@agoric/network 0.1.1-other-dev-3eb1a1d.0 → 0.1.1-other-dev-d15096d.0.d15096d

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/README.md CHANGED
@@ -48,7 +48,13 @@ You must also prepare a `ConnectionHandler` object to manage the connection you'
48
48
  Then you will call the `connect()` method on your local `Port`. This will return a `Promise` that will fire with a new `Connection` object, on which you can send data. Your `ConnectionHandler` will be notified about the new channel, and will receive inbound data from the other side.
49
49
 
50
50
  ```js
51
- const remoteEndpoint = `/ibc-hop/${hopName}/ibc-port/${portName}/ordered/${version}`;
51
+ import { encodeIbcEndpoint } from '@agoric/vats/tools/ibc-utils.js';
52
+ const remoteEndpoint = encodeIbcEndpoint({
53
+ hops: [connectionID],
54
+ portID,
55
+ order: 'ordered',
56
+ version
57
+ });;
52
58
  E(home.ibcport[0]).connect(remoteEndpoint, connectionHandler)
53
59
  .then(conn => doSomethingWithConnection(conn));
54
60
  ```
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
1
  {
2
2
  "name": "@agoric/network",
3
- "version": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
3
+ "version": "0.1.1-other-dev-d15096d.0.d15096d",
4
4
  "description": "Agoric's network protocol API",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "repository": "https://github.com/Agoric/agoric-sdk",
8
8
  "scripts": {
9
9
  "build": "exit 0",
10
- "prepack": "tsc --build tsconfig.build.json",
11
- "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
10
+ "prepack": "yarn run -T tsc --build tsconfig.build.json",
11
+ "postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
12
12
  "test": "ava",
13
- "test:c8": "c8 --all $C8_OPTIONS ava",
13
+ "test:c8": "c8 --all ${C8_OPTIONS:-} ava",
14
14
  "test:xs": "exit 0",
15
15
  "lint-fix": "yarn lint:eslint --fix",
16
- "lint": "run-s --continue-on-error lint:*",
17
- "lint:types": "tsc",
18
- "lint:eslint": "eslint ."
16
+ "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
17
+ "lint:types": "yarn run -T tsc",
18
+ "lint:eslint": "yarn run -T eslint ."
19
19
  },
20
20
  "keywords": [],
21
21
  "author": "Agoric",
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@agoric/internal": "0.3.3-other-dev-3eb1a1d.0+3eb1a1d",
25
- "@agoric/store": "0.9.3-other-dev-3eb1a1d.0+3eb1a1d",
26
- "@agoric/vat-data": "0.5.3-other-dev-3eb1a1d.0+3eb1a1d",
27
- "@endo/base64": "^1.0.9",
28
- "@endo/errors": "^1.2.8",
29
- "@endo/far": "^1.1.9",
30
- "@endo/pass-style": "^1.4.7",
31
- "@endo/patterns": "^1.4.7",
32
- "@endo/promise-kit": "^1.1.8"
24
+ "@agoric/internal": "0.3.3-other-dev-d15096d.0.d15096d",
25
+ "@agoric/store": "0.9.3-other-dev-d15096d.0.d15096d",
26
+ "@agoric/vat-data": "0.5.3-other-dev-d15096d.0.d15096d",
27
+ "@endo/base64": "^1.0.12",
28
+ "@endo/errors": "^1.2.13",
29
+ "@endo/far": "^1.1.14",
30
+ "@endo/pass-style": "^1.6.3",
31
+ "@endo/patterns": "^1.7.0",
32
+ "@endo/promise-kit": "^1.1.13"
33
33
  },
34
34
  "devDependencies": {
35
- "@agoric/swingset-liveslots": "0.10.3-other-dev-3eb1a1d.0+3eb1a1d",
36
- "@agoric/swingset-vat": "0.32.3-other-dev-3eb1a1d.0+3eb1a1d",
37
- "@agoric/vow": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
38
- "@agoric/zone": "0.2.3-other-dev-3eb1a1d.0+3eb1a1d",
39
- "@endo/bundle-source": "^3.5.0",
35
+ "@agoric/swingset-liveslots": "0.10.3-other-dev-d15096d.0.d15096d",
36
+ "@agoric/swingset-vat": "0.32.3-other-dev-d15096d.0.d15096d",
37
+ "@agoric/vow": "0.1.1-other-dev-d15096d.0.d15096d",
38
+ "@agoric/zone": "0.2.3-other-dev-d15096d.0.d15096d",
39
+ "@endo/bundle-source": "^4.1.2",
40
40
  "ava": "^5.3.0",
41
- "c8": "^10.1.2"
41
+ "c8": "^10.1.3"
42
42
  },
43
43
  "exports": {
44
44
  ".": "./src/index.js"
@@ -53,7 +53,7 @@
53
53
  "access": "public"
54
54
  },
55
55
  "engines": {
56
- "node": "^18.12 || ^20.9"
56
+ "node": "^20.9 || ^22.11"
57
57
  },
