@stryke/capnp 0.12.44 → 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.
Files changed (97) hide show
  1. package/bin/capnpc.mjs.map +1 -1
  2. package/dist/_virtual/rolldown_runtime.cjs +1 -0
  3. package/dist/_virtual/rolldown_runtime.mjs +1 -0
  4. package/dist/compile.cjs +1 -1
  5. package/dist/compile.d.cts +40 -3
  6. package/dist/compile.d.cts.map +1 -0
  7. package/dist/compile.d.mts +40 -3
  8. package/dist/compile.d.mts.map +1 -0
  9. package/dist/compile.mjs +2 -1
  10. package/dist/compile.mjs.map +1 -0
  11. package/dist/helpers.cjs +1 -1
  12. package/dist/helpers.d.cts +1 -1
  13. package/dist/helpers.d.mts +1 -1
  14. package/dist/helpers.mjs +2 -1
  15. package/dist/helpers.mjs.map +1 -0
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.cts +2 -2
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.mjs +1 -1
  20. package/dist/packages/convert/src/to-array.cjs +1 -0
  21. package/dist/packages/convert/src/to-array.mjs +2 -0
  22. package/dist/packages/convert/src/to-array.mjs.map +1 -0
  23. package/dist/rpc-helpers.cjs +1 -1
  24. package/dist/rpc-helpers.mjs +1 -1
  25. package/dist/rpc-helpers.mjs.map +1 -1
  26. package/dist/types.cjs +1 -1
  27. package/dist/types.d.cts +55 -2
  28. package/dist/types.d.cts.map +1 -0
  29. package/dist/types.d.mts +55 -2
  30. package/dist/types.d.mts.map +1 -0
  31. package/dist/types.mjs +2 -1
  32. package/dist/types.mjs.map +1 -0
  33. package/package.json +26 -11
  34. package/schemas/_virtual/rolldown_runtime.cjs +1 -0
  35. package/schemas/_virtual/rolldown_runtime.mjs +1 -0
  36. package/schemas/packages/capnp/src/compile.cjs +1 -0
  37. package/{dist/compile-DccxA7WZ.d.cts → schemas/packages/capnp/src/compile.d.mts} +4 -4
  38. package/{dist/compile-DccxA7WZ.d.cts.map → schemas/packages/capnp/src/compile.d.mts.map} +1 -1
  39. package/schemas/packages/capnp/src/compile.mjs +1 -0
  40. package/schemas/packages/capnp/src/helpers.cjs +1 -0
  41. package/schemas/packages/capnp/src/helpers.mjs +1 -0
  42. package/schemas/packages/capnp/src/index.cjs +1 -0
  43. package/schemas/packages/capnp/src/index.d.mts +13 -0
  44. package/schemas/packages/capnp/src/index.d.mts.map +1 -0
  45. package/schemas/packages/capnp/src/index.mjs +1 -0
  46. package/{dist/types-D03SjfBL.d.mts → schemas/packages/capnp/src/types.d.mts} +2 -2
  47. package/{dist/types-D03SjfBL.d.mts.map → schemas/packages/capnp/src/types.d.mts.map} +1 -1
  48. package/schemas/persistent.cjs +1 -1
  49. package/schemas/persistent.d.cts +1 -1
  50. package/schemas/persistent.d.mts +1 -1
  51. package/schemas/persistent.mjs +1 -1
  52. package/schemas/persistent.mjs.map +1 -1
  53. package/schemas/rpc-twoparty.cjs +1 -1
  54. package/schemas/rpc-twoparty.d.cts +1 -1
  55. package/schemas/rpc-twoparty.d.mts +1 -1
  56. package/schemas/rpc-twoparty.mjs +1 -1
  57. package/schemas/rpc-twoparty.mjs.map +1 -1
  58. package/schemas/rpc.cjs +1 -1
  59. package/schemas/rpc.d.cts +1 -1
  60. package/schemas/rpc.d.mts +1 -1
  61. package/schemas/rpc.mjs +1 -1
  62. package/schemas/rpc.mjs.map +1 -1
  63. package/schemas/schema.cjs +1 -1
  64. package/schemas/schema.d.cts +1 -1
  65. package/schemas/schema.d.mts +1 -1
  66. package/schemas/schema.mjs +1 -1
  67. package/schemas/schema.mjs.map +1 -1
  68. package/{dist/compile-UkKIpqrK.d.mts → schemas/src/compile.d.cts} +4 -4
  69. package/schemas/src/compile.d.cts.map +1 -0
  70. package/schemas/src/index.d.cts +13 -0
  71. package/schemas/src/index.d.cts.map +1 -0
  72. package/{dist/types-D52qMMoK.d.cts → schemas/src/types.d.cts} +2 -2
  73. package/schemas/src/types.d.cts.map +1 -0
  74. package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs +0 -12
  75. package/dist/capnp-es.GpvEvMIK-BsgDzeBH.mjs.map +0 -1
  76. package/dist/capnp-es.GpvEvMIK-xNDcbmgx.cjs +0 -11
  77. package/dist/compile-ChbJ-p6B.cjs +0 -169
  78. package/dist/compile-DJUj4hs3.mjs +0 -163
  79. package/dist/compile-DJUj4hs3.mjs.map +0 -1
  80. package/dist/compile-UkKIpqrK.d.mts.map +0 -1
  81. package/dist/dist-C1gSYYrg.cjs +0 -1
  82. package/dist/dist-CK47iMja.mjs +0 -2
  83. package/dist/dist-CK47iMja.mjs.map +0 -1
  84. package/dist/helpers-BoKbpcuO.mjs +0 -27
  85. package/dist/helpers-BoKbpcuO.mjs.map +0 -1
  86. package/dist/helpers-DSMRKdw1.cjs +0 -26
  87. package/dist/types-BujoAx-K.mjs +0 -2
  88. package/dist/types-BujoAx-K.mjs.map +0 -1
  89. package/dist/types-D52qMMoK.d.cts.map +0 -1
  90. package/dist/types-D6FuBB1k.cjs +0 -1
  91. package/schemas/index-BAJMwFip.d.mts +0 -96
  92. package/schemas/index-BAJMwFip.d.mts.map +0 -1
  93. package/schemas/index-b7dam4EA.d.cts +0 -96
  94. package/schemas/index-b7dam4EA.d.cts.map +0 -1
  95. package/schemas/src-CGrmR2BO.cjs +0 -11
  96. package/schemas/src-DqIy7I3p.mjs +0 -12
  97. package/schemas/src-DqIy7I3p.mjs.map +0 -1
