@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
21 lines • 1.17 kB
TypeScript
/**
* Sends a session's `job_widget_state` at most once per {@link PUBLISH_INTERVAL_MS} and only when
* what a client draws changed: `updatedAtMs` moves with every output line, so it does not count.
* A burst inside the interval collapses into one trailing send of the newest state. Every view is
* redacted here, before it is compared or sent, so nothing a client receives carries a secret.
*/
import type { JobWidgetRedact } from "./author-redact.ts";
import type { JobWidgetState } from "./view-types.ts";
export declare const PUBLISH_INTERVAL_MS = 1000;
export declare class JobWidgetStatePublisher {
#private;
constructor(send: (state: JobWidgetState) => void, redact: JobWidgetRedact);
/** `state` as it may leave the engine: every view string redacted. */
redacted(state: JobWidgetState): JobWidgetState;
/** The newest state; sent now, at the end of the current interval, or not at all when unchanged. */
offer(state: JobWidgetState): void;
/** Forgets what was sent, so the next offer goes out even if unchanged (a new listener needs it). */
reset(): void;
dispose(): void;
}
//# sourceMappingURL=state-publisher.d.ts.map