@almadar/core 10.129.0 → 11.0.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 (132) hide show
  1. package/dist/behavior-package.d.ts +49 -11
  2. package/dist/behavior-package.js +1 -1
  3. package/dist/{orbital-CkFdDS9f.d.ts → builders-BhnofAik.d.ts} +5966 -7116
  4. package/dist/builders.d.ts +6 -6
  5. package/dist/builders.js +7 -6
  6. package/dist/{bus-CcbB__oo.d.ts → bus-BrRFWDQK.d.ts} +270 -354
  7. package/dist/chunk-347APWFM.js +286 -0
  8. package/dist/chunk-347APWFM.js.map +1 -0
  9. package/dist/chunk-3URQAGD7.js +98 -0
  10. package/dist/chunk-3URQAGD7.js.map +1 -0
  11. package/dist/chunk-7GHJU5WI.js +39 -0
  12. package/dist/chunk-7GHJU5WI.js.map +1 -0
  13. package/dist/chunk-B4MNHGBP.js +8 -0
  14. package/dist/chunk-B4MNHGBP.js.map +1 -0
  15. package/dist/{chunk-KDMV222Q.js → chunk-F6KHUW7T.js} +304 -373
  16. package/dist/chunk-F6KHUW7T.js.map +1 -0
  17. package/dist/chunk-FGT5OS2Y.js +918 -0
  18. package/dist/chunk-FGT5OS2Y.js.map +1 -0
  19. package/dist/chunk-FQLEAMAB.js +24 -0
  20. package/dist/chunk-FQLEAMAB.js.map +1 -0
  21. package/dist/chunk-HEXOGHQ4.js +3264 -0
  22. package/dist/chunk-HEXOGHQ4.js.map +1 -0
  23. package/dist/chunk-JCD6GLBX.js +412 -0
  24. package/dist/chunk-JCD6GLBX.js.map +1 -0
  25. package/dist/{chunk-QUOTJULD.js → chunk-MGLG2XLD.js} +20 -219
  26. package/dist/chunk-MGLG2XLD.js.map +1 -0
  27. package/dist/chunk-MTBEBSNO.js +1293 -0
  28. package/dist/chunk-MTBEBSNO.js.map +1 -0
  29. package/dist/{chunk-X4SC7FGF.js → chunk-RGACZEYC.js} +99 -96
  30. package/dist/chunk-RGACZEYC.js.map +1 -0
  31. package/dist/{chunk-RYPVOI6H.js → chunk-UZPYYI37.js} +524 -26
  32. package/dist/{chunk-RYPVOI6H.js.map → chunk-UZPYYI37.js.map} +1 -1
  33. package/dist/chunk-VG7BRFUD.js +152 -0
  34. package/dist/chunk-VG7BRFUD.js.map +1 -0
  35. package/dist/chunk-Y2DYZPP5.js +2329 -0
  36. package/dist/chunk-Y2DYZPP5.js.map +1 -0
  37. package/dist/chunk-ZEI7C32D.js +1566 -0
  38. package/dist/chunk-ZEI7C32D.js.map +1 -0
  39. package/dist/{domain-Dz3jP-UM.d.ts → domain-CfKPpXCP.d.ts} +51 -51
  40. package/dist/{effect-result-Bebwu9yT.d.ts → effect-result-DPERsn_v.d.ts} +641 -851
  41. package/dist/{effect-CiEVLsZz.d.ts → effect-wP-IdRt2.d.ts} +236 -443
  42. package/dist/{expression-D0Fs0riG.d.ts → expression-DirYKz-f.d.ts} +5 -13
  43. package/dist/factory/index.d.ts +7 -144
  44. package/dist/factory/index.js +8 -8
  45. package/dist/factory-runtime/index.d.ts +7 -6
  46. package/dist/factory-runtime/index.js +527 -8
  47. package/dist/factory-runtime/index.js.map +1 -1
  48. package/dist/fixtures.d.ts +9 -11
  49. package/dist/fixtures.js +12 -8
  50. package/dist/fixtures.js.map +1 -1
  51. package/dist/i18n/index.d.ts +15 -19
  52. package/dist/i18n/index.js +2 -1
  53. package/dist/{index-BC-Jycqj.d.ts → index-DomgmRBG.d.ts} +29 -729
  54. package/dist/index.d.ts +69 -247
  55. package/dist/index.js +322 -986
  56. package/dist/index.js.map +1 -1
  57. package/dist/kernel-wire.d.ts +3 -3
  58. package/dist/kernel-wire.js +3 -79
  59. package/dist/kernel-wire.js.map +1 -1
  60. package/dist/language/constructs.json +22 -2
  61. package/dist/language/program-types.json +203 -22
  62. package/dist/language/protocols.json +46 -0
  63. package/dist/language/ui-vocabulary.json +1697 -0
  64. package/dist/language/validation-codes.json +1205 -1215
  65. package/dist/language/vocabulary.json +44 -8
  66. package/dist/language-data.d.ts +7 -4
  67. package/dist/language-data.js +20 -14
  68. package/dist/language-data.js.map +1 -1
  69. package/dist/patterns/component-mapping.json +11 -1
  70. package/dist/patterns/definitions.d.ts +2 -2
  71. package/dist/patterns/definitions.js +1 -1
  72. package/dist/patterns/event-contracts.json +1 -15
  73. package/dist/patterns/index.d.ts +24 -120
  74. package/dist/patterns/index.js +3 -3
  75. package/dist/patterns/patterns-registry.json +522 -24
  76. package/dist/patterns/registry.json +522 -24
  77. package/dist/trait-CzG9M89M.d.ts +3519 -0
  78. package/dist/types/index.d.ts +9 -10
  79. package/dist/types/index.js +11 -5
  80. package/dist/{types-DGwrltUF.d.ts → types-BHlTjwWd.d.ts} +3 -3
  81. package/fixtures/events-wire/client-effects-by-trait/response.json +0 -18
  82. package/fixtures/events-wire/client-effects-provenance/response.json +0 -18
  83. package/fixtures/events-wire/effect-results-every-kind/response.json +2 -27
  84. package/fixtures/events-wire/navigate-1/response.json +8 -5
  85. package/fixtures/events-wire/navigate-2/response.json +11 -8
  86. package/fixtures/events-wire/navigate-3/response.json +14 -11
  87. package/fixtures/events-wire/navigate-back/response.json +7 -4
  88. package/fixtures/events-wire/render-ui-3/response.json +12 -9
  89. package/fixtures/events-wire/render-ui-clear/response.json +0 -7
  90. package/fixtures/events-wire/sse-stream/response.json +0 -20
  91. package/fixtures/events-wire/sse-stream/stream.json +0 -20
  92. package/fixtures/events-wire/stateless-traits/response.json +14 -5
  93. package/fixtures/kernel-wire/golden/basic-entity.json +1687 -0
  94. package/fixtures/kernel-wire/golden/entity-rerender.json +743 -0
  95. package/fixtures/kernel-wire/golden/rollback.json +793 -0
  96. package/fixtures/kernel-wire/golden/tick-counter.json +1538 -0
  97. package/fixtures/kernel-wire/golden/two-orbital-chore.json +847 -0
  98. package/fixtures/kernel-wire/golden/two-orbital-task.json +457 -0
  99. package/fixtures/kernel-wire/played-step.json +136 -0
  100. package/fixtures/kernel-wire/scripts/basic-entity.json +28 -0
  101. package/fixtures/kernel-wire/scripts/entity-rerender.json +13 -0
  102. package/fixtures/kernel-wire/scripts/rollback.json +53 -0
  103. package/fixtures/kernel-wire/scripts/tick-counter.json +26 -0
  104. package/fixtures/kernel-wire/scripts/two-orbital-chore.json +9 -0
  105. package/fixtures/kernel-wire/scripts/two-orbital-task.json +9 -0
  106. package/package.json +28 -19
  107. package/dist/builders-DmZE5By0.d.ts +0 -2663
  108. package/dist/chunk-45I2O4SJ.js +0 -4646
  109. package/dist/chunk-45I2O4SJ.js.map +0 -1
  110. package/dist/chunk-6LR43Z5E.js +0 -3061
  111. package/dist/chunk-6LR43Z5E.js.map +0 -1
  112. package/dist/chunk-GIUA3NUJ.js +0 -809
  113. package/dist/chunk-GIUA3NUJ.js.map +0 -1
  114. package/dist/chunk-GTY53NS5.js +0 -1908
  115. package/dist/chunk-GTY53NS5.js.map +0 -1
  116. package/dist/chunk-JOHDVS6J.js +0 -1614
  117. package/dist/chunk-JOHDVS6J.js.map +0 -1
  118. package/dist/chunk-KDMV222Q.js.map +0 -1
  119. package/dist/chunk-QRHJUS3D.js +0 -23
  120. package/dist/chunk-QRHJUS3D.js.map +0 -1
  121. package/dist/chunk-QUOTJULD.js.map +0 -1
  122. package/dist/chunk-V5VNGRVU.js +0 -66
  123. package/dist/chunk-V5VNGRVU.js.map +0 -1
  124. package/dist/chunk-X4SC7FGF.js.map +0 -1
  125. package/dist/entityAccess-BPSz1i2n.d.ts +0 -80
  126. package/dist/mock/index.d.ts +0 -153
  127. package/dist/mock/index.js +0 -190
  128. package/dist/mock/index.js.map +0 -1
  129. package/dist/schema-T5RT5s6H.d.ts +0 -282
  130. package/dist/state-machine/index.d.ts +0 -359
  131. package/dist/state-machine/index.js +0 -3
  132. package/dist/state-machine/index.js.map +0 -1
