@northtalk/ts 0.2.0 → 0.4.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 (55) hide show
  1. package/README.md +16 -14
  2. package/{base64-DORMd3Hv.js → base64-Dtqaz_0A.js} +880 -409
  3. package/{binary-value-CEmh60GC.d.ts → binary-value-Bb6HPDtM.d.ts} +2 -2
  4. package/{capabilities-CH0FkRMq.js → capabilities-Bi5Qm6Fr.js} +39 -20
  5. package/{checker-Dc1jl2WH.js → checker-DMI4LiRm.js} +321 -112
  6. package/core-BzGUgjL6.d.ts +22 -0
  7. package/{debug-CQBxKnJB.d.ts → debug-C72o2pZy.d.ts} +506 -50
  8. package/debug.d.ts +3 -3
  9. package/debug.js +1 -1
  10. package/driver-ClV_UDEK.d.ts +63 -0
  11. package/driver.d.ts +2 -40
  12. package/driver.js +24 -4
  13. package/{encoding-nlrpj-Pb.js → encoding-C3Q7pIC9.js} +2 -2
  14. package/{engine-BGaJ9dAk.js → engine-BpdGfAND.js} +6 -6
  15. package/{engine-vbYInVYF.d.ts → engine-Dtby_FkE.d.ts} +3 -3
  16. package/{errors-LYJZ_c8h.js → errors-BKJES3Zu.js} +1060 -751
  17. package/{group-B742gg4T.js → group-vuUL2tq-.js} +6526 -1725
  18. package/http.d.ts +2 -2
  19. package/http.js +3 -3
  20. package/index-ByF5j53i.d.ts +779 -0
  21. package/index.d.ts +6 -651
  22. package/index.js +23 -15
  23. package/{http-capability-CSTkw1Yt.js → inline-grants-Cx0Z9XAt.js} +109 -24
  24. package/manifest-Dw-8Unmf.js +256 -0
  25. package/message-layer.d.ts +3 -3
  26. package/message-layer.js +2 -2
  27. package/notify.d.ts +2 -2
  28. package/notify.js +1 -1
  29. package/{objects-Db7IB5vQ.js → objects-BC4fS0vq.js} +1 -1
  30. package/{objects-DJ3QtCCs.d.ts → objects-Dnqor7Gn.d.ts} +12 -4
  31. package/{operation-promises-EgZXG5N_.js → operation-promises-ClA1BTaS.js} +10 -5
  32. package/package.json +2 -2
  33. package/{readers-CjJHKHvH.js → readers-B5e5bBrY.js} +2 -2
  34. package/{readers-BFPuosPk.d.ts → readers-DAFVvvq4.d.ts} +2 -2
  35. package/{request-pump-binary-DdY3X-yl.js → request-pump-binary-BjnyqXV5.js} +4 -4
  36. package/{router--71qvxtY.js → router-BCHEfs4x.js} +5 -5
  37. package/{router-Zhrw5l__.d.ts → router-BspOCPA0.d.ts} +3 -3
  38. package/session.d.ts +41 -3
  39. package/session.js +260 -179
  40. package/setup.d.ts +2 -2
  41. package/setup.js +4 -4
  42. package/sha256-9CGf5BS_.js +168 -0
  43. package/sqlite.d.ts +5 -5
  44. package/sqlite.js +27 -21
  45. package/{store-hJrRULMx.js → store-DTQa0lyE.js} +2 -2
  46. package/{store-capability-OZp4hXmj.js → store-capability-BxXgiRM7.js} +4 -4
  47. package/store.d.ts +3 -3
  48. package/store.js +2 -2
  49. package/{user-capability-BK4Asg7D.js → user-capability-5-IvCeZI.js} +5 -5
  50. package/wasm.d.ts +12 -8
  51. package/wasm.js +67 -39
  52. package/core-DptnvQT9.d.ts +0 -14
  53. package/manifest-BscyH_rW.d.ts +0 -70
  54. package/manifest-DjsxDSuB.js +0 -129
  55. package/sha256-B_kyYw3Z.js +0 -124
