import type { AgentWorkContract } from "../../features/agent-work-contracts/types.js"; /** * Dependencies for the tool-before-guard transform (AC-18). * * Injected at composition time from plugin.ts: * - toolGuardHook: the tool.execute.before guard (toolGuardHooks["tool.execute.before"]) * - sessionTracker: SessionTracker instance for proactive child discovery * - logWarn: optional logging callback * - contractEnforcement: optional deps for contract enforcement (Plan 06 wires these) */ export interface ToolBeforeGuardDeps { toolGuardHook: (input: unknown, output: unknown) => Promise; sessionTracker: { handleToolExecuteBefore(params: { sessionID: string; callID: string; subagentType: string; description: string; taskId?: string; tool?: string; }): Promise; }; logWarn?: (message: string, error: unknown) => void; /** Optional contract enforcement deps. When provided, contract enforcement is added as third step. */ contractEnforcement?: { getActiveContractByAgent: (projectRoot: string, agentName: string) => AgentWorkContract | undefined; resolveAgentName: (sessionID: string) => string | undefined; projectRoot: string; }; } /** * Extracted hook handler for tool.execute.before (AC-18). * * Runs the tool guard FIRST (circuit breaker, budget, governance), then * detects task tool dispatch for proactive child session discovery. * Best-effort: session-tracker errors are caught and logged — never block * tool execution or throw to the OpenCode runtime. * * Mirror of the original inline handler from plugin.ts (lines 194-235). * * @param deps - Typed dependencies injected from plugin.ts at composition time. * @returns An async function that receives (input, output) for tool.execute.before. */ export declare function createToolBeforeGuard(deps: ToolBeforeGuardDeps): (input: unknown, output: unknown) => Promise; //# sourceMappingURL=tool-before-guard.d.ts.map