@tangle-network/sandbox 0.28.0-develop.20260819071312.197e010 → 0.29.0-develop.20260819083239.92e9b26

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 (2) hide show
  1. package/README.md +42 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -33,6 +33,42 @@ export SANDBOX_BASE_URL=https://sandbox.tangle.tools
33
33
 
34
34
  Install an optional peer dependency only when the selected integration requires it.
35
35
 
36
+ ## Credential boundary
37
+
38
+ `TANGLE_API_KEY` is an account-level control-plane credential. Keep it in a
39
+ trusted server, CI secret store, or CLI configuration. Never ship it, a sandbox
40
+ connection token, or provider credentials to browser JavaScript.
41
+
42
+ Mint a short-lived delegated token on the server:
43
+
44
+ ```typescript
45
+ const scoped = await box.mintScopedToken({
46
+ scope: "session-runtime",
47
+ sessionId: ownedRuntimeSessionId,
48
+ ttlMinutes: 5,
49
+ });
50
+ ```
51
+
52
+ Give the browser only `scoped.token`, `scoped.expiresAt`, and
53
+ `scoped.sidecarProxyUrl`, then construct the browser-safe client:
54
+
55
+ ```typescript
56
+ import { createSandboxRuntimeClient } from "@tangle-network/sandbox/runtime";
57
+
58
+ const runtime = createSandboxRuntimeClient({
59
+ baseUrl: delegated.sidecarProxyUrl,
60
+ token: delegated.token,
61
+ });
62
+ ```
63
+
64
+ Use `scope: "session"` plus an authorized `runtimeSessionId` for
65
+ `SessionGatewayClient` reconnect and replay. Use `scope: "read-only"` for
66
+ runtime reads that need no workspace or terminal mutation. The server must
67
+ authorize every sandbox and session identifier before minting.
68
+
69
+ See the public `/docs/authentication` guide and
70
+ `examples/browser-streaming-resume.ts`.
71
+
36
72
  ## Quick start
37
73
 
38
74
  ```typescript
@@ -182,7 +218,12 @@ const changes = await reviewer.changes();
182
218
  await reviewer.commit({ message: "Apply reviewer changes" });
183
219
  ```
184
220
 
185
- An isolated Agent requires a Git repository and returns `SandboxTaskSession`.
221
+ An isolated Agent requires a Git repository and returns
222
+ `SandboxTaskSession`. `commit()` applies the changes and removes the owned
223
+ worktree and task branch. `box.agents.stop(id)` discards an uncommitted isolated
224
+ generation and removes those owned Git resources before its durable session
225
+ record; cleanup failure leaves the record intact for a safe retry.
226
+
186
227
  Agents in one Sandbox share a broad trust and resource boundary. Use separate
187
228
  Sandboxes for mutually untrusted Agents, separate tenants, or hard resource
188
229
  isolation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "0.28.0-develop.20260819071312.197e010",
3
+ "version": "0.29.0-develop.20260819083239.92e9b26",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "sideEffects": [