yaml-flow 8.4.19 → 8.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/browser/asset-integrity.json +3 -3
  2. package/browser/board-livecards-localstorage.js +7 -7
  3. package/cli/browser-api/board-live-cards-browser-adapter.d.ts +1 -1
  4. package/cli/bundled/artifacts-store-cli.mjs +9 -9
  5. package/cli/bundled/board-live-cards-cli.mjs +19 -19
  6. package/cli/{types-0p9n3CCe.d.ts → types-juH2nFpz.d.ts} +0 -7
  7. package/examples/board/demo-shell-with-server.html +2 -2
  8. package/examples/board/doc.html +2 -2
  9. package/examples/board-local/demo-shell-localstorage.html +3 -3
  10. package/lib/artifacts-store-public.d.cts +1 -1
  11. package/lib/artifacts-store-public.d.ts +1 -1
  12. package/lib/board-live-cards-node.cjs +9 -9
  13. package/lib/board-live-cards-node.d.cts +4 -4
  14. package/lib/board-live-cards-node.d.ts +4 -4
  15. package/lib/board-live-cards-node.js +9 -9
  16. package/lib/{board-live-cards-public-BYsn6ZiF.d.cts → board-live-cards-public-B4RcYPC_.d.cts} +0 -7
  17. package/lib/{board-live-cards-public-DOnaJrsU.d.ts → board-live-cards-public-ydXuA4zh.d.ts} +0 -7
  18. package/lib/board-live-cards-public.cjs +2 -2
  19. package/lib/board-live-cards-public.d.cts +1 -1
  20. package/lib/board-live-cards-public.d.ts +1 -1
  21. package/lib/board-live-cards-public.js +2 -2
  22. package/lib/board-live-cards-server-runtime.cjs +3 -3
  23. package/lib/board-live-cards-server-runtime.d.cts +2 -2
  24. package/lib/board-live-cards-server-runtime.d.ts +2 -2
  25. package/lib/board-live-cards-server-runtime.js +3 -3
  26. package/lib/card-store-public.d.cts +1 -1
  27. package/lib/card-store-public.d.ts +1 -1
  28. package/lib/chat-store-public.d.cts +1 -1
  29. package/lib/chat-store-public.d.ts +1 -1
  30. package/lib/server-runtime/index.cjs +3 -3
  31. package/lib/server-runtime/index.d.cts +3 -3
  32. package/lib/server-runtime/index.d.ts +3 -3
  33. package/lib/server-runtime/index.js +3 -3
  34. package/lib/{types-CDfG82H-.d.ts → types-1L1D33mr.d.ts} +1 -1
  35. package/lib/{types-DlQrB1RA.d.cts → types-D501gMQt.d.cts} +1 -1
  36. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  import{createRequire}from"module";const require=createRequire(import.meta.url);
