Class: PtyFramedInteractiveSession
Defined in: node/src/executors/internal/pty-framed-session.ts:40
Stateful ECHO-disabled OS pseudo-terminal session managing framed turn-based CLI communication (local.daemon.interact).
Spawns the interactive command inside a real node-pty pseudo-terminal (xterm-256color, 120x40) with terminal ECHO disabled (stty -echo), drains the initial startup banner until frameDelimiter matches and output settles for idleSettleMs, and serializes concurrent turns via PQueue({ concurrency: 1 }).
Constructors
Constructor
new PtyFramedInteractiveSession(options): PtyFramedInteractiveSession;Defined in: node/src/executors/internal/pty-framed-session.ts:75
Initializes a PtyFramedInteractiveSession with its command and framing configuration.
Pre-compiles the frame delimiter regular expression when configured as a regex descriptor.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | PtyFramedSessionOptions | Interactive command, delimiter, settle, and timeout options. |
Returns
PtyFramedInteractiveSession
Methods
close()
close(): Promise<void>;Defined in: node/src/executors/internal/pty-framed-session.ts:116
Terminates the underlying node-pty pseudo-terminal and its descendant process tree.
Disposes PTY listeners, kills the PTY master/child, and reaps any surviving descendants via pidtree + fkill.
Returns
Promise<void>
Resolves once the interactive PTY process tree has exited.
sendTurn()
sendTurn(input, signal?): Promise<string>;Defined in: node/src/executors/internal/pty-framed-session.ts:99
Enqueues and executes a single serialized interactive turn on the PTY session via PQueue.
Lazily spawns the PTY process and drains its startup banner on the first turn, writes ${input}\n, and resolves once frameDelimiter matches and output settles for idleSettleMs.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | Command line input to send to the interactive PTY process. |
signal? | AbortSignal | Optional abort signal cancelling the turn. |
Returns
Promise<string>
Settled output frame with the trailing prompt delimiter stripped.
Throws
If signal aborts, the PTY process exits prematurely, or the turn times out.