@withgateway/sdk 0.2.9 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cli.js +2355 -486
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +2335 -466
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/files/index.d.mts +1 -0
  6. package/dist/files/index.d.ts +1 -0
  7. package/dist/files/index.js +1324 -21
  8. package/dist/files/index.js.map +1 -1
  9. package/dist/files/index.mjs +1322 -13
  10. package/dist/files/index.mjs.map +1 -1
  11. package/dist/{index-Cz8Q6Keo.d.mts → index-D6oi1TWE.d.mts} +93 -34
  12. package/dist/{index-BO2SNSgy.d.ts → index-DAb-FCMg.d.ts} +93 -34
  13. package/dist/index.d.mts +4 -3
  14. package/dist/index.d.ts +4 -3
  15. package/dist/index.js +1758 -116
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +1720 -97
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/media-CbcAfQvd.d.mts +83 -0
  20. package/dist/media-CbcAfQvd.d.ts +83 -0
  21. package/dist/traces/index.d.mts +1 -0
  22. package/dist/traces/index.d.ts +1 -0
  23. package/dist/traces/index.js +1321 -18
  24. package/dist/traces/index.js.map +1 -1
  25. package/dist/traces/index.mjs +1319 -10
  26. package/dist/traces/index.mjs.map +1 -1
  27. package/dist/tracing/index.d.mts +2 -1
  28. package/dist/tracing/index.d.ts +2 -1
  29. package/dist/tracing/index.js +512 -11
  30. package/dist/tracing/index.js.map +1 -1
  31. package/dist/tracing/index.mjs +501 -10
  32. package/dist/tracing/index.mjs.map +1 -1
  33. package/dist/worlds/index.d.mts +583 -63
  34. package/dist/worlds/index.d.ts +583 -63
  35. package/dist/worlds/index.js +1703 -94
  36. package/dist/worlds/index.js.map +1 -1
  37. package/dist/worlds/index.mjs +1689 -80
  38. package/dist/worlds/index.mjs.map +1 -1
  39. package/package.json +1 -1
  40. package/runtime/gatewaysdk/environment/schema/api.py +38 -56
  41. package/runtime/gatewaysdk/environment/schema/grading.py +1 -5
  42. package/runtime/gatewaysdk/environment/schema/host.py +53 -90
  43. package/runtime/gatewaysdk/environment/schema/local.py +15 -7
  44. package/runtime/gatewaysdk/environment/schema/runtime.py +9 -9
  45. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +7 -7
  46. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +1 -0
  47. package/runtime/gatewaysdk/environment/schema/tasks.py +25 -1
  48. package/skills/worlds-getting-started/SKILL.md +7 -7
  49. package/skills/worlds-getting-started/references/cli-mcp-map.md +1 -0
@@ -34,7 +34,7 @@ from pathlib import Path
34
34
  from typing import TYPE_CHECKING, Any, Optional
35
35
 
36
36
  from . import snapshot as snapshots
37
- from .api import WorldApp, WorldState, operation_request, vendor_credential, with_query
37
+ from .api import Via, WorldApp, WorldState, operation_request, vendor_credential, with_query
38
38
  from .dependencies import Dependency
39
39
  from .grading import Grade, GraderError, TaskGrader
40
40
  from .snapshot import SCENARIOS
@@ -654,12 +654,6 @@ class SnapshotRuntime(WorldRuntime):
654
654
  }
655
655
 
656
656
 
657
- # --------------------------------------------------------------------------- #
658
- # Shared by the runtimes and the local session: an operation by name, the
659
- # client grant, the task card.
660
- # --------------------------------------------------------------------------- #
661
-
662
-
663
657
  def client_grant(app: WorldApp | None, credential: str | None) -> str | None:
664
658
  """The bearer an ``oauth2`` world's routes take when the session itself
665
659
  calls them (the page's api prefix, an operation by name); None for any
@@ -682,7 +676,8 @@ def call_operation(
682
676
  """An operation of connector.toml called by name (:func:`operation_request`
683
677
  reads the args: ``path``/``query``/``body``, or leftover top-level keys as
684
678
  the body); the world's own credential is presented, as the host presents a
