@northtalk/ts 0.10.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.
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { J as Value } from "./debug-2yfUZYzF.js";
2
+ import { J as Value } from "./debug-fthW6KN8.js";
3
3
  //#region src/binary-value.d.ts
4
4
  type BinaryValueOptions = {
5
5
  coreErrors?: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { B as restore, Bn as compileLibrary, en as Core, vt as defineObjectKind, z as newGroup } from "./debug-2yfUZYzF.js";
2
+ import { B as restore, Bn as compileLibrary, en as Core, vt as defineObjectKind, z as newGroup } from "./debug-fthW6KN8.js";
3
3
  //#region src/save-format.d.ts
4
4
  /**
5
5
  * A save's State Fingerprint (ADR 0142), read from its header and frames
@@ -2273,6 +2273,7 @@ type Group = {
2273
2273
  dispose(o: HostObject): void;
2274
2274
  fingerprint(): Uint8Array;
2275
2275
  inspect(): Inspection;
2276
+ libraries(): Library[];
2276
2277
  load(o: LoadOptions): Script;
2277
2278
  readonly name: string;
2278
2279
  object<N>(kind: ObjectKind<N>, id: string, native: N, o?: {
@@ -3273,7 +3274,7 @@ declare class TsGroup implements Group {
3273
3274
  private readonly trace;
3274
3275
  private readonly onReady;
3275
3276
  private readonly scripts;
3276
- private readonly libraries;
3277
+ private readonly libraryMap;
3277
3278
  private readonly waits;
3278
3279
  private readonly functionGroup;
3279
3280
  private readonly objects;
@@ -3439,6 +3440,12 @@ declare class TsGroup implements Group {
3439
3440
  script(name: string): TsScript | undefined;
3440
3441
  /** Any time, inside a Pump too. Its Scripts' names, in load order; not a Host Input. */
3441
3442
  scriptNames(): string[];
3443
+ /**
3444
+ * Any time, inside a Pump too. The user Libraries it holds now, as
3445
+ * `restore` takes them, including those `replaceLibrary` recompiled
3446
+ * (chapter 9); not a Host Input, and not traced.
3447
+ */
3448
+ libraries(): Library[];
3442
3449
  private queueInput;
3443
3450
  private worker;
3444
3451
  private finalizeEffects;
package/debug.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { a as DebugPause, c as RepeatedEffect, ct as sourceForm, et as isReadable, i as DebugInstruction, n as DebugEvaluation, o as DebugSnapshot, r as DebugFrame, s as DebugSource, t as DebugController } from "./debug-2yfUZYzF.js";
2
+ import { a as DebugPause, c as RepeatedEffect, ct as sourceForm, et as isReadable, i as DebugInstruction, n as DebugEvaluation, o as DebugSnapshot, r as DebugFrame, s as DebugSource, t as DebugController } from "./debug-fthW6KN8.js";
3
3
  export { type DebugController, type DebugEvaluation, type DebugFrame, type DebugInstruction, type DebugPause, type DebugSnapshot, type DebugSource, type RepeatedEffect, isReadable, sourceForm };
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { b as PumpOptions, h as GroupOptions, tn as Group, x as PumpResult } from "./debug-2yfUZYzF.js";
2
+ import { b as PumpOptions, h as GroupOptions, tn as Group, x as PumpResult } from "./debug-fthW6KN8.js";
3
3
  //#region src/operation-promises.d.ts
4
4
  /** A suspending call whose Host `run` Promise has not settled. */
5
5
  type PendingOperation = {
package/driver.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { a as autoDrive, i as asyncDispose, n as Drive, o as newDrivenGroup, r as DrivenGroupOptions, s as PendingOperation, t as AutoDriveOptions } from "./driver-CT-ksM-N.js";
2
+ import { a as autoDrive, i as asyncDispose, n as Drive, o as newDrivenGroup, r as DrivenGroupOptions, s as PendingOperation, t as AutoDriveOptions } from "./driver-DtOBRKiH.js";
3
3
  export { AutoDriveOptions, Drive, DrivenGroupOptions, type PendingOperation, asyncDispose, autoDrive, newDrivenGroup };
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { Dt as EffectResult, J as Value, Mt as GrantContext, Ut as SegmentContext, bt as Call, mn as StoreImpl } from "./debug-2yfUZYzF.js";
3
- import { i as WatchLimits, n as RouterOptions, t as NotificationRouter } from "./router-2vjYbqx3.js";
2
+ import { Dt as EffectResult, J as Value, Mt as GrantContext, Ut as SegmentContext, bt as Call, mn as StoreImpl } from "./debug-fthW6KN8.js";
3
+ import { i as WatchLimits, n as RouterOptions, t as NotificationRouter } from "./router-D6b7VJ92.js";
4
4
  //#region src/store/engine.d.ts
5
5
  /** A Store's limits, each counted by logical size (chapter 8). */
6
6
  type StoreQuotas = {
@@ -7439,6 +7439,25 @@ const replacementLibraries = (available, replacement) => {
7439
7439
  };
7440
7440
  //#endregion
7441
7441
  //#region src/run-accounting.ts
7442
+ /**
7443
+ * Copies `a` onto `into` in `RunAncestry` key order. Run reports are built
7444
+ * once per turn, so they assign fields rather than spread them (#2235).
7445
+ */
7446
+ const putAncestry = (into, a) => {
7447
+ into.rootDelivery = a.rootDelivery;
7448
+ if (a.parentRun !== void 0) into.parentRun = a.parentRun;
7449
+ if (a.parentCall !== void 0) into.parentCall = a.parentCall;
7450
+ };
7451
+ /** A new live Run's accounting row report, which the Group owns. */
7452
+ const accountingReport = (a, script, run, fuel) => {
7453
+ const r = { kind: "run accounting" };
7454
+ putAncestry(r, a);
7455
+ r.script = script;
7456
+ r.run = run;
7457
+ r.fuel = fuel;
7458
+ r.state = "live";
7459
+ return r;
7460
+ };
7442
7461
  const emptyAccounting = () => ({
7443
7462
  next: 0,
7444
7463
  runs: /* @__PURE__ */ new Map(),
@@ -7453,13 +7472,18 @@ const accountingTail = (state, queued) => {
7453
7472
  const live = /* @__PURE__ */ new Map();
7454
7473
  for (const [id, row] of [...state.runs].sort((a, b) => a[1].order - b[1].order)) {
7455
7474
  const r = row.report;
7456
- if (r.state === "live") live.set(r.rootDelivery, (live.get(r.rootDelivery) ?? 0) + 1);
7457
- if (row.reportedFuel !== r.fuel || r.state !== "live") {
7475
+ if (r.state !== "live") {
7476
+ reports.push(r);
7477
+ changed.add(r.rootDelivery);
7478
+ state.runs.delete(id);
7479
+ continue;
7480
+ }
7481
+ live.set(r.rootDelivery, (live.get(r.rootDelivery) ?? 0) + 1);
7482
+ if (row.reportedFuel !== r.fuel) {
7458
7483
  reports.push({ ...r });
7459
7484
  changed.add(r.rootDelivery);
7460
7485
  }
7461
7486
  row.reportedFuel = r.fuel;
7462
- if (r.state !== "live") state.runs.delete(id);
7463
7487
  }
7464
7488
  for (const [root, row] of [...state.roots].sort((a, b) => Number(a[0].slice(1)) - Number(b[0].slice(1)))) {
7465
7489
  const r = {
@@ -11329,7 +11353,7 @@ var TsGroup = class TsGroup {
11329
11353
  trace;
11330
11354
  onReady;
11331
11355
  scripts = [];
11332
- libraries = /* @__PURE__ */ new Map();
11356
+ libraryMap = /* @__PURE__ */ new Map();
11333
11357
  waits = new Waits();
11334
11358
  functionGroup = {};
11335
11359
  objects = /* @__PURE__ */ new Map();
@@ -11394,10 +11418,13 @@ var TsGroup = class TsGroup {
11394
11418
  const parentRun = senderRun(d.from);
11395
11419
  const parent = this.accounting.runs.get(parentRun);
11396
11420
  if (!parent) throw new Error(`missing accounting parent ${parentRun}`);
11397
- d.ancestry = {
11421
+ d.ancestry = d.reply ? {
11398
11422
  rootDelivery: parent.report.rootDelivery,
11399
11423
  parentRun,
11400
- ...d.reply ? { parentCall: d.reply } : {}
11424
+ parentCall: d.reply
11425
+ } : {
11426
+ rootDelivery: parent.report.rootDelivery,
11427
+ parentRun
11401
11428
  };
11402
11429
  }
11403
11430
  }
@@ -11406,39 +11433,34 @@ var TsGroup = class TsGroup {
11406
11433
  }
11407
11434
  accountStart(s, r) {
11408
11435
  const ancestry = this.ancestry(r.delivery);
11436
+ const d = r.delivery;
11409
11437
  this.accounting.runs.set(r.id, {
11410
11438
  order: ++this.accounting.next,
11411
- report: {
11412
- kind: "run accounting",
11413
- ...ancestry,
11414
- script: s.name,
11415
- run: r.id,
11416
- fuel: r.run.fuel,
11417
- state: "live"
11418
- }
11419
- });
11420
- this.drainReports.push({
11421
- kind: "run started",
11422
- ...ancestry,
11423
- script: s.name,
11424
- run: r.id,
11425
- ...r.delivery.id ? { delivery: r.delivery.id } : {},
11426
- ...r.delivery.fn ? { fn: r.delivery.fn } : { selector: r.delivery.message },
11427
- args: [...r.delivery.args]
11439
+ report: accountingReport(ancestry, s.name, r.id, r.run.fuel)
11428
11440
  });
11441
+ const started = { kind: "run started" };
11442
+ putAncestry(started, ancestry);
11443
+ started.script = s.name;
11444
+ started.run = r.id;
11445
+ if (d.id) started.delivery = d.id;
11446
+ if (d.fn) started.fn = d.fn;
11447
+ else started.selector = d.message;
11448
+ started.args = d.args.slice();
11449
+ this.drainReports.push(started);
11429
11450
  }
11430
11451
  accountEnd(r, state, reason) {
11431
11452
  const row = this.accounting.runs.get(r.id);
11432
11453
  if (row.report.state !== "live") return;
11433
11454
  row.report.fuel = r.run.fuel;
11434
11455
  row.report.state = state;
11435
- if (state === "discarded") this.drainReports.push({
11436
- kind: "run discarded",
11437
- ...this.ancestry(r.delivery),
11438
- script: row.report.script,
11439
- run: r.id,
11440
- reason
11441
- });
11456
+ if (state === "discarded") {
11457
+ const discarded = { kind: "run discarded" };
11458
+ putAncestry(discarded, this.ancestry(r.delivery));
11459
+ discarded.script = row.report.script;
11460
+ discarded.run = r.id;
11461
+ discarded.reason = reason;
11462
+ this.drainReports.push(discarded);
11463
+ }
11442
11464
  }
11443
11465
  accountDrop(d) {
11444
11466
  const a = this.ancestry(d);
@@ -11508,7 +11530,7 @@ var TsGroup = class TsGroup {
11508
11530
  for (const library of code.libraries.values()) visit(library);
11509
11531
  };
11510
11532
  for (const s of this.scripts) for (const code of s.loaded.units) visit(code, s.name);
11511
- for (const library of this.libraries.values()) visit(codeOf(library));
11533
+ for (const library of this.libraryMap.values()) visit(codeOf(library));
11512
11534
  return sources;
11513
11535
  }, (body, frame) => this.debugEvaluate(body, frame));
11514
11536
  }
@@ -11633,7 +11655,7 @@ var TsGroup = class TsGroup {
11633
11655
  return hexBytes(sha256(canonicalJSON({
11634
11656
  language: languageVersion,
11635
11657
  costModel: costModel.version,
11636
- libraries: [...this.libraries.values()].sort(byName).map((l) => [l.name, identityOf(l)]),
11658
+ libraries: [...this.libraryMap.values()].sort(byName).map((l) => [l.name, identityOf(l)]),
11637
11659
  scripts
11638
11660
  })));
11639
11661
  }
@@ -11675,7 +11697,7 @@ var TsGroup = class TsGroup {
11675
11697
  issued: this.issued,
11676
11698
  chargeCounter: this.chargeCounter,
11677
11699
  lastClock: this.lastClock,
11678
- libraries: this.libraries,
11700
+ libraries: this.libraryMap,
11679
11701
  name: this.savedName ?? this.name,
11680
11702
  objects: this.objects,
11681
11703
  randomState: this.randomState,
@@ -11714,8 +11736,8 @@ var TsGroup = class TsGroup {
11714
11736
  save.objects.forEach((object, i) => {
11715
11737
  objects[i].parent = object.parent === void 0 ? null : objects[object.parent];
11716
11738
  });
11717
- for (const library of o.libraries) group.libraries.set(library.name, library);
11718
- let mismatch = save.libraries.some((l) => !group.libraries.has(l.name) || identityOf(group.libraries.get(l.name)) !== hexOf(l.identity));
11739
+ for (const library of o.libraries) group.libraryMap.set(library.name, library);
11740
+ let mismatch = save.libraries.some((l) => !group.libraryMap.has(l.name) || identityOf(group.libraryMap.get(l.name)) !== hexOf(l.identity));
11719
11741
  let wholeGroup = save.language !== "1.0-rc.3" || save.costModel !== costModel.version;
11720
11742
  const changed = /* @__PURE__ */ new Set();
11721
11743
  let loadFailure;
@@ -11791,7 +11813,7 @@ var TsGroup = class TsGroup {
11791
11813
  mismatch ||= wholeGroup || changed.size > 0 || hexOf(group.fingerprint()) !== savedFingerprint;
11792
11814
  const partial = mismatch && !wholeGroup && o.onMismatch === "reload changed";
11793
11815
  const variablesOnly = mismatch && !partial;
11794
- const withheld = save.libraries.filter((l) => !group.libraries.has(l.name)).map((l) => l.name);
11816
+ const withheld = save.libraries.filter((l) => !group.libraryMap.has(l.name)).map((l) => l.name);
11795
11817
  const restoreLine = (result) => recordLine("restore", [], [
11796
11818
  ["from", saveId],
11797
11819
  ["mismatch", o.onMismatch === "variables only" ? "variables-only" : o.onMismatch === "reload changed" ? "reload-changed" : null],
@@ -12148,14 +12170,7 @@ var TsGroup = class TsGroup {
12148
12170
  });
12149
12171
  this.accounting.runs.set(rec.id, {
12150
12172
  order: rec.order,
12151
- report: {
12152
- kind: "run accounting",
12153
- ...this.ancestry(r.delivery),
12154
- script: script.name,
12155
- run: rec.id,
12156
- fuel: rec.fuel,
12157
- state: "live"
12158
- }
12173
+ report: accountingReport(this.ancestry(r.delivery), script.name, rec.id, rec.fuel)
12159
12174
  });
12160
12175
  markRest(r, {
12161
12176
  fuel: rec.segmentFuel,
@@ -13222,6 +13237,14 @@ var TsGroup = class TsGroup {
13222
13237
  scriptNames() {
13223
13238
  return this.scripts.map((s) => s.name);
13224
13239
  }
13240
+ /**
13241
+ * Any time, inside a Pump too. The user Libraries it holds now, as
13242
+ * `restore` takes them, including those `replaceLibrary` recompiled
13243
+ * (chapter 9); not a Host Input, and not traced.
13244
+ */
13245
+ libraries() {
13246
+ return [...this.libraryMap.values()];
13247
+ }
13225
13248
  queueInput(input, notify = true) {
13226
13249
  const landing = this.debugController?.current;
13227
13250
  if (landing && (input.action.k === "stop" || input.action.k === "cancel-run" || input.action.k === "rewind-run") && typeof input.line === "string") input.line += ` pc=${landing.pc}`;
@@ -13293,7 +13316,7 @@ var TsGroup = class TsGroup {
13293
13316
  const grants = new Map(Object.entries(o.grants ?? {}));
13294
13317
  if (grants.has("musical-clock")) throw new HostError("invalid value", `${MUSICAL_CLOCK} is the Group's own Grant name`);
13295
13318
  if ([...grants.values()].filter((g) => g.capability.name === "peer").length > 1) throw new HostError("invalid value", `Script ${o.name} has more than one peer Grant`);
13296
- const p = prepare("script", o.name, o.source, this.libraries, objects, declarationsOf(grants), void 0, {
13319
+ const p = prepare("script", o.name, o.source, this.libraryMap, objects, declarationsOf(grants), void 0, {
13297
13320
  ...propertyChecks(o.objects ?? {}, o.owner),
13298
13321
  forbidSuspension: o.forbidSuspension === true
13299
13322
  });
@@ -13369,7 +13392,7 @@ var TsGroup = class TsGroup {
13369
13392
  ["end", `${d.endLine}:${d.endCol}`]
13370
13393
  ]));
13371
13394
  }
13372
- replacement(s, source, carry, libraries = this.libraries, extensions = [], keepMailbox = false) {
13395
+ replacement(s, source, carry, libraries = this.libraryMap, extensions = [], keepMailbox = false) {
13373
13396
  const grants = availableGrants(s);
13374
13397
  const p = prepare("script", s.name, source, libraries, Object.keys(s.objects), declarationsOf(grants), void 0, {
13375
13398
  ...propertyChecks(s.objects, s.owner?.handle),
@@ -13419,20 +13442,20 @@ var TsGroup = class TsGroup {
13419
13442
  this.worker();
13420
13443
  this.requireKnownEffects();
13421
13444
  const s = this.scripts.find((s) => s.name === name);
13422
- const p = prepare("script", name, source, this.libraries);
13445
+ const p = prepare("script", name, source, this.libraryMap);
13423
13446
  this.trace?.(recordLine("reload", [name], [
13424
13447
  ["carry", carry === "carry variables" ? "yes" : "no"],
13425
13448
  ["mailbox", keepMailbox ? "keep" : null],
13426
13449
  ["source", displayText(source)],
13427
13450
  ["identity", p.identity]
13428
13451
  ], true));
13429
- const replacement = this.replacement(s, source, carry, this.libraries, [], keepMailbox);
13452
+ const replacement = this.replacement(s, source, carry, this.libraryMap, [], keepMailbox);
13430
13453
  return this.replaceScripts([{
13431
13454
  s,
13432
13455
  ...replacement
13433
13456
  }], keepMailbox);
13434
13457
  }
13435
- extension(s, source, libraries = this.libraries) {
13458
+ extension(s, source, libraries = this.libraryMap) {
13436
13459
  const name = `${s.name}+${s.units.length}`;
13437
13460
  const existing = {};
13438
13461
  const links = /* @__PURE__ */ new Map();
@@ -13586,12 +13609,12 @@ var TsGroup = class TsGroup {
13586
13609
  throw new HostError(code, message);
13587
13610
  };
13588
13611
  if (stdlibNames.has(l.name)) refuse("reserved name", `${l.name} is a stdlib Library's name`);
13589
- if (this.libraries.has(l.name)) refuse("name reused", `The Group already holds a Library ${l.name}`);
13612
+ if (this.libraryMap.has(l.name)) refuse("name reused", `The Group already holds a Library ${l.name}`);
13590
13613
  for (const i of l.imports.filter((i) => !stdlibNames.has(i.name))) {
13591
- const held = this.libraries.get(i.name);
13614
+ const held = this.libraryMap.get(i.name);
13592
13615
  if (!held || identityOf(held) !== identityOf(i)) refuse("library mismatch", `The Group doesn't hold the ${i.name} that ${l.name} imports`);
13593
13616
  }
13594
- this.libraries.set(l.name, l);
13617
+ this.libraryMap.set(l.name, l);
13595
13618
  }
13596
13619
  /** Worker. Prepare every dependent before changing the Group. */
13597
13620
  replaceLibrary(l, carry, o) {
@@ -13609,19 +13632,19 @@ var TsGroup = class TsGroup {
13609
13632
  throw new HostError(code);
13610
13633
  };
13611
13634
  if (stdlibNames.has(l.name)) refuse("reserved name");
13612
- if (!this.libraries.has(l.name)) refuse("library mismatch");
13635
+ if (!this.libraryMap.has(l.name)) refuse("library mismatch");
13613
13636
  for (const imported of l.imports.filter((i) => !stdlibNames.has(i.name))) {
13614
- const held = this.libraries.get(imported.name);
13637
+ const held = this.libraryMap.get(imported.name);
13615
13638
  if (!held || identityOf(held) !== identityOf(imported)) refuse("library mismatch");
13616
13639
  }
13617
13640
  let libraries;
13618
13641
  try {
13619
- libraries = replacementLibraries(this.libraries, l);
13642
+ libraries = replacementLibraries(this.libraryMap, l);
13620
13643
  } catch (error) {
13621
13644
  this.writeDiagnostics(error);
13622
13645
  throw error;
13623
13646
  }
13624
- const affected = new Set([...libraries].filter(([name, library]) => library !== this.libraries.get(name)).map(([name]) => name));
13647
+ const affected = new Set([...libraries].filter(([name, library]) => library !== this.libraryMap.get(name)).map(([name]) => name));
13625
13648
  affected.add(l.name);
13626
13649
  const replacements = this.scripts.filter((s) => s.units.some((u) => u.imports.some((i) => affected.has(i.name)))).map((s) => ({
13627
13650
  s,
@@ -13635,8 +13658,8 @@ var TsGroup = class TsGroup {
13635
13658
  this.discardReason = "stop";
13636
13659
  }
13637
13660
  if (this.effectStateUnknown) return reports;
13638
- this.libraries.clear();
13639
- for (const [name, library] of libraries) this.libraries.set(name, library);
13661
+ this.libraryMap.clear();
13662
+ for (const [name, library] of libraries) this.libraryMap.set(name, library);
13640
13663
  return reports;
13641
13664
  }
13642
13665
  hostFor(s, run, delivery) {
@@ -15039,24 +15062,24 @@ var TsGroup = class TsGroup {
15039
15062
  ...error ? { error } : {}
15040
15063
  });
15041
15064
  this.accountEnd(running, "terminal");
15042
- reports.push({
15043
- kind: "run end",
15044
- script: s.name,
15045
- run: running.id,
15046
- ...delivery.id ? { delivery: delivery.id } : {},
15047
- ...delivery.broadcast ? { broadcast: delivery.broadcast } : {},
15048
- ...handler ? { handler } : {},
15049
- ...fallback ? { fallback } : {},
15050
- ...outcome.kind === "cancelled" && outcome.cleanupFailed ? { cleanupFailed: "code" in outcome.cleanupFailed ? outcome.cleanupFailed : { limit: limitWord(outcome.cleanupFailed.limit) } } : {},
15051
- outcome: outcome.kind,
15052
- ...outcome.kind === "effect failed" ? { effect: outcome.effect } : {},
15053
- ...result ? { result } : {},
15054
- ...error ? { error: hostError(error) } : {},
15055
- ...limit ? { limit } : {},
15056
- ...outcome.kind === "errored" ? { at: location(outcome.at) } : outcome.kind === "limit fault" ? { at: location(outcome) } : {},
15057
- fuel: run.fuel,
15058
- alloc: run.alloc
15059
- });
15065
+ const end = { kind: "run end" };
15066
+ end.script = s.name;
15067
+ end.run = running.id;
15068
+ if (delivery.id) end.delivery = delivery.id;
15069
+ if (delivery.broadcast) end.broadcast = delivery.broadcast;
15070
+ if (handler) end.handler = handler;
15071
+ if (fallback) end.fallback = fallback;
15072
+ if (outcome.kind === "cancelled" && outcome.cleanupFailed) end.cleanupFailed = "code" in outcome.cleanupFailed ? outcome.cleanupFailed : { limit: limitWord(outcome.cleanupFailed.limit) };
15073
+ end.outcome = outcome.kind;
15074
+ if (outcome.kind === "effect failed") end.effect = outcome.effect;
15075
+ if (result) end.result = result;
15076
+ if (error) end.error = hostError(error);
15077
+ if (limit) end.limit = limit;
15078
+ if (outcome.kind === "errored") end.at = location(outcome.at);
15079
+ else if (outcome.kind === "limit fault") end.at = location(outcome);
15080
+ end.fuel = run.fuel;
15081
+ end.alloc = run.alloc;
15082
+ reports.push(end);
15060
15083
  if (outcome.kind === "errored" || outcome.kind === "limit fault" || outcome.kind === "cancelled" || outcome.kind === "dropped" || outcome.kind === "effect failed") this.seal(delivery, {
15061
15084
  verdict: "undecided",
15062
15085
  undecided: {
package/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { J as Value, cn as HttpClientImpl, gt as ObjectKindDef, ht as ObjectKind, ln as HttpImpl, tn as Group, x as PumpResult } from "./debug-2yfUZYzF.js";
2
+ import { J as Value, cn as HttpClientImpl, gt as ObjectKindDef, ht as ObjectKind, ln as HttpImpl, tn as Group, x as PumpResult } from "./debug-fthW6KN8.js";
3
3
  import { Buffer } from "node:buffer";
4
4
  //#region src/http/fetch.d.ts
5
5
  /** The largest response body `fetch` reads by default: 8 MiB. */
package/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { $ as instant, $n as NotImplementedError, $t as shape, A as ScriptSources, An as calendarCapability, Ar as SourceSpan, At as FireOp, B as restore, Bn as compileLibrary, Br as syntaxSelector, Bt as ReleaseHook, C as Report, Cn as LocaleImpl, Cr as NameRole, Ct as ChargeRequest, Dn as Costs, Dr as SemanticScope, Dt as EffectResult, E as RestoreResult, En as ConsoleImpl, Er as SemanticNode, Et as Cost, Fn as Library, Fr as SyntaxElement, Ft as Metering, G as RunStarted, Gn as Run, Gt as SegmentGrant, H as RunAccounting, Hn as LimitName, Ht as ScopeDecl, In as LibraryOptions, Ir as SyntaxErrorCode, It as Operation, J as Value, Jn as UnitLoadError, Jt as SuspendingOp, K as Decimal, Kn as RunRecord, Kt as SegmentLifecycle, L as TsScript, Ln as LibrarySource, Lr as SyntaxNode, Lt as Operations, Mn as consoleCapability, Mr as Mode, Mt as GrantContext, N as Settlement, Nn as musicalClockCapability, Nr as TokType, Nt as ImmediateOp, O as SaveOptions, On as MusicalClockImpl, Or as SemanticToken, Ot as ErrorDecl, P as TsGroup, Pn as timerCapability, Pr as Token, Pt as LimitReached, Q as dec, Qn as loadScript, Qt as operationDeclarations, R as Verdict, Rn as OperationRef, Rr as SyntaxRule, Rt as PlainArg, S as PumpedRequest, Sn as sqliteCapability, Sr as LibraryExport, St as CapabilityDefiner, T as RestoreOptions, Tn as CalendarImpl, Tr as SemanticName, Tt as CoordinatedLifecycle, U as RunAncestry, Un as Limits, Ut as SegmentContext, V as CausalWork, Vr as syntaxText, Vt as ReleaseReason, W as RunDiscarded, Wn as Outcome, Wt as SegmentCoordinator, X as bytes, Xn as defaultLimits, Xt as defineCapability, Y as bool, Yn as callFunction, Yt as conforms, Z as civilDate, Zn as deliver, Zt as explain, _ as LoadOptions, _n as SqlParams, _r as disassemble, _t as PropDef, an as PeerImpl, ar as LoadError, at as quantity, b as PumpOptions, bn as SqliteBinding, br as ExportKind, bt as Call, cn as HttpClientImpl, cr as SendFailedReason, d as Counters, dn as httpCapability, dr as CodeUnit, dt as nowMicros, en as Core, er as canConvert, f as Decided, fn as UserImpl, fr as EventBranch, ft as parseInstant, g as Inspection, gn as storeCapability, gr as UnwindEntry, gt as ObjectKindDef, h as GroupOptions, hn as add, hr as Operand, ht as ObjectKind, in as coreVersions, ir as LoadDiagnostic, it as num, jn as clockCapability, jr as Lexer, jt as Grant, k as ScriptCodeRequest, kn as TimerImpl, kr as SemanticTree, kt as FieldShape, l as CancellationOptions, ln as HttpImpl, lr as Body, lt as text, m as EffectFailure, mn as StoreImpl, mr as Instruction, mt as ObjectElements, nn as Script$1, nr as HostError, nt as map, on as peerCapability, or as MailboxFull, ot as range, p as Deciding, pn as userCapability, pr as EventEntry, pt as HostObject, q as Kind, qn as Script, qt as Shape, rn as Versions, rr as HostErrorCode, rt as nothing, sn as peerKind, sr as ScriptError, st as record, tn as Group, tr as waitUs, tt as list, u as CarryOver, un as HttpServerImpl, ur as BodyKind, ut as formatInstant, v as Message, vn as SqlRows, vr as Binding, vt as defineObjectKind, w as Requested, wn as localeCapability, wr as SemanticElement, wt as ChargeResult, x as PumpResult, xn as SqliteImpl, xr as FunctionContract, xt as CapabilityDef, y as PendingCall, yn as SqlValue, yr as BindingKind, yt as GrantDecls, z as newGroup, zn as codeIdentity, zr as Trivia, zt as PlainResult } from "./debug-2yfUZYzF.js";
2
+ import { $ as instant, $n as NotImplementedError, $t as shape, A as ScriptSources, An as calendarCapability, Ar as SourceSpan, At as FireOp, B as restore, Bn as compileLibrary, Br as syntaxSelector, Bt as ReleaseHook, C as Report, Cn as LocaleImpl, Cr as NameRole, Ct as ChargeRequest, Dn as Costs, Dr as SemanticScope, Dt as EffectResult, E as RestoreResult, En as ConsoleImpl, Er as SemanticNode, Et as Cost, Fn as Library, Fr as SyntaxElement, Ft as Metering, G as RunStarted, Gn as Run, Gt as SegmentGrant, H as RunAccounting, Hn as LimitName, Ht as ScopeDecl, In as LibraryOptions, Ir as SyntaxErrorCode, It as Operation, J as Value, Jn as UnitLoadError, Jt as SuspendingOp, K as Decimal, Kn as RunRecord, Kt as SegmentLifecycle, L as TsScript, Ln as LibrarySource, Lr as SyntaxNode, Lt as Operations, Mn as consoleCapability, Mr as Mode, Mt as GrantContext, N as Settlement, Nn as musicalClockCapability, Nr as TokType, Nt as ImmediateOp, O as SaveOptions, On as MusicalClockImpl, Or as SemanticToken, Ot as ErrorDecl, P as TsGroup, Pn as timerCapability, Pr as Token, Pt as LimitReached, Q as dec, Qn as loadScript, Qt as operationDeclarations, R as Verdict, Rn as OperationRef, Rr as SyntaxRule, Rt as PlainArg, S as PumpedRequest, Sn as sqliteCapability, Sr as LibraryExport, St as CapabilityDefiner, T as RestoreOptions, Tn as CalendarImpl, Tr as SemanticName, Tt as CoordinatedLifecycle, U as RunAncestry, Un as Limits, Ut as SegmentContext, V as CausalWork, Vr as syntaxText, Vt as ReleaseReason, W as RunDiscarded, Wn as Outcome, Wt as SegmentCoordinator, X as bytes, Xn as defaultLimits, Xt as defineCapability, Y as bool, Yn as callFunction, Yt as conforms, Z as civilDate, Zn as deliver, Zt as explain, _ as LoadOptions, _n as SqlParams, _r as disassemble, _t as PropDef, an as PeerImpl, ar as LoadError, at as quantity, b as PumpOptions, bn as SqliteBinding, br as ExportKind, bt as Call, cn as HttpClientImpl, cr as SendFailedReason, d as Counters, dn as httpCapability, dr as CodeUnit, dt as nowMicros, en as Core, er as canConvert, f as Decided, fn as UserImpl, fr as EventBranch, ft as parseInstant, g as Inspection, gn as storeCapability, gr as UnwindEntry, gt as ObjectKindDef, h as GroupOptions, hn as add, hr as Operand, ht as ObjectKind, in as coreVersions, ir as LoadDiagnostic, it as num, jn as clockCapability, jr as Lexer, jt as Grant, k as ScriptCodeRequest, kn as TimerImpl, kr as SemanticTree, kt as FieldShape, l as CancellationOptions, ln as HttpImpl, lr as Body, lt as text, m as EffectFailure, mn as StoreImpl, mr as Instruction, mt as ObjectElements, nn as Script$1, nr as HostError, nt as map, on as peerCapability, or as MailboxFull, ot as range, p as Deciding, pn as userCapability, pr as EventEntry, pt as HostObject, q as Kind, qn as Script, qt as Shape, rn as Versions, rr as HostErrorCode, rt as nothing, sn as peerKind, sr as ScriptError, st as record, tn as Group, tr as waitUs, tt as list, u as CarryOver, un as HttpServerImpl, ur as BodyKind, ut as formatInstant, v as Message, vn as SqlRows, vr as Binding, vt as defineObjectKind, w as Requested, wn as localeCapability, wr as SemanticElement, wt as ChargeResult, x as PumpResult, xn as SqliteImpl, xr as FunctionContract, xt as CapabilityDef, y as PendingCall, yn as SqlValue, yr as BindingKind, yt as GrantDecls, z as newGroup, zn as codeIdentity, zr as Trivia, zt as PlainResult } from "./debug-fthW6KN8.js";
3
3
  import { n as registerStdlib, r as stdlibNames, t as StdlibLibrary } from "./stdlib-registry-BwitI3Ox.js";
4
- import { $ as grammar, A as FromValueOptions, B as SemanticResult, C as handlersOf, D as shapeData, E as ShapeData, F as talk, G as ParseError, H as checkSyntax, I as CheckOptions, J as RecoveryDiagnostic, K as ParseResult, L as CheckResult, M as ToValueOptions, N as fromValue, O as kindNames, P as toValue, Q as builtins, R as Diagnostic, S as ScriptWithHandlers, T as encodeJson, U as EntryKind, V as checkSource, W as EntryResult, X as parseSource, Y as parseEntry, Z as parseSourceRecovering, _ as createGroup, a as LoweringError, c as lowerTree, d as exportManifest, et as units, f as zoneRules, g as CreateGroupOptions, h as inlineGrants, i as CompileResult, j as PlainValue, k as encodeValue, l as ManifestSpec, m as InlineOperation, n as declarationStart, o as compileSource, p as InlineFunction, q as RecoveringParseResult, r as CompileOptions, s as exportsOf, t as validMessageSelector, u as MessageDecl, w as decodeJson, x as Handlers, y as DrivenGroup, z as DiagnosticCode } from "./lean-DU_muGpT.js";
5
- import { n as createCore, t as TsCore } from "./core-Dwec7SRy.js";
6
- import { a as decodeValue, o as readDisplay, t as FunctionResolver } from "./readers-IhVpgXkj.js";
4
+ import { $ as grammar, A as FromValueOptions, B as SemanticResult, C as handlersOf, D as shapeData, E as ShapeData, F as talk, G as ParseError, H as checkSyntax, I as CheckOptions, J as RecoveryDiagnostic, K as ParseResult, L as CheckResult, M as ToValueOptions, N as fromValue, O as kindNames, P as toValue, Q as builtins, R as Diagnostic, S as ScriptWithHandlers, T as encodeJson, U as EntryKind, V as checkSource, W as EntryResult, X as parseSource, Y as parseEntry, Z as parseSourceRecovering, _ as createGroup, a as LoweringError, c as lowerTree, d as exportManifest, et as units, f as zoneRules, g as CreateGroupOptions, h as inlineGrants, i as CompileResult, j as PlainValue, k as encodeValue, l as ManifestSpec, m as InlineOperation, n as declarationStart, o as compileSource, p as InlineFunction, q as RecoveringParseResult, r as CompileOptions, s as exportsOf, t as validMessageSelector, u as MessageDecl, w as decodeJson, x as Handlers, y as DrivenGroup, z as DiagnosticCode } from "./lean-BAz1NuyP.js";
5
+ import { n as createCore, t as TsCore } from "./core-kBXyAo-m.js";
6
+ import { a as decodeValue, o as readDisplay, t as FunctionResolver } from "./readers-DW4pUrD-.js";
7
7
  import { n as stdlibSources, t as allStdlib } from "./index-CBuczWK0.js";
8
8
  export { type Binding, type BindingKind, type Body, type BodyKind, type CalendarImpl, type Call, type CancellationOptions, type CapabilityDef, type CapabilityDefiner, type CarryOver, type CausalWork, type ChargeRequest, type ChargeResult, type CheckOptions, type CheckResult, type CodeUnit, type CompileOptions, type CompileResult, Script as CompiledScript, type ConsoleImpl, type CoordinatedLifecycle, type Core, type Cost, type Costs, type Counters, type CreateGroupOptions, type Decided, type Deciding, Decimal, type Diagnostic, type DiagnosticCode, type DrivenGroup, type EffectFailure, type EffectResult, type EntryKind, type EntryResult, type ErrorDecl, type EventBranch, type EventEntry, type ExportKind, type FieldShape, type FireOp, type FromValueOptions, type FunctionContract, type FunctionResolver, type Grant, type GrantContext, type GrantDecls, type Group, type GroupOptions, type Handlers, HostError, type HostErrorCode, type HostObject, type HttpClientImpl, type HttpImpl, type HttpServerImpl, type ImmediateOp, type InlineFunction, type InlineOperation, type Inspection, type Instruction, type Kind, Lexer, type Library, type LibraryExport, type LibraryOptions, type LibrarySource, type LimitName, LimitReached, type Limits, type LoadDiagnostic, LoadError, type LoadOptions, type LocaleImpl, LoweringError, MailboxFull, type ManifestSpec, type Message, type MessageDecl, type Metering, type Mode, type MusicalClockImpl, type NameRole, NotImplementedError, type ObjectElements, type ObjectKind, type ObjectKindDef, type Operand, type Operation, type OperationRef, type Operations, type Outcome, ParseError, type ParseResult, type PeerImpl, type PendingCall, type PlainArg, type PlainResult, type PlainValue, type PropDef, type PumpOptions, type PumpResult, type PumpedRequest, type RecoveringParseResult, type RecoveryDiagnostic, type ReleaseHook, type ReleaseReason, type Report, type Requested, type RestoreOptions, type RestoreResult, Run, type RunAccounting, type RunAncestry, type RunDiscarded, type RunRecord, type RunStarted, type SaveOptions, type ScopeDecl, type Script$1 as Script, type ScriptCodeRequest, ScriptError, type ScriptSources, type ScriptWithHandlers, type SegmentContext, type SegmentCoordinator, type SegmentGrant, type SegmentLifecycle, type SemanticElement, type SemanticName, type SemanticNode, type SemanticResult, type SemanticScope, type SemanticToken, type SemanticTree, type SendFailedReason, type Settlement, type Shape, type ShapeData, type SourceSpan, type SqlParams, type SqlRows, type SqlValue, type SqliteBinding, type SqliteImpl, type StdlibLibrary, type StoreImpl, type SuspendingOp, type SyntaxElement, type SyntaxErrorCode, type SyntaxNode, type SyntaxRule, type TimerImpl, type ToValueOptions, type TokType, type Token, type Trivia, type TsCore, TsGroup, TsScript, UnitLoadError, type UnwindEntry, type UserImpl, Value, type Verdict, type Versions, add, allStdlib, bool, builtins, bytes, calendarCapability, callFunction, canConvert, checkSource, checkSyntax, civilDate, clockCapability, codeIdentity, compileLibrary, compileSource, conforms, consoleCapability, coreVersions, createCore, createGroup, dec, declarationStart, decodeJson, decodeValue, defaultLimits, defineCapability, defineObjectKind, deliver, disassemble, encodeJson, encodeValue, explain, exportManifest, exportsOf, formatInstant, fromValue, grammar, handlersOf, httpCapability, inlineGrants, instant, kindNames, list, loadScript, localeCapability, lowerTree, map, musicalClockCapability, newGroup, nothing, nowMicros, num, operationDeclarations, parseEntry, parseInstant, parseSource, parseSourceRecovering, peerCapability, peerKind, quantity, range, readDisplay, record, registerStdlib, restore, shape, shapeData, sqliteCapability, stdlibNames, stdlibSources, storeCapability, syntaxSelector, syntaxText, talk, text, timerCapability, toValue, units, userCapability, validMessageSelector, waitUs, zoneRules };
package/index.js CHANGED
@@ -7,7 +7,7 @@ import { list as list$1 } from "./stdlib/list.js";
7
7
  import { map as map$1 } from "./stdlib/map.js";
8
8
  import { units as units$1 } from "./stdlib/units.js";
9
9
  import { D as instant, H as num, J as range, K as quantity, L as map, N as list, Qt as parseInstant, V as nothing, Xt as nowMicros, Y as record, b as dec, c as Decimal, d as bytes, g as civilDate, hn as grammar, i as ScriptError, it as text, l as Value, n as LoadError, pn as builtins, qt as formatInstant, r as MailboxFull, t as HostError, u as bool, vn as units } from "./errors-CNc-xY_9.js";
10
- import { S as registerStdlib, _ as loadScript, b as exportsOf, c as codeIdentity, d as Run, f as Script, g as deliver, h as defaultLimits, i as restore, l as compileLibrary, m as callFunction, n as TsScript, p as UnitLoadError, r as newGroup, t as TsGroup, v as LoweringError, w as stdlibNames, x as lowerTree, y as compileSource } from "./group--dcl0em8.js";
10
+ import { S as registerStdlib, _ as loadScript, b as exportsOf, c as codeIdentity, d as Run, f as Script, g as deliver, h as defaultLimits, i as restore, l as compileLibrary, m as callFunction, n as TsScript, p as UnitLoadError, r as newGroup, t as TsGroup, v as LoweringError, w as stdlibNames, x as lowerTree, y as compileSource } from "./group-dgTtB1Pi.js";
11
11
  import { t as defineObjectKind } from "./objects-OKVLH190.js";
12
12
  import { At as validMessageSelector, Dt as shape, Et as operationDeclarations, Mt as Lexer, U as waitUs, bt as defineCapability, c as canConvert, et as disassemble, gt as LimitReached, t as NotImplementedError, vt as conforms, wt as explain } from "./operations-DrsedOvj.js";
13
13
  import { a as syntaxText, c as parseSource, i as syntaxSelector, l as parseSourceRecovering, o as ParseError, p as declarationStart, r as checkSyntax, s as parseEntry, t as checkSource, v as shapeData, y as kindNames } from "./checker-hkWO1UbN.js";
@@ -17,7 +17,7 @@ import { a as clockCapability, d as timerCapability, i as calendarCapability, o
17
17
  import { a as peerKind, i as peerCapability } from "./peer-capability-RMdN4OHj.js";
18
18
  import { a as httpCapability, c as toValue, i as handlersOf, l as talk, n as inlineGrants, o as sqliteCapability, s as fromValue, t as zoneRules } from "./zone-rules-Cn-f9u_Z.js";
19
19
  import { o as decodeJson, s as encodeJson } from "./http-fetch-CLAeEXVi.js";
20
- import { n as createCore, r as coreVersions, t as createGroup } from "./lean-BtbKWkXA.js";
20
+ import { n as createCore, r as coreVersions, t as createGroup } from "./lean-BwszbUJl.js";
21
21
  import { n as localeCapability, t as userCapability } from "./user-capability-CzoLN3RK.js";
22
22
  import { r as storeCapability, t as add } from "./store-capability-Db6v_dw9.js";
23
23
  //#region src/generated/stdlib.ts
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { Ar as SourceSpan, Er as SemanticNode, Fn as Library, Ir as SyntaxErrorCode, J as Value, K as Decimal, Lr as SyntaxNode, Pr as Token, Sr as LibraryExport, _ as LoadOptions, dr as CodeUnit, en as Core, ht as ObjectKind, jt as Grant, kr as SemanticTree, nn as Script, qt as Shape, tn as Group, vr as Binding, yt as GrantDecls } from "./debug-2yfUZYzF.js";
3
- import { n as Drive, r as DrivenGroupOptions } from "./driver-CT-ksM-N.js";
2
+ import { Ar as SourceSpan, Er as SemanticNode, Fn as Library, Ir as SyntaxErrorCode, J as Value, K as Decimal, Lr as SyntaxNode, Pr as Token, Sr as LibraryExport, _ as LoadOptions, dr as CodeUnit, en as Core, ht as ObjectKind, jt as Grant, kr as SemanticTree, nn as Script, qt as Shape, tn as Group, vr as Binding, yt as GrantDecls } from "./debug-fthW6KN8.js";
3
+ import { n as Drive, r as DrivenGroupOptions } from "./driver-DtOBRKiH.js";
4
4
  //#region src/generated/syntax.d.ts
5
5
  declare const grammar: {
6
6
  reserved: string[];
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { fn as unicodeVersion } from "./errors-CNc-xY_9.js";
3
- import { i as restore, l as compileLibrary, r as newGroup, s as stateFingerprint } from "./group--dcl0em8.js";
3
+ import { i as restore, l as compileLibrary, r as newGroup, s as stateFingerprint } from "./group-dgTtB1Pi.js";
4
4
  import { t as defineObjectKind } from "./objects-OKVLH190.js";
5
5
  import { bt as defineCapability, dt as costModel, pt as languageVersion } from "./operations-DrsedOvj.js";
6
6
  import { a as clockCapability, d as timerCapability, i as calendarCapability, o as consoleCapability, u as musicalClockCapability } from "./encoding-DlMqlP2Y.js";
@@ -13,7 +13,7 @@ const coreVersions = Object.freeze({
13
13
  language: languageVersion,
14
14
  costModel: String(costModel.version),
15
15
  unicode: unicodeVersion,
16
- core: "ts/0.10.0",
16
+ core: "ts/0.11.0",
17
17
  saveFormat: String(1)
18
18
  });
19
19
  //#endregion
package/lean.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { $ as instant, $n as NotImplementedError, $t as shape, A as ScriptSources, An as calendarCapability, Ar as SourceSpan, At as FireOp, B as restore, Bn as compileLibrary, Br as syntaxSelector, Bt as ReleaseHook, C as Report, Cn as LocaleImpl, Cr as NameRole, Ct as ChargeRequest, Dn as Costs, Dr as SemanticScope, Dt as EffectResult, E as RestoreResult, En as ConsoleImpl, Er as SemanticNode, Et as Cost, Fn as Library, Fr as SyntaxElement, Ft as Metering, G as RunStarted, Gn as Run, Gt as SegmentGrant, H as RunAccounting, Hn as LimitName, Ht as ScopeDecl, In as LibraryOptions, Ir as SyntaxErrorCode, It as Operation, J as Value, Jn as UnitLoadError, Jt as SuspendingOp, K as Decimal, Kn as RunRecord, Kt as SegmentLifecycle, L as TsScript, Ln as LibrarySource, Lr as SyntaxNode, Lt as Operations, Mn as consoleCapability, Mr as Mode, Mt as GrantContext, N as Settlement, Nn as musicalClockCapability, Nr as TokType, Nt as ImmediateOp, O as SaveOptions, On as MusicalClockImpl, Or as SemanticToken, Ot as ErrorDecl, P as TsGroup, Pn as timerCapability, Pr as Token, Pt as LimitReached, Q as dec, Qn as loadScript, Qt as operationDeclarations, R as Verdict, Rn as OperationRef, Rr as SyntaxRule, Rt as PlainArg, S as PumpedRequest, Sn as sqliteCapability, Sr as LibraryExport, St as CapabilityDefiner, T as RestoreOptions, Tn as CalendarImpl, Tr as SemanticName, Tt as CoordinatedLifecycle, U as RunAncestry, Un as Limits, Ut as SegmentContext, V as CausalWork, Vr as syntaxText, Vt as ReleaseReason, W as RunDiscarded, Wn as Outcome, Wt as SegmentCoordinator, X as bytes, Xn as defaultLimits, Xt as defineCapability, Y as bool, Yn as callFunction, Yt as conforms, Z as civilDate, Zn as deliver, Zt as explain, _ as LoadOptions, _n as SqlParams, _r as disassemble, _t as PropDef, an as PeerImpl, ar as LoadError, at as quantity, b as PumpOptions, bn as SqliteBinding, br as ExportKind, bt as Call, cn as HttpClientImpl, cr as SendFailedReason, d as Counters, dn as httpCapability, dr as CodeUnit, dt as nowMicros, en as Core, er as canConvert, f as Decided, fn as UserImpl, fr as EventBranch, ft as parseInstant, g as Inspection, gn as storeCapability, gr as UnwindEntry, gt as ObjectKindDef, h as GroupOptions, hn as add, hr as Operand, ht as ObjectKind, in as coreVersions, ir as LoadDiagnostic, it as num, jn as clockCapability, jr as Lexer, jt as Grant, k as ScriptCodeRequest, kn as TimerImpl, kr as SemanticTree, kt as FieldShape, l as CancellationOptions, ln as HttpImpl, lr as Body, lt as text, m as EffectFailure, mn as StoreImpl, mr as Instruction, mt as ObjectElements, nn as Script$1, nr as HostError, nt as map, on as peerCapability, or as MailboxFull, ot as range, p as Deciding, pn as userCapability, pr as EventEntry, pt as HostObject, q as Kind, qn as Script, qt as Shape, rn as Versions, rr as HostErrorCode, rt as nothing, sn as peerKind, sr as ScriptError, st as record, tn as Group, tr as waitUs, tt as list, u as CarryOver, un as HttpServerImpl, ur as BodyKind, ut as formatInstant, v as Message, vn as SqlRows, vr as Binding, vt as defineObjectKind, w as Requested, wn as localeCapability, wr as SemanticElement, wt as ChargeResult, x as PumpResult, xn as SqliteImpl, xr as FunctionContract, xt as CapabilityDef, y as PendingCall, yn as SqlValue, yr as BindingKind, yt as GrantDecls, z as newGroup, zn as codeIdentity, zr as Trivia, zt as PlainResult } from "./debug-2yfUZYzF.js";
2
+ import { $ as instant, $n as NotImplementedError, $t as shape, A as ScriptSources, An as calendarCapability, Ar as SourceSpan, At as FireOp, B as restore, Bn as compileLibrary, Br as syntaxSelector, Bt as ReleaseHook, C as Report, Cn as LocaleImpl, Cr as NameRole, Ct as ChargeRequest, Dn as Costs, Dr as SemanticScope, Dt as EffectResult, E as RestoreResult, En as ConsoleImpl, Er as SemanticNode, Et as Cost, Fn as Library, Fr as SyntaxElement, Ft as Metering, G as RunStarted, Gn as Run, Gt as SegmentGrant, H as RunAccounting, Hn as LimitName, Ht as ScopeDecl, In as LibraryOptions, Ir as SyntaxErrorCode, It as Operation, J as Value, Jn as UnitLoadError, Jt as SuspendingOp, K as Decimal, Kn as RunRecord, Kt as SegmentLifecycle, L as TsScript, Ln as LibrarySource, Lr as SyntaxNode, Lt as Operations, Mn as consoleCapability, Mr as Mode, Mt as GrantContext, N as Settlement, Nn as musicalClockCapability, Nr as TokType, Nt as ImmediateOp, O as SaveOptions, On as MusicalClockImpl, Or as SemanticToken, Ot as ErrorDecl, P as TsGroup, Pn as timerCapability, Pr as Token, Pt as LimitReached, Q as dec, Qn as loadScript, Qt as operationDeclarations, R as Verdict, Rn as OperationRef, Rr as SyntaxRule, Rt as PlainArg, S as PumpedRequest, Sn as sqliteCapability, Sr as LibraryExport, St as CapabilityDefiner, T as RestoreOptions, Tn as CalendarImpl, Tr as SemanticName, Tt as CoordinatedLifecycle, U as RunAncestry, Un as Limits, Ut as SegmentContext, V as CausalWork, Vr as syntaxText, Vt as ReleaseReason, W as RunDiscarded, Wn as Outcome, Wt as SegmentCoordinator, X as bytes, Xn as defaultLimits, Xt as defineCapability, Y as bool, Yn as callFunction, Yt as conforms, Z as civilDate, Zn as deliver, Zt as explain, _ as LoadOptions, _n as SqlParams, _r as disassemble, _t as PropDef, an as PeerImpl, ar as LoadError, at as quantity, b as PumpOptions, bn as SqliteBinding, br as ExportKind, bt as Call, cn as HttpClientImpl, cr as SendFailedReason, d as Counters, dn as httpCapability, dr as CodeUnit, dt as nowMicros, en as Core, er as canConvert, f as Decided, fn as UserImpl, fr as EventBranch, ft as parseInstant, g as Inspection, gn as storeCapability, gr as UnwindEntry, gt as ObjectKindDef, h as GroupOptions, hn as add, hr as Operand, ht as ObjectKind, in as coreVersions, ir as LoadDiagnostic, it as num, jn as clockCapability, jr as Lexer, jt as Grant, k as ScriptCodeRequest, kn as TimerImpl, kr as SemanticTree, kt as FieldShape, l as CancellationOptions, ln as HttpImpl, lr as Body, lt as text, m as EffectFailure, mn as StoreImpl, mr as Instruction, mt as ObjectElements, nn as Script$1, nr as HostError, nt as map, on as peerCapability, or as MailboxFull, ot as range, p as Deciding, pn as userCapability, pr as EventEntry, pt as HostObject, q as Kind, qn as Script, qt as Shape, rn as Versions, rr as HostErrorCode, rt as nothing, sn as peerKind, sr as ScriptError, st as record, tn as Group, tr as waitUs, tt as list, u as CarryOver, un as HttpServerImpl, ur as BodyKind, ut as formatInstant, v as Message, vn as SqlRows, vr as Binding, vt as defineObjectKind, w as Requested, wn as localeCapability, wr as SemanticElement, wt as ChargeResult, x as PumpResult, xn as SqliteImpl, xr as FunctionContract, xt as CapabilityDef, y as PendingCall, yn as SqlValue, yr as BindingKind, yt as GrantDecls, z as newGroup, zn as codeIdentity, zr as Trivia, zt as PlainResult } from "./debug-fthW6KN8.js";
3
3
  import { n as registerStdlib, r as stdlibNames, t as StdlibLibrary } from "./stdlib-registry-BwitI3Ox.js";
4
- import { $ as grammar, A as FromValueOptions, B as SemanticResult, C as handlersOf, D as shapeData, E as ShapeData, F as talk, G as ParseError, H as checkSyntax, I as CheckOptions, J as RecoveryDiagnostic, K as ParseResult, L as CheckResult, M as ToValueOptions, N as fromValue, O as kindNames, P as toValue, Q as builtins, R as Diagnostic, S as ScriptWithHandlers, T as encodeJson, U as EntryKind, V as checkSource, W as EntryResult, X as parseSource, Y as parseEntry, Z as parseSourceRecovering, _ as createGroup, a as LoweringError, c as lowerTree, d as exportManifest, et as units, f as zoneRules, g as CreateGroupOptions, h as inlineGrants, i as CompileResult, j as PlainValue, k as encodeValue, l as ManifestSpec, m as InlineOperation, n as declarationStart, o as compileSource, p as InlineFunction, q as RecoveringParseResult, r as CompileOptions, s as exportsOf, t as validMessageSelector, u as MessageDecl, w as decodeJson, x as Handlers, y as DrivenGroup, z as DiagnosticCode } from "./lean-DU_muGpT.js";
5
- import { n as createCore, t as TsCore } from "./core-Dwec7SRy.js";
6
- import { a as decodeValue, o as readDisplay, t as FunctionResolver } from "./readers-IhVpgXkj.js";
4
+ import { $ as grammar, A as FromValueOptions, B as SemanticResult, C as handlersOf, D as shapeData, E as ShapeData, F as talk, G as ParseError, H as checkSyntax, I as CheckOptions, J as RecoveryDiagnostic, K as ParseResult, L as CheckResult, M as ToValueOptions, N as fromValue, O as kindNames, P as toValue, Q as builtins, R as Diagnostic, S as ScriptWithHandlers, T as encodeJson, U as EntryKind, V as checkSource, W as EntryResult, X as parseSource, Y as parseEntry, Z as parseSourceRecovering, _ as createGroup, a as LoweringError, c as lowerTree, d as exportManifest, et as units, f as zoneRules, g as CreateGroupOptions, h as inlineGrants, i as CompileResult, j as PlainValue, k as encodeValue, l as ManifestSpec, m as InlineOperation, n as declarationStart, o as compileSource, p as InlineFunction, q as RecoveringParseResult, r as CompileOptions, s as exportsOf, t as validMessageSelector, u as MessageDecl, w as decodeJson, x as Handlers, y as DrivenGroup, z as DiagnosticCode } from "./lean-BAz1NuyP.js";
5
+ import { n as createCore, t as TsCore } from "./core-kBXyAo-m.js";
6
+ import { a as decodeValue, o as readDisplay, t as FunctionResolver } from "./readers-DW4pUrD-.js";
7
7
  export { type Binding, type BindingKind, type Body, type BodyKind, type CalendarImpl, type Call, type CancellationOptions, type CapabilityDef, type CapabilityDefiner, type CarryOver, type CausalWork, type ChargeRequest, type ChargeResult, type CheckOptions, type CheckResult, type CodeUnit, type CompileOptions, type CompileResult, Script as CompiledScript, type ConsoleImpl, type CoordinatedLifecycle, type Core, type Cost, type Costs, type Counters, type CreateGroupOptions, type Decided, type Deciding, Decimal, type Diagnostic, type DiagnosticCode, type DrivenGroup, type EffectFailure, type EffectResult, type EntryKind, type EntryResult, type ErrorDecl, type EventBranch, type EventEntry, type ExportKind, type FieldShape, type FireOp, type FromValueOptions, type FunctionContract, type FunctionResolver, type Grant, type GrantContext, type GrantDecls, type Group, type GroupOptions, type Handlers, HostError, type HostErrorCode, type HostObject, type HttpClientImpl, type HttpImpl, type HttpServerImpl, type ImmediateOp, type InlineFunction, type InlineOperation, type Inspection, type Instruction, type Kind, Lexer, type Library, type LibraryExport, type LibraryOptions, type LibrarySource, type LimitName, LimitReached, type Limits, type LoadDiagnostic, LoadError, type LoadOptions, type LocaleImpl, LoweringError, MailboxFull, type ManifestSpec, type Message, type MessageDecl, type Metering, type Mode, type MusicalClockImpl, type NameRole, NotImplementedError, type ObjectElements, type ObjectKind, type ObjectKindDef, type Operand, type Operation, type OperationRef, type Operations, type Outcome, ParseError, type ParseResult, type PeerImpl, type PendingCall, type PlainArg, type PlainResult, type PlainValue, type PropDef, type PumpOptions, type PumpResult, type PumpedRequest, type RecoveringParseResult, type RecoveryDiagnostic, type ReleaseHook, type ReleaseReason, type Report, type Requested, type RestoreOptions, type RestoreResult, Run, type RunAccounting, type RunAncestry, type RunDiscarded, type RunRecord, type RunStarted, type SaveOptions, type ScopeDecl, type Script$1 as Script, type ScriptCodeRequest, ScriptError, type ScriptSources, type ScriptWithHandlers, type SegmentContext, type SegmentCoordinator, type SegmentGrant, type SegmentLifecycle, type SemanticElement, type SemanticName, type SemanticNode, type SemanticResult, type SemanticScope, type SemanticToken, type SemanticTree, type SendFailedReason, type Settlement, type Shape, type ShapeData, type SourceSpan, type SqlParams, type SqlRows, type SqlValue, type SqliteBinding, type SqliteImpl, type StdlibLibrary, type StoreImpl, type SuspendingOp, type SyntaxElement, type SyntaxErrorCode, type SyntaxNode, type SyntaxRule, type TimerImpl, type ToValueOptions, type TokType, type Token, type Trivia, type TsCore, TsGroup, TsScript, UnitLoadError, type UnwindEntry, type UserImpl, Value, type Verdict, type Versions, add, bool, builtins, bytes, calendarCapability, callFunction, canConvert, checkSource, checkSyntax, civilDate, clockCapability, codeIdentity, compileLibrary, compileSource, conforms, consoleCapability, coreVersions, createCore, createGroup, dec, declarationStart, decodeJson, decodeValue, defaultLimits, defineCapability, defineObjectKind, deliver, disassemble, encodeJson, encodeValue, explain, exportManifest, exportsOf, formatInstant, fromValue, grammar, handlersOf, httpCapability, inlineGrants, instant, kindNames, list, loadScript, localeCapability, lowerTree, map, musicalClockCapability, newGroup, nothing, nowMicros, num, operationDeclarations, parseEntry, parseInstant, parseSource, parseSourceRecovering, peerCapability, peerKind, quantity, range, readDisplay, record, registerStdlib, restore, shape, shapeData, sqliteCapability, stdlibNames, storeCapability, syntaxSelector, syntaxText, talk, text, timerCapability, toValue, units, userCapability, validMessageSelector, waitUs, zoneRules };
package/lean.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { D as instant, H as num, J as range, K as quantity, L as map, N as list, Qt as parseInstant, V as nothing, Xt as nowMicros, Y as record, b as dec, c as Decimal, d as bytes, g as civilDate, hn as grammar, i as ScriptError, it as text, l as Value, n as LoadError, pn as builtins, qt as formatInstant, r as MailboxFull, t as HostError, u as bool, vn as units } from "./errors-CNc-xY_9.js";
3
- import { S as registerStdlib, _ as loadScript, b as exportsOf, c as codeIdentity, d as Run, f as Script, g as deliver, h as defaultLimits, i as restore, l as compileLibrary, m as callFunction, n as TsScript, p as UnitLoadError, r as newGroup, t as TsGroup, v as LoweringError, w as stdlibNames, x as lowerTree, y as compileSource } from "./group--dcl0em8.js";
3
+ import { S as registerStdlib, _ as loadScript, b as exportsOf, c as codeIdentity, d as Run, f as Script, g as deliver, h as defaultLimits, i as restore, l as compileLibrary, m as callFunction, n as TsScript, p as UnitLoadError, r as newGroup, t as TsGroup, v as LoweringError, w as stdlibNames, x as lowerTree, y as compileSource } from "./group-dgTtB1Pi.js";
4
4
  import { t as defineObjectKind } from "./objects-OKVLH190.js";
5
5
  import { At as validMessageSelector, Dt as shape, Et as operationDeclarations, Mt as Lexer, U as waitUs, bt as defineCapability, c as canConvert, et as disassemble, gt as LimitReached, t as NotImplementedError, vt as conforms, wt as explain } from "./operations-DrsedOvj.js";
6
6
  import { a as syntaxText, c as parseSource, i as syntaxSelector, l as parseSourceRecovering, o as ParseError, p as declarationStart, r as checkSyntax, s as parseEntry, t as checkSource, v as shapeData, y as kindNames } from "./checker-hkWO1UbN.js";
@@ -10,7 +10,7 @@ import { a as clockCapability, d as timerCapability, i as calendarCapability, o
10
10
  import { a as peerKind, i as peerCapability } from "./peer-capability-RMdN4OHj.js";
11
11
  import { a as httpCapability, c as toValue, i as handlersOf, l as talk, n as inlineGrants, o as sqliteCapability, s as fromValue, t as zoneRules } from "./zone-rules-Cn-f9u_Z.js";
12
12
  import { o as decodeJson, s as encodeJson } from "./http-fetch-CLAeEXVi.js";
13
- import { n as createCore, r as coreVersions, t as createGroup } from "./lean-BtbKWkXA.js";
13
+ import { n as createCore, r as coreVersions, t as createGroup } from "./lean-BwszbUJl.js";
14
14
  import { n as localeCapability, t as userCapability } from "./user-capability-CzoLN3RK.js";
15
15
  import { r as storeCapability, t as add } from "./store-capability-Db6v_dw9.js";
16
16
  export { Script as CompiledScript, Decimal, HostError, Lexer, LimitReached, LoadError, LoweringError, MailboxFull, NotImplementedError, ParseError, Run, ScriptError, TsGroup, TsScript, UnitLoadError, Value, add, bool, builtins, bytes, calendarCapability, callFunction, canConvert, checkSource, checkSyntax, civilDate, clockCapability, codeIdentity, compileLibrary, compileSource, conforms, consoleCapability, coreVersions, createCore, createGroup, dec, declarationStart, decodeJson, decodeValue, defaultLimits, defineCapability, defineObjectKind, deliver, disassemble, encodeJson, encodeValue, explain, exportManifest, exportsOf, formatInstant, fromValue, grammar, handlersOf, httpCapability, inlineGrants, instant, kindNames, list, loadScript, localeCapability, lowerTree, map, musicalClockCapability, newGroup, nothing, nowMicros, num, operationDeclarations, parseEntry, parseInstant, parseSource, parseSourceRecovering, peerCapability, peerKind, quantity, range, readDisplay, record, registerStdlib, restore, shape, shapeData, sqliteCapability, stdlibNames, storeCapability, syntaxSelector, syntaxText, talk, text, timerCapability, toValue, units, userCapability, validMessageSelector, waitUs, zoneRules };
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { i as JsonObject, n as Json, r as JsonNumber, s as readOrderedJSON } from "./readers-IhVpgXkj.js";
3
- import { n as decodeBinaryValue, r as encodeBinaryValue, t as BinaryValueOptions } from "./binary-value-B8W4W_e1.js";
2
+ import { i as JsonObject, n as Json, r as JsonNumber, s as readOrderedJSON } from "./readers-DW4pUrD-.js";
3
+ import { n as decodeBinaryValue, r as encodeBinaryValue, t as BinaryValueOptions } from "./binary-value-np-QZCfn.js";
4
4
  //#region src/request-pump-binary.d.ts
5
5
  export declare const requestPumpFeature: "request-pump-fields-v1";
6
6
  export declare const callbacksFeature: "callbacks-fields-v1";
package/notify.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { a as changed, i as WatchLimits, n as RouterOptions, o as createRouter, r as RoutingResult, t as NotificationRouter } from "./router-2vjYbqx3.js";
2
+ import { a as changed, i as WatchLimits, n as RouterOptions, o as createRouter, r as RoutingResult, t as NotificationRouter } from "./router-D6b7VJ92.js";
3
3
  export { type NotificationRouter, type RouterOptions, type RoutingResult, type WatchLimits, changed, createRouter };
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { Bn as compileLibrary, C as Report, Cn as LocaleImpl, D as RunEvent, E as RestoreResult, F as TsGroupOptions, Fn as Library, Ht as ScopeDecl, I as TsRestoreOptions, J as Value, L as TsScript, M as SessionPort, P as TsGroup, Tn as CalendarImpl, Un as Limits, Vn as replacementLibraries, ar as LoadError, bn as SqliteBinding, g as Inspection, gt as ObjectKindDef, ht as ObjectKind, j as SessionControls, jt as Grant, pt as HostObject, qt as Shape, t as DebugController, xt as CapabilityDef, yt as GrantDecls } from "./debug-2yfUZYzF.js";
2
+ import { Bn as compileLibrary, C as Report, Cn as LocaleImpl, D as RunEvent, E as RestoreResult, F as TsGroupOptions, Fn as Library, Ht as ScopeDecl, I as TsRestoreOptions, J as Value, L as TsScript, M as SessionPort, P as TsGroup, Tn as CalendarImpl, Un as Limits, Vn as replacementLibraries, ar as LoadError, bn as SqliteBinding, g as Inspection, gt as ObjectKindDef, ht as ObjectKind, j as SessionControls, jt as Grant, pt as HostObject, qt as Shape, t as DebugController, xt as CapabilityDef, yt as GrantDecls } from "./debug-fthW6KN8.js";
3
3
  //#region src/setup.d.ts
4
4
  type ShapeSpec = string | {
5
5
  quantity: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northtalk/ts",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "NorthTalk, a readable scripting language for embedding: the TS Core, its Session Host and Standard Capabilities.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/peer.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { J as Value, P as TsGroup, an as PeerImpl } from "./debug-2yfUZYzF.js";
2
+ import { J as Value, P as TsGroup, an as PeerImpl } from "./debug-fthW6KN8.js";
3
3
  //#region src/peer-message-port.d.ts
4
4
  /** What the link needs of a `MessagePort`, a `Worker` or a worker's `self`. */
5
5
  type PortEndpoint = {
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { J as Value } from "./debug-2yfUZYzF.js";
2
+ import { J as Value } from "./debug-fthW6KN8.js";
3
3
  //#region src/readers.d.ts
4
4
  /** Finds the Host Object a reader names by its kind and id, or none. */
5
5
  type ObjectResolver = (kind: string, id: string) => {
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { E as RestoreResult, I as TsRestoreOptions, J as Value, Mt as GrantContext, O as SaveOptions, P as TsGroup, bt as Call, tn as Group } from "./debug-2yfUZYzF.js";
3
- import { t as TsCore } from "./core-Dwec7SRy.js";
2
+ import { E as RestoreResult, I as TsRestoreOptions, J as Value, Mt as GrantContext, O as SaveOptions, P as TsGroup, bt as Call, tn as Group } from "./debug-fthW6KN8.js";
3
+ import { t as TsCore } from "./core-kBXyAo-m.js";
4
4
  //#region src/notify/router.d.ts
5
5
  /** A Store's four limits on its watches (Store Notifications, Limits). */
6
6
  type WatchLimits = {
package/session.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { J as Value } from "./debug-2yfUZYzF.js";
3
- import { C as Setup, _ as UserPrompt, a as ReplayOptions, c as parseTranscript, d as DebugAction, f as MOCK_ARGUMENTS, g as SourcePlacement, h as SessionHost, i as parseEnvelope, l as replayTranscript, m as SessionEnvironment, n as ObjectReference, o as Replayed, p as Mock, r as SessionObjects, s as TranscriptItem, t as Envelope, u as writeTranscript, v as Waiting } from "./objects-DoyEohtr.js";
2
+ import { J as Value } from "./debug-fthW6KN8.js";
3
+ import { C as Setup, _ as UserPrompt, a as ReplayOptions, c as parseTranscript, d as DebugAction, f as MOCK_ARGUMENTS, g as SourcePlacement, h as SessionHost, i as parseEnvelope, l as replayTranscript, m as SessionEnvironment, n as ObjectReference, o as Replayed, p as Mock, r as SessionObjects, s as TranscriptItem, t as Envelope, u as writeTranscript, v as Waiting } from "./objects-Cpc3eO-f.js";
4
4
  //#region src/session/describe.d.ts
5
5
  /** One declaration of the session source, as `:describe` reads it. */
6
6
  type DeclaredName = {
package/session.js CHANGED
@@ -1,6 +1,6 @@
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--dcl0em8.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
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
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";
@@ -2928,7 +2928,10 @@ var SessionHost = class {
2928
2928
  this.deadline = void 0;
2929
2929
  return this.discarded(reports);
2930
2930
  }
2931
- 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 });
2932
2935
  if (how === "add") this.setup0 = immutableSetup({
2933
2936
  ...this.setup0,
2934
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-2yfUZYzF.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-DoyEohtr.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,6 +1,6 @@
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--dcl0em8.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
5
  import { Dt as shape, Et as operationDeclarations } from "./operations-DrsedOvj.js";
6
6
  import { r as MUSICAL_CLOCK } from "./encoding-DlMqlP2Y.js";
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-2yfUZYzF.js";
3
- import { a as Stores, r as StoreQuotas } from "./engine-DP_lqWfI.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/store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { n as RouterOptions } from "./router-2vjYbqx3.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-DP_lqWfI.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/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-2yfUZYzF.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-DU_muGpT.js";
4
- import { a as decodeValue, n as Json, o as readDisplay } from "./readers-IhVpgXkj.js";
5
- import { t as BinaryValueOptions } from "./binary-value-B8W4W_e1.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?: {
package/wasm.js CHANGED
@@ -410,6 +410,7 @@ const decodeJsonView = (view, j) => decodeView(view, j);
410
410
  //#endregion
411
411
  //#region src/wasm/group.ts
412
412
  const key = (kind, id) => `${kind}\u0000${id}`;
413
+ const sameBytes = (a, b) => a.length === b.length && a.every((x, i) => x === b[i]);
413
414
  const isLimitReached = (error) => error instanceof Error && error.name === "LimitReached";
414
415
  const propertyFailure = (details, detail) => {
415
416
  details.push(detail);
@@ -519,6 +520,8 @@ var WasmGroup = class {
519
520
  /** Calls a restore left pending, until the first Pump. */
520
521
  #restored = /* @__PURE__ */ new Map();
521
522
  #restoring = null;
523
+ /** The Libraries the Host gave or `libraries()` made, by name, latest last. */
524
+ #libraries = /* @__PURE__ */ new Map();
522
525
  #exchanging = 0;
523
526
  #combining = false;
524
527
  /** Answers given while their call was starting, sent once the exchange ends. */
@@ -1090,6 +1093,29 @@ var WasmGroup = class {
1090
1093
  scriptNames() {
1091
1094
  return [...this.#scripts.keys()];
1092
1095
  }
1096
+ /**
1097
+ * The user Libraries the guest holds, in add order. One a Library
1098
+ * replacement recompiled is compiled again here, against the Libraries
1099
+ * before it, so a restore can install it.
1100
+ */
1101
+ libraries() {
1102
+ const held = [];
1103
+ const now = /* @__PURE__ */ new Map();
1104
+ for (const item of listOf(field(this.send("libraries"), "libraries"))) {
1105
+ const name = textOf(field(item, "name"));
1106
+ const identity = bytesOfFrame(field(item, "identity"));
1107
+ let library = this.#libraries.get(name);
1108
+ if (!library) throw new HostError("library mismatch", `${name} isn't known here`);
1109
+ if (!sameBytes(library.identity, identity)) {
1110
+ library = this.#core.recompile(library, library.imports.map((l) => now.get(l.name) ?? l));
1111
+ if (!sameBytes(library.identity, identity)) throw new HostError("library mismatch", `${name} compiled differently`);
1112
+ this.#libraries.set(name, library);
1113
+ }
1114
+ now.set(name, library);
1115
+ held.push(library);
1116
+ }
1117
+ return held;
1118
+ }
1093
1119
  #grantHandles(grants) {
1094
1120
  return Object.fromEntries(Object.entries(grants).map(([name, g]) => [name, this.#session.grant(g)]));
1095
1121
  }
@@ -1124,14 +1150,17 @@ var WasmGroup = class {
1124
1150
  addLibrary(l) {
1125
1151
  this.#core.install(this.#session, l);
1126
1152
  this.worker("add-library", { identity: bytesFrame(l.identity) });
1153
+ this.#libraries.set(l.name, l);
1127
1154
  }
1128
1155
  replaceLibrary(l, carry, o) {
1129
1156
  this.#core.install(this.#session, l);
1130
- return this.lifecycle("replace-library", {
1157
+ const reports = this.lifecycle("replace-library", {
1131
1158
  identity: bytesFrame(l.identity),
1132
1159
  carry,
1133
1160
  keepMailbox: o?.keepMailbox
1134
1161
  });
1162
+ this.#libraries.set(l.name, l);
1163
+ return reports;
1135
1164
  }
1136
1165
  /** @internal Reload and Library replacement end Runs and settle their futures. */
1137
1166
  lifecycle(m, fields) {
@@ -1391,7 +1420,10 @@ var WasmGroup = class {
1391
1420
  }
1392
1421
  /** @internal */
1393
1422
  restore(save, o) {
1394
- for (const l of o.libraries) this.#core.install(this.#session, l);
1423
+ for (const l of o.libraries) {
1424
+ this.#core.install(this.#session, l);
1425
+ this.#libraries.set(l.name, l);
1426
+ }
1395
1427
  this.#session.syncKinds();
1396
1428
  this.#restoring = o;
1397
1429
  let ok;
@@ -1724,6 +1756,7 @@ var WasmCore = class {
1724
1756
  this.#groupCore = {
1725
1757
  session: () => this.#session(),
1726
1758
  install: (session, library) => this.#install(session, library),
1759
+ recompile: (library, imports) => this.compileLibrary(library, imports, this.#declarations.get(library)),
1727
1760
  kind: (name) => this.#kinds.find((k) => k.name === name)
1728
1761
  };
1729
1762
  }