@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
44 lines • 2.21 kB
TypeScript
import { type RpcRemoteCheckpoint } from "./rpc-monitor-remote.ts";
import { type RpcEvents, type RpcTarget } from "./rpc-monitor-targets.ts";
import { type RpcRemoteSource } from "./rpc-remote-source.ts";
export declare const RPC_RESCAN_MS = 30000;
/** What a restore compares against: each endpoint's host identity and each session's last status. */
export interface RpcMonitorCheckpoint {
readonly hosts: Readonly<Record<string, {
readonly instanceId: string;
readonly generation: string;
}>>;
readonly statuses: Readonly<Record<string, string>>;
/** A remote target's resume position (absent for local targets). */
readonly remote?: RpcRemoteCheckpoint;
}
export interface RpcWatchOptions {
readonly agentDir: string;
readonly target: RpcTarget;
readonly events: RpcEvents;
readonly exclude: readonly string[];
/** Where to look for endpoints; defaults to every endpoint registered under `agentDir`. */
readonly endpoints?: () => Promise<readonly string[]>;
/** Every line this watch reports. */
readonly line: (line: string) => void;
/** The watch's view changed (a host joined, a status moved): persist it. */
readonly checkpoint?: (checkpoint: RpcMonitorCheckpoint) => void;
/** The source serving a remote target; defaults to the one an extension registered. */
readonly remoteSource?: RpcRemoteSource;
/** A restore's saved view: a remote target resumes from its cursor. */
readonly restoredFrom?: RpcMonitorCheckpoint;
/** A remote target's access ended for good: the monitor settles with this summary. */
readonly ended?: (summary: string) => void;
}
export declare class RpcMonitorWatch {
#private;
constructor(options: RpcWatchOptions);
/** Joins every endpoint now; resolves to the arm-time RESULT rows (one per matched session). */
start(): Promise<string[]>;
/** The current checkpoint: host identities and last statuses. */
checkpoint(): RpcMonitorCheckpoint;
/** Lines for what changed between a saved checkpoint and what this watch sees now. */
diffSince(saved: RpcMonitorCheckpoint): string[];
stop(): void;
}
//# sourceMappingURL=rpc-monitor-watch.d.ts.map