@rudderhq/server 0.2.5-canary.9 → 0.2.5

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 (309) hide show
  1. package/dist/bootstrap/plugin-host-runtime.d.ts +39 -39
  2. package/dist/bundled-plugins/plugin-linear/dist/worker.js +101 -147
  3. package/dist/bundled-plugins/plugin-linear/dist/worker.js.map +2 -2
  4. package/dist/bundled-plugins/plugin-linear/package.json +1 -1
  5. package/dist/routes/access-onboarding.helpers.d.ts +142 -0
  6. package/dist/routes/access-onboarding.helpers.d.ts.map +1 -0
  7. package/dist/routes/access-onboarding.helpers.js +762 -0
  8. package/dist/routes/access-onboarding.helpers.js.map +1 -0
  9. package/dist/routes/access.d.ts +2 -48
  10. package/dist/routes/access.d.ts.map +1 -1
  11. package/dist/routes/access.helpers.d.ts +109 -0
  12. package/dist/routes/access.helpers.d.ts.map +1 -0
  13. package/dist/routes/access.helpers.js +460 -0
  14. package/dist/routes/access.helpers.js.map +1 -0
  15. package/dist/routes/access.js +6 -1218
  16. package/dist/routes/access.js.map +1 -1
  17. package/dist/routes/agents.d.ts.map +1 -1
  18. package/dist/routes/agents.js +55 -1057
  19. package/dist/routes/agents.js.map +1 -1
  20. package/dist/routes/agents.management-routes.d.ts +12 -0
  21. package/dist/routes/agents.management-routes.d.ts.map +1 -0
  22. package/dist/routes/agents.management-routes.js +1067 -0
  23. package/dist/routes/agents.management-routes.js.map +1 -0
  24. package/dist/routes/chats.d.ts.map +1 -1
  25. package/dist/routes/chats.js +42 -652
  26. package/dist/routes/chats.js.map +1 -1
  27. package/dist/routes/chats.stream-routes.d.ts +12 -0
  28. package/dist/routes/chats.stream-routes.d.ts.map +1 -0
  29. package/dist/routes/chats.stream-routes.js +666 -0
  30. package/dist/routes/chats.stream-routes.js.map +1 -0
  31. package/dist/routes/issues.comments-attachments.d.ts +12 -0
  32. package/dist/routes/issues.comments-attachments.d.ts.map +1 -0
  33. package/dist/routes/issues.comments-attachments.js +511 -0
  34. package/dist/routes/issues.comments-attachments.js.map +1 -0
  35. package/dist/routes/issues.d.ts.map +1 -1
  36. package/dist/routes/issues.js +43 -1128
  37. package/dist/routes/issues.js.map +1 -1
  38. package/dist/routes/issues.mutations.d.ts +12 -0
  39. package/dist/routes/issues.mutations.d.ts.map +1 -0
  40. package/dist/routes/issues.mutations.js +635 -0
  41. package/dist/routes/issues.mutations.js.map +1 -0
  42. package/dist/routes/plugins.d.ts.map +1 -1
  43. package/dist/routes/plugins.js +14 -694
  44. package/dist/routes/plugins.js.map +1 -1
  45. package/dist/routes/plugins.operations-routes.d.ts +28 -0
  46. package/dist/routes/plugins.operations-routes.d.ts.map +1 -0
  47. package/dist/routes/plugins.operations-routes.js +720 -0
  48. package/dist/routes/plugins.operations-routes.js.map +1 -0
  49. package/dist/services/access.d.ts +21 -21
  50. package/dist/services/activity.d.ts +19 -19
  51. package/dist/services/agents.d.ts +158 -158
  52. package/dist/services/approvals.d.ts +29 -29
  53. package/dist/services/assets.d.ts +8 -8
  54. package/dist/services/automations.d.ts +41 -27
  55. package/dist/services/automations.d.ts.map +1 -1
  56. package/dist/services/automations.js +287 -110
  57. package/dist/services/automations.js.map +1 -1
  58. package/dist/services/automations.scheduler.d.ts +9 -0
  59. package/dist/services/automations.scheduler.d.ts.map +1 -0
  60. package/dist/services/automations.scheduler.js +101 -0
  61. package/dist/services/automations.scheduler.js.map +1 -0
  62. package/dist/services/board-auth.d.ts +32 -32
  63. package/dist/services/calendar.d.ts +26 -26
  64. package/dist/services/chat-assistant.d.ts +3 -47
  65. package/dist/services/chat-assistant.d.ts.map +1 -1
  66. package/dist/services/chat-assistant.helpers.d.ts +156 -0
  67. package/dist/services/chat-assistant.helpers.d.ts.map +1 -0
  68. package/dist/services/chat-assistant.helpers.js +862 -0
  69. package/dist/services/chat-assistant.helpers.js.map +1 -0
  70. package/dist/services/chat-assistant.js +2 -861
  71. package/dist/services/chat-assistant.js.map +1 -1
  72. package/dist/services/chats.d.ts +149 -247
  73. package/dist/services/chats.d.ts.map +1 -1
  74. package/dist/services/chats.helpers.d.ts +117 -0
  75. package/dist/services/chats.helpers.d.ts.map +1 -0
  76. package/dist/services/chats.helpers.js +285 -0
  77. package/dist/services/chats.helpers.js.map +1 -0
  78. package/dist/services/chats.js +6 -286
  79. package/dist/services/chats.js.map +1 -1
  80. package/dist/services/costs.d.ts +8 -8
  81. package/dist/services/finance.d.ts +18 -18
  82. package/dist/services/goals.d.ts +30 -30
  83. package/dist/services/heartbeat.d.ts +3 -1
  84. package/dist/services/heartbeat.d.ts.map +1 -1
  85. package/dist/services/heartbeat.js +3 -1
  86. package/dist/services/heartbeat.js.map +1 -1
  87. package/dist/services/issue-approvals.d.ts +4 -4
  88. package/dist/services/issue-review-wakeup.d.ts +3 -3
  89. package/dist/services/issues.comments-attachments.d.ts +141 -0
  90. package/dist/services/issues.comments-attachments.d.ts.map +1 -0
  91. package/dist/services/issues.comments-attachments.js +313 -0
  92. package/dist/services/issues.comments-attachments.js.map +1 -0
  93. package/dist/services/issues.d.ts +205 -256
  94. package/dist/services/issues.d.ts.map +1 -1
  95. package/dist/services/issues.helpers.d.ts +87 -0
  96. package/dist/services/issues.helpers.d.ts.map +1 -0
  97. package/dist/services/issues.helpers.js +270 -0
  98. package/dist/services/issues.helpers.js.map +1 -0
  99. package/dist/services/issues.js +5 -569
  100. package/dist/services/issues.js.map +1 -1
  101. package/dist/services/knowledge-portability/organization-portability.core.d.ts +210 -0
  102. package/dist/services/knowledge-portability/organization-portability.core.d.ts.map +1 -0
  103. package/dist/services/knowledge-portability/organization-portability.core.js +997 -0
  104. package/dist/services/knowledge-portability/organization-portability.core.js.map +1 -0
  105. package/dist/services/knowledge-portability/organization-portability.d.ts +6 -28
  106. package/dist/services/knowledge-portability/organization-portability.d.ts.map +1 -1
  107. package/dist/services/knowledge-portability/organization-portability.export.d.ts +24 -0
  108. package/dist/services/knowledge-portability/organization-portability.export.d.ts.map +1 -0
  109. package/dist/services/knowledge-portability/organization-portability.export.js +607 -0
  110. package/dist/services/knowledge-portability/organization-portability.export.js.map +1 -0
  111. package/dist/services/knowledge-portability/organization-portability.files.d.ts +69 -0
  112. package/dist/services/knowledge-portability/organization-portability.files.d.ts.map +1 -0
  113. package/dist/services/knowledge-portability/organization-portability.files.js +597 -0
  114. package/dist/services/knowledge-portability/organization-portability.files.js.map +1 -0
  115. package/dist/services/knowledge-portability/organization-portability.import.d.ts +31 -0
  116. package/dist/services/knowledge-portability/organization-portability.import.d.ts.map +1 -0
  117. package/dist/services/knowledge-portability/organization-portability.import.js +575 -0
  118. package/dist/services/knowledge-portability/organization-portability.import.js.map +1 -0
  119. package/dist/services/knowledge-portability/organization-portability.js +37 -3848
  120. package/dist/services/knowledge-portability/organization-portability.js.map +1 -1
  121. package/dist/services/knowledge-portability/organization-portability.package.d.ts +72 -0
  122. package/dist/services/knowledge-portability/organization-portability.package.d.ts.map +1 -0
  123. package/dist/services/knowledge-portability/organization-portability.package.js +749 -0
  124. package/dist/services/knowledge-portability/organization-portability.package.js.map +1 -0
  125. package/dist/services/knowledge-portability/organization-portability.preview.d.ts +18 -0
  126. package/dist/services/knowledge-portability/organization-portability.preview.d.ts.map +1 -0
  127. package/dist/services/knowledge-portability/organization-portability.preview.js +333 -0
  128. package/dist/services/knowledge-portability/organization-portability.preview.js.map +1 -0
  129. package/dist/services/knowledge-portability/organization-portability.resolve-source.d.ts +4 -0
  130. package/dist/services/knowledge-portability/organization-portability.resolve-source.d.ts.map +1 -0
  131. package/dist/services/knowledge-portability/organization-portability.resolve-source.js +86 -0
  132. package/dist/services/knowledge-portability/organization-portability.resolve-source.js.map +1 -0
  133. package/dist/services/knowledge-portability/organization-skills.catalog.d.ts +221 -0
  134. package/dist/services/knowledge-portability/organization-skills.catalog.d.ts.map +1 -0
  135. package/dist/services/knowledge-portability/organization-skills.catalog.js +999 -0
  136. package/dist/services/knowledge-portability/organization-skills.catalog.js.map +1 -0
  137. package/dist/services/knowledge-portability/organization-skills.d.ts +4 -75
  138. package/dist/services/knowledge-portability/organization-skills.d.ts.map +1 -1
  139. package/dist/services/knowledge-portability/organization-skills.js +11 -2008
  140. package/dist/services/knowledge-portability/organization-skills.js.map +1 -1
  141. package/dist/services/knowledge-portability/organization-skills.scans.d.ts +16 -0
  142. package/dist/services/knowledge-portability/organization-skills.scans.d.ts.map +1 -0
  143. package/dist/services/knowledge-portability/organization-skills.scans.js +300 -0
  144. package/dist/services/knowledge-portability/organization-skills.scans.js.map +1 -0
  145. package/dist/services/knowledge-portability/organization-skills.sources.d.ts +68 -0
  146. package/dist/services/knowledge-portability/organization-skills.sources.d.ts.map +1 -0
  147. package/dist/services/knowledge-portability/organization-skills.sources.js +728 -0
  148. package/dist/services/knowledge-portability/organization-skills.sources.js.map +1 -0
  149. package/dist/services/messenger.d.ts +2 -2
  150. package/dist/services/messenger.js +2 -2
  151. package/dist/services/messenger.js.map +1 -1
  152. package/dist/services/organization-skills.d.ts +3 -1
  153. package/dist/services/organization-skills.d.ts.map +1 -1
  154. package/dist/services/organization-skills.js +3 -1
  155. package/dist/services/organization-skills.js.map +1 -1
  156. package/dist/services/orgs.d.ts +9 -9
  157. package/dist/services/plugin-loader.core.d.ts +14 -0
  158. package/dist/services/plugin-loader.core.d.ts.map +1 -0
  159. package/dist/services/plugin-loader.core.js +905 -0
  160. package/dist/services/plugin-loader.core.js.map +1 -0
  161. package/dist/services/plugin-loader.d.ts +3 -440
  162. package/dist/services/plugin-loader.d.ts.map +1 -1
  163. package/dist/services/plugin-loader.helpers.d.ts +468 -0
  164. package/dist/services/plugin-loader.helpers.d.ts.map +1 -0
  165. package/dist/services/plugin-loader.helpers.js +263 -0
  166. package/dist/services/plugin-loader.helpers.js.map +1 -0
  167. package/dist/services/plugin-loader.js +3 -1191
  168. package/dist/services/plugin-loader.js.map +1 -1
  169. package/dist/services/plugin-loader.worker-paths.d.ts +7 -0
  170. package/dist/services/plugin-loader.worker-paths.d.ts.map +1 -0
  171. package/dist/services/plugin-loader.worker-paths.js +85 -0
  172. package/dist/services/plugin-loader.worker-paths.js.map +1 -0
  173. package/dist/services/plugin-registry.d.ts +123 -123
  174. package/dist/services/projects.d.ts +8 -8
  175. package/dist/services/runtime-kernel/heartbeat.core.d.ts +725 -0
  176. package/dist/services/runtime-kernel/heartbeat.core.d.ts.map +1 -0
  177. package/dist/services/runtime-kernel/heartbeat.core.js +525 -0
  178. package/dist/services/runtime-kernel/heartbeat.core.js.map +1 -0
  179. package/dist/services/runtime-kernel/heartbeat.d.ts +38 -259
  180. package/dist/services/runtime-kernel/heartbeat.d.ts.map +1 -1
  181. package/dist/services/runtime-kernel/heartbeat.execute.d.ts +5 -0
  182. package/dist/services/runtime-kernel/heartbeat.execute.d.ts.map +1 -0
  183. package/dist/services/runtime-kernel/heartbeat.execute.js +1052 -0
  184. package/dist/services/runtime-kernel/heartbeat.execute.js.map +1 -0
  185. package/dist/services/runtime-kernel/heartbeat.js +50 -4142
  186. package/dist/services/runtime-kernel/heartbeat.js.map +1 -1
  187. package/dist/services/runtime-kernel/heartbeat.misc.d.ts +30 -0
  188. package/dist/services/runtime-kernel/heartbeat.misc.d.ts.map +1 -0
  189. package/dist/services/runtime-kernel/heartbeat.misc.js +483 -0
  190. package/dist/services/runtime-kernel/heartbeat.misc.js.map +1 -0
  191. package/dist/services/runtime-kernel/heartbeat.recovery.d.ts +38 -0
  192. package/dist/services/runtime-kernel/heartbeat.recovery.d.ts.map +1 -0
  193. package/dist/services/runtime-kernel/heartbeat.recovery.js +605 -0
  194. package/dist/services/runtime-kernel/heartbeat.recovery.js.map +1 -0
  195. package/dist/services/runtime-kernel/heartbeat.release.d.ts +6 -0
  196. package/dist/services/runtime-kernel/heartbeat.release.d.ts.map +1 -0
  197. package/dist/services/runtime-kernel/heartbeat.release.js +398 -0
  198. package/dist/services/runtime-kernel/heartbeat.release.js.map +1 -0
  199. package/dist/services/runtime-kernel/heartbeat.sessions.d.ts +229 -0
  200. package/dist/services/runtime-kernel/heartbeat.sessions.d.ts.map +1 -0
  201. package/dist/services/runtime-kernel/heartbeat.sessions.js +708 -0
  202. package/dist/services/runtime-kernel/heartbeat.sessions.js.map +1 -0
  203. package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts +5 -0
  204. package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts.map +1 -0
  205. package/dist/services/runtime-kernel/heartbeat.wakeup.js +552 -0
  206. package/dist/services/runtime-kernel/heartbeat.wakeup.js.map +1 -0
  207. package/dist/services/secrets.d.ts +25 -25
  208. package/dist/services/sidebar-badges.js +1 -1
  209. package/dist/services/sidebar-badges.js.map +1 -1
  210. package/dist/services/workspace-runtime.comments.d.ts +6 -0
  211. package/dist/services/workspace-runtime.comments.d.ts.map +1 -0
  212. package/dist/services/workspace-runtime.comments.js +17 -0
  213. package/dist/services/workspace-runtime.comments.js.map +1 -0
  214. package/dist/services/workspace-runtime.d.ts +4 -163
  215. package/dist/services/workspace-runtime.d.ts.map +1 -1
  216. package/dist/services/workspace-runtime.helpers.d.ts +163 -0
  217. package/dist/services/workspace-runtime.helpers.d.ts.map +1 -0
  218. package/dist/services/workspace-runtime.helpers.js +360 -0
  219. package/dist/services/workspace-runtime.helpers.js.map +1 -0
  220. package/dist/services/workspace-runtime.js +4 -1236
  221. package/dist/services/workspace-runtime.js.map +1 -1
  222. package/dist/services/workspace-runtime.lifecycle.d.ts +35 -0
  223. package/dist/services/workspace-runtime.lifecycle.d.ts.map +1 -0
  224. package/dist/services/workspace-runtime.lifecycle.js +266 -0
  225. package/dist/services/workspace-runtime.lifecycle.js.map +1 -0
  226. package/dist/services/workspace-runtime.services.d.ts +140 -0
  227. package/dist/services/workspace-runtime.services.d.ts.map +1 -0
  228. package/dist/services/workspace-runtime.services.js +606 -0
  229. package/dist/services/workspace-runtime.services.js.map +1 -0
  230. package/package.json +21 -15
  231. package/ui-dist/assets/{_basePickBy-B5mJzzqZ.js → _basePickBy-N8I9ml5Y.js} +1 -1
  232. package/ui-dist/assets/{_baseUniq-B10Ec09o.js → _baseUniq-BuSlpRSQ.js} +1 -1
  233. package/ui-dist/assets/{arc-Bw7wimOa.js → arc-qX-dPyA1.js} +1 -1
  234. package/ui-dist/assets/{architectureDiagram-2XIMDMQ5-DZr0XEvv.js → architectureDiagram-2XIMDMQ5-DhjkbXsp.js} +1 -1
  235. package/ui-dist/assets/{blockDiagram-WCTKOSBZ-D0jl0LgB.js → blockDiagram-WCTKOSBZ-JS-tTu3J.js} +1 -1
  236. package/ui-dist/assets/{c4Diagram-IC4MRINW-BEFxBnEm.js → c4Diagram-IC4MRINW-4DqwCWIx.js} +1 -1
  237. package/ui-dist/assets/channel-CccCW5_a.js +1 -0
  238. package/ui-dist/assets/{chunk-4BX2VUAB-Cbul1GoA.js → chunk-4BX2VUAB-T37SqBpp.js} +1 -1
  239. package/ui-dist/assets/{chunk-55IACEB6-DuouC3bT.js → chunk-55IACEB6-BSj9hdqK.js} +1 -1
  240. package/ui-dist/assets/{chunk-FMBD7UC4-bN1jF9xw.js → chunk-FMBD7UC4-Dkrlh0Wk.js} +1 -1
  241. package/ui-dist/assets/{chunk-JSJVCQXG-B0-Ij6ZF.js → chunk-JSJVCQXG-C0ZE3QdB.js} +1 -1
  242. package/ui-dist/assets/{chunk-KX2RTZJC-BjI3IEjI.js → chunk-KX2RTZJC-DOZQM9gW.js} +1 -1
  243. package/ui-dist/assets/{chunk-NQ4KR5QH-MUoGr46n.js → chunk-NQ4KR5QH-5Yr3U2k8.js} +1 -1
  244. package/ui-dist/assets/{chunk-QZHKN3VN-CQoI9Ouy.js → chunk-QZHKN3VN-CvKTufwF.js} +1 -1
  245. package/ui-dist/assets/{chunk-WL4C6EOR-DSJh3iDp.js → chunk-WL4C6EOR-IoEM0jyx.js} +1 -1
  246. package/ui-dist/assets/classDiagram-VBA2DB6C-JKk4tCW2.js +1 -0
  247. package/ui-dist/assets/classDiagram-v2-RAHNMMFH-JKk4tCW2.js +1 -0
  248. package/ui-dist/assets/clone-Onaweg8D.js +1 -0
  249. package/ui-dist/assets/{cose-bilkent-S5V4N54A-BPepglgB.js → cose-bilkent-S5V4N54A-CTvr1OFj.js} +1 -1
  250. package/ui-dist/assets/{dagre-KLK3FWXG-DhnHVZkt.js → dagre-KLK3FWXG-UZ-SNjVK.js} +1 -1
  251. package/ui-dist/assets/{diagram-E7M64L7V-DNvXtoOO.js → diagram-E7M64L7V-D7RAN0Hr.js} +1 -1
  252. package/ui-dist/assets/{diagram-IFDJBPK2-DhGlDTgn.js → diagram-IFDJBPK2-B4LViaFR.js} +1 -1
  253. package/ui-dist/assets/{diagram-P4PSJMXO-BmXEloWS.js → diagram-P4PSJMXO-CY1be7ak.js} +1 -1
  254. package/ui-dist/assets/{erDiagram-INFDFZHY-BTYVzaLM.js → erDiagram-INFDFZHY-Dca0KkvJ.js} +1 -1
  255. package/ui-dist/assets/{flowDiagram-PKNHOUZH-CqMNQUVv.js → flowDiagram-PKNHOUZH-i-qMvfwg.js} +1 -1
  256. package/ui-dist/assets/{ganttDiagram-A5KZAMGK-B2le_64a.js → ganttDiagram-A5KZAMGK-Wxq2lhbh.js} +1 -1
  257. package/ui-dist/assets/{gitGraphDiagram-K3NZZRJ6-BtxOBq5A.js → gitGraphDiagram-K3NZZRJ6-DwzgPlAY.js} +1 -1
  258. package/ui-dist/assets/{graph-C5E6qFfm.js → graph-BAqf89Tz.js} +1 -1
  259. package/ui-dist/assets/{index-Piq-IPXt.js → index-4eCzaLuY.js} +1 -1
  260. package/ui-dist/assets/{index-DT6UN2ec.js → index-8uu-nKqK.js} +1 -1
  261. package/ui-dist/assets/{index-T5NVZ3nR.js → index-B-1NEcI_.js} +1 -1
  262. package/ui-dist/assets/{index-D-MoarxG.js → index-B0b_3Eu5.js} +1 -1
  263. package/ui-dist/assets/{index-CZiP3FBQ.js → index-B8v0eZjP.js} +1 -1
  264. package/ui-dist/assets/{index-C1Ga66FM.js → index-BN7Moj3u.js} +1 -1
  265. package/ui-dist/assets/{index-xBUfBdQn.js → index-BSpxh3cY.js} +1 -1
  266. package/ui-dist/assets/{index-CQcMWp51.js → index-BY44RIi9.js} +1 -1
  267. package/ui-dist/assets/{index-3a93sZNI.js → index-BhyQJhdZ.js} +1 -1
  268. package/ui-dist/assets/{index-BsVDit5y.js → index-BkPL_iGU.js} +1 -1
  269. package/ui-dist/assets/{index-88lBSTsW.js → index-BsPfoHXS.js} +1 -1
  270. package/ui-dist/assets/{index-CyJtcUF0.js → index-BstW7nmv.js} +1 -1
  271. package/ui-dist/assets/{index-BvZ0Ptfl.js → index-BwB67Zyz.js} +1 -1
  272. package/ui-dist/assets/index-C2peSkmT.css +1 -0
  273. package/ui-dist/assets/{index-vkCrQLeX.js → index-C3ktOsS_.js} +1 -1
  274. package/ui-dist/assets/{index-D2hZpQJT.js → index-CMyABlS-.js} +1 -1
  275. package/ui-dist/assets/{index-C4WCPEY4.js → index-CyBJ8ujC.js} +1 -1
  276. package/ui-dist/assets/{index-Bf7NB_lK.js → index-DAxM2W3O.js} +1 -1
  277. package/ui-dist/assets/{index-Dq7H6-Lm.js → index-DVZXPmhk.js} +1 -1
  278. package/ui-dist/assets/{index-CskDu6A3.js → index-Dc19uAyw.js} +1 -1
  279. package/ui-dist/assets/index-DzHrwZu1.js +1511 -0
  280. package/ui-dist/assets/{index-B20JneLK.js → index-LJuf53Ye.js} +1 -1
  281. package/ui-dist/assets/{index-D6McTDMQ.js → index-Ugw5VWWz.js} +1 -1
  282. package/ui-dist/assets/{index-CcVGS6HJ.js → index-YGraEFR7.js} +1 -1
  283. package/ui-dist/assets/{infoDiagram-LFFYTUFH-BiCCZcIW.js → infoDiagram-LFFYTUFH-jLmDtFVR.js} +1 -1
  284. package/ui-dist/assets/{ishikawaDiagram-PHBUUO56-BiwBemM5.js → ishikawaDiagram-PHBUUO56-6OGMyLT8.js} +1 -1
  285. package/ui-dist/assets/{journeyDiagram-4ABVD52K-D8RGr2xl.js → journeyDiagram-4ABVD52K-yQjl6E0t.js} +1 -1
  286. package/ui-dist/assets/{kanban-definition-K7BYSVSG-C733Fj-E.js → kanban-definition-K7BYSVSG-DkdCeQlS.js} +1 -1
  287. package/ui-dist/assets/{layout-CM4c3NA_.js → layout-CqSYvZ_w.js} +1 -1
  288. package/ui-dist/assets/{linear-DzH21Xsf.js → linear-B8xGZaoi.js} +1 -1
  289. package/ui-dist/assets/{mermaid.core-Z2rpoVP2.js → mermaid.core-AKL_cdyk.js} +4 -4
  290. package/ui-dist/assets/{mindmap-definition-YRQLILUH-DylLLj9w.js → mindmap-definition-YRQLILUH-Zr-dXC0x.js} +1 -1
  291. package/ui-dist/assets/{pieDiagram-SKSYHLDU-617wI_rr.js → pieDiagram-SKSYHLDU-BvDAU-Nk.js} +1 -1
  292. package/ui-dist/assets/{quadrantDiagram-337W2JSQ-lxoCPJIL.js → quadrantDiagram-337W2JSQ-Dn9kM62o.js} +1 -1
  293. package/ui-dist/assets/{requirementDiagram-Z7DCOOCP-C5XydQ9-.js → requirementDiagram-Z7DCOOCP-GIsIh7Sd.js} +1 -1
  294. package/ui-dist/assets/{sankeyDiagram-WA2Y5GQK--grmq-Q8.js → sankeyDiagram-WA2Y5GQK-CUCuBkuf.js} +1 -1
  295. package/ui-dist/assets/{sequenceDiagram-2WXFIKYE-BS2PeYH-.js → sequenceDiagram-2WXFIKYE-MDpUY2HM.js} +1 -1
  296. package/ui-dist/assets/{stateDiagram-RAJIS63D-CeuZtj2z.js → stateDiagram-RAJIS63D-BymMpuUU.js} +1 -1
  297. package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-Bi2oCU6d.js +1 -0
  298. package/ui-dist/assets/{timeline-definition-YZTLITO2-DxHdMpRr.js → timeline-definition-YZTLITO2-B6ofPhhy.js} +1 -1
  299. package/ui-dist/assets/{treemap-KZPCXAKY-Bv1ZlC5h.js → treemap-KZPCXAKY-DnLO6w1l.js} +1 -1
  300. package/ui-dist/assets/{vennDiagram-LZ73GAT5-DvpZSXY2.js → vennDiagram-LZ73GAT5-D0MyZIDl.js} +1 -1
  301. package/ui-dist/assets/{xychartDiagram-JWTSCODW-DttOu1GC.js → xychartDiagram-JWTSCODW-rADY1iUG.js} +1 -1
  302. package/ui-dist/index.html +2 -2
  303. package/ui-dist/assets/channel-DGUh6rEi.js +0 -1
  304. package/ui-dist/assets/classDiagram-VBA2DB6C-1ntk2IOV.js +0 -1
  305. package/ui-dist/assets/classDiagram-v2-RAHNMMFH-1ntk2IOV.js +0 -1
  306. package/ui-dist/assets/clone-BpddY88c.js +0 -1
  307. package/ui-dist/assets/index-C8AD6s7S.js +0 -1510
  308. package/ui-dist/assets/index-Ded0dPwB.css +0 -1
  309. package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-DXq0yC5C.js +0 -1