@@ -0,0 +1,168 @@
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
+ /** An incremental SHA-256: `update` with bytes, then `final` once. */
81
+ var Sha256 = class {
82
+ h = new Uint32Array(initial);
83
+ w = /* @__PURE__ */ new Uint32Array(64);
84
+ block = /* @__PURE__ */ new Uint8Array(64);
85
+ blockView = new DataView(this.block.buffer);
86
+ filled = 0;
87
+ length = 0;
88
+ done = false;
89
+ update(bytes) {
90
+ if (this.done) throw new Error("Sha256.update after final");
91
+ this.length += bytes.length;
92
+ let at = 0;
93
+ if (this.filled > 0) {
94
+ const take = Math.min(64 - this.filled, bytes.length);
95
+ this.block.set(bytes.subarray(0, take), this.filled);
96
+ this.filled += take;
97
+ at = take;
98
+ if (this.filled < 64) return this;
99
+ this.compress(this.blockView, 0);
100
+ this.filled = 0;
101
+ }
102
+ const whole = at + Math.floor((bytes.length - at) / 64) * 64;
103
+ if (whole > at) {
104
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.length);
105
+ for (; at < whole; at += 64) this.compress(view, at);
106
+ }
107
+ this.block.set(bytes.subarray(at));
108
+ this.filled = bytes.length - at;
109
+ return this;
110
+ }
111
+ /** The 32-byte digest; the hash takes no more input after it. */
112
+ final() {
113
+ if (this.done) throw new Error("Sha256.final twice");
114
+ const length = this.length;
115
+ const tail = new Uint8Array(this.filled < 56 ? 64 : 128);
116
+ tail.set(this.block.subarray(0, this.filled));
117
+ tail[this.filled] = 128;
118
+ const view = new DataView(tail.buffer);
119
+ view.setUint32(tail.length - 8, Math.floor(length / 536870912));
120
+ view.setUint32(tail.length - 4, length * 8 >>> 0);
121
+ for (let at = 0; at < tail.length; at += 64) this.compress(view, at);
122
+ this.done = true;
123
+ const out = /* @__PURE__ */ new Uint8Array(32);
124
+ const outView = new DataView(out.buffer);
125
+ for (let i = 0; i < 8; i++) outView.setUint32(i * 4, this.h[i]);
126
+ return out;
127
+ }
128
+ compress(view, block) {
129
+ const { h, w } = this;
130
+ for (let i = 0; i < 16; i++) w[i] = view.getUint32(block + i * 4);
131
+ for (let i = 16; i < 64; i++) {
132
+ const s0 = rotr(w[i - 15], 7) ^ rotr(w[i - 15], 18) ^ w[i - 15] >>> 3;
133
+ const s1 = rotr(w[i - 2], 17) ^ rotr(w[i - 2], 19) ^ w[i - 2] >>> 10;
134
+ w[i] = w[i - 16] + s0 + w[i - 7] + s1 >>> 0;
135
+ }
136
+ 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];
137
+ for (let i = 0; i < 64; i++) {
138
+ const s1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
139
+ const ch = e & f ^ ~e & g;
140
+ const t1 = hh + s1 + ch + K[i] + w[i] >>> 0;
141
+ const t2 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) + (a & b ^ a & c ^ b & c) >>> 0;
142
+ hh = g;
143
+ g = f;
144
+ f = e;
145
+ e = d + t1 >>> 0;
146
+ d = c;
147
+ c = b;
148
+ b = a;
149
+ a = t1 + t2 >>> 0;
150
+ }
151
+ h[0] = h[0] + a >>> 0;
152
+ h[1] = h[1] + b >>> 0;
153
+ h[2] = h[2] + c >>> 0;
154
+ h[3] = h[3] + d >>> 0;
155
+ h[4] = h[4] + e >>> 0;
156
+ h[5] = h[5] + f >>> 0;
157
+ h[6] = h[6] + g >>> 0;
158
+ h[7] = h[7] + hh >>> 0;
159
+ }
160
+ };
161
+ /** The SHA-256 of `bytes`, as 32 bytes. */
162
+ const sha256Bytes = (bytes) => new Sha256().update(bytes).final();
163
+ const sha256 = (input) => {
164
+ const bytes = typeof input === "string" ? new TextEncoder().encode(input) : input;
165
+ return Array.from(sha256Bytes(bytes), (x) => x.toString(16).padStart(2, "0")).join("");
166
+ };
167
+ //#endregion
168
+ export { sha256 as n, sha256Bytes as r, Sha256 as t };
package/sqlite.d.ts CHANGED
@@ -1,6 +1,6 @@
1
-
2
- import { Bt as SegmentCoordinator, an as SqlParams, cn as SqliteBinding, ln as SqliteImpl, nn as StoreImpl, on as SqlRows, yt as Call } from "./debug-CQBxKnJB.js";
3
- import { a as Stores, r as StoreQuotas } from "./engine-vbYInVYF.js";
1
+ /// <reference lib="esnext.disposable" />
2
+ import { Wt as SegmentCoordinator, bt as Call, fn as SqliteBinding, ln as SqlParams, on as StoreImpl, pn as SqliteImpl, un as SqlRows } from "./debug-C72o2pZy.js";
3
+ import { a as Stores, r as StoreQuotas } from "./engine-Dtby_FkE.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";
@@ -39,8 +39,8 @@ export declare class SqliteDatabase {
39
39
  exec(sql: string): void;
40
40
  /** Closes the database, discarding any Segment's uncommitted changes. */
41
41
  close(): void;
42
- query(call: Call<SqliteBinding>, sql: string, params: SqlParams, max: number): SqlRows;
43
- change(call: Call<SqliteBinding>, sql: string, params: SqlParams, max: number): SqlRows & {
42
+ query(call: Call<SqliteBinding>, sql: string, params: SqlParams, max: number, beforeStep: () => void): SqlRows;
43
+ change(call: Call<SqliteBinding>, sql: string, params: SqlParams, max: number, beforeStep: () => void): SqlRows & {
44
44
  readonly changes: number;
45
45
  };
46
46
  begin(call: Call<SqliteBinding>): void;
package/sqlite.js CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
- import { K as text, _ as dec, t as HostError } from "./errors-LYJZ_c8h.js";
3
- import { r as decodeValue } from "./readers-CjJHKHvH.js";
4
- import { t as encodeValue } from "./encoding-nlrpj-Pb.js";
5
- import { n as hostScriptError } from "./store-capability-OZp4hXmj.js";
6
- import { r as Stores, t as StoreContentsError } from "./engine-BGaJ9dAk.js";
2
+ import { Q as text, t as HostError, v as dec } from "./errors-BKJES3Zu.js";
3
+ import { r as decodeValue } from "./readers-B5e5bBrY.js";
4
+ import { t as encodeValue } from "./encoding-C3Q7pIC9.js";
5
+ import { n as hostScriptError } from "./store-capability-BxXgiRM7.js";
6
+ import { r as Stores, t as StoreContentsError } from "./engine-BpdGfAND.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;
@@ -219,7 +219,7 @@ var SqliteDatabase = class {
219
219
  groups = /* @__PURE__ */ new WeakMap();
220
220
  nextGroup = 0;
221
221
  constructor(path, options = {}) {
222
- if (path === "" || path === ":memory:") throw new HostError("invalid value", "A sqlite database is a file, which its connections share");
222
+ if (path === "" || path === ":memory:") throw new HostError("invalid value", "A sqlite database is a file, which its writer and reader share; for a throwaway database, open a file in a temporary directory");
223
223
  if (typeof DatabaseSync.prototype.setAuthorizer !== "function") throw new HostError("invalid value", "sqlite needs node:sqlite with setAuthorizer, as in Node 24.10 or later");
224
224
  const opened = [];
225
225
  try {
@@ -276,16 +276,16 @@ var SqliteDatabase = class {
276
276
  this.writer.close();
277
277
  this.lock.close();
278
278
  }
279
- query(call, sql, params, max) {
279
+ query(call, sql, params, max, beforeStep) {
280
280
  const connection = this.holder === this.key(call) ? this.writer : this.reader;
281
- return this.statement(connection, call.binding, sql, params, max, true);
281
+ return this.statement(connection, call.binding, sql, params, max, beforeStep, true);
282
282
  }
283
- change(call, sql, params, max) {
283
+ change(call, sql, params, max, beforeStep) {
284
284
  this.acquire(call, () => failure("sqlite busy"));
285
285
  const before = this.changeCounts().total;
286
286
  this.writer.exec("SAVEPOINT northtalk_call");
287
287
  try {
288
- const result = this.statement(this.writer, call.binding, sql, params, max, false);
288
+ const result = this.statement(this.writer, call.binding, sql, params, max, beforeStep, false);
289
289
  const { changes, total } = this.changeCounts();
290
290
  this.writer.exec("RELEASE northtalk_call");
291
291
  return {
@@ -385,7 +385,7 @@ var SqliteDatabase = class {
385
385
  total: Number(row.total)
386
386
  };
387
387
  }
388
- statement(connection, binding, sql, params, max, readOnly) {
388
+ statement(connection, binding, sql, params, max, beforeStep, readOnly) {
389
389
  const scanned = scan(sql);
390
390
  if (scanned.keyword === "") throw sqlFailure("The SQL holds no statement");
391
391
  if (scanned.keyword === "VACUUM") throw sqlFailure("VACUUM is not allowed");
@@ -403,15 +403,21 @@ var SqliteDatabase = class {
403
403
  const columns = prepared.columns().map((c) => c.name);
404
404
  const rows = [];
405
405
  const bound = Array.isArray(params) ? params : [Object.fromEntries(params)];
406
- const stepped = prepared.iterate(...bound);
407
- for (const row of stepped) {
408
- if (rows.length === max) throw failure("too many rows", [["max", dec(String(max))]]);
409
- rows.push(row.map((value, i) => decoded(value, columns[i])));
406
+ const stepped = prepared.iterate(...bound)[Symbol.iterator]();
407
+ try {
408
+ for (;;) {
409
+ beforeStep();
410
+ const next = stepped.next();
411
+ if (next.done) return {
412
+ columns,
413
+ rows
414
+ };
415
+ if (rows.length === max) throw failure("too many rows", [["max", dec(String(max))]]);
416
+ rows.push(next.value.map((value, i) => decoded(value, columns[i])));
417
+ }
418
+ } finally {
419
+ stepped.return?.();
410
420
  }
411
- return {
412
- columns,
413
- rows
414
- };
415
421
  } catch (error) {
416
422
  throw translated(error);
417
423
  } finally {
@@ -518,8 +524,8 @@ const sqliteDatabases = (databases) => {
518
524
  };
519
525
  return {
520
526
  coordinator: (database) => named(database).coordinator,
521
- query: (call, sql, params, max) => named(call.binding.database).query(call, sql, params, max),
522
- change: (call, sql, params, max) => named(call.binding.database).change(call, sql, params, max),
527
+ query: (call, sql, params, max, beforeStep) => named(call.binding.database).query(call, sql, params, max, beforeStep),
528
+ change: (call, sql, params, max, beforeStep) => named(call.binding.database).change(call, sql, params, max, beforeStep),
523
529
  begin: (call) => named(call.binding.database).begin(call),
524
530
  commit: (call) => named(call.binding.database).commit(call),
525
531
  rollback: (call) => named(call.binding.database).rollback(call)
@@ -1,6 +1,6 @@
1
1
 
2
- import { st as compareText } from "./base64-DORMd3Hv.js";
3
- import { a as encodeContents, i as decodeContents, n as StoreStateUnknownError, r as Stores, s as sessionWatchLimits } from "./engine-BGaJ9dAk.js";
2
+ import { dt as compareText } from "./base64-Dtqaz_0A.js";
3
+ import { a as encodeContents, i as decodeContents, n as StoreStateUnknownError, r as Stores, s as sessionWatchLimits } from "./engine-BpdGfAND.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,8 +1,8 @@
1
1
 
2
- import { K as text, M as map, P as nothing, i as ScriptError, t as HostError, u as bool, w as instant } from "./errors-LYJZ_c8h.js";
3
- import { a as defineValueCapability, f as validComputedMessageName, u as shape } from "./capabilities-CH0FkRMq.js";
4
- import { i as ScriptError$1, lt as errorMessages, o as arithmetic } from "./base64-DORMd3Hv.js";
5
- import { r as registerStandardChecks } from "./encoding-nlrpj-Pb.js";
2
+ import { L as nothing, N as map, Q as text, T as instant, i as ScriptError, t as HostError, u as bool } from "./errors-BKJES3Zu.js";
3
+ import { a as defineValueCapability, f as validComputedMessageName, u as shape } from "./capabilities-Bi5Qm6Fr.js";
4
+ import { i as ScriptError$1, o as arithmetic, pt as errorMessages } from "./base64-Dtqaz_0A.js";
5
+ import { r as registerStandardChecks } from "./encoding-C3Q7pIC9.js";
6
6
  //#region src/standard-capabilities.ts
7
7
  const costOf = (costs, name) => {
8
8
  const cost = costs && Object.hasOwn(costs, name) ? costs[name] : void 0;
package/store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
-
2
- import { n as RouterOptions } from "./router-Zhrw5l__.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-vbYInVYF.js";
1
+ /// <reference lib="esnext.disposable" />
2
+ import { n as RouterOptions } from "./router-BspOCPA0.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-Dtby_FkE.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-BGaJ9dAk.js";
3
- import { i as memoryStores, n as webStorageStores, r as memoryBackend, t as webStorageBackend } from "./store-hJrRULMx.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-BpdGfAND.js";
3
+ import { i as memoryStores, n as webStorageStores, r as memoryBackend, t as webStorageBackend } from "./store-DTQa0lyE.js";
4
4
  export { StoreContentsError, StoreStateUnknownError, Stores, decodeContents, encodeContents, memoryBackend, memoryStores, sessionQuotas, sessionWatchLimits, webStorageBackend, webStorageStores };
@@ -1,9 +1,9 @@
1
1
 
2
- import { K as text, M as map, Ot as integerOf, kt as isInteger, t as HostError, u as bool, v as decimalParts } from "./errors-LYJZ_c8h.js";
3
- import { a as defineValueCapability, u as shape } from "./capabilities-CH0FkRMq.js";
4
- import { i as ScriptError } from "./base64-DORMd3Hv.js";
5
- import { r as registerStandardChecks } from "./encoding-nlrpj-Pb.js";
6
- import { c as fixed, s as costOf } from "./store-capability-OZp4hXmj.js";
2
+ import { Dt as isInteger, Et as integerOf, N as map, Q as text, t as HostError, u as bool, y as decimalParts } from "./errors-BKJES3Zu.js";
3
+ import { a as defineValueCapability, u as shape } from "./capabilities-Bi5Qm6Fr.js";
4
+ import { i as ScriptError } from "./base64-Dtqaz_0A.js";
5
+ import { r as registerStandardChecks } from "./encoding-C3Q7pIC9.js";
6
+ import { c as fixed, s as costOf } from "./store-capability-BxXgiRM7.js";
7
7
  //#region src/locale-tag.ts
8
8
  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;
9
9
  const alpha = /^[a-z]+$/i;
package/wasm.d.ts CHANGED
@@ -1,8 +1,8 @@
1
-
2
- import { An as Outcome, At as ImmediateOp, B as CausalWork, Bt as SegmentCoordinator, C as Requested, Cn as LibrarySource, Ct as Cost, Dt as FireOp, Et as FieldShape, Ft as PlainResult, G as Decimal, Gn as LoadError, Gt as defineCapability, H as RunAncestry, Hn as HostError, Ht as SegmentLifecycle, It as ReleaseHook, J as bool, Jn as SendFailedReason, Jt as Group, K as Kind, Kn as MailboxFull, Kt as shape, L as Verdict, Lt as ReleaseReason, M as Settlement, Mt as Operation, Nt as Operations, On as LimitName, Ot as Grant, Pt as PlainArg, Q as instant, Qt as HttpImpl, Rt as ScopeDecl, S as Report, St as CoordinatedLifecycle, T as RestoreResult, Tt as ErrorDecl, U as RunDiscarded, Un as HostErrorCode, Ut as Shape, V as RunAccounting, Vt as SegmentGrant, W as RunStarted, Wn as LoadDiagnostic, Wt as SuspendingOp, X as civilDate, Xt as Versions, Y as bytes, Yt as Script, Z as dec, _ as Message, an as SqlParams, at as range, b as PumpResult, bt as CapabilityDef, c as CancellationOptions, cn as SqliteBinding, ct as text, d as Decided, dn as LocaleImpl, dt as parseInstant, en as UserImpl, et as list, f as Deciding, ft as HostObject, g as LoadOptions, gn as TimerImpl, gt as PropDef, h as Inspection, hn as Costs, ht as ObjectKindDef, it as quantity, jt as LimitReached, kn as Limits, kt as GrantContext, l as CarryOver, ln as SqliteImpl, lt as formatInstant, m as GroupOptions, mn as ConsoleImpl, mt as ObjectKind, nn as StoreImpl, nt as nothing, on as SqlRows, ot as record, p as EffectFailure, pn as CalendarImpl, pt as ObjectElements, q as Value, qn as ScriptError, qt as Core, rn as add, rt as num, sn as SqlValue, tt as map, u as Counters, ut as nowMicros, v as PendingCall, vt as GrantDecls, w as RestoreOptions, wn as OperationRef, wt as EffectResult, x as PumpedRequest, xn as Library, xt as CapabilityDefiner, y as PumpOptions, yt as Call, zt as SegmentContext } from "./debug-CQBxKnJB.js";
3
- import { a as encodeJson, c as PlainValue, d as toValue, f as talk, i as decodeJson, l as ToValueOptions, n as MessageDecl, o as encodeValue, r as exportManifest, s as FromValueOptions, t as ManifestSpec, u as fromValue } from "./manifest-BscyH_rW.js";
4
- import { a as decodeValue, n as Json, o as readDisplay } from "./readers-BFPuosPk.js";
5
- import { t as BinaryValueOptions } from "./binary-value-CEmh60GC.js";
1
+ /// <reference lib="esnext.disposable" />
2
+ import { $ as instant, $t as Script, At as FireOp, Bt as ReleaseHook, C as Report, Ct as ChargeRequest, Dn as LibrarySource, Dt as EffectResult, E as RestoreResult, Et as Cost, Ft as Metering, G as RunStarted, Gt as SegmentGrant, H as RunAccounting, Ht as ScopeDecl, It as Operation, J as Value, Jn as LoadDiagnostic, Jt as SuspendingOp, K as Decimal, Kn as HostError, Kt as SegmentLifecycle, Lt as Operations, Mn as LimitName, Mt as GrantContext, N as Settlement, Nn as Limits, Nt as ImmediateOp, On as OperationRef, Ot as ErrorDecl, Pn as Outcome, Pt as LimitReached, Q as dec, Qn as SendFailedReason, Qt as Group, R as Verdict, Rt as PlainArg, S as PumpedRequest, St as CapabilityDefiner, T as RestoreOptions, Tn as Library, Tt as CoordinatedLifecycle, U as RunAncestry, Ut as SegmentContext, V as CausalWork, Vt as ReleaseReason, W as RunDiscarded, Wt as SegmentCoordinator, X as bytes, Xn as MailboxFull, Xt as shape, Y as bool, Yn as LoadError, Yt as defineCapability, Z as civilDate, Zn as ScriptError, Zt as Core, _ as LoadOptions, _n as CalendarImpl, _t as PropDef, at as quantity, b as PumpOptions, bn as TimerImpl, bt as Call, d as Counters, dn as SqlValue, dt as nowMicros, en as Versions, f as Decided, fn as SqliteBinding, ft as parseInstant, g as Inspection, gt as ObjectKindDef, h as GroupOptions, hn as LocaleImpl, ht as ObjectKind, in as UserImpl, it as num, jt as Grant, kt as FieldShape, l as CancellationOptions, ln as SqlParams, lt as text, m as EffectFailure, mt as ObjectElements, nn as HttpImpl, nt as map, on as StoreImpl, ot as range, p as Deciding, pn as SqliteImpl, pt as HostObject, q as Kind, qn as HostErrorCode, qt as Shape, rt as nothing, sn as add, st as record, tt as list, u as CarryOver, un as SqlRows, ut as formatInstant, v as Message, vn as ConsoleImpl, w as Requested, wt as ChargeResult, x as PumpResult, xt as CapabilityDef, y as PendingCall, yn as Costs, yt as GrantDecls, zt as PlainResult } from "./debug-C72o2pZy.js";
3
+ import { A as ToValueOptions, C as handlersOf, D as encodeValue, M as toValue, N as talk, O as FromValueOptions, S as ScriptWithHandlers, T as encodeJson, b as createGroup, d as MessageDecl, f as exportManifest, h as inlineGrants, j as fromValue, k as PlainValue, m as InlineOperation, p as InlineFunction, u as ManifestSpec, v as CreateGroupOptions, w as decodeJson, x as Handlers, y as DrivenGroup } from "./index-ByF5j53i.js";
4
+ import { a as decodeValue, n as Json, o as readDisplay } from "./readers-DAFVvvq4.js";
5
+ import { t as BinaryValueOptions } from "./binary-value-Bb6HPDtM.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;
@@ -136,7 +136,7 @@ export declare class WasmGroup implements Group {
136
136
  */
137
137
  worker(m: string, fields?: Record<string, Frame | undefined>): Json;
138
138
  /** @internal Message data shared with the Script combined operation. */
139
- messageFrame(m: Message): Frame;
139
+ messageFrame(m: Message, call: string): Frame;
140
140
  /** @internal */
141
141
  queue(m: string, fields: Record<string, Frame | undefined>, message?: Message): string;
142
142
  /** @internal */
@@ -173,6 +173,8 @@ export declare class WasmGroup implements Group {
173
173
  pump(now: bigint, o?: PumpOptions): PumpResult;
174
174
  save(): Uint8Array;
175
175
  fingerprint(): Uint8Array;
176
+ /** The State Fingerprint (ADR 0142): the Group's save without its save id. */
177
+ stateFingerprint(): Uint8Array;
176
178
  inspect(): Inspection;
177
179
  settle(callId: string, s: Settlement): Call<unknown> | undefined;
178
180
  /** @internal */
@@ -208,13 +210,15 @@ export declare class WasmCore implements Core {
208
210
  timerCapability: (impl: TimerImpl, costs: Costs) => CapabilityDef<unknown>;
209
211
  consoleCapability: (impl: ConsoleImpl, costs: Costs) => CapabilityDef<unknown>;
210
212
  storeCapability: (impl: StoreImpl, costs: Costs) => CapabilityDef<string>;
211
- sqliteCapability: (impl: SqliteImpl, costs: Costs, perRow: number) => CapabilityDef<SqliteBinding>;
213
+ sqliteCapability: (impl: SqliteImpl, costs: Costs, perStep: number) => CapabilityDef<SqliteBinding>;
212
214
  userCapability: (impl: UserImpl, costs: Costs) => CapabilityDef<unknown>;
213
215
  httpCapability: (impl: HttpImpl, costs: Costs) => CapabilityDef<unknown>;
214
216
  defineObjectKind<N>(k: ObjectKindDef<N>): ObjectKind<N>;
215
217
  /** Checked in a guest the Core keeps; each Group's guest compiles it again when added. */
216
218
  compileLibrary(src: LibrarySource, imports?: Library[], declarations?: GrantDecls): Library;
217
219
  newGroup(o: GroupOptions): WasmGroup;
220
+ /** A save's State Fingerprint, without restoring it (ADR 0142). */
221
+ stateFingerprint(save: Uint8Array): Uint8Array;
218
222
  restore(save: Uint8Array, o: RestoreOptions): {
219
223
  group: WasmGroup;
220
224
  result: RestoreResult;
@@ -240,4 +244,4 @@ export declare const defaultLimits: Readonly<{
240
244
  cleanupBudget: number;
241
245
  }>;
242
246
  //#endregion
243
- export { type CalendarImpl, type Call, type CancellationOptions, type CapabilityDef, type CapabilityDefiner, type CarryOver, type CausalWork, type ConsoleImpl, type CoordinatedLifecycle, type Core, type CoreOptions, type Cost, type Costs, type Counters, type Decided, type Deciding, Decimal, type EffectFailure, type EffectResult, type ErrorDecl, type FieldShape, type FireOp, type FromValueOptions, type Grant, type GrantContext, type GrantDecls, type Group, type GroupOptions, HostError, type HostErrorCode, type HostObject, type HttpImpl, type ImmediateOp, type Inspection, type Kind, type Library, type LibrarySource, type LimitName, LimitReached, type Limits, type LoadDiagnostic, LoadError, type LoadOptions, type LocaleImpl, MailboxFull, type ManifestSpec, type Message, type MessageDecl, type ObjectElements, type ObjectKind, type ObjectKindDef, type Operation, type OperationRef, type Operations, type Outcome, type PendingCall, type PlainArg, type PlainResult, type PlainValue, type PropDef, type PumpOptions, type PumpResult, type PumpedRequest, type ReleaseHook, type ReleaseReason, type Report, type Requested, type RestoreOptions, type RestoreResult, type RunAccounting, type RunAncestry, type RunDiscarded, type RunStarted, type ScopeDecl, type Script, ScriptError, type SegmentContext, type SegmentCoordinator, type SegmentGrant, type SegmentLifecycle, type SendFailedReason, type Settlement, type Shape, type SqlParams, type SqlRows, type SqlValue, type SqliteBinding, type SqliteImpl, type StoreImpl, type SuspendingOp, type TimerImpl, type ToValueOptions, type UserImpl, Value, type Verdict, type Versions, type WasmSource, add, bool, bytes, civilDate, dec, decodeJson, decodeValue, encodeJson, encodeValue, exportManifest, formatInstant, fromValue, instant, list, map, nothing, nowMicros, num, parseInstant, quantity, range, readDisplay, record, shape, talk, text, toValue };
247
+ export { type CalendarImpl, type Call, type CancellationOptions, type CapabilityDef, type CapabilityDefiner, type CarryOver, type CausalWork, type ChargeRequest, type ChargeResult, type ConsoleImpl, type CoordinatedLifecycle, type Core, type CoreOptions, type Cost, type Costs, type Counters, type CreateGroupOptions, type Decided, type Deciding, Decimal, type DrivenGroup, type EffectFailure, type EffectResult, type ErrorDecl, type FieldShape, type FireOp, type FromValueOptions, type Grant, type GrantContext, type GrantDecls, type Group, type GroupOptions, type Handlers, HostError, type HostErrorCode, type HostObject, type HttpImpl, type ImmediateOp, type InlineFunction, type InlineOperation, type Inspection, type Kind, type Library, type LibrarySource, type LimitName, LimitReached, type Limits, type LoadDiagnostic, LoadError, type LoadOptions, type LocaleImpl, MailboxFull, type ManifestSpec, type Message, type MessageDecl, type Metering, type ObjectElements, type ObjectKind, type ObjectKindDef, type Operation, type OperationRef, type Operations, type Outcome, type PendingCall, type PlainArg, type PlainResult, type PlainValue, type PropDef, type PumpOptions, type PumpResult, type PumpedRequest, type ReleaseHook, type ReleaseReason, type Report, type Requested, type RestoreOptions, type RestoreResult, type RunAccounting, type RunAncestry, type RunDiscarded, type RunStarted, type ScopeDecl, type Script, ScriptError, type ScriptWithHandlers, type SegmentContext, type SegmentCoordinator, type SegmentGrant, type SegmentLifecycle, type SendFailedReason, type Settlement, type Shape, type SqlParams, type SqlRows, type SqlValue, type SqliteBinding, type SqliteImpl, type StoreImpl, type SuspendingOp, type TimerImpl, type ToValueOptions, type UserImpl, Value, type Verdict, type Versions, type WasmSource, add, bool, bytes, civilDate, createGroup, dec, decodeJson, decodeValue, encodeJson, encodeValue, exportManifest, formatInstant, fromValue, handlersOf, inlineGrants, instant, list, map, nothing, nowMicros, num, parseInstant, quantity, range, readDisplay, record, shape, talk, text, toValue };