/** * Projects action and tool results into model context without discarding their * text, errors, structured data, or earlier results. Size warnings remain * diagnostic only: model/provider boundaries must reject unsupported request * sizes explicitly instead of silently changing the prompt. */ import type { ActionResult } from "../types/components.js"; export declare const ACTION_RESULT_OVERSIZE_WARNING_TOKENS = 10000; export type ActionResultTextField = "text" | "error"; export interface ActionResultSizeWarning { actionName: string; field: ActionResultTextField; rawCharLength: number; estimatedTokens: number; thresholdTokens: number; } export interface ActionResultReferences { text?: string; error?: string; } export declare function estimateActionResultTokens(text: string): number; /** * The action name for an executed result, resolved from the fields producers * actually set. `data.actionName` is canonical; `data.action` is its documented * sibling on multi-op actions (LINEAR, BROWSER, MANAGE_PLUGINS), and executors * also attach the name at the top level. Falling back to "Unknown Action" while * a real name is present loses the action from chain summaries and prompt * formatting, so every carrier is consulted before that default. */ export declare function getActionResultActionName(result: ActionResult): string; export declare function collectActionResultSizeWarnings(result: ActionResult, thresholdTokens?: number): ActionResultSizeWarning[]; export declare function trimActionResultForPromptState(result: T, references?: ActionResultReferences): T;