@@ -5,7 +5,7 @@ declare const BehaviorPackageOrbBlockSchema: z.ZodObject<{
5
5
  registry: z.ZodOptional<z.ZodString>;
6
6
  source: z.ZodOptional<z.ZodString>;
7
7
  vectors: z.ZodOptional<z.ZodString>;
8
- compiler: z.ZodString;
8
+ language: z.ZodString;
9
9
  }, z.core.$strip>;
10
10
  type BehaviorPackageOrbBlock = z.infer<typeof BehaviorPackageOrbBlockSchema>;
11
11
  /** `sidecars.lock.json` — package-relative paths whose content lives in the sidecar store (§13). */
@@ -66,13 +66,18 @@ declare function userStoreDir(): string;
66
66
  * across rungs (callers keep the nearest).
67
67
  */
68
68
  declare function installedPackageDirs(startDir: string, userStore?: string): string[];
69
+ interface DiscoverOptions {
70
+ /** The `orb` binary; default {@link resolveOrbBinary} from `startDir`. */
71
+ orbBin?: string;
72
+ /** The home whose `.orb` is the user store (the last rung); default the process's. */
73
+ home?: string;
74
+ }
69
75
  /**
70
- * Every installed behavior package, the same rule as `orb`
71
- * (`orbital-core` `behavior_packages::discover`): every package
72
- * ({@link installedPackageDirs}) whose `package.json` carries a behavior `orb`
73
- * block; nearest wins per name; two packages claiming one prefix is an error.
76
+ * Every installed behavior package, as `orb` discovers them (`orbital-core` `behavior_packages::discover`, the std
77
+ * `orb list --json --ancestors` command): each ancestor `node_modules` of `startDir`, nearest first, then the user
78
+ * store's; nearest wins per name; two packages claiming one prefix is an error.
74
79
  */
