Skip to content

feat(providers): add createos sandbox provider#303

Open
pratikbin wants to merge 1 commit into
rivet-dev:mainfrom
NodeOps-app:feat/createos-provider
Open

feat(providers): add createos sandbox provider#303
pratikbin wants to merge 1 commit into
rivet-dev:mainfrom
NodeOps-app:feat/createos-provider

Conversation

@pratikbin

Copy link
Copy Markdown

What

Adds a SandboxProvider for the createos (@nodeops-createos/sandbox) VM sandbox control plane, so sandbox-agent can 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

File Change
sdks/typescript/src/providers/createos.ts New. createos(opts) factory returning SandboxProvider.
sdks/typescript/package.json ./createos subpath export + optional peerDep/devDep @nodeops-createos/sandbox.
sdks/typescript/tsup.config.ts New build entry + external.
sdks/typescript/tests/createos.test.ts New. Unit test: real SDK driven through a mocked fetch.
sdks/typescript/tests/providers.test.ts Registry entry, gated on CREATEOS_API_KEY.
examples/createos/ New. Runnable example mirroring examples/e2b.

Provider behavior

  • create() — provisions a sandbox with ingress_enabled: true, then runs (each via bash -lc, PATH-exported): curl …/install.sh, sandbox-agent install-agent {claude,codex}, sandbox-agent server --port 3000.
  • getUrl() — returns the ingress preview URL for the agent port; enables ingress first if it was off.
  • pause / kill / destroy / reconnect / ensureServer — mapped onto the SDK lifecycle. reconnect resumes paused sandboxes and maps CreateosSandboxNotFoundErrorSandboxDestroyedError. ensureServer is idempotent (duplicate server exits on port conflict).
  • Defaults: shape s-1vcpu-1gb (createos requires a shape — override via shape/create), cwd /root, agent port 3000, https ingress scheme.

Testing

Unit (tests/createos.test.ts) — drives the real @nodeops-createos/sandbox SDK through a mocked fetch (its documented test seam). 6/6 pass. Asserts: create issues the right install/server command strings with ingress enabled; getUrl builds the ingress URL and PATCHes setIngress when 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.yaml intentionally 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.
  • baseUrl required 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, pass client.baseUrl or set CREATEOS_SANDBOX_BASE_URL. The example/test do this.

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.
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.

1 participant