@tangle-network/sandbox-cli 0.21.1-develop.20260813074026.e3d841b → 0.21.1

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.
package/README.md CHANGED
@@ -15,7 +15,7 @@ See [Limitations](#limitations) for open gaps.
15
15
 
16
16
  ## Install
17
17
 
18
- One-liner (requires Node 20+ on PATH):
18
+ One-liner (requires Node on PATH matching the package's [`engines` metadata](./package.json)):
19
19
 
20
20
  ```bash
21
21
  curl -fsSL https://sandbox.tangle.tools/install.sh | sh
@@ -52,6 +52,43 @@ pnpm --filter @tangle-network/sandbox-cli build
52
52
  node products/sandbox/cli/bin/tangle.js --help
53
53
  ```
54
54
 
55
+ ## Local graphs
56
+
57
+ Save a graph in a repository's `.tangle/graphs/<name>.yaml` or in
58
+ `~/.tangle/graphs/<name>.yaml`. Repository graphs take precedence. The packaged
59
+ [`haiku-review.yaml`](./examples/haiku-review.yaml) contains a writer, an independent
60
+ critic and a declared completion check.
61
+
62
+ ```bash
63
+ tangle graph new "Write and independently judge a haiku" --name haiku-review
64
+ tangle graph run haiku-review --dry-run
65
+ tangle graph run haiku-review
66
+ ```
67
+
68
+ Graphs use the selected harness's native subscription login. Set `seat` in
69
+ `~/.tangle/config.json` to keep a default; `--seat` overrides it for every node.
70
+ A graph with no integration needs requires no Tangle login. Validation resolves
71
+ seats and needs before starting agents. Missing connections name the provider
72
+ and its `tangle hub connect <provider>` command.
73
+
74
+ Progress goes to stderr; `--json` returns the result or the shared error contract
75
+ on stdout. Run journals live under `~/.tangle/runs/<run-id>`, and graph history
76
+ lives in `~/.tangle/graph-registry`. Unknown token and cost totals remain `null`.
77
+
78
+ ## Supervisor accounting
79
+
80
+ `tangle supervise` reports measured tokens and cost for successful and failed runs.
81
+ A run without a winner can still incur cost.
82
+ Unknown totals display as `Unavailable` and appear as `null` in JSON output.
83
+
84
+ ## Workflow inputs
85
+
86
+ Use `tangle workflows run <id> --input-file ~/.tangle/params/code-fix.json --wait`
87
+ to run a stored preset. The file is a flat JSON object of string values, such as
88
+ `{"repo":"o/r","base":"develop","change":"fix the parser"}`. Repeatable
89
+ `--input key=value` flags override matching file keys. Invalid files fail before
90
+ authentication or run admission; `--json` errors include `code`, `cause`, and `fix`.
91
+
55
92
  ## Authentication
56
93
 
57
94
  Three flows are supported:
@@ -63,8 +100,14 @@ Three flows are supported:
63
100
  Credential lookup precedence:
64
101
 
65
102
  1. `--api-key` flag
66
- 2. `TANGLE_API_KEY` environment variable
67
- 3. `~/.tangle/credentials` (populated by `tangle auth login`)
103
+ 2. `TANGLE_API_KEY_FILE` managed credential file
104
+ 3. `TANGLE_API_KEY` environment variable
105
+ 4. `~/.tangle/credentials` (populated by `tangle auth login`)
106
+
107
+ The sidecar publishes refreshed delegated credentials through `TANGLE_API_KEY_FILE`.
108
+ The CLI reads this file for each request, including requests from an existing client.
109
+ A configured file that is missing, unreadable, or malformed fails without falling back to an older key.
110
+ A verified Sandbox request can install a new source credential; an expired source cannot renew itself unattended.
68
111
 
69
112
  Common commands:
70
113
 
@@ -77,6 +120,50 @@ tangle auth profiles
77
120
 
78
121
  `tangle auth login` validates the supplied credential against `/v1/account/me`, which requires a valid token.
79
122
 
123
+ ### The two surfaces
124
+
125
+ Commands address one of two services, and the two accept different credentials.
126
+
127
+ | Surface | Command families | Credential |
128
+ |---|---|---|
129
+ | Sandbox API | `sandbox`, `exec`, `ssh`, `fs`, `process`, `snapshot`, `secret`, `agent`, `fleet`, `batch`, `usage` | the session `tangle auth login` stores, or an `sk-tan-*` key |
130
+ | Platform control plane (`id.tangle.tools`) | `keys`, `workflows`, `hub` | an `sk-tan-*` key only |
131
+
132
+ The platform does not accept the sandbox session: it belongs to a different
133
+ audience. After a browser login the CLI therefore mints a short-lived platform
134
+ key from that session on the first platform command, caches it in the same
135
+ credential store, and replaces it before it expires. Nothing durable is written
136
+ for a surface you never use, and no long-lived key sits on disk.
137
+
138
+ An `sk-tan-*` key is used exactly as supplied on both surfaces, whether it
139
+ arrives through `--api-key`, `TANGLE_API_KEY`, or `tangle auth login --api-key`,
140
+ so a spawned sandbox and a CI job keep the credential they were given and no
141
+ mint replaces it. `TANGLE_HUB_CAPABILITY_TOKEN` serves the `hub` commands only.
142
+
143
+ ### What the minted credential may do
144
+
145
+ The minted key lives for minutes, so the platform refuses key creation and
146
+ revocation through it: a credential that short must not add or destroy authority
147
+ that outlasts it.
148
+
149
+ - `tangle keys list` works after `tangle auth login`.
150
+ - `tangle keys create` and `tangle keys revoke` need a key you minted yourself:
151
+ set `TANGLE_API_KEY`, run `tangle auth login --api-key sk-tan-…`, or mint the
152
+ key in the web console.
153
+
154
+ Everything else on the control plane — `tangle workflows`, `tangle hub` — works
155
+ from the login alone.
156
+
157
+ `tangle auth status` reports both surfaces. It exits non-zero when either one
158
+ REFUSES the stored credential — a behaviour change for a script that gated on
159
+ the old sandbox-only check, and the point of it: the platform rejecting the
160
+ credential used to be reported as success. An unreachable platform is a
161
+ different answer and exits zero, because an outage says nothing about the
162
+ credential; read `platform.reachable` in `--json` to gate platform work.
163
+ `--base-url` names the sandbox host for BOTH halves: the session is checked
164
+ there, and the platform credential is minted there, so the two lines of the
165
+ answer always describe one deployment.
166
+
80
167
  ## Command Surface
81
168
 
82
169
  Top-level command groups:
@@ -90,7 +177,6 @@ Top-level command groups:
90
177
  - `fleet`
91
178
  - `snapshot`
92
179
  - `usage`
93
- - `permissions`
94
180
  - `backend`
95
181
  - `batch`
96
182
  - `process`
@@ -221,9 +307,19 @@ The file uses the same complete request shape as the TypeScript SDK and cannot b
221
307
  ## Provisioning Coverage
222
308
 
223
309
  `tangle sandbox create` supports environments or container images, resources, temporary GPU leases, lifecycle limits, driver and backend selection, SSH and web terminal, environment variables, secrets, metadata, git clone, BYOS3 storage, and snapshot restore.
224
- Use the `tools`, `permissions`, `network`, and `expose` commands after creation.
310
+ Use the `sandbox network` and `sandbox expose` commands after creation.
225
311
  Run `tangle sandbox create --help` for the current flag list.
226
312
 
227
313
  ## Limitations
228
314
 
229
315
  - `snapshot restore` creates a new sandbox from a snapshot; the command signature suggests in-place restore.
316
+
317
+ ## Compliance posture is not a flag
318
+
319
+ No CLI command takes a `--compliance` / HIPAA / PHI option, by design: a
320
+ caller-asserted flag could dodge the platform's observability gates or
321
+ claim a protection it never granted. The platform derives the posture from
322
+ the credential's verified attribution and pins it server-side. Reads
323
+ (`sandbox list`, `sandbox get`) surface it as the read-only `compliance:
324
+ { hipaa: true }` echo field — absent means the platform made no claim, and
325
+ `hipaa: false` never appears.
package/SKILL.md CHANGED
@@ -12,7 +12,12 @@ All commands support `--help` for inline reference.
12
12
 
13
13
  ## Auth
14
14
 
15
- Generic command auth modes, resolved in order:
15
+ Commands address one of two services. Sandbox commands (`sandbox`, `exec`,
16
+ `ssh`, `fs`, `snapshot`, `secret`, `agent`, …) address the sandbox API. Platform
17
+ commands (`keys`, `workflows`, `hub`) address the control plane at
18
+ `id.tangle.tools`, which accepts only an `sk-tan-*` key.
19
+
20
+ Sandbox command auth modes, resolved in order:
16
21
 
17
22
  | Priority | Source | Set via |
18
23
  |----------|--------|--------|
@@ -20,14 +25,18 @@ Generic command auth modes, resolved in order:
20
25
  | 2 | Env var | `TANGLE_API_KEY` |
21
26
  | 3 | Profile store | `tangle auth login` (keychain or file) |
22
27
 
23
- Hub commands resolve auth in this order:
28
+ Platform commands resolve auth in the same order, with one step added: the
29
+ session that `tangle auth login` stores is not a platform credential, so the CLI
30
+ mints a short-lived platform key from it on first use and refreshes it as
31
+ needed. Hub commands also accept `TANGLE_HUB_CAPABILITY_TOKEN`, ranked directly
32
+ below `--api-key`; other platform commands do not, because that token
33
+ authenticates `/v1/hub/exec` alone.
24
34
 
25
- | Priority | Source | Set via |
26
- |----------|--------|--------|
27
- | 1 | CLI flag | `--api-key <key>` |
28
- | 2 | Hub capability | `TANGLE_HUB_CAPABILITY_TOKEN` |
29
- | 3 | Env var | `TANGLE_API_KEY` |
30
- | 4 | Profile store | `tangle auth login` (keychain or file) |
35
+ The minted key lives for minutes, so the platform refuses key creation and
36
+ revocation through it. `tangle keys list` works from a browser login; `tangle
37
+ keys create` and `tangle keys revoke` need a key you minted yourself
38
+ (`TANGLE_API_KEY`, `tangle auth login --api-key`, or the web console). A stored
39
+ `sk-tan-*` is presented as-is and never minted over.
31
40
 
32
41
  **Inside a sandbox:** `tangle` is automatically authenticated.
33
42
  No extra authentication is needed.
@@ -75,6 +84,24 @@ Use a normal sandbox first, then attach a GPU only for the work that needs it.
75
84
  Omit `--provider` to use the cheapest configured GPU cloud.
76
85
  Always set a spend cap and lifetime.
77
86
 
87
+ Check which GPU clouds work before attaching. `gpu providers` lists every supported provider with its state (`ready`, `credential-invalid`, `unverified`, `not-configured`, `disabled`), the orchestrator variables it needs, and a live price for the accelerator you name:
88
+
89
+ ```bash
90
+ tangle sandbox gpu providers <sandbox-id> --accelerator-kind nvidia-h100
91
+ ```
92
+
93
+ | Provider | `--provider` | Orchestrator variables |
94
+ | --- | --- | --- |
95
+ | RunPod | `runpod` | `RUNPOD_API_KEY` |
96
+ | Vast.ai | `vast-ai` | `VAST_API_KEY` |
97
+ | Lambda | `lambda-labs` | `LAMBDA_API_KEY` |
98
+ | Modal | `modal` | `MODAL_TOKEN_ID`, `MODAL_TOKEN_SECRET` |
99
+
100
+ TensorDock, Paperspace, AWS, GCP, Azure, Crusoe and Fluidstack are also supported; `gpu providers` prints the variables each needs.
101
+ Setting a provider's variables enables it; `GPU_LEASE_PROVIDERS` only narrows the set.
102
+ An attach with no usable provider fails with 503 `GPU_PROVIDER_NOT_CONFIGURED` naming the variables to set; a refused key shows as `credential-invalid` and is never selected.
103
+ Modal offers T4, L4, A10G, L40S, A100, H100, H200 and B200, not consumer cards such as the RTX 3090.
104
+
78
105
  ```bash
79
106
  # One-shot eval: attach GPU, run command, always destroy the lease.
80
107
  tangle sandbox gpu run <sandbox-id> \
@@ -147,8 +174,8 @@ Two equivalent commands are available: `call` and `exec`.
147
174
 
148
175
  ```bash
149
176
  # Basic call: <path tokens...> <json-input>
150
- tangle hub call github issues search '{"q":"repo:tangle-network/agent-dev-container is:issue"}'
151
- tangle hub exec github.issues.search '{"q":"repo:tangle-network/agent-dev-container is:issue"}'
177
+ tangle hub call github issues search '{"q":"repo:tangle-network/agent-container is:issue"}'
178
+ tangle hub exec github.issues.search '{"q":"repo:tangle-network/agent-container is:issue"}'
152
179
 
153
180
  # With explicit connection
154
181
  tangle hub call github issues createIssue '{"owner":"foo","repo":"bar","title":"Fix bug"}' --connection conn_xxx
@@ -257,7 +284,13 @@ tangle team invitations [team] # List pending/historical invitations
257
284
  ## Workflows
258
285
 
259
286
  Authenticate with the `sk-tan-*` API key (`TANGLE_API_KEY`), same as the other
260
- platform commands, not a hub capability token.
287
+ platform commands, not a hub capability token. These commands address the
288
+ platform control plane, not the sandbox API. The host resolves from
289
+ `--base-url`, then `TANGLE_HUB_URL` (which a spawned sandbox injects to name
290
+ its own hub, so it wins over an ambient value), then `TANGLE_PLATFORM_URL`,
291
+ then `https://id.tangle.tools`. On `workflows`,
292
+ `--base-url` names the PLATFORM host — unlike `tangle keys`, where `--base-url`
293
+ is the sandbox API and `--platform-url` is the platform.
261
294
 
262
295
  Authoring a workflow (graph topology, guards, joins, KV state, decisions):
263
296
  https://sandbox.tangle.tools/docs/workflows
@@ -266,7 +299,9 @@ https://sandbox.tangle.tools/docs/workflows
266
299
  tangle workflows validate workflow.yml
267
300
  tangle workflows schema # print JSON Schema
268
301
  tangle workflows create workflow.yml
302
+ tangle workflows apply workflow.yml # create or update, matched by the definition's name
269
303
  tangle workflows list
304
+ tangle workflows fleet # run tallies over a trailing window, failing first
270
305
  tangle workflows get <id>
271
306
  tangle workflows update <id> workflow.yml
272
307
  tangle workflows enable <id>
@@ -291,6 +326,7 @@ tangle workflows runs <id> # run history
291
326
  tangle workflows run-detail <id> <runId> # single-run detail
292
327
  tangle workflows events <id> <runId> # tail live progress
293
328
  tangle workflows cancel <id> <runId> # cancel a queued/running run
329
+ tangle workflows retry <id> <runId> # re-run a failed run with the same trigger context
294
330
 
295
331
  # Cross-run KV state
296
332
  tangle workflows kv list <id>
@@ -328,10 +364,6 @@ tangle backend restart <sandboxId>
328
364
  tangle env ls
329
365
  tangle env get <id>
330
366
 
331
- # Tools (mise)
332
- tangle tools ls <id>
333
- tangle tools install <id> python 3.12
334
-
335
367
  # Batch tasks across sandboxes
336
368
  tangle batch run --tasks tasks.json
337
369
  tangle batch run --tasks tasks.json --backend writer=opencode --backend reviewer=claude-code --stream
@@ -354,10 +386,6 @@ tangle mcp serve <id>
354
386
  tangle preview ls <id>
355
387
  tangle preview create <id> 3000
356
388
  tangle preview rm <id> <preview-id>
357
-
358
- # Sandbox user permissions
359
- tangle permissions list <sandboxId>
360
- tangle permissions add <sandboxId> --userId <userId> --role editor
361
389
  ```
362
390
 
363
391
  ## Common Workflows