import type { ExecutionId, ProposalId, SessionEpoch } from './ids.ts'; import type { ToolCall } from './engine.ts'; export type EffectCategory = 'pure-local' | 'external-read' | 'external-write' | 'financial'; export interface JsonSchema { type?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null'; properties?: Record; required?: string[]; items?: JsonSchema; enum?: Array; minimum?: number; maximum?: number; minLength?: number; maxLength?: number; additionalProperties?: boolean; description?: string; } export interface ToolDefinition { name: string; description: string; parameters: JsonSchema; effect: EffectCategory; networkDestinations: string[]; timeoutMs: number; maxOutputBytes: number; idempotency: 'idempotent' | 'at-most-once' | 'non-idempotent'; } export interface ToolExecutionReceipt { proposalId: ProposalId; executionId: ExecutionId; epoch: SessionEpoch; call: ToolCall; status: 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'refused'; startedAt: number; finishedAt?: number; output?: string; error?: string; } export interface ToolAuthorization { proposalId: ProposalId; approved: boolean; arguments: Record; }