@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
31 lines • 1.8 kB
TypeScript
/**
* `pi.session` as one session binds it: admission and the ledger come from the session's own
* `ExternalAdmission`, the header write from its `SessionManager`, and the control endpoint from
* whichever host the running mode installed. Only the interactive TUI installs one; every other
* mode answers `unsupported` and registers nothing.
*/
import type { RegisterControlEndpointOptions, SessionControlActions, SessionControlRegistration } from "./extensions/session-control-types.ts";
import type { ExternalAdmission } from "./external-admission.ts";
import type { SessionManager } from "./session-manager.ts";
import { type SessionRelocationHost } from "./session-relocation.ts";
export interface ControlEndpointHost {
register(options: RegisterControlEndpointOptions): Promise<SessionControlRegistration>;
}
export interface SessionControlActionDeps {
readonly admission: ExternalAdmission;
readonly sessionManager: SessionManager;
readonly host: () => ControlEndpointHost | undefined;
readonly relocationHost: () => SessionRelocationHost | undefined;
}
/** One extension generation's `pi.session`, which owns the control endpoints that generation registered. */
export interface GenerationSessionControlActions extends SessionControlActions {
/**
* Disposes every endpoint this generation registered. A reload calls it as it retires the
* generation: the endpoint's `drain` is that generation's closure, so it must not outlive it
* (senpi#3246). Idempotent.
*/
retire(): Promise<void>;
}
export declare function createSessionControlActions(deps: SessionControlActionDeps): GenerationSessionControlActions;
export declare function unboundSessionControlActions(): SessionControlActions;
//# sourceMappingURL=session-control-actions.d.ts.map