import { type Static, type TSchema, Type } from "typebox"; import { HerdrCapabilityResolver } from "./capability.js"; import { type HerdrPromptApi } from "./guidance.js"; import { type CommandRunner } from "./process.js"; declare const HerdrWorktreeParameters: Type.TUnion<[Type.TObject<{ operation: Type.TLiteral<"list">; }>, Type.TObject<{ operation: Type.TLiteral<"create">; branch: Type.TString; base: Type.TOptional; path: Type.TOptional; label: Type.TOptional; focus: Type.TOptional; }>, Type.TObject<{ operation: Type.TLiteral<"open">; path: Type.TOptional; branch: Type.TOptional; label: Type.TOptional; focus: Type.TOptional; }>, Type.TObject<{ operation: Type.TLiteral<"remove">; workspace_id: Type.TString; force: Type.TOptional; }>]>; type HerdrWorktreeParameters = Static; type HerdrWorktreeOperation = HerdrWorktreeParameters["operation"]; /** The fields one operation accepts, typed against the schema so the two cannot drift. */ type FieldsOf = keyof Extract & string; interface RequestSchema { readonly required: readonly FieldsOf[]; readonly optional: readonly FieldsOf[]; } export declare const OPERATION_FIELDS: { readonly [K in HerdrWorktreeOperation]: RequestSchema; }; interface TextContent { readonly type: "text"; readonly text: string; } interface ToolResult { readonly content: readonly TextContent[]; readonly details: TDetails; } interface ToolContext { readonly cwd: string; readonly ui?: { confirm(title: string, message: string): Promise; }; } type ToolTier = "read" | "write" | "exec"; type ToolApprovalDecision = ToolTier | { readonly tier: ToolTier; readonly reason?: string; readonly policy?: "allow" | "deny" | "prompt"; }; interface ToolDefinition { readonly name: string; readonly label: string; readonly description: string; readonly parameters: TParameters; readonly approval: ToolApprovalDecision | ((args: unknown) => ToolApprovalDecision); readonly loadMode: "essential" | "discoverable"; readonly concurrency?: "shared" | "exclusive" | ((args: Partial>) => "shared" | "exclusive"); readonly executionMode?: "sequential" | "parallel"; readonly formatApprovalDetails?: (args: unknown) => string | readonly string[] | undefined; execute(toolCallId: string, parameters: Static, signal: AbortSignal | undefined, onUpdate: unknown, context: ToolContext): Promise>; } export interface HerdrExtensionApi extends HerdrPromptApi { registerTool(definition: ToolDefinition): void; } export interface HerdrExtensionDependencies { readonly runner?: CommandRunner; readonly capabilities?: HerdrCapabilityResolver; } export declare function registerHerdrWorktreeTools(pi: HerdrExtensionApi, dependencies?: HerdrExtensionDependencies): void; export {}; //# sourceMappingURL=tools.d.ts.map