@stryke/capnp 0.12.45 → 0.12.46
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.mjs.map +1 -1
- package/dist/_virtual/rolldown_runtime.cjs +1 -0
- package/dist/_virtual/rolldown_runtime.mjs +1 -0
- package/dist/compile.cjs +1 -1
- package/dist/compile.d.cts +40 -3
- package/dist/compile.d.cts.map +1 -0
- package/dist/compile.d.mts +40 -3
- package/dist/compile.d.mts.map +1 -0
- package/dist/compile.mjs +2 -1
- package/dist/compile.mjs.map +1 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.d.cts +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/helpers.mjs +2 -1
- package/dist/helpers.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/packages/convert/src/to-array.cjs +1 -0
- package/dist/packages/convert/src/to-array.mjs +2 -0
- package/dist/packages/convert/src/to-array.mjs.map +1 -0
- package/dist/rpc-helpers.cjs +1 -1
- package/dist/rpc-helpers.mjs +1 -1
- package/dist/rpc-helpers.mjs.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +55 -2
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +55 -2
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +2 -1
- package/dist/types.mjs.map +1 -0
- package/package.json +9 -9
- package/schemas/_virtual/rolldown_runtime.cjs +1 -0
- package/schemas/_virtual/rolldown_runtime.mjs +1 -0
- package/schemas/packages/capnp/src/compile.cjs +1 -0
- package/{dist/compile-DccxA7WZ.d.cts → schemas/packages/capnp/src/compile.d.mts} +4 -4
- package/{dist/compile-DccxA7WZ.d.cts.map → schemas/packages/capnp/src/compile.d.mts.map} +1 -1
- package/schemas/packages/capnp/src/compile.mjs +1 -0
- package/schemas/packages/capnp/src/helpers.cjs +1 -0
- package/schemas/packages/capnp/src/helpers.mjs +1 -0
- package/schemas/packages/capnp/src/index.cjs +1 -0
- package/schemas/packages/capnp/src/index.d.mts +13 -0
- package/schemas/packages/capnp/src/index.d.mts.map +1 -0
- package/schemas/packages/capnp/src/index.mjs +1 -0
- package/{dist/types-D03SjfBL.d.mts → schemas/packages/capnp/src/types.d.mts} +2 -2
- package/{dist/types-D03SjfBL.d.mts.map → schemas/packages/capnp/src/types.d.mts.map} +1 -1
- package/schemas/persistent.cjs +1 -1
- package/schemas/persistent.d.cts +1 -1
- package/schemas/persistent.d.mts +1 -1
- package/schemas/persistent.mjs +1 -1
- package/schemas/persistent.mjs.map +1 -1
- package/schemas/rpc-twoparty.cjs +1 -1
- package/schemas/rpc-twoparty.d.cts +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.cts +1 -1
- package/schemas/rpc.d.mts +1 -1
- package/schemas/rpc.mjs +1 -1
- package/schemas/rpc.mjs.map +1 -1
- package/schemas/schema.cjs +1 -1
- package/schemas/schema.d.cts +1 -1
- package/schemas/schema.d.mts +1 -1
- package/schemas/schema.mjs +1 -1
- package/schemas/schema.mjs.map +1 -1
- package/{dist/compile-UkKIpqrK.d.mts → schemas/src/compile.d.cts} +4 -4
- package/schemas/src/compile.d.cts.map +1 -0
- package/schemas/src/index.d.cts +13 -0
- package/schemas/src/index.d.cts.map +1 -0
- package/{dist/types-D52qMMoK.d.cts → schemas/src/types.d.cts} +2 -2
- package/schemas/src/types.d.cts.map +1 -0
- package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs +0 -12
- package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs.map +0 -1
- package/dist/capnp-es.GpvEvMIK-xNDcbmgx.cjs +0 -11
- package/dist/compile-ChbJ-p6B.cjs +0 -169
- package/dist/compile-DJUj4hs3.mjs +0 -163
- package/dist/compile-DJUj4hs3.mjs.map +0 -1
- package/dist/compile-UkKIpqrK.d.mts.map +0 -1
- package/dist/dist-C1gSYYrg.cjs +0 -1
- package/dist/dist-CK47iMja.mjs +0 -2
- package/dist/dist-CK47iMja.mjs.map +0 -1
- package/dist/helpers-BoKbpcuO.mjs +0 -27
- package/dist/helpers-BoKbpcuO.mjs.map +0 -1
- package/dist/helpers-DSMRKdw1.cjs +0 -26
- package/dist/types-BujoAx-K.mjs +0 -2
- package/dist/types-BujoAx-K.mjs.map +0 -1
- package/dist/types-D52qMMoK.d.cts.map +0 -1
- package/dist/types-D6FuBB1k.cjs +0 -1
- package/schemas/index-BAJMwFip.d.mts +0 -96
- package/schemas/index-BAJMwFip.d.mts.map +0 -1
- package/schemas/index-b7dam4EA.d.cts +0 -96
- package/schemas/index-b7dam4EA.d.cts.map +0 -1
- package/schemas/src-CGrmR2BO.cjs +0 -11
- package/schemas/src-DqIy7I3p.mjs +0 -12
- package/schemas/src-DqIy7I3p.mjs.map +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var e=(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))(e||{});const t=new DataView(new ArrayBuffer(8));new Uint16Array(t.buffer)[0]=258;const n=4096,r=64<<20,i=7,a=8192,o=2147483647,s=4294967295,c=4096,l=t.getUint8(0)===2,u=2,d=4,f=3,p=2147483647,m=4294967295,h=`CAPNP-TS000 Unreachable code detected.`;function ee(e){throw Error(`CAPNP-TS000 Unreachable code detected. (never block hit with: ${e})`)}const te=`CAPNP-TS001 Attempted to parse an invalid message frame header; are you sure this is a Cap'n Proto message?`,ne=`CAPNP-TS003 Attempted to pack a message that was not word-aligned.`,re=`CAPNP-TS004 Segment ID %X is out of bounds for message %s.`,ie=`CAPNP-TS005 First segment must have at least enough room to hold the root pointer (8 bytes).`,ae=`CAPNP-TS006 %s is not implemented.`,oe=`CAPNP-TS008 Attempted to adopt %s into a pointer in a different message %s.`,se=`CAPNP-TS009 Attempted to adopt %s more than once.`,ce=`CAPNP-TS010 Attempted to set a composite list without providing a composite element size.`,le=`CAPNP-TS011 Nesting depth limit exceeded for %s.`,ue=`CAPNP-TS013 Attempted to initialize a struct member from a composite list (%s).`,de=`CAPNP-TS015 Target of a far pointer (%s) is another far pointer.`,fe=`CAPNP-TS016 Invalid list element size: %x.`,pe=`CAPNP-TS017 Invalid pointer type: %x.`,me=`CAPNP-TS018 Attempted to access getter on %s for union field %s that is not currently set (wanted: %d, found: %d).`,he=`CAPNP-TS019 Pointer offset %a is out of bounds for underlying buffer.`,ge=`CAPNP-TS020 Attempted to access out-of-bounds struct data (struct: %s, %d bytes at %a, data words: %d).`,_e=`CAPNP-TS021 Attempted to access out-of-bounds struct pointer (%s, index: %d, length: %d).`,ve=`CAPNP-TS022 Traversal limit exceeded! Slow down! %s`,ye=`CAPNP-TS023 Cannot convert %s to a %s list.`,be=`CAPNP-TS024 Attempted to convert pointer %s to a %s type.`,xe=`CAPNP-TS035 Attempted to get a segment other than 0 (%d) from a single segment arena.`,Se=`CAPNP-TS036 Attempted to get an out-of-bounds segment (%d).`,Ce=`CAPNP-TS037 Segment buffer length %d is not a multiple of 8.`,we=`CAPNP-TS038 Attempted to replace a segment buffer with one that is smaller than the allocated space.`,Te=`CAPNP-TS039 Requested size %x exceeds maximum value (${m}).`,Ee=`CAPNP-TS040 Must provide a composite element size for composite list pointers.`,g=`CAPNP-TS045: Cannot call mutative methods on an immutable list.`,_=`CAPNP-TS046: Search is not supported for list.`,De=`CAPNP-TS100 Call on null client.`,Oe=`CAPNP-TS101 Promised answer call queue full.`,ke=`CAPNP-TS102 Queue call canceled.`,Ae=`CAPNP-TS105 Ref() called on zeroed refcount.`,je=`CAPNP-TS106 Call on closed import.`,Me=`CAPNP-TS107 Method not implemented.`,Ne=`CAPNP-TS109 Target not found.`,Pe=`CAPNP-TS111 Received return for unknown question (id=%s).`,Fe=`CAPNP-TS112 Attempted to re-use question id (%s).`,Ie=`CAPNP-TS113 Capability table references unknown export ID (%s).`,Le=`CAPNP-TS114 Capability table references unknown answer ID (%s).`,Re=`CAPNP-TS115 Unknown cap descriptor type (which: %s).`,ze=`CAPNP-TS116 RPC method failed at %s.%s(): %s`,Be=`CAPNP-TS117 RPC call failed, reason: %s`,Ve=`CAPNP-TS118 Received bootstrap message without main interface set.`,He=`CAPNP-TS119 Received finish message for unknown answer ID (%s).`,Ue=`CAPNP-TS120 Fulfill called more than once for question (%s).`;function We(e){let t=new Uint8Array(e),n=[];for(let e=0;e<t.byteLength;e++)n.push(y(t[e].toString(16),2));return`[${n.join(` `)}]`}function Ge(e){let t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=Math.min(t.byteLength,8192),r=v(`
|
|
2
|
-
=== buffer[%d] ===`,n);for(let e=0;e<n;e+=16){r+=`
|
|
3
|
-
${y(e.toString(16),8)}: `;let n=``,i;for(i=0;i<16&&e+i<t.byteLength;i++){let a=t[e+i];r+=`${y(a.toString(16),2)} `,n+=a>31&&a<255?String.fromCharCode(a):`·`,i===7&&(r+=` `)}r+=`${` `.repeat((17-i)*3)}${n}`}return r+=`
|
|
4
|
-
`,n!==t.byteLength&&(r+=v(`=== (truncated %d bytes) ===
|
|
5
|
-
`,t.byteLength-n)),r}function v(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`+y(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 y(e,t,n=`0`){return e.length>=t?e:Array.from({length:t-e.length+1}).join(n)+e}function b(e){return e+7&-8}var Ke=class{constructor(e,t){this.dataByteLength=e,this.pointerLength=t}toString(){return v(`ObjectSize_dw:%d,pc:%d`,qe(this),this.pointerLength)}};function x(e){return e.dataByteLength+e.pointerLength*8}function qe(e){return e.dataByteLength/8}function S(e){return e.dataByteLength/8+e.pointerLength}function Je(e){return new Ke(b(e.dataByteLength),e.pointerLength)}var Ye=class{_capnp;byteOffset;segment;constructor(t){let n=D(t);switch(this.segment=n.segment,this.byteOffset=n.byteOffset,this._capnp={},this._capnp.type=N(t),this._capnp.type){case B.STRUCT:this._capnp.size=P(t);break;case B.LIST:this._capnp.length=M(t),this._capnp.elementSize=j(t),this._capnp.elementSize===e.COMPOSITE&&(this._capnp.size=dt(t));break;case B.OTHER:this._capnp.capId=rt(t);break;default:throw Error(pe)}tt(t)}_moveTo(t){if(this._capnp===void 0)throw Error(v(`CAPNP-TS009 Attempted to adopt %s more than once.`,this));if(this.segment.message!==t.segment.message)throw Error(v(`CAPNP-TS008 Attempted to adopt %s into a pointer in a different message %s.`,this,t));T(t);let n=F(this.segment,this.byteOffset,t);switch(this._capnp.type){case B.STRUCT:R(n.offsetWords,this._capnp.size,n.pointer);break;case B.LIST:{let{offsetWords:t}=n;this._capnp.elementSize===e.COMPOSITE&&t--,L(t,this._capnp.elementSize,this._capnp.length,n.pointer,this._capnp.size);break}case B.OTHER:ht(this._capnp.capId,n.pointer);break;default:throw Error(pe)}this._capnp=void 0}dispose(){if(this._capnp!==void 0){switch(this._capnp.type){case B.STRUCT:this.segment.fillZeroWords(this.byteOffset,S(this._capnp.size));break;case B.LIST:{let e=$e(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 v(`Orphan_%d@%a,type:%s`,this.segment.id,this.byteOffset,this._capnp&&this._capnp.type)}};function Xe(e,t){e._moveTo(t)}function Ze(e){return new Ye(e)}function Qe(e){return We(e.segment.buffer.slice(e.byteOffset,e.byteOffset+8))}function $e(t,n,r){switch(t){case e.BIT:return b(n+7>>>3);case e.BYTE:case e.BYTE_2:case e.BYTE_4:case e.BYTE_8:case e.POINTER:case e.VOID:return b(C(t)*n);case e.COMPOSITE:if(r===void 0)throw Error(v(fe,NaN));return n*b(x(r));default:throw Error(fe)}}function C(t){switch(t){case e.BIT:return NaN;case e.BYTE:return 1;case e.BYTE_2:return 2;case e.BYTE_4:return 4;case e.BYTE_8:case e.POINTER:return 8;case e.COMPOSITE:return NaN;case e.VOID:return 0;default:throw Error(v(fe,t))}}function et(e,t){return new V(t.segment,t.byteOffset+e,t._capnp.depthLimit)}function w(e,t){if(!(t.segment===e.segment&&t.byteOffset===e.byteOffset)&&(T(t),!I(e)))switch(N(e)){case B.STRUCT:yt(e,t);break;case B.LIST:vt(e,t);break;case B.OTHER:_t(e,t);break;default:throw Error(v(pe,N(t)))}}function T(t){if(I(t))return;let n;switch(N(t)){case B.STRUCT:{let e=P(t);n=D(t),n.segment.fillZeroWords(n.byteOffset,e.dataByteLength/8);for(let t=0;t<e.pointerLength;t++)T(et(t*8,n));break}case B.LIST:{let r=j(t),i=M(t),a=b(i*C(r));if(n=D(t),r===e.POINTER){for(let e=0;e<i;e++)T(new V(n.segment,n.byteOffset+e*8,t._capnp.depthLimit-1));break}else if(r===e.COMPOSITE){let e=et(-8,n),r=A(e),o=x(r);a=O(e),n.segment.setWordZero(n.byteOffset-8);for(let e=0;e<i;e++)for(let i=0;i<r.pointerLength;i++)T(new V(n.segment,n.byteOffset+e*o+i*8,t._capnp.depthLimit-1))}n.segment.fillZeroWords(n.byteOffset,a);break}case B.OTHER:break;default:throw Error(v(pe,N(t)))}tt(t)}function tt(e){if(k(e)===B.FAR){let t=nt(e);ft(e)&&t.segment.setWordZero(t.byteOffset+8),t.segment.setWordZero(t.byteOffset)}e.segment.setWordZero(e.byteOffset)}function nt(e){return new V(e.segment.message.getSegment(e.segment.getUint32(e.byteOffset+4)),(e.segment.getUint32(e.byteOffset)>>>3)*8,e._capnp.depthLimit-1)}function E(e){if(k(e)===B.FAR){let t=nt(e);return ft(e)&&(t.byteOffset+=8),t}return e}function rt(e){return e.segment.getUint32(e.byteOffset+4)}function it(t){return N(t)===B.LIST&&j(t)===e.COMPOSITE}function D(e,t){let n;if(ft(e)){let t=nt(e);n=new V(e.segment.message.getSegment(at(t)),O(t)*8)}else{let t=E(e);n=new V(t.segment,t.byteOffset+8+O(t)*8)}return it(e)&&(n.byteOffset+=8),!t&&e._capnp.compositeIndex!==void 0&&(n.byteOffset-=8,n.byteOffset+=8+e._capnp.compositeIndex*x(Je(A(n)))),n}function at(e){return e.segment.getUint32(e.byteOffset+4)}function ot(e){return e.segment.getUint32(e.byteOffset+4)&7}function st(e){return e.segment.getUint32(e.byteOffset+4)>>>3}function O(e){let t=e.segment.getInt32(e.byteOffset);return t&2?t>>3:t>>2}function k(e){return e.segment.getUint32(e.byteOffset)&3}function ct(e){return e.segment.getUint16(e.byteOffset+4)}function lt(e){return e.segment.getUint16(e.byteOffset+6)}function A(e){return new Ke(ct(e)*8,lt(e))}function ut(e){let t=D(e);return t.byteOffset-=8,t}function dt(e){return A(ut(e))}function j(e){return ot(E(e))}function M(t){let n=E(t);return ot(n)===e.COMPOSITE?O(ut(t)):st(n)}function N(e){let t=k(E(e));if(t===B.FAR)throw Error(v(`CAPNP-TS015 Target of a far pointer (%s) is another far pointer.`,e));return t}function P(e){return A(E(e))}function F(e,t,n){if(n.segment!==e){if(!e.hasCapacity(8)){let r=n.segment.allocate(16);return mt(!0,r.byteOffset/8,r.segment.id,n),mt(!1,t/8,e.id,r),r.byteOffset+=8,new xt(r,0)}let r=e.allocate(8);if(r.segment.id!==e.id)throw Error(h);return mt(!1,r.byteOffset/8,r.segment.id,n),new xt(r,(t-r.byteOffset-8)/8)}return new xt(n,(t-n.byteOffset-8)/8)}function ft(e){return k(e)===B.FAR&&(e.segment.getUint32(e.byteOffset)&4)!=0}function I(e){return e.segment.isWordZero(e.byteOffset)}function pt(e,t){let n=E(t),r=n.segment.getUint8(n.byteOffset)&3,i=n.segment.getUint32(n.byteOffset+4);T(e);let a=F(n.segment,n.byteOffset+8+O(n)*8,e);a.pointer.segment.setUint32(a.pointer.byteOffset,r|a.offsetWords<<2),a.pointer.segment.setUint32(a.pointer.byteOffset+4,i),tt(t)}function mt(e,t,n,r){let i=B.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 ht(e,t){t.segment.setUint32(t.byteOffset,B.OTHER),t.segment.setUint32(t.byteOffset+4,e)}function gt(e){return e.segment.getUint32(e.byteOffset+4)}function L(t,n,r,i,a){let o=B.LIST,s=t,c=n,l=r;if(n===e.COMPOSITE){if(a===void 0)throw TypeError(`CAPNP-TS040 Must provide a composite element size for composite list pointers.`);l*=S(a)}i.segment.setUint32(i.byteOffset,o|s<<2),i.segment.setUint32(i.byteOffset+4,c|l<<3)}function R(e,t,n){let r=B.STRUCT,i=e,a=qe(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 z(t,n,r){if(I(n))return;let i=E(n);if((i.segment.getUint32(i.byteOffset)&3)!==t)throw Error(v(`CAPNP-TS024 Attempted to convert pointer %s to a %s type.`,n,t));if(r!==void 0&&(i.segment.getUint32(i.byteOffset+4)&7)!==r)throw Error(v(`CAPNP-TS023 Cannot convert %s to a %s list.`,n,e[r]))}function _t(e,t){let n=gt(e);if(n<0)return;let r=e.segment.message._capnp.capTable;if(!r)return;let i=r[n];i&&ht(t.segment.message.addCap(i),t)}function vt(t,n){if(n._capnp.depthLimit<=0)throw Error(le);let r=D(t),i=j(t),a=M(t),o,s,c;if(i===e.POINTER){c=n.segment.allocate(a<<3);for(let e=0;e<a;e++)w(new V(r.segment,r.byteOffset+(e<<3),t._capnp.depthLimit-1),new V(c.segment,c.byteOffset+(e<<3),n._capnp.depthLimit-1))}else if(i===e.COMPOSITE){if(o=Je(dt(t)),s=x(o),c=n.segment.allocate(x(o)*a+8),c.segment.copyWord(c.byteOffset,r.segment,r.byteOffset-8),o.dataByteLength>0){let e=S(o)*a;c.segment.copyWords(c.byteOffset+8,r.segment,r.byteOffset,e)}for(let e=0;e<a;e++)for(let i=0;i<o.pointerLength;i++){let a=e*s+o.dataByteLength+(i<<3);w(new V(r.segment,r.byteOffset+a,t._capnp.depthLimit-1),new V(c.segment,c.byteOffset+a+8,n._capnp.depthLimit-1))}}else{let t=b(i===e.BIT?a+7>>>3:C(i)*a),o=t>>>3;c=n.segment.allocate(t),c.segment.copyWords(c.byteOffset,r.segment,r.byteOffset,o)}let l=F(c.segment,c.byteOffset,n);L(l.offsetWords,i,a,l.pointer,o)}function yt(e,t){if(t._capnp.depthLimit<=0)throw Error(le);let n=D(e),r=P(e),i=qe(r),a=t.segment.allocate(x(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;w(new V(n.segment,n.byteOffset+o,e._capnp.depthLimit-1),new V(a.segment,a.byteOffset+o,t._capnp.depthLimit-1))}if(t._capnp.compositeList)return;let o=F(a.segment,a.byteOffset,t);R(o.offsetWords,r,o.pointer)}function bt(e,t){if(e._capnp.traversalLimit-=8,e._capnp.traversalLimit<=0)throw Error(v(`CAPNP-TS022 Traversal limit exceeded! Slow down! %s`,t))}var xt=class{constructor(e,t){this.pointer=e,this.offsetWords=t}},B=(e=>(e[e.STRUCT=0]=`STRUCT`,e[e.LIST=1]=`LIST`,e[e.FAR=2]=`FAR`,e[e.OTHER=3]=`OTHER`,e))(B||{}),V=class{static _capnp={displayName:`Pointer`};_capnp;byteOffset;segment;constructor(e,t,n=p){if(this._capnp={compositeList:!1,depthLimit:n},this.segment=e,this.byteOffset=t,n<1)throw Error(v(le,this));if(bt(e.message,this),t<0||t>e.byteLength)throw Error(v(`CAPNP-TS019 Pointer offset %a is out of bounds for underlying buffer.`,t))}[Symbol.toStringTag](){return v(`Pointer_%d`,this.segment.id)}toString(){return v(`->%d@%a%s`,this.segment.id,this.byteOffset,Qe(this))}},St=class t extends V{static _capnp={displayName:`List<Generic>`,size:e.VOID};constructor(e,n,r){return super(e,n,r),new Proxy(this,t.#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 M(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(_)}findLast(e,t){throw Error(_)}findLastIndex(e,t){throw Error(_)}indexOf(e,t){throw Error(_)}lastIndexOf(e,t){throw Error(_)}pop(){throw Error(g)}push(...e){throw Error(g)}reverse(){throw Error(g)}shift(){throw Error(g)}unshift(...e){throw Error(g)}splice(e,t,...n){throw Error(g)}sort(e){throw Error(g)}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 H(t,n,r,i){let a;switch(t){case e.BIT:a=r.segment.allocate(Math.ceil(n/8));break;case e.BYTE:case e.BYTE_2:case e.BYTE_4:case e.BYTE_8:case e.POINTER:a=r.segment.allocate(n*C(t));break;case e.COMPOSITE:{if(i===void 0)throw Error(v(`CAPNP-TS010 Attempted to set a composite list without providing a composite element size.`));i=Je(i);let e=x(i)*n;a=r.segment.allocate(e+8),R(n,i,a);break}case e.VOID:L(0,t,n,r);return;default:throw Error(v(fe,t))}let o=F(a.segment,a.byteOffset,r);L(o.offsetWords,t,n,o.pointer,i)}var Ct=class extends St{static fromPointer(t){return z(B.LIST,t,e.BYTE),this._fromPointerUnchecked(t)}static _fromPointerUnchecked(e){return new this(e.segment,e.byteOffset,e._capnp.depthLimit)}copyBuffer(e){let t=D(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=D(this);return t.segment.getUint8(t.byteOffset+e)}set(e,t){let n=D(this);n.segment.setUint8(n.byteOffset+e,t)}toArrayBuffer(){let e=D(this);return e.segment.buffer.slice(e.byteOffset,e.byteOffset+this.length)}toDataView(){let e=D(this);return new DataView(e.segment.buffer,e.byteOffset,this.length)}[Symbol.toStringTag](){return`Data_${super.toString()}`}toUint8Array(){let e=D(this);return new Uint8Array(e.segment.buffer,e.byteOffset,this.length)}};const wt=new TextEncoder,Tt=new TextDecoder;var Et=class extends St{static fromPointer(t){return z(B.LIST,t,e.BYTE),Dt(t)}get(e=0){if(I(this))return``;let t=D(this);return Tt.decode(new Uint8Array(t.segment.buffer,t.byteOffset+e,this.length-e))}get length(){return super.length-1}set(t,n){let r=wt.encode(n),i=r.byteLength+t,a,o;if(!I(this)){a=D(this);let e=Math.min(this.length,t);o=new Uint8Array(a.segment.buffer.slice(a.byteOffset,a.byteOffset+e)),T(this)}H(e.BYTE,i+1,this),a=D(this);let s=new Uint8Array(a.segment.buffer,a.byteOffset,i);o&&s.set(o),s.set(r,t)}toString(){return this.get()}toJSON(){return this.get()}[Symbol.toPrimitive](){return this.get()}[Symbol.toStringTag](){return`Text_${super.toString()}`}};function Dt(e){return new Et(e.segment,e.byteOffset,e._capnp.depthLimit)}var Ot=class extends V{static _capnp={displayName:`Struct`};constructor(e,t,n=p,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}`} > ${D(this).toString()}`}},kt=class extends Ot{static _capnp={displayName:`AnyStruct`,id:`0`,size:new Ke(0,0)}},At=class{struct(){return Promise.resolve(this.structSync())}},jt=class extends At{constructor(e){super(),this.err=e}structSync(){throw this.err}pipelineCall(e,t){return this}pipelineClose(e){throw this.err}},Mt=class{constructor(e){this.err=e}call(e){return new jt(this.err)}close(){throw this.err}};function Nt(e){return e??new Mt(Error(De))}const U=new DataView(new ArrayBuffer(8));function Pt(e,t){if(t._capnp.compositeIndex!==void 0)throw Error(v(`CAPNP-TS013 Attempted to initialize a struct member from a composite list (%s).`,t));T(t);let n=t.segment.allocate(x(e)),r=F(n.segment,n.byteOffset,t);R(r.offsetWords,e,r.pointer)}function Ft(e,t,n){let r=Xt(e,t,n);return Pt(t._capnp.size,r),r}function W(e,t){let{pointerLength:n}=q(t);if(e<0||e>=n)throw Error(v(`CAPNP-TS021 Attempted to access out-of-bounds struct pointer (%s, index: %d, length: %d).`,t,e,n))}function It(e,t){return Lt(Yt(e,t))}function Lt(e){let t=null,n=gt(e),{capTable:r}=e.segment.message._capnp;return r&&n>=0&&n<r.length&&(t=r[n]),Nt(t)}function Rt(t,n){let r=q(n),i=D(n),a=n.segment.allocate(x(t));a.segment.copyWords(a.byteOffset,i.segment,i.byteOffset,Math.min(qe(r),qe(t)));let o=F(a.segment,a.byteOffset,n);R(o.offsetWords,t,o.pointer);for(let n=0;n<Math.min(r.pointerLength,t.pointerLength);n++){let o=new V(i.segment,i.byteOffset+r.dataByteLength+n*8);if(I(o))continue;let s=E(o),c=D(o),l=new V(a.segment,a.byteOffset+t.dataByteLength+n*8);N(o)===B.LIST&&j(o)===e.COMPOSITE&&(c.byteOffset-=8);let u=F(c.segment,c.byteOffset,l),d=s.segment.getUint8(s.byteOffset)&3,f=s.segment.getUint32(s.byteOffset+4);u.pointer.segment.setUint32(u.pointer.byteOffset,d|u.offsetWords<<2),u.pointer.segment.setUint32(u.pointer.byteOffset+4,f)}i.segment.fillZeroWords(i.byteOffset,S(r))}function zt(e,t){return new e(t.segment,t.byteOffset,t._capnp.depthLimit,t._capnp.compositeIndex)}function Bt(e,t,n){let r=Math.floor(e/8),i=1<<e%8;J(r,1,t);let a=G(t),o=a.segment.getUint8(a.byteOffset+r);return n===void 0?(o&i)!==0:((o^n.getUint8(0))&i)!==0}function Vt(t,n,r){W(t,n);let i=K(n);i.byteOffset+=t*8;let a=new Ct(i.segment,i.byteOffset,n._capnp.depthLimit-1);return I(a)&&(r?w(r,a):H(e.BYTE,0,a)),a}function G(e){return D(e)}function Ht(e,t,n){J(e,4,t);let r=G(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 U.setUint32(0,i,l),U.getFloat32(0,l)}function Ut(e,t,n){J(e,8,t);let r=G(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 U.setUint32(0,t,l),U.setUint32(4,i,l),U.getFloat64(0,l)}return r.segment.getFloat64(r.byteOffset+e)}function Wt(e,t,n){J(e,2,t);let r=G(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 U.setUint16(0,i,l),U.getInt16(0,l)}function Gt(e,t,n){J(e,4,t);let r=G(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 U.setUint32(0,i,l),U.getInt32(0,l)}function Kt(e,t,n){J(e,8,t);let r=G(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 U.setUint32(l?0:4,t,l),U.setUint32(l?4:0,i,l),U.getBigInt64(0,l)}return r.segment.getInt64(r.byteOffset+e)}function qt(e,t,n){J(e,1,t);let r=G(t);if(n===void 0)return r.segment.getInt8(r.byteOffset+e);let i=r.segment.getUint8(r.byteOffset+e)^n.getUint8(0);return U.setUint8(0,i),U.getInt8(0)}function Jt(t,n,r,i){W(t,r);let a=K(r);a.byteOffset+=t*8;let o=new n(a.segment,a.byteOffset,r._capnp.depthLimit-1);if(I(o))i?w(i,o):H(n._capnp.size,0,o,n._capnp.compositeSize);else if(n._capnp.compositeSize!==void 0){let t=dt(o),r=n._capnp.compositeSize;if(r.dataByteLength>t.dataByteLength||r.pointerLength>t.pointerLength){let i=D(o),a=M(o),s=o.segment.allocate(x(r)*a+8),c=F(s.segment,s.byteOffset,o);L(c.offsetWords,n._capnp.size,a,c.pointer,r),R(a,r,s),s.byteOffset+=8;for(let n=0;n<a;n++){let a=i.byteOffset+n*x(t),o=s.byteOffset+n*x(r);s.segment.copyWords(o,i.segment,a,S(t));for(let n=0;n<t.pointerLength;n++){let c=new V(i.segment,a+t.dataByteLength+n*8),l=new V(s.segment,o+r.dataByteLength+n*8),u=E(c),d=D(c);N(c)===B.LIST&&j(c)===e.COMPOSITE&&(d.byteOffset-=8);let f=F(d.segment,d.byteOffset,l),p=u.segment.getUint8(u.byteOffset)&3,m=u.segment.getUint32(u.byteOffset+4);f.pointer.segment.setUint32(f.pointer.byteOffset,p|f.offsetWords<<2),f.pointer.segment.setUint32(f.pointer.byteOffset+4,m)}}i.segment.fillZeroWords(i.byteOffset,S(t)*a)}}return o}function Yt(e,t){W(e,t);let n=K(t);return n.byteOffset+=e*8,new V(n.segment,n.byteOffset,t._capnp.depthLimit-1)}function Xt(e,t,n){W(e,n);let r=K(n);return r.byteOffset+=e*8,new t(r.segment,r.byteOffset,n._capnp.depthLimit-1)}function K(e){let t=D(e);return t.byteOffset+=b(q(e).dataByteLength),t}function q(e){if(e._capnp.compositeIndex!==void 0){let t=D(e,!0);return t.byteOffset-=8,A(t)}return P(e)}function Zt(e,t,n,r){let i=Xt(e,t,n);if(I(i))r?w(r,i):Pt(t._capnp.size,i);else{z(B.STRUCT,i);let e=P(i);(e.dataByteLength<t._capnp.size.dataByteLength||e.pointerLength<t._capnp.size.pointerLength)&&Rt(t._capnp.size,i)}return i}function Qt(e,t,n){let r=Et.fromPointer(Yt(e,t));return I(r)&&n&&r.set(0,n),r.get(0)}function $t(e,t,n){J(e,2,t);let r=G(t);return n===void 0?r.segment.getUint16(r.byteOffset+e):r.segment.getUint16(r.byteOffset+e)^n.getUint16(0,!0)}function en(e,t,n){J(e,4,t);let r=G(t);return n===void 0?r.segment.getUint32(r.byteOffset+e):r.segment.getUint32(r.byteOffset+e)^n.getUint32(0,!0)}function tn(e,t,n){J(e,8,t);let r=G(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 U.setUint32(l?0:4,t,l),U.setUint32(l?4:0,i,l),U.getBigUint64(0,l)}return r.segment.getUint64(r.byteOffset+e)}function nn(e,t,n){J(e,1,t);let r=G(t);return n===void 0?r.segment.getUint8(r.byteOffset+e):r.segment.getUint8(r.byteOffset+e)^n.getUint8(0)}function rn(t,n,r){W(t,r);let i=K(r);i.byteOffset+=t*8;let a=new Ct(i.segment,i.byteOffset,r._capnp.depthLimit-1);return T(a),H(e.BYTE,n,a),a}function an(e,t,n,r){W(e,r);let i=K(r);i.byteOffset+=e*8;let a=new t(i.segment,i.byteOffset,r._capnp.depthLimit-1);return T(a),H(t._capnp.size,n,a,t._capnp.compositeSize),a}function on(e,t,n,r){let i=Math.floor(e/8),a=1<<e%8;J(i,1,n);let o=G(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 sn(e,t,n,r){J(e,4,n);let i=G(n);if(r!==void 0){U.setFloat32(0,t,l);let n=U.getUint32(0,l)^r.getUint32(0,!0);i.segment.setUint32(i.byteOffset+e,n);return}i.segment.setFloat32(i.byteOffset+e,t)}function cn(e,t,n,r){J(e,8,n);let i=G(n);if(r!==void 0){U.setFloat64(0,t,l);let n=U.getUint32(0,l)^r.getUint32(0,!0),a=U.getUint32(4,l)^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 ln(e,t,n,r){J(e,2,n);let i=G(n);if(r!==void 0){U.setInt16(0,t,l);let n=U.getUint16(0,l)^r.getUint16(0,!0);i.segment.setUint16(i.byteOffset+e,n);return}i.segment.setInt16(i.byteOffset+e,t)}function un(e,t,n,r){J(e,4,n);let i=G(n);if(r!==void 0){U.setInt32(0,t,l);let n=U.getUint32(0,l)^r.getUint32(0,!0);i.segment.setUint32(i.byteOffset+e,n);return}i.segment.setInt32(i.byteOffset+e,t)}function dn(e,t,n,r){J(e,8,n);let i=G(n);if(r!==void 0){U.setBigInt64(0,t,l);let n=U.getUint32(l?0:4,l)^r.getUint32(0,!0),a=U.getUint32(l?4:0,l)^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 fn(e,t,n,r){J(e,1,n);let i=G(n);if(r!==void 0){U.setInt8(0,t);let n=U.getUint8(0)^r.getUint8(0);i.segment.setUint8(i.byteOffset+e,n);return}i.segment.setInt8(i.byteOffset+e,t)}function pn(e,t,n){Et.fromPointer(Yt(e,n)).set(0,t)}function mn(e,t,n,r){J(e,2,n);let i=G(n);r!==void 0&&(t^=r.getUint16(0,!0)),i.segment.setUint16(i.byteOffset+e,t)}function hn(e,t,n,r){J(e,4,n);let i=G(n);r!==void 0&&(t^=r.getUint32(0,!0)),i.segment.setUint32(i.byteOffset+e,t)}function gn(e,t,n,r){J(e,8,n);let i=G(n);if(r!==void 0){U.setBigUint64(0,t,l);let n=U.getUint32(l?0:4,l)^r.getUint32(0,!0),a=U.getUint32(l?4:0,l)^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 _n(e,t,n,r){J(e,1,n);let i=G(n);r!==void 0&&(t^=r.getUint8(0)),i.segment.setUint8(i.byteOffset+e,t)}function vn(e,t,n,r){if(t!==n)throw Error(v(`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 J(e,t,n){let{dataByteLength:r}=q(n);if(e<0||t<0||e+t>r)throw Error(v(`CAPNP-TS020 Attempted to access out-of-bounds struct data (struct: %s, %d bytes at %a, data words: %d).`,n,t,e,r))}function yn(t){return class extends St{static _capnp={compositeSize:t._capnp.size,displayName:`List<${t._capnp.displayName}>`,size:e.COMPOSITE};get(e){return new t(this.segment,this.byteOffset,this._capnp.depthLimit-1,e)}set(e,t){w(t,this.get(e))}[Symbol.toStringTag](){return`Composite_${super.toString()},cls:${t.toString()}`}}}function Y(e,t){return n=>{let r=new DataView(new ArrayBuffer(e));return t.call(r,0,n,!0),r}}const bn=Y(4,DataView.prototype.setFloat32),xn=Y(8,DataView.prototype.setFloat64),Sn=Y(2,DataView.prototype.setInt16),Cn=Y(4,DataView.prototype.setInt32),wn=Y(8,DataView.prototype.setBigInt64),Tn=Y(1,DataView.prototype.setInt8),En=Y(2,DataView.prototype.setUint16),Dn=Y(4,DataView.prototype.setUint32),On=Y(8,DataView.prototype.setBigUint64),kn=Y(1,DataView.prototype.setUint8);function An(e,t){let n=new DataView(new ArrayBuffer(1));return e&&n.setUint8(0,1<<t%8),n}var X=(e=>(e[e.SINGLE_SEGMENT=0]=`SINGLE_SEGMENT`,e[e.MULTI_SEGMENT=1]=`MULTI_SEGMENT`,e))(X||{}),jn=class{buffer;id;constructor(e,t){this.id=e,this.buffer=t}},Z=class{constructor(e=[new ArrayBuffer(n)]){this.buffers=e;let t=e.length;for(;--t>=0;)if(e[t].byteLength&7)throw Error(v(Ce,e[t].byteLength))}static allocate=Mn;static getBuffer=Nn;static getNumSegments=Pn;kind=X.MULTI_SEGMENT;toString(){return v(`MultiSegmentArena_segments:%d`,Pn(this))}};function Mn(e,t){let r=new ArrayBuffer(b(Math.max(e,n)));return t.buffers.push(r),new jn(t.buffers.length-1,r)}function Nn(e,t){if(e<0||e>=t.buffers.length)throw Error(v(`CAPNP-TS036 Attempted to get an out-of-bounds segment (%d).`,e));return t.buffers[e]}function Pn(e){return e.buffers.length}var Q=class{static allocate=Fn;static getBuffer=In;static getNumSegments=Ln;buffer;kind=X.SINGLE_SEGMENT;constructor(e=new ArrayBuffer(n)){if(e.byteLength&7)throw Error(v(Ce,e.byteLength));this.buffer=e}toString(){return v(`SingleSegmentArena_len:%x`,this.buffer.byteLength)}};function Fn(e,t,n){let r=t.length>0?t[0].buffer:n.buffer;return e=e<c?c:b(e),n.buffer=new ArrayBuffer(r.byteLength+e),new Float64Array(n.buffer).set(new Float64Array(r)),new jn(0,n.buffer)}function In(e,t){if(e!==0)throw Error(v(`CAPNP-TS035 Attempted to get a segment other than 0 (%d) from a single segment arena.`,e));return t.buffer}function Ln(){return 1}var $=class{static allocate=Rn;static copy=zn;static getBuffer=Bn;static getNumSegments=Vn};function Rn(e,t,n){switch(n.kind){case X.MULTI_SEGMENT:return Z.allocate(e,n);case X.SINGLE_SEGMENT:return Q.allocate(e,t,n);default:return ee(n)}}function zn(e){switch(e.kind){case X.MULTI_SEGMENT:{let t=e.buffers.length,n=Array.from({length:t});for(;--t>=0;)n[t]=e.buffers[t].slice(0);return new Z(n)}case X.SINGLE_SEGMENT:return new Q(e.buffer.slice(0));default:return ee(e)}}function Bn(e,t){switch(t.kind){case X.MULTI_SEGMENT:return Z.getBuffer(e,t);case X.SINGLE_SEGMENT:return Q.getBuffer(e,t);default:return ee(t)}}function Vn(e){switch(e.kind){case X.MULTI_SEGMENT:return Z.getNumSegments(e);case X.SINGLE_SEGMENT:return Q.getNumSegments();default:return ee(e)}}function Hn(e){let t=e-(e>>1&1431655765);return t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>24}function Un(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 Wn(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+=Hn(i)+1,r=i)}return n*8}function Gn(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 Kn(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=Un(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:Gn(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 qn(e){let t=new Uint8Array(e),n=new Uint8Array(new ArrayBuffer(Wn(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 Jn=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=b(e),e>m-8)throw Error(v(Te,e));t.hasCapacity(e)||(t=t.message.allocateSegment(e));let n=t.byteLength;return t.byteLength+=e,new V(t,n)}copyWord(e,t,n){let r=t._dv.getFloat64(n,l);this._dv.setFloat64(e,r,l)}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,l)===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,l)}toString(){return v(`Segment_id:%d,off:%a,len:%a,cap:%a`,this.id,this.byteLength,this.byteOffset,this.buffer.byteLength)}},Yn=class{static allocateSegment=tr;static dump=nr;static getRoot=rr;static getSegment=ir;static initRoot=ar;static readRawPointer=or;static toArrayBuffer=cr;static toPackedArrayBuffer=lr;_capnp;constructor(e,t=!0,n=!1){this._capnp=Xn(e,t,n),e&&Qn(this)}allocateSegment(e){return tr(e,this)}copy(){return dr(this)}dump(){return nr(this)}getRoot(e){return rr(e,this)}getSegment(e){return ir(e,this)}initRoot(e){return ar(e,this)}setRoot(e){sr(e,this)}toArrayBuffer(){return cr(this)}toPackedArrayBuffer(){return lr(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 Xn(e,t=!0,n=!1){if(e===void 0)return{arena:new Q,segments:[],traversalLimit:r};if(er(e))return{arena:e,segments:[],traversalLimit:r};let i=e;return $n(i)&&(i=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)),t&&(i=qn(i)),n?{arena:new Q(i),segments:[],traversalLimit:r}:{arena:new Z(Zn(i)),segments:[],traversalLimit:r}}function Zn(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(te);for(let a=0;a<n;a++){let n=t.getUint32(4+a*4,!0)*8;if(i+n>e.byteLength)throw Error(te);r[a]=e.slice(i,i+n),i+=n}return r}function Qn(e){let t=$.getNumSegments(e._capnp.arena);e._capnp.segments=Array.from({length:t});for(let n=0;n<t;n++){if(n===0&&$.getBuffer(n,e._capnp.arena).byteLength<8)throw Error(ie);let t=$.getBuffer(n,e._capnp.arena),r=new Jn(n,e,t,t.byteLength);e._capnp.segments[n]=r}}function $n(e){return e.byteOffset!==void 0}function er(e){return e.kind!==void 0}function tr(e,t){let n=$.allocate(e,t._capnp.segments,t._capnp.arena),r;if(n.id===t._capnp.segments.length)r=new Jn(n.id,t,n.buffer),t._capnp.segments.push(r);else if(n.id<0||n.id>t._capnp.segments.length)throw Error(v(re,n.id,t));else r=t._capnp.segments[n.id],r.replaceBuffer(n.buffer);return r}function nr(e){let t=``;if(e._capnp.segments.length===0)return`================
|
|
6
|
-
No Segments
|
|
7
|
-
================
|
|
8
|
-
`;for(let n=0;n<e._capnp.segments.length;n++){t+=`================
|
|
9
|
-
Segment #${n}
|
|
10
|
-
================
|
|
11
|
-
`;let{buffer:r,byteLength:i}=e._capnp.segments[n],a=new Uint8Array(r,0,i);t+=Ge(a)}return t}function rr(e,t){let n=new e(t.getSegment(0),0);z(B.STRUCT,n);let r=P(n);return(r.dataByteLength<e._capnp.size.dataByteLength||r.pointerLength<e._capnp.size.pointerLength)&&Rt(e._capnp.size,n),n}function ir(e,t){let r=t._capnp.segments.length;if(e===0&&r===0){if($.getNumSegments(t._capnp.arena)===0?tr(n,t):t._capnp.segments[0]=new Jn(0,t,$.getBuffer(0,t._capnp.arena)),!t._capnp.segments[0].hasCapacity(8))throw Error(ie);return t._capnp.segments[0].allocate(8),t._capnp.segments[0]}if(e<0||e>=r)throw Error(v(re,e,t));return t._capnp.segments[e]}function ar(e,t){let n=new e(t.getSegment(0),0);return Pt(e._capnp.size,n),n}function or(e){return new V(new Yn(e).getSegment(0),0)}function sr(e,t){w(e,new V(t.getSegment(0),0))}function cr(e){let t=ur(e);e._capnp.segments.length===0&&ir(0,e);let{segments:n}=e._capnp,r=t.byteLength+n.reduce((e,t)=>e+b(t.byteLength),0),i=new Uint8Array(new ArrayBuffer(r)),a=t.byteLength;i.set(new Uint8Array(t));for(let e of n){let t=b(e.byteLength);i.set(new Uint8Array(e.buffer,0,t),a),a+=t}return i.buffer}function lr(e){let t=Kn(ur(e));e._capnp.segments.length===0&&e.getSegment(0);let n=e._capnp.segments.map(e=>Kn(e.buffer,0,b(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 ur(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 dr(e){return new Yn($.copy(e._capnp.arena))}Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,`$t`,{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return`CAPNP-TS109 Target not found.`}}),Object.defineProperty(exports,`At`,{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return`CAPNP-TS112 Attempted to re-use question id (%s).`}}),Object.defineProperty(exports,`Bt`,{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`Cn`,{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,`Ct`,{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`Dn`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`Dt`,{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,`En`,{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,`Et`,{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return`CAPNP-TS106 Call on closed import.`}}),Object.defineProperty(exports,`Ft`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return`CAPNP-TS113 Capability table references unknown export ID (%s).`}}),Object.defineProperty(exports,`Gt`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return`CAPNP-TS111 Received return for unknown question (id=%s).`}}),Object.defineProperty(exports,`Ht`,{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return`CAPNP-TS116 RPC method failed at %s.%s(): %s`}}),Object.defineProperty(exports,`It`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,`Jt`,{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return`CAPNP-TS105 Ref() called on zeroed refcount.`}}),Object.defineProperty(exports,`Kt`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return`CAPNP-TS107 Method not implemented.`}}),Object.defineProperty(exports,`Lt`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return`CAPNP-TS117 RPC call failed, reason: %s`}}),Object.defineProperty(exports,`Mt`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return`CAPNP-TS119 Received finish message for unknown answer ID (%s).`}}),Object.defineProperty(exports,`Nt`,{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,`Ot`,{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return`CAPNP-TS120 Fulfill called more than once for question (%s).`}}),Object.defineProperty(exports,`Pt`,{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`Qt`,{enumerable:!0,get:function(){return nn}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return`CAPNP-TS118 Received bootstrap message without main interface set.`}}),Object.defineProperty(exports,`Rt`,{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`Sn`,{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,`St`,{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,`Tn`,{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,`Tt`,{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return`CAPNP-TS114 Capability table references unknown answer ID (%s).`}}),Object.defineProperty(exports,`Ut`,{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return`CAPNP-TS102 Queue call canceled.`}}),Object.defineProperty(exports,`Vt`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return`CAPNP-TS115 Unknown cap descriptor type (which: %s).`}}),Object.defineProperty(exports,`Wt`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,`Xt`,{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,`Yt`,{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`Zt`,{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,`_n`,{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,`_t`,{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,`an`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`at`,{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`bn`,{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,`bt`,{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,`cn`,{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,`ct`,{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,`dn`,{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,`dt`,{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,`en`,{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,`fn`,{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,`ft`,{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,`gn`,{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,`gt`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,`hn`,{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,`ht`,{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,`in`,{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return`CAPNP-TS101 Promised answer call queue full.`}}),Object.defineProperty(exports,`jt`,{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`kt`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,`ln`,{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,`lt`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,`mn`,{enumerable:!0,get:function(){return un}}),Object.defineProperty(exports,`mt`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,`nn`,{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,`on`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`ot`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,`pn`,{enumerable:!0,get:function(){return ln}}),Object.defineProperty(exports,`pt`,{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,`qt`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,`rn`,{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,`sn`,{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,`st`,{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(exports,`tn`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,`un`,{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,`ut`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,`vn`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`vt`,{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return`CAPNP-TS006 %s is not implemented.`}}),Object.defineProperty(exports,`wn`,{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,`wt`,{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,`xn`,{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,`xt`,{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,`yn`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`yt`,{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`zt`,{enumerable:!0,get:function(){return ct}});
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
const e=require(`./helpers-DSMRKdw1.cjs`),t=require(`./capnp-es.GpvEvMIK-xNDcbmgx.cjs`);let n=require(`@stryke/fs/exists`),r=require(`typescript`);r=e.r(r);let i=require(`defu`);i=e.r(i);let a=require(`node:buffer`),o=require(`node:child_process`);var s=class extends t.q{static _capnp={displayName:`Parameter`,id:`b9521bccf10fa3b1`,size:new t.T(0,1)};get name(){return t.Jt(0,this)}set name(e){t.bn(0,e,this)}toString(){return`Node_Parameter_`+super.toString()}},c=class extends t.q{static _capnp={displayName:`NestedNode`,id:`debf55bbfa0fc242`,size:new t.T(8,1)};get name(){return t.Jt(0,this)}set name(e){t.bn(0,e,this)}get id(){return t.Zt(0,this)}set id(e){t.Cn(0,e,this)}toString(){return`Node_NestedNode_`+super.toString()}},l=class extends t.q{static _capnp={displayName:`Member`,id:`c2ba9038898e1fa2`,size:new t.T(0,1)};get docComment(){return t.Jt(0,this)}set docComment(e){t.bn(0,e,this)}toString(){return`Node_SourceInfo_Member_`+super.toString()}},u=class e extends t.q{static Member=l;static _capnp={displayName:`SourceInfo`,id:`f38e1de3041357ae`,size:new t.T(8,2)};static _Members;get id(){return t.Zt(0,this)}set id(e){t.Cn(0,e,this)}get docComment(){return t.Jt(0,this)}set docComment(e){t.bn(0,e,this)}_adoptMembers(e){t.X(e,t.Nt(1,this))}_disownMembers(){return t.it(this.members)}get members(){return t.Dt(1,e._Members,this)}_hasMembers(){return!t.an(t.Nt(1,this))}_initMembers(n){return t.en(1,e._Members,n,this)}set members(e){t.et(e,t.Nt(1,this))}toString(){return`Node_SourceInfo_`+super.toString()}},d=class e extends t.q{static _capnp={displayName:`struct`,id:`9ea0b19b37fb4435`,size:new t.T(40,6)};static _Fields;get dataWordCount(){return t.Yt(14,this)}set dataWordCount(e){t.xn(14,e,this)}get pointerCount(){return t.Yt(24,this)}set pointerCount(e){t.xn(24,e,this)}get preferredListEncoding(){return t.Yt(26,this)}set preferredListEncoding(e){t.xn(26,e,this)}get isGroup(){return t.ft(224,this)}set isGroup(e){t.ln(224,e,this)}get discriminantCount(){return t.Yt(30,this)}set discriminantCount(e){t.xn(30,e,this)}get discriminantOffset(){return t.Xt(32,this)}set discriminantOffset(e){t.Sn(32,e,this)}_adoptFields(e){t.X(e,t.Nt(3,this))}_disownFields(){return t.it(this.fields)}get fields(){return t.Dt(3,e._Fields,this)}_hasFields(){return!t.an(t.Nt(3,this))}_initFields(n){return t.en(3,e._Fields,n,this)}set fields(e){t.et(e,t.Nt(3,this))}toString(){return`Node_Struct_`+super.toString()}},f=class e extends t.q{static _capnp={displayName:`enum`,id:`b54ab3364333f598`,size:new t.T(40,6)};static _Enumerants;_adoptEnumerants(e){t.X(e,t.Nt(3,this))}_disownEnumerants(){return t.it(this.enumerants)}get enumerants(){return t.Dt(3,e._Enumerants,this)}_hasEnumerants(){return!t.an(t.Nt(3,this))}_initEnumerants(n){return t.en(3,e._Enumerants,n,this)}set enumerants(e){t.et(e,t.Nt(3,this))}toString(){return`Node_Enum_`+super.toString()}},p=class e extends t.q{static _capnp={displayName:`interface`,id:`e82753cff0c2218f`,size:new t.T(40,6)};static _Methods;static _Superclasses;_adoptMethods(e){t.X(e,t.Nt(3,this))}_disownMethods(){return t.it(this.methods)}get methods(){return t.Dt(3,e._Methods,this)}_hasMethods(){return!t.an(t.Nt(3,this))}_initMethods(n){return t.en(3,e._Methods,n,this)}set methods(e){t.et(e,t.Nt(3,this))}_adoptSuperclasses(e){t.X(e,t.Nt(4,this))}_disownSuperclasses(){return t.it(this.superclasses)}get superclasses(){return t.Dt(4,e._Superclasses,this)}_hasSuperclasses(){return!t.an(t.Nt(4,this))}_initSuperclasses(n){return t.en(4,e._Superclasses,n,this)}set superclasses(e){t.et(e,t.Nt(4,this))}toString(){return`Node_Interface_`+super.toString()}},m=class extends t.q{static _capnp={displayName:`const`,id:`b18aa5ac7a0d9420`,size:new t.T(40,6)};_adoptType(e){t.X(e,t.Nt(3,this))}_disownType(){return t.it(this.type)}get type(){return t.Rt(3,A,this)}_hasType(){return!t.an(t.Nt(3,this))}_initType(){return t.rn(3,A,this)}set type(e){t.et(e,t.Nt(3,this))}_adoptValue(e){t.X(e,t.Nt(4,this))}_disownValue(){return t.it(this.value)}get value(){return t.Rt(4,F,this)}_hasValue(){return!t.an(t.Nt(4,this))}_initValue(){return t.rn(4,F,this)}set value(e){t.et(e,t.Nt(4,this))}toString(){return`Node_Const_`+super.toString()}},h=class extends t.q{static _capnp={displayName:`annotation`,id:`ec1619d4400a0290`,size:new t.T(40,6)};_adoptType(e){t.X(e,t.Nt(3,this))}_disownType(){return t.it(this.type)}get type(){return t.Rt(3,A,this)}_hasType(){return!t.an(t.Nt(3,this))}_initType(){return t.rn(3,A,this)}set type(e){t.et(e,t.Nt(3,this))}get targetsFile(){return t.ft(112,this)}set targetsFile(e){t.ln(112,e,this)}get targetsConst(){return t.ft(113,this)}set targetsConst(e){t.ln(113,e,this)}get targetsEnum(){return t.ft(114,this)}set targetsEnum(e){t.ln(114,e,this)}get targetsEnumerant(){return t.ft(115,this)}set targetsEnumerant(e){t.ln(115,e,this)}get targetsStruct(){return t.ft(116,this)}set targetsStruct(e){t.ln(116,e,this)}get targetsField(){return t.ft(117,this)}set targetsField(e){t.ln(117,e,this)}get targetsUnion(){return t.ft(118,this)}set targetsUnion(e){t.ln(118,e,this)}get targetsGroup(){return t.ft(119,this)}set targetsGroup(e){t.ln(119,e,this)}get targetsInterface(){return t.ft(120,this)}set targetsInterface(e){t.ln(120,e,this)}get targetsMethod(){return t.ft(121,this)}set targetsMethod(e){t.ln(121,e,this)}get targetsParam(){return t.ft(122,this)}set targetsParam(e){t.ln(122,e,this)}get targetsAnnotation(){return t.ft(123,this)}set targetsAnnotation(e){t.ln(123,e,this)}toString(){return`Node_Annotation_`+super.toString()}};const g={FILE:0,STRUCT:1,ENUM:2,INTERFACE:3,CONST:4,ANNOTATION:5};var _=class e extends t.q{static FILE=g.FILE;static STRUCT=g.STRUCT;static ENUM=g.ENUM;static INTERFACE=g.INTERFACE;static CONST=g.CONST;static ANNOTATION=g.ANNOTATION;static Parameter=s;static NestedNode=c;static SourceInfo=u;static _capnp={displayName:`Node`,id:`e682ab4cf923a417`,size:new t.T(40,6)};static _Parameters;static _NestedNodes;static _Annotations;get id(){return t.Zt(0,this)}set id(e){t.Cn(0,e,this)}get displayName(){return t.Jt(0,this)}set displayName(e){t.bn(0,e,this)}get displayNamePrefixLength(){return t.Xt(8,this)}set displayNamePrefixLength(e){t.Sn(8,e,this)}get scopeId(){return t.Zt(16,this)}set scopeId(e){t.Cn(16,e,this)}_adoptParameters(e){t.X(e,t.Nt(5,this))}_disownParameters(){return t.it(this.parameters)}get parameters(){return t.Dt(5,e._Parameters,this)}_hasParameters(){return!t.an(t.Nt(5,this))}_initParameters(n){return t.en(5,e._Parameters,n,this)}set parameters(e){t.et(e,t.Nt(5,this))}get isGeneric(){return t.ft(288,this)}set isGeneric(e){t.ln(288,e,this)}_adoptNestedNodes(e){t.X(e,t.Nt(1,this))}_disownNestedNodes(){return t.it(this.nestedNodes)}get nestedNodes(){return t.Dt(1,e._NestedNodes,this)}_hasNestedNodes(){return!t.an(t.Nt(1,this))}_initNestedNodes(n){return t.en(1,e._NestedNodes,n,this)}set nestedNodes(e){t.et(e,t.Nt(1,this))}_adoptAnnotations(e){t.X(e,t.Nt(2,this))}_disownAnnotations(){return t.it(this.annotations)}get annotations(){return t.Dt(2,e._Annotations,this)}_hasAnnotations(){return!t.an(t.Nt(2,this))}_initAnnotations(n){return t.en(2,e._Annotations,n,this)}set annotations(e){t.et(e,t.Nt(2,this))}get _isFile(){return t.Yt(12,this)===0}set file(e){t.xn(12,0,this)}get struct(){return t.Tn(`struct`,t.Yt(12,this),1,this),t.dt(d,this)}_initStruct(){return t.xn(12,1,this),t.dt(d,this)}get _isStruct(){return t.Yt(12,this)===1}set struct(e){t.xn(12,1,this)}get enum(){return t.Tn(`enum`,t.Yt(12,this),2,this),t.dt(f,this)}_initEnum(){return t.xn(12,2,this),t.dt(f,this)}get _isEnum(){return t.Yt(12,this)===2}set enum(e){t.xn(12,2,this)}get interface(){return t.Tn(`interface`,t.Yt(12,this),3,this),t.dt(p,this)}_initInterface(){return t.xn(12,3,this),t.dt(p,this)}get _isInterface(){return t.Yt(12,this)===3}set interface(e){t.xn(12,3,this)}get const(){return t.Tn(`const`,t.Yt(12,this),4,this),t.dt(m,this)}_initConst(){return t.xn(12,4,this),t.dt(m,this)}get _isConst(){return t.Yt(12,this)===4}set const(e){t.xn(12,4,this)}get annotation(){return t.Tn(`annotation`,t.Yt(12,this),5,this),t.dt(h,this)}_initAnnotation(){return t.xn(12,5,this),t.dt(h,this)}get _isAnnotation(){return t.Yt(12,this)===5}set annotation(e){t.xn(12,5,this)}toString(){return`Node_`+super.toString()}which(){return t.Yt(12,this)}},v=class extends t.q{static _capnp={displayName:`slot`,id:`c42305476bb4746f`,size:new t.T(24,4)};get offset(){return t.Xt(4,this)}set offset(e){t.Sn(4,e,this)}_adoptType(e){t.X(e,t.Nt(2,this))}_disownType(){return t.it(this.type)}get type(){return t.Rt(2,A,this)}_hasType(){return!t.an(t.Nt(2,this))}_initType(){return t.rn(2,A,this)}set type(e){t.et(e,t.Nt(2,this))}_adoptDefaultValue(e){t.X(e,t.Nt(3,this))}_disownDefaultValue(){return t.it(this.defaultValue)}get defaultValue(){return t.Rt(3,F,this)}_hasDefaultValue(){return!t.an(t.Nt(3,this))}_initDefaultValue(){return t.rn(3,F,this)}set defaultValue(e){t.et(e,t.Nt(3,this))}get hadExplicitDefault(){return t.ft(128,this)}set hadExplicitDefault(e){t.ln(128,e,this)}toString(){return`Field_Slot_`+super.toString()}},y=class extends t.q{static _capnp={displayName:`group`,id:`cafccddb68db1d11`,size:new t.T(24,4)};get typeId(){return t.Zt(16,this)}set typeId(e){t.Cn(16,e,this)}toString(){return`Field_Group_`+super.toString()}};const b={IMPLICIT:0,EXPLICIT:1};var x=class extends t.q{static IMPLICIT=b.IMPLICIT;static EXPLICIT=b.EXPLICIT;static _capnp={displayName:`ordinal`,id:`bb90d5c287870be6`,size:new t.T(24,4)};get _isImplicit(){return t.Yt(10,this)===0}set implicit(e){t.xn(10,0,this)}get explicit(){return t.Tn(`explicit`,t.Yt(10,this),1,this),t.Yt(12,this)}get _isExplicit(){return t.Yt(10,this)===1}set explicit(e){t.xn(10,1,this),t.xn(12,e,this)}toString(){return`Field_Ordinal_`+super.toString()}which(){return t.Yt(10,this)}};const S={SLOT:0,GROUP:1};var C=class e extends t.q{static NO_DISCRIMINANT=65535;static SLOT=S.SLOT;static GROUP=S.GROUP;static _capnp={displayName:`Field`,id:`9aad50a41f4af45f`,size:new t.T(24,4),defaultDiscriminantValue:t.d(65535)};static _Annotations;get name(){return t.Jt(0,this)}set name(e){t.bn(0,e,this)}get codeOrder(){return t.Yt(0,this)}set codeOrder(e){t.xn(0,e,this)}_adoptAnnotations(e){t.X(e,t.Nt(1,this))}_disownAnnotations(){return t.it(this.annotations)}get annotations(){return t.Dt(1,e._Annotations,this)}_hasAnnotations(){return!t.an(t.Nt(1,this))}_initAnnotations(n){return t.en(1,e._Annotations,n,this)}set annotations(e){t.et(e,t.Nt(1,this))}get discriminantValue(){return t.Yt(2,this,e._capnp.defaultDiscriminantValue)}set discriminantValue(n){t.xn(2,n,this,e._capnp.defaultDiscriminantValue)}get slot(){return t.Tn(`slot`,t.Yt(8,this),0,this),t.dt(v,this)}_initSlot(){return t.xn(8,0,this),t.dt(v,this)}get _isSlot(){return t.Yt(8,this)===0}set slot(e){t.xn(8,0,this)}get group(){return t.Tn(`group`,t.Yt(8,this),1,this),t.dt(y,this)}_initGroup(){return t.xn(8,1,this),t.dt(y,this)}get _isGroup(){return t.Yt(8,this)===1}set group(e){t.xn(8,1,this)}get ordinal(){return t.dt(x,this)}_initOrdinal(){return t.dt(x,this)}toString(){return`Field_`+super.toString()}which(){return t.Yt(8,this)}},w=class e extends t.q{static _capnp={displayName:`Enumerant`,id:`978a7cebdc549a4d`,size:new t.T(8,2)};static _Annotations;get name(){return t.Jt(0,this)}set name(e){t.bn(0,e,this)}get codeOrder(){return t.Yt(0,this)}set codeOrder(e){t.xn(0,e,this)}_adoptAnnotations(e){t.X(e,t.Nt(1,this))}_disownAnnotations(){return t.it(this.annotations)}get annotations(){return t.Dt(1,e._Annotations,this)}_hasAnnotations(){return!t.an(t.Nt(1,this))}_initAnnotations(n){return t.en(1,e._Annotations,n,this)}set annotations(e){t.et(e,t.Nt(1,this))}toString(){return`Enumerant_`+super.toString()}},ee=class extends t.q{static _capnp={displayName:`Superclass`,id:`a9962a9ed0a4d7f8`,size:new t.T(8,1)};get id(){return t.Zt(0,this)}set id(e){t.Cn(0,e,this)}_adoptBrand(e){t.X(e,t.Nt(0,this))}_disownBrand(){return t.it(this.brand)}get brand(){return t.Rt(0,N,this)}_hasBrand(){return!t.an(t.Nt(0,this))}_initBrand(){return t.rn(0,N,this)}set brand(e){t.et(e,t.Nt(0,this))}toString(){return`Superclass_`+super.toString()}},T=class e extends t.q{static _capnp={displayName:`Method`,id:`9500cce23b334d80`,size:new t.T(24,5)};static _ImplicitParameters;static _Annotations;get name(){return t.Jt(0,this)}set name(e){t.bn(0,e,this)}get codeOrder(){return t.Yt(0,this)}set codeOrder(e){t.xn(0,e,this)}_adoptImplicitParameters(e){t.X(e,t.Nt(4,this))}_disownImplicitParameters(){return t.it(this.implicitParameters)}get implicitParameters(){return t.Dt(4,e._ImplicitParameters,this)}_hasImplicitParameters(){return!t.an(t.Nt(4,this))}_initImplicitParameters(n){return t.en(4,e._ImplicitParameters,n,this)}set implicitParameters(e){t.et(e,t.Nt(4,this))}get paramStructType(){return t.Zt(8,this)}set paramStructType(e){t.Cn(8,e,this)}_adoptParamBrand(e){t.X(e,t.Nt(2,this))}_disownParamBrand(){return t.it(this.paramBrand)}get paramBrand(){return t.Rt(2,N,this)}_hasParamBrand(){return!t.an(t.Nt(2,this))}_initParamBrand(){return t.rn(2,N,this)}set paramBrand(e){t.et(e,t.Nt(2,this))}get resultStructType(){return t.Zt(16,this)}set resultStructType(e){t.Cn(16,e,this)}_adoptResultBrand(e){t.X(e,t.Nt(3,this))}_disownResultBrand(){return t.it(this.resultBrand)}get resultBrand(){return t.Rt(3,N,this)}_hasResultBrand(){return!t.an(t.Nt(3,this))}_initResultBrand(){return t.rn(3,N,this)}set resultBrand(e){t.et(e,t.Nt(3,this))}_adoptAnnotations(e){t.X(e,t.Nt(1,this))}_disownAnnotations(){return t.it(this.annotations)}get annotations(){return t.Dt(1,e._Annotations,this)}_hasAnnotations(){return!t.an(t.Nt(1,this))}_initAnnotations(n){return t.en(1,e._Annotations,n,this)}set annotations(e){t.et(e,t.Nt(1,this))}toString(){return`Method_`+super.toString()}},te=class extends t.q{static _capnp={displayName:`list`,id:`87e739250a60ea97`,size:new t.T(24,1)};_adoptElementType(e){t.X(e,t.Nt(0,this))}_disownElementType(){return t.it(this.elementType)}get elementType(){return t.Rt(0,A,this)}_hasElementType(){return!t.an(t.Nt(0,this))}_initElementType(){return t.rn(0,A,this)}set elementType(e){t.et(e,t.Nt(0,this))}toString(){return`Type_List_`+super.toString()}},ne=class extends t.q{static _capnp={displayName:`enum`,id:`9e0e78711a7f87a9`,size:new t.T(24,1)};get typeId(){return t.Zt(8,this)}set typeId(e){t.Cn(8,e,this)}_adoptBrand(e){t.X(e,t.Nt(0,this))}_disownBrand(){return t.it(this.brand)}get brand(){return t.Rt(0,N,this)}_hasBrand(){return!t.an(t.Nt(0,this))}_initBrand(){return t.rn(0,N,this)}set brand(e){t.et(e,t.Nt(0,this))}toString(){return`Type_Enum_`+super.toString()}},re=class extends t.q{static _capnp={displayName:`struct`,id:`ac3a6f60ef4cc6d3`,size:new t.T(24,1)};get typeId(){return t.Zt(8,this)}set typeId(e){t.Cn(8,e,this)}_adoptBrand(e){t.X(e,t.Nt(0,this))}_disownBrand(){return t.it(this.brand)}get brand(){return t.Rt(0,N,this)}_hasBrand(){return!t.an(t.Nt(0,this))}_initBrand(){return t.rn(0,N,this)}set brand(e){t.et(e,t.Nt(0,this))}toString(){return`Type_Struct_`+super.toString()}},ie=class extends t.q{static _capnp={displayName:`interface`,id:`ed8bca69f7fb0cbf`,size:new t.T(24,1)};get typeId(){return t.Zt(8,this)}set typeId(e){t.Cn(8,e,this)}_adoptBrand(e){t.X(e,t.Nt(0,this))}_disownBrand(){return t.it(this.brand)}get brand(){return t.Rt(0,N,this)}_hasBrand(){return!t.an(t.Nt(0,this))}_initBrand(){return t.rn(0,N,this)}set brand(e){t.et(e,t.Nt(0,this))}toString(){return`Type_Interface_`+super.toString()}};const E={ANY_KIND:0,STRUCT:1,LIST:2,CAPABILITY:3};var ae=class extends t.q{static ANY_KIND=E.ANY_KIND;static STRUCT=E.STRUCT;static LIST=E.LIST;static CAPABILITY=E.CAPABILITY;static _capnp={displayName:`unconstrained`,id:`8e3b5f79fe593656`,size:new t.T(24,1)};get _isAnyKind(){return t.Yt(10,this)===0}set anyKind(e){t.xn(10,0,this)}get _isStruct(){return t.Yt(10,this)===1}set struct(e){t.xn(10,1,this)}get _isList(){return t.Yt(10,this)===2}set list(e){t.xn(10,2,this)}get _isCapability(){return t.Yt(10,this)===3}set capability(e){t.xn(10,3,this)}toString(){return`Type_AnyPointer_Unconstrained_`+super.toString()}which(){return t.Yt(10,this)}},D=class extends t.q{static _capnp={displayName:`parameter`,id:`9dd1f724f4614a85`,size:new t.T(24,1)};get scopeId(){return t.Zt(16,this)}set scopeId(e){t.Cn(16,e,this)}get parameterIndex(){return t.Yt(10,this)}set parameterIndex(e){t.xn(10,e,this)}toString(){return`Type_AnyPointer_Parameter_`+super.toString()}},oe=class extends t.q{static _capnp={displayName:`implicitMethodParameter`,id:`baefc9120c56e274`,size:new t.T(24,1)};get parameterIndex(){return t.Yt(10,this)}set parameterIndex(e){t.xn(10,e,this)}toString(){return`Type_AnyPointer_ImplicitMethodParameter_`+super.toString()}};const O={UNCONSTRAINED:0,PARAMETER:1,IMPLICIT_METHOD_PARAMETER:2};var se=class extends t.q{static UNCONSTRAINED=O.UNCONSTRAINED;static PARAMETER=O.PARAMETER;static IMPLICIT_METHOD_PARAMETER=O.IMPLICIT_METHOD_PARAMETER;static _capnp={displayName:`anyPointer`,id:`c2573fe8a23e49f1`,size:new t.T(24,1)};get unconstrained(){return t.Tn(`unconstrained`,t.Yt(8,this),0,this),t.dt(ae,this)}_initUnconstrained(){return t.xn(8,0,this),t.dt(ae,this)}get _isUnconstrained(){return t.Yt(8,this)===0}set unconstrained(e){t.xn(8,0,this)}get parameter(){return t.Tn(`parameter`,t.Yt(8,this),1,this),t.dt(D,this)}_initParameter(){return t.xn(8,1,this),t.dt(D,this)}get _isParameter(){return t.Yt(8,this)===1}set parameter(e){t.xn(8,1,this)}get implicitMethodParameter(){return t.Tn(`implicitMethodParameter`,t.Yt(8,this),2,this),t.dt(oe,this)}_initImplicitMethodParameter(){return t.xn(8,2,this),t.dt(oe,this)}get _isImplicitMethodParameter(){return t.Yt(8,this)===2}set implicitMethodParameter(e){t.xn(8,2,this)}toString(){return`Type_AnyPointer_`+super.toString()}which(){return t.Yt(8,this)}};const k={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 A=class extends t.q{static VOID=k.VOID;static BOOL=k.BOOL;static INT8=k.INT8;static INT16=k.INT16;static INT32=k.INT32;static INT64=k.INT64;static UINT8=k.UINT8;static UINT16=k.UINT16;static UINT32=k.UINT32;static UINT64=k.UINT64;static FLOAT32=k.FLOAT32;static FLOAT64=k.FLOAT64;static TEXT=k.TEXT;static DATA=k.DATA;static LIST=k.LIST;static ENUM=k.ENUM;static STRUCT=k.STRUCT;static INTERFACE=k.INTERFACE;static ANY_POINTER=k.ANY_POINTER;static _capnp={displayName:`Type`,id:`d07378ede1f9cc60`,size:new t.T(24,1)};get _isVoid(){return t.Yt(0,this)===0}set void(e){t.xn(0,0,this)}get _isBool(){return t.Yt(0,this)===1}set bool(e){t.xn(0,1,this)}get _isInt8(){return t.Yt(0,this)===2}set int8(e){t.xn(0,2,this)}get _isInt16(){return t.Yt(0,this)===3}set int16(e){t.xn(0,3,this)}get _isInt32(){return t.Yt(0,this)===4}set int32(e){t.xn(0,4,this)}get _isInt64(){return t.Yt(0,this)===5}set int64(e){t.xn(0,5,this)}get _isUint8(){return t.Yt(0,this)===6}set uint8(e){t.xn(0,6,this)}get _isUint16(){return t.Yt(0,this)===7}set uint16(e){t.xn(0,7,this)}get _isUint32(){return t.Yt(0,this)===8}set uint32(e){t.xn(0,8,this)}get _isUint64(){return t.Yt(0,this)===9}set uint64(e){t.xn(0,9,this)}get _isFloat32(){return t.Yt(0,this)===10}set float32(e){t.xn(0,10,this)}get _isFloat64(){return t.Yt(0,this)===11}set float64(e){t.xn(0,11,this)}get _isText(){return t.Yt(0,this)===12}set text(e){t.xn(0,12,this)}get _isData(){return t.Yt(0,this)===13}set data(e){t.xn(0,13,this)}get list(){return t.Tn(`list`,t.Yt(0,this),14,this),t.dt(te,this)}_initList(){return t.xn(0,14,this),t.dt(te,this)}get _isList(){return t.Yt(0,this)===14}set list(e){t.xn(0,14,this)}get enum(){return t.Tn(`enum`,t.Yt(0,this),15,this),t.dt(ne,this)}_initEnum(){return t.xn(0,15,this),t.dt(ne,this)}get _isEnum(){return t.Yt(0,this)===15}set enum(e){t.xn(0,15,this)}get struct(){return t.Tn(`struct`,t.Yt(0,this),16,this),t.dt(re,this)}_initStruct(){return t.xn(0,16,this),t.dt(re,this)}get _isStruct(){return t.Yt(0,this)===16}set struct(e){t.xn(0,16,this)}get interface(){return t.Tn(`interface`,t.Yt(0,this),17,this),t.dt(ie,this)}_initInterface(){return t.xn(0,17,this),t.dt(ie,this)}get _isInterface(){return t.Yt(0,this)===17}set interface(e){t.xn(0,17,this)}get anyPointer(){return t.Tn(`anyPointer`,t.Yt(0,this),18,this),t.dt(se,this)}_initAnyPointer(){return t.xn(0,18,this),t.dt(se,this)}get _isAnyPointer(){return t.Yt(0,this)===18}set anyPointer(e){t.xn(0,18,this)}toString(){return`Type_`+super.toString()}which(){return t.Yt(0,this)}};const ce={BIND:0,INHERIT:1};var j=class e extends t.q{static BIND=ce.BIND;static INHERIT=ce.INHERIT;static _capnp={displayName:`Scope`,id:`abd73485a9636bc9`,size:new t.T(16,1)};static _Bind;get scopeId(){return t.Zt(0,this)}set scopeId(e){t.Cn(0,e,this)}_adoptBind(e){t.xn(8,0,this),t.X(e,t.Nt(0,this))}_disownBind(){return t.it(this.bind)}get bind(){return t.Tn(`bind`,t.Yt(8,this),0,this),t.Dt(0,e._Bind,this)}_hasBind(){return!t.an(t.Nt(0,this))}_initBind(n){return t.xn(8,0,this),t.en(0,e._Bind,n,this)}get _isBind(){return t.Yt(8,this)===0}set bind(e){t.xn(8,0,this),t.et(e,t.Nt(0,this))}get _isInherit(){return t.Yt(8,this)===1}set inherit(e){t.xn(8,1,this)}toString(){return`Brand_Scope_`+super.toString()}which(){return t.Yt(8,this)}};const M={UNBOUND:0,TYPE:1};var le=class extends t.q{static UNBOUND=M.UNBOUND;static TYPE=M.TYPE;static _capnp={displayName:`Binding`,id:`c863cd16969ee7fc`,size:new t.T(8,1)};get _isUnbound(){return t.Yt(0,this)===0}set unbound(e){t.xn(0,0,this)}_adoptType(e){t.xn(0,1,this),t.X(e,t.Nt(0,this))}_disownType(){return t.it(this.type)}get type(){return t.Tn(`type`,t.Yt(0,this),1,this),t.Rt(0,A,this)}_hasType(){return!t.an(t.Nt(0,this))}_initType(){return t.xn(0,1,this),t.rn(0,A,this)}get _isType(){return t.Yt(0,this)===1}set type(e){t.xn(0,1,this),t.et(e,t.Nt(0,this))}toString(){return`Brand_Binding_`+super.toString()}which(){return t.Yt(0,this)}},N=class e extends t.q{static Scope=j;static Binding=le;static _capnp={displayName:`Brand`,id:`903455f06065422b`,size:new t.T(0,1)};static _Scopes;_adoptScopes(e){t.X(e,t.Nt(0,this))}_disownScopes(){return t.it(this.scopes)}get scopes(){return t.Dt(0,e._Scopes,this)}_hasScopes(){return!t.an(t.Nt(0,this))}_initScopes(n){return t.en(0,e._Scopes,n,this)}set scopes(e){t.et(e,t.Nt(0,this))}toString(){return`Brand_`+super.toString()}};const P={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 F=class extends t.q{static VOID=P.VOID;static BOOL=P.BOOL;static INT8=P.INT8;static INT16=P.INT16;static INT32=P.INT32;static INT64=P.INT64;static UINT8=P.UINT8;static UINT16=P.UINT16;static UINT32=P.UINT32;static UINT64=P.UINT64;static FLOAT32=P.FLOAT32;static FLOAT64=P.FLOAT64;static TEXT=P.TEXT;static DATA=P.DATA;static LIST=P.LIST;static ENUM=P.ENUM;static STRUCT=P.STRUCT;static INTERFACE=P.INTERFACE;static ANY_POINTER=P.ANY_POINTER;static _capnp={displayName:`Value`,id:`ce23dcd2d7b00c9b`,size:new t.T(16,1)};get _isVoid(){return t.Yt(0,this)===0}set void(e){t.xn(0,0,this)}get bool(){return t.Tn(`bool`,t.Yt(0,this),1,this),t.ft(16,this)}get _isBool(){return t.Yt(0,this)===1}set bool(e){t.xn(0,1,this),t.ln(16,e,this)}get int8(){return t.Tn(`int8`,t.Yt(0,this),2,this),t.Ct(2,this)}get _isInt8(){return t.Yt(0,this)===2}set int8(e){t.xn(0,2,this),t.gn(2,e,this)}get int16(){return t.Tn(`int16`,t.Yt(0,this),3,this),t.bt(2,this)}get _isInt16(){return t.Yt(0,this)===3}set int16(e){t.xn(0,3,this),t.pn(2,e,this)}get int32(){return t.Tn(`int32`,t.Yt(0,this),4,this),t.xt(4,this)}get _isInt32(){return t.Yt(0,this)===4}set int32(e){t.xn(0,4,this),t.mn(4,e,this)}get int64(){return t.Tn(`int64`,t.Yt(0,this),5,this),t.St(8,this)}get _isInt64(){return t.Yt(0,this)===5}set int64(e){t.xn(0,5,this),t.hn(8,e,this)}get uint8(){return t.Tn(`uint8`,t.Yt(0,this),6,this),t.Qt(2,this)}get _isUint8(){return t.Yt(0,this)===6}set uint8(e){t.xn(0,6,this),t.wn(2,e,this)}get uint16(){return t.Tn(`uint16`,t.Yt(0,this),7,this),t.Yt(2,this)}get _isUint16(){return t.Yt(0,this)===7}set uint16(e){t.xn(0,7,this),t.xn(2,e,this)}get uint32(){return t.Tn(`uint32`,t.Yt(0,this),8,this),t.Xt(4,this)}get _isUint32(){return t.Yt(0,this)===8}set uint32(e){t.xn(0,8,this),t.Sn(4,e,this)}get uint64(){return t.Tn(`uint64`,t.Yt(0,this),9,this),t.Zt(8,this)}get _isUint64(){return t.Yt(0,this)===9}set uint64(e){t.xn(0,9,this),t.Cn(8,e,this)}get float32(){return t.Tn(`float32`,t.Yt(0,this),10,this),t.vt(4,this)}get _isFloat32(){return t.Yt(0,this)===10}set float32(e){t.xn(0,10,this),t.dn(4,e,this)}get float64(){return t.Tn(`float64`,t.Yt(0,this),11,this),t.yt(8,this)}get _isFloat64(){return t.Yt(0,this)===11}set float64(e){t.xn(0,11,this),t.fn(8,e,this)}get text(){return t.Tn(`text`,t.Yt(0,this),12,this),t.Jt(0,this)}get _isText(){return t.Yt(0,this)===12}set text(e){t.xn(0,12,this),t.bn(0,e,this)}_adoptData(e){t.xn(0,13,this),t.X(e,t.Nt(0,this))}_disownData(){return t.it(this.data)}get data(){return t.Tn(`data`,t.Yt(0,this),13,this),t.ht(0,this)}_hasData(){return!t.an(t.Nt(0,this))}_initData(e){return t.xn(0,13,this),t.$t(0,e,this)}get _isData(){return t.Yt(0,this)===13}set data(e){t.xn(0,13,this),t.et(e,t.Nt(0,this))}_adoptList(e){t.xn(0,14,this),t.X(e,t.Nt(0,this))}_disownList(){return t.it(this.list)}get list(){return t.Tn(`list`,t.Yt(0,this),14,this),t.Nt(0,this)}_hasList(){return!t.an(t.Nt(0,this))}get _isList(){return t.Yt(0,this)===14}set list(e){t.xn(0,14,this),t.et(e,t.Nt(0,this))}get enum(){return t.Tn(`enum`,t.Yt(0,this),15,this),t.Yt(2,this)}get _isEnum(){return t.Yt(0,this)===15}set enum(e){t.xn(0,15,this),t.xn(2,e,this)}_adoptStruct(e){t.xn(0,16,this),t.X(e,t.Nt(0,this))}_disownStruct(){return t.it(this.struct)}get struct(){return t.Tn(`struct`,t.Yt(0,this),16,this),t.Nt(0,this)}_hasStruct(){return!t.an(t.Nt(0,this))}get _isStruct(){return t.Yt(0,this)===16}set struct(e){t.xn(0,16,this),t.et(e,t.Nt(0,this))}get _isInterface(){return t.Yt(0,this)===17}set interface(e){t.xn(0,17,this)}_adoptAnyPointer(e){t.xn(0,18,this),t.X(e,t.Nt(0,this))}_disownAnyPointer(){return t.it(this.anyPointer)}get anyPointer(){return t.Tn(`anyPointer`,t.Yt(0,this),18,this),t.Nt(0,this)}_hasAnyPointer(){return!t.an(t.Nt(0,this))}get _isAnyPointer(){return t.Yt(0,this)===18}set anyPointer(e){t.xn(0,18,this),t.et(e,t.Nt(0,this))}toString(){return`Value_`+super.toString()}which(){return t.Yt(0,this)}},I=class extends t.q{static _capnp={displayName:`Annotation`,id:`f1c8950dab257542`,size:new t.T(8,2)};get id(){return t.Zt(0,this)}set id(e){t.Cn(0,e,this)}_adoptBrand(e){t.X(e,t.Nt(1,this))}_disownBrand(){return t.it(this.brand)}get brand(){return t.Rt(1,N,this)}_hasBrand(){return!t.an(t.Nt(1,this))}_initBrand(){return t.rn(1,N,this)}set brand(e){t.et(e,t.Nt(1,this))}_adoptValue(e){t.X(e,t.Nt(0,this))}_disownValue(){return t.it(this.value)}get value(){return t.Rt(0,F,this)}_hasValue(){return!t.an(t.Nt(0,this))}_initValue(){return t.rn(0,F,this)}set value(e){t.et(e,t.Nt(0,this))}toString(){return`Annotation_`+super.toString()}};const ue={EMPTY:0,BIT:1,BYTE:2,TWO_BYTES:3,FOUR_BYTES:4,EIGHT_BYTES:5,POINTER:6,INLINE_COMPOSITE:7};var de=class extends t.q{static _capnp={displayName:`CapnpVersion`,id:`d85d305b7d839963`,size:new t.T(8,0)};get major(){return t.Yt(0,this)}set major(e){t.xn(0,e,this)}get minor(){return t.Qt(2,this)}set minor(e){t.wn(2,e,this)}get micro(){return t.Qt(3,this)}set micro(e){t.wn(3,e,this)}toString(){return`CapnpVersion_`+super.toString()}},fe=class extends t.q{static _capnp={displayName:`Import`,id:`ae504193122357e5`,size:new t.T(8,1)};get id(){return t.Zt(0,this)}set id(e){t.Cn(0,e,this)}get name(){return t.Jt(0,this)}set name(e){t.bn(0,e,this)}toString(){return`CodeGeneratorRequest_RequestedFile_Import_`+super.toString()}},L=class e extends t.q{static Import=fe;static _capnp={displayName:`RequestedFile`,id:`cfea0eb02e810062`,size:new t.T(8,2)};static _Imports;get id(){return t.Zt(0,this)}set id(e){t.Cn(0,e,this)}get filename(){return t.Jt(0,this)}set filename(e){t.bn(0,e,this)}_adoptImports(e){t.X(e,t.Nt(1,this))}_disownImports(){return t.it(this.imports)}get imports(){return t.Dt(1,e._Imports,this)}_hasImports(){return!t.an(t.Nt(1,this))}_initImports(n){return t.en(1,e._Imports,n,this)}set imports(e){t.et(e,t.Nt(1,this))}toString(){return`CodeGeneratorRequest_RequestedFile_`+super.toString()}},R=class e extends t.q{static RequestedFile=L;static _capnp={displayName:`CodeGeneratorRequest`,id:`bfc546f6210ad7ce`,size:new t.T(0,4)};static _Nodes;static _SourceInfo;static _RequestedFiles;_adoptCapnpVersion(e){t.X(e,t.Nt(2,this))}_disownCapnpVersion(){return t.it(this.capnpVersion)}get capnpVersion(){return t.Rt(2,de,this)}_hasCapnpVersion(){return!t.an(t.Nt(2,this))}_initCapnpVersion(){return t.rn(2,de,this)}set capnpVersion(e){t.et(e,t.Nt(2,this))}_adoptNodes(e){t.X(e,t.Nt(0,this))}_disownNodes(){return t.it(this.nodes)}get nodes(){return t.Dt(0,e._Nodes,this)}_hasNodes(){return!t.an(t.Nt(0,this))}_initNodes(n){return t.en(0,e._Nodes,n,this)}set nodes(e){t.et(e,t.Nt(0,this))}_adoptSourceInfo(e){t.X(e,t.Nt(3,this))}_disownSourceInfo(){return t.it(this.sourceInfo)}get sourceInfo(){return t.Dt(3,e._SourceInfo,this)}_hasSourceInfo(){return!t.an(t.Nt(3,this))}_initSourceInfo(n){return t.en(3,e._SourceInfo,n,this)}set sourceInfo(e){t.et(e,t.Nt(3,this))}_adoptRequestedFiles(e){t.X(e,t.Nt(1,this))}_disownRequestedFiles(){return t.it(this.requestedFiles)}get requestedFiles(){return t.Dt(1,e._RequestedFiles,this)}_hasRequestedFiles(){return!t.an(t.Nt(1,this))}_initRequestedFiles(n){return t.en(1,e._RequestedFiles,n,this)}set requestedFiles(e){t.et(e,t.Nt(1,this))}toString(){return`CodeGeneratorRequest_`+super.toString()}};u._Members=t.r(l),d._Fields=t.r(C),f._Enumerants=t.r(w),p._Methods=t.r(T),p._Superclasses=t.r(ee),_._Parameters=t.r(s),_._NestedNodes=t.r(c),_._Annotations=t.r(I),C._Annotations=t.r(I),w._Annotations=t.r(I),T._ImplicitParameters=t.r(s),T._Annotations=t.r(I),j._Bind=t.r(le),N._Scopes=t.r(j),L._Imports=t.r(fe),R._Nodes=t.r(_),R._SourceInfo=t.r(u),R._RequestedFiles=t.r(L);const pe=`CAPNP-ES000 Don't know how to generate a %s field with an explicit default value.`,me=`CAPNP-ES001 Don't know how to generate non-inline struct lists.`,he=`CAPNP-ES002 Failed to look up node id %s.`,ge=`CAPNP-ES003 Don't know how to generate a "%s" node.`,_e=`CAPNP-ES004 Don't know how to serialize a value of kind %s.`,ve=`CAPNP-ES005 Don't know how to generate a struct field of kind %d.`,ye=`CAPNP-ES006 Unknown slot type encountered: %d`,be=`CAPNP-ES007 Encountered an unsupported list element type: %d`,xe=`CAPNP-ES009 Failed to transpile emitted schema source code; see above for error messages.`,Se=`CAPNP-ES010 Don't know how to generate a default value for %s fields.`,z={[A.ANY_POINTER]:`$.AnyPointerList`,[A.BOOL]:`$.BoolList`,[A.DATA]:`$.DataList`,[A.ENUM]:`$.Uint16List`,[A.FLOAT32]:`$.Float32List`,[A.FLOAT64]:`$.Float64List`,[A.INT16]:`$.Int16List`,[A.INT32]:`$.Int32List`,[A.INT64]:`$.Int64List`,[A.INT8]:`$.Int8List`,[A.INTERFACE]:`$.InterfaceList`,[A.LIST]:`$.PointerList`,[A.STRUCT]:`$.CompositeList`,[A.TEXT]:`$.TextList`,[A.UINT16]:`$.Uint16List`,[A.UINT32]:`$.Uint32List`,[A.UINT64]:`$.Uint64List`,[A.UINT8]:`$.Uint8List`,[A.VOID]:`$.VoidList`},Ce={[A.BOOL]:{byteLength:1,getter:`getBit`,mask:`getBitMask`,setter:`setBit`},[A.ENUM]:{byteLength:2,getter:`getUint16`,mask:`getUint16Mask`,setter:`setUint16`},[A.FLOAT32]:{byteLength:4,getter:`getFloat32`,mask:`getFloat32Mask`,setter:`setFloat32`},[A.FLOAT64]:{byteLength:8,getter:`getFloat64`,mask:`getFloat64Mask`,setter:`setFloat64`},[A.INT16]:{byteLength:2,getter:`getInt16`,mask:`getInt16Mask`,setter:`setInt16`},[A.INT32]:{byteLength:4,getter:`getInt32`,mask:`getInt32Mask`,setter:`setInt32`},[A.INT64]:{byteLength:8,getter:`getInt64`,mask:`getInt64Mask`,setter:`setInt64`},[A.INT8]:{byteLength:1,getter:`getInt8`,mask:`getInt8Mask`,setter:`setInt8`},[A.UINT16]:{byteLength:2,getter:`getUint16`,mask:`getUint16Mask`,setter:`setUint16`},[A.UINT32]:{byteLength:4,getter:`getUint32`,mask:`getUint32Mask`,setter:`setUint32`},[A.UINT64]:{byteLength:8,getter:`getUint64`,mask:`getUint64Mask`,setter:`setUint64`},[A.UINT8]:{byteLength:1,getter:`getUint8`,mask:`getUint8Mask`,setter:`setUint8`},[A.VOID]:{byteLength:0,getter:`getVoid`,mask:`getVoidMask`,setter:`setVoid`}},we=`
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
// biome-ignore lint: disable
|
|
4
|
-
|
|
5
|
-
// Generated by storm-capnpc
|
|
6
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
7
|
-
|
|
8
|
-
`,Te=`e37ded525a68a7c9`;var B,V;function Ee(){if(V)return B;V=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 B={hexToDec:a,decToHex:i},B}var De=Ee();function H(e){return Oe(e).map(e=>e.toUpperCase()).join(`_`)}function U(e){return e[0].toUpperCase()+e.slice(1)}function Oe(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 ke(e){return BigInt(De.hexToDec(e))}function W(e,t){return e.codeOrder-t.codeOrder}function Ae(e,t){if(!t._isList)return q(e,t,!1);let{elementType:n}=t.list,r=n.which();if(r===A.LIST)return`$.PointerList(${Ae(e,n)})`;if(r===A.STRUCT){if(J(e,n.struct.typeId).struct.preferredListEncoding!==ue.INLINE_COMPOSITE)throw Error(`CAPNP-ES001 Don't know how to generate non-inline struct lists.`);return`$.CompositeList(${q(e,n,!1)})`}return z[r]}function G(e){return e.displayName.slice(e.displayNamePrefixLength)}function K(e){return e.displayName.split(`:`)[1].split(`.`).map(e=>U(e)).join(`_`)}function q(e,n,r){let i=n.which();switch(i){case A.ANY_POINTER:return`$.Pointer`;case A.BOOL:return`boolean`;case A.DATA:return`$.Data`;case A.ENUM:return K(J(e,n.enum.typeId));case A.FLOAT32:case A.FLOAT64:case A.INT16:case A.INT32:case A.INT8:case A.UINT16:case A.UINT32:case A.UINT8:return`number`;case A.UINT64:case A.INT64:return`bigint`;case A.INTERFACE:return K(J(e,n.interface.typeId));case A.LIST:return`$.List${r?`Ctor`:``}<${q(e,n.list.elementType,!1)}>`;case A.STRUCT:{let t=K(J(e,n.struct.typeId));return r?`$.StructCtor<${t}>`:t}case A.TEXT:return`string`;case A.VOID:return`$.Void`;default:throw Error(t.ut(`CAPNP-ES006 Unknown slot type encountered: %d`,i))}}function je(e){return e.struct.fields.filter(e=>e.discriminantValue!==C.NO_DISCRIMINANT)}function Me(e,t){let n=typeof t==`bigint`?t:t.id;return e.nodes.some(e=>e.id===n)}function Ne(e,t){let n=new Xe(e,t);return n.tsPath=J(n,t.id).displayName.replace(/\.capnp$/,``)+`.ts`,n}function J(e,n){let r=typeof n==`bigint`?n:n.id,i=e.nodes.find(e=>e.id===r);if(i===void 0)throw Error(t.ut(`CAPNP-ES002 Failed to look up node id %s.`,r));return i}function Y(e,t){let n=typeof t==`bigint`?t:t.id;return e.req.sourceInfo.find(e=>e.id===n)}function Pe(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 X(e){let t=e.toString(16),n=``;return t[0]===`-`&&(t=t.slice(1),n=`-`),`${n}BigInt("0x${t}")`}function Z(e){let t=e?.docComment;return t?`/**
|
|
9
|
-
`+t.toString().split(`
|
|
10
|
-
`).map(e=>`* ${e}`).join(`
|
|
11
|
-
`)+`
|
|
12
|
-
*/`:``}function Fe(e,t,n,r){let i=r.map(({codeOrder:e},t)=>({fieldIndex:t,codeOrder:e})).sort(W).map(({fieldIndex:e})=>e),a=Y(e,n),o=i.map(e=>{let t=r[e];return`
|
|
13
|
-
${Z(a?.members.at(e))}
|
|
14
|
-
${H(t.name)}: ${t.discriminantValue||e}`});e.codeParts.push(`
|
|
15
|
-
export const ${t} = {
|
|
16
|
-
${o.join(`,
|
|
17
|
-
`)}
|
|
18
|
-
} as const;
|
|
19
|
-
|
|
20
|
-
export type ${t} = (typeof ${t})[keyof typeof ${t}];
|
|
21
|
-
`)}function Ie(e,t){Le(e,t),ze(e,t),Re(e,t)}function Le(e,t){for(let n of t.interface.methods){let t=J(e,n.paramStructType),r=J(e,n.resultStructType);$(e,t),$(e,r),Be(e,r)}}function Re(e,t){let n=K(t),r=`${n}$Server`,i=`${r}$Target`,a=`${n}$Client`,o=t.interface.methods.map(t=>{let n=K(J(e,t.paramStructType)),r=K(J(e,t.resultStructType));return`${t.name}(params: ${n}, results: ${r}): Promise<void>;`}).join(`
|
|
22
|
-
`);e.codeParts.push(`
|
|
23
|
-
export interface ${i} {
|
|
24
|
-
${o}
|
|
25
|
-
}`);let s=[];s.push(`public override readonly target: ${i};`);let c=[],l=0;for(let e of t.interface.methods)c.push(`{
|
|
26
|
-
...${a}.methods[${l}],
|
|
27
|
-
impl: target.${e.name}
|
|
28
|
-
}`),l++;s.push(`
|
|
29
|
-
constructor(target: ${i}) {
|
|
30
|
-
super(target, [
|
|
31
|
-
${c.join(`,
|
|
32
|
-
`)}
|
|
33
|
-
]);
|
|
34
|
-
this.target = target;
|
|
35
|
-
}
|
|
36
|
-
client(): ${a} {
|
|
37
|
-
return new ${a}(this);
|
|
38
|
-
}
|
|
39
|
-
`),e.codeParts.push(`
|
|
40
|
-
export class ${r} extends $.Server {
|
|
41
|
-
${s.join(`
|
|
42
|
-
`)}
|
|
43
|
-
}
|
|
44
|
-
`)}function ze(e,t){let n=`${K(t)}$Client`,r=[];r.push(`
|
|
45
|
-
client: $.Client;
|
|
46
|
-
static readonly interfaceId: bigint = ${X(t.id)};
|
|
47
|
-
constructor(client: $.Client) {
|
|
48
|
-
this.client = client;
|
|
49
|
-
}
|
|
50
|
-
`);let i=[],a=[],o=[];for(let r=0;r<t.interface.methods.length;r++)Ve(e,t,n,i,a,o,r);r.push(`
|
|
51
|
-
static readonly methods:[
|
|
52
|
-
${o.join(`,
|
|
53
|
-
`)}
|
|
54
|
-
] = [
|
|
55
|
-
${a.join(`,
|
|
56
|
-
`)}
|
|
57
|
-
];
|
|
58
|
-
${i.join(`
|
|
59
|
-
`)}
|
|
60
|
-
`),e.codeParts.push(`
|
|
61
|
-
export class ${n} {
|
|
62
|
-
${r.join(`
|
|
63
|
-
`)}
|
|
64
|
-
}
|
|
65
|
-
$.Registry.register(${n}.interfaceId, ${n});
|
|
66
|
-
`)}function Be(e,n){let r=n.id;if(e.generatedResultsPromiseIds.has(r))return;e.generatedResultsPromiseIds.add(r);let i=K(n),a=`${i}$Promise`,o=[];o.push(`
|
|
67
|
-
pipeline: $.Pipeline<any, any, ${i}>;
|
|
68
|
-
constructor(pipeline: $.Pipeline<any, any, ${i}>) {
|
|
69
|
-
this.pipeline = pipeline;
|
|
70
|
-
}
|
|
71
|
-
`);let{struct:s}=n,c=s.fields.toArray().sort(W),l=n=>{let r,i=!1,a;if(n._isSlot){a=n.slot;let t=a.type;if(t.which()!==A.INTERFACE)return;i=!0,r=q(e,t,!1)}else if(n._isGroup)return;else throw Error(t.ut(ve,n.which()));let s=r;i&&(r=`${r}$Client`);let{name:c}=n,l=U(c);o.push(`
|
|
72
|
-
get${l}(): ${r} {
|
|
73
|
-
return new ${r}(this.pipeline.getPipeline(${s}, ${a.offset}).client());
|
|
74
|
-
}
|
|
75
|
-
`)};for(let e of c)l(e);o.push(`
|
|
76
|
-
async promise(): Promise<${i}> {
|
|
77
|
-
return await this.pipeline.struct();
|
|
78
|
-
}
|
|
79
|
-
`),e.codeParts.push(`
|
|
80
|
-
export class ${a} {
|
|
81
|
-
${o.join(`
|
|
82
|
-
`)}
|
|
83
|
-
}
|
|
84
|
-
`)}function Ve(e,t,n,r,i,a,o){let s=t.interface.methods[o],{name:c}=s,l=K(J(e,s.paramStructType)),u=K(J(e,s.resultStructType));a.push(`$.Method<${l}, ${u}>`),i.push(`{
|
|
85
|
-
ParamsClass: ${l},
|
|
86
|
-
ResultsClass: ${u},
|
|
87
|
-
interfaceId: ${n}.interfaceId,
|
|
88
|
-
methodId: ${o},
|
|
89
|
-
interfaceName: "${t.displayName}",
|
|
90
|
-
methodName: "${s.name}"
|
|
91
|
-
}`);let d=Z(Y(e,t)?.members.at(o));r.push(`
|
|
92
|
-
${d}
|
|
93
|
-
${c}(paramsFunc?: (params: ${l}) => void): ${u}$Promise {
|
|
94
|
-
const answer = this.client.call({
|
|
95
|
-
method: ${n}.methods[${o}],
|
|
96
|
-
paramsFunc: paramsFunc
|
|
97
|
-
});
|
|
98
|
-
const pipeline = new $.Pipeline(${u}, answer);
|
|
99
|
-
return new ${u}$Promise(pipeline);
|
|
100
|
-
}
|
|
101
|
-
`)}function He(e,t){let n=G(t),r=K(t),i=t.nestedNodes.map(({id:t})=>J(e,t)).filter(e=>!e._isConst&&!e._isAnnotation),a=t.id,o=a.toString(16),s=je(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(W).map(({fieldIndex:e})=>e),g=m.filter(e=>Pe(e)).sort(W),_=e.nodes.filter(e=>e.scopeId===a&&e._isConst),v=u!==0;v&&Fe(e,r+`_Which`,t,s);let y=[];y.push(..._.map(e=>`static readonly ${H(G(e))} = ${Q(e.const.value)}`),...s.sort(W).map(e=>Ke(r,e)),...i.map(e=>qe(e)));let b=[];for(let e of h){let t=m[e];t._isSlot&&t.slot.hadExplicitDefault&&t.slot.type.which()!==A.VOID&&b.push(We(t))}y.push(`
|
|
102
|
-
public static override readonly _capnp = {
|
|
103
|
-
displayName: "${n}",
|
|
104
|
-
id: "${o}",
|
|
105
|
-
size: new $.ObjectSize(${p}, ${f}),
|
|
106
|
-
${b.join(`,`)}
|
|
107
|
-
}`,...g.map(t=>Ge(e,t)));for(let n of h){let r=m[n];Ue(e,y,t,r,n)}y.push(`public override toString(): string { return "${r}_" + super.toString(); }`),v&&y.push(`
|
|
108
|
-
which(): ${r}_Which {
|
|
109
|
-
return $.utils.getUint16(${d*2}, this) as ${r}_Which;
|
|
110
|
-
}
|
|
111
|
-
`);let x=`
|
|
112
|
-
${Z(Y(e,t))}
|
|
113
|
-
export class ${r} extends $.Struct {
|
|
114
|
-
${y.join(`
|
|
115
|
-
`)}
|
|
116
|
-
}`;e.codeParts.push(x),e.concreteLists.push(...g.map(e=>[r,e]))}function Ue(e,n,r,i,a){let o,s;if(i._isSlot){let t=i.slot.type;o=q(e,t,!1),s=t.which()}else if(i._isGroup)o=K(J(e,i.group.typeId)),s=`group`;else throw Error(t.ut(ve,i.which()));s===A.INTERFACE&&(o=`${o}$Client`);let{discriminantOffset:c}=r.struct,{name:l}=i,u=l===`constructor`?`$constructor`:l,d=U(l),{discriminantValue:f}=i,p=K(r),m=i._isSlot&&i.slot.hadExplicitDefault,h=m?`, ${p}._capnp.default${d}`:``,g=f!==C.NO_DISCRIMINANT,_=i._isSlot?i.slot.offset:0,v=!1,y=!1,b=!1,x,S,w;switch(s){case A.ANY_POINTER:v=!0,y=!0,b=!0,S=`$.utils.getPointer(${_}, this${h})`,w=`$.utils.copyFrom(value, ${S})`;break;case A.BOOL:case A.ENUM:case A.FLOAT32:case A.FLOAT64:case A.INT16:case A.INT32:case A.INT64:case A.INT8:case A.UINT16:case A.UINT32:case A.UINT64:case A.UINT8:{let{byteLength:e,getter:t,setter:n}=Ce[s],r=_*e;S=`$.utils.${t}(${r}, this${h})`,w=`$.utils.${n}(${r}, value, this${h})`,s===A.ENUM&&(S=`${S} as ${o}`);break}case A.DATA:v=!0,y=!0,b=!0,S=`$.utils.getData(${_}, this${h})`,w=`$.utils.copyFrom(value, $.utils.getPointer(${_}, this))`,x=`$.utils.initData(${_}, length, this)`;break;case A.INTERFACE:S=`new ${o}($.utils.getInterfaceClientOrNullAt(${_}, this))`,w=`$.utils.setInterfacePointer(this.segment.message.addCap(value.client), $.utils.getPointer(${_}, this))`;break;case A.LIST:{let e=i.slot.type.list.elementType.which(),n=z[e];if(e===A.LIST||e===A.STRUCT)n=`${p}._${d}`;else if(n===void 0)throw Error(t.ut(`CAPNP-ES007 Encountered an unsupported list element type: %d`,e));v=!0,y=!0,b=!0,S=`$.utils.getList(${_}, ${n}, this${h})`,w=`$.utils.copyFrom(value, $.utils.getPointer(${_}, this))`,x=`$.utils.initList(${_}, ${n}, length, this)`,e===A.ENUM&&(S=`${S} as ${o}`,x=`${x} as ${o}`);break}case A.STRUCT:v=!0,y=!0,b=!0,S=`$.utils.getStruct(${_}, ${o}, this${h})`,w=`$.utils.copyFrom(value, $.utils.getPointer(${_}, this))`,x=`$.utils.initStructAt(${_}, ${o}, this)`;break;case A.TEXT:S=`$.utils.getText(${_}, this${h})`,w=`$.utils.setText(${_}, value, this)`;break;case A.VOID:break;case`group`:if(m)throw Error(t.ut(`CAPNP-ES000 Don't know how to generate a %s field with an explicit default value.`,`group`));S=`$.utils.getAs(${o}, this)`,x=S;break}if(v&&n.push(`
|
|
117
|
-
_adopt${d}(value: $.Orphan<${o}>): void {
|
|
118
|
-
${g?`$.utils.setUint16(${c*2}, ${f}, this);`:``}
|
|
119
|
-
$.utils.adopt(value, $.utils.getPointer(${_}, this));
|
|
120
|
-
}
|
|
121
|
-
`),y&&n.push(`
|
|
122
|
-
_disown${d}(): $.Orphan<${o}> {
|
|
123
|
-
return $.utils.disown(this.${l===`constructor`?`$${l}`:l});
|
|
124
|
-
}
|
|
125
|
-
`),S){let t=Z(Y(e,r)?.members.at(a));n.push(`
|
|
126
|
-
${t}
|
|
127
|
-
get ${u}(): ${o} {
|
|
128
|
-
${g?`$.utils.testWhich(${JSON.stringify(l)}, $.utils.getUint16(${c*2}, this), ${f}, this);`:``}
|
|
129
|
-
return ${S};
|
|
130
|
-
}
|
|
131
|
-
`)}if(b&&n.push(`
|
|
132
|
-
_has${d}(): boolean {
|
|
133
|
-
return !$.utils.isNull($.utils.getPointer(${_}, this));
|
|
134
|
-
}
|
|
135
|
-
`),x){let e=s===A.DATA||s===A.LIST?`length: number`:``;n.push(`
|
|
136
|
-
_init${d}(${e}): ${o} {
|
|
137
|
-
${g?`$.utils.setUint16(${c*2}, ${f}, this);`:``}
|
|
138
|
-
return ${x};
|
|
139
|
-
}
|
|
140
|
-
`)}if(g&&n.push(`
|
|
141
|
-
get _is${d}(): boolean {
|
|
142
|
-
return $.utils.getUint16(${c*2}, this) === ${f};
|
|
143
|
-
}
|
|
144
|
-
`),w||g){let e=w?`value: ${o}`:`_: true`;n.push(`
|
|
145
|
-
set ${u}(${e}) {
|
|
146
|
-
${g?`$.utils.setUint16(${c*2}, ${f}, this);`:``}
|
|
147
|
-
${w?`${w};`:``}
|
|
148
|
-
}
|
|
149
|
-
`)}}function We(e){let{name:n,slot:r}=e,i=r.type.which(),a=Ce[i],o;switch(i){case k.ANY_POINTER:case k.DATA:case k.LIST:case k.STRUCT:case k.INTERFACE:o=Q(r.defaultValue);break;case k.TEXT:o=JSON.stringify(r.defaultValue.text);break;case k.BOOL:{let e=Q(r.defaultValue),t=r.offset%8;o=`$.${a.mask}(${e}, ${t})`;break}case k.ENUM:case k.FLOAT32:case k.FLOAT64:case k.INT16:case k.INT32:case k.INT64:case k.INT8:case k.UINT16:case k.UINT32:case k.UINT64:case k.UINT8:{let e=Q(r.defaultValue);o=`$.${a.mask}(${e})`;break}default:throw Error(t.ut(`CAPNP-ES010 Don't know how to generate a default value for %s fields.`,i))}return`default${U(n)}: ${o}`}function Ge(e,t){return`static ${`_${U(t.name)}`}: ${q(e,t.slot.type,!0)};`}function Ke(e,t){let n=H(t.name);return`static readonly ${n} = ${`${e}_Which.${n}`};`}function Q(e){let n;switch(e.which()){case F.BOOL:return e.bool?`true`:`false`;case F.ENUM:return String(e.enum);case F.FLOAT32:return String(e.float32);case F.FLOAT64:return String(e.float64);case F.INT8:return String(e.int8);case F.INT16:return String(e.int16);case F.INT32:return String(e.int32);case F.INT64:return X(e.int64);case F.UINT8:return String(e.uint8);case F.UINT16:return String(e.uint16);case F.UINT32:return String(e.uint32);case F.UINT64:return X(e.uint64);case F.TEXT:return JSON.stringify(e.text);case F.VOID:return`undefined`;case F.ANY_POINTER:n=e.anyPointer;break;case F.DATA:n=e.data;break;case F.LIST:n=e.list;break;case F.STRUCT:n=e.struct;break;case F.INTERFACE:t.Tn(`interface`,t.Yt(0,e),17,e),n=t.Nt(0,e);break;default:throw Error(t.ut(`CAPNP-ES004 Don't know how to serialize a value of kind %s.`,e.which()))}let r=new t.t;r.setRoot(n);let i=new Uint8Array(r.toPackedArrayBuffer()),a=[];for(let e=0;e<i.byteLength;e++)a.push(`0x${t.on(i[e].toString(16),2)}`);return`$.readRawPointer(new Uint8Array([${a.join(`,`)}]).buffer)`}function qe(e){return`static readonly ${G(e)} = ${K(e)};`}function Je(e,t){let n=G(t),r=K(t),i=t.nestedNodes.map(t=>J(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 ${H(G(e))} = ${Q(e.const.value)}`),...i.map(e=>qe(e)),`static readonly Client = ${r}$Client;
|
|
150
|
-
static readonly Server = ${r}$Server;
|
|
151
|
-
public static override readonly _capnp = {
|
|
152
|
-
displayName: "${n}",
|
|
153
|
-
id: "${o}",
|
|
154
|
-
size: new $.ObjectSize(0, 0),
|
|
155
|
-
}
|
|
156
|
-
public override toString(): string { return "${r}_" + super.toString(); }`);let l=`
|
|
157
|
-
${Z(Y(e,t))}
|
|
158
|
-
export class ${r} extends $.Interface {
|
|
159
|
-
${c.join(`
|
|
160
|
-
`)}
|
|
161
|
-
}`;Ie(e,t),e.codeParts.push(l)}function $(e,n){let r=n.id,i=r.toString(16);if(e.generatedNodeIds.has(i))return;e.generatedNodeIds.add(i);let a=n.nestedNodes.map(t=>J(e,t));for(let t of a)$(e,t);let o=e.nodes.filter(e=>e.scopeId===r&&e._isStruct&&e.struct.isGroup);for(let t of o)$(e,t);let s=n.which();switch(s){case _.STRUCT:He(e,n);break;case _.CONST:break;case _.ENUM:Fe(e,K(n),n,n.enum.enumerants.toArray());break;case _.INTERFACE:Je(e,n);break;case _.ANNOTATION:break;default:throw Error(t.ut(`CAPNP-ES003 Don't know how to generate a "%s" node.`,s))}}var Ye=class{files=[]},Xe=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 Ze(e){e.codeParts.push(`export const _capnpFileId = BigInt("0x${e.file.id.toString(16)}");`)}function Qe(e,t,n){let r=`_${U(n.name)}`,i=Ae(e,n.slot.type);e.codeParts.push(`${t}.${r} = ${i};`)}function $e(e){let t=J(e,e.file),n=ke(`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 et(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=tt(e,J(e,t)).flatMap(e=>{let t=K(e);return e._isInterface?[t,`${t}$Client`]:t}).sort().join(`, `);i.length!==0&&e.codeParts.push(`import { ${i} } from "${r}";`)}}function tt(e,t,n=new Set){n.add(t.id);let r=t.nestedNodes.filter(({id:t})=>Me(e,t)).filter(({id:e})=>!n.has(e)).map(({id:t})=>J(e,t)).filter(e=>e._isStruct||e._isEnum||e._isInterface);return r.concat(r.flatMap(t=>tt(e,t,n)))}async function nt(e,n){let r=new t.t(e,!1).getRoot(R),i=new Ye;if(i.files=r.requestedFiles.map(e=>Ne(r,e)),i.files.length===0)throw Error(GEN_NO_FILES);let a=new Map(i.files.map(e=>[e.tsPath,rt(e)]));if(a.size===0)throw Error(GEN_NO_FILES);if((n?.dts===!0||n?.js===!0)&&it(a,n?.dts===!0,n?.js===!0,n?.tsconfig),!n?.ts)for(let[e]of a)e.endsWith(`.ts`)&&!e.endsWith(`.d.ts`)&&a.delete(e);return{ctx:i,files:a}}function rt(e){$e(e),et(e),Ze(e);let t=J(e,e.file).nestedNodes.map(t=>J(e,t));for(let n of t)$(e,n);for(let[t,n]of e.concreteLists)Qe(e,t,n);let n=r.default.createSourceFile(e.tsPath,e.codeParts.map(e=>e.toString()).join(``),r.default.ScriptTarget.Latest,!1,r.default.ScriptKind.TS);return`
|
|
162
|
-
/* eslint-disable */
|
|
163
|
-
// biome-ignore lint: disable
|
|
164
|
-
|
|
165
|
-
// Generated by storm-capnpc
|
|
166
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
167
|
-
|
|
168
|
-
`+r.default.createPrinter().printFile(n)}function it(e,t,n,i){if(!t&&!n)return;let a={moduleResolution:r.default.ModuleResolutionKind.Bundler,target:r.default.ScriptTarget.ESNext,strict:!0,...i,noEmitOnError:!1,noFallthroughCasesInSwitch:!0,preserveConstEnums:!0,noImplicitReturns:!0,noUnusedLocals:!1,noUnusedParameters:!1,removeComments:!1,skipLibCheck:!0,sourceMap:!1,emitDeclarationOnly:t&&!n,declaration:t},o=r.default.createCompilerHost(a);o.writeFile=(t,n)=>{e.set(t,n)};let s=o.readFile;o.readFile=t=>e.has(t)?e.get(t):s(t);let c=r.default.createProgram([...e.keys()],a,o),l=c.emit(),u=[...r.default.getPreEmitDiagnostics(c),...l.diagnostics];if(u.length>0){for(let e of u){let t=r.default.flattenDiagnosticMessageText(e.messageText,`
|
|
169
|
-
`);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.`)}}async function at(t){let{output:r,tsconfig:i,schemas:s=[],tty:c}=t,l=a.Buffer.alloc(0);if(c){let e=[];process.stdin.on(`data`,t=>{e.push(t)}),await new Promise(e=>{process.stdin.on(`end`,e)});let t=a.Buffer.alloc(e.reduce((e,t)=>e+t.byteLength,0)),n=0;for(let r of e)r.copy(t,n),n+=r.byteLength;l=t}if(l.byteLength===0){let t=[];r&&(0,n.existsSync)(r)?t.push(`-o-:${r}`):(r&&!(0,n.existsSync)(r)&&e.n(`Output directory "${r}" does not exist, will write to schema path...`),t.push(`-o-`)),l=await new Promise(e=>{(0,o.exec)(`capnpc ${t.join(` `)} ${s.join(` `)}`,{encoding:`buffer`},(t,n,r)=>{if(r.length>0&&process.stderr.write(r),t)throw t;e(n)})})}return nt(l,{ts:t.ts??!0,js:!1,dts:!1,tsconfig:i.options})}async function ot(t,n){let r=await e.t(n);if(!r){e.n(`✖ Unable to resolve Cap'n Proto compiler options - the program will terminate`,{logLevel:`all`});return}return nt(t,(0,i.default)({tsconfig:r.tsconfig.options},r,{ts:!0,js:!1,dts:!1}))}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return at}});
|