@graphrefly/ts 0.0.1 → 0.0.2

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 (330) hide show
  1. package/dist/actions-types-CSC3NMDl.d.ts +657 -0
  2. package/dist/actions-types-wl9Mgkmr.d.cts +657 -0
  3. package/dist/adapters/index.cjs +5157 -2951
  4. package/dist/adapters/index.cjs.map +1 -1
  5. package/dist/adapters/index.d.cts +207 -70
  6. package/dist/adapters/index.d.ts +207 -70
  7. package/dist/adapters/index.js +3738 -1688
  8. package/dist/adapters/index.js.map +1 -1
  9. package/dist/adapters/nestjs/microservices.cjs +841 -0
  10. package/dist/adapters/nestjs/microservices.cjs.map +1 -0
  11. package/dist/adapters/nestjs/microservices.d.cts +45 -0
  12. package/dist/adapters/nestjs/microservices.d.ts +45 -0
  13. package/dist/adapters/nestjs/microservices.js +206 -0
  14. package/dist/adapters/nestjs/microservices.js.map +1 -0
  15. package/dist/adapters/nestjs/native.cjs +1391 -0
  16. package/dist/adapters/nestjs/native.cjs.map +1 -0
  17. package/dist/adapters/nestjs/native.d.cts +111 -0
  18. package/dist/adapters/nestjs/native.d.ts +111 -0
  19. package/dist/adapters/nestjs/native.js +577 -0
  20. package/dist/adapters/nestjs/native.js.map +1 -0
  21. package/dist/adapters/nestjs/websockets.cjs +924 -0
  22. package/dist/adapters/nestjs/websockets.cjs.map +1 -0
  23. package/dist/adapters/nestjs/websockets.d.cts +47 -0
  24. package/dist/adapters/nestjs/websockets.d.ts +47 -0
  25. package/dist/adapters/nestjs/websockets.js +286 -0
  26. package/dist/adapters/nestjs/websockets.js.map +1 -0
  27. package/dist/adapters/nestjs.cjs +1085 -0
  28. package/dist/adapters/nestjs.cjs.map +1 -0
  29. package/dist/adapters/nestjs.d.cts +385 -0
  30. package/dist/adapters/nestjs.d.ts +385 -0
  31. package/dist/adapters/nestjs.js +112 -0
  32. package/dist/adapters/nestjs.js.map +1 -0
  33. package/dist/adapters/observe-storage.d.cts +3 -3
  34. package/dist/adapters/observe-storage.d.ts +3 -3
  35. package/dist/adapters/observe-storage.js +4 -4
  36. package/dist/adapters/react.cjs.map +1 -1
  37. package/dist/adapters/react.d.cts +2 -2
  38. package/dist/adapters/react.d.ts +2 -2
  39. package/dist/adapters/react.js +1 -1
  40. package/dist/adapters/solid.cjs.map +1 -1
  41. package/dist/adapters/solid.d.cts +2 -2
  42. package/dist/adapters/solid.d.ts +2 -2
  43. package/dist/adapters/solid.js +1 -1
  44. package/dist/adapters/svelte.cjs.map +1 -1
  45. package/dist/adapters/svelte.d.cts +2 -2
  46. package/dist/adapters/svelte.d.ts +2 -2
  47. package/dist/adapters/svelte.js +1 -1
  48. package/dist/adapters/vue.cjs.map +1 -1
  49. package/dist/adapters/vue.d.cts +2 -2
  50. package/dist/adapters/vue.d.ts +2 -2
  51. package/dist/adapters/vue.js +1 -1
  52. package/dist/{agent-runtime-DZTJ3C-p.d.cts → agent-runtime-types-core-CaXfKNtY.d.cts} +171 -320
  53. package/dist/{agent-runtime-BesGDZcB.d.ts → agent-runtime-types-core-hU299uIC.d.ts} +171 -320
  54. package/dist/agent-runtime-types-tool-BEpSINol.d.ts +695 -0
  55. package/dist/agent-runtime-types-tool-DninPEzk.d.cts +695 -0
  56. package/dist/agentic-memory-retention-BmGX368S.d.ts +14 -0
  57. package/dist/agentic-memory-retention-Ih1qhX9Z.d.cts +14 -0
  58. package/dist/{agentic-memory-BmRCvh0d.d.ts → agentic-memory-types-CVSUS6XR.d.ts} +13 -57
  59. package/dist/{agentic-memory-DfuVZ-lY.d.cts → agentic-memory-types-FnnYlVUs.d.cts} +13 -57
  60. package/dist/{capability-admission-g0mn9hpq.d.ts → capability-admission-BW2CziT6.d.ts} +3 -3
  61. package/dist/{capability-admission-B0BzqAm5.d.cts → capability-admission-lwSecxXs.d.cts} +3 -3
  62. package/dist/chunk-2KUAG2GZ.js +9693 -0
  63. package/dist/chunk-2KUAG2GZ.js.map +1 -0
  64. package/dist/chunk-2NJP6GO4.js +1320 -0
  65. package/dist/chunk-2NJP6GO4.js.map +1 -0
  66. package/dist/{chunk-YDSIVHRR.js → chunk-4NWSNI4K.js} +1598 -1584
  67. package/dist/chunk-4NWSNI4K.js.map +1 -0
  68. package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
  69. package/dist/chunk-6E76H4OU.js +132 -0
  70. package/dist/chunk-6E76H4OU.js.map +1 -0
  71. package/dist/chunk-7GOTIIQ7.js +819 -0
  72. package/dist/chunk-7GOTIIQ7.js.map +1 -0
  73. package/dist/{chunk-IXZBUWSP.js → chunk-7HZRJMN6.js} +2 -2
  74. package/dist/{chunk-SS2A464I.js → chunk-CJIFGJQG.js} +3 -3
  75. package/dist/{chunk-V7CIJE4B.js → chunk-CX6B6PO2.js} +92 -9
  76. package/dist/chunk-CX6B6PO2.js.map +1 -0
  77. package/dist/{chunk-FBUU43PM.js → chunk-E4QCH32M.js} +448 -446
  78. package/dist/chunk-E4QCH32M.js.map +1 -0
  79. package/dist/{chunk-HKK2JD7Z.js → chunk-ECURQ3HD.js} +12 -125
  80. package/dist/chunk-ECURQ3HD.js.map +1 -0
  81. package/dist/{chunk-3JR3EDB2.js → chunk-EOKT4QFF.js} +121 -115
  82. package/dist/chunk-EOKT4QFF.js.map +1 -0
  83. package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
  84. package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
  85. package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
  86. package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
  87. package/dist/chunk-K7FB3JTD.js.map +1 -0
  88. package/dist/{chunk-H75VXTGT.js → chunk-L6LDXRWE.js} +3 -3
  89. package/dist/{chunk-H75VXTGT.js.map → chunk-L6LDXRWE.js.map} +1 -1
  90. package/dist/{chunk-YXMZ2N6J.js → chunk-M7J6Z4IJ.js} +1071 -1025
  91. package/dist/chunk-M7J6Z4IJ.js.map +1 -0
  92. package/dist/chunk-MQEQMS7B.js +1009 -0
  93. package/dist/chunk-MQEQMS7B.js.map +1 -0
  94. package/dist/chunk-MTELVIYR.js +1421 -0
  95. package/dist/chunk-MTELVIYR.js.map +1 -0
  96. package/dist/{chunk-QFY4AFY4.js → chunk-PVC7WDKI.js} +58 -52
  97. package/dist/chunk-PVC7WDKI.js.map +1 -0
  98. package/dist/{chunk-VTHLCFN4.js → chunk-RAHNUYA5.js} +2 -2
  99. package/dist/{chunk-XKXWK2KP.js → chunk-SHZDP2MQ.js} +1157 -1021
  100. package/dist/chunk-SHZDP2MQ.js.map +1 -0
  101. package/dist/{chunk-CZNV3VXM.js → chunk-SIDJO2T4.js} +11 -11
  102. package/dist/chunk-STXRMPW4.js +4131 -0
  103. package/dist/chunk-STXRMPW4.js.map +1 -0
  104. package/dist/{chunk-2747WN4Y.js → chunk-TPND5MJS.js} +3 -3
  105. package/dist/chunk-TQPCAIQI.js +612 -0
  106. package/dist/chunk-TQPCAIQI.js.map +1 -0
  107. package/dist/{chunk-43BKLFZU.js → chunk-YDWBXXQZ.js} +10 -10
  108. package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
  109. package/dist/composition/index.cjs +1228 -1076
  110. package/dist/composition/index.cjs.map +1 -1
  111. package/dist/composition/index.d.cts +3 -3
  112. package/dist/composition/index.d.ts +3 -3
  113. package/dist/composition/index.js +4 -4
  114. package/dist/core/index.cjs +1198 -1046
  115. package/dist/core/index.cjs.map +1 -1
  116. package/dist/core/index.d.cts +1 -1
  117. package/dist/core/index.d.ts +1 -1
  118. package/dist/core/index.js +2 -2
  119. package/dist/cqrs/index.d.cts +3 -3
  120. package/dist/cqrs/index.d.ts +3 -3
  121. package/dist/cqrs/messaging.d.cts +4 -4
  122. package/dist/cqrs/messaging.d.ts +4 -4
  123. package/dist/cqrs/work-queue.d.cts +5 -5
  124. package/dist/cqrs/work-queue.d.ts +5 -5
  125. package/dist/data-structures/index.cjs +1226 -1074
  126. package/dist/data-structures/index.cjs.map +1 -1
  127. package/dist/data-structures/index.d.cts +8 -7
  128. package/dist/data-structures/index.d.ts +8 -7
  129. package/dist/data-structures/index.js +6 -5
  130. package/dist/{describe-BpyJuWkw.d.ts → describe-B_A5fbXH.d.ts} +1 -1
  131. package/dist/{describe-DYMw_l1C.d.cts → describe-CQRrkv-Q.d.cts} +1 -1
  132. package/dist/executors/tool-provider-adapters.cjs +3091 -0
  133. package/dist/executors/tool-provider-adapters.cjs.map +1 -0
  134. package/dist/executors/tool-provider-adapters.d.cts +174 -0
  135. package/dist/executors/tool-provider-adapters.d.ts +174 -0
  136. package/dist/executors/tool-provider-adapters.js +1336 -0
  137. package/dist/executors/tool-provider-adapters.js.map +1 -0
  138. package/dist/executors/tool-provider-runtime.cjs +5178 -0
  139. package/dist/executors/tool-provider-runtime.cjs.map +1 -0
  140. package/dist/executors/tool-provider-runtime.d.cts +17 -0
  141. package/dist/executors/tool-provider-runtime.d.ts +17 -0
  142. package/dist/executors/tool-provider-runtime.js +15 -0
  143. package/dist/executors/tool-provider-runtime.js.map +1 -0
  144. package/dist/executors/tool-provider.cjs +6392 -0
  145. package/dist/executors/tool-provider.cjs.map +1 -0
  146. package/dist/executors/tool-provider.d.cts +60 -0
  147. package/dist/executors/tool-provider.d.ts +60 -0
  148. package/dist/executors/tool-provider.js +89 -0
  149. package/dist/executors/tool-provider.js.map +1 -0
  150. package/dist/executors/work-queue.d.cts +6 -6
  151. package/dist/executors/work-queue.d.ts +6 -6
  152. package/dist/graph/index.cjs +1499 -1341
  153. package/dist/graph/index.cjs.map +1 -1
  154. package/dist/graph/index.d.cts +9 -8
  155. package/dist/graph/index.d.ts +9 -8
  156. package/dist/graph/index.js +23 -22
  157. package/dist/{graph-DCEWh4T2.d.cts → graph-CWK3HLPB.d.cts} +133 -131
  158. package/dist/{graph-D-1-SQeC.d.ts → graph-ho5sotHP.d.ts} +133 -131
  159. package/dist/{index-Bmxeu0nK.d.ts → index-CQWcE0Dw.d.ts} +18 -4
  160. package/dist/{index-72VZC0-E.d.cts → index-DHA1i67c.d.cts} +18 -4
  161. package/dist/index.cjs +3397 -3140
  162. package/dist/index.cjs.map +1 -1
  163. package/dist/index.d.cts +12 -9
  164. package/dist/index.d.ts +12 -9
  165. package/dist/index.js +110 -109
  166. package/dist/inspection/boundary.d.cts +4 -4
  167. package/dist/inspection/boundary.d.ts +4 -4
  168. package/dist/measurements-C0mAvWU1.d.cts +164 -0
  169. package/dist/measurements-OMpCeBwh.d.ts +164 -0
  170. package/dist/messaging/index.cjs +57 -51
  171. package/dist/messaging/index.cjs.map +1 -1
  172. package/dist/messaging/index.d.cts +11 -276
  173. package/dist/messaging/index.d.ts +11 -276
  174. package/dist/messaging/index.js +1 -1
  175. package/dist/operators/index.cjs +1228 -1076
  176. package/dist/operators/index.cjs.map +1 -1
  177. package/dist/operators/index.d.cts +5 -5
  178. package/dist/operators/index.d.ts +5 -5
  179. package/dist/operators/index.js +5 -5
  180. package/dist/orchestration/index.cjs +8844 -6071
  181. package/dist/orchestration/index.cjs.map +1 -1
  182. package/dist/orchestration/index.d.cts +171 -224
  183. package/dist/orchestration/index.d.ts +171 -224
  184. package/dist/orchestration/index.js +42 -991
  185. package/dist/orchestration/index.js.map +1 -1
  186. package/dist/orchestration/messaging.d.cts +5 -8
  187. package/dist/orchestration/messaging.d.ts +5 -8
  188. package/dist/orchestration/work-queue.cjs +1243 -5
  189. package/dist/orchestration/work-queue.cjs.map +1 -1
  190. package/dist/orchestration/work-queue.d.cts +121 -10
  191. package/dist/orchestration/work-queue.d.ts +121 -10
  192. package/dist/orchestration/work-queue.js +1067 -4
  193. package/dist/orchestration/work-queue.js.map +1 -1
  194. package/dist/patterns/event-flow.cjs +6 -20
  195. package/dist/patterns/event-flow.cjs.map +1 -1
  196. package/dist/patterns/event-flow.d.cts +4 -4
  197. package/dist/patterns/event-flow.d.ts +4 -4
  198. package/dist/patterns/event-flow.js +2 -2
  199. package/dist/patterns/index.cjs +453 -465
  200. package/dist/patterns/index.cjs.map +1 -1
  201. package/dist/patterns/index.d.cts +6 -5
  202. package/dist/patterns/index.d.ts +6 -5
  203. package/dist/patterns/index.js +3 -3
  204. package/dist/process-types-C9uMYz3i.d.ts +200 -0
  205. package/dist/process-types-h3uRlzDc.d.cts +200 -0
  206. package/dist/{reactive-collection-DNV0-gFi.d.cts → reactive-collection-B9R0Bl1P.d.cts} +4 -34
  207. package/dist/{reactive-collection-BAmfrGjd.d.ts → reactive-collection-BXFrH0U2.d.ts} +4 -34
  208. package/dist/{reactive-collection-storage-BNEldDyi.d.cts → reactive-collection-storage-BLGv8Xp8.d.cts} +5 -5
  209. package/dist/{reactive-collection-storage-YZsAQsWK.d.ts → reactive-collection-storage-a4zD3665.d.ts} +5 -5
  210. package/dist/{reactive-map-DRD1LJ2H.d.cts → reactive-map-C_8sOfdS.d.cts} +3 -2
  211. package/dist/{reactive-map-EsDiCmJk.d.ts → reactive-map-jle5dnok.d.ts} +3 -2
  212. package/dist/render/index.d.cts +2 -2
  213. package/dist/render/index.d.ts +2 -2
  214. package/dist/scheduled-readiness-5rwQlyjV.d.ts +91 -0
  215. package/dist/scheduled-readiness-DpRY8jI0.d.cts +91 -0
  216. package/dist/semantic-memory-graph-C2ZUwIlq.d.ts +30 -0
  217. package/dist/semantic-memory-graph-DlZBD_Eu.d.cts +30 -0
  218. package/dist/{semantic-memory-graph-DKuNzuWw.d.cts → semantic-memory-graph-types-BvzdqmkY.d.cts} +2 -28
  219. package/dist/{semantic-memory-graph-uwbwJdhe.d.ts → semantic-memory-graph-types-Ci-OtahO.d.ts} +2 -28
  220. package/dist/solutions/index.cjs +6353 -6169
  221. package/dist/solutions/index.cjs.map +1 -1
  222. package/dist/solutions/index.d.cts +12 -10
  223. package/dist/solutions/index.d.ts +12 -10
  224. package/dist/solutions/index.js +5 -5
  225. package/dist/solutions/reactive-layout/browser/index.cjs +116 -108
  226. package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -1
  227. package/dist/solutions/reactive-layout/browser/index.d.cts +4 -4
  228. package/dist/solutions/reactive-layout/browser/index.d.ts +4 -4
  229. package/dist/solutions/reactive-layout/browser/index.js +3 -3
  230. package/dist/solutions/reactive-layout/index.cjs +3578 -3350
  231. package/dist/solutions/reactive-layout/index.cjs.map +1 -1
  232. package/dist/solutions/reactive-layout/index.d.cts +32 -576
  233. package/dist/solutions/reactive-layout/index.d.ts +32 -576
  234. package/dist/solutions/reactive-layout/index.js +65 -5
  235. package/dist/solutions/reactive-layout/node-canvas/index.cjs +127 -117
  236. package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -1
  237. package/dist/solutions/reactive-layout/node-canvas/index.d.cts +4 -4
  238. package/dist/solutions/reactive-layout/node-canvas/index.d.ts +4 -4
  239. package/dist/solutions/reactive-layout/node-canvas/index.js +3 -3
  240. package/dist/solutions/reactive-layout/react-native/index.cjs +127 -117
  241. package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -1
  242. package/dist/solutions/reactive-layout/react-native/index.d.cts +4 -4
  243. package/dist/solutions/reactive-layout/react-native/index.d.ts +4 -4
  244. package/dist/solutions/reactive-layout/react-native/index.js +3 -3
  245. package/dist/solutions/reactive-layout/skia/index.cjs +127 -117
  246. package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -1
  247. package/dist/solutions/reactive-layout/skia/index.d.cts +4 -4
  248. package/dist/solutions/reactive-layout/skia/index.d.ts +4 -4
  249. package/dist/solutions/reactive-layout/skia/index.js +3 -3
  250. package/dist/solutions/work-item/actions.cjs +1609 -1428
  251. package/dist/solutions/work-item/actions.cjs.map +1 -1
  252. package/dist/solutions/work-item/actions.d.cts +23 -184
  253. package/dist/solutions/work-item/actions.d.ts +23 -184
  254. package/dist/solutions/work-item/actions.js +1558 -934
  255. package/dist/solutions/work-item/actions.js.map +1 -1
  256. package/dist/solutions/work-item/scheduling.cjs +9181 -1838
  257. package/dist/solutions/work-item/scheduling.cjs.map +1 -1
  258. package/dist/solutions/work-item/scheduling.d.cts +1763 -328
  259. package/dist/solutions/work-item/scheduling.d.ts +1763 -328
  260. package/dist/solutions/work-item/scheduling.js +117 -3
  261. package/dist/solutions/work-item/work-queue.d.cts +7 -7
  262. package/dist/solutions/work-item/work-queue.d.ts +7 -7
  263. package/dist/sources/browser.cjs +1318 -1083
  264. package/dist/sources/browser.cjs.map +1 -1
  265. package/dist/sources/browser.d.cts +4 -4
  266. package/dist/sources/browser.d.ts +4 -4
  267. package/dist/sources/browser.js +4 -4
  268. package/dist/sources/index.cjs +1318 -1083
  269. package/dist/sources/index.cjs.map +1 -1
  270. package/dist/sources/index.d.cts +4 -4
  271. package/dist/sources/index.d.ts +4 -4
  272. package/dist/sources/index.js +4 -4
  273. package/dist/sources/node.d.cts +3 -3
  274. package/dist/sources/node.d.ts +3 -3
  275. package/dist/storage/browser.cjs +16 -0
  276. package/dist/storage/browser.cjs.map +1 -1
  277. package/dist/storage/browser.js +3 -3
  278. package/dist/storage/index.cjs +16 -0
  279. package/dist/storage/index.cjs.map +1 -1
  280. package/dist/storage/index.d.cts +5 -4
  281. package/dist/storage/index.d.ts +5 -4
  282. package/dist/storage/index.js +6 -6
  283. package/dist/storage/node.cjs +16 -0
  284. package/dist/storage/node.cjs.map +1 -1
  285. package/dist/storage/node.js +3 -3
  286. package/dist/{store-C-joM4gh.d.ts → store-BmtEs9mG.d.ts} +1 -1
  287. package/dist/{store-CNJwmT-h.d.cts → store-PAAsYvML.d.cts} +1 -1
  288. package/dist/types-BRNKoFHj.d.ts +357 -0
  289. package/dist/{types-CcPIn7sy.d.cts → types-BS6CyR-x.d.cts} +27 -108
  290. package/dist/types-BWK2ay3e.d.cts +457 -0
  291. package/dist/types-BXKSAoE1.d.cts +357 -0
  292. package/dist/types-BaPpZItj.d.ts +457 -0
  293. package/dist/types-BhveCMg5.d.cts +274 -0
  294. package/dist/{types-BsJvElYZ.d.ts → types-C9NOgNJw.d.ts} +27 -108
  295. package/dist/types-CTsQ8Ww4.d.ts +274 -0
  296. package/dist/types-DL_05n2M.d.ts +34 -0
  297. package/dist/types-XDoqxYO9.d.cts +34 -0
  298. package/dist/{work-item-runtime-C3M79vE9.d.ts → work-item-runtime-types-BqtWnSCS.d.ts} +3 -93
  299. package/dist/{work-item-runtime-qaVgsL0T.d.cts → work-item-runtime-types-CHO03AKh.d.cts} +3 -93
  300. package/dist/work-queue/index.cjs +957 -953
  301. package/dist/work-queue/index.cjs.map +1 -1
  302. package/dist/work-queue/index.d.cts +9 -357
  303. package/dist/work-queue/index.d.ts +9 -357
  304. package/dist/work-queue/index.js +957 -953
  305. package/dist/work-queue/index.js.map +1 -1
  306. package/package.json +603 -513
  307. package/dist/chunk-3JR3EDB2.js.map +0 -1
  308. package/dist/chunk-4VLAQHZI.js.map +0 -1
  309. package/dist/chunk-6XAIOL3X.js +0 -2407
  310. package/dist/chunk-6XAIOL3X.js.map +0 -1
  311. package/dist/chunk-FBUU43PM.js.map +0 -1
  312. package/dist/chunk-HKK2JD7Z.js.map +0 -1
  313. package/dist/chunk-PC3BTTBE.js +0 -3217
  314. package/dist/chunk-PC3BTTBE.js.map +0 -1
  315. package/dist/chunk-QFY4AFY4.js.map +0 -1
  316. package/dist/chunk-V7CIJE4B.js.map +0 -1
  317. package/dist/chunk-XKXWK2KP.js.map +0 -1
  318. package/dist/chunk-YDSIVHRR.js.map +0 -1
  319. package/dist/chunk-YXMZ2N6J.js.map +0 -1
  320. /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
  321. /package/dist/{chunk-IXZBUWSP.js.map → chunk-7HZRJMN6.js.map} +0 -0
  322. /package/dist/{chunk-SS2A464I.js.map → chunk-CJIFGJQG.js.map} +0 -0
  323. /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
  324. /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
  325. /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
  326. /package/dist/{chunk-VTHLCFN4.js.map → chunk-RAHNUYA5.js.map} +0 -0
  327. /package/dist/{chunk-CZNV3VXM.js.map → chunk-SIDJO2T4.js.map} +0 -0
  328. /package/dist/{chunk-2747WN4Y.js.map → chunk-TPND5MJS.js.map} +0 -0
  329. /package/dist/{chunk-43BKLFZU.js.map → chunk-YDWBXXQZ.js.map} +0 -0
  330. /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
