/** * Reliability Session Bridge — adapters that connect the Reliability Kernel to * a live agent session's tool hooks. * * The bridge is provider-independent and side-effect free until attached. It * provides: * * - createToolSchemaValidator(): adapts real AgentTool[] to the kernel's * ToolSchemaValidator (schema enforcement via validateToolArguments). * - createActionPolicyAdapter(): adapts a workspace root + forbidden-action * set to the kernel's ActionPolicyAdapter (boundary + denylist checks). * - ReliabilitySessionBridge: wraps beforeToolCall/afterToolCall/agentEnd so * a session gains action validation, evidence recording, and a completion * gate without a separate agent implementation. */ import type { AgentTool } from "@apholdings/jensen-agent-core"; import { type ActionPolicyAdapter, type ToolSchemaValidator } from "./action-validator.js"; import type { MissionRuntime } from "./mission-runtime.js"; import type { MissionEvidence, ToolCallAction } from "./types.js"; export declare function createToolSchemaValidator(tools: readonly AgentTool[]): ToolSchemaValidator; export interface ActionPolicyAdapterOptions { workspaceRoot?: string; /** Tool names that are forbidden for this mission. */ forbiddenTools?: readonly string[]; /** When true, tools that write the workspace are blocked. */ readOnly?: boolean; } /** * Lexical boundary/denylist policy. The full realpath boundary is enforced by * the tool executor itself; this adapter rejects obviously-escaping absolute * paths and `..` segments deterministically before execution. */ export declare function createActionPolicyAdapter(options?: ActionPolicyAdapterOptions): ActionPolicyAdapter; export interface ReliabilityBridgeHooks { /** Called with observed tool evidence after a validated execution. */ onToolExecuted?(evidence: MissionEvidence): void; /** Called when the agent ends a turn (implicit or explicit final candidate). */ onAgentEnd?(): void; } /** * Bridge between a live agent session and the Reliability Kernel. * * beforeToolCall decodes + validates the model's raw tool call and blocks * invalid actions. afterToolCall records observed evidence. agentEnd proposes a * final candidate and runs the completion gate. */ export declare class ReliabilitySessionBridge { readonly runtime: MissionRuntime; private readonly schema; private readonly policy; constructor(runtime: MissionRuntime, schema: ToolSchemaValidator, policy: ActionPolicyAdapter); /** beforeToolCall handler — block invalid tool calls before execution. */ beforeToolCall(toolCall: ToolCallAction): Promise<{ block: boolean; reason?: string; }>; /** afterToolCall handler — record observed tool outcome as evidence. */ afterToolCall(toolCall: ToolCallAction, isError: boolean, summary?: string): void; /** agentEnd handler — propose a final candidate and run the completion gate. */ onAgentEnd(): ReturnType; } //# sourceMappingURL=integration.d.ts.map