Skip to content

feat(sdk/typescript): @deeplethe/forkd v0.3.1 — TS SDK with surface parity (closes #115)#121

Merged
WaylandYang merged 1 commit into
mainfrom
feat/ts-sdk
May 19, 2026
Merged

feat(sdk/typescript): @deeplethe/forkd v0.3.1 — TS SDK with surface parity (closes #115)#121
WaylandYang merged 1 commit into
mainfrom
feat/ts-sdk

Conversation

@WaylandYang
Copy link
Copy Markdown
Contributor

Closes #115 (item 3 of meta #112). Distribution track.

What ships

  • sdk/typescript/ — new workspace member; ESM, Node 18+, no runtime deps (global fetch).
  • Controller class with full surface parity to the Python SDK: 10 methods covering snapshots, sandboxes, branch, exec, eval, ping. Wire-level stays snake_case; TS-side camelCase.
  • Sandbox wrapper mirroring E2B/Daytona patterns: Sandbox.create, .exec, .eval, .ping, .branch, .kill, .with(opts, fn) for auto-cleanup.
  • ControllerError carries status, body, url for HTTP failure inspection.
  • branchSandbox + spawnSandboxes leapfrog the Python SDK by exposing v0.3's diff, measure_diff, and prewarm options. Follow-up PR will back-port to the Python side.

Tests

9 vitest unit tests, all green:

  • snake_case serialization
  • diff: true option pass-through
  • ControllerError on 4xx
  • bearer-token header
  • FORKD_URL env default
  • DELETE empty body
  • URL encoding of sandbox ids
  • abort-on-timeout

CI / publish

  • .github/workflows/ci-typescript.yml — Node 18/20/22 matrix, runs on PRs touching sdk/typescript/
  • .github/workflows/publish-npm.yml — fires on ts-v* tag push, publishes @deeplethe/forkd to npm with OIDC provenance. Needs NPM_TOKEN secret in the npm environment.

Scoped npm name (@deeplethe/forkd) since forkd on npm is taken.

After merge

  1. Configure NPM_TOKEN in the repo's npm environment
  2. git tag ts-v0.3.1 && git push origin ts-v0.3.1 to publish

Follow-ups (not in this PR)

  • Back-port diff / prewarm / measure_diff to Python SDK (currently behind daemon API)
  • API-key auth helper for managed-cloud scenarios

…rity with Python SDK

Closes #115 (item 3 of meta #112). Distribution track.

What ships:
- sdk/typescript/ — new workspace member; ESM, Node 18+, no
  runtime deps (uses global fetch).
- Controller class with full surface parity to Python SDK:
  listSnapshots, deleteSnapshot, spawnSandboxes, listSandboxes,
  getSandbox, killSandbox, branchSandbox, execCommand, evalCode,
  pingSandbox. Wire-level still snake_case; TS-side camelCase.
- branchSandbox + spawnSandboxes leapfrog the Python SDK by exposing
  v0.3's diff / measure_diff / prewarm options. Follow-up PR will
  back-port to the Python side.
- Sandbox higher-level wrapper (mirrors E2B/Daytona patterns):
  Sandbox.create, .exec, .eval, .ping, .branch, .kill, .with.
- ControllerError carries status + body + url for HTTP failure
  inspection.
- 9 vitest unit tests, all green: snake_case serialization,
  diff option pass-through, ControllerError on 4xx, auth header,
  FORKD_URL env default, DELETE empty body, URL encoding,
  abort-on-timeout.
- README with API table, quick-start, v0.3 fast-BRANCH section,
  error handling, links to forkd-mcp + forkd-action.

CI / publish:
- .github/workflows/ci-typescript.yml — Node 18/20/22 matrix,
  build + test on every PR touching sdk/typescript/.
- .github/workflows/publish-npm.yml — fires on ts-v* tag push,
  publishes @deeplethe/forkd to npm with provenance via OIDC.
  Needs NPM_TOKEN secret in the `npm` environment.

Scoped npm name (@deeplethe/forkd) since `forkd` on npm is taken.
Version 0.3.1 matches the rest of the v0.3 release line.

Not in this PR (follow-ups):
- Back-port diff / prewarm / measure_diff options to Python SDK
  (Python SDK is currently behind the daemon API).
- Add API-key auth helper for managed-cloud scenarios.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@WaylandYang WaylandYang merged commit 95f03f7 into main May 19, 2026
5 checks passed
@WaylandYang WaylandYang deleted the feat/ts-sdk branch May 19, 2026 15:41
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.

TypeScript SDK — surface parity with Python SDK

1 participant