/** * HITL Request Tool Module - Built-in tool for generic human-in-the-loop input * * Purpose: * - Expose a built-in `human_intervention_request` tool that lets the model ask questions and offer options. * * Key Features: * - Supports option-only response mode for deterministic user selection. * - Uses existing world-scoped HITL option runtime. * - Returns structured JSON payloads for stable downstream model parsing. * * Implementation Notes: * - Option values are normalized and deduplicated as display labels. * - Free-text path is intentionally disabled to keep HITL interactions simple and auditable. * - Tool execution requires world context; no external side effects beyond HITL events. * * Recent Changes: * - 2026-03-06: Removed `world.currentChatId` fallback from HITL approval routing; interactive requests now require explicit `context.chatId`. * - 2026-02-28: Added shorthand default-option resolution so values like "No" can map to a single matching option label. * - 2026-02-27: Removed built-in post-selection confirmation stage and removed deprecated confirmation parameters from the tool contract. * - 2026-02-20: Removed free-text mode from `human_intervention_request`; tool now enforces options-only interactions. * - 2026-02-20: Added initial built-in `human_intervention_request` tool implementation. */ import { type World } from './types.js'; type HitlRequestToolArgs = { question?: unknown; options?: unknown; timeoutMs?: unknown; defaultOption?: unknown; metadata?: unknown; }; type HitlRequestToolContext = { world?: World; chatId?: string | null; agentName?: string | null; toolCallId?: string; }; export declare function createHitlToolDefinition(): { description: string; parameters: { type: string; properties: { question: { type: string; description: string; }; options: { type: string; items: { type: string; }; description: string; }; timeoutMs: { type: string; description: string; }; defaultOption: { type: string; description: string; }; metadata: { type: string; description: string; additionalProperties: boolean; }; }; required: string[]; additionalProperties: boolean; }; execute: (rawArgs: HitlRequestToolArgs, _sequenceId?: string, _parentToolCall?: string, context?: HitlRequestToolContext) => Promise; }; export {};