@northtalk/ts 0.4.0 → 0.5.1

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 (70) hide show
  1. package/README.md +11 -0
  2. package/base64-CDO-a06R.js +29 -0
  3. package/{binary-value-Bb6HPDtM.d.ts → binary-value-xvJoGg0C.d.ts} +1 -1
  4. package/{checker-DMI4LiRm.js → checker-CUhn2XaM.js} +4 -4
  5. package/{core-BzGUgjL6.d.ts → core-BuTAYRm-.d.ts} +1 -1
  6. package/{debug-C72o2pZy.d.ts → debug-DRhMZAxw.d.ts} +28 -8
  7. package/debug.d.ts +1 -1
  8. package/debug.js +1 -1
  9. package/{driver-ClV_UDEK.d.ts → driver-CHDcuqUy.d.ts} +1 -1
  10. package/driver.d.ts +1 -1
  11. package/driver.js +1 -1
  12. package/{encoding-C3Q7pIC9.js → encoding-RUuES_e4.js} +2 -2
  13. package/{engine-BpdGfAND.js → engine-CXf5FCwi.js} +6 -6
  14. package/{engine-Dtby_FkE.d.ts → engine-Cc3yofGM.d.ts} +2 -2
  15. package/{errors-BKJES3Zu.js → errors-D11zizZg.js} +1580 -1481
  16. package/{group-vuUL2tq-.js → group-BflSou2n.js} +66 -44
  17. package/http-fetch-DFwVIOQg.js +517 -0
  18. package/http.d.ts +39 -2
  19. package/http.js +189 -6
  20. package/index.d.ts +13 -5
  21. package/index.js +36 -49
  22. package/{inline-grants-Cx0Z9XAt.js → inline-grants-XbX9HL_w.js} +72 -304
  23. package/lean-BebPaTMK.js +47 -0
  24. package/{index-ByF5j53i.d.ts → lean-CjWVuOrC.d.ts} +86 -124
  25. package/lean.d.ts +8 -0
  26. package/lean.js +15 -0
  27. package/{manifest-Dw-8Unmf.js → manifest-CCfpn0kC.js} +3 -4
  28. package/manifest-DVrx-pT2.d.ts +122 -0
  29. package/message-layer.d.ts +2 -2
  30. package/message-layer.js +2 -2
  31. package/notify.d.ts +1 -1
  32. package/notify.js +1 -1
  33. package/{objects-Dnqor7Gn.d.ts → objects-DC6HjzBY.d.ts} +1 -1
  34. package/{objects-BC4fS0vq.js → objects-DmUc0lha.js} +1 -1
  35. package/{base64-Dtqaz_0A.js → operations-DnCcztkZ.js} +1632 -32
  36. package/package.json +36 -2
  37. package/{readers-B5e5bBrY.js → readers-CsvlahLi.js} +2 -2
  38. package/{readers-DAFVvvq4.d.ts → readers-MmyZ_d0w.d.ts} +1 -1
  39. package/{request-pump-binary-BjnyqXV5.js → request-pump-binary-oqjWFqZA.js} +5 -4
  40. package/{router-BCHEfs4x.js → router-BZ-aYeXA.js} +4 -4
  41. package/{router-BspOCPA0.d.ts → router-D56rSkU8.d.ts} +2 -2
  42. package/session.d.ts +2 -2
  43. package/session.js +54 -15
  44. package/setup.d.ts +1 -1
  45. package/setup.js +4 -4
  46. package/sqlite.d.ts +2 -2
  47. package/sqlite.js +5 -5
  48. package/stdlib/bytes.d.ts +6 -0
  49. package/stdlib/bytes.js +11 -0
  50. package/stdlib/date.d.ts +6 -0
  51. package/stdlib/date.js +11 -0
  52. package/stdlib/json.d.ts +6 -0
  53. package/stdlib/json.js +11 -0
  54. package/stdlib/list.d.ts +6 -0
  55. package/stdlib/list.js +10 -0
  56. package/stdlib/map.d.ts +6 -0
  57. package/stdlib/map.js +10 -0
  58. package/stdlib/text.d.ts +6 -0
  59. package/stdlib/text.js +10 -0
  60. package/stdlib/units.d.ts +6 -0
  61. package/stdlib/units.js +10 -0
  62. package/stdlib-registry-BwitI3Ox.d.ts +18 -0
  63. package/{store-DTQa0lyE.js → store-DHlo6fP5.js} +2 -2
  64. package/{store-capability-BxXgiRM7.js → store-capability-BrUUAwVS.js} +3 -4
  65. package/store.d.ts +2 -2
  66. package/store.js +2 -2
  67. package/{user-capability-5-IvCeZI.js → user-capability-BcRQyyEw.js} +4 -5
  68. package/wasm.d.ts +5 -5
  69. package/wasm.js +13 -11
  70. package/capabilities-Bi5Qm6Fr.js +0 -1320
