@northtalk/ts 0.9.0 → 0.11.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 (51) hide show
  1. package/{binary-value-B93hEK7l.d.ts → binary-value-np-QZCfn.d.ts} +1 -1
  2. package/{checker-D74oYIhs.js → checker-hkWO1UbN.js} +1 -1
  3. package/{core-BBPI6EhG.d.ts → core-kBXyAo-m.d.ts} +1 -1
  4. package/{debug-s6QIovKS.d.ts → debug-fthW6KN8.d.ts} +15 -1
  5. package/debug.d.ts +1 -1
  6. package/{driver-D5yrK3Nu.d.ts → driver-DtOBRKiH.d.ts} +1 -1
  7. package/driver.d.ts +1 -1
  8. package/{encoding-DzVFpg7k.js → encoding-DlMqlP2Y.js} +1 -1
  9. package/{engine-Dy-BCoiw.d.ts → engine-BoafZGEv.d.ts} +2 -2
  10. package/{engine-Bx8B63iQ.js → engine-CxcONfhv.js} +4 -4
  11. package/{group-CY4FKhzT.js → group-dgTtB1Pi.js} +179 -97
  12. package/{http-fetch-DnpfiOWK.js → http-fetch-CLAeEXVi.js} +1 -1
  13. package/http.d.ts +1 -1
  14. package/http.js +2 -2
  15. package/index.d.ts +4 -4
  16. package/index.js +11 -11
  17. package/{lean-Bg_UTRj0.d.ts → lean-BAz1NuyP.d.ts} +2 -2
  18. package/{lean-DTCTJUmR.js → lean-BwszbUJl.js} +8 -8
  19. package/lean.d.ts +4 -4
  20. package/lean.js +11 -11
  21. package/{manifest-DVS1SEmN.js → manifest-CRpUahPt.js} +2 -2
  22. package/message-layer.d.ts +2 -2
  23. package/message-layer.js +1 -1
  24. package/notify.d.ts +1 -1
  25. package/notify.js +1 -1
  26. package/{objects-q0lnCK-4.d.ts → objects-Cpc3eO-f.d.ts} +1 -1
  27. package/{operations-B3XaG7Ve.js → operations-DrsedOvj.js} +3 -3
  28. package/package.json +1 -1
  29. package/{peer-capability-3etyPHs3.js → peer-capability-RMdN4OHj.js} +2 -2
  30. package/peer.d.ts +1 -1
  31. package/peer.js +2 -2
  32. package/{readers-AeB1bJ--.d.ts → readers-DW4pUrD-.d.ts} +1 -1
  33. package/{request-pump-binary-VOPVqRZD.js → request-pump-binary-P8m6kLfB.js} +229 -51
  34. package/{router-Bdm4KiMG.js → router-C_Fjc2as.js} +4 -4
  35. package/{router-DXoJ_2Z4.d.ts → router-D6b7VJ92.d.ts} +2 -2
  36. package/session.d.ts +2 -2
  37. package/session.js +21 -17
  38. package/setup.d.ts +2 -2
  39. package/setup.js +3 -3
  40. package/sha256-C5Lqj5U7.js +197 -0
  41. package/sqlite.d.ts +2 -2
  42. package/sqlite.js +3 -3
  43. package/{store-BTcyKBLg.js → store-_af2DPoK.js} +2 -2
  44. package/{store-capability-CBJ6mUoH.js → store-capability-Db6v_dw9.js} +2 -2
  45. package/store.d.ts +2 -2
  46. package/store.js +2 -2
  47. package/{user-capability-DNY2dyjq.js → user-capability-CzoLN3RK.js} +2 -2
  48. package/wasm.d.ts +15 -4
  49. package/wasm.js +119 -46
  50. package/{zone-rules-DsCJtmlC.js → zone-rules-Cn-f9u_Z.js} +3 -3
  51. package/sha256-9CGf5BS_.js +0 -168
package/session.js CHANGED
@@ -1,17 +1,17 @@
1
1
 
2
2
  import { H as num, J as range, L as map, P as listValues, Qt as parseInstant, V as nothing, i as ScriptError, it as text, l as Value, n as LoadError, nn as characterBoundaries, on as lower, pn as builtins, qt as formatInstant, t as HostError, u as bool } from "./errors-CNc-xY_9.js";
