import type { AgentToolErrorCode, ToolExecutionTarget } from "@inupedia/spotlight-protocol"; import { type HostToolEffect } from "./agentRegistry.js"; export interface ToolTraceEvent { phase: "dependency" | "context" | "execution"; source: "executor" | "spotlight_action"; type: "start" | "missing" | "cycle" | "require" | "prerequisites_resolved" | "precondition_failed" | "retry_scheduled" | "retrying" | "recovery_action" | "rollback_applied" | "rollback_failed" | "run_failed" | "done"; tool: string; detail?: string; at: number; elapsedMs: number; } export interface ToolResult { success: boolean; data?: T; error?: string; errorCode?: AgentToolErrorCode; executionTarget?: ToolExecutionTarget; hostEffect?: HostToolEffect; trace: ToolTraceEvent[]; } export type AgentExecutorContext = Record; export type AgentExecutorNavigation = { getContext: () => AgentExecutorContext; ensureMainScene?: () => Promise; ensureMidScene?: () => Promise; ensureSmallScene?: () => Promise; ensureMainTab?: (tab: string) => Promise; ensureSmallTab?: (tab: string) => Promise; }; export type CreateAgentExecutorOptions = AgentExecutorNavigation & { loadTools?: () => Promise; onToolComplete?: (toolName: string, input: unknown, result: ToolResult) => void; }; export declare function createAgentExecutor(options: CreateAgentExecutorOptions): (toolName: string, input: TInput) => Promise>; //# sourceMappingURL=agentExecutor.d.ts.map