@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
28 lines • 1.4 kB
TypeScript
/**
* Live delivery (senpi#4074): while a session is open in an interactive or RPC process, that process
* fires the session's own due jobs and steers them into the running turn (or starts a turn when idle).
* Runners keep deferring while the session is open, so the live holder is the only writer then.
*
* It reuses the runner's pass (`runDueJobs` scoped to this session): the same session lock, claim
* rename, re-arm-before-delivery and settle. One timer is armed for the earliest due time; a create or
* cancel from the tool and any change in `pending/` re-plan it, so nothing polls.
*/
import type { ExtensionAPI } from "../../types.ts";
/** One-shot timer for the next pass; `fire` resolves when that pass has finished. */
export interface LiveTimerPort {
arm(delayMs: number, fire: () => Promise<void>): void;
cancel(): void;
}
export declare function createNodeLiveTimer(): LiveTimerPort;
export interface LiveDeliveryDeps {
readonly now: () => number;
readonly timer: () => LiveTimerPort;
}
export interface LiveDelivery {
/** Whether this process delivers the current session's jobs itself. */
isLive(): boolean;
/** Run a pass now and re-arm the timer; passes are serialized. */
replan(): Promise<void>;
}
export declare function registerLiveDelivery(pi: ExtensionAPI, deps: LiveDeliveryDeps): LiveDelivery;
//# sourceMappingURL=live-delivery.d.ts.map