3
- import { C as registeredStdlib, T as stdlibSource, a as recordLine, h as defaultLimits, i as restore, l as compileLibrary, o as traceValue } from "./group-CY4FKhzT.js";
3
+ import { C as registeredStdlib, T as stdlibSource, a as recordLine, h as defaultLimits, i as restore, l as compileLibrary, o as traceValue } from "./group-dgTtB1Pi.js";
4
4
  import { o as stateOf, t as defineObjectKind } from "./objects-OKVLH190.js";
5
- import { Dt as shape, Et as operationDeclarations, H as textForm$1, U as waitUs, jt as validStaticMessageName, tt as functionHead, ut as compareText, x as integerValue, xt as defineValueCapability } from "./operations-B3XaG7Ve.js";
6
- import { _ as viewSource, c as parseSource, f as declarationDocs, h as leadingDoc, m as functionDoc, s as parseEntry, t as checkSource } from "./checker-D74oYIhs.js";
7
- import { n as exportManifest, o as shapeData, t as canonicalJSON } from "./manifest-DVS1SEmN.js";
5
+ import { Dt as shape, Et as operationDeclarations, H as textForm$1, U as waitUs, jt as validStaticMessageName, tt as functionHead, ut as compareText, x as integerValue, xt as defineValueCapability } from "./operations-DrsedOvj.js";
6
+ import { _ as viewSource, c as parseSource, f as declarationDocs, h as leadingDoc, m as functionDoc, s as parseEntry, t as checkSource } from "./checker-hkWO1UbN.js";
7
+ import { n as exportManifest, o as shapeData, t as canonicalJSON } from "./manifest-CRpUahPt.js";
8
8
  import { c as readDisplay, l as readOrderedJSON, r as decodeValue } from "./readers-G1lHqrPl.js";
9
- import { a as clockCapability, i as calendarCapability, n as quoteJSON, o as consoleCapability, t as encodeValue } from "./encoding-DzVFpg7k.js";
10
- import { n as localeCapability, t as userCapability } from "./user-capability-DNY2dyjq.js";
11
- import { r as storeCapability } from "./store-capability-CBJ6mUoH.js";
9
+ import { a as clockCapability, i as calendarCapability, n as quoteJSON, o as consoleCapability, t as encodeValue } from "./encoding-DlMqlP2Y.js";
10
+ import { n as localeCapability, t as userCapability } from "./user-capability-CzoLN3RK.js";
11
+ import { r as storeCapability } from "./store-capability-Db6v_dw9.js";
12
12
  import { buildSetupGroup, capabilityOperations, immutableSetup, shapeOf } from "./setup.js";
13
- import { a as encodeContents, i as decodeContents, o as sessionQuotas, t as StoreContentsError } from "./engine-Bx8B63iQ.js";
14
- import { i as memoryStores } from "./store-BTcyKBLg.js";
13
+ import { a as encodeContents, i as decodeContents, o as sessionQuotas, t as StoreContentsError } from "./engine-CxcONfhv.js";
14
+ import { i as memoryStores } from "./store-_af2DPoK.js";
15
15
  //#region src/session/objects.ts
