import type { AgentTool } from '@earendil-works/pi-agent-core'; import { type GoalEvidenceContext } from '../../../core/goal-evidence.js'; import type { ToolDef } from '../../../core/llm/provider-base.js'; import type { ToolDispatcher } from '../../../core/llm/tool-dispatcher.js'; export interface ToolBridgeApprovalCtx { runId: string; platform: string; channelId: string; threadId: string; userId: string; } export interface ToolBridgeOptions { /** Forwarded into ToolDispatcherContext so dispatchers can correlate audit * rows back to the originating turn. */ traceId?: string; /** agim's parallel-safe verdict per tool name (read-only tools may run * concurrently). Defaults to sequential — the safe choice for mutating / * stateful tools. */ parallelSafe?: (toolName: string) => boolean; /** Active goal snapshot captured for this turn. */ goalEvidence?: GoalEvidenceContext; /** Dynamic lookup supports long_task followed by tools in the same run. */ resolveGoalEvidence?: () => GoalEvidenceContext | null; /** Fail closed for mutations when goal state cannot be read. */ goalLedgerAvailable?: () => boolean; /** * IM/web identity for escalating unconfined `agim_exec` (no bwrap) to an * explicit approval card while a versioned goal is active. */ approvalCtx?: ToolBridgeApprovalCtx; /** Test seam — overrides the default confirmUnconfinedGoalExec helper. */ confirmUnconfinedExec?: (args: Record, signal?: AbortSignal) => Promise<'allow' | 'deny'>; } /** Wrap one agim ToolDef + the shared dispatcher into a pi AgentTool. */ export declare function agimToolToPi(def: ToolDef, dispatch: ToolDispatcher, opts?: ToolBridgeOptions): AgentTool; /** Bridge a whole agim tool surface at once. */ export declare function agimToolsToPi(tools: ToolDef[], dispatch: ToolDispatcher, opts?: ToolBridgeOptions): AgentTool[]; //# sourceMappingURL=tool-bridge.d.ts.map