2d5af16b05
<!-- CURSOR_SUMMARY --> > [!NOTE] > Introduce `connect` methods to attach to running PTY sessions across JS and Python SDKs, with tests and default timeout handling. > > - **SDKs**: > - **JS (`packages/js-sdk/src/sandbox/commands/pty.ts`)**: > - Add `Pty.connect(pid, opts?)` to attach to running PTYs; accepts `PtyConnectOpts` with `onData`, `timeoutMs`, and `requestTimeoutMs`. > - Factor default PTY connection timeout via `defaultPtyConnectionTimeout` and apply to `create`/`connect` calls. > - **Python**: > - Async: Add `AsyncSandbox.pty.connect(pid, on_data, timeout?, request_timeout?)` in `e2b/sandbox_async/commands/pty.py`. > - Sync: Add `sandbox.pty.connect(pid, timeout?, request_timeout?)` in `e2b/sandbox_sync/commands/pty.py`. > - **Tests**: > - JS: `packages/js-sdk/tests/sandbox/pty/ptyConnect.test.ts` validates connect/reconnect and output handling. > - Python: async and sync tests under `packages/python-sdk/tests/.../pty/test_pty_connect.py` verify reconnection and exit codes. > - **Release**: > - Changeset: minor version bumps for `@e2b/python-sdk` and `e2b`; note “added option to connect to a running pty session”. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 539c4f518606544dfcef253df5bde49354fe7903. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Mish <10400064+mishushakov@users.noreply.github.com>