import type { FlexibleSchema } from "ai"; import type { Approval } from "#approval/definition.js"; import type { InternalToolDefinition, InternalToolLabelDefinition, ToolExecuteOptions } from "#tools/definition.js"; import type { JsonValue } from "#shared/json.js"; import type { PreparedToolBehavior } from "#tools/behavior.js"; /** * Unified harness-owned tool definition. */ export interface HarnessToolDefinition { readonly availableInSubagents?: boolean; readonly label?: InternalToolLabelDefinition; readonly approvalKey?: (toolInput: Readonly>) => string; readonly behavior?: PreparedToolBehavior; /** Kept out of the model's tool list; the model reaches it through `eve__search` and `eve__tool`. */ readonly deferred?: boolean; readonly description: string; /** A successful call ends the turn without a final reply; see `ToolDefinition.endsTurn`. */ readonly endsTurn?: InternalToolDefinition["endsTurn"]; readonly execute?: (input: any, options: ToolExecuteOptions) => any; /** Optional JSON input substituted when this tool starts its workflow body. */ readonly executeInput?: (input: unknown) => JsonValue; readonly frameworkTool?: boolean; readonly frameworkAction?: "task-cancel" | "task-wait"; readonly inputSchema: FlexibleSchema; readonly name: string; readonly approval?: Approval; readonly outputSchema?: FlexibleSchema; /** * Advertise this tool only to the root session, hiding it from subagent * sessions. Set on the injected `agent` self-delegation tool so children * cannot delegate recursively. Absent means visible everywhere. */ readonly rootOnly?: boolean; readonly toModelOutput?: (output: unknown) => unknown; /** Present when this tool starts an associated durable workflow. */ readonly workflowId?: string; }