@@ -0,0 +1,999 @@
1
+ import { createHash } from "node:crypto";
2
+ import { promises as fs } from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import { readRudderSkillSyncPreference } from "@rudderhq/agent-runtime-utils/server-utils";
6
+ import { readSkillMetadataFromPath } from "@rudderhq/agent-runtime-utils/server-utils";
7
+ import { RUDDER_BUNDLED_SKILL_SLUGS, getBundledRudderSkillSlug, isCanonicalBundledRudderSkillKey, normalizeAgentUrlKey, resolveOrganizationSkillReference, toBundledRudderSkillKey, } from "@rudderhq/shared";
8
+ import { resolveOrganizationSkillsDir, resolveOrganizationWorkspaceRoot, } from "../../home-paths.js";
9
+ import { unprocessable } from "../../errors.js";
10
+ export const skillInventoryRefreshPromises = new Map();
11
+ export const CANONICAL_BUNDLED_SKILL_KEYS = new Set(RUDDER_BUNDLED_SKILL_SLUGS.map((slug) => `rudder/${slug}`));
12
+ export const COMMUNITY_PRESET_SKILLS = [
13
+ {
14
+ slug: "deep-research",
15
+ source: "repo",
16
+ },
17
+ {
18
+ slug: "software-product-advisor",
19
+ source: "repo",
20
+ },
21
+ ];
22
+ export const COMMUNITY_PRESET_SKILL_SLUGS = COMMUNITY_PRESET_SKILLS.map((preset) => preset.slug);
23
+ export const BUNDLED_SELECTION_PREFIX = "bundled:";
24
+ export const ORGANIZATION_SELECTION_PREFIX = "org:";
25
+ export const AGENT_SELECTION_PREFIX = "agent:";
26
+ export const GLOBAL_SELECTION_PREFIX = "global:";
27
+ export const ADAPTER_SELECTION_PREFIX = "adapter:";
28
+ export const AGENT_SKILL_SOURCE_CLASS_ORDER = {
29
+ bundled: 0,
30
+ organization: 1,
31
+ agent_home: 2,
32
+ global: 3,
33
+ adapter_home: 4,
34
+ };
35
+ export const ADAPTER_SKILL_HOME_DEFINITIONS = {
36
+ claude_local: {
37
+ mode: "ephemeral",
38
+ label: "Adapter skill",
39
+ locationLabel: "~/.claude/skills",
40
+ resolveRoot: (config) => path.join(resolveConfiguredHomeDir(config), ".claude", "skills"),
41
+ },
42
+ opencode_local: {
43
+ mode: "ephemeral",
44
+ label: "Adapter skill",
45
+ locationLabel: "~/.claude/skills",
46
+ resolveRoot: (config) => path.join(resolveConfiguredHomeDir(config), ".claude", "skills"),
47
+ },
48
+ codex_local: {
49
+ mode: "persistent",
50
+ label: "Adapter skill",
51
+ locationLabel: "~/.codex/skills",
52
+ resolveRoot: (config) => path.join(resolveConfiguredCodexHomeDir(config), "skills"),
53
+ },
54
+ cursor: {
55
+ mode: "persistent",
56
+ label: "Adapter skill",
57
+ locationLabel: "~/.cursor/skills",
58
+ resolveRoot: (config) => path.join(resolveConfiguredHomeDir(config), ".cursor", "skills"),
59
+ },
60
+ gemini_local: {
61
+ mode: "persistent",
62
+ label: "Adapter skill",
63
+ locationLabel: "~/.gemini/skills",
64
+ resolveRoot: (config) => path.join(resolveConfiguredHomeDir(config), ".gemini", "skills"),
65
+ },
66
+ pi_local: {
67
+ mode: "persistent",
68
+ label: "Adapter skill",
69
+ locationLabel: "~/.pi/agent/skills",
70
+ resolveRoot: (config) => path.join(resolveConfiguredHomeDir(config), ".pi", "agent", "skills"),
71
+ },
72
+ };
73
+ export const PROJECT_SCAN_DIRECTORY_ROOTS = [
74
+ "skills",
75
+ "skills/.curated",
76
+ "skills/.experimental",
77
+ "skills/.system",
78
+ ".agents/skills",
79
+ ".agent/skills",
80
+ ".augment/skills",
81
+ ".claude/skills",
82
+ ".codebuddy/skills",
83
+ ".commandcode/skills",
84
+ ".continue/skills",
85
+ ".cortex/skills",
86
+ ".crush/skills",
87
+ ".factory/skills",
88
+ ".goose/skills",
89
+ ".junie/skills",
90
+ ".iflow/skills",
91
+ ".kilocode/skills",
92
+ ".kiro/skills",
93
+ ".kode/skills",
94
+ ".mcpjam/skills",
95
+ ".vibe/skills",
96
+ ".mux/skills",
97
+ ".openhands/skills",
98
+ ".pi/skills",
99
+ ".qoder/skills",
100
+ ".qwen/skills",
101
+ ".roo/skills",
102
+ ".trae/skills",
103
+ ".windsurf/skills",
104
+ ".zencoder/skills",
105
+ ".neovate/skills",
106
+ ".pochi/skills",
107
+ ".adal/skills",
108
+ ];
109
+ export const PROJECT_ROOT_SKILL_SUBDIRECTORIES = [
110
+ "references",
111
+ "scripts",
112
+ "assets",
113
+ ];
114
+ export function asString(value) {
115
+ if (typeof value !== "string")
116
+ return null;
117
+ const trimmed = value.trim();
118
+ return trimmed.length > 0 ? trimmed : null;
119
+ }
120
+ export function normalizeSkillDescription(value) {
121
+ const description = asString(value);
122
+ if (!description)
123
+ return null;
124
+ return /^[>|][+-]?$/.test(description) ? null : description;
125
+ }
126
+ export function isPlainRecord(value) {
127
+ return typeof value === "object" && value !== null && !Array.isArray(value);
128
+ }
129
+ export function resolveConfigEnvRecord(config) {
130
+ return isPlainRecord(config.env) ? config.env : {};
131
+ }
132
+ export function resolveConfiguredHomeDir(config) {
133
+ const env = resolveConfigEnvRecord(config);
134
+ const configuredHome = asString(env.HOME);
135
+ return configuredHome ? path.resolve(configuredHome) : os.homedir();
136
+ }
137
+ export function resolveConfiguredCodexHomeDir(config) {
138
+ const env = resolveConfigEnvRecord(config);
139
+ const configuredCodexHome = asString(env.CODEX_HOME);
140
+ return configuredCodexHome
141
+ ? path.resolve(configuredCodexHome)
142
+ : path.join(resolveConfiguredHomeDir(config), ".codex");
143
+ }
144
+ export function normalizePortablePath(input) {
145
+ const parts = [];
146
+ for (const segment of input.replace(/\\/g, "/").replace(/^\.\/+/, "").replace(/^\/+/, "").split("/")) {
147
+ if (!segment || segment === ".")
148
+ continue;
149
+ if (segment === "..") {
150
+ if (parts.length > 0)
151
+ parts.pop();
152
+ continue;
153
+ }
154
+ parts.push(segment);
155
+ }
156
+ return parts.join("/");
157
+ }
158
+ export async function statPath(targetPath) {
159
+ return fs.stat(targetPath).catch(() => null);
160
+ }
161
+ export function normalizePackageFileMap(files) {
162
+ const out = {};
163
+ for (const [rawPath, content] of Object.entries(files)) {
164
+ const nextPath = normalizePortablePath(rawPath);
165
+ if (!nextPath)
166
+ continue;
167
+ out[nextPath] = content;
168
+ }
169
+ return out;
170
+ }
171
+ export function normalizeSkillSlug(value) {
172
+ return value ? normalizeAgentUrlKey(value) ?? null : null;
173
+ }
174
+ export function normalizeSkillKey(value) {
175
+ if (!value)
176
+ return null;
177
+ const segments = value
178
+ .split("/")
179
+ .map((segment) => normalizeSkillSlug(segment))
180
+ .filter((segment) => Boolean(segment));
181
+ return segments.length > 0 ? segments.join("/") : null;
182
+ }
183
+ export function isBundledRudderSourceKind(value) {
184
+ return value === "rudder_bundled" || value === "paperclip_bundled";
185
+ }
186
+ export function isBundledRudderSkillKey(value) {
187
+ return isCanonicalBundledRudderSkillKey(value);
188
+ }
189
+ export function buildBundledSelectionKey(skillKey) {
190
+ return `${BUNDLED_SELECTION_PREFIX}${skillKey}`;
191
+ }
192
+ export function buildOrganizationSelectionKey(skillKey) {
193
+ return `${ORGANIZATION_SELECTION_PREFIX}${skillKey}`;
194
+ }
195
+ export function buildAgentSelectionKey(slug) {
196
+ return `${AGENT_SELECTION_PREFIX}${slug}`;
197
+ }
198
+ export function buildGlobalSelectionKey(slug) {
199
+ return `${GLOBAL_SELECTION_PREFIX}${slug}`;
200
+ }
201
+ export function buildAdapterSelectionKey(agentRuntimeType, slug) {
202
+ return `${ADAPTER_SELECTION_PREFIX}${agentRuntimeType}:${slug}`;
203
+ }
204
+ export function parseSelectionKey(selectionKey) {
205
+ const trimmed = selectionKey.trim();
206
+ if (!trimmed) {
207
+ return { sourceClass: null, orgKey: null, slug: null, agentRuntimeType: null };
208
+ }
209
+ if (trimmed.startsWith(BUNDLED_SELECTION_PREFIX)) {
210
+ const orgKey = trimmed.slice(BUNDLED_SELECTION_PREFIX.length).trim();
211
+ return {
212
+ sourceClass: "bundled",
213
+ orgKey: orgKey || null,
214
+ slug: normalizeSkillSlug(orgKey.split("/").pop() ?? null),
215
+ agentRuntimeType: null,
216
+ };
217
+ }
218
+ if (trimmed.startsWith(ORGANIZATION_SELECTION_PREFIX)) {
219
+ const orgKey = trimmed.slice(ORGANIZATION_SELECTION_PREFIX.length).trim();
220
+ return {
221
+ sourceClass: "organization",
222
+ orgKey: orgKey || null,
223
+ slug: normalizeSkillSlug(orgKey.split("/").pop() ?? null),
224
+ agentRuntimeType: null,
225
+ };
226
+ }
227
+ if (trimmed.startsWith(AGENT_SELECTION_PREFIX)) {
228
+ const slug = normalizeSkillSlug(trimmed.slice(AGENT_SELECTION_PREFIX.length));
229
+ return {
230
+ sourceClass: "agent_home",
231
+ orgKey: null,
232
+ slug,
233
+ agentRuntimeType: null,
234
+ };
235
+ }
236
+ if (trimmed.startsWith(GLOBAL_SELECTION_PREFIX)) {
237
+ const slug = normalizeSkillSlug(trimmed.slice(GLOBAL_SELECTION_PREFIX.length));
238
+ return {
239
+ sourceClass: "global",
240
+ orgKey: null,
241
+ slug,
242
+ agentRuntimeType: null,
243
+ };
244
+ }
245
+ if (trimmed.startsWith(ADAPTER_SELECTION_PREFIX)) {
246
+ const payload = trimmed.slice(ADAPTER_SELECTION_PREFIX.length);
247
+ const delimiter = payload.indexOf(":");
248
+ if (delimiter <= 0) {
249
+ return { sourceClass: "adapter_home", orgKey: null, slug: null, agentRuntimeType: null };
250
+ }
251
+ return {
252
+ sourceClass: "adapter_home",
253
+ orgKey: null,
254
+ slug: normalizeSkillSlug(payload.slice(delimiter + 1)),
255
+ agentRuntimeType: payload.slice(0, delimiter).trim() || null,
256
+ };
257
+ }
258
+ return { sourceClass: null, orgKey: null, slug: null, agentRuntimeType: null };
259
+ }
260
+ export function normalizeSelectionRef(reference, skills, orgId, agentRuntimeType) {
261
+ const trimmed = reference.trim();
262
+ if (!trimmed)
263
+ return null;
264
+ const parsedSelection = parseSelectionKey(trimmed);
265
+ if (parsedSelection.sourceClass === "bundled") {
266
+ return parsedSelection.orgKey ? buildBundledSelectionKey(parsedSelection.orgKey) : null;
267
+ }
268
+ if (parsedSelection.sourceClass === "organization") {
269
+ return parsedSelection.orgKey ? buildOrganizationSelectionKey(parsedSelection.orgKey) : null;
270
+ }
271
+ if (parsedSelection.sourceClass === "agent_home") {
272
+ return parsedSelection.slug ? buildAgentSelectionKey(parsedSelection.slug) : null;
273
+ }
274
+ if (parsedSelection.sourceClass === "global") {
275
+ return parsedSelection.slug ? buildGlobalSelectionKey(parsedSelection.slug) : null;
276
+ }
277
+ if (parsedSelection.sourceClass === "adapter_home") {
278
+ if (!parsedSelection.slug || !parsedSelection.agentRuntimeType)
279
+ return null;
280
+ return buildAdapterSelectionKey(parsedSelection.agentRuntimeType, parsedSelection.slug);
281
+ }
282
+ const orgMatch = resolveSkillReference(skills, trimmed, orgId);
283
+ if (orgMatch.skill) {
284
+ if (isBundledRudderSkillKey(orgMatch.skill.key)) {
285
+ return buildBundledSelectionKey(orgMatch.skill.key);
286
+ }
287
+ return buildOrganizationSelectionKey(orgMatch.skill.key);
288
+ }
289
+ const bundledSlug = getBundledRudderSkillSlug(trimmed);
290
+ if (bundledSlug) {
291
+ const bundledKey = toBundledRudderSkillKey(bundledSlug);
292
+ return bundledKey ? buildBundledSelectionKey(bundledKey) : null;
293
+ }
294
+ const normalizedSlug = normalizeSkillSlug(trimmed);
295
+ if (!normalizedSlug)
296
+ return null;
297
+ return buildAdapterSelectionKey(agentRuntimeType, normalizedSlug);
298
+ }
299
+ export async function discoverLocalSkillDirectories(root) {
300
+ const discovered = new Set();
301
+ for (const candidateRoot of [root, path.join(root, "skills")]) {
302
+ const candidateStat = await statPath(candidateRoot);
303
+ if (!candidateStat?.isDirectory())
304
+ continue;
305
+ const entries = await fs.readdir(candidateRoot, { withFileTypes: true }).catch(() => []);
306
+ for (const entry of entries) {
307
+ if (!entry.isDirectory())
308
+ continue;
309
+ const skillDir = path.resolve(candidateRoot, entry.name);
310
+ if (!(await statPath(path.join(skillDir, "SKILL.md")))?.isFile())
311
+ continue;
312
+ discovered.add(skillDir);
313
+ }
314
+ }
315
+ return Array.from(discovered).sort((left, right) => left.localeCompare(right));
316
+ }
317
+ export async function readDiscoveredSkillEntries(orgId, root, selectionKeyForSlug, options) {
318
+ const out = [];
319
+ const seenSelectionKeys = new Set();
320
+ for (const skillDir of await discoverLocalSkillDirectories(root)) {
321
+ const slug = normalizeSkillSlug(path.basename(skillDir));
322
+ if (!slug)
323
+ continue;
324
+ const selectionKey = selectionKeyForSlug(slug);
325
+ if (seenSelectionKeys.has(selectionKey))
326
+ continue;
327
+ seenSelectionKeys.add(selectionKey);
328
+ const metadata = await readSkillMetadataFromPath(skillDir).catch(() => ({ name: null, description: null }));
329
+ out.push({
330
+ key: slug,
331
+ selectionKey,
332
+ runtimeName: slug,
333
+ description: metadata.description ?? null,
334
+ desired: false,
335
+ configurable: true,
336
+ alwaysEnabled: false,
337
+ managed: false,
338
+ state: "external",
339
+ sourceClass: options.sourceClass,
340
+ origin: "user_installed",
341
+ originLabel: options.originLabel,
342
+ locationLabel: options.locationLabel,
343
+ readOnly: false,
344
+ sourcePath: skillDir,
345
+ targetPath: null,
346
+ workspaceEditPath: resolveWorkspaceEditPath(orgId, skillDir),
347
+ detail: null,
348
+ organizationSkillKey: null,
349
+ runtimeSourcePath: skillDir,
350
+ });
351
+ }
352
+ return out;
353
+ }
354
+ export function buildDraftSkillMarkdown(input) {
355
+ return (input.markdown?.trim().length
356
+ ? input.markdown
357
+ : [
358
+ "---",
359
+ `name: ${input.name}`,
360
+ ...(input.description?.trim() ? [`description: ${input.description.trim()}`] : []),
361
+ "---",
362
+ "",
363
+ `# ${input.name}`,
364
+ "",
365
+ input.description?.trim() ? input.description.trim() : "Describe what this skill does.",
366
+ "",
367
+ ].join("\n"));
368
+ }
369
+ export function buildAgentPrivateSkillEntry(orgId, slug, skillDir, description) {
370
+ return {
371
+ key: slug,
372
+ selectionKey: buildAgentSelectionKey(slug),
373
+ runtimeName: slug,
374
+ description,
375
+ desired: false,
376
+ configurable: true,
377
+ alwaysEnabled: false,
378
+ managed: false,
379
+ state: "external",
380
+ sourceClass: "agent_home",
381
+ origin: "user_installed",
382
+ originLabel: "Agent skill",
383
+ locationLabel: "AGENT_HOME/skills",
384
+ readOnly: false,
385
+ sourcePath: skillDir,
386
+ targetPath: null,
387
+ workspaceEditPath: resolveWorkspaceEditPath(orgId, skillDir),
388
+ detail: "Installed, not enabled. Future runs will not load it until enabled.",
389
+ organizationSkillKey: null,
390
+ runtimeSourcePath: skillDir,
391
+ };
392
+ }
393
+ export function normalizeGitHubSkillDirectory(value, fallback) {
394
+ const normalized = normalizePortablePath(value ?? "");
395
+ if (!normalized)
396
+ return normalizePortablePath(fallback);
397
+ if (path.posix.basename(normalized).toLowerCase() === "skill.md") {
398
+ return normalizePortablePath(path.posix.dirname(normalized));
399
+ }
400
+ return normalized;
401
+ }
402
+ export function listStaleBundledSkillIds(existingSkills, currentBundledKeys) {
403
+ const currentKeysSet = new Set(currentBundledKeys.map((key) => {
404
+ const bundledKey = toBundledRudderSkillKey(getBundledRudderSkillSlug(key));
405
+ return bundledKey ?? key;
406
+ }));
407
+ return existingSkills
408
+ .filter((skill) => {
409
+ const sourceKind = skill.metadata?.sourceKind;
410
+ if (sourceKind !== "rudder_bundled" && sourceKind !== "paperclip_bundled") {
411
+ return false;
412
+ }
413
+ const canonicalKey = toBundledRudderSkillKey(getBundledRudderSkillSlug(skill.key)) ?? skill.key;
414
+ return !currentKeysSet.has(canonicalKey);
415
+ })
416
+ .map((skill) => skill.id);
417
+ }
418
+ export function listStaleCommunityPresetSkillIds(existingSkills, currentCommunityPresetKeys) {
419
+ const currentKeysSet = new Set(currentCommunityPresetKeys);
420
+ return existingSkills
421
+ .filter((skill) => skill.metadata?.sourceKind === "community_preset")
422
+ .filter((skill) => !currentKeysSet.has(skill.key))
423
+ .map((skill) => skill.id);
424
+ }
425
+ export function hashSkillValue(value) {
426
+ return createHash("sha256").update(value).digest("hex").slice(0, 10);
427
+ }
428
+ export function uniqueSkillSlug(baseSlug, usedSlugs) {
429
+ if (!usedSlugs.has(baseSlug))
430
+ return baseSlug;
431
+ let attempt = 2;
432
+ let candidate = `${baseSlug}-${attempt}`;
433
+ while (usedSlugs.has(candidate)) {
434
+ attempt += 1;
435
+ candidate = `${baseSlug}-${attempt}`;
436
+ }
437
+ return candidate;
438
+ }
439
+ export function uniqueImportedSkillKey(orgId, baseSlug, usedKeys) {
440
+ const initial = `organization/${orgId}/${baseSlug}`;
441
+ if (!usedKeys.has(initial))
442
+ return initial;
443
+ let attempt = 2;
444
+ let candidate = `organization/${orgId}/${baseSlug}-${attempt}`;
445
+ while (usedKeys.has(candidate)) {
446
+ attempt += 1;
447
+ candidate = `organization/${orgId}/${baseSlug}-${attempt}`;
448
+ }
449
+ return candidate;
450
+ }
451
+ export function buildSkillRuntimeName(key, slug) {
452
+ if (getBundledRudderSkillSlug(key))
453
+ return slug;
454
+ return `${slug}--${hashSkillValue(key)}`;
455
+ }
456
+ export function readCanonicalSkillKey(frontmatter, metadata) {
457
+ const direct = normalizeSkillKey(asString(frontmatter.key)
458
+ ?? asString(frontmatter.skillKey)
459
+ ?? asString(metadata?.skillKey)
460
+ ?? asString(metadata?.canonicalKey)
461
+ ?? asString(metadata?.rudderSkillKey));
462
+ if (direct)
463
+ return direct;
464
+ const rudder = isPlainRecord(metadata?.rudder) ? metadata?.rudder : null;
465
+ return normalizeSkillKey(asString(rudder?.skillKey)
466
+ ?? asString(rudder?.key));
467
+ }
468
+ export function deriveCanonicalSkillKey(orgId, input) {
469
+ const slug = normalizeSkillSlug(input.slug) ?? "skill";
470
+ const metadata = isPlainRecord(input.metadata) ? input.metadata : null;
471
+ const sourceKind = asString(metadata?.sourceKind);
472
+ const explicitKey = readCanonicalSkillKey({}, metadata);
473
+ if (explicitKey) {
474
+ if (isBundledRudderSourceKind(sourceKind)) {
475
+ return toBundledRudderSkillKey(getBundledRudderSkillSlug(explicitKey) ?? slug) ?? explicitKey;
476
+ }
477
+ return explicitKey;
478
+ }
479
+ if (isBundledRudderSourceKind(sourceKind)) {
480
+ return toBundledRudderSkillKey(slug) ?? `rudder/${slug}`;
481
+ }
482
+ if (sourceKind === "community_preset") {
483
+ return `organization/${orgId}/${slug}`;
484
+ }
485
+ const owner = normalizeSkillSlug(asString(metadata?.owner));
486
+ const repo = normalizeSkillSlug(asString(metadata?.repo));
487
+ if ((input.sourceType === "github" || input.sourceType === "skills_sh" || sourceKind === "github" || sourceKind === "skills_sh") && owner && repo) {
488
+ return `${owner}/${repo}/${slug}`;
489
+ }
490
+ if (input.sourceType === "url" || sourceKind === "url") {
491
+ const locator = asString(input.sourceLocator);
492
+ if (locator) {
493
+ try {
494
+ const url = new URL(locator);
495
+ const host = normalizeSkillSlug(url.host) ?? "url";
496
+ return `url/${host}/${hashSkillValue(locator)}/${slug}`;
497
+ }
498
+ catch {
499
+ return `url/unknown/${hashSkillValue(locator)}/${slug}`;
500
+ }
501
+ }
502
+ }
503
+ if (input.sourceType === "local_path") {
504
+ if (sourceKind === "managed_local") {
505
+ return `organization/${orgId}/${slug}`;
506
+ }
507
+ const locator = asString(input.sourceLocator);
508
+ if (locator) {
509
+ return `local/${hashSkillValue(path.resolve(locator))}/${slug}`;
510
+ }
511
+ }
512
+ return `organization/${orgId}/${slug}`;
513
+ }
514
+ export function classifyInventoryKind(relativePath) {
515
+ const normalized = normalizePortablePath(relativePath).toLowerCase();
516
+ if (normalized.endsWith("/skill.md") || normalized === "skill.md")
517
+ return "skill";
518
+ if (normalized.startsWith("references/"))
519
+ return "reference";
520
+ if (normalized.startsWith("scripts/"))
521
+ return "script";
522
+ if (normalized.startsWith("assets/"))
523
+ return "asset";
524
+ if (normalized.endsWith(".md"))
525
+ return "markdown";
526
+ const fileName = path.posix.basename(normalized);
527
+ if (fileName.endsWith(".sh")
528
+ || fileName.endsWith(".js")
529
+ || fileName.endsWith(".mjs")
530
+ || fileName.endsWith(".cjs")
531
+ || fileName.endsWith(".ts")
532
+ || fileName.endsWith(".py")
533
+ || fileName.endsWith(".rb")
534
+ || fileName.endsWith(".bash")) {
535
+ return "script";
536
+ }
537
+ if (fileName.endsWith(".png")
538
+ || fileName.endsWith(".jpg")
539
+ || fileName.endsWith(".jpeg")
540
+ || fileName.endsWith(".gif")
541
+ || fileName.endsWith(".svg")
542
+ || fileName.endsWith(".webp")
543
+ || fileName.endsWith(".pdf")) {
544
+ return "asset";
545
+ }
546
+ return "other";
547
+ }
548
+ export function deriveTrustLevel(fileInventory) {
549
+ if (fileInventory.some((entry) => entry.kind === "script"))
550
+ return "scripts_executables";
551
+ if (fileInventory.some((entry) => entry.kind === "asset" || entry.kind === "other"))
552
+ return "assets";
553
+ return "markdown_only";
554
+ }
555
+ export function toCompanySkill(row) {
556
+ return {
557
+ ...row,
558
+ description: row.description ?? null,
559
+ sourceType: row.sourceType,
560
+ sourceLocator: row.sourceLocator ?? null,
561
+ sourceRef: row.sourceRef ?? null,
562
+ trustLevel: row.trustLevel,
563
+ compatibility: row.compatibility,
564
+ fileInventory: Array.isArray(row.fileInventory)
565
+ ? row.fileInventory.flatMap((entry) => {
566
+ if (!isPlainRecord(entry))
567
+ return [];
568
+ return [{
569
+ path: String(entry.path ?? ""),
570
+ kind: String(entry.kind ?? "other"),
571
+ }];
572
+ })
573
+ : [],
574
+ metadata: isPlainRecord(row.metadata) ? row.metadata : null,
575
+ };
576
+ }
577
+ export function serializeFileInventory(fileInventory) {
578
+ return fileInventory.map((entry) => ({
579
+ path: entry.path,
580
+ kind: entry.kind,
581
+ }));
582
+ }
583
+ export function getSkillMeta(skill) {
584
+ return isPlainRecord(skill.metadata) ? skill.metadata : {};
585
+ }
586
+ export function resolveSkillReference(skills, reference, orgId) {
587
+ const trimmed = reference.trim();
588
+ if (!trimmed) {
589
+ return { skill: null, ambiguous: false };
590
+ }
591
+ const byId = skills.find((skill) => skill.id === trimmed);
592
+ if (byId) {
593
+ return { skill: byId, ambiguous: false };
594
+ }
595
+ return resolveOrganizationSkillReference(skills, trimmed, { orgId });
596
+ }
597
+ export function resolveRequestedSkillKeysOrThrow(skills, requestedReferences, orgId) {
598
+ const missing = new Set();
599
+ const ambiguous = new Set();
600
+ const resolved = new Set();
601
+ for (const reference of requestedReferences) {
602
+ const trimmed = reference.trim();
603
+ if (!trimmed)
604
+ continue;
605
+ const match = resolveSkillReference(skills, trimmed, orgId);
606
+ if (match.skill) {
607
+ resolved.add(match.skill.key);
608
+ continue;
609
+ }
610
+ if (match.ambiguous) {
611
+ ambiguous.add(trimmed);
612
+ continue;
613
+ }
614
+ missing.add(trimmed);
615
+ }
616
+ if (ambiguous.size > 0 || missing.size > 0) {
617
+ const problems = [];
618
+ if (ambiguous.size > 0) {
619
+ problems.push(`ambiguous references: ${Array.from(ambiguous).sort().join(", ")}`);
620
+ }
621
+ if (missing.size > 0) {
622
+ problems.push(`unknown references: ${Array.from(missing).sort().join(", ")}`);
623
+ }
624
+ throw unprocessable(`Invalid organization skill selection (${problems.join("; ")}).`);
625
+ }
626
+ return Array.from(resolved);
627
+ }
628
+ export function resolveDesiredSkillKeys(skills, config, orgId) {
629
+ const preference = readRudderSkillSyncPreference(config);
630
+ return Array.from(new Set(preference.desiredSkills
631
+ .map((reference) => {
632
+ const resolved = resolveSkillReference(skills, reference, orgId).skill?.key;
633
+ if (resolved)
634
+ return resolved;
635
+ const bundledKey = toBundledRudderSkillKey(getBundledRudderSkillSlug(reference));
636
+ return bundledKey ?? normalizeSkillKey(reference);
637
+ })
638
+ .filter((value) => Boolean(value))));
639
+ }
640
+ export function getRequiredBundledSkillKeys(skills) {
641
+ const availableKeys = new Set(skills.map((skill) => skill.key));
642
+ return RUDDER_BUNDLED_SKILL_SLUGS
643
+ .map((slug) => `rudder/${slug}`)
644
+ .filter((key) => availableKeys.has(key));
645
+ }
646
+ export function sortUniqueSkillKeys(skillKeys) {
647
+ return Array.from(new Set(skillKeys
648
+ .map((value) => value.trim())
649
+ .filter(Boolean))).sort((left, right) => left.localeCompare(right));
650
+ }
651
+ export function sortUniqueSelectionRefs(selectionRefs) {
652
+ return Array.from(new Set(selectionRefs
653
+ .map((value) => value.trim())
654
+ .filter(Boolean))).sort((left, right) => left.localeCompare(right));
655
+ }
656
+ export function arraysEqual(left, right) {
657
+ if (left === right)
658
+ return true;
659
+ if (left.length !== right.length)
660
+ return false;
661
+ return left.every((value, index) => value === right[index]);
662
+ }
663
+ export function buildMissingSelectionEntry(selectionKey, agentRuntimeType) {
664
+ const parsed = parseSelectionKey(selectionKey);
665
+ const key = parsed.slug ?? parsed.orgKey ?? selectionKey;
666
+ const runtimeTypeMismatch = parsed.sourceClass === "adapter_home"
667
+ && parsed.agentRuntimeType
668
+ && parsed.agentRuntimeType !== agentRuntimeType;
669
+ const locationLabel = (() => {
670
+ if (parsed.sourceClass === "agent_home")
671
+ return "AGENT_HOME/skills";
672
+ if (parsed.sourceClass === "global")
673
+ return "~/.agents/skills";
674
+ if (parsed.sourceClass === "adapter_home" && parsed.agentRuntimeType) {
675
+ return ADAPTER_SKILL_HOME_DEFINITIONS[parsed.agentRuntimeType]?.locationLabel ?? null;
676
+ }
677
+ return null;
678
+ })();
679
+ const detail = runtimeTypeMismatch
680
+ ? `This adapter-specific skill was saved for ${parsed.agentRuntimeType} and is unavailable on ${agentRuntimeType}.`
681
+ : "Rudder cannot find this enabled skill in the current Rudder-owned catalog.";
682
+ return {
683
+ key,
684
+ selectionKey,
685
+ runtimeName: parsed.slug ?? key,
686
+ description: null,
687
+ desired: true,
688
+ configurable: parsed.sourceClass !== "bundled",
689
+ alwaysEnabled: parsed.sourceClass === "bundled",
690
+ managed: parsed.sourceClass === "bundled" || parsed.sourceClass === "organization",
691
+ state: "missing",
692
+ sourceClass: parsed.sourceClass ?? "adapter_home",
693
+ origin: "external_unknown",
694
+ originLabel: runtimeTypeMismatch ? "Unavailable for this runtime" : "Unavailable",
695
+ locationLabel,
696
+ readOnly: parsed.sourceClass === "bundled",
697
+ sourcePath: null,
698
+ targetPath: null,
699
+ detail,
700
+ organizationSkillKey: parsed.orgKey ?? null,
701
+ runtimeSourcePath: null,
702
+ };
703
+ }
704
+ export function applyDesiredSelectionsToCatalog(entries, desiredSelectionRefs, agentRuntimeType) {
705
+ const desiredSet = new Set(desiredSelectionRefs);
706
+ const warnings = [];
707
+ const out = entries.map((entry) => {
708
+ const desired = entry.alwaysEnabled || desiredSet.has(entry.selectionKey);
709
+ const state = entry.alwaysEnabled
710
+ ? "configured"
711
+ : desired
712
+ ? "configured"
713
+ : entry.sourceClass === "agent_home" || entry.sourceClass === "global" || entry.sourceClass === "adapter_home"
714
+ ? "external"
715
+ : "available";
716
+ return {
717
+ ...entry,
718
+ desired,
719
+ state,
720
+ detail: desired
721
+ ? entry.alwaysEnabled
722
+ ? (entry.detail ?? "Always loaded by Rudder for every agent run.")
723
+ : "Enabled for this agent and loaded on the next run."
724
+ : (entry.detail ?? null),
725
+ };
726
+ });
727
+ const knownSelectionKeys = new Set(out.map((entry) => entry.selectionKey));
728
+ for (const selectionKey of desiredSelectionRefs) {
729
+ if (knownSelectionKeys.has(selectionKey))
730
+ continue;
731
+ warnings.push(`Enabled skill "${selectionKey}" is no longer available in the current skill catalog.`);
732
+ out.push(buildMissingSelectionEntry(selectionKey, agentRuntimeType));
733
+ }
734
+ out.sort((left, right) => {
735
+ const orderDelta = AGENT_SKILL_SOURCE_CLASS_ORDER[left.sourceClass] - AGENT_SKILL_SOURCE_CLASS_ORDER[right.sourceClass];
736
+ if (orderDelta !== 0)
737
+ return orderDelta;
738
+ return left.key.localeCompare(right.key) || left.selectionKey.localeCompare(right.selectionKey);
739
+ });
740
+ const conflictGroups = new Map();
741
+ for (const entry of out) {
742
+ if (!entry.desired || entry.alwaysEnabled)
743
+ continue;
744
+ const existing = conflictGroups.get(entry.key) ?? [];
745
+ existing.push(entry.selectionKey);
746
+ conflictGroups.set(entry.key, existing);
747
+ }
748
+ for (const [skillKey, selectionKeys] of conflictGroups.entries()) {
749
+ if (selectionKeys.length <= 1)
750
+ continue;
751
+ warnings.push(`Enabled skill collision for "${skillKey}": ${selectionKeys.join(", ")}`);
752
+ }
753
+ return {
754
+ desiredSkills: sortUniqueSelectionRefs(desiredSelectionRefs),
755
+ entries: out,
756
+ warnings,
757
+ };
758
+ }
759
+ export function stripBundledRequiredSkillKeys(skillKeys) {
760
+ return sortUniqueSkillKeys(skillKeys).filter((skillKey) => !isBundledRudderSkillKey(skillKey));
761
+ }
762
+ export function mergeRequiredBundledSkillKeys(skills, skillKeys) {
763
+ return sortUniqueSkillKeys([
764
+ ...stripBundledRequiredSkillKeys(skillKeys),
765
+ ...getRequiredBundledSkillKeys(skills),
766
+ ]);
767
+ }
768
+ export function normalizeSkillDirectory(skill) {
769
+ if ((skill.sourceType !== "local_path" && skill.sourceType !== "catalog") || !skill.sourceLocator)
770
+ return null;
771
+ const resolved = path.resolve(skill.sourceLocator);
772
+ if (path.basename(resolved).toLowerCase() === "skill.md") {
773
+ return path.dirname(resolved);
774
+ }
775
+ return resolved;
776
+ }
777
+ export function normalizeSourceLocatorDirectory(sourceLocator) {
778
+ if (!sourceLocator)
779
+ return null;
780
+ const resolved = path.resolve(sourceLocator);
781
+ return path.basename(resolved).toLowerCase() === "skill.md" ? path.dirname(resolved) : resolved;
782
+ }
783
+ export async function findMissingLocalSkillIds(skills) {
784
+ const missingIds = [];
785
+ for (const skill of skills) {
786
+ if (skill.sourceType !== "local_path")
787
+ continue;
788
+ const skillDir = normalizeSourceLocatorDirectory(skill.sourceLocator);
789
+ if (!skillDir) {
790
+ missingIds.push(skill.id);
791
+ continue;
792
+ }
793
+ const skillDirStat = await statPath(skillDir);
794
+ const skillFileStat = await statPath(path.join(skillDir, "SKILL.md"));
795
+ if (!skillDirStat?.isDirectory() || !skillFileStat?.isFile()) {
796
+ missingIds.push(skill.id);
797
+ }
798
+ }
799
+ return missingIds;
800
+ }
801
+ export function resolveManagedSkillsRoot(orgId) {
802
+ return resolveOrganizationSkillsDir(orgId);
803
+ }
804
+ export function resolveWorkspaceEditPath(orgId, sourcePath) {
805
+ if (!sourcePath)
806
+ return null;
807
+ const workspaceRoot = path.resolve(resolveOrganizationWorkspaceRoot(orgId));
808
+ const skillDir = path.resolve(sourcePath);
809
+ const entryFilePath = path.resolve(skillDir, "SKILL.md");
810
+ const relativePath = path.relative(workspaceRoot, entryFilePath);
811
+ if (relativePath.startsWith("..") || path.isAbsolute(relativePath)) {
812
+ return null;
813
+ }
814
+ return normalizePortablePath(relativePath);
815
+ }
816
+ export function resolveLocalSkillFilePath(skill, relativePath) {
817
+ const normalized = normalizePortablePath(relativePath);
818
+ const skillDir = normalizeSkillDirectory(skill);
819
+ if (skillDir) {
820
+ return path.resolve(skillDir, normalized);
821
+ }
822
+ if (!skill.sourceLocator)
823
+ return null;
824
+ const fallbackRoot = path.resolve(skill.sourceLocator);
825
+ const directPath = path.resolve(fallbackRoot, normalized);
826
+ return directPath;
827
+ }
828
+ export function inferLanguageFromPath(filePath) {
829
+ const fileName = path.posix.basename(filePath).toLowerCase();
830
+ if (fileName === "skill.md" || fileName.endsWith(".md"))
831
+ return "markdown";
832
+ if (fileName.endsWith(".ts"))
833
+ return "typescript";
834
+ if (fileName.endsWith(".tsx"))
835
+ return "tsx";
836
+ if (fileName.endsWith(".js"))
837
+ return "javascript";
838
+ if (fileName.endsWith(".jsx"))
839
+ return "jsx";
840
+ if (fileName.endsWith(".json"))
841
+ return "json";
842
+ if (fileName.endsWith(".yml") || fileName.endsWith(".yaml"))
843
+ return "yaml";
844
+ if (fileName.endsWith(".sh"))
845
+ return "bash";
846
+ if (fileName.endsWith(".py"))
847
+ return "python";
848
+ if (fileName.endsWith(".html"))
849
+ return "html";
850
+ if (fileName.endsWith(".css"))
851
+ return "css";
852
+ return null;
853
+ }
854
+ export function isMarkdownPath(filePath) {
855
+ const fileName = path.posix.basename(filePath).toLowerCase();
856
+ return fileName === "skill.md" || fileName.endsWith(".md");
857
+ }
858
+ export function deriveSkillSourceInfo(skill) {
859
+ const metadata = getSkillMeta(skill);
860
+ const localSkillDir = normalizeSkillDirectory(skill);
861
+ if (isBundledRudderSourceKind(asString(metadata.sourceKind))) {
862
+ return {
863
+ editable: false,
864
+ editableReason: "Bundled Rudder skills are read-only.",
865
+ sourceLabel: "Bundled by Rudder",
866
+ sourceBadge: "rudder",
867
+ sourcePath: null,
868
+ };
869
+ }
870
+ if (asString(metadata.sourceKind) === "community_preset") {
871
+ return {
872
+ editable: false,
873
+ editableReason: "Community preset skills are read-only.",
874
+ sourceLabel: "Community preset",
875
+ sourceBadge: "community",
876
+ sourcePath: null,
877
+ };
878
+ }
879
+ if (skill.sourceType === "skills_sh") {
880
+ const owner = asString(metadata.owner) ?? null;
881
+ const repo = asString(metadata.repo) ?? null;
882
+ return {
883
+ editable: false,
884
+ editableReason: "Skills.sh-managed skills are read-only.",
885
+ sourceLabel: skill.sourceLocator ?? (owner && repo ? `${owner}/${repo}` : null),
886
+ sourceBadge: "skills_sh",
887
+ sourcePath: null,
888
+ };
889
+ }
890
+ if (skill.sourceType === "github") {
891
+ const owner = asString(metadata.owner) ?? null;
892
+ const repo = asString(metadata.repo) ?? null;
893
+ return {
894
+ editable: false,
895
+ editableReason: "Remote GitHub skills are read-only. Fork or import locally to edit them.",
896
+ sourceLabel: owner && repo ? `${owner}/${repo}` : skill.sourceLocator,
897
+ sourceBadge: "github",
898
+ sourcePath: null,
899
+ };
900
+ }
901
+ if (skill.sourceType === "url") {
902
+ return {
903
+ editable: false,
904
+ editableReason: "URL-based skills are read-only. Save them locally to edit them.",
905
+ sourceLabel: skill.sourceLocator,
906
+ sourceBadge: "url",
907
+ sourcePath: null,
908
+ };
909
+ }
910
+ if (skill.sourceType === "local_path") {
911
+ const managedRoot = resolveManagedSkillsRoot(skill.orgId);
912
+ const projectName = asString(metadata.projectName);
913
+ const workspaceName = asString(metadata.workspaceName);
914
+ const isProjectScan = metadata.sourceKind === "project_scan";
915
+ if (localSkillDir && localSkillDir.startsWith(managedRoot)) {
916
+ return {
917
+ editable: true,
918
+ editableReason: null,
919
+ sourceLabel: "Rudder workspace",
920
+ sourceBadge: "rudder",
921
+ sourcePath: managedRoot,
922
+ };
923
+ }
924
+ return {
925
+ editable: true,
926
+ editableReason: null,
927
+ sourceLabel: isProjectScan
928
+ ? [projectName, workspaceName].filter((value) => Boolean(value)).join(" / ")
929
+ || skill.sourceLocator
930
+ : skill.sourceLocator,
931
+ sourceBadge: "local",
932
+ sourcePath: null,
933
+ };
934
+ }
935
+ return {
936
+ editable: false,
937
+ editableReason: "This skill source is read-only.",
938
+ sourceLabel: skill.sourceLocator,
939
+ sourceBadge: "catalog",
940
+ sourcePath: null,
941
+ };
942
+ }
943
+ export function enrichSkill(skill, attachedAgentCount, usedByAgents = []) {
944
+ const source = deriveSkillSourceInfo(skill);
945
+ return {
946
+ ...skill,
947
+ attachedAgentCount,
948
+ usedByAgents,
949
+ ...source,
950
+ workspaceEditPath: resolveWorkspaceEditPath(skill.orgId, normalizeSkillDirectory(skill)),
951
+ };
952
+ }
953
+ export function toCompanySkillListItem(skill, attachedAgentCount) {
954
+ const source = deriveSkillSourceInfo(skill);
955
+ return {
956
+ id: skill.id,
957
+ orgId: skill.orgId,
958
+ key: skill.key,
959
+ slug: skill.slug,
960
+ name: skill.name,
961
+ description: skill.description,
962
+ sourceType: skill.sourceType,
963
+ sourceLocator: skill.sourceLocator,
964
+ sourceRef: skill.sourceRef,
965
+ trustLevel: skill.trustLevel,
966
+ compatibility: skill.compatibility,
967
+ fileInventory: skill.fileInventory,
968
+ createdAt: skill.createdAt,
969
+ updatedAt: skill.updatedAt,
970
+ attachedAgentCount,
971
+ editable: source.editable,
972
+ editableReason: source.editableReason,
973
+ sourceLabel: source.sourceLabel,
974
+ sourceBadge: source.sourceBadge,
975
+ sourcePath: source.sourcePath,
976
+ workspaceEditPath: resolveWorkspaceEditPath(skill.orgId, normalizeSkillDirectory(skill)),
977
+ };
978
+ }
979
+ export function compareOrganizationSkillListItems(left, right) {
980
+ const leftBundledSlug = getBundledRudderSkillSlug(left.key);
981
+ const rightBundledSlug = getBundledRudderSkillSlug(right.key);
982
+ if (leftBundledSlug && rightBundledSlug) {
983
+ const leftIndex = RUDDER_BUNDLED_SKILL_SLUGS.findIndex((slug) => slug === leftBundledSlug);
984
+ const rightIndex = RUDDER_BUNDLED_SKILL_SLUGS.findIndex((slug) => slug === rightBundledSlug);
985
+ if (leftIndex !== rightIndex)
986
+ return leftIndex - rightIndex;
987
+ }
988
+ else if (leftBundledSlug) {
989
+ return -1;
990
+ }
991
+ else if (rightBundledSlug) {
992
+ return 1;
993
+ }
994
+ const byName = left.name.localeCompare(right.name, undefined, { sensitivity: "base" });
995
+ if (byName !== 0)
996
+ return byName;
997
+ return left.key.localeCompare(right.key, undefined, { sensitivity: "base" });
998
+ }
999
+ //# sourceMappingURL=organization-skills.catalog.js.map