@stryke/capnp 0.12.96 → 0.12.98
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 +405 -304
- 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 +368 -268
- 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-Cx88xgqJ.mjs → compile-D_BOc0dD.mjs} +109 -15
- package/dist/compile-D_BOc0dD.mjs.map +1 -0
- package/dist/{compile-SmxAaHxW.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-BoYAadSB.mjs → helpers-2TldkyGG.mjs} +136 -137
- package/dist/helpers-2TldkyGG.mjs.map +1 -0
- package/dist/{helpers-gxlsFdP8.cjs → helpers-Dn4nWOb7.cjs} +164 -165
- 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 +5 -5
- 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-Cx88xgqJ.mjs.map +0 -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/dist-BlvFBzSi.mjs.map +0 -1
- package/dist/helpers-BoYAadSB.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
|
-
const require_capnp_es_GpvEvMIK = require('./capnp-es.GpvEvMIK-
|
|
1
|
+
const require_capnp_es_GpvEvMIK = require('./capnp-es.GpvEvMIK-CZ5ZimCD.cjs');
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@6.0.3/node_modules/capnp-es/dist/shared/capnp-es.UAt3nLGq.mjs
|
|
4
4
|
var Interface = class extends require_capnp_es_GpvEvMIK.Pointer {
|
|
@@ -382,22 +382,100 @@ var Server = class {
|
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@6.0.3/node_modules/capnp-es/dist/capnp/rpc.mjs
|
|
384
384
|
const Message_Which = {
|
|
385
|
+
/**
|
|
386
|
+
* The sender previously received this message from the peer but didn't understand it or doesn't
|
|
387
|
+
* yet implement the functionality that was requested. So, the sender is echoing the message
|
|
388
|
+
* back. In some cases, the receiver may be able to recover from this by pretending the sender
|
|
389
|
+
* had taken some appropriate "null" action.
|
|
390
|
+
*
|
|
391
|
+
* For example, say `resolve` is received by a level 0 implementation (because a previous call
|
|
392
|
+
* or return happened to contain a promise). The level 0 implementation will echo it back as
|
|
393
|
+
* `unimplemented`. The original sender can then simply release the cap to which the promise
|
|
394
|
+
* had resolved, thus avoiding a leak.
|
|
395
|
+
*
|
|
396
|
+
* For any message type that introduces a question, if the message comes back unimplemented,
|
|
397
|
+
* the original sender may simply treat it as if the question failed with an exception.
|
|
398
|
+
*
|
|
399
|
+
* In cases where there is no sensible way to react to an `unimplemented` message (without
|
|
400
|
+
* resource leaks or other serious problems), the connection may need to be aborted. This is
|
|
401
|
+
* a gray area; different implementations may take different approaches.
|
|
402
|
+
*
|
|
403
|
+
*/
|
|
385
404
|
UNIMPLEMENTED: 0,
|
|
405
|
+
/**
|
|
406
|
+
* Sent when a connection is being aborted due to an unrecoverable error. This could be e.g.
|
|
407
|
+
* because the sender received an invalid or nonsensical message or because the sender had an
|
|
408
|
+
* internal error. The sender will shut down the outgoing half of the connection after `abort`
|
|
409
|
+
* and will completely close the connection shortly thereafter (it's up to the sender how much
|
|
410
|
+
* of a time buffer they want to offer for the client to receive the `abort` before the
|
|
411
|
+
* connection is reset).
|
|
412
|
+
*
|
|
413
|
+
*/
|
|
386
414
|
ABORT: 1,
|
|
415
|
+
/**
|
|
416
|
+
* Request the peer's bootstrap interface.
|
|
417
|
+
*
|
|
418
|
+
*/
|
|
387
419
|
BOOTSTRAP: 8,
|
|
420
|
+
/**
|
|
421
|
+
* Begin a method call.
|
|
422
|
+
*
|
|
423
|
+
*/
|
|
388
424
|
CALL: 2,
|
|
425
|
+
/**
|
|
426
|
+
* Complete a method call.
|
|
427
|
+
*
|
|
428
|
+
*/
|
|
389
429
|
RETURN: 3,
|
|
430
|
+
/**
|
|
431
|
+
* Release a returned answer / cancel a call.
|
|
432
|
+
*
|
|
433
|
+
*/
|
|
390
434
|
FINISH: 4,
|
|
435
|
+
/**
|
|
436
|
+
* Resolve a previously-sent promise.
|
|
437
|
+
*
|
|
438
|
+
*/
|
|
391
439
|
RESOLVE: 5,
|
|
440
|
+
/**
|
|
441
|
+
* Release a capability so that the remote object can be deallocated.
|
|
442
|
+
*
|
|
443
|
+
*/
|
|
392
444
|
RELEASE: 6,
|
|
445
|
+
/**
|
|
446
|
+
* Lift an embargo used to enforce E-order over promise resolution.
|
|
447
|
+
*
|
|
448
|
+
*/
|
|
393
449
|
DISEMBARGO: 13,
|
|
450
|
+
/**
|
|
451
|
+
* Obsolete request to save a capability, resulting in a SturdyRef. This has been replaced
|
|
452
|
+
* by the `Persistent` interface defined in `persistent.capnp`. This operation was never
|
|
453
|
+
* implemented.
|
|
454
|
+
*
|
|
455
|
+
*/
|
|
394
456
|
OBSOLETE_SAVE: 7,
|
|
457
|
+
/**
|
|
458
|
+
* Obsolete way to delete a SturdyRef. This operation was never implemented.
|
|
459
|
+
*
|
|
460
|
+
*/
|
|
395
461
|
OBSOLETE_DELETE: 9,
|
|
462
|
+
/**
|
|
463
|
+
* Provide a capability to a third party.
|
|
464
|
+
*
|
|
465
|
+
*/
|
|
396
466
|
PROVIDE: 10,
|
|
467
|
+
/**
|
|
468
|
+
* Accept a capability provided by a third party.
|
|
469
|
+
*
|
|
470
|
+
*/
|
|
397
471
|
ACCEPT: 11,
|
|
472
|
+
/**
|
|
473
|
+
* Directly connect to the common root of two or more proxied caps.
|
|
474
|
+
*
|
|
475
|
+
*/
|
|
398
476
|
JOIN: 12
|
|
399
477
|
};
|
|
400
|
-
var Message
|
|
478
|
+
var Message = class Message extends require_capnp_es_GpvEvMIK.Struct {
|
|
401
479
|
static UNIMPLEMENTED = Message_Which.UNIMPLEMENTED;
|
|
402
480
|
static ABORT = Message_Which.ABORT;
|
|
403
481
|
static BOOTSTRAP = Message_Which.BOOTSTRAP;
|
|
@@ -445,14 +523,14 @@ var Message$1 = class Message$1 extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
445
523
|
*/
|
|
446
524
|
get unimplemented() {
|
|
447
525
|
require_capnp_es_GpvEvMIK.testWhich("unimplemented", require_capnp_es_GpvEvMIK.getUint16(0, this), 0, this);
|
|
448
|
-
return require_capnp_es_GpvEvMIK.getStruct(0, Message
|
|
526
|
+
return require_capnp_es_GpvEvMIK.getStruct(0, Message, this);
|
|
449
527
|
}
|
|
450
528
|
_hasUnimplemented() {
|
|
451
529
|
return !require_capnp_es_GpvEvMIK.isNull(require_capnp_es_GpvEvMIK.getPointer(0, this));
|
|
452
530
|
}
|
|
453
531
|
_initUnimplemented() {
|
|
454
532
|
require_capnp_es_GpvEvMIK.setUint16(0, 0, this);
|
|
455
|
-
return require_capnp_es_GpvEvMIK.initStructAt(0, Message
|
|
533
|
+
return require_capnp_es_GpvEvMIK.initStructAt(0, Message, this);
|
|
456
534
|
}
|
|
457
535
|
get _isUnimplemented() {
|
|
458
536
|
return require_capnp_es_GpvEvMIK.getUint16(0, this) === 0;
|
|
@@ -957,8 +1035,65 @@ var Bootstrap = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
957
1035
|
}
|
|
958
1036
|
};
|
|
959
1037
|
const Call_SendResultsTo_Which = {
|
|
1038
|
+
/**
|
|
1039
|
+
* Send the return message back to the caller (the usual).
|
|
1040
|
+
*
|
|
1041
|
+
*/
|
|
960
1042
|
CALLER: 0,
|
|
1043
|
+
/**
|
|
1044
|
+
* **(level 1)**
|
|
1045
|
+
*
|
|
1046
|
+
* Don't actually return the results to the sender. Instead, hold on to them and await
|
|
1047
|
+
* instructions from the sender regarding what to do with them. In particular, the sender
|
|
1048
|
+
* may subsequently send a `Return` for some other call (which the receiver had previously made
|
|
1049
|
+
* to the sender) with `takeFromOtherQuestion` set. The results from this call are then used
|
|
1050
|
+
* as the results of the other call.
|
|
1051
|
+
*
|
|
1052
|
+
* When `yourself` is used, the receiver must still send a `Return` for the call, but sets the
|
|
1053
|
+
* field `resultsSentElsewhere` in that `Return` rather than including the results.
|
|
1054
|
+
*
|
|
1055
|
+
* This feature can be used to implement tail calls in which a call from Vat A to Vat B ends up
|
|
1056
|
+
* returning the result of a call from Vat B back to Vat A.
|
|
1057
|
+
*
|
|
1058
|
+
* In particular, the most common use case for this feature is when Vat A makes a call to a
|
|
1059
|
+
* promise in Vat B, and then that promise ends up resolving to a capability back in Vat A.
|
|
1060
|
+
* Vat B must forward all the queued calls on that promise back to Vat A, but can set `yourself`
|
|
1061
|
+
* in the calls so that the results need not pass back through Vat B.
|
|
1062
|
+
*
|
|
1063
|
+
* For example:
|
|
1064
|
+
* - Alice, in Vat A, calls foo() on Bob in Vat B.
|
|
1065
|
+
* - Alice makes a pipelined call bar() on the promise returned by foo().
|
|
1066
|
+
* - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next
|
|
1067
|
+
* to Alice).
|
|
1068
|
+
* - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'().
|
|
1069
|
+
* Notice that bar() and bar'() are travelling in opposite directions on the same network
|
|
1070
|
+
* link.
|
|
1071
|
+
* - The `Call` for bar'() has `sendResultsTo` set to `yourself`.
|
|
1072
|
+
* - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results,
|
|
1073
|
+
* with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return,
|
|
1074
|
+
* as doing so would introduce unnecessary round trip latency.
|
|
1075
|
+
* - Vat A receives bar'() and delivers it to Carol.
|
|
1076
|
+
* - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere`
|
|
1077
|
+
* set in place of results.
|
|
1078
|
+
* - Vat A sends a `Finish` for the bar() call to Vat B.
|
|
1079
|
+
* - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'().
|
|
1080
|
+
*
|
|
1081
|
+
*/
|
|
961
1082
|
YOURSELF: 1,
|
|
1083
|
+
/**
|
|
1084
|
+
* **(level 3)**
|
|
1085
|
+
*
|
|
1086
|
+
* The call's result should be returned to a different vat. The receiver (the callee) expects
|
|
1087
|
+
* to receive an `Accept` message from the indicated vat, and should return the call's result
|
|
1088
|
+
* to it, rather than to the sender of the `Call`.
|
|
1089
|
+
*
|
|
1090
|
+
* This operates much like `yourself`, above, except that Carol is in a separate Vat C. `Call`
|
|
1091
|
+
* messages are sent from Vat A -> Vat B and Vat B -> Vat C. A `Return` message is sent from
|
|
1092
|
+
* Vat B -> Vat A that contains `acceptFromThirdParty` in place of results. When Vat A sends
|
|
1093
|
+
* an `Accept` to Vat C, it receives back a `Return` containing the call's actual result. Vat C
|
|
1094
|
+
* also sends a `Return` to Vat B with `resultsSentElsewhere`.
|
|
1095
|
+
*
|
|
1096
|
+
*/
|
|
962
1097
|
THIRD_PARTY: 2
|
|
963
1098
|
};
|
|
964
1099
|
var Call_SendResultsTo = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -1180,11 +1315,54 @@ var Call = class Call extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
1180
1315
|
}
|
|
1181
1316
|
};
|
|
1182
1317
|
const Return_Which = {
|
|
1318
|
+
/**
|
|
1319
|
+
* Equal to the QuestionId of the corresponding `Call` message.
|
|
1320
|
+
*
|
|
1321
|
+
*/
|
|
1183
1322
|
RESULTS: 0,
|
|
1323
|
+
/**
|
|
1324
|
+
* If true, all capabilities that were in the params should be considered released. The sender
|
|
1325
|
+
* must not send separate `Release` messages for them. Level 0 implementations in particular
|
|
1326
|
+
* should always set this true. This defaults true because if level 0 implementations forget to
|
|
1327
|
+
* set it they'll never notice (just silently leak caps), but if level >=1 implementations forget
|
|
1328
|
+
* to set it to false they'll quickly get errors.
|
|
1329
|
+
*
|
|
1330
|
+
* The receiver should act as if the sender had sent a release message with count=1 for each
|
|
1331
|
+
* CapDescriptor in the original Call message.
|
|
1332
|
+
*
|
|
1333
|
+
*/
|
|
1184
1334
|
EXCEPTION: 1,
|
|
1335
|
+
/**
|
|
1336
|
+
* The result.
|
|
1337
|
+
*
|
|
1338
|
+
* For regular method calls, `results.content` points to the result struct.
|
|
1339
|
+
*
|
|
1340
|
+
* For a `Return` in response to an `Accept` or `Bootstrap`, `results` contains a single
|
|
1341
|
+
* capability (rather than a struct), and `results.content` is just a capability pointer with
|
|
1342
|
+
* index 0. A `Finish` is still required in this case.
|
|
1343
|
+
*
|
|
1344
|
+
*/
|
|
1185
1345
|
CANCELED: 2,
|
|
1346
|
+
/**
|
|
1347
|
+
* Indicates that the call failed and explains why.
|
|
1348
|
+
*
|
|
1349
|
+
*/
|
|
1186
1350
|
RESULTS_SENT_ELSEWHERE: 3,
|
|
1351
|
+
/**
|
|
1352
|
+
* Indicates that the call was canceled due to the caller sending a Finish message
|
|
1353
|
+
* before the call had completed.
|
|
1354
|
+
*
|
|
1355
|
+
*/
|
|
1187
1356
|
TAKE_FROM_OTHER_QUESTION: 4,
|
|
1357
|
+
/**
|
|
1358
|
+
* This is set when returning from a `Call` that had `sendResultsTo` set to something other
|
|
1359
|
+
* than `caller`.
|
|
1360
|
+
*
|
|
1361
|
+
* It doesn't matter too much when this is sent, as the receiver doesn't need to do anything
|
|
1362
|
+
* with it, but the C++ implementation appears to wait for the call to finish before sending
|
|
1363
|
+
* this.
|
|
1364
|
+
*
|
|
1365
|
+
*/
|
|
1188
1366
|
ACCEPT_FROM_THIRD_PARTY: 5
|
|
1189
1367
|
};
|
|
1190
1368
|
var Return = class Return extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -1429,7 +1607,43 @@ var Finish = class Finish extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
1429
1607
|
}
|
|
1430
1608
|
};
|
|
1431
1609
|
const Resolve_Which = {
|
|
1610
|
+
/**
|
|
1611
|
+
* The ID of the promise to be resolved.
|
|
1612
|
+
*
|
|
1613
|
+
* Unlike all other instances of `ExportId` sent from the exporter, the `Resolve` message does
|
|
1614
|
+
* _not_ increase the reference count of `promiseId`. In fact, it is expected that the receiver
|
|
1615
|
+
* will release the export soon after receiving `Resolve`, and the sender will not send this
|
|
1616
|
+
* `ExportId` again until it has been released and recycled.
|
|
1617
|
+
*
|
|
1618
|
+
* When an export ID sent over the wire (e.g. in a `CapDescriptor`) is indicated to be a promise,
|
|
1619
|
+
* this indicates that the sender will follow up at some point with a `Resolve` message. If the
|
|
1620
|
+
* same `promiseId` is sent again before `Resolve`, still only one `Resolve` is sent. If the
|
|
1621
|
+
* same ID is sent again later _after_ a `Resolve`, it can only be because the export's
|
|
1622
|
+
* reference count hit zero in the meantime and the ID was re-assigned to a new export, therefore
|
|
1623
|
+
* this later promise does _not_ correspond to the earlier `Resolve`.
|
|
1624
|
+
*
|
|
1625
|
+
* If a promise ID's reference count reaches zero before a `Resolve` is sent, the `Resolve`
|
|
1626
|
+
* message may or may not still be sent (the `Resolve` may have already been in-flight when
|
|
1627
|
+
* `Release` was sent, but if the `Release` is received before `Resolve` then there is no longer
|
|
1628
|
+
* any reason to send a `Resolve`). Thus a `Resolve` may be received for a promise of which
|
|
1629
|
+
* the receiver has no knowledge, because it already released it earlier. In this case, the
|
|
1630
|
+
* receiver should simply release the capability to which the promise resolved.
|
|
1631
|
+
*
|
|
1632
|
+
*/
|
|
1432
1633
|
CAP: 0,
|
|
1634
|
+
/**
|
|
1635
|
+
* The object to which the promise resolved.
|
|
1636
|
+
*
|
|
1637
|
+
* The sender promises that from this point forth, until `promiseId` is released, it shall
|
|
1638
|
+
* simply forward all messages to the capability designated by `cap`. This is true even if
|
|
1639
|
+
* `cap` itself happens to designate another promise, and that other promise later resolves --
|
|
1640
|
+
* messages sent to `promiseId` shall still go to that other promise, not to its resolution.
|
|
1641
|
+
* This is important in the case that the receiver of the `Resolve` ends up sending a
|
|
1642
|
+
* `Disembargo` message towards `promiseId` in order to control message ordering -- that
|
|
1643
|
+
* `Disembargo` really needs to reflect back to exactly the object designated by `cap` even
|
|
1644
|
+
* if that object is itself a promise.
|
|
1645
|
+
*
|
|
1646
|
+
*/
|
|
1433
1647
|
EXCEPTION: 1
|
|
1434
1648
|
};
|
|
1435
1649
|
var Resolve = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -1575,9 +1789,48 @@ var Release = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
1575
1789
|
}
|
|
1576
1790
|
};
|
|
1577
1791
|
const Disembargo_Context_Which = {
|
|
1792
|
+
/**
|
|
1793
|
+
* The sender is requesting a disembargo on a promise that is known to resolve back to a
|
|
1794
|
+
* capability hosted by the sender. As soon as the receiver has echoed back all pipelined calls
|
|
1795
|
+
* on this promise, it will deliver the Disembargo back to the sender with `receiverLoopback`
|
|
1796
|
+
* set to the same value as `senderLoopback`. This value is chosen by the sender, and since
|
|
1797
|
+
* it is also consumed be the sender, the sender can use whatever strategy it wants to make sure
|
|
1798
|
+
* the value is unambiguous.
|
|
1799
|
+
*
|
|
1800
|
+
* The receiver must verify that the target capability actually resolves back to the sender's
|
|
1801
|
+
* vat. Otherwise, the sender has committed a protocol error and should be disconnected.
|
|
1802
|
+
*
|
|
1803
|
+
*/
|
|
1578
1804
|
SENDER_LOOPBACK: 0,
|
|
1805
|
+
/**
|
|
1806
|
+
* The receiver previously sent a `senderLoopback` Disembargo towards a promise resolving to
|
|
1807
|
+
* this capability, and that Disembargo is now being echoed back.
|
|
1808
|
+
*
|
|
1809
|
+
*/
|
|
1579
1810
|
RECEIVER_LOOPBACK: 1,
|
|
1811
|
+
/**
|
|
1812
|
+
* **(level 3)**
|
|
1813
|
+
*
|
|
1814
|
+
* The sender is requesting a disembargo on a promise that is known to resolve to a third-party
|
|
1815
|
+
* capability that the sender is currently in the process of accepting (using `Accept`).
|
|
1816
|
+
* The receiver of this `Disembargo` has an outstanding `Provide` on said capability. The
|
|
1817
|
+
* receiver should now send a `Disembargo` with `provide` set to the question ID of that
|
|
1818
|
+
* `Provide` message.
|
|
1819
|
+
*
|
|
1820
|
+
* See `Accept.embargo` for an example.
|
|
1821
|
+
*
|
|
1822
|
+
*/
|
|
1580
1823
|
ACCEPT: 2,
|
|
1824
|
+
/**
|
|
1825
|
+
* **(level 3)**
|
|
1826
|
+
*
|
|
1827
|
+
* The sender is requesting a disembargo on a capability currently being provided to a third
|
|
1828
|
+
* party. The question ID identifies the `Provide` message previously sent by the sender to
|
|
1829
|
+
* this capability. On receipt, the receiver (the capability host) shall release the embargo
|
|
1830
|
+
* on the `Accept` message that it has received from the third party. See `Accept.embargo` for
|
|
1831
|
+
* an example.
|
|
1832
|
+
*
|
|
1833
|
+
*/
|
|
1581
1834
|
PROVIDE: 3
|
|
1582
1835
|
};
|
|
1583
1836
|
var Disembargo_Context = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -1924,7 +2177,20 @@ var Join = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
1924
2177
|
}
|
|
1925
2178
|
};
|
|
1926
2179
|
const MessageTarget_Which = {
|
|
2180
|
+
/**
|
|
2181
|
+
* This message is to a capability or promise previously imported by the caller (exported by
|
|
2182
|
+
* the receiver).
|
|
2183
|
+
*
|
|
2184
|
+
*/
|
|
1927
2185
|
IMPORTED_CAP: 0,
|
|
2186
|
+
/**
|
|
2187
|
+
* This message is to a capability that is expected to be returned by another call that has not
|
|
2188
|
+
* yet been completed.
|
|
2189
|
+
*
|
|
2190
|
+
* At level 0, this is supported only for addressing the result of a previous `Bootstrap`, so
|
|
2191
|
+
* that initial startup doesn't require a round trip.
|
|
2192
|
+
*
|
|
2193
|
+
*/
|
|
1928
2194
|
PROMISED_ANSWER: 1
|
|
1929
2195
|
};
|
|
1930
2196
|
var MessageTarget = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -2045,11 +2311,52 @@ var Payload = class Payload extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
2045
2311
|
}
|
|
2046
2312
|
};
|
|
2047
2313
|
const CapDescriptor_Which = {
|
|
2314
|
+
/**
|
|
2315
|
+
* There is no capability here. This `CapDescriptor` should not appear in the payload content.
|
|
2316
|
+
* A `none` CapDescriptor can be generated when an application inserts a capability into a
|
|
2317
|
+
* message and then later changes its mind and removes it -- rewriting all of the other
|
|
2318
|
+
* capability pointers may be hard, so instead a tombstone is left, similar to the way a removed
|
|
2319
|
+
* struct or list instance is zeroed out of the message but the space is not reclaimed.
|
|
2320
|
+
* Hopefully this is unusual.
|
|
2321
|
+
*
|
|
2322
|
+
*/
|
|
2048
2323
|
NONE: 0,
|
|
2324
|
+
/**
|
|
2325
|
+
* The ID of a capability in the sender's export table (receiver's import table). It may be a
|
|
2326
|
+
* newly allocated table entry, or an existing entry (increments the reference count).
|
|
2327
|
+
*
|
|
2328
|
+
*/
|
|
2049
2329
|
SENDER_HOSTED: 1,
|
|
2330
|
+
/**
|
|
2331
|
+
* A promise that the sender will resolve later. The sender will send exactly one Resolve
|
|
2332
|
+
* message at a future point in time to replace this promise. Note that even if the same
|
|
2333
|
+
* `senderPromise` is received multiple times, only one `Resolve` is sent to cover all of
|
|
2334
|
+
* them. If `senderPromise` is released before the `Resolve` is sent, the sender (of this
|
|
2335
|
+
* `CapDescriptor`) may choose not to send the `Resolve` at all.
|
|
2336
|
+
*
|
|
2337
|
+
*/
|
|
2050
2338
|
SENDER_PROMISE: 2,
|
|
2339
|
+
/**
|
|
2340
|
+
* A capability (or promise) previously exported by the receiver (imported by the sender).
|
|
2341
|
+
*
|
|
2342
|
+
*/
|
|
2051
2343
|
RECEIVER_HOSTED: 3,
|
|
2344
|
+
/**
|
|
2345
|
+
* A capability expected to be returned in the results of a currently-outstanding call posed
|
|
2346
|
+
* by the sender.
|
|
2347
|
+
*
|
|
2348
|
+
*/
|
|
2052
2349
|
RECEIVER_ANSWER: 4,
|
|
2350
|
+
/**
|
|
2351
|
+
* **(level 3)**
|
|
2352
|
+
*
|
|
2353
|
+
* A capability that lives in neither the sender's nor the receiver's vat. The sender needs
|
|
2354
|
+
* to form a direct connection to a third party to pick up the capability.
|
|
2355
|
+
*
|
|
2356
|
+
* Level 1 and 2 implementations that receive a `thirdPartyHosted` may simply send calls to its
|
|
2357
|
+
* `vine` instead.
|
|
2358
|
+
*
|
|
2359
|
+
*/
|
|
2053
2360
|
THIRD_PARTY_HOSTED: 5
|
|
2054
2361
|
};
|
|
2055
2362
|
var CapDescriptor = class CapDescriptor extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -2258,7 +2565,17 @@ var CapDescriptor = class CapDescriptor extends require_capnp_es_GpvEvMIK.Struct
|
|
|
2258
2565
|
}
|
|
2259
2566
|
};
|
|
2260
2567
|
const PromisedAnswer_Op_Which = {
|
|
2568
|
+
/**
|
|
2569
|
+
* Does nothing. This member is mostly defined so that we can make `Op` a union even
|
|
2570
|
+
* though (as of this writing) only one real operation is defined.
|
|
2571
|
+
*
|
|
2572
|
+
*/
|
|
2261
2573
|
NOOP: 0,
|
|
2574
|
+
/**
|
|
2575
|
+
* Get a pointer field within a struct. The number is an index into the pointer section, NOT
|
|
2576
|
+
* a field ordinal, so that the receiver does not need to understand the schema.
|
|
2577
|
+
*
|
|
2578
|
+
*/
|
|
2262
2579
|
GET_POINTER_FIELD: 1
|
|
2263
2580
|
};
|
|
2264
2581
|
var PromisedAnswer_Op = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -2398,9 +2715,61 @@ var ThirdPartyCapDescriptor = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
|
2398
2715
|
}
|
|
2399
2716
|
};
|
|
2400
2717
|
const Exception_Type = {
|
|
2718
|
+
/**
|
|
2719
|
+
* A generic problem occurred, and it is believed that if the operation were repeated without
|
|
2720
|
+
* any change in the state of the world, the problem would occur again.
|
|
2721
|
+
*
|
|
2722
|
+
* A client might respond to this error by logging it for investigation by the developer and/or
|
|
2723
|
+
* displaying it to the user.
|
|
2724
|
+
*
|
|
2725
|
+
*/
|
|
2401
2726
|
FAILED: 0,
|
|
2727
|
+
/**
|
|
2728
|
+
* The request was rejected due to a temporary lack of resources.
|
|
2729
|
+
*
|
|
2730
|
+
* Examples include:
|
|
2731
|
+
* - There's not enough CPU time to keep up with incoming requests, so some are rejected.
|
|
2732
|
+
* - The server ran out of RAM or disk space during the request.
|
|
2733
|
+
* - The operation timed out (took significantly longer than it should have).
|
|
2734
|
+
*
|
|
2735
|
+
* A client might respond to this error by scheduling to retry the operation much later. The
|
|
2736
|
+
* client should NOT retry again immediately since this would likely exacerbate the problem.
|
|
2737
|
+
*
|
|
2738
|
+
*/
|
|
2402
2739
|
OVERLOADED: 1,
|
|
2740
|
+
/**
|
|
2741
|
+
* The method failed because a connection to some necessary capability was lost.
|
|
2742
|
+
*
|
|
2743
|
+
* Examples include:
|
|
2744
|
+
* - The client introduced the server to a third-party capability, the connection to that third
|
|
2745
|
+
* party was subsequently lost, and then the client requested that the server use the dead
|
|
2746
|
+
* capability for something.
|
|
2747
|
+
* - The client previously requested that the server obtain a capability from some third party.
|
|
2748
|
+
* The server returned a capability to an object wrapping the third-party capability. Later,
|
|
2749
|
+
* the server's connection to the third party was lost.
|
|
2750
|
+
* - The capability has been revoked. Revocation does not necessarily mean that the client is
|
|
2751
|
+
* no longer authorized to use the capability; it is often used simply as a way to force the
|
|
2752
|
+
* client to repeat the setup process, perhaps to efficiently move them to a new back-end or
|
|
2753
|
+
* get them to recognize some other change that has occurred.
|
|
2754
|
+
*
|
|
2755
|
+
* A client should normally respond to this error by releasing all capabilities it is currently
|
|
2756
|
+
* holding related to the one it called and then re-creating them by restoring SturdyRefs and/or
|
|
2757
|
+
* repeating the method calls used to create them originally. In other words, disconnect and
|
|
2758
|
+
* start over. This should in turn cause the server to obtain a new copy of the capability that
|
|
2759
|
+
* it lost, thus making everything work.
|
|
2760
|
+
*
|
|
2761
|
+
* If the client receives another `disconnected` error in the process of rebuilding the
|
|
2762
|
+
* capability and retrying the call, it should treat this as an `overloaded` error: the network
|
|
2763
|
+
* is currently unreliable, possibly due to load or other temporary issues.
|
|
2764
|
+
*
|
|
2765
|
+
*/
|
|
2403
2766
|
DISCONNECTED: 2,
|
|
2767
|
+
/**
|
|
2768
|
+
* The server doesn't implement the requested method. If there is some other method that the
|
|
2769
|
+
* client could call (perhaps an older and/or slower interface), it should try that instead.
|
|
2770
|
+
* Otherwise, this should be treated like `failed`.
|
|
2771
|
+
*
|
|
2772
|
+
*/
|
|
2404
2773
|
UNIMPLEMENTED: 3
|
|
2405
2774
|
};
|
|
2406
2775
|
var Exception = class extends require_capnp_es_GpvEvMIK.Struct {
|
|
@@ -2898,7 +3267,7 @@ function toException(exc, err) {
|
|
|
2898
3267
|
exc.type = Exception.Type.FAILED;
|
|
2899
3268
|
}
|
|
2900
3269
|
function newMessage() {
|
|
2901
|
-
return new require_capnp_es_GpvEvMIK.Message().initRoot(Message
|
|
3270
|
+
return new require_capnp_es_GpvEvMIK.Message().initRoot(Message);
|
|
2902
3271
|
}
|
|
2903
3272
|
function newFinishMessage(questionID, release) {
|
|
2904
3273
|
const m = newMessage();
|
|
@@ -3358,20 +3727,20 @@ var Conn = class {
|
|
|
3358
3727
|
}
|
|
3359
3728
|
handleMessage(m) {
|
|
3360
3729
|
switch (m.which()) {
|
|
3361
|
-
case Message
|
|
3362
|
-
case Message
|
|
3730
|
+
case Message.UNIMPLEMENTED: break;
|
|
3731
|
+
case Message.BOOTSTRAP:
|
|
3363
3732
|
this.handleBootstrapMessage(m);
|
|
3364
3733
|
break;
|
|
3365
|
-
case Message
|
|
3734
|
+
case Message.ABORT:
|
|
3366
3735
|
this.shutdown(new RPCError(m.abort));
|
|
3367
3736
|
break;
|
|
3368
|
-
case Message
|
|
3737
|
+
case Message.FINISH:
|
|
3369
3738
|
this.handleFinishMessage(m);
|
|
3370
3739
|
break;
|
|
3371
|
-
case Message
|
|
3740
|
+
case Message.RETURN:
|
|
3372
3741
|
this.handleReturnMessage(m);
|
|
3373
3742
|
break;
|
|
3374
|
-
case Message
|
|
3743
|
+
case Message.CALL:
|
|
3375
3744
|
this.handleCallMessage(m);
|
|
3376
3745
|
break;
|
|
3377
3746
|
}
|
|
@@ -3681,7 +4050,7 @@ var DeferredTransport = class {
|
|
|
3681
4050
|
};
|
|
3682
4051
|
resolve = (buf) => {
|
|
3683
4052
|
try {
|
|
3684
|
-
this.d?.resolve(new require_capnp_es_GpvEvMIK.Message(buf, false).getRoot(Message
|
|
4053
|
+
this.d?.resolve(new require_capnp_es_GpvEvMIK.Message(buf, false).getRoot(Message));
|
|
3685
4054
|
} catch (error_) {
|
|
3686
4055
|
this.d?.reject(error_);
|
|
3687
4056
|
}
|