@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
27 lines • 1.75 kB
TypeScript
import type { SendMessageItem, SendMessageReceipt } from "./extensions/types.ts";
import type { CustomMessage } from "./messages.ts";
type BatchMessage = Pick<CustomMessage, "customType" | "content" | "display" | "details">;
/**
* How one admitted itemized batch reports back from the delivery path (senpi#3811 design 4.5): the entry its
* message was written to, a write that failed, or an abort that dropped it before admission so it is decided again.
*/
export interface ItemizedAdmission {
readonly persisted: (entryId: string) => void;
readonly failed: (error: unknown) => void;
readonly droppedByAbort: () => void;
/** The batch's item ids, so a re-send of a queued ticket can be checked against what will be written (senpi#4106). */
readonly itemIds?: readonly string[];
}
/** What waits on a queued itemized message: the entry it is written to, or the write's failure. */
export type PersistWatcher = Pick<ItemizedAdmission, "persisted" | "failed" | "itemIds">;
/** A queued itemized message that `clearQueue` removed before it was written: none of its items were delivered. */
export declare class QueuedDeliveryCleared extends Error {
readonly itemIds: readonly string[];
constructor(itemIds?: readonly string[]);
}
/** The notice an item is stored as when its batch is held: its own payload and details, never the whole batch's. */
export declare function itemNoticeMessage(message: BatchMessage, item: SendMessageItem): CustomMessage;
/** One `message_persisted` receipt per item: the batch was delivered as the one message in `entryId`. */
export declare function deliveredReceipts(items: readonly SendMessageItem[], entryId: string): SendMessageReceipt[];
export {};
//# sourceMappingURL=itemized-send.d.ts.map