@almadar/core 10.102.0 → 10.103.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 (45) hide show
  1. package/dist/builders.d.ts +5 -5
  2. package/dist/builders.js +5 -2
  3. package/dist/builders.js.map +1 -1
  4. package/dist/{bus-BS4TMOJW.d.ts → bus-BGojNDOE.d.ts} +37 -7
  5. package/dist/{domain-Ds_7wZIL.d.ts → domain-OgMkN3WN.d.ts} +13 -1
  6. package/dist/{effect-Hm_QDaSI.d.ts → effect-Xn3LIyL7.d.ts} +1 -1
  7. package/dist/{entityAccess-D2OpLCyX.d.ts → entityAccess-z5HA0P7P.d.ts} +3 -3
  8. package/dist/{expression-DRwzVnMu.d.ts → expression-CfeHdS-f.d.ts} +10 -1
  9. package/dist/factory/index.d.ts +5 -5
  10. package/dist/factory/index.js.map +1 -1
  11. package/dist/factory-runtime/index.d.ts +5 -5
  12. package/dist/factory-runtime/index.js +33 -8
  13. package/dist/factory-runtime/index.js.map +1 -1
  14. package/dist/fixtures.d.ts +3 -3
  15. package/dist/fixtures.js +19 -2
  16. package/dist/fixtures.js.map +1 -1
  17. package/dist/i18n/index.js +27 -6
  18. package/dist/i18n/index.js.map +1 -1
  19. package/dist/{index-CyfcxG5N.d.ts → index-CVYZ3GcI.d.ts} +122 -23
  20. package/dist/index.d.ts +74 -17
  21. package/dist/index.js +400 -76
  22. package/dist/index.js.map +1 -1
  23. package/dist/lolo-document/index.d.ts +166 -0
  24. package/dist/lolo-document/index.js +615 -0
  25. package/dist/lolo-document/index.js.map +1 -0
  26. package/dist/mock/index.d.ts +6 -6
  27. package/dist/mock/index.js +12 -1
  28. package/dist/mock/index.js.map +1 -1
  29. package/dist/patterns/index.d.ts +22 -4
  30. package/dist/patterns/index.js +41 -1
  31. package/dist/patterns/index.js.map +1 -1
  32. package/dist/{schema-COf9yTjs.d.ts → schema-sHVqe8Kb.d.ts} +1307 -4
  33. package/dist/state-machine/index.d.ts +1 -1
  34. package/dist/themes/index.d.ts +1 -1
  35. package/dist/themes/index.js +2 -1
  36. package/dist/themes/index.js.map +1 -1
  37. package/dist/{trait-Be3xF0px.d.ts → trait-BSe6oDBd.d.ts} +59 -10
  38. package/dist/types/index.d.ts +8 -8
  39. package/dist/types/index.js +210 -16
  40. package/dist/types/index.js.map +1 -1
  41. package/dist/{types-CYOzs4As.d.ts → types-DK29MMOQ.d.ts} +2 -2
  42. package/fixtures/events-wire/client-effects-provenance/request.json +5 -0
  43. package/fixtures/events-wire/client-effects-provenance/response.json +57 -0
  44. package/package.json +6 -1
  45. package/src/types/bindings.ts +28 -3
@@ -1,11 +1,11 @@
1
- import { O as OrbitalSchema, a as OrbitalDefinition } from '../schema-COf9yTjs.js';
2
- import { g as TraitConfigValue, i as CallSiteConfig, j as CallSiteConfigEntry, h as Trait } from '../trait-Be3xF0px.js';
3
- import { E as EntityField, a as EntityPersistence } from '../effect-Hm_QDaSI.js';
1
+ import { O as OrbitalSchema, a as OrbitalDefinition } from '../schema-sHVqe8Kb.js';
2
+ import { g as TraitConfigValue, i as CallSiteConfig, j as CallSiteConfigEntry, h as Trait } from '../trait-BSe6oDBd.js';
3
+ import { E as EntityField, a as EntityPersistence } from '../effect-Xn3LIyL7.js';
4
4
  import { MakeTraitRefOpts } from '../builders.js';
5
5
  import '../json-D8gmyK3l.js';
6
- import '../expression-DRwzVnMu.js';
6
+ import '../expression-CfeHdS-f.js';
7
7
  import 'zod';
8
- import '../domain-Ds_7wZIL.js';
8
+ import '../domain-OgMkN3WN.js';
9
9
 
