@almadar/core 10.97.0 → 10.99.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 (101) hide show
  1. package/README.md +25 -0
  2. package/dist/builders.d.ts +5 -4
  3. package/dist/builders.js +60 -34
  4. package/dist/builders.js.map +1 -1
  5. package/dist/bus-BGDM3Xot.d.ts +565 -0
  6. package/dist/domain-Ds_7wZIL.d.ts +16213 -0
  7. package/dist/{effect-Bw8T4qh5.d.ts → effect-CW_IT0Jn.d.ts} +59 -4
  8. package/dist/{entityAccess-DfoXs9mc.d.ts → entityAccess-BLpOMojb.d.ts} +3 -3
  9. package/dist/{expression-WfTp2arD.d.ts → expression-DRwzVnMu.d.ts} +5 -1
  10. package/dist/factory/index.d.ts +5 -5
  11. package/dist/factory/index.js +22 -0
  12. package/dist/factory/index.js.map +1 -1
  13. package/dist/factory-runtime/index.d.ts +5 -4
  14. package/dist/factory-runtime/index.js +176 -34
  15. package/dist/factory-runtime/index.js.map +1 -1
  16. package/dist/fixtures.d.ts +45 -0
  17. package/dist/fixtures.js +693 -0
  18. package/dist/fixtures.js.map +1 -0
  19. package/dist/{index-H0bOi9oP.d.ts → index-CHHuux4I.d.ts} +8 -375
  20. package/dist/index.d.ts +19 -15
  21. package/dist/index.js +9069 -44
  22. package/dist/index.js.map +1 -1
  23. package/dist/mock/index.d.ts +6 -5
  24. package/dist/mock/index.js +14 -0
  25. package/dist/mock/index.js.map +1 -1
  26. package/dist/patterns/component-mapping.json +1 -1
  27. package/dist/patterns/event-contracts.json +1 -1
  28. package/dist/patterns/index.d.ts +12 -8
  29. package/dist/patterns/index.js +15 -4
  30. package/dist/patterns/index.js.map +1 -1
  31. package/dist/patterns/patterns-registry.json +1 -1
  32. package/dist/patterns/registry.json +1 -1
  33. package/dist/{schema-DPpES4qj.d.ts → schema-BVjtoRYf.d.ts} +2134 -23608
  34. package/dist/state-machine/index.d.ts +1 -1
  35. package/dist/themes/index.d.ts +19 -0
  36. package/dist/themes/index.js +9251 -0
  37. package/dist/themes/index.js.map +1 -0
  38. package/dist/{trait-DXXRrRMP.d.ts → trait-C9lr222u.d.ts} +26 -26
  39. package/dist/types/index.d.ts +8 -6
  40. package/dist/types/index.js +207 -41
  41. package/dist/types/index.js.map +1 -1
  42. package/dist/{types-BMaTUGyk.d.ts → types-BoyvM79n.d.ts} +2 -2
  43. package/fixtures/events-wire/cascade-emitted-events/request.json +9 -0
  44. package/fixtures/events-wire/cascade-emitted-events/response.json +30 -0
  45. package/fixtures/events-wire/client-effects-by-trait/request.json +4 -0
  46. package/fixtures/events-wire/client-effects-by-trait/response.json +52 -0
  47. package/fixtures/events-wire/effect-results/request.json +9 -0
  48. package/fixtures/events-wire/effect-results/response.json +42 -0
  49. package/fixtures/events-wire/effect-results-every-kind/request.json +9 -0
  50. package/fixtures/events-wire/effect-results-every-kind/response.json +70 -0
  51. package/fixtures/events-wire/guard-rejected/request.json +6 -0
  52. package/fixtures/events-wire/guard-rejected/response.json +11 -0
  53. package/fixtures/events-wire/live-push/live-push.json +12 -0
  54. package/fixtures/events-wire/live-push/request.json +9 -0
  55. package/fixtures/events-wire/live-push/response.json +33 -0
  56. package/fixtures/events-wire/navigate-1/request.json +5 -0
  57. package/fixtures/events-wire/navigate-1/response.json +16 -0
  58. package/fixtures/events-wire/navigate-2/request.json +8 -0
  59. package/fixtures/events-wire/navigate-2/response.json +19 -0
  60. package/fixtures/events-wire/navigate-3/request.json +8 -0
  61. package/fixtures/events-wire/navigate-3/response.json +22 -0
  62. package/fixtures/events-wire/navigate-back/request.json +5 -0
  63. package/fixtures/events-wire/navigate-back/response.json +15 -0
  64. package/fixtures/events-wire/render-ui-3/request.json +5 -0
  65. package/fixtures/events-wire/render-ui-3/response.json +20 -0
  66. package/fixtures/events-wire/render-ui-4/request.json +5 -0
  67. package/fixtures/events-wire/render-ui-4/response.json +41 -0
  68. package/fixtures/events-wire/render-ui-5/request.json +9 -0
  69. package/fixtures/events-wire/render-ui-5/response.json +52 -0
  70. package/fixtures/events-wire/render-ui-clear/request.json +5 -0
  71. package/fixtures/events-wire/render-ui-clear/response.json +27 -0
  72. package/fixtures/events-wire/sse-stream/request.json +9 -0
  73. package/fixtures/events-wire/sse-stream/response.json +79 -0
  74. package/fixtures/events-wire/sse-stream/stream.json +131 -0
  75. package/fixtures/events-wire/stateless-traits/request.json +27 -0
  76. package/fixtures/events-wire/stateless-traits/response.json +15 -0
  77. package/fixtures/theme-tokens/every-key.json +43 -0
  78. package/package.json +18 -3
  79. package/themes/almadar-website.json +207 -0
  80. package/themes/almadar.json +203 -0
  81. package/themes/atelier.json +459 -0
  82. package/themes/bloomberg-dense.json +459 -0
  83. package/themes/clay.json +445 -0
  84. package/themes/comic.json +457 -0
  85. package/themes/corporate.json +445 -0
  86. package/themes/game-adventure.json +229 -0
  87. package/themes/game-rpg.json +230 -0
  88. package/themes/game-sci-fi.json +229 -0
  89. package/themes/game-ui-pack.json +230 -0
  90. package/themes/gazette.json +445 -0
  91. package/themes/glass.json +445 -0
  92. package/themes/kiosk.json +441 -0
  93. package/themes/linear-clean.json +459 -0
  94. package/themes/minimalist.json +445 -0
  95. package/themes/neon.json +445 -0
  96. package/themes/notion-editorial.json +459 -0
  97. package/themes/prism.json +203 -0
  98. package/themes/retro.json +445 -0
  99. package/themes/terminal.json +457 -0
  100. package/themes/trait-wars.json +493 -0
  101. package/themes/wireframe.json +445 -0
