@almadar/core 11.4.0 → 11.5.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 (49) hide show
  1. package/dist/{builders-CAQ_shuO.d.ts → builders-JiXD6W1T.d.ts} +2434 -266
  2. package/dist/builders.d.ts +5 -5
  3. package/dist/builders.js +3 -3
  4. package/dist/{bus-QFvlnIfW.d.ts → bus-__zVNcsp.d.ts} +26 -6
  5. package/dist/{chunk-OLSKERKZ.js → chunk-27Y5AXHB.js} +21 -0
  6. package/dist/chunk-2WLRKYD5.js +3823 -0
  7. package/dist/{chunk-UCP26C3C.js → chunk-J64IR3DR.js} +14 -4
  8. package/dist/{chunk-ISAUHHDU.js → chunk-J64YVVB4.js} +1 -1
  9. package/dist/{chunk-JPJQCTJI.js → chunk-JN3MMQTB.js} +3 -1
  10. package/dist/{chunk-JCRN3F6T.js → chunk-LQZXCL47.js} +62 -26
  11. package/dist/{chunk-O2ZUOWNK.js → chunk-OQ3Y5SL3.js} +1 -1
  12. package/dist/{chunk-TOAMAGC7.js → chunk-Q4OJQNYY.js} +5 -2
  13. package/dist/{chunk-QV6J4EAF.js → chunk-VC3HXUWQ.js} +7071 -48
  14. package/dist/{chunk-7JO77HA6.js → chunk-VQWE3FCB.js} +1 -1
  15. package/dist/{chunk-DHWP7B4S.js → chunk-XYHBAUWE.js} +102 -5
  16. package/dist/{effect--PY8R4Oi.d.ts → effect-gddySYLX.d.ts} +212 -49
  17. package/dist/{effect-result-fH1ZTxn6.d.ts → effect-result-BvBwmspK.d.ts} +76 -9
  18. package/dist/factory/index.d.ts +2 -2
  19. package/dist/factory/index.js +4 -4
  20. package/dist/factory-runtime/index.d.ts +3 -3
  21. package/dist/factory-runtime/index.js +10 -10
  22. package/dist/fixtures.d.ts +3 -3
  23. package/dist/fixtures.js +2 -2
  24. package/dist/i18n/index.js +1 -1
  25. package/dist/{index-Dk2AoJdI.d.ts → index-h6KrpmjR.d.ts} +27 -27
  26. package/dist/index.d.ts +14 -14
  27. package/dist/index.js +15 -15
  28. package/dist/kernel-wire.d.ts +2 -2
  29. package/dist/kernel-wire.js +1 -1
  30. package/dist/language/constructs.json +13 -3
  31. package/dist/language/program-types.json +22 -1
  32. package/dist/language/validation-codes.json +96 -1
  33. package/dist/language/vocabulary.json +19 -1
  34. package/dist/language-data.js +1 -1
  35. package/dist/patterns/component-mapping.json +11 -1
  36. package/dist/patterns/definitions.d.ts +1 -1
  37. package/dist/patterns/definitions.js +1 -1
  38. package/dist/patterns/event-contracts.json +1 -1
  39. package/dist/patterns/index.d.ts +41 -3
  40. package/dist/patterns/index.js +2 -2
  41. package/dist/patterns/patterns-registry.json +7071 -48
  42. package/dist/patterns/registry.json +7071 -48
  43. package/dist/{trait-BO2gbBte.d.ts → trait-Oun4JgeZ.d.ts} +113 -73
  44. package/dist/types/index.d.ts +8 -8
  45. package/dist/types/index.js +7 -7
  46. package/dist/{types-CSBhbbse.d.ts → types-B-r7Z7Lf.d.ts} +2 -2
  47. package/package.json +6 -6
  48. package/dist/chunk-AIRZM37O.js +0 -3809
  49. package/dist/{domain-Cpmja5ak.d.ts → domain-WtYcvBMH.d.ts} +51 -51