10
10
  /**
11
11
  * Orbital factory manifest types — shared across all packages.
@@ -731,6 +731,7 @@ var TraitTickSchema = z.object({
731
731
  priority: z.number().optional(),
732
732
  interval: TickIntervalSchema,
733
733
  appliesTo: z.array(z.string()).optional(),
734
+ runsInBackground: z.boolean().optional(),
734
735
  pages: z.array(z.string()).optional(),
735
736
  pageIds: z.array(PageIdSchema).optional(),
736
737
  guard: ExpressionSchema.optional(),
@@ -1345,8 +1346,9 @@ var ThemeDefinitionSchema = z.object({
1345
1346
  tokens: ThemeTokensSchema,
1346
1347
  variants: z.record(z.string(), ThemeVariantSchema).optional()
1347
1348
  });
1349
+ var THEME_REGISTRY_KEY_PATTERN = "[a-z][a-z0-9]*(-[a-z0-9]+)*";
1348
1350
  var ThemeRefStringSchema = z.string().regex(
1349
- /^([A-Z][a-zA-Z0-9]*\.theme|[a-z][a-z0-9]*(-[a-z0-9]+)*)$/,
1351
+ new RegExp(`^([A-Z][a-zA-Z0-9]*\\.theme|${THEME_REGISTRY_KEY_PATTERN})$`),
1350
1352
  'Theme reference must be "Alias.theme" or a registry theme key (e.g., "linear-clean-light")'
1351
1353
  );
1352
1354
  var ThemeRefSchema = z.union([
@@ -1554,7 +1556,8 @@ var OrbitalRefObjectSchema = z.object({
1554
1556
  roles: z.record(z.string(), z.array(z.string())).optional(),
1555
1557
  entities: z.record(z.string(), z.string()).optional(),
1556
1558
  mounts: z.record(z.string(), z.array(z.string())).optional(),
1557
- extend: z.array(EntityFieldSchema).optional()
1559
+ extend: z.array(EntityFieldSchema).optional(),
1560
+ listens: z.array(TraitEventListenerSchema.extend({ trait: z.string() })).optional()
1558
1561
  });
1559
1562
  z.string().regex(
1560
1563
  /^([A-Z][a-zA-Z0-9]*\.traits\.)?[A-Z][a-zA-Z0-9]*$/,
@@ -1671,12 +1674,18 @@ var BINDING_ROOTS = [
1671
1674
  "entity",
1672
1675
  "payload",
1673
1676
  "state",
1677
+ "now",
1674
1678
  "config",
1675
- "user",
1676
1679
  "trait",
1677
- "item",
1678
- "now",
1679
- "computed",
1680
+ "user",
1681
+ "callsitePayload",
1682
+ "pages",
1683
+ "currentTheme",
1684
+ "event",
1685
+ "prevEvents",
1686
+ "prevStates",
1687
+ "fromState",
1688
+ "toState",
1680
1689
  "other"
1681
1690
  ];
1682
1691
  new Set(BINDING_ROOTS.filter((r) => r !== "other"));
@@ -1731,6 +1740,15 @@ var BusEventSourceSchema = z.object({
1731
1740
  dispatched: z.boolean().optional(),
1732
1741
  originClientId: z.string().optional()
1733
1742
  });
1743
+ var DeliveryRecordSchema = z.object({
1744
+ event: z.string(),
1745
+ payload: EventPayloadSchema.optional(),
1746
+ source: BusEventSourceSchema
1747
+ });
1748
+ var DispatchLogSchema = z.object({
1749
+ prevEvents: z.array(DeliveryRecordSchema),
1750
+ prevStates: z.array(z.string())
1751
+ });
1734
1752
  var EmittedEventSchema = z.object({
1735
1753
  event: z.string(),
1736
1754
  payload: EventPayloadSchema.optional(),
@@ -1775,7 +1793,9 @@ z.object({
1775
1793
  sourceTrait: z.string().optional(),
1776
1794
  traits: z.array(z.object({ trait: z.string(), from: z.string() })).optional(),
1777
1795
  entityByTrait: z.record(EntityRowSchema).optional(),
1778
- behavior: z.string().optional()
1796
+ behavior: z.string().optional(),
1797
+ delivery: DeliveryRecordSchema.optional(),
1798
+ dispatchLog: DispatchLogSchema.optional()
1779
1799
  });
1780
1800
  z.object({
1781
1801
  success: z.boolean(),
@@ -1785,7 +1805,12 @@ z.object({
1785
1805
  data: z.record(z.array(EntityRowSchema)).optional(),
1786
1806
  entityByTrait: z.record(EntityRowSchema).optional(),
1787
1807
  clientEffects: z.array(ClientEffectTupleSchema).optional(),
1788
- clientEffectsByTrait: z.array(z.object({ traitName: z.string(), effect: ClientEffectTupleSchema })).optional(),
1808
+ clientEffectsByTrait: z.array(z.object({
1809
+ traitName: z.string(),
1810
+ effect: ClientEffectTupleSchema,
1811
+ event: z.string().optional(),
1812
+ fromState: z.string().optional()
1813
+ })).optional(),
1789
1814
  effectResults: z.array(ServerEffectResultSchema).optional(),
1790
1815
  guardFailed: z.string().optional(),
1791
1816
  rejections: z.array(