UNPKG

@code-yeongyu/senpi

Version:

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

24 lines • 1.26 kB
/** * `machine_op` answers by op_id (senpi#6752): an op runs once; a repeat gets the first answer, and a repeat that arrives * while the first still runs joins it. `machine_op_result` reads only settled answers, so after its own restart the * relay host can learn how an op ended (and re-sending the same op_id joins one still running). Bounded by count and by * age since settling; an op_id past either bound is unknown again. Each answer is bound to the owner (the sender) that * ran it: `ownerOf` lets the caller refuse another owner's repeat instead of handing it that answer. */ export declare const MACHINE_OP_CACHE_MAX_ENTRIES = 4096; export declare const MACHINE_OP_CACHE_MAX_AGE_MS: number; export declare class MachineOpAnswerCache<T> { private readonly slots; private readonly now; constructor(options?: { readonly now?: () => number; }); get size(): number; settled(opId: string): T | undefined; ownerOf(opId: string): string | undefined; answer(opId: string, owner: string, run: () => Promise<T>): Promise<T>; private expire; /** Settled answers leave oldest first; an op still running is never forgotten (its repeat must join it). */ private trim; } //# sourceMappingURL=answer-cache.d.ts.map