@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
68 lines • 3.6 kB
TypeScript
import type { BrowserEngine } from "../../core/browser-engine.ts";
import type { PromptSurface } from "../../core/dynamic-prompt/types.ts";
import type { CliRuntimeConfiguration } from "../../main.ts";
import type { RpcConnectionOptions } from "./connection-handler.ts";
import type { RpcSessionBinding } from "./session-binding.ts";
import { SessionAcceptanceLane } from "./session-acceptance-lane.ts";
import type { SessionEventWriter } from "./session-event-writer.ts";
import type { RpcSessionLaunchProfile } from "./session-registry.ts";
import type { WorkerSnapshot } from "./session-worker-protocol.ts";
import { WorkerIntake } from "./session-worker-intake.ts";
import type { SessionWorkerCallbacks } from "./session-worker-callbacks.ts";
import { startSessionWorker } from "./session-worker-start.ts";
export declare class SessionWorkerClient {
private readonly secrets;
private privateBinding?;
private stopPrivateBinding?;
private readonly privateOperations;
/** The worker's own route to the main-thread Bun.WebView service; released when the worker exits. */
private readonly webviewBroker;
private readonly spawned;
readonly worker: ReturnType<typeof startSessionWorker>["result"];
readonly exited: Promise<void>;
snapshot?: WorkerSnapshot;
/** Main marks this only after installing the unique routing binding. */
bindingReady: boolean;
private readonly request;
private readonly requests;
private stopped;
private closeTimer?;
private writer?;
private sessionId?;
private requestClose?;
private options;
private readonly listeners;
private cancelUiPending;
private terminalFailure?;
private stopLimitMirror;
/** The host's ordered acceptance lane for this worker incarnation, present only once `commit()` negotiated it. */
acceptance: SessionAcceptanceLane | undefined;
/** The host half of the negotiated payload transport: permits, physical frame order, fragment staging (S12b). */
intake: WorkerIntake | undefined;
private readonly owners;
private readonly callbacks;
private readonly agentDir;
constructor(callbacks: SessionWorkerCallbacks, agentDir?: string);
prepare(configuration: CliRuntimeConfiguration, profile: RpcSessionLaunchProfile): Promise<string>;
/** Moves the worker's live session to another prompt surface (a later `open_session.promptSurface`). */
setPromptSurface(surface: PromptSurface): Promise<void>;
/** Moves the worker's live session to another browser engine (a later `open_session.browserEngine`). */
setBrowserEngine(engine: BrowserEngine): Promise<void>;
/** Moves the worker's live session to another permission preset (a later `open_session.permissionPreset`). */
setPermissionPreset(preset: string): Promise<void>;
commit(): Promise<WorkerSnapshot>;
bind(sessionId: string, writer: SessionEventWriter, requestClose: () => void, options: Pick<RpcConnectionOptions, "capabilities" | "clientInfo" | "connectionRoles">): Promise<RpcSessionBinding>;
get busy(): boolean;
get handoffBusy(): boolean;
subscribeSettled(listener: () => void): () => void;
/** Deadline requests termination, but only the actual exit callback releases ownership. */
close(graceMs: number): Promise<void>;
quarantine(): void;
private postRetired;
private post;
private receive;
private fail;
/** Terminal close records observe completed registry removal, including worker failure. */
private publishTerminalFailure;
}
//# sourceMappingURL=session-worker-client.d.ts.map