UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

50 lines • 3.02 kB
import type { HandoffCueKind } from "../prompt-preset/contract.ts"; import type { TodoAsk, TodoItem, TodoPhase } from "./todo-types.ts"; export type AskNowNext = { ask: string; now: string; next: string; }; /** * The three handoff anchors of a todo state: the captured user request, the task in * progress, and the first pending task after it in phase order (it may sit in an earlier * phase after an out-of-order start). Task labels are verbatim. */ export declare function describeAskNowNext(state: { phases: readonly TodoPhase[]; ask?: TodoAsk; }): AskNowNext; /** The todo transitions at which the user is owed a handoff block (the prompts' `## Handoff` moments). */ export type HandoffMoment = "list-created" | "phase-closed" | "all-closed"; /** * Which handoff moment a successful mutation produced, if any: the list was just created, the * last open task of a phase closed, or the last open task of the whole list closed. The result * carries the cue right before the model writes its next text, where a system-prompt rule alone * proved unreliable on weaker models (senpi#2121 real-surface QA). A list of one task is no * multi-step work: the first-turn opener makes a question such a list, and its reply is the answer * itself, so it reaches no moment (senpi#3323). */ export declare function handoffMomentOf(before: readonly TodoPhase[], after: readonly TodoPhase[], createsList: boolean): HandoffMoment | undefined; export declare const HANDOFF_CUES: Readonly<Record<HandoffMoment, string>>; /** * The labels of the handoff block every GPT block preset renders (gpt-5.5, gpt-5.6, gpt-6-astra; * the gpt-6.2 core inherits it until its rewrite lands). The cue names these labels - the prompt * itself carries the full template, so the cue does not repeat it - and a test pins the labels * against the rendered presets. */ export declare const GPT_HANDOFF_LABELS = "Outcome so far / You need / Now / Next"; export declare const GPT_HANDOFF_CUES: Readonly<Record<HandoffMoment, string>>; /** * The cue line appended to a todo result, or nothing when no handoff moment was reached or the * active preset defines no handoff block to cue (senpi#6977). */ export declare function formatHandoffCue(moment: HandoffMoment | undefined, kind?: HandoffCueKind): string; /** `Ask:` / `Now:` / `Next:` lines plus a blank separator line. */ export declare function formatAskNowNextHeader(phases: readonly TodoPhase[], ask: TodoAsk | undefined): string; export declare function formatSummary(phases: readonly TodoPhase[], errors: readonly string[], readOnly?: boolean, ask?: TodoAsk): string; export declare function sanitizeTodoText(text: string): string; export declare function isTerminalTodoStatus(status: string): boolean; export declare function isIncompleteTodo(todo: TodoItem): boolean; export declare function getTodoMarker(status: string): string; export declare function getTodoResultLines(phases: readonly TodoPhase[]): string[]; //# sourceMappingURL=todo-format.d.ts.map