@@ -1,4 +1,4 @@
1
- import { mergeCallSiteConfigOverrides, parseOrbitalSchema, isOrbitalValue, OrbitalValueSchema, isInlineTrait, isEntityReference, parseEntityRef, isEntityCall } from './chunk-UCP26C3C.js';
1
+ import { mergeCallSiteConfigOverrides, parseOrbitalSchema, isOrbitalValue, OrbitalValueSchema, isInlineTrait, isEntityReference, parseEntityRef, isEntityCall } from './chunk-J64IR3DR.js';
2
2
 
3
3
  // src/builders/apply-config-overrides.ts
4
4
  function overrideTrait(trait, values) {
@@ -1,5 +1,5 @@
1
- import { OrbitalSchemaSchema, SourceDeclarationMetadataSchema } from './chunk-UCP26C3C.js';
2
- import { FieldValueSchema, EntityRowSchema, SERVER_REPORTED_EFFECTS } from './chunk-JPJQCTJI.js';
1
+ import { OrbitalSchemaSchema, SourceDeclarationMetadataSchema } from './chunk-J64IR3DR.js';
2
+ import { FieldValueSchema, EntityRowSchema, SERVER_REPORTED_EFFECTS } from './chunk-JN3MMQTB.js';
3
3
  import { EventPayloadValueSchema, EventPayloadSchema } from './chunk-R3Y7ABF4.js';
4
4
  import { JsonValueSchema, isJsonObject } from './chunk-GNLND5O2.js';
5
5
  import { z } from 'zod';
@@ -675,6 +675,7 @@ function guardHolds(check, onError) {
675
675
  return false;
676
676
  }
677
677
  }