685
- session's. The answer is the route's ``{status, body}``."""
679
+ session's. The call is logged ``via: tool``. The answer is the route's
680
+ ``{status, body}``."""
686
681
  spec = app.router.spec
687
682
  operation = spec.operations.get(name)
688
683
  if operation is None:
@@ -696,7 +691,12 @@ def call_operation(
696
691
  method, target, raw = operation_request(spec, operation, args)
697
692
  headers, credential_query = vendor_credential(spec, credential, grant=grant)
698
693
  status, answer, _ = app.handle(
699
- method, with_query(target, credential_query), {"content-type": "application/json", **headers}, raw, "127.0.0.1"
694
+ method,
695
+ with_query(target, credential_query),
696
+ {"content-type": "application/json", **headers},
697
+ raw,
698
+ "127.0.0.1",
699
+ via=Via.TOOL,
700
700
  )
701
701
  return {"status": status, "body": answer}
702
702
 
@@ -341,10 +341,10 @@ verifiers) is refused `world_kind_retired`; one on an api bundle opens and lists
341
341
  "metadata": { "externalUserId": "u_42" } }
342
342
  ```
343
343
 
344
- `instruction` is what the agent is told; `seed` (`{mode?, rows}`, the live-seed contract) is
345
- laid on the clone and re-applied by `reset`; `grader` is `assertions` (`entity`, `where`,
346
- `exists|absent|count|all|any`, `field op value`; each check's `id` becomes a `rewards` key),
347
- `{kind: "python", source}` (a `verify.py` body) or `{kind: "rubric", rubric, criteria?, model?}`
344
+ `instruction` is what the agent is told; `seed` (`{mode?, rows}`, the live-seed contract) is laid on the clone and re-applied by `reset`;
345
+ `grader` is `assertions` (`entity`, `where`, `exists|absent|count|all|any`, `field op value`; each check's `id` becomes a `rewards` key;
346
+ `entity: "calls"` reads the call log — `operation`, `args`, `selectors`, `status`, `rows`, `found`, and `via`: `ui` from the page's `api_path`,
347
+ `api` from the api origin, `tool` by name), `{kind: "python", source}` (a `verify.py` body) or `{kind: "rubric", rubric, criteria?, model?}`
348
348
  (an LLM judge over end state + call log, graded on the platform: `grade` answers pending until
349
349
  the worker finalizes it); `tools: [names]` narrows the operations the session may call to
350
350
  exactly those (a name the world does not serve is a 400); `metadata` rides the session. At most one of
@@ -456,8 +456,7 @@ gateway environment rollouts <container-id>
456
456
  ```
457
457
 
458
458
  MCP: `run_evaluation({ models | runConfigId, versionId?, numExamples?, rolloutsPerExample? })`,
459
- `create_task_set`, `create_task`, `link_task_set`, `list_rollouts`, `get_rollout_samples`,
460
- `get_task_performance`; `promote_failure_to_scenario({...})` turns a failed rollout into a scenario.
459
+ `create_task_set`, `create_task`, `link_task_set`, `list_rollouts`, `get_rollout_samples`, `get_task_performance`; `promote_failure_to_scenario({...})` turns a failed rollout into a scenario.
461
460
 
462
461
  ## 8. Iterate
463
462
 
@@ -467,6 +466,7 @@ gateway bench fork x --into x-experiment # a new container sh
467
466
  gateway worlds edit status x # your open EDIT SESSION: every push / sandbox commit / data import after the first version lands there; only this credential reads it as main
468
467
  gateway worlds edit close x -m "why" # seal it: main moves to the session's tip for everyone; each version stays in `log`, `edit rollback` undoes the whole session (60 idle minutes seal it too). `edit list x` = history, `edit discard x` drops it unseen