58
58
  "ava": {
59
59
  "files": [
@@ -68,5 +68,5 @@
68
68
  "typeCoverage": {
69
69
  "atLeast": 91.16
70
70
  },
71
- "gitHead": "3eb1a1d2d75b2b4a94807cd3bf759bc9fc531f05"
71
+ "gitHead": "d15096dc4ff8b96e9b6cd11954c20d3a9efbb393"
72
72
  }
package/src/bytes.d.ts CHANGED
@@ -42,5 +42,4 @@ export function byteSourceToBase64(byteSource: ByteSource): string;
42
42
  export function base64ToBytes(string: string): Bytes;
43
43
  export type ByteSource = Bytes | Buffer | Uint8Array | Iterable<number>;
44
44
  import type { Bytes } from './types.js';
45
- import type { Bytes as Bytes_1 } from './types.js';
46
45
  //# sourceMappingURL=bytes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["bytes.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH,2EAA2E;AAE3E;;;;;;;GAOG;AACH,6CAHW,OAAO,GACL,UAAU,CAgBtB;AAuBD;;;;;;GAMG;AACH,oCAHW,UAAU,GACR,KAAK,CAOjB;AAED;;;;;GAKG;AACH,qCAHW,KAAK,GACH,MAAM,CAIlB;AAED;;;;;GAKG;AACH,+CAHW,UAAU,GACR,MAAM,CAKlB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,GACJ,KAAK,CAIjB;yBA1Fa,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;2BAHpC,YAAY;sCAAZ,YAAY"}
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["bytes.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH,2EAA2E;AAE3E;;;;;;;GAOG;AACH,6CAHW,OAAO,GACL,UAAU,CAgBtB;AAuBD;;;;;;GAMG;AACH,oCAHW,UAAU,GACR,KAAK,CAOjB;AAED;;;;;GAKG;AACH,qCAHW,KAAK,GACH,MAAM,CAIlB;AAED;;;;;GAKG;AACH,+CAHW,UAAU,GACR,MAAM,CAKlB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,GACJ,KAAK,CAIjB;yBA1Fa,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;2BAHpC,YAAY"}
package/src/bytes.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @ts-check
2
2
  import { X, Fail } from '@endo/errors';
3
3
  import { encodeBase64, decodeBase64 } from '@endo/base64';
4
- import { isObject } from '@endo/pass-style';
4
+ import { isPrimitive } from '@endo/pass-style';
5
5
 
6
6
  /**
7
7
  * @import {Bytes} from './types.js';
@@ -22,7 +22,7 @@ export function coerceToByteSource(specimen) {
22
22
  return specimen;
23
23
  }
24
24
 
25
- isObject(specimen) ||
25
+ !isPrimitive(specimen) ||
26
26
  assert.fail(X`non-object ${specimen} is not a ByteSource`, TypeError);
27
27
 
28
28
  const obj = /** @type {{}} */ (specimen);
package/src/network.d.ts CHANGED
@@ -8,10 +8,10 @@ export function getPrefixes(addr: string): string[];
8
8
  /**
9
9
  * Create a protocol handler that just connects to itself.
10
10
  *
11
- * @param {import('@agoric/base-zone').Zone} zone
11
+ * @param {Zone} zone
12
12
  * @param {VowTools} powers
13
13
  */
14
- export function prepareLoopbackProtocolHandler(zone: import("@agoric/base-zone").Zone, { watch, allVows }: VowTools): (instancePrefix?: string | undefined) => import("@endo/exo").Guarded<{
14
+ export function prepareLoopbackProtocolHandler(zone: Zone, { watch, allVows }: VowTools): (instancePrefix?: string) => import("@endo/exo").Guarded<{
15
15
  onCreate(_impl: any, _protocolHandler: any): Promise<void>;
16
16
  generatePortID(_localAddr: any, _protocolHandler: any): Promise<string>;
17
17
  onBind(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
@@ -19,9 +19,9 @@ export function prepareLoopbackProtocolHandler(zone: import("@agoric/base-zone")
19
19
  * @param {*} _port
20
20
  * @param {Endpoint} localAddr
21
21
  * @param {Endpoint} remoteAddr
22
- * @returns {import('@agoric/vow').PromiseVow<AttemptDescription>}}
22
+ * @returns {PromiseVow<AttemptDescription>}}
23
23
  */
24
- onConnect(_port: any, localAddr: Endpoint, remoteAddr: Endpoint): import("@agoric/vow").PromiseVow<AttemptDescription>;
24
+ onConnect(_port: any, localAddr: Endpoint, remoteAddr: Endpoint): PromiseVow<AttemptDescription>;
25
25
  onInstantiate(_port: any, _localAddr: any, _remote: any, _protocol: any): Promise<string>;
26
26
  onListen(port: any, localAddr: any, listenHandler: any, _protocolHandler: any): Promise<void>;
27
27
  /**
@@ -40,9 +40,9 @@ export function prepareLoopbackProtocolHandler(zone: import("@agoric/base-zone")
40
40
  export const ENDPOINT_SEPARATOR: "/";
41
41
  export const CLOSE_REASON_FINALIZER: "closed-by-finalizer";
42
42
  export function rethrowUnlessMissing(err: unknown): undefined;
43
- export function crossoverConnection(zone: import("@agoric/zone").Zone, handler0: Remote<Required<ConnectionHandler>>, addr0: Endpoint, handler1: Remote<Required<ConnectionHandler>>, addr1: Endpoint, makeConnection: (opts: ConnectionOpts) => Connection, finalizer: Finalizer, current?: globalThis.WeakSetStore<Closable> | undefined): Connection[];
44
- export function prepareNetworkProtocol(zone: import("@agoric/base-zone").Zone, powers: Powers): (protocolHandler: Remote<ProtocolHandler>) => Protocol;
45
- export function prepareEchoConnectionKit(zone: import("@agoric/base-zone").Zone): () => import("@endo/exo").GuardedKit<{
43
+ export function crossoverConnection(zone: Zone, handler0: Remote<Required<ConnectionHandler>>, addr0: Endpoint, handler1: Remote<Required<ConnectionHandler>>, addr1: Endpoint, makeConnection: (opts: ConnectionOpts) => Connection, finalizer: Finalizer, current?: WeakSetStore<Closable>): Connection[];
44
+ export function prepareNetworkProtocol(zone: Zone, powers: Powers): (protocolHandler: Remote<ProtocolHandler>) => Protocol;
45
+ export function prepareEchoConnectionKit(zone: Zone): () => import("@endo/exo").GuardedKit<{
46
46
  handler: {
47
47
  /**
48
48
  * @param {Connection} _connection
@@ -55,7 +55,7 @@ export function prepareEchoConnectionKit(zone: import("@agoric/base-zone").Zone)
55
55
  * @param {CloseReason} [reason]
56
56
  * @param {ConnectionHandler} [_connectionHandler]
57
57
  */
58
- onClose(_connection: Connection, reason?: CloseReason, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
58
+ onClose(_connection: Connection, reason?: CloseReason, _connectionHandler?: ConnectionHandler): Promise<void>;
59
59
  };
60
60
  listener: {
61
61
  onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<import("@endo/exo").Guarded<{
@@ -70,12 +70,12 @@ export function prepareEchoConnectionKit(zone: import("@agoric/base-zone").Zone)
70
70
  * @param {CloseReason} [reason]
71
71
  * @param {ConnectionHandler} [_connectionHandler]
72
72
  */
73
- onClose(_connection: Connection, reason?: CloseReason, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
73
+ onClose(_connection: Connection, reason?: CloseReason, _connectionHandler?: ConnectionHandler): Promise<void>;
74
74
  }>>;
75
75
  onListen(port: any, _listenHandler: any): Promise<void>;
76
76
  };
77
77
  }>;
78
- export function preparePortAllocator(zone: import("@agoric/base-zone").Zone, { watch }: Powers): (args_0: {
78
+ export function preparePortAllocator(zone: Zone, { watch }: Powers): (args_0: {
79
79
  protocol: Protocol;
80
80
  }) => import("@endo/exo").Guarded<{
81
81
  allocateCustomIBCPort(specifiedName?: string): Promise<import("@agoric/vow").Vow<Port>>;
@@ -83,7 +83,7 @@ export function preparePortAllocator(zone: import("@agoric/base-zone").Zone, { w
83
83
  allocateICQControllerPort(): Promise<import("@agoric/vow").Vow<Port>>;
84
84
  allocateCustomLocalPort(specifiedName?: string): Promise<import("@agoric/vow").Vow<Port>>;
85
85
  }>;
86
- export function prepareNetworkPowers(zone: import("@agoric/base-zone").Zone, vowTools: VowTools): Powers;
86
+ export function prepareNetworkPowers(zone: Zone, vowTools: VowTools): Powers;
87
87
  export type MakeEchoConnectionKit = ReturnType<typeof prepareEchoConnectionKit>;
88
88
  export type Powers = VowTools & {
89
89
  finalizer: Finalizer;
@@ -98,9 +98,11 @@ export type ConnectionOpts = {
98
98
  };
99
99
  export type PortAllocator = ReturnType<ReturnType<typeof preparePortAllocator>>;
100
100
  export type Finalizer = ReturnType<typeof prepareFinalizer>;
101
+ import type { Zone } from '@agoric/base-zone';
101
102
  import type { VowTools } from '@agoric/vow';
102
103
  import type { Endpoint } from './types.js';
103
104
  import type { AttemptDescription } from './types.js';
105
+ import type { PromiseVow } from '@agoric/vow';
104
106
  import type { Port } from './types.js';
105
107
  import type { Remote } from '@agoric/vow';
106
108
  import type { ListenHandler } from './types.js';
@@ -120,10 +122,10 @@ import type { CloseReason } from './types.js';
120
122
  * The reason this functionality wasn't just baked into the other network exos
121
123
  * is to maintain upgrade-compatible with minimal additional changes.
122
124
  *
123
- * @param {import('@agoric/base-zone').Zone} zone
125
+ * @param {Zone} zone
124
126
  * @param {VowTools} vowTools
125
127
  */
126
- declare function prepareFinalizer(zone: import("@agoric/base-zone").Zone, { watch }: VowTools): import("@endo/exo").Guarded<{
128
+ declare function prepareFinalizer(zone: Zone, { watch }: VowTools): import("@endo/exo").Guarded<{
127
129
  has(obj: any): boolean;
128
130
  /**
129
131
  * Add a connection and handler for an `onClose` method to be called upon
@@ -143,6 +145,5 @@ declare function prepareFinalizer(zone: import("@agoric/base-zone").Zone, { watc
143
145
  finalize(obj: any): import("@agoric/vow").Vow<any> | undefined;
144
146
  unpin(obj: any): void;
145
147
  }>;
146
- import type { PromiseVow } from '@agoric/vow';
147
148
  export {};
148
149
  //# sourceMappingURL=network.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"network.d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gCACpJ,aAAa;0BAD2H,YAAY;4BACpJ,aAAa;mCAD2H,YAAY;uCAAZ,YAAY;gCAAZ,YAAY;8BAAZ,YAAY;qCAAZ,YAAY;8BAAZ,YAAY;2BAAZ,YAAY;iCAAZ,YAAY;AAq/CnM,mFAAmF;AAEnF;;;;;;;;;;GAUG;AACH,wCAHW,IAAI,aACJ,QAAQ;;IAcf;;;;;OAKG;yBAFQ,OAAO,UAAU,CAAC,WAClB,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAK9C;;;;OAIG;uBADQ,OAAO;QAAE,KAAK,IAAI,WAAW,GAAG,CAAC,CAAA;KAAE,CAAC;;;GA0BlD"}
package/src/network.js CHANGED
@@ -10,8 +10,9 @@ import { Shape } from './shapes.js';
10
10
 
11
11
  /// <reference path="./types.js" />
12
12
  /**
13
- * @import {AttemptDescription, Bytes, CloseReason, Closable, Connection, ConnectionHandler, Endpoint, ListenHandler, Port, Protocol, ProtocolHandler, ProtocolImpl} from './types.js';
13
+ * @import {AttemptDescription, Bytes, CloseReason, Closable, Connection, ConnectionHandler, Endpoint, ListenHandler, Port, Protocol, ProtocolHandler, ProtocolImpl, SendOptions} from './types.js';
14
14
  * @import {PromiseVow, Remote, VowTools} from '@agoric/vow';
15
+ * @import {Zone} from '@agoric/base-zone';
15
16
  */
16
17
 
17
18
  /** @typedef {VowTools & { finalizer: Finalizer }} Powers */
@@ -84,7 +85,7 @@ function throwIfInvalidPortName(specifiedName) {
84
85
  */
85
86
 
86
87
  /**
87
- * @param {import('@agoric/base-zone').Zone} zone
88
+ * @param {Zone} zone
88
89
  * @param {Powers} powers
89
90
  */
90
91
  const prepareHalfConnection = (zone, { watch, allVows, finalizer }) => {
@@ -114,8 +115,11 @@ const prepareHalfConnection = (zone, { watch, allVows, finalizer }) => {
114
115
  const { addrs, r } = this.state;
115
116
  return addrs[r];
116
117
  },
117
- /** @param {Bytes} packetBytes */
118
- async send(packetBytes) {
118
+ /**
119
+ * @param {Bytes} packetBytes
120
+ * @param {SendOptions} [opts]
121
+ */
122
+ async send(packetBytes, opts) {
119
123
  const { closed, handlers, r, conns } = this.state;
120
124
  if (closed) {
121
125
  throw Error(closed);
@@ -126,6 +130,7 @@ const prepareHalfConnection = (zone, { watch, allVows, finalizer }) => {
126
130
  conns.get(r),
127
131
  toBytes(packetBytes),
128
132
  handlers[r],
133
+ opts,
129
134
  ),
130
135
  this.facets.openConnectionAckWatcher,
131
136
  );
@@ -186,7 +191,7 @@ const prepareHalfConnection = (zone, { watch, allVows, finalizer }) => {
186
191
  };
187
192
 
188
193
  /**
189
- * @param {import('@agoric/zone').Zone} zone
194
+ * @param {Zone} zone
190
195
  * @param {Remote<Required<ConnectionHandler>>} handler0
191
196
  * @param {Endpoint} addr0
192
197
  * @param {Remote<Required<ConnectionHandler>>} handler1
@@ -248,7 +253,7 @@ export const crossoverConnection = (
248
253
  };
249
254
 
250
255
  /**
251
- * @param {import('@agoric/zone').Zone} zone
256
+ * @param {Zone} zone
252
257
  * @param {(opts: ConnectionOpts) => Connection} makeConnection
253
258
  * @param {Powers} powers
254
259
  */
@@ -413,7 +418,7 @@ const RevokeState = /** @type {const} */ ({
413
418
  harden(RevokeState);
414
419
 
415
420
  /**
416
- * @param {import('@agoric/zone').Zone} zone
421
+ * @param {Zone} zone
417
422
  * @param {Powers} powers
418
423
  */
419
424
  const preparePort = (zone, powers) => {
@@ -661,7 +666,7 @@ const preparePort = (zone, powers) => {
661
666
  };
662
667
 
663
668
  /**
664
- * @param {import('@agoric/base-zone').Zone} zone
669
+ * @param {Zone} zone
665
670
  * @param {Powers} powers
666
671
  */
667
672
  const prepareBinder = (zone, powers) => {
@@ -1178,7 +1183,7 @@ const prepareBinder = (zone, powers) => {
1178
1183
  };
1179
1184
 
1180
1185
  /**
1181
- * @param {import('@agoric/base-zone').Zone} zone
1186
+ * @param {Zone} zone
1182
1187
  * @param {Powers} powers
1183
1188
  */
1184
1189
  export const prepareNetworkProtocol = (zone, powers) => {
@@ -1218,7 +1223,7 @@ export const prepareNetworkProtocol = (zone, powers) => {
1218
1223
  /**
1219
1224
  * Create a ConnectionHandler that just echoes its packets.
1220
1225
  *
1221
- * @param {import('@agoric/base-zone').Zone} zone
1226
+ * @param {Zone} zone
1222
1227
  */
1223
1228
  export const prepareEchoConnectionKit = zone => {
1224
1229
  const makeEchoConnectionKit = zone.exoClassKit(
@@ -1302,7 +1307,7 @@ export const prepareEchoConnectionKit = zone => {
1302
1307
  /**
1303
1308
  * Create a protocol handler that just connects to itself.
1304
1309
  *
1305
- * @param {import('@agoric/base-zone').Zone} zone
1310
+ * @param {Zone} zone
1306
1311
  * @param {VowTools} powers
1307
1312
  */
1308
1313
  export function prepareLoopbackProtocolHandler(zone, { watch, allVows }) {
@@ -1342,7 +1347,7 @@ export function prepareLoopbackProtocolHandler(zone, { watch, allVows }) {
1342
1347
  * @param {*} _port
1343
1348
  * @param {Endpoint} localAddr
1344
1349
  * @param {Endpoint} remoteAddr
1345
- * @returns {import('@agoric/vow').PromiseVow<AttemptDescription>}}
1350
+ * @returns {PromiseVow<AttemptDescription>}}
1346
1351
  */
1347
1352
  async onConnect(_port, localAddr, remoteAddr) {
1348
1353
  const { listeners } = this.state;
@@ -1460,7 +1465,7 @@ export function prepareLoopbackProtocolHandler(zone, { watch, allVows }) {
1460
1465
 
1461
1466
  /**
1462
1467
  *
1463
- * @param {import('@agoric/base-zone').Zone} zone
1468
+ * @param {Zone} zone
1464
1469
  * @param {Powers} powers
1465
1470
  */
1466
1471
  export const preparePortAllocator = (zone, { watch }) =>
@@ -1540,7 +1545,7 @@ export const preparePortAllocator = (zone, { watch }) =>
1540
1545
  * The reason this functionality wasn't just baked into the other network exos
1541
1546
  * is to maintain upgrade-compatible with minimal additional changes.
1542
1547
  *
1543
- * @param {import('@agoric/base-zone').Zone} zone
1548
+ * @param {Zone} zone
1544
1549
  * @param {VowTools} vowTools
1545
1550
  */
1546
1551
  const prepareFinalizer = (zone, { watch }) => {
@@ -1597,7 +1602,7 @@ const prepareFinalizer = (zone, { watch }) => {
1597
1602
  harden(prepareFinalizer);
1598
1603
 
1599
1604
  /**
1600
- * @param {import('@agoric/base-zone').Zone} zone
1605
+ * @param {Zone} zone
1601
1606
  * @param {VowTools} vowTools
1602
1607
  * @returns {Powers}
1603
1608
  */
package/src/router.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * @import {Endpoint, Port, Protocol, ProtocolHandler} from './types.js';
3
3
  * @import {PromiseVow, Remote, VowTools} from '@agoric/vow';
4
+ * @import {Zone} from '@agoric/base-zone';
5
+ * @import {Powers} from './network.js';
4
6
  */
5
7
  /**
6
8
  * @template T
@@ -17,7 +19,7 @@ export const RouterI: import("@endo/patterns").InterfaceGuard<{
17
19
  register: import("@endo/patterns").MethodGuard;
18
20
  unregister: import("@endo/patterns").MethodGuard;
19
21
  }>;
20
- export function prepareRouter<T>(zone: import("@agoric/base-zone").Zone): () => import("@endo/exo").Guarded<{
22
+ export function prepareRouter<T>(zone: Zone): () => import("@endo/exo").Guarded<{
21
23
  /** @param {Endpoint} addr */
22
24
  getRoutes(addr: Endpoint): [string, T][];
23
25
  /**
@@ -31,16 +33,7 @@ export function prepareRouter<T>(zone: import("@agoric/base-zone").Zone): () =>
31
33
  */
32
34
  unregister(prefix: string, route: T): void;
33
35
  }>;
34
- export function prepareRouterProtocol(zone: import("@agoric/base-zone").Zone, powers: import("./network.js").Powers, E?: ((<T>(x: T) => import("../../../node_modules/@endo/eventual-send/src/E.js").ECallableOrMethods<import("@endo/eventual-send").RemoteFunctions<T>>) & {
35
- readonly get: <T>(x: T) => import("../../../node_modules/@endo/eventual-send/src/E.js").EGetters<import("@endo/eventual-send").LocalRecord<T>>;
36
- readonly resolve: {
37
- (): Promise<void>;
38
- <T>(value: T): Promise<Awaited<T>>;
39
- <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
40
- };
41
- readonly sendOnly: <T>(x: T) => import("../../../node_modules/@endo/eventual-send/src/E.js").ESendOnlyCallableOrMethods<import("@endo/eventual-send").RemoteFunctions<T>>;
42
- readonly when: <T, U = T>(x: T | PromiseLike<T>, onfulfilled?: ((value: T) => import("@endo/eventual-send").ERef<U>) | undefined, onrejected?: ((reason: any) => import("@endo/eventual-send").ERef<U>) | undefined) => Promise<U>;
43
- }) | undefined): () => import("@endo/exo").Guarded<{
36
+ export function prepareRouterProtocol(zone: Zone, powers: Powers, E?: typeof defaultE): () => import("@endo/exo").Guarded<{
44
37
  /**
45
38
  * @param {string[]} paths
46
39
  * @param {Remote<ProtocolHandler>} protocolHandler
@@ -79,7 +72,10 @@ export type RouterProtocol = {
79
72
  registerProtocolHandler: (paths: string[], protocolHandler: ProtocolHandler) => void;
80
73
  unregisterProtocolHandler: (prefix: string, protocolHandler: ProtocolHandler) => void;
81
74
  };
75
+ import type { Zone } from '@agoric/base-zone';
82
76
  import type { Endpoint } from './types.js';
77
+ import type { Powers } from './network.js';
78
+ import { E as defaultE } from '@endo/far';
83
79
  import type { ProtocolHandler } from './types.js';
84
80
  import type { Remote } from '@agoric/vow';
85
81
  import type { Port } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["router.js"],"names":[],"mappings":"AAWA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH;;;;GAIG;AAMI,8BAHM,CAAC,QACH,OAAO,mBAAmB,EAAE,IAAI;IAiBrC,6BAA6B;oBAAjB,QAAQ;IAyBpB;;;OAGG;qBAFQ,MAAM,SACN,CAAC;IAKZ;;;OAGG;uBAFQ,MAAM,SACN,CAAC;GAWjB;AAgBM,4CAJI,OAAO,mBAAmB,EAAE,IAAI,UAChC,OAAO,cAAc,EAAE,MAAM;;;;;;;;gEAjGR,CAAC,+EAItB,CAAC;;IAiIN;;;OAGG;mCAFQ,MAAM,EAAE,mBACR,OAAO,eAAe,CAAC;IAYlC;;;OAGG;sCAFQ,MAAM,mBACN,OAAO,eAAe,CAAC;IAclC,kCAAkC;wBAAtB,QAAQ;GAUzB;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AAC,MAAM,EAAE,MAAM,KAAK,WAAW,IAAI,CAAC;6BACpC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,eAAe,KAAK,IAAI;+BAC3D,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,KAAK,IAAI;;0BA3FjD,mBAAmB;8BAFkB,YAAY;4BAG/C,cAAc;8BATT,WAAW;qCAMmB,YAAY;4BACzB,aAAa;0BADA,YAAY;gCACzB,aAAa"}
package/src/router.js CHANGED
@@ -12,6 +12,8 @@ import { Shape } from './shapes.js';
12
12
  /**
13
13
  * @import {Endpoint, Port, Protocol, ProtocolHandler} from './types.js';
14
14
  * @import {PromiseVow, Remote, VowTools} from '@agoric/vow';
15
+ * @import {Zone} from '@agoric/base-zone';
16
+ * @import {Powers} from './network.js';
15
17
  */
16
18
 
17
19
  /**
@@ -33,7 +35,7 @@ export const RouterI = M.interface('Router', {
33
35
 
34
36
  /**
35
37
  * @template T
36
- * @param {import('@agoric/base-zone').Zone} zone
38
+ * @param {Zone} zone
37
39
  */
38
40
  export const prepareRouter = zone => {
39
41
  const detached = zone.detached();
@@ -107,8 +109,8 @@ export const prepareRouter = zone => {
107
109
  /**
108
110
  * Create a router that behaves like a Protocol.
109
111
  *
110
- * @param {import('@agoric/base-zone').Zone} zone
111
- * @param {import('./network.js').Powers} powers
112
+ * @param {Zone} zone
113
+ * @param {Powers} powers
112
114
  * @param {typeof defaultE} [E] Eventual sender
113
115
  */
114
116
  export const prepareRouterProtocol = (zone, powers, E = defaultE) => {
package/src/shapes.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ export const SendOptionsShape: import("@endo/patterns").Matcher;
1
2
  export namespace Shape {
2
- namespace ConnectionI {
3
+ export namespace ConnectionI {
3
4
  let connection: import("@endo/patterns").InterfaceGuard<{
4
5
  send: import("@endo/patterns").MethodGuard;
5
6
  close: import("@endo/patterns").MethodGuard;
@@ -16,7 +17,7 @@ export namespace Shape {
16
17
  onFulfilled: import("@endo/patterns").MethodGuard;
17
18
  }>;
18
19
  }
19
- namespace InboundAttemptI {
20
+ export namespace InboundAttemptI {
20
21
  export let inboundAttempt: import("@endo/patterns").InterfaceGuard<{
21
22
  accept: import("@endo/patterns").MethodGuard;
22
23
  getLocalAddress: import("@endo/patterns").MethodGuard;
@@ -35,7 +36,7 @@ export namespace Shape {
35
36
  }>;
36
37
  export { sinkWatcher_1 as sinkWatcher };
37
38
  }
38
- namespace PortI {
39
+ export namespace PortI {
39
40
  export let port: import("@endo/patterns").InterfaceGuard<{
40
41
  getLocalAddress: import("@endo/patterns").MethodGuard;
41
42
  addListener: import("@endo/patterns").MethodGuard;
@@ -68,7 +69,7 @@ export namespace Shape {
68
69
  }>;
69
70
  export { sinkWatcher_2 as sinkWatcher };
70
71
  }
71
- namespace ProtocolHandlerI {
72
+ export namespace ProtocolHandlerI {
72
73
  export let protocolHandler: import("@endo/patterns").InterfaceGuard<{
73
74
  onCreate: import("@endo/patterns").MethodGuard;
74
75
  generatePortID: import("@endo/patterns").MethodGuard;
@@ -93,25 +94,25 @@ export namespace Shape {
93
94
  }>;
94
95
  export { rethrowUnlessMissingWatcher_3 as rethrowUnlessMissingWatcher };
95
96
  }
96
- let ProtocolImplI: import("@endo/patterns").InterfaceGuard<{
97
+ export let ProtocolImplI: import("@endo/patterns").InterfaceGuard<{
97
98
  bindPort: import("@endo/patterns").MethodGuard;
98
99
  inbound: import("@endo/patterns").MethodGuard;
99
100
  outbound: import("@endo/patterns").MethodGuard;
100
101
  }>;
101
- function Vow$(shape: any): import("@endo/patterns").Matcher;
102
- let AttemptDescription: import("@endo/patterns").Matcher;
103
- let Opts: import("@endo/patterns").Matcher;
104
- let Data: import("@endo/patterns").Matcher;
105
- let Bytes: import("@endo/patterns").Matcher;
106
- let Endpoint: import("@endo/patterns").Matcher;
107
- let Vow: import("@endo/patterns").Matcher;
108
- let ConnectionHandler: import("@endo/patterns").Matcher;
109
- let Connection: import("@endo/patterns").Matcher;
110
- let InboundAttempt: import("@endo/patterns").Matcher;
111
- let Listener: import("@endo/patterns").Matcher;
112
- let ListenHandler: import("@endo/patterns").Matcher;
113
- let Port: import("@endo/patterns").Matcher;
114
- let ProtocolHandler: import("@endo/patterns").Matcher;
115
- let ProtocolImpl: import("@endo/patterns").Matcher;
102
+ export function Vow$(shape: any): import("@endo/patterns").Matcher;
103
+ export let AttemptDescription: import("@endo/patterns").Matcher;
104
+ export { SendOptionsShape as Opts };
105
+ export let Data: import("@endo/patterns").Matcher;
106
+ export let Bytes: import("@endo/patterns").Matcher;
107
+ export let Endpoint: import("@endo/patterns").Matcher;
108
+ export let Vow: import("@endo/patterns").Matcher;
109
+ export let ConnectionHandler: import("@endo/patterns").Matcher;
110
+ export let Connection: import("@endo/patterns").Matcher;
111
+ export let InboundAttempt: import("@endo/patterns").Matcher;
112
+ export let Listener: import("@endo/patterns").Matcher;
113
+ export let ListenHandler: import("@endo/patterns").Matcher;
114
+ export let Port: import("@endo/patterns").Matcher;
115
+ export let ProtocolHandler: import("@endo/patterns").Matcher;
116
+ export let ProtocolImpl: import("@endo/patterns").Matcher;
116
117
  }
117
118
  //# sourceMappingURL=shapes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["shapes.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BQ,4DAAgC"}
1
+ {"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["shapes.js"],"names":[],"mappings":"AA2BA,gEAGE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIM,mEAAgC"}
package/src/shapes.js CHANGED
@@ -25,6 +25,11 @@ const Shape1 = /** @type {const} */ ({
25
25
  ProtocolImpl: M.remotable('ProtocolImpl'),
26
26
  });
27
27
 
28
+ export const SendOptionsShape = M.splitRecord(
29
+ {},
30
+ { relativeTimeoutNs: M.bigint() },
31
+ );
32
+
28
33
  const Shape2 = /** @type {const} */ ({
29
34
  ...Shape1,
30
35
  Vow$: shape => M.or(shape, Shape1.Vow),
@@ -32,7 +37,7 @@ const Shape2 = /** @type {const} */ ({
32
37
  { handler: Shape1.ConnectionHandler },
33
38
  { remoteAddress: Shape1.Endpoint, localAddress: Shape1.Endpoint },
34
39
  ),
35
- Opts: M.recordOf(M.string(), M.any()),
40
+ Opts: SendOptionsShape,
36
41
  });
37
42
 
38
43
  export const Shape = /** @type {const} */ harden({
package/src/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Rearrange the exo types to make a cast of the methods (M) and init function (I) to a specific type.
3
3
  */
4
- export type ExoClassMethods<M extends import("@endo/exo").Methods, I extends (...args: any[]) => any> = M & ThisType<{
5
- self: import("@endo/exo").Guarded<M>;
4
+ export type ExoClassMethods<M extends Methods, I extends (...args: any[]) => any> = M & ThisType<{
5
+ self: Guarded<M>;
6
6
  state: ReturnType<I>;
7
7
  }>;
8
8
  /**
@@ -87,11 +87,18 @@ export type ListenHandler = {
87
87
  */
88
88
  onRemove?: ((port: Remote<Port>, l: Remote<ListenHandler>) => PromiseVow<void>) | undefined;
89
89
  };
90
+ export type WellKnownSendOptions = {
91
+ /**
92
+ * timeout the packet if an ack is not received by this time
93
+ */
94
+ relativeTimeoutNs?: bigint | undefined;
95
+ };
96
+ export type SendOptions = WellKnownSendOptions & Record<string, any>;
90
97
  export type ConnectionI = {
91
98
  /**
92
99
  * Send a packet on the connection
93
100
  */
94
- send: (packetBytes: Bytes, opts?: Record<string, any>) => PromiseVow<Bytes>;
101
+ send: (packetBytes: Bytes, opts?: SendOptions) => PromiseVow<Bytes>;
95
102
  /**
96
103
  * Close both ends of the connection
97
104
  */
@@ -212,6 +219,8 @@ export type ProtocolImpl = {
212
219
  */
213
220
  outbound: (port: Remote<Port>, remoteAddr: Endpoint, connectionHandler: Remote<ConnectionHandler>) => PromiseVow<Connection>;
214
221
  };
222
+ import type { Methods } from '@endo/exo';
223
+ import type { Guarded } from '@endo/exo';
215
224
  import type { PromiseVow } from '@agoric/vow';
216
225
  import type { RemotableObject } from '@endo/pass-style';
217
226
  import type { Remote } from '@agoric/vow';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;4BAW2C,CAAC,SAA/B,OAAQ,WAAW,EAAE,OAAQ,EACH,CAAC,SAA3B,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAI,IACzB,CAAC,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;;;;oBAK5E,MAAM;;;;;uBAIN,MAAM;;;;;;;;WAML,MAAM,WAAW,IAAI,CAAC;;uBAGvB,eAAe,GAAG,SAAS;;;;;;;;;cAK1B,CAAC,MAAM,EAAE,QAAQ,KAAK,WAAW,IAAI,CAAC;;;;;;;;;;qBAMtC,MAAM,QAAQ;;;;iBAEd,CAAC,aAAa,EAAE,OAAO,aAAa,CAAC,KAAK,WAAW,IAAI,CAAC;;;;aAE1D,CACT,MAAM,EAAE,QAAQ,EAChB,iBAAiB,CAAC,EAAE,OAAO,iBAAiB,CAAC,KAC1C,WAAW,UAAU,CAAC;;;;oBAEhB,CAAC,aAAa,EAAE,OAAO,aAAa,CAAC,KAAK,WAAW,IAAI,CAAC;;;;;YAE1D,MAAM,WAAW,IAAI,CAAC;;;;;;;;;uBAMf,OAAO,IAAI,CAAC,KAAK,OAAO,aAAa,CAAC,KAAK,WAAW,IAAI,CAAC;;;;cAClE,CACT,IAAI,EAAE,OAAO,IAAI,CAAC,EAClB,SAAS,EAAE,QAAQ,EACnB,UAA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4BACzB,aAAa"}
package/src/types.js CHANGED
@@ -6,12 +6,14 @@ export {};
6
6
  /**
7
7
  * @import {Passable, RemotableObject} from '@endo/pass-style';
8
8
  * @import {PromiseVow, Remote} from '@agoric/vow';
9
+ * @import {Methods} from '@endo/exo';
10
+ * @import {Guarded} from '@endo/exo';
9
11
  */
10
12
 
11
13
  /**
12
- * @template {import('@endo/exo').Methods} M
14
+ * @template {Methods} M
13
15
  * @template {(...args: any[]) => any} I
14
- * @typedef {M & ThisType<{ self: import('@endo/exo').Guarded<M>, state: ReturnType<I> }>} ExoClassMethods
16
+ * @typedef {M & ThisType<{ self: Guarded<M>, state: ReturnType<I> }>} ExoClassMethods
15
17
  * Rearrange the exo types to make a cast of the methods (M) and init function (I) to a specific type.
16
18
  */
17
19
 
@@ -78,11 +80,20 @@ export {};
78
80
  * listener has been removed
79
81
  */
80
82
 
83
+ /**
84
+ * @typedef {object} WellKnownSendOptions
85
+ * @property {bigint} [relativeTimeoutNs] timeout the packet if an ack is not received by this time
86
+ */
87
+
88
+ /**
89
+ * @typedef {WellKnownSendOptions & Record<string, any>} SendOptions
90
+ */
91
+
81
92
  /**
82
93
  * @typedef {object} ConnectionI
83
94
  * @property {(
84
95
  * packetBytes: Bytes,
85
- * opts?: Record<string, any>,
96
+ * opts?: SendOptions,
86
97
  * ) => PromiseVow<Bytes>} send
87
98
  * Send a packet on the connection
88
99
  * @property {() => PromiseVow<void>} close Close both ends of the connection