@agoric/async-flow 0.1.1-upgrade-16-dev-d45b478.0 → 0.1.1-upgrade-17-dev-3b97a9f.0

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.
Files changed (46) hide show
  1. package/index.d.ts +2 -0
  2. package/index.js +2 -0
  3. package/package.json +20 -19
  4. package/src/async-flow.d.ts +19 -12
  5. package/src/async-flow.d.ts.map +1 -1
  6. package/src/async-flow.js +31 -16
  7. package/src/bijection.d.ts +7 -4
  8. package/src/bijection.d.ts.map +1 -1
  9. package/src/bijection.js +90 -15
  10. package/src/convert.d.ts +1 -0
  11. package/src/convert.d.ts.map +1 -1
  12. package/src/convert.js +7 -5
  13. package/src/endowments.d.ts +16 -0
  14. package/src/endowments.d.ts.map +1 -0
  15. package/src/endowments.js +294 -0
  16. package/src/ephemera.d.ts +1 -0
  17. package/src/ephemera.d.ts.map +1 -1
  18. package/src/ephemera.js +4 -0
  19. package/src/equate.js +4 -4
  20. package/src/log-store.d.ts +4 -2
  21. package/src/log-store.d.ts.map +1 -1
  22. package/src/log-store.js +5 -1
  23. package/src/replay-membrane.d.ts +19 -50
  24. package/src/replay-membrane.d.ts.map +1 -1
  25. package/src/replay-membrane.js +218 -18
  26. package/src/type-guards.d.ts.map +1 -1
  27. package/src/type-guards.js +21 -7
  28. package/src/types.d.ts +211 -60
  29. package/src/types.js +1 -164
  30. package/test/async-flow-crank.test.js +6 -0
  31. package/test/async-flow-early-completion.test.js +2 -0
  32. package/test/async-flow-no-this.js +6 -0
  33. package/test/async-flow.test.js +5 -2
  34. package/test/bad-host.test.js +5 -0
  35. package/test/bijection.test.js +12 -6
  36. package/test/convert.test.js +5 -0
  37. package/test/endowments.test.js +157 -0
  38. package/test/equate.test.js +6 -2
  39. package/test/log-store.test.js +9 -1
  40. package/test/replay-membrane-eventual.test.js +134 -8
  41. package/test/replay-membrane-settlement.test.js +24 -5
  42. package/test/replay-membrane-zombie.test.js +43 -14
  43. package/test/replay-membrane.test.js +39 -13
  44. package/test/types.test-d.ts +73 -0
  45. package/tsconfig.json +2 -0
  46. package/src/types.d.ts.map +0 -1
