@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
20 lines • 1.6 kB
TypeScript
import type { PresenterAccountAuthority } from "./modes/rpc/mcp-presenter-account.ts";
/**
* How an embedding distribution hands the RPC host its `PresenterAccountAuthority` (D11, senpi#4249).
*
* The distribution's entry calls `registerPresenterAccountAuthority` before it loads the CLI; `main()` calls
* `takePresenterAccountAuthority` as its first statement, which seals the slot whether or not anything was registered.
* From then on no code (an extension, a session, a later import) can fill or replace it. The slot is process-global
* (`Symbol.for`) because a bundled run hands off to a runtime-snapshot COPY of the engine: a module-local variable would
* not be the one that copy reads. Its value is a frozen pair of functions with the state in this closure, so it cannot be
* written directly. This module has no other imports, so a distribution can load it without evaluating the engine.
*/
export type PresenterAuthorityRegistrationRefusal = "presenter_authority_already_registered" | "presenter_authority_sealed";
/**
* @public package entry `@code-yeongyu/senpi/presenter-authority`, called by an embedding distribution before it loads
* the CLI. Throws once a registration exists or main() has started.
*/
export declare function registerPresenterAccountAuthority(authority: PresenterAccountAuthority): void;
/** Seals the slot and returns its authority; later calls return the same value. Called first thing by `main()`. */
export declare function takePresenterAccountAuthority(): PresenterAccountAuthority | undefined;
//# sourceMappingURL=presenter-authority-slot.d.ts.map