@@ -1,163 +0,0 @@
1
- import{n as e,t}from"./helpers-BoKbpcuO.mjs";import{$t as n,Cn as r,Ct as i,Dt as a,Jt as o,Nt as s,Qt as c,Rt as l,Sn as u,St as d,T as f,Tn as p,X as m,Xt as h,Yt as g,Zt as _,an as v,bn as y,bt as b,d as x,dn as S,dt as C,en as w,et as T,fn as ee,ft as E,gn as te,hn as ne,ht as re,it as D,ln as O,mn as ie,on as ae,pn as oe,q as k,r as A,rn as j,t as se,ut as M,vt as ce,wn as le,xn as N,xt as ue,yt as de}from"./capnp-es.GpvEvMIK-BsgDzeBH.mjs";import{existsSync as fe}from"@stryke/fs/exists";import P from"typescript";import pe from"defu";import{Buffer as me}from"node:buffer";import{exec as he}from"node:child_process";var ge=class extends k{static _capnp={displayName:`Parameter`,id:`b9521bccf10fa3b1`,size:new f(0,1)};get name(){return o(0,this)}set name(e){y(0,e,this)}toString(){return`Node_Parameter_`+super.toString()}},_e=class extends k{static _capnp={displayName:`NestedNode`,id:`debf55bbfa0fc242`,size:new f(8,1)};get name(){return o(0,this)}set name(e){y(0,e,this)}get id(){return _(0,this)}set id(e){r(0,e,this)}toString(){return`Node_NestedNode_`+super.toString()}},ve=class extends k{static _capnp={displayName:`Member`,id:`c2ba9038898e1fa2`,size:new f(0,1)};get docComment(){return o(0,this)}set docComment(e){y(0,e,this)}toString(){return`Node_SourceInfo_Member_`+super.toString()}},ye=class e extends k{static Member=ve;static _capnp={displayName:`SourceInfo`,id:`f38e1de3041357ae`,size:new f(8,2)};static _Members;get id(){return _(0,this)}set id(e){r(0,e,this)}get docComment(){return o(0,this)}set docComment(e){y(0,e,this)}_adoptMembers(e){m(e,s(1,this))}_disownMembers(){return D(this.members)}get members(){return a(1,e._Members,this)}_hasMembers(){return!v(s(1,this))}_initMembers(t){return w(1,e._Members,t,this)}set members(e){T(e,s(1,this))}toString(){return`Node_SourceInfo_`+super.toString()}},be=class e extends k{static _capnp={displayName:`struct`,id:`9ea0b19b37fb4435`,size:new f(40,6)};static _Fields;get dataWordCount(){return g(14,this)}set dataWordCount(e){N(14,e,this)}get pointerCount(){return g(24,this)}set pointerCount(e){N(24,e,this)}get preferredListEncoding(){return g(26,this)}set preferredListEncoding(e){N(26,e,this)}get isGroup(){return E(224,this)}set isGroup(e){O(224,e,this)}get discriminantCount(){return g(30,this)}set discriminantCount(e){N(30,e,this)}get discriminantOffset(){return h(32,this)}set discriminantOffset(e){u(32,e,this)}_adoptFields(e){m(e,s(3,this))}_disownFields(){return D(this.fields)}get fields(){return a(3,e._Fields,this)}_hasFields(){return!v(s(3,this))}_initFields(t){return w(3,e._Fields,t,this)}set fields(e){T(e,s(3,this))}toString(){return`Node_Struct_`+super.toString()}},xe=class e extends k{static _capnp={displayName:`enum`,id:`b54ab3364333f598`,size:new f(40,6)};static _Enumerants;_adoptEnumerants(e){m(e,s(3,this))}_disownEnumerants(){return D(this.enumerants)}get enumerants(){return a(3,e._Enumerants,this)}_hasEnumerants(){return!v(s(3,this))}_initEnumerants(t){return w(3,e._Enumerants,t,this)}set enumerants(e){T(e,s(3,this))}toString(){return`Node_Enum_`+super.toString()}},F=class e extends k{static _capnp={displayName:`interface`,id:`e82753cff0c2218f`,size:new f(40,6)};static _Methods;static _Superclasses;_adoptMethods(e){m(e,s(3,this))}_disownMethods(){return D(this.methods)}get methods(){return a(3,e._Methods,this)}_hasMethods(){return!v(s(3,this))}_initMethods(t){return w(3,e._Methods,t,this)}set methods(e){T(e,s(3,this))}_adoptSuperclasses(e){m(e,s(4,this))}_disownSuperclasses(){return D(this.superclasses)}get superclasses(){return a(4,e._Superclasses,this)}_hasSuperclasses(){return!v(s(4,this))}_initSuperclasses(t){return w(4,e._Superclasses,t,this)}set superclasses(e){T(e,s(4,this))}toString(){return`Node_Interface_`+super.toString()}},Se=class extends k{static _capnp={displayName:`const`,id:`b18aa5ac7a0d9420`,size:new f(40,6)};_adoptType(e){m(e,s(3,this))}_disownType(){return D(this.type)}get type(){return l(3,z,this)}_hasType(){return!v(s(3,this))}_initType(){return j(3,z,this)}set type(e){T(e,s(3,this))}_adoptValue(e){m(e,s(4,this))}_disownValue(){return D(this.value)}get value(){return l(4,H,this)}_hasValue(){return!v(s(4,this))}_initValue(){return j(4,H,this)}set value(e){T(e,s(4,this))}toString(){return`Node_Const_`+super.toString()}},Ce=class extends k{static _capnp={displayName:`annotation`,id:`ec1619d4400a0290`,size:new f(40,6)};_adoptType(e){m(e,s(3,this))}_disownType(){return D(this.type)}get type(){return l(3,z,this)}_hasType(){return!v(s(3,this))}_initType(){return j(3,z,this)}set type(e){T(e,s(3,this))}get targetsFile(){return E(112,this)}set targetsFile(e){O(112,e,this)}get targetsConst(){return E(113,this)}set targetsConst(e){O(113,e,this)}get targetsEnum(){return E(114,this)}set targetsEnum(e){O(114,e,this)}get targetsEnumerant(){return E(115,this)}set targetsEnumerant(e){O(115,e,this)}get targetsStruct(){return E(116,this)}set targetsStruct(e){O(116,e,this)}get targetsField(){return E(117,this)}set targetsField(e){O(117,e,this)}get targetsUnion(){return E(118,this)}set targetsUnion(e){O(118,e,this)}get targetsGroup(){return E(119,this)}set targetsGroup(e){O(119,e,this)}get targetsInterface(){return E(120,this)}set targetsInterface(e){O(120,e,this)}get targetsMethod(){return E(121,this)}set targetsMethod(e){O(121,e,this)}get targetsParam(){return E(122,this)}set targetsParam(e){O(122,e,this)}get targetsAnnotation(){return E(123,this)}set targetsAnnotation(e){O(123,e,this)}toString(){return`Node_Annotation_`+super.toString()}};const I={FILE:0,STRUCT:1,ENUM:2,INTERFACE:3,CONST:4,ANNOTATION:5};var L=class e extends k{static FILE=I.FILE;static STRUCT=I.STRUCT;static ENUM=I.ENUM;static INTERFACE=I.INTERFACE;static CONST=I.CONST;static ANNOTATION=I.ANNOTATION;static Parameter=ge;static NestedNode=_e;static SourceInfo=ye;static _capnp={displayName:`Node`,id:`e682ab4cf923a417`,size:new f(40,6)};static _Parameters;static _NestedNodes;static _Annotations;get id(){return _(0,this)}set id(e){r(0,e,this)}get displayName(){return o(0,this)}set displayName(e){y(0,e,this)}get displayNamePrefixLength(){return h(8,this)}set displayNamePrefixLength(e){u(8,e,this)}get scopeId(){return _(16,this)}set scopeId(e){r(16,e,this)}_adoptParameters(e){m(e,s(5,this))}_disownParameters(){return D(this.parameters)}get parameters(){return a(5,e._Parameters,this)}_hasParameters(){return!v(s(5,this))}_initParameters(t){return w(5,e._Parameters,t,this)}set parameters(e){T(e,s(5,this))}get isGeneric(){return E(288,this)}set isGeneric(e){O(288,e,this)}_adoptNestedNodes(e){m(e,s(1,this))}_disownNestedNodes(){return D(this.nestedNodes)}get nestedNodes(){return a(1,e._NestedNodes,this)}_hasNestedNodes(){return!v(s(1,this))}_initNestedNodes(t){return w(1,e._NestedNodes,t,this)}set nestedNodes(e){T(e,s(1,this))}_adoptAnnotations(e){m(e,s(2,this))}_disownAnnotations(){return D(this.annotations)}get annotations(){return a(2,e._Annotations,this)}_hasAnnotations(){return!v(s(2,this))}_initAnnotations(t){return w(2,e._Annotations,t,this)}set annotations(e){T(e,s(2,this))}get _isFile(){return g(12,this)===0}set file(e){N(12,0,this)}get struct(){return p(`struct`,g(12,this),1,this),C(be,this)}_initStruct(){return N(12,1,this),C(be,this)}get _isStruct(){return g(12,this)===1}set struct(e){N(12,1,this)}get enum(){return p(`enum`,g(12,this),2,this),C(xe,this)}_initEnum(){return N(12,2,this),C(xe,this)}get _isEnum(){return g(12,this)===2}set enum(e){N(12,2,this)}get interface(){return p(`interface`,g(12,this),3,this),C(F,this)}_initInterface(){return N(12,3,this),C(F,this)}get _isInterface(){return g(12,this)===3}set interface(e){N(12,3,this)}get const(){return p(`const`,g(12,this),4,this),C(Se,this)}_initConst(){return N(12,4,this),C(Se,this)}get _isConst(){return g(12,this)===4}set const(e){N(12,4,this)}get annotation(){return p(`annotation`,g(12,this),5,this),C(Ce,this)}_initAnnotation(){return N(12,5,this),C(Ce,this)}get _isAnnotation(){return g(12,this)===5}set annotation(e){N(12,5,this)}toString(){return`Node_`+super.toString()}which(){return g(12,this)}},we=class extends k{static _capnp={displayName:`slot`,id:`c42305476bb4746f`,size:new f(24,4)};get offset(){return h(4,this)}set offset(e){u(4,e,this)}_adoptType(e){m(e,s(2,this))}_disownType(){return D(this.type)}get type(){return l(2,z,this)}_hasType(){return!v(s(2,this))}_initType(){return j(2,z,this)}set type(e){T(e,s(2,this))}_adoptDefaultValue(e){m(e,s(3,this))}_disownDefaultValue(){return D(this.defaultValue)}get defaultValue(){return l(3,H,this)}_hasDefaultValue(){return!v(s(3,this))}_initDefaultValue(){return j(3,H,this)}set defaultValue(e){T(e,s(3,this))}get hadExplicitDefault(){return E(128,this)}set hadExplicitDefault(e){O(128,e,this)}toString(){return`Field_Slot_`+super.toString()}},Te=class extends k{static _capnp={displayName:`group`,id:`cafccddb68db1d11`,size:new f(24,4)};get typeId(){return _(16,this)}set typeId(e){r(16,e,this)}toString(){return`Field_Group_`+super.toString()}};const Ee={IMPLICIT:0,EXPLICIT:1};var De=class extends k{static IMPLICIT=Ee.IMPLICIT;static EXPLICIT=Ee.EXPLICIT;static _capnp={displayName:`ordinal`,id:`bb90d5c287870be6`,size:new f(24,4)};get _isImplicit(){return g(10,this)===0}set implicit(e){N(10,0,this)}get explicit(){return p(`explicit`,g(10,this),1,this),g(12,this)}get _isExplicit(){return g(10,this)===1}set explicit(e){N(10,1,this),N(12,e,this)}toString(){return`Field_Ordinal_`+super.toString()}which(){return g(10,this)}};const Oe={SLOT:0,GROUP:1};var ke=class e extends k{static NO_DISCRIMINANT=65535;static SLOT=Oe.SLOT;static GROUP=Oe.GROUP;static _capnp={displayName:`Field`,id:`9aad50a41f4af45f`,size:new f(24,4),defaultDiscriminantValue:x(65535)};static _Annotations;get name(){return o(0,this)}set name(e){y(0,e,this)}get codeOrder(){return g(0,this)}set codeOrder(e){N(0,e,this)}_adoptAnnotations(e){m(e,s(1,this))}_disownAnnotations(){return D(this.annotations)}get annotations(){return a(1,e._Annotations,this)}_hasAnnotations(){return!v(s(1,this))}_initAnnotations(t){return w(1,e._Annotations,t,this)}set annotations(e){T(e,s(1,this))}get discriminantValue(){return g(2,this,e._capnp.defaultDiscriminantValue)}set discriminantValue(t){N(2,t,this,e._capnp.defaultDiscriminantValue)}get slot(){return p(`slot`,g(8,this),0,this),C(we,this)}_initSlot(){return N(8,0,this),C(we,this)}get _isSlot(){return g(8,this)===0}set slot(e){N(8,0,this)}get group(){return p(`group`,g(8,this),1,this),C(Te,this)}_initGroup(){return N(8,1,this),C(Te,this)}get _isGroup(){return g(8,this)===1}set group(e){N(8,1,this)}get ordinal(){return C(De,this)}_initOrdinal(){return C(De,this)}toString(){return`Field_`+super.toString()}which(){return g(8,this)}},Ae=class e extends k{static _capnp={displayName:`Enumerant`,id:`978a7cebdc549a4d`,size:new f(8,2)};static _Annotations;get name(){return o(0,this)}set name(e){y(0,e,this)}get codeOrder(){return g(0,this)}set codeOrder(e){N(0,e,this)}_adoptAnnotations(e){m(e,s(1,this))}_disownAnnotations(){return D(this.annotations)}get annotations(){return a(1,e._Annotations,this)}_hasAnnotations(){return!v(s(1,this))}_initAnnotations(t){return w(1,e._Annotations,t,this)}set annotations(e){T(e,s(1,this))}toString(){return`Enumerant_`+super.toString()}},je=class extends k{static _capnp={displayName:`Superclass`,id:`a9962a9ed0a4d7f8`,size:new f(8,1)};get id(){return _(0,this)}set id(e){r(0,e,this)}_adoptBrand(e){m(e,s(0,this))}_disownBrand(){return D(this.brand)}get brand(){return l(0,B,this)}_hasBrand(){return!v(s(0,this))}_initBrand(){return j(0,B,this)}set brand(e){T(e,s(0,this))}toString(){return`Superclass_`+super.toString()}},Me=class e extends k{static _capnp={displayName:`Method`,id:`9500cce23b334d80`,size:new f(24,5)};static _ImplicitParameters;static _Annotations;get name(){return o(0,this)}set name(e){y(0,e,this)}get codeOrder(){return g(0,this)}set codeOrder(e){N(0,e,this)}_adoptImplicitParameters(e){m(e,s(4,this))}_disownImplicitParameters(){return D(this.implicitParameters)}get implicitParameters(){return a(4,e._ImplicitParameters,this)}_hasImplicitParameters(){return!v(s(4,this))}_initImplicitParameters(t){return w(4,e._ImplicitParameters,t,this)}set implicitParameters(e){T(e,s(4,this))}get paramStructType(){return _(8,this)}set paramStructType(e){r(8,e,this)}_adoptParamBrand(e){m(e,s(2,this))}_disownParamBrand(){return D(this.paramBrand)}get paramBrand(){return l(2,B,this)}_hasParamBrand(){return!v(s(2,this))}_initParamBrand(){return j(2,B,this)}set paramBrand(e){T(e,s(2,this))}get resultStructType(){return _(16,this)}set resultStructType(e){r(16,e,this)}_adoptResultBrand(e){m(e,s(3,this))}_disownResultBrand(){return D(this.resultBrand)}get resultBrand(){return l(3,B,this)}_hasResultBrand(){return!v(s(3,this))}_initResultBrand(){return j(3,B,this)}set resultBrand(e){T(e,s(3,this))}_adoptAnnotations(e){m(e,s(1,this))}_disownAnnotations(){return D(this.annotations)}get annotations(){return a(1,e._Annotations,this)}_hasAnnotations(){return!v(s(1,this))}_initAnnotations(t){return w(1,e._Annotations,t,this)}set annotations(e){T(e,s(1,this))}toString(){return`Method_`+super.toString()}},Ne=class extends k{static _capnp={displayName:`list`,id:`87e739250a60ea97`,size:new f(24,1)};_adoptElementType(e){m(e,s(0,this))}_disownElementType(){return D(this.elementType)}get elementType(){return l(0,z,this)}_hasElementType(){return!v(s(0,this))}_initElementType(){return j(0,z,this)}set elementType(e){T(e,s(0,this))}toString(){return`Type_List_`+super.toString()}},Pe=class extends k{static _capnp={displayName:`enum`,id:`9e0e78711a7f87a9`,size:new f(24,1)};get typeId(){return _(8,this)}set typeId(e){r(8,e,this)}_adoptBrand(e){m(e,s(0,this))}_disownBrand(){return D(this.brand)}get brand(){return l(0,B,this)}_hasBrand(){return!v(s(0,this))}_initBrand(){return j(0,B,this)}set brand(e){T(e,s(0,this))}toString(){return`Type_Enum_`+super.toString()}},Fe=class extends k{static _capnp={displayName:`struct`,id:`ac3a6f60ef4cc6d3`,size:new f(24,1)};get typeId(){return _(8,this)}set typeId(e){r(8,e,this)}_adoptBrand(e){m(e,s(0,this))}_disownBrand(){return D(this.brand)}get brand(){return l(0,B,this)}_hasBrand(){return!v(s(0,this))}_initBrand(){return j(0,B,this)}set brand(e){T(e,s(0,this))}toString(){return`Type_Struct_`+super.toString()}},Ie=class extends k{static _capnp={displayName:`interface`,id:`ed8bca69f7fb0cbf`,size:new f(24,1)};get typeId(){return _(8,this)}set typeId(e){r(8,e,this)}_adoptBrand(e){m(e,s(0,this))}_disownBrand(){return D(this.brand)}get brand(){return l(0,B,this)}_hasBrand(){return!v(s(0,this))}_initBrand(){return j(0,B,this)}set brand(e){T(e,s(0,this))}toString(){return`Type_Interface_`+super.toString()}};const Le={ANY_KIND:0,STRUCT:1,LIST:2,CAPABILITY:3};var Re=class extends k{static ANY_KIND=Le.ANY_KIND;static STRUCT=Le.STRUCT;static LIST=Le.LIST;static CAPABILITY=Le.CAPABILITY;static _capnp={displayName:`unconstrained`,id:`8e3b5f79fe593656`,size:new f(24,1)};get _isAnyKind(){return g(10,this)===0}set anyKind(e){N(10,0,this)}get _isStruct(){return g(10,this)===1}set struct(e){N(10,1,this)}get _isList(){return g(10,this)===2}set list(e){N(10,2,this)}get _isCapability(){return g(10,this)===3}set capability(e){N(10,3,this)}toString(){return`Type_AnyPointer_Unconstrained_`+super.toString()}which(){return g(10,this)}},ze=class extends k{static _capnp={displayName:`parameter`,id:`9dd1f724f4614a85`,size:new f(24,1)};get scopeId(){return _(16,this)}set scopeId(e){r(16,e,this)}get parameterIndex(){return g(10,this)}set parameterIndex(e){N(10,e,this)}toString(){return`Type_AnyPointer_Parameter_`+super.toString()}},Be=class extends k{static _capnp={displayName:`implicitMethodParameter`,id:`baefc9120c56e274`,size:new f(24,1)};get parameterIndex(){return g(10,this)}set parameterIndex(e){N(10,e,this)}toString(){return`Type_AnyPointer_ImplicitMethodParameter_`+super.toString()}};const Ve={UNCONSTRAINED:0,PARAMETER:1,IMPLICIT_METHOD_PARAMETER:2};var He=class extends k{static UNCONSTRAINED=Ve.UNCONSTRAINED;static PARAMETER=Ve.PARAMETER;static IMPLICIT_METHOD_PARAMETER=Ve.IMPLICIT_METHOD_PARAMETER;static _capnp={displayName:`anyPointer`,id:`c2573fe8a23e49f1`,size:new f(24,1)};get unconstrained(){return p(`unconstrained`,g(8,this),0,this),C(Re,this)}_initUnconstrained(){return N(8,0,this),C(Re,this)}get _isUnconstrained(){return g(8,this)===0}set unconstrained(e){N(8,0,this)}get parameter(){return p(`parameter`,g(8,this),1,this),C(ze,this)}_initParameter(){return N(8,1,this),C(ze,this)}get _isParameter(){return g(8,this)===1}set parameter(e){N(8,1,this)}get implicitMethodParameter(){return p(`implicitMethodParameter`,g(8,this),2,this),C(Be,this)}_initImplicitMethodParameter(){return N(8,2,this),C(Be,this)}get _isImplicitMethodParameter(){return g(8,this)===2}set implicitMethodParameter(e){N(8,2,this)}toString(){return`Type_AnyPointer_`+super.toString()}which(){return g(8,this)}};const R={VOID:0,BOOL:1,INT8:2,INT16:3,INT32:4,INT64:5,UINT8:6,UINT16:7,UINT32:8,UINT64:9,FLOAT32:10,FLOAT64:11,TEXT:12,DATA:13,LIST:14,ENUM:15,STRUCT:16,INTERFACE:17,ANY_POINTER:18};var z=class extends k{static VOID=R.VOID;static BOOL=R.BOOL;static INT8=R.INT8;static INT16=R.INT16;static INT32=R.INT32;static INT64=R.INT64;static UINT8=R.UINT8;static UINT16=R.UINT16;static UINT32=R.UINT32;static UINT64=R.UINT64;static FLOAT32=R.FLOAT32;static FLOAT64=R.FLOAT64;static TEXT=R.TEXT;static DATA=R.DATA;static LIST=R.LIST;static ENUM=R.ENUM;static STRUCT=R.STRUCT;static INTERFACE=R.INTERFACE;static ANY_POINTER=R.ANY_POINTER;static _capnp={displayName:`Type`,id:`d07378ede1f9cc60`,size:new f(24,1)};get _isVoid(){return g(0,this)===0}set void(e){N(0,0,this)}get _isBool(){return g(0,this)===1}set bool(e){N(0,1,this)}get _isInt8(){return g(0,this)===2}set int8(e){N(0,2,this)}get _isInt16(){return g(0,this)===3}set int16(e){N(0,3,this)}get _isInt32(){return g(0,this)===4}set int32(e){N(0,4,this)}get _isInt64(){return g(0,this)===5}set int64(e){N(0,5,this)}get _isUint8(){return g(0,this)===6}set uint8(e){N(0,6,this)}get _isUint16(){return g(0,this)===7}set uint16(e){N(0,7,this)}get _isUint32(){return g(0,this)===8}set uint32(e){N(0,8,this)}get _isUint64(){return g(0,this)===9}set uint64(e){N(0,9,this)}get _isFloat32(){return g(0,this)===10}set float32(e){N(0,10,this)}get _isFloat64(){return g(0,this)===11}set float64(e){N(0,11,this)}get _isText(){return g(0,this)===12}set text(e){N(0,12,this)}get _isData(){return g(0,this)===13}set data(e){N(0,13,this)}get list(){return p(`list`,g(0,this),14,this),C(Ne,this)}_initList(){return N(0,14,this),C(Ne,this)}get _isList(){return g(0,this)===14}set list(e){N(0,14,this)}get enum(){return p(`enum`,g(0,this),15,this),C(Pe,this)}_initEnum(){return N(0,15,this),C(Pe,this)}get _isEnum(){return g(0,this)===15}set enum(e){N(0,15,this)}get struct(){return p(`struct`,g(0,this),16,this),C(Fe,this)}_initStruct(){return N(0,16,this),C(Fe,this)}get _isStruct(){return g(0,this)===16}set struct(e){N(0,16,this)}get interface(){return p(`interface`,g(0,this),17,this),C(Ie,this)}_initInterface(){return N(0,17,this),C(Ie,this)}get _isInterface(){return g(0,this)===17}set interface(e){N(0,17,this)}get anyPointer(){return p(`anyPointer`,g(0,this),18,this),C(He,this)}_initAnyPointer(){return N(0,18,this),C(He,this)}get _isAnyPointer(){return g(0,this)===18}set anyPointer(e){N(0,18,this)}toString(){return`Type_`+super.toString()}which(){return g(0,this)}};const Ue={BIND:0,INHERIT:1};var We=class e extends k{static BIND=Ue.BIND;static INHERIT=Ue.INHERIT;static _capnp={displayName:`Scope`,id:`abd73485a9636bc9`,size:new f(16,1)};static _Bind;get scopeId(){return _(0,this)}set scopeId(e){r(0,e,this)}_adoptBind(e){N(8,0,this),m(e,s(0,this))}_disownBind(){return D(this.bind)}get bind(){return p(`bind`,g(8,this),0,this),a(0,e._Bind,this)}_hasBind(){return!v(s(0,this))}_initBind(t){return N(8,0,this),w(0,e._Bind,t,this)}get _isBind(){return g(8,this)===0}set bind(e){N(8,0,this),T(e,s(0,this))}get _isInherit(){return g(8,this)===1}set inherit(e){N(8,1,this)}toString(){return`Brand_Scope_`+super.toString()}which(){return g(8,this)}};const Ge={UNBOUND:0,TYPE:1};var Ke=class extends k{static UNBOUND=Ge.UNBOUND;static TYPE=Ge.TYPE;static _capnp={displayName:`Binding`,id:`c863cd16969ee7fc`,size:new f(8,1)};get _isUnbound(){return g(0,this)===0}set unbound(e){N(0,0,this)}_adoptType(e){N(0,1,this),m(e,s(0,this))}_disownType(){return D(this.type)}get type(){return p(`type`,g(0,this),1,this),l(0,z,this)}_hasType(){return!v(s(0,this))}_initType(){return N(0,1,this),j(0,z,this)}get _isType(){return g(0,this)===1}set type(e){N(0,1,this),T(e,s(0,this))}toString(){return`Brand_Binding_`+super.toString()}which(){return g(0,this)}},B=class e extends k{static Scope=We;static Binding=Ke;static _capnp={displayName:`Brand`,id:`903455f06065422b`,size:new f(0,1)};static _Scopes;_adoptScopes(e){m(e,s(0,this))}_disownScopes(){return D(this.scopes)}get scopes(){return a(0,e._Scopes,this)}_hasScopes(){return!v(s(0,this))}_initScopes(t){return w(0,e._Scopes,t,this)}set scopes(e){T(e,s(0,this))}toString(){return`Brand_`+super.toString()}};const V={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 H=class extends k{static VOID=V.VOID;static BOOL=V.BOOL;static INT8=V.INT8;static INT16=V.INT16;static INT32=V.INT32;static INT64=V.INT64;static UINT8=V.UINT8;static UINT16=V.UINT16;static UINT32=V.UINT32;static UINT64=V.UINT64;static FLOAT32=V.FLOAT32;static FLOAT64=V.FLOAT64;static TEXT=V.TEXT;static DATA=V.DATA;static LIST=V.LIST;static ENUM=V.ENUM;static STRUCT=V.STRUCT;static INTERFACE=V.INTERFACE;static ANY_POINTER=V.ANY_POINTER;static _capnp={displayName:`Value`,id:`ce23dcd2d7b00c9b`,size:new f(16,1)};get _isVoid(){return g(0,this)===0}set void(e){N(0,0,this)}get bool(){return p(`bool`,g(0,this),1,this),E(16,this)}get _isBool(){return g(0,this)===1}set bool(e){N(0,1,this),O(16,e,this)}get int8(){return p(`int8`,g(0,this),2,this),i(2,this)}get _isInt8(){return g(0,this)===2}set int8(e){N(0,2,this),te(2,e,this)}get int16(){return p(`int16`,g(0,this),3,this),b(2,this)}get _isInt16(){return g(0,this)===3}set int16(e){N(0,3,this),oe(2,e,this)}get int32(){return p(`int32`,g(0,this),4,this),ue(4,this)}get _isInt32(){return g(0,this)===4}set int32(e){N(0,4,this),ie(4,e,this)}get int64(){return p(`int64`,g(0,this),5,this),d(8,this)}get _isInt64(){return g(0,this)===5}set int64(e){N(0,5,this),ne(8,e,this)}get uint8(){return p(`uint8`,g(0,this),6,this),c(2,this)}get _isUint8(){return g(0,this)===6}set uint8(e){N(0,6,this),le(2,e,this)}get uint16(){return p(`uint16`,g(0,this),7,this),g(2,this)}get _isUint16(){return g(0,this)===7}set uint16(e){N(0,7,this),N(2,e,this)}get uint32(){return p(`uint32`,g(0,this),8,this),h(4,this)}get _isUint32(){return g(0,this)===8}set uint32(e){N(0,8,this),u(4,e,this)}get uint64(){return p(`uint64`,g(0,this),9,this),_(8,this)}get _isUint64(){return g(0,this)===9}set uint64(e){N(0,9,this),r(8,e,this)}get float32(){return p(`float32`,g(0,this),10,this),ce(4,this)}get _isFloat32(){return g(0,this)===10}set float32(e){N(0,10,this),S(4,e,this)}get float64(){return p(`float64`,g(0,this),11,this),de(8,this)}get _isFloat64(){return g(0,this)===11}set float64(e){N(0,11,this),ee(8,e,this)}get text(){return p(`text`,g(0,this),12,this),o(0,this)}get _isText(){return g(0,this)===12}set text(e){N(0,12,this),y(0,e,this)}_adoptData(e){N(0,13,this),m(e,s(0,this))}_disownData(){return D(this.data)}get data(){return p(`data`,g(0,this),13,this),re(0,this)}_hasData(){return!v(s(0,this))}_initData(e){return N(0,13,this),n(0,e,this)}get _isData(){return g(0,this)===13}set data(e){N(0,13,this),T(e,s(0,this))}_adoptList(e){N(0,14,this),m(e,s(0,this))}_disownList(){return D(this.list)}get list(){return p(`list`,g(0,this),14,this),s(0,this)}_hasList(){return!v(s(0,this))}get _isList(){return g(0,this)===14}set list(e){N(0,14,this),T(e,s(0,this))}get enum(){return p(`enum`,g(0,this),15,this),g(2,this)}get _isEnum(){return g(0,this)===15}set enum(e){N(0,15,this),N(2,e,this)}_adoptStruct(e){N(0,16,this),m(e,s(0,this))}_disownStruct(){return D(this.struct)}get struct(){return p(`struct`,g(0,this),16,this),s(0,this)}_hasStruct(){return!v(s(0,this))}get _isStruct(){return g(0,this)===16}set struct(e){N(0,16,this),T(e,s(0,this))}get _isInterface(){return g(0,this)===17}set interface(e){N(0,17,this)}_adoptAnyPointer(e){N(0,18,this),m(e,s(0,this))}_disownAnyPointer(){return D(this.anyPointer)}get anyPointer(){return p(`anyPointer`,g(0,this),18,this),s(0,this)}_hasAnyPointer(){return!v(s(0,this))}get _isAnyPointer(){return g(0,this)===18}set anyPointer(e){N(0,18,this),T(e,s(0,this))}toString(){return`Value_`+super.toString()}which(){return g(0,this)}},U=class extends k{static _capnp={displayName:`Annotation`,id:`f1c8950dab257542`,size:new f(8,2)};get id(){return _(0,this)}set id(e){r(0,e,this)}_adoptBrand(e){m(e,s(1,this))}_disownBrand(){return D(this.brand)}get brand(){return l(1,B,this)}_hasBrand(){return!v(s(1,this))}_initBrand(){return j(1,B,this)}set brand(e){T(e,s(1,this))}_adoptValue(e){m(e,s(0,this))}_disownValue(){return D(this.value)}get value(){return l(0,H,this)}_hasValue(){return!v(s(0,this))}_initValue(){return j(0,H,this)}set value(e){T(e,s(0,this))}toString(){return`Annotation_`+super.toString()}};const qe={EMPTY:0,BIT:1,BYTE:2,TWO_BYTES:3,FOUR_BYTES:4,EIGHT_BYTES:5,POINTER:6,INLINE_COMPOSITE:7};var Je=class extends k{static _capnp={displayName:`CapnpVersion`,id:`d85d305b7d839963`,size:new f(8,0)};get major(){return g(0,this)}set major(e){N(0,e,this)}get minor(){return c(2,this)}set minor(e){le(2,e,this)}get micro(){return c(3,this)}set micro(e){le(3,e,this)}toString(){return`CapnpVersion_`+super.toString()}},Ye=class extends k{static _capnp={displayName:`Import`,id:`ae504193122357e5`,size:new f(8,1)};get id(){return _(0,this)}set id(e){r(0,e,this)}get name(){return o(0,this)}set name(e){y(0,e,this)}toString(){return`CodeGeneratorRequest_RequestedFile_Import_`+super.toString()}},Xe=class e extends k{static Import=Ye;static _capnp={displayName:`RequestedFile`,id:`cfea0eb02e810062`,size:new f(8,2)};static _Imports;get id(){return _(0,this)}set id(e){r(0,e,this)}get filename(){return o(0,this)}set filename(e){y(0,e,this)}_adoptImports(e){m(e,s(1,this))}_disownImports(){return D(this.imports)}get imports(){return a(1,e._Imports,this)}_hasImports(){return!v(s(1,this))}_initImports(t){return w(1,e._Imports,t,this)}set imports(e){T(e,s(1,this))}toString(){return`CodeGeneratorRequest_RequestedFile_`+super.toString()}},Ze=class e extends k{static RequestedFile=Xe;static _capnp={displayName:`CodeGeneratorRequest`,id:`bfc546f6210ad7ce`,size:new f(0,4)};static _Nodes;static _SourceInfo;static _RequestedFiles;_adoptCapnpVersion(e){m(e,s(2,this))}_disownCapnpVersion(){return D(this.capnpVersion)}get capnpVersion(){return l(2,Je,this)}_hasCapnpVersion(){return!v(s(2,this))}_initCapnpVersion(){return j(2,Je,this)}set capnpVersion(e){T(e,s(2,this))}_adoptNodes(e){m(e,s(0,this))}_disownNodes(){return D(this.nodes)}get nodes(){return a(0,e._Nodes,this)}_hasNodes(){return!v(s(0,this))}_initNodes(t){return w(0,e._Nodes,t,this)}set nodes(e){T(e,s(0,this))}_adoptSourceInfo(e){m(e,s(3,this))}_disownSourceInfo(){return D(this.sourceInfo)}get sourceInfo(){return a(3,e._SourceInfo,this)}_hasSourceInfo(){return!v(s(3,this))}_initSourceInfo(t){return w(3,e._SourceInfo,t,this)}set sourceInfo(e){T(e,s(3,this))}_adoptRequestedFiles(e){m(e,s(1,this))}_disownRequestedFiles(){return D(this.requestedFiles)}get requestedFiles(){return a(1,e._RequestedFiles,this)}_hasRequestedFiles(){return!v(s(1,this))}_initRequestedFiles(t){return w(1,e._RequestedFiles,t,this)}set requestedFiles(e){T(e,s(1,this))}toString(){return`CodeGeneratorRequest_`+super.toString()}};ye._Members=A(ve),be._Fields=A(ke),xe._Enumerants=A(Ae),F._Methods=A(Me),F._Superclasses=A(je),L._Parameters=A(ge),L._NestedNodes=A(_e),L._Annotations=A(U),ke._Annotations=A(U),Ae._Annotations=A(U),Me._ImplicitParameters=A(ge),Me._Annotations=A(U),We._Bind=A(Ke),B._Scopes=A(We),Xe._Imports=A(Ye),Ze._Nodes=A(L),Ze._SourceInfo=A(ye),Ze._RequestedFiles=A(Xe);const Qe=`CAPNP-ES005 Don't know how to generate a struct field of kind %d.`,$e={[z.ANY_POINTER]:`$.AnyPointerList`,[z.BOOL]:`$.BoolList`,[z.DATA]:`$.DataList`,[z.ENUM]:`$.Uint16List`,[z.FLOAT32]:`$.Float32List`,[z.FLOAT64]:`$.Float64List`,[z.INT16]:`$.Int16List`,[z.INT32]:`$.Int32List`,[z.INT64]:`$.Int64List`,[z.INT8]:`$.Int8List`,[z.INTERFACE]:`$.InterfaceList`,[z.LIST]:`$.PointerList`,[z.STRUCT]:`$.CompositeList`,[z.TEXT]:`$.TextList`,[z.UINT16]:`$.Uint16List`,[z.UINT32]:`$.Uint32List`,[z.UINT64]:`$.Uint64List`,[z.UINT8]:`$.Uint8List`,[z.VOID]:`$.VoidList`},et={[z.BOOL]:{byteLength:1,getter:`getBit`,mask:`getBitMask`,setter:`setBit`},[z.ENUM]:{byteLength:2,getter:`getUint16`,mask:`getUint16Mask`,setter:`setUint16`},[z.FLOAT32]:{byteLength:4,getter:`getFloat32`,mask:`getFloat32Mask`,setter:`setFloat32`},[z.FLOAT64]:{byteLength:8,getter:`getFloat64`,mask:`getFloat64Mask`,setter:`setFloat64`},[z.INT16]:{byteLength:2,getter:`getInt16`,mask:`getInt16Mask`,setter:`setInt16`},[z.INT32]:{byteLength:4,getter:`getInt32`,mask:`getInt32Mask`,setter:`setInt32`},[z.INT64]:{byteLength:8,getter:`getInt64`,mask:`getInt64Mask`,setter:`setInt64`},[z.INT8]:{byteLength:1,getter:`getInt8`,mask:`getInt8Mask`,setter:`setInt8`},[z.UINT16]:{byteLength:2,getter:`getUint16`,mask:`getUint16Mask`,setter:`setUint16`},[z.UINT32]:{byteLength:4,getter:`getUint32`,mask:`getUint32Mask`,setter:`setUint32`},[z.UINT64]:{byteLength:8,getter:`getUint64`,mask:`getUint64Mask`,setter:`setUint64`},[z.UINT8]:{byteLength:1,getter:`getUint8`,mask:`getUint8Mask`,setter:`setUint8`},[z.VOID]:{byteLength:0,getter:`getVoid`,mask:`getVoidMask`,setter:`setVoid`}};var tt,nt;function rt(){if(nt)return tt;nt=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 tt={hexToDec:a,decToHex:i},tt}var it=rt();function at(e){return ot(e).map(e=>e.toUpperCase()).join(`_`)}function W(e){return e[0].toUpperCase()+e.slice(1)}function ot(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 st(e){return BigInt(it.hexToDec(e))}function G(e,t){return e.codeOrder-t.codeOrder}function ct(e,t){if(!t._isList)return J(e,t,!1);let{elementType:n}=t.list,r=n.which();if(r===z.LIST)return`$.PointerList(${ct(e,n)})`;if(r===z.STRUCT){if(Y(e,n.struct.typeId).struct.preferredListEncoding!==qe.INLINE_COMPOSITE)throw Error(`CAPNP-ES001 Don't know how to generate non-inline struct lists.`);return`$.CompositeList(${J(e,n,!1)})`}return $e[r]}function K(e){return e.displayName.slice(e.displayNamePrefixLength)}function q(e){return e.displayName.split(`:`)[1].split(`.`).map(e=>W(e)).join(`_`)}function J(e,t,n){let r=t.which();switch(r){case z.ANY_POINTER:return`$.Pointer`;case z.BOOL:return`boolean`;case z.DATA:return`$.Data`;case z.ENUM:return q(Y(e,t.enum.typeId));case z.FLOAT32:case z.FLOAT64:case z.INT16:case z.INT32:case z.INT8:case z.UINT16:case z.UINT32:case z.UINT8:return`number`;case z.UINT64:case z.INT64:return`bigint`;case z.INTERFACE:return q(Y(e,t.interface.typeId));case z.LIST:return`$.List${n?`Ctor`:``}<${J(e,t.list.elementType,!1)}>`;case z.STRUCT:{let r=q(Y(e,t.struct.typeId));return n?`$.StructCtor<${r}>`:r}case z.TEXT:return`string`;case z.VOID:return`$.Void`;default:throw Error(M(`CAPNP-ES006 Unknown slot type encountered: %d`,r))}}function lt(e){return e.struct.fields.filter(e=>e.discriminantValue!==ke.NO_DISCRIMINANT)}function ut(e,t){let n=typeof t==`bigint`?t:t.id;return e.nodes.some(e=>e.id===n)}function dt(e,t){let n=new kt(e,t);return n.tsPath=Y(n,t.id).displayName.replace(/\.capnp$/,``)+`.ts`,n}function Y(e,t){let n=typeof t==`bigint`?t:t.id,r=e.nodes.find(e=>e.id===n);if(r===void 0)throw Error(M(`CAPNP-ES002 Failed to look up node id %s.`,n));return r}function X(e,t){let n=typeof t==`bigint`?t:t.id;return e.req.sourceInfo.find(e=>e.id===n)}function ft(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 pt(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?`/**
2
- `+t.toString().split(`
3
- `).map(e=>`* ${e}`).join(`
4
- `)+`
5
- */`:``}function mt(e,t,n,r){let i=r.map(({codeOrder:e},t)=>({fieldIndex:t,codeOrder:e})).sort(G).map(({fieldIndex:e})=>e),a=X(e,n),o=i.map(e=>{let t=r[e];return`
6
- ${Z(a?.members.at(e))}
7
- ${at(t.name)}: ${t.discriminantValue||e}`});e.codeParts.push(`
8
- export const ${t} = {
9
- ${o.join(`,
10
- `)}
11
- } as const;
12
-
13
- export type ${t} = (typeof ${t})[keyof typeof ${t}];
14
- `)}function ht(e,t){gt(e,t),vt(e,t),_t(e,t)}function gt(e,t){for(let n of t.interface.methods){let t=Y(e,n.paramStructType),r=Y(e,n.resultStructType);$(e,t),$(e,r),yt(e,r)}}function _t(e,t){let n=q(t),r=`${n}$Server`,i=`${r}$Target`,a=`${n}$Client`,o=t.interface.methods.map(t=>{let n=q(Y(e,t.paramStructType)),r=q(Y(e,t.resultStructType));return`${t.name}(params: ${n}, results: ${r}): Promise<void>;`}).join(`
15
- `);e.codeParts.push(`
16
- export interface ${i} {
17
- ${o}
18
- }`);let s=[];s.push(`public override readonly target: ${i};`);let c=[],l=0;for(let e of t.interface.methods)c.push(`{
19
- ...${a}.methods[${l}],
20
- impl: target.${e.name}
21
- }`),l++;s.push(`
22
- constructor(target: ${i}) {
23
- super(target, [
24
- ${c.join(`,
25
- `)}
26
- ]);
27
- this.target = target;
28
- }
29
- client(): ${a} {
30
- return new ${a}(this);
31
- }
32
- `),e.codeParts.push(`
33
- export class ${r} extends $.Server {
34
- ${s.join(`
35
- `)}
36
- }
37
- `)}function vt(e,t){let n=`${q(t)}$Client`,r=[];r.push(`
38
- client: $.Client;
39
- static readonly interfaceId: bigint = ${pt(t.id)};
40
- constructor(client: $.Client) {
41
- this.client = client;
42
- }
43
- `);let i=[],a=[],o=[];for(let r=0;r<t.interface.methods.length;r++)bt(e,t,n,i,a,o,r);r.push(`
44
- static readonly methods:[
45
- ${o.join(`,
46
- `)}
47
- ] = [
48
- ${a.join(`,
49
- `)}
50
- ];
51
- ${i.join(`
52
- `)}
53
- `),e.codeParts.push(`
54
- export class ${n} {
55
- ${r.join(`
56
- `)}
57
- }
58
- $.Registry.register(${n}.interfaceId, ${n});
59
- `)}function yt(e,t){let n=t.id;if(e.generatedResultsPromiseIds.has(n))return;e.generatedResultsPromiseIds.add(n);let r=q(t),i=`${r}$Promise`,a=[];a.push(`
60
- pipeline: $.Pipeline<any, any, ${r}>;
61
- constructor(pipeline: $.Pipeline<any, any, ${r}>) {
62
- this.pipeline = pipeline;
63
- }
64
- `);let{struct:o}=t,s=o.fields.toArray().sort(G),c=t=>{let n,r=!1,i;if(t._isSlot){i=t.slot;let a=i.type;if(a.which()!==z.INTERFACE)return;r=!0,n=J(e,a,!1)}else if(t._isGroup)return;else throw Error(M(Qe,t.which()));let o=n;r&&(n=`${n}$Client`);let{name:s}=t,c=W(s);a.push(`
65
- get${c}(): ${n} {
66
- return new ${n}(this.pipeline.getPipeline(${o}, ${i.offset}).client());
67
- }
68
- `)};for(let e of s)c(e);a.push(`
69
- async promise(): Promise<${r}> {
70
- return await this.pipeline.struct();
71
- }
72
- `),e.codeParts.push(`
73
- export class ${i} {
74
- ${a.join(`
75
- `)}
76
- }
77
- `)}function bt(e,t,n,r,i,a,o){let s=t.interface.methods[o],{name:c}=s,l=q(Y(e,s.paramStructType)),u=q(Y(e,s.resultStructType));a.push(`$.Method<${l}, ${u}>`),i.push(`{
78
- ParamsClass: ${l},
79
- ResultsClass: ${u},
80
- interfaceId: ${n}.interfaceId,
81
- methodId: ${o},
82
- interfaceName: "${t.displayName}",
83
- methodName: "${s.name}"
84
- }`);let d=Z(X(e,t)?.members.at(o));r.push(`
85
- ${d}
86
- ${c}(paramsFunc?: (params: ${l}) => void): ${u}$Promise {
87
- const answer = this.client.call({
88
- method: ${n}.methods[${o}],
89
- paramsFunc: paramsFunc
90
- });
91
- const pipeline = new $.Pipeline(${u}, answer);
92
- return new ${u}$Promise(pipeline);
93
- }
94
- `)}function xt(e,t){let n=K(t),r=q(t),i=t.nestedNodes.map(({id:t})=>Y(e,t)).filter(e=>!e._isConst&&!e._isAnnotation),a=t.id,o=a.toString(16),s=lt(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(G).map(({fieldIndex:e})=>e),g=m.filter(e=>ft(e)).sort(G),_=e.nodes.filter(e=>e.scopeId===a&&e._isConst),v=u!==0;v&&mt(e,r+`_Which`,t,s);let y=[];y.push(..._.map(e=>`static readonly ${at(K(e))} = ${Q(e.const.value)}`),...s.sort(G).map(e=>Tt(r,e)),...i.map(e=>Et(e)));let b=[];for(let e of h){let t=m[e];t._isSlot&&t.slot.hadExplicitDefault&&t.slot.type.which()!==z.VOID&&b.push(Ct(t))}y.push(`
95
- public static override readonly _capnp = {
96
- displayName: "${n}",
97
- id: "${o}",
98
- size: new $.ObjectSize(${p}, ${f}),
99
- ${b.join(`,`)}
100
- }`,...g.map(t=>wt(e,t)));for(let n of h){let r=m[n];St(e,y,t,r,n)}y.push(`public override toString(): string { return "${r}_" + super.toString(); }`),v&&y.push(`
101
- which(): ${r}_Which {
102
- return $.utils.getUint16(${d*2}, this) as ${r}_Which;
103
- }
104
- `);let x=`
105
- ${Z(X(e,t))}
106
- export class ${r} extends $.Struct {
107
- ${y.join(`
108
- `)}
109
- }`;e.codeParts.push(x),e.concreteLists.push(...g.map(e=>[r,e]))}function St(e,t,n,r,i){let a,o;if(r._isSlot){let t=r.slot.type;a=J(e,t,!1),o=t.which()}else if(r._isGroup)a=q(Y(e,r.group.typeId)),o=`group`;else throw Error(M(Qe,r.which()));o===z.INTERFACE&&(a=`${a}$Client`);let{discriminantOffset:s}=n.struct,{name:c}=r,l=c===`constructor`?`$constructor`:c,u=W(c),{discriminantValue:d}=r,f=q(n),p=r._isSlot&&r.slot.hadExplicitDefault,m=p?`, ${f}._capnp.default${u}`:``,h=d!==ke.NO_DISCRIMINANT,g=r._isSlot?r.slot.offset:0,_=!1,v=!1,y=!1,b,x,S;switch(o){case z.ANY_POINTER:_=!0,v=!0,y=!0,x=`$.utils.getPointer(${g}, this${m})`,S=`$.utils.copyFrom(value, ${x})`;break;case z.BOOL:case z.ENUM:case z.FLOAT32:case z.FLOAT64:case z.INT16:case z.INT32:case z.INT64:case z.INT8:case z.UINT16:case z.UINT32:case z.UINT64:case z.UINT8:{let{byteLength:e,getter:t,setter:n}=et[o],r=g*e;x=`$.utils.${t}(${r}, this${m})`,S=`$.utils.${n}(${r}, value, this${m})`,o===z.ENUM&&(x=`${x} as ${a}`);break}case z.DATA:_=!0,v=!0,y=!0,x=`$.utils.getData(${g}, this${m})`,S=`$.utils.copyFrom(value, $.utils.getPointer(${g}, this))`,b=`$.utils.initData(${g}, length, this)`;break;case z.INTERFACE:x=`new ${a}($.utils.getInterfaceClientOrNullAt(${g}, this))`,S=`$.utils.setInterfacePointer(this.segment.message.addCap(value.client), $.utils.getPointer(${g}, this))`;break;case z.LIST:{let e=r.slot.type.list.elementType.which(),t=$e[e];if(e===z.LIST||e===z.STRUCT)t=`${f}._${u}`;else if(t===void 0)throw Error(M(`CAPNP-ES007 Encountered an unsupported list element type: %d`,e));_=!0,v=!0,y=!0,x=`$.utils.getList(${g}, ${t}, this${m})`,S=`$.utils.copyFrom(value, $.utils.getPointer(${g}, this))`,b=`$.utils.initList(${g}, ${t}, length, this)`,e===z.ENUM&&(x=`${x} as ${a}`,b=`${b} as ${a}`);break}case z.STRUCT:_=!0,v=!0,y=!0,x=`$.utils.getStruct(${g}, ${a}, this${m})`,S=`$.utils.copyFrom(value, $.utils.getPointer(${g}, this))`,b=`$.utils.initStructAt(${g}, ${a}, this)`;break;case z.TEXT:x=`$.utils.getText(${g}, this${m})`,S=`$.utils.setText(${g}, value, this)`;break;case z.VOID:break;case`group`:if(p)throw Error(M(`CAPNP-ES000 Don't know how to generate a %s field with an explicit default value.`,`group`));x=`$.utils.getAs(${a}, this)`,b=x;break}if(_&&t.push(`
110
- _adopt${u}(value: $.Orphan<${a}>): void {
111
- ${h?`$.utils.setUint16(${s*2}, ${d}, this);`:``}
112
- $.utils.adopt(value, $.utils.getPointer(${g}, this));
113
- }
114
- `),v&&t.push(`
115
- _disown${u}(): $.Orphan<${a}> {
116
- return $.utils.disown(this.${c===`constructor`?`$${c}`:c});
117
- }
118
- `),x){let r=Z(X(e,n)?.members.at(i));t.push(`
119
- ${r}
120
- get ${l}(): ${a} {
121
- ${h?`$.utils.testWhich(${JSON.stringify(c)}, $.utils.getUint16(${s*2}, this), ${d}, this);`:``}
122
- return ${x};
123
- }
124
- `)}if(y&&t.push(`
125
- _has${u}(): boolean {
126
- return !$.utils.isNull($.utils.getPointer(${g}, this));
127
- }
128
- `),b){let e=o===z.DATA||o===z.LIST?`length: number`:``;t.push(`
129
- _init${u}(${e}): ${a} {
130
- ${h?`$.utils.setUint16(${s*2}, ${d}, this);`:``}
131
- return ${b};
132
- }
133
- `)}if(h&&t.push(`
134
- get _is${u}(): boolean {
135
- return $.utils.getUint16(${s*2}, this) === ${d};
136
- }
137
- `),S||h){let e=S?`value: ${a}`:`_: true`;t.push(`
138
- set ${l}(${e}) {
139
- ${h?`$.utils.setUint16(${s*2}, ${d}, this);`:``}
140
- ${S?`${S};`:``}
141
- }
142
- `)}}function Ct(e){let{name:t,slot:n}=e,r=n.type.which(),i=et[r],a;switch(r){case R.ANY_POINTER:case R.DATA:case R.LIST:case R.STRUCT:case R.INTERFACE:a=Q(n.defaultValue);break;case R.TEXT:a=JSON.stringify(n.defaultValue.text);break;case R.BOOL:{let e=Q(n.defaultValue),t=n.offset%8;a=`$.${i.mask}(${e}, ${t})`;break}case R.ENUM:case R.FLOAT32:case R.FLOAT64:case R.INT16:case R.INT32:case R.INT64:case R.INT8:case R.UINT16:case R.UINT32:case R.UINT64:case R.UINT8:{let e=Q(n.defaultValue);a=`$.${i.mask}(${e})`;break}default:throw Error(M(`CAPNP-ES010 Don't know how to generate a default value for %s fields.`,r))}return`default${W(t)}: ${a}`}function wt(e,t){return`static ${`_${W(t.name)}`}: ${J(e,t.slot.type,!0)};`}function Tt(e,t){let n=at(t.name);return`static readonly ${n} = ${`${e}_Which.${n}`};`}function Q(e){let t;switch(e.which()){case H.BOOL:return e.bool?`true`:`false`;case H.ENUM:return String(e.enum);case H.FLOAT32:return String(e.float32);case H.FLOAT64:return String(e.float64);case H.INT8:return String(e.int8);case H.INT16:return String(e.int16);case H.INT32:return String(e.int32);case H.INT64:return pt(e.int64);case H.UINT8:return String(e.uint8);case H.UINT16:return String(e.uint16);case H.UINT32:return String(e.uint32);case H.UINT64:return pt(e.uint64);case H.TEXT:return JSON.stringify(e.text);case H.VOID:return`undefined`;case H.ANY_POINTER:t=e.anyPointer;break;case H.DATA:t=e.data;break;case H.LIST:t=e.list;break;case H.STRUCT:t=e.struct;break;case H.INTERFACE:p(`interface`,g(0,e),17,e),t=s(0,e);break;default:throw Error(M(`CAPNP-ES004 Don't know how to serialize a value of kind %s.`,e.which()))}let n=new se;n.setRoot(t);let r=new Uint8Array(n.toPackedArrayBuffer()),i=[];for(let e=0;e<r.byteLength;e++)i.push(`0x${ae(r[e].toString(16),2)}`);return`$.readRawPointer(new Uint8Array([${i.join(`,`)}]).buffer)`}function Et(e){return`static readonly ${K(e)} = ${q(e)};`}function Dt(e,t){let n=K(t),r=q(t),i=t.nestedNodes.map(t=>Y(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 ${at(K(e))} = ${Q(e.const.value)}`),...i.map(e=>Et(e)),`static readonly Client = ${r}$Client;
143
- static readonly Server = ${r}$Server;
144
- public static override readonly _capnp = {
145
- displayName: "${n}",
146
- id: "${o}",
147
- size: new $.ObjectSize(0, 0),
148
- }
149
- public override toString(): string { return "${r}_" + super.toString(); }`);let l=`
150
- ${Z(X(e,t))}
151
- export class ${r} extends $.Interface {
152
- ${c.join(`
153
- `)}
154
- }`;ht(e,t),e.codeParts.push(l)}function $(e,t){let n=t.id,r=n.toString(16);if(e.generatedNodeIds.has(r))return;e.generatedNodeIds.add(r);let i=t.nestedNodes.map(t=>Y(e,t));for(let t of i)$(e,t);let a=e.nodes.filter(e=>e.scopeId===n&&e._isStruct&&e.struct.isGroup);for(let t of a)$(e,t);let o=t.which();switch(o){case L.STRUCT:xt(e,t);break;case L.CONST:break;case L.ENUM:mt(e,q(t),t,t.enum.enumerants.toArray());break;case L.INTERFACE:Dt(e,t);break;case L.ANNOTATION:break;default:throw Error(M(`CAPNP-ES003 Don't know how to generate a "%s" node.`,o))}}var Ot=class{files=[]},kt=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 At(e){e.codeParts.push(`export const _capnpFileId = BigInt("0x${e.file.id.toString(16)}");`)}function jt(e,t,n){let r=`_${W(n.name)}`,i=ct(e,n.slot.type);e.codeParts.push(`${t}.${r} = ${i};`)}function Mt(e){let t=Y(e,e.file),n=st(`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 Nt(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=Pt(e,Y(e,t)).flatMap(e=>{let t=q(e);return e._isInterface?[t,`${t}$Client`]:t}).sort().join(`, `);i.length!==0&&e.codeParts.push(`import { ${i} } from "${r}";`)}}function Pt(e,t,n=new Set){n.add(t.id);let r=t.nestedNodes.filter(({id:t})=>ut(e,t)).filter(({id:e})=>!n.has(e)).map(({id:t})=>Y(e,t)).filter(e=>e._isStruct||e._isEnum||e._isInterface);return r.concat(r.flatMap(t=>Pt(e,t,n)))}async function Ft(e,t){let n=new se(e,!1).getRoot(Ze),r=new Ot;if(r.files=n.requestedFiles.map(e=>dt(n,e)),r.files.length===0)throw Error(GEN_NO_FILES);let i=new Map(r.files.map(e=>[e.tsPath,It(e)]));if(i.size===0)throw Error(GEN_NO_FILES);if((t?.dts===!0||t?.js===!0)&&Lt(i,t?.dts===!0,t?.js===!0,t?.tsconfig),!t?.ts)for(let[e]of i)e.endsWith(`.ts`)&&!e.endsWith(`.d.ts`)&&i.delete(e);return{ctx:r,files:i}}function It(e){Mt(e),Nt(e),At(e);let t=Y(e,e.file).nestedNodes.map(t=>Y(e,t));for(let n of t)$(e,n);for(let[t,n]of e.concreteLists)jt(e,t,n);let n=P.createSourceFile(e.tsPath,e.codeParts.map(e=>e.toString()).join(``),P.ScriptTarget.Latest,!1,P.ScriptKind.TS);return`
155
- /* eslint-disable */
156
- // biome-ignore lint: disable
157
-
158
- // Generated by storm-capnpc
159
- // Note: Do not edit this file manually - it will be overwritten automatically
160
-
161
- `+P.createPrinter().printFile(n)}function Lt(e,t,n,r){if(!t&&!n)return;let i={moduleResolution:P.ModuleResolutionKind.Bundler,target:P.ScriptTarget.ESNext,strict:!0,...r,noEmitOnError:!1,noFallthroughCasesInSwitch:!0,preserveConstEnums:!0,noImplicitReturns:!0,noUnusedLocals:!1,noUnusedParameters:!1,removeComments:!1,skipLibCheck:!0,sourceMap:!1,emitDeclarationOnly:t&&!n,declaration:t},a=P.createCompilerHost(i);a.writeFile=(t,n)=>{e.set(t,n)};let o=a.readFile;a.readFile=t=>e.has(t)?e.get(t):o(t);let s=P.createProgram([...e.keys()],i,a),c=s.emit(),l=[...P.getPreEmitDiagnostics(s),...c.diagnostics];if(l.length>0){for(let e of l){let t=P.flattenDiagnosticMessageText(e.messageText,`
162
- `);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 Rt(t){let{output:n,tsconfig:r,schemas:i=[],tty:a}=t,o=me.alloc(0);if(a){let e=[];process.stdin.on(`data`,t=>{e.push(t)}),await new Promise(e=>{process.stdin.on(`end`,e)});let t=me.alloc(e.reduce((e,t)=>e+t.byteLength,0)),n=0;for(let r of e)r.copy(t,n),n+=r.byteLength;o=t}if(o.byteLength===0){let t=[];n&&fe(n)?t.push(`-o-:${n}`):(n&&!fe(n)&&e(`Output directory "${n}" does not exist, will write to schema path...`),t.push(`-o-`)),o=await new Promise(e=>{he(`capnpc ${t.join(` `)} ${i.join(` `)}`,{encoding:`buffer`},(t,n,r)=>{if(r.length>0&&process.stderr.write(r),t)throw t;e(n)})})}return Ft(o,{ts:t.ts??!0,js:!1,dts:!1,tsconfig:r.options})}async function zt(n,r){let i=await t(r);if(!i){e(`✖ Unable to resolve Cap'n Proto compiler options - the program will terminate`,{logLevel:`all`});return}return Ft(n,pe({tsconfig:i.tsconfig.options},i,{ts:!0,js:!1,dts:!1}))}export{zt as n,Rt as t};
163
- //# sourceMappingURL=compile-DJUj4hs3.mjs.map