/** * [WHO]: PrintModeOptions, PrintModeResult, formatPrintLoopResult(), collectPrintAssistantText(), runPrintMode() * [FROM]: Depends on ai, agent-core, core/runtime/agent-session * [TO]: Consumed by modes/index.ts, main.ts, print mode tests * [HERE]: modes/print-mode.ts - non-interactive batch processing mode */ import type { AgentRunResult } from "@catui/agent-core"; import type { ImageContent, Message } from "@catui/ai/types"; import type { AgentSession } from "../core/runtime/agent-session.js"; /** * Options for print mode. */ export interface PrintModeOptions { /** Output mode: "text" for final response only, "json" for all events */ mode: "text" | "json"; /** Array of additional prompts to send after initialMessage */ messages?: string[]; /** First message to send (may contain @file content) */ initialMessage?: string; /** Images to attach to the initial message */ initialImages?: ImageContent[]; /** In text mode, emit the final agent loop result as one JSON line on stderr */ printLoopResult?: boolean; /** Exit non-zero when the final agent loop result is an error. */ failOnAgentError?: boolean; /** Exit non-zero when the final agent loop result includes tool permission denials. */ failOnToolDenial?: boolean; } export interface PrintModeResult { exitCode: number; } export declare function formatPrintLoopResult(result: AgentRunResult | undefined): string | undefined; export declare function collectPrintAssistantText(messages: Message[], result?: AgentRunResult): string[]; /** * Run in print (single-shot) mode. * Sends prompts to the agent and outputs the result. */ export declare function runPrintMode(session: AgentSession, options: PrintModeOptions): Promise;