/** * src/core/formatting.ts — pure output/feedback formatting. No fs, no @earendil-works/*. */ import type { ChildResult } from "./types.js"; export interface BlockedFeedbackDiagnostics { executionPerformed: false; currentMode: string; reasonCode: string; retryPolicy: string; safeNextAction: string; } export interface FileToolPreflightFeedbackDiagnostics { executionPerformed: false; toolName: string; reasonCode: string; field: string; pathHash: string; inputHash: string; snapshotHash: string; fingerprintHash: string; retryPolicy: string; safeNextActions: readonly string[]; telemetryRecorded: boolean; deduplicated: boolean; attemptCount: number; unchangedRetryCount: number; } /** Build a "blocked" feedback message for a blocked tool call. */ export declare function blockedFeedback(toolName: string, reason: string, attempted: string, diagnostics?: BlockedFeedbackDiagnostics): string; /** Build a body-free file-tool preflight blocked message. */ export declare function fileToolPreflightFeedback(diagnostics: FileToolPreflightFeedbackDiagnostics): string; /** Cap output to a byte limit, truncating safely on UTF-8 boundaries. */ export declare function capOutput(output: string, limit?: number): string; /** * F4: actionable message surfaced wherever a `provider_quota` failure kind * appears (result text, run views). Provider-side usage/rate limits are * retryable by waiting or switching model — say so explicitly. */ export declare const PROVIDER_QUOTA_MESSAGE = "Provider quota/rate limit reached \u2014 retry later or switch model."; /** Render a child result into a readable human/machine summary. */ export declare function formatChildResultText(result: ChildResult): string;