@tangle-network/sandbox-cli 0.3.3 → 0.4.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.
- package/README.md +59 -2
- package/SKILL.md +56 -5
- package/dist/index.mjs +19 -19
- package/hub-reference.md +34 -29
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -86,6 +86,7 @@ Top-level command groups:
|
|
|
86
86
|
- `exec`
|
|
87
87
|
- `ssh`
|
|
88
88
|
- `agent`
|
|
89
|
+
- `fleet`
|
|
89
90
|
- `snapshot`
|
|
90
91
|
- `usage`
|
|
91
92
|
- `permissions`
|
|
@@ -112,13 +113,23 @@ tangle exec sbx_123 "npm test"
|
|
|
112
113
|
tangle ssh sbx_123
|
|
113
114
|
tangle agent prompt sbx_123 "Summarize this repo"
|
|
114
115
|
tangle agent task sbx_123 "Fix the failing tests"
|
|
116
|
+
tangle fleet create --count 4 --coordinator
|
|
115
117
|
|
|
116
118
|
# grant hub connections to the agent (see hub-reference.md for the 3 modes).
|
|
117
119
|
# the connection is an id or a provider name (resolved via `tangle hub connections`).
|
|
118
120
|
tangle agent task sbx_123 "triage issues" \
|
|
119
|
-
--connection github:github.issues.
|
|
121
|
+
--connection github:github.issues.search,github.issues.create
|
|
120
122
|
tangle agent task sbx_123 "file the report" --connection github:* --allow-writes
|
|
121
123
|
|
|
124
|
+
# temporary GPU for an eval; omitted provider picks the cheapest configured cloud
|
|
125
|
+
tangle sandbox gpu run sbx_123 \
|
|
126
|
+
--accelerator-kind nvidia-3090 \
|
|
127
|
+
--accelerator-memory 24000 \
|
|
128
|
+
--max-spend-usd 1 \
|
|
129
|
+
--max-lifetime 900 \
|
|
130
|
+
--idle-timeout 120 \
|
|
131
|
+
-- python eval.py
|
|
132
|
+
|
|
122
133
|
# state and operations
|
|
123
134
|
tangle secret list
|
|
124
135
|
tangle snapshot list sbx_123
|
|
@@ -131,9 +142,55 @@ short-lived platform Hub key from your `tangle auth login` session — no separa
|
|
|
131
142
|
key needed. See [`hub-reference.md`](./hub-reference.md) for the `--connection`
|
|
132
143
|
grant modes, `--allow-writes`, and `permissions revert-writes`.
|
|
133
144
|
|
|
145
|
+
## Temporary GPUs
|
|
146
|
+
|
|
147
|
+
Keep the base sandbox cheap and attach a GPU only while the accelerated command runs.
|
|
148
|
+
Omit `--provider` to let Tangle choose the cheapest configured GPU cloud.
|
|
149
|
+
Always set a spend cap and lifetime.
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Attach, run one command, and destroy the lease.
|
|
153
|
+
tangle sandbox gpu run sbx_123 \
|
|
154
|
+
--accelerator-kind nvidia-3090 \
|
|
155
|
+
--accelerator-memory 24000 \
|
|
156
|
+
--max-spend-usd 1 \
|
|
157
|
+
--max-lifetime 900 \
|
|
158
|
+
--idle-timeout 120 \
|
|
159
|
+
-- python eval.py
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
For multiple GPU commands, use the manual lifecycle:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
tangle sandbox gpu attach sbx_123 \
|
|
166
|
+
--accelerator-kind nvidia-3090 \
|
|
167
|
+
--accelerator-memory 24000 \
|
|
168
|
+
--max-spend-usd 1 \
|
|
169
|
+
--max-lifetime 900 \
|
|
170
|
+
--idle-timeout 120
|
|
171
|
+
|
|
172
|
+
tangle sandbox gpu list sbx_123
|
|
173
|
+
tangle sandbox gpu exec sbx_123 gpu_abc -- python eval.py
|
|
174
|
+
tangle sandbox gpu detach sbx_123 gpu_abc
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Create-time GPU flags are a shortcut over the same lease lifecycle:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
tangle sandbox create --name gpu-eval \
|
|
181
|
+
--accelerator-kind nvidia-3090 \
|
|
182
|
+
--accelerator-memory 24000 \
|
|
183
|
+
--gpu-max-spend-usd 1 \
|
|
184
|
+
--gpu-max-lifetime 900 \
|
|
185
|
+
--gpu-idle-timeout 120
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The final detach output includes billed seconds and customer cost.
|
|
189
|
+
Use `tangle usage` to inspect account-level GPU seconds and GPU spend.
|
|
190
|
+
|
|
134
191
|
## Provisioning Coverage
|
|
135
192
|
|
|
136
|
-
`tangle sandbox create` exposes the full SDK provisioning surface, including image/environment, resources (CPU, memory, disk), lifetime and idle timeout, driver and backend selection (`opencode`, `claude-code`, `codex`, `cursor`, `amp`, and other registry backends), SSH and web terminal, env and secret injection, metadata, initial permissions, git clone, tool pre-install, BYOS3 storage, snapshot restore, and outbound network controls. Run `tangle sandbox create --help` for the canonical flag list.
|
|
193
|
+
`tangle sandbox create` exposes the full SDK provisioning surface, including image/environment, resources (CPU, memory, disk), temporary GPU leases, lifetime and idle timeout, driver and backend selection (`opencode`, `claude-code`, `codex`, `cursor`, `amp`, and other registry backends), SSH and web terminal, env and secret injection, metadata, initial permissions, git clone, tool pre-install, BYOS3 storage, snapshot restore, and outbound network controls. Run `tangle sandbox create --help` for the canonical flag list.
|
|
137
194
|
|
|
138
195
|
## Limitations
|
|
139
196
|
|
package/SKILL.md
CHANGED
|
@@ -67,6 +67,44 @@ tangle sandbox expose <id> --port 3000
|
|
|
67
67
|
tangle sandbox urls <id>
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
## Temporary GPUs
|
|
71
|
+
|
|
72
|
+
Use a normal sandbox first, then attach a GPU only for the work that needs it.
|
|
73
|
+
Omit `--provider` to use the cheapest configured GPU cloud.
|
|
74
|
+
Always set a spend cap and lifetime.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# One-shot eval: attach GPU, run command, always destroy the lease.
|
|
78
|
+
tangle sandbox gpu run <sandbox-id> \
|
|
79
|
+
--accelerator-kind nvidia-3090 \
|
|
80
|
+
--accelerator-memory 24000 \
|
|
81
|
+
--max-spend-usd 1 \
|
|
82
|
+
--max-lifetime 900 \
|
|
83
|
+
--idle-timeout 120 \
|
|
84
|
+
-- python eval.py
|
|
85
|
+
|
|
86
|
+
# Manual lifecycle when the agent needs multiple GPU commands.
|
|
87
|
+
tangle sandbox gpu attach <sandbox-id> \
|
|
88
|
+
--accelerator-kind nvidia-3090 \
|
|
89
|
+
--accelerator-memory 24000 \
|
|
90
|
+
--max-spend-usd 1 \
|
|
91
|
+
--max-lifetime 900 \
|
|
92
|
+
--idle-timeout 120
|
|
93
|
+
tangle sandbox gpu exec <sandbox-id> <gpu-lease-id> -- python eval.py
|
|
94
|
+
tangle sandbox gpu detach <sandbox-id> <gpu-lease-id>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For fleets, put the same GPU lease cap on every worker:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
tangle fleet create --count 4 \
|
|
101
|
+
--accelerator-kind nvidia-3090 \
|
|
102
|
+
--accelerator-memory 24000 \
|
|
103
|
+
--gpu-max-spend-usd 1 \
|
|
104
|
+
--gpu-max-lifetime 900 \
|
|
105
|
+
--gpu-idle-timeout 120
|
|
106
|
+
```
|
|
107
|
+
|
|
70
108
|
## Hub — Full Workflow
|
|
71
109
|
|
|
72
110
|
Hub lets agents use connected provider tools (GitHub, etc.) through Tangle without seeing provider OAuth tokens.
|
|
@@ -98,7 +136,7 @@ tangle hub tools sources --json
|
|
|
98
136
|
tangle hub tools search "github issues" --provider github --json
|
|
99
137
|
|
|
100
138
|
# Describe a tool to see input/output schemas
|
|
101
|
-
tangle hub tools describe github.issues.
|
|
139
|
+
tangle hub tools describe github.issues.search --json
|
|
102
140
|
```
|
|
103
141
|
|
|
104
142
|
### Tool Execution
|
|
@@ -107,8 +145,8 @@ Two equivalent commands — `call` and `exec`:
|
|
|
107
145
|
|
|
108
146
|
```bash
|
|
109
147
|
# Basic call: <path tokens...> <json-input>
|
|
110
|
-
tangle hub call github issues
|
|
111
|
-
tangle hub exec github.issues.
|
|
148
|
+
tangle hub call github issues search '{"q":"repo:tangle-network/agent-dev-container is:issue"}'
|
|
149
|
+
tangle hub exec github.issues.search '{"q":"repo:tangle-network/agent-dev-container is:issue"}'
|
|
112
150
|
|
|
113
151
|
# With explicit connection
|
|
114
152
|
tangle hub call github issues createIssue '{"owner":"foo","repo":"bar","title":"Fix bug"}' --connection conn_xxx
|
|
@@ -125,7 +163,7 @@ tangle hub approvals approve <approval-id>
|
|
|
125
163
|
tangle hub approvals deny <approval-id>
|
|
126
164
|
|
|
127
165
|
# Set policy to always allow (skip future approvals)
|
|
128
|
-
tangle hub permissions set --connection conn_xxx --action github.issues.
|
|
166
|
+
tangle hub permissions set --connection conn_xxx --action github.issues.search --decision allow
|
|
129
167
|
|
|
130
168
|
# Set policy to always deny (block tool)
|
|
131
169
|
tangle hub permissions set --connection conn_xxx --action github.issues.deleteIssue --decision deny
|
|
@@ -221,6 +259,9 @@ tangle team invitations [team] # List pending/historical invitations
|
|
|
221
259
|
|
|
222
260
|
## Workflows
|
|
223
261
|
|
|
262
|
+
Authenticate with the `sk-tan-*` API key (`TANGLE_API_KEY`), same as the other
|
|
263
|
+
platform commands — not a hub capability token.
|
|
264
|
+
|
|
224
265
|
```bash
|
|
225
266
|
tangle workflows validate workflow.yml
|
|
226
267
|
tangle workflows schema # print JSON Schema
|
|
@@ -228,7 +269,17 @@ tangle workflows create workflow.yml
|
|
|
228
269
|
tangle workflows list
|
|
229
270
|
tangle workflows get <id>
|
|
230
271
|
tangle workflows update <id> workflow.yml
|
|
272
|
+
tangle workflows enable <id>
|
|
273
|
+
tangle workflows disable <id>
|
|
231
274
|
tangle workflows delete <id>
|
|
275
|
+
|
|
276
|
+
# Runs
|
|
277
|
+
tangle workflows run <id> # trigger a run
|
|
278
|
+
tangle workflows run <id> --input pull_request.number=123 # with trigger inputs
|
|
279
|
+
tangle workflows run <id> --wait # wait + print result
|
|
280
|
+
tangle workflows runs <id> # run history
|
|
281
|
+
tangle workflows run-detail <id> <runId> # single-run detail
|
|
282
|
+
tangle workflows events <id> <runId> # tail live progress
|
|
232
283
|
```
|
|
233
284
|
|
|
234
285
|
## Other Commands
|
|
@@ -287,7 +338,7 @@ tangle permissions add <sandboxId> --userId <userId> --role editor
|
|
|
287
338
|
| Goal | Commands |
|
|
288
339
|
|------|----------|
|
|
289
340
|
| Spin up sandbox, run agent | `tangle sandbox create --name X` → `tangle agent task <id> "..."` |
|
|
290
|
-
| Connect GitHub, read issues | `tangle hub connect github` → `tangle hub tools search "issues" --provider github` → `tangle hub call github issues
|
|
341
|
+
| Connect GitHub, read issues | `tangle hub connect github` → `tangle hub tools search "issues" --provider github` → `tangle hub call github issues search '{"q":"repo:X/Y is:issue"}'` |
|
|
291
342
|
| Push code from sandbox to GitHub | `tangle hub connect github` → `tangle git add <id> files` → `tangle git commit <id> -m "msg"` → `tangle git push <id>` |
|
|
292
343
|
| Save and restore state | `tangle snapshot create <id>` → ...work... → `tangle snapshot revert <id> <snap-id>` |
|
|
293
344
|
| Set secret for agent use | `tangle secret create GITHUB_TOKEN "..."` → agent reads via `process.env.GITHUB_TOKEN` |
|