@northtalk/ts 0.8.0 → 0.10.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 (58) hide show
  1. package/{binary-value-B93hEK7l.d.ts → binary-value-B8W4W_e1.d.ts} +1 -1
  2. package/{checker-Q4w7rLXk.js → checker-hkWO1UbN.js} +2 -2
  3. package/{core-BBPI6EhG.d.ts → core-Dwec7SRy.d.ts} +1 -1
  4. package/{debug-s6QIovKS.d.ts → debug-2yfUZYzF.d.ts} +7 -0
  5. package/debug.d.ts +1 -1
  6. package/debug.js +1 -1
  7. package/{driver-D5yrK3Nu.d.ts → driver-CT-ksM-N.d.ts} +1 -1
  8. package/driver.d.ts +1 -1
  9. package/driver.js +1 -1
  10. package/{encoding-B7MCQ4ii.js → encoding-DlMqlP2Y.js} +2 -2
  11. package/{engine-OL1BveVZ.js → engine-CxcONfhv.js} +6 -6
  12. package/{engine-Dy-BCoiw.d.ts → engine-DP_lqWfI.d.ts} +2 -2
  13. package/{errors-VuwK669R.js → errors-CNc-xY_9.js} +1 -1
  14. package/{group-Ccuqwq12.js → group--dcl0em8.js} +83 -24
  15. package/{http-fetch--O27xjSW.js → http-fetch-CLAeEXVi.js} +2 -2
  16. package/http.d.ts +1 -1
  17. package/http.js +4 -4
  18. package/index-CBuczWK0.d.ts +9 -0
  19. package/index.d.ts +6 -12
  20. package/index.js +15 -15
  21. package/{lean-BjhQvHyr.js → lean-BtbKWkXA.js} +10 -10
  22. package/{lean-D6DQfbqH.d.ts → lean-DU_muGpT.d.ts} +134 -5
  23. package/lean.d.ts +5 -6
  24. package/lean.js +15 -15
  25. package/{manifest-BeViDIoy.js → manifest-CRpUahPt.js} +3 -3
  26. package/message-layer.d.ts +2 -2
  27. package/message-layer.js +2 -2
  28. package/notify.d.ts +1 -1
  29. package/notify.js +1 -1
  30. package/{objects-q0lnCK-4.d.ts → objects-DoyEohtr.d.ts} +1 -1
  31. package/{objects-TarIKBL8.js → objects-OKVLH190.js} +1 -1
  32. package/{operations-BAELnqwf.js → operations-DrsedOvj.js} +116 -13
  33. package/package.json +1 -1
  34. package/{peer-capability-B8eKbljR.js → peer-capability-RMdN4OHj.js} +4 -4
  35. package/peer.d.ts +1 -1
  36. package/peer.js +4 -4
  37. package/{readers-BG8g59qS.js → readers-G1lHqrPl.js} +1 -1
  38. package/{readers-AeB1bJ--.d.ts → readers-IhVpgXkj.d.ts} +1 -1
  39. package/{request-pump-binary-87klb6sX.js → request-pump-binary-P8m6kLfB.js} +231 -53
  40. package/{router-DXoJ_2Z4.d.ts → router-2vjYbqx3.d.ts} +2 -2
  41. package/{router-DXmPA-qi.js → router-C_Fjc2as.js} +5 -5
  42. package/session.d.ts +2 -2
  43. package/session.js +23 -22
  44. package/setup.d.ts +2 -2
  45. package/setup.js +5 -5
  46. package/sha256-C5Lqj5U7.js +197 -0
  47. package/sqlite.d.ts +2 -2
  48. package/sqlite.js +5 -5
  49. package/{store-DzpyWjt2.js → store-_af2DPoK.js} +2 -2
  50. package/{store-capability-CxQJ_Huz.js → store-capability-Db6v_dw9.js} +3 -3
  51. package/store.d.ts +2 -2
  52. package/store.js +2 -2
  53. package/{user-capability-ClYd8Vln.js → user-capability-CzoLN3RK.js} +3 -3
  54. package/wasm.d.ts +5 -5
  55. package/wasm.js +88 -48
  56. package/{inline-grants-DmOdgSoK.js → zone-rules-Cn-f9u_Z.js} +88 -5
  57. package/manifest-l07K7nW-.d.ts +0 -124
  58. package/sha256-9CGf5BS_.js +0 -168
@@ -1,7 +1,6 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { Ar as SourceSpan, Er as SemanticNode, Ir as SyntaxErrorCode, Lr as SyntaxNode, Pr as Token, Sr as LibraryExport, dr as CodeUnit, en as Core, kr as SemanticTree, vr as Binding, yt as GrantDecls } from "./debug-s6QIovKS.js";
3
- import { r as DrivenGroupOptions } from "./driver-D5yrK3Nu.js";
4
- import { c as DrivenGroup } from "./manifest-l07K7nW-.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-2yfUZYzF.js";
3
+ import { n as Drive, r as DrivenGroupOptions } from "./driver-CT-ksM-N.js";
5
4
  //#region src/generated/syntax.d.ts
