@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
25 lines • 1.07 kB
TypeScript
import type { RpcClient } from "./rpc-client.ts";
/** Routing handles last one host epoch; keep a durable id or path across parking and handoff. */
export type SessionRef = string;
export type SessionRow = Awaited<ReturnType<RpcClient["listSessions"]>>[number];
/**
* Where a reference points. `parked` is a session the host no longer lists (idle park, handoff)
* whose transcript still exists; `open_session { sessionPath }` resumes it.
*/
export type ResolvedSessionRef = {
readonly kind: "live";
readonly row: SessionRow;
} | {
readonly kind: "parked";
readonly sessionPath: string;
readonly cwd: string;
readonly durableSessionId: string;
} | {
readonly kind: "ambiguous";
readonly candidates: readonly string[];
} | {
readonly kind: "unknown";
};
/** Resolve anew on every invocation: a durable session can have a new routing handle. */
export declare function resolveSessionRef(client: Pick<RpcClient, "listSessions">, ref: SessionRef, agentDir: string): Promise<ResolvedSessionRef>;
//# sourceMappingURL=host-session-ref.d.ts.map