@rudderhq/server 0.7.2 → 0.7.3

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 (428) 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 +20 -4
  14. package/dist/bootstrap/register-api-routes.js.map +1 -1
  15. package/dist/middleware/logger.js +2 -2
  16. package/dist/middleware/logger.js.map +1 -1
  17. package/dist/middleware/logger.test.js +26 -10
  18. package/dist/middleware/logger.test.js.map +1 -1
  19. package/dist/routes/agent-issue-creation.d.ts +25 -0
  20. package/dist/routes/agent-issue-creation.d.ts.map +1 -0
  21. package/dist/routes/agent-issue-creation.js +201 -0
  22. package/dist/routes/agent-issue-creation.js.map +1 -0
  23. package/dist/routes/app-builder.d.ts +3 -1
  24. package/dist/routes/app-builder.d.ts.map +1 -1
  25. package/dist/routes/app-builder.js +31 -11
  26. package/dist/routes/app-builder.js.map +1 -1
  27. package/dist/routes/computer.d.ts +30 -0
  28. package/dist/routes/computer.d.ts.map +1 -0
  29. package/dist/routes/computer.js +231 -0
  30. package/dist/routes/computer.js.map +1 -0
  31. package/dist/routes/health.d.ts.map +1 -1
  32. package/dist/routes/health.js +2 -0
  33. package/dist/routes/health.js.map +1 -1
  34. package/dist/routes/instance-settings.d.ts.map +1 -1
  35. package/dist/routes/instance-settings.js +3 -0
  36. package/dist/routes/instance-settings.js.map +1 -1
  37. package/dist/routes/issues.comments-attachments.d.ts.map +1 -1
  38. package/dist/routes/issues.comments-attachments.js +90 -8
  39. package/dist/routes/issues.comments-attachments.js.map +1 -1
  40. package/dist/routes/issues.d.ts.map +1 -1
  41. package/dist/routes/issues.js +12 -1
  42. package/dist/routes/issues.js.map +1 -1
  43. package/dist/routes/issues.mutations.d.ts.map +1 -1
  44. package/dist/routes/issues.mutations.js +85 -33
  45. package/dist/routes/issues.mutations.js.map +1 -1
  46. package/dist/routes/managed-mcp-runtime.d.ts.map +1 -1
  47. package/dist/routes/managed-mcp-runtime.js +109 -7
  48. package/dist/routes/managed-mcp-runtime.js.map +1 -1
  49. package/dist/routes/rudder-plugins.d.ts +4 -0
  50. package/dist/routes/rudder-plugins.d.ts.map +1 -0
  51. package/dist/routes/rudder-plugins.js +213 -0
  52. package/dist/routes/rudder-plugins.js.map +1 -0
  53. package/dist/services/activity-log.d.ts +0 -3
  54. package/dist/services/activity-log.d.ts.map +1 -1
  55. package/dist/services/activity-log.js +0 -33
  56. package/dist/services/activity-log.js.map +1 -1
  57. package/dist/services/activity.d.ts +3 -3
  58. package/dist/services/agent-issue-creation.d.ts +344 -0
  59. package/dist/services/agent-issue-creation.d.ts.map +1 -0
  60. package/dist/services/agent-issue-creation.js +675 -0
  61. package/dist/services/agent-issue-creation.js.map +1 -0
  62. package/dist/services/agent-run-context.d.ts.map +1 -1
  63. package/dist/services/agent-run-context.js +13 -2
  64. package/dist/services/agent-run-context.js.map +1 -1
  65. package/dist/services/app-builder.d.ts.map +1 -1
  66. package/dist/services/app-builder.js +24 -3
  67. package/dist/services/app-builder.js.map +1 -1
  68. package/dist/services/chat-assistant.d.ts.map +1 -1
  69. package/dist/services/chat-assistant.helpers.d.ts +1 -1
  70. package/dist/services/chat-assistant.js +11 -2
  71. package/dist/services/chat-assistant.js.map +1 -1
  72. package/dist/services/chat-generation-protocol.test.js +2 -2
  73. package/dist/services/chat-generation-protocol.test.js.map +1 -1
  74. package/dist/services/chats.d.ts +2 -2
  75. package/dist/services/computer-broker.d.ts +35 -0
  76. package/dist/services/computer-broker.d.ts.map +1 -0
  77. package/dist/services/computer-broker.js +211 -0
  78. package/dist/services/computer-broker.js.map +1 -0
  79. package/dist/services/computer-broker.test.d.ts +2 -0
  80. package/dist/services/computer-broker.test.d.ts.map +1 -0
  81. package/dist/services/computer-broker.test.js +70 -0
  82. package/dist/services/computer-broker.test.js.map +1 -0
  83. package/dist/services/computer-capability.d.ts +13 -0
  84. package/dist/services/computer-capability.d.ts.map +1 -0
  85. package/dist/services/computer-capability.js +11 -0
  86. package/dist/services/computer-capability.js.map +1 -0
  87. package/dist/services/computer-capability.test.d.ts +2 -0
  88. package/dist/services/computer-capability.test.d.ts.map +1 -0
  89. package/dist/services/computer-capability.test.js +27 -0
  90. package/dist/services/computer-capability.test.js.map +1 -0
  91. package/dist/services/finance.d.ts +1 -1
  92. package/dist/services/index.d.ts +2 -0
  93. package/dist/services/index.d.ts.map +1 -1
  94. package/dist/services/index.js +2 -0
  95. package/dist/services/index.js.map +1 -1
  96. package/dist/services/instance-settings.d.ts.map +1 -1
  97. package/dist/services/instance-settings.js +15 -2
  98. package/dist/services/instance-settings.js.map +1 -1
  99. package/dist/services/integrations/agent-integrations.d.ts +1 -1
  100. package/dist/services/issues.d.ts +86 -1
  101. package/dist/services/issues.d.ts.map +1 -1
  102. package/dist/services/issues.helpers.d.ts +4 -0
  103. package/dist/services/issues.helpers.d.ts.map +1 -1
  104. package/dist/services/issues.helpers.js +28 -6
  105. package/dist/services/issues.helpers.js.map +1 -1
  106. package/dist/services/issues.js +207 -127
  107. package/dist/services/issues.js.map +1 -1
  108. package/dist/services/knowledge-portability/organization-portability.files.d.ts +1 -1
  109. package/dist/services/knowledge-portability/organization-skills.catalog.d.ts +7 -1
  110. package/dist/services/knowledge-portability/organization-skills.catalog.d.ts.map +1 -1
  111. package/dist/services/knowledge-portability/organization-skills.catalog.js +10 -0
  112. package/dist/services/knowledge-portability/organization-skills.catalog.js.map +1 -1
  113. package/dist/services/knowledge-portability/organization-skills.d.ts +1 -0
  114. package/dist/services/knowledge-portability/organization-skills.d.ts.map +1 -1
  115. package/dist/services/knowledge-portability/organization-skills.js +36 -3
  116. package/dist/services/knowledge-portability/organization-skills.js.map +1 -1
  117. package/dist/services/mcp/managed-bindings.d.ts +3 -1
  118. package/dist/services/mcp/managed-bindings.d.ts.map +1 -1
  119. package/dist/services/mcp/managed-bindings.js +20 -3
  120. package/dist/services/mcp/managed-bindings.js.map +1 -1
  121. package/dist/services/mcp/managed-client.d.ts +15 -0
  122. package/dist/services/mcp/managed-client.d.ts.map +1 -1
  123. package/dist/services/mcp/managed-client.js +23 -1
  124. package/dist/services/mcp/managed-client.js.map +1 -1
  125. package/dist/services/mcp/managed-client.test.js +73 -9
  126. package/dist/services/mcp/managed-client.test.js.map +1 -1
  127. package/dist/services/messenger.d.ts +2 -2
  128. package/dist/services/messenger.d.ts.map +1 -1
  129. package/dist/services/messenger.js +126 -49
  130. package/dist/services/messenger.js.map +1 -1
  131. package/dist/services/product-analytics.d.ts +1 -1
  132. package/dist/services/rudder-plugins.d.ts +107 -0
  133. package/dist/services/rudder-plugins.d.ts.map +1 -0
  134. package/dist/services/rudder-plugins.js +1746 -0
  135. package/dist/services/rudder-plugins.js.map +1 -0
  136. package/dist/services/rudder-plugins.test.d.ts +2 -0
  137. package/dist/services/rudder-plugins.test.d.ts.map +1 -0
  138. package/dist/services/rudder-plugins.test.js +191 -0
  139. package/dist/services/rudder-plugins.test.js.map +1 -0
  140. package/dist/services/runtime-kernel/heartbeat.core.d.ts +1 -0
  141. package/dist/services/runtime-kernel/heartbeat.core.d.ts.map +1 -1
  142. package/dist/services/runtime-kernel/heartbeat.core.js +1 -1
  143. package/dist/services/runtime-kernel/heartbeat.core.js.map +1 -1
  144. package/dist/services/runtime-kernel/heartbeat.d.ts +53 -0
  145. package/dist/services/runtime-kernel/heartbeat.d.ts.map +1 -1
  146. package/dist/services/runtime-kernel/heartbeat.js +227 -107
  147. package/dist/services/runtime-kernel/heartbeat.js.map +1 -1
  148. package/dist/services/runtime-kernel/heartbeat.recovery.d.ts.map +1 -1
  149. package/dist/services/runtime-kernel/heartbeat.recovery.js +23 -2
  150. package/dist/services/runtime-kernel/heartbeat.recovery.js.map +1 -1
  151. package/dist/services/runtime-kernel/heartbeat.terminal.d.ts +14 -1
  152. package/dist/services/runtime-kernel/heartbeat.terminal.d.ts.map +1 -1
  153. package/dist/services/runtime-kernel/heartbeat.terminal.js +31 -0
  154. package/dist/services/runtime-kernel/heartbeat.terminal.js.map +1 -1
  155. package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts.map +1 -1
  156. package/dist/services/runtime-kernel/heartbeat.wakeup.js +35 -3
  157. package/dist/services/runtime-kernel/heartbeat.wakeup.js.map +1 -1
  158. package/package.json +18 -18
  159. package/resources/bundled-skills/app-builder/SKILL.md +39 -9
  160. package/resources/bundled-skills/app-builder/assets/scaffold/app/globals.css +109 -16
  161. package/resources/bundled-skills/app-builder/assets/scaffold/components/contacts-workspace.tsx +176 -152
  162. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/alert.tsx +12 -0
  163. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/badge.tsx +27 -0
  164. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/button.tsx +9 -7
  165. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/card.tsx +15 -3
  166. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/empty.tsx +18 -0
  167. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/field.tsx +23 -0
  168. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/input.tsx +1 -1
  169. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/label.tsx +1 -1
  170. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/separator.tsx +6 -0
  171. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/skeleton.tsx +6 -0
  172. package/resources/bundled-skills/app-builder/assets/scaffold/components/ui/table.tsx +30 -0
  173. package/resources/bundled-skills/app-builder/assets/scaffold/components.json +20 -0
  174. package/resources/bundled-skills/app-builder/assets/scaffold/next-env.d.ts +1 -1
  175. package/resources/bundled-skills/app-builder/assets/scaffold/next.config.ts +19 -0
  176. package/resources/bundled-skills/app-builder/assets/scaffold/package.json +2 -1
  177. package/resources/bundled-skills/app-builder/assets/scaffold/rudder.app.json +1 -1
  178. package/resources/bundled-skills/app-builder/assets/scaffold/rudder.ui.json +13 -0
  179. package/resources/bundled-skills/app-builder/assets/scaffold/scripts/validate-rudder-ui.mjs +50 -0
  180. package/resources/bundled-skills/app-builder/assets/scaffold/tests/e2e/app.spec.ts +35 -1
  181. package/resources/bundled-skills/app-builder/evals/evals.json +2 -1
  182. package/resources/bundled-skills/app-builder/references/design-guidelines.md +19 -2
  183. package/resources/bundled-skills/app-builder/references/rudder-ui-preset.md +73 -0
  184. package/resources/bundled-skills/app-builder/references/scaffold-contract.md +12 -0
  185. package/resources/bundled-skills/app-builder/references/verification.md +6 -0
  186. package/resources/bundled-skills/app-builder/scripts/report-build-status.mjs +83 -0
  187. package/resources/bundled-skills/rudder-docs/SKILL.md +2 -2
  188. package/resources/bundled-skills/rudder-docs/evals/retrieval-authority-evals.json +40 -0
  189. package/resources/bundled-skills/rudder-docs/evals/trigger-evals.json +2 -2
  190. package/resources/bundled-skills/rudder-docs/references/api-reference.md +0 -2
  191. package/resources/bundled-skills/rudder-docs/references/plugin-authoring.md +38 -114
  192. package/resources/bundled-skills/rudder-docs/references/source-map.md +2 -0
  193. package/skills/app-builder/SKILL.md +39 -9
  194. package/skills/app-builder/assets/scaffold/app/globals.css +109 -16
  195. package/skills/app-builder/assets/scaffold/components/contacts-workspace.tsx +176 -152
  196. package/skills/app-builder/assets/scaffold/components/ui/alert.tsx +12 -0
  197. package/skills/app-builder/assets/scaffold/components/ui/badge.tsx +27 -0
  198. package/skills/app-builder/assets/scaffold/components/ui/button.tsx +9 -7
  199. package/skills/app-builder/assets/scaffold/components/ui/card.tsx +15 -3
  200. package/skills/app-builder/assets/scaffold/components/ui/empty.tsx +18 -0
  201. package/skills/app-builder/assets/scaffold/components/ui/field.tsx +23 -0
  202. package/skills/app-builder/assets/scaffold/components/ui/input.tsx +1 -1
  203. package/skills/app-builder/assets/scaffold/components/ui/label.tsx +1 -1
  204. package/skills/app-builder/assets/scaffold/components/ui/separator.tsx +6 -0
  205. package/skills/app-builder/assets/scaffold/components/ui/skeleton.tsx +6 -0
  206. package/skills/app-builder/assets/scaffold/components/ui/table.tsx +30 -0
  207. package/skills/app-builder/assets/scaffold/components.json +20 -0
  208. package/skills/app-builder/assets/scaffold/next-env.d.ts +1 -1
  209. package/skills/app-builder/assets/scaffold/next.config.ts +19 -0
  210. package/skills/app-builder/assets/scaffold/package.json +2 -1
  211. package/skills/app-builder/assets/scaffold/rudder.app.json +1 -1
  212. package/skills/app-builder/assets/scaffold/rudder.ui.json +13 -0
  213. package/skills/app-builder/assets/scaffold/scripts/validate-rudder-ui.mjs +50 -0
  214. package/skills/app-builder/assets/scaffold/tests/e2e/app.spec.ts +35 -1
  215. package/skills/app-builder/evals/evals.json +2 -1
  216. package/skills/app-builder/references/design-guidelines.md +19 -2
  217. package/skills/app-builder/references/rudder-ui-preset.md +73 -0
  218. package/skills/app-builder/references/scaffold-contract.md +12 -0
  219. package/skills/app-builder/references/verification.md +6 -0
  220. package/skills/app-builder/scripts/report-build-status.mjs +83 -0
  221. package/skills/rudder-docs/SKILL.md +2 -2
  222. package/skills/rudder-docs/evals/retrieval-authority-evals.json +40 -0
  223. package/skills/rudder-docs/evals/trigger-evals.json +2 -2
  224. package/skills/rudder-docs/references/api-reference.md +0 -2
  225. package/skills/rudder-docs/references/plugin-authoring.md +38 -114
  226. package/skills/rudder-docs/references/source-map.md +2 -0
  227. package/ui-dist/assets/{LibraryLiveSurface-cHCJmmsl.js → LibraryLiveSurface-CoGcDfo0.js} +1 -1
  228. package/ui-dist/assets/{abnfDiagram-VRR7QNED-BORJvkew.js → abnfDiagram-VRR7QNED-BnPHHNfu.js} +1 -1
  229. package/ui-dist/assets/{arc-DPUzhx87.js → arc-CAvqQQR_.js} +1 -1
  230. package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR-Bz_hY8LM.js → architectureDiagram-ZJ3FMSHR-DDa31YAK.js} +1 -1
  231. package/ui-dist/assets/{blockDiagram-677ZJIJ3-Bq1X3YkP.js → blockDiagram-677ZJIJ3-DDXLU9Ej.js} +1 -1
  232. package/ui-dist/assets/{c4Diagram-LMCZKHZV-BawEM9Pc.js → c4Diagram-LMCZKHZV-zEm0rHCp.js} +1 -1
  233. package/ui-dist/assets/channel-M_3GhwHQ.js +1 -0
  234. package/ui-dist/assets/{chunk-2Q5K7J3B-D0D5ZOaA.js → chunk-2Q5K7J3B-y1Rw45sz.js} +1 -1
  235. package/ui-dist/assets/{chunk-32BRIVSS-T90P7lug.js → chunk-32BRIVSS-Cq8cQBba.js} +1 -1
  236. package/ui-dist/assets/{chunk-5VM5RSS4-jcAERTgh.js → chunk-5VM5RSS4-CjQA6jGI.js} +1 -1
  237. package/ui-dist/assets/{chunk-EX3LRPZG-t9-JXwnR.js → chunk-EX3LRPZG-VVYt7jh3.js} +1 -1
  238. package/ui-dist/assets/{chunk-JWPE2WC7-hqgD1saC.js → chunk-JWPE2WC7-BJC3ISop.js} +1 -1
  239. package/ui-dist/assets/{chunk-MOJQB5TN-BsSUoYzd.js → chunk-MOJQB5TN-ClZgTqQk.js} +1 -1
  240. package/ui-dist/assets/{chunk-RYQCIY6F-YcdDh2Zn.js → chunk-RYQCIY6F-DRei3pn2.js} +1 -1
  241. package/ui-dist/assets/{chunk-V7JOEXUC-ChFyH9Su.js → chunk-V7JOEXUC-BGWrQfpZ.js} +1 -1
  242. package/ui-dist/assets/{chunk-VR4S4FIN-BjVK8IyX.js → chunk-VR4S4FIN-BBYT57Lt.js} +1 -1
  243. package/ui-dist/assets/{chunk-XXDRQBXY-D-TvO9vT.js → chunk-XXDRQBXY-D7P4SoZB.js} +1 -1
  244. package/ui-dist/assets/classDiagram-OUVF2IWQ-G44FJFnB.js +1 -0
  245. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-G44FJFnB.js +1 -0
  246. package/ui-dist/assets/{cose-bilkent-JH36ORCC-DBwhASJG.js → cose-bilkent-JH36ORCC-mJXY7GQo.js} +1 -1
  247. package/ui-dist/assets/{cynefin-VYW2F7L2-SlCRmwl2.js → cynefin-VYW2F7L2-C-I_lPmH.js} +1 -1
  248. package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-DImV6N_p.js → cynefinDiagram-TSTJHNR4-Bm1S_w7H.js} +1 -1
  249. package/ui-dist/assets/{dagre-VKFMJZFB-FH4Wv8Zn.js → dagre-VKFMJZFB-BuPIm1AB.js} +1 -1
  250. package/ui-dist/assets/{diagram-FQU43EPY-CrZvQjId.js → diagram-FQU43EPY-DTBCuV0W.js} +1 -1
  251. package/ui-dist/assets/{diagram-G47NLZAW-B7IGl_T3.js → diagram-G47NLZAW-B4CK8uR2.js} +1 -1
  252. package/ui-dist/assets/{diagram-NH7WQ7WH-CB4i7H1a.js → diagram-NH7WQ7WH-BkbS0GkL.js} +1 -1
  253. package/ui-dist/assets/{diagram-OA4YK3LP-DNyWPYY9.js → diagram-OA4YK3LP-C_mkRe0c.js} +1 -1
  254. package/ui-dist/assets/{diagram-WEI45ONY-BAhxbhpi.js → diagram-WEI45ONY-CHUb3TIJ.js} +1 -1
  255. package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-ClXtQ9qt.js → ebnfDiagram-CCIWWBDH-D_lN4ZOY.js} +1 -1
  256. package/ui-dist/assets/{erDiagram-Q63AITRT-DGXiMYfn.js → erDiagram-Q63AITRT-CRnDqcsy.js} +1 -1
  257. package/ui-dist/assets/{flowDiagram-23GEKE2U-CdZ-02zc.js → flowDiagram-23GEKE2U-ChELY-8y.js} +1 -1
  258. package/ui-dist/assets/{ganttDiagram-NO4QXBWP-TxhzNpta.js → ganttDiagram-NO4QXBWP-QIML25-M.js} +1 -1
  259. package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-D6Q_w6wR.js → gitGraphDiagram-IHSO6WYX-TB_AKH8l.js} +1 -1
  260. package/ui-dist/assets/{graph-CxNmbpl9.js → graph-HKPvyYQ1.js} +1 -1
  261. package/ui-dist/assets/{index-C12QC1Ex.js → index-Ar0zIwom.js} +1 -1
  262. package/ui-dist/assets/{index-CW21qWFm.js → index-BeNxgoKd.js} +1 -1
  263. package/ui-dist/assets/{index-BujwWE3j.js → index-CB-UdrKN.js} +1 -1
  264. package/ui-dist/assets/{index-Cx6oIZPm.js → index-CfpFS1Tl.js} +555 -581
  265. package/ui-dist/assets/{index-C_nwI4Yj.js → index-CjIeIR2m.js} +1 -1
  266. package/ui-dist/assets/{index-Rau2cGm0.js → index-DCgbySwf.js} +1 -1
  267. package/ui-dist/assets/{index-Do78GymY.js → index-DDMaBNLI.js} +1 -1
  268. package/ui-dist/assets/{index-DU2LI7f9.js → index-DSZmO4bA.js} +1 -1
  269. package/ui-dist/assets/{index-BA9tMBhO.js → index-DfzFi2fx.js} +1 -1
  270. package/ui-dist/assets/{index-BoTz5S-X.js → index-DmEf_U5I.js} +1 -1
  271. package/ui-dist/assets/{index-kbWUQ1um.js → index-OfGDMJiA.js} +1 -1
  272. package/ui-dist/assets/{index-AkhgKOxC.js → index-ZzX8P4M5.js} +1 -1
  273. package/ui-dist/assets/{index-BQ87dGIq.js → index-fDtlbG8Y.js} +1 -1
  274. package/ui-dist/assets/{index-CXnqg1Oq.js → index-gdvFtffQ.js} +1 -1
  275. package/ui-dist/assets/index-noipz8bE.css +1 -0
  276. package/ui-dist/assets/{index-Bxz75ICF.js → index-rnOTiIXd.js} +1 -1
  277. package/ui-dist/assets/{infoDiagram-FWYZ7A6U-CnJd4-Jq.js → infoDiagram-FWYZ7A6U-DUR3sDTd.js} +1 -1
  278. package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-Bq-qc3pD.js → ishikawaDiagram-FXEZZL3T-CcnYT0s0.js} +1 -1
  279. package/ui-dist/assets/{journeyDiagram-5HDEW3XC-NSmpUGUA.js → journeyDiagram-5HDEW3XC-CqfbG8T1.js} +1 -1
  280. package/ui-dist/assets/{kanban-definition-HUTT4EX6-D7pgWtfA.js → kanban-definition-HUTT4EX6-CYwQM9eR.js} +1 -1
  281. package/ui-dist/assets/{layout-BRuo6LWe.js → layout-B2IlJgLE.js} +1 -1
  282. package/ui-dist/assets/{linear-CkaWI9Nd.js → linear-CcEPcfbO.js} +1 -1
  283. package/ui-dist/assets/{map-CgA6tTpZ.js → map-Bmhfvlpu.js} +1 -1
  284. package/ui-dist/assets/{mermaid.core-DrXOt-P6.js → mermaid.core-T9Q0CuQx.js} +4 -4
  285. package/ui-dist/assets/{mindmap-definition-LN4V7U3C-D9ImeWBe.js → mindmap-definition-LN4V7U3C-CRjQlwN4.js} +1 -1
  286. package/ui-dist/assets/{pegDiagram-2B236MQR-Cq-zZ_zz.js → pegDiagram-2B236MQR-DenccdY8.js} +1 -1
  287. package/ui-dist/assets/{pieDiagram-ENE6RG2P-FgNgy726.js → pieDiagram-ENE6RG2P-CPiTrJcY.js} +1 -1
  288. package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-BxQbmGmi.js → quadrantDiagram-ABIIQ3AL-fKbvGl_-.js} +1 -1
  289. package/ui-dist/assets/{railroadDiagram-RFXS5EU6-CrpbkPH2.js → railroadDiagram-RFXS5EU6-D6uOjEmA.js} +1 -1
  290. package/ui-dist/assets/{requirementDiagram-TGXJPOKE-DQ-65ZW6.js → requirementDiagram-TGXJPOKE-CQIQ387O.js} +1 -1
  291. package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-Bom0lMZm.js → sankeyDiagram-HTMAVEWB-CKrnONJL.js} +1 -1
  292. package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-C1MSDLDj.js → sequenceDiagram-DBY2YBRQ-C3vaOiZO.js} +1 -1
  293. package/ui-dist/assets/{sizeCapture-X5ZJPWSS-Bn1vxebD.js → sizeCapture-X5ZJPWSS-F39EvxY0.js} +1 -1
  294. package/ui-dist/assets/{stateDiagram-2N3HPSRC-GRRQpmzI.js → stateDiagram-2N3HPSRC-Bq2sVFQq.js} +1 -1
  295. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-B94IPtHC.js +1 -0
  296. package/ui-dist/assets/{swimlanes-5IMT3BWC-BcOOCZ4q.js → swimlanes-5IMT3BWC-CSrygB7m.js} +2 -2
  297. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-9WQr2_E9.js +8 -0
  298. package/ui-dist/assets/{timeline-definition-FHXFAJF6-gi6amswh.js → timeline-definition-FHXFAJF6-DSMMlntv.js} +1 -1
  299. package/ui-dist/assets/{vennDiagram-L72KCM5P-B9uqeyQt.js → vennDiagram-L72KCM5P-D5XH96zV.js} +1 -1
  300. package/ui-dist/assets/{wardleyDiagram-EHGQE667-BnqWAMiE.js → wardleyDiagram-EHGQE667-BXX2RFsU.js} +1 -1
  301. package/ui-dist/assets/{xychartDiagram-FW5EYKEG-BJXKltIN.js → xychartDiagram-FW5EYKEG-awBW2lwG.js} +1 -1
  302. package/ui-dist/index.html +2 -2
  303. package/dist/bootstrap/plugin-host-runtime.d.ts +0 -116
  304. package/dist/bootstrap/plugin-host-runtime.d.ts.map +0 -1
  305. package/dist/bootstrap/plugin-host-runtime.js +0 -179
  306. package/dist/bootstrap/plugin-host-runtime.js.map +0 -1
  307. package/dist/bundled-plugins/plugin-linear/README.md +0 -22
  308. package/dist/bundled-plugins/plugin-linear/dist/manifest.js +0 -183
  309. package/dist/bundled-plugins/plugin-linear/dist/manifest.js.map +0 -7
  310. package/dist/bundled-plugins/plugin-linear/dist/ui/index.js +0 -1285
  311. package/dist/bundled-plugins/plugin-linear/dist/ui/index.js.map +0 -7
  312. package/dist/bundled-plugins/plugin-linear/dist/worker.js +0 -10699
  313. package/dist/bundled-plugins/plugin-linear/dist/worker.js.map +0 -7
  314. package/dist/bundled-plugins/plugin-linear/package.json +0 -42
  315. package/dist/routes/plugin-ui-static.d.ts +0 -70
  316. package/dist/routes/plugin-ui-static.d.ts.map +0 -1
  317. package/dist/routes/plugin-ui-static.js +0 -375
  318. package/dist/routes/plugin-ui-static.js.map +0 -1
  319. package/dist/routes/plugins.d.ts +0 -120
  320. package/dist/routes/plugins.d.ts.map +0 -1
  321. package/dist/routes/plugins.js +0 -1125
  322. package/dist/routes/plugins.js.map +0 -1
  323. package/dist/routes/plugins.operations-routes.d.ts +0 -28
  324. package/dist/routes/plugins.operations-routes.d.ts.map +0 -1
  325. package/dist/routes/plugins.operations-routes.js +0 -720
  326. package/dist/routes/plugins.operations-routes.js.map +0 -1
  327. package/dist/services/plugin-capability-validator.d.ts +0 -108
  328. package/dist/services/plugin-capability-validator.d.ts.map +0 -1
  329. package/dist/services/plugin-capability-validator.js +0 -268
  330. package/dist/services/plugin-capability-validator.js.map +0 -1
  331. package/dist/services/plugin-config-validator.d.ts +0 -26
  332. package/dist/services/plugin-config-validator.d.ts.map +0 -1
  333. package/dist/services/plugin-config-validator.js +0 -41
  334. package/dist/services/plugin-config-validator.js.map +0 -1
  335. package/dist/services/plugin-dev-watcher.d.ts +0 -47
  336. package/dist/services/plugin-dev-watcher.d.ts.map +0 -1
  337. package/dist/services/plugin-dev-watcher.js +0 -275
  338. package/dist/services/plugin-dev-watcher.js.map +0 -1
  339. package/dist/services/plugin-event-bus.d.ts +0 -149
  340. package/dist/services/plugin-event-bus.d.ts.map +0 -1
  341. package/dist/services/plugin-event-bus.js +0 -258
  342. package/dist/services/plugin-event-bus.js.map +0 -1
  343. package/dist/services/plugin-host-service-cleanup.d.ts +0 -14
  344. package/dist/services/plugin-host-service-cleanup.d.ts.map +0 -1
  345. package/dist/services/plugin-host-service-cleanup.js +0 -37
  346. package/dist/services/plugin-host-service-cleanup.js.map +0 -1
  347. package/dist/services/plugin-host-services.d.ts +0 -13
  348. package/dist/services/plugin-host-services.d.ts.map +0 -1
  349. package/dist/services/plugin-host-services.js +0 -933
  350. package/dist/services/plugin-host-services.js.map +0 -1
  351. package/dist/services/plugin-job-coordinator.d.ts +0 -81
  352. package/dist/services/plugin-job-coordinator.d.ts.map +0 -1
  353. package/dist/services/plugin-job-coordinator.js +0 -172
  354. package/dist/services/plugin-job-coordinator.js.map +0 -1
  355. package/dist/services/plugin-job-scheduler.d.ts +0 -163
  356. package/dist/services/plugin-job-scheduler.d.ts.map +0 -1
  357. package/dist/services/plugin-job-scheduler.js +0 -452
  358. package/dist/services/plugin-job-scheduler.js.map +0 -1
  359. package/dist/services/plugin-job-store.d.ts +0 -208
  360. package/dist/services/plugin-job-store.d.ts.map +0 -1
  361. package/dist/services/plugin-job-store.js +0 -350
  362. package/dist/services/plugin-job-store.js.map +0 -1
  363. package/dist/services/plugin-lifecycle.d.ts +0 -240
  364. package/dist/services/plugin-lifecycle.d.ts.map +0 -1
  365. package/dist/services/plugin-lifecycle.js +0 -439
  366. package/dist/services/plugin-lifecycle.js.map +0 -1
  367. package/dist/services/plugin-loader.core.d.ts +0 -40
  368. package/dist/services/plugin-loader.core.d.ts.map +0 -1
  369. package/dist/services/plugin-loader.core.js +0 -879
  370. package/dist/services/plugin-loader.core.js.map +0 -1
  371. package/dist/services/plugin-loader.d.ts +0 -30
  372. package/dist/services/plugin-loader.d.ts.map +0 -1
  373. package/dist/services/plugin-loader.helpers.d.ts +0 -495
  374. package/dist/services/plugin-loader.helpers.d.ts.map +0 -1
  375. package/dist/services/plugin-loader.helpers.js +0 -238
  376. package/dist/services/plugin-loader.helpers.js.map +0 -1
  377. package/dist/services/plugin-loader.js +0 -30
  378. package/dist/services/plugin-loader.js.map +0 -1
  379. package/dist/services/plugin-loader.worker-paths.d.ts +0 -37
  380. package/dist/services/plugin-loader.worker-paths.d.ts.map +0 -1
  381. package/dist/services/plugin-loader.worker-paths.js +0 -62
  382. package/dist/services/plugin-loader.worker-paths.js.map +0 -1
  383. package/dist/services/plugin-log-retention.d.ts +0 -20
  384. package/dist/services/plugin-log-retention.d.ts.map +0 -1
  385. package/dist/services/plugin-log-retention.js +0 -63
  386. package/dist/services/plugin-log-retention.js.map +0 -1
  387. package/dist/services/plugin-manifest-validator.d.ts +0 -90
  388. package/dist/services/plugin-manifest-validator.d.ts.map +0 -1
  389. package/dist/services/plugin-manifest-validator.js +0 -72
  390. package/dist/services/plugin-manifest-validator.js.map +0 -1
  391. package/dist/services/plugin-registry.d.ts +0 -2542
  392. package/dist/services/plugin-registry.d.ts.map +0 -1
  393. package/dist/services/plugin-registry.js +0 -536
  394. package/dist/services/plugin-registry.js.map +0 -1
  395. package/dist/services/plugin-runtime-sandbox.d.ts +0 -40
  396. package/dist/services/plugin-runtime-sandbox.d.ts.map +0 -1
  397. package/dist/services/plugin-runtime-sandbox.js +0 -154
  398. package/dist/services/plugin-runtime-sandbox.js.map +0 -1
  399. package/dist/services/plugin-secrets-handler.d.ts +0 -81
  400. package/dist/services/plugin-secrets-handler.d.ts.map +0 -1
  401. package/dist/services/plugin-secrets-handler.js +0 -275
  402. package/dist/services/plugin-secrets-handler.js.map +0 -1
  403. package/dist/services/plugin-state-store.d.ts +0 -92
  404. package/dist/services/plugin-state-store.d.ts.map +0 -1
  405. package/dist/services/plugin-state-store.js +0 -190
  406. package/dist/services/plugin-state-store.js.map +0 -1
  407. package/dist/services/plugin-stream-bus.d.ts +0 -29
  408. package/dist/services/plugin-stream-bus.d.ts.map +0 -1
  409. package/dist/services/plugin-stream-bus.js +0 -48
  410. package/dist/services/plugin-stream-bus.js.map +0 -1
  411. package/dist/services/plugin-tool-dispatcher.d.ts +0 -180
  412. package/dist/services/plugin-tool-dispatcher.d.ts.map +0 -1
  413. package/dist/services/plugin-tool-dispatcher.js +0 -224
  414. package/dist/services/plugin-tool-dispatcher.js.map +0 -1
  415. package/dist/services/plugin-tool-registry.d.ts +0 -192
  416. package/dist/services/plugin-tool-registry.d.ts.map +0 -1
  417. package/dist/services/plugin-tool-registry.js +0 -224
  418. package/dist/services/plugin-tool-registry.js.map +0 -1
  419. package/dist/services/plugin-worker-manager.d.ts +0 -260
  420. package/dist/services/plugin-worker-manager.d.ts.map +0 -1
  421. package/dist/services/plugin-worker-manager.js +0 -836
  422. package/dist/services/plugin-worker-manager.js.map +0 -1
  423. package/ui-dist/assets/channel-C08AyYJr.js +0 -1
  424. package/ui-dist/assets/classDiagram-OUVF2IWQ-BIXq6fec.js +0 -1
  425. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-BIXq6fec.js +0 -1
  426. package/ui-dist/assets/index-BmXb0yC1.css +0 -1
  427. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-KvSJhiLM.js +0 -1
  428. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-Cr92NnJ4.js +0 -8
