/** * @fileoverview Tool invocation orchestration. * * Given a resolved tool and parsed args, this validates availability and * capability gates, resolves input, parses options against the tool schema, * executes, and writes output. All Textavia errors map to stable exit codes. */ import { type TextaviaToolDefinition, type ToolExecutionContext, type ToolRegistry } from '@textavia/core'; import type { ParsedArgs } from './argv.js'; import { type PromptFn } from './input.js'; /** Injectable process surface so the CLI is testable without globals. */ export interface ProcessSurface { readonly cwd: string; readonly stdin: NodeJS.ReadableStream; readonly stdout: NodeJS.WritableStream; readonly stderr: NodeJS.WritableStream; } /** Parameters for a single tool invocation. */ export interface InvocationParams { readonly registry: ToolRegistry; readonly tool: TextaviaToolDefinition; readonly parsed: ParsedArgs; readonly positionalInput?: string; readonly mode: ToolExecutionContext['mode']; readonly proc: ProcessSurface; readonly prompt?: PromptFn; readonly startedAt: number; readonly allowNetwork: boolean; readonly allowUnsafe: boolean; readonly configDefaults?: Readonly>; } /** Runs a single tool invocation end to end and returns the process exit code. */ export declare function executeTool(params: InvocationParams): Promise; export declare function assertCapabilityGates(tool: TextaviaToolDefinition, allowNetwork: boolean, _allowUnsafe: boolean): void; //# sourceMappingURL=execute.d.ts.map