469
468
  gateway worlds edit rollback x <sessionId> # undo a sealed session (source + data together) as a new sealed session; --force when later sessions would go too
469
+ gateway worlds task edit close <task> -m "why" # a change across a TASK's worlds: seal them all in ONE step or none (`task edit status <task>` first: your unsealed worlds, only you see them; `task edit rollback <task> --group <groupId>` undoes the group)
470
470
  gateway worlds sandbox open x@main # no local checkout: write|exec|check|commit|close <id> edit the tree server-side; `bench sandbox` is the same set
471
471
  gateway worlds sandbox exec <id> 'gateway worlds schema entity add . tickets --fields id:string,title:string -k id && gateway worlds schema compile . && gateway worlds data import . rows.json && gateway worlds schema check . && gateway worlds test .'
472
472
  gateway worlds sandbox open --new y --from custom # a world that does not exist yet (no base); its first `commit` creates it — references/new-world-sandbox.md
@@ -482,7 +482,7 @@ into its tree — `check`/`commit` hold back scratch, credential-shaped files (`
482
482
  any read. `sandbox commit <id> -m why --rebase` replays your edits onto a branch that moved since `open`; a path changed on both sides is a 409, one `conflict: <path> (<reason>)` line each on stderr, exit 1. `worlds run --path` on a clean `bench pull` checkout files runs pinned to the base version.
483
483
  Work is saved while a sandbox sits idle and resumes by id, but after 7 idle days (`status` shows `idleExpiresAt`) the platform closes it even with uncommitted files, and a closed sandbox cannot be reopened: commit before you walk away. `sandbox close <id>` refuses uncommitted files (exit 1, their paths on stderr) unless `--force`. Sandbox twins and every limit: `references/cli-mcp-map.md`.
484
484
 
485
- MCP: `list_world_edits({ slug })`, `close_world_edit`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId })`; `env_diff({ containerId })`, `env_run_tests`, `env_get_run`; proposals (`env_propose`, `env_list_proposals`, `env_apply_proposal`, `env_dismiss_proposal`) are the legacy PR-style door.
485
+ MCP: `list_world_edits({ slug })`, `close_world_edit`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId })`; across a task's worlds `get_task_edit({ task })`, `close_task_edit({ task, requireAll?, force? })`, `rollback_task_edit({ task, groupId })`; `env_diff({ containerId })`, `env_run_tests`, `env_get_run`; proposals (`env_propose`, `env_list_proposals`, `env_apply_proposal`, `env_dismiss_proposal`) are the legacy PR-style door.
486
486
 
487
487
  ## 9. Where it shows in the UI, the CLI to MCP map, gotchas
488
488
 
@@ -36,6 +36,7 @@ Reference for `worlds-getting-started`: every CLI step and its MCP twin, then ho
36
36
  | `environment link-task-set` / `create-task` | `create_task_set`, `create_task`, `link_task_set` |
37
37
  | `bench diff` / `propose` | `env_diff`, `env_propose` (proposals are the legacy PR-style door; edit sessions below are the version-control loop) |
38
38
  | `worlds\|bench edit status\|list\|close\|discard\|rollback <slug>` | `list_world_edits({ slug, status?, limit? })`, `close_world_edit({ slug, sessionId?, force?, message? })`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId, force?, message? })` (`GET /api/public/worlds/{slug}/edits`, `POST …/edits/close\|discard\|rollback`). After a world's first version every push, sandbox commit, data import, agent `env_commit` and UI save lands on the credential's open edit session — a private `edit/<id>` branch only that credential reads as `main` (`describe`, `pull`, `log`, `session open`, `sandbox open`); the write's JSON carries `editSessionId` + a hint. `close`, or 60 minutes without an edit, seals the session: the shared `main` moves to its tip (every version stays in `log`; the session is the rollback unit); a `main` that moved meanwhile is rebased when the paths differ, else the session parks as `conflict` (`close --force` takes its content). `rollback` restores source + data snapshot from before a sealed session as a new sealed session (`--force` when later sessions would be undone too). UI: world › History › Edit sessions |
