@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
43 lines • 2.03 kB
TypeScript
/**
* The remote half of an rpc watch: one `RpcRemoteSource` subscription for a `<device>/<session>` or
* `<device>/*` target. Records go through the watch's own render path with the device in the socket's
* place, so a remote line reads exactly like a local one. A resync after a gap reports each change once,
* a turn end is reported once per `turnId`, and the source's cursor rides the monitor checkpoint.
*/
import type { RpcRecord } from "./rpc-monitor-observer.ts";
import { type RpcMonitorRenderer } from "./rpc-monitor-render.ts";
import type { RpcEvents } from "./rpc-monitor-targets.ts";
import type { RpcRemoteSource, RpcRemoteTarget } from "./rpc-remote-source.ts";
/** What a remote watch persists: the source's resume cursor and the turns already reported per session. */
export interface RpcRemoteCheckpoint {
readonly cursor?: string;
readonly settled: Readonly<Record<string, readonly string[]>>;
}
export interface RpcRemoteFeedHost {
readonly renderer: RpcMonitorRenderer;
readonly hosts: Map<string, {
instanceId: string;
generation: string;
}>;
record(socket: string, record: RpcRecord): void;
line(line: string): void;
checkpoint(): void;
ended(summary: string): void;
}
export interface RpcRemoteFeedOptions {
readonly events: RpcEvents;
readonly exclude: readonly string[];
readonly source: RpcRemoteSource;
readonly saved?: RpcRemoteCheckpoint;
}
export declare class RpcRemoteFeed {
#private;
constructor(target: RpcRemoteTarget, options: RpcRemoteFeedOptions, host: RpcRemoteFeedHost);
/** Opens the subscription; resolves to the arm-time rows. Callbacks before the open resolves wait for it. */
start(): Promise<string[]>;
stop(): void;
checkpoint(): RpcRemoteCheckpoint;
/** After a restore: the turns that settled while nothing watched, which the saved checkpoint had not seen. */
diffSettled(saved: RpcRemoteCheckpoint | undefined): string[];
}
//# sourceMappingURL=rpc-monitor-remote.d.ts.map