@graphrefly/ts 0.0.0 → 0.0.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 (307) hide show
  1. package/README.md +135 -0
  2. package/dist/adapters/index.cjs +105 -66
  3. package/dist/adapters/index.cjs.map +1 -1
  4. package/dist/adapters/index.d.cts +11 -136
  5. package/dist/adapters/index.d.ts +11 -136
  6. package/dist/adapters/index.js +27 -225
  7. package/dist/adapters/index.js.map +1 -1
  8. package/dist/adapters/observe-storage.d.cts +4 -4
  9. package/dist/adapters/observe-storage.d.ts +4 -4
  10. package/dist/adapters/observe-storage.js +1 -0
  11. package/dist/adapters/observe-storage.js.map +1 -1
  12. package/dist/adapters/react.cjs +166 -0
  13. package/dist/adapters/react.cjs.map +1 -0
  14. package/dist/adapters/react.d.cts +31 -0
  15. package/dist/adapters/react.d.ts +31 -0
  16. package/dist/adapters/react.js +51 -0
  17. package/dist/adapters/react.js.map +1 -0
  18. package/dist/adapters/solid.cjs +157 -0
  19. package/dist/adapters/solid.cjs.map +1 -0
  20. package/dist/adapters/solid.d.cts +26 -0
  21. package/dist/adapters/solid.d.ts +26 -0
  22. package/dist/adapters/solid.js +48 -0
  23. package/dist/adapters/solid.js.map +1 -0
  24. package/dist/adapters/svelte.cjs +148 -0
  25. package/dist/adapters/svelte.cjs.map +1 -0
  26. package/dist/adapters/svelte.d.cts +31 -0
  27. package/dist/adapters/svelte.d.ts +31 -0
  28. package/dist/adapters/svelte.js +46 -0
  29. package/dist/adapters/svelte.js.map +1 -0
  30. package/dist/adapters/vue.cjs +155 -0
  31. package/dist/adapters/vue.cjs.map +1 -0
  32. package/dist/adapters/vue.d.cts +26 -0
  33. package/dist/adapters/vue.d.ts +26 -0
  34. package/dist/adapters/vue.js +46 -0
  35. package/dist/adapters/vue.js.map +1 -0
  36. package/dist/agent-runtime-BesGDZcB.d.ts +555 -0
  37. package/dist/agent-runtime-DZTJ3C-p.d.cts +555 -0
  38. package/dist/agentic-memory-BmRCvh0d.d.ts +517 -0
  39. package/dist/agentic-memory-DfuVZ-lY.d.cts +517 -0
  40. package/dist/capability-admission-B0BzqAm5.d.cts +102 -0
  41. package/dist/capability-admission-g0mn9hpq.d.ts +102 -0
  42. package/dist/{chunk-JR4IKCR2.js → chunk-2747WN4Y.js} +5 -5
  43. package/dist/{chunk-2ILL7HQI.js → chunk-3JR3EDB2.js} +17 -17
  44. package/dist/{chunk-2ILL7HQI.js.map → chunk-3JR3EDB2.js.map} +1 -1
  45. package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
  46. package/dist/{chunk-DJC4CHLQ.js → chunk-43BKLFZU.js} +9 -9
  47. package/dist/chunk-6XAIOL3X.js +2407 -0
  48. package/dist/chunk-6XAIOL3X.js.map +1 -0
  49. package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
  50. package/dist/{chunk-Y3ZLRGHC.js → chunk-CZNV3VXM.js} +16 -16
  51. package/dist/chunk-DGUM43GV.js +11 -0
  52. package/dist/chunk-DGUM43GV.js.map +1 -0
  53. package/dist/{chunk-JIMUDQN3.js → chunk-FBUU43PM.js} +2 -2
  54. package/dist/chunk-H75VXTGT.js +219 -0
  55. package/dist/chunk-H75VXTGT.js.map +1 -0
  56. package/dist/{chunk-RIIOUTGM.js → chunk-HKK2JD7Z.js} +12 -9
  57. package/dist/chunk-HKK2JD7Z.js.map +1 -0
  58. package/dist/{chunk-D6BG7U6A.js → chunk-IXZBUWSP.js} +3 -3
  59. package/dist/chunk-PC3BTTBE.js +3217 -0
  60. package/dist/chunk-PC3BTTBE.js.map +1 -0
  61. package/dist/chunk-QFY4AFY4.js +879 -0
  62. package/dist/chunk-QFY4AFY4.js.map +1 -0
  63. package/dist/{chunk-DK554R7P.js → chunk-S6HXABGL.js} +2 -1
  64. package/dist/chunk-S6HXABGL.js.map +1 -0
  65. package/dist/{chunk-PKVBHGBM.js → chunk-SS2A464I.js} +7 -7
  66. package/dist/chunk-UT3MHJCW.js +49 -0
  67. package/dist/chunk-UT3MHJCW.js.map +1 -0
  68. package/dist/{chunk-G4M3NHRJ.js → chunk-V7CIJE4B.js} +3 -3
  69. package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
  70. package/dist/chunk-VTHLCFN4.js +368 -0
  71. package/dist/chunk-VTHLCFN4.js.map +1 -0
  72. package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
  73. package/dist/chunk-WQIA3GFB.js.map +1 -0
  74. package/dist/{chunk-I3IHOHCJ.js → chunk-XKXWK2KP.js} +108 -64
  75. package/dist/chunk-XKXWK2KP.js.map +1 -0
  76. package/dist/{chunk-COHO25CZ.js → chunk-YDSIVHRR.js} +553 -7
  77. package/dist/chunk-YDSIVHRR.js.map +1 -0
  78. package/dist/chunk-YXMZ2N6J.js +1884 -0
  79. package/dist/chunk-YXMZ2N6J.js.map +1 -0
  80. package/dist/composition/index.cjs +102 -57
  81. package/dist/composition/index.cjs.map +1 -1
  82. package/dist/composition/index.d.cts +4 -4
  83. package/dist/composition/index.d.ts +4 -4
  84. package/dist/composition/index.js +6 -5
  85. package/dist/core/index.cjs +102 -57
  86. package/dist/core/index.cjs.map +1 -1
  87. package/dist/core/index.d.cts +2 -2
  88. package/dist/core/index.d.ts +2 -2
  89. package/dist/core/index.js +5 -4
  90. package/dist/cqrs/index.cjs.map +1 -1
  91. package/dist/cqrs/index.d.cts +4 -4
  92. package/dist/cqrs/index.d.ts +4 -4
  93. package/dist/cqrs/index.js +3 -2
  94. package/dist/cqrs/index.js.map +1 -1
  95. package/dist/cqrs/messaging.cjs +312 -0
  96. package/dist/cqrs/messaging.cjs.map +1 -0
  97. package/dist/cqrs/messaging.d.cts +57 -0
  98. package/dist/cqrs/messaging.d.ts +57 -0
  99. package/dist/cqrs/messaging.js +274 -0
  100. package/dist/cqrs/messaging.js.map +1 -0
  101. package/dist/cqrs/work-queue.cjs +329 -0
  102. package/dist/cqrs/work-queue.cjs.map +1 -0
  103. package/dist/cqrs/work-queue.d.cts +90 -0
  104. package/dist/cqrs/work-queue.d.ts +90 -0
  105. package/dist/cqrs/work-queue.js +292 -0
  106. package/dist/cqrs/work-queue.js.map +1 -0
  107. package/dist/data/index.cjs +19 -0
  108. package/dist/data/index.cjs.map +1 -0
  109. package/dist/data/index.d.cts +36 -0
  110. package/dist/data/index.d.ts +36 -0
  111. package/dist/data/index.js +1 -0
  112. package/dist/data/index.js.map +1 -0
  113. package/dist/data-structures/index.cjs +105 -57
  114. package/dist/data-structures/index.cjs.map +1 -1
  115. package/dist/data-structures/index.d.cts +8 -8
  116. package/dist/data-structures/index.d.ts +8 -8
  117. package/dist/data-structures/index.js +7 -6
  118. package/dist/{describe-BZb7AS2y.d.ts → describe-BpyJuWkw.d.ts} +1 -1
  119. package/dist/{describe-Ciu8SUnN.d.cts → describe-DYMw_l1C.d.cts} +1 -1
  120. package/dist/executors/work-queue.cjs +342 -0
  121. package/dist/executors/work-queue.cjs.map +1 -0
  122. package/dist/executors/work-queue.d.cts +90 -0
  123. package/dist/executors/work-queue.d.ts +90 -0
  124. package/dist/executors/work-queue.js +306 -0
  125. package/dist/executors/work-queue.js.map +1 -0
  126. package/dist/graph/index.cjs +112 -58
  127. package/dist/graph/index.cjs.map +1 -1
  128. package/dist/graph/index.d.cts +9 -9
  129. package/dist/graph/index.d.ts +9 -9
  130. package/dist/graph/index.js +18 -17
  131. package/dist/{graph-DfdF9zy4.d.ts → graph-D-1-SQeC.d.ts} +3 -3
  132. package/dist/{graph-s23RbbFO.d.cts → graph-DCEWh4T2.d.cts} +3 -3
  133. package/dist/{index-CAEmLCYF.d.cts → index-72VZC0-E.d.cts} +2 -2
  134. package/dist/{index-SnzZu3x7.d.ts → index-Bmxeu0nK.d.ts} +2 -2
  135. package/dist/index.cjs +112 -58
  136. package/dist/index.cjs.map +1 -1
  137. package/dist/index.d.cts +11 -10
  138. package/dist/index.d.ts +11 -10
  139. package/dist/index.js +118 -113
  140. package/dist/inspection/boundary.cjs +98 -0
  141. package/dist/inspection/boundary.cjs.map +1 -0
  142. package/dist/inspection/boundary.d.cts +61 -0
  143. package/dist/inspection/boundary.d.ts +61 -0
  144. package/dist/inspection/boundary.js +75 -0
  145. package/dist/inspection/boundary.js.map +1 -0
  146. package/dist/{messages-BZqrGGm1.d.ts → messages-CAzUPPJM.d.cts} +10 -5
  147. package/dist/{messages-BZqrGGm1.d.cts → messages-CAzUPPJM.d.ts} +10 -5
  148. package/dist/messaging/index.cjs +744 -613
  149. package/dist/messaging/index.cjs.map +1 -1
  150. package/dist/messaging/index.d.cts +216 -160
  151. package/dist/messaging/index.d.ts +216 -160
  152. package/dist/messaging/index.js +19 -749
  153. package/dist/messaging/index.js.map +1 -1
  154. package/dist/operators/index.cjs +102 -57
  155. package/dist/operators/index.cjs.map +1 -1
  156. package/dist/operators/index.d.cts +6 -6
  157. package/dist/operators/index.d.ts +6 -6
  158. package/dist/operators/index.js +8 -7
  159. package/dist/orchestration/index.cjs +3333 -59
  160. package/dist/orchestration/index.cjs.map +1 -1
  161. package/dist/orchestration/index.d.cts +7 -4
  162. package/dist/orchestration/index.d.ts +7 -4
  163. package/dist/orchestration/index.js +49 -8
  164. package/dist/orchestration/index.js.map +1 -1
  165. package/dist/orchestration/messaging.cjs +314 -0
  166. package/dist/orchestration/messaging.cjs.map +1 -0
  167. package/dist/orchestration/messaging.d.cts +59 -0
  168. package/dist/orchestration/messaging.d.ts +59 -0
  169. package/dist/orchestration/messaging.js +276 -0
  170. package/dist/orchestration/messaging.js.map +1 -0
  171. package/dist/orchestration/work-queue.cjs +262 -0
  172. package/dist/orchestration/work-queue.cjs.map +1 -0
  173. package/dist/orchestration/work-queue.d.cts +85 -0
  174. package/dist/orchestration/work-queue.d.ts +85 -0
  175. package/dist/orchestration/work-queue.js +226 -0
  176. package/dist/orchestration/work-queue.js.map +1 -0
  177. package/dist/patterns/event-flow.cjs +447 -0
  178. package/dist/patterns/event-flow.cjs.map +1 -0
  179. package/dist/patterns/event-flow.d.cts +115 -0
  180. package/dist/patterns/event-flow.d.ts +115 -0
  181. package/dist/patterns/event-flow.js +14 -0
  182. package/dist/patterns/event-flow.js.map +1 -0
  183. package/dist/patterns/index.cjs +423 -18
  184. package/dist/patterns/index.cjs.map +1 -1
  185. package/dist/patterns/index.d.cts +8 -5
  186. package/dist/patterns/index.d.ts +8 -5
  187. package/dist/patterns/index.js +13 -4
  188. package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BAmfrGjd.d.ts} +9 -9
  189. package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-DNV0-gFi.d.cts} +9 -9
  190. package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BNEldDyi.d.cts} +5 -5
  191. package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-YZsAQsWK.d.ts} +5 -5
  192. package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-DRD1LJ2H.d.cts} +6 -6
  193. package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-EsDiCmJk.d.ts} +6 -6
  194. package/dist/render/index.d.cts +3 -3
  195. package/dist/render/index.d.ts +3 -3
  196. package/dist/render/index.js +1 -0
  197. package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-DKuNzuWw.d.cts} +2 -2
  198. package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-uwbwJdhe.d.ts} +2 -2
  199. package/dist/solutions/index.cjs +4478 -2
  200. package/dist/solutions/index.cjs.map +1 -1
  201. package/dist/solutions/index.d.cts +13 -519
  202. package/dist/solutions/index.d.ts +13 -519
  203. package/dist/solutions/index.js +90 -6
  204. package/dist/solutions/reactive-layout/browser/index.cjs +449 -0
  205. package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -0
  206. package/dist/solutions/reactive-layout/browser/index.d.cts +44 -0
  207. package/dist/solutions/reactive-layout/browser/index.d.ts +44 -0
  208. package/dist/solutions/reactive-layout/browser/index.js +69 -0
  209. package/dist/solutions/reactive-layout/browser/index.js.map +1 -0
  210. package/dist/solutions/reactive-layout/index.cjs +4266 -0
  211. package/dist/solutions/reactive-layout/index.cjs.map +1 -0
  212. package/dist/solutions/reactive-layout/index.d.cts +581 -0
  213. package/dist/solutions/reactive-layout/index.d.ts +581 -0
  214. package/dist/solutions/reactive-layout/index.js +86 -0
  215. package/dist/solutions/reactive-layout/index.js.map +1 -0
  216. package/dist/solutions/reactive-layout/node-canvas/index.cjs +545 -0
  217. package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -0
  218. package/dist/solutions/reactive-layout/node-canvas/index.d.cts +54 -0
  219. package/dist/solutions/reactive-layout/node-canvas/index.d.ts +54 -0
  220. package/dist/solutions/reactive-layout/node-canvas/index.js +131 -0
  221. package/dist/solutions/reactive-layout/node-canvas/index.js.map +1 -0
  222. package/dist/solutions/reactive-layout/react-native/index.cjs +494 -0
  223. package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -0
  224. package/dist/solutions/reactive-layout/react-native/index.d.cts +51 -0
  225. package/dist/solutions/reactive-layout/react-native/index.d.ts +51 -0
  226. package/dist/solutions/reactive-layout/react-native/index.js +77 -0
  227. package/dist/solutions/reactive-layout/react-native/index.js.map +1 -0
  228. package/dist/solutions/reactive-layout/skia/index.cjs +547 -0
  229. package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -0
  230. package/dist/solutions/reactive-layout/skia/index.d.cts +64 -0
  231. package/dist/solutions/reactive-layout/skia/index.d.ts +64 -0
  232. package/dist/solutions/reactive-layout/skia/index.js +70 -0
  233. package/dist/solutions/reactive-layout/skia/index.js.map +1 -0
  234. package/dist/solutions/work-item/actions.cjs +2164 -0
  235. package/dist/solutions/work-item/actions.cjs.map +1 -0
  236. package/dist/solutions/work-item/actions.d.cts +201 -0
  237. package/dist/solutions/work-item/actions.d.ts +201 -0
  238. package/dist/solutions/work-item/actions.js +1454 -0
  239. package/dist/solutions/work-item/actions.js.map +1 -0
  240. package/dist/solutions/work-item/scheduling.cjs +2454 -0
  241. package/dist/solutions/work-item/scheduling.cjs.map +1 -0
  242. package/dist/solutions/work-item/scheduling.d.cts +433 -0
  243. package/dist/solutions/work-item/scheduling.d.ts +433 -0
  244. package/dist/solutions/work-item/scheduling.js +32 -0
  245. package/dist/solutions/work-item/scheduling.js.map +1 -0
  246. package/dist/solutions/work-item/work-queue.cjs +306 -0
  247. package/dist/solutions/work-item/work-queue.cjs.map +1 -0
  248. package/dist/solutions/work-item/work-queue.d.cts +71 -0
  249. package/dist/solutions/work-item/work-queue.d.ts +71 -0
  250. package/dist/solutions/work-item/work-queue.js +270 -0
  251. package/dist/solutions/work-item/work-queue.js.map +1 -0
  252. package/dist/sources/browser.cjs +169 -57
  253. package/dist/sources/browser.cjs.map +1 -1
  254. package/dist/sources/browser.d.cts +33 -6
  255. package/dist/sources/browser.d.ts +33 -6
  256. package/dist/sources/browser.js +73 -6
  257. package/dist/sources/browser.js.map +1 -1
  258. package/dist/sources/index.cjs +102 -57
  259. package/dist/sources/index.cjs.map +1 -1
  260. package/dist/sources/index.d.cts +5 -5
  261. package/dist/sources/index.d.ts +5 -5
  262. package/dist/sources/index.js +6 -5
  263. package/dist/sources/node.cjs.map +1 -1
  264. package/dist/sources/node.d.cts +4 -4
  265. package/dist/sources/node.d.ts +4 -4
  266. package/dist/sources/node.js +2 -1
  267. package/dist/sources/node.js.map +1 -1
  268. package/dist/storage/browser.js +1 -0
  269. package/dist/storage/browser.js.map +1 -1
  270. package/dist/storage/index.d.cts +5 -5
  271. package/dist/storage/index.d.ts +5 -5
  272. package/dist/storage/index.js +5 -4
  273. package/dist/storage/node.js +1 -0
  274. package/dist/storage/node.js.map +1 -1
  275. package/dist/store-C-joM4gh.d.ts +123 -0
  276. package/dist/store-CNJwmT-h.d.cts +123 -0
  277. package/dist/testing/index.cjs +1 -0
  278. package/dist/testing/index.cjs.map +1 -1
  279. package/dist/testing/index.d.cts +1 -1
  280. package/dist/testing/index.d.ts +1 -1
  281. package/dist/testing/index.js +3 -2
  282. package/dist/{types-h12mNYbq.d.ts → types-BsJvElYZ.d.ts} +31 -31
  283. package/dist/{types-bNMSWKqF.d.cts → types-CcPIn7sy.d.cts} +31 -31
  284. package/dist/work-item-runtime-C3M79vE9.d.ts +228 -0
  285. package/dist/work-item-runtime-qaVgsL0T.d.cts +228 -0
  286. package/dist/work-queue/index.cjs +1132 -0
  287. package/dist/work-queue/index.cjs.map +1 -0
  288. package/dist/work-queue/index.d.cts +369 -0
  289. package/dist/work-queue/index.d.ts +369 -0
  290. package/dist/work-queue/index.js +1078 -0
  291. package/dist/work-queue/index.js.map +1 -0
  292. package/package.json +266 -2
  293. package/dist/chunk-COHO25CZ.js.map +0 -1
  294. package/dist/chunk-DK554R7P.js.map +0 -1
  295. package/dist/chunk-I3IHOHCJ.js.map +0 -1
  296. package/dist/chunk-RIIOUTGM.js.map +0 -1
  297. package/dist/chunk-SWTLEQL6.js.map +0 -1
  298. /package/dist/{chunk-JR4IKCR2.js.map → chunk-2747WN4Y.js.map} +0 -0
  299. /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
  300. /package/dist/{chunk-DJC4CHLQ.js.map → chunk-43BKLFZU.js.map} +0 -0
  301. /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
  302. /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-CZNV3VXM.js.map} +0 -0
  303. /package/dist/{chunk-JIMUDQN3.js.map → chunk-FBUU43PM.js.map} +0 -0
  304. /package/dist/{chunk-D6BG7U6A.js.map → chunk-IXZBUWSP.js.map} +0 -0
  305. /package/dist/{chunk-PKVBHGBM.js.map → chunk-SS2A464I.js.map} +0 -0
  306. /package/dist/{chunk-G4M3NHRJ.js.map → chunk-V7CIJE4B.js.map} +0 -0
  307. /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
