@northtalk/ts 0.6.0 → 0.8.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 (57) hide show
  1. package/{binary-value-C4ZiXVjv.d.ts → binary-value-B93hEK7l.d.ts} +1 -1
  2. package/{checker-CUhn2XaM.js → checker-Q4w7rLXk.js} +600 -85
  3. package/{core-egHbNmve.d.ts → core-BBPI6EhG.d.ts} +1 -1
  4. package/{debug--Of4MSLw.d.ts → debug-s6QIovKS.d.ts} +142 -10
  5. package/debug.d.ts +1 -1
  6. package/debug.js +1 -1
  7. package/{driver-BIm1mL77.d.ts → driver-D5yrK3Nu.d.ts} +1 -1
  8. package/driver.d.ts +1 -1
  9. package/driver.js +1 -1
  10. package/encoding-B7MCQ4ii.js +338 -0
  11. package/{engine-DbDcopGM.d.ts → engine-Dy-BCoiw.d.ts} +2 -2
  12. package/{engine-CXf5FCwi.js → engine-OL1BveVZ.js} +6 -6
  13. package/{errors-D11zizZg.js → errors-VuwK669R.js} +157 -23
  14. package/{group-BpzTo0k4.js → group-Ccuqwq12.js} +477 -110
  15. package/{http-fetch-DFwVIOQg.js → http-fetch--O27xjSW.js} +2 -2
  16. package/http.d.ts +1 -1
  17. package/http.js +4 -4
  18. package/index.d.ts +6 -6
  19. package/index.js +15 -14
  20. package/{inline-grants-XbX9HL_w.js → inline-grants-DmOdgSoK.js} +4 -5
  21. package/{lean-aCvN6y52.js → lean-BjhQvHyr.js} +13 -8
  22. package/{lean-DiS9rUcn.d.ts → lean-D6DQfbqH.d.ts} +42 -7
  23. package/lean.d.ts +6 -6
  24. package/lean.js +15 -14
  25. package/{manifest-CCfpn0kC.js → manifest-BeViDIoy.js} +4 -3
  26. package/{manifest-mpivREn-.d.ts → manifest-l07K7nW-.d.ts} +4 -2
  27. package/message-layer.d.ts +2 -2
  28. package/message-layer.js +2 -2
  29. package/notify.d.ts +1 -1
  30. package/notify.js +1 -1
  31. package/{objects-DmUc0lha.js → objects-TarIKBL8.js} +1 -1
  32. package/{objects-DYq_YvaQ.d.ts → objects-q0lnCK-4.d.ts} +8 -3
  33. package/{operations-DnCcztkZ.js → operations-BAELnqwf.js} +133 -58
  34. package/package.json +5 -1
  35. package/peer-capability-B8eKbljR.js +151 -0
  36. package/peer.d.ts +180 -0
  37. package/peer.js +559 -0
  38. package/{readers-8WCimMop.d.ts → readers-AeB1bJ--.d.ts} +1 -1
  39. package/{readers-CsvlahLi.js → readers-BG8g59qS.js} +1 -1
  40. package/{request-pump-binary-oqjWFqZA.js → request-pump-binary-87klb6sX.js} +9 -4
  41. package/{router-BZ-aYeXA.js → router-DXmPA-qi.js} +4 -4
  42. package/{router-BQsO8aPV.d.ts → router-DXoJ_2Z4.d.ts} +2 -2
  43. package/session.d.ts +2 -2
  44. package/session.js +64 -16
  45. package/setup.d.ts +3 -2
  46. package/setup.js +14 -16
  47. package/sqlite.d.ts +2 -2
  48. package/sqlite.js +5 -5
  49. package/{store-DHlo6fP5.js → store-DzpyWjt2.js} +2 -2
  50. package/store-capability-CxQJ_Huz.js +187 -0
  51. package/store.d.ts +2 -2
  52. package/store.js +2 -2
  53. package/{user-capability-BcRQyyEw.js → user-capability-ClYd8Vln.js} +3 -4
  54. package/wasm.d.ts +13 -6
  55. package/wasm.js +47 -19
  56. package/encoding-RUuES_e4.js +0 -99
  57. package/store-capability-BrUUAwVS.js +0 -389
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { B as restore, Mn as compileLibrary, Zt as Core, vt as defineObjectKind, z as newGroup } from "./debug--Of4MSLw.js";
2
+ import { B as restore, Bn as compileLibrary, en as Core, vt as defineObjectKind, z as newGroup } from "./debug-s6QIovKS.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
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
2
  //#region src/syntax.d.ts
