/** * extractSequence — derive the in-flight tool-call sequence from * `scope.history` for `PermissionChecker.check()`. * * Pattern: Pure function over conversation history. * Role: Single source of truth — sequence is reconstructed on * demand from `LLMMessage[]` instead of maintained as * parallel state in scope. Survives `agent.resumeOnError` * correctly because the history IS the durable artifact. * Emits: N/A (pure compute). * * The sequence reads the assistant turns' `toolCalls` blocks in order. * Calls that were denied at the gate (synthetic tool_results in history * but no `tool.execute()` invocation) are NOT included — the sequence * reflects what actually dispatched, not what was attempted. * * Detection of "did this call dispatch?" — we look at the matching * `tool` message and check its content. Synthetic deny messages match * a known prefix; everything else is a real dispatch. This pairs the * sender (assistant.toolCalls[i].id) with the receiver (tool.toolCallId). */ import type { LLMMessage, ToolCallEntry } from '../adapters/types.js'; /** Prefix the framework writes on synthetic deny tool_results. Used to * distinguish "denied but in history" from "actually dispatched". */ export declare const SYNTHETIC_DENY_PREFIX = "[permission denied:"; export interface ExtractSequenceOptions { /** * Resolver: tool name → providerId. When the tool was registered via * `staticTools(...)` / `.tool(...)`, returns `'local'` (or the resolver's * choice). When registered via a `discoveryProvider`, returns the * provider's `id`. Lets policies match cross-hub patterns. */ readonly resolveProviderId?: (toolName: string) => string | undefined; } /** * Walk `history` in order, collect each dispatched tool call into the * sequence. Only calls that produced a non-denied tool_result are * included. * * @param history Conversation history at check time. * @param iteration Current ReAct iteration (used to tag the proposed * call's iteration if you append it). * @param options Optional resolver for `providerId`. * @returns The dispatched-call sequence, in chronological order. */ export declare function extractSequence(history: readonly LLMMessage[], iteration: number, options?: ExtractSequenceOptions): ToolCallEntry[]; //# sourceMappingURL=extractSequence.d.ts.map