@@ -0,0 +1,1009 @@
1
+ // src/adapters/nestjs.ts
2
+ var NEST_BOUNDARY_ENVELOPE_VERSION = 1;
3
+ var NEST_BOUNDARY_PAYLOAD_MAX_BYTES = 64 * 1024;
4
+ var NEST_HTTP_DIAGNOSTICS_MAX_RETAINED = 100;
5
+ var GRAPHREFLY_ROOT_GRAPH = /* @__PURE__ */ Symbol.for("graphrefly:root-graph");
6
+ var GRAPHREFLY_MODULE_OPTIONS = /* @__PURE__ */ Symbol.for("graphrefly:module-options");
7
+ var GRAPHREFLY_REQUEST_GRAPH = /* @__PURE__ */ Symbol.for("graphrefly:request-graph");
8
+ var EVENT_HANDLERS = /* @__PURE__ */ new WeakMap();
9
+ var INTERVAL_HANDLERS = /* @__PURE__ */ new WeakMap();
10
+ var CRON_HANDLERS = /* @__PURE__ */ new WeakMap();
11
+ var NEST_BOUNDARY_BINDINGS = /* @__PURE__ */ new WeakMap();
12
+ function getGraphToken(name) {
13
+ assertNonEmptyString(name, "getGraphToken(name)");
14
+ return /* @__PURE__ */ Symbol.for(`graphrefly:graph:${name}`);
15
+ }
16
+ function getNodeToken(path) {
17
+ assertNonEmptyString(path, "getNodeToken(path)");
18
+ return /* @__PURE__ */ Symbol.for(`graphrefly:node:${path}`);
19
+ }
20
+ function getNestBoundaryToken(bindingId) {
21
+ assertNonEmptyString(bindingId, "getNestBoundaryToken(bindingId)");
22
+ return /* @__PURE__ */ Symbol.for(`graphrefly:nest-boundary:${bindingId}`);
23
+ }
24
+ function nestProvider(provide, useValue) {
25
+ return { provide, useValue };
26
+ }
27
+ function fromNestReq(graph, opts = {}) {
28
+ return nestIngress(graph, "request", opts);
29
+ }
30
+ function fromNestGuard(graph, opts = {}) {
31
+ return nestIngress(graph, "guard", opts);
32
+ }
33
+ function fromNestIntercept(graph, opts = {}) {
34
+ return nestIngress(graph, "interceptor", opts);
35
+ }
36
+ function fromNestError(graph, opts = {}) {
37
+ return nestIngress(graph, "error", opts);
38
+ }
39
+ function fromNestLifecycle(graph, opts = {}) {
40
+ return nestIngress(graph, "lifecycle", opts);
41
+ }
42
+ function fromNestCron(graph, opts = {}) {
43
+ return nestIngress(graph, "cron", opts);
44
+ }
45
+ function fromNestDiagnostics(graph, opts = {}) {
46
+ return nestIngress(graph, "diagnostics", {
47
+ ...opts,
48
+ payload: (diagnostic) => sanitizeNestDiagnostic(diagnostic, opts.phase)
49
+ });
50
+ }
51
+ function fromNestWs(graph, opts = {}) {
52
+ return nestIngress(graph, "ws", opts);
53
+ }
54
+ function fromNestMessage(graph, opts = {}) {
55
+ return nestIngress(graph, "message", opts);
56
+ }
57
+ function toNestHttp(egress, opts = {}) {
58
+ const bindingId = stableBindingId("http", opts);
59
+ const scopedBindingId = opts.bindingId;
60
+ const maxDiagnostics = diagnosticsRetainedLimit(opts.maxDiagnostics);
61
+ const maxPayloadBytes = payloadByteLimit(opts.maxPayloadBytes);
62
+ const pending = /* @__PURE__ */ new Map();
63
+ const diagnostics = [];
64
+ let active = true;
65
+ let terminal;
66
+ const report = (diagnostic) => {
67
+ pushDiagnostic(diagnostics, diagnostic, maxDiagnostics);
68
+ try {
69
+ const phase = diagnostic.phase ?? opts.diagnosticPhase ?? "http";
70
+ const payload = sanitizeNestDiagnostic({ ...diagnostic, phase }, phase);
71
+ opts.diagnosticBoundary?.emit(payload, { payload });
72
+ } catch {
73
+ }
74
+ };
75
+ const keyOf = (requestId, requestBindingId) => requestBindingId === void 0 ? requestId : `${requestBindingId}\0${requestId}`;
76
+ const rejectEntry = (entry, error, envelope, message) => {
77
+ try {
78
+ entry.handle.reject(error, envelope);
79
+ } catch (rejectError) {
80
+ report({
81
+ kind: "reject-threw",
82
+ requestId: entry.requestId,
83
+ bindingId: entry.bindingId,
84
+ message,
85
+ error: rejectError
86
+ });
87
+ }
88
+ };
89
+ const rejectPending = (kind, error, message) => {
90
+ const entries = [...pending.values()];
91
+ pending.clear();
92
+ if (entries.length === 0) return 0;
93
+ report({ kind, bindingId: scopedBindingId, message, error });
94
+ for (const entry of entries) {
95
+ rejectEntry(entry, error, void 0, `toNestHttp(${bindingId}) pending reject threw`);
96
+ }
97
+ return entries.length;
98
+ };
99
+ const unsubscribe = egress.subscribe((msg) => {
100
+ if (!active) return;
101
+ if (msg[0] === "ERROR" || msg[0] === "COMPLETE" || msg[0] === "TEARDOWN") {
102
+ const error = msg[0] === "ERROR" ? msg[1] : new Error(`toNestHttp(${bindingId}) egress received ${msg[0]}`);
103
+ const message = `toNestHttp(${bindingId}) rejected pending requests after ${msg[0]}`;
104
+ terminal = { error, message };
105
+ const rejectedCount = rejectPending("terminal-egress", error, message);
106
+ if (rejectedCount === 0)
107
+ report({ kind: "terminal-egress", bindingId: scopedBindingId, message, error });
108
+ return;
109
+ }
110
+ if (msg[0] !== "DATA") return;
111
+ const envelope = msg[1];
112
+ const malformed = validateEnvelope(envelope, maxPayloadBytes);
113
+ if (malformed !== void 0) {
114
+ const correlated = malformedCorrelation(msg[1], scopedBindingId);
115
+ if (correlated !== void 0) {
116
+ const pendingKey2 = keyOf(correlated.requestId, scopedBindingId);
117
+ const entry2 = pending.get(pendingKey2);
118
+ if (entry2 !== void 0) {
119
+ pending.delete(pendingKey2);
120
+ rejectEntry(
121
+ entry2,
122
+ new Error(malformed),
123
+ void 0,
124
+ `toNestHttp(${bindingId}) rejected malformed correlated egress`
125
+ );
126
+ }
127
+ }
128
+ report({
129
+ kind: "malformed-egress",
130
+ requestId: correlated?.requestId,
131
+ bindingId: correlated?.bindingId,
132
+ message: malformed
133
+ });
134
+ return;
135
+ }
136
+ if (scopedBindingId !== void 0 && envelope.bindingId !== scopedBindingId) {
137
+ report({
138
+ kind: "binding-mismatch",
139
+ requestId: envelope.requestId,
140
+ bindingId: envelope.bindingId,
141
+ expectedBindingId: scopedBindingId,
142
+ message: `toNestHttp(${bindingId}) ignored egress for binding ${envelope.bindingId}`
143
+ });
144
+ return;
145
+ }
146
+ const pendingKey = keyOf(envelope.requestId, scopedBindingId);
147
+ const entry = pending.get(pendingKey);
148
+ if (entry === void 0) {
149
+ report({
150
+ kind: "stale-egress",
151
+ requestId: envelope.requestId,
152
+ bindingId: envelope.bindingId,
153
+ message: `toNestHttp(${bindingId}) ignored stale requestId ${envelope.requestId}`
154
+ });
155
+ return;
156
+ }
157
+ pending.delete(pendingKey);
158
+ try {
159
+ entry.handle.resolve(
160
+ opts.transform?.(envelope.payload, envelope) ?? envelope.payload,
161
+ envelope
162
+ );
163
+ } catch (error) {
164
+ report({
165
+ kind: "resolve-threw",
166
+ requestId: envelope.requestId,
167
+ bindingId: envelope.bindingId,
168
+ message: `toNestHttp(${bindingId}) response handle threw while resolving`,
169
+ error
170
+ });
171
+ rejectEntry(
172
+ entry,
173
+ error,
174
+ envelope,
175
+ `toNestHttp(${bindingId}) response handle threw while rejecting`
176
+ );
177
+ }
178
+ });
179
+ return {
180
+ kind: "http",
181
+ bindingId,
182
+ attach(registration) {
183
+ if (!active) throw new Error(`toNestHttp(${bindingId}) is disposed`);
184
+ assertNonEmptyString(registration.requestId, "toNestHttp.attach(requestId)");
185
+ const registrationBindingId = registration.bindingId ?? scopedBindingId;
186
+ if (scopedBindingId !== void 0 && registrationBindingId !== scopedBindingId) {
187
+ throw new Error(
188
+ `toNestHttp.attach expected bindingId ${scopedBindingId}, got ${registrationBindingId}`
189
+ );
190
+ }
191
+ if (terminal !== void 0) {
192
+ const entry2 = {
193
+ requestId: registration.requestId,
194
+ bindingId: registrationBindingId,
195
+ handle: registration.handle
196
+ };
197
+ report({
198
+ kind: "terminal-egress",
199
+ requestId: registration.requestId,
200
+ bindingId: registrationBindingId,
201
+ message: terminal.message,
202
+ error: terminal.error
203
+ });
204
+ rejectEntry(
205
+ entry2,
206
+ terminal.error,
207
+ void 0,
208
+ `toNestHttp(${bindingId}) terminal response handle reject threw`
209
+ );
210
+ return () => false;
211
+ }
212
+ const key = keyOf(registration.requestId, scopedBindingId);
213
+ if (pending.has(key)) {
214
+ throw new Error(`toNestHttp.attach duplicate pending requestId ${registration.requestId}`);
215
+ }
216
+ const entry = {
217
+ requestId: registration.requestId,
218
+ bindingId: registrationBindingId,
219
+ handle: registration.handle
220
+ };
221
+ pending.set(key, entry);
222
+ return () => {
223
+ if (pending.get(key) !== entry) return false;
224
+ return pending.delete(key);
225
+ };
226
+ },
227
+ pendingCount: () => pending.size,
228
+ diagnostics: () => diagnostics.slice(),
229
+ dispose() {
230
+ if (!active) return;
231
+ active = false;
232
+ rejectPending(
233
+ "dispose-pending",
234
+ new Error(`toNestHttp(${bindingId}) disposed before response resolution`),
235
+ `toNestHttp(${bindingId}) rejected pending requests during dispose`
236
+ );
237
+ unsubscribe();
238
+ }
239
+ };
240
+ }
241
+ function GraphReq(boundary, opts = {}) {
242
+ return graphIngressBinding("request", boundary, opts);
243
+ }
244
+ function GraphGuard(boundary, opts = {}) {
245
+ return graphIngressBinding("guard", boundary, opts);
246
+ }
247
+ function GraphIntercept(boundary, opts = {}) {
248
+ return graphIngressBinding("interceptor", boundary, opts);
249
+ }
250
+ function GraphFilter(boundary, opts = {}) {
251
+ return graphIngressBinding("error", boundary, opts);
252
+ }
253
+ function GraphError(boundary, opts = {}) {
254
+ return GraphFilter(boundary, opts);
255
+ }
256
+ function GraphLifecycle(boundary, opts = {}) {
257
+ return graphIngressBinding("lifecycle", boundary, opts);
258
+ }
259
+ function GraphCron(boundary, opts = {}) {
260
+ return graphIngressBinding("cron", boundary, opts);
261
+ }
262
+ function GraphWs(boundary, opts = {}) {
263
+ return graphIngressBinding("ws", boundary, opts);
264
+ }
265
+ function GraphMessage(boundary, opts = {}) {
266
+ return graphIngressBinding("message", boundary, opts);
267
+ }
268
+ function GraphHttpReply(replyNode, opts) {
269
+ const bindingId = opts?.bindingId;
270
+ if (typeof bindingId !== "string" || bindingId.length === 0) {
271
+ throw new Error("GraphHttpReply requires a non-empty bindingId");
272
+ }
273
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => ({
274
+ direction: "egress",
275
+ kind: "http",
276
+ bindingId,
277
+ methodKey,
278
+ replyNode,
279
+ order: opts.order,
280
+ issueResponse: opts.issueResponse,
281
+ protocolError: opts.protocolError
282
+ }));
283
+ }
284
+ function GraphGuardDecision(decisionNode, opts) {
285
+ const bindingId = opts?.bindingId;
286
+ if (typeof bindingId !== "string" || bindingId.length === 0) {
287
+ throw new Error("GraphGuardDecision requires a non-empty bindingId");
288
+ }
289
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => ({
290
+ direction: "egress",
291
+ kind: "guard-decision",
292
+ bindingId,
293
+ methodKey,
294
+ decisionNode,
295
+ order: opts.order,
296
+ issueResponse: opts.issueResponse,
297
+ protocolError: opts.protocolError
298
+ }));
299
+ }
300
+ function GraphWsAck(ackNode, opts) {
301
+ return graphReplyBinding("ws-ack", ackNode, opts, "GraphWsAck");
302
+ }
303
+ function GraphWsReply(replyNode, opts) {
304
+ return graphReplyBinding("ws-reply", replyNode, opts, "GraphWsReply");
305
+ }
306
+ function GraphMessageReply(replyNode, opts) {
307
+ return graphReplyBinding("message-reply", replyNode, opts, "GraphMessageReply");
308
+ }
309
+ function createNestGraphBoundaryRunner(opts = {}) {
310
+ const httpBoundaries = /* @__PURE__ */ new Map();
311
+ const httpBoundaryFor = (node, bindingId) => {
312
+ let byBinding = httpBoundaries.get(node);
313
+ if (byBinding === void 0) {
314
+ byBinding = /* @__PURE__ */ new Map();
315
+ httpBoundaries.set(node, byBinding);
316
+ }
317
+ let boundary = byBinding.get(bindingId);
318
+ if (boundary === void 0) {
319
+ boundary = toNestHttp(node, {
320
+ bindingId,
321
+ diagnosticBoundary: opts.diagnosticBoundary,
322
+ diagnosticPhase: opts.diagnosticPhase ?? "http"
323
+ });
324
+ byBinding.set(bindingId, boundary);
325
+ }
326
+ return boundary;
327
+ };
328
+ return {
329
+ run(target, methodKey, host, opts2 = {}) {
330
+ const ctor = typeof target === "function" ? target : target.constructor;
331
+ const bindings = getNestBoundaryBindings(ctor, methodKey);
332
+ if (bindings.length === 0) return void 0;
333
+ const requestId = requestIdFromRunOptions(host, opts2);
334
+ const replies = bindings.filter(isHttpReplyBinding);
335
+ const ingress = bindings.filter(
336
+ (binding) => binding.direction === "ingress" && (binding.kind === "request" || binding.kind === "interceptor")
337
+ );
338
+ if (replies.length > 0 && ingress.length === 0) {
339
+ throw new Error("Nest GraphHttpReply requires at least one ingress boundary");
340
+ }
341
+ const ingressEmits = ingress.map((binding) => ({
342
+ binding,
343
+ requestId: requestIdFromBinding(host, binding) ?? requestId
344
+ }));
345
+ const replyRequestIds = uniqueDefinedStrings(ingressEmits.map((entry) => entry.requestId));
346
+ if (replies.length > 0 && replyRequestIds.length === 0) {
347
+ throw new Error("Nest GraphHttpReply requires a stable requestId");
348
+ }
349
+ const cleanups = [];
350
+ let resolveReply;
351
+ let rejectReply;
352
+ const replyPromise = replies.length === 0 ? void 0 : new Promise((resolve, reject) => {
353
+ resolveReply = resolve;
354
+ rejectReply = reject;
355
+ });
356
+ try {
357
+ for (const reply of replies) {
358
+ const http = httpBoundaryFor(reply.replyNode, reply.bindingId);
359
+ for (const replyRequestId of replyRequestIds) {
360
+ cleanups.push(
361
+ http.attach({
362
+ requestId: replyRequestId,
363
+ bindingId: reply.bindingId,
364
+ handle: {
365
+ resolve: resolveReply ?? (() => void 0),
366
+ reject: rejectReply ?? (() => void 0)
367
+ }
368
+ })
369
+ );
370
+ }
371
+ }
372
+ for (const entry of ingressEmits) {
373
+ entry.binding.boundary.emit(host, {
374
+ bindingId: entry.binding.bindingId,
375
+ requestId: entry.requestId,
376
+ ...bindingPayloadEmitOption(host, entry.binding),
377
+ requireRequestId: requiresRequestId(entry.binding.kind)
378
+ });
379
+ }
380
+ } catch (error) {
381
+ for (const cleanup of cleanups) cleanup();
382
+ throw error;
383
+ }
384
+ return replyPromise?.finally(() => {
385
+ for (const cleanup of cleanups) cleanup();
386
+ });
387
+ },
388
+ dispose() {
389
+ for (const byBinding of httpBoundaries.values()) {
390
+ for (const boundary of byBinding.values()) boundary.dispose();
391
+ }
392
+ httpBoundaries.clear();
393
+ }
394
+ };
395
+ }
396
+ function createNestGraphBoundaryInterceptor(opts = {}) {
397
+ const runner = opts.runner ?? createNestGraphBoundaryRunner(opts);
398
+ let nextRequestSeq = 1;
399
+ return {
400
+ intercept(context, next) {
401
+ const ctor = context.getClass();
402
+ const handler = context.getHandler();
403
+ const methodKey = methodKeyForHandler(ctor, handler);
404
+ if (methodKey === void 0) return next?.handle();
405
+ const bindings = getNestBoundaryBindings(ctor, methodKey);
406
+ const needsSyntheticRequestId = bindings.some(
407
+ (binding) => binding.direction === "egress" || binding.direction === "ingress" && requiresRequestId(binding.kind)
408
+ );
409
+ const host = opts.host?.(context) ?? defaultNestHttpHost(context, () => nextRequestSeq++, needsSyntheticRequestId) ?? {};
410
+ const result = runner.run(ctor, methodKey, host, opts);
411
+ return result ?? next?.handle();
412
+ },
413
+ dispose() {
414
+ runner.dispose();
415
+ }
416
+ };
417
+ }
418
+ function getNestBoundaryBindings(target, methodKey) {
419
+ const ctor = typeof target === "function" ? target : target.constructor;
420
+ const bindings = boundaryBindingsFor(ctor);
421
+ return sortBoundaryBindings(
422
+ methodKey === void 0 ? bindings : bindings.filter((binding) => binding.methodKey === methodKey)
423
+ );
424
+ }
425
+ function resolveNestMethodKey(ctor, handler) {
426
+ return methodKeyForHandler(ctor, handler);
427
+ }
428
+ function bindingRequestId(host, binding, fallback) {
429
+ if (binding.direction === "ingress") {
430
+ const requestId = requestIdFromBinding(host, binding);
431
+ if (requestId !== void 0) return requestId;
432
+ }
433
+ if (typeof fallback === "string") {
434
+ assertNonEmptyString(fallback, "requestId");
435
+ return fallback;
436
+ }
437
+ if (typeof fallback === "function") {
438
+ const requestId = fallback(host);
439
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
440
+ return requestId;
441
+ }
442
+ return requestIdOf(host, {}, {});
443
+ }
444
+ function bindingEmitOptions(host, binding, requestId) {
445
+ return {
446
+ bindingId: binding.bindingId,
447
+ requestId,
448
+ ...bindingPayloadEmitOption(host, binding),
449
+ requireRequestId: requiresRequestId(binding.kind)
450
+ };
451
+ }
452
+ function isDataIssue(value) {
453
+ return value !== null && typeof value === "object" && value.kind === "issue" && typeof value.code === "string" && typeof value.message === "string";
454
+ }
455
+ function isHttpDataIssue(value) {
456
+ return isDataIssue(value) && Number.isInteger(value.status);
457
+ }
458
+ function issueResponse(issue, _host) {
459
+ if (isHttpDataIssue(issue)) {
460
+ return {
461
+ status: issue.status,
462
+ body: issue.body ?? { code: issue.code, message: issue.message },
463
+ headers: issue.headers
464
+ };
465
+ }
466
+ return {
467
+ status: 400,
468
+ body: { code: issue.code, message: issue.message }
469
+ };
470
+ }
471
+ function protocolError(_errorPayload, _host) {
472
+ return {
473
+ status: 500,
474
+ body: { code: "graphrefly.protocol_error", message: "GraphReFly reply pipeline failed" }
475
+ };
476
+ }
477
+ function lowerHttpReplyPayload(payload, host, opts = {}) {
478
+ if (isHttpResponsePayload(payload)) return payload;
479
+ if (isDataIssue(payload)) return (opts.issueResponse ?? issueResponse)(payload, host);
480
+ return { status: 200, body: payload };
481
+ }
482
+ function lowerProtocolError(errorPayload, host, opts = {}) {
483
+ return (opts.protocolError ?? protocolError)(errorPayload, host);
484
+ }
485
+ function sanitizeNestDiagnostic(diagnostic, defaultPhase = "adapter") {
486
+ const payload = {
487
+ kind: diagnostic.kind,
488
+ phase: diagnostic.phase ?? defaultPhase,
489
+ message: diagnostic.message,
490
+ ...optionalStringField("requestId", diagnostic.requestId),
491
+ ...optionalStringField("bindingId", diagnostic.bindingId),
492
+ ...optionalStringField("expectedBindingId", diagnostic.expectedBindingId),
493
+ ...optionalDiagnosticError(diagnostic.error)
494
+ };
495
+ assertGraphVisibleData(payload, "NestDiagnosticPayload", NEST_BOUNDARY_PAYLOAD_MAX_BYTES);
496
+ return payload;
497
+ }
498
+ function nestIngress(graph, kind, opts) {
499
+ const bindingId = stableBindingId(kind, opts);
500
+ const version = parseEnvelopeVersion(opts.version ?? NEST_BOUNDARY_ENVELOPE_VERSION, "version");
501
+ const maxPayloadBytes = payloadByteLimit(opts.maxPayloadBytes);
502
+ const node = graph.node([], null, {
503
+ name: opts.name,
504
+ meta: { adapter: "nestjs", boundary: "ingress", kind, bindingId, version }
505
+ });
506
+ return {
507
+ kind,
508
+ bindingId,
509
+ version,
510
+ node,
511
+ envelope(host, emitOpts = {}) {
512
+ const requestId = requestIdOf(host, opts, {
513
+ ...emitOpts,
514
+ requireRequestId: emitOpts.requireRequestId ?? opts.requireRequestId ?? requiresRequestId(kind)
515
+ });
516
+ const envelopeBindingId = emitOpts.bindingId ?? bindingId;
517
+ assertNonEmptyString(envelopeBindingId, "NestBoundaryEnvelope.bindingId");
518
+ const envelopeVersion = parseEnvelopeVersion(
519
+ emitOpts.version ?? version,
520
+ "NestBoundaryEnvelope.version"
521
+ );
522
+ const payload = "payload" in emitOpts ? emitOpts.payload : opts.payload !== void 0 ? opts.payload(host) : host;
523
+ assertGraphVisibleData(payload, "NestBoundaryEnvelope.payload", maxPayloadBytes);
524
+ const envelope = {
525
+ bindingId: envelopeBindingId,
526
+ version: envelopeVersion,
527
+ payload
528
+ };
529
+ return requestId === void 0 ? envelope : { ...envelope, requestId };
530
+ },
531
+ emit(host, emitOpts = {}) {
532
+ const envelope = this.envelope(host, emitOpts);
533
+ node.down([["DATA", envelope]]);
534
+ return envelope;
535
+ }
536
+ };
537
+ }
538
+ function stableBindingId(kind, opts) {
539
+ const bindingId = opts.bindingId ?? opts.name ?? `nestjs.${kind}`;
540
+ assertNonEmptyString(bindingId, "bindingId");
541
+ return bindingId;
542
+ }
543
+ function requiresRequestId(kind) {
544
+ return kind === "request" || kind === "guard" || kind === "interceptor" || kind === "error";
545
+ }
546
+ function requestIdFromRunOptions(host, opts) {
547
+ if (typeof opts.requestId === "string") {
548
+ assertNonEmptyString(opts.requestId, "requestId");
549
+ return opts.requestId;
550
+ }
551
+ if (typeof opts.requestId === "function") {
552
+ const requestId = opts.requestId(host);
553
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
554
+ return requestId;
555
+ }
556
+ return requestIdOf(host, {}, {});
557
+ }
558
+ function requestIdFromBinding(host, binding) {
559
+ if (typeof binding.requestId === "string") {
560
+ assertNonEmptyString(binding.requestId, "requestId");
561
+ return binding.requestId;
562
+ }
563
+ if (typeof binding.requestId === "function") {
564
+ const requestId = binding.requestId(host);
565
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
566
+ return requestId;
567
+ }
568
+ return void 0;
569
+ }
570
+ function bindingPayloadEmitOption(host, binding) {
571
+ return binding.payload === void 0 ? {} : { payload: binding.payload(host) };
572
+ }
573
+ function isHttpResponsePayload(value) {
574
+ if (value === null || typeof value !== "object") return false;
575
+ const status = value.status;
576
+ if (!Number.isInteger(status)) return false;
577
+ const headers = value.headers;
578
+ return headers === void 0 || isStringRecord(headers);
579
+ }
580
+ function isStringRecord(value) {
581
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
582
+ for (const entry of Object.values(value)) if (typeof entry !== "string") return false;
583
+ return true;
584
+ }
585
+ function isHttpReplyBinding(binding) {
586
+ return binding.direction === "egress" && binding.kind === "http";
587
+ }
588
+ function uniqueDefinedStrings(values) {
589
+ const seen = /* @__PURE__ */ new Set();
590
+ for (const value of values) {
591
+ if (value !== void 0) seen.add(value);
592
+ }
593
+ return [...seen];
594
+ }
595
+ function defaultNestHttpHost(context, nextSeq, needsSyntheticRequestId) {
596
+ const request = context.switchToHttp?.().getRequest();
597
+ if (request === void 0 || request === null || typeof request !== "object") return request;
598
+ if (requestIdFromRecord(request) !== void 0) return request;
599
+ const headerId = requestIdFromHeaders(request.headers);
600
+ if (headerId !== void 0 || needsSyntheticRequestId) {
601
+ return { ...request, requestId: headerId ?? `nestjs-request:${nextSeq()}` };
602
+ }
603
+ return request;
604
+ }
605
+ function requestIdFromRecord(record) {
606
+ for (const key of ["requestId", "id"]) {
607
+ const value = record[key];
608
+ if (typeof value === "string" && value.length > 0) return value;
609
+ }
610
+ return void 0;
611
+ }
612
+ function requestIdFromHeaders(headers) {
613
+ if (headers === null || typeof headers !== "object") return void 0;
614
+ for (const key of ["x-request-id", "x-correlation-id"]) {
615
+ const value = headers[key];
616
+ const first = Array.isArray(value) ? value[0] : value;
617
+ if (typeof first === "string" && first.trim().length > 0) return first.trim();
618
+ }
619
+ return void 0;
620
+ }
621
+ function graphIngressBinding(kind, boundary, opts) {
622
+ if (boundary.kind !== kind) {
623
+ throw new Error(`Graph${kind} expected a ${kind} boundary, got ${boundary.kind}`);
624
+ }
625
+ const bindingId = opts.bindingId ?? boundary.bindingId;
626
+ assertNonEmptyString(bindingId, "bindingId");
627
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => ({
628
+ direction: "ingress",
629
+ kind,
630
+ bindingId,
631
+ methodKey,
632
+ boundary,
633
+ payload: opts.payload,
634
+ requestId: opts.requestId,
635
+ order: opts.order,
636
+ mode: opts.mode,
637
+ issueResponse: opts.issueResponse,
638
+ protocolError: opts.protocolError
639
+ }));
640
+ }
641
+ function graphReplyBinding(kind, node, opts, decoratorName) {
642
+ const bindingId = opts?.bindingId;
643
+ if (typeof bindingId !== "string" || bindingId.length === 0) {
644
+ throw new Error(`${decoratorName} requires a non-empty bindingId`);
645
+ }
646
+ const replyNode = node;
647
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => {
648
+ if (kind === "ws-ack") {
649
+ return {
650
+ direction: "egress",
651
+ kind,
652
+ bindingId,
653
+ methodKey,
654
+ ackNode: replyNode,
655
+ order: opts.order
656
+ };
657
+ }
658
+ return {
659
+ direction: "egress",
660
+ kind,
661
+ bindingId,
662
+ methodKey,
663
+ replyNode,
664
+ order: opts.order
665
+ };
666
+ });
667
+ }
668
+ function methodKeyForHandler(ctor, handler) {
669
+ for (const binding of boundaryBindingsFor(ctor)) {
670
+ const candidate = methodOnPrototypeChain(ctor, binding.methodKey);
671
+ if (candidate === handler || String(binding.methodKey) === handler.name)
672
+ return binding.methodKey;
673
+ }
674
+ return void 0;
675
+ }
676
+ function boundaryBindingsFor(ctor) {
677
+ const bindings = [];
678
+ const seen = /* @__PURE__ */ new Set();
679
+ let current = ctor;
680
+ while (typeof current === "function" && current !== Function.prototype) {
681
+ for (const binding of NEST_BOUNDARY_BINDINGS.get(current) ?? []) {
682
+ if (seen.has(binding)) continue;
683
+ seen.add(binding);
684
+ bindings.push(binding);
685
+ }
686
+ current = Object.getPrototypeOf(current);
687
+ }
688
+ return bindings;
689
+ }
690
+ function sortBoundaryBindings(bindings) {
691
+ return bindings.map((binding, index) => ({ binding, index })).sort((a, b) => (a.binding.order ?? 0) - (b.binding.order ?? 0) || a.index - b.index).map(({ binding }) => binding);
692
+ }
693
+ function methodOnPrototypeChain(ctor, methodKey) {
694
+ let proto = ctor.prototype;
695
+ while (proto !== null && typeof proto === "object") {
696
+ if (Object.hasOwn(proto, methodKey)) {
697
+ return proto[methodKey];
698
+ }
699
+ proto = Object.getPrototypeOf(proto);
700
+ }
701
+ return void 0;
702
+ }
703
+ function requestIdOf(host, opts, emitOpts) {
704
+ const fromEmit = emitOpts.requestId;
705
+ if (fromEmit !== void 0) {
706
+ assertNonEmptyString(fromEmit, "requestId");
707
+ return fromEmit;
708
+ }
709
+ if (typeof opts.requestId === "string") {
710
+ assertNonEmptyString(opts.requestId, "requestId");
711
+ return opts.requestId;
712
+ }
713
+ if (typeof opts.requestId === "function") {
714
+ const requestId = opts.requestId(host);
715
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
716
+ return requestId;
717
+ }
718
+ const record = host;
719
+ if (typeof record?.requestId === "string" && record.requestId.length > 0) return record.requestId;
720
+ if (typeof record?.id === "string" && record.id.length > 0) return record.id;
721
+ if (emitOpts.requireRequestId ?? opts.requireRequestId ?? false) {
722
+ throw new Error("Nest boundary ingress requires a stable requestId");
723
+ }
724
+ return void 0;
725
+ }
726
+ function validateEnvelope(value, maxPayloadBytes) {
727
+ try {
728
+ assertGraphVisibleData(value, "NestBoundaryEnvelope", maxPayloadBytes);
729
+ } catch (error) {
730
+ return error instanceof Error ? error.message : "egress envelope must be data-only material";
731
+ }
732
+ if (value === null || typeof value !== "object") return "egress DATA is not an envelope object";
733
+ const envelope = value;
734
+ if (typeof envelope.requestId !== "string" || envelope.requestId.length === 0) {
735
+ return "egress envelope requestId must be a non-empty string";
736
+ }
737
+ if (typeof envelope.bindingId !== "string" || envelope.bindingId.length === 0) {
738
+ return "egress envelope bindingId must be a non-empty string";
739
+ }
740
+ try {
741
+ parseEnvelopeVersion(envelope.version, "egress envelope version");
742
+ } catch {
743
+ return `egress envelope version must be ${NEST_BOUNDARY_ENVELOPE_VERSION}`;
744
+ }
745
+ return void 0;
746
+ }
747
+ function malformedCorrelation(value, scopedBindingId) {
748
+ if (value === null || typeof value !== "object") return void 0;
749
+ const requestId = value.requestId;
750
+ const bindingId = value.bindingId;
751
+ if (typeof requestId !== "string" || requestId.length === 0) return void 0;
752
+ if (typeof bindingId !== "string" || bindingId.length === 0) return void 0;
753
+ if (scopedBindingId !== void 0 && bindingId !== scopedBindingId) return void 0;
754
+ return { requestId, bindingId };
755
+ }
756
+ function parseEnvelopeVersion(value, label) {
757
+ if (value !== NEST_BOUNDARY_ENVELOPE_VERSION) {
758
+ throw new Error(`${label} must be ${NEST_BOUNDARY_ENVELOPE_VERSION}`);
759
+ }
760
+ return value;
761
+ }
762
+ function assertNonEmptyString(value, label) {
763
+ if (value.length === 0) throw new Error(`${label} must be a non-empty string`);
764
+ }
765
+ function optionalStringField(key, value) {
766
+ return value === void 0 ? {} : { [key]: value };
767
+ }
768
+ function optionalDiagnosticError(error) {
769
+ const summarized = summarizeDiagnosticError(error);
770
+ return summarized === void 0 ? {} : { error: summarized };
771
+ }
772
+ function summarizeDiagnosticError(error) {
773
+ if (error === void 0) return void 0;
774
+ if (error instanceof Error) {
775
+ return {
776
+ ...optionalDiagnosticName(safeDiagnosticString(() => error.name)),
777
+ message: safeDiagnosticString(() => error.message) ?? "diagnostic error"
778
+ };
779
+ }
780
+ if (typeof error === "string") return { message: error };
781
+ if (typeof error === "number" || typeof error === "boolean" || typeof error === "bigint") {
782
+ return { message: String(error) };
783
+ }
784
+ if (typeof error === "symbol") return { message: error.description ?? "symbol" };
785
+ if (typeof error === "function") return { message: "opaque diagnostic function" };
786
+ if (error !== null && typeof error === "object") {
787
+ const record = error;
788
+ const message = safeDiagnosticString(() => record.message);
789
+ if (message !== void 0) {
790
+ return {
791
+ ...optionalDiagnosticName(safeDiagnosticString(() => record.name)),
792
+ message
793
+ };
794
+ }
795
+ return { message: "opaque diagnostic error" };
796
+ }
797
+ return { message: String(error) };
798
+ }
799
+ function safeDiagnosticString(read) {
800
+ try {
801
+ const value = read();
802
+ return typeof value === "string" ? value : void 0;
803
+ } catch {
804
+ return void 0;
805
+ }
806
+ }
807
+ function optionalDiagnosticName(name) {
808
+ return name === void 0 || name.length === 0 ? {} : { name };
809
+ }
810
+ function payloadByteLimit(value) {
811
+ if (value === void 0) return NEST_BOUNDARY_PAYLOAD_MAX_BYTES;
812
+ if (!Number.isSafeInteger(value) || value < 1) {
813
+ throw new Error("Nest boundary maxPayloadBytes must be a positive safe integer");
814
+ }
815
+ return value;
816
+ }
817
+ function diagnosticsRetainedLimit(value) {
818
+ if (value === void 0) return NEST_HTTP_DIAGNOSTICS_MAX_RETAINED;
819
+ if (!Number.isSafeInteger(value) || value < 0) {
820
+ throw new Error("toNestHttp maxDiagnostics must be a non-negative safe integer");
821
+ }
822
+ return value;
823
+ }
824
+ function pushDiagnostic(diagnostics, diagnostic, maxDiagnostics) {
825
+ if (maxDiagnostics === 0) return;
826
+ diagnostics.push(diagnostic);
827
+ if (diagnostics.length > maxDiagnostics)
828
+ diagnostics.splice(0, diagnostics.length - maxDiagnostics);
829
+ }
830
+ function assertGraphVisibleData(value, path, maxPayloadBytes, seen = /* @__PURE__ */ new WeakSet()) {
831
+ if (value === void 0) {
832
+ throw new TypeError(`${path} cannot be undefined; undefined is SENTINEL/no DATA`);
833
+ }
834
+ if (value === null) return;
835
+ const type = typeof value;
836
+ if (type === "string" || type === "boolean") return;
837
+ if (type === "number") {
838
+ if (!Number.isFinite(value)) throw new TypeError(`${path} number must be finite`);
839
+ return;
840
+ }
841
+ if (type === "function" || type === "symbol" || type === "bigint") {
842
+ throw new TypeError(`${path} must be data-only; found ${type}`);
843
+ }
844
+ if (type !== "object") return;
845
+ if (seen.has(value)) throw new TypeError(`${path} must be acyclic data`);
846
+ seen.add(value);
847
+ if (Array.isArray(value)) {
848
+ try {
849
+ for (let i = 0; i < value.length; i += 1) {
850
+ const descriptor = Object.getOwnPropertyDescriptor(value, i);
851
+ if (descriptor === void 0) {
852
+ throw new TypeError(`${path}[${i}] cannot be a sparse array hole`);
853
+ }
854
+ if (!descriptor.enumerable || !("value" in descriptor)) {
855
+ throw new TypeError(`${path}[${i}] must be enumerable plain data`);
856
+ }
857
+ assertGraphVisibleData(descriptor.value, `${path}[${i}]`, maxPayloadBytes, seen);
858
+ }
859
+ for (const key of Reflect.ownKeys(value)) {
860
+ if (key === "length") continue;
861
+ if (typeof key === "symbol" || !/^(0|[1-9]\d*)$/.test(key)) {
862
+ throw new TypeError(`${path} arrays must not carry hidden or extra properties`);
863
+ }
864
+ }
865
+ assertPayloadSize(value, path, maxPayloadBytes);
866
+ } finally {
867
+ seen.delete(value);
868
+ }
869
+ return;
870
+ }
871
+ const proto = Object.getPrototypeOf(value);
872
+ if (proto !== Object.prototype && proto !== null) {
873
+ throw new TypeError(`${path} must be a plain data object or array`);
874
+ }
875
+ try {
876
+ for (const key of Reflect.ownKeys(value)) {
877
+ if (typeof key === "symbol") throw new TypeError(`${path} must not carry symbol keys`);
878
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
879
+ if (descriptor === void 0) continue;
880
+ if (!descriptor.enumerable || !("value" in descriptor)) {
881
+ throw new TypeError(`${path}.${key} must be enumerable plain data`);
882
+ }
883
+ assertGraphVisibleData(descriptor.value, `${path}.${key}`, maxPayloadBytes, seen);
884
+ }
885
+ assertPayloadSize(value, path, maxPayloadBytes);
886
+ } finally {
887
+ seen.delete(value);
888
+ }
889
+ }
890
+ function assertPayloadSize(value, path, maxPayloadBytes) {
891
+ const serialized = JSON.stringify(value);
892
+ if (serialized !== void 0 && utf8ByteLength(serialized) > maxPayloadBytes) {
893
+ throw new TypeError(`${path} exceeds ${maxPayloadBytes} bytes`);
894
+ }
895
+ }
896
+ function utf8ByteLength(value) {
897
+ let bytes = 0;
898
+ for (let i = 0; i < value.length; i += 1) {
899
+ const code = value.charCodeAt(i);
900
+ if (code < 128) {
901
+ bytes += 1;
902
+ } else if (code < 2048) {
903
+ bytes += 2;
904
+ } else if (code >= 55296 && code <= 56319 && i + 1 < value.length) {
905
+ const next = value.charCodeAt(i + 1);
906
+ if (next >= 56320 && next <= 57343) {
907
+ bytes += 4;
908
+ i += 1;
909
+ } else {
910
+ bytes += 3;
911
+ }
912
+ } else {
913
+ bytes += 3;
914
+ }
915
+ }
916
+ return bytes;
917
+ }
918
+ function sameMeta(a, b) {
919
+ const left = a;
920
+ const right = b;
921
+ const keys = Reflect.ownKeys(left);
922
+ if (keys.length !== Reflect.ownKeys(right).length) return false;
923
+ for (const key of keys) {
924
+ if (!Object.is(left[key], right[key])) return false;
925
+ }
926
+ return true;
927
+ }
928
+ function pushUniqueMeta(registry, ctor, item) {
929
+ const existing = registry.get(ctor) ?? [];
930
+ if (existing.some((current) => sameMeta(current, item))) return;
931
+ registry.set(ctor, [...existing, item]);
932
+ }
933
+ function registerMeta(registry, meta) {
934
+ return ((targetOrValue, contextOrKey) => {
935
+ if (typeof contextOrKey === "object" && contextOrKey !== null) {
936
+ const methodKey = contextOrKey.name;
937
+ contextOrKey.addInitializer(function() {
938
+ const ctor2 = this.constructor;
939
+ pushUniqueMeta(registry, ctor2, meta(methodKey));
940
+ });
941
+ return;
942
+ }
943
+ const ctor = targetOrValue.constructor;
944
+ pushUniqueMeta(registry, ctor, meta(contextOrKey));
945
+ });
946
+ }
947
+ function OnGraphEvent(nodeName) {
948
+ return registerMeta(EVENT_HANDLERS, (methodKey) => ({ nodeName, methodKey }));
949
+ }
950
+ function GraphInterval(ms) {
951
+ return registerMeta(INTERVAL_HANDLERS, (methodKey) => ({ ms, methodKey }));
952
+ }
953
+
954
+ export {
955
+ NEST_BOUNDARY_ENVELOPE_VERSION,
956
+ NEST_BOUNDARY_PAYLOAD_MAX_BYTES,
957
+ NEST_HTTP_DIAGNOSTICS_MAX_RETAINED,
958
+ GRAPHREFLY_ROOT_GRAPH,
959
+ GRAPHREFLY_MODULE_OPTIONS,
960
+ GRAPHREFLY_REQUEST_GRAPH,
961
+ EVENT_HANDLERS,
962
+ INTERVAL_HANDLERS,
963
+ CRON_HANDLERS,
964
+ NEST_BOUNDARY_BINDINGS,
965
+ getGraphToken,
966
+ getNodeToken,
967
+ getNestBoundaryToken,
968
+ nestProvider,
969
+ fromNestReq,
970
+ fromNestGuard,
971
+ fromNestIntercept,
972
+ fromNestError,
973
+ fromNestLifecycle,
974
+ fromNestCron,
975
+ fromNestDiagnostics,
976
+ fromNestWs,
977
+ fromNestMessage,
978
+ toNestHttp,
979
+ GraphReq,
980
+ GraphGuard,
981
+ GraphIntercept,
982
+ GraphFilter,
983
+ GraphError,
984
+ GraphLifecycle,
985
+ GraphCron,
986
+ GraphWs,
987
+ GraphMessage,
988
+ GraphHttpReply,
989
+ GraphGuardDecision,
990
+ GraphWsAck,
991
+ GraphWsReply,
992
+ GraphMessageReply,
993
+ createNestGraphBoundaryRunner,
994
+ createNestGraphBoundaryInterceptor,
995
+ getNestBoundaryBindings,
996
+ resolveNestMethodKey,
997
+ bindingRequestId,
998
+ bindingEmitOptions,
999
+ isDataIssue,
1000
+ isHttpDataIssue,
1001
+ issueResponse,
1002
+ protocolError,
1003
+ lowerHttpReplyPayload,
1004
+ lowerProtocolError,
1005
+ sanitizeNestDiagnostic,
1006
+ OnGraphEvent,
1007
+ GraphInterval
1008
+ };
1009
+ //# sourceMappingURL=chunk-MQEQMS7B.js.map