@endo/eventual-send 1.2.1 → 1.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endo/eventual-send",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Extend a Promise class to implement the eventual-send API",
5
5
  "type": "module",
6
6
  "main": "src/no-shim.js",
@@ -10,8 +10,8 @@
10
10
  "test:xs": "exit 0",
11
11
  "build": "exit 0",
12
12
  "clean": "git clean -f '*.d.ts*'",
13
- "build:types": "tsc --build tsconfig.build.json",
14
- "clean:types": "git clean -f '*.d.ts*'",
13
+ "prepack": "tsc --build tsconfig.build.json",
14
+ "postpack": "git clean -f '*.d.ts*'",
15
15
  "lint-fix": "yarn lint:eslint --fix && yarn lint:types",
16
16
  "lint-check": "yarn lint",
17
17
  "lint": "yarn lint:types && yarn lint:eslint",
@@ -36,13 +36,14 @@
36
36
  },
37
37
  "homepage": "https://github.com/endojs/endo#readme",
38
38
  "dependencies": {
39
- "@endo/env-options": "^1.1.3"
39
+ "@endo/env-options": "^1.1.5"
40
40
  },
41
41
  "devDependencies": {
42
- "@endo/lockdown": "^1.0.6",
43
- "ava": "^6.1.2",
42
+ "@endo/lockdown": "^1.0.8",
43
+ "ava": "^6.1.3",
44
44
  "c8": "^7.14.0",
45
- "tsd": "^0.30.7"
45
+ "tsd": "^0.30.7",
46
+ "typescript": "5.5.2"
46
47
  },
47
48
  "keywords": [
48
49
  "eventual send",
@@ -65,12 +66,13 @@
65
66
  },
66
67
  "ava": {
67
68
  "files": [
68
- "test/**/test-*.js"
69
+ "test/**/test-*.*",
70
+ "test/**/*.test.*"
69
71
  ],
70
72
  "timeout": "2m"
71
73
  },
72
74
  "typeCoverage": {
73
75
  "atLeast": 77.81
74
76
  },
75
- "gitHead": "25229bdcc26babb3afe0c229df4283a0f3c105f3"
77
+ "gitHead": "681b813ccb1fa177905dabf2ed3f5f248cb33ce7"
76
78
  }
