import type { WebSearchSelection } from "#shared/web-search.js"; import type { WorkflowToolEntryPoint } from "#tools/workflow-entry-point.js"; /** Session facts that can hide a selected tool without changing source composition. */ export type ToolAvailabilityCondition = "root-session"; /** Native behavior declared by a selected compiled tool. */ export type CompiledToolHandling = { readonly kind: "dispatch"; readonly action: "self-agent"; } | ({ readonly kind: "provider-tool"; } & WebSearchSelection) | { readonly kind: "workflow-tool"; readonly entryPoint: WorkflowToolEntryPoint; readonly workflowId: string; }; /** Closed, serializable behavior carried by one selected compiled tool. */ export interface ToolExecutionShape { readonly suspend: "none" | "workflow"; } export interface CompiledToolBehavior { readonly availability: readonly ToolAvailabilityCondition[]; readonly handling?: CompiledToolHandling; readonly shape?: ToolExecutionShape; } /** Concrete dispatch identity prepared before a tool reaches the harness. */ export type PreparedDispatchTarget = { readonly kind: "remote-agent-call"; readonly nodeId: string; readonly remoteAgentName: string; } | { readonly kind: "self-agent-call"; readonly nodeId: string; readonly subagentName: string; } | { readonly kind: "subagent-call"; readonly nodeId: string; readonly subagentName: string; } | { readonly kind: "workflow-tool-call"; readonly entryPoint: WorkflowToolEntryPoint; readonly workflowId: string; }; /** Runtime-prepared handling consumed by the harness and execution boundary. */ export type PreparedToolHandling = { readonly kind: "dispatch"; readonly target: PreparedDispatchTarget; } | Extract; /** Runtime-prepared behavior carried by one harness-visible tool. */ export interface PreparedToolBehavior { readonly availability: readonly ToolAvailabilityCondition[]; readonly handling?: PreparedToolHandling; } /** Attaches internal behavior without adding a public string-keyed definition field. */ export declare function attachToolBehavior(definition: TDefinition, behavior: CompiledToolBehavior): TDefinition; /** Reads internal behavior from a framework-owned definition. */ export declare function readToolBehavior(value: unknown): CompiledToolBehavior | undefined;