75
- declare function discoverBehaviorPackages(startDir: string, userStore?: string): BehaviorPackage[];
80
+ declare function discoverBehaviorPackages(startDir: string, options?: DiscoverOptions): BehaviorPackage[];
76
81
  /** Resolve an installed behavior package by name, node-style, from `fromDir`. */
77
82
  declare function findInstalledBehaviorPackage(name: string, fromDir: string): BehaviorPackage;
78
83
  /** The absolute path of a file (or the registry directory) the package declares. Fails when it is missing. */
@@ -88,14 +93,14 @@ declare function derivedCacheDir(): string;
88
93
  interface RegistryDirOptions {
89
94
  orbBin?: string;
90
95
  cacheDir?: string;
91
- /** How many files one `orb lower` run takes. */
92
- batch?: number;
93
96
  }
94
97
  /**
95
98
  * Delete every live-package mirror under the derived cache except those of
96
99
  * `keep` (as the current `orb` keys them) — a new `orb` binary, new language data or a moved
97
100
  * checkout leaves the old ones behind. Returns the removed directories.
98
- * Explicit only: other checkouts share the cache, so nothing prunes on its own.
101
+ * Explicit and total: it removes every mirror not in `keep`. Reading a mirror
102
+ * ({@link behaviorRegistryDir}) separately keeps only the newest
103
+ * {@link REGISTRY_MIRROR_LIMIT}.
99
104
  */