39
+ | `worlds task edit status\|close\|rollback <task>` (task id, spec file with `worlds`, or `task up` manifest) | `get_task_edit({ task })`, `close_task_edit({ task, requireAll?, force?, message? })`, `rollback_task_edit({ task, groupId, force?, message? })` (`POST /api/public/world-task-edits/status\|close\|rollback`). The same edit sessions across every world a task names: `status` shows each world's unsealed edits (open and `parked` in conflict) and what closing would do (`fast-forward`, `rebase`, `conflict`) — your own `task up` opens them at your tip (`private: true`), everyone else still gets shared `main`; `close` seals every world in ONE transaction (a conflict, a missing world, a ref other than `main` or a parked session anywhere seals nothing, and the 409 names every world's problem; worlds with no edit are skipped unless `--require-all`), and the sessions share a `groupId`; `rollback --group` restores every world together to the `main` the group replaced, refused when anything reached a world's `main` after the group (a later session or a write outside sessions) unless `--force` |
39
40
  | `worlds\|bench sandbox open\|status\|read\|write\|exec\|check\|commit\|close` | `open_world_sandbox`, `get_world_sandbox`, `read_world_sandbox_file`, `write_world_sandbox_file` (base64), `exec_in_world_sandbox`, `check_world_sandbox`, `commit_world_sandbox`, `close_world_sandbox({ sandboxId, force? })` (`/api/public/benchmark-containers/sandboxes[/{id}[/file\|exec\|check\|commit]]`; `close` with uncommitted work is a 409 `sandbox_uncommitted` naming the paths, nothing closed, unless `force: true` / `--force`; the source tree only — no data snapshot, nothing on the caller's disk; `commit` lands on the recorded base; `commit --rebase` sends `rebase: true` and replays onto a branch head that moved, a 409 naming each conflicting path). `open` reports `cli: {version, digest}` — the platform's own `gateway` CLI and a `sqlite3` are on PATH inside `exec`, so `gateway worlds schema entity add\|verifier add\|task add\|compile\|check .`, `gateway worlds data import\|show\|query .`, `gateway worlds test .`, `gateway worlds serve . --port 8080 & sleep 2; gateway worlds call http://localhost:8080 <tool> …` (one `exec`; a served world lives only as long as that command) and `sqlite3 db/state.sqlite "…"` run on the working copy; remote verbs (push, run, session open) stop in the sandbox by design — `check`/`commit` from your machine. `cli: null` + `warnings[]` means the image cannot host the runtime (python3 < 3.12 or node < 18); plain shell still runs |
40
41
  | `worlds\|bench sandbox open --new <slug> --from custom\|<template>` | `open_world_sandbox({ new, from })` (same route, body `{new, from}`; a world that does not exist yet — `baseVersionId`/`containerId`/`baseContentHash` null, `branch: main`, `pendingSlug`; `custom` = the `schema init` scaffold, else a shipped template (`GET /api/public/worlds/templates`; unknown → 400 naming the list); taken slug → 409 `world_exists`, never renamed; `check_world_sandbox` runs the first commit's gate; the first `commit_world_sandbox` creates the world on `main` through the `worlds create --from <dir>` door, later commits land on the new base; the same staged CLI runs on the scaffold) |
41
42
  | `worlds skill <name>` / `worlds connector skill` | `get_connector_authoring_skill`, `guide` |
@@ -126,6 +126,12 @@ class TaskSpec:
126
126
  #: declare an entity by either name (the compiler refuses it), so a check on
127
127
  #: one is never a typo for a row entity; a seed may not target them.
128
128
  RESERVED_STATE_KEYS = frozenset({"calls", "snapshot"})
129
+ CALL_LOG = "calls"
130
+ DOOR_FIELD = "via"
131
+
132
+
133
+ class GraderError(Exception):
134
+ """A grader that could not deliver a grade, with the reason a reader acts on."""
129
135
 
130
136
 
131
137
  def unknown_task_entities(spec: TaskSpec, defined: Iterable[str]) -> list[str]:
@@ -594,8 +600,26 @@ def _rows_of(state: dict, entity: str) -> list[dict]:
594
600
  return []
595
601
 
596
602
 
603
+ def _names_the_door(check: dict) -> bool:
604
+ entity = check["entity"]
605
+ on_call_log = entity == CALL_LOG or entity.endswith(f".{CALL_LOG}")
606
+ return on_call_log and (check.get("field") == DOOR_FIELD or DOOR_FIELD in (check.get("where") or {}))
607
+
608
+
609
+ def _require_the_door(check: dict, state: dict, rows: list[dict]) -> None:
610
+ """A door check over no call log, or a log that does not record the door,
611
+ would select nothing (``absent`` passes) or miss the key (``neq`` passes):
612
+ ungraded."""
613
+ if not _names_the_door(check):
614
+ return
615
+ if check["entity"] not in state or any(DOOR_FIELD not in row for row in rows):
616
+ raise GraderError(f"this engine's call log does not record the door ({DOOR_FIELD})")
617
+
618
+
597
619
  def evaluate_check(check: dict, state: dict) -> bool:
598
- selected = [row for row in _rows_of(state, check["entity"]) if _matches_where(row, check.get("where"))]
620
+ rows = _rows_of(state, check["entity"])
621
+ _require_the_door(check, state, rows)
622
+ selected = [row for row in rows if _matches_where(row, check.get("where"))]
599
623
  assertion = check["assert"]
600
624
  if assertion == "exists":
601
625
  return bool(selected)
@@ -341,10 +341,10 @@ verifiers) is refused `world_kind_retired`; one on an api bundle opens and lists
341
341
  "metadata": { "externalUserId": "u_42" } }
