@tangle-network/sandbox-cli 0.23.10 → 0.23.12
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 +21 -1
- package/SKILL.md +4 -0
- package/dist/{account-Bklwl_Tx.mjs → account-ppb4-uf5.mjs} +1 -1
- package/dist/credential-store-C6gb-zro.mjs +1 -0
- package/dist/{device-D6rmGHLz.mjs → device-CggsQEHQ.mjs} +1 -1
- package/dist/index.mjs +34 -34
- package/dist/{run-BxATA6T4.mjs → run-CJ0jL7ul.mjs} +1 -1
- package/dist/{solve-signer-D6EYGOv9.mjs → solve-signer-DPwZymEr.mjs} +1 -1
- package/dist/{submit-BCCjJAeU.mjs → submit-wmXtPZX6.mjs} +1 -1
- package/package.json +7 -7
- package/dist/credential-store-DysDRcD-.mjs +0 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ tangle --json graph inspect <run-id>
|
|
|
68
68
|
tangle graph run haiku-review --resume <run-id>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
Graphs use the selected harness's native subscription login. Set `seat` in
|
|
71
|
+
Graphs use the selected harness's native subscription login by default. Set `seat` in
|
|
72
72
|
`~/.tangle/config.json` to keep a default; `--seat` overrides it for every node.
|
|
73
73
|
A graph with no integration needs requires no Tangle login. Before starting
|
|
74
74
|
agents, an interactive run connects missing needs in the browser and resumes
|
|
@@ -77,6 +77,26 @@ Validation, `--json` and noninteractive runs report missing providers with the
|
|
|
77
77
|
exact `tangle hub connect <provider>` command. Ctrl-C cancels login, connection
|
|
78
78
|
polling and pending Hub requests.
|
|
79
79
|
|
|
80
|
+
Local runs use the driver registrations supplied by the pinned `cli-bridge`
|
|
81
|
+
package. A saved graph selects its resolved harnesses; an explicit
|
|
82
|
+
`BRIDGE_BACKENDS` limits which drivers may run, including when a seat lists
|
|
83
|
+
fallbacks. Bridge accepts canonical harness names such as `claude-code` and
|
|
84
|
+
their backend aliases. A profile harness recognized by the SDK is not proof
|
|
85
|
+
that the local Bridge implements that driver; cloud deployments have their own
|
|
86
|
+
installed drivers and capability admission.
|
|
87
|
+
|
|
88
|
+
For an operator-configured API or local inference route, set
|
|
89
|
+
`BRIDGE_SUBSCRIPTIONS_ONLY=0` explicitly and supply an exact provider and model,
|
|
90
|
+
for example `--seat prime/openai/<model-id>` with Prime's native model and
|
|
91
|
+
credential configuration. Such an explicit route can use a registered driver
|
|
92
|
+
that does not publish model catalog entries. This does not establish a working
|
|
93
|
+
login or profile support: Bridge still checks the selected driver's health,
|
|
94
|
+
capabilities and native admission. An exact catalog row with authenticated native
|
|
95
|
+
status can supply the provider for an otherwise opaque model name. Automatic seat
|
|
96
|
+
selection and the default subscription-only mode still require verified
|
|
97
|
+
subscription inventory. Graph command checks remain independent of the selected
|
|
98
|
+
agent harness.
|
|
99
|
+
|
|
80
100
|
Local graph gates accept `--param gate.<id>=<choice>` or ask in the terminal.
|
|
81
101
|
Supplied choices are validated before execution and recorded with the run;
|
|
82
102
|
resume preserves them and Runtime replays completed decisions. JSON and
|
package/SKILL.md
CHANGED
|
@@ -304,8 +304,12 @@ Canonical proxy custody at create time — the value never enters the box:
|
|
|
304
304
|
```bash
|
|
305
305
|
tangle sandbox create --proxy-secret '{"envName":"PROVIDER_KEY","secretRef":{"kind":"secret-ref","key":"PROVIDER_KEY"},"presentation":{"type":"bearer"},"hosts":["api.example.org"]}'
|
|
306
306
|
tangle sandbox create --proxy-secret @bindings.json # repeatable; array or single binding
|
|
307
|
+
tangle sandbox create --proxy-secret @bindings.json --allow-domain api.example.org
|
|
308
|
+
tangle sandbox egress <id> --allow-domain api.example.org # add a host; without the flag, show the policy
|
|
307
309
|
```
|
|
308
310
|
|
|
311
|
+
The default egress policy is strict and does not reach a binding's host; create warns and names the flag.
|
|
312
|
+
|
|
309
313
|
## Snapshots
|
|
310
314
|
|
|
311
315
|
```bash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,o as t}from"./output-BqCeTtw4.mjs";import{n,t as r}from"./solve-signer-
|
|
1
|
+
import{a as e,o as t}from"./output-BqCeTtw4.mjs";import{n,t as r}from"./solve-signer-DPwZymEr.mjs";function i(i){let a=i.create?r():n();if(!a)throw Error("No Solve device signer found. Run `tangle solve account --create`");i.json?e({address:a.account.address,source:a.source}):t({Address:a.account.address,Source:a.source})}export{i as showSolveAccount};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"node:fs";import*as t from"node:path";import{randomUUID as n}from"node:crypto";import*as r from"node:os";import{execFileSync as i}from"node:child_process";import{lockSync as a}from"proper-lockfile";const o=t.join(r.homedir(),`.tangle`),s=t.join(o,`credentials.json`),c=`tangle-sandbox-cli`,l=`/usr/bin/security`,u=`tangle-base64:`,d=new Int32Array(new SharedArrayBuffer(4));var f=class extends Error{constructor(e,t){super(`Credentials file at ${e} is corrupted and cannot be parsed. Inspect or remove it manually before retrying — refusing to overwrite it automatically.`),this.filePath=e,this.name=`CredentialsFileCorruptedError`,t&&(this.cause=t)}},p=class extends Error{constructor(e){super(`Credential storage preflight failed: ${e}`),this.name=`CredentialStorageProbeError`}},m=class extends Error{constructor(e){super(`Credential storage is busy. Wait a moment and retry.`),this.name=`CredentialsFileLockedError`,e&&(this.cause=e)}};function h(e){let t=x(e);if(t)return{value:t,source:`keychain`};let n=T(e);return n?{value:n,source:`file`}:{source:`none`}}function g(e,t){return C(e,t)?(D(e),`keychain`):(E(e,t),`file`)}function _(){let e=`credential-write-probe:${process.pid}:${n()}`,t=n();if(C(e,t)){let n=x(e);if(!w(e))throw new p(`the OS keychain accepted a test credential but the CLI could not remove it`);if(n!==t)throw new p(`the OS keychain accepted a test credential but the CLI could not read it back`);return`keychain`}return j(e),`file`}function v(e){w(e),D(e)}function y(e,t,n={}){if(e===`darwin`)return{command:l,args:t.darwin,input:n.darwin};if(e===`linux`)return{command:`secret-tool`,args:t.linux,input:n.linux}}function b(e){if(e)try{return i(e.command,e.args,{encoding:`utf8`,input:e.input,stdio:[e.input===void 0?`ignore`:`pipe`,`pipe`,`ignore`],timeout:e.command===l?void 0:1e4}).trim()}catch{return}}function x(e){let t=N(e),n=b(y(process.platform,{darwin:[`find-generic-password`,`-s`,c,`-a`,t,`-w`],linux:[`lookup`,`service`,c,`account`,t]}));return n?.startsWith(u)?Buffer.from(n.slice(14),`base64`).toString(`utf8`):n}function S(e,t,n=process.platform){let r=N(e),i=`add-generic-password -U -s ${c} -a ${r} -w ${u+Buffer.from(t,`utf8`).toString(`base64`)}\n`;if(!(n===`darwin`&&Buffer.byteLength(i)>4096))return y(n,{darwin:[`-i`],linux:[`store`,`--label=Tangle Sandbox CLI`,`service`,c,`account`,r]},{darwin:i,linux:t})}function C(e,t){return b(S(e,t))===void 0?!1:x(e)===t}function w(e){let t=N(e);return b(y(process.platform,{darwin:[`delete-generic-password`,`-s`,c,`-a`,t],linux:[`clear`,`service`,c,`account`,t]}))!==void 0}function T(e){return k()[e]}function E(e,t){O(()=>{let n=k();n[e]=t,A(n)})}function D(e){return O(()=>{let t;try{t=k()}catch(e){if(e instanceof f)return!1;throw e}return e in t?(delete t[e],A(t),T(e)===void 0):!0})}function O(e){M();let t=Date.now()+2e3,n,r;for(;!n;)try{n=a(s,{realpath:!1,stale:5e3})}catch(e){if(r=e instanceof Error?e:void 0,!e||typeof e!=`object`||!(`code`in e)||e.code!==`ELOCKED`)throw e;if(Date.now()>=t)throw new m(r);Atomics.wait(d,0,0,20)}try{return e()}finally{n()}}function k(){let t;try{t=e.readFileSync(s,`utf8`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return{};throw e}try{let e=JSON.parse(t);if(typeof e!=`object`||!e||Array.isArray(e))throw new f(s);let n={};for(let[t,r]of Object.entries(e))typeof r==`string`&&(n[t]=r);return n}catch(e){throw e instanceof f?e:new f(s,e instanceof Error?e:void 0)}}function A(t){if(M(),Object.keys(t).length===0){e.existsSync(s)&&e.unlinkSync(s);return}let n=`${s}.${process.pid}.tmp`;e.writeFileSync(n,`${JSON.stringify(t,null,2)}\n`,{mode:384}),e.renameSync(n,s)}function j(e){let t=n(),r=!1,i;try{if(E(e,t),r=!0,T(e)!==t)throw new p(`the credentials file did not return the value just written`)}catch(e){i=e}finally{if(r)try{!D(e)&&!i&&(i=new p(`the credentials file accepted a test credential but the CLI could not remove it`))}catch(e){i??=e}}if(i)throw i}function M(){if(!e.existsSync(o)){e.mkdirSync(o,{mode:448,recursive:!0});return}if(process.platform!==`win32`)try{(e.statSync(o).mode&511)!=448&&e.chmodSync(o,448)}catch{}}function N(e){return`profile:${e}`}export{g as i,v as n,h as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,f as t,i as n,p as r,r as i}from"./output-BqCeTtw4.mjs";import{p as a,y as o}from"./index.mjs";import{n as s,r as c}from"./solve-signer-
|
|
1
|
+
import{a as e,f as t,i as n,p as r,r as i}from"./output-BqCeTtw4.mjs";import{p as a,y as o}from"./index.mjs";import{n as s,r as c}from"./solve-signer-DPwZymEr.mjs";import{n as l,r as u,t as d}from"./api-COxVvwlJ.mjs";import{t as f}from"./deployment-t_Jhgj4Q.mjs";import{n as p,o as m,v as h,x as g}from"./transactions-C3dKwqB0.mjs";import{createPublicClient as _,getAddress as v,http as y,isAddress as b}from"viem";import{tempoModerato as x}from"viem/chains";const S={...f,chainName:`Tempo Moderato`,nativeSymbol:`TNT`},C={async read(e){let t=_({chain:x,transport:y(S.rpcUrl,{timeout:15e3})}),n=e=>e.catch(()=>null),r=await Promise.all(e.map(async e=>{let[r,i]=await Promise.all([n(t.readContract({address:S.tangleAddress,abi:g,functionName:`isPermittedCaller`,args:[S.serviceId,e]})),n(t.readContract({address:S.managerAddress,abi:h,functionName:`isDeviceRevoked`,args:[e]}))]);return[e.toLowerCase(),{permitted:r,revoked:i}]}));return new Map(r)},async revokeSelf(e){return p(await m(S,e),S)}},w={permitted:null,revoked:null};function T(e){return e.revoked?`revoked`:e.permitted===null?`unknown`:e.permitted?`permitted`:`not permitted`}async function E(t,r=C){try{let{devices:i}=await l({apiUrl:t.apiUrl,profile:t.profile}),a=s()?.account.address.toLowerCase(),o=i.map(e=>({...e,local:e.address===a,status:e.revokedAt?`revoked`:`active`}));a&&!o.some(e=>e.local)&&o.push({address:a,local:!0,status:`unbound`,boundAt:null,lastUsedAt:null,revokedAt:null,revocationMethod:null,revocationReason:null});let c=await r.read(o.map(e=>v(e.address))),u=o.map(e=>({...e,onChain:c.get(e.address)??w}));if(t.json){e({serviceId:S.serviceId.toString(),devices:u});return}n([`Address`,`Status`,`Local`,`Service ${S.serviceId}`,`Last used`,`Revoked`],u.map(e=>[e.address,e.status,e.local?`yes`:``,T(e.onChain),e.lastUsedAt??``,e.revokedAt?`${e.revokedAt} (${e.revocationMethod})`:``]))}catch(e){o(e,t.json)}}async function D(n,l,f=C){try{if(!b(n))throw Error(`${n} is not an EVM address`);let o=v(n),p=s(),m=p?.account.address===o;if(!l.yes){if(!process.stdin.isTTY)throw Error(`Revoking a device is permanent. Re-run with --yes to confirm`);if(!await a(`Permanently revoke Solve device ${o}${m?` (this machine's device)`:``}? [y/N] `,`--yes`)){i(`Revocation cancelled`);return}}let h;if(p&&m){let e=await d({deviceAddress:o,purpose:`revoke`,apiUrl:l.apiUrl,profile:l.profile});h={challengeId:e.challengeId,signature:await p.account.signMessage({message:e.message})}}let g=await u({deviceAddress:o,reason:l.reason,...h,apiUrl:l.apiUrl,profile:l.profile}),_=o.toLowerCase(),y=(await f.read([o])).get(_)??w,x;if(p&&m&&!y.revoked){try{x=await f.revokeSelf(p.account)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`The Solve API revoked ${o}, but the on-chain revocation failed and the local key was kept: ${t}. Run the command again to retry`)}y=(await f.read([o])).get(_)??w}let C=p&&m&&y.revoked?c(p):void 0;if(l.json){e({...g,serviceId:S.serviceId.toString(),onChain:y,...x?{revocationTransaction:x}:{},localKeyRetired:!!C});return}t(g.alreadyRevoked?`${o} was already revoked in the Solve API`:`Revoked ${o}; the Solve API refuses its signatures`),x&&t(`Revoked on Tempo in ${x}; service ${S.serviceId} refuses its jobs`),C&&i("The local device key was moved aside because its address may still hold stake or rewards. Run `tangle solve account --create` for a new device"),!m&&y.permitted&&r(`The device can still submit jobs to service ${S.serviceId}. Only its key, or the Solve blueprint owner, can revoke it on chain`)}catch(e){o(e,l.json)}}export{E as listSolveDevices,D as revokeSolveDevice};
|