package/src/E.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  export default makeE;
2
- export type EProxy = ReturnType<(HandledPromise: {
3
- new <R>(executor: import("./handled-promise.js").HandledExecutor<R>, unfulfilledHandler?: import("./handled-promise.js").Handler<Promise<unknown>> | undefined): Promise<R>;
4
- prototype: Promise<unknown>;
5
- } & PromiseConstructor & import("./handled-promise.js").HandledPromiseStaticMethods) => (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
2
+ export type EProxy = ReturnType<(HandledPromise: import("./types").HandledPromiseConstructor) => (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
6
3
  /**
7
4
  * E.get(x) returns a proxy on which you can get arbitrary properties.
8
5
  * Each of these properties returns a promise for the property. The promise
@@ -14,7 +11,7 @@ export type EProxy = ReturnType<(HandledPromise: {
14
11
  * @returns {EGetters<LocalRecord<T>>} property get proxy
15
12
  * @readonly
16
13
  */
17
- readonly get: <T_1>(x: T_1) => EGetters<LocalRecord<T_1>>;
14
+ readonly get: <T>(x: T) => EGetters<LocalRecord<T>>;
18
15
  /**
19
16
  * E.resolve(x) converts x to a handled promise. It is
20
17
  * shorthand for HandledPromise.resolve(x)
@@ -26,8 +23,8 @@ export type EProxy = ReturnType<(HandledPromise: {
26
23
  */
27
24
  readonly resolve: {
28
25
  (): Promise<void>;
29
- <T_2>(value: T_2): Promise<Awaited<T_2>>;
30
- <T_3>(value: T_3 | PromiseLike<T_3>): Promise<Awaited<T_3>>;
26
+ <T>(value: T): Promise<Awaited<T>>;
27
+ <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
31
28
  };
32
29
  /**
33
30
  * E.sendOnly returns a proxy similar to E, but for which the results
@@ -38,7 +35,7 @@ export type EProxy = ReturnType<(HandledPromise: {
38
35
  * @returns {ESendOnlyCallableOrMethods<RemoteFunctions<T>>} method/function call proxy
39
36
  * @readonly
40
37
  */
41
- readonly sendOnly: <T_4>(x: T_4) => ESendOnlyCallableOrMethods<RemoteFunctions<T_4>>;
38
+ readonly sendOnly: <T>(x: T) => ESendOnlyCallableOrMethods<RemoteFunctions<T>>;
42
39
  /**
43
40
  * E.when(x, res, rej) is equivalent to
44
41
  * HandledPromise.resolve(x).then(res, rej)
@@ -51,26 +48,26 @@ export type EProxy = ReturnType<(HandledPromise: {
51
48
  * @returns {Promise<U>}
52
49
  * @readonly
53
50
  */
54
- readonly when: <T_5, U = T_5>(x: T_5 | PromiseLike<T_5>, onfulfilled?: ((value: T_5) => ERef<U>) | undefined, onrejected?: ((reason: any) => ERef<U>) | undefined) => Promise<U>;
51
+ readonly when: <T, U = T>(x: T | PromiseLike<T>, onfulfilled?: ((value: T) => ERef<U>) | undefined, onrejected?: ((reason: any) => ERef<U>) | undefined) => Promise<U>;
55
52
  }>;
56
53
  /**
57
54
  * Creates a type that accepts both near and marshalled references that were
58
55
  * returned from `Remotable` or `Far`, and also promises for such references.
59
56
  */
60
- export type FarRef<Primary, Local = DataOnly<Primary>> = ERef<Local & import('./types').RemotableBrand<Local, Primary>>;
57
+ export type FarRef<Primary, Local = DataOnly<Primary>> = ERef<Local & import("./types").RemotableBrand<Local, Primary>>;
61
58
  /**
62
59
  * `DataOnly<T>` means to return a record type `T2` consisting only of
63
60
  * properties that are *not* functions.
64
61
  */
65
- export type DataOnly<T> = Omit<T, FilteredKeys<T, import('./types').Callable>>;
62
+ export type DataOnly<T> = Omit<T, FilteredKeys<T, import("./types").Callable>>;
66
63
  export type ERef<T> = PromiseLike<T> | T;
67
64
  export type ECallable<T extends import("./types").Callable> = (ReturnType<T> extends PromiseLike<infer U> ? T : (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>);
68
65
  export type EMethods<T> = { readonly [P in keyof T]: T[P] extends import("./types").Callable ? ECallable<T[P]> : never; };
69
66
  export type EGetters<T> = { readonly [P in keyof T]: T[P] extends PromiseLike<infer U> ? T[P] : Promise<Awaited<T[P]>>; };
70
67
  export type ESendOnlyCallable<T extends import("./types").Callable> = (...args: Parameters<T>) => Promise<void>;
71
68
  export type ESendOnlyMethods<T> = { readonly [P in keyof T]: T[P] extends import("./types").Callable ? ESendOnlyCallable<T[P]> : never; };
72
- export type ESendOnlyCallableOrMethods<T> = (T extends import('./types').Callable ? ESendOnlyCallable<T> & ESendOnlyMethods<Required<T>> : ESendOnlyMethods<Required<T>>);
73
- export type ECallableOrMethods<T> = (T extends import('./types').Callable ? ECallable<T> & EMethods<Required<T>> : EMethods<Required<T>>);
69
+ export type ESendOnlyCallableOrMethods<T> = (T extends import("./types").Callable ? ESendOnlyCallable<T> & ESendOnlyMethods<Required<T>> : ESendOnlyMethods<Required<T>>);
70
+ export type ECallableOrMethods<T> = (T extends import("./types").Callable ? ECallable<T> & EMethods<Required<T>> : EMethods<Required<T>>);
74
71
  /**
75
72
  * Return a union of property names/symbols/numbers P for which the record element T[P]'s type extends U.
76
73
  *
@@ -86,25 +83,25 @@ export type FilteredKeys<T, U> = { [P in keyof T]: T[P] extends U ? P : never; }
86
83
  * `PickCallable<T>` means to return a single root callable or a record type
87
84
  * consisting only of properties that are functions.
88
85
  */
89
- export type PickCallable<T> = (T extends import('./types').Callable ? (...args: Parameters<T>) => ReturnType<T> : Pick<T, FilteredKeys<T, import('./types').Callable>>);
86
+ export type PickCallable<T> = (T extends import("./types").Callable ? (...args: Parameters<T>) => ReturnType<T> : Pick<T, FilteredKeys<T, import("./types").Callable>>);
90
87
  /**
91
88
  * `RemoteFunctions<T>` means to return the functions and properties that are remotely callable.
92
89
  */
93
- export type RemoteFunctions<T> = T extends import("./types").RemotableBrand<infer L, infer R> ? PickCallable<R> : Awaited<T> extends import("./types").RemotableBrand<infer L_1, infer R_1> ? PickCallable<R_1> : T extends PromiseLike<infer U> ? Awaited<T> : T;
94
- export type LocalRecord<T> = T extends import("./types").RemotableBrand<infer L, infer R> ? L : Awaited<T> extends import("./types").RemotableBrand<infer L_1, infer R_1> ? L_1 : T extends PromiseLike<infer U> ? Awaited<T> : T;
90
+ export type RemoteFunctions<T> = (T extends import("./types").RemotableBrand<infer L, infer R> ? PickCallable<R> : Awaited<T> extends import("./types").RemotableBrand<infer L, infer R> ? PickCallable<R> : T extends PromiseLike<infer U> ? Awaited<T> : T);
91
+ export type LocalRecord<T> = (T extends import("./types").RemotableBrand<infer L, infer R> ? L : Awaited<T> extends import("./types").RemotableBrand<infer L, infer R> ? L : T extends PromiseLike<infer U> ? Awaited<T> : T);
95
92
  export type EPromiseKit<R = unknown> = {
96
93
  promise: Promise<R>;
97
- settler: import('./types').Settler<R>;
94
+ settler: import("./types").Settler<R>;
98
95
  };
99
96
  /**
100
97
  * Type for an object that must only be invoked with E. It supports a given
101
98
  * interface but declares all the functions as asyncable.
102
99
  */
103
- export type EOnly<T> = T extends import("./types").Callable ? (...args: Parameters<T>) => ERef<Awaited<EOnly<ReturnType<T>>>> : T extends Record<PropertyKey, import("./types").Callable> ? { [K in keyof T]: T[K] extends import("./types").Callable ? (...args: Parameters<T[K]>) => ERef<Awaited<EOnly<ReturnType<T[K]>>>> : T[K]; } : T;
100
+ export type EOnly<T> = (T extends import("./types").Callable ? (...args: Parameters<T>) => ERef<Awaited<EOnly<ReturnType<T>>>> : T extends Record<PropertyKey, import("./types").Callable> ? { [K in keyof T]: T[K] extends import("./types").Callable ? (...args: Parameters<T[K]>) => ERef<Awaited<EOnly<ReturnType<T[K]>>>> : T[K]; } : T);
104
101
  /**
105
102
  * @param {import('./types').HandledPromiseConstructor} HandledPromise
106
103
  */
107
- declare function makeE(HandledPromise: import('./types').HandledPromiseConstructor): (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
104
+ declare function makeE(HandledPromise: import("./types").HandledPromiseConstructor): (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
108
105
  /**
109
106
  * E.get(x) returns a proxy on which you can get arbitrary properties.
110
107
  * Each of these properties returns a promise for the property. The promise
@@ -116,7 +113,7 @@ declare function makeE(HandledPromise: import('./types').HandledPromiseConstruct
116
113
  * @returns {EGetters<LocalRecord<T>>} property get proxy
117
114
  * @readonly
118
115
  */
119
- readonly get: <T_1>(x: T_1) => EGetters<LocalRecord<T_1>>;
116
+ readonly get: <T>(x: T) => EGetters<LocalRecord<T>>;
120
117
  /**
121
118
  * E.resolve(x) converts x to a handled promise. It is
122
119
  * shorthand for HandledPromise.resolve(x)
@@ -128,8 +125,8 @@ declare function makeE(HandledPromise: import('./types').HandledPromiseConstruct
128
125
  */
129
126
  readonly resolve: {
130
127
  (): Promise<void>;
131
- <T_2>(value: T_2): Promise<Awaited<T_2>>;
132
- <T_3>(value: T_3 | PromiseLike<T_3>): Promise<Awaited<T_3>>;
128
+ <T>(value: T): Promise<Awaited<T>>;
129
+ <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
133
130
  };
134
131
  /**
135
132
  * E.sendOnly returns a proxy similar to E, but for which the results
@@ -140,7 +137,7 @@ declare function makeE(HandledPromise: import('./types').HandledPromiseConstruct
140
137
  * @returns {ESendOnlyCallableOrMethods<RemoteFunctions<T>>} method/function call proxy
141
138
  * @readonly
142
139
  */
143
- readonly sendOnly: <T_4>(x: T_4) => ESendOnlyCallableOrMethods<RemoteFunctions<T_4>>;
140
+ readonly sendOnly: <T>(x: T) => ESendOnlyCallableOrMethods<RemoteFunctions<T>>;
144
141
  /**
145
142
  * E.when(x, res, rej) is equivalent to
146
143
  * HandledPromise.resolve(x).then(res, rej)
@@ -153,6 +150,6 @@ declare function makeE(HandledPromise: import('./types').HandledPromiseConstruct
153
150
  * @returns {Promise<U>}
154
151
  * @readonly
155
152
  */
156
- readonly when: <T_5, U = T_5>(x: T_5 | PromiseLike<T_5>, onfulfilled?: ((value: T_5) => ERef<U>) | undefined, onrejected?: ((reason: any) => ERef<U>) | undefined) => Promise<U>;
153
+ readonly when: <T, U = T>(x: T | PromiseLike<T>, onfulfilled?: ((value: T) => ERef<U>) | undefined, onrejected?: ((reason: any) => ERef<U>) | undefined) => Promise<U>;
157
154
  };
158
155
  //# sourceMapping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AAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC/D,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,SAAS,EAAE,QAAQ,CAAC,GACzD,GACG,CAAY,IAAP,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,SAAS,EAAE,QAAQ,GACnD,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACrE,CAAC,CAAC,CAAC,CAAC,GACT,GACD,CAAC,CACN;AAnPJ;;GAEG;AACH,uCAFW,OAAO,SAAS,EAAE,yBAAyB,KAUnC,CAAC,KACH,CAAC,KACC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAIjD;;;;;;;;;;OAUG;mBAJU,CAAC,KACH,CAAC,KACC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAQrC;;;;;;;;OAQG;;;;;;IAGH;;;;;;;;OAQG;wBAJU,CAAC,KACH,CAAC,KACC,0BAA0B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAQ3D;;;;;;;;;;;OAWG;oBAPU,CAAC,EACA,CAAC,SACJ,CAAC,GAAC,WAAW,CAAC,CAAC,CAAC,yBACR,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,sCACZ,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,kBACtB,OAAO,CAAC,CAAC,CAAC;EAU9B"}
package/src/E.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { trackTurns } from './track-turns.js';
2
2
  import { makeMessageBreakpointTester } from './message-breakpoints.js';
3
3
 
4
- const { details: X, quote: q, Fail } = assert;
4
+ const { details: X, quote: q, Fail, error: makeError } = assert;
5
5
  const { assign, create } = Object;
6
6
 
7
7
  const onSend = makeMessageBreakpointTester('ENDO_SEND_BREAKPOINTS');
@@ -52,7 +52,7 @@ const makeEProxyHandler = (recipient, HandledPromise) =>
52
52
  if (this !== receiver) {
53
53
  // Reject the async function call
54
54
  return HandledPromise.reject(
55
- assert.error(
55
+ makeError(
56
56
  X`Unexpected receiver for "${q(propertyKey)}" method of E(${q(
57
57
  recipient,
58
58
  )})`,
@@ -1 +1 @@
1
- {"version":3,"file":"handled-promise.d.ts","sourceRoot":"","sources":["handled-promise.js"],"names":[],"mappings":"AAyDO;SAsIyG,CAAC,qDAArC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;eAA0B,OAAO,CAAC,OAAO,CAAC;qDAoY9I;oBAU4B,CAAC,IANjB;IACZ,GAAO,CAAC,CAAC,CAAC,EAKkB,CAAC,AALhB,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACzE,WAAe,CAAC,CAAC,CAAC,EAIU,CAAC,AAJR,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD,aAAiB,CAAC,CAAC,CAAC,EAGQ,CAAC,AAHN,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACjF,qBAAyB,CAAC,CAAC,CAAC,EAEA,CAAC,AAFE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACxD,WAAe,CAAC,CAAC,CAAC,EACU,CAAC,AADR,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAC9G,mBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAA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AC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9D,WAAe,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;CACvD;wCAGU,UAAU,CAAC,OAAO,kBAAkB,CAAC"}
@@ -9,7 +9,7 @@ import {
9
9
  } from './local.js';
10
10
  import { makePostponedHandler } from './postponed.js';
11
11
 
12
- const { Fail, details: X, quote: q } = assert;
12
+ const { Fail, details: X, quote: q, note: annotateError } = assert;
13
13
 
14
14
  const {
15
15
  create,
@@ -337,7 +337,7 @@ export const makeHandledPromise = () => {
337
337
  handledResolve(resolvedTarget);
338
338
  return resolvedTarget;
339
339
  } catch (e) {
340
- assert.note(e, X`during resolveWithPresence`);
340
+ annotateError(e, X`during resolveWithPresence`);
341
341
  handledReject(e);
342
342
  throw e;
343
343
  }
@@ -6,14 +6,14 @@ export function makeMessageBreakpointTester(optionName: string): MessageBreakpoi
6
6
  * prefix. For objects defined with `Far` this is the first argument,
7
7
  * known as the `farName`. For exos, this is the tag.
8
8
  */
9
- export type MatchStringTag = string | '*';
9
+ export type MatchStringTag = string | "*";
10
10
  /**
11
11
  * A star `'*'` matches any method name. Otherwise, the string is
12
12
  * matched against the method name. Currently, this is only an exact match.
13
13
  * However, beware that we may introduce a string syntax for
14
14
  * symbol method names.
15
15
  */
16
- export type MatchMethodName = string | '*';
16
+ export type MatchMethodName = string | "*";
17
17
  /**
18
18
  * A star `'*'` will always breakpoint. Otherwise, the string
19
19
  * must be a non-negative integer. Once that is zero, always breakpoint.
@@ -21,7 +21,7 @@ export type MatchMethodName = string | '*';
21
21
  * In other words, the countdown represents the number of
22
22
  * breakpoint occurrences to skip before actually breakpointing.
23
23
  */
24
- export type MatchCountdown = number | '*';
24
+ export type MatchCountdown = number | "*";
25
25
  /**
26
26
  * This is the external JSON representation, in which
27
27
  * - the outer property name is the class-like tag or '*',
package/src/no-shim.d.ts CHANGED
@@ -1,17 +1,27 @@
1
- export const E: (<T>(x: T) => import("./E.js").ECallableOrMethods<import("./E.js").RemoteFunctions<T>>) & {
2
- readonly get: <T_1>(x: T_1) => import("./E.js").EGetters<import("./E.js").LocalRecord<T_1>>;
1
+ export const E: (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
2
+ readonly get: <T>(x: T) => EGetters<LocalRecord<T>>;
3
3
  readonly resolve: {
4
4
  (): Promise<void>;
5
- <T_2>(value: T_2): Promise<Awaited<T_2>>;
6
- <T_3>(value: T_3 | PromiseLike<T_3>): Promise<Awaited<T_3>>;
5
+ <T>(value: T): Promise<Awaited<T>>;
6
+ <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
7
7
  };
8
- readonly sendOnly: <T_4>(x: T_4) => import("./E.js").ESendOnlyCallableOrMethods<import("./E.js").RemoteFunctions<T_4>>;
9
- readonly when: <T_5, U = T_5>(x: T_5 | PromiseLike<T_5>, onfulfilled?: ((value: T_5) => import("./E.js").ERef<U>) | undefined, onrejected?: ((reason: any) => import("./E.js").ERef<U>) | undefined) => Promise<U>;
8
+ readonly sendOnly: <T>(x: T) => ESendOnlyCallableOrMethods<RemoteFunctions<T>>;
9
+ readonly when: <T, U = T>(x: T | PromiseLike<T>, onfulfilled?: ((value: T) => ERef<U>) | undefined, onrejected?: ((reason: any) => ERef<U>) | undefined) => Promise<U>;
10
10
  };
11
11
  export { hp as HandledPromise };
12
12
  export * from "./exports.js";
13
+ import type { ECallableOrMethods } from './E.js';
14
+ import type { RemoteFunctions } from './E.js';
15
+ import type { EGetters } from './E.js';
16
+ import type { LocalRecord } from './E.js';
17
+ import type { ESendOnlyCallableOrMethods } from './E.js';
18
+ import type { ERef } from './E.js';
19
+ /** @import {Handler, HandledExecutor} from './handled-promise.js' */
20
+ /** @import {ECallableOrMethods, EGetters, ERef, ERemoteFunctions, ESendOnlyCallableOrMethods, LocalRecord, RemoteFunctions} from './E.js' */
13
21
  declare const hp: {
14
- new <R>(executor: import("./handled-promise.js").HandledExecutor<R>, unfulfilledHandler?: import("./handled-promise.js").Handler<Promise<unknown>> | undefined): Promise<R>;
22
+ new <R>(executor: HandledExecutor<R>, unfulfilledHandler?: Handler<Promise<unknown>>): Promise<R>;
15
23
  prototype: Promise<unknown>;
16
24
  } & PromiseConstructor & import("./handled-promise.js").HandledPromiseStaticMethods;
25
+ import type { HandledExecutor } from './handled-promise.js';
26
+ import type { Handler } from './handled-promise.js';
17
27
  //# sourceMappingURL=no-shim.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-shim.d.ts","sourceRoot":"","sources":["no-shim.js"],"names":[],"mappings":"AAGA;;;;;;;;;EAA2B;;;AAD3B;;;oFAA0B"}
1
+ {"version":3,"file":"no-shim.d.ts","sourceRoot":"","sources":["no-shim.js"],"names":[],"mappings":"AAOA;;;;;;;;;EAA2B;;;wCAHuG,QAAQ;qCAAR,QAAQ;8BAAR,QAAQ;iCAAR,QAAQ;gDAAR,QAAQ;0BAAR,QAAQ;AAD1I,qEAAqE;AACrE,6IAA6I;AAE7I;;;oFAA0B;qCAHkB,sBAAsB;6BAAtB,sBAAsB"}
package/src/no-shim.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import makeE from './E.js';
2
2
 
3
+ // XXX module exports for HandledPromise fail if these aren't in scope
4
+ /** @import {Handler, HandledExecutor} from './handled-promise.js' */
5
+ /** @import {ECallableOrMethods, EGetters, ERef, ERemoteFunctions, ESendOnlyCallableOrMethods, LocalRecord, RemoteFunctions} from './E.js' */
6
+
3
7
  const hp = HandledPromise;
4
8
  export const E = makeE(hp);
5
9
  export { hp as HandledPromise };
@@ -1,2 +1,2 @@
1
- export function makePostponedHandler(HandledPromise: import('./types').HandledPromiseConstructor): [Required<import('./types').Handler<any>>, () => void];
1
+ export function makePostponedHandler(HandledPromise: import("./types").HandledPromiseConstructor): [Required<import("./types").Handler<any>>, () => void];
2
2
  //# sourceMappingURL=postponed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"track-turns.d.ts","sourceRoot":"","sources":["track-turns.js"],"names":[],"mappings":"AAwFO,2BAFM,CAAC,uCAmBb;;;;;4BAMY,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,SAAS"}
1
+ {"version":3,"file":"track-turns.d.ts","sourceRoot":"","sources":["track-turns.js"],"names":[],"mappings":"AA2FO,2BAJwB,CAAC,SAAlB,aAAa,EAAG,SACnB,CAAC,GACC,CAAC,CAmBb;;;;;4BAMY,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,SAAS"}
@@ -5,7 +5,10 @@ import {
5
5
  } from '@endo/env-options';
6
6
 
7
7
  // NOTE: We can't import these because they're not in scope before lockdown.
8
- // import { assert, details as X, Fail } from '@agoric/assert';
8
+ // We also cannot currently import them because it would create a cyclic
9
+ // dependency, though this is more easily fixed.
10
+ // import { assert, X, Fail } from '@endo/errors';
11
+ // See also https://github.com/Agoric/agoric-sdk/issues/9515
9
12
 
10
13
  // WARNING: Global Mutable State!
11
14
  // This state is communicated to `assert` that makes it available to the
@@ -33,7 +36,7 @@ const ENABLED =
33
36
 
34
37
  const addRejectionNote = detailsNote => reason => {
35
38
  if (reason instanceof Error) {
36
- assert.note(reason, detailsNote);
39
+ globalThis.assert.note(reason, detailsNote);
37
40
  }
38
41
  if (VERBOSE) {
39
42
  console.log('REJECTED at top of event loop', reason);
@@ -52,7 +55,7 @@ const wrapFunction =
52
55
  result = func(...args);
53
56
  } catch (err) {
54
57
  if (err instanceof Error) {
55
- assert.note(
58
+ globalThis.assert.note(
56
59
  err,
57
60
  X`Thrown from: ${hiddenPriorError}:${hiddenCurrentTurn}.${hiddenCurrentEvent}`,
58
61
  );
@@ -90,14 +93,14 @@ export const trackTurns = funcs => {
90
93
  if (!ENABLED || typeof globalThis === 'undefined' || !globalThis.assert) {
91
94
  return funcs;
92
95
  }
93
- const { details: X } = assert;
96
+ const { details: X, note: annotateError } = globalThis.assert;
94
97
 
95
98
  hiddenCurrentEvent += 1;
96
99
  const sendingError = Error(
97
100
  `Event: ${hiddenCurrentTurn}.${hiddenCurrentEvent}`,
98
101
  );
99
102
  if (hiddenPriorError !== undefined) {
100
- assert.note(sendingError, X`Caused by: ${hiddenPriorError}`);
103
+ annotateError(sendingError, X`Caused by: ${hiddenPriorError}`);
101
104
  }
102
105
 
103
106
  return /** @type {T} */ (