Overview
Handle for controlling and monitoring a terminal created viacreateTerminal.
Provides methods to:
- Get current output without waiting
- Wait for command completion
- Kill the running command
- Release terminal resources
release() when done with the terminal to free resources.
The terminal supports async disposal via Symbol.asyncDispose for automatic cleanup. You can use await using to ensure the terminal is automatically released when it goes out of scope.
Constructor
AgentSideConnection.createTerminal() instead.
string
required
The terminal ID
string
required
The session ID this terminal belongs to
Connection
required
The underlying connection object
Properties
id
ToolCallContent with type “terminal” to embed the terminal in tool calls.
Methods
currentOutput
TerminalOutputResponse
The current terminal output and exit status (if available)
waitForExit
WaitForTerminalExitResponse
The exit status of the terminal command
kill
- Get the final output with
currentOutput() - Check the exit status
- Release the terminal when done
KillTerminalResponse
An empty object on success
release
ReleaseTerminalResponse | void
An empty object on success
[Symbol.asyncDispose]
await using syntax for automatic cleanup:
Promise<void>
A promise that resolves when the terminal has been released