yaml-flow 8.5.3 → 8.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/browser/asset-integrity.json +3 -3
  2. package/examples/board/demo-shell-with-server.html +2 -2
  3. package/examples/board/doc.html +2 -2
  4. package/examples/board/server/board-server.js +266 -5
  5. package/examples/board/server/board-worker/task-executor.js +166 -51
  6. package/examples/board/server/chat-flow/copilot-chat/assistant.js +25 -12
  7. package/examples/board/server/chat-flow/copilot-chat/probe.js +7 -0
  8. package/examples/board/server/chat-flow/copilot-chat/shared.js +97 -0
  9. package/examples/board/server/chat-flow/flow-steps.json +109 -51
  10. package/examples/board/server-config.json +1 -0
  11. package/examples/board/test/server-http-test.js +870 -67
  12. package/examples/board-local/demo-shell-localstorage.html +3 -3
  13. package/lib/{artifacts-store-lib-D-k-E8Vy.d.ts → artifacts-store-lib-C1rtrkxm.d.ts} +1 -1
  14. package/lib/{artifacts-store-lib-CVgtQrNZ.d.cts → artifacts-store-lib-CLOtsiav.d.cts} +1 -1
  15. package/lib/artifacts-store-public.cjs +1 -1
  16. package/lib/artifacts-store-public.d.cts +3 -3
  17. package/lib/artifacts-store-public.d.ts +3 -3
  18. package/lib/artifacts-store-public.js +1 -1
  19. package/lib/batch/index.cjs +1 -1
  20. package/lib/batch/index.js +1 -1
  21. package/lib/board-live-cards-mcp.cjs +1 -1
  22. package/lib/board-live-cards-mcp.d.cts +35 -15
  23. package/lib/board-live-cards-mcp.d.ts +35 -15
  24. package/lib/board-live-cards-mcp.js +1 -1
  25. package/lib/board-live-cards-node.cjs +8 -16
  26. package/lib/board-live-cards-node.d.cts +32 -12
  27. package/lib/board-live-cards-node.d.ts +32 -12
  28. package/lib/board-live-cards-node.js +8 -16
  29. package/lib/{board-live-cards-public-BGS22cMb.d.ts → board-live-cards-public-CBVjm327.d.ts} +59 -24
  30. package/lib/{board-live-cards-public-B13InXhC.d.cts → board-live-cards-public-CPJy-aGW.d.cts} +59 -24
  31. package/lib/board-live-cards-public.cjs +1 -2
  32. package/lib/board-live-cards-public.d.cts +2 -2
  33. package/lib/board-live-cards-public.d.ts +2 -2
  34. package/lib/board-live-cards-public.js +1 -2
  35. package/lib/board-live-cards-server-runtime.cjs +1 -7
  36. package/lib/board-live-cards-server-runtime.d.cts +5 -5
  37. package/lib/board-live-cards-server-runtime.d.ts +5 -5
  38. package/lib/board-live-cards-server-runtime.js +1 -7
  39. package/lib/board-livegraph-runtime/index.cjs +1 -2
  40. package/lib/board-livegraph-runtime/index.js +1 -2
  41. package/lib/board-worker-adapter.cjs +21 -7
  42. package/lib/board-worker-adapter.d.cts +17 -2
  43. package/lib/board-worker-adapter.d.ts +17 -2
  44. package/lib/board-worker-adapter.js +21 -7
  45. package/lib/card-compute/index.cjs +1 -9
  46. package/lib/card-compute/index.js +1 -9
  47. package/lib/card-store-public.cjs +1 -1
  48. package/lib/card-store-public.d.cts +2 -2
  49. package/lib/card-store-public.d.ts +2 -2
  50. package/lib/card-store-public.js +1 -1
  51. package/lib/card-validation.cjs +1 -9
  52. package/lib/card-validation.js +1 -9
  53. package/lib/{chat-storage-lib-CJn7a6OH.d.ts → chat-storage-lib-Bce-xx6l.d.ts} +1 -1
  54. package/lib/{chat-storage-lib-0imhRX3l.d.cts → chat-storage-lib-CKylihjm.d.cts} +1 -1
  55. package/lib/chat-store-public.cjs +1 -1
  56. package/lib/chat-store-public.d.cts +3 -3
  57. package/lib/chat-store-public.d.ts +3 -3
  58. package/lib/chat-store-public.js +1 -1
  59. package/lib/chunk-2MZUYY65.cjs +2 -0
  60. package/lib/chunk-5DB54ZX2.cjs +2 -0
  61. package/lib/chunk-5EA2ESS4.cjs +16 -0
  62. package/lib/chunk-6APH25VI.js +2 -0
  63. package/lib/chunk-76ON3V7R.js +2 -0
  64. package/lib/chunk-7BKNHFNH.js +2 -0
  65. package/lib/chunk-CWREBRXS.js +3 -0
  66. package/lib/chunk-DAXACY63.js +2 -0
  67. package/lib/chunk-FW4363Y4.js +2 -0
  68. package/lib/chunk-FZ2SBU5M.js +3 -0
  69. package/lib/chunk-G4XXRHL2.cjs +3 -0
  70. package/lib/chunk-GNFE24S7.cjs +2 -0
  71. package/lib/chunk-GYQXDNNI.cjs +2 -0
  72. package/lib/chunk-H5KD3JPY.cjs +2 -0
  73. package/lib/chunk-HLJH7LGW.js +16 -0
  74. package/lib/chunk-I4WH5U5D.cjs +2 -0
  75. package/lib/chunk-IXZG74EW.cjs +2 -0
  76. package/lib/chunk-JAL25FGA.cjs +2 -0
  77. package/lib/chunk-JM5EKT57.js +2 -0
  78. package/lib/chunk-JMDHDY6M.js +2 -0
  79. package/lib/chunk-KBELAKIY.js +2 -0
  80. package/lib/chunk-KHJABJ45.cjs +3 -0
  81. package/lib/chunk-KLRUISRY.cjs +2 -0
  82. package/lib/chunk-KNFFDVLD.cjs +2 -0
  83. package/lib/chunk-LBMEVV4U.js +2 -0
  84. package/lib/chunk-LDAP75GN.js +2 -0
  85. package/lib/chunk-LODXIALE.cjs +2 -0
  86. package/lib/chunk-LVNQCE5X.cjs +3 -0
  87. package/lib/chunk-M7EQRS6W.js +3 -0
  88. package/lib/chunk-MNEOJWPS.js +10 -0
  89. package/lib/chunk-NJJ7WEDT.cjs +2 -0
  90. package/lib/chunk-NMZ6XNLB.cjs +3 -0
  91. package/lib/chunk-OPNGCSXJ.js +2 -0
  92. package/lib/chunk-P64UKI3L.cjs +8 -0
  93. package/lib/chunk-P7ZCDICS.cjs +2 -0
  94. package/lib/chunk-Q6H7NINN.cjs +5 -0
  95. package/lib/chunk-Q6VSL327.js +8 -0
  96. package/lib/chunk-QWBNDVUA.js +5 -0
  97. package/lib/chunk-S6DRP2HX.cjs +2 -0
  98. package/lib/chunk-UJ7ZTV4J.cjs +10 -0
  99. package/lib/chunk-UVE65IPR.cjs +3 -0
  100. package/lib/chunk-VCCTAUIG.js +2 -0
  101. package/lib/chunk-VGT3TRQG.js +3 -0
  102. package/lib/chunk-VLBB3D6B.js +3 -0
  103. package/lib/chunk-WDPOGXTY.js +2 -0
  104. package/lib/chunk-X3LC4LII.js +2 -0
  105. package/lib/chunk-YGKDQLYP.js +2 -0
  106. package/lib/chunk-YMEIPKLW.cjs +2 -0
  107. package/lib/config/index.cjs +1 -1
  108. package/lib/config/index.js +1 -1
  109. package/lib/continuous-event-graph/index.cjs +1 -2
  110. package/lib/continuous-event-graph/index.js +1 -2
  111. package/lib/event-graph/index.cjs +1 -22
  112. package/lib/event-graph/index.js +1 -22
  113. package/lib/execution-refs.cjs +1 -2
  114. package/lib/execution-refs.d.cts +3 -2
  115. package/lib/execution-refs.d.ts +3 -2
  116. package/lib/execution-refs.js +1 -2
  117. package/lib/index.cjs +2 -24
  118. package/lib/index.d.cts +1 -1
  119. package/lib/index.d.ts +1 -1
  120. package/lib/index.js +2 -24
  121. package/lib/server-runtime/index.cjs +1 -7
  122. package/lib/server-runtime/index.d.cts +6 -6
  123. package/lib/server-runtime/index.d.ts +6 -6
  124. package/lib/server-runtime/index.js +1 -7
  125. package/lib/step-machine/index.cjs +1 -11
  126. package/lib/step-machine/index.js +1 -11
  127. package/lib/step-machine-public/index.cjs +1 -4
  128. package/lib/step-machine-public/index.d.cts +1 -1
  129. package/lib/step-machine-public/index.d.ts +1 -1
  130. package/lib/step-machine-public/index.js +1 -4
  131. package/lib/{storage-interface-B2WD9D5n.d.cts → storage-interface-Ct-C4tlz.d.cts} +28 -1
  132. package/lib/{storage-interface-B2WD9D5n.d.ts → storage-interface-Ct-C4tlz.d.ts} +28 -1
  133. package/lib/stores/index.cjs +1 -2
  134. package/lib/stores/index.d.cts +1 -1
  135. package/lib/stores/index.d.ts +1 -1
  136. package/lib/stores/index.js +1 -2
  137. package/lib/stores/kv.cjs +1 -2
  138. package/lib/stores/kv.d.cts +1 -1
  139. package/lib/stores/kv.d.ts +1 -1
  140. package/lib/stores/kv.js +1 -2
  141. package/lib/stores/memory.cjs +1 -1
  142. package/lib/stores/memory.js +1 -1
  143. package/lib/{types-30R357js.d.ts → types-BuK2UMxk.d.ts} +4 -4
  144. package/lib/{types-CIgsh56O.d.cts → types-DRl0Hy_p.d.cts} +4 -4
  145. package/package.json +2 -16
  146. package/cli/board-live-cards-lib-COi4bSpk.d.ts +0 -322
  147. package/cli/browser-api/board-live-cards-browser-adapter.d.ts +0 -36
  148. package/cli/browser-api/board-live-cards-browser-adapter.js +0 -4
  149. package/cli/browser-api/card-store-browser-api.d.ts +0 -25
  150. package/cli/browser-api/card-store-browser-api.js +0 -2
  151. package/cli/browser-api/jsonata-sync.cjs +0 -7623
  152. package/cli/bundled/artifacts-store-cli.mjs +0 -12
  153. package/cli/bundled/batch-runner-cli.mjs +0 -3
  154. package/cli/bundled/board-live-cards-cli.mjs +0 -29
  155. package/cli/bundled/card-store-cli.mjs +0 -154
  156. package/cli/bundled/chat-store-cli.mjs +0 -16
  157. package/cli/bundled/jsonata-sync.cjs +0 -7623
  158. package/cli/bundled/step-machine-cli.mjs +0 -150
  159. package/cli/execution-interface-BCIhu1gO.d.ts +0 -442
  160. package/cli/types-H3EMBPY2.d.ts +0 -398
  161. package/examples/board/server/README-mcp-api.md +0 -690
  162. package/examples/board/test/server-http-mcp-test.js +0 -1280
  163. package/lib/board-livegraph-runtime/jsonata-sync.cjs +0 -7623
  164. package/lib/card-compute/jsonata-sync.cjs +0 -7623
  165. package/lib/continuous-event-graph/jsonata-sync.cjs +0 -7623
  166. package/lib/server-runtime/jsonata-sync.cjs +0 -7623
