yaml-flow 8.4.12 → 8.4.14

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-05-22T21:54:20.113Z",
2
+ "generatedAt": "2026-05-22T23:45:09.335Z",
3
3
  "algorithm": "sha256",
4
4
  "files": {
5
5
  "browser/board-livecards-localstorage.js": {
@@ -7,8 +7,8 @@
7
7
  "bytes": 100818
8
8
  },
9
9
  "browser/live-cards.schema.json": {
10
- "sha256": "sha256-9CUv3YSTpgq3k0Dsi8bs7bNUlGoBA1SGWMCBSZcbzys=",
11
- "bytes": 17134
10
+ "sha256": "sha256-F5nfqDzZ5L3p0lLTMxGt4YtMa2sVzdNPh8sbQ8OiXHE=",
11
+ "bytes": 17305
12
12
  }
13
13
  }
14
14
  }
@@ -554,6 +554,10 @@
554
554
  "uploaded_at": {
555
555
  "type": "string",
556
556
  "format": "date-time"
557
+ },
558
+ "chat": {
559
+ "type": "boolean",
560
+ "description": "Whether this file entry is associated with a chat interaction"
557
561
  }
558
562
  },
559
563
  "additionalProperties": false
@@ -1,6 +1,6 @@
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,o)=>{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:!(o=gt(t,n))||o.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=o(e.chmod),e.fchmod=o(e.fchmod),e.lchmod=o(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(u,s,l){l&&process.nextTick(l)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(u,s,l,f){f&&process.nextTick(f)},e.lchownSync=function(){}),bt==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(u){function s(l,f,p){var _=Date.now(),v=0;u(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"?u(l,f,E):p(R)})},v),v<100&&(v+=10);return}p&&p(R)})}return Object.setPrototypeOf&&Object.setPrototypeOf(s,u),s})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(u){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++,u.call(e,l,f,p,_,v,R);E.apply(this,arguments)}}return u.call(e,l,f,p,_,v,R)}return Object.setPrototypeOf&&Object.setPrototypeOf(s,u),s})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(u){return function(s,l,f,p,_){for(var v=0;;)try{return u.call(e,s,l,f,p,_)}catch(E){if(E.code==="EAGAIN"&&v<10){v++;continue}throw E}}})(e.readSync);function t(u){u.lchmod=function(s,l,f){u.open(s,q.O_WRONLY|q.O_SYMLINK,l,function(p,_){if(p){f&&f(p);return}u.fchmod(_,l,function(v){u.close(_,function(E){f&&f(v||E)})})})},u.lchmodSync=function(s,l){var f=u.openSync(s,q.O_WRONLY|q.O_SYMLINK,l),p=!0,_;try{_=u.fchmodSync(f,l),p=!1}finally{if(p)try{u.closeSync(f)}catch{}else u.closeSync(f)}return _}}function r(u){q.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(s,l,f,p){u.open(s,q.O_SYMLINK,function(_,v){if(_){p&&p(_);return}u.futimes(v,l,f,function(E){u.close(v,function(R){p&&p(E||R)})})})},u.lutimesSync=function(s,l,f){var p=u.openSync(s,q.O_SYMLINK),_,v=!0;try{_=u.futimesSync(p,l,f),v=!1}finally{if(v)try{u.closeSync(p)}catch{}else u.closeSync(p)}return _}):u.futimes&&(u.lutimes=function(s,l,f,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function o(u){return u&&function(s,l,f){return u.call(e,s,l,function(p){h(p)&&(p=null),f&&f.apply(this,arguments)})}}function n(u){return u&&function(s,l){try{return u.call(e,s,l)}catch(f){if(!h(f))throw f}}}function i(u){return u&&function(s,l,f,p){return u.call(e,s,l,f,function(_){h(_)&&(_=null),p&&p.apply(this,arguments)})}}function a(u){return u&&function(s,l,f){try{return u.call(e,s,l,f)}catch(p){if(!h(p))throw p}}}function c(u){return u&&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?u.call(e,s,l,p):u.call(e,s,p)}}function d(u){return u&&function(s,l){var f=l?u.call(e,s,l):u.call(e,s);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function h(u){if(!u||u.code==="ENOSYS")return!0;var s=!process.getuid||process.getuid()!==0;return!!(s&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ce=P((pr,Pe)=>{var Re=$("stream").Stream;Pe.exports=It;function It(e){return{ReadStream:t,WriteStream:r};function t(o,n){if(!(this instanceof t))return new t(o,n);Re.call(this);var i=this;this.path=o,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(u,s){if(u){i.emit("error",u),i.readable=!1;return}i.fd=s,i.emit("open",s),i._read()})}function r(o,n){if(!(this instanceof r))return new r(o,n);Re.call(this),this.path=o,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 je=P((dr,Ue)=>{"use strict";Ue.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=je(),oe=$("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;oe.debuglog?G=oe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(G=function(){var e=oe.format.apply(oe,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,o){return e.call(k,r,function(n){n||qe(),typeof o=="function"&&o.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 o=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 o(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 u=/^v[0-5]\./;function s(y,S,m){typeof S=="function"&&(m=S,S=null);var L=u.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 ue;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(ue),ue=void 0,k[M].length!==0){var e=k[M].shift(),t=e[0],r=e[1],o=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,o)}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)}ue===void 0&&(ue=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 o=this,n=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._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,o=0;o<this._errors.length;o++){var n=this._errors[o],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 o=[],n=0;n<t.retries;n++)o.push(this.createTimeout(n,t));return e&&e.forever&&!o.length&&o.push(this.createTimeout(n,t)),o.sort(function(i,a){return i-a}),o};W.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,o=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return o=Math.min(o,t.maxTimeout),o};W.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var o in e)typeof e[o]=="function"&&r.push(o)}for(var n=0;n<r.length;n++){var i=r[n],a=e[i];e[i]=function(d){var h=W.operation(t),u=Array.prototype.slice.call(arguments,1),s=u.pop();u.push(function(l){h.retry(l)||(l&&(arguments[0]=h.mainError()),s.apply(this,arguments))}),h.attempt(function(){d.apply(e,u)})}.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 o=function(){I.removeListener(r,e),I.listeners("exit").length===0&&I.listeners("afterexit").length===0&&fe()};return I.on(r,e),o},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,o){I.emitted[t]||(I.emitted[t]=!0,I.emit(t,r,o))},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 o=le.apply(this,arguments);return Y("exit",T.exitCode,null),Y("afterexit",T.exitCode,null),o}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 o=t[et];if(o)return t.stat(e,(i,a)=>{if(i)return r(i);r(null,a.mtime,o)});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 Ut(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}Te.exports.probe=Ct;Te.exports.getMtime=Ut});var ut=P((xr,re)=>{"use strict";var jt=$("path"),ke=ge(),$t=Je(),qt=Ze(),rt=tt(),j={};function te(e,t){return t.lockfilePath||`${e}.lock`}function be(e,t,r){if(!t.realpath)return r(null,jt.resolve(e));t.fs.realpath(e,r)}function Oe(e,t,r){let o=te(e,t);t.fs.mkdir(o,n=>{if(!n)return rt.probe(o,t.fs,(i,a,c)=>{if(i)return t.fs.rmdir(o,()=>{}),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(o,(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),o=>{if(o&&o.code!=="ENOENT")return r(o);r()})}function ye(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,(o,n)=>{let i=r.lastUpdate+t.stale<Date.now();if(o)return o.code==="ENOENT"||i?Ee(e,r,Object.assign(o,{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),j[e]===t&&delete j[e],t.options.onCompromised(r)}function Bt(e,t,r){t={stale:1e4,update:null,realpath:!0,retries:0,fs:ke,onCompromised:o=>{throw o},...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,(o,n)=>{if(o)return r(o);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=j[n]={lockfilePath:te(n,t),mtime:c,mtimePrecision:d,options:t,lastUpdate:Date.now()};ye(n,t),r(null,u=>{if(h.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));ot(n,{...t,realpath:!1},u)})})})})}function ot(e,t,r){t={fs:ke,realpath:!0,...t},be(e,t,(o,n)=>{if(o)return r(o);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],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,(o,n)=>{if(o)return r(o);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 j}qt(()=>{for(let e in j){let t=j[e].options;try{t.fs.rmdirSync(te(e,t))}catch{}}});re.exports.lock=Bt;re.exports.unlock=ot;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(o=>{r[o]=(...n)=>{let i=n.pop(),a;try{a=e[`${o}Sync`](...n)}catch(c){return i(c)}i(null,a)}}),r}function Jt(e){return(...t)=>new Promise((r,o)=>{t.push((n,i)=>{n?o(n):r(i)}),e(...t)})}function Kt(e){return(...t)=>{let r,o;if(t.push((n,i)=>{r=n,o=i}),e(...t),r)throw r;return o}}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=ut(),{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 U 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 o=atob(t),n=new Uint8Array(o.length);for(let i=0;i<o.length;i+=1)n[i]=o.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 o=0;o<=r.length;o++)try{w.renameSync(e,t);return}catch(n){let i=n.code;if((i==="EPERM"||i==="EBUSY")&&o<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[o]);continue}throw n}}function nr(e){function t(n){return U.join(e,...n.split("/"))}function r(n){return U.relative(e,n).replace(/\\/g,"/")}function o(n,i){if(w.existsSync(n))for(let a of w.readdirSync(n,{withFileTypes:!0})){let c=U.join(n,a.name);if(a.isDirectory()){o(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(U.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(U.dirname(a),{recursive:!0}),w.writeFileSync(c,Buffer.from(i)),yt(c,a)},listKeys(n){let i=[];o(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}}}}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 or(e){function t(r){let o=e.stat?ir(e.stat(r)):null;if(o)return o;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,o,n="text/plain; charset=utf-8"){e.write(r,o);let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??pt(),i.size=i.size??dt(o),i},putBytes(r,o,n="application/octet-stream"){if(e.writeBytes)e.writeBytes(r,o);else{let a=JSON.stringify({__kind:"bytes-array",data:[...o]});e.write(r,a)}let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??pt(),i.size=i.size??o.byteLength,i},getText(r){let o=e.read(r);if(o===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(o);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new TextDecoder("utf-8").decode(new Uint8Array(n.data))}catch{}return o},getBytes(r){if(e.readBytes){let n=e.readBytes(r);if(n!==null)return n}let o=e.read(r);if(o===null)return null;try{let n=JSON.parse(o);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new Uint8Array(n.data)}catch{}return new TextEncoder().encode(o)},head:t,list(r=""){return e.listKeys(r).map(o=>t(o)??{key:o}).sort((o,n)=>o.key.localeCompare(n.key))},remove(r){e.remove(r)}}}function ur(e){function t(n){return{status:"success",data:n}}function r(n){return{status:"fail",error:n}}function o(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 o(i)}},head(n){try{let i=n.params?.key;return i?t({artifact:e.head(i)}):r("head requires params.key")}catch(i){return o(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(u=>Math.max(0,Math.min(255,Number(u)||0))));return t({artifact:e.putBytes(i,h,a)})}return r("put requires body as string, {text}, or {bytes:number[]}")}catch(i){return o(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 o(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 o(i)}}}}function ht(...e){return U.resolve(...e)}U.join(St.tmpdir(),".board-live-cards-git-bash-cache.json");function ne(e,t,r){let o=e.indexOf(t),n=o!==-1?e[o+1]:void 0;if(!n)throw new Error(`Missing ${t}
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,o)=>{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:!(o=gt(t,n))||o.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=o(e.chmod),e.fchmod=o(e.fchmod),e.lchmod=o(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(u,s,l){l&&process.nextTick(l)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(u,s,l,f){f&&process.nextTick(f)},e.lchownSync=function(){}),bt==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(u){function s(l,f,p){var _=Date.now(),v=0;u(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"?u(l,f,E):p(R)})},v),v<100&&(v+=10);return}p&&p(R)})}return Object.setPrototypeOf&&Object.setPrototypeOf(s,u),s})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(u){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++,u.call(e,l,f,p,_,v,R);E.apply(this,arguments)}}return u.call(e,l,f,p,_,v,R)}return Object.setPrototypeOf&&Object.setPrototypeOf(s,u),s})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(u){return function(s,l,f,p,_){for(var v=0;;)try{return u.call(e,s,l,f,p,_)}catch(E){if(E.code==="EAGAIN"&&v<10){v++;continue}throw E}}})(e.readSync);function t(u){u.lchmod=function(s,l,f){u.open(s,q.O_WRONLY|q.O_SYMLINK,l,function(p,_){if(p){f&&f(p);return}u.fchmod(_,l,function(v){u.close(_,function(E){f&&f(v||E)})})})},u.lchmodSync=function(s,l){var f=u.openSync(s,q.O_WRONLY|q.O_SYMLINK,l),p=!0,_;try{_=u.fchmodSync(f,l),p=!1}finally{if(p)try{u.closeSync(f)}catch{}else u.closeSync(f)}return _}}function r(u){q.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(s,l,f,p){u.open(s,q.O_SYMLINK,function(_,v){if(_){p&&p(_);return}u.futimes(v,l,f,function(E){u.close(v,function(R){p&&p(E||R)})})})},u.lutimesSync=function(s,l,f){var p=u.openSync(s,q.O_SYMLINK),_,v=!0;try{_=u.futimesSync(p,l,f),v=!1}finally{if(v)try{u.closeSync(p)}catch{}else u.closeSync(p)}return _}):u.futimes&&(u.lutimes=function(s,l,f,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function o(u){return u&&function(s,l,f){return u.call(e,s,l,function(p){h(p)&&(p=null),f&&f.apply(this,arguments)})}}function n(u){return u&&function(s,l){try{return u.call(e,s,l)}catch(f){if(!h(f))throw f}}}function i(u){return u&&function(s,l,f,p){return u.call(e,s,l,f,function(_){h(_)&&(_=null),p&&p.apply(this,arguments)})}}function a(u){return u&&function(s,l,f){try{return u.call(e,s,l,f)}catch(p){if(!h(p))throw p}}}function c(u){return u&&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?u.call(e,s,l,p):u.call(e,s,p)}}function d(u){return u&&function(s,l){var f=l?u.call(e,s,l):u.call(e,s);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function h(u){if(!u||u.code==="ENOSYS")return!0;var s=!process.getuid||process.getuid()!==0;return!!(s&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ce=P((pr,Pe)=>{var Re=$("stream").Stream;Pe.exports=It;function It(e){return{ReadStream:t,WriteStream:r};function t(o,n){if(!(this instanceof t))return new t(o,n);Re.call(this);var i=this;this.path=o,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(u,s){if(u){i.emit("error",u),i.readable=!1;return}i.fd=s,i.emit("open",s),i._read()})}function r(o,n){if(!(this instanceof r))return new r(o,n);Re.call(this),this.path=o,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(),oe=$("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;oe.debuglog?G=oe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(G=function(){var e=oe.format.apply(oe,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,o){return e.call(k,r,function(n){n||qe(),typeof o=="function"&&o.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 o=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 o(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 u=/^v[0-5]\./;function s(y,S,m){typeof S=="function"&&(m=S,S=null);var L=u.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 ue;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(ue),ue=void 0,k[M].length!==0){var e=k[M].shift(),t=e[0],r=e[1],o=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,o)}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)}ue===void 0&&(ue=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 o=this,n=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._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,o=0;o<this._errors.length;o++){var n=this._errors[o],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 o=[],n=0;n<t.retries;n++)o.push(this.createTimeout(n,t));return e&&e.forever&&!o.length&&o.push(this.createTimeout(n,t)),o.sort(function(i,a){return i-a}),o};W.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,o=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return o=Math.min(o,t.maxTimeout),o};W.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var o in e)typeof e[o]=="function"&&r.push(o)}for(var n=0;n<r.length;n++){var i=r[n],a=e[i];e[i]=function(d){var h=W.operation(t),u=Array.prototype.slice.call(arguments,1),s=u.pop();u.push(function(l){h.retry(l)||(l&&(arguments[0]=h.mainError()),s.apply(this,arguments))}),h.attempt(function(){d.apply(e,u)})}.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 o=function(){I.removeListener(r,e),I.listeners("exit").length===0&&I.listeners("afterexit").length===0&&fe()};return I.on(r,e),o},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,o){I.emitted[t]||(I.emitted[t]=!0,I.emit(t,r,o))},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 o=le.apply(this,arguments);return Y("exit",T.exitCode,null),Y("afterexit",T.exitCode,null),o}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 o=t[et];if(o)return t.stat(e,(i,a)=>{if(i)return r(i);r(null,a.mtime,o)});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 ut=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 o=te(e,t);t.fs.mkdir(o,n=>{if(!n)return rt.probe(o,t.fs,(i,a,c)=>{if(i)return t.fs.rmdir(o,()=>{}),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(o,(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),o=>{if(o&&o.code!=="ENOENT")return r(o);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,(o,n)=>{let i=r.lastUpdate+t.stale<Date.now();if(o)return o.code==="ENOENT"||i?Ee(e,r,Object.assign(o,{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:o=>{throw o},...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,(o,n)=>{if(o)return r(o);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,u=>{if(h.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));ot(n,{...t,realpath:!1},u)})})})})}function ot(e,t,r){t={fs:ke,realpath:!0,...t},be(e,t,(o,n)=>{if(o)return r(o);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,(o,n)=>{if(o)return r(o);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=ot;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(o=>{r[o]=(...n)=>{let i=n.pop(),a;try{a=e[`${o}Sync`](...n)}catch(c){return i(c)}i(null,a)}}),r}function Jt(e){return(...t)=>new Promise((r,o)=>{t.push((n,i)=>{n?o(n):r(i)}),e(...t)})}function Kt(e){return(...t)=>{let r,o;if(t.push((n,i)=>{r=n,o=i}),e(...t),r)throw r;return o}}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=ut(),{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 o=atob(t),n=new Uint8Array(o.length);for(let i=0;i<o.length;i+=1)n[i]=o.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 o=0;o<=r.length;o++)try{w.renameSync(e,t);return}catch(n){let i=n.code;if((i==="EPERM"||i==="EBUSY")&&o<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[o]);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 o(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()){o(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=[];o(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}}}}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 or(e){function t(r){let o=e.stat?ir(e.stat(r)):null;if(o)return o;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,o,n="text/plain; charset=utf-8"){e.write(r,o);let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??pt(),i.size=i.size??dt(o),i},putBytes(r,o,n="application/octet-stream"){if(e.writeBytes)e.writeBytes(r,o);else{let a=JSON.stringify({__kind:"bytes-array",data:[...o]});e.write(r,a)}let i=t(r)??{key:r};return i.contentType=n,i.updatedAt=i.updatedAt??pt(),i.size=i.size??o.byteLength,i},getText(r){let o=e.read(r);if(o===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(o);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new TextDecoder("utf-8").decode(new Uint8Array(n.data))}catch{}return o},getBytes(r){if(e.readBytes){let n=e.readBytes(r);if(n!==null)return n}let o=e.read(r);if(o===null)return null;try{let n=JSON.parse(o);if(n&&n.__kind==="bytes-array"&&Array.isArray(n.data))return new Uint8Array(n.data)}catch{}return new TextEncoder().encode(o)},head:t,list(r=""){return e.listKeys(r).map(o=>t(o)??{key:o}).sort((o,n)=>o.key.localeCompare(n.key))},remove(r){e.remove(r)}}}function ur(e){function t(n){return{status:"success",data:n}}function r(n){return{status:"fail",error:n}}function o(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 o(i)}},head(n){try{let i=n.params?.key;return i?t({artifact:e.head(i)}):r("head requires params.key")}catch(i){return o(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(u=>Math.max(0,Math.min(255,Number(u)||0))));return t({artifact:e.putBytes(i,h,a)})}return r("put requires body as string, {text}, or {bytes:number[]}")}catch(i){return o(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 o(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 o(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 o=e.indexOf(t),n=o!==-1?e[o+1]:void 0;if(!n)throw new Error(`Missing ${t}
4
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
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 o=ne(r,"--store-ref",`artifacts-store ${t} --store-ref <b64-ref>`),n=rr(o).value,i=ur(or(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"),u;if(d)u={bytes:[...new Uint8Array(w.readFileSync(d))]};else if(typeof h=="string")u={text:h};else if(!process.stdin.isTTY)u={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:u});if(s.status!=="success")throw new Error(s.error||"put failed");process.stdout.write(JSON.stringify(s.data,null,2)+`
6
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 u=new Uint8Array(h.data.bytes??[]);d?w.writeFileSync(d,Buffer.from(u)):process.stdout.write(JSON.stringify({...h.data,bytes:void 0,byteLength:u.byteLength},null,2)+`