Kind: Class
Source: atloria-monorepo/libs/agent-core/src/tools/bash-session.ts
A persistent shell session that maintains cwd, env vars, and venv activation across commands. Spawns a single bash process and sends commands via stdin, reading output until a unique delimiter marker signals completion.
Methods
| Method | Signature | Returns |
|---|---|---|
start | start() | Promise<void> |
execute | execute(command: string, options: { timeout?: number }) | Promise<BashResult> |
getCwd | getCwd() | string |
isDisposed | isDisposed() | boolean |
isRunning | isRunning() | boolean |
dispose | dispose() | void |
Where it refuses work
BashSessionstops the work withErrorwhenthis.disposed— “BashSession has been disposed”.BashSessionstops the work withErrorwhenthis.disposed || !this.process?.stdin || !this.process?.stdout— “BashSession is not running. Call start() first or session was disposed.”.BashSessionstops the work with an early return whenthis.process.BashSessionstops the work with an early return whensettled.BashSessionstops the work with an early return whenthis.disposed.BashSessionstops the work with an early return whenprocess.env.SHELL.
When something fails
BashSessionhandles failure in 2 places: it discards it silently in all 2.
Was this page helpful?