@@ -0,0 +1,294 @@
1
+ import { Fail } from '@endo/errors';
2
+ import { E } from '@endo/eventual-send';
3
+ import { isPromise } from '@endo/promise-kit';
4
+ import { isRemotable, isPassable, GET_METHOD_NAMES } from '@endo/pass-style';
5
+ import { M, objectMap } from '@endo/patterns';
6
+ import { prepareVowTools, toPassableCap } from '@agoric/vow';
7
+ import { isVow } from '@agoric/vow/src/vow-utils.js';
8
+ import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
9
+ import { PropertyKeyShape } from './type-guards.js';
10
+
11
+ /**
12
+ * @import {RemotableObject} from '@endo/pass-style'
13
+ * @import {Zone} from '@agoric/base-zone'
14
+ * @import {Callable} from '@agoric/internal'
15
+ * @import {PreparationOptions} from '../src/types.js'
16
+ */
17
+
18
+ /**
19
+ * @typedef {'promise' | 'storable' | 'far' | 'function' | 'array' | 'record' | 'state'} EndowmentKind
20
+ */
21
+
22
+ const {
23
+ getOwnPropertyDescriptor,
24
+ getOwnPropertyDescriptors,
25
+ create,
26
+ fromEntries,
27
+ entries,
28
+ prototype: objectPrototype,
29
+ } = Object;
30
+ const { ownKeys } = Reflect;
31
+
32
+ const FunctionWrapperI = M.interface('FunctionWrapper', {
33
+ apply: M.call(M.array()).returns(M.any()),
34
+ });
35
+
36
+ const StateAccessorI = M.interface('StateAccessor', {
37
+ get: M.call(PropertyKeyShape).returns(M.any()),
38
+ set: M.call(PropertyKeyShape, M.any()).returns(),
39
+ });
40
+
41
+ const UnwrapperI = M.interface('Unwrapper', {
42
+ unwrap: M.call(M.remotable('guestWrapped')).returns(M.raw()),
43
+ });
44
+
45
+ export const forwardingMethods = rem => {
46
+ const keys = rem[GET_METHOD_NAMES]();
47
+ const makeMethodEntry = key =>
48
+ entries({
49
+ [key](...args) {
50
+ return rem[key](...args);
51
+ },
52
+ })[0];
53
+ return fromEntries(keys.map(makeMethodEntry));
54
+ };
55
+
56
+ /**
57
+ * Given a possibly mutable (and therefore unhardened) record, return a
58
+ * corresponding state record that acts identically for normal
59
+ * gets and sets, but is implemented using accessors, so it will be recognized
60
+ * as a state record.
61
+ *
62
+ * @template { string | number | symbol } K
63
+ * @template {Record<K, any>} R
64
+ * @param {R} dataRecord
65
+ * @returns {R}
66
+ */
67
+ export const makeSharedStateRecord = dataRecord =>
68
+ harden(
69
+ create(
70
+ objectPrototype,
71
+ fromEntries(
72
+ ownKeys(dataRecord).flatMap(key =>
73
+ entries(
74
+ getOwnPropertyDescriptors({
75
+ get [key]() {
76
+ return dataRecord[key];
77
+ },
78
+ set [key](newValue) {
79
+ dataRecord[key] = newValue;
80
+ },
81
+ }),
82
+ ),
83
+ ),
84
+ ),
85
+ ),
86
+ );
87
+
88
+ /**
89
+ * @param {Zone} outerZone
90
+ * @param {PreparationOptions} [outerOptions]
91
+ */
92
+ export const prepareEndowmentTools = (outerZone, outerOptions = {}) => {
93
+ const { vowTools = prepareVowTools(outerZone) } = outerOptions;
94
+ const { makeVowKit } = vowTools;
95
+
96
+ const functionUnwrapper = outerZone.exo('FunctionUnwrapper', UnwrapperI, {
97
+ unwrap(guestWrapped) {
98
+ const unwrapped = (...args) => guestWrapped.apply(args);
99
+ return harden(unwrapped);
100
+ },
101
+ });
102
+
103
+ const makeStateUnwrapper = outerZone.exoClass(
104
+ 'StateUnwrapper',
105
+ UnwrapperI,
106
+ keys => ({ keys }),
107
+ {
108
+ unwrap(guestWrapped) {
109
+ const { state } = this;
110
+ const { keys } = state;
111
+ return harden(
112
+ create(
113
+ objectPrototype,
114
+ fromEntries(
115
+ keys.flatMap(key =>
116
+ entries(
117
+ getOwnPropertyDescriptors({
118
+ get [key]() {
119
+ return guestWrapped.get(key);
120
+ },
121
+ set [key](newValue) {
122
+ guestWrapped.set(key, newValue);
123
+ },
124
+ }),
125
+ ),
126
+ ),
127
+ ),
128
+ ),
129
+ );
130
+ },
131
+ },
132
+ );
133
+
134
+ /**
135
+ * Endowment taxonomy. Expected to grow over time.
136
+ * Defined within `prepareEndowmentTools` because isStorable depends on zone.
137
+ *
138
+ * @param {unknown} e
139
+ * @returns {EndowmentKind}
140
+ */
141
+ const endowmentKindOf = e => {
142
+ harden(e);
143
+ if (isPromise(e)) {
144
+ return 'promise';
145
+ } else if (outerZone.isStorable(e)) {
146
+ return 'storable';
147
+ } else if (isPassable(e) && isRemotable(e)) {
148
+ return 'far';
149
+ } else if (typeof e === 'function') {
150
+ return 'function';
151
+ } else if (typeof e === 'object') {
152
+ if (e === null) {
153
+ throw Fail`internal: null is always storable`;
154
+ }
155
+ if (Array.isArray(e)) {
156
+ return 'array';
157
+ }
158
+ const keys = ownKeys(e);
159
+ keys.length >= 1 || Fail`empty record should be storable ${e}`;
160
+ const desc = /** @type {PropertyDescriptor} */ (
161
+ getOwnPropertyDescriptor(e, keys[0])
162
+ );
163
+ if ('value' in desc) {
164
+ return 'record';
165
+ } else {
166
+ 'get' in desc || Fail`internal: unexpected descriptor ${desc}`;
167
+ return 'state';
168
+ }
169
+ } else {
170
+ throw Fail`unexpected endowment ${e}`;
171
+ }
172
+ };
173
+ harden(endowmentKindOf);
174
+
175
+ const unwrapMap = outerZone.weakMapStore('unwrapMap', {
176
+ keyShape: M.remotable('wrapped'),
177
+ valueShape: M.remotable('unwrapper'),
178
+ });
179
+
180
+ const unwrapMapHas = k => {
181
+ if (isVow(k) || isRemotable(k)) {
182
+ return unwrapMap.has(toPassableCap(k));
183
+ } else {
184
+ return false;
185
+ }
186
+ };
187
+ const unwrapMapGet = k => unwrapMap.get(toPassableCap(k));
188
+ const unwrapMapSet = (k, v) => {
189
+ const k2 = toPassableCap(k);
190
+ if (unwrapMapHas(k)) {
191
+ unwrapMap.set(k2, v);
192
+ } else {
193
+ unwrapMap.init(k2, v);
194
+ }
195
+ };
196
+
197
+ /**
198
+ * @param {Zone} zone
199
+ * @param {string} tag
200
+ * @param {unknown} e
201
+ */
202
+ const prepareEndowment = (zone, tag, e) => {
203
+ const eKind = endowmentKindOf(e);
204
+ switch (eKind) {
205
+ case 'promise': {
206
+ const p = /** @type {Promise} */ (e);
207
+ // Not using watch or watchPromise because upgrade rejection
208
+ // should leave it to be resolved by the next promise endowment
209
+ const { vow, resolver } = makeVowKit();
210
+ void E.when(
211
+ p,
212
+ v => {
213
+ resolver.resolve(v);
214
+ },
215
+ reason => {
216
+ if (!isUpgradeDisconnection(reason)) {
217
+ resolver.reject(reason);
218
+ }
219
+ },
220
+ );
221
+ return vow;
222
+ }
223
+ case 'storable': {
224
+ return e;
225
+ }
226
+ case 'far': {
227
+ const r = /** @type {RemotableObject} */ (e);
228
+ const methods = forwardingMethods(r);
229
+ return zone.exo(
230
+ tag,
231
+ M.interface('FarWrapped', {}, { defaultGuards: 'raw' }),
232
+ methods,
233
+ );
234
+ }
235
+ case 'function': {
236
+ const f = /** @type {Callable} */ (e);
237
+ const wrapped = zone.exo(tag, FunctionWrapperI, {
238
+ apply(args) {
239
+ return f(...args);
240
+ },
241
+ });
242
+ unwrapMapSet(wrapped, functionUnwrapper);
243
+ return wrapped;
244
+ }
245
+ case 'array': {
246
+ const a = /** @type {unknown[]} */ (e);
247
+ const subZone = zone.subZone(tag);
248
+ return a.map((subE, i) => prepareEndowment(subZone, `${i}`, subE));
249
+ }
250
+ case 'record': {
251
+ const r = /** @type {Record<PropertyKey, unknown>} */ (e);
252
+ const subZone = zone.subZone(tag);
253
+ return objectMap(r, (subE, k) =>
254
+ prepareEndowment(subZone, String(k), subE),
255
+ );
256
+ }
257
+ case 'state': {
258
+ const state = /** @type {Record<PropertyKey, unknown>} */ (e);
259
+ const keys = harden(ownKeys(state));
260
+ const wrapped = zone.exo(tag, StateAccessorI, {
261
+ get(key) {
262
+ return state[key];
263
+ },
264
+ set(key, newValue) {
265
+ state[key] = newValue;
266
+ },
267
+ });
268
+ const stateUnwrapper = makeStateUnwrapper(keys);
269
+ // Need to replace the instance because the keys may be different
270
+ unwrapMapSet(wrapped, stateUnwrapper);
271
+ return wrapped;
272
+ }
273
+ default: {
274
+ throw Fail`unexpected endowment ${e}`;
275
+ }
276
+ }
277
+ };
278
+
279
+ const unwrap = (wrapped, guestWrapped) => {
280
+ if (unwrapMapHas(wrapped)) {
281
+ const unwrapper = unwrapMapGet(wrapped);
282
+ return unwrapper.unwrap(guestWrapped);
283
+ } else {
284
+ return guestWrapped;
285
+ }
286
+ };
287
+
288
+ return harden({ prepareEndowment, unwrap });
289
+ };
290
+ harden(prepareEndowmentTools);
291
+
292
+ /**
293
+ * @typedef {ReturnType<prepareEndowmentTools>} EndowmentTools
294
+ */
package/src/ephemera.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export function makeEphemera<S extends WeakKey = WeakKey, V extends unknown = any>(reinit: (self: S) => V): Ephemera<S, V>;
2
+ import type { Ephemera } from './types.js';
2
3
  //# sourceMappingURL=ephemera.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ephemera.d.ts","sourceRoot":"","sources":["ephemera.js"],"names":[],"mappings":"AAkBO,6BAFe,CAAC,4BAAC,CAAC,gCADd,CAAC,IAAI,EACM,CAAC,AADJ,KACK,CAAC,AADA,GACZ,QAAQ,CAAC,CAAC,EAAC,CAAC,CAAC,CAiBzB"}
