@stryke/capnp 0.12.95 → 0.12.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/capnpc.cjs +418 -316
- package/bin/capnpc.d.cts +909 -4
- package/bin/capnpc.d.cts.map +1 -1
- package/bin/capnpc.d.mts +909 -4
- package/bin/capnpc.d.mts.map +1 -1
- package/bin/capnpc.mjs +381 -280
- package/bin/capnpc.mjs.map +1 -1
- package/dist/capnp-es.BHkXHvyK-B3-d8RNu.d.mts +2991 -0
- package/dist/capnp-es.BHkXHvyK-B3-d8RNu.d.mts.map +1 -0
- package/dist/capnp-es.BHkXHvyK-CQWXOqvU.d.cts +2991 -0
- package/dist/capnp-es.BHkXHvyK-CQWXOqvU.d.cts.map +1 -0
- package/dist/{capnp-es.GpvEvMIK-C4q8I6qy.mjs → capnp-es.GpvEvMIK-CH8kq1KS.mjs} +13 -6
- package/dist/{capnp-es.GpvEvMIK-C4q8I6qy.mjs.map → capnp-es.GpvEvMIK-CH8kq1KS.mjs.map} +1 -1
- package/dist/{capnp-es.GpvEvMIK-BcYm5JyH.cjs → capnp-es.GpvEvMIK-CZ5ZimCD.cjs} +12 -5
- package/dist/{compile-ySRLGi2G.mjs → compile-D_BOc0dD.mjs} +109 -15
- package/dist/compile-D_BOc0dD.mjs.map +1 -0
- package/dist/{compile-DgmKft8T.cjs → compile-Yq1zhccM.cjs} +113 -19
- package/dist/compile.cjs +2 -2
- package/dist/compile.d.cts +38 -3
- package/dist/compile.d.cts.map +1 -0
- package/dist/compile.d.mts +38 -3
- package/dist/compile.d.mts.map +1 -0
- package/dist/compile.mjs +1 -2
- package/dist/{dist-BlvFBzSi.mjs → dist-DQ7xmzRT.mjs} +385 -16
- package/dist/dist-DQ7xmzRT.mjs.map +1 -0
- package/dist/{dist-YywzZL3Q.cjs → dist-VMGxvENY.cjs} +381 -12
- package/dist/{helpers-B1zJTrkG.mjs → helpers-2TldkyGG.mjs} +149 -149
- package/dist/helpers-2TldkyGG.mjs.map +1 -0
- package/dist/{helpers-B7aznH9v.cjs → helpers-Dn4nWOb7.cjs} +177 -177
- package/dist/helpers.cjs +2 -1
- package/dist/helpers.d.cts +1 -2
- package/dist/helpers.d.cts.map +1 -1
- package/dist/helpers.d.mts +1 -2
- package/dist/helpers.d.mts.map +1 -1
- package/dist/helpers.mjs +1 -1
- package/dist/index-63Za7yNc.d.cts +736 -0
- package/dist/index-63Za7yNc.d.cts.map +1 -0
- package/dist/index-LYXu6eWz.d.mts +736 -0
- package/dist/index-LYXu6eWz.d.mts.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +5 -4
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -5
- package/dist/rpc-helpers.cjs +4 -3
- package/dist/rpc-helpers.d.cts +3 -4
- package/dist/rpc-helpers.d.cts.map +1 -1
- package/dist/rpc-helpers.d.mts +3 -4
- package/dist/rpc-helpers.d.mts.map +1 -1
- package/dist/rpc-helpers.mjs +2 -2
- package/dist/types-BjCOVfgj.d.cts +1506 -0
- package/dist/types-BjCOVfgj.d.cts.map +1 -0
- package/dist/types-CVzMn-TI.d.mts +1506 -0
- package/dist/types-CVzMn-TI.d.mts.map +1 -0
- package/dist/types.cjs +8 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +7 -2
- package/dist/types.mjs.map +1 -0
- package/package.json +8 -8
- package/schemas/cpp.cjs +1 -0
- package/schemas/cpp.d.cts.map +1 -1
- package/schemas/cpp.d.mts.map +1 -1
- package/schemas/index-BB47pUzp.d.cts +742 -0
- package/schemas/index-BB47pUzp.d.cts.map +1 -0
- package/schemas/index-DprjZUdT.d.mts +742 -0
- package/schemas/index-DprjZUdT.d.mts.map +1 -0
- package/schemas/persistent.cjs +2 -1
- package/schemas/persistent.d.cts +48 -21
- package/schemas/persistent.d.cts.map +1 -1
- package/schemas/persistent.d.mts +48 -21
- package/schemas/persistent.d.mts.map +1 -1
- package/schemas/persistent.mjs +1 -1
- package/schemas/persistent.mjs.map +1 -1
- package/schemas/rpc-twoparty.cjs +20 -1
- package/schemas/rpc-twoparty.d.cts +17 -17
- package/schemas/rpc-twoparty.d.cts.map +1 -1
- package/schemas/rpc-twoparty.d.mts +17 -17
- package/schemas/rpc-twoparty.d.mts.map +1 -1
- package/schemas/rpc-twoparty.mjs +19 -1
- package/schemas/rpc-twoparty.mjs.map +1 -1
- package/schemas/rpc.cjs +371 -1
- package/schemas/rpc.d.cts +141 -141
- package/schemas/rpc.d.cts.map +1 -1
- package/schemas/rpc.d.mts +141 -141
- package/schemas/rpc.d.mts.map +1 -1
- package/schemas/rpc.mjs +370 -1
- package/schemas/rpc.mjs.map +1 -1
- package/schemas/schema.cjs +96 -1
- package/schemas/schema.d.cts +286 -228
- package/schemas/schema.d.cts.map +1 -1
- package/schemas/schema.d.mts +286 -228
- package/schemas/schema.d.mts.map +1 -1
- package/schemas/schema.mjs +95 -1
- package/schemas/schema.mjs.map +1 -1
- package/schemas/{src-2eLj6yCr.cjs → src-B6FhDNiV.cjs} +19 -12
- package/schemas/{src-s2pCu2mc.mjs → src-B97sIXSw.mjs} +19 -13
- package/schemas/src-B97sIXSw.mjs.map +1 -0
- package/schemas/ts.cjs +1 -0
- package/schemas/ts.d.cts.map +1 -1
- package/schemas/ts.d.mts.map +1 -1
- package/dist/compile-DccxA7WZ.d.cts +0 -40
- package/dist/compile-DccxA7WZ.d.cts.map +0 -1
- package/dist/compile-UkKIpqrK.d.mts +0 -40
- package/dist/compile-UkKIpqrK.d.mts.map +0 -1
- package/dist/compile-ySRLGi2G.mjs.map +0 -1
- package/dist/dist-BlvFBzSi.mjs.map +0 -1
- package/dist/helpers-B1zJTrkG.mjs.map +0 -1
- package/dist/types-Cuj2daUE.mjs +0 -8
- package/dist/types-Cuj2daUE.mjs.map +0 -1
- package/dist/types-D03SjfBL.d.mts +0 -55
- package/dist/types-D03SjfBL.d.mts.map +0 -1
- package/dist/types-D52qMMoK.d.cts +0 -55
- package/dist/types-D52qMMoK.d.cts.map +0 -1
- package/dist/types-DHrjS-69.cjs +0 -13
- package/schemas/index-BAJMwFip.d.mts +0 -96
- package/schemas/index-BAJMwFip.d.mts.map +0 -1
- package/schemas/index-b7dam4EA.d.cts +0 -96
- package/schemas/index-b7dam4EA.d.cts.map +0 -1
- package/schemas/src-s2pCu2mc.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as ObjectSize, d as Pointer, l as Orphan, p as Struct } from "./index-DprjZUdT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region schemas/rpc-twoparty.d.ts
|
|
4
4
|
declare const _capnpFileId: bigint;
|
|
@@ -25,11 +25,11 @@ declare const Side: {
|
|
|
25
25
|
readonly CLIENT: 1;
|
|
26
26
|
};
|
|
27
27
|
type Side = (typeof Side)[keyof typeof Side];
|
|
28
|
-
declare class VatId extends
|
|
28
|
+
declare class VatId extends Struct {
|
|
29
29
|
static readonly _capnp: {
|
|
30
30
|
displayName: string;
|
|
31
31
|
id: string;
|
|
32
|
-
size:
|
|
32
|
+
size: ObjectSize;
|
|
33
33
|
};
|
|
34
34
|
get side(): Side;
|
|
35
35
|
set side(value: Side);
|
|
@@ -39,11 +39,11 @@ declare class VatId extends index_d_exports.Struct {
|
|
|
39
39
|
* Only used for joins, since three-way introductions never happen on a two-party network.
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
42
|
-
declare class ProvisionId extends
|
|
42
|
+
declare class ProvisionId extends Struct {
|
|
43
43
|
static readonly _capnp: {
|
|
44
44
|
displayName: string;
|
|
45
45
|
id: string;
|
|
46
|
-
size:
|
|
46
|
+
size: ObjectSize;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* The ID from `JoinKeyPart`.
|
|
@@ -57,11 +57,11 @@ declare class ProvisionId extends index_d_exports.Struct {
|
|
|
57
57
|
* Never used, because there are only two parties.
|
|
58
58
|
*
|
|
59
59
|
*/
|
|
60
|
-
declare class RecipientId extends
|
|
60
|
+
declare class RecipientId extends Struct {
|
|
61
61
|
static readonly _capnp: {
|
|
62
62
|
displayName: string;
|
|
63
63
|
id: string;
|
|
64
|
-
size:
|
|
64
|
+
size: ObjectSize;
|
|
65
65
|
};
|
|
66
66
|
toString(): string;
|
|
67
67
|
}
|
|
@@ -69,11 +69,11 @@ declare class RecipientId extends index_d_exports.Struct {
|
|
|
69
69
|
* Never used, because there is no third party.
|
|
70
70
|
*
|
|
71
71
|
*/
|
|
72
|
-
declare class ThirdPartyCapId extends
|
|
72
|
+
declare class ThirdPartyCapId extends Struct {
|
|
73
73
|
static readonly _capnp: {
|
|
74
74
|
displayName: string;
|
|
75
75
|
id: string;
|
|
76
|
-
size:
|
|
76
|
+
size: ObjectSize;
|
|
77
77
|
};
|
|
78
78
|
toString(): string;
|
|
79
79
|
}
|
|
@@ -110,11 +110,11 @@ declare class ThirdPartyCapId extends index_d_exports.Struct {
|
|
|
110
110
|
* as if it had been requested locally.
|
|
111
111
|
*
|
|
112
112
|
*/
|
|
113
|
-
declare class JoinKeyPart extends
|
|
113
|
+
declare class JoinKeyPart extends Struct {
|
|
114
114
|
static readonly _capnp: {
|
|
115
115
|
displayName: string;
|
|
116
116
|
id: string;
|
|
117
|
-
size:
|
|
117
|
+
size: ObjectSize;
|
|
118
118
|
};
|
|
119
119
|
/**
|
|
120
120
|
* A number identifying this join, chosen by the sender. May be reused once `Finish` messages are
|
|
@@ -137,11 +137,11 @@ declare class JoinKeyPart extends index_d_exports.Struct {
|
|
|
137
137
|
set partNum(value: number);
|
|
138
138
|
toString(): string;
|
|
139
139
|
}
|
|
140
|
-
declare class JoinResult extends
|
|
140
|
+
declare class JoinResult extends Struct {
|
|
141
141
|
static readonly _capnp: {
|
|
142
142
|
displayName: string;
|
|
143
143
|
id: string;
|
|
144
|
-
size:
|
|
144
|
+
size: ObjectSize;
|
|
145
145
|
};
|
|
146
146
|
/**
|
|
147
147
|
* Matches `JoinKeyPart`.
|
|
@@ -157,15 +157,15 @@ declare class JoinResult extends index_d_exports.Struct {
|
|
|
157
157
|
*/
|
|
158
158
|
get succeeded(): boolean;
|
|
159
159
|
set succeeded(value: boolean);
|
|
160
|
-
_adoptCap(value:
|
|
161
|
-
_disownCap():
|
|
160
|
+
_adoptCap(value: Orphan<Pointer>): void;
|
|
161
|
+
_disownCap(): Orphan<Pointer>;
|
|
162
162
|
/**
|
|
163
163
|
* One of the JoinResults will have a non-null `cap` which is the joined capability.
|
|
164
164
|
*
|
|
165
165
|
*/
|
|
166
|
-
get cap():
|
|
166
|
+
get cap(): Pointer;
|
|
167
167
|
_hasCap(): boolean;
|
|
168
|
-
set cap(value:
|
|
168
|
+
set cap(value: Pointer);
|
|
169
169
|
toString(): string;
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-twoparty.d.mts","names":[],"sources":["../../schemas/rpc-twoparty.ts"],"
|
|
1
|
+
{"version":3,"file":"rpc-twoparty.d.mts","names":[],"sources":["../../schemas/rpc-twoparty.ts"],"mappings":";;;cAKa,YAAA;AAAA,cACA,IAAA;EADA;;;;;AACb;;;;;AAsBA;;EAvBa,SAsBH,MAAA;EACiB;;AAC3B;;;;EAD2B,SADjB,MAAA;AAAA;AAAA,KACE,IAAA,WAAe,IAAA,eAAmB,IAAA;AAAA,cACjC,KAAA,SAAc,MAAA;EAAA,gBACO,MAAA;;;;;MAK5B,IAAA,CAAA,GAAQ,IAAA;EAAA,IAGR,IAAA,CAAK,KAAA,EAAO,IAAA;EAGA,QAAA,CAAA;AAAA;;;;;cAML,WAAA,SAAoB,MAAA;EAAA,gBACC,MAAA;;;UADT,UAAA;EAAA;;;;;MAUnB,MAAA,CAAA;EAAA,IAGA,MAAA,CAAO,KAAA;EAGK,QAAA,CAAA;AAAA;;;;;cAML,WAAA,SAAoB,MAAA;EAAA,gBACC,MAAA;;;UADT,UAAA;EAAA;EAMP,QAAA,CAAA;AAAA;;;;;cAML,eAAA,SAAwB,MAAA;EAAA,gBACH,MAAA;;;UADL,UAAA;EAAA;EAMX,QAAA,CAAA;AAAA;;;;;;;;;;;;;;;AAmClB;;;;;;;;;;;;;;;;;;;cAAa,WAAA,SAAoB,MAAA;EAAA,gBACC,MAAA;;;UADT,UAAA;EAAA;EAuCD;;;;;EAAA,IA5BlB,MAAA,CAAA;EAAA,IAGA,MAAA,CAAO,KAAA;EA+DA;;;;EAAA,IAxDP,SAAA,CAAA;EAAA,IAGA,SAAA,CAAU,KAAA;EAekB;;;;EAAA,IAR5B,OAAA,CAAA;EAAA,IAGA,OAAA,CAAQ,KAAA;EAGI,QAAA,CAAA;AAAA;AAAA,cAEL,UAAA,SAAmB,MAAA;EAAA,gBACE,MAAA;;;;;EA2Bf;;;;EAAA,IAlBb,MAAA,CAAA;EAAA,IAGA,MAAA,CAAO,KAAA;EAkBG;;;;;;EAAA,IATV,SAAA,CAAA;EAAA,IAGA,SAAA,CAAU,KAAA;EAGd,SAAA,CAAU,KAAA,EAAO,MAAA,CAAS,OAAA;EAG1B,UAAA,CAAA,GAAc,MAAA,CAAS,OAAA;EAaN;;;;EAAA,IANb,GAAA,CAAA,GAAO,OAAA;EAGX,OAAA,CAAA;EAAA,IAGI,GAAA,CAAI,KAAA,EAAO,OAAA;EAGC,QAAA,CAAA;AAAA"}
|
package/schemas/rpc-twoparty.mjs
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import { d as Struct, t as utils, u as ObjectSize } from "./src-
|
|
1
|
+
import { d as Struct, t as utils, u as ObjectSize } from "./src-B97sIXSw.mjs";
|
|
2
2
|
|
|
3
3
|
//#region schemas/rpc-twoparty.ts
|
|
4
4
|
const _capnpFileId = BigInt("0xa184c7885cdaf2a1");
|
|
5
5
|
const Side = {
|
|
6
|
+
/**
|
|
7
|
+
* The object lives on the "server" or "supervisor" end of the connection. Only the
|
|
8
|
+
* server/supervisor knows how to interpret the ref; to the client, it is opaque.
|
|
9
|
+
*
|
|
10
|
+
* Note that containers intending to implement strong confinement should rewrite SturdyRefs
|
|
11
|
+
* received from the external network before passing them on to the confined app. The confined
|
|
12
|
+
* app thus does not ever receive the raw bits of the SturdyRef (which it could perhaps
|
|
13
|
+
* maliciously leak), but instead receives only a thing that it can pass back to the container
|
|
14
|
+
* later to restore the ref. See:
|
|
15
|
+
* http://www.erights.org/elib/capability/dist-confine.html
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
6
18
|
SERVER: 0,
|
|
19
|
+
/**
|
|
20
|
+
* The object lives on the "client" or "confined app" end of the connection. Only the client
|
|
21
|
+
* knows how to interpret the ref; to the server/supervisor, it is opaque. Most clients do not
|
|
22
|
+
* actually know how to persist capabilities at all, so use of this is unusual.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
7
25
|
CLIENT: 1
|
|
8
26
|
};
|
|
9
27
|
var VatId = class extends Struct {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-twoparty.mjs","names":["$.Struct","$.ObjectSize"],"sources":["../../schemas/rpc-twoparty.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(\"0xa184c7885cdaf2a1\");\nexport const Side = {\n /**\n* The object lives on the \"server\" or \"supervisor\" end of the connection. Only the\n* server/supervisor knows how to interpret the ref; to the client, it is opaque.\n*\n* Note that containers intending to implement strong confinement should rewrite SturdyRefs\n* received from the external network before passing them on to the confined app. The confined\n* app thus does not ever receive the raw bits of the SturdyRef (which it could perhaps\n* maliciously leak), but instead receives only a thing that it can pass back to the container\n* later to restore the ref. See:\n* http://www.erights.org/elib/capability/dist-confine.html\n*\n*/\n SERVER: 0,\n /**\n* The object lives on the \"client\" or \"confined app\" end of the connection. Only the client\n* knows how to interpret the ref; to the server/supervisor, it is opaque. Most clients do not\n* actually know how to persist capabilities at all, so use of this is unusual.\n*\n*/\n CLIENT: 1\n} as const;\nexport type Side = (typeof Side)[keyof typeof Side];\nexport class VatId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"VatId\",\n id: \"d20b909fee733a8e\",\n size: new $.ObjectSize(8, 0),\n };\n get side(): Side {\n return $.utils.getUint16(0, this) as Side;\n }\n set side(value: Side) {\n $.utils.setUint16(0, value, this);\n }\n public override toString(): string { return \"VatId_\" + super.toString(); }\n}\n/**\n* Only used for joins, since three-way introductions never happen on a two-party network.\n*\n*/\nexport class ProvisionId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"ProvisionId\",\n id: \"b88d09a9c5f39817\",\n size: new $.ObjectSize(8, 0),\n };\n /**\n* The ID from `JoinKeyPart`.\n*\n*/\n get joinId(): number {\n return $.utils.getUint32(0, this);\n }\n set joinId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n public override toString(): string { return \"ProvisionId_\" + super.toString(); }\n}\n/**\n* Never used, because there are only two parties.\n*\n*/\nexport class RecipientId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"RecipientId\",\n id: \"89f389b6fd4082c1\",\n size: new $.ObjectSize(0, 0),\n };\n public override toString(): string { return \"RecipientId_\" + super.toString(); }\n}\n/**\n* Never used, because there is no third party.\n*\n*/\nexport class ThirdPartyCapId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"ThirdPartyCapId\",\n id: \"b47f4979672cb59d\",\n size: new $.ObjectSize(0, 0),\n };\n public override toString(): string { return \"ThirdPartyCapId_\" + super.toString(); }\n}\n/**\n* Joins in the two-party case are simplified by a few observations.\n*\n* First, on a two-party network, a Join only ever makes sense if the receiving end is also\n* connected to other networks. A vat which is not connected to any other network can safely\n* reject all joins.\n*\n* Second, since a two-party connection bisects the network -- there can be no other connections\n* between the networks at either end of the connection -- if one part of a join crosses the\n* connection, then _all_ parts must cross it. Therefore, a vat which is receiving a Join request\n* off some other network which needs to be forwarded across the two-party connection can\n* collect all the parts on its end and only forward them across the two-party connection when all\n* have been received.\n*\n* For example, imagine that Alice and Bob are vats connected over a two-party connection, and\n* each is also connected to other networks. At some point, Alice receives one part of a Join\n* request off her network. The request is addressed to a capability that Alice received from\n* Bob and is proxying to her other network. Alice goes ahead and responds to the Join part as\n* if she hosted the capability locally (this is important so that if not all the Join parts end\n* up at Alice, the original sender can detect the failed Join without hanging). As other parts\n* trickle in, Alice verifies that each part is addressed to a capability from Bob and continues\n* to respond to each one. Once the complete set of join parts is received, Alice checks if they\n* were all for the exact same capability. If so, she doesn't need to send anything to Bob at\n* all. Otherwise, she collects the set of capabilities (from Bob) to which the join parts were\n* addressed and essentially initiates a _new_ Join request on those capabilities to Bob. Alice\n* does not forward the Join parts she received herself, but essentially forwards the Join as a\n* whole.\n*\n* On Bob's end, since he knows that Alice will always send all parts of a Join together, he\n* simply waits until he's received them all, then performs a join on the respective capabilities\n* as if it had been requested locally.\n*\n*/\nexport class JoinKeyPart extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"JoinKeyPart\",\n id: \"95b29059097fca83\",\n size: new $.ObjectSize(8, 0),\n };\n /**\n* A number identifying this join, chosen by the sender. May be reused once `Finish` messages are\n* sent corresponding to all of the `Join` messages.\n*\n*/\n get joinId(): number {\n return $.utils.getUint32(0, this);\n }\n set joinId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n /**\n* The number of capabilities to be joined.\n*\n*/\n get partCount(): number {\n return $.utils.getUint16(4, this);\n }\n set partCount(value: number) {\n $.utils.setUint16(4, value, this);\n }\n /**\n* Which part this request targets -- a number in the range [0, partCount).\n*\n*/\n get partNum(): number {\n return $.utils.getUint16(6, this);\n }\n set partNum(value: number) {\n $.utils.setUint16(6, value, this);\n }\n public override toString(): string { return \"JoinKeyPart_\" + super.toString(); }\n}\nexport class JoinResult extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"JoinResult\",\n id: \"9d263a3630b7ebee\",\n size: new $.ObjectSize(8, 1),\n };\n /**\n* Matches `JoinKeyPart`.\n*\n*/\n get joinId(): number {\n return $.utils.getUint32(0, this);\n }\n set joinId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n /**\n* All JoinResults in the set will have the same value for `succeeded`. The receiver actually\n* implements the join by waiting for all the `JoinKeyParts` and then performing its own join on\n* them, then going back and answering all the join requests afterwards.\n*\n*/\n get succeeded(): boolean {\n return $.utils.getBit(32, this);\n }\n set succeeded(value: boolean) {\n $.utils.setBit(32, value, this);\n }\n _adoptCap(value: $.Orphan<$.Pointer>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownCap(): $.Orphan<$.Pointer> {\n return $.utils.disown(this.cap);\n }\n /**\n* One of the JoinResults will have a non-null `cap` which is the joined capability.\n*\n*/\n get cap(): $.Pointer {\n return $.utils.getPointer(0, this);\n }\n _hasCap(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n set cap(value: $.Pointer) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n public override toString(): string { return \"JoinResult_\" + super.toString(); }\n}\n"],"mappings":";;;AAKA,MAAa,eAAe,OAAO,qBAAqB;AACxD,MAAa,OAAO
|
|
1
|
+
{"version":3,"file":"rpc-twoparty.mjs","names":["$.Struct","$.ObjectSize"],"sources":["../../schemas/rpc-twoparty.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(\"0xa184c7885cdaf2a1\");\nexport const Side = {\n /**\n* The object lives on the \"server\" or \"supervisor\" end of the connection. Only the\n* server/supervisor knows how to interpret the ref; to the client, it is opaque.\n*\n* Note that containers intending to implement strong confinement should rewrite SturdyRefs\n* received from the external network before passing them on to the confined app. The confined\n* app thus does not ever receive the raw bits of the SturdyRef (which it could perhaps\n* maliciously leak), but instead receives only a thing that it can pass back to the container\n* later to restore the ref. See:\n* http://www.erights.org/elib/capability/dist-confine.html\n*\n*/\n SERVER: 0,\n /**\n* The object lives on the \"client\" or \"confined app\" end of the connection. Only the client\n* knows how to interpret the ref; to the server/supervisor, it is opaque. Most clients do not\n* actually know how to persist capabilities at all, so use of this is unusual.\n*\n*/\n CLIENT: 1\n} as const;\nexport type Side = (typeof Side)[keyof typeof Side];\nexport class VatId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"VatId\",\n id: \"d20b909fee733a8e\",\n size: new $.ObjectSize(8, 0),\n };\n get side(): Side {\n return $.utils.getUint16(0, this) as Side;\n }\n set side(value: Side) {\n $.utils.setUint16(0, value, this);\n }\n public override toString(): string { return \"VatId_\" + super.toString(); }\n}\n/**\n* Only used for joins, since three-way introductions never happen on a two-party network.\n*\n*/\nexport class ProvisionId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"ProvisionId\",\n id: \"b88d09a9c5f39817\",\n size: new $.ObjectSize(8, 0),\n };\n /**\n* The ID from `JoinKeyPart`.\n*\n*/\n get joinId(): number {\n return $.utils.getUint32(0, this);\n }\n set joinId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n public override toString(): string { return \"ProvisionId_\" + super.toString(); }\n}\n/**\n* Never used, because there are only two parties.\n*\n*/\nexport class RecipientId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"RecipientId\",\n id: \"89f389b6fd4082c1\",\n size: new $.ObjectSize(0, 0),\n };\n public override toString(): string { return \"RecipientId_\" + super.toString(); }\n}\n/**\n* Never used, because there is no third party.\n*\n*/\nexport class ThirdPartyCapId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"ThirdPartyCapId\",\n id: \"b47f4979672cb59d\",\n size: new $.ObjectSize(0, 0),\n };\n public override toString(): string { return \"ThirdPartyCapId_\" + super.toString(); }\n}\n/**\n* Joins in the two-party case are simplified by a few observations.\n*\n* First, on a two-party network, a Join only ever makes sense if the receiving end is also\n* connected to other networks. A vat which is not connected to any other network can safely\n* reject all joins.\n*\n* Second, since a two-party connection bisects the network -- there can be no other connections\n* between the networks at either end of the connection -- if one part of a join crosses the\n* connection, then _all_ parts must cross it. Therefore, a vat which is receiving a Join request\n* off some other network which needs to be forwarded across the two-party connection can\n* collect all the parts on its end and only forward them across the two-party connection when all\n* have been received.\n*\n* For example, imagine that Alice and Bob are vats connected over a two-party connection, and\n* each is also connected to other networks. At some point, Alice receives one part of a Join\n* request off her network. The request is addressed to a capability that Alice received from\n* Bob and is proxying to her other network. Alice goes ahead and responds to the Join part as\n* if she hosted the capability locally (this is important so that if not all the Join parts end\n* up at Alice, the original sender can detect the failed Join without hanging). As other parts\n* trickle in, Alice verifies that each part is addressed to a capability from Bob and continues\n* to respond to each one. Once the complete set of join parts is received, Alice checks if they\n* were all for the exact same capability. If so, she doesn't need to send anything to Bob at\n* all. Otherwise, she collects the set of capabilities (from Bob) to which the join parts were\n* addressed and essentially initiates a _new_ Join request on those capabilities to Bob. Alice\n* does not forward the Join parts she received herself, but essentially forwards the Join as a\n* whole.\n*\n* On Bob's end, since he knows that Alice will always send all parts of a Join together, he\n* simply waits until he's received them all, then performs a join on the respective capabilities\n* as if it had been requested locally.\n*\n*/\nexport class JoinKeyPart extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"JoinKeyPart\",\n id: \"95b29059097fca83\",\n size: new $.ObjectSize(8, 0),\n };\n /**\n* A number identifying this join, chosen by the sender. May be reused once `Finish` messages are\n* sent corresponding to all of the `Join` messages.\n*\n*/\n get joinId(): number {\n return $.utils.getUint32(0, this);\n }\n set joinId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n /**\n* The number of capabilities to be joined.\n*\n*/\n get partCount(): number {\n return $.utils.getUint16(4, this);\n }\n set partCount(value: number) {\n $.utils.setUint16(4, value, this);\n }\n /**\n* Which part this request targets -- a number in the range [0, partCount).\n*\n*/\n get partNum(): number {\n return $.utils.getUint16(6, this);\n }\n set partNum(value: number) {\n $.utils.setUint16(6, value, this);\n }\n public override toString(): string { return \"JoinKeyPart_\" + super.toString(); }\n}\nexport class JoinResult extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"JoinResult\",\n id: \"9d263a3630b7ebee\",\n size: new $.ObjectSize(8, 1),\n };\n /**\n* Matches `JoinKeyPart`.\n*\n*/\n get joinId(): number {\n return $.utils.getUint32(0, this);\n }\n set joinId(value: number) {\n $.utils.setUint32(0, value, this);\n }\n /**\n* All JoinResults in the set will have the same value for `succeeded`. The receiver actually\n* implements the join by waiting for all the `JoinKeyParts` and then performing its own join on\n* them, then going back and answering all the join requests afterwards.\n*\n*/\n get succeeded(): boolean {\n return $.utils.getBit(32, this);\n }\n set succeeded(value: boolean) {\n $.utils.setBit(32, value, this);\n }\n _adoptCap(value: $.Orphan<$.Pointer>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownCap(): $.Orphan<$.Pointer> {\n return $.utils.disown(this.cap);\n }\n /**\n* One of the JoinResults will have a non-null `cap` which is the joined capability.\n*\n*/\n get cap(): $.Pointer {\n return $.utils.getPointer(0, this);\n }\n _hasCap(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n set cap(value: $.Pointer) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n public override toString(): string { return \"JoinResult_\" + super.toString(); }\n}\n"],"mappings":";;;AAKA,MAAa,eAAe,OAAO,qBAAqB;AACxD,MAAa,OAAO;;;;;;;;;;;;;CAalB,QAAQ;;;;;;;CAOR,QAAQ;CACT;AAED,IAAa,QAAb,cAA2BA,OAAS;CAClC,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAIC,WAAa,GAAG,EAAE;EAC7B;CACD,IAAI,OAAa;AACf,eAAe,UAAU,GAAG,KAAK;;CAEnC,IAAI,KAAK,OAAa;AACpB,QAAQ,UAAU,GAAG,OAAO,KAAK;;CAEnC,AAAgB,WAAmB;AAAE,SAAO,WAAW,MAAM,UAAU;;;;;;;AAMzE,IAAa,cAAb,cAAiCD,OAAS;CACxC,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAIC,WAAa,GAAG,EAAE;EAC7B;;;;;CAKD,IAAI,SAAiB;AACnB,eAAe,UAAU,GAAG,KAAK;;CAEnC,IAAI,OAAO,OAAe;AACxB,QAAQ,UAAU,GAAG,OAAO,KAAK;;CAEnC,AAAgB,WAAmB;AAAE,SAAO,iBAAiB,MAAM,UAAU;;;;;;;AAM/E,IAAa,cAAb,cAAiCD,OAAS;CACxC,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAIC,WAAa,GAAG,EAAE;EAC7B;CACD,AAAgB,WAAmB;AAAE,SAAO,iBAAiB,MAAM,UAAU;;;;;;;AAM/E,IAAa,kBAAb,cAAqCD,OAAS;CAC5C,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAIC,WAAa,GAAG,EAAE;EAC7B;CACD,AAAgB,WAAmB;AAAE,SAAO,qBAAqB,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCnF,IAAa,cAAb,cAAiCD,OAAS;CACxC,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAIC,WAAa,GAAG,EAAE;EAC7B;;;;;;CAMD,IAAI,SAAiB;AACnB,eAAe,UAAU,GAAG,KAAK;;CAEnC,IAAI,OAAO,OAAe;AACxB,QAAQ,UAAU,GAAG,OAAO,KAAK;;;;;;CAMnC,IAAI,YAAoB;AACtB,eAAe,UAAU,GAAG,KAAK;;CAEnC,IAAI,UAAU,OAAe;AAC3B,QAAQ,UAAU,GAAG,OAAO,KAAK;;;;;;CAMnC,IAAI,UAAkB;AACpB,eAAe,UAAU,GAAG,KAAK;;CAEnC,IAAI,QAAQ,OAAe;AACzB,QAAQ,UAAU,GAAG,OAAO,KAAK;;CAEnC,AAAgB,WAAmB;AAAE,SAAO,iBAAiB,MAAM,UAAU;;;AAE/E,IAAa,aAAb,cAAgCD,OAAS;CACvC,OAAgC,SAAS;EACvC,aAAa;EACb,IAAI;EACJ,MAAM,IAAIC,WAAa,GAAG,EAAE;EAC7B;;;;;CAKD,IAAI,SAAiB;AACnB,eAAe,UAAU,GAAG,KAAK;;CAEnC,IAAI,OAAO,OAAe;AACxB,QAAQ,UAAU,GAAG,OAAO,KAAK;;;;;;;;CAQnC,IAAI,YAAqB;AACvB,eAAe,OAAO,IAAI,KAAK;;CAEjC,IAAI,UAAU,OAAgB;AAC5B,QAAQ,OAAO,IAAI,OAAO,KAAK;;CAEjC,UAAU,OAAkC;AAC1C,QAAQ,MAAM,aAAe,WAAW,GAAG,KAAK,CAAC;;CAEnD,aAAkC;AAChC,eAAe,OAAO,KAAK,IAAI;;;;;;CAMjC,IAAI,MAAiB;AACnB,eAAe,WAAW,GAAG,KAAK;;CAEpC,UAAmB;AACjB,SAAO,OAAS,aAAe,WAAW,GAAG,KAAK,CAAC;;CAErD,IAAI,IAAI,OAAkB;AACxB,QAAQ,SAAS,aAAe,WAAW,GAAG,KAAK,CAAC;;CAEtD,AAAgB,WAAmB;AAAE,SAAO,gBAAgB,MAAM,UAAU"}
|
package/schemas/rpc.cjs
CHANGED
|
@@ -1,21 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_src = require('./src-B6FhDNiV.cjs');
|
|
2
3
|
|
|
3
4
|
//#region schemas/rpc.ts
|
|
4
5
|
const _capnpFileId = BigInt("0xb312981b2552a250");
|
|
5
6
|
const Message_Which = {
|
|
7
|
+
/**
|
|
8
|
+
* The sender previously received this message from the peer but didn't understand it or doesn't
|
|
9
|
+
* yet implement the functionality that was requested. So, the sender is echoing the message
|
|
10
|
+
* back. In some cases, the receiver may be able to recover from this by pretending the sender
|
|
11
|
+
* had taken some appropriate "null" action.
|
|
12
|
+
*
|
|
13
|
+
* For example, say `resolve` is received by a level 0 implementation (because a previous call
|
|
14
|
+
* or return happened to contain a promise). The level 0 implementation will echo it back as
|
|
15
|
+
* `unimplemented`. The original sender can then simply release the cap to which the promise
|
|
16
|
+
* had resolved, thus avoiding a leak.
|
|
17
|
+
*
|
|
18
|
+
* For any message type that introduces a question, if the message comes back unimplemented,
|
|
19
|
+
* the original sender may simply treat it as if the question failed with an exception.
|
|
20
|
+
*
|
|
21
|
+
* In cases where there is no sensible way to react to an `unimplemented` message (without
|
|
22
|
+
* resource leaks or other serious problems), the connection may need to be aborted. This is
|
|
23
|
+
* a gray area; different implementations may take different approaches.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
6
26
|
UNIMPLEMENTED: 0,
|
|
27
|
+
/**
|
|
28
|
+
* Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.
|
|
29
|
+
* because the sender received an invalid or nonsensical message or because the sender had an
|
|
30
|
+
* internal error. The sender will shut down the outgoing half of the connection after `abort`
|
|
31
|
+
* and will completely close the connection shortly thereafter (it's up to the sender how much
|
|
32
|
+
* of a time buffer they want to offer for the client to receive the `abort` before the
|
|
33
|
+
* connection is reset).
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
7
36
|
ABORT: 1,
|
|
37
|
+
/**
|
|
38
|
+
* Request the peer's bootstrap interface.
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
8
41
|
BOOTSTRAP: 8,
|
|
42
|
+
/**
|
|
43
|
+
* Begin a method call.
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
9
46
|
CALL: 2,
|
|
47
|
+
/**
|
|
48
|
+
* Complete a method call.
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
10
51
|
RETURN: 3,
|
|
52
|
+
/**
|
|
53
|
+
* Release a returned answer / cancel a call.
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
11
56
|
FINISH: 4,
|
|
57
|
+
/**
|
|
58
|
+
* Resolve a previously-sent promise.
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
12
61
|
RESOLVE: 5,
|
|
62
|
+
/**
|
|
63
|
+
* Release a capability so that the remote object can be deallocated.
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
13
66
|
RELEASE: 6,
|
|
67
|
+
/**
|
|
68
|
+
* Lift an embargo used to enforce E-order over promise resolution.
|
|
69
|
+
*
|
|
70
|
+
*/
|
|
14
71
|
DISEMBARGO: 13,
|
|
72
|
+
/**
|
|
73
|
+
* Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced
|
|
74
|
+
* by the `Persistent` interface defined in `persistent.capnp`. This operation was never
|
|
75
|
+
* implemented.
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
15
78
|
OBSOLETE_SAVE: 7,
|
|
79
|
+
/**
|
|
80
|
+
* Obsolete way to delete a SturdyRef. This operation was never implemented.
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
16
83
|
OBSOLETE_DELETE: 9,
|
|
84
|
+
/**
|
|
85
|
+
* Provide a capability to a third party.
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
17
88
|
PROVIDE: 10,
|
|
89
|
+
/**
|
|
90
|
+
* Accept a capability provided by a third party.
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
18
93
|
ACCEPT: 11,
|
|
94
|
+
/**
|
|
95
|
+
* Directly connect to the common root of two or more proxied caps.
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
19
98
|
JOIN: 12
|
|
20
99
|
};
|
|
21
100
|
/**
|
|
@@ -614,8 +693,65 @@ var Bootstrap = class extends require_src.Struct {
|
|
|
614
693
|
}
|
|
615
694
|
};
|
|
616
695
|
const Call_SendResultsTo_Which = {
|
|
696
|
+
/**
|
|
697
|
+
* Send the return message back to the caller (the usual).
|
|
698
|
+
*
|
|
699
|
+
*/
|
|
617
700
|
CALLER: 0,
|
|
701
|
+
/**
|
|
702
|
+
* **(level 1)**
|
|
703
|
+
*
|
|
704
|
+
* Don't actually return the results to the sender. Instead, hold on to them and await
|
|
705
|
+
* instructions from the sender regarding what to do with them. In particular, the sender
|
|
706
|
+
* may subsequently send a `Return` for some other call (which the receiver had previously made
|
|
707
|
+
* to the sender) with `takeFromOtherQuestion` set. The results from this call are then used
|
|
708
|
+
* as the results of the other call.
|
|
709
|
+
*
|
|
710
|
+
* When `yourself` is used, the receiver must still send a `Return` for the call, but sets the
|
|
711
|
+
* field `resultsSentElsewhere` in that `Return` rather than including the results.
|
|
712
|
+
*
|
|
713
|
+
* This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up
|
|
714
|
+
* returning the result of a call from Vat B back to Vat A.
|
|
715
|
+
*
|
|
716
|
+
* In particular, the most common use case for this feature is when Vat A makes a call to a
|
|
717
|
+
* promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.
|
|
718
|
+
* Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`
|
|
719
|
+
* in the calls so that the results need not pass back through Vat B.
|
|
720
|
+
*
|
|
721
|
+
* For example:
|
|
722
|
+
* - Alice, in Vat A, calls foo() on Bob in Vat B.
|
|
723
|
+
* - Alice makes a pipelined call bar() on the promise returned by foo().
|
|
724
|
+
* - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next
|
|
725
|
+
* to Alice).
|
|
726
|
+
* - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().
|
|
727
|
+
* Notice that bar() and bar'() are travelling in opposite directions on the same network
|
|
728
|
+
* link.
|
|
729
|
+
* - The `Call` for bar'() has `sendResultsTo` set to `yourself`.
|
|
730
|
+
* - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,
|
|
731
|
+
* with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,
|
|
732
|
+
* as doing so would introduce unnecessary round trip latency.
|
|
733
|
+
* - Vat A receives bar'() and delivers it to Carol.
|
|
734
|
+
* - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`
|
|
735
|
+
* set in place of results.
|
|
736
|
+
* - Vat A sends a `Finish` for the bar() call to Vat B.
|
|
737
|
+
* - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().
|
|
738
|
+
*
|
|
739
|
+
*/
|
|
618
740
|
YOURSELF: 1,
|
|
741
|
+
/**
|
|
742
|
+
* **(level 3)**
|
|
743
|
+
*
|
|
744
|
+
* The call's result should be returned to a different vat. The receiver (the callee) expects
|
|
745
|
+
* to receive an `Accept` message from the indicated vat, and should return the call's result
|
|
746
|
+
* to it, rather than to the sender of the `Call`.
|
|
747
|
+
*
|
|
748
|
+
* This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`
|
|
749
|
+
* messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from
|
|
750
|
+
* Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends
|
|
751
|
+
* an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C
|
|
752
|
+
* also sends a `Return` to Vat B with `resultsSentElsewhere`.
|
|
753
|
+
*
|
|
754
|
+
*/
|
|
619
755
|
THIRD_PARTY: 2
|
|
620
756
|
};
|
|
621
757
|
/**
|
|
@@ -847,11 +983,54 @@ var Call = class Call extends require_src.Struct {
|
|
|
847
983
|
}
|
|
848
984
|
};
|
|
849
985
|
const Return_Which = {
|
|
986
|
+
/**
|
|
987
|
+
* Equal to the QuestionId of the corresponding `Call` message.
|
|
988
|
+
*
|
|
989
|
+
*/
|
|
850
990
|
RESULTS: 0,
|
|
991
|
+
/**
|
|
992
|
+
* If true, all capabilities that were in the params should be considered released. The sender
|
|
993
|
+
* must not send separate `Release` messages for them. Level 0 implementations in particular
|
|
994
|
+
* should always set this true. This defaults true because if level 0 implementations forget to
|
|
995
|
+
* set it they'll never notice (just silently leak caps), but if level >=1 implementations forget
|
|
996
|
+
* to set it to false they'll quickly get errors.
|
|
997
|
+
*
|
|
998
|
+
* The receiver should act as if the sender had sent a release message with count=1 for each
|
|
999
|
+
* CapDescriptor in the original Call message.
|
|
1000
|
+
*
|
|
1001
|
+
*/
|
|
851
1002
|
EXCEPTION: 1,
|
|
1003
|
+
/**
|
|
1004
|
+
* The result.
|
|
1005
|
+
*
|
|
1006
|
+
* For regular method calls, `results.content` points to the result struct.
|
|
1007
|
+
*
|
|
1008
|
+
* For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single
|
|
1009
|
+
* capability (rather than a struct), and `results.content` is just a capability pointer with
|
|
1010
|
+
* index 0. A `Finish` is still required in this case.
|
|
1011
|
+
*
|
|
1012
|
+
*/
|
|
852
1013
|
CANCELED: 2,
|
|
1014
|
+
/**
|
|
1015
|
+
* Indicates that the call failed and explains why.
|
|
1016
|
+
*
|
|
1017
|
+
*/
|
|
853
1018
|
RESULTS_SENT_ELSEWHERE: 3,
|
|
1019
|
+
/**
|
|
1020
|
+
* Indicates that the call was canceled due to the caller sending a Finish message
|
|
1021
|
+
* before the call had completed.
|
|
1022
|
+
*
|
|
1023
|
+
*/
|
|
854
1024
|
TAKE_FROM_OTHER_QUESTION: 4,
|
|
1025
|
+
/**
|
|
1026
|
+
* This is set when returning from a `Call` that had `sendResultsTo` set to something other
|
|
1027
|
+
* than `caller`.
|
|
1028
|
+
*
|
|
1029
|
+
* It doesn't matter too much when this is sent, as the receiver doesn't need to do anything
|
|
1030
|
+
* with it, but the C++ implementation appears to wait for the call to finish before sending
|
|
1031
|
+
* this.
|
|
1032
|
+
*
|
|
1033
|
+
*/
|
|
855
1034
|
ACCEPT_FROM_THIRD_PARTY: 5
|
|
856
1035
|
};
|
|
857
1036
|
/**
|
|
@@ -1123,7 +1302,43 @@ var Finish = class Finish extends require_src.Struct {
|
|
|
1123
1302
|
}
|
|
1124
1303
|
};
|
|
1125
1304
|
const Resolve_Which = {
|
|
1305
|
+
/**
|
|
1306
|
+
* The ID of the promise to be resolved.
|
|
1307
|
+
*
|
|
1308
|
+
* Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does
|
|
1309
|
+
* _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver
|
|
1310
|
+
* will release the export soon after receiving `Resolve`, and the sender will not send this
|
|
1311
|
+
* `ExportId` again until it has been released and recycled.
|
|
1312
|
+
*
|
|
1313
|
+
* When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,
|
|
1314
|
+
* this indicates that the sender will follow up at some point with a `Resolve` message. If the
|
|
1315
|
+
* same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the
|
|
1316
|
+
* same ID is sent again later _after_ a `Resolve`, it can only be because the export's
|
|
1317
|
+
* reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore
|
|
1318
|
+
* this later promise does _not_ correspond to the earlier `Resolve`.
|
|
1319
|
+
*
|
|
1320
|
+
* If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`
|
|
1321
|
+
* message may or may not still be sent (the `Resolve` may have already been in-flight when
|
|
1322
|
+
* `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer
|
|
1323
|
+
* any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which
|
|
1324
|
+
* the receiver has no knowledge, because it already released it earlier. In this case, the
|
|
1325
|
+
* receiver should simply release the capability to which the promise resolved.
|
|
1326
|
+
*
|
|
1327
|
+
*/
|
|
1126
1328
|
CAP: 0,
|
|
1329
|
+
/**
|
|
1330
|
+
* The object to which the promise resolved.
|
|
1331
|
+
*
|
|
1332
|
+
* The sender promises that from this point forth, until `promiseId` is released, it shall
|
|
1333
|
+
* simply forward all messages to the capability designated by `cap`. This is true even if
|
|
1334
|
+
* `cap` itself happens to designate another promise, and that other promise later resolves --
|
|
1335
|
+
* messages sent to `promiseId` shall still go to that other promise, not to its resolution.
|
|
1336
|
+
* This is important in the case that the receiver of the `Resolve` ends up sending a
|
|
1337
|
+
* `Disembargo` message towards `promiseId` in order to control message ordering -- that
|
|
1338
|
+
* `Disembargo` really needs to reflect back to exactly the object designated by `cap` even
|
|
1339
|
+
* if that object is itself a promise.
|
|
1340
|
+
*
|
|
1341
|
+
*/
|
|
1127
1342
|
EXCEPTION: 1
|
|
1128
1343
|
};
|
|
1129
1344
|
/**
|
|
@@ -1295,9 +1510,48 @@ var Release = class extends require_src.Struct {
|
|
|
1295
1510
|
}
|
|
1296
1511
|
};
|
|
1297
1512
|
const Disembargo_Context_Which = {
|
|
1513
|
+
/**
|
|
1514
|
+
* The sender is requesting a disembargo on a promise that is known to resolve back to a
|
|
1515
|
+
* capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls
|
|
1516
|
+
* on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`
|
|
1517
|
+
* set to the same value as `senderLoopback`. This value is chosen by the sender, and since
|
|
1518
|
+
* it is also consumed be the sender, the sender can use whatever strategy it wants to make sure
|
|
1519
|
+
* the value is unambiguous.
|
|
1520
|
+
*
|
|
1521
|
+
* The receiver must verify that the target capability actually resolves back to the sender's
|
|
1522
|
+
* vat. Otherwise, the sender has committed a protocol error and should be disconnected.
|
|
1523
|
+
*
|
|
1524
|
+
*/
|
|
1298
1525
|
SENDER_LOOPBACK: 0,
|
|
1526
|
+
/**
|
|
1527
|
+
* The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to
|
|
1528
|
+
* this capability, and that Disembargo is now being echoed back.
|
|
1529
|
+
*
|
|
1530
|
+
*/
|
|
1299
1531
|
RECEIVER_LOOPBACK: 1,
|
|
1532
|
+
/**
|
|
1533
|
+
* **(level 3)**
|
|
1534
|
+
*
|
|
1535
|
+
* The sender is requesting a disembargo on a promise that is known to resolve to a third-party
|
|
1536
|
+
* capability that the sender is currently in the process of accepting (using `Accept`).
|
|
1537
|
+
* The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The
|
|
1538
|
+
* receiver should now send a `Disembargo` with `provide` set to the question ID of that
|
|
1539
|
+
* `Provide` message.
|
|
1540
|
+
*
|
|
1541
|
+
* See `Accept.embargo` for an example.
|
|
1542
|
+
*
|
|
1543
|
+
*/
|
|
1300
1544
|
ACCEPT: 2,
|
|
1545
|
+
/**
|
|
1546
|
+
* **(level 3)**
|
|
1547
|
+
*
|
|
1548
|
+
* The sender is requesting a disembargo on a capability currently being provided to a third
|
|
1549
|
+
* party. The question ID identifies the `Provide` message previously sent by the sender to
|
|
1550
|
+
* this capability. On receipt, the receiver (the capability host) shall release the embargo
|
|
1551
|
+
* on the `Accept` message that it has received from the third party. See `Accept.embargo` for
|
|
1552
|
+
* an example.
|
|
1553
|
+
*
|
|
1554
|
+
*/
|
|
1301
1555
|
PROVIDE: 3
|
|
1302
1556
|
};
|
|
1303
1557
|
var Disembargo_Context = class extends require_src.Struct {
|
|
@@ -1777,7 +2031,20 @@ var Join = class extends require_src.Struct {
|
|
|
1777
2031
|
}
|
|
1778
2032
|
};
|
|
1779
2033
|
const MessageTarget_Which = {
|
|
2034
|
+
/**
|
|
2035
|
+
* This message is to a capability or promise previously imported by the caller (exported by
|
|
2036
|
+
* the receiver).
|
|
2037
|
+
*
|
|
2038
|
+
*/
|
|
1780
2039
|
IMPORTED_CAP: 0,
|
|
2040
|
+
/**
|
|
2041
|
+
* This message is to a capability that is expected to be returned by another call that has not
|
|
2042
|
+
* yet been completed.
|
|
2043
|
+
*
|
|
2044
|
+
* At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so
|
|
2045
|
+
* that initial startup doesn't require a round trip.
|
|
2046
|
+
*
|
|
2047
|
+
*/
|
|
1781
2048
|
PROMISED_ANSWER: 1
|
|
1782
2049
|
};
|
|
1783
2050
|
/**
|
|
@@ -1906,11 +2173,52 @@ var Payload = class Payload extends require_src.Struct {
|
|
|
1906
2173
|
}
|
|
1907
2174
|
};
|
|
1908
2175
|
const CapDescriptor_Which = {
|
|
2176
|
+
/**
|
|
2177
|
+
* There is no capability here. This `CapDescriptor` should not appear in the payload content.
|
|
2178
|
+
* A `none` CapDescriptor can be generated when an application inserts a capability into a
|
|
2179
|
+
* message and then later changes its mind and removes it -- rewriting all of the other
|
|
2180
|
+
* capability pointers may be hard, so instead a tombstone is left, similar to the way a removed
|
|
2181
|
+
* struct or list instance is zeroed out of the message but the space is not reclaimed.
|
|
2182
|
+
* Hopefully this is unusual.
|
|
2183
|
+
*
|
|
2184
|
+
*/
|
|
1909
2185
|
NONE: 0,
|
|
2186
|
+
/**
|
|
2187
|
+
* The ID of a capability in the sender's export table (receiver's import table). It may be a
|
|
2188
|
+
* newly allocated table entry, or an existing entry (increments the reference count).
|
|
2189
|
+
*
|
|
2190
|
+
*/
|
|
1910
2191
|
SENDER_HOSTED: 1,
|
|
2192
|
+
/**
|
|
2193
|
+
* A promise that the sender will resolve later. The sender will send exactly one Resolve
|
|
2194
|
+
* message at a future point in time to replace this promise. Note that even if the same
|
|
2195
|
+
* `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of
|
|
2196
|
+
* them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this
|
|
2197
|
+
* `CapDescriptor`) may choose not to send the `Resolve` at all.
|
|
2198
|
+
*
|
|
2199
|
+
*/
|
|
1911
2200
|
SENDER_PROMISE: 2,
|
|
2201
|
+
/**
|
|
2202
|
+
* A capability (or promise) previously exported by the receiver (imported by the sender).
|
|
2203
|
+
*
|
|
2204
|
+
*/
|
|
1912
2205
|
RECEIVER_HOSTED: 3,
|
|
2206
|
+
/**
|
|
2207
|
+
* A capability expected to be returned in the results of a currently-outstanding call posed
|
|
2208
|
+
* by the sender.
|
|
2209
|
+
*
|
|
2210
|
+
*/
|
|
1913
2211
|
RECEIVER_ANSWER: 4,
|
|
2212
|
+
/**
|
|
2213
|
+
* **(level 3)**
|
|
2214
|
+
*
|
|
2215
|
+
* A capability that lives in neither the sender's nor the receiver's vat. The sender needs
|
|
2216
|
+
* to form a direct connection to a third party to pick up the capability.
|
|
2217
|
+
*
|
|
2218
|
+
* Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its
|
|
2219
|
+
* `vine` instead.
|
|
2220
|
+
*
|
|
2221
|
+
*/
|
|
1914
2222
|
THIRD_PARTY_HOSTED: 5
|
|
1915
2223
|
};
|
|
1916
2224
|
/**
|
|
@@ -2137,7 +2445,17 @@ var CapDescriptor = class CapDescriptor extends require_src.Struct {
|
|
|
2137
2445
|
}
|
|
2138
2446
|
};
|
|
2139
2447
|
const PromisedAnswer_Op_Which = {
|
|
2448
|
+
/**
|
|
2449
|
+
* Does nothing. This member is mostly defined so that we can make `Op` a union even
|
|
2450
|
+
* though (as of this writing) only one real operation is defined.
|
|
2451
|
+
*
|
|
2452
|
+
*/
|
|
2140
2453
|
NOOP: 0,
|
|
2454
|
+
/**
|
|
2455
|
+
* Get a pointer field within a struct. The number is an index into the pointer section, NOT
|
|
2456
|
+
* a field ordinal, so that the receiver does not need to understand the schema.
|
|
2457
|
+
*
|
|
2458
|
+
*/
|
|
2141
2459
|
GET_POINTER_FIELD: 1
|
|
2142
2460
|
};
|
|
2143
2461
|
var PromisedAnswer_Op = class extends require_src.Struct {
|
|
@@ -2296,9 +2614,61 @@ var ThirdPartyCapDescriptor = class extends require_src.Struct {
|
|
|
2296
2614
|
}
|
|
2297
2615
|
};
|
|
2298
2616
|
const Exception_Type = {
|
|
2617
|
+
/**
|
|
2618
|
+
* A generic problem occurred, and it is believed that if the operation were repeated without
|
|
2619
|
+
* any change in the state of the world, the problem would occur again.
|
|
2620
|
+
*
|
|
2621
|
+
* A client might respond to this error by logging it for investigation by the developer and/or
|
|
2622
|
+
* displaying it to the user.
|
|
2623
|
+
*
|
|
2624
|
+
*/
|
|
2299
2625
|
FAILED: 0,
|
|
2626
|
+
/**
|
|
2627
|
+
* The request was rejected due to a temporary lack of resources.
|
|
2628
|
+
*
|
|
2629
|
+
* Examples include:
|
|
2630
|
+
* - There's not enough CPU time to keep up with incoming requests, so some are rejected.
|
|
2631
|
+
* - The server ran out of RAM or disk space during the request.
|
|
2632
|
+
* - The operation timed out (took significantly longer than it should have).
|
|
2633
|
+
*
|
|
2634
|
+
* A client might respond to this error by scheduling to retry the operation much later. The
|
|
2635
|
+
* client should NOT retry again immediately since this would likely exacerbate the problem.
|
|
2636
|
+
*
|
|
2637
|
+
*/
|
|
2300
2638
|
OVERLOADED: 1,
|
|
2639
|
+
/**
|
|
2640
|
+
* The method failed because a connection to some necessary capability was lost.
|
|
2641
|
+
*
|
|
2642
|
+
* Examples include:
|
|
2643
|
+
* - The client introduced the server to a third-party capability, the connection to that third
|
|
2644
|
+
* party was subsequently lost, and then the client requested that the server use the dead
|
|
2645
|
+
* capability for something.
|
|
2646
|
+
* - The client previously requested that the server obtain a capability from some third party.
|
|
2647
|
+
* The server returned a capability to an object wrapping the third-party capability. Later,
|
|
2648
|
+
* the server's connection to the third party was lost.
|
|
2649
|
+
* - The capability has been revoked. Revocation does not necessarily mean that the client is
|
|
2650
|
+
* no longer authorized to use the capability; it is often used simply as a way to force the
|
|
2651
|
+
* client to repeat the setup process, perhaps to efficiently move them to a new back-end or
|
|
2652
|
+
* get them to recognize some other change that has occurred.
|
|
2653
|
+
*
|
|
2654
|
+
* A client should normally respond to this error by releasing all capabilities it is currently
|
|
2655
|
+
* holding related to the one it called and then re-creating them by restoring SturdyRefs and/or
|
|
2656
|
+
* repeating the method calls used to create them originally. In other words, disconnect and
|
|
2657
|
+
* start over. This should in turn cause the server to obtain a new copy of the capability that
|
|
2658
|
+
* it lost, thus making everything work.
|
|
2659
|
+
*
|
|
2660
|
+
* If the client receives another `disconnected` error in the process of rebuilding the
|
|
2661
|
+
* capability and retrying the call, it should treat this as an `overloaded` error: the network
|
|
2662
|
+
* is currently unreliable, possibly due to load or other temporary issues.
|
|
2663
|
+
*
|
|
2664
|
+
*/
|
|
2301
2665
|
DISCONNECTED: 2,
|
|
2666
|
+
/**
|
|
2667
|
+
* The server doesn't implement the requested method. If there is some other method that the
|
|
2668
|
+
* client could call (perhaps an older and/or slower interface), it should try that instead.
|
|
2669
|
+
* Otherwise, this should be treated like `failed`.
|
|
2670
|
+
*
|
|
2671
|
+
*/
|
|
2302
2672
|
UNIMPLEMENTED: 3
|
|
2303
2673
|
};
|
|
2304
2674
|
/**
|