@stryke/capnp 0.8.3 → 0.9.1

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.
@@ -0,0 +1,209 @@
1
+ import {
2
+ ObjectSize,
3
+ Struct,
4
+ utils
5
+ } from "./chunk-BQI46ZE5.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-SHUYVCID.js";
9
+
10
+ // schemas/rpc-twoparty.ts
11
+ var _capnpFileId = BigInt("0xa184c7885cdaf2a1");
12
+ var Side = {
13
+ /**
14
+ * The object lives on the "server" or "supervisor" end of the connection. Only the
15
+ * server/supervisor knows how to interpret the ref; to the client, it is opaque.
16
+ *
17
+ * Note that containers intending to implement strong confinement should rewrite SturdyRefs
18
+ * received from the external network before passing them on to the confined app. The confined
19
+ * app thus does not ever receive the raw bits of the SturdyRef (which it could perhaps
20
+ * maliciously leak), but instead receives only a thing that it can pass back to the container
21
+ * later to restore the ref. See:
22
+ * http://www.erights.org/elib/capability/dist-confine.html
23
+ *
24
+ */
25
+ SERVER: 0,
26
+ /**
27
+ * The object lives on the "client" or "confined app" end of the connection. Only the client
28
+ * knows how to interpret the ref; to the server/supervisor, it is opaque. Most clients do not
29
+ * actually know how to persist capabilities at all, so use of this is unusual.
30
+ *
31
+ */
32
+ CLIENT: 1
33
+ };
34
+ var VatId = class extends Struct {
35
+ static {
36
+ __name(this, "VatId");
37
+ }
38
+ static _capnp = {
39
+ displayName: "VatId",
40
+ id: "d20b909fee733a8e",
41
+ size: new ObjectSize(8, 0)
42
+ };
43
+ get side() {
44
+ return utils.getUint16(0, this);
45
+ }
46
+ set side(value) {
47
+ utils.setUint16(0, value, this);
48
+ }
49
+ toString() {
50
+ return "VatId_" + super.toString();
51
+ }
52
+ };
53
+ var ProvisionId = class extends Struct {
54
+ static {
55
+ __name(this, "ProvisionId");
56
+ }
57
+ static _capnp = {
58
+ displayName: "ProvisionId",
59
+ id: "b88d09a9c5f39817",
60
+ size: new ObjectSize(8, 0)
61
+ };
62
+ /**
63
+ * The ID from `JoinKeyPart`.
64
+ *
65
+ */
66
+ get joinId() {
67
+ return utils.getUint32(0, this);
68
+ }
69
+ set joinId(value) {
70
+ utils.setUint32(0, value, this);
71
+ }
72
+ toString() {
73
+ return "ProvisionId_" + super.toString();
74
+ }
75
+ };
76
+ var RecipientId = class extends Struct {
77
+ static {
78
+ __name(this, "RecipientId");
79
+ }
80
+ static _capnp = {
81
+ displayName: "RecipientId",
82
+ id: "89f389b6fd4082c1",
83
+ size: new ObjectSize(0, 0)
84
+ };
85
+ toString() {
86
+ return "RecipientId_" + super.toString();
87
+ }
88
+ };
89
+ var ThirdPartyCapId = class extends Struct {
90
+ static {
91
+ __name(this, "ThirdPartyCapId");
92
+ }
93
+ static _capnp = {
94
+ displayName: "ThirdPartyCapId",
95
+ id: "b47f4979672cb59d",
96
+ size: new ObjectSize(0, 0)
97
+ };
98
+ toString() {
99
+ return "ThirdPartyCapId_" + super.toString();
100
+ }
101
+ };
102
+ var JoinKeyPart = class extends Struct {
103
+ static {
104
+ __name(this, "JoinKeyPart");
105
+ }
106
+ static _capnp = {
107
+ displayName: "JoinKeyPart",
108
+ id: "95b29059097fca83",
109
+ size: new ObjectSize(8, 0)
110
+ };
111
+ /**
112
+ * A number identifying this join, chosen by the sender. May be reused once `Finish` messages are
113
+ * sent corresponding to all of the `Join` messages.
114
+ *
115
+ */
116
+ get joinId() {
117
+ return utils.getUint32(0, this);
118
+ }
119
+ set joinId(value) {
120
+ utils.setUint32(0, value, this);
121
+ }
122
+ /**
123
+ * The number of capabilities to be joined.
124
+ *
125
+ */
126
+ get partCount() {
127
+ return utils.getUint16(4, this);
128
+ }
129
+ set partCount(value) {
130
+ utils.setUint16(4, value, this);
131
+ }
132
+ /**
133
+ * Which part this request targets -- a number in the range [0, partCount).
134
+ *
135
+ */
136
+ get partNum() {
137
+ return utils.getUint16(6, this);
138
+ }
139
+ set partNum(value) {
140
+ utils.setUint16(6, value, this);
141
+ }
142
+ toString() {
143
+ return "JoinKeyPart_" + super.toString();
144
+ }
145
+ };
146
+ var JoinResult = class extends Struct {
147
+ static {
148
+ __name(this, "JoinResult");
149
+ }
150
+ static _capnp = {
151
+ displayName: "JoinResult",
152
+ id: "9d263a3630b7ebee",
153
+ size: new ObjectSize(8, 1)
154
+ };
155
+ /**
156
+ * Matches `JoinKeyPart`.
157
+ *
158
+ */
159
+ get joinId() {
160
+ return utils.getUint32(0, this);
161
+ }
162
+ set joinId(value) {
163
+ utils.setUint32(0, value, this);
164
+ }
165
+ /**
166
+ * All JoinResults in the set will have the same value for `succeeded`. The receiver actually
167
+ * implements the join by waiting for all the `JoinKeyParts` and then performing its own join on
168
+ * them, then going back and answering all the join requests afterwards.
169
+ *
170
+ */
171
+ get succeeded() {
172
+ return utils.getBit(32, this);
173
+ }
174
+ set succeeded(value) {
175
+ utils.setBit(32, value, this);
176
+ }
177
+ _adoptCap(value) {
178
+ utils.adopt(value, utils.getPointer(0, this));
179
+ }
180
+ _disownCap() {
181
+ return utils.disown(this.cap);
182
+ }
183
+ /**
184
+ * One of the JoinResults will have a non-null `cap` which is the joined capability.
185
+ *
186
+ */
187
+ get cap() {
188
+ return utils.getPointer(0, this);
189
+ }
190
+ _hasCap() {
191
+ return !utils.isNull(utils.getPointer(0, this));
192
+ }
193
+ set cap(value) {
194
+ utils.copyFrom(value, utils.getPointer(0, this));
195
+ }
196
+ toString() {
197
+ return "JoinResult_" + super.toString();
198
+ }
199
+ };
200
+ export {
201
+ JoinKeyPart,
202
+ JoinResult,
203
+ ProvisionId,
204
+ RecipientId,
205
+ Side,
206
+ ThirdPartyCapId,
207
+ VatId,
208
+ _capnpFileId
209
+ };