@almadar/core 10.101.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 +6 -2
  3. package/dist/builders.js.map +1 -1
  4. package/dist/{bus-B8evi8AZ.d.ts → bus-BGojNDOE.d.ts} +52 -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-DdcKps16.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 +42 -8
  13. package/dist/factory-runtime/index.js.map +1 -1
  14. package/dist/fixtures.d.ts +3 -3
  15. package/dist/fixtures.js +27 -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-1b2JJVYl.d.ts → index-CVYZ3GcI.d.ts} +122 -23
  20. package/dist/index.d.ts +74 -17
  21. package/dist/index.js +417 -72
  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-TqLV2wlK.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-YlNXc4H3.d.ts → trait-BSe6oDBd.d.ts} +79 -3
  38. package/dist/types/index.d.ts +8 -8
  39. package/dist/types/index.js +227 -12
  40. package/dist/types/index.js.map +1 -1
  41. package/dist/{types-Ug92oza4.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-TqLV2wlK.js';
2
- import { g as TraitConfigValue, i as CallSiteConfig, j as CallSiteConfigEntry, h as Trait } from '../trait-YlNXc4H3.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(),
@@ -900,6 +901,7 @@ var EffectUseSchema = z.object({
900
901
  site: EffectSiteSchema.optional()
901
902
  });
902
903
  var EffectRowSchema = z.array(EffectUseSchema);
904
+ z.enum(["persistedAwaited", "hybridClientOnly", "runtimeOptimistic"]);
903
905
  var SourceBehaviorMetadataSchema = z.object({
904
906
  behavior: z.string().min(1),
905
907
  alias: z.string().min(1),
@@ -1344,8 +1346,9 @@ var ThemeDefinitionSchema = z.object({
1344
1346
  tokens: ThemeTokensSchema,
1345
1347
  variants: z.record(z.string(), ThemeVariantSchema).optional()
1346
1348
  });
1349
+ var THEME_REGISTRY_KEY_PATTERN = "[a-z][a-z0-9]*(-[a-z0-9]+)*";
1347
1350
  var ThemeRefStringSchema = z.string().regex(
1348
- /^([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})$`),
1349
1352
  'Theme reference must be "Alias.theme" or a registry theme key (e.g., "linear-clean-light")'
1350
1353
  );
1351
1354
  var ThemeRefSchema = z.union([
@@ -1553,7 +1556,8 @@ var OrbitalRefObjectSchema = z.object({
1553
1556
  roles: z.record(z.string(), z.array(z.string())).optional(),
1554
1557
  entities: z.record(z.string(), z.string()).optional(),
1555
1558
  mounts: z.record(z.string(), z.array(z.string())).optional(),
1556
- extend: z.array(EntityFieldSchema).optional()
1559
+ extend: z.array(EntityFieldSchema).optional(),
1560
+ listens: z.array(TraitEventListenerSchema.extend({ trait: z.string() })).optional()
1557
1561
  });
1558
1562
  z.string().regex(
1559
1563
  /^([A-Z][a-zA-Z0-9]*\.traits\.)?[A-Z][a-zA-Z0-9]*$/,
@@ -1670,12 +1674,18 @@ var BINDING_ROOTS = [
1670
1674
  "entity",
1671
1675
  "payload",
1672
1676
  "state",
1677
+ "now",
1673
1678
  "config",
1674
- "user",
1675
1679
  "trait",
1676
- "item",
1677
- "now",
1678
- "computed",
1680
+ "user",
1681
+ "callsitePayload",
1682
+ "pages",
1683
+ "currentTheme",
1684
+ "event",
1685
+ "prevEvents",
1686
+ "prevStates",
1687
+ "fromState",
1688
+ "toState",
1679
1689
  "other"
1680
1690
  ];
1681
1691
  new Set(BINDING_ROOTS.filter((r) => r !== "other"));
@@ -1730,6 +1740,15 @@ var BusEventSourceSchema = z.object({
1730
1740
  dispatched: z.boolean().optional(),
1731
1741
  originClientId: z.string().optional()
1732
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
+ });
1733
1752
  var EmittedEventSchema = z.object({
1734
1753
  event: z.string(),
1735
1754
  payload: EventPayloadSchema.optional(),
@@ -1774,7 +1793,9 @@ z.object({
1774
1793
  sourceTrait: z.string().optional(),
1775
1794
  traits: z.array(z.object({ trait: z.string(), from: z.string() })).optional(),
1776
1795
  entityByTrait: z.record(EntityRowSchema).optional(),
1777
- behavior: z.string().optional()
1796
+ behavior: z.string().optional(),
1797
+ delivery: DeliveryRecordSchema.optional(),
1798
+ dispatchLog: DispatchLogSchema.optional()
1778
1799
  });
1779
1800
  z.object({
1780
1801
  success: z.boolean(),
@@ -1784,7 +1805,12 @@ z.object({
1784
1805
  data: z.record(z.array(EntityRowSchema)).optional(),
1785
1806
  entityByTrait: z.record(EntityRowSchema).optional(),
1786
1807
  clientEffects: z.array(ClientEffectTupleSchema).optional(),
1787
- 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(),
1788
1814
  effectResults: z.array(ServerEffectResultSchema).optional(),
1789
1815
  guardFailed: z.string().optional(),
1790
1816
  rejections: z.array(
@@ -1801,6 +1827,14 @@ z.object({
1801
1827
  cascadeTruncated: z.array(z.string()).optional(),
1802
1828
  error: z.string().optional()
1803
1829
  });
1830
+ var ServerTopologySchema = z.enum(["stateless", "stateful"]);
1831
+ z.object({
1832
+ success: z.boolean(),
1833
+ topology: ServerTopologySchema.optional(),
1834
+ message: z.string().optional(),
1835
+ orbitals: z.array(z.string()).optional(),
1836
+ error: z.string().optional()
1837
+ });
1804
1838
  z.object({
1805
1839
  event: z.string(),
1806
1840
  payload: EventPayloadSchema.optional(),