Skip to content

Add TypeScript SDK for TensorLake Sandboxes#583

Open
diptanu wants to merge 7 commits intomainfrom
typescript-sdk
Open

Add TypeScript SDK for TensorLake Sandboxes#583
diptanu wants to merge 7 commits intomainfrom
typescript-sdk

Conversation

@diptanu
Copy link
Copy Markdown
Contributor

@diptanu diptanu commented Mar 20, 2026

Summary

  • Adds a zero-dependency TypeScript/Node.js 18+ SDK (@tensorlakeai/tensorlake) in typescript/ that mirrors the Python sandbox SDK
  • SandboxClient — lifecycle management (create/get/list/delete sandboxes, pools, snapshots, claim from pool, createAndConnect)
  • Sandbox — interactive operations (run commands, process management, file read/write/delete, SSE streaming, PTY session URLs, health/info)
  • Full error hierarchy matching Python SDK (SandboxNotFoundError, PoolInUseError, RemoteAPIError, etc.)
  • Internal HTTP client with retry on 429/502/503/504, exponential backoff, and proper error mapping
  • Dual ESM/CJS build via tsup with TypeScript declarations
  • 60 unit tests (URL resolution, SSE parsing, HTTP retry/error mapping, client CRUD, sandbox operations)
  • Integration test suite against cloud API (sandbox lifecycle, commands, file ops, pool lifecycle, warm containers, timeout behavior)
  • GHA workflow for integration tests (typescript_sdk.yaml) — runs on push to main + manual dispatch with dev/prod environment selection
  • GHA workflow for npm publish (publish_npm.yaml) — manual dispatch, builds/tests then publishes with provenance

CI prerequisites

  • @tensorlakeai npm org must exist on npmjs.com
  • Create npm GitHub environment with NPM_TOKEN secret
  • prod/dev environments already have TENSORLAKE_API_URL and TENSORLAKE_API_KEY (shared with Document AI tests)

Test plan

  • npm run typecheck — no type errors
  • npm run build — dual ESM/CJS output compiles
  • npm test — 60 unit tests pass
  • npm run test:integration — run against cloud with API key to validate end-to-end

🤖 Generated with Claude Code

diptanu and others added 7 commits April 3, 2026 09:41
Zero-dependency TypeScript/Node.js 18+ SDK that mirrors the Python
sandbox SDK. Includes SandboxClient (lifecycle/CRUD), Sandbox
(process management, file ops, SSE streaming), full error hierarchy,
and dual ESM/CJS build via tsup.

Adds GHA workflows for integration tests against cloud and npm publish.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add pull_request trigger and consolidate the two integration jobs into
one that runs on PRs, pushes to main, and manual dispatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sandboxes suspend (not terminate) on timeout regardless of whether they are
named. Suspended sandboxes have no terminal outcome, so the assertion is now
conditional on the actual final status.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants