@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
38 lines • 1.45 kB
TypeScript
import type { RpcResponse } from "./rpc-types.ts";
/**
* `open` says an engine of this host holds the session now, so a caller knows whether it is reopening or attaching.
* One exception: a hosted session that names no file cannot be matched to a file, so its file on disk is answered
* with `open: false`. `open` is a hint; the id is what a caller checks.
*/
export type FindSessionAnswer = {
readonly found: {
readonly sessionPath: string;
readonly cwd: string;
readonly open: boolean;
};
} | {
readonly ambiguous: true;
} | {
readonly unknown: true;
};
/** One live session as the host lists it; only its durable id, file and folder are read. */
export interface HostedSession {
readonly durableSessionId?: string | undefined;
readonly sessionPath?: string | undefined;
readonly cwd?: string | undefined;
}
export interface FindSessionOptions {
readonly agentDir: string;
readonly durableSessionId: string;
readonly hosted: readonly HostedSession[];
}
export interface FindSessionPort {
readonly agentDir: string | undefined;
hosted(): readonly HostedSession[];
}
/** The RPC face: it decides nothing itself beyond the request's shape and this host's own folder. */
export declare function findSession(port: FindSessionPort, command: {
readonly id?: string;
readonly durableSessionId?: unknown;
}): Promise<RpcResponse>;
//# sourceMappingURL=find-session.d.ts.map