3
- type SyntaxErrorCode = 'unterminated interpolation' | 'empty interpolation' | 'invalid text escape' | 'invalid text indentation' | 'invalid text delimiter' | 'bad character' | 'unterminated text' | 'bad unit' | 'unit without number' | 'unexpected token' | 'not a container';
3
+ type SyntaxErrorCode = 'unterminated interpolation' | 'empty interpolation' | 'invalid text escape' | 'invalid text indentation' | 'invalid text delimiter' | 'bad character' | 'unterminated text' | 'bad unit' | 'unit without number' | 'unexpected token' | 'reserved word' | 'repeat with' | 'not a container';
4
4
  /** All offsets index the original TS string; line and col count Unicode scalars. */
5
5
  type Trivia = {
6
6
  col: number;
@@ -10,7 +10,7 @@ type Trivia = {
10
10
  pos: number;
11
11
  raw: string;
12
12
  };
13
- type SyntaxRule = 'Source' | 'Entry' | 'Error' | 'Declaration' | 'Use' | 'Handler' | 'Parameter' | 'Function' | 'Block' | 'Body' | 'Statement' | 'SimpleStatement' | 'ExpressionList' | 'Container' | 'AndWait' | 'ResultTarget' | 'Send' | 'AskTell' | 'TellBlock' | 'TimeoutBlock' | 'OperationLine' | 'Wait' | 'Event' | 'If' | 'Repeat' | 'Collecting' | 'Match' | 'Try' | 'OfferClause' | 'OfferParameter' | 'RecoveryMarker' | 'ChooseOffer' | 'Replace' | 'IgnoringCase' | 'Expression' | 'Lambda' | 'Whose' | 'EveryHead' | 'WhoseKey' | 'Default' | 'Or' | 'And' | 'Not' | 'Comparison' | 'Concat' | 'Range' | 'Additive' | 'Multiplicative' | 'Power' | 'Unary' | 'Conversion' | 'Kind' | 'ChunkLevel' | 'Postfix' | 'Key' | 'Call' | 'Primary' | 'Interpolated' | 'Chunk' | 'The' | 'List' | 'MapKey' | 'Map' | 'Pattern' | 'PatternPrimary' | 'TextPattern' | 'Alternation' | 'Element' | 'Atom' | 'BinaryPattern' | 'Field' | 'AsText' | 'FieldType' | 'BinaryBuild' | 'Name' | 'MessageName' | 'Label';
13
+ type SyntaxRule = 'Source' | 'Entry' | 'Error' | 'Declaration' | 'Use' | 'ShapeExpr' | 'ShapeTerm' | 'ShapeMap' | 'ShapeField' | 'Handler' | 'Parameter' | 'Function' | 'Block' | 'Body' | 'Statement' | 'SimpleStatement' | 'ExpressionList' | 'Container' | 'AndWait' | 'ResultTarget' | 'Send' | 'AskTell' | 'TellBlock' | 'TimeoutBlock' | 'OperationLine' | 'Wait' | 'Event' | 'If' | 'Repeat' | 'Collecting' | 'Match' | 'Try' | 'OfferClause' | 'OfferParameter' | 'RecoveryMarker' | 'ChooseOffer' | 'Replace' | 'IgnoringCase' | 'Expression' | 'Lambda' | 'Whose' | 'EveryHead' | 'WhoseKey' | 'Default' | 'Or' | 'And' | 'Not' | 'Comparison' | 'Concat' | 'Range' | 'Additive' | 'Multiplicative' | 'Power' | 'Unary' | 'Conversion' | 'Kind' | 'ChunkLevel' | 'Postfix' | 'Key' | 'Call' | 'Primary' | 'Interpolated' | 'Chunk' | 'The' | 'List' | 'MapKey' | 'Map' | 'Pattern' | 'PatternPrimary' | 'TextPattern' | 'Alternation' | 'Element' | 'Atom' | 'BinaryPattern' | 'Field' | 'AsText' | 'FieldType' | 'BinaryBuild' | 'Name' | 'MessageName' | 'Label';
14
14
  type SyntaxElement = SyntaxNode | Token;
15
15
  /** Children are ordered and own each source character exactly once. Spans include trivia. */
16
16
  type SyntaxNode = {
@@ -95,6 +95,8 @@ type LibraryExport = ExportKind | {
95
95
  contract?: FunctionContract;
96
96
  kind: ExportKind;
97
97
  maySuspend?: boolean;
98
+ /** A Constant declared with `shape` (ADR 0168). */
99
+ shape?: boolean;
98
100
  };
99
101
  type Binding = {
100
102
  contract?: FunctionContract;
@@ -107,6 +109,8 @@ type Binding = {
107
109
  kind: BindingKind;
108
110
  name: string;
109
111
  scope: number;
112
+ /** A Constant declared with `shape`, which `is a` may name (ADR 0168). */
113
+ shape?: boolean;
110
114
  span: SourceSpan | null;
111
115
  };
112
116
  type SemanticScope = {
@@ -718,6 +722,20 @@ type Body = {
718
722
  params: string[];
719
723
  policy?: 'queued' | 'dropping' | 'replacing';
720
724
  start: number;
725
+ /**
726
+ * For a Handler Clause, where its dispatch tests start, so a failure can be
727
+ * explained in the Trace (ADR 0172): each Clause Shape's first instruction,
728
+ * its argument and Shape, then the Guard's. Tooling-only, never saved.
729
+ */
730
+ tests?: {
731
+ guardAt: number;
732
+ shapes: {
733
+ arg: number;
734
+ at: number;
735
+ definition?: number;
736
+ kind?: string;
737
+ }[];
738
+ };
721
739
  };
722
740
  type UnwindEntry = {
723
741
  depth: number;
@@ -960,6 +978,15 @@ type Deadline = {
960
978
  at: bigint;
961
979
  k: 'deadline';
962
980
  };
981
+ /** Why dispatch skipped a named clause (ADR 0172). */
982
+ type ClauseMismatch = {
983
+ argument?: number;
984
+ clause: number;
985
+ reason: 'arity' | 'pattern' | 'shape' | 'guard';
986
+ /** For `shape`, the Shape data the argument failed, if it is known. */
987
+ shape?: Value;
988
+ value?: Value;
989
+ };
963
990
  type Dispatch = {
964
991
  args: Value[];
965
992
  clauses: Body[];
@@ -1202,7 +1229,8 @@ type Suspension = ({
1202
1229
  abort: AbortController;
1203
1230
  call: CallContext;
1204
1231
  k: 'ask';
1205
- ms: number;
1232
+ /** Its own deadline, or null for the musical clock's, which has none. */
1233
+ ms: number | null;
1206
1234
  } | {
1207
1235
  args: Value[];
1208
1236
  id: string;
@@ -1532,6 +1560,15 @@ declare class Run {
1532
1560
  private clause;
1533
1561
  /** Its entry dispatch reached the Fallback Handler's clauses (ADR 0064). */
1534
1562
  private viaFallback;
1563
+ /**
1564
+ * Why dispatch skipped each named clause of the entry Delivery, for the
1565
+ * Trace's `mismatches` (ADR 0172). Tooling-only, never saved or charged.
1566
+ */
1567
+ mismatches: ClauseMismatch[];
1568
+ private stepFrame;
1569
+ private stepPc;
1570
+ private priorFrame;
1571
+ private priorPc;
1535
1572
  private during;
1536
1573
  /** Its Fuel when its cancellation cleanup began, if it has been cancelled. */
1537
1574
  private cleanupFrom;
@@ -1646,6 +1683,7 @@ declare class Run {
1646
1683
  get ended(): Outcome | null;
1647
1684
  private push;
1648
1685
  private dispatch;
1686
+ private mismatchOf;
1649
1687
  /** Whether a dispatch has a clause left to try after the current one. */
1650
1688
  private static more;
1651
1689
  private get frame();
@@ -1682,6 +1720,15 @@ declare class Run {
1682
1720
  * The Group calls this only when no tooling observes the steps.
1683
1721
  */
1684
1722
  fastSteps(room: number): void;
1723
+ /**
1724
+ * `fastSteps`' charge for writing a key its Map already has, with the new
1725
+ * Map version left as the measured result; or nothing, for `step`. The
1726
+ * entry count doesn't change, so the result's charge is the Map's.
1727
+ */
1728
+ private fastSetKeyCharge;
1729
+ /** `fastSteps`' charge for calling the unit's own Handler, whose first clause takes the arguments. */
1730
+ private fastCallHandlerCharge;
1731
+ private fastCallHandler;
1685
1732
  /**
1686
1733
  * Run instructions, fast and general, while they spend less than `room`
1687
1734
  * Fuel and the Group has nothing to do between them: none writes a record
@@ -1876,6 +1923,12 @@ declare class Run {
1876
1923
  private fillDefaults;
1877
1924
  private functionValue;
1878
1925
  private popArgs;
1926
+ /**
1927
+ * `wait q` in a Musical Unit (chapter 5): `wait 0 bars` goes straight on;
1928
+ * any other count calls the Group's musical clock with `q`, as an
1929
+ * `ask … and wait` would, or raises `no musical time` without one.
1930
+ */
1931
+ private musicalWait;
1879
1932
  /**
1880
1933
  * A Capability call (chapter 9): the arguments checked against their
1881
1934
  * Shapes, uncharged; the declared cost; the Host function, which may
@@ -1941,7 +1994,9 @@ type LibraryOptions = {
1941
1994
  /**
1942
1995
  * Compile a Library, once per process for each code identity. `imports` holds
1943
1996
  * every Library its `use` lines name, other than the stdlib's, which are
1944
- * always there. Throws LoadError.
1997
+ * always there. `declarations` holds the Operations of every Capability its
1998
+ * code calls, built with `operationDeclarations`; without them each `ask` or
1999
+ * `tell` fails with `unknown operation`. Throws LoadError.
1945
2000
  */
1946
2001
  declare const compileLibrary: (src: LibrarySource, imports?: readonly Library[], declarations?: GrantDecls, options?: LibraryOptions) => Library;
1947
2002
  /** Recompile the complete dependent Library graph without changing its registrations. */
@@ -1957,10 +2012,25 @@ type TimerImpl = {
1957
2012
  cancel(call: Call<unknown>, name: string): void;
1958
2013
  schedule(call: Call<unknown>, name: string, at: Value, message: string, args: Value): void;
1959
2014
  };
2015
+ /**
2016
+ * A musical clock (ADR 0166): `wait` receives the Quantity a Script waits
2017
+ * for, a whole number of bars or beats, 1 or more. The Host answers the call
2018
+ * with Nothing when that many lines have passed on its Transport, or fails it.
2019
+ */
2020
+ type MusicalClockImpl = {
2021
+ wait(call: Call<unknown>, count: Value): void;
2022
+ };
1960
2023
  /** The Pump's Clock reading; there is no Host clock implementation. */
1961
2024
  declare const clockCapability: (costs: Costs) => CapabilityDef<void>;
1962
2025
  /** The Host owns durable timers, scoped by Script and name. */
1963
2026
  declare const timerCapability: (impl: TimerImpl, costs: Costs) => CapabilityDef<unknown>;
2027
+ /**
2028
+ * The musical clock a Group's `musicalClock` option takes (chapter 9): one
2029
+ * suspending `wait`, with no `maxPending`, that Scripts call through a plain
2030
+ * `wait` in a Musical Unit. Only the Core makes it, since `wait` can't name
2031
+ * a Host's Operation.
2032
+ */
2033
+ declare const musicalClockCapability: (impl: MusicalClockImpl, costs: Costs, release?: ReleaseHook<unknown>) => CapabilityDef<unknown>;
1964
2034
  /** The Host shows Values in text form and answers read with a line of text. */
1965
2035
  declare const consoleCapability: (impl: ConsoleImpl, costs: Costs) => CapabilityDef<unknown>;
1966
2036
  type CalendarImpl = {
@@ -2104,6 +2174,34 @@ type HttpImpl = HttpServerImpl | HttpClientImpl | (HttpServerImpl & HttpClientIm
2104
2174
  */
2105
2175
  declare const httpCapability: (impl: HttpImpl, costs: Costs) => CapabilityDef<unknown>;
2106
2176
  //#endregion
2177
+ //#region src/peer-capability.d.ts
2178
+ declare const peerKind: ObjectKind<unknown>;
2179
+ /**
2180
+ * The Host's side of `peer` (chapter 9, The `peer` factory). `expose`,
2181
+ * `reach` and `call` start suspending calls, answered through the Call;
2182
+ * `expose` hears `null` for an unnamed exposure. `unexpose` hears a name or
2183
+ * a Peer. `post` and `call` hear the Peer, the Selector and the arguments,
2184
+ * which may hold Peers. `caller` gives the Caller Identity recorded for
2185
+ * `call.delivery`, or Nothing. The optional `release` is the Grant release
2186
+ * hook, for withdrawing the exposures a Grant made when it stops being
2187
+ * effective.
2188
+ */
2189
+ type PeerImpl = {
2190
+ call(call: Call<unknown>, peer: HostObject, message: string, args: Value[]): void;
2191
+ caller(call: Call<unknown>): Value;
2192
+ /** No name makes a new unnamed exposure. */
2193
+ expose(call: Call<unknown>, name?: string): void;
2194
+ post(call: Call<unknown>, peer: HostObject, message: string, args: Value[]): void;
2195
+ reach(call: Call<unknown>, address: string): void;
2196
+ release?(context: GrantContext<unknown>): void;
2197
+ unexpose(call: Call<unknown>, exposure: string | HostObject): void;
2198
+ };
2199
+ /**
2200
+ * Optional for Hosts. The binding is the Host's own description of the
2201
+ * names the Grant may `reach` and `expose`; the Core never reads it.
2202
+ */
2203
+ declare const peerCapability: (impl: PeerImpl, costs: Costs) => CapabilityDef<unknown>;
2204
+ //#endregion
2107
2205
  //#region src/versions.d.ts
2108
2206
  type Versions = {
2109
2207
  core: string;
@@ -2130,7 +2228,13 @@ type Core = {
2130
2228
  defineObjectKind<N>(k: ObjectKindDef<N>): ObjectKind<N>;
2131
2229
  httpCapability: typeof httpCapability;
2132
2230
  localeCapability: typeof localeCapability;
2231
+ /** A musical clock for the Group option `musicalClock` (ADR 0166). */
2232
+ musicalClockCapability: typeof musicalClockCapability;
2133
2233
  newGroup(o: GroupOptions): Group;
2234
+ /** Optional for Hosts (ADR 0153). */
2235
+ peerCapability: typeof peerCapability;
2236
+ /** The Core-fixed Object Kind of a Peer, which the Host makes Peers with. */
2237
+ readonly peerKind: ObjectKind<unknown>;
2134
2238
  restore(save: Uint8Array, o: RestoreOptions): {
2135
2239
  group: Group;
2136
2240
  result: RestoreResult;
@@ -2169,7 +2273,9 @@ type Group = {
2169
2273
  }): HostObject<N>;
2170
2274
  objectById(kind: string, id: string): HostObject | undefined;
2171
2275
  pump(now: bigint, o?: PumpOptions): PumpResult;
2172
- replaceLibrary(l: Library, carry: CarryOver): Report[];
2276
+ replaceLibrary(l: Library, carry: CarryOver, o?: {
2277
+ keepMailbox?: boolean;
2278
+ }): Report[];
2173
2279
  request(to: HostObject, m: Message, o?: CancellationOptions): Requested;
2174
2280
  requestPump(to: HostObject, m: Message, now: bigint, o?: PumpOptions & CancellationOptions): PumpedRequest;
2175
2281
  save(): Uint8Array;
@@ -2500,6 +2606,16 @@ type CapabilityDefiner<B> = <const O extends Record<string, OpDecl>>(name: strin
2500
2606
  */
2501
2607
  declare function defineCapability<const O extends Record<string, OpDecl>>(name: string, ops: Operations<void, O>, lifecycle?: SegmentLifecycle<void> | CoordinatedLifecycle<void>, release?: ReleaseHook<void>): CapabilityDef<void>;
2502
2608
  declare function defineCapability<B>(): CapabilityDefiner<B>;
2609
+ /**
2610
+ * The Operation declarations a Library's Capability calls are checked
2611
+ * against, for `compileLibrary`'s `declarations`. Takes CapabilityDefs, keyed
2612
+ * by their names, or a map from the name each is granted under.
2613
+ */
2614
+ declare const operationDeclarations: (capabilities: ReadonlyMap<string, CapabilityDef<unknown>> | Iterable<CapabilityDef<unknown>>) => GrantDecls;
2615
+ /** True exactly when `v` fits `s`, with a Capability argument's acceptance (ADR 0176). */
2616
+ declare const conforms: (v: Value, s: Shape) => boolean;
2617
+ /** The `explain` Built-in's report for `v` against `s` (ADR 0176). */
2618
+ declare const explain: (v: Value, s: Shape) => Value;
2503
2619
  //#endregion
2504
2620
  //#region src/effects.d.ts
2505
2621
  type OperationMode = 'immediate' | 'suspending' | 'fire-and-forget';
@@ -2781,6 +2897,12 @@ type AccountingReport = RunStarted | RunDiscarded | RunAccounting | CausalWork;
2781
2897
  //#endregion
2782
2898
  //#region src/group.d.ts
2783
2899
  type GroupOptions = {
2900
+ /**
2901
+ * The Host's musical clock, from `musicalClockCapability`, which a `wait`
2902
+ * in a Musical Unit calls; without one it raises `no musical time`
2903
+ * (chapter 9, The musical clock).
2904
+ */
2905
+ musicalClock?: CapabilityDef<unknown>;
2784
2906
  name: string;
2785
2907
  /**
2786
2908
  * Called once per queued Host Input. Don't pump inside it.
@@ -2849,6 +2971,8 @@ type TsRestoreOptions = RestoreOptions & {
2849
2971
  session?: SessionPort;
2850
2972
  };
2851
2973
  type LoadOptions = {
2974
+ /** Refuse any possible Suspension Point as `can't suspend here`; kept by Reload, Extend, Library replacement and restore (ADR 0178). */
2975
+ forbidSuspension?: boolean;
2852
2976
  /** Its Grants, by the name the Script uses for each. */
2853
2977
  grants?: Readonly<Record<string, Grant<any>>>;
2854
2978
  /** Keep only Operations used by this source and its Libraries. */
@@ -3080,6 +3204,7 @@ type MessageView = {
3080
3204
  type Inspection = {
3081
3205
  scripts: {
3082
3206
  disabledGrants?: string[];
3207
+ forbidSuspension?: true;
3083
3208
  mailbox: MessageView[];
3084
3209
  name: string;
3085
3210
  runs: RunView[];
@@ -3149,6 +3274,8 @@ declare class TsGroup implements Group {
3149
3274
  private accounting;
3150
3275
  private discardReason;
3151
3276
  private inputs;
3277
+ private urgentInputs;
3278
+ private chargeInputs;
3152
3279
  private deliveries;
3153
3280
  private broadcasts;
3154
3281
  /**
@@ -3169,6 +3296,8 @@ declare class TsGroup implements Group {
3169
3296
  private saves;
3170
3297
  private lastClock;
3171
3298
  private randomState;
3299
+ /** The musical clock's Grant, which every Script holds (chapter 9). */
3300
+ private musicalClock;
3172
3301
  private pumping;
3173
3302
  private combining;
3174
3303
  private combinedAdmission;
@@ -3206,7 +3335,7 @@ declare class TsGroup implements Group {
3206
3335
  private evaluationHost;
3207
3336
  private advanceDebugPump;
3208
3337
  private attachSession;
3209
- /** Worker. A Fingerprint covers code, declarations and limits, never state. */
3338
+ /** Worker. A Fingerprint covers code, declarations, limits and `forbidSuspension`, never state. */
3210
3339
  fingerprint(): Uint8Array;
3211
3340
  save(o?: SaveOptions): Uint8Array;
3212
3341
  /** Worker. Refused as a save would be, but writes no Trace record. */
@@ -3239,8 +3368,6 @@ declare class TsGroup implements Group {
3239
3368
  scriptUnitDocs(name: string): [string, Map<string, string>][];
3240
3369
  /** The code units restored Runs may name. */
3241
3370
  private knownCode;
3242
- /** A Library's code a Script imports, by its unit name. */
3243
- private libraryCode;
3244
3371
  private discardedDecisions;
3245
3372
  private unsettled;
3246
3373
  private restored;
@@ -3273,6 +3400,7 @@ declare class TsGroup implements Group {
3273
3400
  private queueRevoke;
3274
3401
  private applyInput;
3275
3402
  private runsOf;
3403
+ private findRun;
3276
3404
  private forgetWait;
3277
3405
  private cancelRunning;
3278
3406
  /**
@@ -3297,6 +3425,8 @@ declare class TsGroup implements Group {
3297
3425
  private dropStoppedMailbox;
3298
3426
  private acceptDelivery;
3299
3427
  private recordRefusal;
3428
+ private pushInput;
3429
+ private setInputs;
3300
3430
  private landUrgentInputs;
3301
3431
  constructor(options: TsGroupOptions);
3302
3432
  script(name: string): TsScript | undefined;
@@ -3326,7 +3456,9 @@ declare class TsGroup implements Group {
3326
3456
  */
3327
3457
  addLibrary(l: Library): void;
3328
3458
  /** Worker. Prepare every dependent before changing the Group. */
3329
- replaceLibrary(l: Library, carry: CarryOver): Report[];
3459
+ replaceLibrary(l: Library, carry: CarryOver, o?: {
3460
+ keepMailbox?: boolean;
3461
+ }): Report[];
3330
3462
  private hostFor;
3331
3463
  private enqueue;
3332
3464
  private fireTimer;
@@ -3546,4 +3678,4 @@ declare class DebugController {
3546
3678
  enter(pause: DebugPause): void;
3547
3679
  }
3548
3680
  //#endregion
3549
- export { instant as $, ScriptError as $n, Script as $t, ScriptSources as A, OperationRef as An, SyntaxRule as Ar, FireOp as At, restore as B, UnitLoadError as Bn, ReleaseHook as Bt, Report as C, calendarCapability as Cn, Lexer as Cr, ChargeRequest as Ct, RunEvent as D, Library as Dn, SyntaxElement as Dr, EffectResult as Dt, RestoreResult as E, timerCapability as En, Token as Er, Cost as Et, TsGroupOptions as F, Limits as Fn, Metering as Ft, RunStarted as G, NotImplementedError as Gn, SegmentGrant as Gt, RunAccounting as H, defaultLimits as Hn, ScopeDecl as Ht, TsRestoreOptions as I, Outcome as In, Operation as It, Value as J, HostError as Jn, SuspendingOp as Jt, Decimal as K, canConvert as Kn, SegmentLifecycle as Kt, TsScript as L, Run as Ln, Operations as Lt, SessionPort as M, compileLibrary as Mn, syntaxSelector as Mr, GrantContext as Mt, Settlement as N, replacementLibraries as Nn, syntaxText as Nr, ImmediateOp as Nt, SaveOptions as O, LibraryOptions as On, SyntaxErrorCode as Or, ErrorDecl as Ot, TsGroup as P, LimitName as Pn, LimitReached as Pt, dec as Q, MailboxFull as Qn, Group as Qt, Verdict as R, RunRecord as Rn, PlainArg as Rt, PumpedRequest as S, TimerImpl as Sn, SourceSpan as Sr, CapabilityDefiner as St, RestoreOptions as T, consoleCapability as Tn, TokType as Tr, CoordinatedLifecycle as Tt, RunAncestry as U, deliver as Un, SegmentContext as Ut, CausalWork as V, callFunction as Vn, ReleaseReason as Vt, RunDiscarded as W, loadScript as Wn, SegmentCoordinator as Wt, bytes as X, LoadDiagnostic as Xn, shape as Xt, bool as Y, HostErrorCode as Yn, defineCapability as Yt, civilDate as Z, LoadError as Zn, Core as Zt, LoadOptions as _, LocaleImpl as _n, SemanticName as _r, PropDef as _t, DebugPause as a, httpCapability as an, EventEntry as ar, quantity as at, PumpOptions as b, ConsoleImpl as bn, SemanticToken as br, Call as bt, RepeatedEffect as c, StoreImpl as cn, UnwindEntry as cr, sourceForm as ct, Counters as d, SqlParams as dn, BindingKind as dr, nowMicros as dt, Versions as en, SendFailedReason as er, isReadable as et, Decided as f, SqlRows as fn, ExportKind as fr, parseInstant as ft, Inspection as g, sqliteCapability as gn, SemanticElement as gr, ObjectKindDef as gt, GroupOptions as h, SqliteImpl as hn, NameRole as hr, ObjectKind as ht, DebugInstruction as i, HttpServerImpl as in, EventBranch as ir, num as it, SessionControls as j, codeIdentity as jn, Trivia as jr, Grant as jt, ScriptCodeRequest as k, LibrarySource as kn, SyntaxNode as kr, FieldShape as kt, CancellationOptions as l, add as ln, disassemble as lr, text as lt, EffectFailure as m, SqliteBinding as mn, LibraryExport as mr, ObjectElements as mt, DebugEvaluation as n, HttpClientImpl as nn, BodyKind as nr, map as nt, DebugSnapshot as o, UserImpl as on, Instruction as or, range as ot, Deciding as p, SqlValue as pn, FunctionContract as pr, HostObject as pt, Kind as q, waitUs as qn, Shape as qt, DebugFrame as r, HttpImpl as rn, CodeUnit as rr, nothing as rt, DebugSource as s, userCapability as sn, Operand as sr, record as st, DebugController as t, coreVersions as tn, Body as tr, list as tt, CarryOver as u, storeCapability as un, Binding as ur, formatInstant as ut, Message as v, localeCapability as vn, SemanticNode as vr, defineObjectKind as vt, Requested as w, clockCapability as wn, Mode as wr, ChargeResult as wt, PumpResult as x, Costs as xn, SemanticTree as xr, CapabilityDef as xt, PendingCall as y, CalendarImpl as yn, SemanticScope as yr, GrantDecls as yt, newGroup as z, Script$1 as zn, PlainResult as zt };
3681
+ export { instant as $, NotImplementedError as $n, shape as $t, ScriptSources as A, calendarCapability as An, SourceSpan as Ar, FireOp as At, restore as B, compileLibrary as Bn, syntaxSelector as Br, ReleaseHook as Bt, Report as C, LocaleImpl as Cn, NameRole as Cr, ChargeRequest as Ct, RunEvent as D, Costs as Dn, SemanticScope as Dr, EffectResult as Dt, RestoreResult as E, ConsoleImpl as En, SemanticNode as Er, Cost as Et, TsGroupOptions as F, Library as Fn, SyntaxElement as Fr, Metering as Ft, RunStarted as G, Run as Gn, SegmentGrant as Gt, RunAccounting as H, LimitName as Hn, ScopeDecl as Ht, TsRestoreOptions as I, LibraryOptions as In, SyntaxErrorCode as Ir, Operation as It, Value as J, UnitLoadError as Jn, SuspendingOp as Jt, Decimal as K, RunRecord as Kn, SegmentLifecycle as Kt, TsScript as L, LibrarySource as Ln, SyntaxNode as Lr, Operations as Lt, SessionPort as M, consoleCapability as Mn, Mode as Mr, GrantContext as Mt, Settlement as N, musicalClockCapability as Nn, TokType as Nr, ImmediateOp as Nt, SaveOptions as O, MusicalClockImpl as On, SemanticToken as Or, ErrorDecl as Ot, TsGroup as P, timerCapability as Pn, Token as Pr, LimitReached as Pt, dec as Q, loadScript as Qn, operationDeclarations as Qt, Verdict as R, OperationRef as Rn, SyntaxRule as Rr, PlainArg as Rt, PumpedRequest as S, sqliteCapability as Sn, LibraryExport as Sr, CapabilityDefiner as St, RestoreOptions as T, CalendarImpl as Tn, SemanticName as Tr, CoordinatedLifecycle as Tt, RunAncestry as U, Limits as Un, SegmentContext as Ut, CausalWork as V, replacementLibraries as Vn, syntaxText as Vr, ReleaseReason as Vt, RunDiscarded as W, Outcome as Wn, SegmentCoordinator as Wt, bytes as X, defaultLimits as Xn, defineCapability as Xt, bool as Y, callFunction as Yn, conforms as Yt, civilDate as Z, deliver as Zn, explain as Zt, LoadOptions as _, SqlParams as _n, disassemble as _r, PropDef as _t, DebugPause as a, PeerImpl as an, LoadError as ar, quantity as at, PumpOptions as b, SqliteBinding as bn, ExportKind as br, Call as bt, RepeatedEffect as c, HttpClientImpl as cn, SendFailedReason as cr, sourceForm as ct, Counters as d, httpCapability as dn, CodeUnit as dr, nowMicros as dt, Core as en, canConvert as er, isReadable as et, Decided as f, UserImpl as fn, EventBranch as fr, parseInstant as ft, Inspection as g, storeCapability as gn, UnwindEntry as gr, ObjectKindDef as gt, GroupOptions as h, add as hn, Operand as hr, ObjectKind as ht, DebugInstruction as i, coreVersions as in, LoadDiagnostic as ir, num as it, SessionControls as j, clockCapability as jn, Lexer as jr, Grant as jt, ScriptCodeRequest as k, TimerImpl as kn, SemanticTree as kr, FieldShape as kt, CancellationOptions as l, HttpImpl as ln, Body as lr, text as lt, EffectFailure as m, StoreImpl as mn, Instruction as mr, ObjectElements as mt, DebugEvaluation as n, Script as nn, HostError as nr, map as nt, DebugSnapshot as o, peerCapability as on, MailboxFull as or, range as ot, Deciding as p, userCapability as pn, EventEntry as pr, HostObject as pt, Kind as q, Script$1 as qn, Shape as qt, DebugFrame as r, Versions as rn, HostErrorCode as rr, nothing as rt, DebugSource as s, peerKind as sn, ScriptError as sr, record as st, DebugController as t, Group as tn, waitUs as tr, list as tt, CarryOver as u, HttpServerImpl as un, BodyKind as ur, formatInstant as ut, Message as v, SqlRows as vn, Binding as vr, defineObjectKind as vt, Requested as w, localeCapability as wn, SemanticElement as wr, ChargeResult as wt, PumpResult as x, SqliteImpl as xn, FunctionContract as xr, CapabilityDef as xt, PendingCall as y, SqlValue as yn, BindingKind as yr, GrantDecls as yt, newGroup as z, codeIdentity as zn, Trivia as zr, PlainResult as zt };
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--Of4MSLw.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-s6QIovKS.js";
3
3
  export { type DebugController, type DebugEvaluation, type DebugFrame, type DebugInstruction, type DebugPause, type DebugSnapshot, type DebugSource, type RepeatedEffect, isReadable, sourceForm };
package/debug.js CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { O as isReadable, Z as sourceForm } from "./errors-D11zizZg.js";
2
+ export { A as isReadable, rt as sourceForm } from "./errors-VuwK669R.js";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { Qt as Group, b as PumpOptions, h as GroupOptions, x as PumpResult } from "./debug--Of4MSLw.js";
2
+ import { b as PumpOptions, h as GroupOptions, tn as Group, x as PumpResult } from "./debug-s6QIovKS.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-BIm1mL77.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-D5yrK3Nu.js";
3
3
  export { AutoDriveOptions, Drive, DrivenGroupOptions, type PendingOperation, asyncDispose, autoDrive, newDrivenGroup };
package/driver.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { Ut as nowMicros } from "./errors-D11zizZg.js";
2
+ import { Xt as nowMicros } from "./errors-VuwK669R.js";
3
3
  import { r as waitForOperations, t as pendingOperations } from "./operation-promises-ClA1BTaS.js";
4
4
  //#region src/driver.ts
5
5
  /** Creates a Group on `core` ready to drive queued Inputs from the Host's event loop. */