feat(providers): add createos sandbox provider#303
Open
pratikbin wants to merge 1 commit into
Open
Conversation
Add a SandboxProvider for the createos (@nodeops-createos/sandbox) VM sandbox control plane, mirroring the existing e2b provider pattern. - src/providers/createos.ts: factory returning a SandboxProvider. create() provisions a sandbox with ingress enabled, curl-installs sandbox-agent, installs the default agents, and starts the server; getUrl() resolves the ingress preview URL for the agent port; pause/kill/destroy/reconnect/ ensureServer map onto the SDK lifecycle (reconnect resumes paused boxes and maps NotFound -> SandboxDestroyedError). - package.json: ./createos subpath export + optional peerDep/devDep on @nodeops-createos/sandbox. - tsup.config.ts: new entry + external. - tests/createos.test.ts: drives the real SDK through a mocked fetch to assert wire behavior (install/server command strings, ingress URL, lifecycle endpoints). - tests/providers.test.ts: registry entry, gated on CREATEOS_API_KEY. - examples/createos: runnable example mirroring examples/e2b. Verified live against the production control plane: provision, /v1/health, a Claude Code session on the haiku model, and teardown. Note: pnpm-lock.yaml is intentionally not included; adding the dep regenerates 1400+ lines of unrelated transitive bumps from preexisting drift in the committed lock. Run `pnpm install` to refresh it locally.
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.
What
Adds a
SandboxProviderfor the createos (@nodeops-createos/sandbox) VM sandbox control plane, sosandbox-agentcan provision and drive coding agents on createos sandboxes — the same way it already supports e2b, daytona, modal, vercel, cloudflare, etc.Modeled on the existing e2b provider (closest analogue: remote API sandbox → curl-install sandbox-agent → start server → expose via host URL).
Changes
sdks/typescript/src/providers/createos.tscreateos(opts)factory returningSandboxProvider.sdks/typescript/package.json./createossubpath export + optional peerDep/devDep@nodeops-createos/sandbox.sdks/typescript/tsup.config.tsexternal.sdks/typescript/tests/createos.test.tsfetch.sdks/typescript/tests/providers.test.tsCREATEOS_API_KEY.examples/createos/examples/e2b.Provider behavior
ingress_enabled: true, then runs (each viabash -lc, PATH-exported):curl …/install.sh,sandbox-agent install-agent {claude,codex},sandbox-agent server --port 3000.reconnectresumes paused sandboxes and mapsCreateosSandboxNotFoundError→SandboxDestroyedError.ensureServeris idempotent (duplicate server exits on port conflict).s-1vcpu-1gb(createos requires a shape — override viashape/create), cwd/root, agent port3000, https ingress scheme.Testing
Unit (
tests/createos.test.ts) — drives the real@nodeops-createos/sandboxSDK through a mockedfetch(its documented test seam). 6/6 pass. Asserts: create issues the right install/server command strings with ingress enabled;getUrlbuilds the ingress URL and PATCHessetIngresswhen off; destroy/pause hit the right endpoints; ensureServer restarts the server.Live — verified end-to-end against the production control plane (
api.sb.createos.sh):```
/v1/health -> 200 {"status":"ok"}
session model=haiku # "Set model to haiku (claude-haiku-4-5-20251001)"
prompt done: {"stopReason":"end_turn", ...}
```
Provision → install agent → ingress reachable → Claude Code session on haiku → prompt round-trip → teardown, all green.
Gates: SDK build ✅ · typecheck ✅ · biome ✅ · example typecheck ✅.
Notes for reviewer
pnpm-lock.yamlintentionally omitted. Adding the dep regenerates 1400+ lines of unrelated transitive bumps (preexisting drift between the committed lock and the registry). Run `pnpm install` to refresh the lock.baseUrlrequired on@nodeops-createos/sandbox@0.6.0. The production default (https://api.sb.createos.sh) is a newer unreleased SDK commit; on 0.6.0, passclient.baseUrlor setCREATEOS_SANDBOX_BASE_URL. The example/test do this.