@stryke/capnp 0.12.41 → 0.12.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/capnpc.cjs +224 -7
- package/bin/capnpc.mjs +219 -9
- package/bin/capnpc.mjs.map +1 -1
- package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs +12 -0
- package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs.map +1 -0
- package/dist/capnp-es.GpvEvMIK-xNDcbmgx.cjs +11 -0
- package/dist/compile-ChbJ-p6B.cjs +169 -0
- package/dist/compile-DJUj4hs3.mjs +163 -0
- package/dist/compile-DJUj4hs3.mjs.map +1 -0
- package/dist/{compile-DN7i0G3X.d.mts → compile-UkKIpqrK.d.mts} +2 -2
- package/dist/{compile-DN7i0G3X.d.mts.map → compile-UkKIpqrK.d.mts.map} +1 -1
- package/dist/compile.cjs +1 -1
- package/dist/compile.d.mts +2 -2
- package/dist/compile.mjs +1 -1
- package/dist/dist-C1gSYYrg.cjs +1 -0
- package/dist/dist-CK47iMja.mjs +2 -0
- package/dist/dist-CK47iMja.mjs.map +1 -0
- package/dist/helpers-BoKbpcuO.mjs +27 -0
- package/dist/helpers-BoKbpcuO.mjs.map +1 -0
- package/dist/helpers-DSMRKdw1.cjs +26 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/helpers.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/rpc.cjs +1 -1
- package/dist/rpc.mjs +1 -1
- package/dist/rpc.mjs.map +1 -1
- package/dist/types-BujoAx-K.mjs +2 -0
- package/dist/{types-y_yfxLs5.mjs.map → types-BujoAx-K.mjs.map} +1 -1
- package/dist/{types-DBd3Wi0H.d.mts → types-D03SjfBL.d.mts} +1 -1
- package/dist/{types-DBd3Wi0H.d.mts.map → types-D03SjfBL.d.mts.map} +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +1 -1
- package/package.json +4 -4
- package/schemas/{index-CDymg4xL.d.mts → index-BAJMwFip.d.mts} +2 -2
- package/schemas/{index-CDymg4xL.d.mts.map → index-BAJMwFip.d.mts.map} +1 -1
- package/schemas/persistent.cjs +1 -1
- package/schemas/persistent.d.mts +1 -1
- package/schemas/persistent.mjs +1 -1
- package/schemas/rpc-twoparty.cjs +1 -1
- package/schemas/rpc-twoparty.d.mts +1 -1
- package/schemas/rpc-twoparty.mjs +1 -1
- package/schemas/rpc-twoparty.mjs.map +1 -1
- package/schemas/rpc.cjs +1 -1
- package/schemas/rpc.d.mts +1 -1
- package/schemas/rpc.mjs +1 -1
- package/schemas/schema.cjs +1 -1
- package/schemas/schema.d.mts +1 -1
- package/schemas/schema.mjs +1 -1
- package/schemas/src-CGrmR2BO.cjs +11 -0
- package/schemas/src-DqIy7I3p.mjs +12 -0
- package/schemas/src-DqIy7I3p.mjs.map +1 -0
- package/dist/compile-DOMgXQRn.cjs +0 -1
- package/dist/compile-cQ918Wl_.mjs +0 -2
- package/dist/compile-cQ918Wl_.mjs.map +0 -1
- package/dist/dist-BzGdCkHS.cjs +0 -1
- package/dist/dist-CvDcvswe.mjs +0 -2
- package/dist/dist-CvDcvswe.mjs.map +0 -1
- package/dist/helpers-BIiGufva.cjs +0 -6
- package/dist/helpers-BYBeqv2d.mjs +0 -7
- package/dist/helpers-BYBeqv2d.mjs.map +0 -1
- package/dist/types-y_yfxLs5.mjs +0 -2
- package/schemas/src-CtkguuVd.mjs +0 -7
- package/schemas/src-CtkguuVd.mjs.map +0 -1
- package/schemas/src-DqnIPdOg.cjs +0 -6
- /package/dist/{types-B2gKzfwi.cjs → types-D6FuBB1k.cjs} +0 -0
package/bin/capnpc.cjs
CHANGED
|
@@ -1,10 +1,227 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@storm-software/config-tools/logger/console`),l=require(`@storm-software/config-tools/utilities`),u=require(`node:fs`),d=require(`node:fs/promises`),f=require(`commander`),p=require(`capnp-es/compiler`),m=require(`defu`);m=s(m);let h=require(`node:buffer`),g=require(`node:child_process`),_=require(`jsonc-parser`),v=require(`superjson`);v=s(v);let y=require(`lines-and-columns`);require(`nanotar`);let b=require(`glob`),x=require(`typescript`);function S(e){return(0,u.existsSync)(e)}const C=e=>e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e),ee=e=>typeof e==`object`&&!!e,w=e=>{if(!ee(e)||C(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},T=e=>{try{return e===null}catch{return!1}},te=e=>{try{return e instanceof Number||typeof e==`number`||Number(e)===e}catch{return!1}},E=e=>e===void 0,ne=e=>{try{return E(e)||T(e)}catch{return!1}},re=e=>{try{return!ne(e)}catch{return!1}},D=e=>{try{return typeof e==`string`}catch{return!1}},O=e=>{try{return re(e)&&D(e)&&e.length>0}catch{return!1}},ie=``;function k(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const A=/^[A-Z]:\//i,ae=/^[A-Z]:$/i,oe=/^[/\\]{2}/,se=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i,j=/^\/([A-Z]:)?$/i,ce=/\.[0-9a-z]+$/i;function M(e){return se.test(P(e))}function N(e){return M(e)}function P(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}function F(e=``){return e&&e.replace(/\\/g,`/`).replace(A,e=>e.toUpperCase())}function I(e){if(!e||e.length===0)return`.`;e=F(e);let t=e.match(oe),n=N(e),r=e[e.length-1]===`/`;return e=R(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),ae.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!N(e)?`/${e}`:e)}function L(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return I(t)}function R(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function z(e=``){return e&&P(e).replace(A,e=>e.toUpperCase())}function B(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function V(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=z(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?``:r===!1&&i.includes(`.`)?i.replace(`.${U(i)??``}`,``)||``:i}function H(e,t={}){let n=z(e),r=n.replace(V(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}function U(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let t=ce.exec(z(e));return t&&t.length>0&&O(t[0])?t[0].replace(`.`,``):void 0}function W(...e){e=e.map(e=>z(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:k();!i||i.length===0||(t=`${i}/${t}`,n=N(i))}return t=B(t,!n),n&&!N(t)?`/${t}`:t.length>0?t:`.`}function G(e,t){let n=W(e).replace(j,`$1`).split(`/`),r=W(t).replace(j,`$1`).split(`/`);if(r[0][1]===`:`&&n[0][1]===`:`&&n[0]!==r[0])return r.join(`/`);let i=[...n];for(let e of i){if(r[0]!==e)break;n.shift(),r.shift()}return[...n.map(()=>`..`),...r].join(`/`)}function K(e,t,n=!1){return G(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}function le(e){return e??=[],Array.isArray(e)?e:[e]}const q=e=>{try{return typeof e==`object`||!!e&&e?.constructor===Object||w(e)}catch{return!1}},J=Symbol(`singleComment`),Y=Symbol(`multiComment`);function ue(){return``}function de(e,t,n){return e.slice(t,n).replace(/\S/g,` `)}function fe(e,t){let n=t-1,r=0;for(;e[n]===`\\`;)--n,r+=1;return!!(r%2)}function pe(e,{whitespace:t=!0,trailingCommas:n=!1}={}){if(typeof e!=`string`)throw TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof e}\``);let r=t?de:ue,i=!1,a=!1,o=0,s=``,c=``,l=-1;for(let t=0;t<e.length;t++){let u=e[t],d=e[t+1];!a&&u===`"`&&(fe(e,t)||(i=!i)),!i&&(!a&&u+(d??``)===`//`?(s+=e.slice(o,t),o=t,a=J,t++):a===J&&u+(d??``)===`\r
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`,
|
|
7
|
-
`)
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`node:child_process`),u=require(`node:fs`),d=require(`node:path`),f=require(`node:fs/promises`),p=require(`@stryke/fs/exists`),m=require(`@stryke/path/file-path-fns`),h=require(`@stryke/path/join-paths`),g=require(`typescript`);g=c(g),require(`defu`);let ee=require(`node:buffer`),te=require(`@stryke/fs/json`),ne=require(`@stryke/fs/list-files`);var _={light:{background:`#fafafa`,foreground:`#1d1e22`,brand:`#1fb2a6`,alternate:`#db2777`,help:`#5C4EE5`,success:`#087f5b`,info:`#0550ae`,warning:`#e3b341`,danger:`#D8314A`,fatal:`#51070f`,link:`#3fa6ff`,positive:`#22c55e`,negative:`#dc2626`,gradient:[`#1fb2a6`,`#db2777`,`#5C4EE5`]},dark:{background:`#1d1e22`,foreground:`#cbd5e1`,brand:`#2dd4bf`,alternate:`#db2777`,help:`#818cf8`,success:`#10b981`,info:`#58a6ff`,warning:`#f3d371`,danger:`#D8314A`,fatal:`#a40e26`,link:`#3fa6ff`,positive:`#22c55e`,negative:`#dc2626`,gradient:[`#1fb2a6`,`#db2777`,`#818cf8`]}},v=o(((e,t)=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})),re=o(((e,t)=>{let n=v(),r={};for(let e of Object.keys(n))r[n[e]]=e;let i={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};t.exports=i;for(let e of Object.keys(i)){if(!(`channels`in i[e]))throw Error(`missing channels property: `+e);if(!(`labels`in i[e]))throw Error(`missing channel labels property: `+e);if(i[e].labels.length!==i[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],`channels`,{value:t}),Object.defineProperty(i[e],`labels`,{value:n})}i.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},i.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},i.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],a=i.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,o*100,r*100]},i.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function a(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=r[e];if(t)return t;let i=1/0,o;for(let t of Object.keys(n)){let r=n[t],s=a(e,r);s<i&&(i=s,o=t)}return o},i.keyword.rgb=function(e){return n[e]},i.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),n=t[0],r=t[1],a=t[2];return n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*r-16,500*(n-r),200*(r-a)]},i.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},i.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},i.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},i.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},i.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},i.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},i.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},i.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},i.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},i.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},i.rgb.ansi16=function(e,t=null){let[n,r,a]=e,o=t===null?i.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},i.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},i.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},i.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},i.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},i.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},i.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},i.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},i.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}})),ie=o(((e,t)=>{let n=re();function r(){let e={},t=Object.keys(n);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function i(e){let t=r(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],o=t[n];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,i.unshift(n))}}return t}function a(e,t){return function(n){return t(e(n))}}function o(e,t){let r=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),i=a(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=r,i}t.exports=function(e){let t=i(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=o(e,t))}return n}})),ae=o(((e,t)=>{let n=re(),r=ie(),i={},a=Object.keys(n);function o(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function s(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}a.forEach(e=>{i[e]={},Object.defineProperty(i[e],`channels`,{value:n[e].channels}),Object.defineProperty(i[e],`labels`,{value:n[e].labels});let t=r(e);Object.keys(t).forEach(n=>{let r=t[n];i[e][n]=s(r),i[e][n].raw=o(r)})}),t.exports=i})),oe=o(((e,t)=>{let n=(e,t)=>(...n)=>`\u001B[${e(...n)+t}m`,r=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};5;${r}m`},i=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},a=e=>e,o=(e,t,n)=>[e,t,n],s=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{let r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},c,l=(e,t,n,r)=>{c===void 0&&(c=ae());let i=r?10:0,a={};for(let[r,o]of Object.entries(c)){let s=r===`ansi16`?`ansi`:r;r===t?a[s]=e(n,i):typeof o==`object`&&(a[s]=e(o[t],i))}return a};function u(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[n,r]of Object.entries(t)){for(let[n,i]of Object.entries(r))t[n]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},r[n]=t[n],e.set(i[0],i[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,`codes`,{value:e,enumerable:!1}),t.color.close=`\x1B[39m`,t.bgColor.close=`\x1B[49m`,s(t.color,`ansi`,()=>l(n,`ansi16`,a,!1)),s(t.color,`ansi256`,()=>l(r,`ansi256`,a,!1)),s(t.color,`ansi16m`,()=>l(i,`rgb`,o,!1)),s(t.bgColor,`ansi`,()=>l(n,`ansi16`,a,!0)),s(t.bgColor,`ansi256`,()=>l(r,`ansi256`,a,!0)),s(t.bgColor,`ansi16m`,()=>l(i,`rgb`,o,!0)),t}Object.defineProperty(t,`exports`,{enumerable:!0,get:u})})),se=o(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),ce=o(((e,t)=>{let n=require(`node:os`),r=require(`node:tty`),i=se(),{env:a}=process,o;i(`no-color`)||i(`no-colors`)||i(`color=false`)||i(`color=never`)?o=0:(i(`color`)||i(`colors`)||i(`color=true`)||i(`color=always`))&&(o=1),`FORCE_COLOR`in a&&(o=a.FORCE_COLOR===`true`?1:a.FORCE_COLOR===`false`?0:a.FORCE_COLOR.length===0?1:Math.min(parseInt(a.FORCE_COLOR,10),3));function s(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e,t){if(o===0)return 0;if(i(`color=16m`)||i(`color=full`)||i(`color=truecolor`))return 3;if(i(`color=256`))return 2;if(e&&!t&&o===void 0)return 0;let r=o||0;if(a.TERM===`dumb`)return r;if(process.platform===`win32`){let e=n.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in a)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in a)||a.CI_NAME===`codeship`?1:r;if(`TEAMCITY_VERSION`in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if(a.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in a){let e=parseInt((a.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(a.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||`COLORTERM`in a?1:r}function l(e){return s(c(e,e&&e.isTTY))}t.exports={supportsColor:l,stdout:s(c(!0,r.isatty(1))),stderr:s(c(!0,r.isatty(2)))}})),le=o(((e,t)=>{t.exports={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.substr(a,r-a)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.substr(a),o},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
|
|
3
|
+
`:`
|
|
4
|
+
`)+n,i=r+1,r=e.indexOf(`
|
|
5
|
+
`,i)}while(r!==-1);return a+=e.substr(i),a}}})),ue=o(((e,t)=>{let n=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,a=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([[`n`,`
|
|
6
|
+
`],[`r`,`\r`],[`t`,` `],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`0`,`\0`],[`\\`,`\\`],[`e`,`\x1B`],[`a`,`\x07`]]);function s(e){let t=e[0]===`u`,n=e[1]===`{`;return t&&!n&&e.length===5||e[0]===`x`&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function c(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),o;for(let t of r){let r=Number(t);if(!Number.isNaN(r))n.push(r);else if(o=t.match(i))n.push(o[2].replace(a,(e,t,n)=>t?s(t):n));else throw Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}return n}function l(e){r.lastIndex=0;let t=[],n;for(;(n=r.exec(e))!==null;){let e=n[1];if(n[2]){let r=c(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function u(e,t){let n={};for(let e of t)for(let t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(let[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw Error(`Unknown Chalk style: ${e}`);r=t.length>0?r[e](...t):r[e]}return r}t.exports=(e,t)=>{let r=[],i=[],a=[];if(t.replace(n,(t,n,o,c,d,f)=>{if(n)a.push(s(n));else if(c){let t=a.join(``);a=[],i.push(r.length===0?t:u(e,r)(t)),r.push({inverse:o,styles:l(c)})}else if(d){if(r.length===0)throw Error(`Found extraneous } in Chalk template literal`);i.push(u(e,r)(a.join(``))),a=[],r.pop()}else a.push(f)}),i.push(a.join(``)),r.length>0){let e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?``:`s`} (\`}\`)`;throw Error(e)}return i.join(``)}})),de=o(((e,t)=>{let n=oe(),{stdout:r,stderr:i}=ce(),{stringReplaceAll:a,stringEncaseCRLFWithFirstIndex:o}=le(),{isArray:s}=Array,c=[`ansi`,`ansi`,`ansi256`,`ansi16m`],l=Object.create(null),u=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=r?r.level:0;e.level=t.level===void 0?n:t.level};var d=class{constructor(e){return f(e)}};let f=e=>{let t={};return u(t,e),t.template=(...e)=>_(t.template,...e),Object.setPrototypeOf(t,p.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=d,t.template};function p(e){return f(e)}for(let[e,t]of Object.entries(n))l[e]={get(){let n=ee(this,g(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};l.visible={get(){let e=ee(this,this._styler,!0);return Object.defineProperty(this,`visible`,{value:e}),e}};let m=[`rgb`,`hex`,`keyword`,`hsl`,`hsv`,`hwb`,`ansi`,`ansi256`];for(let e of m)l[e]={get(){let{level:t}=this;return function(...r){let i=g(n.color[c[t]][e](...r),n.color.close,this._styler);return ee(this,i,this._isEmpty)}}};for(let e of m){let t=`bg`+e[0].toUpperCase()+e.slice(1);l[t]={get(){let{level:t}=this;return function(...r){let i=g(n.bgColor[c[t]][e](...r),n.bgColor.close,this._styler);return ee(this,i,this._isEmpty)}}}}let h=Object.defineProperties(()=>{},{...l,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),g=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},ee=(e,t,n)=>{let r=(...e)=>s(e[0])&&s(e[0].raw)?te(r,_(r,...e)):te(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,h),r._generator=e,r._styler=t,r._isEmpty=n,r},te=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?``:t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.indexOf(`\x1B`)!==-1)for(;n!==void 0;)t=a(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
|
|
7
|
+
`);return s!==-1&&(t=o(t,i,r,s)),r+t+i},ne,_=(e,...t)=>{let[n]=t;if(!s(n)||!s(n.raw))return t.join(` `);let r=t.slice(1),i=[n.raw[0]];for(let e=1;e<n.length;e++)i.push(String(r[e-1]).replace(/[{}\\]/g,`\\$&`),String(n.raw[e]));return ne===void 0&&(ne=ue()),ne(e,i.join(``))};Object.defineProperties(p.prototype,l);let v=p();v.supportsColor=r,v.stderr=p({level:i?i.level:0}),v.stderr.supportsColor=i,t.exports=v})),fe=c(de(),1),pe={hex:e=>e=>e,bgHex:e=>({whiteBright:e=>e,white:e=>e}),white:e=>e,whiteBright:e=>e,gray:e=>e,bold:{hex:e=>e=>e,bgHex:e=>({whiteBright:e=>e,white:e=>e}),whiteBright:e=>e,white:e=>e},dim:{hex:e=>e=>e,gray:e=>e}},me=()=>{let e=fe.default;return(!e?.hex||!e?.bold?.hex||!e?.bgHex||!e?.whiteBright||!e?.white)&&(e=pe),e};function he(){return process.platform===`win32`?!!process.env.WT_SESSION||!!process.env.TERMINUS_SUBLIME||process.env.ConEmuTask===`{cmd::Cmder}`||process.env.TERM_PROGRAM===`Terminus-Sublime`||process.env.TERM_PROGRAM===`vscode`||process.env.TERM===`xterm-256color`||process.env.TERM===`alacritty`||process.env.TERM===`rxvt-unicode`||process.env.TERM===`rxvt-unicode-256color`||process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:process.env.TERM!==`linux`}var y={SILENT:0,FATAL:10,ERROR:20,WARN:30,SUCCESS:35,INFO:40,DEBUG:60,TRACE:70,ALL:100},b={SILENT:`silent`,FATAL:`fatal`,ERROR:`error`,WARN:`warn`,SUCCESS:`success`,INFO:`info`,DEBUG:`debug`,TRACE:`trace`,ALL:`all`},ge=(e,t)=>he()?e:t,_e={[b.ERROR]:ge(`✘`,`×`),[b.FATAL]:ge(`💀`,`×`),[b.WARN]:ge(`⚠`,`‼`),[b.INFO]:ge(`ℹ`,`i`),[b.SUCCESS]:ge(`✔`,`√`),[b.DEBUG]:ge(`🛠`,`D`),[b.TRACE]:ge(`🛠`,`T`),[b.ALL]:ge(`✉`,`→`)},ve=(e=new Date)=>`${e.toLocaleDateString()} ${e.toLocaleTimeString()}`,ye=e=>{switch(e){case`all`:return y.ALL;case`trace`:return y.TRACE;case`debug`:return y.DEBUG;case`info`:return y.INFO;case`warn`:return y.WARN;case`error`:return y.ERROR;case`fatal`:return y.FATAL;case`silent`:return y.SILENT;default:return y.INFO}},be=(e=y.INFO,t={},n=me())=>{let r=!t.colors?.dark&&!t.colors?.base&&!t.colors?.base?.dark?_:t.colors?.dark&&typeof t.colors.dark==`string`?t.colors:t.colors?.base?.dark&&typeof t.colors.base.dark==`string`?t.colors.base.dark:t.colors?.base?t.colors?.base:_,i=t.logLevel||process.env.STORM_LOG_LEVEL||b.INFO;return e>ye(i)||e<=y.SILENT||ye(i)<=y.SILENT?e=>{}:typeof e==`number`&&y.FATAL>=e?e=>{console.error(`
|
|
8
|
+
${n.gray(ve())} ${n.hex(r.fatal??_.dark.fatal)(`[${_e[b.FATAL]} Fatal] `)}${n.bold.whiteBright(Oe(e))}
|
|
9
|
+
`)}:typeof e==`number`&&y.ERROR>=e?e=>{console.error(`
|
|
10
|
+
${n.gray(ve())} ${n.hex(r.danger??_.dark.danger)(`[${_e[b.ERROR]} Error] `)}${n.bold.whiteBright(Oe(e))}
|
|
11
|
+
`)}:typeof e==`number`&&y.WARN>=e?e=>{console.warn(`
|
|
12
|
+
${n.gray(ve())} ${n.hex(r.warning??_.dark.warning)(`[${_e[b.WARN]} Warn] `)}${n.bold.whiteBright(Oe(e))}
|
|
13
|
+
`)}:typeof e==`number`&&y.SUCCESS>=e?e=>{console.info(`
|
|
14
|
+
${n.gray(ve())} ${n.hex(r.success??_.dark.success)(`[${_e[b.SUCCESS]} Success] `)}${n.bold.whiteBright(Oe(e))}
|
|
15
|
+
`)}:typeof e==`number`&&y.INFO>=e?e=>{console.info(`
|
|
16
|
+
${n.gray(ve())} ${n.hex(r.info??_.dark.info)(`[${_e[b.INFO]} Info] `)}${n.bold.whiteBright(Oe(e))}
|
|
17
|
+
`)}:typeof e==`number`&&y.DEBUG>=e?e=>{console.debug(`
|
|
18
|
+
${n.gray(ve())} ${n.hex(r.info??_.dark.info)(`[${_e[b.DEBUG]} Debug] `)}${n.bold.whiteBright(Oe(e))}
|
|
19
|
+
`)}:typeof e==`number`&&y.TRACE>=e?e=>{console.debug(`
|
|
20
|
+
${n.gray(ve())} ${n.hex(r.info??_.dark.info)(`[${_e[b.TRACE]} Trace] `)}${n.bold.whiteBright(Oe(e))}
|
|
21
|
+
`)}:e=>{console.log(`
|
|
22
|
+
${n.gray(ve())} ${n.hex(r.brand??_.dark.brand)(`[${_e[b.ALL]} System] `)}${n.bold.whiteBright(Oe(e))}
|
|
23
|
+
`)}},xe=(e,t)=>be(y.FATAL,t)(e),Se=(e,t)=>be(y.ERROR,t)(e),Ce=(e,t)=>be(y.WARN,t)(e),we=(e,t)=>be(y.INFO,t)(e),Te=(e,t)=>be(y.SUCCESS,t)(e),Ee=(e,t)=>be(y.TRACE,t)(e),De=4,Oe=(e,t={},n=0)=>{if(n>De)return`<max depth>`;let r=t.prefix??`-`,i=t.skip??[];return e==null||!e&&typeof e!=`boolean`?`<none>`:typeof e==`string`?e:Array.isArray(e)?`
|
|
24
|
+
${e.map((e,t)=>` ${r}> #${t} = ${Oe(e,{prefix:`${r}-`,skip:i},n+1)}`).join(`
|
|
25
|
+
`)}`:typeof e==`object`?`
|
|
26
|
+
${Object.keys(e).filter(e=>!i.includes(e)).map(t=>` ${r}> ${t} = ${ke(e[t])?`<function>`:typeof e[t]==`object`?Oe(e[t],{prefix:`${r}-`,skip:i},n+1):e[t]}`).join(`
|
|
27
|
+
`)}`:e},ke=e=>{try{return e instanceof Function||typeof e==`function`||!!(e?.constructor&&e?.call&&e?.apply)}catch{return!1}},Ae=e=>{xe(`Exiting script with an error status...`,e),process.exit(1)},je=e=>{Te(`Script completed successfully. Exiting...`,e),process.exit(0)},Me=e=>{Ee(`Using the following arguments to process the script: ${process.argv.join(`, `)}`,e),process.on(`unhandledRejection`,t=>{Se(`An Unhandled Rejection occurred while running the program: ${t}`,e),Ae(e)}),process.on(`uncaughtException`,t=>{Se(`An Uncaught Exception occurred while running the program: ${t.message}
|
|
28
|
+
Stacktrace: ${t.stack}`,e),Ae(e)}),process.on(`SIGTERM`,t=>{Se(`The program terminated with signal code: ${t}`,e),Ae(e)}),process.on(`SIGINT`,t=>{Se(`The program terminated with signal code: ${t}`,e),Ae(e)}),process.on(`SIGHUP`,t=>{Se(`The program terminated with signal code: ${t}`,e),Ae(e)})},Ne=30,Pe=0;function Fe(e,t=[],n=[]){let r=e??process.cwd();if(n.some(e=>(0,u.existsSync)((0,d.join)(r,e)))||t.some(e=>(0,u.existsSync)((0,d.join)(r,e))))return r;if(r!==`/`&&Pe++<Ne)return Fe((0,d.join)(r,`..`),t,n)}var Ie=/^[A-Za-z]:\//;function Le(e=``){return e&&e.replace(/\\/g,`/`).replace(Ie,e=>e.toUpperCase())}var Re=/^[/\\]{2}/,ze=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Be=/^[A-Za-z]:$/,Ve=function(e){if(!e||e.length===0)return`.`;e=Le(e);let t=e?.match(Re),n=Ue(e),r=e[e.length-1]===`/`;return e=He(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),Be.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!Ue(e)?`/${e}`:e)};function He(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}var Ue=function(e){return ze.test(e)},We=`storm-workspace.json,storm-workspace.yaml,storm-workspace.yml,storm-workspace.js,storm-workspace.ts,.storm-workspace.json,.storm-workspace.yaml,.storm-workspace.yml,.storm-workspace.js,.storm-workspace.ts,lerna.json,nx.json,turbo.json,npm-workspace.json,yarn-workspace.json,pnpm-workspace.json,npm-workspace.yaml,yarn-workspace.yaml,pnpm-workspace.yaml,npm-workspace.yml,yarn-workspace.yml,pnpm-workspace.yml,npm-lock.json,yarn-lock.json,pnpm-lock.json,npm-lock.yaml,yarn-lock.yaml,pnpm-lock.yaml,npm-lock.yml,yarn-lock.yml,pnpm-lock.yml,bun.lockb`.split(`,`),Ge=[`.storm-workspace`,`.nx`,`.git`,`.github`,`.vscode`,`.verdaccio`];function Ke(e){return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH?Ve(process.env.STORM_WORKSPACE_ROOT??process.env.NX_WORKSPACE_ROOT_PATH):Ve(Fe(e??process.cwd(),We,Ge))}var qe=o((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),Je=o((e=>{let{InvalidArgumentError:t}=qe();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),Ye=o((e=>{let{humanReadableArgName:t}=Je();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
29
|
+
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
30
|
+
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
31
|
+
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),Xe=o((e=>{let{InvalidArgumentError:t}=qe();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
32
|
+
- a short flag is a single dash and a single character
|
|
33
|
+
- either use a single dash and a single character (for a short flag)
|
|
34
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
|
|
35
|
+
- too many short flags`):i.test(t)?Error(`${n}
|
|
36
|
+
- too many long flags`):Error(`${n}
|
|
37
|
+
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),Ze=o((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),Qe=o((e=>{let t=require(`node:events`).EventEmitter,n=require(`node:child_process`),r=require(`node:path`),i=require(`node:fs`),a=require(`node:process`),{Argument:o,humanReadableArgName:s}=Je(),{CommanderError:c}=qe(),{Help:l,stripColor:u}=Ye(),{Option:d,DualOptions:f}=Xe(),{suggestSimilar:p}=Ze();var m=class e extends t{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>g()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>g()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:e=>u(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
38
|
+
- specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new o(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
39
|
+
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),a.exit(e)}action(e){return this._actionHandler=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new d(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
40
|
+
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof d)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){a.versions?.electron&&(t.from=`electron`);let e=a.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=a.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:a.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
41
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(i.existsSync(e))return;let r=`'${e}' does not exist
|
|
42
|
+
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
43
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
44
|
+
- ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let o=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function l(e,t){let n=r.resolve(e,t);if(i.existsSync(n))return n;if(s.includes(r.extname(t)))return;let a=s.find(e=>i.existsSync(`${n}${e}`));if(a)return`${n}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=l(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=l(d,`${n}-${e._name}`))}u=t||u}o=s.includes(r.extname(u));let f;a.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.execPath,t,{stdio:`inherit`})):o?(t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{a.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new c(e,`commander.executeSubCommandAsync`,`(close)`)):a.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)a.exit(1);else{let e=new c(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!==`default`});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
45
|
+
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in a.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,a.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new f(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=p(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=p(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>s(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=r.basename(e,r.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(a.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
46
|
+
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g})),$e=o((e=>{let{Argument:t}=Je(),{Command:n}=Qe(),{CommanderError:r,InvalidArgumentError:i}=qe(),{Help:a}=Ye(),{Option:o}=Xe();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})),et=c($e(),1);const{program:tt,createCommand:nt,createArgument:rt,createOption:it,CommanderError:at,InvalidArgumentError:ot,InvalidOptionArgumentError:st,Command:ct,Argument:lt,Option:ut,Help:dt}=et.default;var x=(e=>(e[e.VOID=0]=`VOID`,e[e.BIT=1]=`BIT`,e[e.BYTE=2]=`BYTE`,e[e.BYTE_2=3]=`BYTE_2`,e[e.BYTE_4=4]=`BYTE_4`,e[e.BYTE_8=5]=`BYTE_8`,e[e.POINTER=6]=`POINTER`,e[e.COMPOSITE=7]=`COMPOSITE`,e))(x||{});const ft=new DataView(new ArrayBuffer(8));new Uint16Array(ft.buffer)[0]=258;const pt=4096,mt=64<<20,ht=7,gt=8192,_t=2147483647,vt=4294967295,yt=4096,S=ft.getUint8(0)===2,bt=2,xt=4,St=3,Ct=2147483647,wt=4294967295,Tt=`CAPNP-TS000 Unreachable code detected.`;function Et(e){throw Error(`CAPNP-TS000 Unreachable code detected. (never block hit with: ${e})`)}const Dt=`CAPNP-TS001 Attempted to parse an invalid message frame header; are you sure this is a Cap'n Proto message?`,Ot=`CAPNP-TS003 Attempted to pack a message that was not word-aligned.`,kt=`CAPNP-TS004 Segment ID %X is out of bounds for message %s.`,At=`CAPNP-TS005 First segment must have at least enough room to hold the root pointer (8 bytes).`,jt=`CAPNP-TS008 Attempted to adopt %s into a pointer in a different message %s.`,Mt=`CAPNP-TS009 Attempted to adopt %s more than once.`,Nt=`CAPNP-TS010 Attempted to set a composite list without providing a composite element size.`,Pt=`CAPNP-TS011 Nesting depth limit exceeded for %s.`,Ft=`CAPNP-TS013 Attempted to initialize a struct member from a composite list (%s).`,It=`CAPNP-TS015 Target of a far pointer (%s) is another far pointer.`,Lt=`CAPNP-TS016 Invalid list element size: %x.`,Rt=`CAPNP-TS017 Invalid pointer type: %x.`,zt=`CAPNP-TS018 Attempted to access getter on %s for union field %s that is not currently set (wanted: %d, found: %d).`,Bt=`CAPNP-TS019 Pointer offset %a is out of bounds for underlying buffer.`,Vt=`CAPNP-TS020 Attempted to access out-of-bounds struct data (struct: %s, %d bytes at %a, data words: %d).`,Ht=`CAPNP-TS021 Attempted to access out-of-bounds struct pointer (%s, index: %d, length: %d).`,Ut=`CAPNP-TS022 Traversal limit exceeded! Slow down! %s`,Wt=`CAPNP-TS023 Cannot convert %s to a %s list.`,Gt=`CAPNP-TS024 Attempted to convert pointer %s to a %s type.`,Kt=`CAPNP-TS035 Attempted to get a segment other than 0 (%d) from a single segment arena.`,qt=`CAPNP-TS036 Attempted to get an out-of-bounds segment (%d).`,Jt=`CAPNP-TS037 Segment buffer length %d is not a multiple of 8.`,Yt=`CAPNP-TS038 Attempted to replace a segment buffer with one that is smaller than the allocated space.`,Xt=`CAPNP-TS039 Requested size %x exceeds maximum value (${wt}).`,Zt=`CAPNP-TS040 Must provide a composite element size for composite list pointers.`,Qt=`CAPNP-TS045: Cannot call mutative methods on an immutable list.`,$t=`CAPNP-TS046: Search is not supported for list.`;function en(e){let t=new Uint8Array(e),n=[];for(let e=0;e<t.byteLength;e++)n.push(nn(t[e].toString(16),2));return`[${n.join(` `)}]`}function tn(e){let t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=Math.min(t.byteLength,8192),r=C(`
|
|
47
|
+
=== buffer[%d] ===`,n);for(let e=0;e<n;e+=16){r+=`
|
|
48
|
+
${nn(e.toString(16),8)}: `;let n=``,i;for(i=0;i<16&&e+i<t.byteLength;i++){let a=t[e+i];r+=`${nn(a.toString(16),2)} `,n+=a>31&&a<255?String.fromCharCode(a):`·`,i===7&&(r+=` `)}r+=`${` `.repeat((17-i)*3)}${n}`}return r+=`
|
|
49
|
+
`,n!==t.byteLength&&(r+=C(`=== (truncated %d bytes) ===
|
|
50
|
+
`,t.byteLength-n)),r}function C(e,...t){let n=e.length,r,i=0,a,o=!1,s=0,c=!1,l,u=``;function d(){return t[i++]}function f(){let t=``;for(;/\d/.test(e[s]);)t+=e[s++],a=e[s];return t.length>0?Number.parseInt(t,10):null}for(;s<n;++s)if(a=e[s],o)switch(o=!1,a===`.`?(c=!1,a=e[++s]):a===`0`&&e[s+1]===`.`?(c=!0,s+=2,a=e[s]):c=!0,l=f(),a){case`a`:u+=`0x`+nn(Number.parseInt(String(d()),10).toString(16),8);break;case`b`:u+=Number.parseInt(String(d()),10).toString(2);break;case`c`:r=d(),u+=typeof r==`string`||r instanceof String?r:String.fromCharCode(Number.parseInt(String(r),10));break;case`d`:u+=Number.parseInt(String(d()),10);break;case`f`:{let e=Number.parseFloat(String(d())).toFixed(l||6);u+=c?e:e.replace(/^0/,``);break}case`j`:u+=JSON.stringify(d());break;case`o`:u+=`0`+Number.parseInt(String(d()),10).toString(8);break;case`s`:u+=d();break;case`x`:u+=`0x`+Number.parseInt(String(d()),10).toString(16);break;case`X`:u+=`0x`+Number.parseInt(String(d()),10).toString(16).toUpperCase();break;default:u+=a;break}else a===`%`?o=!0:u+=a;return u}function nn(e,t,n=`0`){return e.length>=t?e:Array.from({length:t-e.length+1}).join(n)+e}function rn(e){return e+7&-8}var w=class{constructor(e,t){this.dataByteLength=e,this.pointerLength=t}toString(){return C(`ObjectSize_dw:%d,pc:%d`,on(this),this.pointerLength)}};function an(e){return e.dataByteLength+e.pointerLength*8}function on(e){return e.dataByteLength/8}function sn(e){return e.dataByteLength/8+e.pointerLength}function cn(e){return new w(rn(e.dataByteLength),e.pointerLength)}var ln=class{_capnp;byteOffset;segment;constructor(e){let t=O(e);switch(this.segment=t.segment,this.byteOffset=t.byteOffset,this._capnp={},this._capnp.type=Mn(e),this._capnp.type){case A.STRUCT:this._capnp.size=Nn(e);break;case A.LIST:this._capnp.length=jn(e),this._capnp.elementSize=An(e),this._capnp.elementSize===x.COMPOSITE&&(this._capnp.size=kn(e));break;case A.OTHER:this._capnp.capId=vn(e);break;default:throw Error(Rt)}hn(e)}_moveTo(e){if(this._capnp===void 0)throw Error(C(`CAPNP-TS009 Attempted to adopt %s more than once.`,this));if(this.segment.message!==e.segment.message)throw Error(C(`CAPNP-TS008 Attempted to adopt %s into a pointer in a different message %s.`,this,e));mn(e);let t=Pn(this.segment,this.byteOffset,e);switch(this._capnp.type){case A.STRUCT:Bn(t.offsetWords,this._capnp.size,t.pointer);break;case A.LIST:{let{offsetWords:e}=t;this._capnp.elementSize===x.COMPOSITE&&e--,zn(e,this._capnp.elementSize,this._capnp.length,t.pointer,this._capnp.size);break}case A.OTHER:Ln(this._capnp.capId,t.pointer);break;default:throw Error(Rt)}this._capnp=void 0}dispose(){if(this._capnp!==void 0){switch(this._capnp.type){case A.STRUCT:this.segment.fillZeroWords(this.byteOffset,sn(this._capnp.size));break;case A.LIST:{let e=dn(this._capnp.elementSize,this._capnp.length,this._capnp.size);this.segment.fillZeroWords(this.byteOffset,e);break}}this._capnp=void 0}}[Symbol.for(`nodejs.util.inspect.custom`)](){return C(`Orphan_%d@%a,type:%s`,this.segment.id,this.byteOffset,this._capnp&&this._capnp.type)}};function T(e,t){e._moveTo(t)}function E(e){return new ln(e)}function un(e){return en(e.segment.buffer.slice(e.byteOffset,e.byteOffset+8))}function dn(e,t,n){switch(e){case x.BIT:return rn(t+7>>>3);case x.BYTE:case x.BYTE_2:case x.BYTE_4:case x.BYTE_8:case x.POINTER:case x.VOID:return rn(fn(e)*t);case x.COMPOSITE:if(n===void 0)throw Error(C(Lt,NaN));return t*rn(an(n));default:throw Error(Lt)}}function fn(e){switch(e){case x.BIT:return NaN;case x.BYTE:return 1;case x.BYTE_2:return 2;case x.BYTE_4:return 4;case x.BYTE_8:case x.POINTER:return 8;case x.COMPOSITE:return NaN;case x.VOID:return 0;default:throw Error(C(Lt,e))}}function pn(e,t){return new j(t.segment,t.byteOffset+e,t._capnp.depthLimit)}function D(e,t){if(!(t.segment===e.segment&&t.byteOffset===e.byteOffset)&&(mn(t),!k(e)))switch(Mn(e)){case A.STRUCT:Wn(e,t);break;case A.LIST:Un(e,t);break;case A.OTHER:Hn(e,t);break;default:throw Error(C(Rt,Mn(t)))}}function mn(e){if(k(e))return;let t;switch(Mn(e)){case A.STRUCT:{let n=Nn(e);t=O(e),t.segment.fillZeroWords(t.byteOffset,n.dataByteLength/8);for(let e=0;e<n.pointerLength;e++)mn(pn(e*8,t));break}case A.LIST:{let n=An(e),r=jn(e),i=rn(r*fn(n));if(t=O(e),n===x.POINTER){for(let n=0;n<r;n++)mn(new j(t.segment,t.byteOffset+n*8,e._capnp.depthLimit-1));break}else if(n===x.COMPOSITE){let n=pn(-8,t),a=Dn(n),o=an(a);i=Cn(n),t.segment.setWordZero(t.byteOffset-8);for(let n=0;n<r;n++)for(let r=0;r<a.pointerLength;r++)mn(new j(t.segment,t.byteOffset+n*o+r*8,e._capnp.depthLimit-1))}t.segment.fillZeroWords(t.byteOffset,i);break}case A.OTHER:break;default:throw Error(C(Rt,Mn(e)))}hn(e)}function hn(e){if(wn(e)===A.FAR){let t=gn(e);Fn(e)&&t.segment.setWordZero(t.byteOffset+8),t.segment.setWordZero(t.byteOffset)}e.segment.setWordZero(e.byteOffset)}function gn(e){return new j(e.segment.message.getSegment(e.segment.getUint32(e.byteOffset+4)),(e.segment.getUint32(e.byteOffset)>>>3)*8,e._capnp.depthLimit-1)}function _n(e){if(wn(e)===A.FAR){let t=gn(e);return Fn(e)&&(t.byteOffset+=8),t}return e}function vn(e){return e.segment.getUint32(e.byteOffset+4)}function yn(e){return Mn(e)===A.LIST&&An(e)===x.COMPOSITE}function O(e,t){let n;if(Fn(e)){let t=gn(e);n=new j(e.segment.message.getSegment(bn(t)),Cn(t)*8)}else{let t=_n(e);n=new j(t.segment,t.byteOffset+8+Cn(t)*8)}return yn(e)&&(n.byteOffset+=8),!t&&e._capnp.compositeIndex!==void 0&&(n.byteOffset-=8,n.byteOffset+=8+e._capnp.compositeIndex*an(cn(Dn(n)))),n}function bn(e){return e.segment.getUint32(e.byteOffset+4)}function xn(e){return e.segment.getUint32(e.byteOffset+4)&7}function Sn(e){return e.segment.getUint32(e.byteOffset+4)>>>3}function Cn(e){let t=e.segment.getInt32(e.byteOffset);return t&2?t>>3:t>>2}function wn(e){return e.segment.getUint32(e.byteOffset)&3}function Tn(e){return e.segment.getUint16(e.byteOffset+4)}function En(e){return e.segment.getUint16(e.byteOffset+6)}function Dn(e){return new w(Tn(e)*8,En(e))}function On(e){let t=O(e);return t.byteOffset-=8,t}function kn(e){return Dn(On(e))}function An(e){return xn(_n(e))}function jn(e){let t=_n(e);return xn(t)===x.COMPOSITE?Cn(On(e)):Sn(t)}function Mn(e){let t=wn(_n(e));if(t===A.FAR)throw Error(C(`CAPNP-TS015 Target of a far pointer (%s) is another far pointer.`,e));return t}function Nn(e){return Dn(_n(e))}function Pn(e,t,n){if(n.segment!==e){if(!e.hasCapacity(8)){let r=n.segment.allocate(16);return In(!0,r.byteOffset/8,r.segment.id,n),In(!1,t/8,e.id,r),r.byteOffset+=8,new Kn(r,0)}let r=e.allocate(8);if(r.segment.id!==e.id)throw Error(`CAPNP-TS000 Unreachable code detected.`);return In(!1,r.byteOffset/8,r.segment.id,n),new Kn(r,(t-r.byteOffset-8)/8)}return new Kn(n,(t-n.byteOffset-8)/8)}function Fn(e){return wn(e)===A.FAR&&(e.segment.getUint32(e.byteOffset)&4)!=0}function k(e){return e.segment.isWordZero(e.byteOffset)}function In(e,t,n,r){let i=A.FAR,a=e?1:0,o=t,s=n;r.segment.setUint32(r.byteOffset,i|a<<2|o<<3),r.segment.setUint32(r.byteOffset+4,s)}function Ln(e,t){t.segment.setUint32(t.byteOffset,A.OTHER),t.segment.setUint32(t.byteOffset+4,e)}function Rn(e){return e.segment.getUint32(e.byteOffset+4)}function zn(e,t,n,r,i){let a=A.LIST,o=e,s=t,c=n;if(t===x.COMPOSITE){if(i===void 0)throw TypeError(`CAPNP-TS040 Must provide a composite element size for composite list pointers.`);c*=sn(i)}r.segment.setUint32(r.byteOffset,a|o<<2),r.segment.setUint32(r.byteOffset+4,s|c<<3)}function Bn(e,t,n){let r=A.STRUCT,i=e,a=on(t),o=t.pointerLength;n.segment.setUint32(n.byteOffset,r|i<<2),n.segment.setUint16(n.byteOffset+4,a),n.segment.setUint16(n.byteOffset+6,o)}function Vn(e,t,n){if(k(t))return;let r=_n(t);if((r.segment.getUint32(r.byteOffset)&3)!==e)throw Error(C(`CAPNP-TS024 Attempted to convert pointer %s to a %s type.`,t,e));if(n!==void 0&&(r.segment.getUint32(r.byteOffset+4)&7)!==n)throw Error(C(`CAPNP-TS023 Cannot convert %s to a %s list.`,t,x[n]))}function Hn(e,t){let n=Rn(e);if(n<0)return;let r=e.segment.message._capnp.capTable;if(!r)return;let i=r[n];i&&Ln(t.segment.message.addCap(i),t)}function Un(e,t){if(t._capnp.depthLimit<=0)throw Error(Pt);let n=O(e),r=An(e),i=jn(e),a,o,s;if(r===x.POINTER){s=t.segment.allocate(i<<3);for(let r=0;r<i;r++)D(new j(n.segment,n.byteOffset+(r<<3),e._capnp.depthLimit-1),new j(s.segment,s.byteOffset+(r<<3),t._capnp.depthLimit-1))}else if(r===x.COMPOSITE){if(a=cn(kn(e)),o=an(a),s=t.segment.allocate(an(a)*i+8),s.segment.copyWord(s.byteOffset,n.segment,n.byteOffset-8),a.dataByteLength>0){let e=sn(a)*i;s.segment.copyWords(s.byteOffset+8,n.segment,n.byteOffset,e)}for(let r=0;r<i;r++)for(let i=0;i<a.pointerLength;i++){let c=r*o+a.dataByteLength+(i<<3);D(new j(n.segment,n.byteOffset+c,e._capnp.depthLimit-1),new j(s.segment,s.byteOffset+c+8,t._capnp.depthLimit-1))}}else{let e=rn(r===x.BIT?i+7>>>3:fn(r)*i),a=e>>>3;s=t.segment.allocate(e),s.segment.copyWords(s.byteOffset,n.segment,n.byteOffset,a)}let c=Pn(s.segment,s.byteOffset,t);zn(c.offsetWords,r,i,c.pointer,a)}function Wn(e,t){if(t._capnp.depthLimit<=0)throw Error(Pt);let n=O(e),r=Nn(e),i=on(r),a=t.segment.allocate(an(r));a.segment.copyWords(a.byteOffset,n.segment,n.byteOffset,i);for(let i=0;i<r.pointerLength;i++){let o=r.dataByteLength+i*8;D(new j(n.segment,n.byteOffset+o,e._capnp.depthLimit-1),new j(a.segment,a.byteOffset+o,t._capnp.depthLimit-1))}if(t._capnp.compositeList)return;let o=Pn(a.segment,a.byteOffset,t);Bn(o.offsetWords,r,o.pointer)}function Gn(e,t){if(e._capnp.traversalLimit-=8,e._capnp.traversalLimit<=0)throw Error(C(`CAPNP-TS022 Traversal limit exceeded! Slow down! %s`,t))}var Kn=class{constructor(e,t){this.pointer=e,this.offsetWords=t}},A=(e=>(e[e.STRUCT=0]=`STRUCT`,e[e.LIST=1]=`LIST`,e[e.FAR=2]=`FAR`,e[e.OTHER=3]=`OTHER`,e))(A||{}),j=class{static _capnp={displayName:`Pointer`};_capnp;byteOffset;segment;constructor(e,t,n=Ct){if(this._capnp={compositeList:!1,depthLimit:n},this.segment=e,this.byteOffset=t,n<1)throw Error(C(Pt,this));if(Gn(e.message,this),t<0||t>e.byteLength)throw Error(C(`CAPNP-TS019 Pointer offset %a is out of bounds for underlying buffer.`,t))}[Symbol.toStringTag](){return C(`Pointer_%d`,this.segment.id)}toString(){return C(`->%d@%a%s`,this.segment.id,this.byteOffset,un(this))}},qn=class e extends j{static _capnp={displayName:`List<Generic>`,size:x.VOID};constructor(t,n,r){return super(t,n,r),new Proxy(this,e.#e)}static#e={get(e,t,n){let r=Reflect.get(e,t,n);if(r!==void 0)return r;if(typeof t==`string`)return e.get(+t)}};get length(){return jn(this)}toArray(){let{length:e}=this,t=Array.from({length:e});for(let n=0;n<e;n++)t[n]=this.at(n);return t}get(e){throw TypeError(`Cannot get from a generic list.`)}set(e,t){throw TypeError(`Cannot set on a generic list.`)}at(e){return this.get(e<0?this.length+e:e)}concat(e){let{length:t}=this,n=e.length,r=Array.from({length:t+n});for(let e=0;e<t;e++)r[e]=this.at(e);for(let i=0;i<n;i++)r[i+t]=e.at(i);return r}some(e,t){for(let n=0;n<this.length;n++)if(e.call(t,this.at(n),n,this))return!0;return!1}filter(e,t){let n=[];for(let r=0;r<this.length;r++){let i=this.at(r);e.call(t,i,r,this)&&n.push(i)}return n}find(e,t){for(let n=0;n<this.length;n++){let r=this.at(n);if(e.call(t,r,n,this))return r}}findIndex(e,t){for(let n=0;n<this.length;n++){let r=this.at(n);if(e.call(t,r,n,this))return n}return-1}forEach(e,t){for(let n=0;n<this.length;n++)e.call(t,this.at(n),n,this)}map(e,t){let{length:n}=this,r=Array.from({length:n});for(let i=0;i<n;i++)r[i]=e.call(t,this.at(i),i,this);return r}flatMap(e,t){let n=[];for(let r=0;r<this.length;r++){let i=e.call(t,this.at(r),r,this);n.push(...Array.isArray(i)?i:[i])}return n}every(e,t){for(let n=0;n<this.length;n++)if(!e.call(t,this.at(n),n,this))return!1;return!0}reduce(e,t){let n=0,r;for(t===void 0?(r=this.at(0),n++):r=t;n<this.length;n++)r=e(r,this.at(n),n,this);return r}reduceRight(e,t){let n=this.length-1,r;for(t===void 0?(r=this.at(n),n--):r=t;n>=0;n--)r=e(r,this.at(n),n,this);return r}slice(e=0,t){let n=t?Math.min(this.length,t):this.length,r=Array.from({length:n-e});for(let t=e;t<n;t++)r[t]=this.at(t);return r}join(e){return this.toArray().join(e)}toReversed(){return this.toArray().reverse()}toSorted(e){return this.toArray().sort(e)}toSpliced(e,t,...n){return this.toArray().splice(e,t,...n)}fill(e,t,n){let{length:r}=this,i=Math.max(t??0,0),a=Math.min(n??r,r);for(let t=i;t<a;t++)this.set(t,e);return this}copyWithin(e,t,n){let{length:r}=this,i=n??r,a=t<0?Math.max(r+t,0):t,o=e<0?Math.max(r+e,0):e,s=Math.min(i-a,r-o);for(let e=0;e<s;e++)this.set(o+e,this.at(a+e));return this}keys(){return Array.from({length:this.length},(e,t)=>t)[Symbol.iterator]()}values(){return this.toArray().values()}entries(){return this.toArray().entries()}flat(e){return this.toArray().flat(e)}with(e,t){return this.toArray().with(e,t)}includes(e,t){throw Error($t)}findLast(e,t){throw Error($t)}findLastIndex(e,t){throw Error($t)}indexOf(e,t){throw Error($t)}lastIndexOf(e,t){throw Error($t)}pop(){throw Error(Qt)}push(...e){throw Error(Qt)}reverse(){throw Error(Qt)}shift(){throw Error(Qt)}unshift(...e){throw Error(Qt)}splice(e,t,...n){throw Error(Qt)}sort(e){throw Error(Qt)}get[Symbol.unscopables](){return Array.prototype[Symbol.unscopables]}[Symbol.iterator](){return this.values()}toJSON(){return this.toArray()}toString(){return this.join(`,`)}toLocaleString(e,t){return this.toString()}[Symbol.toStringTag](){return`[object Array]`}static[Symbol.toStringTag](){return this._capnp.displayName}};function Jn(e,t,n,r){let i;switch(e){case x.BIT:i=n.segment.allocate(Math.ceil(t/8));break;case x.BYTE:case x.BYTE_2:case x.BYTE_4:case x.BYTE_8:case x.POINTER:i=n.segment.allocate(t*fn(e));break;case x.COMPOSITE:{if(r===void 0)throw Error(C(`CAPNP-TS010 Attempted to set a composite list without providing a composite element size.`));r=cn(r);let e=an(r)*t;i=n.segment.allocate(e+8),Bn(t,r,i);break}case x.VOID:zn(0,e,t,n);return;default:throw Error(C(Lt,e))}let a=Pn(i.segment,i.byteOffset,n);zn(a.offsetWords,e,t,a.pointer,r)}var Yn=class extends qn{static fromPointer(e){return Vn(A.LIST,e,x.BYTE),this._fromPointerUnchecked(e)}static _fromPointerUnchecked(e){return new this(e.segment,e.byteOffset,e._capnp.depthLimit)}copyBuffer(e){let t=O(this),n=this.length,r=e.byteLength,i=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,Math.min(n,r)),a=new Uint8Array(t.segment.buffer,t.byteOffset,this.length);a.set(i),n>r&&a.fill(0,r,n)}get(e){let t=O(this);return t.segment.getUint8(t.byteOffset+e)}set(e,t){let n=O(this);n.segment.setUint8(n.byteOffset+e,t)}toArrayBuffer(){let e=O(this);return e.segment.buffer.slice(e.byteOffset,e.byteOffset+this.length)}toDataView(){let e=O(this);return new DataView(e.segment.buffer,e.byteOffset,this.length)}[Symbol.toStringTag](){return`Data_${super.toString()}`}toUint8Array(){let e=O(this);return new Uint8Array(e.segment.buffer,e.byteOffset,this.length)}};const Xn=new TextEncoder,Zn=new TextDecoder;var Qn=class extends qn{static fromPointer(e){return Vn(A.LIST,e,x.BYTE),$n(e)}get(e=0){if(k(this))return``;let t=O(this);return Zn.decode(new Uint8Array(t.segment.buffer,t.byteOffset+e,this.length-e))}get length(){return super.length-1}set(e,t){let n=Xn.encode(t),r=n.byteLength+e,i,a;if(!k(this)){i=O(this);let t=Math.min(this.length,e);a=new Uint8Array(i.segment.buffer.slice(i.byteOffset,i.byteOffset+t)),mn(this)}Jn(x.BYTE,r+1,this),i=O(this);let o=new Uint8Array(i.segment.buffer,i.byteOffset,r);a&&o.set(a),o.set(n,e)}toString(){return this.get()}toJSON(){return this.get()}[Symbol.toPrimitive](){return this.get()}[Symbol.toStringTag](){return`Text_${super.toString()}`}};function $n(e){return new Qn(e.segment,e.byteOffset,e._capnp.depthLimit)}var M=class extends j{static _capnp={displayName:`Struct`};constructor(e,t,n=Ct,r){super(e,t,n),this._capnp.compositeIndex=r,this._capnp.compositeList=r!==void 0}static[Symbol.toStringTag](){return this._capnp.displayName}[Symbol.toStringTag](){return`Struct_${super.toString()}${this._capnp.compositeIndex===void 0?``:`,ci:${this._capnp.compositeIndex}`} > ${O(this).toString()}`}},er=class extends M{static _capnp={displayName:`AnyStruct`,id:`0`,size:new w(0,0)}};const N=new DataView(new ArrayBuffer(8));function tr(e,t){if(t._capnp.compositeIndex!==void 0)throw Error(C(`CAPNP-TS013 Attempted to initialize a struct member from a composite list (%s).`,t));mn(t);let n=t.segment.allocate(an(e)),r=Pn(n.segment,n.byteOffset,t);Bn(r.offsetWords,e,r.pointer)}function P(e,t,n){let r=dr(e,t,n);return tr(t._capnp.size,r),r}function nr(e,t){let{pointerLength:n}=pr(t);if(e<0||e>=n)throw Error(C(`CAPNP-TS021 Attempted to access out-of-bounds struct pointer (%s, index: %d, length: %d).`,t,e,n))}function rr(e,t){let n=pr(t),r=O(t),i=t.segment.allocate(an(e));i.segment.copyWords(i.byteOffset,r.segment,r.byteOffset,Math.min(on(n),on(e)));let a=Pn(i.segment,i.byteOffset,t);Bn(a.offsetWords,e,a.pointer);for(let t=0;t<Math.min(n.pointerLength,e.pointerLength);t++){let a=new j(r.segment,r.byteOffset+n.dataByteLength+t*8);if(k(a))continue;let o=_n(a),s=O(a),c=new j(i.segment,i.byteOffset+e.dataByteLength+t*8);Mn(a)===A.LIST&&An(a)===x.COMPOSITE&&(s.byteOffset-=8);let l=Pn(s.segment,s.byteOffset,c),u=o.segment.getUint8(o.byteOffset)&3,d=o.segment.getUint32(o.byteOffset+4);l.pointer.segment.setUint32(l.pointer.byteOffset,u|l.offsetWords<<2),l.pointer.segment.setUint32(l.pointer.byteOffset+4,d)}r.segment.fillZeroWords(r.byteOffset,sn(n))}function F(e,t){return new e(t.segment,t.byteOffset,t._capnp.depthLimit,t._capnp.compositeIndex)}function I(e,t,n){let r=Math.floor(e/8),i=1<<e%8;K(r,1,t);let a=L(t),o=a.segment.getUint8(a.byteOffset+r);return n===void 0?(o&i)!==0:((o^n.getUint8(0))&i)!==0}function ir(e,t,n){nr(e,t);let r=fr(t);r.byteOffset+=e*8;let i=new Yn(r.segment,r.byteOffset,t._capnp.depthLimit-1);return k(i)&&(n?D(n,i):Jn(x.BYTE,0,i)),i}function L(e){return O(e)}function ar(e,t,n){K(e,4,t);let r=L(t);if(n===void 0)return r.segment.getFloat32(r.byteOffset+e);let i=r.segment.getUint32(r.byteOffset+e)^n.getUint32(0,!0);return N.setUint32(0,i,S),N.getFloat32(0,S)}function or(e,t,n){K(e,8,t);let r=L(t);if(n!==void 0){let t=r.segment.getUint32(r.byteOffset+e)^n.getUint32(0,!0),i=r.segment.getUint32(r.byteOffset+e+4)^n.getUint32(4,!0);return N.setUint32(0,t,S),N.setUint32(4,i,S),N.getFloat64(0,S)}return r.segment.getFloat64(r.byteOffset+e)}function sr(e,t,n){K(e,2,t);let r=L(t);if(n===void 0)return r.segment.getInt16(r.byteOffset+e);let i=r.segment.getUint16(r.byteOffset+e)^n.getUint16(0,!0);return N.setUint16(0,i,S),N.getInt16(0,S)}function cr(e,t,n){K(e,4,t);let r=L(t);if(n===void 0)return r.segment.getInt32(r.byteOffset+e);let i=r.segment.getUint32(r.byteOffset+e)^n.getUint16(0,!0);return N.setUint32(0,i,S),N.getInt32(0,S)}function lr(e,t,n){K(e,8,t);let r=L(t);if(n!==void 0){let t=r.segment.getUint32(r.byteOffset+e)^n.getUint32(0,!0),i=r.segment.getUint32(r.byteOffset+e+4)^n.getUint32(4,!0);return N.setUint32(S?0:4,t,S),N.setUint32(S?4:0,i,S),N.getBigInt64(0,S)}return r.segment.getInt64(r.byteOffset+e)}function ur(e,t,n){K(e,1,t);let r=L(t);if(n===void 0)return r.segment.getInt8(r.byteOffset+e);let i=r.segment.getUint8(r.byteOffset+e)^n.getUint8(0);return N.setUint8(0,i),N.getInt8(0)}function R(e,t,n,r){nr(e,n);let i=fr(n);i.byteOffset+=e*8;let a=new t(i.segment,i.byteOffset,n._capnp.depthLimit-1);if(k(a))r?D(r,a):Jn(t._capnp.size,0,a,t._capnp.compositeSize);else if(t._capnp.compositeSize!==void 0){let e=kn(a),n=t._capnp.compositeSize;if(n.dataByteLength>e.dataByteLength||n.pointerLength>e.pointerLength){let r=O(a),i=jn(a),o=a.segment.allocate(an(n)*i+8),s=Pn(o.segment,o.byteOffset,a);zn(s.offsetWords,t._capnp.size,i,s.pointer,n),Bn(i,n,o),o.byteOffset+=8;for(let t=0;t<i;t++){let i=r.byteOffset+t*an(e),a=o.byteOffset+t*an(n);o.segment.copyWords(a,r.segment,i,sn(e));for(let t=0;t<e.pointerLength;t++){let s=new j(r.segment,i+e.dataByteLength+t*8),c=new j(o.segment,a+n.dataByteLength+t*8),l=_n(s),u=O(s);Mn(s)===A.LIST&&An(s)===x.COMPOSITE&&(u.byteOffset-=8);let d=Pn(u.segment,u.byteOffset,c),f=l.segment.getUint8(l.byteOffset)&3,p=l.segment.getUint32(l.byteOffset+4);d.pointer.segment.setUint32(d.pointer.byteOffset,f|d.offsetWords<<2),d.pointer.segment.setUint32(d.pointer.byteOffset+4,p)}}r.segment.fillZeroWords(r.byteOffset,sn(e)*i)}}return a}function z(e,t){nr(e,t);let n=fr(t);return n.byteOffset+=e*8,new j(n.segment,n.byteOffset,t._capnp.depthLimit-1)}function dr(e,t,n){nr(e,n);let r=fr(n);return r.byteOffset+=e*8,new t(r.segment,r.byteOffset,n._capnp.depthLimit-1)}function fr(e){let t=O(e);return t.byteOffset+=rn(pr(e).dataByteLength),t}function pr(e){if(e._capnp.compositeIndex!==void 0){let t=O(e,!0);return t.byteOffset-=8,Dn(t)}return Nn(e)}function mr(e,t,n,r){let i=dr(e,t,n);if(k(i))r?D(r,i):tr(t._capnp.size,i);else{Vn(A.STRUCT,i);let e=Nn(i);(e.dataByteLength<t._capnp.size.dataByteLength||e.pointerLength<t._capnp.size.pointerLength)&&rr(t._capnp.size,i)}return i}function hr(e,t,n){let r=Qn.fromPointer(z(e,t));return k(r)&&n&&r.set(0,n),r.get(0)}function B(e,t,n){K(e,2,t);let r=L(t);return n===void 0?r.segment.getUint16(r.byteOffset+e):r.segment.getUint16(r.byteOffset+e)^n.getUint16(0,!0)}function gr(e,t,n){K(e,4,t);let r=L(t);return n===void 0?r.segment.getUint32(r.byteOffset+e):r.segment.getUint32(r.byteOffset+e)^n.getUint32(0,!0)}function V(e,t,n){K(e,8,t);let r=L(t);if(n!==void 0){let t=r.segment.getUint32(r.byteOffset+e)^n.getUint32(0,!0),i=r.segment.getUint32(r.byteOffset+e+4)^n.getUint32(4,!0);return N.setUint32(S?0:4,t,S),N.setUint32(S?4:0,i,S),N.getBigUint64(0,S)}return r.segment.getUint64(r.byteOffset+e)}function _r(e,t,n){K(e,1,t);let r=L(t);return n===void 0?r.segment.getUint8(r.byteOffset+e):r.segment.getUint8(r.byteOffset+e)^n.getUint8(0)}function vr(e,t,n){nr(e,n);let r=fr(n);r.byteOffset+=e*8;let i=new Yn(r.segment,r.byteOffset,n._capnp.depthLimit-1);return mn(i),Jn(x.BYTE,t,i),i}function H(e,t,n,r){nr(e,r);let i=fr(r);i.byteOffset+=e*8;let a=new t(i.segment,i.byteOffset,r._capnp.depthLimit-1);return mn(a),Jn(t._capnp.size,n,a,t._capnp.compositeSize),a}function yr(e,t,n,r){let i=Math.floor(e/8),a=1<<e%8;K(i,1,n);let o=L(n),s=o.segment.getUint8(o.byteOffset+i);r!==void 0&&(t=(r.getUint8(0)&a)===0?t:!t),o.segment.setUint8(o.byteOffset+i,t?s|a:s&~a)}function br(e,t,n,r){K(e,4,n);let i=L(n);if(r!==void 0){N.setFloat32(0,t,S);let n=N.getUint32(0,S)^r.getUint32(0,!0);i.segment.setUint32(i.byteOffset+e,n);return}i.segment.setFloat32(i.byteOffset+e,t)}function xr(e,t,n,r){K(e,8,n);let i=L(n);if(r!==void 0){N.setFloat64(0,t,S);let n=N.getUint32(0,S)^r.getUint32(0,!0),a=N.getUint32(4,S)^r.getUint32(4,!0);i.segment.setUint32(i.byteOffset+e,n),i.segment.setUint32(i.byteOffset+e+4,a);return}i.segment.setFloat64(i.byteOffset+e,t)}function Sr(e,t,n,r){K(e,2,n);let i=L(n);if(r!==void 0){N.setInt16(0,t,S);let n=N.getUint16(0,S)^r.getUint16(0,!0);i.segment.setUint16(i.byteOffset+e,n);return}i.segment.setInt16(i.byteOffset+e,t)}function Cr(e,t,n,r){K(e,4,n);let i=L(n);if(r!==void 0){N.setInt32(0,t,S);let n=N.getUint32(0,S)^r.getUint32(0,!0);i.segment.setUint32(i.byteOffset+e,n);return}i.segment.setInt32(i.byteOffset+e,t)}function wr(e,t,n,r){K(e,8,n);let i=L(n);if(r!==void 0){N.setBigInt64(0,t,S);let n=N.getUint32(S?0:4,S)^r.getUint32(0,!0),a=N.getUint32(S?4:0,S)^r.getUint32(4,!0);i.segment.setUint32(i.byteOffset+e,n),i.segment.setUint32(i.byteOffset+e+4,a);return}i.segment.setInt64(i.byteOffset+e,t)}function Tr(e,t,n,r){K(e,1,n);let i=L(n);if(r!==void 0){N.setInt8(0,t);let n=N.getUint8(0)^r.getUint8(0);i.segment.setUint8(i.byteOffset+e,n);return}i.segment.setInt8(i.byteOffset+e,t)}function Er(e,t,n){Qn.fromPointer(z(e,n)).set(0,t)}function U(e,t,n,r){K(e,2,n);let i=L(n);r!==void 0&&(t^=r.getUint16(0,!0)),i.segment.setUint16(i.byteOffset+e,t)}function Dr(e,t,n,r){K(e,4,n);let i=L(n);r!==void 0&&(t^=r.getUint32(0,!0)),i.segment.setUint32(i.byteOffset+e,t)}function W(e,t,n,r){K(e,8,n);let i=L(n);if(r!==void 0){N.setBigUint64(0,t,S);let n=N.getUint32(S?0:4,S)^r.getUint32(0,!0),a=N.getUint32(S?4:0,S)^r.getUint32(4,!0);i.segment.setUint32(i.byteOffset+e,n),i.segment.setUint32(i.byteOffset+e+4,a);return}i.segment.setUint64(i.byteOffset+e,t)}function Or(e,t,n,r){K(e,1,n);let i=L(n);r!==void 0&&(t^=r.getUint8(0)),i.segment.setUint8(i.byteOffset+e,t)}function G(e,t,n,r){if(t!==n)throw Error(C(`CAPNP-TS018 Attempted to access getter on %s for union field %s that is not currently set (wanted: %d, found: %d).`,r,e,t,n))}function K(e,t,n){let{dataByteLength:r}=pr(n);if(e<0||t<0||e+t>r)throw Error(C(`CAPNP-TS020 Attempted to access out-of-bounds struct data (struct: %s, %d bytes at %a, data words: %d).`,n,t,e,r))}function q(e){return class extends qn{static _capnp={compositeSize:e._capnp.size,displayName:`List<${e._capnp.displayName}>`,size:x.COMPOSITE};get(t){return new e(this.segment,this.byteOffset,this._capnp.depthLimit-1,t)}set(e,t){D(t,this.get(e))}[Symbol.toStringTag](){return`Composite_${super.toString()},cls:${e.toString()}`}}}function kr(e,t){return n=>{let r=new DataView(new ArrayBuffer(e));return t.call(r,0,n,!0),r}}const Ar=kr(4,DataView.prototype.setFloat32),jr=kr(8,DataView.prototype.setFloat64),Mr=kr(2,DataView.prototype.setInt16),Nr=kr(4,DataView.prototype.setInt32),Pr=kr(8,DataView.prototype.setBigInt64),Fr=kr(1,DataView.prototype.setInt8),Ir=kr(2,DataView.prototype.setUint16),Lr=kr(4,DataView.prototype.setUint32),Rr=kr(8,DataView.prototype.setBigUint64),zr=kr(1,DataView.prototype.setUint8);var Br=class extends M{static _capnp={displayName:`Parameter`,id:`b9521bccf10fa3b1`,size:new w(0,1)};get name(){return hr(0,this)}set name(e){Er(0,e,this)}toString(){return`Node_Parameter_`+super.toString()}},Vr=class extends M{static _capnp={displayName:`NestedNode`,id:`debf55bbfa0fc242`,size:new w(8,1)};get name(){return hr(0,this)}set name(e){Er(0,e,this)}get id(){return V(0,this)}set id(e){W(0,e,this)}toString(){return`Node_NestedNode_`+super.toString()}},Hr=class extends M{static _capnp={displayName:`Member`,id:`c2ba9038898e1fa2`,size:new w(0,1)};get docComment(){return hr(0,this)}set docComment(e){Er(0,e,this)}toString(){return`Node_SourceInfo_Member_`+super.toString()}},Ur=class e extends M{static Member=Hr;static _capnp={displayName:`SourceInfo`,id:`f38e1de3041357ae`,size:new w(8,2)};static _Members;get id(){return V(0,this)}set id(e){W(0,e,this)}get docComment(){return hr(0,this)}set docComment(e){Er(0,e,this)}_adoptMembers(e){T(e,z(1,this))}_disownMembers(){return E(this.members)}get members(){return R(1,e._Members,this)}_hasMembers(){return!k(z(1,this))}_initMembers(t){return H(1,e._Members,t,this)}set members(e){D(e,z(1,this))}toString(){return`Node_SourceInfo_`+super.toString()}},Wr=class e extends M{static _capnp={displayName:`struct`,id:`9ea0b19b37fb4435`,size:new w(40,6)};static _Fields;get dataWordCount(){return B(14,this)}set dataWordCount(e){U(14,e,this)}get pointerCount(){return B(24,this)}set pointerCount(e){U(24,e,this)}get preferredListEncoding(){return B(26,this)}set preferredListEncoding(e){U(26,e,this)}get isGroup(){return I(224,this)}set isGroup(e){yr(224,e,this)}get discriminantCount(){return B(30,this)}set discriminantCount(e){U(30,e,this)}get discriminantOffset(){return gr(32,this)}set discriminantOffset(e){Dr(32,e,this)}_adoptFields(e){T(e,z(3,this))}_disownFields(){return E(this.fields)}get fields(){return R(3,e._Fields,this)}_hasFields(){return!k(z(3,this))}_initFields(t){return H(3,e._Fields,t,this)}set fields(e){D(e,z(3,this))}toString(){return`Node_Struct_`+super.toString()}},Gr=class e extends M{static _capnp={displayName:`enum`,id:`b54ab3364333f598`,size:new w(40,6)};static _Enumerants;_adoptEnumerants(e){T(e,z(3,this))}_disownEnumerants(){return E(this.enumerants)}get enumerants(){return R(3,e._Enumerants,this)}_hasEnumerants(){return!k(z(3,this))}_initEnumerants(t){return H(3,e._Enumerants,t,this)}set enumerants(e){D(e,z(3,this))}toString(){return`Node_Enum_`+super.toString()}},Kr=class e extends M{static _capnp={displayName:`interface`,id:`e82753cff0c2218f`,size:new w(40,6)};static _Methods;static _Superclasses;_adoptMethods(e){T(e,z(3,this))}_disownMethods(){return E(this.methods)}get methods(){return R(3,e._Methods,this)}_hasMethods(){return!k(z(3,this))}_initMethods(t){return H(3,e._Methods,t,this)}set methods(e){D(e,z(3,this))}_adoptSuperclasses(e){T(e,z(4,this))}_disownSuperclasses(){return E(this.superclasses)}get superclasses(){return R(4,e._Superclasses,this)}_hasSuperclasses(){return!k(z(4,this))}_initSuperclasses(t){return H(4,e._Superclasses,t,this)}set superclasses(e){D(e,z(4,this))}toString(){return`Node_Interface_`+super.toString()}},qr=class extends M{static _capnp={displayName:`const`,id:`b18aa5ac7a0d9420`,size:new w(40,6)};_adoptType(e){T(e,z(3,this))}_disownType(){return E(this.type)}get type(){return mr(3,Y,this)}_hasType(){return!k(z(3,this))}_initType(){return P(3,Y,this)}set type(e){D(e,z(3,this))}_adoptValue(e){T(e,z(4,this))}_disownValue(){return E(this.value)}get value(){return mr(4,Z,this)}_hasValue(){return!k(z(4,this))}_initValue(){return P(4,Z,this)}set value(e){D(e,z(4,this))}toString(){return`Node_Const_`+super.toString()}},Jr=class extends M{static _capnp={displayName:`annotation`,id:`ec1619d4400a0290`,size:new w(40,6)};_adoptType(e){T(e,z(3,this))}_disownType(){return E(this.type)}get type(){return mr(3,Y,this)}_hasType(){return!k(z(3,this))}_initType(){return P(3,Y,this)}set type(e){D(e,z(3,this))}get targetsFile(){return I(112,this)}set targetsFile(e){yr(112,e,this)}get targetsConst(){return I(113,this)}set targetsConst(e){yr(113,e,this)}get targetsEnum(){return I(114,this)}set targetsEnum(e){yr(114,e,this)}get targetsEnumerant(){return I(115,this)}set targetsEnumerant(e){yr(115,e,this)}get targetsStruct(){return I(116,this)}set targetsStruct(e){yr(116,e,this)}get targetsField(){return I(117,this)}set targetsField(e){yr(117,e,this)}get targetsUnion(){return I(118,this)}set targetsUnion(e){yr(118,e,this)}get targetsGroup(){return I(119,this)}set targetsGroup(e){yr(119,e,this)}get targetsInterface(){return I(120,this)}set targetsInterface(e){yr(120,e,this)}get targetsMethod(){return I(121,this)}set targetsMethod(e){yr(121,e,this)}get targetsParam(){return I(122,this)}set targetsParam(e){yr(122,e,this)}get targetsAnnotation(){return I(123,this)}set targetsAnnotation(e){yr(123,e,this)}toString(){return`Node_Annotation_`+super.toString()}};const Yr={FILE:0,STRUCT:1,ENUM:2,INTERFACE:3,CONST:4,ANNOTATION:5};var Xr=class e extends M{static FILE=Yr.FILE;static STRUCT=Yr.STRUCT;static ENUM=Yr.ENUM;static INTERFACE=Yr.INTERFACE;static CONST=Yr.CONST;static ANNOTATION=Yr.ANNOTATION;static Parameter=Br;static NestedNode=Vr;static SourceInfo=Ur;static _capnp={displayName:`Node`,id:`e682ab4cf923a417`,size:new w(40,6)};static _Parameters;static _NestedNodes;static _Annotations;get id(){return V(0,this)}set id(e){W(0,e,this)}get displayName(){return hr(0,this)}set displayName(e){Er(0,e,this)}get displayNamePrefixLength(){return gr(8,this)}set displayNamePrefixLength(e){Dr(8,e,this)}get scopeId(){return V(16,this)}set scopeId(e){W(16,e,this)}_adoptParameters(e){T(e,z(5,this))}_disownParameters(){return E(this.parameters)}get parameters(){return R(5,e._Parameters,this)}_hasParameters(){return!k(z(5,this))}_initParameters(t){return H(5,e._Parameters,t,this)}set parameters(e){D(e,z(5,this))}get isGeneric(){return I(288,this)}set isGeneric(e){yr(288,e,this)}_adoptNestedNodes(e){T(e,z(1,this))}_disownNestedNodes(){return E(this.nestedNodes)}get nestedNodes(){return R(1,e._NestedNodes,this)}_hasNestedNodes(){return!k(z(1,this))}_initNestedNodes(t){return H(1,e._NestedNodes,t,this)}set nestedNodes(e){D(e,z(1,this))}_adoptAnnotations(e){T(e,z(2,this))}_disownAnnotations(){return E(this.annotations)}get annotations(){return R(2,e._Annotations,this)}_hasAnnotations(){return!k(z(2,this))}_initAnnotations(t){return H(2,e._Annotations,t,this)}set annotations(e){D(e,z(2,this))}get _isFile(){return B(12,this)===0}set file(e){U(12,0,this)}get struct(){return G(`struct`,B(12,this),1,this),F(Wr,this)}_initStruct(){return U(12,1,this),F(Wr,this)}get _isStruct(){return B(12,this)===1}set struct(e){U(12,1,this)}get enum(){return G(`enum`,B(12,this),2,this),F(Gr,this)}_initEnum(){return U(12,2,this),F(Gr,this)}get _isEnum(){return B(12,this)===2}set enum(e){U(12,2,this)}get interface(){return G(`interface`,B(12,this),3,this),F(Kr,this)}_initInterface(){return U(12,3,this),F(Kr,this)}get _isInterface(){return B(12,this)===3}set interface(e){U(12,3,this)}get const(){return G(`const`,B(12,this),4,this),F(qr,this)}_initConst(){return U(12,4,this),F(qr,this)}get _isConst(){return B(12,this)===4}set const(e){U(12,4,this)}get annotation(){return G(`annotation`,B(12,this),5,this),F(Jr,this)}_initAnnotation(){return U(12,5,this),F(Jr,this)}get _isAnnotation(){return B(12,this)===5}set annotation(e){U(12,5,this)}toString(){return`Node_`+super.toString()}which(){return B(12,this)}},Zr=class extends M{static _capnp={displayName:`slot`,id:`c42305476bb4746f`,size:new w(24,4)};get offset(){return gr(4,this)}set offset(e){Dr(4,e,this)}_adoptType(e){T(e,z(2,this))}_disownType(){return E(this.type)}get type(){return mr(2,Y,this)}_hasType(){return!k(z(2,this))}_initType(){return P(2,Y,this)}set type(e){D(e,z(2,this))}_adoptDefaultValue(e){T(e,z(3,this))}_disownDefaultValue(){return E(this.defaultValue)}get defaultValue(){return mr(3,Z,this)}_hasDefaultValue(){return!k(z(3,this))}_initDefaultValue(){return P(3,Z,this)}set defaultValue(e){D(e,z(3,this))}get hadExplicitDefault(){return I(128,this)}set hadExplicitDefault(e){yr(128,e,this)}toString(){return`Field_Slot_`+super.toString()}},Qr=class extends M{static _capnp={displayName:`group`,id:`cafccddb68db1d11`,size:new w(24,4)};get typeId(){return V(16,this)}set typeId(e){W(16,e,this)}toString(){return`Field_Group_`+super.toString()}};const $r={IMPLICIT:0,EXPLICIT:1};var ei=class extends M{static IMPLICIT=$r.IMPLICIT;static EXPLICIT=$r.EXPLICIT;static _capnp={displayName:`ordinal`,id:`bb90d5c287870be6`,size:new w(24,4)};get _isImplicit(){return B(10,this)===0}set implicit(e){U(10,0,this)}get explicit(){return G(`explicit`,B(10,this),1,this),B(12,this)}get _isExplicit(){return B(10,this)===1}set explicit(e){U(10,1,this),U(12,e,this)}toString(){return`Field_Ordinal_`+super.toString()}which(){return B(10,this)}};const ti={SLOT:0,GROUP:1};var ni=class e extends M{static NO_DISCRIMINANT=65535;static SLOT=ti.SLOT;static GROUP=ti.GROUP;static _capnp={displayName:`Field`,id:`9aad50a41f4af45f`,size:new w(24,4),defaultDiscriminantValue:Ir(65535)};static _Annotations;get name(){return hr(0,this)}set name(e){Er(0,e,this)}get codeOrder(){return B(0,this)}set codeOrder(e){U(0,e,this)}_adoptAnnotations(e){T(e,z(1,this))}_disownAnnotations(){return E(this.annotations)}get annotations(){return R(1,e._Annotations,this)}_hasAnnotations(){return!k(z(1,this))}_initAnnotations(t){return H(1,e._Annotations,t,this)}set annotations(e){D(e,z(1,this))}get discriminantValue(){return B(2,this,e._capnp.defaultDiscriminantValue)}set discriminantValue(t){U(2,t,this,e._capnp.defaultDiscriminantValue)}get slot(){return G(`slot`,B(8,this),0,this),F(Zr,this)}_initSlot(){return U(8,0,this),F(Zr,this)}get _isSlot(){return B(8,this)===0}set slot(e){U(8,0,this)}get group(){return G(`group`,B(8,this),1,this),F(Qr,this)}_initGroup(){return U(8,1,this),F(Qr,this)}get _isGroup(){return B(8,this)===1}set group(e){U(8,1,this)}get ordinal(){return F(ei,this)}_initOrdinal(){return F(ei,this)}toString(){return`Field_`+super.toString()}which(){return B(8,this)}},ri=class e extends M{static _capnp={displayName:`Enumerant`,id:`978a7cebdc549a4d`,size:new w(8,2)};static _Annotations;get name(){return hr(0,this)}set name(e){Er(0,e,this)}get codeOrder(){return B(0,this)}set codeOrder(e){U(0,e,this)}_adoptAnnotations(e){T(e,z(1,this))}_disownAnnotations(){return E(this.annotations)}get annotations(){return R(1,e._Annotations,this)}_hasAnnotations(){return!k(z(1,this))}_initAnnotations(t){return H(1,e._Annotations,t,this)}set annotations(e){D(e,z(1,this))}toString(){return`Enumerant_`+super.toString()}},ii=class extends M{static _capnp={displayName:`Superclass`,id:`a9962a9ed0a4d7f8`,size:new w(8,1)};get id(){return V(0,this)}set id(e){W(0,e,this)}_adoptBrand(e){T(e,z(0,this))}_disownBrand(){return E(this.brand)}get brand(){return mr(0,bi,this)}_hasBrand(){return!k(z(0,this))}_initBrand(){return P(0,bi,this)}set brand(e){D(e,z(0,this))}toString(){return`Superclass_`+super.toString()}},ai=class e extends M{static _capnp={displayName:`Method`,id:`9500cce23b334d80`,size:new w(24,5)};static _ImplicitParameters;static _Annotations;get name(){return hr(0,this)}set name(e){Er(0,e,this)}get codeOrder(){return B(0,this)}set codeOrder(e){U(0,e,this)}_adoptImplicitParameters(e){T(e,z(4,this))}_disownImplicitParameters(){return E(this.implicitParameters)}get implicitParameters(){return R(4,e._ImplicitParameters,this)}_hasImplicitParameters(){return!k(z(4,this))}_initImplicitParameters(t){return H(4,e._ImplicitParameters,t,this)}set implicitParameters(e){D(e,z(4,this))}get paramStructType(){return V(8,this)}set paramStructType(e){W(8,e,this)}_adoptParamBrand(e){T(e,z(2,this))}_disownParamBrand(){return E(this.paramBrand)}get paramBrand(){return mr(2,bi,this)}_hasParamBrand(){return!k(z(2,this))}_initParamBrand(){return P(2,bi,this)}set paramBrand(e){D(e,z(2,this))}get resultStructType(){return V(16,this)}set resultStructType(e){W(16,e,this)}_adoptResultBrand(e){T(e,z(3,this))}_disownResultBrand(){return E(this.resultBrand)}get resultBrand(){return mr(3,bi,this)}_hasResultBrand(){return!k(z(3,this))}_initResultBrand(){return P(3,bi,this)}set resultBrand(e){D(e,z(3,this))}_adoptAnnotations(e){T(e,z(1,this))}_disownAnnotations(){return E(this.annotations)}get annotations(){return R(1,e._Annotations,this)}_hasAnnotations(){return!k(z(1,this))}_initAnnotations(t){return H(1,e._Annotations,t,this)}set annotations(e){D(e,z(1,this))}toString(){return`Method_`+super.toString()}},oi=class extends M{static _capnp={displayName:`list`,id:`87e739250a60ea97`,size:new w(24,1)};_adoptElementType(e){T(e,z(0,this))}_disownElementType(){return E(this.elementType)}get elementType(){return mr(0,Y,this)}_hasElementType(){return!k(z(0,this))}_initElementType(){return P(0,Y,this)}set elementType(e){D(e,z(0,this))}toString(){return`Type_List_`+super.toString()}},si=class extends M{static _capnp={displayName:`enum`,id:`9e0e78711a7f87a9`,size:new w(24,1)};get typeId(){return V(8,this)}set typeId(e){W(8,e,this)}_adoptBrand(e){T(e,z(0,this))}_disownBrand(){return E(this.brand)}get brand(){return mr(0,bi,this)}_hasBrand(){return!k(z(0,this))}_initBrand(){return P(0,bi,this)}set brand(e){D(e,z(0,this))}toString(){return`Type_Enum_`+super.toString()}},ci=class extends M{static _capnp={displayName:`struct`,id:`ac3a6f60ef4cc6d3`,size:new w(24,1)};get typeId(){return V(8,this)}set typeId(e){W(8,e,this)}_adoptBrand(e){T(e,z(0,this))}_disownBrand(){return E(this.brand)}get brand(){return mr(0,bi,this)}_hasBrand(){return!k(z(0,this))}_initBrand(){return P(0,bi,this)}set brand(e){D(e,z(0,this))}toString(){return`Type_Struct_`+super.toString()}},li=class extends M{static _capnp={displayName:`interface`,id:`ed8bca69f7fb0cbf`,size:new w(24,1)};get typeId(){return V(8,this)}set typeId(e){W(8,e,this)}_adoptBrand(e){T(e,z(0,this))}_disownBrand(){return E(this.brand)}get brand(){return mr(0,bi,this)}_hasBrand(){return!k(z(0,this))}_initBrand(){return P(0,bi,this)}set brand(e){D(e,z(0,this))}toString(){return`Type_Interface_`+super.toString()}};const ui={ANY_KIND:0,STRUCT:1,LIST:2,CAPABILITY:3};var di=class extends M{static ANY_KIND=ui.ANY_KIND;static STRUCT=ui.STRUCT;static LIST=ui.LIST;static CAPABILITY=ui.CAPABILITY;static _capnp={displayName:`unconstrained`,id:`8e3b5f79fe593656`,size:new w(24,1)};get _isAnyKind(){return B(10,this)===0}set anyKind(e){U(10,0,this)}get _isStruct(){return B(10,this)===1}set struct(e){U(10,1,this)}get _isList(){return B(10,this)===2}set list(e){U(10,2,this)}get _isCapability(){return B(10,this)===3}set capability(e){U(10,3,this)}toString(){return`Type_AnyPointer_Unconstrained_`+super.toString()}which(){return B(10,this)}},fi=class extends M{static _capnp={displayName:`parameter`,id:`9dd1f724f4614a85`,size:new w(24,1)};get scopeId(){return V(16,this)}set scopeId(e){W(16,e,this)}get parameterIndex(){return B(10,this)}set parameterIndex(e){U(10,e,this)}toString(){return`Type_AnyPointer_Parameter_`+super.toString()}},pi=class extends M{static _capnp={displayName:`implicitMethodParameter`,id:`baefc9120c56e274`,size:new w(24,1)};get parameterIndex(){return B(10,this)}set parameterIndex(e){U(10,e,this)}toString(){return`Type_AnyPointer_ImplicitMethodParameter_`+super.toString()}};const mi={UNCONSTRAINED:0,PARAMETER:1,IMPLICIT_METHOD_PARAMETER:2};var hi=class extends M{static UNCONSTRAINED=mi.UNCONSTRAINED;static PARAMETER=mi.PARAMETER;static IMPLICIT_METHOD_PARAMETER=mi.IMPLICIT_METHOD_PARAMETER;static _capnp={displayName:`anyPointer`,id:`c2573fe8a23e49f1`,size:new w(24,1)};get unconstrained(){return G(`unconstrained`,B(8,this),0,this),F(di,this)}_initUnconstrained(){return U(8,0,this),F(di,this)}get _isUnconstrained(){return B(8,this)===0}set unconstrained(e){U(8,0,this)}get parameter(){return G(`parameter`,B(8,this),1,this),F(fi,this)}_initParameter(){return U(8,1,this),F(fi,this)}get _isParameter(){return B(8,this)===1}set parameter(e){U(8,1,this)}get implicitMethodParameter(){return G(`implicitMethodParameter`,B(8,this),2,this),F(pi,this)}_initImplicitMethodParameter(){return U(8,2,this),F(pi,this)}get _isImplicitMethodParameter(){return B(8,this)===2}set implicitMethodParameter(e){U(8,2,this)}toString(){return`Type_AnyPointer_`+super.toString()}which(){return B(8,this)}};const J={VOID:0,BOOL:1,INT8:2,INT16:3,INT32:4,INT64:5,UINT8:6,UINT16:7,UINT32:8,UINT64:9,FLOAT32:10,FLOAT64:11,TEXT:12,DATA:13,LIST:14,ENUM:15,STRUCT:16,INTERFACE:17,ANY_POINTER:18};var Y=class extends M{static VOID=J.VOID;static BOOL=J.BOOL;static INT8=J.INT8;static INT16=J.INT16;static INT32=J.INT32;static INT64=J.INT64;static UINT8=J.UINT8;static UINT16=J.UINT16;static UINT32=J.UINT32;static UINT64=J.UINT64;static FLOAT32=J.FLOAT32;static FLOAT64=J.FLOAT64;static TEXT=J.TEXT;static DATA=J.DATA;static LIST=J.LIST;static ENUM=J.ENUM;static STRUCT=J.STRUCT;static INTERFACE=J.INTERFACE;static ANY_POINTER=J.ANY_POINTER;static _capnp={displayName:`Type`,id:`d07378ede1f9cc60`,size:new w(24,1)};get _isVoid(){return B(0,this)===0}set void(e){U(0,0,this)}get _isBool(){return B(0,this)===1}set bool(e){U(0,1,this)}get _isInt8(){return B(0,this)===2}set int8(e){U(0,2,this)}get _isInt16(){return B(0,this)===3}set int16(e){U(0,3,this)}get _isInt32(){return B(0,this)===4}set int32(e){U(0,4,this)}get _isInt64(){return B(0,this)===5}set int64(e){U(0,5,this)}get _isUint8(){return B(0,this)===6}set uint8(e){U(0,6,this)}get _isUint16(){return B(0,this)===7}set uint16(e){U(0,7,this)}get _isUint32(){return B(0,this)===8}set uint32(e){U(0,8,this)}get _isUint64(){return B(0,this)===9}set uint64(e){U(0,9,this)}get _isFloat32(){return B(0,this)===10}set float32(e){U(0,10,this)}get _isFloat64(){return B(0,this)===11}set float64(e){U(0,11,this)}get _isText(){return B(0,this)===12}set text(e){U(0,12,this)}get _isData(){return B(0,this)===13}set data(e){U(0,13,this)}get list(){return G(`list`,B(0,this),14,this),F(oi,this)}_initList(){return U(0,14,this),F(oi,this)}get _isList(){return B(0,this)===14}set list(e){U(0,14,this)}get enum(){return G(`enum`,B(0,this),15,this),F(si,this)}_initEnum(){return U(0,15,this),F(si,this)}get _isEnum(){return B(0,this)===15}set enum(e){U(0,15,this)}get struct(){return G(`struct`,B(0,this),16,this),F(ci,this)}_initStruct(){return U(0,16,this),F(ci,this)}get _isStruct(){return B(0,this)===16}set struct(e){U(0,16,this)}get interface(){return G(`interface`,B(0,this),17,this),F(li,this)}_initInterface(){return U(0,17,this),F(li,this)}get _isInterface(){return B(0,this)===17}set interface(e){U(0,17,this)}get anyPointer(){return G(`anyPointer`,B(0,this),18,this),F(hi,this)}_initAnyPointer(){return U(0,18,this),F(hi,this)}get _isAnyPointer(){return B(0,this)===18}set anyPointer(e){U(0,18,this)}toString(){return`Type_`+super.toString()}which(){return B(0,this)}};const gi={BIND:0,INHERIT:1};var _i=class e extends M{static BIND=gi.BIND;static INHERIT=gi.INHERIT;static _capnp={displayName:`Scope`,id:`abd73485a9636bc9`,size:new w(16,1)};static _Bind;get scopeId(){return V(0,this)}set scopeId(e){W(0,e,this)}_adoptBind(e){U(8,0,this),T(e,z(0,this))}_disownBind(){return E(this.bind)}get bind(){return G(`bind`,B(8,this),0,this),R(0,e._Bind,this)}_hasBind(){return!k(z(0,this))}_initBind(t){return U(8,0,this),H(0,e._Bind,t,this)}get _isBind(){return B(8,this)===0}set bind(e){U(8,0,this),D(e,z(0,this))}get _isInherit(){return B(8,this)===1}set inherit(e){U(8,1,this)}toString(){return`Brand_Scope_`+super.toString()}which(){return B(8,this)}};const vi={UNBOUND:0,TYPE:1};var yi=class extends M{static UNBOUND=vi.UNBOUND;static TYPE=vi.TYPE;static _capnp={displayName:`Binding`,id:`c863cd16969ee7fc`,size:new w(8,1)};get _isUnbound(){return B(0,this)===0}set unbound(e){U(0,0,this)}_adoptType(e){U(0,1,this),T(e,z(0,this))}_disownType(){return E(this.type)}get type(){return G(`type`,B(0,this),1,this),mr(0,Y,this)}_hasType(){return!k(z(0,this))}_initType(){return U(0,1,this),P(0,Y,this)}get _isType(){return B(0,this)===1}set type(e){U(0,1,this),D(e,z(0,this))}toString(){return`Brand_Binding_`+super.toString()}which(){return B(0,this)}},bi=class e extends M{static Scope=_i;static Binding=yi;static _capnp={displayName:`Brand`,id:`903455f06065422b`,size:new w(0,1)};static _Scopes;_adoptScopes(e){T(e,z(0,this))}_disownScopes(){return E(this.scopes)}get scopes(){return R(0,e._Scopes,this)}_hasScopes(){return!k(z(0,this))}_initScopes(t){return H(0,e._Scopes,t,this)}set scopes(e){D(e,z(0,this))}toString(){return`Brand_`+super.toString()}};const X={VOID:0,BOOL:1,INT8:2,INT16:3,INT32:4,INT64:5,UINT8:6,UINT16:7,UINT32:8,UINT64:9,FLOAT32:10,FLOAT64:11,TEXT:12,DATA:13,LIST:14,ENUM:15,STRUCT:16,INTERFACE:17,ANY_POINTER:18};var Z=class extends M{static VOID=X.VOID;static BOOL=X.BOOL;static INT8=X.INT8;static INT16=X.INT16;static INT32=X.INT32;static INT64=X.INT64;static UINT8=X.UINT8;static UINT16=X.UINT16;static UINT32=X.UINT32;static UINT64=X.UINT64;static FLOAT32=X.FLOAT32;static FLOAT64=X.FLOAT64;static TEXT=X.TEXT;static DATA=X.DATA;static LIST=X.LIST;static ENUM=X.ENUM;static STRUCT=X.STRUCT;static INTERFACE=X.INTERFACE;static ANY_POINTER=X.ANY_POINTER;static _capnp={displayName:`Value`,id:`ce23dcd2d7b00c9b`,size:new w(16,1)};get _isVoid(){return B(0,this)===0}set void(e){U(0,0,this)}get bool(){return G(`bool`,B(0,this),1,this),I(16,this)}get _isBool(){return B(0,this)===1}set bool(e){U(0,1,this),yr(16,e,this)}get int8(){return G(`int8`,B(0,this),2,this),ur(2,this)}get _isInt8(){return B(0,this)===2}set int8(e){U(0,2,this),Tr(2,e,this)}get int16(){return G(`int16`,B(0,this),3,this),sr(2,this)}get _isInt16(){return B(0,this)===3}set int16(e){U(0,3,this),Sr(2,e,this)}get int32(){return G(`int32`,B(0,this),4,this),cr(4,this)}get _isInt32(){return B(0,this)===4}set int32(e){U(0,4,this),Cr(4,e,this)}get int64(){return G(`int64`,B(0,this),5,this),lr(8,this)}get _isInt64(){return B(0,this)===5}set int64(e){U(0,5,this),wr(8,e,this)}get uint8(){return G(`uint8`,B(0,this),6,this),_r(2,this)}get _isUint8(){return B(0,this)===6}set uint8(e){U(0,6,this),Or(2,e,this)}get uint16(){return G(`uint16`,B(0,this),7,this),B(2,this)}get _isUint16(){return B(0,this)===7}set uint16(e){U(0,7,this),U(2,e,this)}get uint32(){return G(`uint32`,B(0,this),8,this),gr(4,this)}get _isUint32(){return B(0,this)===8}set uint32(e){U(0,8,this),Dr(4,e,this)}get uint64(){return G(`uint64`,B(0,this),9,this),V(8,this)}get _isUint64(){return B(0,this)===9}set uint64(e){U(0,9,this),W(8,e,this)}get float32(){return G(`float32`,B(0,this),10,this),ar(4,this)}get _isFloat32(){return B(0,this)===10}set float32(e){U(0,10,this),br(4,e,this)}get float64(){return G(`float64`,B(0,this),11,this),or(8,this)}get _isFloat64(){return B(0,this)===11}set float64(e){U(0,11,this),xr(8,e,this)}get text(){return G(`text`,B(0,this),12,this),hr(0,this)}get _isText(){return B(0,this)===12}set text(e){U(0,12,this),Er(0,e,this)}_adoptData(e){U(0,13,this),T(e,z(0,this))}_disownData(){return E(this.data)}get data(){return G(`data`,B(0,this),13,this),ir(0,this)}_hasData(){return!k(z(0,this))}_initData(e){return U(0,13,this),vr(0,e,this)}get _isData(){return B(0,this)===13}set data(e){U(0,13,this),D(e,z(0,this))}_adoptList(e){U(0,14,this),T(e,z(0,this))}_disownList(){return E(this.list)}get list(){return G(`list`,B(0,this),14,this),z(0,this)}_hasList(){return!k(z(0,this))}get _isList(){return B(0,this)===14}set list(e){U(0,14,this),D(e,z(0,this))}get enum(){return G(`enum`,B(0,this),15,this),B(2,this)}get _isEnum(){return B(0,this)===15}set enum(e){U(0,15,this),U(2,e,this)}_adoptStruct(e){U(0,16,this),T(e,z(0,this))}_disownStruct(){return E(this.struct)}get struct(){return G(`struct`,B(0,this),16,this),z(0,this)}_hasStruct(){return!k(z(0,this))}get _isStruct(){return B(0,this)===16}set struct(e){U(0,16,this),D(e,z(0,this))}get _isInterface(){return B(0,this)===17}set interface(e){U(0,17,this)}_adoptAnyPointer(e){U(0,18,this),T(e,z(0,this))}_disownAnyPointer(){return E(this.anyPointer)}get anyPointer(){return G(`anyPointer`,B(0,this),18,this),z(0,this)}_hasAnyPointer(){return!k(z(0,this))}get _isAnyPointer(){return B(0,this)===18}set anyPointer(e){U(0,18,this),D(e,z(0,this))}toString(){return`Value_`+super.toString()}which(){return B(0,this)}},xi=class extends M{static _capnp={displayName:`Annotation`,id:`f1c8950dab257542`,size:new w(8,2)};get id(){return V(0,this)}set id(e){W(0,e,this)}_adoptBrand(e){T(e,z(1,this))}_disownBrand(){return E(this.brand)}get brand(){return mr(1,bi,this)}_hasBrand(){return!k(z(1,this))}_initBrand(){return P(1,bi,this)}set brand(e){D(e,z(1,this))}_adoptValue(e){T(e,z(0,this))}_disownValue(){return E(this.value)}get value(){return mr(0,Z,this)}_hasValue(){return!k(z(0,this))}_initValue(){return P(0,Z,this)}set value(e){D(e,z(0,this))}toString(){return`Annotation_`+super.toString()}};const Si={EMPTY:0,BIT:1,BYTE:2,TWO_BYTES:3,FOUR_BYTES:4,EIGHT_BYTES:5,POINTER:6,INLINE_COMPOSITE:7};var Ci=class extends M{static _capnp={displayName:`CapnpVersion`,id:`d85d305b7d839963`,size:new w(8,0)};get major(){return B(0,this)}set major(e){U(0,e,this)}get minor(){return _r(2,this)}set minor(e){Or(2,e,this)}get micro(){return _r(3,this)}set micro(e){Or(3,e,this)}toString(){return`CapnpVersion_`+super.toString()}},wi=class extends M{static _capnp={displayName:`Import`,id:`ae504193122357e5`,size:new w(8,1)};get id(){return V(0,this)}set id(e){W(0,e,this)}get name(){return hr(0,this)}set name(e){Er(0,e,this)}toString(){return`CodeGeneratorRequest_RequestedFile_Import_`+super.toString()}},Ti=class e extends M{static Import=wi;static _capnp={displayName:`RequestedFile`,id:`cfea0eb02e810062`,size:new w(8,2)};static _Imports;get id(){return V(0,this)}set id(e){W(0,e,this)}get filename(){return hr(0,this)}set filename(e){Er(0,e,this)}_adoptImports(e){T(e,z(1,this))}_disownImports(){return E(this.imports)}get imports(){return R(1,e._Imports,this)}_hasImports(){return!k(z(1,this))}_initImports(t){return H(1,e._Imports,t,this)}set imports(e){D(e,z(1,this))}toString(){return`CodeGeneratorRequest_RequestedFile_`+super.toString()}},Ei=class e extends M{static RequestedFile=Ti;static _capnp={displayName:`CodeGeneratorRequest`,id:`bfc546f6210ad7ce`,size:new w(0,4)};static _Nodes;static _SourceInfo;static _RequestedFiles;_adoptCapnpVersion(e){T(e,z(2,this))}_disownCapnpVersion(){return E(this.capnpVersion)}get capnpVersion(){return mr(2,Ci,this)}_hasCapnpVersion(){return!k(z(2,this))}_initCapnpVersion(){return P(2,Ci,this)}set capnpVersion(e){D(e,z(2,this))}_adoptNodes(e){T(e,z(0,this))}_disownNodes(){return E(this.nodes)}get nodes(){return R(0,e._Nodes,this)}_hasNodes(){return!k(z(0,this))}_initNodes(t){return H(0,e._Nodes,t,this)}set nodes(e){D(e,z(0,this))}_adoptSourceInfo(e){T(e,z(3,this))}_disownSourceInfo(){return E(this.sourceInfo)}get sourceInfo(){return R(3,e._SourceInfo,this)}_hasSourceInfo(){return!k(z(3,this))}_initSourceInfo(t){return H(3,e._SourceInfo,t,this)}set sourceInfo(e){D(e,z(3,this))}_adoptRequestedFiles(e){T(e,z(1,this))}_disownRequestedFiles(){return E(this.requestedFiles)}get requestedFiles(){return R(1,e._RequestedFiles,this)}_hasRequestedFiles(){return!k(z(1,this))}_initRequestedFiles(t){return H(1,e._RequestedFiles,t,this)}set requestedFiles(e){D(e,z(1,this))}toString(){return`CodeGeneratorRequest_`+super.toString()}};Ur._Members=q(Hr),Wr._Fields=q(ni),Gr._Enumerants=q(ri),Kr._Methods=q(ai),Kr._Superclasses=q(ii),Xr._Parameters=q(Br),Xr._NestedNodes=q(Vr),Xr._Annotations=q(xi),ni._Annotations=q(xi),ri._Annotations=q(xi),ai._ImplicitParameters=q(Br),ai._Annotations=q(xi),_i._Bind=q(yi),bi._Scopes=q(_i),Ti._Imports=q(wi),Ei._Nodes=q(Xr),Ei._SourceInfo=q(Ur),Ei._RequestedFiles=q(Ti);var Di=(e=>(e[e.SINGLE_SEGMENT=0]=`SINGLE_SEGMENT`,e[e.MULTI_SEGMENT=1]=`MULTI_SEGMENT`,e))(Di||{}),Oi=class{buffer;id;constructor(e,t){this.id=e,this.buffer=t}},ki=class{constructor(e=[new ArrayBuffer(pt)]){this.buffers=e;let t=e.length;for(;--t>=0;)if(e[t].byteLength&7)throw Error(C(Jt,e[t].byteLength))}static allocate=Ai;static getBuffer=ji;static getNumSegments=Mi;kind=Di.MULTI_SEGMENT;toString(){return C(`MultiSegmentArena_segments:%d`,Mi(this))}};function Ai(e,t){let n=new ArrayBuffer(rn(Math.max(e,pt)));return t.buffers.push(n),new Oi(t.buffers.length-1,n)}function ji(e,t){if(e<0||e>=t.buffers.length)throw Error(C(`CAPNP-TS036 Attempted to get an out-of-bounds segment (%d).`,e));return t.buffers[e]}function Mi(e){return e.buffers.length}var Ni=class{static allocate=Pi;static getBuffer=Fi;static getNumSegments=Ii;buffer;kind=Di.SINGLE_SEGMENT;constructor(e=new ArrayBuffer(pt)){if(e.byteLength&7)throw Error(C(Jt,e.byteLength));this.buffer=e}toString(){return C(`SingleSegmentArena_len:%x`,this.buffer.byteLength)}};function Pi(e,t,n){let r=t.length>0?t[0].buffer:n.buffer;return e=e<yt?yt:rn(e),n.buffer=new ArrayBuffer(r.byteLength+e),new Float64Array(n.buffer).set(new Float64Array(r)),new Oi(0,n.buffer)}function Fi(e,t){if(e!==0)throw Error(C(`CAPNP-TS035 Attempted to get a segment other than 0 (%d) from a single segment arena.`,e));return t.buffer}function Ii(){return 1}var Li=class{static allocate=Ri;static copy=zi;static getBuffer=Bi;static getNumSegments=Vi};function Ri(e,t,n){switch(n.kind){case Di.MULTI_SEGMENT:return ki.allocate(e,n);case Di.SINGLE_SEGMENT:return Ni.allocate(e,t,n);default:return Et(n)}}function zi(e){switch(e.kind){case Di.MULTI_SEGMENT:{let t=e.buffers.length,n=Array.from({length:t});for(;--t>=0;)n[t]=e.buffers[t].slice(0);return new ki(n)}case Di.SINGLE_SEGMENT:return new Ni(e.buffer.slice(0));default:return Et(e)}}function Bi(e,t){switch(t.kind){case Di.MULTI_SEGMENT:return ki.getBuffer(e,t);case Di.SINGLE_SEGMENT:return Ni.getBuffer(e,t);default:return Et(t)}}function Vi(e){switch(e.kind){case Di.MULTI_SEGMENT:return ki.getNumSegments(e);case Di.SINGLE_SEGMENT:return Ni.getNumSegments();default:return Et(e)}}function Hi(e){let t=e-(e>>1&1431655765);return t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>24}function Ui(e,t,n,r,i,a,o,s){return(e===0?0:1)|(t===0?0:2)|(n===0?0:4)|(r===0?0:8)|(i===0?0:16)|(a===0?0:32)|(o===0?0:64)|(s===0?0:128)}function Wi(e){let t=new Uint8Array(e),n=0,r=119;for(let e=0;e<t.byteLength;){let i=t[e];r===0?(n+=i,e++,r=119):r===255?(n+=i,e+=i*8+1,r=119):(n++,e+=Hi(i)+1,r=i)}return n*8}function Gi(e,t,n,r,i,a,o,s){return(e===0?1:0)+(t===0?1:0)+(n===0?1:0)+(r===0?1:0)+(i===0?1:0)+(a===0?1:0)+(o===0?1:0)+(s===0?1:0)}function Ki(e,t=0,n){if(e.byteLength%8!=0)throw Error(`CAPNP-TS003 Attempted to pack a message that was not word-aligned.`);let r=new Uint8Array(e,t,n),i=[],a=119,o=0,s=0;for(let e=0;e<r.byteLength;e+=8){let t=r[e],n=r[e+1],c=r[e+2],l=r[e+3],u=r[e+4],d=r[e+5],f=r[e+6],p=r[e+7],m=Ui(t,n,c,l,u,d,f,p),h=!0;switch(a){case 0:m!==0||s>=255?(i.push(s),s=0,h=!1):s++;break;case 255:Gi(t,n,c,l,u,d,f,p)>=2||s>=255?(i[o]=s,s=0,h=!1):(i.push(t,n,c,l,u,d,f,p),s++);break;default:h=!1;break}h||(i.push(m),a=m,t!==0&&i.push(t),n!==0&&i.push(n),c!==0&&i.push(c),l!==0&&i.push(l),u!==0&&i.push(u),d!==0&&i.push(d),f!==0&&i.push(f),p!==0&&i.push(p),m===255&&(o=i.length,i.push(0)))}return a===0?i.push(s):a===255&&(i[o]=s),new Uint8Array(i).buffer}function qi(e){let t=new Uint8Array(e),n=new Uint8Array(new ArrayBuffer(Wi(e))),r=119;for(let e=0,i=0;e<t.byteLength;){let a=t[e];if(r===0)i+=a*8,e++,r=119;else if(r===255){let o=a*8;n.set(t.subarray(e+1,e+1+o),i),i+=o,e+=1+o,r=119}else{e++;for(let r=1;r<=128;r<<=1)(a&r)!==0&&(n[i]=t[e++]),i++;r=a}}return n.buffer}var Ji=class{constructor(e,t,n,r=0){this.id=e,this.message=t,this.message=t,this.buffer=n,this._dv=new DataView(n),this.byteOffset=0,this.byteLength=r}buffer;byteLength;byteOffset;[Symbol.toStringTag]=`Segment`;_dv;allocate(e){let t=this;if(e=rn(e),e>wt-8)throw Error(C(Xt,e));t.hasCapacity(e)||(t=t.message.allocateSegment(e));let n=t.byteLength;return t.byteLength+=e,new j(t,n)}copyWord(e,t,n){let r=t._dv.getFloat64(n,S);this._dv.setFloat64(e,r,S)}copyWords(e,t,n,r){let i=new Float64Array(this.buffer,e,r),a=new Float64Array(t.buffer,n,r);i.set(a)}fillZeroWords(e,t){new Float64Array(this.buffer,e,t).fill(0)}getBigInt64(e,t){return this._dv.getBigInt64(e,t)}getBigUint64(e,t){return this._dv.getBigUint64(e,t)}getCapacity(){return this.buffer.byteLength}getFloat32(e){return this._dv.getFloat32(e,!0)}getFloat64(e){return this._dv.getFloat64(e,!0)}getInt16(e){return this._dv.getInt16(e,!0)}getInt32(e){return this._dv.getInt32(e,!0)}getInt64(e){return this._dv.getBigInt64(e,!0)}getInt8(e){return this._dv.getInt8(e)}getUint16(e){return this._dv.getUint16(e,!0)}getUint32(e){return this._dv.getUint32(e,!0)}getUint64(e){return this._dv.getBigUint64(e,!0)}getUint8(e){return this._dv.getUint8(e)}hasCapacity(e){return this.buffer.byteLength-this.byteLength>=e}isWordZero(e){return this._dv.getFloat64(e,S)===0}replaceBuffer(e){if(this.buffer!==e){if(e.byteLength<this.byteLength)throw Error(`CAPNP-TS038 Attempted to replace a segment buffer with one that is smaller than the allocated space.`);this._dv=new DataView(e),this.buffer=e}}setBigInt64(e,t,n){this._dv.setBigInt64(e,t,n)}setBigUint64(e,t,n){this._dv.setBigUint64(e,t,n)}setFloat32(e,t){this._dv.setFloat32(e,t,!0)}setFloat64(e,t){this._dv.setFloat64(e,t,!0)}setInt16(e,t){this._dv.setInt16(e,t,!0)}setInt32(e,t){this._dv.setInt32(e,t,!0)}setInt8(e,t){this._dv.setInt8(e,t)}setInt64(e,t){this._dv.setBigInt64(e,t,!0)}setUint16(e,t){this._dv.setUint16(e,t,!0)}setUint32(e,t){this._dv.setUint32(e,t,!0)}setUint64(e,t){this._dv.setBigUint64(e,t,!0)}setUint8(e,t){this._dv.setUint8(e,t)}setWordZero(e){this._dv.setFloat64(e,0,S)}toString(){return C(`Segment_id:%d,off:%a,len:%a,cap:%a`,this.id,this.byteLength,this.byteOffset,this.buffer.byteLength)}},Yi=class{static allocateSegment=ta;static dump=na;static getRoot=ra;static getSegment=ia;static initRoot=aa;static readRawPointer=oa;static toArrayBuffer=ca;static toPackedArrayBuffer=la;_capnp;constructor(e,t=!0,n=!1){this._capnp=Xi(e,t,n),e&&Qi(this)}allocateSegment(e){return ta(e,this)}copy(){return da(this)}dump(){return na(this)}getRoot(e){return ra(e,this)}getSegment(e){return ia(e,this)}initRoot(e){return aa(e,this)}setRoot(e){sa(e,this)}toArrayBuffer(){return ca(this)}toPackedArrayBuffer(){return la(this)}addCap(e){this._capnp.capTable||(this._capnp.capTable=[]);let t=this._capnp.capTable.length;return this._capnp.capTable.push(e),t}toString(){return`Message_arena:${this._capnp.arena}`}};function Xi(e,t=!0,n=!1){if(e===void 0)return{arena:new Ni,segments:[],traversalLimit:mt};if(ea(e))return{arena:e,segments:[],traversalLimit:mt};let r=e;return $i(r)&&(r=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)),t&&(r=qi(r)),n?{arena:new Ni(r),segments:[],traversalLimit:mt}:{arena:new ki(Zi(r)),segments:[],traversalLimit:mt}}function Zi(e){let t=new DataView(e),n=t.getUint32(0,!0)+1,r=Array.from({length:n}),i=4+n*4;if(i+=i%8,i+n*4>e.byteLength)throw Error(Dt);for(let a=0;a<n;a++){let n=t.getUint32(4+a*4,!0)*8;if(i+n>e.byteLength)throw Error(Dt);r[a]=e.slice(i,i+n),i+=n}return r}function Qi(e){let t=Li.getNumSegments(e._capnp.arena);e._capnp.segments=Array.from({length:t});for(let n=0;n<t;n++){if(n===0&&Li.getBuffer(n,e._capnp.arena).byteLength<8)throw Error(At);let t=Li.getBuffer(n,e._capnp.arena),r=new Ji(n,e,t,t.byteLength);e._capnp.segments[n]=r}}function $i(e){return e.byteOffset!==void 0}function ea(e){return e.kind!==void 0}function ta(e,t){let n=Li.allocate(e,t._capnp.segments,t._capnp.arena),r;if(n.id===t._capnp.segments.length)r=new Ji(n.id,t,n.buffer),t._capnp.segments.push(r);else if(n.id<0||n.id>t._capnp.segments.length)throw Error(C(kt,n.id,t));else r=t._capnp.segments[n.id],r.replaceBuffer(n.buffer);return r}function na(e){let t=``;if(e._capnp.segments.length===0)return`================
|
|
51
|
+
No Segments
|
|
52
|
+
================
|
|
53
|
+
`;for(let n=0;n<e._capnp.segments.length;n++){t+=`================
|
|
54
|
+
Segment #${n}
|
|
55
|
+
================
|
|
56
|
+
`;let{buffer:r,byteLength:i}=e._capnp.segments[n],a=new Uint8Array(r,0,i);t+=tn(a)}return t}function ra(e,t){let n=new e(t.getSegment(0),0);Vn(A.STRUCT,n);let r=Nn(n);return(r.dataByteLength<e._capnp.size.dataByteLength||r.pointerLength<e._capnp.size.pointerLength)&&rr(e._capnp.size,n),n}function ia(e,t){let n=t._capnp.segments.length;if(e===0&&n===0){if(Li.getNumSegments(t._capnp.arena)===0?ta(pt,t):t._capnp.segments[0]=new Ji(0,t,Li.getBuffer(0,t._capnp.arena)),!t._capnp.segments[0].hasCapacity(8))throw Error(At);return t._capnp.segments[0].allocate(8),t._capnp.segments[0]}if(e<0||e>=n)throw Error(C(kt,e,t));return t._capnp.segments[e]}function aa(e,t){let n=new e(t.getSegment(0),0);return tr(e._capnp.size,n),n}function oa(e){return new j(new Yi(e).getSegment(0),0)}function sa(e,t){D(e,new j(t.getSegment(0),0))}function ca(e){let t=ua(e);e._capnp.segments.length===0&&ia(0,e);let{segments:n}=e._capnp,r=t.byteLength+n.reduce((e,t)=>e+rn(t.byteLength),0),i=new Uint8Array(new ArrayBuffer(r)),a=t.byteLength;i.set(new Uint8Array(t));for(let e of n){let t=rn(e.byteLength);i.set(new Uint8Array(e.buffer,0,t),a),a+=t}return i.buffer}function la(e){let t=Ki(ua(e));e._capnp.segments.length===0&&e.getSegment(0);let n=e._capnp.segments.map(e=>Ki(e.buffer,0,rn(e.byteLength))),r=t.byteLength+n.reduce((e,t)=>e+t.byteLength,0),i=new Uint8Array(new ArrayBuffer(r)),a=t.byteLength;i.set(new Uint8Array(t));for(let e of n)i.set(new Uint8Array(e),a),a+=e.byteLength;return i.buffer}function ua(e){let{length:t}=e._capnp.segments;if(t===0)return new Float64Array(1).buffer;let n=4+t*4+(1-t%2)*4,r=new DataView(new ArrayBuffer(n));r.setUint32(0,t-1,!0);for(let[t,n]of e._capnp.segments.entries())r.setUint32(t*4+4,n.byteLength/8,!0);return r.buffer}function da(e){return new Yi(Li.copy(e._capnp.arena))}const fa=`CAPNP-ES000 Don't know how to generate a %s field with an explicit default value.`,pa=`CAPNP-ES001 Don't know how to generate non-inline struct lists.`,ma=`CAPNP-ES002 Failed to look up node id %s.`,ha=`CAPNP-ES003 Don't know how to generate a "%s" node.`,ga=`CAPNP-ES004 Don't know how to serialize a value of kind %s.`,_a=`CAPNP-ES005 Don't know how to generate a struct field of kind %d.`,va=`CAPNP-ES006 Unknown slot type encountered: %d`,ya=`CAPNP-ES007 Encountered an unsupported list element type: %d`,ba=`CAPNP-ES009 Failed to transpile emitted schema source code; see above for error messages.`,xa=`CAPNP-ES010 Don't know how to generate a default value for %s fields.`,Sa={[Y.ANY_POINTER]:`$.AnyPointerList`,[Y.BOOL]:`$.BoolList`,[Y.DATA]:`$.DataList`,[Y.ENUM]:`$.Uint16List`,[Y.FLOAT32]:`$.Float32List`,[Y.FLOAT64]:`$.Float64List`,[Y.INT16]:`$.Int16List`,[Y.INT32]:`$.Int32List`,[Y.INT64]:`$.Int64List`,[Y.INT8]:`$.Int8List`,[Y.INTERFACE]:`$.InterfaceList`,[Y.LIST]:`$.PointerList`,[Y.STRUCT]:`$.CompositeList`,[Y.TEXT]:`$.TextList`,[Y.UINT16]:`$.Uint16List`,[Y.UINT32]:`$.Uint32List`,[Y.UINT64]:`$.Uint64List`,[Y.UINT8]:`$.Uint8List`,[Y.VOID]:`$.VoidList`},Ca={[Y.BOOL]:{byteLength:1,getter:`getBit`,mask:`getBitMask`,setter:`setBit`},[Y.ENUM]:{byteLength:2,getter:`getUint16`,mask:`getUint16Mask`,setter:`setUint16`},[Y.FLOAT32]:{byteLength:4,getter:`getFloat32`,mask:`getFloat32Mask`,setter:`setFloat32`},[Y.FLOAT64]:{byteLength:8,getter:`getFloat64`,mask:`getFloat64Mask`,setter:`setFloat64`},[Y.INT16]:{byteLength:2,getter:`getInt16`,mask:`getInt16Mask`,setter:`setInt16`},[Y.INT32]:{byteLength:4,getter:`getInt32`,mask:`getInt32Mask`,setter:`setInt32`},[Y.INT64]:{byteLength:8,getter:`getInt64`,mask:`getInt64Mask`,setter:`setInt64`},[Y.INT8]:{byteLength:1,getter:`getInt8`,mask:`getInt8Mask`,setter:`setInt8`},[Y.UINT16]:{byteLength:2,getter:`getUint16`,mask:`getUint16Mask`,setter:`setUint16`},[Y.UINT32]:{byteLength:4,getter:`getUint32`,mask:`getUint32Mask`,setter:`setUint32`},[Y.UINT64]:{byteLength:8,getter:`getUint64`,mask:`getUint64Mask`,setter:`setUint64`},[Y.UINT8]:{byteLength:1,getter:`getUint8`,mask:`getUint8Mask`,setter:`setUint8`},[Y.VOID]:{byteLength:0,getter:`getVoid`,mask:`getVoidMask`,setter:`setVoid`}},wa=`
|
|
57
|
+
/* eslint-disable */
|
|
58
|
+
// biome-ignore lint: disable
|
|
59
|
+
|
|
60
|
+
// Generated by storm-capnpc
|
|
61
|
+
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
62
|
+
|
|
63
|
+
`,Ta=`e37ded525a68a7c9`;var Ea,Da;function Oa(){if(Da)return Ea;Da=1;function e(e,t,n){for(var r=[],i=Math.max(e.length,t.length),a=0,o=0;o<i||a;){var s=o<e.length?e[o]:0,c=o<t.length?t[o]:0,l=a+s+c;r.push(l%n),a=Math.floor(l/n),o++}return r}function t(t,n,r){if(t<0)return null;if(t==0)return[];for(var i=[],a=n;t&1&&(i=e(i,a,r)),t>>=1,t!==0;)a=e(a,a,r);return i}function n(e,t){for(var n=e.split(``),r=[],i=n.length-1;i>=0;i--){var a=parseInt(n[i],t);if(isNaN(a))return null;r.push(a)}return r}function r(r,i,a){var o=n(r,i);if(o===null)return null;for(var s=[],c=[1],l=0;l<o.length;l++)o[l]&&(s=e(s,t(o[l],c,a),a)),c=t(i,c,a);for(var u=``,l=s.length-1;l>=0;l--)u+=s[l].toString(a);return u===``&&(u=`0`),u}function i(e,t){var n=t&&t.prefix===!1,i=r(e,10,16);return i?n?i:`0x`+i:null}function a(e){return e.substring(0,2)===`0x`&&(e=e.substring(2)),e=e.toLowerCase(),r(e,16,10)}return Ea={hexToDec:a,decToHex:i},Ea}var ka=Oa();function Aa(e){return Ma(e).map(e=>e.toUpperCase()).join(`_`)}function ja(e){return e[0].toUpperCase()+e.slice(1)}function Ma(e){let t=!1;return e.split(``).reduce((e,n)=>{let r=n.toUpperCase()!==n,i=n.toLowerCase()!==n;if(e.length===0||t&&i)e.push(n);else{let t=e.length-1;e[t]=e[t]+n}return t=r,e},[])}function Na(e){return BigInt(ka.hexToDec(e))}function Pa(e,t){return e.codeOrder-t.codeOrder}function Fa(e,t){if(!t._isList)return La(e,t,!1);let{elementType:n}=t.list,r=n.which();if(r===Y.LIST)return`$.PointerList(${Fa(e,n)})`;if(r===Y.STRUCT){if($(e,n.struct.typeId).struct.preferredListEncoding!==Si.INLINE_COMPOSITE)throw Error(`CAPNP-ES001 Don't know how to generate non-inline struct lists.`);return`$.CompositeList(${La(e,n,!1)})`}return Sa[r]}function Ia(e){return e.displayName.slice(e.displayNamePrefixLength)}function Q(e){return e.displayName.split(`:`)[1].split(`.`).map(e=>ja(e)).join(`_`)}function La(e,t,n){let r=t.which();switch(r){case Y.ANY_POINTER:return`$.Pointer`;case Y.BOOL:return`boolean`;case Y.DATA:return`$.Data`;case Y.ENUM:return Q($(e,t.enum.typeId));case Y.FLOAT32:case Y.FLOAT64:case Y.INT16:case Y.INT32:case Y.INT8:case Y.UINT16:case Y.UINT32:case Y.UINT8:return`number`;case Y.UINT64:case Y.INT64:return`bigint`;case Y.INTERFACE:return Q($(e,t.interface.typeId));case Y.LIST:return`$.List${n?`Ctor`:``}<${La(e,t.list.elementType,!1)}>`;case Y.STRUCT:{let r=Q($(e,t.struct.typeId));return n?`$.StructCtor<${r}>`:r}case Y.TEXT:return`string`;case Y.VOID:return`$.Void`;default:throw Error(C(`CAPNP-ES006 Unknown slot type encountered: %d`,r))}}function Ra(e){return e.struct.fields.filter(e=>e.discriminantValue!==ni.NO_DISCRIMINANT)}function za(e,t){let n=typeof t==`bigint`?t:t.id;return e.nodes.some(e=>e.id===n)}function Ba(e,t){let n=new co(e,t);return n.tsPath=$(n,t.id).displayName.replace(/\.capnp$/,``)+`.ts`,n}function $(e,t){let n=typeof t==`bigint`?t:t.id,r=e.nodes.find(e=>e.id===n);if(r===void 0)throw Error(C(`CAPNP-ES002 Failed to look up node id %s.`,n));return r}function Va(e,t){let n=typeof t==`bigint`?t:t.id;return e.req.sourceInfo.find(e=>e.id===n)}function Ha(e){if(!e._isSlot)return!1;let t=e.slot.type;if(!t._isList)return!1;let{elementType:n}=t.list;return n._isStruct||n._isList}function Ua(e){let t=e.toString(16),n=``;return t[0]===`-`&&(t=t.slice(1),n=`-`),`${n}BigInt("0x${t}")`}function Wa(e){let t=e?.docComment;return t?`/**
|
|
64
|
+
`+t.toString().split(`
|
|
65
|
+
`).map(e=>`* ${e}`).join(`
|
|
66
|
+
`)+`
|
|
67
|
+
*/`:``}function Ga(e,t,n,r){let i=r.map(({codeOrder:e},t)=>({fieldIndex:t,codeOrder:e})).sort(Pa).map(({fieldIndex:e})=>e),a=Va(e,n),o=i.map(e=>{let t=r[e];return`
|
|
68
|
+
${Wa(a?.members.at(e))}
|
|
69
|
+
${Aa(t.name)}: ${t.discriminantValue||e}`});e.codeParts.push(`
|
|
70
|
+
export const ${t} = {
|
|
71
|
+
${o.join(`,
|
|
72
|
+
`)}
|
|
73
|
+
} as const;
|
|
74
|
+
|
|
75
|
+
export type ${t} = (typeof ${t})[keyof typeof ${t}];
|
|
76
|
+
`)}function Ka(e,t){qa(e,t),Ya(e,t),Ja(e,t)}function qa(e,t){for(let n of t.interface.methods){let t=$(e,n.paramStructType),r=$(e,n.resultStructType);oo(e,t),oo(e,r),Xa(e,r)}}function Ja(e,t){let n=Q(t),r=`${n}$Server`,i=`${r}$Target`,a=`${n}$Client`,o=t.interface.methods.map(t=>{let n=Q($(e,t.paramStructType)),r=Q($(e,t.resultStructType));return`${t.name}(params: ${n}, results: ${r}): Promise<void>;`}).join(`
|
|
77
|
+
`);e.codeParts.push(`
|
|
78
|
+
export interface ${i} {
|
|
79
|
+
${o}
|
|
80
|
+
}`);let s=[];s.push(`public override readonly target: ${i};`);let c=[],l=0;for(let e of t.interface.methods)c.push(`{
|
|
81
|
+
...${a}.methods[${l}],
|
|
82
|
+
impl: target.${e.name}
|
|
83
|
+
}`),l++;s.push(`
|
|
84
|
+
constructor(target: ${i}) {
|
|
85
|
+
super(target, [
|
|
86
|
+
${c.join(`,
|
|
87
|
+
`)}
|
|
88
|
+
]);
|
|
89
|
+
this.target = target;
|
|
90
|
+
}
|
|
91
|
+
client(): ${a} {
|
|
92
|
+
return new ${a}(this);
|
|
93
|
+
}
|
|
94
|
+
`),e.codeParts.push(`
|
|
95
|
+
export class ${r} extends $.Server {
|
|
96
|
+
${s.join(`
|
|
97
|
+
`)}
|
|
98
|
+
}
|
|
99
|
+
`)}function Ya(e,t){let n=`${Q(t)}$Client`,r=[];r.push(`
|
|
100
|
+
client: $.Client;
|
|
101
|
+
static readonly interfaceId: bigint = ${Ua(t.id)};
|
|
102
|
+
constructor(client: $.Client) {
|
|
103
|
+
this.client = client;
|
|
104
|
+
}
|
|
105
|
+
`);let i=[],a=[],o=[];for(let r=0;r<t.interface.methods.length;r++)Za(e,t,n,i,a,o,r);r.push(`
|
|
106
|
+
static readonly methods:[
|
|
107
|
+
${o.join(`,
|
|
108
|
+
`)}
|
|
109
|
+
] = [
|
|
110
|
+
${a.join(`,
|
|
111
|
+
`)}
|
|
112
|
+
];
|
|
113
|
+
${i.join(`
|
|
114
|
+
`)}
|
|
115
|
+
`),e.codeParts.push(`
|
|
116
|
+
export class ${n} {
|
|
117
|
+
${r.join(`
|
|
118
|
+
`)}
|
|
119
|
+
}
|
|
120
|
+
$.Registry.register(${n}.interfaceId, ${n});
|
|
121
|
+
`)}function Xa(e,t){let n=t.id;if(e.generatedResultsPromiseIds.has(n))return;e.generatedResultsPromiseIds.add(n);let r=Q(t),i=`${r}$Promise`,a=[];a.push(`
|
|
122
|
+
pipeline: $.Pipeline<any, any, ${r}>;
|
|
123
|
+
constructor(pipeline: $.Pipeline<any, any, ${r}>) {
|
|
124
|
+
this.pipeline = pipeline;
|
|
125
|
+
}
|
|
126
|
+
`);let{struct:o}=t,s=o.fields.toArray().sort(Pa),c=t=>{let n,r=!1,i;if(t._isSlot){i=t.slot;let a=i.type;if(a.which()!==Y.INTERFACE)return;r=!0,n=La(e,a,!1)}else if(t._isGroup)return;else throw Error(C(_a,t.which()));let o=n;r&&(n=`${n}$Client`);let{name:s}=t,c=ja(s);a.push(`
|
|
127
|
+
get${c}(): ${n} {
|
|
128
|
+
return new ${n}(this.pipeline.getPipeline(${o}, ${i.offset}).client());
|
|
129
|
+
}
|
|
130
|
+
`)};for(let e of s)c(e);a.push(`
|
|
131
|
+
async promise(): Promise<${r}> {
|
|
132
|
+
return await this.pipeline.struct();
|
|
133
|
+
}
|
|
134
|
+
`),e.codeParts.push(`
|
|
135
|
+
export class ${i} {
|
|
136
|
+
${a.join(`
|
|
137
|
+
`)}
|
|
138
|
+
}
|
|
139
|
+
`)}function Za(e,t,n,r,i,a,o){let s=t.interface.methods[o],{name:c}=s,l=Q($(e,s.paramStructType)),u=Q($(e,s.resultStructType));a.push(`$.Method<${l}, ${u}>`),i.push(`{
|
|
140
|
+
ParamsClass: ${l},
|
|
141
|
+
ResultsClass: ${u},
|
|
142
|
+
interfaceId: ${n}.interfaceId,
|
|
143
|
+
methodId: ${o},
|
|
144
|
+
interfaceName: "${t.displayName}",
|
|
145
|
+
methodName: "${s.name}"
|
|
146
|
+
}`);let d=Wa(Va(e,t)?.members.at(o));r.push(`
|
|
147
|
+
${d}
|
|
148
|
+
${c}(paramsFunc?: (params: ${l}) => void): ${u}$Promise {
|
|
149
|
+
const answer = this.client.call({
|
|
150
|
+
method: ${n}.methods[${o}],
|
|
151
|
+
paramsFunc: paramsFunc
|
|
152
|
+
});
|
|
153
|
+
const pipeline = new $.Pipeline(${u}, answer);
|
|
154
|
+
return new ${u}$Promise(pipeline);
|
|
155
|
+
}
|
|
156
|
+
`)}function Qa(e,t){let n=Ia(t),r=Q(t),i=t.nestedNodes.map(({id:t})=>$(e,t)).filter(e=>!e._isConst&&!e._isAnnotation),a=t.id,o=a.toString(16),s=Ra(t),{struct:c}=t,{dataWordCount:l,discriminantCount:u,discriminantOffset:d,pointerCount:f}=c,p=l*8,m=c.fields.toArray(),h=m.map(({codeOrder:e},t)=>({fieldIndex:t,codeOrder:e})).sort(Pa).map(({fieldIndex:e})=>e),g=m.filter(e=>Ha(e)).sort(Pa),ee=e.nodes.filter(e=>e.scopeId===a&&e._isConst),te=u!==0;te&&Ga(e,r+`_Which`,t,s);let ne=[];ne.push(...ee.map(e=>`static readonly ${Aa(Ia(e))} = ${ro(e.const.value)}`),...s.sort(Pa).map(e=>no(r,e)),...i.map(e=>io(e)));let _=[];for(let e of h){let t=m[e];t._isSlot&&t.slot.hadExplicitDefault&&t.slot.type.which()!==Y.VOID&&_.push(eo(t))}ne.push(`
|
|
157
|
+
public static override readonly _capnp = {
|
|
158
|
+
displayName: "${n}",
|
|
159
|
+
id: "${o}",
|
|
160
|
+
size: new $.ObjectSize(${p}, ${f}),
|
|
161
|
+
${_.join(`,`)}
|
|
162
|
+
}`,...g.map(t=>to(e,t)));for(let n of h){let r=m[n];$a(e,ne,t,r,n)}ne.push(`public override toString(): string { return "${r}_" + super.toString(); }`),te&&ne.push(`
|
|
163
|
+
which(): ${r}_Which {
|
|
164
|
+
return $.utils.getUint16(${d*2}, this) as ${r}_Which;
|
|
165
|
+
}
|
|
166
|
+
`);let v=`
|
|
167
|
+
${Wa(Va(e,t))}
|
|
168
|
+
export class ${r} extends $.Struct {
|
|
169
|
+
${ne.join(`
|
|
170
|
+
`)}
|
|
171
|
+
}`;e.codeParts.push(v),e.concreteLists.push(...g.map(e=>[r,e]))}function $a(e,t,n,r,i){let a,o;if(r._isSlot){let t=r.slot.type;a=La(e,t,!1),o=t.which()}else if(r._isGroup)a=Q($(e,r.group.typeId)),o=`group`;else throw Error(C(_a,r.which()));o===Y.INTERFACE&&(a=`${a}$Client`);let{discriminantOffset:s}=n.struct,{name:c}=r,l=c===`constructor`?`$constructor`:c,u=ja(c),{discriminantValue:d}=r,f=Q(n),p=r._isSlot&&r.slot.hadExplicitDefault,m=p?`, ${f}._capnp.default${u}`:``,h=d!==ni.NO_DISCRIMINANT,g=r._isSlot?r.slot.offset:0,ee=!1,te=!1,ne=!1,_,v,re;switch(o){case Y.ANY_POINTER:ee=!0,te=!0,ne=!0,v=`$.utils.getPointer(${g}, this${m})`,re=`$.utils.copyFrom(value, ${v})`;break;case Y.BOOL:case Y.ENUM:case Y.FLOAT32:case Y.FLOAT64:case Y.INT16:case Y.INT32:case Y.INT64:case Y.INT8:case Y.UINT16:case Y.UINT32:case Y.UINT64:case Y.UINT8:{let{byteLength:e,getter:t,setter:n}=Ca[o],r=g*e;v=`$.utils.${t}(${r}, this${m})`,re=`$.utils.${n}(${r}, value, this${m})`,o===Y.ENUM&&(v=`${v} as ${a}`);break}case Y.DATA:ee=!0,te=!0,ne=!0,v=`$.utils.getData(${g}, this${m})`,re=`$.utils.copyFrom(value, $.utils.getPointer(${g}, this))`,_=`$.utils.initData(${g}, length, this)`;break;case Y.INTERFACE:v=`new ${a}($.utils.getInterfaceClientOrNullAt(${g}, this))`,re=`$.utils.setInterfacePointer(this.segment.message.addCap(value.client), $.utils.getPointer(${g}, this))`;break;case Y.LIST:{let e=r.slot.type.list.elementType.which(),t=Sa[e];if(e===Y.LIST||e===Y.STRUCT)t=`${f}._${u}`;else if(t===void 0)throw Error(C(`CAPNP-ES007 Encountered an unsupported list element type: %d`,e));ee=!0,te=!0,ne=!0,v=`$.utils.getList(${g}, ${t}, this${m})`,re=`$.utils.copyFrom(value, $.utils.getPointer(${g}, this))`,_=`$.utils.initList(${g}, ${t}, length, this)`,e===Y.ENUM&&(v=`${v} as ${a}`,_=`${_} as ${a}`);break}case Y.STRUCT:ee=!0,te=!0,ne=!0,v=`$.utils.getStruct(${g}, ${a}, this${m})`,re=`$.utils.copyFrom(value, $.utils.getPointer(${g}, this))`,_=`$.utils.initStructAt(${g}, ${a}, this)`;break;case Y.TEXT:v=`$.utils.getText(${g}, this${m})`,re=`$.utils.setText(${g}, value, this)`;break;case Y.VOID:break;case`group`:if(p)throw Error(C(`CAPNP-ES000 Don't know how to generate a %s field with an explicit default value.`,`group`));v=`$.utils.getAs(${a}, this)`,_=v;break}if(ee&&t.push(`
|
|
172
|
+
_adopt${u}(value: $.Orphan<${a}>): void {
|
|
173
|
+
${h?`$.utils.setUint16(${s*2}, ${d}, this);`:``}
|
|
174
|
+
$.utils.adopt(value, $.utils.getPointer(${g}, this));
|
|
175
|
+
}
|
|
176
|
+
`),te&&t.push(`
|
|
177
|
+
_disown${u}(): $.Orphan<${a}> {
|
|
178
|
+
return $.utils.disown(this.${c===`constructor`?`$${c}`:c});
|
|
179
|
+
}
|
|
180
|
+
`),v){let r=Wa(Va(e,n)?.members.at(i));t.push(`
|
|
181
|
+
${r}
|
|
182
|
+
get ${l}(): ${a} {
|
|
183
|
+
${h?`$.utils.testWhich(${JSON.stringify(c)}, $.utils.getUint16(${s*2}, this), ${d}, this);`:``}
|
|
184
|
+
return ${v};
|
|
185
|
+
}
|
|
186
|
+
`)}if(ne&&t.push(`
|
|
187
|
+
_has${u}(): boolean {
|
|
188
|
+
return !$.utils.isNull($.utils.getPointer(${g}, this));
|
|
189
|
+
}
|
|
190
|
+
`),_){let e=o===Y.DATA||o===Y.LIST?`length: number`:``;t.push(`
|
|
191
|
+
_init${u}(${e}): ${a} {
|
|
192
|
+
${h?`$.utils.setUint16(${s*2}, ${d}, this);`:``}
|
|
193
|
+
return ${_};
|
|
194
|
+
}
|
|
195
|
+
`)}if(h&&t.push(`
|
|
196
|
+
get _is${u}(): boolean {
|
|
197
|
+
return $.utils.getUint16(${s*2}, this) === ${d};
|
|
198
|
+
}
|
|
199
|
+
`),re||h){let e=re?`value: ${a}`:`_: true`;t.push(`
|
|
200
|
+
set ${l}(${e}) {
|
|
201
|
+
${h?`$.utils.setUint16(${s*2}, ${d}, this);`:``}
|
|
202
|
+
${re?`${re};`:``}
|
|
203
|
+
}
|
|
204
|
+
`)}}function eo(e){let{name:t,slot:n}=e,r=n.type.which(),i=Ca[r],a;switch(r){case J.ANY_POINTER:case J.DATA:case J.LIST:case J.STRUCT:case J.INTERFACE:a=ro(n.defaultValue);break;case J.TEXT:a=JSON.stringify(n.defaultValue.text);break;case J.BOOL:{let e=ro(n.defaultValue),t=n.offset%8;a=`$.${i.mask}(${e}, ${t})`;break}case J.ENUM:case J.FLOAT32:case J.FLOAT64:case J.INT16:case J.INT32:case J.INT64:case J.INT8:case J.UINT16:case J.UINT32:case J.UINT64:case J.UINT8:{let e=ro(n.defaultValue);a=`$.${i.mask}(${e})`;break}default:throw Error(C(`CAPNP-ES010 Don't know how to generate a default value for %s fields.`,r))}return`default${ja(t)}: ${a}`}function to(e,t){return`static ${`_${ja(t.name)}`}: ${La(e,t.slot.type,!0)};`}function no(e,t){let n=Aa(t.name);return`static readonly ${n} = ${`${e}_Which.${n}`};`}function ro(e){let t;switch(e.which()){case Z.BOOL:return e.bool?`true`:`false`;case Z.ENUM:return String(e.enum);case Z.FLOAT32:return String(e.float32);case Z.FLOAT64:return String(e.float64);case Z.INT8:return String(e.int8);case Z.INT16:return String(e.int16);case Z.INT32:return String(e.int32);case Z.INT64:return Ua(e.int64);case Z.UINT8:return String(e.uint8);case Z.UINT16:return String(e.uint16);case Z.UINT32:return String(e.uint32);case Z.UINT64:return Ua(e.uint64);case Z.TEXT:return JSON.stringify(e.text);case Z.VOID:return`undefined`;case Z.ANY_POINTER:t=e.anyPointer;break;case Z.DATA:t=e.data;break;case Z.LIST:t=e.list;break;case Z.STRUCT:t=e.struct;break;case Z.INTERFACE:G(`interface`,B(0,e),17,e),t=z(0,e);break;default:throw Error(C(`CAPNP-ES004 Don't know how to serialize a value of kind %s.`,e.which()))}let n=new Yi;n.setRoot(t);let r=new Uint8Array(n.toPackedArrayBuffer()),i=[];for(let e=0;e<r.byteLength;e++)i.push(`0x${nn(r[e].toString(16),2)}`);return`$.readRawPointer(new Uint8Array([${i.join(`,`)}]).buffer)`}function io(e){return`static readonly ${Ia(e)} = ${Q(e)};`}function ao(e,t){let n=Ia(t),r=Q(t),i=t.nestedNodes.map(t=>$(e,t)).filter(e=>!e._isConst&&!e._isAnnotation),a=t.id,o=a.toString(16),s=e.nodes.filter(e=>e.scopeId===a&&e._isConst),c=[];c.push(...s.map(e=>`static readonly ${Aa(Ia(e))} = ${ro(e.const.value)}`),...i.map(e=>io(e)),`static readonly Client = ${r}$Client;
|
|
205
|
+
static readonly Server = ${r}$Server;
|
|
206
|
+
public static override readonly _capnp = {
|
|
207
|
+
displayName: "${n}",
|
|
208
|
+
id: "${o}",
|
|
209
|
+
size: new $.ObjectSize(0, 0),
|
|
210
|
+
}
|
|
211
|
+
public override toString(): string { return "${r}_" + super.toString(); }`);let l=`
|
|
212
|
+
${Wa(Va(e,t))}
|
|
213
|
+
export class ${r} extends $.Interface {
|
|
214
|
+
${c.join(`
|
|
215
|
+
`)}
|
|
216
|
+
}`;Ka(e,t),e.codeParts.push(l)}function oo(e,t){let n=t.id,r=n.toString(16);if(e.generatedNodeIds.has(r))return;e.generatedNodeIds.add(r);let i=t.nestedNodes.map(t=>$(e,t));for(let t of i)oo(e,t);let a=e.nodes.filter(e=>e.scopeId===n&&e._isStruct&&e.struct.isGroup);for(let t of a)oo(e,t);let o=t.which();switch(o){case Xr.STRUCT:Qa(e,t);break;case Xr.CONST:break;case Xr.ENUM:Ga(e,Q(t),t,t.enum.enumerants.toArray());break;case Xr.INTERFACE:ao(e,t);break;case Xr.ANNOTATION:break;default:throw Error(C(`CAPNP-ES003 Don't know how to generate a "%s" node.`,o))}}var so=class{files=[]},co=class{constructor(e,t){this.req=e,this.file=t,this.nodes=e.nodes.toArray(),this.imports=t.imports.toArray()}nodes;imports;concreteLists=[];generatedNodeIds=new Set;generatedResultsPromiseIds=new Set;tsPath=``;codeParts=[];toString(){return this.file?.filename??`CodeGeneratorFileContext()`}};function lo(e){e.codeParts.push(`export const _capnpFileId = BigInt("0x${e.file.id.toString(16)}");`)}function uo(e,t,n){let r=`_${ja(n.name)}`,i=Fa(e,n.slot.type);e.codeParts.push(`${t}.${r} = ${i};`)}function fo(e){let t=$(e,e.file),n=Na(`e37ded525a68a7c9`),r=e.nodes.find(e=>e.id===n)?.nestedNodes.find(e=>e.name===`importPath`),i=r&&t.annotations.find(e=>e.id===r.id),a=i===void 0?`@stryke/capnp`:i.value.text;e.codeParts.push(`import * as $ from '${a}';`)}function po(e){for(let t of e.imports){let{name:n}=t,r;n.startsWith(`/capnp/`)?r=`@stryke/capnp/schemas/${n.slice(7).replace(/\.capnp$/,``)}`:(r=n.replace(/\.capnp$/,``),r[0]!==`.`&&(r=`./${r}`));let i=mo(e,$(e,t)).flatMap(e=>{let t=Q(e);return e._isInterface?[t,`${t}$Client`]:t}).sort().join(`, `);i.length!==0&&e.codeParts.push(`import { ${i} } from "${r}";`)}}function mo(e,t,n=new Set){n.add(t.id);let r=t.nestedNodes.filter(({id:t})=>za(e,t)).filter(({id:e})=>!n.has(e)).map(({id:t})=>$(e,t)).filter(e=>e._isStruct||e._isEnum||e._isInterface);return r.concat(r.flatMap(t=>mo(e,t,n)))}async function ho(e,t){let n=new Yi(e,!1).getRoot(Ei),r=new so;if(r.files=n.requestedFiles.map(e=>Ba(n,e)),r.files.length===0)throw Error(GEN_NO_FILES);let i=new Map(r.files.map(e=>[e.tsPath,go(e)]));if(i.size===0)throw Error(GEN_NO_FILES);if((t?.dts===!0||t?.js===!0)&&_o(i,t?.dts===!0,t?.js===!0,t?.tsconfig),!t?.ts)for(let[e]of i)e.endsWith(`.ts`)&&!e.endsWith(`.d.ts`)&&i.delete(e);return{ctx:r,files:i}}function go(e){fo(e),po(e),lo(e);let t=$(e,e.file).nestedNodes.map(t=>$(e,t));for(let n of t)oo(e,n);for(let[t,n]of e.concreteLists)uo(e,t,n);let n=g.default.createSourceFile(e.tsPath,e.codeParts.map(e=>e.toString()).join(``),g.default.ScriptTarget.Latest,!1,g.default.ScriptKind.TS);return`
|
|
217
|
+
/* eslint-disable */
|
|
218
|
+
// biome-ignore lint: disable
|
|
219
|
+
|
|
220
|
+
// Generated by storm-capnpc
|
|
221
|
+
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
222
|
+
|
|
223
|
+
`+g.default.createPrinter().printFile(n)}function _o(e,t,n,r){if(!t&&!n)return;let i={moduleResolution:g.default.ModuleResolutionKind.Bundler,target:g.default.ScriptTarget.ESNext,strict:!0,...r,noEmitOnError:!1,noFallthroughCasesInSwitch:!0,preserveConstEnums:!0,noImplicitReturns:!0,noUnusedLocals:!1,noUnusedParameters:!1,removeComments:!1,skipLibCheck:!0,sourceMap:!1,emitDeclarationOnly:t&&!n,declaration:t},a=g.default.createCompilerHost(i);a.writeFile=(t,n)=>{e.set(t,n)};let o=a.readFile;a.readFile=t=>e.has(t)?e.get(t):o(t);let s=g.default.createProgram([...e.keys()],i,a),c=s.emit(),l=[...g.default.getPreEmitDiagnostics(s),...c.diagnostics];if(l.length>0){for(let e of l){let t=g.default.flattenDiagnosticMessageText(e.messageText,`
|
|
224
|
+
`);if(e.file&&e.start){let{line:n,character:r}=e.file.getLineAndCharacterOfPosition(e.start);console.log(`${e.file.fileName}:${n+1}:${r+1} ${t}`)}else console.log(`==> ${t}`)}throw Error(`CAPNP-ES009 Failed to transpile emitted schema source code; see above for error messages.`)}}function vo(e){return e??=[],Array.isArray(e)?e:[e]}async function yo(e){let t=e.tsconfigPath?e.tsconfigPath.replace(`{projectRoot}`,e.projectRoot).replace(`{workspaceRoot}`,e.workspaceRoot):(0,h.joinPaths)(e.projectRoot,`tsconfig.json`),n=vo(e.schemas?e.schemas:(0,h.joinPaths)(e.projectRoot,`schemas/**/*.capnp`)).filter(Boolean).map(t=>t.replace(`{projectRoot}`,e.projectRoot).replace(`{workspaceRoot}`,e.workspaceRoot)),r;if(e.tsconfig)r=e.tsconfig;else{if(!t||!(0,p.existsSync)(t)){let e=t?`✖ The specified TypeScript configuration file "${t}" does not exist. Please provide a valid path.`:`✖ The specified TypeScript configuration file does not exist. Please provide a valid path.`;throw xe(e,{logLevel:`all`}),Error(e)}if(r=(0,g.parseJsonConfigFileContent)(await(0,te.readJsonFile)(t),g.sys,(0,m.findFilePath)(t)),!r){let e=`✖ The specified TypeScript configuration file "${t}" is invalid. Please provide a valid configuration.`;throw xe(e,{logLevel:`all`}),Error(e)}r.options.configFilePath=t,r.options.noImplicitOverride=!1,r.options.noUnusedLocals=!1,r.options.noUnusedParameters=!1}let i=[];for(let e of n){let t=e;!e.endsWith(`.capnp`)&&!e.includes(`*`)&&(t=`${e.replace(/\/$/g,``)}/*.capnp`),i.push(...await(0,ne.listFiles)(t))}if(i.length===0||!i[0])return Ce(`✖ No Cap'n Proto schema files found in the specified source paths: ${n.join(`, `)}. As a result, the Cap'n Proto compiler will not be able to generate any output files. Please ensure that the paths are correct and contain .capnp files.`,{logLevel:`all`}),null;let a=e.output?e.output.replace(`{projectRoot}`,e.projectRoot).replace(`{workspaceRoot}`,e.workspaceRoot):(0,h.joinPaths)(e.projectRoot,(0,m.relativePath)(t?(0,m.findFilePath)(t):e.projectRoot,(0,h.joinPaths)(e.workspaceRoot,i[0].endsWith(`.capnp`)?(0,m.findFilePath)(i[0]):i[0])));return r.options.outDir=a,{...e,importPath:e.importPath?e.importPath.split(`,`).map(e=>e.trim()):[],workspaceRoot:e.workspaceRoot,projectRoot:e.projectRoot,schemas:i,output:a,js:e.js===!0,ts:e.noTs!==!0,dts:e.dts??e.noDts!==!0,tsconfig:r}}async function bo(e){let{output:t,tsconfig:n,schemas:r=[],tty:i}=e,a=ee.Buffer.alloc(0);if(i){let e=[];process.stdin.on(`data`,t=>{e.push(t)}),await new Promise(e=>{process.stdin.on(`end`,e)});let t=ee.Buffer.alloc(e.reduce((e,t)=>e+t.byteLength,0)),n=0;for(let r of e)r.copy(t,n),n+=r.byteLength;a=t}if(a.byteLength===0){let e=[];t&&(0,p.existsSync)(t)?e.push(`-o-:${t}`):(t&&!(0,p.existsSync)(t)&&Ce(`Output directory "${t}" does not exist, will write to schema path...`),e.push(`-o-`)),a=await new Promise(t=>{(0,l.exec)(`capnpc ${e.join(` `)} ${r.join(` `)}`,{encoding:`buffer`},(e,n,r)=>{if(r.length>0&&process.stderr.write(r),e)throw e;t(n)})})}return ho(a,{ts:e.ts??!0,js:!1,dts:!1,tsconfig:n.options})}const xo=e=>async t=>{if(!t.projectRoot)throw Error(`✖ The project root directory must be specified using the -p or --project-root option.`);let n=await yo({workspaceRoot:e,...t,tsconfig:void 0,tsconfigPath:t.tsconfig,schemas:t.schema});if(!n){Ce(`✖ Unable to resolve Cap'n Proto compiler options - the program will terminate`,{logLevel:`all`});return}we(`📦 Storm Cap'n Proto Compiler will output ${n.ts?`TypeScript code`:``}${n.js?n.ts?`, JavaScript code`:`JavaScript code`:``}${n.dts?n.ts||n.js?`, TypeScript declarations`:`TypeScript declarations`:``} files from schemas at ${t.schema?t.schema.replace(`{projectRoot}`,n.projectRoot).replace(`{workspaceRoot}`,n.workspaceRoot):n.projectRoot} to ${n.tsconfig.options.outDir}...`,{logLevel:`all`});let r=await bo(n);if(r.files.size===0){Ce(`⚠️ No files were generated. Please check your schema files.`,{logLevel:`all`});return}we(`📋 Writing ${r.files.size} generated files to disk...`,{logLevel:`all`});for(let[e,n]of r.files){let r=e;if(!(0,p.existsSync)((0,m.findFilePath)(r))){let e=`/${r}`;(0,p.existsSync)((0,m.findFilePath)(e))&&(r=e)}t.output&&(r=(0,h.joinPaths)(t.output,e),(0,p.existsSync)((0,m.findFilePath)(t.output))||Ce(`Output directory "${(0,m.findFilePath)(t.output)}" does not exist, it will be created...`)),await(0,f.writeFile)(r,n.replace(/^\s+/gm,e=>` `.repeat(e.length/2)))}Te(`⚡ Storm Cap'n Proto Compiler completed successfully.`,{logLevel:`all`})};function So(){we(`⚡ Running Storm Cap'n Proto Compiler Tools`,{logLevel:`all`});let e=Ke(process.cwd());process.env.STORM_WORKSPACE_ROOT??=e,process.env.NX_WORKSPACE_ROOT_PATH??=e,e&&process.chdir(e);let t=new ct;return t.name(`storm-capnpc`).description(`Run the Storm Cap'n Proto compiler`).version(`1.0.0`,`-v --version`,`display CLI version`),t.command(`compile`,{isDefault:!0}).option(`-p --project-root <path>`,`The path to the project root directory`).option(`-s --schema <path>`,`The directory (or a glob to the directory) containing the Cap'n Proto schema files to compile (default: current working directory)`).option(`-o --output <path>`,`The directory to output the generated files to`).option(`--tsconfig <path>`,`The path to the TypeScript configuration file to use for compilation`).option(`--skip-generating-id`,`Skip generating a new 64-bit unique ID for use in a Cap'n Proto schema`).option(`--no-standard-imports`,`Skip adding default import paths; use only those specified by -I`).option(`--no-ts`,`An indicator to disable generation of TypeScript files`).option(`--js`,`An indicator to generate JavaScript files`).option(`--dts`,`An indicator to generate TypeScript declaration files`).option(`--no-dts`,`An indicator to disable generation of TypeScript declaration files`).option(`-w --workspace-root <path>`,`The path to the workspace root directory`,e||process.cwd()).option(`--tty`,`An indicator to enable TTY mode for the compiler`).action(xo(e)),t}(async()=>{try{Me(),await So().parseAsync(process.argv),je()}catch(e){xe(`✖ A fatal error occurred while running the Storm Cap'n Proto compiler tool:
|
|
8
225
|
${e?.message?e?.name?`[${e.name}]: ${e.message}`:e.message:JSON.stringify(e)}${e?.stack?`
|
|
9
226
|
|
|
10
|
-
Stack Trace: ${e.stack}`:``}`,{logLevel:`all`}),(
|
|
227
|
+
Stack Trace: ${e.stack}`:``}`,{logLevel:`all`}),Ae()}})(),exports.createProgram=So;
|