UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

30 lines • 1.82 kB
import type { RpcHostResponse } from "./rpc-types.ts"; export interface RelocationChannel { /** The connection that offers relocation for this session right now, or `undefined`. */ offerer(): string | undefined; /** The connection the frame being handled came from. */ current(): string | undefined; /** Delivers a record to `connection` only. `event` keeps it ordered behind the session's buffered events. */ send(connection: string, record: object, kind: "request" | "event"): void; } /** What a shared host lends a session binding; absent on a classic single-connection handler. */ export interface RelocationClientInfo { readonly connectionId: () => string | undefined; readonly relocationConnection?: () => string | undefined; readonly deliverTo?: (connectionId: string, deliver: () => void) => void; } /** * A classic handler has one client, so its own capabilities decide. A shared host names the offering connection from * its per-connection capabilities; a binding the host cannot ask (a worker isolate) offers nothing, which is also * right because `release_session` cannot release such a session. */ export declare function relocationChannel(options: { readonly capabilities: () => readonly string[] | undefined; readonly clientInfo: RelocationClientInfo | undefined; readonly output: (record: object) => void; readonly outputEvent: (record: object) => void; }): RelocationChannel; export type HostResponseOutcome = "answered" | "unknown" | "not_offering_connection"; export declare function answerHostResponse(frame: RpcHostResponse, respond: ((frame: RpcHostResponse) => HostResponseOutcome) | undefined): object; export declare function isHostResponse(value: unknown): value is RpcHostResponse; //# sourceMappingURL=session-relocation-channel.d.ts.map