package/README.md CHANGED
@@ -20,6 +20,31 @@ import { /* ... */ } from '@almadar/core';
20
20
 
21
21
  <!-- Document public exports here -->
22
22
 
23
+ ## Event-wire fixtures (`@almadar/core/fixtures`)
24
+
25
+ `fixtures/events-wire/<case>/{request,response}.json` (+ `stream.json` for
26
+ `sse-stream`, `live-push.json` for `live-push`) is the ONE recorded fixture
27
+ set for the event-dispatch wire (Program A, §156) — canonical =
28
+ `OrbitalEventRequest`/`OrbitalEventResponse`/`LiveBroadcastItem` from
29
+ `src/types/bus.ts`. Generated and zod-validated by
30
+ `scripts/generate-event-wire-fixtures.ts` (`pnpm run build:fixtures`, wired
31
+ into `build`); loaded at runtime via `loadEventWireFixture(caseName)` /
32
+ `EVENT_WIRE_FIXTURE_CASES` from the `@almadar/core/fixtures` subpath
33
+ (Node-only — reads from disk — never the main entry).
34
+
35
+ Consumers, all reading these SAME files instead of hand-rolled wire
36
+ examples:
37
+
38
+ - vitest in `@almadar/runtime`, `@almadar/ui`, `almadar-playground-runtime`
39
+ - `cargo test` in `orbital-core` (serde round trip), `orbital-server`
40
+ (posts fixture requests), `orbital-client`, and the Android/iOS native
41
+ shell decoders
42
+ - the Hono/Express codegen contract test (`orbital-shell-typescript`)
43
+ - `orb verify --server`
44
+
45
+ Separate from `packages/almadar-parity` (behaviour traces across execution
46
+ paths, not wire bytes).
47
+
23
48
  ## License
24
49
 
25
50
  BSL 1.1 (Business Source License). Converts to Apache 2.0 on 2030-02-01. Non-production use is free.
@@ -1,9 +1,10 @@
1
- import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect, i as RenderBinding, j as RenderUIEffect, e as EntityId, f as Entity, E as EntityField, a as EntityPersistence, g as EntityRow } from './effect-Bw8T4qh5.js';
2
- import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, b as ExpectDeclaration, P as PageRef, c as Page, d as PageRefObject } from './schema-DPpES4qj.js';
3
- import { b as TraitConfig, h as Trait, T as TraitEventListener, i as CallSiteConfig, k as TraitEventContract, d as TraitRef, a as TraitReference } from './trait-DXXRrRMP.js';
4
- import { S as SExpr } from './expression-WfTp2arD.js';
1
+ import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect, l as RenderBinding, m as RenderUIEffect, e as EntityId, f as Entity, E as EntityField, a as EntityPersistence, g as EntityRow } from './effect-CW_IT0Jn.js';
2
+ import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, b as ExpectDeclaration, P as PageRef, c as Page, d as PageRefObject } from './schema-BVjtoRYf.js';
3
+ import { b as TraitConfig, h as Trait, T as TraitEventListener, i as CallSiteConfig, k as TraitEventContract, d as TraitRef, a as TraitReference } from './trait-C9lr222u.js';
4
+ import { S as SExpr } from './expression-DRwzVnMu.js';
5
5
  import 'zod';
6
6
  import './json-D8gmyK3l.js';
7
+ import './domain-Ds_7wZIL.js';
7
8
 
