@tangle-network/sandbox-cli 0.19.6-develop.20260812113337.9d09e17 → 0.19.19

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
@@ -52,6 +52,12 @@ pnpm --filter @tangle-network/sandbox-cli build
52
52
  node products/sandbox/cli/bin/tangle.js --help
53
53
  ```
54
54
 
55
+ ## Supervisor accounting
56
+
57
+ `tangle supervise` reports measured tokens and cost for successful and failed runs.
58
+ A run without a winner can still incur cost.
59
+ Unknown totals display as `Unavailable` and appear as `null` in JSON output.
60
+
55
61
  ## Authentication
56
62
 
57
63
  Three flows are supported:
@@ -63,8 +69,14 @@ Three flows are supported:
63
69
  Credential lookup precedence:
64
70
 
65
71
  1. `--api-key` flag
66
- 2. `TANGLE_API_KEY` environment variable
67
- 3. `~/.tangle/credentials` (populated by `tangle auth login`)
72
+ 2. `TANGLE_API_KEY_FILE` managed credential file
73
+ 3. `TANGLE_API_KEY` environment variable
74
+ 4. `~/.tangle/credentials` (populated by `tangle auth login`)
75
+
76
+ The sidecar publishes refreshed delegated credentials through `TANGLE_API_KEY_FILE`.
77
+ The CLI reads this file for each request, including requests from an existing client.
78
+ A configured file that is missing, unreadable, or malformed fails without falling back to an older key.
79
+ A verified Sandbox request can install a new source credential; an expired source cannot renew itself unattended.
68
80
 
69
81
  Common commands:
70
82
 
@@ -77,6 +89,50 @@ tangle auth profiles
77
89
 
78
90
  `tangle auth login` validates the supplied credential against `/v1/account/me`, which requires a valid token.
79
91
 
92
+ ### The two surfaces
93
+
94
+ Commands address one of two services, and the two accept different credentials.
95
+
96
+ | Surface | Command families | Credential |
97
+ |---|---|---|
98
+ | Sandbox API | `sandbox`, `exec`, `ssh`, `fs`, `process`, `snapshot`, `secret`, `agent`, `fleet`, `batch`, `usage` | the session `tangle auth login` stores, or an `sk-tan-*` key |
99
+ | Platform control plane (`id.tangle.tools`) | `keys`, `workflows`, `hub` | an `sk-tan-*` key only |
100
+
101
+ The platform does not accept the sandbox session: it belongs to a different
102
+ audience. After a browser login the CLI therefore mints a short-lived platform
103
+ key from that session on the first platform command, caches it in the same
104
+ credential store, and replaces it before it expires. Nothing durable is written
105
+ for a surface you never use, and no long-lived key sits on disk.
106
+
107
+ An `sk-tan-*` key is used exactly as supplied on both surfaces, whether it
108
+ arrives through `--api-key`, `TANGLE_API_KEY`, or `tangle auth login --api-key`,
109
+ so a spawned sandbox and a CI job keep the credential they were given and no
110
+ mint replaces it. `TANGLE_HUB_CAPABILITY_TOKEN` serves the `hub` commands only.
111
+
112
+ ### What the minted credential may do
113
+
114
+ The minted key lives for minutes, so the platform refuses key creation and
115
+ revocation through it: a credential that short must not add or destroy authority
116
+ that outlasts it.
117
+
118
+ - `tangle keys list` works after `tangle auth login`.
119
+ - `tangle keys create` and `tangle keys revoke` need a key you minted yourself:
120
+ set `TANGLE_API_KEY`, run `tangle auth login --api-key sk-tan-…`, or mint the
121
+ key in the web console.
122
+
123
+ Everything else on the control plane — `tangle workflows`, `tangle hub` — works
124
+ from the login alone.
125
+
126
+ `tangle auth status` reports both surfaces. It exits non-zero when either one
127
+ REFUSES the stored credential — a behaviour change for a script that gated on
128
+ the old sandbox-only check, and the point of it: the platform rejecting the
129
+ credential used to be reported as success. An unreachable platform is a
130
+ different answer and exits zero, because an outage says nothing about the
131
+ credential; read `platform.reachable` in `--json` to gate platform work.
132
+ `--base-url` names the sandbox host for BOTH halves: the session is checked
133
+ there, and the platform credential is minted there, so the two lines of the
134
+ answer always describe one deployment.
135
+
80
136
  ## Command Surface
81
137
 
82
138
  Top-level command groups:
@@ -227,3 +283,13 @@ Run `tangle sandbox create --help` for the current flag list.
227
283
  ## Limitations
228
284
 
229
285
  - `snapshot restore` creates a new sandbox from a snapshot; the command signature suggests in-place restore.
286
+
287
+ ## Compliance posture is not a flag
288
+
289
+ No CLI command takes a `--compliance` / HIPAA / PHI option, by design: a
290
+ caller-asserted flag could dodge the platform's observability gates or
291
+ claim a protection it never granted. The platform derives the posture from
292
+ the credential's verified attribution and pins it server-side. Reads
293
+ (`sandbox list`, `sandbox get`) surface it as the read-only `compliance:
294
+ { hipaa: true }` echo field — absent means the platform made no claim, and
295
+ `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.
@@ -147,8 +156,8 @@ Two equivalent commands are available: `call` and `exec`.
147
156
 
