/** * The answer a finished run leaves in the conversation, and how it is told * apart there: `/run`'s, and a step `/quote` puts there. * * The model reads the answer and one line on how the run ended; the person * also sees the run's last frame, which the message carries in its details * for the renderer and never hands to the model. The `subagent` tool and a * flow stage of `/step` tell how a run ended with the same pieces. */ import { type CheckedFlow, type FlowResult, type JournalEntry, type LivePlan } from "../../src/index.ts"; import type { MessageDeps } from "../deps.ts"; import type { CommandCtx } from "../pi.ts"; /** * `customType` of the message a finished run leaves in the session, and of a * step `/quote` puts there. * * A custom message rather than a user one - see `SendMessage` for the three * doors pi offers and why this is the only one that fits. pi converts it to * the **user** role on the way to the model, so the content carries a header * naming what ran: read as something the user typed, an unattributed report * is confusing; read as a quoted result, it is exactly right. The string * predates flows, and stays so the sessions that hold it still draw. */ export declare const RESULT_MESSAGE = "pipeline-result"; /** What a {@link RESULT_MESSAGE} carries beside its text, for the renderer. */ export type ResultDetails = { /** What ran: the flow, or `chain` for a quoted step. */ readonly name: string; /** The steps of a chain, in order. */ readonly steps?: readonly string[]; /** Where the run left its state and its exports. */ readonly runDir?: string; /** The run's last frame, drawn under the answer and never read by the model. */ readonly live?: LivePlan; }; /** * The run's answer, into the conversation: the output of its last root node * and one line on how it ended, for the model and the person alike; and its * last frame, drawn beneath for the person only. */ export declare function answer(ctx: Pick, doors: MessageDeps, checked: CheckedFlow, input: unknown, runDir: string, result: FlowResult): void; /** How a flow run ended, as every launch tells it: its output, one line on how it ended, and its last frame. */ export type FlowAnswer = { readonly output: string; readonly end: string; readonly live: LivePlan; }; /** What the run in `runDir` of `checked` answered, read back from its journal once it ended. */ export declare function flowAnswer(ctx: Pick, checked: CheckedFlow, runDir: string, result: FlowResult): FlowAnswer; /** Where a failed run failed and why: `failed at answer: provider: …`. */ export declare function failure(result: Extract): string; /** What `/run resume` would do with the run in `runDir`, or why it cannot. */ export declare function resumeHint(ctx: Pick, checked: CheckedFlow, journal: readonly JournalEntry[], runDir: string): string; /** `runDir` as the person reads it: from the working directory. */ export declare function shown(ctx: Pick, runDir: string): string; //# sourceMappingURL=answer.d.ts.map