2
- var vt=Object.create;var De=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var xt=Object.getPrototypeOf,Tt=Object.prototype.hasOwnProperty;var $=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var P=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Et=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of _t(t))!Tt.call(e,n)&&n!==r&&De(e,n,{get:()=>t[n],enumerable:!(u=gt(t,n))||u.enumerable});return e};var Ot=(e,t,r)=>(r=e!=null?vt(xt(e)):{},Et(t||!e||!e.__esModule?De(r,"default",{value:e,enumerable:!0}):r,e));var Ae=P((yr,Me)=>{var q=$("constants"),kt=process.cwd,ie=null,bt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=kt.call(process)),ie};try{process.cwd()}catch{}typeof process.chdir=="function"&&(me=process.chdir,process.chdir=function(e){ie=null,me.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,me));var me;Me.exports=Ft;function Ft(e){q.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=u(e.chmod),e.fchmod=u(e.fchmod),e.lchmod=u(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=c(e.stat),e.fstat=c(e.fstat),e.lstat=c(e.lstat),e.statSync=d(e.statSync),e.fstatSync=d(e.fstatSync),e.lstatSync=d(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(o,s,l){l&&process.nextTick(l)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(o,s,l,f){f&&process.nextTick(f)},e.lchownSync=function(){}),bt==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(o){function s(l,f,p){var _=Date.now(),v=0;o(l,f,function E(R){if(R&&(R.code==="EACCES"||R.code==="EPERM"||R.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){e.stat(f,function(A,Z){A&&A.code==="ENOENT"?o(l,f,E):p(R)})},v),v<100&&(v+=10);return}p&&p(R)})}return Object.setPrototypeOf&&Object.setPrototypeOf(s,o),s})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(o){function s(l,f,p,_,v,E){var R;if(E&&typeof E=="function"){var A=0;R=function(Z,Le,Ne){if(Z&&Z.code==="EAGAIN"&&A<10)return A++,o.call(e,l,f,p,_,v,R);E.apply(this,arguments)}}return o.call(e,l,f,p,_,v,R)}return Object.setPrototypeOf&&Object.setPrototypeOf(s,o),s})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(o){return function(s,l,f,p,_){for(var v=0;;)try{return o.call(e,s,l,f,p,_)}catch(E){if(E.code==="EAGAIN"&&v<10){v++;continue}throw E}}})(e.readSync);function t(o){o.lchmod=function(s,l,f){o.open(s,q.O_WRONLY|q.O_SYMLINK,l,function(p,_){if(p){f&&f(p);return}o.fchmod(_,l,function(v){o.close(_,function(E){f&&f(v||E)})})})},o.lchmodSync=function(s,l){var f=o.openSync(s,q.O_WRONLY|q.O_SYMLINK,l),p=!0,_;try{_=o.fchmodSync(f,l),p=!1}finally{if(p)try{o.closeSync(f)}catch{}else o.closeSync(f)}return _}}function r(o){q.hasOwnProperty("O_SYMLINK")&&o.futimes?(o.lutimes=function(s,l,f,p){o.open(s,q.O_SYMLINK,function(_,v){if(_){p&&p(_);return}o.futimes(v,l,f,function(E){o.close(v,function(R){p&&p(E||R)})})})},o.lutimesSync=function(s,l,f){var p=o.openSync(s,q.O_SYMLINK),_,v=!0;try{_=o.futimesSync(p,l,f),v=!1}finally{if(v)try{o.closeSync(p)}catch{}else o.closeSync(p)}return _}):o.futimes&&(o.lutimes=function(s,l,f,p){p&&process.nextTick(p)},o.lutimesSync=function(){})}function u(o){return o&&function(s,l,f){return o.call(e,s,l,function(p){h(p)&&(p=null),f&&f.apply(this,arguments)})}}function n(o){return o&&function(s,l){try{return o.call(e,s,l)}catch(f){if(!h(f))throw f}}}function i(o){return o&&function(s,l,f,p){return o.call(e,s,l,f,function(_){h(_)&&(_=null),p&&p.apply(this,arguments)})}}function a(o){return o&&function(s,l,f){try{return o.call(e,s,l,f)}catch(p){if(!h(p))throw p}}}function c(o){return o&&function(s,l,f){typeof l=="function"&&(f=l,l=null);function p(_,v){v&&(v.uid<0&&(v.uid+=4294967296),v.gid<0&&(v.gid+=4294967296)),f&&f.apply(this,arguments)}return l?o.call(e,s,l,p):o.call(e,s,p)}}function d(o){return o&&function(s,l){var f=l?o.call(e,s,l):o.call(e,s);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function h(o){if(!o||o.code==="ENOSYS")return!0;var s=!process.getuid||process.getuid()!==0;return!!(s&&(o.code==="EINVAL"||o.code==="EPERM"))}}});var Ce=P((pr,Pe)=>{var Re=$("stream").Stream;Pe.exports=It;function It(e){return{ReadStream:t,WriteStream:r};function t(u,n){if(!(this instanceof t))return new t(u,n);Re.call(this);var i=this;this.path=u,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var a=Object.keys(n),c=0,d=a.length;c<d;c++){var h=a[c];this[h]=n[h]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}e.open(this.path,this.flags,this.mode,function(o,s){if(o){i.emit("error",o),i.readable=!1;return}i.fd=s,i.emit("open",s),i._read()})}function r(u,n){if(!(this instanceof r))return new r(u,n);Re.call(this),this.path=u,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var i=Object.keys(n),a=0,c=i.length;a<c;a++){var d=i[a];this[d]=n[d]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Ue=P((dr,je)=>{"use strict";je.exports=Nt;var Lt=Object.getPrototypeOf||function(e){return e.__proto__};function Nt(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Lt(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var ge=P((hr,ve)=>{var k=$("fs"),Dt=Ae(),Mt=Ce(),At=Ue(),ue=$("util"),M,ae;typeof Symbol=="function"&&typeof Symbol.for=="function"?(M=Symbol.for("graceful-fs.queue"),ae=Symbol.for("graceful-fs.previous")):(M="___graceful-fs.queue",ae="___graceful-fs.previous");function Rt(){}function Be(e,t){Object.defineProperty(e,M,{get:function(){return t}})}var G=Rt;ue.debuglog?G=ue.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(G=function(){var e=ue.format.apply(ue,arguments);e="GFS4: "+e.split(/\n/).join(`
3
- GFS4: `),console.error(e)});k[M]||($e=global[M]||[],Be(k,$e),k.close=(function(e){function t(r,u){return e.call(k,r,function(n){n||qe(),typeof u=="function"&&u.apply(this,arguments)})}return Object.defineProperty(t,ae,{value:e}),t})(k.close),k.closeSync=(function(e){function t(r){e.apply(k,arguments),qe()}return Object.defineProperty(t,ae,{value:e}),t})(k.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){G(k[M]),$("assert").equal(k[M].length,0)}));var $e;global[M]||Be(global,k[M]);ve.exports=Se(At(k));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!k.__patched&&(ve.exports=Se(k),k.__patched=!0);function Se(e){Dt(e),e.gracefulify=Se,e.createReadStream=Le,e.createWriteStream=Ne;var t=e.readFile;e.readFile=r;function r(y,S,m){return typeof S=="function"&&(m=S,S=null),L(y,S,m);function L(N,F,O,b){return t(N,F,function(g){g&&(g.code==="EMFILE"||g.code==="ENFILE")?J([L,[N,F,O],g,b||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var u=e.writeFile;e.writeFile=n;function n(y,S,m,L){return typeof m=="function"&&(L=m,m=null),N(y,S,m,L);function N(F,O,b,g,D){return u(F,O,b,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[F,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}var i=e.appendFile;i&&(e.appendFile=a);function a(y,S,m,L){return typeof m=="function"&&(L=m,m=null),N(y,S,m,L);function N(F,O,b,g,D){return i(F,O,b,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[F,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}var c=e.copyFile;c&&(e.copyFile=d);function d(y,S,m,L){return typeof m=="function"&&(L=m,m=0),N(y,S,m,L);function N(F,O,b,g,D){return c(F,O,b,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[F,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}var h=e.readdir;e.readdir=s;var o=/^v[0-5]\./;function s(y,S,m){typeof S=="function"&&(m=S,S=null);var L=o.test(process.version)?function(O,b,g,D){return h(O,N(O,b,g,D))}:function(O,b,g,D){return h(O,b,N(O,b,g,D))};return L(y,S,m);function N(F,O,b,g){return function(D,x){D&&(D.code==="EMFILE"||D.code==="ENFILE")?J([L,[F,O,b],D,g||Date.now(),Date.now()]):(x&&x.sort&&x.sort(),typeof b=="function"&&b.call(this,D,x))}}}if(process.version.substr(0,4)==="v0.8"){var l=Mt(e);E=l.ReadStream,A=l.WriteStream}var f=e.ReadStream;f&&(E.prototype=Object.create(f.prototype),E.prototype.open=R);var p=e.WriteStream;p&&(A.prototype=Object.create(p.prototype),A.prototype.open=Z),Object.defineProperty(e,"ReadStream",{get:function(){return E},set:function(y){E=y},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return A},set:function(y){A=y},enumerable:!0,configurable:!0});var _=E;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(y){_=y},enumerable:!0,configurable:!0});var v=A;Object.defineProperty(e,"FileWriteStream",{get:function(){return v},set:function(y){v=y},enumerable:!0,configurable:!0});function E(y,S){return this instanceof E?(f.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function R(){var y=this;he(y.path,y.flags,y.mode,function(S,m){S?(y.autoClose&&y.destroy(),y.emit("error",S)):(y.fd=m,y.emit("open",m),y.read())})}function A(y,S){return this instanceof A?(p.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function Z(){var y=this;he(y.path,y.flags,y.mode,function(S,m){S?(y.destroy(),y.emit("error",S)):(y.fd=m,y.emit("open",m))})}function Le(y,S){return new e.ReadStream(y,S)}function Ne(y,S){return new e.WriteStream(y,S)}var wt=e.open;e.open=he;function he(y,S,m,L){return typeof m=="function"&&(L=m,m=null),N(y,S,m,L);function N(F,O,b,g,D){return wt(F,O,b,function(x,sr){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[F,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}return e}function J(e){G("ENQUEUE",e[0].name,e[1]),k[M].push(e),we()}var oe;function qe(){for(var e=Date.now(),t=0;t<k[M].length;++t)k[M][t].length>2&&(k[M][t][3]=e,k[M][t][4]=e);we()}function we(){if(clearTimeout(oe),oe=void 0,k[M].length!==0){var e=k[M].shift(),t=e[0],r=e[1],u=e[2],n=e[3],i=e[4];if(n===void 0)G("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){G("TIMEOUT",t.name,r);var a=r.pop();typeof a=="function"&&a.call(null,u)}else{var c=Date.now()-i,d=Math.max(i-n,1),h=Math.min(d*1.2,100);c>=h?(G("RETRY",t.name,r),t.apply(null,r.concat([n]))):k[M].push(e)}oe===void 0&&(oe=setTimeout(we,0))}}});var We=P((mr,Ge)=>{function C(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Ge.exports=C;C.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};C.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};C.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var u=this,n=setTimeout(function(){u._attempts++,u._operationTimeoutCb&&(u._timeout=setTimeout(function(){u._operationTimeoutCb(u._attempts)},u._operationTimeout),u._options.unref&&u._timeout.unref()),u._fn(u._attempts)},r);return this._options.unref&&n.unref(),!0};C.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};C.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};C.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};C.prototype.start=C.prototype.try;C.prototype.errors=function(){return this._errors};C.prototype.attempts=function(){return this._attempts};C.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,r=0,u=0;u<this._errors.length;u++){var n=this._errors[u],i=n.message,a=(e[i]||0)+1;e[i]=a,a>=r&&(t=n,r=a)}return t}});var ze=P(W=>{var Pt=We();W.operation=function(e){var t=W.timeouts(e);return new Pt(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};W.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var u=[],n=0;n<t.retries;n++)u.push(this.createTimeout(n,t));return e&&e.forever&&!u.length&&u.push(this.createTimeout(n,t)),u.sort(function(i,a){return i-a}),u};W.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,u=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return u=Math.min(u,t.maxTimeout),u};W.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var u in e)typeof e[u]=="function"&&r.push(u)}for(var n=0;n<r.length;n++){var i=r[n],a=e[i];e[i]=function(d){var h=W.operation(t),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push(function(l){h.retry(l)||(l&&(arguments[0]=h.mainError()),s.apply(this,arguments))}),h.attempt(function(){d.apply(e,o)})}.bind(e,a),e[i].options=t}}});var Je=P((wr,Ye)=>{Ye.exports=ze()});var Ke=P((vr,ce)=>{ce.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&ce.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ce.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Ze=P((gr,H)=>{var T=global.process,z=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};z(T)?(Qe=$("assert"),K=Ke(),He=/^win/i.test(T.platform),ee=$("events"),typeof ee!="function"&&(ee=ee.EventEmitter),T.__signal_exit_emitter__?I=T.__signal_exit_emitter__:(I=T.__signal_exit_emitter__=new ee,I.count=0,I.emitted={}),I.infinite||(I.setMaxListeners(1/0),I.infinite=!0),H.exports=function(e,t){if(!z(global.process))return function(){};Qe.equal(typeof e,"function","a callback must be provided for exit handler"),Q===!1&&_e();var r="exit";t&&t.alwaysLast&&(r="afterexit");var u=function(){I.removeListener(r,e),I.listeners("exit").length===0&&I.listeners("afterexit").length===0&&fe()};return I.on(r,e),u},fe=function(){!Q||!z(global.process)||(Q=!1,K.forEach(function(t){try{T.removeListener(t,se[t])}catch{}}),T.emit=le,T.reallyExit=xe,I.count-=1)},H.exports.unload=fe,Y=function(t,r,u){I.emitted[t]||(I.emitted[t]=!0,I.emit(t,r,u))},se={},K.forEach(function(e){se[e]=function(){if(z(global.process)){var r=T.listeners(e);r.length===I.count&&(fe(),Y("exit",null,e),Y("afterexit",null,e),He&&e==="SIGHUP"&&(e="SIGINT"),T.kill(T.pid,e))}}}),H.exports.signals=function(){return K},Q=!1,_e=function(){Q||!z(global.process)||(Q=!0,I.count+=1,K=K.filter(function(t){try{return T.on(t,se[t]),!0}catch{return!1}}),T.emit=Xe,T.reallyExit=Ve)},H.exports.load=_e,xe=T.reallyExit,Ve=function(t){z(global.process)&&(T.exitCode=t||0,Y("exit",T.exitCode,null),Y("afterexit",T.exitCode,null),xe.call(T,T.exitCode))},le=T.emit,Xe=function(t,r){if(t==="exit"&&z(global.process)){r!==void 0&&(T.exitCode=r);var u=le.apply(this,arguments);return Y("exit",T.exitCode,null),Y("afterexit",T.exitCode,null),u}else return le.apply(this,arguments)}):H.exports=function(){return function(){}};var Qe,K,He,ee,I,fe,Y,se,Q,_e,xe,Ve,le,Xe});var tt=P((_r,Te)=>{"use strict";var et=Symbol();function Ct(e,t,r){let u=t[et];if(u)return t.stat(e,(i,a)=>{if(i)return r(i);r(null,a.mtime,u)});let n=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,n,n,i=>{if(i)return r(i);t.stat(e,(a,c)=>{if(a)return r(a);let d=c.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,et,{value:d}),r(null,c.mtime,d)})})}function jt(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}Te.exports.probe=Ct;Te.exports.getMtime=jt});var ot=P((xr,re)=>{"use strict";var Ut=$("path"),ke=ge(),$t=Je(),qt=Ze(),rt=tt(),U={};function te(e,t){return t.lockfilePath||`${e}.lock`}function be(e,t,r){if(!t.realpath)return r(null,Ut.resolve(e));t.fs.realpath(e,r)}function Oe(e,t,r){let u=te(e,t);t.fs.mkdir(u,n=>{if(!n)return rt.probe(u,t.fs,(i,a,c)=>{if(i)return t.fs.rmdir(u,()=>{}),r(i);r(null,a,c)});if(n.code!=="EEXIST")return r(n);if(t.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(u,(i,a)=>{if(i)return i.code==="ENOENT"?Oe(e,{...t,stale:0},r):r(i);if(!nt(a,t))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));it(e,t,c=>{if(c)return r(c);Oe(e,{...t,stale:0},r)})})})}function nt(e,t){return e.mtime.getTime()<Date.now()-t.stale}function it(e,t,r){t.fs.rmdir(te(e,t),u=>{if(u&&u.code!=="ENOENT")return r(u);r()})}function ye(e,t){let r=U[e];r.updateTimeout||(r.updateDelay=r.updateDelay||t.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,t.fs.stat(r.lockfilePath,(u,n)=>{let i=r.lastUpdate+t.stale<Date.now();if(u)return u.code==="ENOENT"||i?Ee(e,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ye(e,t));if(!(r.mtime.getTime()===n.mtime.getTime()))return Ee(e,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let c=rt.getMtime(r.mtimePrecision);t.fs.utimes(r.lockfilePath,c,c,d=>{let h=r.lastUpdate+t.stale<Date.now();if(!r.released){if(d)return d.code==="ENOENT"||h?Ee(e,r,Object.assign(d,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ye(e,t));r.mtime=c,r.lastUpdate=Date.now(),r.updateDelay=null,ye(e,t)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Ee(e,t,r){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),U[e]===t&&delete U[e],t.options.onCompromised(r)}function Bt(e,t,r){t={stale:1e4,update:null,realpath:!0,retries:0,fs:ke,onCompromised:u=>{throw u},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),be(e,t,(u,n)=>{if(u)return r(u);let i=$t.operation(t.retries);i.attempt(()=>{Oe(n,t,(a,c,d)=>{if(i.retry(a))return;if(a)return r(i.mainError());let h=U[n]={lockfilePath:te(n,t),mtime:c,mtimePrecision:d,options:t,lastUpdate:Date.now()};ye(n,t),r(null,o=>{if(h.released)return o&&o(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));ut(n,{...t,realpath:!1},o)})})})})}function ut(e,t,r){t={fs:ke,realpath:!0,...t},be(e,t,(u,n)=>{if(u)return r(u);let i=U[n];if(!i)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete U[n],it(n,t,r)})}function Gt(e,t,r){t={stale:1e4,realpath:!0,fs:ke,...t},t.stale=Math.max(t.stale||0,2e3),be(e,t,(u,n)=>{if(u)return r(u);t.fs.stat(te(n,t),(i,a)=>i?i.code==="ENOENT"?r(null,!1):r(i):r(null,!nt(a,t)))})}function Wt(){return U}qt(()=>{for(let e in U){let t=U[e].options;try{t.fs.rmdirSync(te(e,t))}catch{}}});re.exports.lock=Bt;re.exports.unlock=ut;re.exports.check=Gt;re.exports.getLocks=Wt});var ct=P((Tr,at)=>{"use strict";var zt=ge();function Yt(e){let t=["mkdir","realpath","stat","rmdir","utimes"],r={...e};return t.forEach(u=>{r[u]=(...n)=>{let i=n.pop(),a;try{a=e[`${u}Sync`](...n)}catch(c){return i(c)}i(null,a)}}),r}function Jt(e){return(...t)=>new Promise((r,u)=>{t.push((n,i)=>{n?u(n):r(i)}),e(...t)})}function Kt(e){return(...t)=>{let r,u;if(t.push((n,i)=>{r=n,u=i}),e(...t),r)throw r;return u}}function Qt(e){if(e={...e},e.fs=Yt(e.fs||zt),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}at.exports={toPromise:Jt,toSync:Kt,toSyncOptions:Qt}});var st=P((Er,B)=>{"use strict";var V=ot(),{toPromise:pe,toSync:de,toSyncOptions:Fe}=ct();async function ft(e,t){let r=await pe(V.lock)(e,t);return pe(r)}function Ht(e,t){let r=de(V.lock)(e,Fe(t));return de(r)}function Vt(e,t){return pe(V.unlock)(e,t)}function Xt(e,t){return de(V.unlock)(e,Fe(t))}function Zt(e,t){return pe(V.check)(e,t)}function er(e,t){return de(V.check)(e,Fe(t))}B.exports=ft;B.exports.lock=ft;B.exports.unlock=Vt;B.exports.lockSync=Ht;B.exports.unlockSync=Xt;B.exports.check=Zt;B.exports.checkSync=er});var kr=Ot(st(),1);import*as w from"fs";import*as j from"path";import{randomUUID as lt}from"crypto";import*as St from"os";var Ie="b64:";function tr(e){let t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),r=globalThis.Buffer;if(r)return r.from(t,"base64").toString("utf8");if(typeof atob=="function"){let u=atob(t),n=new Uint8Array(u.length);for(let i=0;i<u.length;i+=1)n[i]=u.charCodeAt(i);return new TextDecoder().decode(n)}throw new Error("No base64 decoder available in this runtime")}function rr(e){if(!e.startsWith(Ie))throw new Error(`Invalid ref format (expected ${Ie}<base64url(json)>): ${e}`);let t;try{t=JSON.parse(tr(e.slice(Ie.length)))}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${e}`)}if(!t||typeof t!="object")throw new Error(`Invalid ref format (expected object payload): ${e}`);let r=t;if(typeof r.kind!="string"||typeof r.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${e}`);return{kind:r.kind,value:r.value}}function yt(e,t){if(process.platform!=="win32"){w.renameSync(e,t);return}let r=[10,20,40,80,160];for(let u=0;u<=r.length;u++)try{w.renameSync(e,t);return}catch(n){let i=n.code;if((i==="EPERM"||i==="EBUSY")&&u<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[u]);continue}throw n}}function nr(e){function t(n){return j.join(e,...n.split("/"))}function r(n){return j.relative(e,n).replace(/\\/g,"/")}function u(n,i){if(w.existsSync(n))for(let a of w.readdirSync(n,{withFileTypes:!0})){let c=j.join(n,a.name);if(a.isDirectory()){u(c,i);continue}a.isFile()&&i.push(r(c))}}return{read(n){let i=t(n);if(!w.existsSync(i))return null;try{return w.readFileSync(i,"utf-8")}catch{return null}},write(n,i){let a=t(n),c=`${a}.${process.pid}.${lt()}.tmp`;w.mkdirSync(j.dirname(a),{recursive:!0}),w.writeFileSync(c,i,"utf-8"),yt(c,a)},exists(n){return w.existsSync(t(n))},remove(n){let i=t(n);try{w.existsSync(i)&&w.unlinkSync(i)}catch{}},readBytes(n){let i=t(n);if(!w.existsSync(i))return null;try{return new Uint8Array(w.readFileSync(i))}catch{return null}},writeBytes(n,i){let a=t(n),c=`${a}.${process.pid}.${lt()}.tmp`;w.mkdirSync(j.dirname(a),{recursive:!0}),w.writeFileSync(c,Buffer.from(i)),yt(c,a)},listKeys(n){let i=[];u(e,i);let a=i.sort();return n?a.filter(c=>c.startsWith(n)):a},stat(n){let i=t(n);if(!w.existsSync(i))return null;try{let a=w.statSync(i);return{key:n,size:Number(a.size||0),updatedAt:new Date(a.mtimeMs).toISOString()}}catch{return null}},keyRef(n){return{kind:"fs-path",value:t(n)}}}}function pt(){return new Date().toISOString()}function dt(e){return new TextEncoder().encode(e).byteLength}function ir(e){return e?{key:e.key,size:e.size,updatedAt:e.updatedAt,contentType:e.contentType}:null}function ur(e){function t(r){let u=e.stat?ir(e.stat(r)):null;if(u)return u;if(!e.exists(r))return null;let n=e.read(r);return n===null?{key:r}:{key:r,size:dt(n)}}return{exists(r){return e.exists(r)},putText(r,u,n="text/plain; charset=utf-8"){e.write(r,u);let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??pt(),i.size=i.size??dt(u),i},putBytes(r,u,n="application/octet-stream"){if(e.writeBytes)e.writeBytes(r,u);else{let a=JSON.stringify({__kind:"bytes-array",data:[...u]});e.write(r,a)}let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??pt(),i.size=i.size??u.byteLength,i},getText(r){let u=e.read(r);if(u===null){if(!e.readBytes)return null;let n=e.readBytes(r);return n===null?null:Buffer.from(n).toString("utf-8")}try{let n=JSON.parse(u);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new TextDecoder("utf-8").decode(new Uint8Array(n.data))}catch{}return u},getBytes(r){if(e.readBytes){let n=e.readBytes(r);if(n!==null)return n}let u=e.read(r);if(u===null)return null;try{let n=JSON.parse(u);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new Uint8Array(n.data)}catch{}return new TextEncoder().encode(u)},head:t,list(r=""){return e.listKeys(r).map(u=>t(u)??{key:u}).sort((u,n)=>u.key.localeCompare(n.key))},remove(r){e.remove(r)}}}function or(e){function t(n){return{status:"success",data:n}}function r(n){return{status:"fail",error:n}}function u(n){return{status:"error",error:n instanceof Error?n.message:String(n)}}return{list(n){try{let i=n.params?.prefix??"";return t({artifacts:e.list(i)})}catch(i){return u(i)}},head(n){try{let i=n.params?.key;return i?t({artifact:e.head(i)}):r("head requires params.key")}catch(i){return u(i)}},put(n){try{let i=n.params?.key,a=n.params?.contentType;if(!i)return r("put requires params.key");let c=n.body;if(typeof c=="string")return t({artifact:e.putText(i,c,a)});if(c&&typeof c=="object"&&typeof c.text=="string")return t({artifact:e.putText(i,c.text,a)});if(c&&typeof c=="object"&&Array.isArray(c.bytes)){let d=c.bytes,h=new Uint8Array(d.map(o=>Math.max(0,Math.min(255,Number(o)||0))));return t({artifact:e.putBytes(i,h,a)})}return r("put requires body as string, {text}, or {bytes:number[]}")}catch(i){return u(i)}},get(n){try{let i=n.params?.key,a=n.params?.as??"base64";if(!i)return r("get requires params.key");let c=e.head(i);if(!c)return r(`artifact "${i}" not found`);if(a==="text"){let h=e.getText(i);return h===null?r(`artifact "${i}" not found`):t({key:i,contentType:c.contentType,size:c.size,text:h})}let d=e.getBytes(i);return d===null?r(`artifact "${i}" not found`):t({key:i,contentType:c.contentType,size:c.size,bytes:[...d]})}catch(i){return u(i)}},del(n){try{let i=n.params?.key;return i?(e.remove(i),t({ok:!0})):r("del requires params.key")}catch(i){return u(i)}}}}function ht(...e){return j.resolve(...e)}j.join(St.tmpdir(),".board-live-cards-git-bash-cache.json");function ne(e,t,r){let u=e.indexOf(t),n=u!==-1?e[u+1]:void 0;if(!n)throw new Error(`Missing ${t}
4
- Usage: ${r}`);return n}function X(e,t){let r=e.indexOf(t);return r!==-1?e[r+1]:void 0}async function ar(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return new Uint8Array(Buffer.concat(e))}var mt=["artifacts-store \u2014 generic artifact CRUD on a blob-backed store",""," artifacts-store put --store-ref <ref> --key <key> [--file <path> | --text <text>] [--content-type <mime>]"," artifacts-store get --store-ref <ref> --key <key> [--out <path>] [--as text|bytes]"," artifacts-store head --store-ref <ref> --key <key>"," artifacts-store list --store-ref <ref> [--prefix <prefix>]"," artifacts-store del --store-ref <ref> --key <key>"].join(`
5
- `);async function cr(e){let t=e[0],r=e.slice(1);if(!t||t==="help"||t==="--help"||t==="-h"){console.error(mt);return}let u=ne(r,"--store-ref",`artifacts-store ${t} --store-ref <b64-ref>`),n=rr(u).value,i=or(ur(nr(n)));if(t==="put"){let a=ne(r,"--key","artifacts-store put --store-ref <ref> --key <key>"),c=X(r,"--content-type"),d=X(r,"--file"),h=X(r,"--text"),o;if(d)o={bytes:[...new Uint8Array(w.readFileSync(d))]};else if(typeof h=="string")o={text:h};else if(!process.stdin.isTTY)o={bytes:[...await ar()]};else throw new Error("put requires --file, --text, or stdin bytes");let s=i.put({params:{key:a,...c?{contentType:c}:{}},body:o});if(s.status!=="success")throw new Error(s.error||"put failed");process.stdout.write(JSON.stringify(s.data,null,2)+`
6
- `);return}if(t==="get"){let a=ne(r,"--key","artifacts-store get --store-ref <ref> --key <key>"),c=(X(r,"--as")||"bytes").toLowerCase(),d=X(r,"--out"),h=i.get({params:{key:a,as:c}});if(h.status!=="success")throw new Error(h.error||"get failed");if(c==="text"){let s=h.data.text??"";d?w.writeFileSync(d,s,"utf-8"):process.stdout.write(s);return}let o=new Uint8Array(h.data.bytes??[]);d?w.writeFileSync(d,Buffer.from(o)):process.stdout.write(JSON.stringify({...h.data,bytes:void 0,byteLength:o.byteLength},null,2)+`
7
- `);return}if(t==="head"){let a=ne(r,"--key","artifacts-store head --store-ref <ref> --key <key>"),c=i.head({params:{key:a}});if(c.status!=="success")throw new Error(c.error||"head failed");process.stdout.write(JSON.stringify(c.data,null,2)+`
8
- `);return}if(t==="list"){let a=X(r,"--prefix")||"",c=i.list({params:a?{prefix:a}:{}});if(c.status!=="success")throw new Error(c.error||"list failed");process.stdout.write(JSON.stringify(c.data,null,2)+`
9
- `);return}if(t==="del"||t==="delete"||t==="rm"){let a=ne(r,"--key","artifacts-store del --store-ref <ref> --key <key>"),c=i.del({params:{key:a}});if(c.status!=="success")throw new Error(c.error||"del failed");process.stdout.write(JSON.stringify(c.data,null,2)+`
2
+ var Et=Object.create;var Ce=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var kt=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var $=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var P=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ft=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of kt(t))!It.call(e,n)&&n!==r&&Ce(e,n,{get:()=>t[n],enumerable:!(u=Ot(t,n))||u.enumerable});return e};var Lt=(e,t,r)=>(r=e!=null?Et(bt(e)):{},Ft(t||!e||!e.__esModule?Ce(r,"default",{value:e,enumerable:!0}):r,e));var je=P((pr,Ue)=>{var q=$("constants"),Nt=process.cwd,ae=null,Dt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ae||(ae=Nt.call(process)),ae};try{process.cwd()}catch{}typeof process.chdir=="function"&&(ge=process.chdir,process.chdir=function(e){ae=null,ge.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ge));var ge;Ue.exports=Rt;function Rt(e){q.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=u(e.chmod),e.fchmod=u(e.fchmod),e.lchmod=u(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=c(e.stat),e.fstat=c(e.fstat),e.lstat=c(e.lstat),e.statSync=d(e.statSync),e.fstatSync=d(e.fstatSync),e.lstatSync=d(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(o,s,l){l&&process.nextTick(l)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(o,s,l,f){f&&process.nextTick(f)},e.lchownSync=function(){}),Dt==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(o){function s(l,f,p){var _=Date.now(),w=0;o(l,f,function E(M){if(M&&(M.code==="EACCES"||M.code==="EPERM"||M.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){e.stat(f,function(A,Z){A&&A.code==="ENOENT"?o(l,f,E):p(M)})},w),w<100&&(w+=10);return}p&&p(M)})}return Object.setPrototypeOf&&Object.setPrototypeOf(s,o),s})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(o){function s(l,f,p,_,w,E){var M;if(E&&typeof E=="function"){var A=0;M=function(Z,Me,Pe){if(Z&&Z.code==="EAGAIN"&&A<10)return A++,o.call(e,l,f,p,_,w,M);E.apply(this,arguments)}}return o.call(e,l,f,p,_,w,M)}return Object.setPrototypeOf&&Object.setPrototypeOf(s,o),s})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(o){return function(s,l,f,p,_){for(var w=0;;)try{return o.call(e,s,l,f,p,_)}catch(E){if(E.code==="EAGAIN"&&w<10){w++;continue}throw E}}})(e.readSync);function t(o){o.lchmod=function(s,l,f){o.open(s,q.O_WRONLY|q.O_SYMLINK,l,function(p,_){if(p){f&&f(p);return}o.fchmod(_,l,function(w){o.close(_,function(E){f&&f(w||E)})})})},o.lchmodSync=function(s,l){var f=o.openSync(s,q.O_WRONLY|q.O_SYMLINK,l),p=!0,_;try{_=o.fchmodSync(f,l),p=!1}finally{if(p)try{o.closeSync(f)}catch{}else o.closeSync(f)}return _}}function r(o){q.hasOwnProperty("O_SYMLINK")&&o.futimes?(o.lutimes=function(s,l,f,p){o.open(s,q.O_SYMLINK,function(_,w){if(_){p&&p(_);return}o.futimes(w,l,f,function(E){o.close(w,function(M){p&&p(E||M)})})})},o.lutimesSync=function(s,l,f){var p=o.openSync(s,q.O_SYMLINK),_,w=!0;try{_=o.futimesSync(p,l,f),w=!1}finally{if(w)try{o.closeSync(p)}catch{}else o.closeSync(p)}return _}):o.futimes&&(o.lutimes=function(s,l,f,p){p&&process.nextTick(p)},o.lutimesSync=function(){})}function u(o){return o&&function(s,l,f){return o.call(e,s,l,function(p){h(p)&&(p=null),f&&f.apply(this,arguments)})}}function n(o){return o&&function(s,l){try{return o.call(e,s,l)}catch(f){if(!h(f))throw f}}}function i(o){return o&&function(s,l,f,p){return o.call(e,s,l,f,function(_){h(_)&&(_=null),p&&p.apply(this,arguments)})}}function a(o){return o&&function(s,l,f){try{return o.call(e,s,l,f)}catch(p){if(!h(p))throw p}}}function c(o){return o&&function(s,l,f){typeof l=="function"&&(f=l,l=null);function p(_,w){w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),f&&f.apply(this,arguments)}return l?o.call(e,s,l,p):o.call(e,s,p)}}function d(o){return o&&function(s,l){var f=l?o.call(e,s,l):o.call(e,s);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function h(o){if(!o||o.code==="ENOSYS")return!0;var s=!process.getuid||process.getuid()!==0;return!!(s&&(o.code==="EINVAL"||o.code==="EPERM"))}}});var Ge=P((dr,qe)=>{var $e=$("stream").Stream;qe.exports=At;function At(e){return{ReadStream:t,WriteStream:r};function t(u,n){if(!(this instanceof t))return new t(u,n);$e.call(this);var i=this;this.path=u,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var a=Object.keys(n),c=0,d=a.length;c<d;c++){var h=a[c];this[h]=n[h]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}e.open(this.path,this.flags,this.mode,function(o,s){if(o){i.emit("error",o),i.readable=!1;return}i.fd=s,i.emit("open",s),i._read()})}function r(u,n){if(!(this instanceof r))return new r(u,n);$e.call(this),this.path=u,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var i=Object.keys(n),a=0,c=i.length;a<c;a++){var d=i[a];this[d]=n[d]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var We=P((hr,Be)=>{"use strict";Be.exports=Pt;var Mt=Object.getPrototypeOf||function(e){return e.__proto__};function Pt(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Mt(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var Ee=P((mr,Te)=>{var k=$("fs"),Ct=je(),Ut=Ge(),jt=We(),ce=$("util"),R,se;typeof Symbol=="function"&&typeof Symbol.for=="function"?(R=Symbol.for("graceful-fs.queue"),se=Symbol.for("graceful-fs.previous")):(R="___graceful-fs.queue",se="___graceful-fs.previous");function $t(){}function Je(e,t){Object.defineProperty(e,R,{get:function(){return t}})}var B=$t;ce.debuglog?B=ce.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(B=function(){var e=ce.format.apply(ce,arguments);e="GFS4: "+e.split(/\n/).join(`
3
+ GFS4: `),console.error(e)});k[R]||(ze=global[R]||[],Je(k,ze),k.close=(function(e){function t(r,u){return e.call(k,r,function(n){n||Ye(),typeof u=="function"&&u.apply(this,arguments)})}return Object.defineProperty(t,se,{value:e}),t})(k.close),k.closeSync=(function(e){function t(r){e.apply(k,arguments),Ye()}return Object.defineProperty(t,se,{value:e}),t})(k.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){B(k[R]),$("assert").equal(k[R].length,0)}));var ze;global[R]||Je(global,k[R]);Te.exports=_e(jt(k));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!k.__patched&&(Te.exports=_e(k),k.__patched=!0);function _e(e){Ct(e),e.gracefulify=_e,e.createReadStream=Me,e.createWriteStream=Pe;var t=e.readFile;e.readFile=r;function r(y,S,m){return typeof S=="function"&&(m=S,S=null),L(y,S,m);function L(N,I,O,b){return t(N,I,function(g){g&&(g.code==="EMFILE"||g.code==="ENFILE")?J([L,[N,I,O],g,b||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var u=e.writeFile;e.writeFile=n;function n(y,S,m,L){return typeof m=="function"&&(L=m,m=null),N(y,S,m,L);function N(I,O,b,g,D){return u(I,O,b,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[I,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}var i=e.appendFile;i&&(e.appendFile=a);function a(y,S,m,L){return typeof m=="function"&&(L=m,m=null),N(y,S,m,L);function N(I,O,b,g,D){return i(I,O,b,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[I,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}var c=e.copyFile;c&&(e.copyFile=d);function d(y,S,m,L){return typeof m=="function"&&(L=m,m=0),N(y,S,m,L);function N(I,O,b,g,D){return c(I,O,b,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[I,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}var h=e.readdir;e.readdir=s;var o=/^v[0-5]\./;function s(y,S,m){typeof S=="function"&&(m=S,S=null);var L=o.test(process.version)?function(O,b,g,D){return h(O,N(O,b,g,D))}:function(O,b,g,D){return h(O,b,N(O,b,g,D))};return L(y,S,m);function N(I,O,b,g){return function(D,x){D&&(D.code==="EMFILE"||D.code==="ENFILE")?J([L,[I,O,b],D,g||Date.now(),Date.now()]):(x&&x.sort&&x.sort(),typeof b=="function"&&b.call(this,D,x))}}}if(process.version.substr(0,4)==="v0.8"){var l=Ut(e);E=l.ReadStream,A=l.WriteStream}var f=e.ReadStream;f&&(E.prototype=Object.create(f.prototype),E.prototype.open=M);var p=e.WriteStream;p&&(A.prototype=Object.create(p.prototype),A.prototype.open=Z),Object.defineProperty(e,"ReadStream",{get:function(){return E},set:function(y){E=y},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return A},set:function(y){A=y},enumerable:!0,configurable:!0});var _=E;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(y){_=y},enumerable:!0,configurable:!0});var w=A;Object.defineProperty(e,"FileWriteStream",{get:function(){return w},set:function(y){w=y},enumerable:!0,configurable:!0});function E(y,S){return this instanceof E?(f.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function M(){var y=this;we(y.path,y.flags,y.mode,function(S,m){S?(y.autoClose&&y.destroy(),y.emit("error",S)):(y.fd=m,y.emit("open",m),y.read())})}function A(y,S){return this instanceof A?(p.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function Z(){var y=this;we(y.path,y.flags,y.mode,function(S,m){S?(y.destroy(),y.emit("error",S)):(y.fd=m,y.emit("open",m))})}function Me(y,S){return new e.ReadStream(y,S)}function Pe(y,S){return new e.WriteStream(y,S)}var Tt=e.open;e.open=we;function we(y,S,m,L){return typeof m=="function"&&(L=m,m=null),N(y,S,m,L);function N(I,O,b,g,D){return Tt(I,O,b,function(x,lr){x&&(x.code==="EMFILE"||x.code==="ENFILE")?J([N,[I,O,b,g],x,D||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}return e}function J(e){B("ENQUEUE",e[0].name,e[1]),k[R].push(e),xe()}var fe;function Ye(){for(var e=Date.now(),t=0;t<k[R].length;++t)k[R][t].length>2&&(k[R][t][3]=e,k[R][t][4]=e);xe()}function xe(){if(clearTimeout(fe),fe=void 0,k[R].length!==0){var e=k[R].shift(),t=e[0],r=e[1],u=e[2],n=e[3],i=e[4];if(n===void 0)B("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){B("TIMEOUT",t.name,r);var a=r.pop();typeof a=="function"&&a.call(null,u)}else{var c=Date.now()-i,d=Math.max(i-n,1),h=Math.min(d*1.2,100);c>=h?(B("RETRY",t.name,r),t.apply(null,r.concat([n]))):k[R].push(e)}fe===void 0&&(fe=setTimeout(xe,0))}}});var Qe=P((Sr,Ke)=>{function C(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Ke.exports=C;C.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};C.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};C.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var u=this,n=setTimeout(function(){u._attempts++,u._operationTimeoutCb&&(u._timeout=setTimeout(function(){u._operationTimeoutCb(u._attempts)},u._operationTimeout),u._options.unref&&u._timeout.unref()),u._fn(u._attempts)},r);return this._options.unref&&n.unref(),!0};C.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};C.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};C.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};C.prototype.start=C.prototype.try;C.prototype.errors=function(){return this._errors};C.prototype.attempts=function(){return this._attempts};C.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,r=0,u=0;u<this._errors.length;u++){var n=this._errors[u],i=n.message,a=(e[i]||0)+1;e[i]=a,a>=r&&(t=n,r=a)}return t}});var He=P(W=>{var qt=Qe();W.operation=function(e){var t=W.timeouts(e);return new qt(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};W.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var u=[],n=0;n<t.retries;n++)u.push(this.createTimeout(n,t));return e&&e.forever&&!u.length&&u.push(this.createTimeout(n,t)),u.sort(function(i,a){return i-a}),u};W.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,u=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return u=Math.min(u,t.maxTimeout),u};W.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var u in e)typeof e[u]=="function"&&r.push(u)}for(var n=0;n<r.length;n++){var i=r[n],a=e[i];e[i]=function(d){var h=W.operation(t),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push(function(l){h.retry(l)||(l&&(arguments[0]=h.mainError()),s.apply(this,arguments))}),h.attempt(function(){d.apply(e,o)})}.bind(e,a),e[i].options=t}}});var Xe=P((wr,Ve)=>{Ve.exports=He()});var Ze=P((gr,le)=>{le.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&le.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&le.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var it=P((_r,H)=>{var T=global.process,z=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};z(T)?(et=$("assert"),K=Ze(),tt=/^win/i.test(T.platform),ee=$("events"),typeof ee!="function"&&(ee=ee.EventEmitter),T.__signal_exit_emitter__?F=T.__signal_exit_emitter__:(F=T.__signal_exit_emitter__=new ee,F.count=0,F.emitted={}),F.infinite||(F.setMaxListeners(1/0),F.infinite=!0),H.exports=function(e,t){if(!z(global.process))return function(){};et.equal(typeof e,"function","a callback must be provided for exit handler"),Q===!1&&Oe();var r="exit";t&&t.alwaysLast&&(r="afterexit");var u=function(){F.removeListener(r,e),F.listeners("exit").length===0&&F.listeners("afterexit").length===0&&ye()};return F.on(r,e),u},ye=function(){!Q||!z(global.process)||(Q=!1,K.forEach(function(t){try{T.removeListener(t,pe[t])}catch{}}),T.emit=de,T.reallyExit=ke,F.count-=1)},H.exports.unload=ye,Y=function(t,r,u){F.emitted[t]||(F.emitted[t]=!0,F.emit(t,r,u))},pe={},K.forEach(function(e){pe[e]=function(){if(z(global.process)){var r=T.listeners(e);r.length===F.count&&(ye(),Y("exit",null,e),Y("afterexit",null,e),tt&&e==="SIGHUP"&&(e="SIGINT"),T.kill(T.pid,e))}}}),H.exports.signals=function(){return K},Q=!1,Oe=function(){Q||!z(global.process)||(Q=!0,F.count+=1,K=K.filter(function(t){try{return T.on(t,pe[t]),!0}catch{return!1}}),T.emit=nt,T.reallyExit=rt)},H.exports.load=Oe,ke=T.reallyExit,rt=function(t){z(global.process)&&(T.exitCode=t||0,Y("exit",T.exitCode,null),Y("afterexit",T.exitCode,null),ke.call(T,T.exitCode))},de=T.emit,nt=function(t,r){if(t==="exit"&&z(global.process)){r!==void 0&&(T.exitCode=r);var u=de.apply(this,arguments);return Y("exit",T.exitCode,null),Y("afterexit",T.exitCode,null),u}else return de.apply(this,arguments)}):H.exports=function(){return function(){}};var et,K,tt,ee,F,ye,Y,pe,Q,Oe,ke,rt,de,nt});var ot=P((xr,be)=>{"use strict";var ut=Symbol();function Gt(e,t,r){let u=t[ut];if(u)return t.stat(e,(i,a)=>{if(i)return r(i);r(null,a.mtime,u)});let n=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,n,n,i=>{if(i)return r(i);t.stat(e,(a,c)=>{if(a)return r(a);let d=c.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,ut,{value:d}),r(null,c.mtime,d)})})}function Bt(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}be.exports.probe=Gt;be.exports.getMtime=Bt});var lt=P((Tr,re)=>{"use strict";var Wt=$("path"),Le=Ee(),zt=Xe(),Yt=it(),at=ot(),j={};function te(e,t){return t.lockfilePath||`${e}.lock`}function Ne(e,t,r){if(!t.realpath)return r(null,Wt.resolve(e));t.fs.realpath(e,r)}function Fe(e,t,r){let u=te(e,t);t.fs.mkdir(u,n=>{if(!n)return at.probe(u,t.fs,(i,a,c)=>{if(i)return t.fs.rmdir(u,()=>{}),r(i);r(null,a,c)});if(n.code!=="EEXIST")return r(n);if(t.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(u,(i,a)=>{if(i)return i.code==="ENOENT"?Fe(e,{...t,stale:0},r):r(i);if(!ct(a,t))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));ft(e,t,c=>{if(c)return r(c);Fe(e,{...t,stale:0},r)})})})}function ct(e,t){return e.mtime.getTime()<Date.now()-t.stale}function ft(e,t,r){t.fs.rmdir(te(e,t),u=>{if(u&&u.code!=="ENOENT")return r(u);r()})}function he(e,t){let r=j[e];r.updateTimeout||(r.updateDelay=r.updateDelay||t.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,t.fs.stat(r.lockfilePath,(u,n)=>{let i=r.lastUpdate+t.stale<Date.now();if(u)return u.code==="ENOENT"||i?Ie(e,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,he(e,t));if(!(r.mtime.getTime()===n.mtime.getTime()))return Ie(e,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let c=at.getMtime(r.mtimePrecision);t.fs.utimes(r.lockfilePath,c,c,d=>{let h=r.lastUpdate+t.stale<Date.now();if(!r.released){if(d)return d.code==="ENOENT"||h?Ie(e,r,Object.assign(d,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,he(e,t));r.mtime=c,r.lastUpdate=Date.now(),r.updateDelay=null,he(e,t)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Ie(e,t,r){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),j[e]===t&&delete j[e],t.options.onCompromised(r)}function Jt(e,t,r){t={stale:1e4,update:null,realpath:!0,retries:0,fs:Le,onCompromised:u=>{throw u},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),Ne(e,t,(u,n)=>{if(u)return r(u);let i=zt.operation(t.retries);i.attempt(()=>{Fe(n,t,(a,c,d)=>{if(i.retry(a))return;if(a)return r(i.mainError());let h=j[n]={lockfilePath:te(n,t),mtime:c,mtimePrecision:d,options:t,lastUpdate:Date.now()};he(n,t),r(null,o=>{if(h.released)return o&&o(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));st(n,{...t,realpath:!1},o)})})})})}function st(e,t,r){t={fs:Le,realpath:!0,...t},Ne(e,t,(u,n)=>{if(u)return r(u);let i=j[n];if(!i)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete j[n],ft(n,t,r)})}function Kt(e,t,r){t={stale:1e4,realpath:!0,fs:Le,...t},t.stale=Math.max(t.stale||0,2e3),Ne(e,t,(u,n)=>{if(u)return r(u);t.fs.stat(te(n,t),(i,a)=>i?i.code==="ENOENT"?r(null,!1):r(i):r(null,!ct(a,t)))})}function Qt(){return j}Yt(()=>{for(let e in j){let t=j[e].options;try{t.fs.rmdirSync(te(e,t))}catch{}}});re.exports.lock=Jt;re.exports.unlock=st;re.exports.check=Kt;re.exports.getLocks=Qt});var pt=P((Er,yt)=>{"use strict";var Ht=Ee();function Vt(e){let t=["mkdir","realpath","stat","rmdir","utimes"],r={...e};return t.forEach(u=>{r[u]=(...n)=>{let i=n.pop(),a;try{a=e[`${u}Sync`](...n)}catch(c){return i(c)}i(null,a)}}),r}function Xt(e){return(...t)=>new Promise((r,u)=>{t.push((n,i)=>{n?u(n):r(i)}),e(...t)})}function Zt(e){return(...t)=>{let r,u;if(t.push((n,i)=>{r=n,u=i}),e(...t),r)throw r;return u}}function er(e){if(e={...e},e.fs=Vt(e.fs||Ht),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}yt.exports={toPromise:Xt,toSync:Zt,toSyncOptions:er}});var ht=P((Or,G)=>{"use strict";var V=lt(),{toPromise:me,toSync:Se,toSyncOptions:De}=pt();async function dt(e,t){let r=await me(V.lock)(e,t);return me(r)}function tr(e,t){let r=Se(V.lock)(e,De(t));return Se(r)}function rr(e,t){return me(V.unlock)(e,t)}function nr(e,t){return Se(V.unlock)(e,De(t))}function ir(e,t){return me(V.check)(e,t)}function ur(e,t){return Se(V.check)(e,De(t))}G.exports=dt;G.exports.lock=dt;G.exports.unlock=rr;G.exports.lockSync=tr;G.exports.unlockSync=nr;G.exports.check=ir;G.exports.checkSync=ur});var br=Lt(ht(),1);import*as v from"fs";import*as U from"path";import{randomUUID as mt}from"crypto";import*as xt from"os";var Re="b64:";function or(e){let t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),r=globalThis.Buffer;if(r)return r.from(t,"base64").toString("utf8");if(typeof atob=="function"){let u=atob(t),n=new Uint8Array(u.length);for(let i=0;i<u.length;i+=1)n[i]=u.charCodeAt(i);return new TextDecoder().decode(n)}throw new Error("No base64 decoder available in this runtime")}function ne(e){if(!e.startsWith(Re))throw new Error(`Invalid ref format (expected ${Re}<base64url(json)>): ${e}`);let t;try{t=JSON.parse(or(e.slice(Re.length)))}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${e}`)}if(!t||typeof t!="object")throw new Error(`Invalid ref format (expected object payload): ${e}`);let r=t;if(typeof r.kind!="string"||typeof r.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${e}`);return{kind:r.kind,value:r.value}}function St(e,t){if(process.platform!=="win32"){v.renameSync(e,t);return}let r=[10,20,40,80,160];for(let u=0;u<=r.length;u++)try{v.renameSync(e,t);return}catch(n){let i=n.code;if((i==="EPERM"||i==="EBUSY")&&u<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[u]);continue}throw n}}function ie(e){function t(n){return U.join(e,...n.split("/"))}function r(n){return U.relative(e,n).replace(/\\/g,"/")}function u(n,i){if(v.existsSync(n))for(let a of v.readdirSync(n,{withFileTypes:!0})){let c=U.join(n,a.name);if(a.isDirectory()){u(c,i);continue}a.isFile()&&i.push(r(c))}}return{read(n){let i=t(n);if(!v.existsSync(i))return null;try{return v.readFileSync(i,"utf-8")}catch{return null}},write(n,i){let a=t(n),c=`${a}.${process.pid}.${mt()}.tmp`;v.mkdirSync(U.dirname(a),{recursive:!0}),v.writeFileSync(c,i,"utf-8"),St(c,a)},exists(n){return v.existsSync(t(n))},remove(n){let i=t(n);try{v.existsSync(i)&&v.unlinkSync(i)}catch{}},readBytes(n){let i=t(n);if(!v.existsSync(i))return null;try{return new Uint8Array(v.readFileSync(i))}catch{return null}},writeBytes(n,i){let a=t(n),c=`${a}.${process.pid}.${mt()}.tmp`;v.mkdirSync(U.dirname(a),{recursive:!0}),v.writeFileSync(c,Buffer.from(i)),St(c,a)},listKeys(n){let i=[];u(e,i);let a=i.sort();return n?a.filter(c=>c.startsWith(n)):a},stat(n){let i=t(n);if(!v.existsSync(i))return null;try{let a=v.statSync(i);return{key:n,size:Number(a.size||0),updatedAt:new Date(a.mtimeMs).toISOString()}}catch{return null}},keyRef(n){return{kind:"fs-path",value:t(n)}}}}function vt(){return new Date().toISOString()}function wt(e){return new TextEncoder().encode(e).byteLength}function ar(e){return e?{key:e.key,size:e.size,updatedAt:e.updatedAt,contentType:e.contentType}:null}function ue(e){function t(r){let u=e.stat?ar(e.stat(r)):null;if(u)return u;if(!e.exists(r))return null;let n=e.read(r);return n===null?{key:r}:{key:r,size:wt(n)}}return{exists(r){return e.exists(r)},putText(r,u,n="text/plain; charset=utf-8"){e.write(r,u);let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??vt(),i.size=i.size??wt(u),i},putBytes(r,u,n="application/octet-stream"){if(e.writeBytes)e.writeBytes(r,u);else{let a=JSON.stringify({__kind:"bytes-array",data:[...u]});e.write(r,a)}let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??vt(),i.size=i.size??u.byteLength,i},getText(r){let u=e.read(r);if(u===null){if(!e.readBytes)return null;let n=e.readBytes(r);return n===null?null:Buffer.from(n).toString("utf-8")}try{let n=JSON.parse(u);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new TextDecoder("utf-8").decode(new Uint8Array(n.data))}catch{}return u},getBytes(r){if(e.readBytes){let n=e.readBytes(r);if(n!==null)return n}let u=e.read(r);if(u===null)return null;try{let n=JSON.parse(u);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new Uint8Array(n.data)}catch{}return new TextEncoder().encode(u)},head:t,list(r=""){return e.listKeys(r).map(u=>t(u)??{key:u}).sort((u,n)=>u.key.localeCompare(n.key))},remove(r){e.remove(r)}}}function oe(e){function t(n){return{status:"success",data:n}}function r(n){return{status:"fail",error:n}}function u(n){return{status:"error",error:n instanceof Error?n.message:String(n)}}return{list(n){try{let i=n.params?.prefix??"";return t({artifacts:e.list(i)})}catch(i){return u(i)}},head(n){try{let i=n.params?.key;return i?t({artifact:e.head(i)}):r("head requires params.key")}catch(i){return u(i)}},put(n){try{let i=n.params?.key,a=n.params?.contentType;if(!i)return r("put requires params.key");let c=n.body;if(typeof c=="string")return t({artifact:e.putText(i,c,a)});if(c&&typeof c=="object"&&typeof c.text=="string")return t({artifact:e.putText(i,c.text,a)});if(c&&typeof c=="object"&&Array.isArray(c.bytes)){let d=c.bytes,h=new Uint8Array(d.map(o=>Math.max(0,Math.min(255,Number(o)||0))));return t({artifact:e.putBytes(i,h,a)})}return r("put requires body as string, {text}, or {bytes:number[]}")}catch(i){return u(i)}},get(n){try{let i=n.params?.key,a=n.params?.as??"base64";if(!i)return r("get requires params.key");let c=e.head(i);if(!c)return r(`artifact "${i}" not found`);if(a==="text"){let h=e.getText(i);return h===null?r(`artifact "${i}" not found`):t({key:i,contentType:c.contentType,size:c.size,text:h})}let d=e.getBytes(i);return d===null?r(`artifact "${i}" not found`):t({key:i,contentType:c.contentType,size:c.size,bytes:[...d]})}catch(i){return u(i)}},del(n){try{let i=n.params?.key;return i?(e.remove(i),t({ok:!0})):r("del requires params.key")}catch(i){return u(i)}}}}function gt(...e){return U.resolve(...e)}U.join(xt.tmpdir(),".board-live-cards-git-bash-cache.json");function Ae(e,t,r){let u=e.indexOf(t),n=u!==-1?e[u+1]:void 0;if(!n)throw new Error(`Missing ${t}
4
+ Usage: ${r}`);return n}function X(e,t){let r=e.indexOf(t);return r!==-1?e[r+1]:void 0}function ve(e,t){return{storeRef:Ae(e,"--store-ref",t),key:Ae(e,"--key",t)}}async function cr(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return new Uint8Array(Buffer.concat(e))}var _t=["artifacts-store \u2014 generic artifact CRUD on a blob-backed store",""," artifacts-store put --store-ref <ref> --key <key> [--file <path> | --text <text>] [--content-type <mime>]"," artifacts-store get --store-ref <ref> --key <key> [--out <path>] [--as text|bytes]"," artifacts-store head --store-ref <ref> --key <key>"," artifacts-store list --store-ref <ref> [--prefix <prefix>]"," artifacts-store del --store-ref <ref> --key <key>"].join(`
5
+ `);async function fr(e){let t=e[0],r=e.slice(1);if(!t||t==="help"||t==="--help"||t==="-h"){console.error(_t);return}if(t==="put"){let{storeRef:u,key:n}=ve(r,"artifacts-store put --store-ref <ref> --key <key>"),i=ne(u).value,a=oe(ue(ie(i))),c=X(r,"--content-type"),d=X(r,"--file"),h=X(r,"--text"),o;if(d)o={bytes:[...new Uint8Array(v.readFileSync(d))]};else if(typeof h=="string")o={text:h};else if(!process.stdin.isTTY)o={bytes:[...await cr()]};else throw new Error("put requires --file, --text, or stdin bytes");let s=a.put({params:{key:n,...c?{contentType:c}:{}},body:o});if(s.status!=="success")throw new Error(s.error||"put failed");process.stdout.write(JSON.stringify(s.data,null,2)+`
6
+ `);return}if(t==="get"){let{storeRef:u,key:n}=ve(r,"artifacts-store get --store-ref <ref> --key <key>"),i=ne(u).value,a=oe(ue(ie(i))),c=(X(r,"--as")||"bytes").toLowerCase(),d=X(r,"--out"),h=a.get({params:{key:n,as:c}});if(h.status!=="success")throw new Error(h.error||"get failed");if(c==="text"){let s=h.data.text??"";d?v.writeFileSync(d,s,"utf-8"):process.stdout.write(s);return}let o=new Uint8Array(h.data.bytes??[]);d?v.writeFileSync(d,Buffer.from(o)):process.stdout.write(JSON.stringify({...h.data,bytes:void 0,byteLength:o.byteLength},null,2)+`
7
+ `);return}if(t==="head"){let{storeRef:u,key:n}=ve(r,"artifacts-store head --store-ref <ref> --key <key>"),i=ne(u).value,a=oe(ue(ie(i))).head({params:{key:n}});if(a.status!=="success")throw new Error(a.error||"head failed");process.stdout.write(JSON.stringify(a.data,null,2)+`
8
+ `);return}if(t==="list"){let u=Ae(r,"--store-ref","artifacts-store list --store-ref <ref> [--prefix <prefix>]"),n=ne(u).value,i=oe(ue(ie(n))),a=X(r,"--prefix")||"",c=i.list({params:a?{prefix:a}:{}});if(c.status!=="success")throw new Error(c.error||"list failed");process.stdout.write(JSON.stringify(c.data,null,2)+`
9
+ `);return}if(t==="del"||t==="delete"||t==="rm"){let{storeRef:u,key:n}=ve(r,"artifacts-store del --store-ref <ref> --key <key>"),i=ne(u).value,a=oe(ue(ie(i))).del({params:{key:n}});if(a.status!=="success")throw new Error(a.error||"del failed");process.stdout.write(JSON.stringify(a.data,null,2)+`
10
10
  `);return}throw new Error(`Unknown command "${t}"
11
11
 
12
- ${mt}`)}var fr=process.argv[1]&&ht(process.argv[1])===ht(new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/,"$1"));fr&&cr(process.argv.slice(2)).catch(e=>{let t=e instanceof Error?e.message:String(e);console.error(t),process.exit(1)});export{cr as cli};
12
+ ${_t}`)}var sr=process.argv[1]&&gt(process.argv[1])===gt(new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/,"$1"));sr&&fr(process.argv.slice(2)).catch(e=>{let t=e instanceof Error?e.message:String(e);console.error(t),process.exit(1)});export{fr as cli};