@sema-agent/core
Version:
Stateless, task-oriented AI agent core
25 lines (24 loc) • 1.81 kB
TypeScript
/**
* What a paused run waits on, named for the person who reads a resume's sentence — ONE reading of the parked row, by the
* kind of pause it is, for every resume sentence that says what is still waiting or what never started: an approval, a
* question's answer, a plan review, a paused run's continuation, a review, or a finished task waiting to be woken (which
* has no approval at all). A sentence that has no row in hand names the paused run, never a guessed kind.
*/
import type { Checkpoint } from "./checkpoint-store.js";
/** The words one kind of pause is said in. */
export interface ParkNoun {
/** What is still waiting, as the subject of a sentence: "the approval request", "the finished task", … */
readonly waiting: string;
/** What to do to carry on: "resume it again", "wake it again". */
readonly again: string;
/** What never started when a resumed leg ended early: "the approved action", "the wake", … */
readonly started: string;
/** What the person gave that the resume redeems, for "the same …" and "a fresh …": "approval", "answer", "wake", … */
readonly grant: string;
}
/** The words for the pause `row` holds — a question's row (the engine's own question to a person) by its origin word, every
* other row by its pending action's kind; a row this engine does not know the kind of reads as {@link UNKNOWN_KIND}. */
export declare function parkNounOf(row: Pick<Checkpoint, "pendingAction"> | undefined): ParkNoun;
/** THE sentence of a resume cancelled before anything ran (`checkpoint.resume_aborted`): when it was cancelled, that nothing
* ran and the pause still waits, and what to do to carry on. */
export declare function resumeCancelledSentence(when: string, row: Pick<Checkpoint, "pendingAction"> | undefined): string;