feat(sdk/typescript): @deeplethe/forkd v0.3.1 — TS SDK with surface parity (closes #115)#121
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #115 (item 3 of meta #112). Distribution track.
What ships
sdk/typescript/— new workspace member; ESM, Node 18+, no runtime deps (global fetch).Controllerclass 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.Sandboxwrapper mirroring E2B/Daytona patterns:Sandbox.create,.exec,.eval,.ping,.branch,.kill,.with(opts, fn)for auto-cleanup.ControllerErrorcarriesstatus,body,urlfor HTTP failure inspection.branchSandbox+spawnSandboxesleapfrog the Python SDK by exposing v0.3'sdiff,measure_diff, andprewarmoptions. Follow-up PR will back-port to the Python side.Tests
9 vitest unit tests, all green:
diff: trueoption pass-throughControllerErroron 4xxFORKD_URLenv defaultDELETEempty bodyCI / publish
.github/workflows/ci-typescript.yml— Node 18/20/22 matrix, runs on PRs touchingsdk/typescript/.github/workflows/publish-npm.yml— fires onts-v*tag push, publishes@deeplethe/forkdto npm with OIDC provenance. NeedsNPM_TOKENsecret in thenpmenvironment.Scoped npm name (
@deeplethe/forkd) sinceforkdon npm is taken.After merge
NPM_TOKENin the repo'snpmenvironmentgit tag ts-v0.3.1 && git push origin ts-v0.3.1to publishFollow-ups (not in this PR)
diff/prewarm/measure_diffto Python SDK (currently behind daemon API)