APIs

Studio runs

Execute a workspace, turn samples into tests, and promote a snapshot. Project setup is on Studio projects.

Run

MethodPathPurpose
POST/studio/workspaces/{id}/runRun the entrypoint against the active sample. Optional live_io: true
POST…/run-scratchRun against inline content without saving a sample
POST…/run-allRun every sample; per-sample status, no history
GET…/runs, GET …/runs/diffHistory and a diff of two runs
POST…/runs/{id}/pinPin a baseline
PUT…/run-retentionCap history
DELETE…/runsClear history

A run returns status (ok, error, timeout, unsupported_runtime), output (your result.message), annotations (logs, line-bound when a line is known), and duration_ms.

curl -s -X POST "$SIRIUS/studio/workspaces/$WS/run" \
  -H 'content-type: application/json' \
  -d '{"tenant_id":"default"}' | jq '{status, duration_ms, output}'

curl -s -X POST "$SIRIUS/studio/workspaces/$WS/run-scratch" \
  -H 'content-type: application/json' -d '{
    "tenant_id":"default",
    "content":"{\"id\":\"scratch\"}",
    "content_type":"json"
  }'

Scripts have no host filesystem or network and a hard timeout. A hung script returns timeout. Connector calls are simulated unless Live I/O is on and a matching connector is wired.

Tests

MethodPathPurpose
POST…/samples/{id}/expectationSet the expected result.message
POST…/samples/{id}/capture-expectationApprove current output
POST…/testRun every test sample
GET…/coverageSamples still missing an expectation
GET…/test-report/exportPortable report
POST/studio/workspaces/test-report/compareCompare two reports
curl -s -X POST "$SIRIUS/studio/workspaces/$WS/test" \
  -H 'content-type: application/json' \
  -d '{"tenant_id":"default"}' | jq '{total, passed, failed, errored}'

Comparison is JSON-normalized (2 matches 2.0) and stable across language packs.

Milestones

MethodPathPurpose
POST/studio/workspaces/{id}/milestonesPromote (label, note, require_tests_pass, capture_baseline)
GET…/milestones, …/milestones/diffList and file-level changelog
POST…/milestones/{id}/restoreRoll the files back
POST…/milestones/{id}/driftDetect drift from the snapshot
GET / POST…/milestones/export, /studio/milestones/verify-bundleSigned release bundles
curl -s -X POST "$SIRIUS/studio/workspaces/$WS/milestones" \
  -H 'content-type: application/json' -d '{
    "tenant_id":"default",
    "label":"v1.0",
    "note":"first release",
    "require_tests_pass":true,
    "capture_baseline":true
  }'

require_tests_pass: true refuses the promotion with HTTP 422 and the failing report.

Runtime packs

Set the language with POST /studio/workspaces/{id}/runtime-pack.

PackEngine
javascriptIn-process JS sandbox (default)
typescriptTranspiled to JS
pythonPythonic dialect (not a full CPython stdlib)
luaIn-process Lua VM
goInterpreted Go with a curated stdlib
tclIn-process Tcl
wasmWASI module
rust, java, c, cppCompile to WASM with a local toolchain

Tenant environment variables (the /env API) are injected on every run. Read them with sirius.env.get(name). Keys named table:<id> seed lookup tables.

WASM build

MethodPathPurpose
POST/studio/wasm/buildCompile source to a WASI module. Local toolchain only. Content-addressed cache.
POST/studio/wasm/warmPre-compile in the background

language is go, tinygo, rust, java, c, or cpp. The response includes module (base64), digest, cache_hit, and available_languages. save=true plus a workspace and path persists the module as a binary entrypoint. Missing toolchains return 503 build_unavailable.

SQL console

MethodPathPermission
GET/studio/sql/connectorsstudio:read
POST/studio/sql/querystudio:write

Statements run against a configured connector id, never a raw DSN. Reads return columns, rows, row_count, truncated, truncated_by, bytes, elapsed_ms, and driver. Ceilings: 200 rows by default (max 1000) and 8 MiB. Writes commit and are irreversible.

Four queries run at a time per tenant. Past that you get 429 too_many_queries with Retry-After: 1 and the statement does not run, so retrying a write is safe.

The same capability exists inside a transform via sirius.db.query / sirius.db.exec / sirius.db.ping.

Collaboration and terminal

  • Presence: GET /studio/workspaces/{id}/collab/presence
  • Editing: ticket from POST …/collab/ticket, then GET /studio/collab/ws. Viewers cannot mutate.
  • Terminal: ticket from POST …/terminal/ticket, then GET /studio/terminal/ws. Human-only; off in the hardened image.
  • Git clone: POST /studio/workspaces/{id}/git/clone (studio:terminal). Shallow, SSRF-guarded, imports the tree as project files.