678
+ var ServerEffectCodeSchema = z.enum(["not-found", "no-row-key", "duplicate-id", "denied", "derived-failed"]);
678
679
  var ServerBatchSummarySchema = z.object({
679
680
  operations: z.array(EntityRowSchema),
680
681
  completedCount: z.number(),
@@ -689,7 +690,7 @@ var ServerEffectResultSchema = z.object({
689
690
  success: z.boolean(),
690
691
  denied: z.literal(true).optional(),
691
692
  error: z.string().optional(),
692
- code: z.enum(["not-found", "no-row-key", "duplicate-id", "denied", "derived-failed"]).optional(),
693
+ code: ServerEffectCodeSchema.optional(),
693
694
  target: z.string().optional(),
694
695
  routed: z.string().optional()
695
696
  });
@@ -1308,7 +1309,7 @@ var validation_codes_default = [
1308
1309
  {
1309
1310
  code: "ORB_BINDING_FROM_ENTITY_OUTSIDE_ENSURES",
1310
1311
  category: "binding",
1311
- description: "@fromEntity is the row before a transition and may only be used inside an @ensures"
1312
+ description: "The @fromEntity binding is the row before a transition and may only be used inside an @ensures"
1312
1313
  },
1313
1314
  {
1314
1315
  code: "ORB_BINDING_INVALID_FORMAT",
@@ -1425,6 +1426,11 @@ var validation_codes_default = [
1425
1426
  category: "circuit",
1426
1427
  description: "A transition declares async result events but its target state has no arm handling them, so the requester cannot hear its own result"
1427
1428
  },
1429
+ {
1430
+ code: "ORB_CIRCUIT_ASYNC_RESULT_DEAF_WAITING",
1431
+ category: "circuit",
1432
+ description: "A state that only an async result can leave is reachable while a call-service is in flight and has no arm for that call's outcome, so the outcome is dropped there"
1433
+ },
1428
1434
  {
1429
1435
  code: "ORB_CIRCUIT_DEAD_BODILESS_ACTION",
1430
1436
  category: "circuit",
@@ -1440,6 +1446,11 @@ var validation_codes_default = [
1440
1446
  category: "circuit",
1441
1447
  description: "A state handles a failure event but its arm neither renders nor emits a declared event, so the failure reaches no one"
1442
1448
  },
1449
+ {
1450
+ code: "ORB_CIRCUIT_INIT_ARM_NEVER_FIRES",
1451
+ category: "circuit",
1452
+ description: "Every INIT arm of a trait's initial state is guarded by a condition that is false for the composition's config and no other arm of that state can fire, so the trait never starts"
1453
+ },
1443
1454
  {
1444
1455
  code: "ORB_CIRCUIT_INIT_UNCOVERED_STATE",
1445
1456
  category: "circuit",
@@ -1615,6 +1626,11 @@ var validation_codes_default = [
1615
1626
  category: "effect",
1616
1627
  description: "An effect is written in a retired object form instead of the array form"
1617
1628
  },
1629
+ {
1630
+ code: "ORB_EFF_SERVER_EFFECT_NO_FAILURE_ROUTE",
1631
+ category: "effect",
1632
+ description: "A fetch, persist or call-service effect on a server entity declares no `emit: { failure }` route, so its error reaches no one"
1633
+ },
1618
1634
  {
1619
1635
  code: "ORB_EFF_SET_INVALID_BINDING",
1620
1636
  category: "effect",
@@ -1665,11 +1681,21 @@ var validation_codes_default = [
1665
1681
  category: "entity",
1666
1682
  description: "An entity declares owner columns but has no access policy scoping rows to the owner"
1667
1683
  },
1684
+ {
1685
+ code: "ORB_ENTITY_READ_UNDECLARED",
1686
+ category: "entity",
1687
+ description: "A persistent entity declares neither an @read policy nor an @read none waiver, so who reads its rows is unstated"
1688
+ },
1668
1689
  {
1669
1690
  code: "ORB_ENTITY_SPLIT_MUTATION",
1670
1691
  category: "entity_mutation",
1671
1692
  description: "A runtime entity is mutated by several traits on isolated per-trait copies while another trait reads a field it never writes"
1672
1693
  },
1694
+ {
1695
+ code: "ORB_ENTITY_WRITE_UNDECLARED",
1696
+ category: "entity",
1697
+ description: "A persistent entity declares no @create, or declares some write directives but not all of @create, @update and @delete, so an undeclared write is allow-all"
1698
+ },
1673
1699
  {
1674
1700
  code: "ORB_E_DUPLICATE_FIELD",
1675
1701
  category: "entity",
@@ -1785,6 +1811,11 @@ var validation_codes_default = [
1785
1811
  category: "effect",
1786
1812
  description: "A fetch with total none skips the count, so the success event's totalCount is never set and may not be read"
1787
1813
  },
1814
+ {
1815
+ code: "ORB_FETCH_UNBOUNDED",
1816
+ category: "query",
1817
+ description: "A fetch of a persistent entity has no limit, id or nearest, so it reads every row"
1818
+ },
1788
1819
  {
1789
1820
  code: "ORB_FETCH_UNINDEXED",
1790
1821
  category: "query",
@@ -1890,6 +1921,21 @@ var validation_codes_default = [
1890
1921
  category: "inbound",
1891
1922
  description: "An inbound hook event answers with an event the trait does not declare in emits"
1892
1923
  },
1924
+ {
1925
+ code: "ORB_INBOUND_CLI_DASH_WORD",
1926
+ category: "inbound",
1927
+ description: "A cli- inbound hook has an empty command word, so a word would start with a dash"
1928
+ },
1929
+ {
1930
+ code: "ORB_INBOUND_CLI_RESERVED",
1931
+ category: "inbound",
1932
+ description: "A cli- inbound hook takes a command word the orb bootloader reserves"
1933
+ },
1934
+ {
1935
+ code: "ORB_INBOUND_CLI_SHADOWED",
1936
+ category: "inbound",
1937
+ description: "A cli- inbound hook is a prefix of a longer cli- hook, so the longer hook takes the arguments that begin with its next word"
1938
+ },
1893
1939
  {
1894
1940
  code: "ORB_INBOUND_DUPLICATE",
1895
1941
  category: "inbound",
@@ -1980,6 +2026,11 @@ var validation_codes_default = [
1980
2026
  category: "listen",
1981
2027
  description: "A listens route is redundant because the embedded trait already receives that event"
1982
2028
  },
2029
+ {
2030
+ code: "ORB_LISTEN_ROUTE_PROJECTION_MISMATCH",
2031
+ category: "trait_event",
2032
+ description: "A listens route copies a payload field projected from one entity field into a payload field projected from a different field of the same entity"
2033
+ },
1983
2034
  {
1984
2035
  code: "ORB_LISTEN_ROUTE_STARVES_REQUIRED_FIELD",
1985
2036
  category: "trait_event",
@@ -2240,6 +2291,11 @@ var validation_codes_default = [
2240
2291
  category: "persist",
2241
2292
  description: "A persist effect names its row id with an expression instead of a binding path or literal id, so no row key resolves"
2242
2293
  },
2294
+ {
2295
+ code: "ORB_PERSIST_UPDATE_WITHOUT_CREATE",
2296
+ category: "cross",
2297
+ description: "A persistent entity the program updates but never creates, upserts or batch-creates, and that declares no instances: the update can never find a row. An update made by a trait authored in this program that binds the entity as its `@rebindable` placeholder is not judged, since the program that composes the trait owns the rows; nor is an update by a trait authored in an orbital that declares `expects entity` for that entity (a composed copy of the trait is still judged), which states that another part of the program supplies the rows"
2298
+ },
2243
2299
  {
2244
2300
  code: "ORB_PERSIST_WHERE_NOT_A_PREDICATE",
2245
2301
  category: "persist",
@@ -2280,6 +2336,11 @@ var validation_codes_default = [
2280
2336
  category: "page",
2281
2337
  description: "A page declares an empty traits array"
2282
2338
  },
2339
+ {
2340
+ code: "ORB_P_ENTRY_UNKNOWN_ROUTE",
2341
+ category: "page",
2342
+ description: "An entry route of the app names a path that is no page of the app"
2343
+ },
2283
2344
  {
2284
2345
  code: "ORB_P_HOST_RESERVED_ROUTE",
2285
2346
  category: "page",
@@ -2325,6 +2386,11 @@ var validation_codes_default = [
2325
2386
  category: "page",
2326
2387
  description: "A page has no traits array for trait-driven UI"
2327
2388
  },
2389
+ {
2390
+ code: "ORB_P_ROUTE_PARAM_MISSING_FOR_INIT",
2391
+ category: "page",
2392
+ description: "A route page whose path lacks a :param for a field a mounted trait declares required on its INIT event, so navigating to it is refused"
2393
+ },
2328
2394
  {
2329
2395
  code: "ORB_P_SIGN_IN_UNKNOWN_ROUTE",
2330
2396
  category: "page",
@@ -2365,6 +2431,11 @@ var validation_codes_default = [
2365
2431
  category: "render_ui",
2366
2432
  description: "A non-drawable child is composed under a canvas draw-host, which paints only neutral drawable descriptors"
2367
2433
  },
2434
+ {
2435
+ code: "ORB_RUI_CONTROLLED_WITHOUT_CHANGE",
2436
+ category: "render_ui",
2437
+ description: "A control whose value is bound to a non-literal and that wires none of the events that report its change: the field cannot be edited"
2438
+ },
2368
2439
  {
2369
2440
  code: "ORB_RUI_ELEMENT_SHAPE_MISMATCH",
2370
2441
  category: "render_ui",
@@ -2465,6 +2536,16 @@ var validation_codes_default = [
2465
2536
  category: "slot",
2466
2537
  description: "No trait on a page renders anything into the main slot"
2467
2538
  },
2539
+ {
2540
+ code: "ORB_SLOT_MAIN_ONLY_CONTAINERS",
2541
+ category: "slot",
2542
+ description: "Every trait render into the main slot of a page paints only empty layout-only containers, so nothing is shown"
2543
+ },
2544
+ {
2545
+ code: "ORB_STATE_TRAPPED",
2546
+ category: "composed",
2547
+ description: "A trait can reach a state that no event the program sends can take it out of"
2548
+ },
2468
2549
  {
2469
2550
  code: "ORB_STORE_DRIVER_CONTRACT",
2470
2551
  category: "store",
@@ -2585,6 +2666,11 @@ var validation_codes_default = [
2585
2666
  category: "schema",
2586
2667
  description: "A read of a field of the signed-in user names a field the declared identity entity does not have"
2587
2668
  },
2669
+ {
2670
+ code: "ORB_S_USER_ID_EMPTY_COMPARISON",
2671
+ category: "schema",
2672
+ description: `A comparison of @user.id with the empty string, which is never true of a viewer: the anonymous viewer's id is "anonymous", so the comparison is constant`
2673
+ },
2588
2674
  {
2589
2675
  code: "ORB_TAB_EFFECT_ON_SERVER",
2590
2676
  category: "tab",
@@ -2780,6 +2866,11 @@ var validation_codes_default = [
2780
2866
  category: "trait",
2781
2867
  description: "A config field typed secret does not default to a string credential reference"
2782
2868
  },
2869
+ {
2870
+ code: "ORB_T_SERVER_TRAIT_CLIENT_EFFECT",
2871
+ category: "trait",
2872
+ description: "A trait that runs every step on the server performs an effect only a client can do and the kernel does not forward to one"
2873
+ },
2783
2874
  {
2784
2875
  code: "ORB_T_STATE_UNREACHABLE",
2785
2876
  category: "trait",
@@ -2845,6 +2936,11 @@ var validation_codes_default = [
2845
2936
  category: "cross",
2846
2937
  description: "Traits form a circular event dependency"
2847
2938
  },
2939
+ {
2940
+ code: "ORB_X_COLLECTION_ENUM_MISMATCH",
2941
+ category: "cross",
2942
+ description: "Two persistent entities on one collection declare the same field as an enum with different value sets, so one entity's rows fail the other's type"
2943
+ },
2848
2944
  {
2849
2945
  code: "ORB_X_CROSS_EMITTER_DECLARED_PAYLOAD_MISMATCH",
2850
2946
  category: "cross",
@@ -3304,6 +3400,7 @@ var PlayedEffectSchema = z.object({
3304
3400
  args: z.array(JsonValueSchema),
3305
3401
  status: z.enum(["executed", "failed", "skipped"]),
3306
3402
  error: z.string().optional(),
3403
+ code: ServerEffectCodeSchema.optional(),
3307
3404
  routed: z.boolean(),
3308
3405
  nested: PlayedNestedSchema.optional()
3309
3406
  });
@@ -3355,7 +3452,7 @@ var RenderedSlotSchema = z.object({
3355
3452
  ownerEntity: z.string(),
3356
3453
  nodes: z.array(RenderedNodeSchema),
3357
3454
  props: JsonValueSchema.optional(),
3358
- fault: z.object({ code: z.enum(["no-matching-transition", "guard-rejected", "no-dispatchable-traits", "not-an-external-input", "inbound-only-event", "effect-failed", "locale-not-declared", "client-circuit-state-refused", "repaint-failed"]), error: z.string() }).optional()
3455
+ fault: z.object({ code: z.enum(["no-matching-transition", "guard-rejected", "no-dispatchable-traits", "not-an-external-input", "inbound-only-event", "effect-failed", "locale-not-declared", "client-circuit-state-refused", "repaint-failed", "cascade-capped"]), error: z.string() }).optional()
3359
3456
  });
3360
3457
  var PlayedStateSchema = z.object({ before: z.string().nullable(), after: z.string().nullable() });
3361
3458
  var PendingAskSchema = z.object({