100
105
  declare function pruneRegistryMirrors(keep: readonly BehaviorPackage[], options?: RegistryDirOptions): string[];
101
106
  /**
@@ -109,6 +114,19 @@ declare function pruneRegistryMirrors(keep: readonly BehaviorPackage[], options?
109
114
  * so every reader of `.orb` files works unchanged. A lowering error fails the call,
110
115
  * naming the file.
111
116
  */
117
+ /**
118
+ * How many live-package mirrors the derived cache keeps. One mirror is a package's full lowered registry
119
+ * (170-360 MB for std), keyed by package root, `orb` binary and language data, so every rebuilt `orb` and every
120
+ * checkout adds one per package. Six holds the current and the previous binary of the two packages a checkout
121
+ * mounts (std, behaviors) plus a second checkout's current pair, and bounds the cache near 2 GB.
122
+ */
123
+ declare const REGISTRY_MIRROR_LIMIT = 6;
124
+ /**
125
+ * Evict the mirrors under `registryRoot` beyond the `limit` most recently used (directory modification time,
126
+ * newest first, ties broken by name), always keeping every directory in `protectedDirs`. Returns the removed
127
+ * directories, sorted.
128
+ */
129
+ declare function evictOldMirrors(registryRoot: string, protectedDirs: ReadonlySet<string>, limit?: number): string[];
112
130
  /**
113
131
  * The files a package authors its behaviors in, without lowering anything: a
114
132
  * live package's `.lolo` source tree, or a published package's declared registry
@@ -119,7 +137,27 @@ declare function behaviorSourceTree(pkg: BehaviorPackage): {
119
137
  dir: string;
120
138
  extension: '.lolo' | '.orb';
121
139
  };
140
+ declare const MaterializeAnswerSchema: z.ZodObject<{
141
+ dir: z.ZodString;
142
+ failures: z.ZodArray<z.ZodObject<{
143
+ rel: z.ZodString;
144
+ error: z.ZodString;
145
+ }, z.core.$strip>>;
146
+ }, z.core.$strip>;
147
+ type MaterializeFailure = z.infer<typeof MaterializeAnswerSchema>['failures'][number];
148
+ interface BehaviorRegistry {
149
+ dir: string;
150
+ /** Sources that did not lower; the rest of the mirror is current. Empty for a materialized registry. */
151
+ failures: MaterializeFailure[];
152
+ }
153
+ /** The registry mirror's directory; use {@link behaviorRegistry} to see which sources failed to lower. */
122
154
  declare function behaviorRegistryDir(pkg: BehaviorPackage, options?: RegistryDirOptions): string;
155
+ /**
156
+ * Throws naming the file and its lower error when `rel` (a `.lolo` path relative to the source tree, or its `.orb`
157
+ * twin) is one of the registry's failures.
158
+ */
159
+ declare function assertImportable(pkg: BehaviorPackage, registry: BehaviorRegistry, rel: string): void;
160
+ declare function behaviorRegistry(pkg: BehaviorPackage, options?: RegistryDirOptions): BehaviorRegistry;
123
161
  /**
124
162
  * Every behavior program in the package's registry, by behavior name: each `.orb` under the
125
163
  * registry tree, named by its basename (the rule `orb` indexes by). Two programs with one name
@@ -142,5 +180,5 @@ interface MaterializeOptions extends RegistryDirOptions {
142
180
  */