@@ -1,12 +0,0 @@
1
- import{createRequire}from"module";const require=createRequire(import.meta.url);
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
- `);return}throw new Error(`Unknown command "${t}"
11
-
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};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire}from"module";const require=createRequire(import.meta.url);
3
- import*as u from"fs";import*as i from"path";import{fileURLToPath as S}from"url";import*as w from"os";function m(...r){return i.resolve(...r)}i.join(w.tmpdir(),".board-live-cards-git-bash-cache.json");var f=i.dirname(S(import.meta.url)),v=i.join(f,"..","..","lib","index.js"),x=i.join(f,"..","..","lib","step-machine-public","index.js"),E=i.join(f,"..","..","lib","batch","index.js"),A=i.join(f,"execution-adapter.js"),{loadStepFlow:O,createStepMachine:J,MemoryStore:M}=await import(p(v).href),{buildStepHandlersForFlow:N}=await import(p(x).href),{batch:R}=await import(p(E).href),{invokeRefSync:$}=await import(p(A).href);function p(r){let t=i.resolve(r).replace(/\\/g,"/");return new URL(`file:///${t.startsWith("/")?t.slice(1):t}`)}async function F(r){let t=T(r);(t.help||r.length===0)&&(k(),process.exit(r.length===0?1:0));let{flowArg:s,itemsArg:n,concurrency:e}=t;if(!s)throw new Error("[batch-runner-cli] Flow path is required.");if(!n)throw new Error("[batch-runner-cli] --items <json-file-or-inline> is required.");let c=d(s),a=i.dirname(c),y=U(n),h=await O(c),l=await R(y,{concurrency:e,processor:async(o,L)=>{let b=N(h,{invoke:(g,j)=>$(W(g),j,{cliDir:a,cwd:a})});return J(h,b,{store:new M}).run(o)},onProgress:o=>{process.stderr.write(`\r[batch] ${o.completed+o.failed}/${o.total} (${o.percent}%) \u2014 ${o.active} active`)}});process.stderr.write("\r"+" ".repeat(80)+"\r"),console.log(JSON.stringify({completed:l.completed,failed:l.failed,total:l.total,durationMs:l.durationMs,items:l.items.map(o=>({index:o.index,status:o.status,durationMs:o.durationMs,...o.status==="completed"?{intent:o.result?.intent,data:o.result?.data}:{error:o.error?.message}}))},null,2)),l.failed>0&&process.exit(1)}function T(r){let t={},s=[],n=!1;for(let e=0;e<r.length;e++){let c=r[e];if(c==="-h"||c==="--help"){n=!0;continue}if(c==="--items"){let a=r[e+1];if(!a||a.startsWith("--"))throw new Error("[batch-runner-cli] Missing value for --items.");t["--items"]=a,e++;continue}if(c==="--concurrency"){let a=r[e+1];if(!a||a.startsWith("--"))throw new Error("[batch-runner-cli] Missing value for --concurrency.");t["--concurrency"]=a,e++;continue}if(c.startsWith("--"))throw new Error(`[batch-runner-cli] Unknown flag: ${c}`);s.push(c)}return{help:n,flowArg:s[0],itemsArg:t["--items"],concurrency:t["--concurrency"]?parseInt(t["--concurrency"],10):5}}function d(r){return i.isAbsolute(r)?r:i.resolve(process.cwd(),r)}function U(r){let t=d(r),s;u.existsSync(t)?s=u.readFileSync(t,"utf-8"):s=r;let n;try{n=JSON.parse(s)}catch(e){let c=e instanceof Error?e.message:String(e);throw new Error(`[batch-runner-cli] Failed to parse items JSON: ${c}`)}if(!Array.isArray(n))throw new Error("[batch-runner-cli] Items must be a JSON array of objects.");for(let e=0;e<n.length;e++)if(!n[e]||typeof n[e]!="object"||Array.isArray(n[e]))throw new Error(`[batch-runner-cli] Item at index ${e} is not a JSON object.`);return n}function W(r){if(!r||typeof r!="object"||typeof r.whatToRun!="string"||!r.whatToRun.startsWith("b64:"))return r;try{let t=r.whatToRun.slice(4),s=t+"=".repeat((4-t.length%4)%4),n=Buffer.from(s.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString("utf8"),e=JSON.parse(n);return!e||typeof e!="object"||typeof e.value!="string"?r:{...r,whatToRun:e}}catch{return r}}function k(){console.error("Usage: batch-runner-cli <step-flow.yaml> --items <items.json> [--concurrency <n>]"),console.error(""),console.error("Run a step-machine flow for each item in a JSON array, with concurrency control."),console.error(""),console.error("Options:"),console.error(" --items <path|json> JSON file or inline JSON array of input objects"),console.error(" --concurrency <n> Max concurrent flows (default: 5)"),console.error(" -h, --help Show this help"),console.error(""),console.error("Example:"),console.error(" batch-runner-cli flow.yaml --items items.json --concurrency 3"),console.error(` batch-runner-cli flow.yaml --items '[{"a":1,"b":2},{"a":3,"b":4}]'`)}var I=process.argv[1]&&m(process.argv[1])===m(new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/,"$1"));I&&F(process.argv.slice(2)).catch(r=>{let t=r instanceof Error?r.stack??r.message:String(r);console.error(t),process.exit(1)});export{F as cli};