toilscript 0.1.42 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "imports": {
3
- "toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.42/dist/toilscript.js",
4
- "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.42/dist/cli.js",
3
+ "toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.44/dist/toilscript.js",
4
+ "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.44/dist/cli.js",
5
5
  "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@130.0.0-nightly.20260609/index.js",
6
6
  "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
7
7
  }
@@ -607,7 +607,9 @@ declare module "types:toilscript/src/diagnosticMessages.generated" {
607
607
  Scheduled_requires_a_single_string_schedule_argument = 9010,
608
608
  Scheduled_spec_0_is_not_a_valid_interval_or_cron_expression = 9011,
609
609
  Scheduled_handler_0_must_take_no_arguments_and_return_void = 9012,
610
- Stream_scope_must_be_a_StreamScope_enum_member = 9013
610
+ Stream_scope_must_be_a_StreamScope_enum_member = 9013,
611
+ Stream_connect_handler_0_has_an_invalid_signature = 9014,
612
+ Stream_message_handler_0_has_an_invalid_signature = 9015
611
613
  }
612
614
  /** Translates a diagnostic code to its respective string. */
613
615
  export function diagnosticCodeToString(code: DiagnosticCode): string;
@@ -2989,6 +2991,8 @@ declare module "types:toilscript/src/parser" {
2989
2991
  toildbCodecClasses: Map<string, ClassDeclaration>;
2990
2992
  /** Guards `weaveDataMigrations` so it runs exactly once (before element creation). */
2991
2993
  toildbWoven: boolean;
2994
+ /** Guards `weaveDeriveHandlers` so the module-level `derive_run` export is emitted once. */
2995
+ toildbDerivesWoven: boolean;
2992
2996
  /** Current overridden module name. */
2993
2997
  currentModuleName: string | null;
2994
2998
  /** Compiler options. */
@@ -3011,6 +3015,12 @@ declare module "types:toilscript/src/parser" {
3011
3015
  getDependee(dependent: string): string | null;
3012
3016
  /** Finishes parsing. */
3013
3017
  finish(): void;
3018
+ /** Synthesize the hot/default module-level `derive_run(derive_id)` export for
3019
+ * `@database` classes with `@derive` methods. Runs before element creation
3020
+ * from `initializeProgram`, so generated members/exports are compiled as
3021
+ * ordinary program symbols. Cold artifacts intentionally do not export
3022
+ * request-path derive runners and do not emit `toildb.derives`. */
3023
+ weaveDeriveHandlers(): void;
3014
3024
  weaveDataMigrations(): void;
3015
3025
  /** Enforce the migration-file convention (folder AND extension): every `@migrate`
3016
3026
  * must live in a `*.migration.ts` file under a `migrations/` directory. Keeping
@@ -3187,6 +3197,9 @@ declare module "types:toilscript/src/parser" {
3187
3197
  /** True if `node` is a non-nullable named type whose identifier is exactly `name`
3188
3198
  * (e.g. a `StreamPacket` parameter or a `StreamOutbound` return on a raw @message). */
3189
3199
  private isNamedType;
3200
+ /** The `@data` message type named by `@stream({ message: SomeData })`, or "" for the raw-bytes
3201
+ * default (F3 / doc 03 section 2.5). Mirrors `buildToilStreamCatalog`'s `identField(objA, "message")`. */
3202
+ private streamMessageType;
3190
3203
  /**
3191
3204
  * The injected stream ring runtime (spec 05 sections 5-6; byte layouts in 10), emitted once per
3192
3205
  * program under the `stream_dispatch` export gate. Provides two fixed 128 KiB rings in linear
@@ -4593,6 +4606,23 @@ declare module "types:toilscript/src/dbcatalog" {
4593
4606
  * missing/non-string arg or an unparseable spec.
4594
4607
  */
4595
4608
  export function buildToilDaemonCatalog(program: Program): Uint8Array | null;
4609
+ /** Build the `toildb.derives` section bytes, or `null` if no `@database` class
4610
+ * declares a `@derive` materializer. The section wires each `@derive` method to
4611
+ * the database class that owns it, so the host runner can, after a write to one
4612
+ * of a database's source collections, re-run that database's derives (each
4613
+ * recomputes + `view.publish`es its materialized view). `derive_id` is assigned
4614
+ * globally in source-declaration order across every `@database` class, matching
4615
+ * the single module-level `derive_run(derive_id)` dispatcher synthesized by the
4616
+ * parser 1:1. Format (LE):
4617
+ *
4618
+ * u16 format_version = 1
4619
+ * u16 n_derives
4620
+ * per derive:
4621
+ * u16 derive_id (global declaration order in the hot/default module)
4622
+ * str db_name (the @database class name; the write -> derive key)
4623
+ * str method_name (the @derive method, for diagnostics)
4624
+ */
4625
+ export function buildToilDbDerives(program: Program): Uint8Array | null;
4596
4626
  /** Build the `toil.surface` section bytes (always emitted per artifact). Per
4597
4627
  * Part 5 (LE):
4598
4628
  *