@exellix/exellix-runtime 3.5.1

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 (318) hide show
  1. package/README.md +422 -0
  2. package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.d.ts +4 -0
  3. package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.d.ts.map +1 -0
  4. package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.js +311 -0
  5. package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.js.map +1 -0
  6. package/dist/catalox-inventory/catalox-execution-matrix-inventory.d.ts +64 -0
  7. package/dist/catalox-inventory/catalox-execution-matrix-inventory.d.ts.map +1 -0
  8. package/dist/catalox-inventory/catalox-execution-matrix-inventory.js +226 -0
  9. package/dist/catalox-inventory/catalox-execution-matrix-inventory.js.map +1 -0
  10. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.d.ts +145 -0
  11. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.d.ts.map +1 -0
  12. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.js +477 -0
  13. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.js.map +1 -0
  14. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.d.ts +2 -0
  15. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.d.ts.map +1 -0
  16. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.js +34 -0
  17. package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.js.map +1 -0
  18. package/dist/cli/argv.d.ts +5 -0
  19. package/dist/cli/argv.d.ts.map +1 -0
  20. package/dist/cli/argv.js +32 -0
  21. package/dist/cli/argv.js.map +1 -0
  22. package/dist/cli/commands/health.d.ts +2 -0
  23. package/dist/cli/commands/health.d.ts.map +1 -0
  24. package/dist/cli/commands/health.js +23 -0
  25. package/dist/cli/commands/health.js.map +1 -0
  26. package/dist/cli/commands/matrix-link.d.ts +2 -0
  27. package/dist/cli/commands/matrix-link.d.ts.map +1 -0
  28. package/dist/cli/commands/matrix-link.js +56 -0
  29. package/dist/cli/commands/matrix-link.js.map +1 -0
  30. package/dist/cli/commands/matrix-read.d.ts +2 -0
  31. package/dist/cli/commands/matrix-read.d.ts.map +1 -0
  32. package/dist/cli/commands/matrix-read.js +73 -0
  33. package/dist/cli/commands/matrix-read.js.map +1 -0
  34. package/dist/cli/env.d.ts +6 -0
  35. package/dist/cli/env.d.ts.map +1 -0
  36. package/dist/cli/env.js +39 -0
  37. package/dist/cli/env.js.map +1 -0
  38. package/dist/cli/exellix-runtime-cli.d.ts +3 -0
  39. package/dist/cli/exellix-runtime-cli.d.ts.map +1 -0
  40. package/dist/cli/exellix-runtime-cli.js +55 -0
  41. package/dist/cli/exellix-runtime-cli.js.map +1 -0
  42. package/dist/cli/help.d.ts +19 -0
  43. package/dist/cli/help.d.ts.map +1 -0
  44. package/dist/cli/help.js +94 -0
  45. package/dist/cli/help.js.map +1 -0
  46. package/dist/client-toolbox/bundle.d.ts +17 -0
  47. package/dist/client-toolbox/bundle.d.ts.map +1 -0
  48. package/dist/client-toolbox/bundle.js +17 -0
  49. package/dist/client-toolbox/bundle.js.map +1 -0
  50. package/dist/client-toolbox/client-toolbox.spec.d.ts +2 -0
  51. package/dist/client-toolbox/client-toolbox.spec.d.ts.map +1 -0
  52. package/dist/client-toolbox/client-toolbox.spec.js +145 -0
  53. package/dist/client-toolbox/client-toolbox.spec.js.map +1 -0
  54. package/dist/client-toolbox/index.d.ts +4 -0
  55. package/dist/client-toolbox/index.d.ts.map +1 -0
  56. package/dist/client-toolbox/index.js +4 -0
  57. package/dist/client-toolbox/index.js.map +1 -0
  58. package/dist/client-toolbox/matrix-config.d.ts +67 -0
  59. package/dist/client-toolbox/matrix-config.d.ts.map +1 -0
  60. package/dist/client-toolbox/matrix-config.js +140 -0
  61. package/dist/client-toolbox/matrix-config.js.map +1 -0
  62. package/dist/client-toolbox/matrix-materialize.d.ts +56 -0
  63. package/dist/client-toolbox/matrix-materialize.d.ts.map +1 -0
  64. package/dist/client-toolbox/matrix-materialize.js +130 -0
  65. package/dist/client-toolbox/matrix-materialize.js.map +1 -0
  66. package/dist/dev/matrix-read-dashboard-smoke.d.ts +2 -0
  67. package/dist/dev/matrix-read-dashboard-smoke.d.ts.map +1 -0
  68. package/dist/dev/matrix-read-dashboard-smoke.js +12 -0
  69. package/dist/dev/matrix-read-dashboard-smoke.js.map +1 -0
  70. package/dist/dev/runtime-real-dev-server.d.ts +2 -0
  71. package/dist/dev/runtime-real-dev-server.d.ts.map +1 -0
  72. package/dist/dev/runtime-real-dev-server.js +90 -0
  73. package/dist/dev/runtime-real-dev-server.js.map +1 -0
  74. package/dist/execution-matrix/catalox-loader.d.ts +55 -0
  75. package/dist/execution-matrix/catalox-loader.d.ts.map +1 -0
  76. package/dist/execution-matrix/catalox-loader.js +199 -0
  77. package/dist/execution-matrix/catalox-loader.js.map +1 -0
  78. package/dist/execution-matrix/catalox-matrix-host.d.ts +20 -0
  79. package/dist/execution-matrix/catalox-matrix-host.d.ts.map +1 -0
  80. package/dist/execution-matrix/catalox-matrix-host.js +19 -0
  81. package/dist/execution-matrix/catalox-matrix-host.js.map +1 -0
  82. package/dist/execution-matrix/collections.d.ts +16 -0
  83. package/dist/execution-matrix/collections.d.ts.map +1 -0
  84. package/dist/execution-matrix/collections.js +75 -0
  85. package/dist/execution-matrix/collections.js.map +1 -0
  86. package/dist/execution-matrix/config-store.d.ts +104 -0
  87. package/dist/execution-matrix/config-store.d.ts.map +1 -0
  88. package/dist/execution-matrix/config-store.js +273 -0
  89. package/dist/execution-matrix/config-store.js.map +1 -0
  90. package/dist/execution-matrix/constants.d.ts +19 -0
  91. package/dist/execution-matrix/constants.d.ts.map +1 -0
  92. package/dist/execution-matrix/constants.js +19 -0
  93. package/dist/execution-matrix/constants.js.map +1 -0
  94. package/dist/execution-matrix/contracts.d.ts +568 -0
  95. package/dist/execution-matrix/contracts.d.ts.map +1 -0
  96. package/dist/execution-matrix/contracts.js +44 -0
  97. package/dist/execution-matrix/contracts.js.map +1 -0
  98. package/dist/execution-matrix/data-source.d.ts +43 -0
  99. package/dist/execution-matrix/data-source.d.ts.map +1 -0
  100. package/dist/execution-matrix/data-source.js +307 -0
  101. package/dist/execution-matrix/data-source.js.map +1 -0
  102. package/dist/execution-matrix/eligibility.d.ts +48 -0
  103. package/dist/execution-matrix/eligibility.d.ts.map +1 -0
  104. package/dist/execution-matrix/eligibility.js +89 -0
  105. package/dist/execution-matrix/eligibility.js.map +1 -0
  106. package/dist/execution-matrix/execution-matrix-claim-pause.d.ts +20 -0
  107. package/dist/execution-matrix/execution-matrix-claim-pause.d.ts.map +1 -0
  108. package/dist/execution-matrix/execution-matrix-claim-pause.js +18 -0
  109. package/dist/execution-matrix/execution-matrix-claim-pause.js.map +1 -0
  110. package/dist/execution-matrix/execution-matrix-claim-pause.spec.d.ts +2 -0
  111. package/dist/execution-matrix/execution-matrix-claim-pause.spec.d.ts.map +1 -0
  112. package/dist/execution-matrix/execution-matrix-claim-pause.spec.js +23 -0
  113. package/dist/execution-matrix/execution-matrix-claim-pause.spec.js.map +1 -0
  114. package/dist/execution-matrix/execution-matrix.live.spec.d.ts +2 -0
  115. package/dist/execution-matrix/execution-matrix.live.spec.d.ts.map +1 -0
  116. package/dist/execution-matrix/execution-matrix.live.spec.js +152 -0
  117. package/dist/execution-matrix/execution-matrix.live.spec.js.map +1 -0
  118. package/dist/execution-matrix/execution-matrix.live.xmemory.spec.d.ts +2 -0
  119. package/dist/execution-matrix/execution-matrix.live.xmemory.spec.d.ts.map +1 -0
  120. package/dist/execution-matrix/execution-matrix.live.xmemory.spec.js +346 -0
  121. package/dist/execution-matrix/execution-matrix.live.xmemory.spec.js.map +1 -0
  122. package/dist/execution-matrix/execution-matrix.spec.d.ts +2 -0
  123. package/dist/execution-matrix/execution-matrix.spec.d.ts.map +1 -0
  124. package/dist/execution-matrix/execution-matrix.spec.js +1786 -0
  125. package/dist/execution-matrix/execution-matrix.spec.js.map +1 -0
  126. package/dist/execution-matrix/execution-mode.d.ts +34 -0
  127. package/dist/execution-matrix/execution-mode.d.ts.map +1 -0
  128. package/dist/execution-matrix/execution-mode.js +72 -0
  129. package/dist/execution-matrix/execution-mode.js.map +1 -0
  130. package/dist/execution-matrix/factory.d.ts +72 -0
  131. package/dist/execution-matrix/factory.d.ts.map +1 -0
  132. package/dist/execution-matrix/factory.js +77 -0
  133. package/dist/execution-matrix/factory.js.map +1 -0
  134. package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.d.ts +2 -0
  135. package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.d.ts.map +1 -0
  136. package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.js +48 -0
  137. package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.js.map +1 -0
  138. package/dist/execution-matrix/graph-entry-xmemory-load.d.ts +130 -0
  139. package/dist/execution-matrix/graph-entry-xmemory-load.d.ts.map +1 -0
  140. package/dist/execution-matrix/graph-entry-xmemory-load.js +146 -0
  141. package/dist/execution-matrix/graph-entry-xmemory-load.js.map +1 -0
  142. package/dist/execution-matrix/graph-entry-xmemory-load.spec.d.ts +2 -0
  143. package/dist/execution-matrix/graph-entry-xmemory-load.spec.d.ts.map +1 -0
  144. package/dist/execution-matrix/graph-entry-xmemory-load.spec.js +66 -0
  145. package/dist/execution-matrix/graph-entry-xmemory-load.spec.js.map +1 -0
  146. package/dist/execution-matrix/graph-operational-aggregates.d.ts +47 -0
  147. package/dist/execution-matrix/graph-operational-aggregates.d.ts.map +1 -0
  148. package/dist/execution-matrix/graph-operational-aggregates.js +137 -0
  149. package/dist/execution-matrix/graph-operational-aggregates.js.map +1 -0
  150. package/dist/execution-matrix/graph-operational-lifecycle.d.ts +43 -0
  151. package/dist/execution-matrix/graph-operational-lifecycle.d.ts.map +1 -0
  152. package/dist/execution-matrix/graph-operational-lifecycle.js +88 -0
  153. package/dist/execution-matrix/graph-operational-lifecycle.js.map +1 -0
  154. package/dist/execution-matrix/graph-operational.spec.d.ts +2 -0
  155. package/dist/execution-matrix/graph-operational.spec.d.ts.map +1 -0
  156. package/dist/execution-matrix/graph-operational.spec.js +203 -0
  157. package/dist/execution-matrix/graph-operational.spec.js.map +1 -0
  158. package/dist/execution-matrix/index.d.ts +73 -0
  159. package/dist/execution-matrix/index.d.ts.map +1 -0
  160. package/dist/execution-matrix/index.js +57 -0
  161. package/dist/execution-matrix/index.js.map +1 -0
  162. package/dist/execution-matrix/live-tier-open.d.ts +6 -0
  163. package/dist/execution-matrix/live-tier-open.d.ts.map +1 -0
  164. package/dist/execution-matrix/live-tier-open.js +6 -0
  165. package/dist/execution-matrix/live-tier-open.js.map +1 -0
  166. package/dist/execution-matrix/materializer.d.ts +99 -0
  167. package/dist/execution-matrix/materializer.d.ts.map +1 -0
  168. package/dist/execution-matrix/materializer.js +210 -0
  169. package/dist/execution-matrix/materializer.js.map +1 -0
  170. package/dist/execution-matrix/matrix-activix.d.ts +24 -0
  171. package/dist/execution-matrix/matrix-activix.d.ts.map +1 -0
  172. package/dist/execution-matrix/matrix-activix.js +34 -0
  173. package/dist/execution-matrix/matrix-activix.js.map +1 -0
  174. package/dist/execution-matrix/matrix-data-tier.d.ts +55 -0
  175. package/dist/execution-matrix/matrix-data-tier.d.ts.map +1 -0
  176. package/dist/execution-matrix/matrix-data-tier.js +74 -0
  177. package/dist/execution-matrix/matrix-data-tier.js.map +1 -0
  178. package/dist/execution-matrix/matrix-execute-graph-adapter.d.ts +43 -0
  179. package/dist/execution-matrix/matrix-execute-graph-adapter.d.ts.map +1 -0
  180. package/dist/execution-matrix/matrix-execute-graph-adapter.js +62 -0
  181. package/dist/execution-matrix/matrix-execute-graph-adapter.js.map +1 -0
  182. package/dist/execution-matrix/matrix-execute-graph-adapter.spec.d.ts +2 -0
  183. package/dist/execution-matrix/matrix-execute-graph-adapter.spec.d.ts.map +1 -0
  184. package/dist/execution-matrix/matrix-execute-graph-adapter.spec.js +60 -0
  185. package/dist/execution-matrix/matrix-execute-graph-adapter.spec.js.map +1 -0
  186. package/dist/execution-matrix/matrix-logxer.d.ts +15 -0
  187. package/dist/execution-matrix/matrix-logxer.d.ts.map +1 -0
  188. package/dist/execution-matrix/matrix-logxer.js +65 -0
  189. package/dist/execution-matrix/matrix-logxer.js.map +1 -0
  190. package/dist/execution-matrix/matrix-read-tier.d.ts +41 -0
  191. package/dist/execution-matrix/matrix-read-tier.d.ts.map +1 -0
  192. package/dist/execution-matrix/matrix-read-tier.js +41 -0
  193. package/dist/execution-matrix/matrix-read-tier.js.map +1 -0
  194. package/dist/execution-matrix/memorix-entity-type-helpers.d.ts +25 -0
  195. package/dist/execution-matrix/memorix-entity-type-helpers.d.ts.map +1 -0
  196. package/dist/execution-matrix/memorix-entity-type-helpers.js +32 -0
  197. package/dist/execution-matrix/memorix-entity-type-helpers.js.map +1 -0
  198. package/dist/execution-matrix/memorix-entity-type-helpers.spec.d.ts +2 -0
  199. package/dist/execution-matrix/memorix-entity-type-helpers.spec.d.ts.map +1 -0
  200. package/dist/execution-matrix/memorix-entity-type-helpers.spec.js +83 -0
  201. package/dist/execution-matrix/memorix-entity-type-helpers.spec.js.map +1 -0
  202. package/dist/execution-matrix/memorix-inference-persister.d.ts +73 -0
  203. package/dist/execution-matrix/memorix-inference-persister.d.ts.map +1 -0
  204. package/dist/execution-matrix/memorix-inference-persister.js +126 -0
  205. package/dist/execution-matrix/memorix-inference-persister.js.map +1 -0
  206. package/dist/execution-matrix/memorix-inference-persister.spec.d.ts +2 -0
  207. package/dist/execution-matrix/memorix-inference-persister.spec.d.ts.map +1 -0
  208. package/dist/execution-matrix/memorix-inference-persister.spec.js +117 -0
  209. package/dist/execution-matrix/memorix-inference-persister.spec.js.map +1 -0
  210. package/dist/execution-matrix/memorix-matrix-entity-facet.d.ts +71 -0
  211. package/dist/execution-matrix/memorix-matrix-entity-facet.d.ts.map +1 -0
  212. package/dist/execution-matrix/memorix-matrix-entity-facet.js +91 -0
  213. package/dist/execution-matrix/memorix-matrix-entity-facet.js.map +1 -0
  214. package/dist/execution-matrix/memorix-matrix-entity-facet.spec.d.ts +2 -0
  215. package/dist/execution-matrix/memorix-matrix-entity-facet.spec.d.ts.map +1 -0
  216. package/dist/execution-matrix/memorix-matrix-entity-facet.spec.js +151 -0
  217. package/dist/execution-matrix/memorix-matrix-entity-facet.spec.js.map +1 -0
  218. package/dist/execution-matrix/memorix-runtime-tier.d.ts +153 -0
  219. package/dist/execution-matrix/memorix-runtime-tier.d.ts.map +1 -0
  220. package/dist/execution-matrix/memorix-runtime-tier.js +185 -0
  221. package/dist/execution-matrix/memorix-runtime-tier.js.map +1 -0
  222. package/dist/execution-matrix/memorix-tier-statistics.d.ts +103 -0
  223. package/dist/execution-matrix/memorix-tier-statistics.d.ts.map +1 -0
  224. package/dist/execution-matrix/memorix-tier-statistics.js +164 -0
  225. package/dist/execution-matrix/memorix-tier-statistics.js.map +1 -0
  226. package/dist/execution-matrix/memory-store.d.ts +20 -0
  227. package/dist/execution-matrix/memory-store.d.ts.map +1 -0
  228. package/dist/execution-matrix/memory-store.js +185 -0
  229. package/dist/execution-matrix/memory-store.js.map +1 -0
  230. package/dist/execution-matrix/navigator.d.ts +97 -0
  231. package/dist/execution-matrix/navigator.d.ts.map +1 -0
  232. package/dist/execution-matrix/navigator.js +119 -0
  233. package/dist/execution-matrix/navigator.js.map +1 -0
  234. package/dist/execution-matrix/orchestrator.d.ts +204 -0
  235. package/dist/execution-matrix/orchestrator.d.ts.map +1 -0
  236. package/dist/execution-matrix/orchestrator.js +656 -0
  237. package/dist/execution-matrix/orchestrator.js.map +1 -0
  238. package/dist/execution-matrix/records-eligibility.d.ts +34 -0
  239. package/dist/execution-matrix/records-eligibility.d.ts.map +1 -0
  240. package/dist/execution-matrix/records-eligibility.js +110 -0
  241. package/dist/execution-matrix/records-eligibility.js.map +1 -0
  242. package/dist/execution-matrix/records-eligibility.spec.d.ts +2 -0
  243. package/dist/execution-matrix/records-eligibility.spec.d.ts.map +1 -0
  244. package/dist/execution-matrix/records-eligibility.spec.js +154 -0
  245. package/dist/execution-matrix/records-eligibility.spec.js.map +1 -0
  246. package/dist/execution-matrix/run-loop.d.ts +140 -0
  247. package/dist/execution-matrix/run-loop.d.ts.map +1 -0
  248. package/dist/execution-matrix/run-loop.js +350 -0
  249. package/dist/execution-matrix/run-loop.js.map +1 -0
  250. package/dist/execution-matrix/runtime-connectivity-health.d.ts +128 -0
  251. package/dist/execution-matrix/runtime-connectivity-health.d.ts.map +1 -0
  252. package/dist/execution-matrix/runtime-connectivity-health.js +253 -0
  253. package/dist/execution-matrix/runtime-connectivity-health.js.map +1 -0
  254. package/dist/execution-matrix/runtime-connectivity-health.spec.d.ts +2 -0
  255. package/dist/execution-matrix/runtime-connectivity-health.spec.d.ts.map +1 -0
  256. package/dist/execution-matrix/runtime-connectivity-health.spec.js +23 -0
  257. package/dist/execution-matrix/runtime-connectivity-health.spec.js.map +1 -0
  258. package/dist/execution-matrix/runtime-objects.d.ts +16 -0
  259. package/dist/execution-matrix/runtime-objects.d.ts.map +1 -0
  260. package/dist/execution-matrix/runtime-objects.js +20 -0
  261. package/dist/execution-matrix/runtime-objects.js.map +1 -0
  262. package/dist/execution-matrix/runtime-store.d.ts +114 -0
  263. package/dist/execution-matrix/runtime-store.d.ts.map +1 -0
  264. package/dist/execution-matrix/runtime-store.js +506 -0
  265. package/dist/execution-matrix/runtime-store.js.map +1 -0
  266. package/dist/execution-matrix/snapshot-runner.d.ts +50 -0
  267. package/dist/execution-matrix/snapshot-runner.d.ts.map +1 -0
  268. package/dist/execution-matrix/snapshot-runner.js +111 -0
  269. package/dist/execution-matrix/snapshot-runner.js.map +1 -0
  270. package/dist/execution-matrix/source-resolver-factories.d.ts +31 -0
  271. package/dist/execution-matrix/source-resolver-factories.d.ts.map +1 -0
  272. package/dist/execution-matrix/source-resolver-factories.js +71 -0
  273. package/dist/execution-matrix/source-resolver-factories.js.map +1 -0
  274. package/dist/execution-matrix/source-resolver-factories.spec.d.ts +2 -0
  275. package/dist/execution-matrix/source-resolver-factories.spec.d.ts.map +1 -0
  276. package/dist/execution-matrix/source-resolver-factories.spec.js +127 -0
  277. package/dist/execution-matrix/source-resolver-factories.spec.js.map +1 -0
  278. package/dist/execution-matrix/source-resolver.d.ts +31 -0
  279. package/dist/execution-matrix/source-resolver.d.ts.map +1 -0
  280. package/dist/execution-matrix/source-resolver.js +26 -0
  281. package/dist/execution-matrix/source-resolver.js.map +1 -0
  282. package/dist/execution-matrix/status.d.ts +7 -0
  283. package/dist/execution-matrix/status.d.ts.map +1 -0
  284. package/dist/execution-matrix/status.js +33 -0
  285. package/dist/execution-matrix/status.js.map +1 -0
  286. package/dist/execution-matrix/xmemory-entity-collections.d.ts +69 -0
  287. package/dist/execution-matrix/xmemory-entity-collections.d.ts.map +1 -0
  288. package/dist/execution-matrix/xmemory-entity-collections.js +120 -0
  289. package/dist/execution-matrix/xmemory-entity-collections.js.map +1 -0
  290. package/dist/execution-matrix/xmemory-entity-collections.spec.d.ts +2 -0
  291. package/dist/execution-matrix/xmemory-entity-collections.spec.d.ts.map +1 -0
  292. package/dist/execution-matrix/xmemory-entity-collections.spec.js +112 -0
  293. package/dist/execution-matrix/xmemory-entity-collections.spec.js.map +1 -0
  294. package/dist/execution-matrix/xmemory-op-tier.d.ts +172 -0
  295. package/dist/execution-matrix/xmemory-op-tier.d.ts.map +1 -0
  296. package/dist/execution-matrix/xmemory-op-tier.js +339 -0
  297. package/dist/execution-matrix/xmemory-op-tier.js.map +1 -0
  298. package/dist/execution-matrix/xmemory-op-tier.spec.d.ts +2 -0
  299. package/dist/execution-matrix/xmemory-op-tier.spec.d.ts.map +1 -0
  300. package/dist/execution-matrix/xmemory-op-tier.spec.js +198 -0
  301. package/dist/execution-matrix/xmemory-op-tier.spec.js.map +1 -0
  302. package/dist/execution-matrix/xronox-matrix-factory.d.ts +38 -0
  303. package/dist/execution-matrix/xronox-matrix-factory.d.ts.map +1 -0
  304. package/dist/execution-matrix/xronox-matrix-factory.js +77 -0
  305. package/dist/execution-matrix/xronox-matrix-factory.js.map +1 -0
  306. package/dist/execution-matrix/xronox-store-native-driver-hooks.d.ts +15 -0
  307. package/dist/execution-matrix/xronox-store-native-driver-hooks.d.ts.map +1 -0
  308. package/dist/execution-matrix/xronox-store-native-driver-hooks.js +41 -0
  309. package/dist/execution-matrix/xronox-store-native-driver-hooks.js.map +1 -0
  310. package/dist/test-fixtures/exellix-test-matrix-ids.d.ts +16 -0
  311. package/dist/test-fixtures/exellix-test-matrix-ids.d.ts.map +1 -0
  312. package/dist/test-fixtures/exellix-test-matrix-ids.js +16 -0
  313. package/dist/test-fixtures/exellix-test-matrix-ids.js.map +1 -0
  314. package/dist/test-fixtures/seed-exellix-test-matrix-config.d.ts +26 -0
  315. package/dist/test-fixtures/seed-exellix-test-matrix-config.d.ts.map +1 -0
  316. package/dist/test-fixtures/seed-exellix-test-matrix-config.js +82 -0
  317. package/dist/test-fixtures/seed-exellix-test-matrix-config.js.map +1 -0
  318. package/package.json +67 -0
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Snapshot transform runner: executes the inline JS source declared on a `query-snapshot`
3
+ * data source under `node:vm` with a wall-clock timeout.
4
+ *
5
+ * **Sandbox is best-effort, NOT a security boundary.** `node:vm` shares the same V8 process and
6
+ * does not isolate prototype tampering or long synchronous loops perfectly. Hosts that expose this
7
+ * to untrusted authors must add their own process-level isolation. We intentionally do not pass
8
+ * `require`, `process`, network globals, or filesystem APIs into the sandbox.
9
+ */
10
+ import { createHash, randomUUID } from 'node:crypto';
11
+ import { Script, createContext } from 'node:vm';
12
+ import { SNAPSHOT_TRANSFORM_TIMEOUT_HARD_CAP_MS, } from './contracts.js';
13
+ const DEFAULT_TIMEOUT_MS = 1_000;
14
+ export class SnapshotTransformError extends Error {
15
+ cause;
16
+ constructor(message, cause) {
17
+ super(message);
18
+ this.cause = cause;
19
+ this.name = 'SnapshotTransformError';
20
+ }
21
+ }
22
+ /**
23
+ * Compile and execute `transform.source` in `node:vm`.
24
+ *
25
+ * Source contract: the script is wrapped in `(function(records, params){ ... })(records, params)` so
26
+ * authors can write either a `return ...` body or a top-level expression. The returned value is
27
+ * the snapshot payload.
28
+ */
29
+ export function runSnapshotTransform(transform, inputs) {
30
+ if (!transform || transform.language !== 'js') {
31
+ throw new SnapshotTransformError('runSnapshotTransform: only language="js" is supported');
32
+ }
33
+ if (!transform.source || typeof transform.source !== 'string') {
34
+ throw new SnapshotTransformError('runSnapshotTransform: source is required');
35
+ }
36
+ const timeoutMs = Math.min(transform.timeoutMs ?? DEFAULT_TIMEOUT_MS, SNAPSHOT_TRANSFORM_TIMEOUT_HARD_CAP_MS);
37
+ const wrappedSource = `(function(records, params, snapshot){\n${transform.source}\n})(records, params, snapshot)`;
38
+ let script;
39
+ try {
40
+ script = new Script(wrappedSource, { filename: `snapshot-transform.${transform.version}.js` });
41
+ }
42
+ catch (err) {
43
+ throw new SnapshotTransformError('runSnapshotTransform: failed to compile transform source', err);
44
+ }
45
+ const sandboxState = { result: undefined };
46
+ const sandbox = createContext({
47
+ records: deepFreezeShallow(inputs.records),
48
+ params: inputs.params ? deepFreezeShallow(inputs.params) : {},
49
+ snapshot: {
50
+ set(value) {
51
+ sandboxState.result = value;
52
+ },
53
+ },
54
+ console: {
55
+ log: () => undefined,
56
+ info: () => undefined,
57
+ warn: () => undefined,
58
+ error: () => undefined,
59
+ },
60
+ });
61
+ let returned;
62
+ try {
63
+ returned = script.runInContext(sandbox, { timeout: timeoutMs, breakOnSigint: true });
64
+ }
65
+ catch (err) {
66
+ throw new SnapshotTransformError(`runSnapshotTransform: execution failed (timeoutMs=${timeoutMs}): ${err?.message ?? String(err)}`, err);
67
+ }
68
+ const payload = returned !== undefined ? returned : sandboxState.result;
69
+ return { payload, transformVersion: transform.version };
70
+ }
71
+ function deepFreezeShallow(v) {
72
+ if (v && typeof v === 'object') {
73
+ try {
74
+ Object.freeze(v);
75
+ }
76
+ catch {
77
+ // ignore
78
+ }
79
+ }
80
+ return v;
81
+ }
82
+ /**
83
+ * Stable hash over a (selection, sourceIds) pair, used to dedupe / correlate snapshots
84
+ * built from the same source query. SHA-256 hex truncated to 32 chars (sufficient for collision
85
+ * resistance within a single matrix's history).
86
+ */
87
+ export function buildSourceQueryHash(selection, sourceIds) {
88
+ const canonical = JSON.stringify({
89
+ selection: selection ?? null,
90
+ sourceIds: sourceIds ? [...sourceIds].sort() : null,
91
+ });
92
+ return createHash('sha256').update(canonical).digest('hex').slice(0, 32);
93
+ }
94
+ /**
95
+ * Convenience: build a fully-formed {@link ExecutionMatrixSnapshotRecord} from transform output.
96
+ * Caller still needs to persist via `ExecutionMatrixRuntime.insertSnapshot`.
97
+ */
98
+ export function buildSnapshotRecord(input) {
99
+ return {
100
+ snapshotId: `snap_${input.matrixCatalogId}_${randomUUID()}`,
101
+ matrixCatalogId: input.matrixCatalogId,
102
+ ...(input.matrixRunId ? { matrixRunId: input.matrixRunId } : {}),
103
+ ...(input.entityType !== undefined && input.entityType !== '' ? { entityType: input.entityType } : {}),
104
+ sourceQueryHash: buildSourceQueryHash(input.selection, input.sourceIds),
105
+ ...(input.sourceIds && input.sourceIds.length > 0 ? { sourceIds: [...input.sourceIds] } : {}),
106
+ transformVersion: input.transformResult.transformVersion,
107
+ payload: input.transformResult.payload,
108
+ createdAt: new Date().toISOString(),
109
+ };
110
+ }
111
+ //# sourceMappingURL=snapshot-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-runner.js","sourceRoot":"","sources":["../../src/execution-matrix/snapshot-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EACL,sCAAsC,GAGvC,MAAM,gBAAgB,CAAC;AAExB,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAQjC,MAAM,OAAO,sBAAuB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,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { XronoxCollection } from '@x12i/xronox-store';
2
+ import type { DataSource, EffectiveMatrixConfig } from './contracts.js';
3
+ import type { MatrixSourceResolver } from './source-resolver.js';
4
+ /** Default cap for {@link listSourceIds} when using factory-built resolvers (matches typical run-loop batching). */
5
+ export declare const DEFAULT_MATRIX_SOURCE_LIST_CAP = 10000;
6
+ export type ResolveMatrixRecordCollection = (collectionRef: string) => XronoxCollection<Record<string, unknown>>;
7
+ export type MatrixSourceResolverFromRecordLikeOptions = {
8
+ resolveCollection: ResolveMatrixRecordCollection;
9
+ /** Document field used as stable source id (default `_id`). */
10
+ sourceIdField?: string;
11
+ /** Max documents scanned per {@link MatrixSourceResolver.listSourceIds} call. */
12
+ listCap?: number;
13
+ };
14
+ /**
15
+ * Builds a {@link MatrixSourceResolver} for **`record`** or **`query-snapshot`** data sources — the same
16
+ * shapes the run loop uses when listing upstream ids before fetch/transform.
17
+ *
18
+ * **Not supported here:** `event`, `storage` (hosts must supply a custom resolver). **`collectionRef`**
19
+ * is resolved through {@link ResolveMatrixRecordCollection} — wire it to your xronox store / Mongo mirror.
20
+ */
21
+ export declare function createMatrixSourceResolverFromRecordLikeDataSource(dataSource: Extract<DataSource, {
22
+ kind: 'record' | 'query-snapshot';
23
+ }>, options: MatrixSourceResolverFromRecordLikeOptions): MatrixSourceResolver;
24
+ /**
25
+ * Same as {@link createMatrixSourceResolverFromRecordLikeDataSource} but reads `payload.dataSource`
26
+ * from an {@link EffectiveMatrixConfig}.
27
+ *
28
+ * @throws When `dataSource` is missing or kind is not `record` / `query-snapshot`.
29
+ */
30
+ export declare function createMatrixSourceResolverFromEffectiveConfig(effective: EffectiveMatrixConfig, options: MatrixSourceResolverFromRecordLikeOptions): MatrixSourceResolver;
31
+ //# sourceMappingURL=source-resolver-factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver-factories.d.ts","sourceRoot":"","sources":["../../src/execution-matrix/source-resolver-factories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,oHAAoH;AACpH,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAErD,MAAM,MAAM,6BAA6B,GAAG,CAC1C,aAAa,EAAE,MAAM,KAClB,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/C,MAAM,MAAM,yCAAyC,GAAG;IACtD,iBAAiB,EAAE,6BAA6B,CAAC;IACjD,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAQF;;;;;;GAMG;AACH,wBAAgB,kDAAkD,CAChE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,gBAAgB,CAAA;CAAE,CAAC,EACtE,OAAO,EAAE,yCAAyC,GACjD,oBAAoB,CAoCtB;AAED;;;;;GAKG;AACH,wBAAgB,6CAA6C,CAC3D,SAAS,EAAE,qBAAqB,EAChC,OAAO,EAAE,yCAAyC,GACjD,oBAAoB,CAWtB"}
@@ -0,0 +1,71 @@
1
+ /** Default cap for {@link listSourceIds} when using factory-built resolvers (matches typical run-loop batching). */
2
+ export const DEFAULT_MATRIX_SOURCE_LIST_CAP = 10_000;
3
+ function normalizeIdField(field, doc) {
4
+ const raw = doc[field];
5
+ if (raw === undefined || raw === null)
6
+ return '';
7
+ return String(raw);
8
+ }
9
+ /**
10
+ * Builds a {@link MatrixSourceResolver} for **`record`** or **`query-snapshot`** data sources — the same
11
+ * shapes the run loop uses when listing upstream ids before fetch/transform.
12
+ *
13
+ * **Not supported here:** `event`, `storage` (hosts must supply a custom resolver). **`collectionRef`**
14
+ * is resolved through {@link ResolveMatrixRecordCollection} — wire it to your xronox store / Mongo mirror.
15
+ */
16
+ export function createMatrixSourceResolverFromRecordLikeDataSource(dataSource, options) {
17
+ const field = options.sourceIdField ?? '_id';
18
+ const cap = options.listCap ?? DEFAULT_MATRIX_SOURCE_LIST_CAP;
19
+ const selection = dataSource.selection;
20
+ return {
21
+ async listSourceIds(sel, _runtimeScope) {
22
+ const coll = options.resolveCollection(dataSource.collectionRef);
23
+ const filter = (sel ?? selection ?? {});
24
+ const docs = await coll.readMany(filter, { limit: cap, mergeCache: true });
25
+ const ids = [];
26
+ for (const d of docs) {
27
+ const id = normalizeIdField(field, d);
28
+ if (id.length > 0)
29
+ ids.push(id);
30
+ }
31
+ return ids;
32
+ },
33
+ async fetchRecordsByIds(ids, _runtimeScope) {
34
+ if (ids.length === 0)
35
+ return [];
36
+ const coll = options.resolveCollection(dataSource.collectionRef);
37
+ const filter = { [field]: { $in: ids } };
38
+ const docs = await coll.readMany(filter, { limit: ids.length, mergeCache: true });
39
+ const byId = new Map();
40
+ for (const d of docs) {
41
+ const id = normalizeIdField(field, d);
42
+ if (id.length > 0)
43
+ byId.set(id, d);
44
+ }
45
+ const out = [];
46
+ for (const id of ids) {
47
+ const row = byId.get(id);
48
+ if (row)
49
+ out.push(row);
50
+ }
51
+ return out;
52
+ },
53
+ };
54
+ }
55
+ /**
56
+ * Same as {@link createMatrixSourceResolverFromRecordLikeDataSource} but reads `payload.dataSource`
57
+ * from an {@link EffectiveMatrixConfig}.
58
+ *
59
+ * @throws When `dataSource` is missing or kind is not `record` / `query-snapshot`.
60
+ */
61
+ export function createMatrixSourceResolverFromEffectiveConfig(effective, options) {
62
+ const ds = effective.payload.dataSource;
63
+ if (!ds) {
64
+ throw new Error('createMatrixSourceResolverFromEffectiveConfig: payload.dataSource is required');
65
+ }
66
+ if (ds.kind === 'record' || ds.kind === 'query-snapshot') {
67
+ return createMatrixSourceResolverFromRecordLikeDataSource(ds, options);
68
+ }
69
+ throw new Error(`createMatrixSourceResolverFromEffectiveConfig: unsupported dataSource.kind '${ds.kind}' — provide a custom MatrixSourceResolver (storage/event sources are host-specific).`);
70
+ }
71
+ //# sourceMappingURL=source-resolver-factories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver-factories.js","sourceRoot":"","sources":["../../src/execution-matrix/source-resolver-factories.ts"],"names":[],"mappings":"AAIA,oHAAoH;AACpH,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAcrD,SAAS,gBAAgB,CAAC,KAAa,EAAE,GAA4B;IACnE,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IACjD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kDAAkD,CAChE,UAAsE,EACtE,OAAkD;IAElD,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC;IAC7C,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,IAAI,8BAA8B,CAAC;IAC9D,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;IAEvC,OAAO;QACL,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,aAAa;YACpC,MAAM,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,SAAS,IAAI,EAAE,CAA4B,CAAC;YACnE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3E,MAAM,GAAG,GAAa,EAAE,CAAC;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AAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6CAA6C,CAC3D,SAAgC,EAChC,OAAkD;IAElD,MAAM,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC;IACxC,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IACnG,CAAC;IACD,IAAI,EAAE,CAAC,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACzD,OAAO,kDAAkD,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IACD,MAAM,IAAI,KAAK,CACb,+EAA+E,EAAE,CAAC,IAAI,sFAAsF,CAC7K,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=source-resolver-factories.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver-factories.spec.d.ts","sourceRoot":"","sources":["../../src/execution-matrix/source-resolver-factories.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,127 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { MATRIX_FAILURE_PK, MATRIX_ROW_PK } from './constants.js';
3
+ import { MemoryMatrixCollection } from './memory-store.js';
4
+ import { fetchSourceJoinView } from './navigator.js';
5
+ import { createExecutionMatrixRuntime } from './runtime-store.js';
6
+ import { createMatrixSourceResolverFromEffectiveConfig, createMatrixSourceResolverFromRecordLikeDataSource, } from './source-resolver-factories.js';
7
+ import { materializeExecutionMatrixRuntimeRows } from './materializer.js';
8
+ describe('createMatrixSourceResolverFromRecordLikeDataSource', () => {
9
+ it('drives waitingInSource for fetchSourceJoinView', async () => {
10
+ const widgets = new MemoryMatrixCollection('_id');
11
+ await widgets.insert({ _id: 'w1', name: 'a' });
12
+ await widgets.insert({ _id: 'w2', name: 'b' });
13
+ const rows = new MemoryMatrixCollection(MATRIX_ROW_PK);
14
+ const fails = new MemoryMatrixCollection(MATRIX_FAILURE_PK);
15
+ const rt = createExecutionMatrixRuntime(rows.asCollection(), fails.asCollection(), { serializeClaims: true });
16
+ const [row] = materializeExecutionMatrixRuntimeRows({
17
+ matrixCatalogId: 'cat',
18
+ matrixItemId: 'item',
19
+ matrixRunId: 'r1',
20
+ payload: { input: {}, graphs: ['G'] },
21
+ graphRecords: [{ graphId: 'G', mappedInput: [], execution: { priority: 1 } }],
22
+ inputRows: [{ sourceId: 'w1' }],
23
+ });
24
+ await rt.insertRuntimeRow(row);
25
+ const resolver = createMatrixSourceResolverFromRecordLikeDataSource({
26
+ kind: 'record',
27
+ collectionRef: 'widgets',
28
+ selection: {},
29
+ }, {
30
+ resolveCollection: (ref) => {
31
+ expect(ref).toBe('widgets');
32
+ return widgets.asCollection();
33
+ },
34
+ sourceIdField: '_id',
35
+ });
36
+ const view = await fetchSourceJoinView({ runtime: rt, sourceResolver: resolver }, { matrixCatalogId: 'cat', matrixRunId: 'r1', graphId: 'G' });
37
+ expect(view.waitingInSource).toEqual(['w2']);
38
+ expect(view.waitingInMatrix).toHaveLength(1);
39
+ });
40
+ it('createMatrixSourceResolverFromEffectiveConfig rejects unsupported kinds', () => {
41
+ const effective = {
42
+ matrixCatalogId: 'cat',
43
+ payload: {
44
+ input: {},
45
+ graphs: ['G'],
46
+ dataSource: { kind: 'event' },
47
+ },
48
+ executionMode: { mode: 'single-pass' },
49
+ pollWhenEmptySeconds: 0,
50
+ dataSourceKind: 'event',
51
+ };
52
+ expect(() => createMatrixSourceResolverFromEffectiveConfig(effective, {
53
+ resolveCollection: () => {
54
+ throw new Error('unused');
55
+ },
56
+ })).toThrow(/unsupported dataSource\.kind/);
57
+ });
58
+ it('createMatrixSourceResolverFromEffectiveConfig rejects missing dataSource', () => {
59
+ const effective = {
60
+ matrixCatalogId: 'cat',
61
+ payload: { input: {}, graphs: ['G'] },
62
+ executionMode: { mode: 'single-pass' },
63
+ pollWhenEmptySeconds: 0,
64
+ dataSourceKind: 'event',
65
+ };
66
+ expect(() => createMatrixSourceResolverFromEffectiveConfig(effective, {
67
+ resolveCollection: () => {
68
+ throw new Error('unused');
69
+ },
70
+ })).toThrow(/payload\.dataSource is required/);
71
+ });
72
+ it('createMatrixSourceResolverFromEffectiveConfig supports record kind', async () => {
73
+ const widgets = new MemoryMatrixCollection('_id');
74
+ await widgets.insert({ _id: 'a1', v: 1 });
75
+ await widgets.insert({ _id: 'a2', v: 2 });
76
+ const effective = {
77
+ matrixCatalogId: 'cat',
78
+ payload: {
79
+ input: {},
80
+ graphs: ['G'],
81
+ dataSource: { kind: 'record', collectionRef: 'widgets', selection: {} },
82
+ },
83
+ executionMode: { mode: 'single-pass' },
84
+ pollWhenEmptySeconds: 0,
85
+ dataSourceKind: 'record',
86
+ };
87
+ const resolver = createMatrixSourceResolverFromEffectiveConfig(effective, {
88
+ resolveCollection: () => widgets.asCollection(),
89
+ });
90
+ const ids = await resolver.listSourceIds({});
91
+ expect(ids).toEqual(['a1', 'a2']);
92
+ });
93
+ it('createMatrixSourceResolverFromEffectiveConfig supports query-snapshot kind', async () => {
94
+ const widgets = new MemoryMatrixCollection('_id');
95
+ await widgets.insert({ _id: 'a1', v: 1 });
96
+ const effective = {
97
+ matrixCatalogId: 'cat',
98
+ payload: {
99
+ input: {},
100
+ graphs: ['G'],
101
+ dataSource: {
102
+ kind: 'query-snapshot',
103
+ collectionRef: 'widgets',
104
+ selection: {},
105
+ transform: { language: 'js', source: 'return records;', version: 'v1' },
106
+ },
107
+ },
108
+ executionMode: { mode: 'single-pass' },
109
+ pollWhenEmptySeconds: 0,
110
+ dataSourceKind: 'query-snapshot',
111
+ };
112
+ const resolver = createMatrixSourceResolverFromEffectiveConfig(effective, {
113
+ resolveCollection: () => widgets.asCollection(),
114
+ });
115
+ const ids = await resolver.listSourceIds({});
116
+ expect(ids).toEqual(['a1']);
117
+ });
118
+ it('fetchRecordsByIds preserves caller id order', async () => {
119
+ const widgets = new MemoryMatrixCollection('_id');
120
+ await widgets.insert({ _id: 'z', name: 'z' });
121
+ await widgets.insert({ _id: 'a', name: 'a' });
122
+ const resolver = createMatrixSourceResolverFromRecordLikeDataSource({ kind: 'record', collectionRef: 'widgets', selection: {} }, { resolveCollection: () => widgets.asCollection(), sourceIdField: '_id' });
123
+ const rows = await resolver.fetchRecordsByIds(['a', 'z', 'missing']);
124
+ expect(rows.map((r) => r._id)).toEqual(['a', 'z']);
125
+ });
126
+ });
127
+ //# sourceMappingURL=source-resolver-factories.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver-factories.spec.js","sourceRoot":"","sources":["../../src/execution-matrix/source-resolver-factories.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACL,6CAA6C,EAC7C,kDAAkD,GACnD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qCAAqC,EAAE,MAAM,mBAAmB,CAAC;AAE1E,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;IAClE,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QAC/C,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,C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SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAC3D,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAC1E,CAAC;QAEF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,iBAAiB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QACrE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Host-implemented bridge between an upstream source (collection / bucket / queue) and the
3
+ * execution matrix. Used by the run loop and by `fetchSourceJoinView` to know which records
4
+ * exist in the source vs which are already represented by matrix rows.
5
+ *
6
+ * Implementations live in product hosts (xmemory, custom MongoDB queries, blob listing …);
7
+ * this package only declares the interface and convenience helpers.
8
+ */
9
+ export interface MatrixSourceResolver {
10
+ /**
11
+ * Return the list of source ids matching `selection` (and any host-defined `runtimeScope`).
12
+ *
13
+ * Order should be deterministic per (selection, scope) pair so callers can compute stable
14
+ * diffs against matrix-side ids. Pagination, if needed, is the host's concern; resolvers
15
+ * may cap the response and expose their own paging surface elsewhere.
16
+ */
17
+ listSourceIds(selection: Record<string, unknown> | undefined, runtimeScope?: Record<string, unknown>): Promise<string[]>;
18
+ /**
19
+ * Hydrate the actual record bodies for a list of ids returned by {@link listSourceIds}.
20
+ *
21
+ * Implementations should preserve the input order on the response when possible to make
22
+ * downstream materialization deterministic.
23
+ */
24
+ fetchRecordsByIds(ids: string[], runtimeScope?: Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
25
+ }
26
+ /**
27
+ * Compute set difference of source ids minus already-known matrix ids.
28
+ * Useful for the run loop's "what hasn't been materialized yet" question.
29
+ */
30
+ export declare function diffSourceIdsAgainstMatrix(sourceIds: ReadonlyArray<string>, matrixSourceIds: ReadonlyArray<string>): string[];
31
+ //# sourceMappingURL=source-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver.d.ts","sourceRoot":"","sources":["../../src/execution-matrix/source-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,aAAa,CACX,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC9C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAErB;;;;;OAKG;IACH,iBAAiB,CACf,GAAG,EAAE,MAAM,EAAE,EACb,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CAC5C;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,EAChC,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,GACrC,MAAM,EAAE,CASV"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Host-implemented bridge between an upstream source (collection / bucket / queue) and the
3
+ * execution matrix. Used by the run loop and by `fetchSourceJoinView` to know which records
4
+ * exist in the source vs which are already represented by matrix rows.
5
+ *
6
+ * Implementations live in product hosts (xmemory, custom MongoDB queries, blob listing …);
7
+ * this package only declares the interface and convenience helpers.
8
+ */
9
+ /**
10
+ * Compute set difference of source ids minus already-known matrix ids.
11
+ * Useful for the run loop's "what hasn't been materialized yet" question.
12
+ */
13
+ export function diffSourceIdsAgainstMatrix(sourceIds, matrixSourceIds) {
14
+ if (sourceIds.length === 0)
15
+ return [];
16
+ if (matrixSourceIds.length === 0)
17
+ return [...sourceIds];
18
+ const seen = new Set(matrixSourceIds);
19
+ const out = [];
20
+ for (const id of sourceIds) {
21
+ if (!seen.has(id))
22
+ out.push(id);
23
+ }
24
+ return out;
25
+ }
26
+ //# sourceMappingURL=source-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver.js","sourceRoot":"","sources":["../../src/execution-matrix/source-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2BH;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,SAAgC,EAChC,eAAsC;IAEtC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC;IACtC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ExecutionMatrixStatus } from './contracts.js';
2
+ /**
3
+ * Normalize user or legacy status strings to canonical {@link ExecutionMatrixStatus}.
4
+ */
5
+ export declare function normalizeExecutionMatrixStatus(raw: string): ExecutionMatrixStatus | null;
6
+ export declare function assertExecutionMatrixStatus(raw: string): ExecutionMatrixStatus;
7
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/execution-matrix/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAkB5D;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAMxF;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAM9E"}
@@ -0,0 +1,33 @@
1
+ import { EXECUTION_MATRIX_STATUSES } from './contracts.js';
2
+ const ALIASES = {
3
+ 'not-strated': 'not-started',
4
+ 'not_started': 'not-started',
5
+ notstarted: 'not-started',
6
+ pending: 'not-started',
7
+ queued: 'not-started',
8
+ running: 'in-progress',
9
+ inprogress: 'in-progress',
10
+ done: 'completed',
11
+ success: 'completed',
12
+ error: 'failed',
13
+ cancelled: 'skipped',
14
+ canceled: 'skipped',
15
+ };
16
+ /**
17
+ * Normalize user or legacy status strings to canonical {@link ExecutionMatrixStatus}.
18
+ */
19
+ export function normalizeExecutionMatrixStatus(raw) {
20
+ const s = raw.trim().toLowerCase().replace(/\s+/g, '-');
21
+ if (EXECUTION_MATRIX_STATUSES.includes(s)) {
22
+ return s;
23
+ }
24
+ return ALIASES[s] ?? null;
25
+ }
26
+ export function assertExecutionMatrixStatus(raw) {
27
+ const n = normalizeExecutionMatrixStatus(raw);
28
+ if (!n) {
29
+ throw new Error(`Invalid execution matrix status: ${JSON.stringify(raw)}`);
30
+ }
31
+ return n;
32
+ }
33
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/execution-matrix/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,OAAO,GAA0C;IACrD,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,aAAa;IAC5B,UAAU,EAAE,aAAa;IACzB,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAAC,GAAW;IACxD,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxD,IAAK,yBAA+C,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,CAA0B,CAAC;IACpC,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,GAAW;IACrD,MAAM,CAAC,GAAG,8BAA8B,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * XMemory entity-collection registry: Catalox catalog listing plus resolved entity queries.
3
+ *
4
+ * The **registry** is a normal Catalox catalog (default id {@link DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID})
5
+ * whose items describe where entity rows live. Each registry item’s `data` should include either:
6
+ * - `entitiesCatalogId` (or `entityCatalogId` / `itemsCatalogId`) — Catalox catalog to list via {@link Catalox.listCatalogItems}, or
7
+ * - `recordCollectionRef` (or `xronoxCollectionRef` / `collectionRef`) — logical collection ref for {@link XronoxCollection.readMany}.
8
+ */
9
+ import { type Catalox, type CataloxContext, type CatalogId, type CatalogListResult, type CatalogQueryOptions, type ItemId, type UnifiedCatalogItem } from '@x12i/catalox';
10
+ import type { XronoxCollection } from '@x12i/xronox-store';
11
+ /** Env: overrides default registry catalog id when non-empty after trim. */
12
+ export declare const EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV: "EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID";
13
+ export type XmemoryEntityCollectionsRuntimeConfig = {
14
+ /** Catalox catalog whose items define entity collections (metadata / pointers to corpora). */
15
+ entityCollectionsCatalogId: CatalogId;
16
+ };
17
+ export declare function resolveXmemoryEntityCollectionsRuntimeConfig(overrides?: Partial<XmemoryEntityCollectionsRuntimeConfig>): XmemoryEntityCollectionsRuntimeConfig;
18
+ /** Read Catalox backing catalog id from a registry catalog item (`data.*`). */
19
+ export declare function resolveEntitiesCatalogIdFromRegistryItem(item: UnifiedCatalogItem): CatalogId | undefined;
20
+ /** Read xronox logical collection ref from a registry catalog item (`data.*`). */
21
+ export declare function resolveRecordCollectionRefFromRegistryItem(item: UnifiedCatalogItem): string | undefined;
22
+ /**
23
+ * List registry items from the configured entity-collections catalog (default {@link DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID}).
24
+ * Forwards `query` to {@link Catalox.listCatalogItems} (`limit`, `offset`, `filter`, `sort`, `scope`).
25
+ */
26
+ export declare function listXmemoryEntityCollectionRegistryItems(catalox: Catalox, context: CataloxContext, query?: CatalogQueryOptions, config?: Partial<XmemoryEntityCollectionsRuntimeConfig>): Promise<CatalogListResult>;
27
+ export type ListXmemoryEntityCollectionCatalogEntitiesInput = {
28
+ /**
29
+ * Registry item id — loads `data.entitiesCatalogId` (or aliases) from the entity-collections catalog.
30
+ * Ignored when `entitiesCatalogId` is set.
31
+ */
32
+ registryItemId?: ItemId;
33
+ /** When set, lists this catalog directly (skips registry lookup). */
34
+ entitiesCatalogId?: CatalogId;
35
+ /** Passed through to {@link Catalox.listCatalogItems} after {@link compactCatalogFilter} on `filter`. */
36
+ query?: CatalogQueryOptions;
37
+ };
38
+ /**
39
+ * List entity rows exposed as a **Catalox catalog** (native or mapped).
40
+ *
41
+ * Resolve order: `entitiesCatalogId` override → registry item `data.entitiesCatalogId` / aliases.
42
+ * Throws if neither yields a catalog id.
43
+ */
44
+ export declare function listXmemoryEntityCollectionCatalogEntities(catalox: Catalox, context: CataloxContext, input: ListXmemoryEntityCollectionCatalogEntitiesInput, config?: Partial<XmemoryEntityCollectionsRuntimeConfig>): Promise<CatalogListResult>;
45
+ export type ListXmemoryEntityCollectionDocumentsInput = {
46
+ /** Registry item id — must carry `recordCollectionRef` (or aliases). */
47
+ registryItemId: ItemId;
48
+ /** Mongo-style filter for {@link XronoxCollection.readMany}. */
49
+ filter?: Record<string, unknown>;
50
+ limit?: number;
51
+ sort?: Record<string, 1 | -1>;
52
+ mergeCache?: boolean;
53
+ /** When true, runs {@link XronoxCollection.countMatching} with the same filter (extra round-trip). */
54
+ includeTotal?: boolean;
55
+ };
56
+ export type ListXmemoryEntityCollectionDocumentsDeps = {
57
+ resolveCollection: (collectionRef: string) => XronoxCollection<Record<string, unknown>>;
58
+ };
59
+ /**
60
+ * List raw documents for an entity collection backed by **xronox** (Mongo-shaped rows).
61
+ *
62
+ * Pagination: use `limit` + tight `filter`. Deep paging without skip is a known xronox read constraint;
63
+ * prefer Catalox-mapped catalogs for offset-style paging via {@link listXmemoryEntityCollectionCatalogEntities}.
64
+ */
65
+ export declare function listXmemoryEntityCollectionDocuments(catalox: Catalox, context: CataloxContext, input: ListXmemoryEntityCollectionDocumentsInput, deps: ListXmemoryEntityCollectionDocumentsDeps, config?: Partial<XmemoryEntityCollectionsRuntimeConfig>): Promise<{
66
+ rows: Record<string, unknown>[];
67
+ total?: number;
68
+ }>;
69
+ //# sourceMappingURL=xmemory-entity-collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xmemory-entity-collections.d.ts","sourceRoot":"","sources":["../../src/execution-matrix/xmemory-entity-collections.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK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