@rudderhq/server 0.7.2 → 0.7.4

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 (512) hide show
  1. package/dist/agent-runtimes/registry.d.ts.map +1 -1
  2. package/dist/agent-runtimes/registry.js +0 -2
  3. package/dist/agent-runtimes/registry.js.map +1 -1
  4. package/dist/app.d.ts.map +1 -1
  5. package/dist/app.js +1 -5
  6. package/dist/app.js.map +1 -1
  7. package/dist/bootstrap/create-http-app.d.ts +1 -2
  8. package/dist/bootstrap/create-http-app.d.ts.map +1 -1
  9. package/dist/bootstrap/create-http-app.js +13 -12
  10. package/dist/bootstrap/create-http-app.js.map +1 -1
  11. package/dist/bootstrap/register-api-routes.d.ts +1 -2
  12. package/dist/bootstrap/register-api-routes.d.ts.map +1 -1
  13. package/dist/bootstrap/register-api-routes.js +22 -4
  14. package/dist/bootstrap/register-api-routes.js.map +1 -1
  15. package/dist/index.js +2 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/middleware/logger.js +2 -2
  18. package/dist/middleware/logger.js.map +1 -1
  19. package/dist/middleware/logger.test.js +26 -10
  20. package/dist/middleware/logger.test.js.map +1 -1
  21. package/dist/redaction.d.ts +4 -0
  22. package/dist/redaction.d.ts.map +1 -1
  23. package/dist/redaction.js +15 -0
  24. package/dist/redaction.js.map +1 -1
  25. package/dist/routes/agent-issue-creation.d.ts +25 -0
  26. package/dist/routes/agent-issue-creation.d.ts.map +1 -0
  27. package/dist/routes/agent-issue-creation.js +201 -0
  28. package/dist/routes/agent-issue-creation.js.map +1 -0
  29. package/dist/routes/app-builder.d.ts +3 -1
  30. package/dist/routes/app-builder.d.ts.map +1 -1
  31. package/dist/routes/app-builder.js +30 -22
  32. package/dist/routes/app-builder.js.map +1 -1
  33. package/dist/routes/approvals.d.ts.map +1 -1
  34. package/dist/routes/approvals.js +36 -9
  35. package/dist/routes/approvals.js.map +1 -1
  36. package/dist/routes/chats.d.ts.map +1 -1
  37. package/dist/routes/chats.js +23 -4
  38. package/dist/routes/chats.js.map +1 -1
  39. package/dist/routes/chats.preflight.d.ts +2 -1
  40. package/dist/routes/chats.preflight.d.ts.map +1 -1
  41. package/dist/routes/chats.preflight.js +7 -0
  42. package/dist/routes/chats.preflight.js.map +1 -1
  43. package/dist/routes/chats.stream-routes.d.ts.map +1 -1
  44. package/dist/routes/chats.stream-routes.js +14 -3
  45. package/dist/routes/chats.stream-routes.js.map +1 -1
  46. package/dist/routes/chats.stream-support.d.ts.map +1 -1
  47. package/dist/routes/chats.stream-support.js +8 -0
  48. package/dist/routes/chats.stream-support.js.map +1 -1
  49. package/dist/routes/computer.d.ts +30 -0
  50. package/dist/routes/computer.d.ts.map +1 -0
  51. package/dist/routes/computer.js +231 -0
  52. package/dist/routes/computer.js.map +1 -0
  53. package/dist/routes/goals.d.ts.map +1 -1
  54. package/dist/routes/goals.js +176 -27
  55. package/dist/routes/goals.js.map +1 -1
  56. package/dist/routes/health.d.ts.map +1 -1
  57. package/dist/routes/health.js +2 -0
  58. package/dist/routes/health.js.map +1 -1
  59. package/dist/routes/index.d.ts +1 -0
  60. package/dist/routes/index.d.ts.map +1 -1
  61. package/dist/routes/index.js +1 -0
  62. package/dist/routes/index.js.map +1 -1
  63. package/dist/routes/instance-settings.d.ts.map +1 -1
  64. package/dist/routes/instance-settings.js +3 -0
  65. package/dist/routes/instance-settings.js.map +1 -1
  66. package/dist/routes/issues.comments-attachments.d.ts.map +1 -1
  67. package/dist/routes/issues.comments-attachments.js +90 -8
  68. package/dist/routes/issues.comments-attachments.js.map +1 -1
  69. package/dist/routes/issues.d.ts.map +1 -1
  70. package/dist/routes/issues.js +14 -2
  71. package/dist/routes/issues.js.map +1 -1
  72. package/dist/routes/issues.mutations.d.ts.map +1 -1
  73. package/dist/routes/issues.mutations.js +206 -52
  74. package/dist/routes/issues.mutations.js.map +1 -1
  75. package/dist/routes/managed-mcp-runtime.d.ts.map +1 -1
  76. package/dist/routes/managed-mcp-runtime.js +109 -7
  77. package/dist/routes/managed-mcp-runtime.js.map +1 -1
  78. package/dist/routes/organization-skills.d.ts.map +1 -1
  79. package/dist/routes/organization-skills.js +23 -1
  80. package/dist/routes/organization-skills.js.map +1 -1
  81. package/dist/routes/requests.d.ts +3 -0
  82. package/dist/routes/requests.d.ts.map +1 -0
  83. package/dist/routes/requests.js +122 -0
  84. package/dist/routes/requests.js.map +1 -0
  85. package/dist/routes/rudder-plugins.d.ts +4 -0
  86. package/dist/routes/rudder-plugins.d.ts.map +1 -0
  87. package/dist/routes/rudder-plugins.js +203 -0
  88. package/dist/routes/rudder-plugins.js.map +1 -0
  89. package/dist/services/activity-log.d.ts +0 -3
  90. package/dist/services/activity-log.d.ts.map +1 -1
  91. package/dist/services/activity-log.js +19 -42
  92. package/dist/services/activity-log.js.map +1 -1
  93. package/dist/services/activity.d.ts +3 -3
  94. package/dist/services/agent-issue-creation.d.ts +344 -0
  95. package/dist/services/agent-issue-creation.d.ts.map +1 -0
  96. package/dist/services/agent-issue-creation.js +675 -0
  97. package/dist/services/agent-issue-creation.js.map +1 -0
  98. package/dist/services/agent-run-context.d.ts.map +1 -1
  99. package/dist/services/agent-run-context.js +10 -4
  100. package/dist/services/agent-run-context.js.map +1 -1
  101. package/dist/services/agents.d.ts +14 -14
  102. package/dist/services/agents.d.ts.map +1 -1
  103. package/dist/services/agents.js +2 -1
  104. package/dist/services/agents.js.map +1 -1
  105. package/dist/services/app-builder.d.ts.map +1 -1
  106. package/dist/services/app-builder.js +24 -3
  107. package/dist/services/app-builder.js.map +1 -1
  108. package/dist/services/chat-agent-runs.d.ts +1 -0
  109. package/dist/services/chat-agent-runs.d.ts.map +1 -1
  110. package/dist/services/chat-agent-runs.js +1 -0
  111. package/dist/services/chat-agent-runs.js.map +1 -1
  112. package/dist/services/chat-assistant.d.ts.map +1 -1
  113. package/dist/services/chat-assistant.helpers.d.ts +3 -1
  114. package/dist/services/chat-assistant.helpers.d.ts.map +1 -1
  115. package/dist/services/chat-assistant.helpers.js +25 -0
  116. package/dist/services/chat-assistant.helpers.js.map +1 -1
  117. package/dist/services/chat-assistant.js +57 -11
  118. package/dist/services/chat-assistant.js.map +1 -1
  119. package/dist/services/chat-generation-protocol.test.js +2 -2
  120. package/dist/services/chat-generation-protocol.test.js.map +1 -1
  121. package/dist/services/chat-queued-message-materialization.d.ts +1 -1
  122. package/dist/services/chats.create.d.ts +2 -2
  123. package/dist/services/chats.create.d.ts.map +1 -1
  124. package/dist/services/chats.d.ts +15 -15
  125. package/dist/services/chats.d.ts.map +1 -1
  126. package/dist/services/chats.helpers.d.ts +2 -2
  127. package/dist/services/chats.helpers.d.ts.map +1 -1
  128. package/dist/services/chats.helpers.goal-context.test.d.ts +2 -0
  129. package/dist/services/chats.helpers.goal-context.test.d.ts.map +1 -0
  130. package/dist/services/chats.helpers.goal-context.test.js +40 -0
  131. package/dist/services/chats.helpers.goal-context.test.js.map +1 -0
  132. package/dist/services/chats.helpers.js +27 -2
  133. package/dist/services/chats.helpers.js.map +1 -1
  134. package/dist/services/chats.js.map +1 -1
  135. package/dist/services/computer-broker.d.ts +35 -0
  136. package/dist/services/computer-broker.d.ts.map +1 -0
  137. package/dist/services/computer-broker.js +211 -0
  138. package/dist/services/computer-broker.js.map +1 -0
  139. package/dist/services/computer-broker.test.d.ts +2 -0
  140. package/dist/services/computer-broker.test.d.ts.map +1 -0
  141. package/dist/services/computer-broker.test.js +70 -0
  142. package/dist/services/computer-broker.test.js.map +1 -0
  143. package/dist/services/computer-capability.d.ts +13 -0
  144. package/dist/services/computer-capability.d.ts.map +1 -0
  145. package/dist/services/computer-capability.js +11 -0
  146. package/dist/services/computer-capability.js.map +1 -0
  147. package/dist/services/computer-capability.test.d.ts +2 -0
  148. package/dist/services/computer-capability.test.d.ts.map +1 -0
  149. package/dist/services/computer-capability.test.js +27 -0
  150. package/dist/services/computer-capability.test.js.map +1 -0
  151. package/dist/services/finance.d.ts +2 -2
  152. package/dist/services/goals.d.ts +267 -244
  153. package/dist/services/goals.d.ts.map +1 -1
  154. package/dist/services/goals.js +1279 -297
  155. package/dist/services/goals.js.map +1 -1
  156. package/dist/services/index.d.ts +3 -0
  157. package/dist/services/index.d.ts.map +1 -1
  158. package/dist/services/index.js +3 -0
  159. package/dist/services/index.js.map +1 -1
  160. package/dist/services/instance-settings.d.ts.map +1 -1
  161. package/dist/services/instance-settings.js +8 -3
  162. package/dist/services/instance-settings.js.map +1 -1
  163. package/dist/services/integrations/agent-integrations.d.ts +1 -1
  164. package/dist/services/issues.d.ts +86 -1
  165. package/dist/services/issues.d.ts.map +1 -1
  166. package/dist/services/issues.helpers.d.ts +4 -0
  167. package/dist/services/issues.helpers.d.ts.map +1 -1
  168. package/dist/services/issues.helpers.js +28 -6
  169. package/dist/services/issues.helpers.js.map +1 -1
  170. package/dist/services/issues.js +207 -127
  171. package/dist/services/issues.js.map +1 -1
  172. package/dist/services/knowledge-portability/organization-portability.files.d.ts +1 -1
  173. package/dist/services/knowledge-portability/organization-skills.catalog.d.ts +7 -1
  174. package/dist/services/knowledge-portability/organization-skills.catalog.d.ts.map +1 -1
  175. package/dist/services/knowledge-portability/organization-skills.catalog.js +10 -0
  176. package/dist/services/knowledge-portability/organization-skills.catalog.js.map +1 -1
  177. package/dist/services/knowledge-portability/organization-skills.d.ts +3 -1
  178. package/dist/services/knowledge-portability/organization-skills.d.ts.map +1 -1
  179. package/dist/services/knowledge-portability/organization-skills.js +80 -12
  180. package/dist/services/knowledge-portability/organization-skills.js.map +1 -1
  181. package/dist/services/mcp/managed-bindings.d.ts.map +1 -1
  182. package/dist/services/mcp/managed-bindings.js +18 -2
  183. package/dist/services/mcp/managed-bindings.js.map +1 -1
  184. package/dist/services/mcp/managed-client.d.ts +15 -0
  185. package/dist/services/mcp/managed-client.d.ts.map +1 -1
  186. package/dist/services/mcp/managed-client.js +23 -1
  187. package/dist/services/mcp/managed-client.js.map +1 -1
  188. package/dist/services/mcp/managed-client.test.js +73 -9
  189. package/dist/services/mcp/managed-client.test.js.map +1 -1
  190. package/dist/services/messenger.d.ts +3 -3
  191. package/dist/services/messenger.d.ts.map +1 -1
  192. package/dist/services/messenger.js +201 -65
  193. package/dist/services/messenger.js.map +1 -1
  194. package/dist/services/orgs.d.ts.map +1 -1
  195. package/dist/services/orgs.js +3 -1
  196. package/dist/services/orgs.js.map +1 -1
  197. package/dist/services/product-analytics.d.ts +2 -2
  198. package/dist/services/requests.d.ts +919 -0
  199. package/dist/services/requests.d.ts.map +1 -0
  200. package/dist/services/requests.js +532 -0
  201. package/dist/services/requests.js.map +1 -0
  202. package/dist/services/rudder-plugins.d.ts +107 -0
  203. package/dist/services/rudder-plugins.d.ts.map +1 -0
  204. package/dist/services/rudder-plugins.js +1760 -0
  205. package/dist/services/rudder-plugins.js.map +1 -0
  206. package/dist/services/rudder-plugins.test.d.ts +2 -0
  207. package/dist/services/rudder-plugins.test.d.ts.map +1 -0
  208. package/dist/services/rudder-plugins.test.js +191 -0
  209. package/dist/services/rudder-plugins.test.js.map +1 -0
  210. package/dist/services/runtime-kernel/heartbeat.core.d.ts +1 -0
  211. package/dist/services/runtime-kernel/heartbeat.core.d.ts.map +1 -1
  212. package/dist/services/runtime-kernel/heartbeat.core.js +1 -1
  213. package/dist/services/runtime-kernel/heartbeat.core.js.map +1 -1
  214. package/dist/services/runtime-kernel/heartbeat.d.ts +65 -0
  215. package/dist/services/runtime-kernel/heartbeat.d.ts.map +1 -1
  216. package/dist/services/runtime-kernel/heartbeat.execute.d.ts.map +1 -1
  217. package/dist/services/runtime-kernel/heartbeat.execute.js +21 -5
  218. package/dist/services/runtime-kernel/heartbeat.execute.js.map +1 -1
  219. package/dist/services/runtime-kernel/heartbeat.js +320 -108
  220. package/dist/services/runtime-kernel/heartbeat.js.map +1 -1
  221. package/dist/services/runtime-kernel/heartbeat.recovery.d.ts +1 -0
  222. package/dist/services/runtime-kernel/heartbeat.recovery.d.ts.map +1 -1
  223. package/dist/services/runtime-kernel/heartbeat.recovery.js +39 -4
  224. package/dist/services/runtime-kernel/heartbeat.recovery.js.map +1 -1
  225. package/dist/services/runtime-kernel/heartbeat.sessions.js +1 -1
  226. package/dist/services/runtime-kernel/heartbeat.sessions.js.map +1 -1
  227. package/dist/services/runtime-kernel/heartbeat.terminal.d.ts +14 -1
  228. package/dist/services/runtime-kernel/heartbeat.terminal.d.ts.map +1 -1
  229. package/dist/services/runtime-kernel/heartbeat.terminal.js +46 -1
  230. package/dist/services/runtime-kernel/heartbeat.terminal.js.map +1 -1
  231. package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts +1 -0
  232. package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts.map +1 -1
  233. package/dist/services/runtime-kernel/heartbeat.wakeup.js +124 -6
  234. package/dist/services/runtime-kernel/heartbeat.wakeup.js.map +1 -1
  235. package/dist/services/workspace-runtime.services.d.ts +1 -1
  236. package/package.json +18 -18
  237. package/resources/bundled-skills/app-builder/SKILL.md +39 -9
  238. package/resources/bundled-skills/app-builder/assets/scaffold/app/globals.css +109 -16
  239. package/resources/bundled-skills/app-builder/assets/scaffold/components/contacts-workspace.tsx +176 -152
  240. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/alert.tsx +12 -0
  241. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/badge.tsx +27 -0
  242. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/button.tsx +9 -7
  243. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/card.tsx +15 -3
  244. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/empty.tsx +18 -0
  245. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/field.tsx +23 -0
  246. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/input.tsx +1 -1
  247. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/label.tsx +1 -1
  248. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/separator.tsx +6 -0
  249. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/skeleton.tsx +6 -0
  250. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/table.tsx +30 -0
  251. package/resources/bundled-skills/app-builder/assets/scaffold/components.json +20 -0
  252. package/resources/bundled-skills/app-builder/assets/scaffold/next-env.d.ts +1 -1
  253. package/resources/bundled-skills/app-builder/assets/scaffold/next.config.ts +19 -0
  254. package/resources/bundled-skills/app-builder/assets/scaffold/package.json +2 -1
  255. package/resources/bundled-skills/app-builder/assets/scaffold/rudder.app.json +1 -1
  256. package/resources/bundled-skills/app-builder/assets/scaffold/rudder.ui.json +13 -0
  257. package/resources/bundled-skills/app-builder/assets/scaffold/scripts/validate-rudder-ui.mjs +50 -0
  258. package/resources/bundled-skills/app-builder/assets/scaffold/tests/e2e/app.spec.ts +35 -1
  259. package/resources/bundled-skills/app-builder/evals/evals.json +2 -1
  260. package/resources/bundled-skills/app-builder/references/design-guidelines.md +19 -2
  261. package/resources/bundled-skills/app-builder/references/rudder-ui-preset.md +73 -0
  262. package/resources/bundled-skills/app-builder/references/scaffold-contract.md +12 -0
  263. package/resources/bundled-skills/app-builder/references/verification.md +6 -0
  264. package/resources/bundled-skills/app-builder/scripts/report-build-status.mjs +83 -0
  265. package/resources/bundled-skills/rudder-docs/SKILL.md +2 -2
  266. package/resources/bundled-skills/rudder-docs/evals/retrieval-authority-evals.json +40 -0
  267. package/resources/bundled-skills/rudder-docs/evals/trigger-evals.json +2 -2
  268. package/resources/bundled-skills/rudder-docs/references/api-reference.md +0 -2
  269. package/resources/bundled-skills/rudder-docs/references/cli-reference.md +7 -2
  270. package/resources/bundled-skills/rudder-docs/references/operating-practices.md +10 -6
  271. package/resources/bundled-skills/rudder-docs/references/plugin-authoring.md +38 -114
  272. package/resources/bundled-skills/rudder-docs/references/source-map.md +2 -0
  273. package/skills/app-builder/SKILL.md +39 -9
  274. package/skills/app-builder/assets/scaffold/app/globals.css +109 -16
  275. package/skills/app-builder/assets/scaffold/components/contacts-workspace.tsx +176 -152
  276. package/skills/app-builder/assets/scaffold/components/ui/alert.tsx +12 -0
  277. package/skills/app-builder/assets/scaffold/components/ui/badge.tsx +27 -0
  278. package/skills/app-builder/assets/scaffold/components/ui/button.tsx +9 -7
  279. package/skills/app-builder/assets/scaffold/components/ui/card.tsx +15 -3
  280. package/skills/app-builder/assets/scaffold/components/ui/empty.tsx +18 -0
  281. package/skills/app-builder/assets/scaffold/components/ui/field.tsx +23 -0
  282. package/skills/app-builder/assets/scaffold/components/ui/input.tsx +1 -1
  283. package/skills/app-builder/assets/scaffold/components/ui/label.tsx +1 -1
  284. package/skills/app-builder/assets/scaffold/components/ui/separator.tsx +6 -0
  285. package/skills/app-builder/assets/scaffold/components/ui/skeleton.tsx +6 -0
  286. package/skills/app-builder/assets/scaffold/components/ui/table.tsx +30 -0
  287. package/skills/app-builder/assets/scaffold/components.json +20 -0
  288. package/skills/app-builder/assets/scaffold/next-env.d.ts +1 -1
  289. package/skills/app-builder/assets/scaffold/next.config.ts +19 -0
  290. package/skills/app-builder/assets/scaffold/package.json +2 -1
  291. package/skills/app-builder/assets/scaffold/rudder.app.json +1 -1
  292. package/skills/app-builder/assets/scaffold/rudder.ui.json +13 -0
  293. package/skills/app-builder/assets/scaffold/scripts/validate-rudder-ui.mjs +50 -0
  294. package/skills/app-builder/assets/scaffold/tests/e2e/app.spec.ts +35 -1
  295. package/skills/app-builder/evals/evals.json +2 -1
  296. package/skills/app-builder/references/design-guidelines.md +19 -2
  297. package/skills/app-builder/references/rudder-ui-preset.md +73 -0
  298. package/skills/app-builder/references/scaffold-contract.md +12 -0
  299. package/skills/app-builder/references/verification.md +6 -0
  300. package/skills/app-builder/scripts/report-build-status.mjs +83 -0
  301. package/skills/rudder-docs/SKILL.md +2 -2
  302. package/skills/rudder-docs/evals/retrieval-authority-evals.json +40 -0
  303. package/skills/rudder-docs/evals/trigger-evals.json +2 -2
  304. package/skills/rudder-docs/references/api-reference.md +0 -2
  305. package/skills/rudder-docs/references/cli-reference.md +7 -2
  306. package/skills/rudder-docs/references/operating-practices.md +10 -6
  307. package/skills/rudder-docs/references/plugin-authoring.md +38 -114
  308. package/skills/rudder-docs/references/source-map.md +2 -0
  309. package/ui-dist/assets/{LibraryLiveSurface-cHCJmmsl.js → LibraryLiveSurface-D4uCo0l0.js} +1 -1
  310. package/ui-dist/assets/{abnfDiagram-VRR7QNED-BORJvkew.js → abnfDiagram-VRR7QNED-FF2qcR6A.js} +1 -1
  311. package/ui-dist/assets/addon-fit-4gL7JXzc.js +1 -0
  312. package/ui-dist/assets/{arc-DPUzhx87.js → arc-D5pLjh6B.js} +1 -1
  313. package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR-Bz_hY8LM.js → architectureDiagram-ZJ3FMSHR-BvqY-HXg.js} +1 -1
  314. package/ui-dist/assets/{blockDiagram-677ZJIJ3-Bq1X3YkP.js → blockDiagram-677ZJIJ3-BU6ZbJ0s.js} +1 -1
  315. package/ui-dist/assets/{c4Diagram-LMCZKHZV-BawEM9Pc.js → c4Diagram-LMCZKHZV-Cl5Gsovj.js} +1 -1
  316. package/ui-dist/assets/channel-HcmprA3I.js +1 -0
  317. package/ui-dist/assets/{chunk-2Q5K7J3B-D0D5ZOaA.js → chunk-2Q5K7J3B-4a2agt_p.js} +1 -1
  318. package/ui-dist/assets/{chunk-32BRIVSS-T90P7lug.js → chunk-32BRIVSS-CF0oOO2T.js} +1 -1
  319. package/ui-dist/assets/{chunk-5VM5RSS4-jcAERTgh.js → chunk-5VM5RSS4-CsSq2zX2.js} +1 -1
  320. package/ui-dist/assets/{chunk-EX3LRPZG-t9-JXwnR.js → chunk-EX3LRPZG-B6riETVZ.js} +1 -1
  321. package/ui-dist/assets/{chunk-JWPE2WC7-hqgD1saC.js → chunk-JWPE2WC7-S-p1xu0r.js} +1 -1
  322. package/ui-dist/assets/{chunk-MOJQB5TN-BsSUoYzd.js → chunk-MOJQB5TN-mVE4v_LV.js} +1 -1
  323. package/ui-dist/assets/{chunk-RYQCIY6F-YcdDh2Zn.js → chunk-RYQCIY6F-CElbgpgs.js} +1 -1
  324. package/ui-dist/assets/{chunk-V7JOEXUC-ChFyH9Su.js → chunk-V7JOEXUC-8XM3povP.js} +1 -1
  325. package/ui-dist/assets/{chunk-VR4S4FIN-BjVK8IyX.js → chunk-VR4S4FIN-LrThp3ht.js} +1 -1
  326. package/ui-dist/assets/{chunk-XXDRQBXY-D-TvO9vT.js → chunk-XXDRQBXY-D38vLb4t.js} +1 -1
  327. package/ui-dist/assets/classDiagram-OUVF2IWQ-Dpe8LaLf.js +1 -0
  328. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-Dpe8LaLf.js +1 -0
  329. package/ui-dist/assets/{cose-bilkent-JH36ORCC-DBwhASJG.js → cose-bilkent-JH36ORCC-CmpZMaDV.js} +1 -1
  330. package/ui-dist/assets/{cynefin-VYW2F7L2-SlCRmwl2.js → cynefin-VYW2F7L2-D3RnbBvI.js} +1 -1
  331. package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-DImV6N_p.js → cynefinDiagram-TSTJHNR4-DZTcUojp.js} +1 -1
  332. package/ui-dist/assets/{dagre-VKFMJZFB-FH4Wv8Zn.js → dagre-VKFMJZFB-6jXSDi0S.js} +1 -1
  333. package/ui-dist/assets/{diagram-FQU43EPY-CrZvQjId.js → diagram-FQU43EPY-DIMm3mfS.js} +1 -1
  334. package/ui-dist/assets/{diagram-G47NLZAW-B7IGl_T3.js → diagram-G47NLZAW-Cyo22v0_.js} +1 -1
  335. package/ui-dist/assets/{diagram-NH7WQ7WH-CB4i7H1a.js → diagram-NH7WQ7WH-CHDV0nSL.js} +1 -1
  336. package/ui-dist/assets/{diagram-OA4YK3LP-DNyWPYY9.js → diagram-OA4YK3LP-Jijx9vQO.js} +1 -1
  337. package/ui-dist/assets/{diagram-WEI45ONY-BAhxbhpi.js → diagram-WEI45ONY-CcL19HLE.js} +1 -1
  338. package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-ClXtQ9qt.js → ebnfDiagram-CCIWWBDH-D94h-RFQ.js} +1 -1
  339. package/ui-dist/assets/{erDiagram-Q63AITRT-DGXiMYfn.js → erDiagram-Q63AITRT-B3ypUGZX.js} +1 -1
  340. package/ui-dist/assets/{flowDiagram-23GEKE2U-CdZ-02zc.js → flowDiagram-23GEKE2U-DjCT6Y1o.js} +1 -1
  341. package/ui-dist/assets/{ganttDiagram-NO4QXBWP-TxhzNpta.js → ganttDiagram-NO4QXBWP-C3QVhTc9.js} +1 -1
  342. package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-D6Q_w6wR.js → gitGraphDiagram-IHSO6WYX-D0trBzU5.js} +1 -1
  343. package/ui-dist/assets/{graph-CxNmbpl9.js → graph-D1zFmVUP.js} +1 -1
  344. package/ui-dist/assets/{index-Cx6oIZPm.js → index-B0GEsWui.js} +568 -593
  345. package/ui-dist/assets/{index-BA9tMBhO.js → index-B8bxQLfN.js} +1 -1
  346. package/ui-dist/assets/{index-C_nwI4Yj.js → index-BFktZ2tu.js} +1 -1
  347. package/ui-dist/assets/index-BT7dphT4.css +32 -0
  348. package/ui-dist/assets/{index-BoTz5S-X.js → index-Bk_yesiO.js} +1 -1
  349. package/ui-dist/assets/{index-CXnqg1Oq.js → index-BwutQLG1.js} +1 -1
  350. package/ui-dist/assets/{index-AkhgKOxC.js → index-CB4zr_Ku.js} +1 -1
  351. package/ui-dist/assets/{index-Rau2cGm0.js → index-CC89UPa-.js} +1 -1
  352. package/ui-dist/assets/{index-kbWUQ1um.js → index-CFWOO6yn.js} +1 -1
  353. package/ui-dist/assets/{index-DU2LI7f9.js → index-CK8u9b07.js} +1 -1
  354. package/ui-dist/assets/{index-C12QC1Ex.js → index-CRolpP90.js} +1 -1
  355. package/ui-dist/assets/{index-Bxz75ICF.js → index-CiCRRUVV.js} +1 -1
  356. package/ui-dist/assets/{index-Do78GymY.js → index-D8JG-IU9.js} +1 -1
  357. package/ui-dist/assets/{index-CW21qWFm.js → index-DKCiVvJo.js} +1 -1
  358. package/ui-dist/assets/{index-BujwWE3j.js → index-G2yfKEf_.js} +1 -1
  359. package/ui-dist/assets/{index-BQ87dGIq.js → index-or2C22bw.js} +1 -1
  360. package/ui-dist/assets/{infoDiagram-FWYZ7A6U-CnJd4-Jq.js → infoDiagram-FWYZ7A6U-Co0nkcV4.js} +1 -1
  361. package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-Bq-qc3pD.js → ishikawaDiagram-FXEZZL3T-CkIg1Jdu.js} +1 -1
  362. package/ui-dist/assets/{journeyDiagram-5HDEW3XC-NSmpUGUA.js → journeyDiagram-5HDEW3XC-AYUT6JuJ.js} +1 -1
  363. package/ui-dist/assets/{kanban-definition-HUTT4EX6-D7pgWtfA.js → kanban-definition-HUTT4EX6-C3H2XW08.js} +1 -1
  364. package/ui-dist/assets/{layout-BRuo6LWe.js → layout-sZWyqNOu.js} +1 -1
  365. package/ui-dist/assets/{linear-CkaWI9Nd.js → linear-BLTYou8N.js} +1 -1
  366. package/ui-dist/assets/{map-CgA6tTpZ.js → map-zKBdHkX8.js} +1 -1
  367. package/ui-dist/assets/{mermaid.core-DrXOt-P6.js → mermaid.core-DbjdFip8.js} +4 -4
  368. package/ui-dist/assets/{mindmap-definition-LN4V7U3C-D9ImeWBe.js → mindmap-definition-LN4V7U3C-DcDNQ4GQ.js} +1 -1
  369. package/ui-dist/assets/{pegDiagram-2B236MQR-Cq-zZ_zz.js → pegDiagram-2B236MQR-BGq1PngU.js} +1 -1
  370. package/ui-dist/assets/{pieDiagram-ENE6RG2P-FgNgy726.js → pieDiagram-ENE6RG2P-BfXWRzNb.js} +1 -1
  371. package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-BxQbmGmi.js → quadrantDiagram-ABIIQ3AL-AYMVAbo1.js} +1 -1
  372. package/ui-dist/assets/{railroadDiagram-RFXS5EU6-CrpbkPH2.js → railroadDiagram-RFXS5EU6-B0PoG0Ih.js} +1 -1
  373. package/ui-dist/assets/{requirementDiagram-TGXJPOKE-DQ-65ZW6.js → requirementDiagram-TGXJPOKE-Cuuu9wfw.js} +1 -1
  374. package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-Bom0lMZm.js → sankeyDiagram-HTMAVEWB-BceAc42f.js} +1 -1
  375. package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-C1MSDLDj.js → sequenceDiagram-DBY2YBRQ-cqJ71-Rw.js} +1 -1
  376. package/ui-dist/assets/{sizeCapture-X5ZJPWSS-Bn1vxebD.js → sizeCapture-X5ZJPWSS-DQ6MibbA.js} +1 -1
  377. package/ui-dist/assets/{stateDiagram-2N3HPSRC-GRRQpmzI.js → stateDiagram-2N3HPSRC-Bdl-XY7t.js} +1 -1
  378. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-Cjj7yPIO.js +1 -0
  379. package/ui-dist/assets/{swimlanes-5IMT3BWC-BcOOCZ4q.js → swimlanes-5IMT3BWC-Dpo2HDtE.js} +2 -2
  380. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-CPmIkNCu.js +8 -0
  381. package/ui-dist/assets/{timeline-definition-FHXFAJF6-gi6amswh.js → timeline-definition-FHXFAJF6-BzmJ-xnC.js} +1 -1
  382. package/ui-dist/assets/{vennDiagram-L72KCM5P-B9uqeyQt.js → vennDiagram-L72KCM5P-BF2EI7vn.js} +1 -1
  383. package/ui-dist/assets/{wardleyDiagram-EHGQE667-BnqWAMiE.js → wardleyDiagram-EHGQE667-DM65x1i1.js} +1 -1
  384. package/ui-dist/assets/xterm-DZP7bLZ5.js +9 -0
  385. package/ui-dist/assets/{xychartDiagram-FW5EYKEG-BJXKltIN.js → xychartDiagram-FW5EYKEG-3Q2t9pdU.js} +1 -1
  386. package/ui-dist/index.html +2 -2
  387. package/dist/bootstrap/plugin-host-runtime.d.ts +0 -116
  388. package/dist/bootstrap/plugin-host-runtime.d.ts.map +0 -1
  389. package/dist/bootstrap/plugin-host-runtime.js +0 -179
  390. package/dist/bootstrap/plugin-host-runtime.js.map +0 -1
  391. package/dist/bundled-plugins/plugin-linear/README.md +0 -22
  392. package/dist/bundled-plugins/plugin-linear/dist/manifest.js +0 -183
  393. package/dist/bundled-plugins/plugin-linear/dist/manifest.js.map +0 -7
  394. package/dist/bundled-plugins/plugin-linear/dist/ui/index.js +0 -1285
  395. package/dist/bundled-plugins/plugin-linear/dist/ui/index.js.map +0 -7
  396. package/dist/bundled-plugins/plugin-linear/dist/worker.js +0 -10699
  397. package/dist/bundled-plugins/plugin-linear/dist/worker.js.map +0 -7
  398. package/dist/bundled-plugins/plugin-linear/package.json +0 -42
  399. package/dist/routes/plugin-ui-static.d.ts +0 -70
  400. package/dist/routes/plugin-ui-static.d.ts.map +0 -1
  401. package/dist/routes/plugin-ui-static.js +0 -375
  402. package/dist/routes/plugin-ui-static.js.map +0 -1
  403. package/dist/routes/plugins.d.ts +0 -120
  404. package/dist/routes/plugins.d.ts.map +0 -1
  405. package/dist/routes/plugins.js +0 -1125
  406. package/dist/routes/plugins.js.map +0 -1
  407. package/dist/routes/plugins.operations-routes.d.ts +0 -28
  408. package/dist/routes/plugins.operations-routes.d.ts.map +0 -1
  409. package/dist/routes/plugins.operations-routes.js +0 -720
  410. package/dist/routes/plugins.operations-routes.js.map +0 -1
  411. package/dist/services/plugin-capability-validator.d.ts +0 -108
  412. package/dist/services/plugin-capability-validator.d.ts.map +0 -1
  413. package/dist/services/plugin-capability-validator.js +0 -268
  414. package/dist/services/plugin-capability-validator.js.map +0 -1
  415. package/dist/services/plugin-config-validator.d.ts +0 -26
  416. package/dist/services/plugin-config-validator.d.ts.map +0 -1
  417. package/dist/services/plugin-config-validator.js +0 -41
  418. package/dist/services/plugin-config-validator.js.map +0 -1
  419. package/dist/services/plugin-dev-watcher.d.ts +0 -47
  420. package/dist/services/plugin-dev-watcher.d.ts.map +0 -1
  421. package/dist/services/plugin-dev-watcher.js +0 -275
  422. package/dist/services/plugin-dev-watcher.js.map +0 -1
  423. package/dist/services/plugin-event-bus.d.ts +0 -149
  424. package/dist/services/plugin-event-bus.d.ts.map +0 -1
  425. package/dist/services/plugin-event-bus.js +0 -258
  426. package/dist/services/plugin-event-bus.js.map +0 -1
  427. package/dist/services/plugin-host-service-cleanup.d.ts +0 -14
  428. package/dist/services/plugin-host-service-cleanup.d.ts.map +0 -1
  429. package/dist/services/plugin-host-service-cleanup.js +0 -37
  430. package/dist/services/plugin-host-service-cleanup.js.map +0 -1
  431. package/dist/services/plugin-host-services.d.ts +0 -13
  432. package/dist/services/plugin-host-services.d.ts.map +0 -1
  433. package/dist/services/plugin-host-services.js +0 -933
  434. package/dist/services/plugin-host-services.js.map +0 -1
  435. package/dist/services/plugin-job-coordinator.d.ts +0 -81
  436. package/dist/services/plugin-job-coordinator.d.ts.map +0 -1
  437. package/dist/services/plugin-job-coordinator.js +0 -172
  438. package/dist/services/plugin-job-coordinator.js.map +0 -1
  439. package/dist/services/plugin-job-scheduler.d.ts +0 -163
  440. package/dist/services/plugin-job-scheduler.d.ts.map +0 -1
  441. package/dist/services/plugin-job-scheduler.js +0 -452
  442. package/dist/services/plugin-job-scheduler.js.map +0 -1
  443. package/dist/services/plugin-job-store.d.ts +0 -208
  444. package/dist/services/plugin-job-store.d.ts.map +0 -1
  445. package/dist/services/plugin-job-store.js +0 -350
  446. package/dist/services/plugin-job-store.js.map +0 -1
  447. package/dist/services/plugin-lifecycle.d.ts +0 -240
  448. package/dist/services/plugin-lifecycle.d.ts.map +0 -1
  449. package/dist/services/plugin-lifecycle.js +0 -439
  450. package/dist/services/plugin-lifecycle.js.map +0 -1
  451. package/dist/services/plugin-loader.core.d.ts +0 -40
  452. package/dist/services/plugin-loader.core.d.ts.map +0 -1
  453. package/dist/services/plugin-loader.core.js +0 -879
  454. package/dist/services/plugin-loader.core.js.map +0 -1
  455. package/dist/services/plugin-loader.d.ts +0 -30
  456. package/dist/services/plugin-loader.d.ts.map +0 -1
  457. package/dist/services/plugin-loader.helpers.d.ts +0 -495
  458. package/dist/services/plugin-loader.helpers.d.ts.map +0 -1
  459. package/dist/services/plugin-loader.helpers.js +0 -238
  460. package/dist/services/plugin-loader.helpers.js.map +0 -1
  461. package/dist/services/plugin-loader.js +0 -30
  462. package/dist/services/plugin-loader.js.map +0 -1
  463. package/dist/services/plugin-loader.worker-paths.d.ts +0 -37
  464. package/dist/services/plugin-loader.worker-paths.d.ts.map +0 -1
  465. package/dist/services/plugin-loader.worker-paths.js +0 -62
  466. package/dist/services/plugin-loader.worker-paths.js.map +0 -1
  467. package/dist/services/plugin-log-retention.d.ts +0 -20
  468. package/dist/services/plugin-log-retention.d.ts.map +0 -1
  469. package/dist/services/plugin-log-retention.js +0 -63
  470. package/dist/services/plugin-log-retention.js.map +0 -1
  471. package/dist/services/plugin-manifest-validator.d.ts +0 -90
  472. package/dist/services/plugin-manifest-validator.d.ts.map +0 -1
  473. package/dist/services/plugin-manifest-validator.js +0 -72
  474. package/dist/services/plugin-manifest-validator.js.map +0 -1
  475. package/dist/services/plugin-registry.d.ts +0 -2542
  476. package/dist/services/plugin-registry.d.ts.map +0 -1
  477. package/dist/services/plugin-registry.js +0 -536
  478. package/dist/services/plugin-registry.js.map +0 -1
  479. package/dist/services/plugin-runtime-sandbox.d.ts +0 -40
  480. package/dist/services/plugin-runtime-sandbox.d.ts.map +0 -1
  481. package/dist/services/plugin-runtime-sandbox.js +0 -154
  482. package/dist/services/plugin-runtime-sandbox.js.map +0 -1
  483. package/dist/services/plugin-secrets-handler.d.ts +0 -81
  484. package/dist/services/plugin-secrets-handler.d.ts.map +0 -1
  485. package/dist/services/plugin-secrets-handler.js +0 -275
  486. package/dist/services/plugin-secrets-handler.js.map +0 -1
  487. package/dist/services/plugin-state-store.d.ts +0 -92
  488. package/dist/services/plugin-state-store.d.ts.map +0 -1
  489. package/dist/services/plugin-state-store.js +0 -190
  490. package/dist/services/plugin-state-store.js.map +0 -1
  491. package/dist/services/plugin-stream-bus.d.ts +0 -29
  492. package/dist/services/plugin-stream-bus.d.ts.map +0 -1
  493. package/dist/services/plugin-stream-bus.js +0 -48
  494. package/dist/services/plugin-stream-bus.js.map +0 -1
  495. package/dist/services/plugin-tool-dispatcher.d.ts +0 -180
  496. package/dist/services/plugin-tool-dispatcher.d.ts.map +0 -1
  497. package/dist/services/plugin-tool-dispatcher.js +0 -224
  498. package/dist/services/plugin-tool-dispatcher.js.map +0 -1
  499. package/dist/services/plugin-tool-registry.d.ts +0 -192
  500. package/dist/services/plugin-tool-registry.d.ts.map +0 -1
  501. package/dist/services/plugin-tool-registry.js +0 -224
  502. package/dist/services/plugin-tool-registry.js.map +0 -1
  503. package/dist/services/plugin-worker-manager.d.ts +0 -260
  504. package/dist/services/plugin-worker-manager.d.ts.map +0 -1
  505. package/dist/services/plugin-worker-manager.js +0 -836
  506. package/dist/services/plugin-worker-manager.js.map +0 -1
  507. package/ui-dist/assets/channel-C08AyYJr.js +0 -1
  508. package/ui-dist/assets/classDiagram-OUVF2IWQ-BIXq6fec.js +0 -1
  509. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-BIXq6fec.js +0 -1
  510. package/ui-dist/assets/index-BmXb0yC1.css +0 -1
  511. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-KvSJhiLM.js +0 -1
  512. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-Cr92NnJ4.js +0 -8
