filecoin 0.0.0 → 0.5.1
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/LICENSE +21 -0
- package/README.md +139 -10
- package/bin/filecoin.js +7 -0
- package/dist/chunks/_esm-BBXTTBLC.js +9 -0
- package/dist/chunks/_esm-BBXTTBLC.js.map +7 -0
- package/dist/chunks/ccip-TGFMQFIR.js +3 -0
- package/dist/chunks/ccip-TGFMQFIR.js.map +7 -0
- package/dist/chunks/chunk-2VZELE36.js +124 -0
- package/dist/chunks/chunk-2VZELE36.js.map +7 -0
- package/dist/chunks/chunk-35V77X3C.js +12 -0
- package/dist/chunks/chunk-35V77X3C.js.map +7 -0
- package/dist/chunks/chunk-3TJUKWFC.js +6 -0
- package/dist/chunks/chunk-3TJUKWFC.js.map +7 -0
- package/dist/chunks/chunk-5CKSVYCY.js +4 -0
- package/dist/chunks/chunk-5CKSVYCY.js.map +7 -0
- package/dist/chunks/chunk-7MEK5RQ7.js +11 -0
- package/dist/chunks/chunk-7MEK5RQ7.js.map +7 -0
- package/dist/chunks/chunk-AHVL5QFR.js +4 -0
- package/dist/chunks/chunk-AHVL5QFR.js.map +7 -0
- package/dist/chunks/chunk-CC75NTEJ.js +5 -0
- package/dist/chunks/chunk-CC75NTEJ.js.map +7 -0
- package/dist/chunks/chunk-D63BUPKY.js +3 -0
- package/dist/chunks/chunk-D63BUPKY.js.map +7 -0
- package/dist/chunks/chunk-FCVBKUS5.js +4 -0
- package/dist/chunks/chunk-FCVBKUS5.js.map +7 -0
- package/dist/chunks/chunk-I5AWWJGL.js +3 -0
- package/dist/chunks/chunk-I5AWWJGL.js.map +7 -0
- package/dist/chunks/chunk-IFG72OQD.js +4 -0
- package/dist/chunks/chunk-IFG72OQD.js.map +7 -0
- package/dist/chunks/chunk-JUFFOBKU.js +59 -0
- package/dist/chunks/chunk-JUFFOBKU.js.map +7 -0
- package/dist/chunks/chunk-P2G2GV6U.js +3 -0
- package/dist/chunks/chunk-P2G2GV6U.js.map +7 -0
- package/dist/chunks/chunk-PSXNKYPA.js +3 -0
- package/dist/chunks/chunk-PSXNKYPA.js.map +7 -0
- package/dist/chunks/chunk-QAYTK26Z.js +4 -0
- package/dist/chunks/chunk-QAYTK26Z.js.map +7 -0
- package/dist/chunks/chunk-QLZRQUR6.js +4 -0
- package/dist/chunks/chunk-QLZRQUR6.js.map +7 -0
- package/dist/chunks/chunk-RK6JJQZL.js +41 -0
- package/dist/chunks/chunk-RK6JJQZL.js.map +7 -0
- package/dist/chunks/chunk-S2DTA2FM.js +3 -0
- package/dist/chunks/chunk-S2DTA2FM.js.map +7 -0
- package/dist/chunks/chunk-SVWQJYA5.js +3 -0
- package/dist/chunks/chunk-SVWQJYA5.js.map +7 -0
- package/dist/chunks/chunk-TCUXKQ65.js +4 -0
- package/dist/chunks/chunk-TCUXKQ65.js.map +7 -0
- package/dist/chunks/chunk-UW35AN2V.js +186 -0
- package/dist/chunks/chunk-UW35AN2V.js.map +7 -0
- package/dist/chunks/chunk-VGOSQFKJ.js +3 -0
- package/dist/chunks/chunk-VGOSQFKJ.js.map +7 -0
- package/dist/chunks/chunk-YIAP3JO3.js +3 -0
- package/dist/chunks/chunk-YIAP3JO3.js.map +7 -0
- package/dist/chunks/chunk-ZAMDBJVN.js +3 -0
- package/dist/chunks/chunk-ZAMDBJVN.js.map +7 -0
- package/dist/chunks/delete-SPJVG4ZK.js +3 -0
- package/dist/chunks/delete-SPJVG4ZK.js.map +7 -0
- package/dist/chunks/doctor-AQGSDILX.js +3 -0
- package/dist/chunks/doctor-AQGSDILX.js.map +7 -0
- package/dist/chunks/get-C4RUQWRS.js +3 -0
- package/dist/chunks/get-C4RUQWRS.js.map +7 -0
- package/dist/chunks/inspect-NXI72CUH.js +3 -0
- package/dist/chunks/inspect-NXI72CUH.js.map +7 -0
- package/dist/chunks/inspect-SBGOKBEP.js +3 -0
- package/dist/chunks/inspect-SBGOKBEP.js.map +7 -0
- package/dist/chunks/login-3LYCAAPW.js +4 -0
- package/dist/chunks/login-3LYCAAPW.js.map +7 -0
- package/dist/chunks/logout-JLRMENQI.js +3 -0
- package/dist/chunks/logout-JLRMENQI.js.map +7 -0
- package/dist/chunks/ls-N5D6HCA4.js +3 -0
- package/dist/chunks/ls-N5D6HCA4.js.map +7 -0
- package/dist/chunks/ls-O5RNPZCH.js +3 -0
- package/dist/chunks/ls-O5RNPZCH.js.map +7 -0
- package/dist/chunks/map-error-QLS3CQMO.js +3 -0
- package/dist/chunks/map-error-QLS3CQMO.js.map +7 -0
- package/dist/chunks/put-GTJP7IFM.js +3 -0
- package/dist/chunks/put-GTJP7IFM.js.map +7 -0
- package/dist/chunks/resume-BCEYVRX7.js +3 -0
- package/dist/chunks/resume-BCEYVRX7.js.map +7 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js +3 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js.map +7 -0
- package/dist/chunks/skills.run-E7FJPXEM.js +5 -0
- package/dist/chunks/skills.run-E7FJPXEM.js.map +7 -0
- package/dist/chunks/status-IWMRFMPV.js +3 -0
- package/dist/chunks/status-IWMRFMPV.js.map +7 -0
- package/dist/main.js +3 -0
- package/dist/main.js.map +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -10
- package/skills/filecoin/SKILL.md +41 -0
- package/basic_types.md +0 -94
- package/chain.md +0 -280
- package/index.js +0 -1
- package/messages.md +0 -1684
- package/state.md +0 -1415
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../node_modules/.pnpm/clipact@0.4.0/node_modules/clipact/src/define.ts", "../../../../node_modules/.pnpm/clipact@0.4.0/node_modules/clipact/src/json-schema.ts", "../../../../node_modules/.pnpm/clipact@0.4.0/node_modules/clipact/src/errors.ts", "../../../../node_modules/.pnpm/clipact@0.4.0/node_modules/clipact/src/skills.ts"],
|
|
4
|
+
"sourcesContent": [null, null, null, null],
|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,KAAM,SACN,YAAa,+DACb,SAAU,CAAC,GAAGH,EAAI,IAAI,uBAAuB,EAC7C,MAAOf,EACP,OAAQC,EACR,SAAU,GACV,MAAQkB,GACNA,EAAK,OACF,IACEC,GACC,GAAGA,EAAK,OAAO,OAAO,CAAC,CAAC,IAAIlB,EAAQkB,EAAK,IAAI,CAAC,GAAGA,EAAK,QAAU,KAAKA,EAAK,OAAO,IAAM,EAAE,EAAE,EAE9F,KAAK;CAAI,EACd,QAASR,EAAMS,GAAQA,EAAI,OAAON,EAAKL,EAAQa,CAAM,CAAC,EACvD,EACD,OAAOC,EAAY,CACjB,KAAM,SACN,YAAa,iDACb,SAAU,CAACP,EAASM,EAAQD,CAAS,EACtC,CACH",
|
|
6
|
+
"names": ["OK", "isOk", "value", "createOk", "data", "next", "HANDLER", "isHandler", "defineCommand", "options", "secret", "BUILTIN_NODES", "markBuiltin", "node", "isBuiltin", "leaves", "prefix", "child", "printsPlainText", "commandPathField", "defineGroup", "defineHandler", "_command", "run", "ctx", "fromJsonSchema", "schema", "jsonSchema", "value", "issues", "result", "check", "node", "path", "record", "properties", "key", "property", "items", "item", "index", "inputIssues", "fromJsonSchema", "confirmationReason", "BUILTIN_ERRORS", "BUILTIN_ERROR_CODES", "SKILLS_ERRORS", "errorRegistry", "own", "skills", "framework", "code", "TRANSIENT_ERROR_CODES", "CliError", "options", "isCliError", "value", "DefinitionError", "command", "message", "homedir", "relative", "sep", "fileURLToPath", "TARGETS", "SCOPES", "scopeName", "scope", "target", "string", "targetName", "object", "properties", "optional", "key", "copiesOutput", "actions", "extra", "installInput", "fromJsonSchema", "installOutput", "uninstallInput", "uninstallOutput", "statusInput", "statusOutput", "display", "path", "cwd", "sep", "relative", "home", "homedir", "skillsPath", "source", "fileURLToPath", "lazy", "create", "skillsGroup", "cli", "skills", "install", "defineCommand", "data", "copy", "run", "uninstall", "status", "defineGroup"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{C as z,a as e,b as a,c as l,e as u,f as s,g as c,i as o,k as t,u as m,v as d,w as p}from"./chunk-JUFFOBKU.js";import{d as i}from"./chunk-3TJUKWFC.js";var v=i({name:"ls",description:"List managed resources, newest first",examples:["filecoin ls","filecoin ls --all --limit 50"],input:c({...p,all:l().default(!1).describe("Include resources pending removal"),...m}),env:d,secrets:["sessionKey"],output:s({network:e(),resources:u(s({ref:e(),kind:o(["file","folder"]),name:e(),size:a().int(),status:o(["active","removal_pending"]),url:e().describe("filecoin-api link a browser renders"),createdAt:e()})),nextCursor:e().optional()}),errors:[t.authRequired,t.loginPending],readOnly:!0,human:n=>n.resources.length===0?`No resources on ${n.network}.`:[...n.resources.map(r=>`${r.ref} ${r.kind.padEnd(8)} ${z(r.size).padStart(10)} ${r.name}${r.status==="active"?"":` (${r.status})`}`),...n.nextCursor?[`more: --cursor ${n.nextCursor}`]:[]].join(`
|
|
3
|
+
`),handler:()=>import("./ls-O5RNPZCH.js")});export{v as a};
|
|
4
|
+
//# sourceMappingURL=chunk-5CKSVYCY.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/ls.ts"],
|
|
4
|
+
"sourcesContent": ["import { defineCommand } from 'clipact'\nimport * as z from 'zod'\nimport { ErrorCodes } from '../errors.ts'\nimport { account, accountEnv, formatBytes, paging } from './shared.ts'\n\n/** `filecoin ls`: list managed resources, newest first, one page at a time. */\nexport const ls = defineCommand({\n name: 'ls',\n description: 'List managed resources, newest first',\n examples: ['filecoin ls', 'filecoin ls --all --limit 50'],\n input: z.strictObject({\n ...paging,\n all: z\n .boolean()\n .default(false)\n .describe('Include resources pending removal'),\n ...account,\n }),\n env: accountEnv,\n secrets: ['sessionKey'],\n output: z.object({\n network: z.string(),\n resources: z.array(\n z.object({\n ref: z.string(),\n kind: z.enum(['file', 'folder']),\n name: z.string(),\n size: z.number().int(),\n status: z.enum(['active', 'removal_pending']),\n url: z.string().describe('filecoin-api link a browser renders'),\n createdAt: z.string(),\n })\n ),\n nextCursor: z.string().optional(),\n }),\n errors: [ErrorCodes.authRequired, ErrorCodes.loginPending],\n readOnly: true,\n human: (data) =>\n data.resources.length === 0\n ? `No resources on ${data.network}.`\n : [\n ...data.resources.map(\n (r) =>\n `${r.ref} ${r.kind.padEnd(8)} ${formatBytes(r.size).padStart(10)} ${r.name}${r.status === 'active' ? '' : ` (${r.status})`}`\n ),\n ...(data.nextCursor ? [`more: --cursor ${data.nextCursor}`] : []),\n ].join('\\n'),\n handler: () => import('../handlers/ls.ts'),\n})\n"],
|
|
5
|
+
"mappings": ";6JAMO,IAAMA,EAAKC,EAAc,CAC9B,KAAM,KACN,YAAa,uCACb,SAAU,CAAC,cAAe,8BAA8B,EACxD,MAASC,EAAa,CACpB,GAAGC,EACH,IACGC,EAAQ,EACR,QAAQ,EAAK,EACb,SAAS,mCAAmC,EAC/C,GAAGC,CACL,CAAC,EACD,IAAKC,EACL,QAAS,CAAC,YAAY,EACtB,OAAUC,EAAO,CACf,QAAWC,EAAO,EAClB,UAAaC,EACTF,EAAO,CACP,IAAOC,EAAO,EACd,KAAQE,EAAK,CAAC,OAAQ,QAAQ,CAAC,EAC/B,KAAQF,EAAO,EACf,KAAQG,EAAO,EAAE,IAAI,EACrB,OAAUD,EAAK,CAAC,SAAU,iBAAiB,CAAC,EAC5C,IAAOF,EAAO,EAAE,SAAS,qCAAqC,EAC9D,UAAaA,EAAO,CACtB,CAAC,CACH,EACA,WAAcA,EAAO,EAAE,SAAS,CAClC,CAAC,EACD,OAAQ,CAACI,EAAW,aAAcA,EAAW,YAAY,EACzD,SAAU,GACV,MAAQC,GACNA,EAAK,UAAU,SAAW,EACtB,mBAAmBA,EAAK,OAAO,IAC/B,CACE,GAAGA,EAAK,UAAU,IACf,GACC,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,OAAO,CAAC,CAAC,IAAIC,EAAY,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,SAAW,SAAW,GAAK,KAAK,EAAE,MAAM,GAAG,EAChI,EACA,GAAID,EAAK,WAAa,CAAC,kBAAkBA,EAAK,UAAU,EAAE,EAAI,CAAC,CACjE,EAAE,KAAK;AAAA,CAAI,EACjB,QAAS,IAAM,OAAO,kBAAmB,CAC3C,CAAC",
|
|
6
|
+
"names": ["ls", "defineCommand", "strictObject", "paging", "boolean", "account", "accountEnv", "object", "string", "array", "_enum", "number", "ErrorCodes", "data", "formatBytes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import*as s from"node:crypto";var l=s&&typeof s=="object"&&"webcrypto"in s?s.webcrypto:s&&typeof s=="object"&&"randomBytes"in s?s:void 0;function N(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function E(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function x(t,...e){if(!N(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function q(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");E(t.outputLen),E(t.blockLen)}function J(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Q(t,e){x(t);let n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Y(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Z(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function $(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function tt(t,e){return t<<32-e|t>>>e}var v=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function V(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function F(t){for(let e=0;e<t.length;e++)t[e]=V(t[e]);return t}var et=v?t=>t:F;function j(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function D(t){return typeof t=="string"&&(t=j(t)),x(t),t}function nt(...t){let e=0;for(let r=0;r<t.length;r++){let o=t[r];x(o),e+=o.length}let n=new Uint8Array(e);for(let r=0,o=0;r<t.length;r++){let i=t[r];n.set(i,o),o+=i.length}return n}var U=class{};function rt(t){let e=r=>t().update(D(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function ot(t=32){if(l&&typeof l.getRandomValues=="function")return l.getRandomValues(new Uint8Array(t));if(l&&typeof l.randomBytes=="function")return Uint8Array.from(l.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}var m=BigInt(0),b=BigInt(1);function A(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function B(t){if(!A(t))throw new Error("Uint8Array expected")}function ft(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function ct(t){let e=t.toString(16);return e.length&1?"0"+e:e}function S(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?m:BigInt("0x"+t)}var I=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",R=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function T(t){if(B(t),I)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=R[t[n]];return e}var p={_0:48,_9:57,A:65,F:70,a:97,f:102};function H(t){if(t>=p._0&&t<=p._9)return t-p._0;if(t>=p.A&&t<=p.F)return t-(p.A-10);if(t>=p.a&&t<=p.f)return t-(p.a-10)}function _(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(I)return Uint8Array.fromHex(t);let e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let r=new Uint8Array(n);for(let o=0,i=0;o<n;o++,i+=2){let u=H(t.charCodeAt(i)),f=H(t.charCodeAt(i+1));if(u===void 0||f===void 0){let a=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+i)}r[o]=u*16+f}return r}function ut(t){return S(T(t))}function st(t){return B(t),S(T(Uint8Array.from(t).reverse()))}function C(t,e){return _(t.toString(16).padStart(e*2,"0"))}function pt(t,e){return C(t,e).reverse()}function at(t,e,n){let r;if(typeof e=="string")try{r=_(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(A(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");let o=r.length;if(typeof n=="number"&&o!==n)throw new Error(t+" of length "+n+" expected, got "+o);return r}function M(...t){let e=0;for(let r=0;r<t.length;r++){let o=t[r];B(o),e+=o.length}let n=new Uint8Array(e);for(let r=0,o=0;r<t.length;r++){let i=t[r];n.set(i,o),o+=i.length}return n}function lt(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}var w=t=>typeof t=="bigint"&&m<=t;function W(t,e,n){return w(t)&&w(e)&&w(n)&&e<=t&&t<n}function dt(t,e,n,r){if(!W(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function gt(t){let e;for(e=0;t>m;t>>=b,e+=1);return e}var yt=t=>(b<<BigInt(t))-b,h=t=>new Uint8Array(t),L=t=>Uint8Array.from(t);function xt(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=h(t),o=h(t),i=0,u=()=>{r.fill(1),o.fill(0),i=0},f=(...c)=>n(o,r,...c),a=(c=h(0))=>{o=f(L([0]),c),r=f(),c.length!==0&&(o=f(L([1]),c),r=f())},O=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let c=0,d=[];for(;c<e;){r=f();let g=r.slice();d.push(g),c+=r.length}return M(...d)};return(c,d)=>{u(),a(c);let g;for(;!(g=d(O()));)a();return u(),g}}var X={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||A(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function wt(t,e,n={}){let r=(o,i,u)=>{let f=X[i];if(typeof f!="function")throw new Error("invalid validator function");let a=t[o];if(!(u&&a===void 0)&&!f(a,t))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+a)};for(let[o,i]of Object.entries(e))r(o,i,!1);for(let[o,i]of Object.entries(n))r(o,i,!0);return t}function ht(t){let e=new WeakMap;return(n,...r)=>{let o=e.get(n);if(o!==void 0)return o;let i=t(n,...r);return e.set(n,i),i}}var y=BigInt(4294967295),k=BigInt(32);function z(t,e=!1){return e?{h:Number(t&y),l:Number(t>>k&y)}:{h:Number(t>>k&y)|0,l:Number(t&y)|0}}function mt(t,e=!1){let n=t.length,r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){let{h:u,l:f}=z(t[i],e);[r[i],o[i]]=[u,f]}return[r,o]}var At=(t,e,n)=>t<<n|e>>>32-n,Bt=(t,e,n)=>e<<n|t>>>32-n,Et=(t,e,n)=>e<<n-32|t>>>64-n,Ut=(t,e,n)=>t<<n-32|e>>>64-n;export{mt as a,At as b,Bt as c,Et as d,Ut as e,E as f,x as g,q as h,J as i,Q as j,Y as k,Z as l,$ as m,tt as n,et as o,D as p,nt as q,U as r,rt as s,ot as t,A as u,B as v,ft as w,ct as x,T as y,_ as z,ut as A,st as B,C,pt as D,at as E,M as F,lt as G,W as H,dt as I,gt as J,yt as K,xt as L,wt as M,ht as N};
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
@noble/hashes/esm/utils.js:
|
|
6
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
7
|
+
|
|
8
|
+
@noble/curves/esm/abstract/utils.js:
|
|
9
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-7MEK5RQ7.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/src/cryptoNode.ts", "../../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/src/utils.ts", "../../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/src/abstract/utils.ts", "../../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/src/_u64.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal webcrypto alias.\n * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.\n * Falls back to Node.js built-in crypto for Node.js <=v14.\n * See utils.ts for details.\n * @module\n */\n// @ts-ignore\nimport * as nc from 'node:crypto';\nexport const crypto: any =\n nc && typeof nc === 'object' && 'webcrypto' in nc\n ? (nc.webcrypto as any)\n : nc && typeof nc === 'object' && 'randomBytes' in nc\n ? nc\n : undefined;\n", "/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\n/** Asserts something is positive integer. */\nexport function anumber(n: number): void {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n);\n}\n\n/** Asserts something is Uint8Array. */\nexport function abytes(b: Uint8Array | undefined, ...lengths: number[]): void {\n if (!isBytes(b)) throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n\n/** Asserts something is hash */\nexport function ahash(h: IHash): void {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance: any, checkFinished = true): void {\n if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');\n}\n\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out: any, instance: any): void {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n\n/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr: TypedArray): Uint8Array {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr: TypedArray): Uint32Array {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays: TypedArray[]): void {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr: TypedArray): DataView {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word: number, shift: number): number {\n return (word << (32 - shift)) | (word >>> shift);\n}\n\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word: number, shift: number): number {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE: boolean = /* @__PURE__ */ (() =>\n new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n\n/** The byte swap operation for uint32 */\nexport function byteSwap(word: number): number {\n return (\n ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff)\n );\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE: (n: number) => number = isLE\n ? (n: number) => n\n : (n: number) => byteSwap(n);\n\n/** @deprecated */\nexport const byteSwapIfBE: typeof swap8IfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr: Uint32Array): Uint32Array {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n\nexport const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE\n ? (u: Uint32Array) => u\n : byteSwap32;\n\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin: boolean = /* @__PURE__ */ (() =>\n // @ts-ignore\n typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin) return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async (): Promise<void> => {};\n\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(\n iters: number,\n tick: number,\n cb: (i: number) => void\n): Promise<void> {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick) continue;\n await nextTick();\n ts += diff;\n }\n}\n\n// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\ndeclare const TextDecoder: any;\n\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes: Uint8Array): string {\n return new TextDecoder().decode(bytes);\n}\n\n/** Accepted input of hash functions. Strings are converted to byte arrays. */\nexport type Input = string | Uint8Array;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data: Input): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** KDFs can accept string or Uint8Array for user convenience. */\nexport type KDFInput = string | Uint8Array;\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data: KDFInput): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\ntype EmptyObj = {};\nexport function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged as T1 & T2;\n}\n\n/** Hash interface. */\nexport type IHash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\n\n/** For runtime check if class implements interface */\nexport abstract class Hash<T extends Hash<T>> {\n abstract blockLen: number; // Bytes per block\n abstract outputLen: number; // Bytes in output\n abstract update(buf: Input): this;\n // Writes digest into buf\n abstract digestInto(buf: Uint8Array): void;\n abstract digest(): Uint8Array;\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n abstract destroy(): void;\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n abstract _cloneInto(to?: T): T;\n // Safe version that clones internal state\n abstract clone(): T;\n}\n\n/**\n * XOF: streaming API to read digest in chunks.\n * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.\n * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot\n * destroy state, next call can require more bytes.\n */\nexport type HashXOF<T extends Hash<T>> = Hash<T> & {\n xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream\n xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf\n};\n\n/** Hash function */\nexport type CHash = ReturnType<typeof createHasher>;\n/** Hash function with output */\nexport type CHashO = ReturnType<typeof createOptHasher>;\n/** XOF with output */\nexport type CHashXO = ReturnType<typeof createXOFer>;\n\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher<T extends Hash<T>>(\n hashCons: () => Hash<T>\n): {\n (msg: Input): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(): Hash<T>;\n} {\n const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\nexport function createOptHasher<H extends Hash<H>, T extends Object>(\n hashCons: (opts?: T) => Hash<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): Hash<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\n\nexport function createXOFer<H extends HashXOF<H>, T extends Object>(\n hashCons: (opts?: T) => HashXOF<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): HashXOF<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor: typeof createHasher = createHasher;\nexport const wrapConstructorWithOpts: typeof createOptHasher = createOptHasher;\nexport const wrapXOFConstructorWithOpts: typeof createXOFer = createXOFer;\n\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32): Uint8Array {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n", "/**\n * Hex, bytes and number utilities.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nexport type Hex = Uint8Array | string; // hex strings are accepted for simplicity\nexport type PrivKey = Hex | bigint; // bigints are accepted to ease learning curve\nexport type CHash = {\n (message: Uint8Array | string): Uint8Array;\n blockLen: number;\n outputLen: number;\n create(opts?: { dkLen?: number }): any; // For shake\n};\nexport type FHash = (message: Uint8Array | string) => Uint8Array;\n\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\nexport function abytes(item: unknown): void {\n if (!isBytes(item)) throw new Error('Uint8Array expected');\n}\n\nexport function abool(title: string, value: boolean): void {\n if (typeof value !== 'boolean') throw new Error(title + ' boolean expected, got ' + value);\n}\n\n// Used in weierstrass, der\nexport function numberToHexUnpadded(num: number | bigint): string {\n const hex = num.toString(16);\n return hex.length & 1 ? '0' + hex : hex;\n}\n\nexport function hexToNumber(hex: string): bigint {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian\n}\n\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin: boolean =\n // @ts-ignore\n typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function';\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin) return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes: Uint8Array): bigint {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes: Uint8Array): bigint {\n abytes(bytes);\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\n\nexport function numberToBytesBE(n: number | bigint, len: number): Uint8Array {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n: number | bigint, len: number): Uint8Array {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n: number | bigint): Uint8Array {\n return hexToBytes(numberToHexUnpadded(n));\n}\n\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array {\n let res: Uint8Array;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n } catch (e) {\n throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e);\n }\n } else if (isBytes(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n } else {\n throw new Error(title + ' must be hex string or Uint8Array');\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len);\n return res;\n}\n\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\n// Compares 2 u8a-s in kinda constant time\nexport function equalBytes(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i];\n return diff === 0;\n}\n\n// Global symbols in both browsers and Node.js since v11\n// See https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\n\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n// Is positive bigint\nconst isPosBig = (n: bigint) => typeof n === 'bigint' && _0n <= n;\n\nexport function inRange(n: bigint, min: bigint, max: bigint): boolean {\n return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;\n}\n\n/**\n * Asserts min <= n < max. NOTE: It's < max and not <= max.\n * @example\n * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n)\n */\nexport function aInRange(title: string, n: bigint, min: bigint, max: bigint): void {\n // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)?\n // consider P=256n, min=0n, max=P\n // - a for min=0 would require -1: `inRange('x', x, -1n, P)`\n // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)`\n // - our way is the cleanest: `inRange('x', x, 0n, P)\n if (!inRange(n, min, max))\n throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n);\n}\n\n// Bit operations\n\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n * TODO: merge with nLength in modular\n */\nexport function bitLen(n: bigint): number {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1);\n return len;\n}\n\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n: bigint, pos: number): bigint {\n return (n >> BigInt(pos)) & _1n;\n}\n\n/**\n * Sets single bit at position.\n */\nexport function bitSet(n: bigint, pos: number, value: boolean): bigint {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n}\n\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n: number): bigint => (_1n << BigInt(n)) - _1n;\n\n// DRBG\n\nconst u8n = (len: number) => new Uint8Array(len); // creates Uint8Array\nconst u8fr = (arr: ArrayLike<number>) => Uint8Array.from(arr); // another shortcut\ntype Pred<T> = (v: Uint8Array) => T | undefined;\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG<Key>(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg<T>(\n hashLen: number,\n qByteLen: number,\n hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array\n): (seed: Uint8Array, predicate: Pred<T>) => T {\n if (typeof hashLen !== 'number' || hashLen < 2) throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2) throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function') throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b: Uint8Array[]) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n(0)) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0) return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000) throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out: Uint8Array[] = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed: Uint8Array, pred: Pred<T>): T => {\n reset();\n reseed(seed); // Steps D-G\n let res: T | undefined = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen()))) reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n\n// Validating curves and fields\n\nconst validatorFns = {\n bigint: (val: any): boolean => typeof val === 'bigint',\n function: (val: any): boolean => typeof val === 'function',\n boolean: (val: any): boolean => typeof val === 'boolean',\n string: (val: any): boolean => typeof val === 'string',\n stringOrUint8Array: (val: any): boolean => typeof val === 'string' || isBytes(val),\n isSafeInteger: (val: any): boolean => Number.isSafeInteger(val),\n array: (val: any): boolean => Array.isArray(val),\n field: (val: any, object: any): any => (object as any).Fp.isValid(val),\n hash: (val: any): boolean => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n} as const;\ntype Validator = keyof typeof validatorFns;\ntype ValMap<T extends Record<string, any>> = { [K in keyof T]?: Validator };\n// type Record<K extends string | number | symbol, T> = { [P in K]: T; }\n\nexport function validateObject<T extends Record<string, any>>(\n object: T,\n validators: ValMap<T>,\n optValidators: ValMap<T> = {}\n): T {\n const checkField = (fieldName: keyof T, type: Validator, isOptional: boolean) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function') throw new Error('invalid validator function');\n\n const val = object[fieldName as keyof typeof object];\n if (isOptional && val === undefined) return;\n if (!checkVal(val, object)) {\n throw new Error(\n 'param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val\n );\n }\n };\n for (const [fieldName, type] of Object.entries(validators)) checkField(fieldName, type!, false);\n for (const [fieldName, type] of Object.entries(optValidators)) checkField(fieldName, type!, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n\n/**\n * throws not implemented error\n */\nexport const notImplemented = (): never => {\n throw new Error('not implemented');\n};\n\n/**\n * Memoizes (caches) computation result.\n * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed.\n */\nexport function memoized<T extends object, R, O extends any[]>(\n fn: (arg: T, ...args: O) => R\n): (arg: T, ...args: O) => R {\n const map = new WeakMap<T, R>();\n return (arg: T, ...args: O): R => {\n const val = map.get(arg);\n if (val !== undefined) return val;\n const computed = fn(arg, ...args);\n map.set(arg, computed);\n return computed;\n };\n}\n", "/**\n * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.\n * @todo re-check https://issues.chromium.org/issues/42212588\n * @module\n */\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n\nfunction fromBig(\n n: bigint,\n le = false\n): {\n h: number;\n l: number;\n} {\n if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n\nfunction split(lst: bigint[], le = false): Uint32Array[] {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n\nconst toBig = (h: number, l: number): bigint => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h: number, _l: number, s: number): number => h >>> s;\nconst shrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h: number, l: number, s: number): number => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h: number, l: number, s: number): number => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h: number, l: number, s: number): number => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h: number, l: number): number => l;\nconst rotr32L = (h: number, _l: number): number => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h: number, l: number, s: number): number => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h: number, l: number, s: number): number => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h: number, l: number, s: number): number => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h: number, l: number, s: number): number => (h << (s - 32)) | (l >>> (64 - s));\n\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(\n Ah: number,\n Al: number,\n Bh: number,\n Bl: number\n): {\n h: number;\n l: number;\n} {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al: number, Bl: number, Cl: number): number => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low: number, Ah: number, Bh: number, Ch: number): number =>\n (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al: number, Bl: number, Cl: number, Dl: number): number =>\n (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number): number =>\n (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number): number =>\n (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number): number =>\n (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n\n// prettier-ignore\nexport {\n add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig\n};\n// prettier-ignore\nconst u64: { fromBig: typeof fromBig; split: typeof split; toBig: (h: number, l: number) => bigint; shrSH: (h: number, _l: number, s: number) => number; shrSL: (h: number, l: number, s: number) => number; rotrSH: (h: number, l: number, s: number) => number; rotrSL: (h: number, l: number, s: number) => number; rotrBH: (h: number, l: number, s: number) => number; rotrBL: (h: number, l: number, s: number) => number; rotr32H: (_h: number, l: number) => number; rotr32L: (h: number, _l: number) => number; rotlSH: (h: number, l: number, s: number) => number; rotlSL: (h: number, l: number, s: number) => number; rotlBH: (h: number, l: number, s: number) => number; rotlBL: (h: number, l: number, s: number) => number; add: typeof add; add3L: (Al: number, Bl: number, Cl: number) => number; add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; } = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n"],
|
|
5
|
+
"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CAAE,EAAG,OAAQG,GAAKF,EAAQD,CAAU,EAAI,EAAG,EAAG,OAAOG,EAAIH,CAAU,EAAI,CAAC,CACjF,CAEA,SAASK,GAAMC,EAAeF,EAAK,GAAK,CACtC,IAAMG,EAAMD,EAAI,OACZE,EAAK,IAAI,YAAYD,CAAG,EACxBE,EAAK,IAAI,YAAYF,CAAG,EAC5B,QAAS,EAAI,EAAG,EAAIA,EAAK,IAAK,CAC5B,GAAM,CAAE,EAAAG,EAAG,EAAAC,CAAC,EAAKT,EAAQI,EAAI,CAAC,EAAGF,CAAE,EACnC,CAACI,EAAG,CAAC,EAAGC,EAAG,CAAC,CAAC,EAAI,CAACC,EAAGC,CAAC,CACxB,CACA,MAAO,CAACH,EAAIC,CAAE,CAChB,CAgBA,IAAMG,GAAS,CAACC,EAAWC,EAAWC,IAAuBF,GAAKE,EAAMD,IAAO,GAAKC,EAC9EC,GAAS,CAACH,EAAWC,EAAWC,IAAuBD,GAAKC,EAAMF,IAAO,GAAKE,EAE9EE,GAAS,CAACJ,EAAWC,EAAWC,IAAuBD,GAAMC,EAAI,GAAQF,IAAO,GAAKE,EACrFG,GAAS,CAACL,EAAWC,EAAWC,IAAuBF,GAAME,EAAI,GAAQD,IAAO,GAAKC",
|
|
6
|
+
"names": ["nc", "crypto", "isBytes", "a", "anumber", "n", "abytes", "b", "lengths", "ahash", "h", "aexists", "instance", "checkFinished", "aoutput", "out", "min", "u32", "arr", "clean", "arrays", "i", "createView", "rotr", "word", "shift", "isLE", "byteSwap", "word", "byteSwap32", "arr", "i", "byteSwap", "swap32IfBE", "isLE", "u", "utf8ToBytes", "str", "toBytes", "data", "utf8ToBytes", "abytes", "concatBytes", "arrays", "sum", "i", "a", "abytes", "res", "pad", "Hash", "createHasher", "hashCons", "hashC", "msg", "toBytes", "tmp", "randomBytes", "bytesLength", "crypto", "_0n", "_1n", "isBytes", "a", "abytes", "item", "abool", "title", "value", "numberToHexUnpadded", "num", "hex", "hexToNumber", "hasHexBuiltin", "hexes", "_", "i", "bytesToHex", "bytes", "asciis", "asciiToBase16", "ch", "hexToBytes", "hl", "al", "array", "ai", "hi", "n1", "n2", "char", "bytesToNumberBE", "bytesToNumberLE", "numberToBytesBE", "n", "len", "numberToBytesLE", "ensureBytes", "title", "hex", "expectedLength", "res", "hexToBytes", "e", "isBytes", "len", "concatBytes", "arrays", "sum", "i", "a", "abytes", "pad", "utf8ToBytes", "str", "isPosBig", "n", "_0n", "inRange", "min", "max", "aInRange", "title", "bitLen", "len", "_1n", "bitMask", "n", "_1n", "u8n", "len", "u8fr", "arr", "createHmacDrbg", "hashLen", "qByteLen", "hmacFn", "v", "k", "reset", "h", "b", "reseed", "seed", "gen", "out", "sl", "concatBytes", "pred", "res", "validatorFns", "val", "isBytes", "object", "validateObject", "validators", "optValidators", "checkField", "fieldName", "type", "isOptional", "checkVal", "memoized", "fn", "map", "arg", "args", "val", "computed", "U32_MASK64", "_32n", "fromBig", "n", "le", "split", "lst", "len", "Ah", "Al", "h", "l", "rotlSH", "h", "l", "s", "rotlSL", "rotlBH", "rotlBL"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{a as o,f as s,g as i,m as n,u as t,v as m,z as u}from"./chunk-JUFFOBKU.js";import{d as r}from"./chunk-3TJUKWFC.js";var d=r({name:"resume",description:"Continue an unfinished operation with its saved input",examples:["filecoin operations resume op_abc123"],input:i({id:o().describe("Operation ID (op_\u2026)"),...t}),positionals:["id"],env:m,secrets:["sessionKey"],output:s(u),errors:n,idempotent:!0,human:e=>e.state==="ready"?`Stored ${e.resource.name} (${e.resource.ref})
|
|
3
|
+
${e.urls.browser}`:`Removal of ${e.resource.ref} (${e.resource.name}) scheduled.`,handler:()=>import("./resume-BCEYVRX7.js")});export{d as a};
|
|
4
|
+
//# sourceMappingURL=chunk-AHVL5QFR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/operations/resume.ts"],
|
|
4
|
+
"sourcesContent": ["import { defineCommand } from 'clipact'\nimport * as z from 'zod'\nimport { JOB_ERRORS } from '../../errors.ts'\nimport { account, accountEnv, jobResult } from '../shared.ts'\n\n/**\n * `filecoin operations resume <id>`: continue an unfinished put or delete with its\n * saved input. Safe to repeat: it reconciles saved submissions before sending\n * anything, and a completed operation returns its saved outcome.\n */\nexport const resume = defineCommand({\n name: 'resume',\n description: 'Continue an unfinished operation with its saved input',\n examples: ['filecoin operations resume op_abc123'],\n input: z.strictObject({\n id: z.string().describe('Operation ID (op_\u2026)'),\n ...account,\n }),\n positionals: ['id'],\n env: accountEnv,\n secrets: ['sessionKey'],\n output: z.object(jobResult),\n errors: JOB_ERRORS,\n idempotent: true,\n human: (data) =>\n data.state === 'ready'\n ? `Stored ${data.resource.name} (${data.resource.ref})\\n${data.urls.browser}`\n : `Removal of ${data.resource.ref} (${data.resource.name}) scheduled.`,\n handler: () => import('../../handlers/operations/resume.ts'),\n})\n"],
|
|
5
|
+
"mappings": ";0HAUO,IAAMA,EAASC,EAAc,CAClC,KAAM,SACN,YAAa,wDACb,SAAU,CAAC,sCAAsC,EACjD,MAASC,EAAa,CACpB,GAAMC,EAAO,EAAE,SAAS,0BAAqB,EAC7C,GAAGC,CACL,CAAC,EACD,YAAa,CAAC,IAAI,EAClB,IAAKC,EACL,QAAS,CAAC,YAAY,EACtB,OAAUC,EAAOC,CAAS,EAC1B,OAAQC,EACR,WAAY,GACZ,MAAQC,GACNA,EAAK,QAAU,QACX,UAAUA,EAAK,SAAS,IAAI,KAAKA,EAAK,SAAS,GAAG;AAAA,EAAMA,EAAK,KAAK,OAAO,GACzE,cAAcA,EAAK,SAAS,GAAG,KAAKA,EAAK,SAAS,IAAI,eAC5D,QAAS,IAAM,OAAO,sBAAqC,CAC7D,CAAC",
|
|
6
|
+
"names": ["resume", "defineCommand", "strictObject", "string", "account", "accountEnv", "object", "jobResult", "JOB_ERRORS", "data"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{C as h,a as e,b as s,c as r,e as c,f as i,g as l,i as a,j as d,m as u,u as z,v as m,x as f,y as g}from"./chunk-JUFFOBKU.js";import{d as p}from"./chunk-3TJUKWFC.js";var b=i({kind:a(["file","folder"]),name:e(),size:s().int().describe("Bytes to store: the file, or the packed CAR"),files:s().int(),rootCid:e().optional(),network:e(),authorization:a(["ready","login_required","login_pending","scopes_missing"]).describe("Whether the session key can sign this put"),missingScopes:c(e()).optional(),provider:i({id:e(),serviceURL:e(),dataSetId:e().optional().describe("Existing data set to add to")}).optional(),cost:i({token:d("USDFC"),ready:r().describe("The payer can cover it now"),depositNeeded:e(),needsApproval:r(),ratePerMonth:e(),lockup:e(),fundingUrl:e().optional()}).optional(),checkedAt:e()}),k=p({name:"put",description:"Store a file (raw piece) or directory (UnixFS CAR) with one copy",examples:["filecoin put ./report.pdf","filecoin put ./site --name docs","filecoin publish ./site --dry-run"],input:l({path:e().describe("File or directory to store"),name:e().min(1).optional().describe("Display name (default: basename)"),provider:e().regex(/^\d+$/,"Expected a decimal provider ID").optional().describe("Storage provider ID (default: automatic)"),...z}),positionals:["path"],env:m,secrets:["sessionKey"],output:i({dryRun:r(),operationId:e().optional().describe("Set when dryRun is false"),state:d("ready").optional(),resource:f.optional(),urls:g.optional(),estimate:b.optional().describe("Set when dryRun is true")}),errors:u,dryRun:!0,human:o=>{if(o.estimate){let t=o.estimate,n=[`Would store ${t.kind} ${t.name}: ${h(t.size)}, ${t.files} file(s) on ${t.network}`,`authorization: ${t.authorization}`];return t.provider&&n.push(`provider: ${t.provider.id} (${t.provider.serviceURL})`),t.cost&&n.push(`cost: ${t.cost.ratePerMonth} USDFC/month, lockup ${t.cost.lockup} USDFC, ${t.cost.ready?"funded":`deposit ${t.cost.depositNeeded} USDFC first`}`),n.join(`
|
|
3
|
+
`)}return`Stored ${o.resource?.name} (${o.resource?.ref})
|
|
4
|
+
${o.urls?.browser}`},handler:()=>import("./put-GTJP7IFM.js")});export{k as a};
|
|
5
|
+
//# sourceMappingURL=chunk-CC75NTEJ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/put.ts"],
|
|
4
|
+
"sourcesContent": ["import { defineCommand } from 'clipact'\nimport * as z from 'zod'\nimport { JOB_ERRORS } from '../errors.ts'\nimport { account, accountEnv, formatBytes, resource, urls } from './shared.ts'\n\n/** What `put --dry-run` reports instead of storing anything. */\nconst estimate = z.object({\n kind: z.enum(['file', 'folder']),\n name: z.string(),\n size: z\n .number()\n .int()\n .describe('Bytes to store: the file, or the packed CAR'),\n files: z.number().int(),\n rootCid: z.string().optional(),\n network: z.string(),\n authorization: z\n .enum(['ready', 'login_required', 'login_pending', 'scopes_missing'])\n .describe('Whether the session key can sign this put'),\n missingScopes: z.array(z.string()).optional(),\n provider: z\n .object({\n id: z.string(),\n serviceURL: z.string(),\n dataSetId: z.string().optional().describe('Existing data set to add to'),\n })\n .optional(),\n cost: z\n .object({\n token: z.literal('USDFC'),\n ready: z.boolean().describe('The payer can cover it now'),\n depositNeeded: z.string(),\n needsApproval: z.boolean(),\n ratePerMonth: z.string(),\n lockup: z.string(),\n fundingUrl: z.string().optional(),\n })\n .optional(),\n checkedAt: z.string(),\n})\n\n/**\n * `filecoin put <path>` (alias `publish`): store a file as exact bytes, or a\n * directory as a UnixFS CAR served at `/ipfs/<rootCid>/`, with one copy.\n */\nexport const put = defineCommand({\n name: 'put',\n description:\n 'Store a file (raw piece) or directory (UnixFS CAR) with one copy',\n examples: [\n 'filecoin put ./report.pdf',\n 'filecoin put ./site --name docs',\n 'filecoin publish ./site --dry-run',\n ],\n input: z.strictObject({\n path: z.string().describe('File or directory to store'),\n name: z\n .string()\n .min(1)\n .optional()\n .describe('Display name (default: basename)'),\n provider: z\n .string()\n .regex(/^\\d+$/, 'Expected a decimal provider ID')\n .optional()\n .describe('Storage provider ID (default: automatic)'),\n ...account,\n }),\n positionals: ['path'],\n env: accountEnv,\n secrets: ['sessionKey'],\n output: z.object({\n dryRun: z.boolean(),\n operationId: z.string().optional().describe('Set when dryRun is false'),\n state: z.literal('ready').optional(),\n resource: resource.optional(),\n urls: urls.optional(),\n estimate: estimate.optional().describe('Set when dryRun is true'),\n }),\n errors: JOB_ERRORS,\n dryRun: true,\n human: (data) => {\n if (data.estimate) {\n const e = data.estimate\n const lines = [\n `Would store ${e.kind} ${e.name}: ${formatBytes(e.size)}, ${e.files} file(s) on ${e.network}`,\n `authorization: ${e.authorization}`,\n ]\n if (e.provider)\n lines.push(`provider: ${e.provider.id} (${e.provider.serviceURL})`)\n if (e.cost) {\n lines.push(\n `cost: ${e.cost.ratePerMonth} USDFC/month, lockup ${e.cost.lockup} USDFC, ${e.cost.ready ? 'funded' : `deposit ${e.cost.depositNeeded} USDFC first`}`\n )\n }\n return lines.join('\\n')\n }\n return `Stored ${data.resource?.name} (${data.resource?.ref})\\n${data.urls?.browser}`\n },\n handler: () => import('../handlers/put.ts'),\n})\n"],
|
|
5
|
+
"mappings": ";2KAMA,IAAMA,EAAaC,EAAO,CACxB,KAAQC,EAAK,CAAC,OAAQ,QAAQ,CAAC,EAC/B,KAAQC,EAAO,EACf,KACGC,EAAO,EACP,IAAI,EACJ,SAAS,6CAA6C,EACzD,MAASA,EAAO,EAAE,IAAI,EACtB,QAAWD,EAAO,EAAE,SAAS,EAC7B,QAAWA,EAAO,EAClB,cACGD,EAAK,CAAC,QAAS,iBAAkB,gBAAiB,gBAAgB,CAAC,EACnE,SAAS,2CAA2C,EACvD,cAAiBG,EAAQF,EAAO,CAAC,EAAE,SAAS,EAC5C,SACGF,EAAO,CACN,GAAME,EAAO,EACb,WAAcA,EAAO,EACrB,UAAaA,EAAO,EAAE,SAAS,EAAE,SA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,EAChEA,EAAE,MACJC,EAAM,KACJ,SAASD,EAAE,KAAK,YAAY,wBAAwBA,EAAE,KAAK,MAAM,WAAWA,EAAE,KAAK,MAAQ,SAAW,WAAWA,EAAE,KAAK,aAAa,cAAc,EACrJ,EAEKC,EAAM,KAAK;AAAA,CAAI,CACxB,CACA,MAAO,UAAUF,EAAK,UAAU,IAAI,KAAKA,EAAK,UAAU,GAAG;AAAA,EAAMA,EAAK,MAAM,OAAO,EACrF,EACA,QAAS,IAAM,OAAO,mBAAoB,CAC5C,CAAC",
|
|
6
|
+
"names": ["estimate", "object", "_enum", "string", "number", "array", "literal", "boolean", "put", "defineCommand", "strictObject", "account", "accountEnv", "resource", "urls", "JOB_ERRORS", "data", "e", "lines", "formatBytes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{d as n,e as o,n as s}from"./chunk-UW35AN2V.js";function f(r){if(r===n.id.toString())return"mainnet";if(r===o.id.toString())return"calibration";throw new Error(`Unknown chain ID ${r}.`)}function c(r,e,d,a,t){let i=new URL(`get/${encodeURIComponent(d)}`,r.endsWith("/")?r:`${r}/`);return i.searchParams.set("network",e),a&&i.searchParams.set("browser","true"),t&&i.searchParams.set("provider",t),i.toString()}function p(r){let e=f(r.chainId);return{piece:c(r.apiUrl,e,r.pieceCid,!1,r.providerId),browser:c(r.apiUrl,e,r.rootCid??r.pieceCid,!0,r.rootCid?void 0:r.providerId)}}function l(r,e){return p({apiUrl:e,chainId:r.chainId,pieceCid:r.pieceCid,rootCid:r.rootCid})}function w(r){let[e]=r.copies;if(!e)throw new Error(`Resource ${r.ref} has no stored copies.`);return s({cid:r.pieceCid,serviceURL:e.serviceURL.endsWith("/")?e.serviceURL:`${e.serviceURL}/`})}export{p as a,l as b,w as c};
|
|
3
|
+
//# sourceMappingURL=chunk-D63BUPKY.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/storage/urls.ts"],
|
|
4
|
+
"sourcesContent": ["import { calibration, mainnet } from '@filoz/synapse-core/chains'\nimport { createPieceUrlPDP } from '@filoz/synapse-core/piece'\nimport type { Network } from '../network.ts'\nimport type { Resource } from '../state/resources.ts'\n\n/**\n * filecoin-api retrieval URLs for stored content. Each redirects to where the\n * content can be fetched; filecoin-api never proxies the bytes.\n *\n * @see ../../../../apps/filecoin-api/README.md#retrieval\n */\nexport type RetrievalUrls = {\n /** Exact stored bytes: `/get/<pieceCid>` redirects to a provider's `/piece/<pieceCid>`. */\n piece: string\n /**\n * Content a browser renders: `/get/<rootCid>?browser=true` redirects a\n * folder to inbrowser.link, and `/get/<pieceCid>?browser=true` redirects a\n * file to a provider's `/piece/<pieceCid>`.\n */\n browser: string\n}\n\n/** Network of a chain ID saved in local state. */\nfunction networkOf(chainId: string): Network {\n if (chainId === mainnet.id.toString()) return 'mainnet'\n if (chainId === calibration.id.toString()) return 'calibration'\n throw new Error(`Unknown chain ID ${chainId}.`)\n}\n\n/** filecoin-api `/get/{cid}` URL on `network`. */\nfunction getUrl(\n apiUrl: string,\n network: Network,\n cid: string,\n browser: boolean,\n providerId: string | undefined\n): string {\n const url = new URL(\n `get/${encodeURIComponent(cid)}`,\n apiUrl.endsWith('/') ? apiUrl : `${apiUrl}/`\n )\n url.searchParams.set('network', network)\n if (browser) url.searchParams.set('browser', 'true')\n if (providerId) url.searchParams.set('provider', providerId)\n return url.toString()\n}\n\n/**\n * Build filecoin-api retrieval URLs for a piece and, for folders, its IPFS root.\n * The folder's browser URL names the root CID, so filecoin-api redirects it to\n * inbrowser.link without waiting for its indexer. `providerId` names the\n * provider holding the piece, which filecoin-api redirects to until its indexer\n * has a copy, so a `/piece` link works as soon as the provider has parked\n * the piece. `put` adds it only to the links it reports before the commit\n * confirms. A folder's browser URL leaves it out: filecoin-api never looks it up.\n *\n * @see ../../../../apps/filecoin-api/README.md#retrieval\n */\nexport function retrievalUrls(options: {\n apiUrl: string\n chainId: string\n pieceCid: string\n rootCid?: string | undefined\n providerId?: string | undefined\n}): RetrievalUrls {\n const network = networkOf(options.chainId)\n return {\n piece: getUrl(\n options.apiUrl,\n network,\n options.pieceCid,\n false,\n options.providerId\n ),\n browser: getUrl(\n options.apiUrl,\n network,\n options.rootCid ?? options.pieceCid,\n true,\n options.rootCid ? undefined : options.providerId\n ),\n }\n}\n\n/** filecoin-api retrieval URLs for a resource. */\nexport function resourceUrls(\n resource: Resource,\n apiUrl: string\n): RetrievalUrls {\n return retrievalUrls({\n apiUrl,\n chainId: resource.chainId,\n pieceCid: resource.pieceCid,\n rootCid: resource.rootCid,\n })\n}\n\n/**\n * Curio `/piece/<pieceCid>` URL of a resource's first copy. `filecoin get`\n * downloads from it directly, so a download never waits for filecoin-api's\n * indexer.\n *\n * @see https://github.com/filecoin-project/curio/blob/main/documentation/en/curio-market/retrievals.md\n */\nexport function providerPieceUrl(resource: Resource): string {\n const [copy] = resource.copies\n if (!copy) throw new Error(`Resource ${resource.ref} has no stored copies.`)\n return createPieceUrlPDP({\n cid: resource.pieceCid,\n serviceURL: copy.serviceURL.endsWith('/')\n ? copy.serviceURL\n : `${copy.serviceURL}/`,\n })\n}\n"],
|
|
5
|
+
"mappings": ";sDAuBA,SAASA,EAAUC,EAA0B,CAC3C,GAAIA,IAAYC,EAAQ,GAAG,SAAS,EAAG,MAAO,UAC9C,GAAID,IAAYE,EAAY,GAAG,SAAS,EAAG,MAAO,cAClD,MAAM,IAAI,MAAM,oBAAoBF,CAAO,GAAG,CAChD,CAGA,SAASG,EACPC,EACAC,EACAC,EACAC,EACAC,EACQ,CACR,IAAMC,EAAM,IAAI,IACd,OAAO,mBAAmBH,CAAG,CAAC,GAC9BF,EAAO,SAAS,GAAG,EAAIA,EAAS,GAAGA,CAAM,GAC3C,EACA,OAAAK,EAAI,aAAa,IAAI,UAAWJ,CAAO,EACnCE,GAASE,EAAI,aAAa,IAAI,UAAW,MAAM,EAC/CD,GAAYC,EAAI,aAAa,IAAI,WAAYD,CAAU,EACpDC,EAAI,SAAS,CACtB,CAaO,SAASC,EAAcC,EAMZ,CAChB,IAAMN,EAAUN,EAAUY,EAAQ,OAAO,EACzC,MAAO,CACL,MAAOR,EACLQ,EAAQ,OACRN,EACAM,EAAQ,SACR,GACAA,EAAQ,UACV,EACA,QAASR,EACPQ,EAAQ,OACRN,EACAM,EAAQ,SAAWA,EAAQ,SAC3B,GACAA,EAAQ,QAAU,OAAYA,EAAQ,UACxC,CACF,CACF,CAGO,SAASC,EACdC,EACAT,EACe,CACf,OAAOM,EAAc,CACnB,OAAAN,EACA,QAASS,EAAS,QAClB,SAAUA,EAAS,SACnB,QAASA,EAAS,OACpB,CAAC,CACH,CASO,SAASC,EAAiBD,EAA4B,CAC3D,GAAM,CAACE,CAAI,EAAIF,EAAS,OACxB,GAAI,CAACE,EAAM,MAAM,IAAI,MAAM,YAAYF,EAAS,GAAG,wBAAwB,EAC3E,OAAOG,EAAkB,CACvB,IAAKH,EAAS,SACd,WAAYE,EAAK,WAAW,SAAS,GAAG,EACpCA,EAAK,WACL,GAAGA,EAAK,UAAU,GACxB,CAAC,CACH",
|
|
6
|
+
"names": ["networkOf", "chainId", "mainnet", "calibration", "getUrl", "apiUrl", "network", "cid", "browser", "providerId", "url", "retrievalUrls", "options", "resourceUrls", "resource", "providerPieceUrl", "copy", "createPieceUrlPDP"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{p as n}from"./chunk-3TJUKWFC.js";var s=new Set(["HttpRequestError","RpcRequestError","WebSocketRequestError","NetworkError","FetchError","ResourceUnavailableRpcError","InternalRpcError","LimitExceededRpcError"]),u=new Set(["TimeoutError"]);function*i(r){let e=r;for(let t=0;e instanceof Error&&t<10;t++)yield e,e=e.cause}function o(r){return r.message.split(`
|
|
3
|
+
`)[0]??r.name}function c(r){for(let e of i(r)){if(u.has(e.name))return new n({code:"timeout",message:`A request timed out: ${o(e)}`,cause:r});if(s.has(e.name))return new n({code:"service_unavailable",message:`A service did not respond: ${o(e)}`,cause:r})}}export{o as a,c as b};
|
|
4
|
+
//# sourceMappingURL=chunk-FCVBKUS5.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/map-error.ts"],
|
|
4
|
+
"sourcesContent": ["import { CliError } from 'clipact'\n\n/** Error names from viem and iso-web for an unreachable or failing endpoint. */\nconst UNAVAILABLE = new Set([\n 'HttpRequestError',\n 'RpcRequestError',\n 'WebSocketRequestError',\n 'NetworkError',\n 'FetchError',\n 'ResourceUnavailableRpcError',\n 'InternalRpcError',\n 'LimitExceededRpcError',\n])\n\n/** Error names for a request that took too long. */\nconst TIMEOUT = new Set(['TimeoutError'])\n\n/** The error and its causes, outermost first. */\nfunction* causes(error: unknown): Generator<Error> {\n let current = error\n for (let depth = 0; current instanceof Error && depth < 10; depth++) {\n yield current\n current = current.cause\n }\n}\n\n/** First line of an error message, without viem's detail blocks. */\nexport function firstLine(error: Error): string {\n return error.message.split('\\n')[0] ?? error.name\n}\n\n/**\n * Translate RPC and HTTP failures from viem and synapse-core into\n * clipact's transient codes. clipact marks them retryable only for read-only\n * and idempotent commands; put and delete wrap errors with their operation\n * first, so they never reach this hook. Loaded only when a handler throws\n * something other than a `CliError`.\n *\n * @see https://github.com/hugomrdias/agents/blob/main/docs/agent-cli/framework-design.md#output-and-errors\n */\nexport default function mapError(error: unknown): CliError | undefined {\n for (const cause of causes(error)) {\n if (TIMEOUT.has(cause.name)) {\n return new CliError({\n code: 'timeout',\n message: `A request timed out: ${firstLine(cause)}`,\n cause: error,\n })\n }\n if (UNAVAILABLE.has(cause.name)) {\n return new CliError({\n code: 'service_unavailable',\n message: `A service did not respond: ${firstLine(cause)}`,\n cause: error,\n })\n }\n }\n return undefined\n}\n"],
|
|
5
|
+
"mappings": ";wCAGA,IAAMA,EAAc,IAAI,IAAI,CAC1B,mBACA,kBACA,wBACA,eACA,aACA,8BACA,mBACA,uBACF,CAAC,EAGKC,EAAU,IAAI,IAAI,CAAC,cAAc,CAAC,EAGxC,SAAUC,EAAOC,EAAkC,CACjD,IAAIC,EAAUD,EACd,QAASE,EAAQ,EAAGD,aAAmB,OAASC,EAAQ,GAAIA,IAC1D,MAAMD,EACNA,EAAUA,EAAQ,KAEtB,CAGO,SAASE,EAAUH,EAAsB,CAC9C,OAAOA,EAAM,QAAQ,MAAM;AAAA,CAAI,EAAE,CAAC,GAAKA,EAAM,IAC/C,CAWe,SAARI,EAA0BJ,EAAsC,CACrE,QAAWK,KAASN,EAAOC,CAAK,EAAG,CACjC,GAAIF,EAAQ,IAAIO,EAAM,IAAI,EACxB,OAAO,IAAIC,EAAS,CAClB,KAAM,UACN,QAAS,wBAAwBH,EAAUE,CAAK,CAAC,GACjD,MAAOL,CACT,CAAC,EAEH,GAAIH,EAAY,IAAIQ,EAAM,IAAI,EAC5B,OAAO,IAAIC,EAAS,CAClB,KAAM,sBACN,QAAS,8BAA8BH,EAAUE,CAAK,CAAC,GACvD,MAAOL,CACT,CAAC,CAEL,CAEF",
|
|
6
|
+
"names": ["UNAVAILABLE", "TIMEOUT", "causes", "error", "current", "depth", "firstLine", "mapError", "cause", "CliError"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{a as w}from"./chunk-SVWQJYA5.js";import{a as y,b as M}from"./chunk-D63BUPKY.js";import{C as L,F as g,L as J,M as _,N as S,O as T,Q as b,R as z,S as F,T as B,U as v}from"./chunk-UW35AN2V.js";import{k as p,o as E,p as I,q as l}from"./chunk-JUFFOBKU.js";import{p as m,q as $}from"./chunk-3TJUKWFC.js";import{createReadStream as j}from"node:fs";import{rm as q,stat as k}from"node:fs/promises";import{basename as Q,join as X,resolve as V}from"node:path";var G={source:"filecoin"},K={source:"filecoin",withIPFSIndexing:""},Y=96;async function H(e){let t=V(e.path),i=await k(t).catch(()=>{});if(!i||!(i.isFile()||i.isDirectory()))throw I(`No file or directory at ${e.path}.`,"path");let r=e.name??Q(t);return i.isDirectory()?{sourcePath:t,kind:"folder",name:r}:(C(i.size),{sourcePath:t,kind:"file",name:r,size:i.size})}async function ve(e,t){let i=await H(t),r=S(e.db,{action:"put",resourceRef:_("res"),chainId:e.chainId,payer:e.payer,input:{sourcePath:i.sourcePath,name:i.name,kind:i.kind,providerId:t.providerId?.toString()}});return await N(e,r.id)}async function Se(e){let t=await H(e),i;if(t.kind==="file")i={kind:"file",name:t.name,size:t.size??0,files:1};else{let d=await w(t.sourcePath);C(d.size),i={kind:"folder",name:t.name,size:d.size,files:d.files,rootCid:d.rootCid.toString()}}if(!e.backend)return i;let r=await e.backend.selectPlacement({metadata:P(i.kind),providerId:e.providerId}),a=await e.backend.quote({size:i.size,placement:r});return{...i,placement:r,quote:a}}async function N(e,t){let i=T(e.db,t);if(!i)throw l(`Operation ${t} not found.`);if(i.executionStatus==="completed")return x(e,i);let r=z(e.db,t);try{return e.onOperation?.(r),r.action==="put"?await te(e,r):await ae(e,r)}catch(a){throw b(e.db,r.id,{executionStatus:"failed",pid:null,error:e.signal?.aborted?"Interrupted":a instanceof Error?a.message:String(a)}),e.signal?.aborted?a:E(a,r.id)}finally{F(r.id)}}function x(e,t){let i=v(e.db,t.resourceRef);if(!i)throw l(`Resource ${t.resourceRef} of ${t.id} no longer exists.`);return Z(e,t,i)}function Z(e,t,i){return{operationId:t.id,state:t.action==="put"?"ready":"removal_pending",resource:i,urls:M(i,e.apiUrl)}}function W(e,t,i,r={}){J(e.db,()=>{B(e.db,i),b(e.db,t.id,{executionStatus:"completed",phase:"done",pid:null,error:null,checkpoint:r})})}function C(e){if(e<g.MIN_UPLOAD_SIZE||e>g.MAX_UPLOAD_SIZE)throw I(`Content must be between ${g.MIN_UPLOAD_SIZE} and ${g.MAX_UPLOAD_SIZE} bytes; got ${e}.`,"path")}function P(e){return e==="folder"?K:G}async function ee(e,t){let i=j(e,{signal:t});return(await L(i)).toString()}function u(e,t,i,r){return b(e.db,t.id,{checkpoint:i,...r?{phase:r}:{}})}async function te(e,t){let{input:i}=t,r=i.kind??"file",a=i.name??"upload",d=e.signal;if(!i.sourcePath)throw new Error(`Operation ${t.id} has no source.`);let s=i.sourcePath;if(r==="folder"&&(s=X(e.stagingDir(t.id),"folder.car"),!await k(s).catch(()=>{}))){if(t.checkpoint.pieceCid)throw new m({code:p.stagingMissing,message:`The staged CAR of ${t.id} is missing, so it cannot be resumed.`,next:[{by:"agent",command:`filecoin put ${i.sourcePath}`,description:"Start a new put of the same directory"}]});t=u(e,t,{},"packing"),e.progress?.({phase:"packing",message:`Packing ${i.sourcePath}`});let D=await w(i.sourcePath,s);t=u(e,t,{rootCid:D.rootCid.toString(),size:D.size})}d?.throwIfAborted();let c=(await k(s)).size;C(c),e.progress?.({phase:"hashing",message:"Computing PieceCID"});let o=await ee(s,d);if(t.checkpoint.pieceCid&&t.checkpoint.pieceCid!==o)throw new m({code:p.sourceChanged,message:`${s} changed since operation ${t.id} started.`,next:[{by:"agent",command:`filecoin put ${i.sourcePath}`,description:"Start a new put with the current content"}]});t=u(e,t,{pieceCid:o,size:c},"storing");let n=ne(t.checkpoint);if(!n){e.progress?.({phase:"placing",message:"Selecting a storage provider"}),n=await e.backend.selectPlacement({metadata:P(r),providerId:i.providerId?BigInt(i.providerId):void 0});let h=await e.backend.quote({size:c,placement:n});if(!h.ready)throw re(h);t=u(e,t,{providerId:n.providerId.toString(),serviceURL:n.serviceURL,payee:n.payee,...n.dataSetId==null?{}:{dataSetId:n.dataSetId.toString(),clientDataSetId:n.clientDataSetId?.toString()}})}t.checkpoint.commit||t.checkpoint.stored||(await e.backend.hasPiece({serviceURL:n.serviceURL,pieceCid:o})||(e.progress?.({phase:"uploading",message:`Uploading ${c} bytes to provider ${n.providerId}`}),await e.backend.upload({serviceURL:n.serviceURL,path:s,size:c,pieceCid:o})),t=u(e,t,{stored:!0}));let R=y({apiUrl:e.apiUrl,chainId:t.chainId,pieceCid:o,rootCid:t.checkpoint.rootCid,providerId:n.providerId.toString()}),U=()=>e.progress?.({phase:"link",message:R.browser,data:{pieceCid:o,urls:R}});r==="file"&&U();let f=await ie(e,t,n,{pieceCid:o,name:a},r==="folder"?U:void 0),O=y({apiUrl:e.apiUrl,chainId:t.chainId,pieceCid:o,rootCid:t.checkpoint.rootCid}),A={ref:t.resourceRef,kind:r,name:a,chainId:t.chainId,payer:t.payer,pieceCid:o,...t.checkpoint.rootCid?{rootCid:t.checkpoint.rootCid}:{},size:c,copies:[{providerId:n.providerId.toString(),dataSetId:f.dataSetId.toString(),pieceId:f.pieceId.toString(),serviceURL:n.serviceURL}],url:O.browser,status:"active",createdAt:new Date().toISOString()};return W(e,t,A,{dataSetId:f.dataSetId.toString(),pieceId:f.pieceId.toString()}),r==="folder"&&await q(e.stagingDir(t.id),{recursive:!0,force:!0}).catch(()=>{}),{operationId:t.id,state:"ready",resource:A,urls:O}}async function ie(e,t,i,r,a){let d={name:r.name.slice(0,Y),...t.checkpoint.rootCid?{ipfsRootCID:t.checkpoint.rootCid}:{}},s=t.checkpoint.commit;if(s){let n=await e.backend.findCommit({nonce:BigInt(s.nonce)});if(n)return n}t=u(e,t,{},"committing");let c=s;if(c||(e.progress?.({phase:"committing",message:"Signing the commit"}),c=await e.backend.signCommit({placement:i,pieceCid:r.pieceCid,metadata:P(t.input.kind??"file"),pieceMetadata:d}),t=u(e,t,{commit:c})),!t.checkpoint.statusUrl){e.progress?.({phase:"committing",message:c.created?"Creating data set and adding piece":"Adding piece"});let n=await e.backend.submitCommit({placement:i,pieceCid:r.pieceCid,commit:c,pieceMetadata:d});t=u(e,t,{statusUrl:n.statusUrl,transactionHash:n.transactionHash})}a?.();let{transactionHash:o}=t.checkpoint;e.progress?.({phase:"committing",message:o?`Waiting for confirmation of transaction ${o}`:"Waiting for on-chain confirmation",...o?{data:{transactionHash:o}}:{}});try{return await e.backend.waitForCommit({statusUrl:t.checkpoint.statusUrl,created:c.created})}catch(n){throw $(n)&&n.code===p.commitRejected&&u(e,t,{statusUrl:void 0,transactionHash:void 0}),n}}function re(e){return new m({code:p.insufficientFunds,message:e.needsApproval?"The payer must deposit USDFC and approve Warm Storage before uploading.":"The payer must deposit more USDFC before uploading.",details:{fundingUrl:e.fundingUrl,depositNeeded:e.depositNeeded.toString(),needsApproval:e.needsApproval},next:[{by:"user",description:`Fund the account at ${e.fundingUrl}`}]})}function ne(e){if(e.providerId&&e.serviceURL&&e.payee)return{providerId:BigInt(e.providerId),serviceURL:e.serviceURL,payee:e.payee,...e.dataSetId&&e.clientDataSetId?{dataSetId:BigInt(e.dataSetId),clientDataSetId:BigInt(e.clientDataSetId)}:{}}}async function we(e,t){let i=v(e.db,t,e);if(!i)throw l(`No managed resource ${t} for this account.`,{by:"agent",command:"filecoin ls",description:"List managed resources"});if(i.status!=="active")throw I(`${t} is already pending removal.`,"ref");let[r]=i.copies;if(!r)throw new Error(`Resource ${t} has no stored copies.`);let a=S(e.db,{action:"delete",resourceRef:t,chainId:e.chainId,payer:e.payer,input:{},checkpoint:{providerId:r.providerId,serviceURL:r.serviceURL,dataSetId:r.dataSetId,pieceId:r.pieceId}});return await N(e,a.id)}async function ae(e,t){let i=v(e.db,t.resourceRef);if(!i)throw l(`Resource ${t.resourceRef} no longer exists.`);let{serviceURL:r,dataSetId:a,pieceId:d}=t.checkpoint;if(!(r&&a&&d))throw new Error(`Operation ${t.id} is missing its removal target.`);if(!t.checkpoint.transactionHash){t=u(e,t,{},"removing"),e.progress?.({phase:"removing",message:`Scheduling removal of piece ${d}`});let{transactionHash:n}=await e.backend.schedulePieceRemoval({serviceURL:r,dataSetId:BigInt(a),pieceId:BigInt(d)});t=u(e,t,{transactionHash:n})}let s=t.checkpoint.transactionHash;if(e.progress?.({phase:"removing",message:`Waiting for confirmation of removal transaction ${s}`,data:{transactionHash:s}}),(await e.backend.waitForTransaction(s)).status!=="success")throw u(e,t,{transactionHash:void 0}),new m({code:p.removalReverted,message:`Removal transaction ${s} reverted; the piece is still stored.`});let o={...i,status:"removal_pending"};return W(e,t,o),Z(e,t,o)}export{ve as a,Se as b,N as c,x as d,we as e};
|
|
3
|
+
//# sourceMappingURL=chunk-I5AWWJGL.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/storage/jobs.ts"],
|
|
4
|
+
"sourcesContent": ["import { createReadStream } from 'node:fs'\nimport { rm, stat } from 'node:fs/promises'\nimport { basename, join, resolve } from 'node:path'\nimport type { DatabaseSync } from 'node:sqlite'\nimport * as Piece from '@filoz/synapse-core/piece'\nimport { SIZE_CONSTANTS } from '@filoz/synapse-core/utils'\nimport { CliError, isCliError } from 'clipact'\nimport {\n ErrorCodes,\n invalidInput,\n notFound,\n operationError,\n} from '../errors.ts'\nimport { transaction } from '../state/db.ts'\nimport { createId } from '../state/ids.ts'\nimport {\n acquireOperation,\n type Checkpoint,\n createOperation,\n getOperation,\n type Operation,\n releaseOperation,\n updateOperation,\n} from '../state/operations.ts'\nimport { getResource, type Resource, saveResource } from '../state/resources.ts'\nimport { packDirectory } from './pack.ts'\nimport type {\n CommittedPiece,\n Placement,\n StorageBackend,\n UploadQuote,\n} from './types.ts'\nimport { type RetrievalUrls, resourceUrls, retrievalUrls } from './urls.ts'\n\n/** Data-set metadata namespacing CLI uploads of raw files. */\nexport const FILE_DATA_SET_METADATA = { source: 'filecoin' }\n\n/**\n * Data-set metadata for folders. `withIPFSIndexing` asks Curio to index\n * the CAR so `/ipfs/<rootCid>` retrieval works.\n */\nexport const FOLDER_DATA_SET_METADATA = {\n source: 'filecoin',\n withIPFSIndexing: '',\n}\n\n/** Longest metadata value FWSS accepts. */\nconst MAX_METADATA_VALUE = 96\n\n/**\n * A step of a job, reported as progress. `link` is not a step: it reports\n * the retrieval link as soon as it works, before the commit confirms.\n */\nexport type JobPhase =\n | 'packing'\n | 'hashing'\n | 'placing'\n | 'uploading'\n | 'link'\n | 'committing'\n | 'removing'\n\n/** Everything a put or delete job needs besides its saved record. */\nexport type JobContext = {\n db: DatabaseSync\n backend: StorageBackend\n chainId: string\n payer: string\n /** filecoin-api origin for retrieval links. */\n apiUrl: string\n /** Staging directory for an operation. */\n stagingDir: (operationId: string) => string\n /** Aborted on SIGINT, SIGTERM, or SIGHUP; stops at the next step. */\n signal?: AbortSignal\n /** Progress for the caller to report on stderr. */\n progress?: (event: {\n phase: JobPhase\n message: string\n data?: Record<string, unknown>\n }) => void\n /** Called once the job's operation is saved and locked. */\n onOperation?: (operation: Operation) => void\n}\n\n/** Outcome of a put or delete, shaped for command output. */\nexport type JobResult = {\n operationId: string\n state: 'ready' | 'removal_pending'\n resource: Resource\n urls: RetrievalUrls\n}\n\n/** Options for {@link startPut}. */\nexport type StartPutOptions = {\n path: string\n name?: string | undefined\n providerId?: bigint | undefined\n}\n\n/** A file or directory checked for a put. */\ntype PutSource = {\n sourcePath: string\n kind: 'file' | 'folder'\n name: string\n /** Bytes of a file; directories are sized after packing. */\n size?: number\n}\n\n/** Check that `path` is a storable file or directory. */\nasync function inspectSource(options: StartPutOptions): Promise<PutSource> {\n const sourcePath = resolve(options.path)\n const stats = await stat(sourcePath).catch(() => undefined)\n if (!stats || !(stats.isFile() || stats.isDirectory())) {\n throw invalidInput(`No file or directory at ${options.path}.`, 'path')\n }\n const name = options.name ?? basename(sourcePath)\n if (stats.isDirectory()) return { sourcePath, kind: 'folder', name }\n assertPieceSize(stats.size)\n return { sourcePath, kind: 'file', name, size: stats.size }\n}\n\n/**\n * Validate the input, save a new put operation before any external mutation,\n * then run it.\n */\nexport async function startPut(\n ctx: JobContext,\n options: StartPutOptions\n): Promise<JobResult> {\n const source = await inspectSource(options)\n const op = createOperation(ctx.db, {\n action: 'put',\n resourceRef: createId('res'),\n chainId: ctx.chainId,\n payer: ctx.payer,\n input: {\n sourcePath: source.sourcePath,\n name: source.name,\n kind: source.kind,\n providerId: options.providerId?.toString(),\n },\n })\n return await runOperation(ctx, op.id)\n}\n\n/** What a put would do, from {@link estimatePut}. */\nexport type PutEstimate = {\n kind: 'file' | 'folder'\n name: string\n /** Bytes to store: the file, or the packed CAR. */\n size: number\n /** Files in a directory; 1 for a file. */\n files: number\n /** IPFS root CID of a directory. */\n rootCid?: string\n /** Chosen provider and quote, when a session key is available. */\n placement?: Placement\n quote?: UploadQuote\n}\n\n/** Options for {@link estimatePut}. */\nexport type EstimatePutOptions = StartPutOptions & {\n /** Prices the upload; omitted when not logged in. */\n backend?: StorageBackend | undefined\n}\n\n/**\n * Describe a put without side effects on providers or the chain: content\n * inventory, stored size, and, with a backend, the provider it would use and\n * what it would cost. Directories are packed only to measure the CAR;\n * nothing is written to disk.\n */\nexport async function estimatePut(\n options: EstimatePutOptions\n): Promise<PutEstimate> {\n const source = await inspectSource(options)\n let estimate: PutEstimate\n if (source.kind === 'file') {\n estimate = {\n kind: 'file',\n name: source.name,\n size: source.size ?? 0,\n files: 1,\n }\n } else {\n const packed = await packDirectory(source.sourcePath)\n assertPieceSize(packed.size)\n estimate = {\n kind: 'folder',\n name: source.name,\n size: packed.size,\n files: packed.files,\n rootCid: packed.rootCid.toString(),\n }\n }\n if (!options.backend) return estimate\n const placement = await options.backend.selectPlacement({\n metadata: metadataFor(estimate.kind),\n providerId: options.providerId,\n })\n const quote = await options.backend.quote({ size: estimate.size, placement })\n return { ...estimate, placement, quote }\n}\n\n/**\n * Run or resume an operation. A completed operation returns its saved\n * outcome. Otherwise this takes the execution lock, continues from the saved\n * checkpoint, and records failures so the job can be resumed with\n * `filecoin operations resume`.\n */\nexport async function runOperation(\n ctx: JobContext,\n operationId: string\n): Promise<JobResult> {\n const saved = getOperation(ctx.db, operationId)\n if (!saved) throw notFound(`Operation ${operationId} not found.`)\n if (saved.executionStatus === 'completed') return savedOutcome(ctx, saved)\n const op = acquireOperation(ctx.db, operationId)\n try {\n ctx.onOperation?.(op)\n return op.action === 'put'\n ? await runPut(ctx, op)\n : await runRemove(ctx, op)\n } catch (error) {\n updateOperation(ctx.db, op.id, {\n executionStatus: 'failed',\n pid: null,\n error: ctx.signal?.aborted\n ? 'Interrupted'\n : error instanceof Error\n ? error.message\n : String(error),\n })\n // clipact reports an interruption itself, with the checkpoint's steps.\n if (ctx.signal?.aborted) throw error\n throw operationError(error, op.id)\n } finally {\n releaseOperation(op.id)\n }\n}\n\n/** The saved outcome of a completed operation; nothing is re-run. */\nexport function savedOutcome(\n ctx: Pick<JobContext, 'db' | 'apiUrl'>,\n op: Operation\n): JobResult {\n const resource = getResource(ctx.db, op.resourceRef)\n if (!resource) {\n throw notFound(`Resource ${op.resourceRef} of ${op.id} no longer exists.`)\n }\n return jobResult(ctx, op, resource)\n}\n\n/** Shape a finished operation and its resource for command output. */\nfunction jobResult(\n ctx: Pick<JobContext, 'apiUrl'>,\n op: Operation,\n resource: Resource\n): JobResult {\n return {\n operationId: op.id,\n state: op.action === 'put' ? 'ready' : 'removal_pending',\n resource,\n urls: resourceUrls(resource, ctx.apiUrl),\n }\n}\n\n/**\n * Save the resource and mark the operation completed in one transaction, so\n * a stop at this point leaves a finished job, never a half-finished one.\n */\nfunction complete(\n ctx: JobContext,\n op: Operation,\n resource: Resource,\n checkpoint: Checkpoint = {}\n): void {\n transaction(ctx.db, () => {\n saveResource(ctx.db, resource)\n updateOperation(ctx.db, op.id, {\n executionStatus: 'completed',\n phase: 'done',\n pid: null,\n error: null,\n checkpoint,\n })\n })\n}\n\n/** Reject sizes outside the PDP piece limits. */\nfunction assertPieceSize(size: number): void {\n if (\n size < SIZE_CONSTANTS.MIN_UPLOAD_SIZE ||\n size > SIZE_CONSTANTS.MAX_UPLOAD_SIZE\n ) {\n throw invalidInput(\n `Content must be between ${SIZE_CONSTANTS.MIN_UPLOAD_SIZE} and ${SIZE_CONSTANTS.MAX_UPLOAD_SIZE} bytes; got ${size}.`,\n 'path'\n )\n }\n}\n\n/** Data-set metadata for a resource kind. */\nfunction metadataFor(kind: 'file' | 'folder') {\n return kind === 'folder' ? FOLDER_DATA_SET_METADATA : FILE_DATA_SET_METADATA\n}\n\n/**\n * Compute the PieceCID of a file by streaming it. Aborting `signal` destroys\n * the read stream, which stops the hashing.\n */\nasync function pieceCidOf(path: string, signal?: AbortSignal): Promise<string> {\n const stream = createReadStream(path, { signal })\n return (await Piece.calculate(stream)).toString()\n}\n\n/** Save checkpoint fields and return the updated operation. */\nfunction save(\n ctx: JobContext,\n op: Operation,\n checkpoint: Checkpoint,\n phase?: Operation['phase']\n): Operation {\n return updateOperation(ctx.db, op.id, {\n checkpoint,\n ...(phase ? { phase } : {}),\n })\n}\n\n/**\n * Put steps: pack (folders), identify, place, upload, commit, record. Each\n * step saves its result first, so a resumed job skips completed work and\n * never sends a second commit for the same content.\n */\nasync function runPut(ctx: JobContext, op: Operation): Promise<JobResult> {\n const { input } = op\n const kind = input.kind ?? 'file'\n const name = input.name ?? 'upload'\n const signal = ctx.signal\n if (!input.sourcePath) throw new Error(`Operation ${op.id} has no source.`)\n\n // Prepare the bytes to store.\n let uploadPath = input.sourcePath\n if (kind === 'folder') {\n uploadPath = join(ctx.stagingDir(op.id), 'folder.car')\n const staged = await stat(uploadPath).catch(() => undefined)\n if (!staged) {\n if (op.checkpoint.pieceCid) {\n throw new CliError({\n code: ErrorCodes.stagingMissing,\n message: `The staged CAR of ${op.id} is missing, so it cannot be resumed.`,\n next: [\n {\n by: 'agent',\n command: `filecoin put ${input.sourcePath}`,\n description: 'Start a new put of the same directory',\n },\n ],\n })\n }\n op = save(ctx, op, {}, 'packing')\n ctx.progress?.({\n phase: 'packing',\n message: `Packing ${input.sourcePath}`,\n })\n const packed = await packDirectory(input.sourcePath, uploadPath)\n op = save(ctx, op, {\n rootCid: packed.rootCid.toString(),\n size: packed.size,\n })\n }\n }\n\n signal?.throwIfAborted()\n const size = (await stat(uploadPath)).size\n assertPieceSize(size)\n ctx.progress?.({ phase: 'hashing', message: 'Computing PieceCID' })\n const pieceCid = await pieceCidOf(uploadPath, signal)\n if (op.checkpoint.pieceCid && op.checkpoint.pieceCid !== pieceCid) {\n throw new CliError({\n code: ErrorCodes.sourceChanged,\n message: `${uploadPath} changed since operation ${op.id} started.`,\n next: [\n {\n by: 'agent',\n command: `filecoin put ${input.sourcePath}`,\n description: 'Start a new put with the current content',\n },\n ],\n })\n }\n op = save(ctx, op, { pieceCid, size }, 'storing')\n\n // Choose a provider once; resumes reuse it.\n let placement = placementOf(op.checkpoint)\n if (!placement) {\n ctx.progress?.({\n phase: 'placing',\n message: 'Selecting a storage provider',\n })\n placement = await ctx.backend.selectPlacement({\n metadata: metadataFor(kind),\n providerId: input.providerId ? BigInt(input.providerId) : undefined,\n })\n const quote = await ctx.backend.quote({ size, placement })\n if (!quote.ready) throw insufficientFunds(quote)\n op = save(ctx, op, {\n providerId: placement.providerId.toString(),\n serviceURL: placement.serviceURL,\n payee: placement.payee,\n ...(placement.dataSetId == null\n ? {}\n : {\n dataSetId: placement.dataSetId.toString(),\n clientDataSetId: placement.clientDataSetId?.toString(),\n }),\n })\n }\n\n // Upload unless the provider already has the piece.\n if (!(op.checkpoint.commit || op.checkpoint.stored)) {\n const present = await ctx.backend.hasPiece({\n serviceURL: placement.serviceURL,\n pieceCid,\n })\n if (!present) {\n ctx.progress?.({\n phase: 'uploading',\n message: `Uploading ${size} bytes to provider ${placement.providerId}`,\n })\n await ctx.backend.upload({\n serviceURL: placement.serviceURL,\n path: uploadPath,\n size,\n pieceCid,\n })\n }\n op = save(ctx, op, { stored: true })\n }\n\n // Links that work before the commit confirms. The provider hint makes\n // filecoin-api redirect to the provider, which serves a parked piece at once.\n // A folder's browser link needs Curio's IPFS index, which Curio starts\n // building when it receives the commit, so it is reported after sending.\n const early = retrievalUrls({\n apiUrl: ctx.apiUrl,\n chainId: op.chainId,\n pieceCid,\n rootCid: op.checkpoint.rootCid,\n providerId: placement.providerId.toString(),\n })\n const reportLink = () =>\n ctx.progress?.({\n phase: 'link',\n message: early.browser,\n data: { pieceCid, urls: early },\n })\n if (kind === 'file') reportLink()\n\n const committed = await commit(\n ctx,\n op,\n placement,\n { pieceCid, name },\n kind === 'folder' ? reportLink : undefined\n )\n\n // Once committed, the indexer ranks the copies; the links need no hint.\n const urls = retrievalUrls({\n apiUrl: ctx.apiUrl,\n chainId: op.chainId,\n pieceCid,\n rootCid: op.checkpoint.rootCid,\n })\n\n const resource: Resource = {\n ref: op.resourceRef,\n kind,\n name,\n chainId: op.chainId,\n payer: op.payer,\n pieceCid,\n ...(op.checkpoint.rootCid ? { rootCid: op.checkpoint.rootCid } : {}),\n size,\n copies: [\n {\n providerId: placement.providerId.toString(),\n dataSetId: committed.dataSetId.toString(),\n pieceId: committed.pieceId.toString(),\n serviceURL: placement.serviceURL,\n },\n ],\n url: urls.browser,\n status: 'active',\n createdAt: new Date().toISOString(),\n }\n complete(ctx, op, resource, {\n dataSetId: committed.dataSetId.toString(),\n pieceId: committed.pieceId.toString(),\n })\n if (kind === 'folder') {\n await rm(ctx.stagingDir(op.id), { recursive: true, force: true }).catch(\n () => undefined\n )\n }\n return { operationId: op.id, state: 'ready', resource, urls }\n}\n\n/**\n * Commit the stored piece on chain exactly once. The commit is signed with a\n * fresh nonce and saved before it is sent. A resume first asks FWSS whether\n * that nonce was used; if so, the commit landed and nothing is sent. If not,\n * the same signature is sent again, and FWSS rejects any second use of its\n * nonce, so at most one commit takes effect.\n *\n * @see https://github.com/filecoin-project/agents/issues/1\n */\nasync function commit(\n ctx: JobContext,\n op: Operation,\n placement: Placement,\n piece: { pieceCid: string; name: string },\n onSent?: () => void\n): Promise<CommittedPiece> {\n const pieceMetadata: Record<string, string> = {\n name: piece.name.slice(0, MAX_METADATA_VALUE),\n ...(op.checkpoint.rootCid ? { ipfsRootCID: op.checkpoint.rootCid } : {}),\n }\n const saved = op.checkpoint.commit\n if (saved) {\n const landed = await ctx.backend.findCommit({ nonce: BigInt(saved.nonce) })\n if (landed) return landed\n }\n\n op = save(ctx, op, {}, 'committing')\n let signed = saved\n if (!signed) {\n ctx.progress?.({ phase: 'committing', message: 'Signing the commit' })\n signed = await ctx.backend.signCommit({\n placement,\n pieceCid: piece.pieceCid,\n metadata: metadataFor(op.input.kind ?? 'file'),\n pieceMetadata,\n })\n op = save(ctx, op, { commit: signed })\n }\n\n if (!op.checkpoint.statusUrl) {\n ctx.progress?.({\n phase: 'committing',\n message: signed.created\n ? 'Creating data set and adding piece'\n : 'Adding piece',\n })\n const submission = await ctx.backend.submitCommit({\n placement,\n pieceCid: piece.pieceCid,\n commit: signed,\n pieceMetadata,\n })\n op = save(ctx, op, {\n statusUrl: submission.statusUrl,\n transactionHash: submission.transactionHash,\n })\n }\n\n onSent?.()\n // clipact repeats this line with the elapsed time while the wait lasts, so\n // the user can look the transaction up meanwhile.\n const { transactionHash } = op.checkpoint\n ctx.progress?.({\n phase: 'committing',\n message: transactionHash\n ? `Waiting for confirmation of transaction ${transactionHash}`\n : 'Waiting for on-chain confirmation',\n ...(transactionHash ? { data: { transactionHash } } : {}),\n })\n try {\n return await ctx.backend.waitForCommit({\n statusUrl: op.checkpoint.statusUrl as string,\n created: signed.created,\n })\n } catch (error) {\n if (isCliError(error) && error.code === ErrorCodes.commitRejected) {\n // A failed transaction leaves the nonce unused; forget its status so a\n // resume sends the same signature again.\n save(ctx, op, { statusUrl: undefined, transactionHash: undefined })\n }\n throw error\n }\n}\n\n/** Error returned when the payer cannot cover an upload. */\nfunction insufficientFunds(quote: UploadQuote): CliError {\n return new CliError({\n code: ErrorCodes.insufficientFunds,\n message: quote.needsApproval\n ? 'The payer must deposit USDFC and approve Warm Storage before uploading.'\n : 'The payer must deposit more USDFC before uploading.',\n details: {\n fundingUrl: quote.fundingUrl,\n depositNeeded: quote.depositNeeded.toString(),\n needsApproval: quote.needsApproval,\n },\n next: [\n {\n by: 'user',\n description: `Fund the account at ${quote.fundingUrl}`,\n },\n ],\n })\n}\n\n/** Rebuild a saved placement from a checkpoint. */\nfunction placementOf(checkpoint: Checkpoint): Placement | undefined {\n if (!(checkpoint.providerId && checkpoint.serviceURL && checkpoint.payee)) {\n return undefined\n }\n return {\n providerId: BigInt(checkpoint.providerId),\n serviceURL: checkpoint.serviceURL,\n payee: checkpoint.payee as `0x${string}`,\n ...(checkpoint.dataSetId && checkpoint.clientDataSetId\n ? {\n dataSetId: BigInt(checkpoint.dataSetId),\n clientDataSetId: BigInt(checkpoint.clientDataSetId),\n }\n : {}),\n }\n}\n\n/**\n * Save a new delete operation for a managed resource, then run it.\n */\nexport async function startRemove(\n ctx: JobContext,\n ref: string\n): Promise<JobResult> {\n const resource = getResource(ctx.db, ref, ctx)\n if (!resource) {\n throw notFound(`No managed resource ${ref} for this account.`, {\n by: 'agent',\n command: 'filecoin ls',\n description: 'List managed resources',\n })\n }\n if (resource.status !== 'active') {\n throw invalidInput(`${ref} is already pending removal.`, 'ref')\n }\n const [copy] = resource.copies\n if (!copy) throw new Error(`Resource ${ref} has no stored copies.`)\n const op = createOperation(ctx.db, {\n action: 'delete',\n resourceRef: ref,\n chainId: ctx.chainId,\n payer: ctx.payer,\n input: {},\n checkpoint: {\n providerId: copy.providerId,\n serviceURL: copy.serviceURL,\n dataSetId: copy.dataSetId,\n pieceId: copy.pieceId,\n },\n })\n return await runOperation(ctx, op.id)\n}\n\n/**\n * Schedule removal of the resource's piece and wait for the transaction.\n * The provider deletes the data at its next proving boundary, so the result\n * is `removal_pending`. A reverted transaction leaves the resource active.\n */\nasync function runRemove(ctx: JobContext, op: Operation): Promise<JobResult> {\n const resource = getResource(ctx.db, op.resourceRef)\n if (!resource) throw notFound(`Resource ${op.resourceRef} no longer exists.`)\n const { serviceURL, dataSetId, pieceId } = op.checkpoint\n if (!(serviceURL && dataSetId && pieceId)) {\n throw new Error(`Operation ${op.id} is missing its removal target.`)\n }\n if (!op.checkpoint.transactionHash) {\n op = save(ctx, op, {}, 'removing')\n ctx.progress?.({\n phase: 'removing',\n message: `Scheduling removal of piece ${pieceId}`,\n })\n const { transactionHash } = await ctx.backend.schedulePieceRemoval({\n serviceURL,\n dataSetId: BigInt(dataSetId),\n pieceId: BigInt(pieceId),\n })\n op = save(ctx, op, { transactionHash })\n }\n const hash = op.checkpoint.transactionHash as `0x${string}`\n ctx.progress?.({\n phase: 'removing',\n message: `Waiting for confirmation of removal transaction ${hash}`,\n data: { transactionHash: hash },\n })\n const receipt = await ctx.backend.waitForTransaction(hash)\n if (receipt.status !== 'success') {\n // The reverted transaction had no effect; a resume signs a new one.\n save(ctx, op, { transactionHash: undefined })\n throw new CliError({\n code: ErrorCodes.removalReverted,\n message: `Removal transaction ${hash} reverted; the piece is still stored.`,\n })\n }\n const updated: Resource = { ...resource, status: 'removal_pending' }\n complete(ctx, op, updated)\n return jobResult(ctx, op, updated)\n}\n"],
|
|
5
|
+
"mappings": ";iTAAA,OAAS,oBAAAA,MAAwB,UACjC,OAAS,MAAAC,EAAI,QAAAC,MAAY,mBACzB,OAAS,YAAAC,EAAU,QAAAC,EAAM,WAAAC,MAAe,YAiCjC,IAAMC,EAAyB,CAAE,OAAQ,UAAW,EAM9CC,EAA2B,CACtC,OAAQ,WACR,iBAAkB,EACpB,EAGMC,EAAqB,GA8D3B,eAAeC,EAAcC,EAA8C,CACzE,IAAMC,EAAaC,EAAQF,EAAQ,IAAI,EACjCG,EAAQ,MAAMC,EAAKH,CAAU,EAAE,MAAM,IAAG,EAAY,EAC1D,GAAI,CAACE,GAAS,EAAEA,EAAM,OAAO,GAAKA,EAAM,YAAY,GAClD,MAAME,EAAa,2BAA2BL,EAAQ,IAAI,IAAK,MAAM,EAEvE,IAAMM,EAAON,EAAQ,MAAQO,EAASN,CAAU,EAChD,OAAIE,EAAM,YAAY,EAAU,CAAE,WAAAF,EAAY,KAAM,SAAU,KAAAK,CAAK,GACnEE,EAAgBL,EAAM,IAAI,EACnB,CAAE,WAAAF,EAAY,KAAM,OAAQ,KAAAK,EAAM,KAAMH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,EAAKwC,EAAK1C,EAAKE,EAAI,CAAC,EAAG,UAAU,EACjCF,EAAI,WAAW,CACb,MAAO,WACP,QAAS,+BAA+BwE,CAAO,EACjD,CAAC,EACD,GAAM,CAAE,gBAAAP,CAAgB,EAAI,MAAMjE,EAAI,QAAQ,qBAAqB,CACjE,WAAAsE,EACA,UAAW,OAAOC,CAAS,EAC3B,QAAS,OAAOC,CAAO,CACzB,CAAC,EACDtE,EAAKwC,EAAK1C,EAAKE,EAAI,CAAE,gBAAA+D,CAAgB,CAAC,CACxC,CACA,IAAMQ,EAAOvE,EAAG,WAAW,gBAO3B,GANAF,EAAI,WAAW,CACb,MAAO,WACP,QAAS,mDAAmDyE,CAAI,GAChE,KAAM,CAAE,gBAAiBA,CAAK,CAChC,CAAC,GACe,MAAMzE,EAAI,QAAQ,mBAAmByE,CAAI,GAC7C,SAAW,UAErB,MAAA/B,EAAK1C,EAAKE,EAAI,CAAE,gBAAiB,MAAU,CAAC,EACtC,IAAI6C,EAAS,CACjB,KAAMC,EAAW,gBACjB,QAAS,uBAAuByB,CAAI,uCACtC,CAAC,EAEH,IAAMC,EAAoB,CAAE,GAAGjD,EAAU,OAAQ,iBAAkB,EACnE,OAAAI,EAAS7B,EAAKE,EAAIwE,CAAO,EAClB/C,EAAU3B,EAAKE,EAAIwE,CAAO,CACnC",
|
|
6
|
+
"names": ["createReadStream", "rm", "stat", "basename", "join", "resolve", "FILE_DATA_SET_METADATA", "FOLDER_DATA_SET_METADATA", "MAX_METADATA_VALUE", "inspectSource", "options", "sourcePath", "resolve", "stats", "stat", "invalidInput", "name", "basename", "assertPieceSize", "startPut", "ctx", "source", "op", "createOperation", "createId", "runOperation", "estimatePut", "estimate", "packed", "packDirectory", "placement", "metadataFor", "quote", "operationId", "saved", "getOperation", "notFound", "savedOutcome", "acquireOperation", "runPut", "runRemove", "error", "updateOperation", "operationError", "releaseOperation", "resource", "getResource", "jobResult", "resourceUrls", "complete", "checkpoint", "transaction", "saveResource", "size", "SIZE_CONSTANTS", "kind", "pieceCidOf", "path", "signal", "stream", "createReadStream", "calculate", "save", "phase", "input", "uploadPath", "join", "CliError", "ErrorCodes", "pieceCid", "placementOf", "insufficientFunds", "early", "retrievalUrls", "reportLink", "committed", "commit", "urls", "rm", "piece", "onSent", "pieceMetadata", "landed", "signed", "submission", "transactionHash", "isCliError", "startRemove", "ref", "copy", "serviceURL", "dataSetId", "pieceId", "hash", "updated"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{a as e,c as s,f as r,g as d,h as p,i,j as l,u,v as f}from"./chunk-JUFFOBKU.js";import{d as a}from"./chunk-3TJUKWFC.js";var y=a({name:"status",description:"Show the session, scope expiries, and funding readiness",examples:["filecoin status","filecoin status --network mainnet"],input:d(u),env:f,secrets:["sessionKey"],output:r({network:e(),session:r({state:i(["none","pending","active"]),source:i(["env","config"]).optional(),address:e().optional(),rootAddress:e().optional(),url:e().optional().describe("Approval link of a pending login"),scopes:p(e(),e()).optional().describe('Expiry per scope, or "expired" or "not granted"')}),account:r({token:l("USDFC"),funds:e(),availableFunds:e(),debt:e(),ready:s().describe("Ready to pay for a new 1 MiB upload"),needsApproval:s(),depositNeeded:e(),fundingUrl:e().optional()}).optional()}),readOnly:!0,human:({network:z,session:n,account:o})=>{let t=[`network: ${z}`,`session: ${n.state}`];n.url&&t.push(`approve at: ${n.url}`),n.rootAddress&&t.push(`wallet: ${n.rootAddress}`);for(let[c,g]of Object.entries(n.scopes??{}))t.push(` ${c}: ${g}`);return o&&(t.push(`funds: ${o.availableFunds} of ${o.funds} USDFC available`,`ready: ${o.ready?"yes":"no"}`),o.fundingUrl&&t.push(`fund at: ${o.fundingUrl}`)),t.join(`
|
|
3
|
+
`)},handler:()=>import("./status-IWMRFMPV.js")});export{y as a};
|
|
4
|
+
//# sourceMappingURL=chunk-IFG72OQD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/status.ts"],
|
|
4
|
+
"sourcesContent": ["import { defineCommand } from 'clipact'\nimport * as z from 'zod'\nimport { account, accountEnv } from './shared.ts'\n\n/** `filecoin status`: session, scope expiries, and funding readiness. */\nexport const status = defineCommand({\n name: 'status',\n description: 'Show the session, scope expiries, and funding readiness',\n examples: ['filecoin status', 'filecoin status --network mainnet'],\n input: z.strictObject(account),\n env: accountEnv,\n secrets: ['sessionKey'],\n output: z.object({\n network: z.string(),\n session: z.object({\n state: z.enum(['none', 'pending', 'active']),\n source: z.enum(['env', 'config']).optional(),\n address: z.string().optional(),\n rootAddress: z.string().optional(),\n url: z.string().optional().describe('Approval link of a pending login'),\n scopes: z\n .record(z.string(), z.string())\n .optional()\n .describe('Expiry per scope, or \"expired\" or \"not granted\"'),\n }),\n account: z\n .object({\n token: z.literal('USDFC'),\n funds: z.string(),\n availableFunds: z.string(),\n debt: z.string(),\n ready: z.boolean().describe('Ready to pay for a new 1 MiB upload'),\n needsApproval: z.boolean(),\n depositNeeded: z.string(),\n fundingUrl: z.string().optional(),\n })\n .optional(),\n }),\n readOnly: true,\n human: ({ network, session, account }) => {\n const lines = [`network: ${network}`, `session: ${session.state}`]\n if (session.url) lines.push(`approve at: ${session.url}`)\n if (session.rootAddress) lines.push(`wallet: ${session.rootAddress}`)\n for (const [scope, expiry] of Object.entries(session.scopes ?? {})) {\n lines.push(` ${scope}: ${expiry}`)\n }\n if (account) {\n lines.push(\n `funds: ${account.availableFunds} of ${account.funds} USDFC available`,\n `ready: ${account.ready ? 'yes' : 'no'}`\n )\n if (account.fundingUrl) lines.push(`fund at: ${account.fundingUrl}`)\n }\n return lines.join('\\n')\n },\n handler: () => import('../handlers/status.ts'),\n})\n"],
|
|
5
|
+
"mappings": ";8HAKO,IAAMA,EAASC,EAAc,CAClC,KAAM,SACN,YAAa,0DACb,SAAU,CAAC,kBAAmB,mCAAmC,E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AK,YAAYV,EAAQ,UAAU,EAAE,GAE9DU,EAAM,KAAK;AAAA,CAAI,CACxB,EACA,QAAS,IAAM,OAAO,sBAAuB,CAC/C,CAAC",
|
|
6
|
+
"names": ["status", "defineCommand", "strictObject", "account", "accountEnv", "object", "string", "_enum", "record", "literal", "boolean", "network", "session", "lines", "scope", "expiry"]
|
|
7
|
+
}
|