@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
46 lines • 2.02 kB
TypeScript
import type { CustomMessage } from "./messages.ts";
import type { SessionEntry } from "./session-manager.ts";
export type HeldItem = {
readonly source: string;
readonly message: CustomMessage;
readonly item: {
readonly itemId: string;
readonly runRef?: unknown;
};
};
/**
* Durable notice custody. A plain wake keeps only the latest model payload of its source; an itemized notice keeps
* its own payload and is delivered on its own.
*/
export declare class EngineTurnHoldNotices {
private wakes;
private readonly append;
private readonly warn;
constructor(entries: readonly SessionEntry[], append: (type: string, data: unknown) => unknown, warn: (error: unknown) => void);
get sources(): Record<string, number>;
get noticeCount(): number;
noticeText(count?: number, source?: string, stopped?: boolean): string;
note(source: string, pauseSeq: number, message?: CustomMessage, stopped?: boolean): string;
/**
* Store every item of an itemized batch as its own notice, in ONE entry (senpi#3811 design 4.5): the batch is
* admitted all-or-nothing. Unlike `note`, a write that fails throws and keeps no item, so the sender keeps the
* whole batch and a retry duplicates nothing.
*/
noteItems(pauseSeq: number, items: readonly HeldItem[], stopped?: boolean): Array<{
itemId: string;
noticeId: string;
entryId: string;
}>;
messages(): Array<{
source: string;
noticeIds: readonly string[];
message: CustomMessage;
}>;
/** The single held -> released transition. Append before removal; failure retains custody. Returns the consumed ids. */
consume(source: string, pauseSeq: number, deliveredIds?: readonly string[]): string[];
/** Settle the notices no turn delivers: plain wakes of a source that kept no payload. */
consumeNotices(pauseSeq: number): void;
private remember;
private forget;
}
//# sourceMappingURL=engine-turn-hold-notices.d.ts.map