import type { PendingToolCallData } from '../types'; /** * Keys in `toolCallArguments` whose value is the actual command/query/script * body — anything that should be rendered as the tool's "title" line in the * approval card. Order matters: first match wins. */ export declare const COMMAND_BODY_ARG_KEYS: readonly ["command", "query", "script", "scriptContent", "code"]; /** * Resolve the human-readable title/preview line for a tool call. * Order: command/query/script/scriptContent/code arg → title → name → fallback. * * Shape-agnostic so both the approval card (`PendingToolCallData`: * `toolCallArguments`/`toolName`) and the execution card (`ToolExecutionData`: * `parameters`/`toolFunction`) can share one source of truth. */ export declare function getToolCallTitle(opts: { args?: Record | null; title?: string | null; name?: string | null; }): string; /** * Extract a human-readable command string from a batch tool call. * Thin adapter over {@link getToolCallTitle}. */ export declare function getCommandText(call: PendingToolCallData): string; /** * The raw command/query/script body only (first {@link COMMAND_BODY_ARG_KEYS} * match), with no title/name fallback. Used by the CLIENT (Fae) card to show * the command in the expanded body once the collapsed line switches to the * human-readable `toolExplanation`. */ export declare function getCommandBody(args?: Record | null): string | undefined; export type FormattedArgValue = { kind: 'inline'; text: string; } | { kind: 'block'; text: string; language: 'json' | 'text'; }; /** * Entry point for {@link expandJson}: readable pretty-print where multi-line * string fields (script bodies, command output, …) are shown with real line * breaks instead of literal `\n`. */ export declare function expandedJsonStringify(value: unknown): string; /** * Decide how to render a single `toolCallArguments` value: * - objects/arrays → pretty-printed JSON block * - strings that parse as JSON → pretty-printed JSON block * - multi-line or long strings → preserved-whitespace text block * - everything else → inline single line */ export declare function formatToolArgValue(value: unknown): FormattedArgValue; /** * Decide how to render a tool execution `result` string. * - Strips a single surrounding markdown code fence (``` … ```), since the * backend often wraps Bash/PowerShell output that way. * - If the body parses as JSON, returns a pretty-printed JSON block. * - If the body is multi-line / long, returns a preserved-whitespace block. * - Otherwise inline. */ export declare function formatToolResult(value: string | undefined | null): FormattedArgValue; //# sourceMappingURL=tool-call-helpers.d.ts.map