@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
36 lines • 1.82 kB
TypeScript
/** The codemode extension's kernel registry key (kernel-registry.ts publishes under it). */
export declare const KERNEL_REGISTRY_KEY: unique symbol;
/** One kernel's memory as the host reports it: every consumer renders this same shape. */
export interface HostKernelMemoryRow {
readonly sessionId: string;
readonly language: string;
readonly liveBytes: number;
readonly measure: string;
}
/**
* The registry's full listing, kept by the report; the RPC row is a projection of it. The listing
* names `lastLiveBytes` (the wire field) and never fabricates `liveBytes`; the row projection maps
* it, reporting 0 between readings.
*/
export interface HostKernelListing {
readonly id: string;
readonly sessionId: string;
readonly language: string;
readonly measure: string;
readonly lastLiveBytes?: number;
/** A cell was running: `lastLiveBytes` is the last reading, not what the kernel holds now. */
readonly stale: boolean;
readonly pid?: number;
}
/** The registry's full listing, validated once here; `busy` maps to `stale` at the boundary. */
export declare function readCodemodeKernelListings(): readonly HostKernelListing[];
/**
* One row per live kernel for the RPC surface; a kernel between readings lists `liveBytes: 0`
* rather than a guess, and a kernel that crashed is absent from the next listing.
*/
export declare function readCodemodeKernelRows(): readonly HostKernelMemoryRow[];
/** Main-thread heap in bytes: `bun:jsc heapSize()` when the runtime offers it, else `heapUsed`. */
export declare function readMainThreadHeapBytes(): number;
/** `bun:jsc` answers synchronously on Bun and is absent on Node, where the figure is omitted. */
export declare function jscHeapSizeOnBun(): number | undefined;
//# sourceMappingURL=kernel-registry-read.d.ts.map