UNPKG

@stryke/capnp

Version:

A package to assist in running the Cap'n Proto compiler and creating Cap'n Proto serialization protocol schemas.

1 lines 139 kB
{"version":3,"file":"rpc.mjs","names":["$.Struct","$.ObjectSize","$.getBitMask","$.getUint8Mask","$.CompositeList"],"sources":["../../schemas/rpc.ts"],"sourcesContent":["/* eslint-disable */\n// biome-ignore lint: disable\n// Generated by storm-capnpc\n// Note: Do not edit this file manually - it will be overwritten automatically\nimport * as $ from \"@stryke/capnp\";\nexport const _capnpFileId = BigInt(\"0xb312981b2552a250\");\nexport const Message_Which = {\n /**\n* The sender previously received this message from the peer but didn't understand it or doesn't\n* yet implement the functionality that was requested. So, the sender is echoing the message\n* back. In some cases, the receiver may be able to recover from this by pretending the sender\n* had taken some appropriate \"null\" action.\n*\n* For example, say `resolve` is received by a level 0 implementation (because a previous call\n* or return happened to contain a promise). The level 0 implementation will echo it back as\n* `unimplemented`. The original sender can then simply release the cap to which the promise\n* had resolved, thus avoiding a leak.\n*\n* For any message type that introduces a question, if the message comes back unimplemented,\n* the original sender may simply treat it as if the question failed with an exception.\n*\n* In cases where there is no sensible way to react to an `unimplemented` message (without\n* resource leaks or other serious problems), the connection may need to be aborted. This is\n* a gray area; different implementations may take different approaches.\n*\n*/\n UNIMPLEMENTED: 0,\n /**\n* Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n* because the sender received an invalid or nonsensical message or because the sender had an\n* internal error. The sender will shut down the outgoing half of the connection after `abort`\n* and will completely close the connection shortly thereafter (it's up to the sender how much\n* of a time buffer they want to offer for the client to receive the `abort` before the\n* connection is reset).\n*\n*/\n ABORT: 1,\n /**\n* Request the peer's bootstrap interface.\n*\n*/\n BOOTSTRAP: 8,\n /**\n* Begin a method call.\n*\n*/\n CALL: 2,\n /**\n* Complete a method call.\n*\n*/\n RETURN: 3,\n /**\n* Release a returned answer / cancel a call.\n*\n*/\n FINISH: 4,\n /**\n* Resolve a previously-sent promise.\n*\n*/\n RESOLVE: 5,\n /**\n* Release a capability so that the remote object can be deallocated.\n*\n*/\n RELEASE: 6,\n /**\n* Lift an embargo used to enforce E-order over promise resolution.\n*\n*/\n DISEMBARGO: 13,\n /**\n* Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n* by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n* implemented.\n*\n*/\n OBSOLETE_SAVE: 7,\n /**\n* Obsolete way to delete a SturdyRef. This operation was never implemented.\n*\n*/\n OBSOLETE_DELETE: 9,\n /**\n* Provide a capability to a third party.\n*\n*/\n PROVIDE: 10,\n /**\n* Accept a capability provided by a third party.\n*\n*/\n ACCEPT: 11,\n /**\n* Directly connect to the common root of two or more proxied caps.\n*\n*/\n JOIN: 12\n} as const;\nexport type Message_Which = (typeof Message_Which)[keyof typeof Message_Which];\n/**\n* An RPC connection is a bi-directional stream of Messages.\n*\n*/\nexport class Message extends $.Struct {\n static readonly UNIMPLEMENTED = Message_Which.UNIMPLEMENTED;\n static readonly ABORT = Message_Which.ABORT;\n static readonly BOOTSTRAP = Message_Which.BOOTSTRAP;\n static readonly CALL = Message_Which.CALL;\n static readonly RETURN = Message_Which.RETURN;\n static readonly FINISH = Message_Which.FINISH;\n static readonly RESOLVE = Message_Which.RESOLVE;\n static readonly RELEASE = Message_Which.RELEASE;\n static readonly DISEMBARGO = Message_Which.DISEMBARGO;\n static readonly OBSOLETE_SAVE = Message_Which.OBSOLETE_SAVE;\n static readonly OBSOLETE_DELETE = Message_Which.OBSOLETE_DELETE;\n static readonly PROVIDE = Message_Which.PROVIDE;\n static readonly ACCEPT = Message_Which.ACCEPT;\n static readonly JOIN = Message_Which.JOIN;\n public static override readonly _capnp = {\n displayName: \"Message\",\n id: \"91b79f1f808db032\",\n size: new $.ObjectSize(8, 1),\n };\n _adoptUnimplemented(value: $.Orphan<Message>): void {\n $.utils.setUint16(0, 0, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownUnimplemented(): $.Orphan<Message> {\n return $.utils.disown(this.unimplemented);\n }\n /**\n* The sender previously received this message from the peer but didn't understand it or doesn't\n* yet implement the functionality that was requested. So, the sender is echoing the message\n* back. In some cases, the receiver may be able to recover from this by pretending the sender\n* had taken some appropriate \"null\" action.\n*\n* For example, say `resolve` is received by a level 0 implementation (because a previous call\n* or return happened to contain a promise). The level 0 implementation will echo it back as\n* `unimplemented`. The original sender can then simply release the cap to which the promise\n* had resolved, thus avoiding a leak.\n*\n* For any message type that introduces a question, if the message comes back unimplemented,\n* the original sender may simply treat it as if the question failed with an exception.\n*\n* In cases where there is no sensible way to react to an `unimplemented` message (without\n* resource leaks or other serious problems), the connection may need to be aborted. This is\n* a gray area; different implementations may take different approaches.\n*\n*/\n get unimplemented(): Message {\n $.utils.testWhich(\"unimplemented\", $.utils.getUint16(0, this), 0, this);\n return $.utils.getStruct(0, Message, this);\n }\n _hasUnimplemented(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initUnimplemented(): Message {\n $.utils.setUint16(0, 0, this);\n return $.utils.initStructAt(0, Message, this);\n }\n get _isUnimplemented(): boolean {\n return $.utils.getUint16(0, this) === 0;\n }\n set unimplemented(value: Message) {\n $.utils.setUint16(0, 0, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptAbort(value: $.Orphan<Exception>): void {\n $.utils.setUint16(0, 1, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownAbort(): $.Orphan<Exception> {\n return $.utils.disown(this.abort);\n }\n /**\n* Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.\n* because the sender received an invalid or nonsensical message or because the sender had an\n* internal error. The sender will shut down the outgoing half of the connection after `abort`\n* and will completely close the connection shortly thereafter (it's up to the sender how much\n* of a time buffer they want to offer for the client to receive the `abort` before the\n* connection is reset).\n*\n*/\n get abort(): Exception {\n $.utils.testWhich(\"abort\", $.utils.getUint16(0, this), 1, this);\n return $.utils.getStruct(0, Exception, this);\n }\n _hasAbort(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initAbort(): Exception {\n $.utils.setUint16(0, 1, this);\n return $.utils.initStructAt(0, Exception, this);\n }\n get _isAbort(): boolean {\n return $.utils.getUint16(0, this) === 1;\n }\n set abort(value: Exception) {\n $.utils.setUint16(0, 1, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptBootstrap(value: $.Orphan<Bootstrap>): void {\n $.utils.setUint16(0, 8, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownBootstrap(): $.Orphan<Bootstrap> {\n return $.utils.disown(this.bootstrap);\n }\n /**\n* Request the peer's bootstrap interface.\n*\n*/\n get bootstrap(): Bootstrap {\n $.utils.testWhich(\"bootstrap\", $.utils.getUint16(0, this), 8, this);\n return $.utils.getStruct(0, Bootstrap, this);\n }\n _hasBootstrap(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initBootstrap(): Bootstrap {\n $.utils.setUint16(0, 8, this);\n return $.utils.initStructAt(0, Bootstrap, this);\n }\n get _isBootstrap(): boolean {\n return $.utils.getUint16(0, this) === 8;\n }\n set bootstrap(value: Bootstrap) {\n $.utils.setUint16(0, 8, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptCall(value: $.Orphan<Call>): void {\n $.utils.setUint16(0, 2, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownCall(): $.Orphan<Call> {\n return $.utils.disown(this.call);\n }\n /**\n* Begin a method call.\n*\n*/\n get call(): Call {\n $.utils.testWhich(\"call\", $.utils.getUint16(0, this), 2, this);\n return $.utils.getStruct(0, Call, this);\n }\n _hasCall(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initCall(): Call {\n $.utils.setUint16(0, 2, this);\n return $.utils.initStructAt(0, Call, this);\n }\n get _isCall(): boolean {\n return $.utils.getUint16(0, this) === 2;\n }\n set call(value: Call) {\n $.utils.setUint16(0, 2, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptReturn(value: $.Orphan<Return>): void {\n $.utils.setUint16(0, 3, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownReturn(): $.Orphan<Return> {\n return $.utils.disown(this.return);\n }\n /**\n* Complete a method call.\n*\n*/\n get return(): Return {\n $.utils.testWhich(\"return\", $.utils.getUint16(0, this), 3, this);\n return $.utils.getStruct(0, Return, this);\n }\n _hasReturn(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initReturn(): Return {\n $.utils.setUint16(0, 3, this);\n return $.utils.initStructAt(0, Return, this);\n }\n get _isReturn(): boolean {\n return $.utils.getUint16(0, this) === 3;\n }\n set return(value: Return) {\n $.utils.setUint16(0, 3, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptFinish(value: $.Orphan<Finish>): void {\n $.utils.setUint16(0, 4, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownFinish(): $.Orphan<Finish> {\n return $.utils.disown(this.finish);\n }\n /**\n* Release a returned answer / cancel a call.\n*\n*/\n get finish(): Finish {\n $.utils.testWhich(\"finish\", $.utils.getUint16(0, this), 4, this);\n return $.utils.getStruct(0, Finish, this);\n }\n _hasFinish(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initFinish(): Finish {\n $.utils.setUint16(0, 4, this);\n return $.utils.initStructAt(0, Finish, this);\n }\n get _isFinish(): boolean {\n return $.utils.getUint16(0, this) === 4;\n }\n set finish(value: Finish) {\n $.utils.setUint16(0, 4, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptResolve(value: $.Orphan<Resolve>): void {\n $.utils.setUint16(0, 5, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownResolve(): $.Orphan<Resolve> {\n return $.utils.disown(this.resolve);\n }\n /**\n* Resolve a previously-sent promise.\n*\n*/\n get resolve(): Resolve {\n $.utils.testWhich(\"resolve\", $.utils.getUint16(0, this), 5, this);\n return $.utils.getStruct(0, Resolve, this);\n }\n _hasResolve(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initResolve(): Resolve {\n $.utils.setUint16(0, 5, this);\n return $.utils.initStructAt(0, Resolve, this);\n }\n get _isResolve(): boolean {\n return $.utils.getUint16(0, this) === 5;\n }\n set resolve(value: Resolve) {\n $.utils.setUint16(0, 5, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptRelease(value: $.Orphan<Release>): void {\n $.utils.setUint16(0, 6, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownRelease(): $.Orphan<Release> {\n return $.utils.disown(this.release);\n }\n /**\n* Release a capability so that the remote object can be deallocated.\n*\n*/\n get release(): Release {\n $.utils.testWhich(\"release\", $.utils.getUint16(0, this), 6, this);\n return $.utils.getStruct(0, Release, this);\n }\n _hasRelease(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initRelease(): Release {\n $.utils.setUint16(0, 6, this);\n return $.utils.initStructAt(0, Release, this);\n }\n get _isRelease(): boolean {\n return $.utils.getUint16(0, this) === 6;\n }\n set release(value: Release) {\n $.utils.setUint16(0, 6, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptDisembargo(value: $.Orphan<Disembargo>): void {\n $.utils.setUint16(0, 13, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownDisembargo(): $.Orphan<Disembargo> {\n return $.utils.disown(this.disembargo);\n }\n /**\n* Lift an embargo used to enforce E-order over promise resolution.\n*\n*/\n get disembargo(): Disembargo {\n $.utils.testWhich(\"disembargo\", $.utils.getUint16(0, this), 13, this);\n return $.utils.getStruct(0, Disembargo, this);\n }\n _hasDisembargo(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initDisembargo(): Disembargo {\n $.utils.setUint16(0, 13, this);\n return $.utils.initStructAt(0, Disembargo, this);\n }\n get _isDisembargo(): boolean {\n return $.utils.getUint16(0, this) === 13;\n }\n set disembargo(value: Disembargo) {\n $.utils.setUint16(0, 13, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptObsoleteSave(value: $.Orphan<$.Pointer>): void {\n $.utils.setUint16(0, 7, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownObsoleteSave(): $.Orphan<$.Pointer> {\n return $.utils.disown(this.obsoleteSave);\n }\n /**\n* Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced\n* by the `Persistent` interface defined in `persistent.capnp`. This operation was never\n* implemented.\n*\n*/\n get obsoleteSave(): $.Pointer {\n $.utils.testWhich(\"obsoleteSave\", $.utils.getUint16(0, this), 7, this);\n return $.utils.getPointer(0, this);\n }\n _hasObsoleteSave(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n get _isObsoleteSave(): boolean {\n return $.utils.getUint16(0, this) === 7;\n }\n set obsoleteSave(value: $.Pointer) {\n $.utils.setUint16(0, 7, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptObsoleteDelete(value: $.Orphan<$.Pointer>): void {\n $.utils.setUint16(0, 9, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownObsoleteDelete(): $.Orphan<$.Pointer> {\n return $.utils.disown(this.obsoleteDelete);\n }\n /**\n* Obsolete way to delete a SturdyRef. This operation was never implemented.\n*\n*/\n get obsoleteDelete(): $.Pointer {\n $.utils.testWhich(\"obsoleteDelete\", $.utils.getUint16(0, this), 9, this);\n return $.utils.getPointer(0, this);\n }\n _hasObsoleteDelete(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n get _isObsoleteDelete(): boolean {\n return $.utils.getUint16(0, this) === 9;\n }\n set obsoleteDelete(value: $.Pointer) {\n $.utils.setUint16(0, 9, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptProvide(value: $.Orphan<Provide>): void {\n $.utils.setUint16(0, 10, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownProvide(): $.Orphan<Provide> {\n return $.utils.disown(this.provide);\n }\n /**\n* Provide a capability to a third party.\n*\n*/\n get provide(): Provide {\n $.utils.testWhich(\"provide\", $.utils.getUint16(0, this), 10, this);\n return $.utils.getStruct(0, Provide, this);\n }\n _hasProvide(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initProvide(): Provide {\n $.utils.setUint16(0, 10, this);\n return $.utils.initStructAt(0, Provide, this);\n }\n get _isProvide(): boolean {\n return $.utils.getUint16(0, this) === 10;\n }\n set provide(value: Provide) {\n $.utils.setUint16(0, 10, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptAccept(value: $.Orphan<Accept>): void {\n $.utils.setUint16(0, 11, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownAccept(): $.Orphan<Accept> {\n return $.utils.disown(this.accept);\n }\n /**\n* Accept a capability provided by a third party.\n*\n*/\n get accept(): Accept {\n $.utils.testWhich(\"accept\", $.utils.getUint16(0, this), 11, this);\n return $.utils.getStruct(0, Accept, this);\n }\n _hasAccept(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initAccept(): Accept {\n $.utils.setUint16(0, 11, this);\n return $.utils.initStructAt(0, Accept, this);\n }\n get _isAccept(): boolean {\n return $.utils.getUint16(0, this) === 11;\n }\n set accept(value: Accept) {\n $.utils.setUint16(0, 11, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptJoin(value: $.Orphan<Join>): void {\n $.utils.setUint16(0, 12, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownJoin(): $.Orphan<Join> {\n return $.utils.disown(this.join);\n }\n /**\n* Directly connect to the common root of two or more proxied caps.\n*\n*/\n get join(): Join {\n $.utils.testWhich(\"join\", $.utils.getUint16(0, this), 12, this);\n return $.utils.getStruct(0, Join, this);\n }\n _hasJoin(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initJoin(): Join {\n $.utils.setUint16(0, 12, this);\n return $.utils.initStructAt(0, Join, this);\n }\n get _isJoin(): boolean {\n return $.utils.getUint16(0, this) === 12;\n }\n set join(value: Join) {\n $.utils.setUint16(0, 12, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n public override toString(): string { return \"Message_\" + super.toString(); }\n which(): Message_Which {\n return $.utils.getUint16(0, this) as Message_Which;\n }\n}\n/**\n* **(level 0)**\n*\n* Get the \"bootstrap\" interface exported by the remote vat.\n*\n* For level 0, 1, and 2 implementations, the \"bootstrap\" interface is simply the main interface\n* exported by a vat. If the vat acts as a server fielding connections from clients, then the\n* bootstrap interface defines the basic functionality available to a client when it connects.\n* The exact interface definition obviously depends on the application.\n*\n* We call this a \"bootstrap\" because in an ideal Cap'n Proto world, bootstrap interfaces would\n* never be used. In such a world, any time you connect to a new vat, you do so because you\n* received an introduction from some other vat (see `ThirdPartyCapId`). Thus, the first message\n* you send is `Accept`, and further communications derive from there. `Bootstrap` is not used.\n*\n* In such an ideal world, DNS itself would support Cap'n Proto -- performing a DNS lookup would\n* actually return a new Cap'n Proto capability, thus introducing you to the target system via\n* level 3 RPC. Applications would receive the capability to talk to DNS in the first place as\n* an initial endowment or part of a Powerbox interaction. Therefore, an app can form arbitrary\n* connections without ever using `Bootstrap`.\n*\n* Of course, in the real world, DNS is not Cap'n-Proto-based, and we don't want Cap'n Proto to\n* require a whole new internet infrastructure to be useful. Therefore, we offer bootstrap\n* interfaces as a way to get up and running without a level 3 introduction. Thus, bootstrap\n* interfaces are used to \"bootstrap\" from other, non-Cap'n-Proto-based means of service discovery,\n* such as legacy DNS.\n*\n* Note that a vat need not provide a bootstrap interface, and in fact many vats (especially those\n* acting as clients) do not. In this case, the vat should either reply to `Bootstrap` with a\n* `Return` indicating an exception, or should return a dummy capability with no methods.\n*\n*/\nexport class Bootstrap extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"Bootstrap\",\n id: \"e94ccf8031176ec4\",\n size: new $.ObjectSize(8, 1),\n };\n /**\n* A new question ID identifying this request, which will eventually receive a Return message\n* containing the restored capability.\n*\n*/\n get questionId(): number {\n return $.utils.getUint32(0, this);\n }\n set questionId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n _adoptDeprecatedObjectId(value: $.Orphan<$.Pointer>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownDeprecatedObjectId(): $.Orphan<$.Pointer> {\n return $.utils.disown(this.deprecatedObjectId);\n }\n /**\n* ** DEPRECATED **\n*\n* A Vat may export multiple bootstrap interfaces. In this case, `deprecatedObjectId` specifies\n* which one to return. If this pointer is null, then the default bootstrap interface is returned.\n*\n* As of version 0.5, use of this field is deprecated. If a service wants to export multiple\n* bootstrap interfaces, it should instead define a single bootstrap interface that has methods\n* that return each of the other interfaces.\n*\n* **History**\n*\n* In the first version of Cap'n Proto RPC (0.4.x) the `Bootstrap` message was called `Restore`.\n* At the time, it was thought that this would eventually serve as the way to restore SturdyRefs\n* (level 2). Meanwhile, an application could offer its \"main\" interface on a well-known\n* (non-secret) SturdyRef.\n*\n* Since level 2 RPC was not implemented at the time, the `Restore` message was in practice only\n* used to obtain the main interface. Since most applications had only one main interface that\n* they wanted to restore, they tended to designate this with a null `objectId`.\n*\n* Unfortunately, the earliest version of the EZ RPC interfaces set a precedent of exporting\n* multiple main interfaces by allowing them to be exported under string names. In this case,\n* `objectId` was a Text value specifying the name.\n*\n* All of this proved problematic for several reasons:\n*\n* - The arrangement assumed that a client wishing to restore a SturdyRef would know exactly what\n* machine to connect to and would be able to immediately restore a SturdyRef on connection.\n* However, in practice, the ability to restore SturdyRefs is itself a capability that may\n* require going through an authentication process to obtain. Thus, it makes more sense to\n* define a \"restorer service\" as a full Cap'n Proto interface. If this restorer interface is\n* offered as the vat's bootstrap interface, then this is equivalent to the old arrangement.\n*\n* - Overloading \"Restore\" for the purpose of obtaining well-known capabilities encouraged the\n* practice of exporting singleton services with string names. If singleton services are desired,\n* it is better to have one main interface that has methods that can be used to obtain each\n* service, in order to get all the usual benefits of schemas and type checking.\n*\n* - Overloading \"Restore\" also had a security problem: Often, \"main\" or \"well-known\"\n* capabilities exported by a vat are in fact not public: they are intended to be accessed only\n* by clients who are capable of forming a connection to the vat. This can lead to trouble if\n* the client itself has other clients and wishes to forward some `Restore` requests from those\n* external clients -- it has to be very careful not to allow through `Restore` requests\n* addressing the default capability.\n*\n* For example, consider the case of a sandboxed Sandstorm application and its supervisor. The\n* application exports a default capability to its supervisor that provides access to\n* functionality that only the supervisor is supposed to access. Meanwhile, though, applications\n* may publish other capabilities that may be persistent, in which case the application needs\n* to field `Restore` requests that could come from anywhere. These requests of course have to\n* pass through the supervisor, as all communications with the outside world must. But, the\n* supervisor has to be careful not to honor an external request addressing the application's\n* default capability, since this capability is privileged. Unfortunately, the default\n* capability cannot be given an unguessable name, because then the supervisor itself would not\n* be able to address it!\n*\n* As of Cap'n Proto 0.5, `Restore` has been renamed to `Bootstrap` and is no longer planned for\n* use in restoring SturdyRefs.\n*\n* Note that 0.4 also defined a message type called `Delete` that, like `Restore`, addressed a\n* SturdyRef, but indicated that the client would not restore the ref again in the future. This\n* operation was never implemented, so it was removed entirely. If a \"delete\" operation is desired,\n* it should exist as a method on the same interface that handles restoring SturdyRefs. However,\n* the utility of such an operation is questionable. You wouldn't be able to rely on it for\n* garbage collection since a client could always disappear permanently without remembering to\n* delete all its SturdyRefs, thus leaving them dangling forever. Therefore, it is advisable to\n* design systems such that SturdyRefs never represent \"owned\" pointers.\n*\n* For example, say a SturdyRef points to an image file hosted on some server. That image file\n* should also live inside a collection (a gallery, perhaps) hosted on the same server, owned by\n* a user who can delete the image at any time. If the user deletes the image, the SturdyRef\n* stops working. On the other hand, if the SturdyRef is discarded, this has no effect on the\n* existence of the image in its collection.\n*\n*/\n get deprecatedObjectId(): $.Pointer {\n return $.utils.getPointer(0, this);\n }\n _hasDeprecatedObjectId(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n set deprecatedObjectId(value: $.Pointer) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n public override toString(): string { return \"Bootstrap_\" + super.toString(); }\n}\nexport const Call_SendResultsTo_Which = {\n /**\n* Send the return message back to the caller (the usual).\n*\n*/\n CALLER: 0,\n /**\n* **(level 1)**\n*\n* Don't actually return the results to the sender. Instead, hold on to them and await\n* instructions from the sender regarding what to do with them. In particular, the sender\n* may subsequently send a `Return` for some other call (which the receiver had previously made\n* to the sender) with `takeFromOtherQuestion` set. The results from this call are then used\n* as the results of the other call.\n*\n* When `yourself` is used, the receiver must still send a `Return` for the call, but sets the\n* field `resultsSentElsewhere` in that `Return` rather than including the results.\n*\n* This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up\n* returning the result of a call from Vat B back to Vat A.\n*\n* In particular, the most common use case for this feature is when Vat A makes a call to a\n* promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.\n* Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`\n* in the calls so that the results need not pass back through Vat B.\n*\n* For example:\n* - Alice, in Vat A, calls foo() on Bob in Vat B.\n* - Alice makes a pipelined call bar() on the promise returned by foo().\n* - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next\n* to Alice).\n* - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().\n* Notice that bar() and bar'() are travelling in opposite directions on the same network\n* link.\n* - The `Call` for bar'() has `sendResultsTo` set to `yourself`.\n* - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,\n* with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,\n* as doing so would introduce unnecessary round trip latency.\n* - Vat A receives bar'() and delivers it to Carol.\n* - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`\n* set in place of results.\n* - Vat A sends a `Finish` for the bar() call to Vat B.\n* - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().\n*\n*/\n YOURSELF: 1,\n /**\n* **(level 3)**\n*\n* The call's result should be returned to a different vat. The receiver (the callee) expects\n* to receive an `Accept` message from the indicated vat, and should return the call's result\n* to it, rather than to the sender of the `Call`.\n*\n* This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n* messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n* Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n* an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n* also sends a `Return` to Vat B with `resultsSentElsewhere`.\n*\n*/\n THIRD_PARTY: 2\n} as const;\nexport type Call_SendResultsTo_Which = (typeof Call_SendResultsTo_Which)[keyof typeof Call_SendResultsTo_Which];\n/**\n* Where should the return message be sent?\n*\n*/\nexport class Call_SendResultsTo extends $.Struct {\n static readonly CALLER = Call_SendResultsTo_Which.CALLER;\n static readonly YOURSELF = Call_SendResultsTo_Which.YOURSELF;\n static readonly THIRD_PARTY = Call_SendResultsTo_Which.THIRD_PARTY;\n public static override readonly _capnp = {\n displayName: \"sendResultsTo\",\n id: \"dae8b0f61aab5f99\",\n size: new $.ObjectSize(24, 3),\n };\n get _isCaller(): boolean {\n return $.utils.getUint16(6, this) === 0;\n }\n set caller(_: true) {\n $.utils.setUint16(6, 0, this);\n }\n get _isYourself(): boolean {\n return $.utils.getUint16(6, this) === 1;\n }\n set yourself(_: true) {\n $.utils.setUint16(6, 1, this);\n }\n _adoptThirdParty(value: $.Orphan<$.Pointer>): void {\n $.utils.setUint16(6, 2, this);\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownThirdParty(): $.Orphan<$.Pointer> {\n return $.utils.disown(this.thirdParty);\n }\n /**\n* **(level 3)**\n*\n* The call's result should be returned to a different vat. The receiver (the callee) expects\n* to receive an `Accept` message from the indicated vat, and should return the call's result\n* to it, rather than to the sender of the `Call`.\n*\n* This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`\n* messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from\n* Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends\n* an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C\n* also sends a `Return` to Vat B with `resultsSentElsewhere`.\n*\n*/\n get thirdParty(): $.Pointer {\n $.utils.testWhich(\"thirdParty\", $.utils.getUint16(6, this), 2, this);\n return $.utils.getPointer(2, this);\n }\n _hasThirdParty(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n get _isThirdParty(): boolean {\n return $.utils.getUint16(6, this) === 2;\n }\n set thirdParty(value: $.Pointer) {\n $.utils.setUint16(6, 2, this);\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"Call_SendResultsTo_\" + super.toString(); }\n which(): Call_SendResultsTo_Which {\n return $.utils.getUint16(6, this) as Call_SendResultsTo_Which;\n }\n}\n/**\n* **(level 0)**\n*\n* Message type initiating a method call on a capability.\n*\n*/\nexport class Call extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"Call\",\n id: \"836a53ce789d4cd4\",\n size: new $.ObjectSize(24, 3),\n defaultAllowThirdPartyTailCall: $.getBitMask(false, 0),\n defaultNoPromisePipelining: $.getBitMask(false, 1),\n defaultOnlyPromisePipeline: $.getBitMask(false, 2)\n };\n /**\n* A number, chosen by the caller, that identifies this call in future messages. This number\n* must be different from all other calls originating from the same end of the connection (but\n* may overlap with question IDs originating from the opposite end). A fine strategy is to use\n* sequential question IDs, but the recipient should not assume this.\n*\n* A question ID can be reused once both:\n* - A matching Return has been received from the callee.\n* - A matching Finish has been sent from the caller.\n*\n*/\n get questionId(): number {\n return $.utils.getUint32(0, this);\n }\n set questionId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n _adoptTarget(value: $.Orphan<MessageTarget>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownTarget(): $.Orphan<MessageTarget> {\n return $.utils.disown(this.target);\n }\n /**\n* The object that should receive this call.\n*\n*/\n get target(): MessageTarget {\n return $.utils.getStruct(0, MessageTarget, this);\n }\n _hasTarget(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initTarget(): MessageTarget {\n return $.utils.initStructAt(0, MessageTarget, this);\n }\n set target(value: MessageTarget) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n /**\n* The type ID of the interface being called. Each capability may implement multiple interfaces.\n*\n*/\n get interfaceId(): bigint {\n return $.utils.getUint64(8, this);\n }\n set interfaceId(value: bigint) {\n $.utils.setUint64(8, value, this);\n }\n /**\n* The ordinal number of the method to call within the requested interface.\n*\n*/\n get methodId(): number {\n return $.utils.getUint16(4, this);\n }\n set methodId(value: number) {\n $.utils.setUint16(4, value, this);\n }\n /**\n* Indicates whether or not the receiver is allowed to send a `Return` containing\n* `acceptFromThirdParty`. Level 3 implementations should set this true. Otherwise, the callee\n* will have to proxy the return in the case of a tail call to a third-party vat.\n*\n*/\n get allowThirdPartyTailCall(): boolean {\n return $.utils.getBit(128, this, Call._capnp.defaultAllowThirdPartyTailCall);\n }\n set allowThirdPartyTailCall(value: boolean) {\n $.utils.setBit(128, value, this, Call._capnp.defaultAllowThirdPartyTailCall);\n }\n /**\n* If true, the sender promises that it won't make any promise-pipelined calls on the results of\n* this call. If it breaks this promise, the receiver may throw an arbitrary error from such\n* calls.\n*\n* The receiver may use this as an optimization, by skipping the bookkeeping needed for pipelining\n* when no pipelined calls are expected. The sender typically sets this to false when the method's\n* schema does not specify any return capabilities.\n*\n*/\n get noPromisePipelining(): boolean {\n return $.utils.getBit(129, this, Call._capnp.defaultNoPromisePipelining);\n }\n set noPromisePipelining(value: boolean) {\n $.utils.setBit(129, value, this, Call._capnp.defaultNoPromisePipelining);\n }\n /**\n* If true, the sender only plans to use this call to make pipelined calls. The receiver need not\n* send a `Return` message (but is still allowed to do so).\n*\n* Since the sender does not know whether a `Return` will be sent, it must release all state\n* related to the call when it sends `Finish`. However, in the case that the callee does not\n* recognize this hint and chooses to send a `Return`, then technically the caller is not allowed\n* to reuse the question ID until it receives said `Return`. This creates a conundrum: How does\n* the caller decide when it's OK to reuse the ID? To sidestep the problem, the C++ implementation\n* uses high-numbered IDs (with the high-order bit set) for such calls, and cycles through the\n* IDs in order. If all 2^31 IDs in this space are used without ever seeing a `Return`, then the\n* implementation assumes that the other end is in fact honoring the hint, and the ID counter is\n* allowed to loop around. If a `Return` is ever seen when `onlyPromisePipeline` was set, then\n* the implementation stops using this hint.\n*\n*/\n get onlyPromisePipeline(): boolean {\n return $.utils.getBit(130, this, Call._capnp.defaultOnlyPromisePipeline);\n }\n set onlyPromisePipeline(value: boolean) {\n $.utils.setBit(130, value, this, Call._capnp.defaultOnlyPromisePipeline);\n }\n _adoptParams(value: $.Orphan<Payload>): void {\n $.utils.adopt(value, $.utils.getPointer(1, this));\n }\n _disownParams(): $.Orphan<Payload> {\n return $.utils.disown(this.params);\n }\n /**\n* The call parameters. `params.content` is a struct whose fields correspond to the parameters of\n* the method.\n*\n*/\n get params(): Payload {\n return $.utils.getStruct(1, Payload, this);\n }\n _hasParams(): boolean {\n return !$.utils.isNull($.utils.getPointer(1, this));\n }\n _initParams(): Payload {\n return $.utils.initStructAt(1, Payload, this);\n }\n set params(value: Payload) {\n $.utils.copyFrom(value, $.utils.getPointer(1, this));\n }\n /**\n* Where should the return message be sent?\n*\n*/\n get sendResultsTo(): Call_SendResultsTo {\n return $.utils.getAs(Call_SendResultsTo, this);\n }\n _initSendResultsTo(): Call_SendResultsTo {\n return $.utils.getAs(Call_SendResultsTo, this);\n }\n public override toString(): string { return \"Call_\" + super.toString(); }\n}\nexport const Return_Which = {\n /**\n* Equal to the QuestionId of the corresponding `Call` message.\n*\n*/\n RESULTS: 0,\n /**\n* If true, all capabilities that were in the params should be considered released. The sender\n* must not send separate `Release` messages for them. Level 0 implementations in particular\n* should always set this true. This defaults true because if level 0 implementations forget to\n* set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n* to set it to false they'll quickly get errors.\n*\n* The receiver should act as if the sender had sent a release message with count=1 for each\n* CapDescriptor in the original Call message.\n*\n*/\n EXCEPTION: 1,\n /**\n* The result.\n*\n* For regular method calls, `results.content` points to the result struct.\n*\n* For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n* capability (rather than a struct), and `results.content` is just a capability pointer with\n* index 0. A `Finish` is still required in this case.\n*\n*/\n CANCELED: 2,\n /**\n* Indicates that the call failed and explains why.\n*\n*/\n RESULTS_SENT_ELSEWHERE: 3,\n /**\n* Indicates that the call was canceled due to the caller sending a Finish message\n* before the call had completed.\n*\n*/\n TAKE_FROM_OTHER_QUESTION: 4,\n /**\n* This is set when returning from a `Call` that had `sendResultsTo` set to something other\n* than `caller`.\n*\n* It doesn't matter too much when this is sent, as the receiver doesn't need to do anything\n* with it, but the C++ implementation appears to wait for the call to finish before sending\n* this.\n*\n*/\n ACCEPT_FROM_THIRD_PARTY: 5\n} as const;\nexport type Return_Which = (typeof Return_Which)[keyof typeof Return_Which];\n/**\n* **(level 0)**\n*\n* Message type sent from callee to caller indicating that the call has completed.\n*\n*/\nexport class Return extends $.Struct {\n static readonly RESULTS = Return_Which.RESULTS;\n static readonly EXCEPTION = Return_Which.EXCEPTION;\n static readonly CANCELED = Return_Which.CANCELED;\n static readonly RESULTS_SENT_ELSEWHERE = Return_Which.RESULTS_SENT_ELSEWHERE;\n static readonly TAKE_FROM_OTHER_QUESTION = Return_Which.TAKE_FROM_OTHER_QUESTION;\n static readonly ACCEPT_FROM_THIRD_PARTY = Return_Which.ACCEPT_FROM_THIRD_PARTY;\n public static override readonly _capnp = {\n displayName: \"Return\",\n id: \"9e19b28d3db3573a\",\n size: new $.ObjectSize(16, 1),\n defaultReleaseParamCaps: $.getBitMask(true, 0),\n defaultNoFinishNeeded: $.getBitMask(false, 1)\n };\n /**\n* Equal to the QuestionId of the corresponding `Call` message.\n*\n*/\n get answerId(): number {\n return $.utils.getUint32(0, this);\n }\n set answerId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n /**\n* If true, all capabilities that were in the params should be considered released. The sender\n* must not send separate `Release` messages for them. Level 0 implementations in particular\n* should always set this true. This defaults true because if level 0 implementations forget to\n* set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n* to set it to false they'll quickly get errors.\n*\n* The receiver should act as if the sender had sent a release message with count=1 for each\n* CapDescriptor in the original Call message.\n*\n*/\n get releaseParamCaps(): boolean {\n return $.utils.getBit(32, this, Return._capnp.defaultReleaseParamCaps);\n }\n set releaseParamCaps(value: boolean) {\n $.utils.setBit(32, value, this, Return._capnp.defaultReleaseParamCaps);\n }\n /**\n* If true, the sender does not need the receiver to send a `Finish` message; its answer table\n* entry has already been cleaned up. This implies that the results do not contain any\n* capabilities, since the `Finish` message would normally release those capabilities from\n* promise pipelining responsibility. The caller may still send a `Finish` message if it wants,\n* which will be silently ignored by the callee.\n*\n*/\n get noFinishNeeded(): boolean {\n return $.utils.getBit(33, this, Return._capnp.defaultNoFinishNeeded);\n }\n set noFinishNeeded(value: boolean) {\n $.utils.setBit(33, value, this, Return._capnp.defaultNoFinishNeeded);\n }\n _adoptResults(value: $.Orphan<Payload>): void {\n $.utils.setUint16(6, 0, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownResults(): $.Orphan<Payload> {\n return $.utils.disown(this.results);\n }\n /**\n* The result.\n*\n* For regular method calls, `results.content` points to the result struct.\n*\n* For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single\n* capability (rather than a struct), and `results.content` is just a capability pointer with\n* index 0. A `Finish` is still required in this case.\n*\n*/\n get results(): Payload {\n $.utils.testWhich(\"results\", $.utils.getUint16(6, this), 0, this);\n return $.utils.getStruct(0, Payload, this);\n }\n _hasResults(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initResults(): Payload {\n $.utils.setUint16(6, 0, this);\n return $.utils.initStructAt(0, Payload, this);\n }\n get _isResults(): boolean {\n return $.utils.getUint16(6, this) === 0;\n }\n set results(value: Payload) {\n $.utils.setUint16(6, 0, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptException(value: $.Orphan<Exception>): void {\n $.utils.setUint16(6, 1, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownException(): $.Orphan<Exception> {\n return $.utils.disown(this.exception);\n }\n /**\n* Indicates that the call failed and explains why.\n*\n*/\n get exception(): Exception {\n $.utils.testWhich(\"exception\", $.utils.getUint16(6, this), 1, this);\n return $.utils.getStruct(0, Exception, this);\n }\n _hasException(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initException(): Exception {\n $.utils.setUint16(6, 1, this);\n return $.utils.initStructAt(0, Exception, this);\n }\n get _isException(): boolean {\n return $.utils.getUint16(6, this) === 1;\n }\n set exception(value: Exception) {\n $.utils.setUint16(6, 1, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n get _isCanceled(): boolean {\n return $.utils.getUint16(6, this) === 2;\n }\n set canceled(_: true) {\n $.utils.setUint16(6, 2, this);\n }\n get _isResultsSentElsewhere(): boolean {\n return $.utils.getUint16(6, this) === 3;\n }\n set resultsSentElsewhere(_: true) {\n $.utils.setUint16(6, 3, this);\n }\n /**\n* The sender has also sent (before this message) a `Call` with the given question ID and with\n* `sendResultsTo.yourself` set, and the results of that other call should be used as the\n* results here. `takeFromOtherQuestion` can only used once per question.\n*\n*/\n get takeFromOtherQuestion(): number {\n $.utils.testWhich(\"takeFromOtherQuestion\", $.utils.getUint16(6, this), 4, this);\n return $.utils.getUint32(8, this);\n }\n get _isTakeFromOtherQuestion(): boolean {\n return $.utils.getUint16(6, this) === 4;\n }\n set takeFromOtherQuestion(value: number) {\n $.utils.setUint16(6, 4, this);\n $.utils.setUint32(8, value, this);\n }\n _adoptAcceptFromThirdParty(value: $.Orphan<$.Pointer>): void {\n $.utils.setUint16(6, 5, this);\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownAcceptFromThirdParty(): $.Orphan<$.Pointer> {\n return $.utils.disown(this.acceptFromThirdParty);\n }\n /**\n* **(level 3)**\n*\n* The caller should contact a third-party vat to pick up the results. An `Accept` message\n* sent to the vat will return the result. This pairs with `Call.sendResultsTo.thirdParty`.\n* It should only be used if the corresponding `Call` had `allowThirdPartyTailCall` set.\n*\n*/\n get acceptFromThirdParty(): $.Pointer {\n $.utils.testWhich(\"acceptFromThirdParty\", $.utils.getUint16(6, this), 5, this);\n return $.utils.getPointer(0, this);\n }\n _hasAcceptFromThirdParty(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n get _isAcceptFromThirdParty(): boolean {\n return $.utils.getUint16(6, this) === 5;\n }\n set acceptFromThirdParty(value: $.Pointer) {\n $.utils.setUint16(6, 5, this);\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n public override toString(): string { return \"Return_\" + super.toString(); }\n which(): Return_Which {\n return $.utils.getUint16(6, this) as Return_Which;\n }\n}\n/**\n* **(level 0)**\n*\n* Message type sent from the caller to the callee to indicate:\n* 1) The questionId will no longer be used in any messages sent by the callee (no further\n* pipelined requests).\n* 2) If the call has not returned yet, the caller no longer cares about the result. If nothing\n* else cares about the result either (e.g. there are no other outstanding calls pipelined on\n* the result of this one) then the callee may wish to immediately cancel the operation and\n* send back a Return message with \"canceled\" set. However, implementations are not required\n* to support premature cancellation -- instead, the implementation may wait until the call\n* actually completes and send a normal `Return` message.\n*\n* TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be\n* possible and useful to notify the server that it doesn't need to keep around the response to\n* service pipeline requests even though the caller still wants to receive it / hasn't yet\n* finished processing it. It could also be useful to notify the server that it need not marshal\n* the results because the caller doesn't want them anyway, even if the caller is still sending\n* pipelined calls, although this seems less useful (just saving some bytes on the wire).\n*\n*/\nexport class Finish extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"Finish\",\n id: \"d37d2eb2c2f80e63\",\n size: new $.ObjectSize(8, 0),\n defaultReleaseResultCaps: $.getBitMask(true, 0),\n defaultRequireEarlyCancellationWorkaround: $.getBitMask(true, 1)\n };\n /**\n* ID of the call whose result is to be released.\n*\n*/\n get questionId(): number {\n return $.utils.getUint32(0, this);\n }\n set questionId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n /**\n* If true, all capabilities that were in the results should be considered released. The sender\n* must not send separate `Release` messages for them. Level 0 implementations in particular\n* should always set this true. This defaults true because if level 0 implementations forget to\n* set it they'll never notice (just silently leak caps), but if level >=1 implementations forget\n* set it false they'll quickly get errors.\n*\n*/\n get releaseResultCaps(): boolean {\n return $.utils.getBit(32, this, Finish._capnp.defaultReleaseResultCaps);\n }\n set releaseResultCaps(value: boolean) {\n $.utils.setBit(32, value, this, Finish._capnp.defaultReleaseResultCaps);\n }\n /**\n* If true, if the RPC system receives this Finish message before the original call has even been\n* delivered, it should defer cancellation util after delivery. In particular, this gives the\n* destination object a chance to opt out of cancellation, e.g. as controlled by the\n* `allowCancellation` annotation defined in `c++.capnp`.\n*\n* This is a work-around. Versions 1.0 and up of Cap'n Proto always set this to false. However,\n* older versions of Cap'n Proto unintentionally exhibited this errant behavior by default, and\n* as a result programs built with older versions could be inadvertently relying on their