APIs
Studio runs
Execute a workspace, turn samples into tests, and promote a snapshot. Project setup is on Studio projects.
Run
| Method | Path | Purpose |
|---|---|---|
POST | /studio/workspaces/{id}/run | Run the entrypoint against the active sample. Optional live_io: true |
POST | …/run-scratch | Run against inline content without saving a sample |
POST | …/run-all | Run every sample; per-sample status, no history |
GET | …/runs, GET …/runs/diff | History and a diff of two runs |
POST | …/runs/{id}/pin | Pin a baseline |
PUT | …/run-retention | Cap history |
DELETE | …/runs | Clear 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
| Method | Path | Purpose |
|---|---|---|
POST | …/samples/{id}/expectation | Set the expected result.message |
POST | …/samples/{id}/capture-expectation | Approve current output |
POST | …/test | Run every test sample |
GET | …/coverage | Samples still missing an expectation |
GET | …/test-report/export | Portable report |
POST | /studio/workspaces/test-report/compare | Compare 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
| Method | Path | Purpose |
|---|---|---|
POST | /studio/workspaces/{id}/milestones | Promote (label, note, require_tests_pass, capture_baseline) |
GET | …/milestones, …/milestones/diff | List and file-level changelog |
POST | …/milestones/{id}/restore | Roll the files back |
POST | …/milestones/{id}/drift | Detect drift from the snapshot |
GET / POST | …/milestones/export, /studio/milestones/verify-bundle | Signed 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.
| Pack | Engine |
|---|---|
javascript | In-process JS sandbox (default) |
typescript | Transpiled to JS |
python | Pythonic dialect (not a full CPython stdlib) |
lua | In-process Lua VM |
go | Interpreted Go with a curated stdlib |
tcl | In-process Tcl |
wasm | WASI module |
rust, java, c, cpp | Compile 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
| Method | Path | Purpose |
|---|---|---|
POST | /studio/wasm/build | Compile source to a WASI module. Local toolchain only. Content-addressed cache. |
POST | /studio/wasm/warm | Pre-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
| Method | Path | Permission |
|---|---|---|
GET | /studio/sql/connectors | studio:read |
POST | /studio/sql/query | studio: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, thenGET /studio/collab/ws. Viewers cannot mutate. - Terminal: ticket from
POST …/terminal/ticket, thenGET /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.