/** * Plain-language wording for shell task observations (`wait`) and cancellations (`kill`). * * One source of truth for two audiences: the model reads compact sentences in the tool result text, and the * transcript renders the same facts as a single status line. Structured data stays in the result `details`. */ import type { CancelError, CancelReceipt, Cleanup, Failure, OutputError, TaskResult, WaitError, WaitOutcome, WatchError } from "../tasks/contracts.js"; export type TaskStatusTone = "success" | "error" | "warning" | "dim"; /** One line of task state: `✓ completed · exit 0`. The glyph and label alone carry the meaning without color. */ export interface TaskStatus { glyph: "✓" | "✗" | "●" | "○"; tone: TaskStatusTone; label: string; detail?: string; } export declare const EMPTY_OUTPUT_TEXT = "(no output)"; export declare function taskResultStatus(result: TaskResult): TaskStatus; /** Status line for a `wait` result. `hasOutput` says whether any output is shown below it. */ export declare function waitStatus(observation: WaitOutcome, hasOutput: boolean): TaskStatus; export interface WaitResultTail { observation: WaitOutcome; truncated: boolean; fullOutputPath?: string; } /** * Everything the model reads after a wait's output: the truncation marker, one sentence with the task's state and * exit code, and the path of the full output when it was truncated. The renderer strips the same tail. */ export declare function waitResultTail({ observation, truncated, fullOutputPath }: WaitResultTail): string; /** Model-facing text of a `kill` result. The receipt itself stays in the result details. */ export declare function cancelReceiptSentence(receipt: CancelReceipt): string; /** Status line for a `kill` result, describing the task rather than the request. */ export declare function cancelReceiptStatus(receipt: CancelReceipt): TaskStatus; /** The first resource that could not be cleaned up, for a status line; undefined when cleanup did not fail. */ export declare function cleanupFailureSummary(cleanup: Cleanup): string | undefined; export type TaskToolFailureCode = WaitError["code"] | CancelError["code"] | OutputError["code"] | WatchError["code"]; /** * A task failure on the `wait`/`kill` path. The message is `: `; * callers that branch on the failure read `code` instead of parsing it. */ export declare class TaskToolError extends Error { readonly code: TaskToolFailureCode; readonly taskId: string; constructor(failure: Failure, taskId: string); } export interface TaskErrorPresentation { headline: string; hint?: string; } /** How the transcript presents the text of a thrown {@link TaskToolError}; undefined for any other error text. */ export declare function presentTaskError(text: string, taskId: string | undefined): TaskErrorPresentation | undefined; //# sourceMappingURL=shell-task-status.d.ts.map