8
9
  /**
9
10
  * Event Wiring
package/dist/builders.js CHANGED
@@ -415,6 +415,19 @@ var SExprSchema = z.lazy(
415
415
  ])
416
416
  );
417
417
  var ExpressionSchema = SExprSchema;
418
+ var EventPayloadValueSchema = z.lazy(
419
+ () => z.union([
420
+ z.string(),
421
+ z.number(),
422
+ z.boolean(),
423
+ z.date(),
424
+ z.null(),
425
+ z.undefined(),
426
+ EventPayloadSchema,
427
+ z.array(EventPayloadValueSchema)
428
+ ])
429
+ );
430
+ var EventPayloadSchema = z.lazy(() => z.record(EventPayloadValueSchema));
418
431
 
419
432
  // src/types/entity.ts
420
433
  var EntityPersistenceSchema = z.enum([
@@ -463,6 +476,7 @@ var EntitySchema = OrbitalEntitySchema;
463
476
  var FieldValueSchema = z.lazy(
464
477
  () => z.union([z.string(), z.number(), z.boolean(), z.date(), z.null(), z.array(FieldValueSchema), z.record(FieldValueSchema.optional())])
465
478
  );
479
+ z.object({ id: z.string().optional() }).catchall(FieldValueSchema.optional());
466
480
  var UI_SLOTS = [
467
481
  // App slots
468
482
  "main",
@@ -496,6 +510,14 @@ var EffectSchema = z.array(SExprDataSchema).min(1).refine(
496
510
  (arr) => typeof arr[0] === "string",
497
511
  { message: "Effect must be an S-expression with a string operator as first element" }
498
512
  );
513
+ z.custom(
514
+ (value) => value === null || typeof value === "object" && value !== null && !Array.isArray(value),
515
+ { message: "Expected a pattern config object or null" }
516
+ );
517
+ z.custom(
518
+ (value) => typeof value === "object" && value !== null && !Array.isArray(value),
519
+ { message: "Expected a resolved pattern props object" }
520
+ );
499
521
 
500
522
  // src/types/state-machine.ts
501
523
  var StateSchema = z.object({
@@ -1194,40 +1216,44 @@ var GeometryTokensSchema = z.object({
1194
1216
  borderStandard: z.string().optional(),
1195
1217
  borderHeavy: z.string().optional()
1196
1218
  });
1197
- var ColorTokensSchema = z.object({
1198
- primary: z.string().optional(),
1199
- primaryHover: z.string().optional(),
1200
- primaryForeground: z.string().optional(),
1201
- secondary: z.string().optional(),
1202
- secondaryHover: z.string().optional(),
1203
- secondaryForeground: z.string().optional(),
1204
- accent: z.string().optional(),
1205
- accentForeground: z.string().optional(),
1206
- muted: z.string().optional(),
1207
- mutedForeground: z.string().optional(),
1208
- background: z.string().optional(),
1209
- foreground: z.string().optional(),
1210
- card: z.string().optional(),
1211
- cardForeground: z.string().optional(),
1212
- surface: z.string().optional(),
1213
- border: z.string().optional(),
1214
- input: z.string().optional(),
1215
- ring: z.string().optional(),
1216
- error: z.string().optional(),
1217
- errorForeground: z.string().optional(),
1218
- success: z.string().optional(),
1219
- successForeground: z.string().optional(),
1220
- warning: z.string().optional(),
1221
- warningForeground: z.string().optional(),
1222
- info: z.string().optional(),
1223
- infoForeground: z.string().optional(),
1224
- tableHeader: z.string().optional(),
1225
- tableBorder: z.string().optional(),
1226
- tableRowHover: z.string().optional(),
1227
- surfaceHover: z.string().optional(),
1228
- borderHover: z.string().optional(),
1229
- placeholder: z.string().optional()
1230
- });
1219
+ var COLOR_TOKEN_KEY_LIST = [
1220
+ "primary",
1221
+ "primaryHover",
1222
+ "primaryForeground",
1223
+ "secondary",
1224
+ "secondaryHover",
1225
+ "secondaryForeground",
1226
+ "accent",
1227
+ "accentForeground",
1228
+ "muted",
1229
+ "mutedForeground",
1230
+ "background",
1231
+ "foreground",
1232
+ "card",
1233
+ "cardForeground",
1234
+ "surface",
1235
+ "border",
1236
+ "input",
1237
+ "ring",
1238
+ "error",
1239
+ "errorForeground",
1240
+ "success",
1241
+ "successForeground",
1242
+ "warning",
1243
+ "warningForeground",
1244
+ "info",
1245
+ "infoForeground",
1246
+ "tableHeader",
1247
+ "tableBorder",
1248
+ "tableRowHover",
1249
+ "surfaceHover",
1250
+ "borderHover",
1251
+ "placeholder"
1252
+ ];
1253
+ var COLOR_TOKEN_KEYS = COLOR_TOKEN_KEY_LIST;
1254
+ var ColorTokensSchema = z.object(
1255
+ Object.fromEntries(COLOR_TOKEN_KEYS.map((key) => [key, z.string().optional()]))
1256
+ );
1231
1257
  var IllustrationStyleSchema = z.enum([
1232
1258
  "minimal",
1233
1259
  "illustrated",