@@ -1,42 +0,0 @@
1
- {
2
- "name": "@rudderhq/plugin-linear",
3
- "version": "0.1.0",
4
- "description": "Import-first Linear connector for Rudder",
5
- "type": "module",
6
- "private": true,
7
- "exports": {
8
- ".": "./src/index.ts"
9
- },
10
- "rudderPlugin": {
11
- "manifest": "./dist/manifest.js",
12
- "worker": "./dist/worker.js",
13
- "ui": "./dist/ui/"
14
- },
15
- "scripts": {
16
- "prebuild": "node ../../../../scripts/ensure-plugin-build-deps.mjs",
17
- "build": "node ./esbuild.config.mjs",
18
- "clean": "rm -rf dist",
19
- "test": "vitest run --config ./vitest.config.ts",
20
- "typecheck": "tsc --noEmit"
21
- },
22
- "dependencies": {
23
- "@rudderhq/plugin-sdk": "workspace:*",
24
- "@rudderhq/shared": "workspace:*"
25
- },
26
- "devDependencies": {
27
- "@testing-library/jest-dom": "^6.9.1",
28
- "@testing-library/react": "^16.3.0",
29
- "@types/node": "^24.12.0",
30
- "@types/react": "^19.2.14",
31
- "@types/react-dom": "^19.2.3",
32
- "esbuild": "^0.27.4",
33
- "jsdom": "^27.0.1",
34
- "react": "^19.2.4",
35
- "react-dom": "^19.2.4",
36
- "typescript": "^5.9.3",
37
- "vitest": "^3.2.7"
38
- },
39
- "peerDependencies": {
40
- "react": ">=18"
41
- }
42
- }
@@ -1,70 +0,0 @@
1
- /**
2
- * @fileoverview Plugin UI static file serving route
3
- *
4
- * Serves plugin UI bundles from the plugin's dist/ui/ directory under the
5
- * `/_plugins/:pluginId/ui/*` namespace described in
6
- * doc/engineering/PLUGIN_RUNTIME_CONTRACT.md.
7
- *
8
- * Plugin UI bundles are pre-built ESM that the host serves as static assets.
9
- * The host dynamically imports the plugin's UI entry module from this path,
10
- * resolves the named export declared in `ui.slots[].exportName`, and mounts
11
- * it into the extension slot.
12
- *
13
- * Security:
14
- * - Path traversal is prevented by resolving the requested path and verifying
15
- * it stays within the plugin's UI directory.
16
- * - Only plugins in 'ready' status have their UI served.
17
- * - Only plugins that declare `entrypoints.ui` serve UI bundles.
18
- *
19
- * Cache Headers:
20
- * - Files with content-hash patterns in their name (e.g., `index-a1b2c3d4.js`)
21
- * receive `Cache-Control: public, max-age=31536000, immutable`.
22
- * - Other files receive `Cache-Control: public, max-age=0, must-revalidate`
23
- * with ETag-based conditional request support.
24
- *
25
- * @module server/routes/plugin-ui-static
26
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md
27
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md
28
- */
29
- import type { Db } from "@rudderhq/db";
30
- import { type PluginPackageResolutionOptions } from "../services/plugin-loader.worker-paths.js";
31
- /**
32
- * Resolve a plugin's UI directory from its package location.
33
- *
34
- * The plugin's `packageName` is stored in the DB. We resolve the package path
35
- * from the local plugin directory (DEFAULT_LOCAL_PLUGIN_DIR) by looking in
36
- * `node_modules`. If the plugin was installed from a local path, the manifest
37
- * `entrypoints.ui` path is resolved relative to the package directory.
38
- *
39
- * @param localPluginDir - The plugin installation directory
40
- * @param packageName - The npm package name
41
- * @param entrypointsUi - The UI entrypoint path from the manifest (e.g., "./dist/ui/")
42
- * @returns Absolute path to the UI directory, or null if not found
43
- */
44
- export declare function resolvePluginUiDir(localPluginDir: string, packageName: string, entrypointsUi: string, packagePath?: string | null, options?: PluginPackageResolutionOptions): string | null;
45
- /**
46
- * Options for the plugin UI static route.
47
- */
48
- export interface PluginUiStaticRouteOptions {
49
- /**
50
- * The local plugin installation directory.
51
- * This is where plugins are installed via `npm install --prefix`.
52
- * Defaults to the standard `~/.rudder/plugins/` location.
53
- */
54
- localPluginDir: string;
55
- }
56
- /**
57
- * Create an Express router that serves plugin UI static files.
58
- *
59
- * This route handles `GET /_plugins/:pluginId/ui/*` requests by:
60
- * 1. Looking up the plugin in the registry by ID or key
61
- * 2. Verifying the plugin is in 'ready' status with UI declared
62
- * 3. Resolving the file path within the plugin's dist/ui/ directory
63
- * 4. Serving the file with appropriate cache headers
64
- *
65
- * @param db - Database connection for plugin registry lookups
66
- * @param options - Configuration options
67
- * @returns Express router
68
- */
69
- export declare function pluginUiStaticRoutes(db: Db, options: PluginUiStaticRouteOptions): import("express-serve-static-core").Router;
70
- //# sourceMappingURL=plugin-ui-static.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-ui-static.d.ts","sourceRoot":"","sources":["../../src/routes/plugin-ui-static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAMvC,OAAO,EAGL,KAAK,8BAA8B,EACpC,MAAM,2CAA2C,CAAC;AA8DnD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,EAC3B,OAAO,GAAE,8BAAmC,GAC3C,MAAM,GAAG,IAAI,CAkBf;AAoBD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,0BAA0B,8CA4R/E"}
@@ -1,375 +0,0 @@
1
- /**
2
- * @fileoverview Plugin UI static file serving route
3
- *
4
- * Serves plugin UI bundles from the plugin's dist/ui/ directory under the
5
- * `/_plugins/:pluginId/ui/*` namespace described in
6
- * doc/engineering/PLUGIN_RUNTIME_CONTRACT.md.
7
- *
8
- * Plugin UI bundles are pre-built ESM that the host serves as static assets.
9
- * The host dynamically imports the plugin's UI entry module from this path,
10
- * resolves the named export declared in `ui.slots[].exportName`, and mounts
11
- * it into the extension slot.
12
- *
13
- * Security:
14
- * - Path traversal is prevented by resolving the requested path and verifying
15
- * it stays within the plugin's UI directory.
16
- * - Only plugins in 'ready' status have their UI served.
17
- * - Only plugins that declare `entrypoints.ui` serve UI bundles.
18
- *
19
- * Cache Headers:
20
- * - Files with content-hash patterns in their name (e.g., `index-a1b2c3d4.js`)
21
- * receive `Cache-Control: public, max-age=31536000, immutable`.
22
- * - Other files receive `Cache-Control: public, max-age=0, must-revalidate`
23
- * with ETag-based conditional request support.
24
- *
25
- * @module server/routes/plugin-ui-static
26
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md
27
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md
28
- */
29
- import { Router } from "express";
30
- import crypto from "node:crypto";
31
- import fs from "node:fs";
32
- import path from "node:path";
33
- import { logger } from "../middleware/logger.js";
34
- import { isPathInsideDir, resolvePluginPackageCandidateDirs, } from "../services/plugin-loader.worker-paths.js";
35
- import { pluginRegistryService } from "../services/plugin-registry.js";
36
- import { isPostgresError } from "../services/postgres-errors.js";
37
- // ---------------------------------------------------------------------------
38
- // Constants
39
- // ---------------------------------------------------------------------------
40
- /**
41
- * Regex to detect content-hashed filenames.
42
- *
43
- * Matches patterns like:
44
- * - `index-a1b2c3d4.js`
45
- * - `styles.abc123def.css`
46
- * - `chunk-ABCDEF01.mjs`
47
- *
48
- * The hash portion must be at least 8 hex characters to avoid false positives.
49
- */
50
- const CONTENT_HASH_PATTERN = /[.-][a-fA-F0-9]{8,}\.\w+$/;
51
- /**
52
- * Cache-Control header for content-hashed files.
53
- * These files are immutable by definition (the hash changes when content changes).
54
- */
55
- /** 1 year in seconds — standard for content-hashed immutable resources. */
56
- const ONE_YEAR_SECONDS = 365 * 24 * 60 * 60; // 31_536_000
57
- const CACHE_CONTROL_IMMUTABLE = `public, max-age=${ONE_YEAR_SECONDS}, immutable`;
58
- /**
59
- * Cache-Control header for non-hashed files.
60
- * These files must be revalidated on each request (ETag-based).
61
- */
62
- const CACHE_CONTROL_REVALIDATE = "public, max-age=0, must-revalidate";
63
- /**
64
- * MIME types for common plugin UI bundle file extensions.
65
- */
66
- const MIME_TYPES = {
67
- ".js": "application/javascript; charset=utf-8",
68
- ".mjs": "application/javascript; charset=utf-8",
69
- ".css": "text/css; charset=utf-8",
70
- ".json": "application/json; charset=utf-8",
71
- ".map": "application/json; charset=utf-8",
72
- ".html": "text/html; charset=utf-8",
73
- ".svg": "image/svg+xml",
74
- ".png": "image/png",
75
- ".jpg": "image/jpeg",
76
- ".jpeg": "image/jpeg",
77
- ".gif": "image/gif",
78
- ".webp": "image/webp",
79
- ".woff": "font/woff",
80
- ".woff2": "font/woff2",
81
- ".ttf": "font/ttf",
82
- ".eot": "application/vnd.ms-fontobject",
83
- ".ico": "image/x-icon",
84
- ".txt": "text/plain; charset=utf-8",
85
- };
86
- // ---------------------------------------------------------------------------
87
- // Helper
88
- // ---------------------------------------------------------------------------
89
- /**
90
- * Resolve a plugin's UI directory from its package location.
91
- *
92
- * The plugin's `packageName` is stored in the DB. We resolve the package path
93
- * from the local plugin directory (DEFAULT_LOCAL_PLUGIN_DIR) by looking in
94
- * `node_modules`. If the plugin was installed from a local path, the manifest
95
- * `entrypoints.ui` path is resolved relative to the package directory.
96
- *
97
- * @param localPluginDir - The plugin installation directory
98
- * @param packageName - The npm package name
99
- * @param entrypointsUi - The UI entrypoint path from the manifest (e.g., "./dist/ui/")
100
- * @returns Absolute path to the UI directory, or null if not found
101
- */
102
- export function resolvePluginUiDir(localPluginDir, packageName, entrypointsUi, packagePath, options = {}) {
103
- for (const packageRoot of resolvePluginPackageCandidateDirs(localPluginDir, packageName, packagePath, options)) {
104
- const uiDir = path.resolve(packageRoot, entrypointsUi);
105
- if (isPathInsideDir(uiDir, packageRoot)
106
- && fs.existsSync(uiDir)) {
107
- return uiDir;
108
- }
109
- }
110
- return null;
111
- }
112
- /**
113
- * Compute an ETag from file stat (size + mtime).
114
- * This is a lightweight approach that avoids reading the file content.
115
- */
116
- function computeETag(size, mtimeMs) {
117
- const ETAG_VERSION = "v2";
118
- const hash = crypto
119
- .createHash("md5")
120
- .update(`${ETAG_VERSION}:${size}-${mtimeMs}`)
121
- .digest("hex")
122
- .slice(0, 16);
123
- return `"${hash}"`;
124
- }
125
- /**
126
- * Create an Express router that serves plugin UI static files.
127
- *
128
- * This route handles `GET /_plugins/:pluginId/ui/*` requests by:
129
- * 1. Looking up the plugin in the registry by ID or key
130
- * 2. Verifying the plugin is in 'ready' status with UI declared
131
- * 3. Resolving the file path within the plugin's dist/ui/ directory
132
- * 4. Serving the file with appropriate cache headers
133
- *
134
- * @param db - Database connection for plugin registry lookups
135
- * @param options - Configuration options
136
- * @returns Express router
137
- */
138
- export function pluginUiStaticRoutes(db, options) {
139
- const router = Router();
140
- const registry = pluginRegistryService(db);
141
- const log = logger.child({ service: "plugin-ui-static" });
142
- /**
143
- * GET /_plugins/:pluginId/ui/*
144
- *
145
- * Serve a static file from a plugin's UI bundle directory.
146
- *
147
- * The :pluginId parameter accepts either:
148
- * - Database UUID
149
- * - Plugin key (e.g., "acme.linear")
150
- *
151
- * The wildcard captures the relative file path within the UI directory.
152
- *
153
- * Cache strategy:
154
- * - Content-hashed filenames → immutable, 1-year max-age
155
- * - Other files → must-revalidate with ETag
156
- */
157
- router.get("/_plugins/:pluginId/ui/*filePath", async (req, res) => {
158
- const { pluginId } = req.params;
159
- // Extract the relative file path from the named wildcard.
160
- // In Express 5 with path-to-regexp v8, named wildcards may return
161
- // an array of path segments or a single string.
162
- const rawParam = req.params.filePath;
163
- const rawFilePath = Array.isArray(rawParam)
164
- ? rawParam.join("/")
165
- : rawParam;
166
- if (!rawFilePath || rawFilePath.length === 0) {
167
- res.status(400).json({ error: "File path is required" });
168
- return;
169
- }
170
- // Step 1: Look up the plugin
171
- let plugin = null;
172
- try {
173
- plugin = await registry.getById(pluginId);
174
- }
175
- catch (error) {
176
- if (!isPostgresError(error, "22P02")) {
177
- throw error;
178
- }
179
- }
180
- if (!plugin) {
181
- plugin = await registry.getByKey(pluginId);
182
- }
183
- if (!plugin) {
184
- res.status(404).json({ error: "Plugin not found" });
185
- return;
186
- }
187
- // Step 2: Verify the plugin is ready and has UI declared
188
- if (plugin.status !== "ready") {
189
- res.status(403).json({
190
- error: `Plugin UI is not available (status: ${plugin.status})`,
191
- });
192
- return;
193
- }
194
- const manifest = plugin.manifestJson;
195
- if (!manifest?.entrypoints?.ui) {
196
- res.status(404).json({ error: "Plugin does not declare a UI bundle" });
197
- return;
198
- }
199
- // Step 2b: Check for devUiUrl in plugin config — proxy to local dev server
200
- // when a plugin author has configured a dev server URL for hot-reload.
201
- // See doc/engineering/PLUGIN_RUNTIME_CONTRACT.md — Local Development Workflow
202
- try {
203
- const configRow = await registry.getConfig(plugin.id);
204
- const devUiUrl = configRow &&
205
- typeof configRow === "object" &&
206
- "configJson" in configRow &&
207
- configRow.configJson?.devUiUrl;
208
- if (typeof devUiUrl === "string" && devUiUrl.length > 0) {
209
- // Dev proxy is only available in development mode
210
- if (process.env.NODE_ENV === "production") {
211
- log.warn({ pluginId: plugin.id }, "plugin-ui-static: devUiUrl ignored in production");
212
- // Fall through to static file serving below
213
- }
214
- else {
215
- // Guard against rawFilePath overriding the base URL via protocol
216
- // scheme (e.g. "https://evil.com/x") or protocol-relative paths
217
- // (e.g. "//evil.com/x") which cause `new URL(path, base)` to
218
- // ignore the base entirely.
219
- // Normalize percent-encoding so encoded slashes (%2F) can't bypass
220
- // the protocol/path checks below.
221
- let decodedPath;
222
- try {
223
- decodedPath = decodeURIComponent(rawFilePath);
224
- }
225
- catch {
226
- res.status(400).json({ error: "Invalid file path" });
227
- return;
228
- }
229
- if (decodedPath.includes("://") ||
230
- decodedPath.startsWith("//") ||
231
- decodedPath.startsWith("\\\\")) {
232
- res.status(400).json({ error: "Invalid file path" });
233
- return;
234
- }
235
- // Proxy the request to the dev server
236
- const targetUrl = new URL(rawFilePath, devUiUrl.endsWith("/") ? devUiUrl : devUiUrl + "/");
237
- // SSRF protection: only allow http/https and localhost targets for dev proxy
238
- if (targetUrl.protocol !== "http:" && targetUrl.protocol !== "https:") {
239
- res.status(400).json({ error: "devUiUrl must use http or https protocol" });
240
- return;
241
- }
242
- // Dev proxy is restricted to loopback addresses only.
243
- // Validate the *constructed* targetUrl hostname (not the base) to
244
- // catch any path-based override that slipped past the checks above.
245
- const devHost = targetUrl.hostname;
246
- const isLoopback = devHost === "localhost" ||
247
- devHost === "127.0.0.1" ||
248
- devHost === "::1" ||
249
- devHost === "[::1]";
250
- if (!isLoopback) {
251
- log.warn({ pluginId: plugin.id, devUiUrl, host: devHost }, "plugin-ui-static: devUiUrl must target localhost, rejecting proxy");
252
- res.status(400).json({ error: "devUiUrl must target localhost" });
253
- return;
254
- }
255
- log.debug({ pluginId: plugin.id, devUiUrl, targetUrl: targetUrl.href }, "plugin-ui-static: proxying to devUiUrl");
256
- try {
257
- const controller = new AbortController();
258
- const timeout = setTimeout(() => controller.abort(), 10_000);
259
- try {
260
- const upstream = await fetch(targetUrl.href, { signal: controller.signal });
261
- if (!upstream.ok) {
262
- res.status(upstream.status).json({
263
- error: `Dev server returned ${upstream.status}`,
264
- });
265
- return;
266
- }
267
- const contentType = upstream.headers.get("content-type");
268
- if (contentType)
269
- res.set("Content-Type", contentType);
270
- res.set("Cache-Control", "no-cache, no-store, must-revalidate");
271
- const body = await upstream.arrayBuffer();
272
- res.send(Buffer.from(body));
273
- return;
274
- }
275
- finally {
276
- clearTimeout(timeout);
277
- }
278
- }
279
- catch (proxyErr) {
280
- log.warn({
281
- pluginId: plugin.id,
282
- devUiUrl,
283
- err: proxyErr instanceof Error ? proxyErr.message : String(proxyErr),
284
- }, "plugin-ui-static: failed to proxy to devUiUrl, falling back to static");
285
- // Fall through to static serving below
286
- }
287
- }
288
- }
289
- }
290
- catch {
291
- // Config lookup failure is non-fatal — fall through to static serving
292
- }
293
- // Step 3: Resolve the plugin's UI directory
294
- const uiDir = resolvePluginUiDir(options.localPluginDir, plugin.packageName, manifest.entrypoints.ui, plugin.packagePath);
295
- if (!uiDir) {
296
- log.warn({ pluginId: plugin.id, pluginKey: plugin.pluginKey, packageName: plugin.packageName }, "plugin-ui-static: UI directory not found on disk");
297
- res.status(404).json({ error: "Plugin UI directory not found" });
298
- return;
299
- }
300
- // Step 4: Resolve the requested file path and prevent traversal (including symlinks)
301
- const resolvedFilePath = path.resolve(uiDir, rawFilePath);
302
- // Step 5: Check that the file exists and is a regular file
303
- let fileStat;
304
- try {
305
- fileStat = fs.statSync(resolvedFilePath);
306
- }
307
- catch {
308
- res.status(404).json({ error: "File not found" });
309
- return;
310
- }
311
- // Security: resolve symlinks via realpathSync and verify containment.
312
- // This prevents symlink-based traversal that string-based startsWith misses.
313
- let realFilePath;
314
- let realUiDir;
315
- try {
316
- realFilePath = fs.realpathSync(resolvedFilePath);
317
- realUiDir = fs.realpathSync(uiDir);
318
- }
319
- catch {
320
- res.status(404).json({ error: "File not found" });
321
- return;
322
- }
323
- const relative = path.relative(realUiDir, realFilePath);
324
- if (relative.startsWith("..") || path.isAbsolute(relative)) {
325
- res.status(403).json({ error: "Access denied" });
326
- return;
327
- }
328
- if (!fileStat.isFile()) {
329
- res.status(404).json({ error: "File not found" });
330
- return;
331
- }
332
- // Step 6: Determine cache strategy based on filename
333
- const basename = path.basename(resolvedFilePath);
334
- const isContentHashed = CONTENT_HASH_PATTERN.test(basename);
335
- // Step 7: Set cache headers
336
- if (isContentHashed) {
337
- res.set("Cache-Control", CACHE_CONTROL_IMMUTABLE);
338
- }
339
- else {
340
- res.set("Cache-Control", CACHE_CONTROL_REVALIDATE);
341
- // Compute and set ETag for conditional request support
342
- const etag = computeETag(fileStat.size, fileStat.mtimeMs);
343
- res.set("ETag", etag);
344
- // Check If-None-Match for 304 Not Modified
345
- const ifNoneMatch = req.headers["if-none-match"];
346
- if (ifNoneMatch === etag) {
347
- res.status(304).end();
348
- return;
349
- }
350
- }
351
- // Step 8: Set Content-Type
352
- const ext = path.extname(resolvedFilePath).toLowerCase();
353
- const contentType = MIME_TYPES[ext];
354
- if (contentType) {
355
- res.set("Content-Type", contentType);
356
- }
357
- // Step 9: Set CORS headers (plugin UI may be loaded from different origin in dev)
358
- res.set("Access-Control-Allow-Origin", "*");
359
- // Step 10: Send the file
360
- // The plugin source can live in Git worktrees (e.g. ".worktrees/...").
361
- // `send` defaults to dotfiles:"ignore", which treats dot-directories as
362
- // not found. We already enforce traversal safety above, so allow dot paths.
363
- res.sendFile(resolvedFilePath, { dotfiles: "allow" }, (err) => {
364
- if (err) {
365
- log.error({ err, pluginId: plugin.id, filePath: resolvedFilePath }, "plugin-ui-static: error sending file");
366
- // Only send error if headers haven't been sent yet
367
- if (!res.headersSent) {
368
- res.status(500).json({ error: "Failed to serve file" });
369
- }
370
- }
371
- });
372
- });
373
- return router;
374
- }
375
- //# sourceMappingURL=plugin-ui-static.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-ui-static.js","sourceRoot":"","sources":["../../src/routes/plugin-ui-static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EACL,e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IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;gBACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;gBACtB,OAAO;YACT,CAAC;QACH,CAAC;QAED,2BAA2B;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC;QACzD,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,WAAW,EAAE,CAAC;YAChB,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACvC,CAAC;QAED,kFAAkF;QAClF,GAAG,CAAC,GAAG,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QAE5C,yBAAyB;QACzB,uEAAuE;QACvE,wEAAwE;QACxE,4EAA4E;QAC5E,GAAG,CAAC,QAAQ,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;YAC5D,IAAI,GAAG,EAAE,CAAC;gBACR,GAAG,CAAC,KAAK,CACP,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,EACxD,sCAAsC,CACvC,CAAC;gBACF,mDAAmD;gBACnD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;oBACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAC;gBAC1D,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,120 +0,0 @@
1
- /**
2
- * @fileoverview Plugin management REST API routes
3
- *
4
- * This module provides Express routes for managing the complete plugin lifecycle:
5
- * - Listing and filtering plugins by status
6
- * - Installing plugins from npm or local paths
7
- * - Uninstalling plugins (soft delete or hard purge)
8
- * - Enabling/disabling plugins
9
- * - Running health diagnostics
10
- * - Upgrading plugins
11
- * - Retrieving UI slot contributions for frontend rendering
12
- * - Discovering and executing plugin-contributed agent tools
13
- *
14
- * All routes require board-level authentication (assertBoard middleware).
15
- *
16
- * @module server/routes/plugins
17
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md for the current plugin runtime contract
18
- */
19
- import type { Db } from "@rudderhq/db";
20
- import type { PluginJobScheduler } from "../services/plugin-job-scheduler.js";
21
- import type { PluginJobStore } from "../services/plugin-job-store.js";
22
- import { pluginLoader } from "../services/plugin-loader.js";
23
- import type { PluginStreamBus } from "../services/plugin-stream-bus.js";
24
- import type { PluginToolDispatcher } from "../services/plugin-tool-dispatcher.js";
25
- import type { PluginWorkerManager } from "../services/plugin-worker-manager.js";
26
- /**
27
- * Optional dependencies for plugin job scheduling routes.
28
- *
29
- * When provided, job-related routes (list jobs, list runs, trigger job) are
30
- * mounted. When omitted, the routes return 501 Not Implemented.
31
- */
32
- export interface PluginRouteJobDeps {
33
- /** The job scheduler instance. */
34
- scheduler: PluginJobScheduler;
35
- /** The job persistence store. */
36
- jobStore: PluginJobStore;
37
- }
38
- /**
39
- * Optional dependencies for plugin webhook routes.
40
- *
41
- * When provided, the webhook ingestion route is enabled. When omitted,
42
- * webhook POST requests return 501 Not Implemented.
43
- */
44
- export interface PluginRouteWebhookDeps {
45
- /** The worker manager for dispatching handleWebhook RPC calls. */
46
- workerManager: PluginWorkerManager;
47
- }
48
- /**
49
- * Optional dependencies for plugin tool routes.
50
- *
51
- * When provided, tool discovery and execution routes are enabled.
52
- * When omitted, the tool routes return 501 Not Implemented.
53
- */
54
- export interface PluginRouteToolDeps {
55
- /** The tool dispatcher for listing and executing plugin tools. */
56
- toolDispatcher: PluginToolDispatcher;
57
- }
58
- /**
59
- * Optional dependencies for plugin UI bridge routes.
60
- *
61
- * When provided, the getData and performAction bridge proxy routes are enabled,
62
- * allowing plugin UI components to communicate with their worker backend via
63
- * `usePluginData()` and `usePluginAction()` hooks.
64
- *
65
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md — `getData`
66
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md — `performAction`
67
- * @see doc/engineering/PLUGIN_RUNTIME_CONTRACT.md — Error Propagation Through The Bridge
68
- */
69
- export interface PluginRouteBridgeDeps {
70
- /** The worker manager for dispatching getData/performAction RPC calls. */
71
- workerManager: PluginWorkerManager;
72
- /** Optional stream bus for SSE push from worker to UI. */
73
- streamBus?: PluginStreamBus;
74
- }
75
- /**
76
- * Create Express router for plugin management API.
77
- *
78
- * Routes provided:
79
- *
80
- * | Method | Path | Description |
81
- * |--------|------|-------------|
82
- * | GET | /plugins | List all plugins (optional ?status= filter) |
83
- * | GET | /plugins/ui-contributions | Get UI slots from ready plugins |
84
- * | GET | /plugins/:pluginId | Get single plugin by ID or key |
85
- * | POST | /plugins/install | Install from npm or local path |
86
- * | DELETE | /plugins/:pluginId | Uninstall (optional ?purge=true) |
87
- * | POST | /plugins/:pluginId/enable | Enable a plugin |
88
- * | POST | /plugins/:pluginId/disable | Disable a plugin |
89
- * | GET | /plugins/:pluginId/health | Run health diagnostics |
90
- * | POST | /plugins/:pluginId/upgrade | Upgrade to newer version |
91
- * | GET | /plugins/:pluginId/jobs | List jobs for a plugin |
92
- * | GET | /plugins/:pluginId/jobs/:jobId/runs | List runs for a job |
93
- * | POST | /plugins/:pluginId/jobs/:jobId/trigger | Manually trigger a job |
94
- * | POST | /plugins/:pluginId/webhooks/:endpointKey | Receive inbound webhook |
95
- * | GET | /plugins/tools | List all available plugin tools |
96
- * | GET | /plugins/tools?pluginId=... | List tools for a specific plugin |
97
- * | POST | /plugins/tools/execute | Execute a plugin tool |
98
- * | GET | /plugins/:pluginId/config | Get current plugin config |
99
- * | POST | /plugins/:pluginId/config | Save (upsert) plugin config |
100
- * | POST | /plugins/:pluginId/config/test | Test config via validateConfig RPC |
101
- * | POST | /plugins/:pluginId/bridge/data | Proxy getData to plugin worker |
102
- * | POST | /plugins/:pluginId/bridge/action | Proxy performAction to plugin worker |
103
- * | POST | /plugins/:pluginId/data/:key | Proxy getData to plugin worker (key in URL) |
104
- * | POST | /plugins/:pluginId/actions/:key | Proxy performAction to plugin worker (key in URL) |
105
- * | GET | /plugins/:pluginId/bridge/stream/:channel | SSE stream from worker to UI |
106
- * | GET | /plugins/:pluginId/dashboard | Aggregated health dashboard data |
107
- *
108
- * **Route Ordering Note:** Static routes (like /ui-contributions, /tools) must be
109
- * registered before parameterized routes (like /:pluginId) to prevent Express from
110
- * matching them as a plugin ID.
111
- *
112
- * @param db - Database connection instance
113
- * @param jobDeps - Optional job scheduling dependencies
114
- * @param webhookDeps - Optional webhook ingestion dependencies
115
- * @param toolDeps - Optional tool dispatcher dependencies
116
- * @param bridgeDeps - Optional bridge proxy dependencies for getData/performAction
117
- * @returns Express router with plugin routes mounted
118
- */
119
- export declare function pluginRoutes(db: Db, loader: ReturnType<typeof pluginLoader>, jobDeps?: PluginRouteJobDeps, webhookDeps?: PluginRouteWebhookDeps, toolDeps?: PluginRouteToolDeps, bridgeDeps?: PluginRouteBridgeDeps): import("express-serve-static-core").Router;
120
- //# sourceMappingURL=plugins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/routes/plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAoBvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAmC,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAu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