143
181
  declare function materializeRegistry(pkg: BehaviorPackage, options?: MaterializeOptions): BehaviorPackageOrbBlock;
144
182
 
145
- export { BUILD_INPUTS_LOCK_FILE, BehaviorPackageError, BehaviorPackageOrbBlockSchema, SIDECAR_LOCK_FILE, SidecarLockSchema, behaviorProgramFiles, behaviorRegistryDir, behaviorSourceTree, derivedCacheDir, discoverBehaviorPackages, ensureDeclaredPath, ensureLockEntry, findInstalledBehaviorPackage, installedPackageDirs, materializeRegistry, pruneRegistryMirrors, readBehaviorPackage, readLockFile, resolveDeclaredFile, resolveDeclaredPath, resolveOrbBinary, sidecarCacheDir, userStoreDir };
146
- export type { BehaviorPackage, BehaviorPackageOrbBlock, DeclaredFileKey, MaterializeOptions, RegistryDirOptions, SidecarFetch, SidecarLock, SidecarLockEntry, SidecarOptions };
183
+ export { BUILD_INPUTS_LOCK_FILE, BehaviorPackageError, BehaviorPackageOrbBlockSchema, MaterializeAnswerSchema, REGISTRY_MIRROR_LIMIT, SIDECAR_LOCK_FILE, SidecarLockSchema, assertImportable, behaviorProgramFiles, behaviorRegistry, behaviorRegistryDir, behaviorSourceTree, derivedCacheDir, discoverBehaviorPackages, ensureDeclaredPath, ensureLockEntry, evictOldMirrors, findInstalledBehaviorPackage, installedPackageDirs, materializeRegistry, pruneRegistryMirrors, readBehaviorPackage, readLockFile, resolveDeclaredFile, resolveDeclaredPath, resolveOrbBinary, sidecarCacheDir, userStoreDir };
184
+ export type { BehaviorPackage, BehaviorPackageOrbBlock, BehaviorRegistry, DeclaredFileKey, DiscoverOptions, MaterializeFailure, MaterializeOptions, RegistryDirOptions, SidecarFetch, SidecarLock, SidecarLockEntry, SidecarOptions };
@@ -1,3 +1,3 @@
1
- export { BUILD_INPUTS_LOCK_FILE, BehaviorPackageError, BehaviorPackageOrbBlockSchema, SIDECAR_LOCK_FILE, SidecarLockSchema, behaviorProgramFiles, behaviorRegistryDir, behaviorSourceTree, derivedCacheDir, discoverBehaviorPackages, ensureDeclaredPath, ensureLockEntry, findInstalledBehaviorPackage, installedPackageDirs, materializeRegistry, pruneRegistryMirrors, readBehaviorPackage, readLockFile, resolveDeclaredFile, resolveDeclaredPath, resolveOrbBinary, sidecarCacheDir, userStoreDir } from './chunk-X4SC7FGF.js';
1
+ export { BUILD_INPUTS_LOCK_FILE, BehaviorPackageError, BehaviorPackageOrbBlockSchema, MaterializeAnswerSchema, REGISTRY_MIRROR_LIMIT, SIDECAR_LOCK_FILE, SidecarLockSchema, assertImportable, behaviorProgramFiles, behaviorRegistry, behaviorRegistryDir, behaviorSourceTree, derivedCacheDir, discoverBehaviorPackages, ensureDeclaredPath, ensureLockEntry, evictOldMirrors, findInstalledBehaviorPackage, installedPackageDirs, materializeRegistry, pruneRegistryMirrors, readBehaviorPackage, readLockFile, resolveDeclaredFile, resolveDeclaredPath, resolveOrbBinary, sidecarCacheDir, userStoreDir } from './chunk-RGACZEYC.js';
2
2
  //# sourceMappingURL=behavior-package.js.map
3
3
  //# sourceMappingURL=behavior-package.js.map