@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
53 lines • 2.09 kB
TypeScript
import type { ImageContent } from "@earendil-works/pi-ai";
import type { HistoryReducer } from "./session-history-reduce.ts";
import type { SessionEntry } from "./session-manager.ts";
export declare const HELD_INPUT_ENTRY = "held-input";
export declare const HELD_INPUT_WITHDRAWN_ENTRY = "held-input-withdrawn";
export declare const HELD_INPUTS_CONSUMED_ENTRY = "held-inputs-consumed";
export interface HeldInput {
readonly inputId: string;
readonly revision: number;
readonly text: string;
readonly images?: ImageContent[];
/** A person's input held before preparation: its commands, skills and templates run when it is delivered. */
readonly prepare?: true;
readonly entryId: string;
}
export type HoldInputResult = {
readonly kind: "held";
readonly entryId: string;
readonly duplicate: boolean;
} | {
readonly kind: "already_delivered";
readonly revision: number;
} | {
readonly kind: "input_id_conflict";
readonly heldRevision: number;
};
/** The held-input entries of the whole history, read without keeping a full-history view (senpi#2537). */
export declare const heldInputHistory: HistoryReducer<SessionEntry[]>;
type HeldInputData = {
inputId: string;
revision: number;
text: string;
images?: ImageContent[];
prepare?: true;
};
/**
* Human input stored while a run-owned hold keeps it from starting a turn (senpi#3811). Idempotent by
* input id: the same id and revision is one entry, the same id with another revision is refused, so a
* guidance record replayed after a crash is never delivered twice and never silently replaced.
*/
export declare class HeldInputs {
private readonly inputs;
private readonly settled;
private readonly append;
constructor(entries: readonly SessionEntry[], append: (customType: string, data: unknown) => string);
hold(input: HeldInputData): HoldInputResult;
withdraw(inputId: string): boolean;
pending(): HeldInput[];
consume(inputIds: readonly string[]): void;
private settle;
}
export {};
//# sourceMappingURL=held-inputs.d.ts.map