342
342
  ```
343
343
 
344
- `instruction` is what the agent is told; `seed` (`{mode?, rows}`, the live-seed contract) is
345
- laid on the clone and re-applied by `reset`; `grader` is `assertions` (`entity`, `where`,
346
- `exists|absent|count|all|any`, `field op value`; each check's `id` becomes a `rewards` key),
347
- `{kind: "python", source}` (a `verify.py` body) or `{kind: "rubric", rubric, criteria?, model?}`
344
+ `instruction` is what the agent is told; `seed` (`{mode?, rows}`, the live-seed contract) is laid on the clone and re-applied by `reset`;
345
+ `grader` is `assertions` (`entity`, `where`, `exists|absent|count|all|any`, `field op value`; each check's `id` becomes a `rewards` key;
346
+ `entity: "calls"` reads the call log — `operation`, `args`, `selectors`, `status`, `rows`, `found`, and `via`: `ui` from the page's `api_path`,
347
+ `api` from the api origin, `tool` by name), `{kind: "python", source}` (a `verify.py` body) or `{kind: "rubric", rubric, criteria?, model?}`
348
348
  (an LLM judge over end state + call log, graded on the platform: `grade` answers pending until
349
349
  the worker finalizes it); `tools: [names]` narrows the operations the session may call to
350
350
  exactly those (a name the world does not serve is a 400); `metadata` rides the session. At most one of
@@ -456,8 +456,7 @@ gateway environment rollouts <container-id>
456
456
  ```
457
457
 
458
458
  MCP: `run_evaluation({ models | runConfigId, versionId?, numExamples?, rolloutsPerExample? })`,
459
- `create_task_set`, `create_task`, `link_task_set`, `list_rollouts`, `get_rollout_samples`,
460
- `get_task_performance`; `promote_failure_to_scenario({...})` turns a failed rollout into a scenario.
459
+ `create_task_set`, `create_task`, `link_task_set`, `list_rollouts`, `get_rollout_samples`, `get_task_performance`; `promote_failure_to_scenario({...})` turns a failed rollout into a scenario.
461
460
 
462
461
  ## 8. Iterate