@@ -1,15 +1,16 @@
1
- import { d as Graph } from '../graph-s23RbbFO.cjs';
2
- import { N as Node } from '../types-bNMSWKqF.cjs';
1
+ import { DataIssue } from '../data/index.cjs';
2
+ import { d as Graph } from '../graph-DCEWh4T2.cjs';
3
+ import { N as Node } from '../types-CcPIn7sy.cjs';
4
+ import { L as LockId } from '../messages-CAzUPPJM.cjs';
3
5
  import '../core/index.cjs';
4
- import '../messages-BZqrGGm1.cjs';
5
6
  import '../codec-BB7p8fJc.cjs';
6
- import '../describe-Ciu8SUnN.cjs';
7
+ import '../describe-DYMw_l1C.cjs';
7
8
 
8
9
  /**
9
10
  * Reusable application-infrastructure messaging namespace.
10
11
  *
11
- * Retained root messaging utilities land here only after B63 re-derives them
12
- * onto the D125 package DAG.
12
+ * D279/D282/D284/D285/D276: messageBus is a retained topic-log plus independent
13
+ * subscription-cursor substrate. DynamicHub is intentionally retired; do not add aliases.
13
14
  */
14
15
 
15
16
  interface MessageEnvelope<T = unknown> {
@@ -17,14 +18,11 @@ interface MessageEnvelope<T = unknown> {
17
18
  readonly seq: number;
18
19
  readonly payload: T;
19
20
  readonly key?: string;
21
+ readonly idempotencyKey?: string;
20
22
  readonly timestampMs: number;
23
+ readonly commandId?: string;
21
24
  }
22
- /**
23
- * Minimal JSON Schema vocabulary for cross-graph/topic payload descriptions.
24
- *
25
- * D125/D132 keep this as passive messaging vocabulary: GraphReFly does not ship
26
- * a validator here and does not make schemas protocol messages.
27
- */
25
+ /** Minimal JSON Schema vocabulary for passive topic payload descriptions (D125/D132). */
28
26
  interface JsonSchema {
29
27
  readonly type?: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null" | readonly ("string" | "number" | "integer" | "boolean" | "object" | "array" | "null")[];
30
28
  readonly properties?: Readonly<Record<string, JsonSchema>>;
@@ -38,10 +36,7 @@ interface JsonSchema {
38
36
  readonly description?: string;
39
37
  readonly title?: string;
40
38
  }
41
- /**
42
- * Recommended passive envelope for payloads that cross topic, agent, or graph
43
- * boundaries. It is an application fact shape, not a required protocol type.
44
- */
39
+ /** Passive envelope for payloads that cross topic, agent, or graph boundaries. */
45
40
  interface TopicMessage<T = unknown> {
46
41
  readonly id: string;
47
42
  readonly schema?: JsonSchema;
@@ -49,6 +44,36 @@ interface TopicMessage<T = unknown> {
49
44
  readonly correlationId?: string;
50
45
  readonly payload: T;
51
46
  }
47
+ /** Passive domain event vocabulary for messageBus/eventFlow composition (D329). */
48
+ interface EventMessage<T = unknown> {
49
+ readonly id: string;
50
+ readonly type: string;
51
+ readonly payload: T;
52
+ readonly key?: string;
53
+ readonly subjectId?: string;
54
+ readonly correlationId?: string;
55
+ readonly causationId?: string;
56
+ readonly occurredAtMs?: number;
57
+ readonly actor?: string;
58
+ readonly evidenceRefs?: readonly string[];
59
+ readonly schema?: JsonSchema;
60
+ readonly metadata?: Readonly<Record<string, unknown>>;
61
+ }
62
+ interface EventMessageOptions {
63
+ readonly id: string;
64
+ readonly key?: string;
65
+ readonly subjectId?: string;
66
+ readonly correlationId?: string;
67
+ readonly causationId?: string;
68
+ readonly occurredAtMs?: number;
69
+ readonly actor?: string;
70
+ readonly evidenceRefs?: readonly string[];
71
+ readonly schema?: JsonSchema;
72
+ readonly metadata?: Readonly<Record<string, unknown>>;
73
+ }
74
+ declare function eventMessage<T>(type: string, payload: T, opts: EventMessageOptions): EventMessage<T>;
75
+ declare function isEventMessage(value: unknown): value is EventMessage;
76
+ declare function eventMessageIssue(value: unknown): DataIssue | undefined;
52
77
  declare const PROMPTS_TOPIC = "prompts";
53
78
  declare const RESPONSES_TOPIC = "responses";
54
79
  declare const INJECTIONS_TOPIC = "injections";
@@ -58,178 +83,209 @@ declare const CONTEXT_TOPIC = "context";
58
83
  declare const TODOS_TOPIC = "todos";
59
84
  declare const STANDARD_TOPICS: readonly ["prompts", "responses", "injections", "deferred", "spawns", "context", "todos"];
60
85
  type StandardTopic = (typeof STANDARD_TOPICS)[number];
61
- interface MessageBusEvent<T = unknown> {
62
- readonly kind: "publish" | "complete" | "error";
63
- readonly topic: string;
64
- readonly seq?: number;
65
- readonly payload?: T;
66
- readonly error?: unknown;
86
+ type MessageBusTopicPolicy = "strict" | "create-as-fact";
87
+ interface MessageBusRetentionPolicy {
88
+ /** Count retention. Trimming advances headSeq and never rewrites seq (D284). */
89
+ readonly maxMessages?: number;
67
90
  }
68
- interface MessageBusOptions<TTopic extends string = string> {
69
- readonly topics: readonly TTopic[];
70
- readonly name?: string;
71
- readonly now?: () => number;
91
+ interface MessageBusDedupePolicy {
92
+ /** Duplicate commandId emits status and never publishes a second retained message (D284). */
93
+ readonly commandId?: "status" | "issue";
72
94
  }
73
- interface MessageBus<TTopic extends string = string> {
74
- readonly topics: readonly TTopic[];
75
- topic<T = unknown>(name: TTopic): Node<MessageEnvelope<T>>;
76
- publish<T = unknown>(name: TTopic, payload: T, opts?: {
77
- key?: string;
78
- }): MessageEnvelope<T>;
79
- has(name: string): name is TTopic;
80
- }
81
- interface ToTopicOptions {
82
- readonly name?: string;
83
- readonly keyOf?: (value: unknown) => string | undefined;
84
- }
85
- interface ToTopicBundle<T> {
86
- readonly events: Node<MessageBusEvent<T>>;
87
- }
88
- type DynamicHubUnknownTopicPolicy = "drop" | "error" | "dead-letter" | "create-as-fact";
89
- interface DynamicHubOptions {
95
+ interface MessageBusOptions<TTopic extends string = string> {
96
+ readonly topics?: readonly TTopic[];
90
97
  readonly name?: string;
91
- readonly topics?: readonly string[];
92
- readonly unknownTopic?: DynamicHubUnknownTopicPolicy;
93
- readonly deadLetter?: boolean;
94
- readonly maxTopics?: number;
95
- readonly maxTopicLength?: number;
96
98
  readonly now?: () => number;
99
+ readonly topicPolicy?: MessageBusTopicPolicy;
100
+ readonly retention?: MessageBusRetentionPolicy;
101
+ readonly dedupe?: MessageBusDedupePolicy;
97
102
  }
98
- interface DynamicHubMetadata {
99
- readonly seq: number;
100
- readonly cursor: number;
101
- readonly timestampMs: number;
102
- }
103
- type DynamicHubEventKind = "create" | "delete" | "message" | "subscribe" | "close" | "error" | "dead-letter";
104
- type DynamicHubCommand<T = unknown> = {
105
- readonly kind: "create";
103
+ type MessageBusCommand<T = unknown> = {
104
+ readonly kind: "ensure-topic";
106
105
  readonly topic: string;
107
- readonly key?: string;
108
- readonly payload?: T;
106
+ readonly commandId?: string;
109
107
  } | {
110
- readonly kind: "delete";
108
+ readonly kind: "close-topic";
111
109
  readonly topic: string;
112
- readonly key?: string;
113
- readonly payload?: T;
110
+ readonly commandId?: string;
114
111
  } | {
115
112
  readonly kind: "publish";
116
113
  readonly topic: string;
117
114
  readonly payload: T;
118
115
  readonly key?: string;
116
+ readonly commandId?: string;
117
+ readonly idempotencyKey?: string;
119
118
  } | {
120
- readonly kind: "subscribe";
121
- readonly topic: string;
122
- readonly key?: string;
123
- readonly payload?: T;
119
+ readonly kind: "topic-policy";
120
+ readonly topicPolicy: MessageBusTopicPolicy;
121
+ readonly commandId?: string;
124
122
  } | {
125
- readonly kind: "close";
126
- readonly key?: string;
127
- readonly payload?: T;
128
- };
129
- interface DynamicHubStatus {
130
- readonly open: boolean;
131
- readonly topics: readonly string[];
132
- readonly seq: number;
133
- readonly cursor: number;
134
- readonly lastEventKind?: DynamicHubEventKind;
135
- }
136
- interface DynamicHubEventFrame {
137
- readonly meta: DynamicHubMetadata;
138
- readonly status: DynamicHubStatus;
139
- }
140
- type DynamicHubEvent<T = unknown> = DynamicHubEventFrame & ({
141
- readonly kind: "create";
123
+ readonly kind: "ack";
142
124
  readonly topic: string;
143
- readonly key?: string;
144
- readonly payload?: T;
145
- } | {
146
- readonly kind: "delete";
147
- readonly topic: string;
148
- readonly key?: string;
149
- readonly payload?: T;
125
+ readonly subscriptionId: string;
126
+ readonly seq: number;
127
+ readonly commandId?: string;
150
128
  } | {
151
- readonly kind: "message";
129
+ readonly kind: "seek";
152
130
  readonly topic: string;
153
- readonly payload: T;
154
- readonly key?: string;
131
+ readonly subscriptionId: string;
132
+ readonly nextSeq: number;
133
+ readonly commandId?: string;
155
134
  } | {
156
- readonly kind: "subscribe";
135
+ readonly kind: "close-subscription";
157
136
  readonly topic: string;
158
- readonly key?: string;
159
- readonly payload?: T;
160
- } | {
161
- readonly kind: "close";
162
- readonly key?: string;
163
- readonly payload?: T;
164
- } | {
165
- readonly kind: "error";
166
- readonly topic?: string;
167
- readonly error: string;
168
- readonly command: unknown;
169
- } | {
170
- readonly kind: "dead-letter";
137
+ readonly subscriptionId: string;
138
+ readonly commandId?: string;
139
+ };
140
+ type MessageBusMessage<T = unknown> = MessageEnvelope<T>;
141
+ interface MessageBusStatus {
142
+ readonly kind: "topic-created" | "topic-closed" | "message-published" | "retention-trimmed" | "duplicate-command" | "subscription-acked" | "subscription-sought" | "subscription-closed" | "command-rejected" | "projection-ready" | "projection-partial";
171
143
  readonly topic?: string;
172
- readonly reason: string;
173
- readonly command: unknown;
174
- });
175
- interface DynamicHubError {
144
+ readonly seq?: number;
145
+ readonly headSeq?: number;
146
+ readonly subscriptionId?: string;
147
+ readonly nextSeq?: number;
148
+ readonly commandId?: string;
149
+ readonly issueCode?: string;
150
+ readonly timestampMs: number;
151
+ readonly details?: unknown;
152
+ }
153
+ interface MessageBusCatalogEntry {
154
+ readonly topic: string;
155
+ readonly closed: boolean;
156
+ readonly headSeq: number;
157
+ readonly nextSeq: number;
158
+ readonly messageCount: number;
159
+ }
160
+ interface MessageBusCatalogPage {
161
+ readonly topics: readonly MessageBusCatalogEntry[];
162
+ readonly nextAfterTopic?: string;
163
+ readonly hasMore: boolean;
164
+ }
165
+ interface MessageBusDeadLetterEntry<T = unknown> {
166
+ readonly entrySeq: number;
176
167
  readonly topic?: string;
177
- readonly error: string;
178
- readonly command: unknown;
179
- readonly meta: DynamicHubMetadata;
168
+ readonly command?: MessageBusCommand<T>;
169
+ readonly message?: MessageBusMessage<T>;
170
+ readonly issue: DataIssue;
171
+ readonly timestampMs: number;
172
+ }
173
+ interface MessageBusDeadLetterPage<T = unknown> {
174
+ readonly entries: readonly MessageBusDeadLetterEntry<T>[];
175
+ readonly nextAfterEntrySeq?: number;
176
+ readonly hasMore: boolean;
177
+ }
178
+ interface MessageBusTopicPage<T = unknown> {
179
+ readonly topic: string;
180
+ readonly messages: readonly MessageBusMessage<T>[];
181
+ readonly fromSeq: number;
182
+ readonly throughSeq?: number;
183
+ readonly nextAfterSeq?: number;
184
+ readonly hasMore: boolean;
180
185
  }
181
- interface DynamicHubDeadLetter {
186
+ interface MessageBusCursor {
187
+ readonly topic: string;
188
+ readonly subscriptionId: string;
189
+ readonly nextSeq: number;
190
+ readonly closed: boolean;
191
+ readonly retentionGap: boolean;
192
+ readonly headSeq: number;
193
+ }
194
+ interface MessageBusAvailablePage<T = unknown> {
195
+ readonly topic: string;
196
+ readonly subscriptionId: string;
197
+ readonly cursor: MessageBusCursor;
198
+ readonly messages: readonly MessageBusMessage<T>[];
199
+ readonly fromSeq: number;
200
+ readonly throughSeq?: number;
201
+ readonly nextAfterSeq?: number;
202
+ readonly hasMore: boolean;
203
+ }
204
+ interface MessageBusPageParams {
205
+ readonly limit?: number;
206
+ }
207
+ interface MessageBusCatalogParams extends MessageBusPageParams {
208
+ readonly afterTopic?: string;
209
+ readonly includeClosed?: boolean;
210
+ }
211
+ interface MessageBusDeadLetterParams extends MessageBusPageParams {
212
+ readonly afterEntrySeq?: number;
182
213
  readonly topic?: string;
183
- readonly reason: string;
184
- readonly command: unknown;
185
- readonly meta: DynamicHubMetadata;
186
- }
187
- interface DynamicHub<T = unknown> {
188
- readonly command: Node<DynamicHubCommand<T>>;
189
- readonly events: Node<DynamicHubEvent<T>>;
190
- readonly status: Node<DynamicHubStatus>;
191
- readonly errors: Node<DynamicHubError>;
192
- readonly deadLetter?: Node<DynamicHubDeadLetter>;
193
- create(topic: string, opts?: {
194
- key?: string;
195
- payload?: T;
196
- }): DynamicHubCommand<T>;
197
- delete(topic: string, opts?: {
198
- key?: string;
199
- payload?: T;
200
- }): DynamicHubCommand<T>;
201
- publish(topic: string, payload: T, opts?: {
202
- key?: string;
203
- }): DynamicHubCommand<T>;
204
- subscribeTopic(topic: string, opts?: {
205
- key?: string;
206
- payload?: T;
207
- }): DynamicHubCommand<T>;
214
+ readonly code?: string;
215
+ }
216
+ interface MessageBusTopicParams extends MessageBusPageParams {
217
+ readonly afterSeq?: number;
218
+ }
219
+ interface MessageBusAvailableParams extends MessageBusPageParams {
220
+ readonly afterSeq?: number;
221
+ }
222
+ interface MessageBusPullProjection<TPage> {
223
+ readonly snapshot: Node<TPage>;
224
+ readonly snapshotPullId: LockId;
225
+ readonly status: Node<MessageBusStatus>;
226
+ readonly issues: Node<DataIssue>;
227
+ }
228
+ interface MessageBusTopicProjection<T = unknown> extends MessageBusPullProjection<MessageBusTopicPage<T>> {
229
+ }
230
+ interface MessageBusSubscription<T = unknown> {
231
+ readonly available: Node<MessageBusAvailablePage<T>>;
232
+ readonly availablePullId: LockId;
233
+ readonly cursor: Node<MessageBusCursor>;
234
+ readonly status: Node<MessageBusStatus>;
235
+ readonly issues: Node<DataIssue>;
236
+ ack(seq: number, opts?: {
237
+ commandId?: string;
238
+ }): MessageBusCommand;
239
+ seek(nextSeq: number, opts?: {
240
+ commandId?: string;
241
+ }): MessageBusCommand;
208
242
  close(opts?: {
243
+ commandId?: string;
244
+ }): MessageBusCommand;
245
+ }
246
+ interface MessageBus<TTopic extends string = string> {
247
+ readonly commands: Node<MessageBusCommand>;
248
+ readonly messages: Node<MessageBusMessage>;
249
+ readonly status: Node<MessageBusStatus>;
250
+ readonly issues: Node<DataIssue>;
251
+ ensureTopic(topic: TTopic | string, opts?: {
252
+ commandId?: string;
253
+ }): MessageBusCommand;
254
+ closeTopic(topic: TTopic | string, opts?: {
255
+ commandId?: string;
256
+ }): MessageBusCommand;
257
+ publish<T = unknown>(topic: TTopic | string, payload: T, opts?: {
209
258
  key?: string;
210
- payload?: T;
211
- }): DynamicHubCommand<T>;
259
+ commandId?: string;
260
+ idempotencyKey?: string;
261
+ }): MessageBusCommand<T>;
262
+ topic<T = unknown>(topic: TTopic | string, opts?: {
263
+ name?: string;
264
+ }): MessageBusTopicProjection<T>;
265
+ catalog(opts?: {
266
+ name?: string;
267
+ }): MessageBusPullProjection<MessageBusCatalogPage>;
268
+ deadLetter<T = unknown>(opts?: {
269
+ name?: string;
270
+ }): MessageBusPullProjection<MessageBusDeadLetterPage<T>>;
271
+ subscription<T = unknown>(opts: {
272
+ topic: TTopic | string;
273
+ subscriptionId: string;
274
+ from?: "earliest" | "latest" | number;
275
+ name?: string;
276
+ }): MessageBusSubscription<T>;
212
277
  }
213
- interface ToHubTopicOptions<T> {
278
+ interface ToTopicOptions {
214
279
  readonly name?: string;
215
- readonly keyOf?: (value: T) => string | undefined;
280
+ readonly keyOf?: (value: unknown) => string | undefined;
281
+ readonly commandIdOf?: (value: unknown) => string | undefined;
216
282
  }
217
- interface ToHubTopicBundle<T> {
218
- readonly commands: Node<DynamicHubCommand<T>>;
283
+ interface ToTopicBundle<T> {
284
+ readonly commands: Node<MessageBusCommand<T>>;
285
+ release(): void;
219
286
  }
220
- declare function messageBus<TTopic extends string>(graph: Graph, opts: MessageBusOptions<TTopic>): MessageBus<TTopic>;
221
- /**
222
- * D135 dynamic messaging hub: topic lifecycle is DATA facts over fixed graph-visible
223
- * command/event/status/error nodes. Topic keys never create or delete graph nodes.
224
- */
225
- declare function dynamicHub<T = unknown>(graph: Graph, opts?: DynamicHubOptions): DynamicHub<T>;
226
- /** Static D135 projection over hub event facts for one topic key; no topic node is created. */
227
- declare function fromHubTopic<T = unknown>(hub: DynamicHub<unknown>, topic: string, opts?: {
228
- name?: string;
229
- }): Node<MessageEnvelope<T>>;
230
- /** Static D135 command helper: source DATA becomes publish command facts for one topic key. */
231
- declare function toHubTopic<T>(graph: Graph, source: Node<T>, hub: DynamicHub<unknown>, topic: string, opts?: ToHubTopicOptions<T>): ToHubTopicBundle<T>;
232
- declare function fromTopic<T = unknown, TTopic extends string = string>(bus: MessageBus<TTopic>, topic: TTopic): Node<MessageEnvelope<T>>;
233
- declare function toTopic<T, TTopic extends string>(graph: Graph, source: Node<T>, bus: MessageBus<TTopic>, topic: TTopic, opts?: ToTopicOptions): ToTopicBundle<T>;
287
+ declare function messageBus<TTopic extends string>(graph: Graph, opts?: MessageBusOptions<TTopic>): MessageBus<TTopic>;
288
+ declare function fromTopic<T = unknown, TTopic extends string = string>(bus: MessageBus<TTopic>, topic: TTopic | string): Node<MessageBusTopicPage<T>>;
289
+ declare function toTopic<T, TTopic extends string>(graph: Graph, source: Node<T>, bus: MessageBus<TTopic>, topic: TTopic | string, opts?: ToTopicOptions): ToTopicBundle<T>;
234
290
 
235
- export { CONTEXT_TOPIC, DEFERRED_TOPIC, type DynamicHub, type DynamicHubCommand, type DynamicHubDeadLetter, type DynamicHubError, type DynamicHubEvent, type DynamicHubEventKind, type DynamicHubMetadata, type DynamicHubOptions, type DynamicHubStatus, type DynamicHubUnknownTopicPolicy, INJECTIONS_TOPIC, type JsonSchema, type MessageBus, type MessageBusEvent, type MessageBusOptions, type MessageEnvelope, PROMPTS_TOPIC, RESPONSES_TOPIC, SPAWNS_TOPIC, STANDARD_TOPICS, type StandardTopic, TODOS_TOPIC, type ToHubTopicBundle, type ToHubTopicOptions, type ToTopicBundle, type ToTopicOptions, type TopicMessage, dynamicHub, fromHubTopic, fromTopic, messageBus, toHubTopic, toTopic };
291
+ export { CONTEXT_TOPIC, DEFERRED_TOPIC, type EventMessage, type EventMessageOptions, INJECTIONS_TOPIC, type JsonSchema, type MessageBus, type MessageBusAvailablePage, type MessageBusAvailableParams, type MessageBusCatalogEntry, type MessageBusCatalogPage, type MessageBusCatalogParams, type MessageBusCommand, type MessageBusCursor, type MessageBusDeadLetterEntry, type MessageBusDeadLetterPage, type MessageBusDeadLetterParams, type MessageBusDedupePolicy, type MessageBusMessage, type MessageBusOptions, type MessageBusPageParams, type MessageBusPullProjection, type MessageBusRetentionPolicy, type MessageBusStatus, type MessageBusSubscription, type MessageBusTopicPage, type MessageBusTopicParams, type MessageBusTopicPolicy, type MessageBusTopicProjection, type MessageEnvelope, PROMPTS_TOPIC, RESPONSES_TOPIC, SPAWNS_TOPIC, STANDARD_TOPICS, type StandardTopic, TODOS_TOPIC, type ToTopicBundle, type ToTopicOptions, type TopicMessage, eventMessage, eventMessageIssue, fromTopic, isEventMessage, messageBus, toTopic };