@@ -1,258 +0,0 @@
1
- /**
2
- * PluginEventBus — typed in-process event bus for the Rudder plugin system.
3
- *
4
- * Responsibilities:
5
- * - Deliver core domain events to subscribing plugin workers (server-side).
6
- * - Apply `EventFilter` server-side so filtered-out events never reach the handler.
7
- * - Namespace plugin-emitted events as `plugin.<pluginId>.<eventName>`.
8
- * - Guard the core namespace: plugins may not emit events with the `plugin.` prefix.
9
- * - Isolate subscriptions per plugin — a plugin cannot enumerate or interfere with
10
- * another plugin's subscriptions.
11
- * - Support wildcard subscriptions via prefix matching (e.g. `plugin.acme.linear.*`).
12
- *
13
- * The bus operates in-process. In the full out-of-process architecture the host
14
- * calls `bus.emit()` after receiving events from the DB/queue layer, and the bus
15
- * forwards to handlers that proxy the call to the relevant worker process via IPC.
16
- * That IPC layer is separate; this module only handles routing and filtering.
17
- *
18
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md — Event System
19
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md — Event Filtering
20
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md — Plugin-to-Plugin Events
21
- */
22
- // ---------------------------------------------------------------------------
23
- // Pattern matching helpers
24
- // ---------------------------------------------------------------------------
25
- /**
26
- * Returns true if the event type matches the subscription pattern.
27
- *
28
- * Matching rules:
29
- * - Exact match: `"issue.created"` matches `"issue.created"`.
30
- * - Wildcard suffix: `"plugin.acme.*"` matches any event type that starts with
31
- * `"plugin.acme."`. The wildcard `*` is only supported as a trailing token.
32
- *
33
- * No full glob syntax is supported — only trailing `*` after a `.` separator.
34
- */
35
- function matchesPattern(eventType, pattern) {
36
- if (pattern === eventType)
37
- return true;
38
- // Trailing wildcard: "plugin.foo.*" → prefix is "plugin.foo."
39
- if (pattern.endsWith(".*")) {
40
- const prefix = pattern.slice(0, -1); // remove the trailing "*", keep the "."
41
- return eventType.startsWith(prefix);
42
- }
43
- return false;
44
- }
45
- /**
46
- * Returns true if the event passes all fields of the filter.
47
- * A `null` or empty filter object passes all events.
48
- *
49
- * **Resolution strategy per field:**
50
- *
51
- * - `projectId` — checked against `event.entityId` when `entityType === "project"`,
52
- * otherwise against `payload.projectId`. This covers both direct project events
53
- * (e.g. `project.created`) and secondary events that embed a project reference in
54
- * their payload (e.g. `issue.created` with `payload.projectId`).
55
- *
56
- * - `orgId` — always resolved from `payload.orgId`. Core domain events that
57
- * belong to a organization embed the organization ID in their payload.
58
- *
59
- * - `agentId` — checked against `event.entityId` when `entityType === "agent"`,
60
- * otherwise against `payload.agentId`. Covers both direct agent lifecycle events
61
- * (e.g. `agent.created`) and run-level events with `payload.agentId` (e.g.
62
- * `agent.run.started`).
63
- *
64
- * Multiple filter fields are ANDed — all specified fields must match.
65
- */
66
- function passesFilter(event, filter) {
67
- if (!filter)
68
- return true;
69
- const payload = event.payload;
70
- if (filter.projectId !== undefined) {
71
- const projectId = event.entityType === "project"
72
- ? event.entityId
73
- : (typeof payload?.projectId === "string" ? payload.projectId : undefined);
74
- if (projectId !== filter.projectId)
75
- return false;
76
- }
77
- if (filter.orgId !== undefined) {
78
- if (event.orgId !== filter.orgId)
79
- return false;
80
- }
81
- if (filter.agentId !== undefined) {
82
- const agentId = event.entityType === "agent"
83
- ? event.entityId
84
- : (typeof payload?.agentId === "string" ? payload.agentId : undefined);
85
- if (agentId !== filter.agentId)
86
- return false;
87
- }
88
- return true;
89
- }
90
- // ---------------------------------------------------------------------------
91
- // Event bus factory
92
- // ---------------------------------------------------------------------------
93
- /**
94
- * Creates and returns a new `PluginEventBus` instance.
95
- *
96
- * A single bus instance should be shared across the server process. Each
97
- * plugin interacts with the bus through a scoped handle obtained via
98
- * {@link PluginEventBus.forPlugin}.
99
- *
100
- * @example
101
- * ```ts
102
- * const bus = createPluginEventBus();
103
- *
104
- * // Give the Linear plugin a scoped handle
105
- * const linearBus = bus.forPlugin("acme.linear");
106
- *
107
- * // Subscribe from the plugin's perspective
108
- * linearBus.subscribe("issue.created", async (event) => {
109
- * // handle event
110
- * });
111
- *
112
- * // Emit a core domain event (called by the host, not the plugin)
113
- * await bus.emit({
114
- * eventId: "evt-1",
115
- * eventType: "issue.created",
116
- * occurredAt: new Date().toISOString(),
117
- * entityId: "iss-1",
118
- * entityType: "issue",
119
- * payload: { title: "Fix login bug", projectId: "proj-1" },
120
- * });
121
- * ```
122
- */
123
- export function createPluginEventBus() {
124
- // Subscription registry: pluginKey → list of subscriptions
125
- const registry = new Map();
126
- /**
127
- * Retrieve or create the subscription list for a plugin.
128
- */
129
- function subsFor(pluginId) {
130
- let subs = registry.get(pluginId);
131
- if (!subs) {
132
- subs = [];
133
- registry.set(pluginId, subs);
134
- }
135
- return subs;
136
- }
137
- /**
138
- * Emit an event envelope to all matching subscribers across all plugins.
139
- *
140
- * Subscribers are called concurrently (Promise.all). Each handler's errors
141
- * are caught individually and collected in the returned `errors` array so a
142
- * single misbehaving plugin cannot interrupt delivery to other plugins.
143
- */
144
- async function emit(event) {
145
- const errors = [];
146
- const promises = [];
147
- for (const [pluginId, subs] of registry) {
148
- for (const sub of subs) {
149
- if (!matchesPattern(event.eventType, sub.eventPattern))
150
- continue;
151
- if (!passesFilter(event, sub.filter))
152
- continue;
153
- // Use Promise.resolve().then() so that synchronous throws from handlers
154
- // are also caught inside the promise chain. Calling
155
- // Promise.resolve(syncThrowingFn()) does NOT catch sync throws — the
156
- // throw escapes before Promise.resolve() can wrap it. Using .then()
157
- // ensures the call is deferred into the microtask queue where all
158
- // exceptions become rejections. Each .catch() swallows the rejection
159
- // and records it — the promise always resolves, so Promise.all never rejects.
160
- promises.push(Promise.resolve().then(() => sub.handler(event)).catch((error) => {
161
- errors.push({ pluginId, error });
162
- }));
163
- }
164
- }
165
- await Promise.all(promises);
166
- return { errors };
167
- }
168
- /**
169
- * Remove all subscriptions for a plugin (e.g. on worker shutdown or uninstall).
170
- */
171
- function clearPlugin(pluginId) {
172
- registry.delete(pluginId);
173
- }
174
- /**
175
- * Return a scoped handle for a specific plugin. The handle exposes only the
176
- * plugin's own subscription list and enforces the plugin namespace on `emit`.
177
- */
178
- function forPlugin(pluginId) {
179
- return {
180
- /**
181
- * Subscribe to a core domain event or a plugin-namespaced event.
182
- *
183
- * For wildcard subscriptions use a trailing `.*` pattern, e.g.
184
- * `"plugin.acme.linear.*"`.
185
- *
186
- * Requires the `events.subscribe` capability (capability enforcement is
187
- * done by the host layer before calling this method).
188
- */
189
- subscribe(eventPattern, fnOrFilter, maybeFn) {
190
- let filter = null;
191
- let handler;
192
- if (typeof fnOrFilter === "function") {
193
- handler = fnOrFilter;
194
- }
195
- else {
196
- filter = fnOrFilter;
197
- if (!maybeFn)
198
- throw new Error("Handler function is required when a filter is provided");
199
- handler = maybeFn;
200
- }
201
- subsFor(pluginId).push({ eventPattern, filter, handler });
202
- },
203
- /**
204
- * Emit a plugin-namespaced event. The event type is automatically
205
- * prefixed with `plugin.<pluginId>.` so:
206
- * - `emit("sync-done", payload)` becomes `"plugin.acme.linear.sync-done"`.
207
- *
208
- * Requires the `events.emit` capability (enforced by the host layer).
209
- *
210
- * @throws {Error} if `name` already contains the `plugin.` prefix
211
- * (prevents cross-namespace spoofing).
212
- */
213
- async emit(name, orgId, payload) {
214
- if (!name || name.trim() === "") {
215
- throw new Error(`Plugin "${pluginId}" must provide a non-empty event name.`);
216
- }
217
- if (!orgId || orgId.trim() === "") {
218
- throw new Error(`Plugin "${pluginId}" must provide a orgId when emitting events.`);
219
- }
220
- if (name.startsWith("plugin.")) {
221
- throw new Error(`Plugin "${pluginId}" must not include the "plugin." prefix when emitting events. ` +
222
- `Emit the bare event name (e.g. "sync-done") and the bus will namespace it automatically.`);
223
- }
224
- const eventType = `plugin.${pluginId}.${name}`;
225
- const event = {
226
- eventId: crypto.randomUUID(),
227
- eventType,
228
- orgId,
229
- occurredAt: new Date().toISOString(),
230
- actorType: "plugin",
231
- actorId: pluginId,
232
- payload,
233
- };
234
- return emit(event);
235
- },
236
- /** Remove all subscriptions registered by this plugin. */
237
- clear() {
238
- clearPlugin(pluginId);
239
- },
240
- };
241
- }
242
- return {
243
- emit,
244
- forPlugin,
245
- clearPlugin,
246
- /** Expose subscription count for a plugin (useful for tests and diagnostics). */
247
- subscriptionCount(pluginId) {
248
- if (pluginId !== undefined) {
249
- return registry.get(pluginId)?.length ?? 0;
250
- }
251
- let total = 0;
252
- for (const subs of registry.values())
253
- total += subs.length;
254
- return total;
255
- },
256
- };
257
- }
258
- //# sourceMappingURL=plugin-event-bus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-event-bus.js","sourceRoot":"","sources":["../../src/services/plugin-event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAqBH,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,SAAS,cAAc,CAAC,SAAiB,EAAE,OAAe;IACxD,IAA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LifecycleManager } from "./plugin-lifecycle.js";
2
- type LifecycleLike = Pick<PluginLifecycleManager, "on" | "off">;
3
- export interface PluginWorkerRuntimeEvent {
4
- type: "plugin.worker.crashed" | "plugin.worker.restarted";
5
- pluginId: string;
6
- }
7
- export interface PluginHostServiceCleanupController {
8
- handleWorkerEvent(event: PluginWorkerRuntimeEvent): void;
9
- disposeAll(): void;
10
- teardown(): void;
11
- }
12
- export declare function createPluginHostServiceCleanup(lifecycle: LifecycleLike, disposers: Map<string, () => void>): PluginHostServiceCleanupController;
13
- export {};
14
- //# sourceMappingURL=plugin-host-service-cleanup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-host-service-cleanup.d.ts","sourceRoot":"","sources":["../../src/services/plugin-host-service-cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,KAAK,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,uBAAuB,GAAG,yBAAyB,CAAC;IAC1D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kCAAkC;IACjD,iBAAiB,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACzD,UAAU,IAAI,IAAI,CAAC;IACnB,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,GACjC,kCAAkC,CAwCpC"}
@@ -1,37 +0,0 @@
1
- export function createPluginHostServiceCleanup(lifecycle, disposers) {
2
- const runDispose = (pluginId, remove = false) => {
3
- const dispose = disposers.get(pluginId);
4
- if (!dispose)
5
- return;
6
- dispose();
7
- if (remove) {
8
- disposers.delete(pluginId);
9
- }
10
- };
11
- const handleWorkerStopped = ({ pluginId }) => {
12
- runDispose(pluginId);
13
- };
14
- const handlePluginUnloaded = ({ pluginId }) => {
15
- runDispose(pluginId, true);
16
- };
17
- lifecycle.on("plugin.worker_stopped", handleWorkerStopped);
18
- lifecycle.on("plugin.unloaded", handlePluginUnloaded);
19
- return {
20
- handleWorkerEvent(event) {
21
- if (event.type === "plugin.worker.crashed") {
22
- runDispose(event.pluginId);
23
- }
24
- },
25
- disposeAll() {
26
- for (const dispose of disposers.values()) {
27
- dispose();
28
- }
29
- disposers.clear();
30
- },
31
- teardown() {
32
- lifecycle.off("plugin.worker_stopped", handleWorkerStopped);
33
- lifecycle.off("plugin.unloaded", handlePluginUnloaded);
34
- },
35
- };
36
- }
37
- //# sourceMappingURL=plugin-host-service-cleanup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-host-service-cleanup.js","sourceRoot":"","sources":["../../src/services/plugin-host-service-cleanup.ts"],"names":[],"mappings":"AAeA,MAAM,UAAU,8BAA8B,CAC5C,SAAwB,EACxB,SAAkC;IAElC,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,OAAO,EAAE,CAAC;QACV,IAAI,MAAM,EAAE,CAAC;YACX,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;QACjE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;QAClE,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,SAAS,CAAC,EAAE,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;IAC3D,SAAS,CAAC,EAAE,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IAEtD,OAAO;QACL,iBAAiB,CAAC,KAAK;YACrB,IAAI,KAAK,CAAC,IAAI,KAAK,uBAAuB,EAAE,CAAC;gBAC3C,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,UAAU;YACR,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;gBACzC,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC;QAED,QAAQ;YACN,SAAS,CAAC,GAAG,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;YAC5D,SAAS,CAAC,GAAG,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;QACzD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { Db } from "@rudderhq/db";
2
- import type { HostServices } from "@rudderhq/plugin-sdk";
3
- import type { PluginEventBus } from "./plugin-event-bus.js";
4
- /**
5
- * Flush all buffered log entries to the database in a single batch insert per
6
- * unique db instance. Errors are swallowed with a console.error fallback so
7
- * flushing never crashes the process.
8
- */
9
- export declare function flushPluginLogBuffer(): Promise<void>;
10
- export declare function buildHostServices(db: Db, pluginId: string, pluginKey: string, eventBus: PluginEventBus, notifyWorker?: (method: string, params: unknown) => void): HostServices & {
11
- dispose(): void;
12
- };
13
- //# sourceMappingURL=plugin-host-services.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-host-services.d.ts","sourceRoot":"","sources":["../../src/services/plugin-host-services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAGV,YAAY,EAKb,MAAM,sBAAsB,CAAC;AAoB9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoV5D;;;;GAIG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkC1D;AA4BD,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,EACxB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GACvD,YAAY,GAAG;IAAE,OAAO,IAAI,IAAI,CAAA;CAAE,CAuoBpC"}