Skip to content

feat(sdk): bootstrap SDK + sandbox packages with runtime state machine#79

Closed
dgarson wants to merge 1 commit intodgarson/forkfrom
feat/sdk-dev-sandbox
Closed

feat(sdk): bootstrap SDK + sandbox packages with runtime state machine#79
dgarson wants to merge 1 commit intodgarson/forkfrom
feat/sdk-dev-sandbox

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Feb 22, 2026

Summary

Bootstrap SDK and sandbox packages for bs-tim-6 (OpenClaw SDK + Local Dev Sandbox).

Changes

@openclaw/sdk:

  • Typed client library with ToolClient, SessionClient, ResourceClient
  • Error types: ValidationError, TransportError, AuthError, ToolRuntimeError, SandboxUnavailableError
  • Result envelope helpers (ok(), err())
  • Health check and request/response handling

@openclaw/sandbox:

  • Local sandbox runtime with lifecycle state machine
  • States: idlestartingreadybusy → (ready | terminating)
  • Error state: failed → (ready | terminal)
  • Event streaming for state changes, execution events
  • Lifecycle callbacks (onReady, onStateChange, onExecutionStart, etc.)

Tests

  • 28 tests for sandbox state machine and basic lifecycle
  • 12 tests for SDK client initialization and error handling

Package Structure

packages/
  sdk/
    src/
      index.ts, client.ts, types.ts
    test/
  sandbox/
    src/
      index.ts, runtime.ts, state-machine.ts, types.ts
    test/

Notes

  • Phase 1 scaffolding - runtime spawns mock process for now
  • Phase 2 will implement actual sandbox process bootstrap
  • Coordinated with Sandy on package boundaries per spec
  • cli package deferred to later phase

Refs: bs-tim-6

This commit adds the initial package scaffolding for bs-tim-6:

- @openclaw/sdk: typed client library with ToolClient, SessionClient,
  ResourceClient, and error types
- @openclaw/sandbox: local sandbox runtime with lifecycle state machine
  (idle -> starting -> ready -> busy -> terminating/failed)

Packages include:
- package.json, tsconfig, vitest config
- Core type definitions
- Runtime implementation with event streaming
- Unit tests for state machine and basic lifecycle

Coordinated with Sandy on package boundaries per spec.

Refs: bs-tim-6
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