@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
25 lines • 1.41 kB
TypeScript
/**
* The run step of exec_command, write_stdin, wait_for_command and kill_terminal (the relay host's `terminal-ops.ts`,
* ported onto the engine's terminals). Each answers the relay host's shapes: TerminalResult (lastSeq, totalBytes byte
* offsets), and the kill result {handleId, state: "task-failed", reason: "killed", lifecycle}. An unknown handle fails
* unknown_handle; a last_seq older than the retained output fails replay_gap naming the retained offset.
*/
import { type After } from "./live-handle.ts";
import type { MachineTerminals } from "./machine-terminals.ts";
import type { ExecArgs, KillArgs, WaitArgs, WriteStdinArgs } from "./terminal-args.ts";
import type { OpOutcome } from "./wire.ts";
export interface TerminalRun {
readonly sender: string;
readonly root: string;
readonly confined: boolean;
readonly signal: AbortSignal;
readonly envOverlay: Readonly<Record<string, string>>;
}
export declare const createTerminalOps: (terminals: MachineTerminals, after: After) => {
execCommand: (d: ExecArgs, call: TerminalRun) => Promise<OpOutcome>;
writeStdin: (d: WriteStdinArgs, call: TerminalRun) => Promise<OpOutcome>;
waitForCommand: (d: WaitArgs, call: TerminalRun) => Promise<OpOutcome>;
killTerminal: (d: KillArgs) => Promise<OpOutcome>;
};
export type TerminalOps = ReturnType<typeof createTerminalOps>;
//# sourceMappingURL=terminal-ops.d.ts.map