1
+ {"version":3,"file":"ephemera.d.ts","sourceRoot":"","sources":["ephemera.js"],"names":[],"mappings":"AAsBO,6BALiB,CAAC,SAAX,OAAQ,YACF,CAAC,gCACV,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GACZ,SAAS,CAAC,EAAC,CAAC,CAAC,CAiBzB;8BApC0B,YAAY"}
package/src/ephemera.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @import {Ephemera} from './types.js';
3
+ */
4
+
1
5
  /**
2
6
  * Used by a possibly-durable exo to store per-instance ephemeral state.
3
7
  * Each ephemera is created at the exo class prepare level, and then
package/src/equate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Fail, X, annotateError, q } from '@endo/errors';
2
2
  import { throwLabeled } from '@endo/common/throw-labeled.js';
3
3
  import { getTag, isObject, passStyleOf } from '@endo/pass-style';
4
- import { isVow } from '@agoric/vow/src/vow-utils.js';
5
4
  import { recordNames } from '@endo/marshal';
5
+ import { isVow } from '@agoric/vow/src/vow-utils.js';
6
6
 
7
7
  const { is } = Object;
8
8
 
@@ -46,7 +46,7 @@ export const makeEquate = bijection => {
46
46
  // `init` does not yet do enough checking anyway. For this case,
47
47
  // we should ensure that h is a host wrapper of a guest promise,
48
48
  // which is a wrapping we don't yet support.
49
- // bijection.init(g, h);
49
+ // bijection.unwrapInit(g, h);
50
50
  // return;
51
51
  }
52
52
  const hPassStyle = passStyleOf(h);
@@ -98,7 +98,7 @@ export const makeEquate = bijection => {
98
98
  // `init` does not yet do enough checking anyway. For this case,
99
99
  // we should ensure that h is a host wrapper of a guest remotable,
100
100
  // which is a wrapping we don't yet support.
101
- // bijection.init(g, h);
101
+ // bijection.unwrapInit(g, h);
102
102
  // return;
103
103
  }
104
104
  case 'promise': {
@@ -110,7 +110,7 @@ export const makeEquate = bijection => {
110
110
  // `init` does not yet do enough checking anyway. For this case,
111
111
  // we should ensure that h is a host wrapper of a guest promise,
112
112
  // which is a wrapping we don't yet support.
113
- // bijection.init(g, h);
113
+ // bijection.unwrapInit(g, h);
114
114
  // return;
115
115
  }
116
116
  default: {
@@ -7,7 +7,7 @@ export function prepareLogStore(zone: Zone): () => import("@endo/exo").Guarded<{
7
7
  peekEntry(): LogEntry;
8
8
  nextEntry(): LogEntry;
9
9
  pushEntry(entry: any): number;
10
- dump(): ([op: "doFulfill", vow: Vow<Passable>, fulfillment: Passable] | [op: "doReject", vow: Vow<Passable>, reason: Passable] | [op: "doReturn", callIndex: number, result: Passable] | [op: "doThrow", callIndex: number, problem: Passable] | [op: "checkCall", target: Passable, optVerb: PropertyKey | undefined, args: Passable[], callIndex: number])[];
10
+ dump(): ([op: "doFulfill", vow: import("@agoric/vow").Vow<import("@endo/pass-style").Passable>, fulfillment: import("@endo/pass-style").Passable] | [op: "doReject", vow: import("@agoric/vow").Vow<import("@endo/pass-style").Passable>, reason: import("@endo/pass-style").Passable] | [op: "doReturn", callIndex: number, result: import("@endo/pass-style").Passable] | [op: "doThrow", callIndex: number, problem: import("@endo/pass-style").Passable] | [op: "checkCall", target: import("@endo/pass-style").Passable, optVerb: PropertyKey | undefined, args: import("@endo/pass-style").Passable[], callIndex: number] | [op: "checkSendOnly", target: import("@endo/pass-style").Passable, optVerb: PropertyKey | undefined, args: import("@endo/pass-style").Passable[], callIndex: number] | [op: "checkSend", target: import("@endo/pass-style").Passable, optVerb: PropertyKey | undefined, args: import("@endo/pass-style").Passable[], callIndex: number])[];
11
11
  promiseReplayDone(): Promise<undefined>;
12
12
  }>;
13
13
  export type LogStore = ReturnType<ReturnType<(zone: Zone) => () => import("@endo/exo").Guarded<{
@@ -19,7 +19,9 @@ export type LogStore = ReturnType<ReturnType<(zone: Zone) => () => import("@endo
19
19
  peekEntry(): LogEntry;
20
20
  nextEntry(): LogEntry;
21
21
  pushEntry(entry: any): number;
22
- dump(): ([op: "doFulfill", vow: Vow<Passable>, fulfillment: Passable] | [op: "doReject", vow: Vow<Passable>, reason: Passable] | [op: "doReturn", callIndex: number, result: Passable] | [op: "doThrow", callIndex: number, problem: Passable] | [op: "checkCall", target: Passable, optVerb: PropertyKey | undefined, args: Passable[], callIndex: number])[];
22
+ dump(): ([op: "doFulfill", vow: import("@agoric/vow").Vow<import("@endo/pass-style").Passable>, fulfillment: import("@endo/pass-style").Passable] | [op: "doReject", vow: import("@agoric/vow").Vow<import("@endo/pass-style").Passable>, reason: import("@endo/pass-style").Passable] | [op: "doReturn", callIndex: number, result: import("@endo/pass-style").Passable] | [op: "doThrow", callIndex: number, problem: import("@endo/pass-style").Passable] | [op: "checkCall", target: import("@endo/pass-style").Passable, optVerb: PropertyKey | undefined, args: import("@endo/pass-style").Passable[], callIndex: number] | [op: "checkSendOnly", target: import("@endo/pass-style").Passable, optVerb: PropertyKey | undefined, args: import("@endo/pass-style").Passable[], callIndex: number] | [op: "checkSend", target: import("@endo/pass-style").Passable, optVerb: PropertyKey | undefined, args: import("@endo/pass-style").Passable[], callIndex: number])[];
23
23
  promiseReplayDone(): Promise<undefined>;
24
24
  }>>>;
25
+ import type { Zone } from '@agoric/base-zone';
26
+ import type { LogEntry } from './types.js';
25
27
  //# sourceMappingURL=log-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log-store.d.ts","sourceRoot":"","sources":["log-store.js"],"names":[],"mappings":"AA4BO;;;;;;;;;;;GAoIN;uBAGY,UAAU,CAAC,UAAU;;;;;;;;;;;GAAiB,CAAC"}
1
+ {"version":3,"file":"log-store.d.ts","sourceRoot":"","sources":["log-store.js"],"names":[],"mappings":"AA+BO,sCAFI,IAAI;;;;;;;;;;;GAuId;uBAGY,UAAU,CAAC,UAAU,QA1IvB,IAAI;;;;;;;;;;;GA0IoC,CAAC;0BA/J7B,mBAAmB;8BAEL,YAAY"}
package/src/log-store.js CHANGED
@@ -5,7 +5,10 @@ import { LogEntryShape } from './type-guards.js';
5
5
  import { makeEphemera } from './ephemera.js';
6
6
 
7
7
  /**
8
- * @import {MapStore} from '@agoric/store'
8
+ * @import {PromiseKit} from '@endo/promise-kit'
9
+ * @import {Zone} from '@agoric/base-zone'
10
+ * @import {MapStore} from '@agoric/store';
11
+ * @import {Ephemera, LogEntry} from './types.js';
9
12
  */