148
157
  ```bash
149
158
  # 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"}'
159
+ tangle hub call github issues search '{"q":"repo:tangle-network/agent-container is:issue"}'
160
+ tangle hub exec github.issues.search '{"q":"repo:tangle-network/agent-container is:issue"}'
152
161
 
153
162
  # With explicit connection
154
163
  tangle hub call github issues createIssue '{"owner":"foo","repo":"bar","title":"Fix bug"}' --connection conn_xxx
@@ -257,7 +266,13 @@ tangle team invitations [team] # List pending/historical invitations
257
266
  ## Workflows
258
267
 
259
268
  Authenticate with the `sk-tan-*` API key (`TANGLE_API_KEY`), same as the other
260
- platform commands, not a hub capability token.
269
+ platform commands, not a hub capability token. These commands address the
270
+ platform control plane, not the sandbox API. The host resolves from
271
+ `--base-url`, then `TANGLE_HUB_URL` (which a spawned sandbox injects to name
272
+ its own hub, so it wins over an ambient value), then `TANGLE_PLATFORM_URL`,
273
+ then `https://id.tangle.tools`. On `workflows`,
274
+ `--base-url` names the PLATFORM host — unlike `tangle keys`, where `--base-url`
275
+ is the sandbox API and `--platform-url` is the platform.
261
276
 
262
277
  Authoring a workflow (graph topology, guards, joins, KV state, decisions):
263
278
  https://sandbox.tangle.tools/docs/workflows
@@ -266,7 +281,9 @@ https://sandbox.tangle.tools/docs/workflows
266
281
  tangle workflows validate workflow.yml
267
282
  tangle workflows schema # print JSON Schema
268
283
  tangle workflows create workflow.yml
284
+ tangle workflows apply workflow.yml # create or update, matched by the definition's name
269
285
  tangle workflows list
286
+ tangle workflows fleet # run tallies over a trailing window, failing first
270
287
  tangle workflows get <id>
271
288
  tangle workflows update <id> workflow.yml
272
289
  tangle workflows enable <id>
@@ -291,6 +308,7 @@ tangle workflows runs <id> # run history
291
308
  tangle workflows run-detail <id> <runId> # single-run detail
292
309
  tangle workflows events <id> <runId> # tail live progress
293
310
  tangle workflows cancel <id> <runId> # cancel a queued/running run
311
+ tangle workflows retry <id> <runId> # re-run a failed run with the same trigger context
294
312
 
295
313
  # Cross-run KV state
296
314
  tangle workflows kv list <id>