6
5
  declare const grammar: {
7
6
  reserved: string[];
@@ -560,7 +559,7 @@ declare const builtins: readonly [{
560
559
  readonly kind: "function";
561
560
  readonly contract: {
562
561
  readonly required: 2;
563
- readonly total: 2;
562
+ readonly total: 3;
564
563
  readonly variadic: false;
565
564
  };
566
565
  }, {
@@ -685,6 +684,49 @@ type CheckResult = (SemanticResult & {
685
684
  declare const checkSyntax: (syntax: SyntaxNode, options?: CheckOptions) => SemanticResult;
686
685
  declare const checkSource: (source: string, options?: CheckOptions) => CheckResult;
687
686
  //#endregion
687
+ //#region src/talk.d.ts
688
+ /**
689
+ * Dedents NorthTalk source; rejects JS interpolation.
690
+ *
691
+ * Write NorthTalk's own interpolation as `\${…}` and its backticks as `` \` ``.
692
+ * Pass values as Request arguments instead of splicing them into source. The
693
+ * longest whitespace prefix shared by every non-blank line is removed, compared
694
+ * exactly, so tabs and spaces never match each other.
695
+ */
696
+ declare const talk: (strings: TemplateStringsArray, ...values: unknown[]) => string;
697
+ //#endregion
698
+ //#region src/plain.d.ts
699
+ /** Plain JS data, as `fromValue` writes it (ADR 0119). */
700
+ type PlainValue = null | boolean | string | Decimal | Uint8Array | Value | PlainValue[] | {
701
+ [key: string]: PlainValue;
702
+ } | Map<string, PlainValue>;
703
+ type ToValueOptions = {
704
+ /**
705
+ * `integer` reads safe integers through `num`; `decimal` uses `num` for
706
+ * any JS number. The default refuses JS numbers.
707
+ */
708
+ numbers?: 'refuse' | 'integer' | 'decimal';
709
+ };
710
+ type FromValueOptions = {
711
+ maps?: 'object' | 'map';
712
+ numbers?: 'decimal' | 'string';
713
+ };
714
+ /**
715
+ * Plain JS data to a Value by the named constructors (ADR 0119). Anything
716
+ * the table doesn't name, and cyclic data, throws `invalid value`.
717
+ */
718
+ declare const toValue: (plain: unknown, options?: ToValueOptions) => Value;
719
+ /** A Value as plain JS data (ADR 0119); kinds with no JS form stay Values. */
720
+ declare const fromValue: (v: Value, options?: FromValueOptions) => PlainValue;
721
+ //#endregion
722
+ //#region src/encoding.d.ts
723
+ /**
724
+ * A Message Layer adapter's own spelling of a Function Value or a Text
725
+ * Pattern, which the Value Encoding doesn't hold.
726
+ */
727
+ type AdapterEncoder = (v: Value) => string;
728
+ declare const encodeValue: (value: Value, adapter?: AdapterEncoder) => string;
729
+ //#endregion
688
730
  //#region src/constructs.d.ts
689
731
  /** Chapter 3's kind names. */
690
732
  declare const kindNames: ReadonlySet<string>;
@@ -719,6 +761,40 @@ type ShapeData = string | {
719
761
  /** Each loadable Shape declaration's data, by its Declaration node. */
720
762
  declare const shapeData: WeakMap<SemanticNode, ShapeData>;
721
763
  //#endregion
764
+ //#region src/json.d.ts
765
+ /** Read exact decimal digits, NFC strings and insertion-ordered maps. */
766
+ declare const decodeJson: (source: string) => Value;
767
+ /** Compact JSON, with canonical numbers and chapter 7's string escapes. */
768
+ declare const encodeJson: (value: Value) => string;
769
+ //#endregion
770
+ //#region src/handlers.d.ts
771
+ /** Untyped Handler calls accept safe-integer JS numbers and plain data. */
772
+ type Handlers = {
773
+ [name: string]: (...args: (PlainValue | number | bigint)[]) => Promise<PlainValue>;
774
+ };
775
+ /** The Host supplies T without runtime checking of its arguments or results. */
776
+ type ScriptWithHandlers<T = Handlers> = Script & {
777
+ readonly handlers: T;
778
+ };
779
+ /**
780
+ * Calls invoke with integer-mode toValue arguments and default fromValue answers.
781
+ * The Script's existing driver or Host Pump loop still runs the Requests.
782
+ * Promise hooks, symbols and non-message properties read as undefined.
783
+ */
784
+ declare const handlersOf: <T = Handlers>(script: Script) => T;
785
+ //#endregion
786
+ //#region src/group-helper.d.ts
787
+ /** A Group whose driver closes explicitly or at the end of an `await using` scope. */
788
+ type DrivenGroup = Omit<Group, 'load'> & Pick<Drive, 'close' | typeof Symbol.asyncDispose> & {
789
+ load<T = Handlers>(o: LoadOptions): ScriptWithHandlers<T>;
790
+ };
791
+ /** The Zig Host Adapter requires its asynchronously created Core. */
792
+ type CreateGroupOptions$1 = DrivenGroupOptions & {
793
+ core: Core;
794
+ };
795
+ /** Creates a driven Group on the supplied Core; close has the driver's shutdown semantics. */
796
+ declare const createGroup$1: (o: CreateGroupOptions$1) => DrivenGroup;
797
+ //#endregion
722
798
  //#region src/create-group.d.ts
723
799
  /** Omitting core uses the process-wide TS Core. */
724
800
  type CreateGroupOptions = DrivenGroupOptions & {
@@ -727,6 +803,59 @@ type CreateGroupOptions = DrivenGroupOptions & {
727
803
  /** Creates a driven Group that supports `await using` and explicit close(reason). */
728
804
  declare const createGroup: (o: CreateGroupOptions) => DrivenGroup;
729
805
  //#endregion
806
+ //#region src/inline-grants.d.ts
807
+ /** Argument and result types are supplied by the Host, without runtime checking. */
808
+ type InlineFunction = (...args: never[]) => unknown;
809
+ type InlineOperation = InlineFunction | {
810
+ arity?: number;
811
+ fn: InlineFunction;
812
+ } | {
813
+ arity?: number;
814
+ async: InlineFunction;
815
+ maxPendingMs?: number;
816
+ };
817
+ /**
818
+ * Defines one Capability per key and grants all its Operations. Arguments use
819
+ * default fromValue; results use integer-mode toValue. Arity is fn.length unless
820
+ * overridden, including for async functions, which also receive a final signal.
821
+ */
822
+ declare const inlineGrants: (capabilities: Readonly<Record<string, Readonly<Record<string, InlineOperation>>>>) => Record<string, Grant<void>>;
823
+ //#endregion
824
+ //#region src/zone-rules.d.ts
825
+ /**
826
+ * Zone Rules for the IANA zone `zone` from `from` up to `until`, exclusive,
827
+ * as an ordinary map (chapter 7): the offset in effect at `from`, then each
828
+ * Instant in the window where the offset changes. An unknown zone, an empty
829
+ * window, or an offset that isn't a whole number of minutes, as in local mean
830
+ * time before a zone adopted standard time, throws invalid value.
831
+ */
832
+ declare const zoneRules: (zone: string, from: Date, until: Date) => Value;
833
+ //#endregion
834
+ //#region src/manifest.d.ts
835
+ type MessageDecl = {
836
+ args?: readonly Shape[];
837
+ description?: string;
838
+ /** NorthTalk source, each sending this message. */
839
+ examples?: readonly string[];
840
+ name: string;
841
+ receivers?: readonly ObjectKind[];
842
+ };
843
+ type ManifestSpec = {
844
+ grants: Readonly<Record<string, Grant<any>>>;
845
+ kind: string;
846
+ libraries?: readonly Library[];
847
+ messages?: readonly MessageDecl[];
848
+ /** Whether the Host supplies a musical clock (chapter 9, The musical clock). */
849
+ musicalTime?: boolean;
850
+ objectKinds?: readonly ObjectKind[];
851
+ objects?: Readonly<Record<string, ObjectKind>>;
852
+ /** The Owner Kind: one of objectKinds, the kind of `me` for tooling. */
853
+ ownerKind?: ObjectKind;
854
+ version: string;
855
+ };
856
+ /** Chapter 9's deterministic JSON file, ending in LF; never calls the Host. */
857
+ declare const exportManifest: (m: ManifestSpec) => string;
858
+ //#endregion
730
859
  //#region src/lowering.d.ts
731
860
  /** A construct whose lowering the Spec leaves unsettled; not a load diagnostic. */
732
861
  declare class LoweringError extends Error {
@@ -773,4 +902,4 @@ declare const declarationStart: (root: SyntaxNode, declaration: SyntaxNode) => n
773
902
  //#region src/selectors.d.ts
774
903
  declare const validMessageSelector: (message: string, arity: number) => boolean;
775
904
  //#endregion
776
- export { builtins as A, ParseError as C, parseEntry as D, RecoveryDiagnostic as E, units as M, parseSource as O, EntryResult as S, RecoveringParseResult as T, DiagnosticCode as _, LoweringError as a, checkSyntax as b, lowerTree as c, ShapeData as d, shapeData as f, Diagnostic as g, CheckResult as h, CompileResult as i, grammar as j, parseSourceRecovering as k, CreateGroupOptions as l, CheckOptions as m, declarationStart as n, compileSource as o, kindNames as p, CompileOptions as r, exportsOf as s, validMessageSelector as t, createGroup as u, SemanticResult as v, ParseResult as w, EntryKind as x, checkSource as y };
905
+ export { grammar as $, FromValueOptions as A, SemanticResult as B, handlersOf as C, shapeData as D, ShapeData as E, talk as F, ParseError as G, checkSyntax as H, CheckOptions as I, RecoveryDiagnostic as J, ParseResult as K, CheckResult as L, ToValueOptions as M, fromValue as N, kindNames as O, toValue as P, builtins as Q, Diagnostic as R, ScriptWithHandlers as S, encodeJson as T, EntryKind as U, checkSource as V, EntryResult as W, parseSource as X, parseEntry as Y, parseSourceRecovering as Z, createGroup as _, LoweringError as a, createGroup$1 as b, lowerTree as c, exportManifest as d, units as et, zoneRules as f, CreateGroupOptions as g, inlineGrants as h, CompileResult as i, PlainValue as j, encodeValue as k, ManifestSpec as l, InlineOperation as m, declarationStart as n, compileSource as o, InlineFunction as p, RecoveringParseResult as q, CompileOptions as r, exportsOf as s, validMessageSelector as t, MessageDecl as u, CreateGroupOptions$1 as v, decodeJson as w, Handlers as x, DrivenGroup as y, DiagnosticCode as z };
package/lean.d.ts CHANGED
@@ -1,8 +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-s6QIovKS.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-2yfUZYzF.js";
3
3
  import { n as registerStdlib, r as stdlibNames, t as StdlibLibrary } from "./stdlib-registry-BwitI3Ox.js";
4
- import { A as builtins, C as ParseError, D as parseEntry, E as RecoveryDiagnostic, M as units, O as parseSource, S as EntryResult, T as RecoveringParseResult, _ as DiagnosticCode, a as LoweringError, b as checkSyntax, c as lowerTree, d as ShapeData, f as shapeData, g as Diagnostic, h as CheckResult, i as CompileResult, j as grammar, k as parseSourceRecovering, l as CreateGroupOptions, m as CheckOptions, n as declarationStart, o as compileSource, p as kindNames, r as CompileOptions, s as exportsOf, t as validMessageSelector, u as createGroup, v as SemanticResult, w as ParseResult, x as EntryKind, y as checkSource } from "./lean-D6DQfbqH.js";
5
- import { _ as PlainValue, a as InlineOperation, b as toValue, c as DrivenGroup, d as ScriptWithHandlers, f as handlersOf, g as FromValueOptions, h as encodeValue, i as InlineFunction, m as encodeJson, n as MessageDecl, o as inlineGrants, p as decodeJson, r as exportManifest, t as ManifestSpec, u as Handlers, v as ToValueOptions, x as talk, y as fromValue } from "./manifest-l07K7nW-.js";
6
- import { n as createCore, t as TsCore } from "./core-BBPI6EhG.js";
7
- import { a as decodeValue, o as readDisplay, t as FunctionResolver } from "./readers-AeB1bJ--.js";
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, 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 };
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";
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,16 +1,16 @@
1
1
 
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-VuwK669R.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-Ccuqwq12.js";
4
- import { t as defineObjectKind } from "./objects-TarIKBL8.js";
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-BAELnqwf.js";
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-Q4w7rLXk.js";
7
- import { n as exportManifest } from "./manifest-BeViDIoy.js";
8
- import { c as readDisplay, r as decodeValue } from "./readers-BG8g59qS.js";
9
- import { a as clockCapability, d as timerCapability, i as calendarCapability, o as consoleCapability, t as encodeValue, u as musicalClockCapability } from "./encoding-B7MCQ4ii.js";
10
- import { a as peerKind, i as peerCapability } from "./peer-capability-B8eKbljR.js";
11
- import { a as sqliteCapability, c as talk, i as httpCapability, o as fromValue, r as handlersOf, s as toValue, t as inlineGrants } from "./inline-grants-DmOdgSoK.js";
12
- import { o as decodeJson, s as encodeJson } from "./http-fetch--O27xjSW.js";
13
- import { n as createCore, r as coreVersions, t as createGroup } from "./lean-BjhQvHyr.js";
14
- import { n as localeCapability, t as userCapability } from "./user-capability-ClYd8Vln.js";
15
- import { r as storeCapability, t as add } from "./store-capability-CxQJ_Huz.js";
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 };
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";
4
+ import { t as defineObjectKind } from "./objects-OKVLH190.js";
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
+ 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";
7
+ import { n as exportManifest } from "./manifest-CRpUahPt.js";
8
+ import { c as readDisplay, r as decodeValue } from "./readers-G1lHqrPl.js";
9
+ import { a as clockCapability, d as timerCapability, i as calendarCapability, o as consoleCapability, t as encodeValue, u as musicalClockCapability } from "./encoding-DlMqlP2Y.js";
10
+ import { a as peerKind, i as peerCapability } from "./peer-capability-RMdN4OHj.js";
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
+ 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";
14
+ import { n as localeCapability, t as userCapability } from "./user-capability-CzoLN3RK.js";
15
+ import { r as storeCapability, t as add } from "./store-capability-Db6v_dw9.js";
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,7 +1,7 @@
1
1
 
2
- import { X as requireArgs, t as HostError } from "./errors-VuwK669R.js";
3
- import { gt as LimitReached, pt as languageVersion, ut as compareText } from "./operations-BAELnqwf.js";
4
- import { n as quoteJSON } from "./encoding-B7MCQ4ii.js";
2
+ import { X as requireArgs, t as HostError } from "./errors-CNc-xY_9.js";
3
+ import { gt as LimitReached, pt as languageVersion, ut as compareText } from "./operations-DrsedOvj.js";
4
+ import { n as quoteJSON } from "./encoding-DlMqlP2Y.js";
5
5
  //#region src/call-meter.ts
6
6
  var CallMeter = class {
7
7
  take;
@@ -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-AeB1bJ--.js";
3
- import { n as decodeBinaryValue, r as encodeBinaryValue, t as BinaryValueOptions } from "./binary-value-B93hEK7l.js";
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";
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/message-layer.js CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
- import { l as readOrderedJSON, n as JsonObject, t as JsonNumber } from "./readers-BG8g59qS.js";
3
- import { c as isRequestPumpBinary, f as decodeBinaryValue, i as encodeBinaryFrame, n as decodeBinaryFrame, p as encodeBinaryValue, t as callbacksFeature, u as requestPumpFeature } from "./request-pump-binary-87klb6sX.js";
2
+ import { l as readOrderedJSON, n as JsonObject, t as JsonNumber } from "./readers-G1lHqrPl.js";
3
+ import { c as isRequestPumpBinary, g as encodeBinaryValue, h as decodeBinaryValue, i as encodeBinaryFrame, n as decodeBinaryFrame, t as callbacksFeature, u as requestPumpFeature } from "./request-pump-binary-P8m6kLfB.js";
4
4
  export { JsonNumber, JsonObject, callbacksFeature, decodeBinaryFrame, decodeBinaryValue, encodeBinaryFrame, encodeBinaryValue, isRequestPumpBinary, readOrderedJSON, requestPumpFeature };
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-DXoJ_2Z4.js";
2
+ import { a as changed, i as WatchLimits, n as RouterOptions, o as createRouter, r as RoutingResult, t as NotificationRouter } from "./router-2vjYbqx3.js";
3
3
  export { type NotificationRouter, type RouterOptions, type RoutingResult, type WatchLimits, changed, createRouter };
package/notify.js CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { t as changed, n as createRouter } from "./router-DXmPA-qi.js";
2
+ export { t as changed, n as createRouter } from "./router-C_Fjc2as.js";
@@ -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-s6QIovKS.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-2yfUZYzF.js";
3
3
  //#region src/setup.d.ts
4
4
  type ShapeSpec = string | {
5
5
  quantity: string;
@@ -1,5 +1,5 @@
1
1
 
2
- import { U as objectValue, t as HostError } from "./errors-VuwK669R.js";
2
+ import { U as objectValue, t as HostError } from "./errors-CNc-xY_9.js";
3
3
  //#region src/objects.ts
4
4
  const elementCost = (cost, name) => {
5
5
  const c = cost;
@@ -1,5 +1,5 @@
1
1
 
2
- import { $ as smallCoefficient, $t as parseInstantText, At as multiply, B as mapWithEntry, Bt as checkInstant, C as extendList, Ct as digitsOf, D as instant, Dt as integerOf, Et as formatDec, F as listWithItem, Ft as withinLimits, G as patternValue, Gt as civilUs, H as num, I as literalDigits, It as DateRangeError, J as range, K as quantity, Kt as dayOfYear, L as map, Lt as US_PER_DAY, M as knownSize, Mt as powerInteger, N as list, Nt as roundRatio, O as instantOf, Ot as isInteger, P as listValues, Pt as subtract, Q as sliceText, Rt as US_PER_SECOND, S as displayText, St as digitCount$1, Tt as divide, Ut as civilOfDays, V as nothing, Vt as civilDays, W as ownedMapPairs, Wt as civilOfUs, Yt as isoWeek, Zt as parseCivil, _ as civilOf, _n as unitKinds, _t as unitText, an as isWhiteSpace, at as textStorage, b as dec, bt as compareDec, cn as scalarCount, ct as combine, d as bytes, dn as utf8Length, dt as ownUnit, en as weekday, et as smallDecimalNumber, f as bytesOf, ft as parseUnit, gt as unitEntry, h as canonicalNumber, hn as grammar, ht as toBase, in as generalCategory, it as text, j as knownContents, jt as negate, k as isDecimal, kt as mod, l as Value, ln as simpleFold, lt as fromBase, m as cacheSize, mt as sameDimension, nn as characterBoundaries, nt as smallInteger, o as invalidValue, on as lower, ot as trimWhiteSpace, p as cacheContents, pt as powerOf, q as quantityOf, rn as charactersAt, sn as normalizeNFC, st as UnitError, t as HostError, tn as assertScalarText, tt as smallExponent, u as bool, un as upper, ut as musicalKind, v as compareBytes, vt as ArithmeticError, wt as div, x as decimalParts, xt as decOf, y as concatText, yt as add, zt as addMonths } from "./errors-VuwK669R.js";
2
+ import { $ as smallCoefficient, $t as parseInstantText, At as multiply, B as mapWithEntry, Bt as checkInstant, C as extendList, Ct as digitsOf, D as instant, Dt as integerOf, Et as formatDec, F as listWithItem, Ft as withinLimits, G as patternValue, Gt as civilUs, H as num, I as literalDigits, It as DateRangeError, J as range, K as quantity, Kt as dayOfYear, L as map, Lt as US_PER_DAY, M as knownSize, Mt as powerInteger, N as list, Nt as roundRatio, O as instantOf, Ot as isInteger, P as listValues, Pt as subtract, Q as sliceText, Rt as US_PER_SECOND, S as displayText, St as digitCount$1, Tt as divide, Ut as civilOfDays, V as nothing, Vt as civilDays, W as ownedMapPairs, Wt as civilOfUs, Yt as isoWeek, Zt as parseCivil, _ as civilOf, _n as unitKinds, _t as unitText, an as isWhiteSpace, at as textStorage, b as dec, bt as compareDec, cn as scalarCount, ct as combine, d as bytes, dn as utf8Length, dt as ownUnit, en as weekday, et as smallDecimalNumber, f as bytesOf, ft as parseUnit, gt as unitEntry, h as canonicalNumber, hn as grammar, ht as toBase, in as generalCategory, it as text, j as knownContents, jt as negate, k as isDecimal, kt as mod, l as Value, ln as simpleFold, lt as fromBase, m as cacheSize, mt as sameDimension, nn as characterBoundaries, nt as smallInteger, o as invalidValue, on as lower, ot as trimWhiteSpace, p as cacheContents, pt as powerOf, q as quantityOf, rn as charactersAt, sn as normalizeNFC, st as UnitError, t as HostError, tn as assertScalarText, tt as smallExponent, u as bool, un as upper, ut as musicalKind, v as compareBytes, vt as ArithmeticError, wt as div, x as decimalParts, xt as decOf, y as concatText, yt as add, zt as addMonths } from "./errors-CNc-xY_9.js";
3
3
  //#region src/tasks.ts
4
4
  const runTask = (root) => {
5
5
  const stack = [root];
@@ -182,8 +182,8 @@ var Lexer = class {
182
182
  const parts = [];
183
183
  let start = begin;
184
184
  let i = begin;
185
- const error = (code, at, incomplete = false) => ({
186
- ...this.tok("error", code, at, Math.min(s.length, at + 1), space, mode, code),
185
+ const error = (code, at, incomplete = false, width = 1) => ({
186
+ ...this.tok("error", code, at, Math.min(s.length, at + width), space, mode, code),
187
187
  incomplete,
188
188
  parts: incomplete ? [] : parts.filter((p) => p.hole && p.hole.end < at)
189
189
  });
@@ -213,7 +213,7 @@ var Lexer = class {
213
213
  ...t,
214
214
  parts: t.incomplete ? [] : [...parts.filter((p) => p.hole), ...t.parts ?? []]
215
215
  };
216
- if (t.t === "eof") return error("unterminated interpolation", at, true);
216
+ if (t.t === "eof") return error("unterminated interpolation", at, true, 2);
217
217
  if (t.t === "op" && t.v === "}" && depth === 0) {
218
218
  parts.push({
219
219
  start,
@@ -4625,6 +4625,11 @@ const costModel = {
4625
4625
  0,
4626
4626
  10,
4627
4627
  1
4628
+ ], [
4629
+ 10,
4630
+ 0,
4631
+ 2,
4632
+ 1
4628
4633
  ]],
4629
4634
  "alloc": [[
4630
4635
  1,
@@ -4640,6 +4645,11 @@ const costModel = {
4640
4645
  0,
4641
4646
  10,
4642
4647
  1
4648
+ ], [
4649
+ 10,
4650
+ 0,
4651
+ 2,
4652
+ 1
4643
4653
  ]],
4644
4654
  "alloc": [[
4645
4655
  1,
@@ -5828,7 +5838,7 @@ const makeCostRates = (measure) => [
5828
5838
  fuel: 0,
5829
5839
  alloc: 0
5830
5840
  }) => {
5831
- into.fuel = 10;
5841
+ into.fuel = 10 + Math.ceil(2 * (m.scanned ?? 0) / 1);
5832
5842
  into.alloc = Math.ceil(1 * (m.resultSize ?? measure(1, m.result)) / 1);
5833
5843
  return into;
5834
5844
  },
@@ -5836,7 +5846,7 @@ const makeCostRates = (measure) => [
5836
5846
  fuel: 0,
5837
5847
  alloc: 0
5838
5848
  }) => {
5839
- into.fuel = 10;
5849
+ into.fuel = 10 + Math.ceil(2 * (m.scanned ?? 0) / 1);
5840
5850
  into.alloc = Math.ceil(1 * (m.resultSize ?? measure(1, m.result)) / 1);
5841
5851
  return into;
5842
5852
  },
@@ -8435,12 +8445,83 @@ const dateField = (name, d) => {
8435
8445
  };
8436
8446
  return integerValue(field[name]);
8437
8447
  };
8438
- const offsetOf = (name, v) => {
8448
+ const fixedOffsetUs = (v) => {
8439
8449
  const q = v.asQuantityRef();
8440
8450
  const seconds = q && sameDimension(q.unit, SECONDS) ? inBase(q) : void 0;
8441
8451
  const whole = seconds && isInteger(seconds) ? integerOf(seconds) : void 0;
8442
- if (whole === void 0 || whole % 60n !== 0n || whole >= 86400n || whole <= -86400n) throw outOfDomain(name, v);
8443
- return whole * US_PER_SECOND;
8452
+ return whole === void 0 || whole % 60n !== 0n || whole >= 86400n || whole <= -86400n ? void 0 : whole * US_PER_SECOND;
8453
+ };
8454
+ const offsetOf = (name, v) => {
8455
+ const us = fixedOffsetUs(v);
8456
+ if (us === void 0) throw outOfDomain(name, v);
8457
+ return us;
8458
+ };
8459
+ const exactKeys = (v, keys) => v.kind === "map" && v.mapSize === keys.length && keys.every((k) => v.hasKey(k));
8460
+ /** `scanned` is the number of changes, whenever `changes` is a list, so a
8461
+ * malformed map is charged as a well-formed one of its length would be. */
8462
+ const zoneRulesOf = (name, v, measure) => {
8463
+ const bad = () => outOfDomain(name, v);
8464
+ if (!exactKeys(v, [
8465
+ "zone",
8466
+ "until",
8467
+ "changes"
8468
+ ])) throw bad();
8469
+ const zone = v.get("zone").asText();
8470
+ const until = v.get("until").asInstant();
8471
+ const changes = v.get("changes");
8472
+ if (changes.kind === "list") measure.scanned = changes.length;
8473
+ if (zone === void 0 || until === void 0 || changes.kind !== "list" || changes.length === 0) throw bad();
8474
+ const starts = [];
8475
+ const offsets = [];
8476
+ for (let i = 1; i <= changes.length; i++) {
8477
+ const change = changes.index(i);
8478
+ if (!exactKeys(change, ["at", "offset"])) throw bad();
8479
+ const at = change.get("at").asInstant();
8480
+ const offset = fixedOffsetUs(change.get("offset"));
8481
+ if (at === void 0 || offset === void 0 || starts.length > 0 && at <= starts.at(-1)) throw bad();
8482
+ starts.push(at);
8483
+ offsets.push(offset);
8484
+ }
8485
+ if (starts.at(-1) >= until) throw bad();
8486
+ return {
8487
+ zone,
8488
+ starts,
8489
+ offsets,
8490
+ until
8491
+ };
8492
+ };
8493
+ const outsideWindow = (rules, us) => us < rules.starts[0] || us >= rules.until;
8494
+ /** The offset in effect at the Instant `us`, inside the window. */
8495
+ const zoneOffsetAt = (rules, us) => {
8496
+ let k = 0;
8497
+ while (k + 1 < rules.starts.length && rules.starts[k + 1] <= us) k++;
8498
+ return rules.offsets[k];
8499
+ };
8500
+ const DISAMBIGUATIONS = [
8501
+ "compatible",
8502
+ "earlier",
8503
+ "later",
8504
+ "reject"
8505
+ ];
8506
+ /** The Instant at which the zone's wall clock reads `local`, a Civil Date's
8507
+ * microseconds read as if at UTC, resolving a gap or overlap. */
8508
+ const zoneInstant = (rules, civil, local, disambiguation) => {
8509
+ for (const o of rules.offsets) if (outsideWindow(rules, local - o)) throw outOfRange("zone", civil);
8510
+ const { starts, offsets, until } = rules;
8511
+ const candidates = [];
8512
+ for (let k = 0; k < starts.length; k++) {
8513
+ const t = local - offsets[k];
8514
+ if (starts[k] <= t && t < (starts[k + 1] ?? until)) candidates.push(t);
8515
+ }
8516
+ if (candidates.length === 1) return candidates[0];
8517
+ if (disambiguation === "reject") throw new ScriptError("ambiguous time", [["civil", civil], ["zone", text(rules.zone)]]);
8518
+ if (candidates.length > 1) return disambiguation === "later" ? candidates.reduce((a, b) => a > b ? a : b) : candidates.reduce((a, b) => a < b ? a : b);
8519
+ for (let j = 1; j < starts.length; j++) {
8520
+ const o1 = offsets[j - 1];
8521
+ const o2 = offsets[j];
8522
+ if (local - o2 < starts[j] && starts[j] <= local - o1) return disambiguation === "earlier" ? local - o2 : local - o1;
8523
+ }
8524
+ throw new Error("a Civil Date with no candidate lies in no gap");
8444
8525
  };
8445
8526
  const unary = {
8446
8527
  sqrt,
@@ -8702,15 +8783,36 @@ const builtin = (name, args, measure = {}) => {
8702
8783
  case "hasTime": return { result: dateField(name, x) };
8703
8784
  case "toCivil": {
8704
8785
  if (x.kind !== "instant") throw wrongKind("instant", x);
8705
- const offset = offsetOf(name, y);
8706
- return { result: inRangeDate(() => civilOf(civilOfUs(x.asInstant() + offset))) };
8786
+ const i = x.asInstant();
8787
+ let offset;
8788
+ if (y.kind === "map") {
8789
+ const rules = zoneRulesOf(name, y, measure);
8790
+ if (outsideWindow(rules, i)) throw outOfRange("zone", x);
8791
+ offset = zoneOffsetAt(rules, i);
8792
+ } else offset = offsetOf(name, y);
8793
+ return {
8794
+ result: inRangeDate(() => civilOf(civilOfUs(i + offset))),
8795
+ scanned: measure.scanned
8796
+ };
8707
8797
  }
8708
8798
  case "toInstant": {
8709
8799
  const c = x.civilRef();
8710
8800
  if (!c) throw wrongKind("civil date", x);
8711
8801
  if (c.us === null) throw outOfDomain(name, x);
8712
- const offset = offsetOf(name, y);
8713
- return { result: inRangeDate(() => instantOf(checkInstant(civilUs(c) - offset))) };
8802
+ const how = z ?? nothing;
8803
+ if (y.kind !== "map") {
8804
+ const offset = offsetOf(name, y);
8805
+ if (how.kind !== "nothing") throw outOfDomain(name, how);
8806
+ return { result: inRangeDate(() => instantOf(checkInstant(civilUs(c) - offset))) };
8807
+ }
8808
+ const rules = zoneRulesOf(name, y, measure);
8809
+ const word = how.kind === "nothing" ? "compatible" : how.asText();
8810
+ if (word === void 0 || !DISAMBIGUATIONS.includes(word)) throw outOfDomain(name, how);
8811
+ const local = civilUs(c);
8812
+ return {
8813
+ result: inRangeDate(() => instantOf(checkInstant(zoneInstant(rules, x, local, word)))),
8814
+ scanned: measure.scanned
8815
+ };
8714
8816
  }
8715
8817
  case "abs":
8716
8818
  case "floor":
@@ -8758,6 +8860,7 @@ const builtin = (name, args, measure = {}) => {
8758
8860
  const builtinDefaults = {
8759
8861
  round: [num(0), text("half up")],
8760
8862
  bitShiftLeft: [nothing],
8863
+ toInstant: [nothing],
8761
8864
  fromFloat64: [text("big")],
8762
8865
  fromFloat32: [text("big")],
8763
8866
  toFloat64: [text("big")],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northtalk/ts",
3
- "version": "0.8.0",
3
+ "version": "0.10.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",
@@ -1,8 +1,8 @@
1
1
 
2
- import { P as listValues, V as nothing, b as dec, it as text, t as HostError } from "./errors-VuwK669R.js";
3
- import { t as defineObjectKind } from "./objects-TarIKBL8.js";
4
- import { Dt as shape, kt as validComputedMessageName, n as ScriptError, xt as defineValueCapability } from "./operations-BAELnqwf.js";
5
- import { c as fixed, f as registerStandardChecks, s as costOf } from "./encoding-B7MCQ4ii.js";
2
+ import { P as listValues, V as nothing, b as dec, it as text, t as HostError } from "./errors-CNc-xY_9.js";
3
+ import { t as defineObjectKind } from "./objects-OKVLH190.js";
4
+ import { Dt as shape, kt as validComputedMessageName, n as ScriptError, xt as defineValueCapability } from "./operations-DrsedOvj.js";
5
+ import { c as fixed, f as registerStandardChecks, s as costOf } from "./encoding-DlMqlP2Y.js";
6
6
  //#region src/peer-capability.ts
7
7
  /** The Core-fixed Object Kind of a Peer: no properties, no collection. */
8
8
  const PEER_KIND = "peer";
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-s6QIovKS.js";
2
+ import { J as Value, P as TsGroup, an as PeerImpl } from "./debug-2yfUZYzF.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 = {
package/peer.js CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
- import { H as num, L as map, N as list, V as nothing, i as ScriptError, it as text } from "./errors-VuwK669R.js";
2
+ import { H as num, L as map, N as list, V as nothing, i as ScriptError, it as text } from "./errors-CNc-xY_9.js";
3
3
  import { n as toBase64, t as fromBase64 } from "./base64-CDO-a06R.js";
4
- import { r as decodeValue } from "./readers-BG8g59qS.js";
5
- import { t as encodeValue } from "./encoding-B7MCQ4ii.js";
6
- import { a as peerKind } from "./peer-capability-B8eKbljR.js";
4
+ import { r as decodeValue } from "./readers-G1lHqrPl.js";
5
+ import { t as encodeValue } from "./encoding-DlMqlP2Y.js";
6
+ import { a as peerKind } from "./peer-capability-RMdN4OHj.js";
7
7
  //#region src/peer-message-port.ts
8
8
  /** The largest frame a link sends or reads, in UTF-8 bytes. */
9
9
  const MAX_FRAME$1 = 16777216;
@@ -1,5 +1,5 @@
1
1
 
2
- import { D as instant, E as hiddenCodePoint, J as range, K as quantity, L as map, P as listValues, Qt as parseInstant, V as nothing, b as dec, f as bytesOf, g as civilDate, it as text, l as Value, o as invalidValue, tn as assertScalarText, u as bool } from "./errors-VuwK669R.js";
2
+ import { D as instant, E as hiddenCodePoint, J as range, K as quantity, L as map, P as listValues, Qt as parseInstant, V as nothing, b as dec, f as bytesOf, g as civilDate, it as text, l as Value, o as invalidValue, tn as assertScalarText, u as bool } from "./errors-CNc-xY_9.js";
3
3
  import { t as fromBase64 } from "./base64-CDO-a06R.js";
4
4
  //#region src/readers.ts
5
5
  var Reader = class {
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { J as Value } from "./debug-s6QIovKS.js";
2
+ import { J as Value } from "./debug-2yfUZYzF.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) => {