import type { ToolCallEvent, ToolCallEventResult, ToolResultEvent, ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { FabricToolPlacementMode, FabricToolPlacementResultV1 } from "../protocol.js"; import type { ToolLoadout, ToolLoadoutChanges } from "@earendil-works/pi-coding-agent"; export declare const fabricToolLoadout: (loadout: ToolLoadout, exclusive: boolean, foreground?: readonly string[]) => ToolLoadoutChanges | undefined; /** * Answer pi-fabric:tool-placement:v1. `model` mirrors fabricToolLoadout: an * exclusive mode declares only fabric_exec plus resolved foreground tools; * orchestration declares the active set. `program` is the caller's view of * pi.* / extensions.* reachability; `programCallable` lists `model` tools * that a program can also call. */ export declare const fabricToolPlacement: (input: { mode: FabricToolPlacementMode; registered: readonly string[]; active: readonly string[]; program: (name: string) => boolean; tools?: readonly string[]; foreground?: readonly string[]; }) => FabricToolPlacementResultV1; export declare const fabricModelContext: (messages: import("@earendil-works/pi-agent-core").AgentMessage[], tools: Pick | readonly Pick[]) => import("@earendil-works/pi-agent-core").AgentMessage[]; export interface FabricToolOwnershipHost { getActiveTools(): string[]; setActiveTools(names: string[]): void; } export interface FabricTopLevelToolAuthorizer { authorize(ref: string, parentToolCallId: string): Promise; } export interface FabricTopLevelToolApprover { approve(event: ToolCallEvent, context: ExtensionContext): Promise; } export declare const ownsFabricToolSource: (tools: Array<{ name: string; sourceInfo: { path: string; }; }>, extensionEntryPath: string) => boolean; export declare class FabricToolLifecycle { #private; readonly ownsFabricTool: () => boolean; readonly authorizer: () => FabricTopLevelToolAuthorizer | undefined; readonly approver: () => FabricTopLevelToolApprover | undefined; constructor(ownsFabricTool: () => boolean, authorizer: () => FabricTopLevelToolAuthorizer | undefined, approver?: () => FabricTopLevelToolApprover | undefined); toolCall(event: ToolCallEvent, context?: ExtensionContext): Promise; toolResult(event: ToolResultEvent): { isError: true; } | undefined; clear(): void; } export interface ToolOwnershipReassertion { reassert(): void; schedule(): void; } export declare const createToolOwnershipReassertion: (options: { ready: () => boolean; active: () => boolean; hiddenNames: () => ReadonlySet; apply: (hidden: ReadonlySet) => boolean; }) => ToolOwnershipReassertion; export declare class FabricToolOwnership { readonly host: FabricToolOwnershipHost; constructor(host: FabricToolOwnershipHost); apply(fullCodeMode: boolean, _hiddenExtensionTools?: ReadonlySet): boolean; release(): boolean; } //# sourceMappingURL=tool-ownership.d.ts.map