@tangle-network/sandbox-cli 0.23.132 → 0.23.133
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/dist/{account-DpYhbTSh.mjs → account-710v_GcH.mjs} +1 -1
- package/dist/{clone-BRhKd1M8.mjs → clone-Cq83-HQa.mjs} +1 -1
- package/dist/{device-tAhoylw1.mjs → device-DL5SWx0P.mjs} +1 -1
- package/dist/{graph-MfPjyD5c.mjs → graph-BKI3z0fk.mjs} +4 -4
- package/dist/{graph-learning-v9CpeSVc.mjs → graph-learning-BK1ocEeg.mjs} +1 -1
- package/dist/{graph-operating-evidence-CFe_jsbE.mjs → graph-operating-evidence-DL5ElQxc.mjs} +1 -1
- package/dist/{graph-profile-learning-CE5WXQ5S.mjs → graph-profile-learning-CHeK7_8O.mjs} +1 -1
- package/dist/{graph-run-input-DKt3kkgz.mjs → graph-run-input-iB-u52EK.mjs} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/output-BRdLZpee.mjs +1 -0
- package/dist/{run-DCWcknDb.mjs → run-DXc2ylL9.mjs} +1 -1
- package/dist/{submit-81-v2Gw0.mjs → submit-SOtFQfrb.mjs} +1 -1
- package/package.json +8 -6
- package/dist/output-COlRi7gh.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,o as t}from"./output-
|
|
1
|
+
import{a as e,o as t}from"./output-BRdLZpee.mjs";import{n,t as r}from"./solve-signer-CpH58uD4.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,f as t,r as n,u as r}from"./output-
|
|
1
|
+
import{a as e,f as t,r as n,u as r}from"./output-BRdLZpee.mjs";import{v as i}from"./index.mjs";import{f as a,g as o,i as s,p as c,r as l,t as u}from"./workspace-B4tVN1WV.mjs";import{a as d}from"./api-CvScxXEC.mjs";import*as f from"node:path";import{execFile as p}from"node:child_process";import{promisify as m}from"node:util";const h=m(p);function g(){return`Task source is '${u}'. Add your fork as 'origin', commit your candidate, push it, and open a pull request before submitting.`}async function _(p,m,_){try{let i=o(await d({path:`/v1/competitions/${encodeURIComponent(p)}`,apiUrl:_.apiUrl,profile:_.profile}),`competition response`),v=c(i.competition??i),y=f.resolve(m??v.slug),b=r(`Cloning ${v.slug}…`);_.json||b.start();try{await h(`git`,[`clone`,`--no-tags`,`--origin`,u,v.repository,y],{encoding:`utf8`,maxBuffer:1e6}),await l(y,[`checkout`,`--detach`,v.taskRevision]);let e=await l(y,[`rev-parse`,`HEAD`]);if(e.toLowerCase()!==v.taskRevision.toLowerCase())throw Error(`Pinned checkout resolved to ${e}, expected ${v.taskRevision}`);await a(f.join(y,`.tangle-solve.json`),v),await s(y)}finally{b.stop()}_.json?e({competition:v,directory:y}):(t(`Cloned ${v.slug} at ${v.taskRevision.slice(0,12)}`),v.provenance&&n(g()),n(`Run the pinned checker with: cd ${y} && tangle solve run`))}catch(e){i(e)}}export{_ as cloneCompetition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,f as t,i as n,p as r,r as i}from"./output-
|
|
1
|
+
import{a as e,f as t,i as n,p as r,r as i}from"./output-BRdLZpee.mjs";import{l as a,v as o}from"./index.mjs";import{n as s,r as c}from"./solve-signer-CpH58uD4.mjs";import{n as l,r as u,t as d}from"./api-CvScxXEC.mjs";import{t as f}from"./deployment-_Lk0By4d.mjs";import{n as p,o as m,v as h,x as g}from"./transactions-Ba_26pWn.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};
|