463
462
 
@@ -467,6 +466,7 @@ gateway bench fork x --into x-experiment # a new container sh
467
466
  gateway worlds edit status x # your open EDIT SESSION: every push / sandbox commit / data import after the first version lands there; only this credential reads it as main
468
467
  gateway worlds edit close x -m "why" # seal it: main moves to the session's tip for everyone; each version stays in `log`, `edit rollback` undoes the whole session (60 idle minutes seal it too). `edit list x` = history, `edit discard x` drops it unseen
469
468
  gateway worlds edit rollback x <sessionId> # undo a sealed session (source + data together) as a new sealed session; --force when later sessions would go too
469
+ gateway worlds task edit close <task> -m "why" # a change across a TASK's worlds: seal them all in ONE step or none (`task edit status <task>` first: your unsealed worlds, only you see them; `task edit rollback <task> --group <groupId>` undoes the group)
470
470
  gateway worlds sandbox open x@main # no local checkout: write|exec|check|commit|close <id> edit the tree server-side; `bench sandbox` is the same set
471
471
  gateway worlds sandbox exec <id> 'gateway worlds schema entity add . tickets --fields id:string,title:string -k id && gateway worlds schema compile . && gateway worlds data import . rows.json && gateway worlds schema check . && gateway worlds test .'
472
472
  gateway worlds sandbox open --new y --from custom # a world that does not exist yet (no base); its first `commit` creates it — references/new-world-sandbox.md
@@ -482,7 +482,7 @@ into its tree — `check`/`commit` hold back scratch, credential-shaped files (`
482
482
  any read. `sandbox commit <id> -m why --rebase` replays your edits onto a branch that moved since `open`; a path changed on both sides is a 409, one `conflict: <path> (<reason>)` line each on stderr, exit 1. `worlds run --path` on a clean `bench pull` checkout files runs pinned to the base version.
483
483
  Work is saved while a sandbox sits idle and resumes by id, but after 7 idle days (`status` shows `idleExpiresAt`) the platform closes it even with uncommitted files, and a closed sandbox cannot be reopened: commit before you walk away. `sandbox close <id>` refuses uncommitted files (exit 1, their paths on stderr) unless `--force`. Sandbox twins and every limit: `references/cli-mcp-map.md`.
484
484
 
485
- MCP: `list_world_edits({ slug })`, `close_world_edit`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId })`; `env_diff({ containerId })`, `env_run_tests`, `env_get_run`; proposals (`env_propose`, `env_list_proposals`, `env_apply_proposal`, `env_dismiss_proposal`) are the legacy PR-style door.
485
+ MCP: `list_world_edits({ slug })`, `close_world_edit`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId })`; across a task's worlds `get_task_edit({ task })`, `close_task_edit({ task, requireAll?, force? })`, `rollback_task_edit({ task, groupId })`; `env_diff({ containerId })`, `env_run_tests`, `env_get_run`; proposals (`env_propose`, `env_list_proposals`, `env_apply_proposal`, `env_dismiss_proposal`) are the legacy PR-style door.
486
486
 
487
487
  ## 9. Where it shows in the UI, the CLI to MCP map, gotchas
488
488
 
@@ -36,6 +36,7 @@ Reference for `worlds-getting-started`: every CLI step and its MCP twin, then ho
36
36
  | `environment link-task-set` / `create-task` | `create_task_set`, `create_task`, `link_task_set` |
37
37
  | `bench diff` / `propose` | `env_diff`, `env_propose` (proposals are the legacy PR-style door; edit sessions below are the version-control loop) |
38
38
  | `worlds\|bench edit status\|list\|close\|discard\|rollback <slug>` | `list_world_edits({ slug, status?, limit? })`, `close_world_edit({ slug, sessionId?, force?, message? })`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId, force?, message? })` (`GET /api/public/worlds/{slug}/edits`, `POST …/edits/close\|discard\|rollback`). After a world's first version every push, sandbox commit, data import, agent `env_commit` and UI save lands on the credential's open edit session — a private `edit/<id>` branch only that credential reads as `main` (`describe`, `pull`, `log`, `session open`, `sandbox open`); the write's JSON carries `editSessionId` + a hint. `close`, or 60 minutes without an edit, seals the session: the shared `main` moves to its tip (every version stays in `log`; the session is the rollback unit); a `main` that moved meanwhile is rebased when the paths differ, else the session parks as `conflict` (`close --force` takes its content). `rollback` restores source + data snapshot from before a sealed session as a new sealed session (`--force` when later sessions would be undone too). UI: world › History › Edit sessions |