@@ -1,6 +1,7 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { $t as Script, Dr as SyntaxNode, Er as SyntaxErrorCode, J as Value, K as Decimal, Qt as Group, Tn as Library, Zt as Core, _ as LoadOptions, br as SourceSpan, cr as Binding, fr as LibraryExport, ht as ObjectKind, jt as Grant, qt as Shape, tr as CodeUnit, wr as Token, yr as SemanticTree, yt as GrantDecls } from "./debug-C72o2pZy.js";
3
- import { n as Drive, r as DrivenGroupOptions } from "./driver-ClV_UDEK.js";
2
+ import { Er as Token, Or as SyntaxErrorCode, Sr as SourceSpan, Zt as Core, kr as SyntaxNode, mr as LibraryExport, rr as CodeUnit, ur as Binding, xr as SemanticTree, yt as GrantDecls } from "./debug-DRhMZAxw.js";
3
+ import { r as DrivenGroupOptions } from "./driver-CHDcuqUy.js";
4
+ import { c as DrivenGroup } from "./manifest-DVrx-pT2.js";
4
5
  //#region src/generated/syntax.d.ts
5
6
  declare const grammar: {
6
7
  reserved: string[];
@@ -338,6 +339,86 @@ declare const builtins: readonly [{
338
339
  readonly total: 1;
339
340
  readonly variadic: false;
340
341
  };
342
+ }, {
343
+ readonly name: "bitAnd";
344
+ readonly kind: "function";
345
+ readonly contract: {
346
+ readonly required: 2;
347
+ readonly total: 2;
348
+ readonly variadic: false;
349
+ };
350
+ }, {
351
+ readonly name: "bitOr";
352
+ readonly kind: "function";
353
+ readonly contract: {
354
+ readonly required: 2;
355
+ readonly total: 2;
356
+ readonly variadic: false;
357
+ };
358
+ }, {
359
+ readonly name: "bitXor";
360
+ readonly kind: "function";
361
+ readonly contract: {
362
+ readonly required: 2;
363
+ readonly total: 2;
364
+ readonly variadic: false;
365
+ };
366
+ }, {
367
+ readonly name: "bitNot";
368
+ readonly kind: "function";
369
+ readonly contract: {
370
+ readonly required: 2;
371
+ readonly total: 2;
372
+ readonly variadic: false;
373
+ };
374
+ }, {
375
+ readonly name: "bitShiftLeft";
376
+ readonly kind: "function";
377
+ readonly contract: {
378
+ readonly required: 2;
379
+ readonly total: 3;
380
+ readonly variadic: false;
381
+ };
382
+ }, {
383
+ readonly name: "bitShiftRight";
384
+ readonly kind: "function";
385
+ readonly contract: {
386
+ readonly required: 2;
387
+ readonly total: 2;
388
+ readonly variadic: false;
389
+ };
390
+ }, {
391
+ readonly name: "bitRotateLeft";
392
+ readonly kind: "function";
393
+ readonly contract: {
394
+ readonly required: 3;
395
+ readonly total: 3;
396
+ readonly variadic: false;
397
+ };
398
+ }, {
399
+ readonly name: "bitRotateRight";
400
+ readonly kind: "function";
401
+ readonly contract: {
402
+ readonly required: 3;
403
+ readonly total: 3;
404
+ readonly variadic: false;
405
+ };
406
+ }, {
407
+ readonly name: "bitCount";
408
+ readonly kind: "function";
409
+ readonly contract: {
410
+ readonly required: 1;
411
+ readonly total: 1;
412
+ readonly variadic: false;
413
+ };
414
+ }, {
415
+ readonly name: "bitTest";
416
+ readonly kind: "function";
417
+ readonly contract: {
418
+ readonly required: 2;
419
+ readonly total: 2;
420
+ readonly variadic: false;
421
+ };
341
422
  }, {
342
423
  readonly name: "fromFloat64";
343
424
  readonly kind: "function";
@@ -577,6 +658,8 @@ type CheckOptions = {
577
658
  objects?: readonly string[];
578
659
  /** Setter availability for an Owning Script's me. */
579
660
  ownerProperties?: Readonly<Record<string, boolean>>;
661
+ /** The stdlib Libraries a `use` may name; absent means all seven. */
662
+ stdlib?: ReadonlySet<string>;
580
663
  /** Whether the source is a Script (the default) or a Library. */
581
664
  unit?: 'script' | 'library';
582
665
  };
@@ -600,87 +683,10 @@ type CheckResult = (SemanticResult & {
600
683
  declare const checkSyntax: (syntax: SyntaxNode, options?: CheckOptions) => SemanticResult;
601
684
  declare const checkSource: (source: string, options?: CheckOptions) => CheckResult;
602
685
  //#endregion
603
- //#region src/talk.d.ts
604
- /**
605
- * Dedents NorthTalk source; rejects JS interpolation.
606
- *
607
- * Write NorthTalk's own interpolation as `\${…}` and its backticks as `` \` ``.
608
- * Pass values as Request arguments instead of splicing them into source. The
609
- * longest whitespace prefix shared by every non-blank line is removed, compared
610
- * exactly, so tabs and spaces never match each other.
611
- */
612
- declare const talk: (strings: TemplateStringsArray, ...values: unknown[]) => string;
613
- //#endregion
614
- //#region src/plain.d.ts
615
- /** Plain JS data, as `fromValue` writes it (ADR 0119). */
616
- type PlainValue = null | boolean | string | Decimal | Uint8Array | Value | PlainValue[] | {
617
- [key: string]: PlainValue;
618
- } | Map<string, PlainValue>;
619
- type ToValueOptions = {
620
- /**
621
- * `integer` reads safe integers through `num`; `decimal` uses `num` for
622
- * any JS number. The default refuses JS numbers.
623
- */
624
- numbers?: 'refuse' | 'integer' | 'decimal';
625
- };
626
- type FromValueOptions = {
627
- maps?: 'object' | 'map';
628
- numbers?: 'decimal' | 'string';
629
- };
630
- /**
631
- * Plain JS data to a Value by the named constructors (ADR 0119). Anything
632
- * the table doesn't name, and cyclic data, throws `invalid value`.
633
- */
634
- declare const toValue: (plain: unknown, options?: ToValueOptions) => Value;
635
- /** A Value as plain JS data (ADR 0119); kinds with no JS form stay Values. */
636
- declare const fromValue: (v: Value, options?: FromValueOptions) => PlainValue;
637
- //#endregion
638
- //#region src/encoding.d.ts
639
- /**
640
- * A Message Layer adapter's own spelling of a Function Value or a Text
641
- * Pattern, which the Value Encoding doesn't hold.
642
- */
643
- type AdapterEncoder = (v: Value) => string;
644
- declare const encodeValue: (value: Value, adapter?: AdapterEncoder) => string;
645
- //#endregion
646
686
  //#region src/constructs.d.ts
647
687
  /** Chapter 3's kind names. */
648
688
  declare const kindNames: ReadonlySet<string>;
649
689
  //#endregion
650
- //#region src/json.d.ts
651
- /** Read exact decimal digits, NFC strings and insertion-ordered maps. */
652
- declare const decodeJson: (source: string) => Value;
653
- /** Compact JSON, with canonical numbers and chapter 7's string escapes. */
654
- declare const encodeJson: (value: Value) => string;
655
- //#endregion
656
- //#region src/handlers.d.ts
657
- /** Untyped Handler calls accept safe-integer JS numbers and plain data. */
658
- type Handlers = {
659
- [name: string]: (...args: (PlainValue | number | bigint)[]) => Promise<PlainValue>;
660
- };
661
- /** The Host supplies T without runtime checking of its arguments or results. */
662
- type ScriptWithHandlers<T = Handlers> = Script & {
663
- readonly handlers: T;
664
- };
665
- /**
666
- * Calls invoke with integer-mode toValue arguments and default fromValue answers.
667
- * The Script's existing driver or Host Pump loop still runs the Requests.
668
- * Promise hooks, symbols and non-message properties read as undefined.
669
- */
670
- declare const handlersOf: <T = Handlers>(script: Script) => T;
671
- //#endregion
672
- //#region src/group-helper.d.ts
673
- /** A Group whose driver closes explicitly or at the end of an `await using` scope. */
674
- type DrivenGroup = Omit<Group, 'load'> & Pick<Drive, 'close' | typeof Symbol.asyncDispose> & {
675
- load<T = Handlers>(o: LoadOptions): ScriptWithHandlers<T>;
676
- };
677
- /** The Zig Host Adapter requires its asynchronously created Core. */
678
- type CreateGroupOptions$1 = DrivenGroupOptions & {
679
- core: Core;
680
- };
681
- /** Creates a driven Group on the supplied Core; close has the driver's shutdown semantics. */
682
- declare const createGroup$1: (o: CreateGroupOptions$1) => DrivenGroup;
683
- //#endregion
684
690
  //#region src/create-group.d.ts
685
691
  /** Omitting core uses the process-wide TS Core. */
686
692
  type CreateGroupOptions = DrivenGroupOptions & {
@@ -689,47 +695,6 @@ type CreateGroupOptions = DrivenGroupOptions & {
689
695
  /** Creates a driven Group that supports `await using` and explicit close(reason). */
690
696
  declare const createGroup: (o: CreateGroupOptions) => DrivenGroup;
691
697
  //#endregion
692
- //#region src/inline-grants.d.ts
693
- /** Argument and result types are supplied by the Host, without runtime checking. */
694
- type InlineFunction = (...args: never[]) => unknown;
695
- type InlineOperation = InlineFunction | {
696
- arity?: number;
697
- fn: InlineFunction;
698
- } | {
699
- arity?: number;
700
- async: InlineFunction;
701
- maxPendingMs?: number;
702
- };
703
- /**
704
- * Defines one Capability per key and grants all its Operations. Arguments use
705
- * default fromValue; results use integer-mode toValue. Arity is fn.length unless
706
- * overridden, including for async functions, which also receive a final signal.
707
- */
708
- declare const inlineGrants: (capabilities: Readonly<Record<string, Readonly<Record<string, InlineOperation>>>>) => Record<string, Grant<void>>;
709
- //#endregion
710
- //#region src/manifest.d.ts
711
- type MessageDecl = {
712
- args?: readonly Shape[];
713
- description?: string;
714
- /** NorthTalk source, each sending this message. */
715
- examples?: readonly string[];
716
- name: string;
717
- receivers?: readonly ObjectKind[];
718
- };
719
- type ManifestSpec = {
720
- grants: Readonly<Record<string, Grant<any>>>;
721
- kind: string;
722
- libraries?: readonly Library[];
723
- messages?: readonly MessageDecl[];
724
- objectKinds?: readonly ObjectKind[];
725
- objects?: Readonly<Record<string, ObjectKind>>;
726
- /** The Owner Kind: one of objectKinds, the kind of `me` for tooling. */
727
- ownerKind?: ObjectKind;
728
- version: string;
729
- };
730
- /** Chapter 9's deterministic JSON file, ending in LF; never calls the Host. */
731
- declare const exportManifest: (m: ManifestSpec) => string;
732
- //#endregion
733
698
  //#region src/lowering.d.ts
734
699
  /** A construct whose lowering the Spec leaves unsettled; not a load diagnostic. */
735
700
  declare class LoweringError extends Error {
@@ -762,9 +727,6 @@ declare const lowerTree: (tree: SemanticTree, options: Pick<CompileOptions, "nam
762
727
  */
763
728
  declare const compileSource: (source: string, options: CompileOptions) => CompileResult;
764
729
  //#endregion
765
- //#region src/generated/stdlib.d.ts
766
- declare const stdlibSources: Record<string, string>;
767
- //#endregion
768
730
  //#region src/documentation.d.ts
769
731
  /**
770
732
  * The source start of a top-level declaration including its attached marked
@@ -776,4 +738,4 @@ declare const declarationStart: (root: SyntaxNode, declaration: SyntaxNode) => n
776
738
  //#region src/selectors.d.ts
777
739
  declare const validMessageSelector: (message: string, arity: number) => boolean;
778
740
  //#endregion
779
- export { ToValueOptions as A, checkSyntax as B, handlersOf as C, encodeValue as D, kindNames as E, CheckResult as F, RecoveringParseResult as G, EntryResult as H, Diagnostic as I, parseSource as J, RecoveryDiagnostic as K, DiagnosticCode as L, toValue as M, talk as N, FromValueOptions as O, CheckOptions as P, units as Q, SemanticResult as R, ScriptWithHandlers as S, encodeJson as T, ParseError as U, EntryKind as V, ParseResult as W, builtins as X, parseSourceRecovering as Y, grammar as Z, createGroup as _, CompileResult as a, createGroup$1 as b, exportsOf as c, MessageDecl as d, exportManifest as f, CreateGroupOptions as g, inlineGrants as h, CompileOptions as i, fromValue as j, PlainValue as k, lowerTree as l, InlineOperation as m, declarationStart as n, LoweringError as o, InlineFunction as p, parseEntry as q, stdlibSources as r, compileSource as s, validMessageSelector as t, ManifestSpec as u, CreateGroupOptions$1 as v, decodeJson as w, Handlers as x, DrivenGroup as y, checkSource as z };
741
+ export { units as A, RecoveringParseResult as C, parseSourceRecovering as D, parseSource as E, builtins as O, ParseResult as S, parseEntry as T, checkSource as _, LoweringError as a, EntryResult as b, lowerTree as c, kindNames as d, CheckOptions as f, SemanticResult as g, DiagnosticCode as h, CompileResult as i, grammar as k, CreateGroupOptions as l, Diagnostic as m, declarationStart as n, compileSource as o, CheckResult as p, CompileOptions as r, exportsOf as s, validMessageSelector as t, createGroup as u, checkSyntax as v, RecoveryDiagnostic as w, ParseError as x, EntryKind as y };
package/lean.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ /// <reference lib="esnext.disposable" />
2
+ import { $ as instant, $n as ScriptError, $t as Script$1, A as ScriptSources, An as OperationRef, Ar as SyntaxRule, At as FireOp, B as restore, Bn as UnitLoadError, Bt as ReleaseHook, C as Report, Cn as calendarCapability, Cr as Lexer, Ct as ChargeRequest, Dn as Library, Dr as SyntaxElement, Dt as EffectResult, E as RestoreResult, En as timerCapability, Er as Token, Et as Cost, Fn as Limits, Ft as Metering, G as RunStarted, Gn as NotImplementedError, Gt as SegmentGrant, H as RunAccounting, Hn as defaultLimits, Ht as ScopeDecl, In as Outcome, It as Operation, J as Value, Jn as HostError, Jt as SuspendingOp, K as Decimal, Kn as canConvert, Kt as SegmentLifecycle, L as TsScript, Ln as Run, Lt as Operations, Mn as compileLibrary, Mr as syntaxSelector, Mt as GrantContext, N as Settlement, Nr as syntaxText, Nt as ImmediateOp, O as SaveOptions, On as LibraryOptions, Or as SyntaxErrorCode, Ot as ErrorDecl, P as TsGroup, Pn as LimitName, Pt as LimitReached, Q as dec, Qn as MailboxFull, Qt as Group, R as Verdict, Rn as RunRecord, Rt as PlainArg, S as PumpedRequest, Sn as TimerImpl, Sr as SourceSpan, St as CapabilityDefiner, T as RestoreOptions, Tn as consoleCapability, Tr as TokType, Tt as CoordinatedLifecycle, U as RunAncestry, Un as deliver, Ut as SegmentContext, V as CausalWork, Vn as callFunction, Vt as ReleaseReason, W as RunDiscarded, Wn as loadScript, Wt as SegmentCoordinator, X as bytes, Xn as LoadDiagnostic, Xt as shape, Y as bool, Yn as HostErrorCode, Yt as defineCapability, Z as civilDate, Zn as LoadError, Zt as Core, _ as LoadOptions, _n as LocaleImpl, _r as SemanticName, _t as PropDef, an as httpCapability, ar as EventEntry, at as quantity, b as PumpOptions, bn as ConsoleImpl, br as SemanticToken, bt as Call, cn as StoreImpl, cr as UnwindEntry, d as Counters, dn as SqlParams, dr as BindingKind, dt as nowMicros, en as Versions, er as SendFailedReason, f as Decided, fn as SqlRows, fr as ExportKind, ft as parseInstant, g as Inspection, gn as sqliteCapability, gr as SemanticElement, gt as ObjectKindDef, h as GroupOptions, hn as SqliteImpl, hr as NameRole, ht as ObjectKind, in as HttpServerImpl, ir as EventBranch, it as num, jn as codeIdentity, jr as Trivia, jt as Grant, k as ScriptCodeRequest, kn as LibrarySource, kr as SyntaxNode, kt as FieldShape, l as CancellationOptions, ln as add, lr as disassemble, lt as text, m as EffectFailure, mn as SqliteBinding, mr as LibraryExport, mt as ObjectElements, nn as HttpClientImpl, nr as BodyKind, nt as map, on as UserImpl, or as Instruction, ot as range, p as Deciding, pn as SqlValue, pr as FunctionContract, pt as HostObject, q as Kind, qn as waitUs, qt as Shape, rn as HttpImpl, rr as CodeUnit, rt as nothing, sn as userCapability, sr as Operand, st as record, tn as coreVersions, tr as Body, tt as list, u as CarryOver, un as storeCapability, ur as Binding, ut as formatInstant, v as Message, vn as localeCapability, vr as SemanticNode, vt as defineObjectKind, w as Requested, wn as clockCapability, wr as Mode, wt as ChargeResult, x as PumpResult, xn as Costs, xr as SemanticTree, xt as CapabilityDef, y as PendingCall, yn as CalendarImpl, yr as SemanticScope, yt as GrantDecls, z as newGroup, zn as Script, zt as PlainResult } from "./debug-DRhMZAxw.js";
3
+ import { n as registerStdlib, r as stdlibNames, t as StdlibLibrary } from "./stdlib-registry-BwitI3Ox.js";
4
+ import { A as units, C as RecoveringParseResult, D as parseSourceRecovering, E as parseSource, O as builtins, S as ParseResult, T as parseEntry, _ as checkSource, a as LoweringError, b as EntryResult, c as lowerTree, d as kindNames, f as CheckOptions, g as SemanticResult, h as DiagnosticCode, i as CompileResult, k as grammar, l as CreateGroupOptions, m as Diagnostic, n as declarationStart, o as compileSource, p as CheckResult, r as CompileOptions, s as exportsOf, t as validMessageSelector, u as createGroup, v as checkSyntax, w as RecoveryDiagnostic, x as ParseError, y as EntryKind } from "./lean-CjWVuOrC.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-DVrx-pT2.js";
6
+ import { n as createCore, t as TsCore } from "./core-BuTAYRm-.js";
7
+ import { a as decodeValue, o as readDisplay, t as FunctionResolver } from "./readers-MmyZ_d0w.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 NameRole, NotImplementedError, type ObjectElements, type ObjectKind, type ObjectKindDef, type Operand, type Operation, type OperationRef, type Operations, type Outcome, ParseError, type ParseResult, 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 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, consoleCapability, coreVersions, createCore, createGroup, dec, declarationStart, decodeJson, decodeValue, defaultLimits, defineCapability, defineObjectKind, deliver, disassemble, encodeJson, encodeValue, exportManifest, exportsOf, formatInstant, fromValue, grammar, handlersOf, httpCapability, inlineGrants, instant, kindNames, list, loadScript, localeCapability, lowerTree, map, newGroup, nothing, nowMicros, num, parseEntry, parseInstant, parseSource, parseSourceRecovering, quantity, range, readDisplay, record, registerStdlib, restore, shape, sqliteCapability, stdlibNames, storeCapability, syntaxSelector, syntaxText, talk, text, timerCapability, toValue, units, userCapability, validMessageSelector, waitUs };
package/lean.js ADDED
@@ -0,0 +1,15 @@
1
+
2
+ import { Bt as formatInstant, G as record, Gt as parseInstant, H as quantity, L as nothing, N as map, Q as text, R as num, T as instant, Ut as nowMicros, W as range, an as builtins, c as Decimal, d as bytes, i as ScriptError, k as list, l as Value, m as civilDate, n as LoadError, r as MailboxFull, sn as grammar, t as HostError, u as bool, un as units, v as dec } from "./errors-D11zizZg.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-BflSou2n.js";
4
+ import { t as defineObjectKind } from "./objects-DmUc0lha.js";
5
+ import { $ as disassemble, Ct as validMessageSelector, H as waitUs, Tt as Lexer, _t as defineCapability, c as canConvert, ht as LimitReached, t as NotImplementedError, xt as shape } from "./operations-DnCcztkZ.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 kindNames } from "./checker-CUhn2XaM.js";
7
+ import { n as exportManifest } from "./manifest-CCfpn0kC.js";
8
+ import { c as readDisplay, r as decodeValue } from "./readers-CsvlahLi.js";
9
+ import { t as encodeValue } from "./encoding-RUuES_e4.js";
10
+ 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-XbX9HL_w.js";
11
+ import { o as decodeJson, s as encodeJson } from "./http-fetch-DFwVIOQg.js";
12
+ import { n as createCore, r as coreVersions, t as createGroup } from "./lean-BebPaTMK.js";
13
+ import { n as localeCapability, t as userCapability } from "./user-capability-BcRQyyEw.js";
14
+ import { a as clockCapability, i as calendarCapability, l as timerCapability, o as consoleCapability, r as storeCapability, t as add } from "./store-capability-BrUUAwVS.js";
15
+ 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, consoleCapability, coreVersions, createCore, createGroup, dec, declarationStart, decodeJson, decodeValue, defaultLimits, defineCapability, defineObjectKind, deliver, disassemble, encodeJson, encodeValue, exportManifest, exportsOf, formatInstant, fromValue, grammar, handlersOf, httpCapability, inlineGrants, instant, kindNames, list, loadScript, localeCapability, lowerTree, map, newGroup, nothing, nowMicros, num, parseEntry, parseInstant, parseSource, parseSourceRecovering, quantity, range, readDisplay, record, registerStdlib, restore, shape, sqliteCapability, stdlibNames, storeCapability, syntaxSelector, syntaxText, talk, text, timerCapability, toValue, units, userCapability, validMessageSelector, waitUs };
@@ -1,8 +1,7 @@
1
1
 
2
- import { K as requireArgs, t as HostError } from "./errors-BKJES3Zu.js";
3
- import { t as LimitReached } from "./capabilities-Bi5Qm6Fr.js";
4
- import { dt as compareText, mt as languageVersion } from "./base64-Dtqaz_0A.js";
5
- import { n as quoteJSON } from "./encoding-C3Q7pIC9.js";
2
+ import { K as requireArgs, t as HostError } from "./errors-D11zizZg.js";
3
+ import { ft as languageVersion, ht as LimitReached, lt as compareText } from "./operations-DnCcztkZ.js";
4
+ import { n as quoteJSON } from "./encoding-RUuES_e4.js";
6
5
  //#region src/call-meter.ts
7
6
  var CallMeter = class {
8
7
  take;
@@ -0,0 +1,122 @@
1
+ /// <reference lib="esnext.disposable" />
2
+ import { $t as Script, Dn as Library, J as Value, K as Decimal, Qt as Group, Zt as Core, _ as LoadOptions, ht as ObjectKind, jt as Grant, qt as Shape } from "./debug-DRhMZAxw.js";
3
+ import { n as Drive, r as DrivenGroupOptions } from "./driver-CHDcuqUy.js";
4
+ //#region src/talk.d.ts
5
+ /**
6
+ * Dedents NorthTalk source; rejects JS interpolation.
7
+ *
8
+ * Write NorthTalk's own interpolation as `\${…}` and its backticks as `` \` ``.
9
+ * Pass values as Request arguments instead of splicing them into source. The
10
+ * longest whitespace prefix shared by every non-blank line is removed, compared
11
+ * exactly, so tabs and spaces never match each other.
12
+ */
13
+ declare const talk: (strings: TemplateStringsArray, ...values: unknown[]) => string;
14
+ //#endregion
15
+ //#region src/plain.d.ts
16
+ /** Plain JS data, as `fromValue` writes it (ADR 0119). */
17
+ type PlainValue = null | boolean | string | Decimal | Uint8Array | Value | PlainValue[] | {
18
+ [key: string]: PlainValue;
19
+ } | Map<string, PlainValue>;
20
+ type ToValueOptions = {
21
+ /**
22
+ * `integer` reads safe integers through `num`; `decimal` uses `num` for
23
+ * any JS number. The default refuses JS numbers.
24
+ */
25
+ numbers?: 'refuse' | 'integer' | 'decimal';
26
+ };
27
+ type FromValueOptions = {
28
+ maps?: 'object' | 'map';
29
+ numbers?: 'decimal' | 'string';
30
+ };
31
+ /**
32
+ * Plain JS data to a Value by the named constructors (ADR 0119). Anything
33
+ * the table doesn't name, and cyclic data, throws `invalid value`.
34
+ */
35
+ declare const toValue: (plain: unknown, options?: ToValueOptions) => Value;
36
+ /** A Value as plain JS data (ADR 0119); kinds with no JS form stay Values. */
37
+ declare const fromValue: (v: Value, options?: FromValueOptions) => PlainValue;
38
+ //#endregion
39
+ //#region src/encoding.d.ts
40
+ /**
41
+ * A Message Layer adapter's own spelling of a Function Value or a Text
42
+ * Pattern, which the Value Encoding doesn't hold.
43
+ */
44
+ type AdapterEncoder = (v: Value) => string;
45
+ declare const encodeValue: (value: Value, adapter?: AdapterEncoder) => string;
46
+ //#endregion
47
+ //#region src/json.d.ts
48
+ /** Read exact decimal digits, NFC strings and insertion-ordered maps. */
49
+ declare const decodeJson: (source: string) => Value;
50
+ /** Compact JSON, with canonical numbers and chapter 7's string escapes. */
51
+ declare const encodeJson: (value: Value) => string;
52
+ //#endregion
53
+ //#region src/handlers.d.ts
54
+ /** Untyped Handler calls accept safe-integer JS numbers and plain data. */
55
+ type Handlers = {
56
+ [name: string]: (...args: (PlainValue | number | bigint)[]) => Promise<PlainValue>;
57
+ };
58
+ /** The Host supplies T without runtime checking of its arguments or results. */
59
+ type ScriptWithHandlers<T = Handlers> = Script & {
60
+ readonly handlers: T;
61
+ };
62
+ /**
63
+ * Calls invoke with integer-mode toValue arguments and default fromValue answers.
64
+ * The Script's existing driver or Host Pump loop still runs the Requests.
65
+ * Promise hooks, symbols and non-message properties read as undefined.
66
+ */
67
+ declare const handlersOf: <T = Handlers>(script: Script) => T;
68
+ //#endregion
69
+ //#region src/group-helper.d.ts
70
+ /** A Group whose driver closes explicitly or at the end of an `await using` scope. */
71
+ type DrivenGroup = Omit<Group, 'load'> & Pick<Drive, 'close' | typeof Symbol.asyncDispose> & {
72
+ load<T = Handlers>(o: LoadOptions): ScriptWithHandlers<T>;
73
+ };
74
+ /** The Zig Host Adapter requires its asynchronously created Core. */
75
+ type CreateGroupOptions = DrivenGroupOptions & {
76
+ core: Core;
77
+ };
78
+ /** Creates a driven Group on the supplied Core; close has the driver's shutdown semantics. */
79
+ declare const createGroup: (o: CreateGroupOptions) => DrivenGroup;
80
+ //#endregion
81
+ //#region src/inline-grants.d.ts
82
+ /** Argument and result types are supplied by the Host, without runtime checking. */
83
+ type InlineFunction = (...args: never[]) => unknown;
84
+ type InlineOperation = InlineFunction | {
85
+ arity?: number;
86
+ fn: InlineFunction;
87
+ } | {
88
+ arity?: number;
89
+ async: InlineFunction;
90
+ maxPendingMs?: number;
91
+ };
92
+ /**
93
+ * Defines one Capability per key and grants all its Operations. Arguments use
94
+ * default fromValue; results use integer-mode toValue. Arity is fn.length unless
95
+ * overridden, including for async functions, which also receive a final signal.
96
+ */
97
+ declare const inlineGrants: (capabilities: Readonly<Record<string, Readonly<Record<string, InlineOperation>>>>) => Record<string, Grant<void>>;
98
+ //#endregion
99
+ //#region src/manifest.d.ts
100
+ type MessageDecl = {
101
+ args?: readonly Shape[];
102
+ description?: string;
103
+ /** NorthTalk source, each sending this message. */
104
+ examples?: readonly string[];
105
+ name: string;
106
+ receivers?: readonly ObjectKind[];
107
+ };
108
+ type ManifestSpec = {
109
+ grants: Readonly<Record<string, Grant<any>>>;
110
+ kind: string;
111
+ libraries?: readonly Library[];
112
+ messages?: readonly MessageDecl[];
113
+ objectKinds?: readonly ObjectKind[];
114
+ objects?: Readonly<Record<string, ObjectKind>>;
115
+ /** The Owner Kind: one of objectKinds, the kind of `me` for tooling. */
116
+ ownerKind?: ObjectKind;
117
+ version: string;
118
+ };
119
+ /** Chapter 9's deterministic JSON file, ending in LF; never calls the Host. */
120
+ declare const exportManifest: (m: ManifestSpec) => string;
121
+ //#endregion
122
+ export { PlainValue as _, InlineOperation as a, toValue as b, DrivenGroup as c, ScriptWithHandlers as d, handlersOf as f, FromValueOptions as g, encodeValue as h, InlineFunction as i, createGroup as l, encodeJson as m, MessageDecl as n, inlineGrants as o, decodeJson as p, exportManifest as r, CreateGroupOptions as s, ManifestSpec as t, Handlers as u, ToValueOptions as v, talk as x, fromValue as y };
@@ -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-DAFVvvq4.js";
3
- import { n as decodeBinaryValue, r as encodeBinaryValue, t as BinaryValueOptions } from "./binary-value-Bb6HPDtM.js";
2
+ import { i as JsonObject, n as Json, r as JsonNumber, s as readOrderedJSON } from "./readers-MmyZ_d0w.js";
3
+ import { n as decodeBinaryValue, r as encodeBinaryValue, t as BinaryValueOptions } from "./binary-value-xvJoGg0C.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-B5e5bBrY.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-BjnyqXV5.js";
2
+ import { l as readOrderedJSON, n as JsonObject, t as JsonNumber } from "./readers-CsvlahLi.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-oqjWFqZA.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-BspOCPA0.js";
2
+ import { a as changed, i as WatchLimits, n as RouterOptions, o as createRouter, r as RoutingResult, t as NotificationRouter } from "./router-D56rSkU8.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-BCHEfs4x.js";
2
+ export { t as changed, n as createRouter } from "./router-BZ-aYeXA.js";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.disposable" />
2
- import { An as compileLibrary, C as Report, D as RunEvent, E as RestoreResult, F as TsGroupOptions, Ht as ScopeDecl, I as TsRestoreOptions, J as Value, L as TsScript, M as SessionPort, Nn as Limits, P as TsGroup, Tn as Library, Yn as LoadError, _n as CalendarImpl, fn as SqliteBinding, g as Inspection, gt as ObjectKindDef, hn as LocaleImpl, ht as ObjectKind, j as SessionControls, jn as replacementLibraries, jt as Grant, pt as HostObject, qt as Shape, t as DebugController, xt as CapabilityDef, yt as GrantDecls } from "./debug-C72o2pZy.js";
2
+ import { C as Report, D as RunEvent, Dn as Library, E as RestoreResult, F as TsGroupOptions, Fn as Limits, Ht as ScopeDecl, I as TsRestoreOptions, J as Value, L as TsScript, M as SessionPort, Mn as compileLibrary, Nn as replacementLibraries, P as TsGroup, Zn as LoadError, _n as LocaleImpl, g as Inspection, gt as ObjectKindDef, ht as ObjectKind, j as SessionControls, jt as Grant, mn as SqliteBinding, pt as HostObject, qt as Shape, t as DebugController, xt as CapabilityDef, yn as CalendarImpl, yt as GrantDecls } from "./debug-DRhMZAxw.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 { t as HostError, z as objectValue } from "./errors-BKJES3Zu.js";
2
+ import { t as HostError, z as objectValue } from "./errors-D11zizZg.js";
3
3
  //#region src/objects.ts
4
4
  const elementCost = (cost, name) => {
5
5
  const c = cost;