16
16
  const externalCollection = () => {
17
17
  throw new Error("external collection callback in replay");
@@ -502,16 +502,13 @@ var SessionObjects = class {
502
502
  }
503
503
  preload() {
504
504
  this.registrations();
505
- if (this.nextType() !== "setup") {
506
- if (this.replay?.length) malformed("missing setup");
507
- return {};
508
- }
505
+ if (this.nextType() !== "setup") return {};
509
506
  const e = this.consume("setup");
510
507
  return Object.fromEntries(Object.entries(recordObject(e.objects)).map(([name, o]) => [name, this.objectRef(o)]));
511
508
  }
512
509
  initial(bindings) {
513
510
  if (this.replay) return;
514
- if (!this.enabled) return;
511
+ if (!this.enabled || Object.keys(bindings).length === 0) return;
515
512
  this.emit({
516
513
  type: "setup",
517
514
  objects: Object.fromEntries(Object.entries(bindings).map(([k, o]) => [k, {
@@ -2731,12 +2728,16 @@ var SessionHost = class {
2731
2728
  if (word === "advance") {
2732
2729
  if (this.virtual === null) refuse("clock is real");
2733
2730
  let us;
2731
+ let negative;
2734
2732
  try {
2735
- us = waitUs(display(arg));
2733
+ const duration = display(arg);
2734
+ us = waitUs(duration);
2735
+ const amount = duration.asQuantityRef().number.toString();
2736
+ negative = amount.startsWith("-") && /[1-9]/.test(amount.split("e")[0]);
2736
2737
  } catch {
2737
2738
  return refuse("bad arguments");
2738
2739
  }
2739
- if (us < 0n) refuse("bad arguments");
2740
+ if (negative) refuse("bad arguments");
2740
2741
  this.virtual += us;
2741
2742
  return this.pump();
2742
2743
  }
@@ -2927,7 +2928,10 @@ var SessionHost = class {
2927
2928
  this.deadline = void 0;
2928
2929
  return this.discarded(reports);
2929
2930
  }
2930
- this.libraries.set(name, { library });
2931
+ if (how === "replace") {
2932
+ this.libraries.clear();
2933
+ for (const held of this.group.libraries()) this.libraries.set(held.name, { library: held });
2934
+ } else this.libraries.set(name, { library });
2931
2935
  if (how === "add") this.setup0 = immutableSetup({
2932
2936
  ...this.setup0,
2933
2937
  libraries: [...this.setup0.libraries, {
package/setup.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { Qt as operationDeclarations } from "./debug-s6QIovKS.js";
3
- import { A as shapeOf, C as Setup, D as capabilityOperations, E as buildSetupGroup, M as tsCore, O as immutableSetup, S as OperationSpec, T as ShapeSpec, b as MissingCapabilityError, j as shapeSpec, k as musicalClockOf, w as SetupGroup, x as ObjectRefSpec, y as CaseCore } from "./objects-q0lnCK-4.js";
2
+ import { Qt as operationDeclarations } from "./debug-fthW6KN8.js";
3
+ import { A as shapeOf, C as Setup, D as capabilityOperations, E as buildSetupGroup, M as tsCore, O as immutableSetup, S as OperationSpec, T as ShapeSpec, b as MissingCapabilityError, j as shapeSpec, k as musicalClockOf, w as SetupGroup, x as ObjectRefSpec, y as CaseCore } from "./objects-Cpc3eO-f.js";
4
4
  export { CaseCore, MissingCapabilityError, ObjectRefSpec, OperationSpec, Setup, SetupGroup, ShapeSpec, buildSetupGroup, capabilityOperations, immutableSetup, musicalClockOf, operationDeclarations, shapeOf, shapeSpec, tsCore };
package/setup.js CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
2
  import { n as LoadError } from "./errors-CNc-xY_9.js";
3
- import { i as restore, l as compileLibrary, r as newGroup, u as replacementLibraries } from "./group-CY4FKhzT.js";
3
+ import { i as restore, l as compileLibrary, r as newGroup, u as replacementLibraries } from "./group-dgTtB1Pi.js";
4
4
  import { t as defineObjectKind } from "./objects-OKVLH190.js";
5
- import { Dt as shape, Et as operationDeclarations } from "./operations-B3XaG7Ve.js";
6
- import { r as MUSICAL_CLOCK } from "./encoding-DzVFpg7k.js";
5
+ import { Dt as shape, Et as operationDeclarations } from "./operations-DrsedOvj.js";
6
+ import { r as MUSICAL_CLOCK } from "./encoding-DlMqlP2Y.js";
7
7
  //#region src/setup.ts
8
8
  const tsCore = {
9
9
  compileLibrary,
@@ -0,0 +1,197 @@
1
+
2
+ //#region src/sha256.ts
3
+ const K = new Uint32Array([
4
+ 1116352408,
5
+ 1899447441,
6
+ 3049323471,
7
+ 3921009573,
8
+ 961987163,
9
+ 1508970993,
10
+ 2453635748,
11
+ 2870763221,
12
+ 3624381080,
13
+ 310598401,
14
+ 607225278,
15
+ 1426881987,
16
+ 1925078388,
17
+ 2162078206,
18
+ 2614888103,
19
+ 3248222580,
20
+ 3835390401,
21
+ 4022224774,
22
+ 264347078,
23
+ 604807628,
24
+ 770255983,
25
+ 1249150122,
26
+ 1555081692,
27
+ 1996064986,
28
+ 2554220882,
29
+ 2821834349,
30
+ 2952996808,
31
+ 3210313671,
32
+ 3336571891,
33
+ 3584528711,
34
+ 113926993,
35
+ 338241895,
36
+ 666307205,
37
+ 773529912,
38
+ 1294757372,
39
+ 1396182291,
40
+ 1695183700,
41
+ 1986661051,
42
+ 2177026350,
43
+ 2456956037,
44
+ 2730485921,
45
+ 2820302411,
46
+ 3259730800,
47
+ 3345764771,
48
+ 3516065817,
49
+ 3600352804,
50
+ 4094571909,
51
+ 275423344,
52
+ 430227734,
53
+ 506948616,
54
+ 659060556,
55
+ 883997877,
56
+ 958139571,
57
+ 1322822218,
58
+ 1537002063,
59
+ 1747873779,
60
+ 1955562222,
61
+ 2024104815,
62
+ 2227730452,
63
+ 2361852424,
64
+ 2428436474,
65
+ 2756734187,
66
+ 3204031479,
67
+ 3329325298
68
+ ]);
69
+ const rotr = (x, n) => x >>> n | x << 32 - n;
70
+ const initial = [
71
+ 1779033703,
72
+ 3144134277,
73
+ 1013904242,
74
+ 2773480762,
75
+ 1359893119,
76
+ 2600822924,
77
+ 528734635,
78
+ 1541459225
79
+ ];
80
+ const w = /* @__PURE__ */ new Uint32Array(64);
81
+ /** One 64-byte block of `view` at `block`, folded into `h`. */
82
+ const compress = (h, view, block) => {
83
+ for (let i = 0; i < 16; i++) w[i] = view.getUint32(block + i * 4);
84
+ for (let i = 16; i < 64; i++) {
85
+ const s0 = rotr(w[i - 15], 7) ^ rotr(w[i - 15], 18) ^ w[i - 15] >>> 3;
86
+ const s1 = rotr(w[i - 2], 17) ^ rotr(w[i - 2], 19) ^ w[i - 2] >>> 10;
87
+ w[i] = w[i - 16] + s0 + w[i - 7] + s1 >>> 0;
88
+ }
89
+ let a = h[0], b = h[1], c = h[2], d = h[3], e = h[4], f = h[5], g = h[6], hh = h[7];
90
+ for (let i = 0; i < 64; i++) {
91
+ const s1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
92
+ const ch = e & f ^ ~e & g;
93
+ const t1 = hh + s1 + ch + K[i] + w[i] >>> 0;
94
+ const t2 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) + (a & b ^ a & c ^ b & c) >>> 0;
95
+ hh = g;
96
+ g = f;
97
+ f = e;
98
+ e = d + t1 >>> 0;
99
+ d = c;
100
+ c = b;
101
+ b = a;
102
+ a = t1 + t2 >>> 0;
103
+ }
104
+ h[0] = h[0] + a >>> 0;
105
+ h[1] = h[1] + b >>> 0;
106
+ h[2] = h[2] + c >>> 0;
107
+ h[3] = h[3] + d >>> 0;
108
+ h[4] = h[4] + e >>> 0;
109
+ h[5] = h[5] + f >>> 0;
110
+ h[6] = h[6] + g >>> 0;
111
+ h[7] = h[7] + hh >>> 0;
112
+ };
113
+ /** An incremental SHA-256: `update` with bytes, then `final` once. */
114
+ var Sha256 = class {
115
+ h = new Uint32Array(initial);
116
+ block = /* @__PURE__ */ new Uint8Array(64);
117
+ blockView = new DataView(this.block.buffer);
118
+ filled = 0;
119
+ length = 0;
120
+ done = false;
121
+ update(bytes) {
122
+ if (this.done) throw new Error("Sha256.update after final");
123
+ this.length += bytes.length;
124
+ let at = 0;
125
+ if (this.filled > 0) {
126
+ const take = Math.min(64 - this.filled, bytes.length);
127
+ this.block.set(bytes.subarray(0, take), this.filled);
128
+ this.filled += take;
129
+ at = take;
130
+ if (this.filled < 64) return this;
131
+ compress(this.h, this.blockView, 0);
132
+ this.filled = 0;
133
+ }
134
+ const whole = at + Math.floor((bytes.length - at) / 64) * 64;
135
+ if (whole > at) {
136
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.length);
137
+ for (; at < whole; at += 64) compress(this.h, view, at);
138
+ }
139
+ this.block.set(bytes.subarray(at));
140
+ this.filled = bytes.length - at;
141
+ return this;
142
+ }
143
+ /** The 32-byte digest; the hash takes no more input after it. */
144
+ final() {
145
+ if (this.done) throw new Error("Sha256.final twice");
146
+ this.done = true;
147
+ return wordBytes(finish(this.h, this.block, this.filled, this.length));
148
+ }
149
+ };
150
+ /**
151
+ * Pads the last `filled` bytes of `tail`, of `length` bytes hashed in all,
152
+ * and compresses them into `h`, which it returns.
153
+ */
154
+ const finish = (h, tail, filled, length) => {
155
+ const padded = new Uint8Array(filled < 56 ? 64 : 128);
156
+ padded.set(tail.subarray(0, filled));
157
+ padded[filled] = 128;
158
+ const view = new DataView(padded.buffer);
159
+ view.setUint32(padded.length - 8, Math.floor(length / 536870912));
160
+ view.setUint32(padded.length - 4, length * 8 >>> 0);
161
+ for (let at = 0; at < padded.length; at += 64) compress(h, view, at);
162
+ return h;
163
+ };
164
+ /**
165
+ * All of `bytes` hashed at once, as the eight state words. Every Load hashes
166
+ * a code identity, so this skips `Sha256`'s block buffering (#2230).
167
+ */
168
+ const digest = (bytes) => {
169
+ const h = new Uint32Array(initial);
170
+ const whole = bytes.length - bytes.length % 64;
171
+ if (whole > 0) {
172
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.length);
173
+ for (let at = 0; at < whole; at += 64) compress(h, view, at);
174
+ }
175
+ return finish(h, bytes.subarray(whole), bytes.length - whole, bytes.length);
176
+ };
177
+ const wordBytes = (h) => {
178
+ const out = /* @__PURE__ */ new Uint8Array(32);
179
+ const view = new DataView(out.buffer);
180
+ for (let i = 0; i < 8; i++) view.setUint32(i * 4, h[i]);
181
+ return out;
182
+ };
183
+ const encoder = new TextEncoder();
184
+ const hex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
185
+ /** The SHA-256 of `bytes`, as 32 bytes. */
186
+ const sha256Bytes = (bytes) => wordBytes(digest(bytes));
187
+ const sha256 = (input) => {
188
+ const h = digest(typeof input === "string" ? encoder.encode(input) : input);
189
+ let out = "";
190
+ for (let i = 0; i < 8; i++) {
191
+ const x = h[i];
192
+ out += hex[x >>> 24] + hex[x >>> 16 & 255] + hex[x >>> 8 & 255] + hex[x & 255];
193
+ }
194
+ return out;
195
+ };
196
+ //#endregion
197
+ export { sha256 as n, sha256Bytes as r, Sha256 as t };
package/sqlite.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { Wt as SegmentCoordinator, _n as SqlParams, bn as SqliteBinding, bt as Call, mn as StoreImpl, vn as SqlRows, xn as SqliteImpl } from "./debug-s6QIovKS.js";
3
- import { a as Stores, r as StoreQuotas } from "./engine-Dy-BCoiw.js";
2
+ import { Wt as SegmentCoordinator, _n as SqlParams, bn as SqliteBinding, bt as Call, mn as StoreImpl, vn as SqlRows, xn as SqliteImpl } from "./debug-fthW6KN8.js";
3
+ import { a as Stores, r as StoreQuotas } from "./engine-BoafZGEv.js";
4
4
  //#region src/sqlite/database.d.ts
5
5
  /** The table that keeps a database's Stores, which no `sqlite` Grant may use. */
6
6
  export declare const STORE_TABLE = "store";
package/sqlite.js CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
2
  import { b as dec, it as text, t as HostError } from "./errors-CNc-xY_9.js";
3
3
  import { r as decodeValue } from "./readers-G1lHqrPl.js";
4
- import { t as encodeValue } from "./encoding-DzVFpg7k.js";
5
- import { n as hostScriptError } from "./store-capability-CBJ6mUoH.js";
6
- import { r as Stores, t as StoreContentsError } from "./engine-Bx8B63iQ.js";
4
+ import { t as encodeValue } from "./encoding-DlMqlP2Y.js";
5
+ import { n as hostScriptError } from "./store-capability-Db6v_dw9.js";
6
+ import { r as Stores, t as StoreContentsError } from "./engine-CxcONfhv.js";
7
7
  import { DatabaseSync } from "node:sqlite";
8
8
  //#region src/sqlite/scan.ts
9
9
  const isWordChar = (c) => /[\w$]/.test(c) || c.charCodeAt(0) > 127;
@@ -1,6 +1,6 @@
1
1
 
2
- import { ut as compareText } from "./operations-B3XaG7Ve.js";
3
- import { a as encodeContents, i as decodeContents, n as StoreStateUnknownError, r as Stores, s as sessionWatchLimits } from "./engine-Bx8B63iQ.js";
2
+ import { ut as compareText } from "./operations-DrsedOvj.js";
3
+ import { a as encodeContents, i as decodeContents, n as StoreStateUnknownError, r as Stores, s as sessionWatchLimits } from "./engine-CxcONfhv.js";
4
4
  //#region src/store/memory.ts
5
5
  /** A backend that keeps nothing outside the engine's own copy. */
6
6
  const memoryBackend = () => ({
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { L as map, V as nothing, i as ScriptError, it as text, t as HostError, u as bool } from "./errors-CNc-xY_9.js";
3
- import { Dt as shape, ft as errorMessages, i as arithmetic, kt as validComputedMessageName, n as ScriptError$1, xt as defineValueCapability } from "./operations-B3XaG7Ve.js";
4
- import { c as fixed, f as registerStandardChecks, s as costOf } from "./encoding-DzVFpg7k.js";
3
+ import { Dt as shape, ft as errorMessages, i as arithmetic, kt as validComputedMessageName, n as ScriptError$1, xt as defineValueCapability } from "./operations-DrsedOvj.js";
4
+ import { c as fixed, f as registerStandardChecks, s as costOf } from "./encoding-DlMqlP2Y.js";
5
5
  //#region src/store-capability.ts
6
6
  /** A Core-raised error as the Host sees it, with its catalogue message. */
7
7
  const hostScriptError = (code, fields) => {
package/store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { n as RouterOptions } from "./router-DXoJ_2Z4.js";
3
- import { a as Stores, c as sessionQuotas, i as StoreStateUnknownError, l as sessionWatchLimits, n as StoreContentsError, o as decodeContents, r as StoreQuotas, s as encodeContents, t as StoreBackend } from "./engine-Dy-BCoiw.js";
2
+ import { n as RouterOptions } from "./router-D6b7VJ92.js";
3
+ import { a as Stores, c as sessionQuotas, i as StoreStateUnknownError, l as sessionWatchLimits, n as StoreContentsError, o as decodeContents, r as StoreQuotas, s as encodeContents, t as StoreBackend } from "./engine-BoafZGEv.js";
4
4
  //#region src/store/memory.d.ts
5
5
  /** A backend that keeps nothing outside the engine's own copy. */
6
6
  export declare const memoryBackend: () => StoreBackend;
package/store.js CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
- import { a as encodeContents, i as decodeContents, n as StoreStateUnknownError, o as sessionQuotas, r as Stores, s as sessionWatchLimits, t as StoreContentsError } from "./engine-Bx8B63iQ.js";
3
- import { i as memoryStores, n as webStorageStores, r as memoryBackend, t as webStorageBackend } from "./store-BTcyKBLg.js";
2
+ import { a as encodeContents, i as decodeContents, n as StoreStateUnknownError, o as sessionQuotas, r as Stores, s as sessionWatchLimits, t as StoreContentsError } from "./engine-CxcONfhv.js";
3
+ import { i as memoryStores, n as webStorageStores, r as memoryBackend, t as webStorageBackend } from "./store-_af2DPoK.js";
4
4
  export { StoreContentsError, StoreStateUnknownError, Stores, decodeContents, encodeContents, memoryBackend, memoryStores, sessionQuotas, sessionWatchLimits, webStorageBackend, webStorageStores };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { Dt as integerOf, L as map, Ot as isInteger, it as text, t as HostError, u as bool, x as decimalParts } from "./errors-CNc-xY_9.js";
3
- import { Dt as shape, n as ScriptError, xt as defineValueCapability } from "./operations-B3XaG7Ve.js";
4
- import { c as fixed, f as registerStandardChecks, s as costOf } from "./encoding-DzVFpg7k.js";
3
+ import { Dt as shape, n as ScriptError, xt as defineValueCapability } from "./operations-DrsedOvj.js";
4
+ import { c as fixed, f as registerStandardChecks, s as costOf } from "./encoding-DlMqlP2Y.js";
5
5
  //#region src/locale-tag.ts
6
6
  const grandfathered = /^(?:en-gb-oed|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)|sgn-(?:be-fr|be-nl|ch-de))$/i;
7
7
  const alpha = /^[a-z]+$/i;
package/wasm.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { $ as instant, $t as shape, At as FireOp, Bt as ReleaseHook, C as Report, Cn as LocaleImpl, Ct as ChargeRequest, Dn as Costs, Dt as EffectResult, E as RestoreResult, En as ConsoleImpl, Et as Cost, Fn as Library, Ft as Metering, G as RunStarted, Gt as SegmentGrant, H as RunAccounting, Hn as LimitName, Ht as ScopeDecl, It as Operation, J as Value, Jt as SuspendingOp, K as Decimal, Kt as SegmentLifecycle, Ln as LibrarySource, Lt as Operations, Mt as GrantContext, N as Settlement, Nt as ImmediateOp, On as MusicalClockImpl, Ot as ErrorDecl, Pt as LimitReached, Q as dec, Qt as operationDeclarations, R as Verdict, Rn as OperationRef, Rt as PlainArg, S as PumpedRequest, St as CapabilityDefiner, T as RestoreOptions, Tn as CalendarImpl, Tt as CoordinatedLifecycle, U as RunAncestry, Un as Limits, Ut as SegmentContext, V as CausalWork, Vt as ReleaseReason, W as RunDiscarded, Wn as Outcome, Wt as SegmentCoordinator, X as bytes, Xt as defineCapability, Y as bool, Yt as conforms, Z as civilDate, Zt as explain, _ as LoadOptions, _n as SqlParams, _t as PropDef, an as PeerImpl, ar as LoadError, at as quantity, b as PumpOptions, bn as SqliteBinding, bt as Call, cn as HttpClientImpl, cr as SendFailedReason, d as Counters, dt as nowMicros, en as Core, f as Decided, fn as UserImpl, ft as parseInstant, g as Inspection, gt as ObjectKindDef, h as GroupOptions, hn as add, ht as ObjectKind, ir as LoadDiagnostic, it as num, jt as Grant, kn as TimerImpl, kt as FieldShape, l as CancellationOptions, ln as HttpImpl, lt as text, m as EffectFailure, mn as StoreImpl, mt as ObjectElements, nn as Script, nr as HostError, nt as map, or as MailboxFull, ot as range, p as Deciding, pt as HostObject, q as Kind, qt as Shape, rn as Versions, rr as HostErrorCode, rt as nothing, sr as ScriptError, st as record, tn as Group, tt as list, u as CarryOver, un as HttpServerImpl, ut as formatInstant, v as Message, vn as SqlRows, w as Requested, wt as ChargeResult, x as PumpResult, xn as SqliteImpl, xt as CapabilityDef, y as PendingCall, yn as SqlValue, yt as GrantDecls, zt as PlainResult } from "./debug-s6QIovKS.js";
3
- import { A as FromValueOptions, C as handlersOf, F as talk, M as ToValueOptions, N as fromValue, P as toValue, S as ScriptWithHandlers, T as encodeJson, b as createGroup, d as exportManifest, f as zoneRules, h as inlineGrants, j as PlainValue, k as encodeValue, l as ManifestSpec, m as InlineOperation, p as InlineFunction, u as MessageDecl, v as CreateGroupOptions, w as decodeJson, x as Handlers, y as DrivenGroup } from "./lean-Bg_UTRj0.js";
4
- import { a as decodeValue, n as Json, o as readDisplay } from "./readers-AeB1bJ--.js";
5
- import { t as BinaryValueOptions } from "./binary-value-B93hEK7l.js";
2
+ import { $ as instant, $t as shape, At as FireOp, Bt as ReleaseHook, C as Report, Cn as LocaleImpl, Ct as ChargeRequest, Dn as Costs, Dt as EffectResult, E as RestoreResult, En as ConsoleImpl, Et as Cost, Fn as Library, Ft as Metering, G as RunStarted, Gt as SegmentGrant, H as RunAccounting, Hn as LimitName, Ht as ScopeDecl, It as Operation, J as Value, Jt as SuspendingOp, K as Decimal, Kt as SegmentLifecycle, Ln as LibrarySource, Lt as Operations, Mt as GrantContext, N as Settlement, Nt as ImmediateOp, On as MusicalClockImpl, Ot as ErrorDecl, Pt as LimitReached, Q as dec, Qt as operationDeclarations, R as Verdict, Rn as OperationRef, Rt as PlainArg, S as PumpedRequest, St as CapabilityDefiner, T as RestoreOptions, Tn as CalendarImpl, Tt as CoordinatedLifecycle, U as RunAncestry, Un as Limits, Ut as SegmentContext, V as CausalWork, Vt as ReleaseReason, W as RunDiscarded, Wn as Outcome, Wt as SegmentCoordinator, X as bytes, Xt as defineCapability, Y as bool, Yt as conforms, Z as civilDate, Zt as explain, _ as LoadOptions, _n as SqlParams, _t as PropDef, an as PeerImpl, ar as LoadError, at as quantity, b as PumpOptions, bn as SqliteBinding, bt as Call, cn as HttpClientImpl, cr as SendFailedReason, d as Counters, dt as nowMicros, en as Core, f as Decided, fn as UserImpl, ft as parseInstant, g as Inspection, gt as ObjectKindDef, h as GroupOptions, hn as add, ht as ObjectKind, ir as LoadDiagnostic, it as num, jt as Grant, kn as TimerImpl, kt as FieldShape, l as CancellationOptions, ln as HttpImpl, lt as text, m as EffectFailure, mn as StoreImpl, mt as ObjectElements, nn as Script, nr as HostError, nt as map, or as MailboxFull, ot as range, p as Deciding, pt as HostObject, q as Kind, qt as Shape, rn as Versions, rr as HostErrorCode, rt as nothing, sr as ScriptError, st as record, tn as Group, tt as list, u as CarryOver, un as HttpServerImpl, ut as formatInstant, v as Message, vn as SqlRows, w as Requested, wt as ChargeResult, x as PumpResult, xn as SqliteImpl, xt as CapabilityDef, y as PendingCall, yn as SqlValue, yt as GrantDecls, zt as PlainResult } from "./debug-fthW6KN8.js";
3
+ import { A as FromValueOptions, C as handlersOf, F as talk, M as ToValueOptions, N as fromValue, P as toValue, S as ScriptWithHandlers, T as encodeJson, b as createGroup, d as exportManifest, f as zoneRules, h as inlineGrants, j as PlainValue, k as encodeValue, l as ManifestSpec, m as InlineOperation, p as InlineFunction, u as MessageDecl, v as CreateGroupOptions, w as decodeJson, x as Handlers, y as DrivenGroup } from "./lean-BAz1NuyP.js";
4
+ import { a as decodeValue, n as Json, o as readDisplay } from "./readers-DW4pUrD-.js";
5
+ import { t as BinaryValueOptions } from "./binary-value-np-QZCfn.js";
6
6
  //#region src/wasm/reactor.d.ts
7
7
  /** Text the reactor writes to stdout or stderr, such as a fatal error. */
8
8
  type Diagnostics = (line: string) => void;
@@ -88,6 +88,11 @@ type GroupCore = {
88
88
  /** Compiles a Library and its imports into a guest, once each. */
89
89
  install(session: Session, library: Library): void;
90
90
  kind(name: string): ObjectKind | undefined;
91
+ /**
92
+ * Compiles a Library again against other imports, with the declarations
93
+ * it was compiled with, as a Library replacement recompiles a dependant.
94
+ */
95
+ recompile(library: Library, imports: Library[]): Library;
91
96
  /** A guest with every definition the Core knows available to declare. */
92
97
  session(): Session;
93
98
  };
@@ -149,6 +154,12 @@ export declare class WasmGroup implements Group {
149
154
  control(m: string, fields: Record<string, Frame | undefined>): void;
150
155
  script(name: string): WasmScript | undefined;
151
156
  scriptNames(): string[];
157
+ /**
158
+ * The user Libraries the guest holds, in add order. One a Library
159
+ * replacement recompiled is compiled again here, against the Libraries
160
+ * before it, so a restore can install it.
161
+ */
162
+ libraries(): Library[];
152
163
  load(o: LoadOptions): WasmScript;
153
164
  addLibrary(l: Library): void;
154
165
  replaceLibrary(l: Library, carry: CarryOver, o?: {