@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
16 lines • 992 B
TypeScript
/**
* Carries a value from a session to the session that replaces it (senpi#4051).
*
* `newSession()` retires the old extension generation before the replacement starts, so a captured `pi` cannot emit
* after the switch, and emitting before it would report a switch that `session_before_switch` may still cancel. The
* builtin factory outlives both generations in one process, so the value waits here, keyed by the session being
* replaced, until the replacement's `session_start` takes it through its own live `pi`. The holder releases its key
* once `newSession()` settles, so a cancelled or failed switch delivers nothing.
*/
export interface ReplacementRelay<T> {
hold(previousSessionFile: string | undefined, value: T): void;
take(previousSessionFile: string | undefined): T | undefined;
release(previousSessionFile: string | undefined): void;
}
export declare function createReplacementRelay<T>(): ReplacementRelay<T>;
//# sourceMappingURL=replacement-relay.d.ts.map