import { type FabricExecutionTraceOperationHandle, type FabricExecutionTraceRecorder } from "../audit/trace.js"; import { type FabricActionDescriptor, type FabricInvocationActivityUpdate, type FabricInvocationContext, type FabricMediaBlock, type FabricProvider, type FabricProviderListRequest } from "../protocol.js"; import type { FabricNestedToolResultProxy } from "./tool-result-proxy.js"; export interface ResolvedFabricAction extends FabricActionDescriptor { ref: string; provider: string; } export interface FabricCallAudit { ref: string; nestedToolCallId: string; startedAt: number; endedAt?: number; success?: boolean; error?: string; resultChars?: number; resultTruncated?: boolean; tool?: string; provider?: string; args?: Record; result?: unknown; media?: FabricMediaBlock[]; mediaNote?: string; preview?: unknown; } export type FabricRegistryActivityEvent = { type: "call_start"; callId: string; ref: string; args: Record; } | { type: "call_update"; callId: string; update: FabricInvocationActivityUpdate; } | { type: "call_end"; callId: string; success: boolean; result?: unknown; preview?: unknown; error?: string; }; export interface FabricRegistryInvocationContext extends FabricInvocationContext { authorize?(action: ResolvedFabricAction): Promise; approve(action: ResolvedFabricAction): Promise; audits: FabricCallAudit[]; maxResultChars: number; trace?: FabricExecutionTraceRecorder; traceOperation?: FabricExecutionTraceOperationHandle; observeInvocation?(event: FabricRegistryActivityEvent): void; } /** * Prefix pi-fabric prepends to every nested tool-call id it generates inside a * fabric_exec run (one per pi., mcp., or agents. invocation). Extensions can * detect that a tool_call/tool_result event came from a nested fabric call — * rather than a top-level call the LLM made directly — by checking * `event.toolCallId.startsWith(NESTED_TOOL_CALL_ID_PREFIX)`. The LLM's own * tool-call ids (e.g. openai "call_…", anthropic "toolu_…") never use this * prefix, so the signal is unambiguous. */ export declare const NESTED_TOOL_CALL_ID_PREFIX = "fabric_"; export declare class ActionRegistry { #private; readonly toolResultProxy?: FabricNestedToolResultProxy | undefined; constructor(toolResultProxy?: FabricNestedToolResultProxy | undefined); register(provider: FabricProvider, options?: { overwrite?: boolean; }): void; has(name: string): boolean; unregister(name: string): FabricProvider | undefined; providers(): Array<{ name: string; description: string; }>; list(request: FabricProviderListRequest & { provider?: string; }, context: FabricInvocationContext): Promise; search(query: string, context: FabricInvocationContext, limit?: number): Promise; describe(ref: string, context: FabricInvocationContext): Promise; invoke(ref: string, args: Record, context: FabricRegistryInvocationContext): Promise; endInvocation(parentToolCallId: string): Promise; close(excludedProviderNames?: Set): Promise; } //# sourceMappingURL=action-registry.d.ts.map