10
13
 
11
14
  const LogStoreI = M.interface('LogStore', {
@@ -138,6 +141,7 @@ export const prepareLogStore = zone => {
138
141
  Fail`internal: index confusion ${q(eph.index)} vs ${q(
139
142
  mapStore.getSize(),
140
143
  )}`;
144
+ // console.log('LOG ENTRY ', eph.index - 1, entry);
141
145
  return eph.index;
142
146
  },
143
147
  dump() {
@@ -1,28 +1,10 @@
1
- export function makeReplayMembrane(log: import("@endo/exo").Guarded<{
2
- reset(): void;
3
- dispose(): void;
4
- getIndex(): number;
5
- getLength(): number;
6
- isReplaying(): boolean;
7
- peekEntry(): LogEntry;
8
- nextEntry(): LogEntry;
9
- pushEntry(entry: any): number;
10
- dump(): ([op: "doFulfill", vow: Vow<Passable>, fulfillment: Passable] | [op: "doReject", vow: Vow<Passable>, reason: Passable] | [op: "doReturn", callIndex: number, result: Passable] | [op: "doThrow", callIndex: number, problem: Passable] | [op: "checkCall", target: Passable, optVerb: PropertyKey | undefined, args: Passable[], callIndex: number])[];
11
- promiseReplayDone(): Promise<undefined>;
12
- }>, bijection: import("@endo/exo").Guarded<{
13
- reset(): void;
14
- init(g: any, h: any): void;
15
- hasGuest(g: any): boolean;
16
- hasHost(h: any): boolean;
17
- has(g: any, h: any): boolean;
18
- guestToHost(g: any): any;
19
- hostToGuest(h: any): any;
20
- }>, vowTools: {
21
- when: <T, TResult1 = import("@agoric/vow").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
22
- watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = never, C = any>(specimenP: import("@agoric/vow").ERef<T_1 | Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => Vow<Exclude<TResult1_1, void> | Exclude<TResult2_1, void> extends never ? TResult1_1 : Exclude<TResult1_1, void> | Exclude<TResult2_1, void>>;
23
- makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
24
- allVows: (vows: unknown[]) => Vow<any[]>;
25
- }, watchWake: (vowish: Promise<any> | Vow) => void, panic: (problem: Error) => never): {
1
+ export function makeReplayMembrane({ log, bijection, vowTools, watchWake, panic, }: {
2
+ log: LogStore;
3
+ bijection: Bijection;
4
+ vowTools: VowTools;
5
+ watchWake: (vowish: Promise<any> | Vow) => void;
6
+ panic: (problem: Error) => never;
7
+ }): {
26
8
  hostToGuest: (specimen: Passable, label?: string | undefined) => any;
27
9
  guestToHost: (specimen: Passable, label?: string | undefined) => any;
28
10
  wake: () => void;
@@ -33,31 +15,13 @@ export function makeReplayMembrane(log: import("@endo/exo").Guarded<{
33
15
  wake: () => void;
34
16
  stop: () => void;
35
17
  }>;
36
- export type ReplayMembrane = ReturnType<(log: import("@endo/exo").Guarded<{
37
- reset(): void;
38
- dispose(): void;
39
- getIndex(): number;
40
- getLength(): number;
41
- isReplaying(): boolean;
42
- peekEntry(): LogEntry;
43
- nextEntry(): LogEntry;
44
- pushEntry(entry: any): number;
45
- dump(): ([op: "doFulfill", vow: Vow<Passable>, fulfillment: Passable] | [op: "doReject", vow: Vow<Passable>, reason: Passable] | [op: "doReturn", callIndex: number, result: Passable] | [op: "doThrow", callIndex: number, problem: Passable] | [op: "checkCall", target: Passable, optVerb: PropertyKey | undefined, args: Passable[], callIndex: number])[];
46
- promiseReplayDone(): Promise<undefined>;
47
- }>, bijection: import("@endo/exo").Guarded<{
48
- reset(): void;
49
- init(g: any, h: any): void;
50
- hasGuest(g: any): boolean;
51
- hasHost(h: any): boolean;
52
- has(g: any, h: any): boolean;
53
- guestToHost(g: any): any;
54
- hostToGuest(h: any): any;
55
- }>, vowTools: {
56
- when: <T, TResult1 = import("@agoric/vow").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
57
- watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = never, C = any>(specimenP: import("@agoric/vow").ERef<T_1 | Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => Vow<Exclude<TResult1_1, void> | Exclude<TResult2_1, void> extends never ? TResult1_1 : Exclude<TResult1_1, void> | Exclude<TResult2_1, void>>;
58
- makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
59
- allVows: (vows: unknown[]) => Vow<any[]>;
60
- }, watchWake: (vowish: Promise<any> | Vow) => void, panic: (problem: Error) => never) => {
18
+ export type ReplayMembrane = ReturnType<({ log, bijection, vowTools, watchWake, panic, }: {
19
+ log: LogStore;
20
+ bijection: Bijection;
21
+ vowTools: VowTools;
22
+ watchWake: (vowish: Promise<any> | Vow) => void;
23
+ panic: (problem: Error) => never;
24
+ }) => {
61
25
  hostToGuest: (specimen: Passable, label?: string | undefined) => any;
62
26
  guestToHost: (specimen: Passable, label?: string | undefined) => any;
63
27
  wake: () => void;
@@ -68,4 +32,9 @@ export type ReplayMembrane = ReturnType<(log: import("@endo/exo").Guarded<{
68
32
  wake: () => void;
69
33
  stop: () => void;
70
34
  }>>;
35
+ import type { LogStore } from '../src/log-store.js';
36
+ import type { Bijection } from '../src/bijection.js';
37
+ import type { VowTools } from '@agoric/vow';
38
+ import type { Vow } from '@agoric/vow';
39
+ import type { Passable } from '@endo/pass-style';
71
40
  //# sourceMappingURL=replay-membrane.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replay-membrane.d.ts","sourceRoot":"","sources":["replay-membrane.js"],"names":[],"mappings":"AAqBO;;;;;;;;;;;;;;;;;;;;uFAZuC,CAAC;;;oBAqBtC,SAAS;8CAZoB,IAAI,SAC/B,CAAC,OAAO,EAAE,KAAK,KAAK,KAAK;;;;;;;;;;GAqdnC;6BAGa,UAAU;;;;;;;;;;;;;;;;;;;;uFAlesB,CAAC;;;oBAqBtC,SAAS;2DAXP,CAAC,OAAO,EAAE,KAAK,KAAK,KAAK;;;;;;;;;;GAwdQ"}
1
+ {"version":3,"file":"replay-membrane.d.ts","sourceRoot":"","sources":["replay-membrane.js"],"names":[],"mappings":"AA8BO,oFANJ;IAAsB,GAAG,EAAjB,QAAQ;IACO,SAAS,EAAxB,SAAS;IACK,QAAQ,EAAtB,QAAQ;IAC6B,SAAS,EAA9C,CAAC,MAAM,EAAE,eAAU,GAAG,KAAK,IAAI;IACA,KAAK,EAApC,CAAC,OAAO,EAAE,KAAK,KAAK,KAAK;CACnC;;;;;;;;;;GAmpBA;6BAGa,UAAU,mDA3pBrB;IAAsB,GAAG,EAAjB,QAAQ;IACO,SAAS,EAAxB,SAAS;IACK,QAAQ,EAAtB,QAAQ;IAC6B,SAAS,EAA9C,CAAC,MAAM,EAAE,eAAU,GAAG,KAAK,IAAI;IACA,KAAK,EAApC,CAAC,OAAO,EAAE,KAAK,KAAK,KAAK;CACnC;;;;;;;;;;GAspB2C;8BApqBjB,qBAAqB;+BACpB,qBAAqB;8BAFT,aAAa;yBAAb,aAAa;8BADD,kBAAkB"}