UNPKG

@code-yeongyu/senpi

Version:

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

32 lines • 1.59 kB
/** * Finds the handoff block (`Ask: ... - wanted: ... For you: ... Now: ... Next: ...`, or the GPT * presets' `... You need: ... Now: ... Next: ...`) in an assistant text so the transcript can fold * its bookkeeping into one muted line (senpi#3323). The labels stay English by prompt contract * (`HANDOFF_LANGUAGE_RULE`), so they are matched literally; the slot contents are any language. */ export type TextSegment = { readonly kind: "text"; readonly text: string; }; export type HandoffSegment = { readonly kind: "handoff"; /** The block exactly as written, shown when the fold is open. */ readonly block: string; /** * What the reader needs, kept in the transcript as answer text: the `For you:` slot, or for the GPT * shape the leading outcome followed by the `You need:` slot. */ readonly answer: string | undefined; readonly now: string | undefined; readonly next: string | undefined; }; export type AssistantTextSegment = TextSegment | HandoffSegment; /** * Splits an assistant text into prose and handoff blocks. A block is one paragraph (blank-line * separated) whose labels are exactly `Ask:` [`wanted:`] `For you:` `Now:` `Next:`, or an outcome * sentence followed by exactly `You need:` `Now:` `Next:`; a paragraph inside a code fence never counts. * Text with no block comes back as one text segment. A block still streaming stays text until its * `Next:` arrives, then folds. */ export declare function splitHandoffBlocks(text: string): readonly AssistantTextSegment[]; //# sourceMappingURL=handoff-fold.d.ts.map