/** * Ask Tool - Interactive user prompting during execution * * Use this tool when you need to ask the user questions during execution. * This allows you to: * 1. Gather user preferences or requirements * 2. Clarify ambiguous instructions * 3. Get decisions on implementation choices as you work * 4. Offer choices to the user about what direction to take * * Usage notes: * - Users will always be able to select "Other" to provide custom text input * - Use multi: true to allow multiple answers to be selected for a question * - Use recommended: to mark the default option; "(Recommended)" suffix is added automatically * - Questions may time out and auto-select the recommended option (configurable, disabled in plan mode) */ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import { type Component } from "@oh-my-pi/pi-tui"; import * as z from "zod/v4"; import type { RenderResultOptions } from "../extensibility/custom-tools/types"; import { type Theme } from "../modes/theme/theme"; import type { ToolSession } from "."; declare const askSchema: z.ZodObject<{ questions: z.ZodArray>; multi: z.ZodOptional; recommended: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export type AskToolInput = z.infer; /** Result for a single question */ export interface QuestionResult { id: string; question: string; options: string[]; multi: boolean; selectedOptions: string[]; customInput?: string; } export interface AskToolDetails { question?: string; options?: string[]; multi?: boolean; selectedOptions?: string[]; customInput?: string; /** Multi-part question mode */ results?: QuestionResult[]; } type AskParams = AskToolInput; /** * Ask tool for interactive user prompting during execution. * * Allows gathering user preferences, clarifying instructions, and getting decisions * on implementation choices as the agent works. */ export declare class AskTool implements AgentTool { #private; private readonly session; readonly name = "ask"; readonly label = "Ask"; readonly summary = "Ask the user a clarifying question"; readonly description: string; readonly parameters: z.ZodObject<{ questions: z.ZodArray>; multi: z.ZodOptional; recommended: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; readonly strict = true; readonly loadMode = "discoverable"; constructor(session: ToolSession); static createIf(session: ToolSession): AskTool | null; execute(_toolCallId: string, params: AskParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, context?: AgentToolContext): Promise>; } interface AskRenderArgs { question?: string; options?: Array<{ label: string; }>; multi?: boolean; questions?: Array<{ id: string; question: string; options: Array<{ label: string; }>; multi?: boolean; }>; } export declare const askToolRenderer: { renderCall(args: AskRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: AskToolDetails; }, _options: RenderResultOptions, uiTheme: Theme): Component; }; export {};