@tangle-network/sandbox-cli 0.23.291 → 0.23.292

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/hub-reference.md CHANGED
@@ -13,6 +13,10 @@ The CLI `--json` flag prints raw response data. The SDK internally uses envelope
13
13
  tangle hub status --json
14
14
  ```
15
15
 
16
+ With a saved Sandbox browser session, `hub status` can refresh the short-lived
17
+ Hub key for this device. Scripts that already supply a Platform key can run
18
+ `tangle hub status --no-hub-key --json` to check Hub without minting a key.
19
+
16
20
  ```json
17
21
  {
18
22
  "principal": {
@@ -93,7 +97,15 @@ Graph nodes may use `needs: [{ provider: gmail, account: research, capabilities:
93
97
 
94
98
  `graph run` and `graph preflight <name-or-file>` check every node before a run exists: a seat source for each authored seat, `BRIDGE_PROXY_SECRET_COMMAND` and `BRIDGE_IRON_PROXY_BIN` for nodes that declare `proxySecrets`, and one test mint and revoke per secret key. Every unmet prerequisite prints as one line (node, requirement, fix), and `--json` returns them as `error.failures`; the minted secret is never printed.
95
99
 
96
- Custom MCP remains the canonical `profile.mcp` declaration. `graph run --mcp-policy <file>` admits it with a separate host-owned JSON policy such as `{"allowLocalMcp":true,"allowedMcpHosts":["tools.example.test"]}`. The defaults deny stdio and remote MCP; hooks remain refused. The policy is retained with a local run or cloud deployment revision and cannot change on resume. Executables and scripts must exist in the run's workspace or selected sandbox environment. Hub connections provide credential-backed tools. The local Bridge refuses custom MCP secret references until its private secret resolver is wired; never put tokens in graph source.
100
+ Declare custom MCP servers in `profile.mcp`. `graph run --mcp-policy <file>` admits them with a host-owned JSON policy such as `{"allowLocalMcp":true,"allowedMcpHosts":["tools.example.test"]}`. The default policy denies stdio, remote MCP, and hooks. The policy is retained with a local run or cloud deployment revision and cannot change on resume. Executables and scripts must exist in the run workspace or selected sandbox environment.
101
+
102
+ For the CLI's embedded local Bridge, bind a declared `secret-ref` to an environment variable. The command records neither the variable name nor its value in the graph.
103
+
104
+ ```bash
105
+ tangle graph run ./graph.yaml --mcp-policy ./local-mcp-policy.json --mcp-secret readerToken=READER_MCP_TOKEN
106
+ ```
107
+
108
+ A separately running Bridge resolves references through its own private secret provider. In the cloud, list the referenced secret names under `deploy.sandbox.secrets` so the sandbox can read them from the workflow owner's vault. Hub tools use the owner's existing Hub connection through the graph's `needs` declaration.
97
109
 
98
110
  ```json
99
111
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-cli",
3
- "version": "0.23.291",
3
+ "version": "0.23.292",
4
4
  "description": "CLI for Tangle Sandbox operations",
5
5
  "type": "module",
6
6
  "engines": {
@@ -24,12 +24,12 @@
24
24
  "@tangle-network/agent-interface": "^5.10.32",
25
25
  "@tangle-network/agent-provider-cli-bridge": "2.0.20",
26
26
  "@tangle-network/agent-runtime": "11.0.0",
27
- "@tangle-network/harness-sessions": "^1.0.13",
28
- "@tangle-network/hub-sdk": "1.0.42",
29
- "@tangle-network/sandbox": "^1.0.756",
30
- "@tangle-network/sdk-cli-runner": "^0.3.26",
27
+ "@tangle-network/harness-sessions": "1.0.20",
28
+ "@tangle-network/hub-sdk": "1.0.43",
29
+ "@tangle-network/sandbox": "^1.0.757",
30
+ "@tangle-network/sdk-cli-runner": "^0.3.27",
31
31
  "chalk": "^5.6.2",
32
- "cli-bridge": "https://codeload.github.com/drewstone/cli-bridge/tar.gz/2d0e4d84fd313a333a10d349796d8bafda3c876c",
32
+ "cli-bridge": "https://codeload.github.com/drewstone/cli-bridge/tar.gz/49ce60fa63da18820bc006e66fc8be3c86ca248d",
33
33
  "commander": "12.1.0",
34
34
  "ora": "^9.4.1",
35
35
  "proper-lockfile": "4.1.2",
@@ -61,9 +61,9 @@
61
61
  "typescript": "^6.0.3",
62
62
  "vitest": "^4.1.12",
63
63
  "@repo/shared": "0.0.0",
64
+ "@tangle-network/runtime-contracts": "0.20.0",
64
65
  "@tangle-network/sdk-session-persistence": "0.7.0",
65
- "@repo/knowledge-host": "0.0.0",
66
- "@tangle-network/runtime-contracts": "0.20.0"
66
+ "@repo/knowledge-host": "0.0.0"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public",
@@ -87,8 +87,8 @@
87
87
  "author": "Tangle Network",
88
88
  "license": "MIT",
89
89
  "tangleRelease": {
90
- "sourceSha": "0109716c1429118a640851044612cf7fa13692d9",
91
- "mergedAt": "2026-12-01T15:30:15-08:00"
90
+ "sourceSha": "c9bc44eb5d77e9b58a1e31b87814c8ac2937940f",
91
+ "mergedAt": "2026-12-01T16:15:45-08:00"
92
92
  },
93
93
  "scripts": {
94
94
  "build": "tsdown",
@@ -1 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-CgXYkLm_.mjs";import{constants as t}from"node:fs";import{basename as n,dirname as r,isAbsolute as i,join as a}from"node:path";import{createHash as o}from"node:crypto";import{z as s}from"zod";import{open as c,realpath as l}from"node:fs/promises";import*as u from"@tangle-network/agent-runtime/kernel";import{HARNESS_TRANSCRIPT_DENY as d,locateDeclaredSessionFiles as f,readHeldSessionFile as p,readSessionInput as m,withinPath as h}from"@tangle-network/harness-sessions";var g=e({graphNativeProducerCapture:()=>P,graphNativeProducerModule:()=>_,graphNativeReaderAvailable:()=>y,nativeCaptureMetadataPath:()=>v,nativeCaptureParser:()=>j,readBridgeTerminal:()=>N,retainedNativeCaptureFamily:()=>A});const _=import.meta.url,v=`__bridge__/native-capture.json`;function y(e){return[`codex`,`claude-code`].includes(e)}const b=s.string().regex(/^sha256:[a-f0-9]{64}$/u),x=s.number().int().nonnegative().safe(),S=s.object({status:s.literal(`retained`),path:s.string().refine(i),sha256:b,byteLength:x}),C=s.object({path:s.string().min(1),nativeSessionId:s.string().min(1),sha256:b,byteLength:x}),w=s.object({schema:s.literal(`tangle.raw-evidence-archive.v2`),nativeSessions:s.tuple([s.object({harness:s.enum([`codex`,`claude-code`]),nativeSessionId:s.string().min(1),complete:s.boolean(),missingReasons:s.array(s.string())})]),bridge:s.object({schema:s.literal(`cli-bridge.native-capture.v1`),familyVerified:s.literal(!0),runId:s.string(),requestDigest:b,sessionId:s.string(),executionId:s.string(),provider:s.string(),environmentId:s.string(),profileDigest:b,cwd:s.string(),nativeStore:s.object({harness:s.enum([`codex`,`claude-code`]),root:s.string().refine(i),basis:s.literal(`host-jail`)}),family:s.array(C).min(1),processIds:s.array(s.string()).min(1),processes:s.array(s.object({captureId:s.string(),pid:s.number().int().positive().nullable(),exitCode:s.number().int().nullable(),signal:s.string().nullable(),closedAt:s.iso.datetime()})).min(1),files:s.array(s.object({path:s.string(),nativeSessionId:s.string(),parentNativeSessionId:s.string().nullable(),sourceSha256:b,sourceByteLength:x,retainedSha256:b,retainedByteLength:x,payload:s.string(),redacted:s.boolean(),truncated:s.boolean()})).min(1)})}),T=e=>`sha256:${o(`sha256`).update(e).digest(`hex`)}`,E=t.O_RDONLY|t.O_DIRECTORY|t.O_NOFOLLOW,D=t.O_RDONLY|t.O_NOFOLLOW|t.O_NONBLOCK;async function O(e,t,n,r){r.throwIfAborted();let i=await e.stat();if(!i.isFile()||i.uid!==process.getuid?.()||i.mode&63||i.nlink!==1||i.size!==t.byteLength||i.size>n)throw Error(`Native producer file is not a private bounded regular file`);let a=await p(e,n,r);if(a.length!==t.byteLength||T(a)!==t.sha256)throw Error(`Native producer bytes changed after commitment`);return a}function k({request:e,ref:t,manifest:n,manifestBytes:r},i){let o=n.bridge,s=n.nativeSessions[0];if(o.runId!==t.runId||o.requestDigest!==t.requestDigest||o.sessionId!==t.sessionId||o.provider!==t.provider||o.environmentId!==t.environmentId||o.executionId!==t.executionId||o.profileDigest!==e.profileDigest||o.cwd!==e.cwd||o.nativeStore.harness!==e.harness||s.harness!==e.harness||!h(o.nativeStore.root,a(i,`.agent-home`))||o.family.length!==o.files.length||o.family.length+1>u.HARNESS_TRANSCRIPT_READ_LIMITS.maxFiles||o.files.reduce((e,t)=>e+t.retainedByteLength,r.byteLength)>u.HARNESS_TRANSCRIPT_READ_LIMITS.maxTotalBytes||o.family.some(e=>e.path===`__bridge__/native-capture.json`)||o.processIds.length!==o.processes.length||new Set(o.processIds).size!==o.processIds.length||new Set(o.processes.map(e=>e.captureId)).size!==o.processes.length||o.processes.some(e=>!o.processIds.includes(e.captureId)))throw Error(`Native producer manifest identity or inventory differs from its admitted Scope`);if(new Set(o.files.map(e=>e.path)).size!==o.files.length||new Set(o.files.map(e=>e.payload)).size!==o.files.length||new Set(o.files.map(e=>JSON.stringify([e.path,e.nativeSessionId]))).size!==o.files.length||new Set(o.family.map(e=>JSON.stringify([e.path,e.nativeSessionId]))).size!==o.family.length||o.family.some(e=>!o.files.some(t=>t.path===e.path&&t.nativeSessionId===e.nativeSessionId&&t.retainedSha256===e.sha256&&t.retainedByteLength===e.byteLength)))throw Error(`Native producer manifest repeats a file binding`);if(o.files.some(e=>d.test(e.payload)||d.test(e.path))||s.complete&&(s.missingReasons.length||o.files.some(e=>e.redacted||e.truncated))||o.files.some(e=>!e.redacted&&!e.truncated&&(e.sourceSha256!==e.retainedSha256||e.sourceByteLength!==e.retainedByteLength)))throw Error(`Native producer manifest names denied files or inconsistent original coverage`)}function A(e){let t=e.files.filter(e=>e.path===v),n=t[0];if(!n)return;let r=Buffer.from(n.content,`utf8`),i=w.parse(JSON.parse(n.content)),a=i.bridge,o=e.binding,s=o?.controlRef??e.source?.controlRef;if(t.length!==1||n.bytes!==r.length||!o||!s||o.nativeSessionId!==i.nativeSessions[0].nativeSessionId||o.sessionId!==s.sessionId||o.runs.length!==1||o.runs[0]?.runId!==s.runId||o.runs[0]?.requestDigest!==s.requestDigest)throw Error(`Retained native producer identity differs from its execution binding`);k({manifest:i,manifestBytes:r,ref:s,request:{harness:e.harness,profileDigest:o.profileDigest,cwd:a.cwd}},a.cwd);let c=e.files.filter(e=>e.path!==v);if(c.length!==a.family.length||new Set(c.map(e=>e.path)).size!==c.length||a.family.some(e=>!c.some(t=>t.path===e.path&&t.bytes===e.byteLength)))throw Error(`Retained native files differ from the producer family commitment`);return a}function j(e,t,n){let r=e=>{let n=t.files.find(t=>t.path===e.path&&t.nativeSessionId===e.nativeSessionId);if(!n)throw Error(`Native child provenance is absent`);return n},i=(e,i)=>{if((e.parentNativeSessionId??null)!==r(i).parentNativeSessionId)throw Error(`Native child parent differs from the producer commitment`);if(i.nativeSessionId===n&&e.cwd!==t.cwd)throw Error(`Native root workspace is unavailable or differs from the admitted execution`);return e};return{parse:(t,n)=>i(m(e,{text:t},{nativeSessionId:n.nativeSessionId,parentNativeSessionId:r(n).parentNativeSessionId,label:n.path},{corruption:`strict`}),n)}}async function M({request:e,ref:t,manifest:n,manifestBytes:r},i,a){let o=n.bridge,s=n.nativeSessions[0],c={harness:e.harness,binding:{kind:`bridge`,controlRef:t,sessionId:e.sessionId,profileDigest:e.profileDigest,nativeSessionId:s.nativeSessionId,runs:e.runs,...e.node?{node:e.node}:{}},nativeSessionId:s.nativeSessionId,files:o.family,signal:e.signal,...j(e.harness,o,s.nativeSessionId),read:async(t,n)=>{let r=o.files.find(e=>e.path===t.path&&e.nativeSessionId===t.nativeSessionId),a=i.find(e=>e.store===t.path);if(!a||!r||t.sha256!==r.retainedSha256||t.byteLength!==r.retainedByteLength)throw Error(`Native producer retained hash or length differs from its family binding`);return O(a.handle,{sha256:r.retainedSha256,byteLength:r.retainedByteLength},u.HARNESS_TRANSCRIPT_READ_LIMITS.maxFileBytes,n??e.signal)}},l=await u.captureBoundHarnessTranscript(c);if(l.status!==`captured`)return l;let d={...l.artifact,files:[...l.artifact.files,{path:v,bytes:r.byteLength,content:new TextDecoder(`utf-8`,{fatal:!0}).decode(r)}]};if(s.complete)return{...l,artifact:d,fileCount:l.fileCount+1,totalBytes:l.totalBytes+r.byteLength};let f=o.files.filter(e=>e.redacted||e.truncated).map(e=>({path:e.path,reason:`Original native bytes are incomplete; source ${e.sourceSha256} (${e.sourceByteLength} bytes); producer ${a}; retained bytes are digest-checked`}));return{...l,artifact:{...d,skipped:[...d.skipped,...f]},fileCount:l.fileCount+1,totalBytes:l.totalBytes+r.byteLength,skippedCount:l.skippedCount+f.length,coverageComplete:!1,missing:[...new Set(s.missingReasons.length?s.missingReasons:[`native-original-byte-coverage`])]}}async function N(e,t,n){let r=await fetch(`${e.bridgeUrl}/v1/runs/${encodeURIComponent(t.runId)}`,{headers:{authorization:`Bearer ${e.bridgeBearer}`},signal:n,redirect:`error`});if(!r.ok)return;let i=s.object({id:s.string(),provider:s.string(),environmentId:s.string(),sessionId:s.string(),executionId:s.string(),requestDigest:b,terminal:s.literal(!0),status:s.enum([`done`,`error`,`cancelled`]),nativeCapture:s.unknown()}).parse(await r.json());if(i.id!==t.runId||i.provider!==t.provider||i.environmentId!==t.environmentId||i.sessionId!==t.sessionId||i.executionId!==t.executionId||i.requestDigest!==t.requestDigest)throw Error(`Bridge terminal proof names another exact execution`);return i}function P(e){return async t=>{let i=()=>({status:`unavailable`,reason:`capture-failed`,skipped:[{path:t.sessionId,reason:`The exact native producer family is unavailable or unsupported`}]});if(process.platform!==`linux`||!t.controlRef||!t.node||t.runs.length!==1||!y(t.harness))return i();let a=t.controlRef;if(t.runs[0]?.runId!==a.runId||t.runs[0]?.requestDigest!==a.requestDigest||a.sessionId!==t.sessionId||t.cwd!==e.cwd)throw Error(`Native producer request names another admitted execution`);let o=await N(e,a,t.signal);if(!o)return i();let s=S.safeParse(o.nativeCapture);if(!s.success||s.data.byteLength>u.HARNESS_TRANSCRIPT_READ_LIMITS.maxFileBytes)return i();let d=r(s.data.path);if(await l(d)!==d||!n(s.data.path).endsWith(`.native.json`))throw Error(`Native producer manifest path is not canonical`);let p=await c(d,E),m=[];try{let i=await p.stat();if(i.uid!==process.getuid?.()||i.mode&63||h(d,e.cwd))throw Error(`Native producer spool is not private to its host`);let o=await c(`/proc/self/fd/${p.fd}/${n(s.data.path)}`,D),l,g;try{g=await O(o,s.data,u.HARNESS_TRANSCRIPT_READ_LIMITS.maxFileBytes,t.signal),l=w.parse(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(g)))}finally{await o.close()}let _={request:t,ref:a,manifest:l,manifestBytes:g};k(_,e.cwd);let v=l.bridge,y=await f({home:p,uid:i.uid,maxEntries:u.HARNESS_TRANSCRIPT_READ_LIMITS.maxFiles,signal:t.signal,stores:v.files.map(e=>({store:e.path,root:r(e.payload),matches:t=>t===n(e.payload)}))});if(m=y.files,y.rejected.length||m.length!==v.files.length)throw Error(`Native producer payload is missing or unsafe`);return await M(_,m,s.data.sha256)}finally{try{await Promise.all(m.map(e=>e.handle.close()))}finally{await p.close()}}}}export{v as a,A as c,g as i,_ as n,j as o,y as r,N as s,P as t};