/** * Print mode (single-shot): Send prompts, output result, exit. * * Used for: * - `pi -p "prompt"` - text output * - `pi --mode json "prompt"` - JSON event stream */ import type { ImageContent } from "@caupulican/pi-ai"; import type { AgentSessionRuntime } from "../core/agent-session-runtime.ts"; /** * Sentinel prefix for the cumulative-usage line emitted to stderr in text print mode under * `--print-usage`. A spawner (subagent extension, auto-learn runner) greps stderr for this prefix * and `JSON.parse`s the remainder ({@link Usage}) to roll the child's cost up via * `pi.reportSpawnedUsage`. See the Cost Aggregation design. */ export declare const PRINT_USAGE_LINE_PREFIX = "__PI_USAGE__"; /** * 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[]; /** * Emit the session's cumulative usage at exit so a spawner can roll this child's cost up. * - text mode: one `__PI_USAGE__` line to stderr (keeps stdout = the answer). * - json mode: a terminal `{type:"result", usage}` event is always emitted regardless of this flag. */ printUsage?: boolean; } /** * Run in print (single-shot) mode. * Sends prompts to the agent and outputs the result. */ export declare function runPrintMode(runtimeHost: AgentSessionRuntime, options: PrintModeOptions): Promise; //# sourceMappingURL=print-mode.d.ts.map