UNPKG

@code-yeongyu/senpi

Version:

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

45 lines • 2.36 kB
/** * The per-row detail of a status report: the sessions a host listed and the session-path claims its * endpoint's `reservations/` directory holds. * * Both are parsed here from what the host and the directory SAY, at the boundary, so the report * carries typed rows and never a raw reply. The listing is the same `list_sessions` reply the counts * are made from; the claims are read from the directory every generation of the endpoint shares, so * a path a draining predecessor still holds is visible even though the answering generation's own * listing no longer names it. */ import type { HostDaemonDirectory } from "./host-daemon-paths.ts"; import type { HostGenerationRow } from "./host-generations.ts"; /** The per-session heap split a host published on its listing (senpi#1960); zeros when none was published. */ export interface HostSessionRowMemory { readonly main_heap_mb: number; readonly kernel_heap_mb: number; readonly kernel_count: number; } /** One session the host listed, with the canonical path a client matches it by. */ export interface HostSessionRow { readonly id: string; readonly kind: string; readonly session_path: string | null; readonly cwd: string | null; readonly name: string | null; readonly attachments: number; /** The labels published on a worker listing; `null` when the host published none. */ readonly context: Readonly<Record<string, string>> | null; /** The heap split the host published; `{0,0,0}` for a pre-field host. */ readonly memory: HostSessionRowMemory; } /** One session-path claim, whichever generation of the endpoint wrote it. */ export interface HostPathClaimRow { readonly session_path: string; readonly owner_pid: number; readonly instance_id: string; /** The owner generation's ordinal, `null` once its generation record is gone. */ readonly generation: number | null; /** Whether the owner had a client attached when it last published; `null` for a pre-flag claim. */ readonly attached: boolean | null; readonly live: boolean; } export declare function parseSessionRows(reply: unknown): readonly HostSessionRow[]; export declare function readClaimRows(paths: HostDaemonDirectory, generations: readonly HostGenerationRow[]): Promise<readonly HostPathClaimRow[]>; //# sourceMappingURL=host-status-rows.d.ts.map