39
+ | `worlds task edit status\|close\|rollback <task>` (task id, spec file with `worlds`, or `task up` manifest) | `get_task_edit({ task })`, `close_task_edit({ task, requireAll?, force?, message? })`, `rollback_task_edit({ task, groupId, force?, message? })` (`POST /api/public/world-task-edits/status\|close\|rollback`). The same edit sessions across every world a task names: `status` shows each world's unsealed edits (open and `parked` in conflict) and what closing would do (`fast-forward`, `rebase`, `conflict`) — your own `task up` opens them at your tip (`private: true`), everyone else still gets shared `main`; `close` seals every world in ONE transaction (a conflict, a missing world, a ref other than `main` or a parked session anywhere seals nothing, and the 409 names every world's problem; worlds with no edit are skipped unless `--require-all`), and the sessions share a `groupId`; `rollback --group` restores every world together to the `main` the group replaced, refused when anything reached a world's `main` after the group (a later session or a write outside sessions) unless `--force` |
39
40
  | `worlds\|bench sandbox open\|status\|read\|write\|exec\|check\|commit\|close` | `open_world_sandbox`, `get_world_sandbox`, `read_world_sandbox_file`, `write_world_sandbox_file` (base64), `exec_in_world_sandbox`, `check_world_sandbox`, `commit_world_sandbox`, `close_world_sandbox({ sandboxId, force? })` (`/api/public/benchmark-containers/sandboxes[/{id}[/file\|exec\|check\|commit]]`; `close` with uncommitted work is a 409 `sandbox_uncommitted` naming the paths, nothing closed, unless `force: true` / `--force`; the source tree only — no data snapshot, nothing on the caller's disk; `commit` lands on the recorded base; `commit --rebase` sends `rebase: true` and replays onto a branch head that moved, a 409 naming each conflicting path). `open` reports `cli: {version, digest}` — the platform's own `gateway` CLI and a `sqlite3` are on PATH inside `exec`, so `gateway worlds schema entity add\|verifier add\|task add\|compile\|check .`, `gateway worlds data import\|show\|query .`, `gateway worlds test .`, `gateway worlds serve . --port 8080 & sleep 2; gateway worlds call http://localhost:8080 <tool> …` (one `exec`; a served world lives only as long as that command) and `sqlite3 db/state.sqlite "…"` run on the working copy; remote verbs (push, run, session open) stop in the sandbox by design — `check`/`commit` from your machine. `cli: null` + `warnings[]` means the image cannot host the runtime (python3 < 3.12 or node < 18); plain shell still runs |
40
41
  | `worlds\|bench sandbox open --new <slug> --from custom\|<template>` | `open_world_sandbox({ new, from })` (same route, body `{new, from}`; a world that does not exist yet — `baseVersionId`/`containerId`/`baseContentHash` null, `branch: main`, `pendingSlug`; `custom` = the `schema init` scaffold, else a shipped template (`GET /api/public/worlds/templates`; unknown → 400 naming the list); taken slug → 409 `world_exists`, never renamed; `check_world_sandbox` runs the first commit's gate; the first `commit_world_sandbox` creates the world on `main` through the `worlds create --from <dir>` door, later commits land on the new base; the same staged CLI runs on the scaffold) |
41
42
  | `worlds skill <name>` / `worlds connector skill` | `get_connector_authoring_skill`, `guide` |