@paperclipai/server 0.3.1 → 2026.3.17-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/dist/adapters/registry.d.ts.map +1 -1
  2. package/dist/adapters/registry.js +23 -2
  3. package/dist/adapters/registry.js.map +1 -1
  4. package/dist/adapters/types.d.ts +1 -1
  5. package/dist/adapters/types.d.ts.map +1 -1
  6. package/dist/app.d.ts +4 -0
  7. package/dist/app.d.ts.map +1 -1
  8. package/dist/app.js +115 -3
  9. package/dist/app.js.map +1 -1
  10. package/dist/attachment-types.d.ts.map +1 -1
  11. package/dist/attachment-types.js +6 -0
  12. package/dist/attachment-types.js.map +1 -1
  13. package/dist/config.d.ts.map +1 -1
  14. package/dist/config.js +9 -1
  15. package/dist/config.js.map +1 -1
  16. package/dist/home-paths.d.ts +5 -0
  17. package/dist/home-paths.d.ts.map +1 -1
  18. package/dist/home-paths.js +18 -0
  19. package/dist/home-paths.js.map +1 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +61 -42
  22. package/dist/index.js.map +1 -1
  23. package/dist/routes/access.d.ts.map +1 -1
  24. package/dist/routes/access.js +90 -1
  25. package/dist/routes/access.js.map +1 -1
  26. package/dist/routes/agents.d.ts.map +1 -1
  27. package/dist/routes/agents.js +64 -1
  28. package/dist/routes/agents.js.map +1 -1
  29. package/dist/routes/assets.d.ts.map +1 -1
  30. package/dist/routes/assets.js +191 -13
  31. package/dist/routes/assets.js.map +1 -1
  32. package/dist/routes/companies.d.ts.map +1 -1
  33. package/dist/routes/companies.js +10 -1
  34. package/dist/routes/companies.js.map +1 -1
  35. package/dist/routes/costs.d.ts.map +1 -1
  36. package/dist/routes/costs.js +160 -5
  37. package/dist/routes/costs.js.map +1 -1
  38. package/dist/routes/execution-workspaces.d.ts +3 -0
  39. package/dist/routes/execution-workspaces.d.ts.map +1 -0
  40. package/dist/routes/execution-workspaces.js +165 -0
  41. package/dist/routes/execution-workspaces.js.map +1 -0
  42. package/dist/routes/health.d.ts.map +1 -1
  43. package/dist/routes/health.js +3 -1
  44. package/dist/routes/health.js.map +1 -1
  45. package/dist/routes/index.d.ts +1 -0
  46. package/dist/routes/index.d.ts.map +1 -1
  47. package/dist/routes/index.js +1 -0
  48. package/dist/routes/index.js.map +1 -1
  49. package/dist/routes/instance-settings.d.ts +3 -0
  50. package/dist/routes/instance-settings.d.ts.map +1 -0
  51. package/dist/routes/instance-settings.js +46 -0
  52. package/dist/routes/instance-settings.js.map +1 -0
  53. package/dist/routes/issues.d.ts.map +1 -1
  54. package/dist/routes/issues.js +339 -4
  55. package/dist/routes/issues.js.map +1 -1
  56. package/dist/routes/plugin-ui-static.d.ts +69 -0
  57. package/dist/routes/plugin-ui-static.d.ts.map +1 -0
  58. package/dist/routes/plugin-ui-static.js +411 -0
  59. package/dist/routes/plugin-ui-static.js.map +1 -0
  60. package/dist/routes/plugins.d.ts +120 -0
  61. package/dist/routes/plugins.d.ts.map +1 -0
  62. package/dist/routes/plugins.js +1784 -0
  63. package/dist/routes/plugins.js.map +1 -0
  64. package/dist/routes/projects.d.ts.map +1 -1
  65. package/dist/routes/projects.js +5 -1
  66. package/dist/routes/projects.js.map +1 -1
  67. package/dist/services/access.d.ts +2 -2
  68. package/dist/services/activity-log.d.ts +3 -0
  69. package/dist/services/activity-log.d.ts.map +1 -1
  70. package/dist/services/activity-log.js +34 -0
  71. package/dist/services/activity-log.js.map +1 -1
  72. package/dist/services/agents.d.ts +39 -15
  73. package/dist/services/agents.d.ts.map +1 -1
  74. package/dist/services/agents.js +60 -8
  75. package/dist/services/agents.js.map +1 -1
  76. package/dist/services/approvals.d.ts +5 -5
  77. package/dist/services/approvals.d.ts.map +1 -1
  78. package/dist/services/approvals.js +11 -0
  79. package/dist/services/approvals.js.map +1 -1
  80. package/dist/services/assets.d.ts +4 -4
  81. package/dist/services/budgets.d.ts +38 -0
  82. package/dist/services/budgets.d.ts.map +1 -0
  83. package/dist/services/budgets.js +784 -0
  84. package/dist/services/budgets.js.map +1 -0
  85. package/dist/services/companies.d.ts +39 -418
  86. package/dist/services/companies.d.ts.map +1 -1
  87. package/dist/services/companies.js +157 -21
  88. package/dist/services/companies.js.map +1 -1
  89. package/dist/services/costs.d.ts +67 -3
  90. package/dist/services/costs.d.ts.map +1 -1
  91. package/dist/services/costs.js +185 -57
  92. package/dist/services/costs.js.map +1 -1
  93. package/dist/services/cron.d.ts +80 -0
  94. package/dist/services/cron.d.ts.map +1 -0
  95. package/dist/services/cron.js +300 -0
  96. package/dist/services/cron.js.map +1 -0
  97. package/dist/services/dashboard.d.ts +6 -0
  98. package/dist/services/dashboard.d.ts.map +1 -1
  99. package/dist/services/dashboard.js +9 -0
  100. package/dist/services/dashboard.js.map +1 -1
  101. package/dist/services/documents.d.ts +164 -0
  102. package/dist/services/documents.d.ts.map +1 -0
  103. package/dist/services/documents.js +382 -0
  104. package/dist/services/documents.js.map +1 -0
  105. package/dist/services/execution-workspace-policy.d.ts +2 -1
  106. package/dist/services/execution-workspace-policy.d.ts.map +1 -1
  107. package/dist/services/execution-workspace-policy.js +63 -15
  108. package/dist/services/execution-workspace-policy.js.map +1 -1
  109. package/dist/services/execution-workspaces.d.ts +19 -0
  110. package/dist/services/execution-workspaces.d.ts.map +1 -0
  111. package/dist/services/execution-workspaces.js +87 -0
  112. package/dist/services/execution-workspaces.js.map +1 -0
  113. package/dist/services/finance.d.ts +93 -0
  114. package/dist/services/finance.d.ts.map +1 -0
  115. package/dist/services/finance.js +120 -0
  116. package/dist/services/finance.js.map +1 -0
  117. package/dist/services/heartbeat.d.ts +11 -1
  118. package/dist/services/heartbeat.d.ts.map +1 -1
  119. package/dist/services/heartbeat.js +1292 -559
  120. package/dist/services/heartbeat.js.map +1 -1
  121. package/dist/services/index.d.ts +7 -0
  122. package/dist/services/index.d.ts.map +1 -1
  123. package/dist/services/index.js +7 -0
  124. package/dist/services/index.js.map +1 -1
  125. package/dist/services/instance-settings.d.ts +9 -0
  126. package/dist/services/instance-settings.d.ts.map +1 -0
  127. package/dist/services/instance-settings.js +80 -0
  128. package/dist/services/instance-settings.js.map +1 -0
  129. package/dist/services/issue-approvals.d.ts +1 -1
  130. package/dist/services/issues.d.ts +14 -2
  131. package/dist/services/issues.d.ts.map +1 -1
  132. package/dist/services/issues.js +161 -9
  133. package/dist/services/issues.js.map +1 -1
  134. package/dist/services/live-events.d.ts +5 -0
  135. package/dist/services/live-events.d.ts.map +1 -1
  136. package/dist/services/live-events.js +9 -0
  137. package/dist/services/live-events.js.map +1 -1
  138. package/dist/services/plugin-capability-validator.d.ts +108 -0
  139. package/dist/services/plugin-capability-validator.d.ts.map +1 -0
  140. package/dist/services/plugin-capability-validator.js +268 -0
  141. package/dist/services/plugin-capability-validator.js.map +1 -0
  142. package/dist/services/plugin-config-validator.d.ts +26 -0
  143. package/dist/services/plugin-config-validator.d.ts.map +1 -0
  144. package/dist/services/plugin-config-validator.js +41 -0
  145. package/dist/services/plugin-config-validator.js.map +1 -0
  146. package/dist/services/plugin-dev-watcher.d.ts +30 -0
  147. package/dist/services/plugin-dev-watcher.d.ts.map +1 -0
  148. package/dist/services/plugin-dev-watcher.js +241 -0
  149. package/dist/services/plugin-dev-watcher.js.map +1 -0
  150. package/dist/services/plugin-event-bus.d.ts +149 -0
  151. package/dist/services/plugin-event-bus.d.ts.map +1 -0
  152. package/dist/services/plugin-event-bus.js +258 -0
  153. package/dist/services/plugin-event-bus.js.map +1 -0
  154. package/dist/services/plugin-host-service-cleanup.d.ts +14 -0
  155. package/dist/services/plugin-host-service-cleanup.d.ts.map +1 -0
  156. package/dist/services/plugin-host-service-cleanup.js +37 -0
  157. package/dist/services/plugin-host-service-cleanup.js.map +1 -0
  158. package/dist/services/plugin-host-services.d.ts +13 -0
  159. package/dist/services/plugin-host-services.d.ts.map +1 -0
  160. package/dist/services/plugin-host-services.js +969 -0
  161. package/dist/services/plugin-host-services.js.map +1 -0
  162. package/dist/services/plugin-job-coordinator.d.ts +81 -0
  163. package/dist/services/plugin-job-coordinator.d.ts.map +1 -0
  164. package/dist/services/plugin-job-coordinator.js +172 -0
  165. package/dist/services/plugin-job-coordinator.js.map +1 -0
  166. package/dist/services/plugin-job-scheduler.d.ts +163 -0
  167. package/dist/services/plugin-job-scheduler.d.ts.map +1 -0
  168. package/dist/services/plugin-job-scheduler.js +454 -0
  169. package/dist/services/plugin-job-scheduler.js.map +1 -0
  170. package/dist/services/plugin-job-store.d.ts +208 -0
  171. package/dist/services/plugin-job-store.d.ts.map +1 -0
  172. package/dist/services/plugin-job-store.js +350 -0
  173. package/dist/services/plugin-job-store.js.map +1 -0
  174. package/dist/services/plugin-lifecycle.d.ts +203 -0
  175. package/dist/services/plugin-lifecycle.d.ts.map +1 -0
  176. package/dist/services/plugin-lifecycle.js +476 -0
  177. package/dist/services/plugin-lifecycle.js.map +1 -0
  178. package/dist/services/plugin-loader.d.ts +441 -0
  179. package/dist/services/plugin-loader.d.ts.map +1 -0
  180. package/dist/services/plugin-loader.js +1192 -0
  181. package/dist/services/plugin-loader.js.map +1 -0
  182. package/dist/services/plugin-log-retention.d.ts +20 -0
  183. package/dist/services/plugin-log-retention.d.ts.map +1 -0
  184. package/dist/services/plugin-log-retention.js +63 -0
  185. package/dist/services/plugin-log-retention.js.map +1 -0
  186. package/dist/services/plugin-manifest-validator.d.ts +79 -0
  187. package/dist/services/plugin-manifest-validator.d.ts.map +1 -0
  188. package/dist/services/plugin-manifest-validator.js +84 -0
  189. package/dist/services/plugin-manifest-validator.js.map +1 -0
  190. package/dist/services/plugin-registry.d.ts +2542 -0
  191. package/dist/services/plugin-registry.d.ts.map +1 -0
  192. package/dist/services/plugin-registry.js +539 -0
  193. package/dist/services/plugin-registry.js.map +1 -0
  194. package/dist/services/plugin-runtime-sandbox.d.ts +40 -0
  195. package/dist/services/plugin-runtime-sandbox.d.ts.map +1 -0
  196. package/dist/services/plugin-runtime-sandbox.js +154 -0
  197. package/dist/services/plugin-runtime-sandbox.js.map +1 -0
  198. package/dist/services/plugin-secrets-handler.d.ts +81 -0
  199. package/dist/services/plugin-secrets-handler.d.ts.map +1 -0
  200. package/dist/services/plugin-secrets-handler.js +275 -0
  201. package/dist/services/plugin-secrets-handler.js.map +1 -0
  202. package/dist/services/plugin-state-store.d.ts +92 -0
  203. package/dist/services/plugin-state-store.d.ts.map +1 -0
  204. package/dist/services/plugin-state-store.js +190 -0
  205. package/dist/services/plugin-state-store.js.map +1 -0
  206. package/dist/services/plugin-stream-bus.d.ts +29 -0
  207. package/dist/services/plugin-stream-bus.d.ts.map +1 -0
  208. package/dist/services/plugin-stream-bus.js +48 -0
  209. package/dist/services/plugin-stream-bus.js.map +1 -0
  210. package/dist/services/plugin-tool-dispatcher.d.ts +180 -0
  211. package/dist/services/plugin-tool-dispatcher.d.ts.map +1 -0
  212. package/dist/services/plugin-tool-dispatcher.js +224 -0
  213. package/dist/services/plugin-tool-dispatcher.js.map +1 -0
  214. package/dist/services/plugin-tool-registry.d.ts +192 -0
  215. package/dist/services/plugin-tool-registry.d.ts.map +1 -0
  216. package/dist/services/plugin-tool-registry.js +224 -0
  217. package/dist/services/plugin-tool-registry.js.map +1 -0
  218. package/dist/services/plugin-worker-manager.d.ts +260 -0
  219. package/dist/services/plugin-worker-manager.d.ts.map +1 -0
  220. package/dist/services/plugin-worker-manager.js +835 -0
  221. package/dist/services/plugin-worker-manager.js.map +1 -0
  222. package/dist/services/projects.d.ts +12 -1
  223. package/dist/services/projects.d.ts.map +1 -1
  224. package/dist/services/projects.js +100 -4
  225. package/dist/services/projects.js.map +1 -1
  226. package/dist/services/quota-windows.d.ts +9 -0
  227. package/dist/services/quota-windows.d.ts.map +1 -0
  228. package/dist/services/quota-windows.js +56 -0
  229. package/dist/services/quota-windows.js.map +1 -0
  230. package/dist/services/secrets.d.ts +5 -5
  231. package/dist/services/work-products.d.ts +14 -0
  232. package/dist/services/work-products.d.ts.map +1 -0
  233. package/dist/services/work-products.js +100 -0
  234. package/dist/services/work-products.js.map +1 -0
  235. package/dist/services/workspace-operation-log-store.d.ts +33 -0
  236. package/dist/services/workspace-operation-log-store.d.ts.map +1 -0
  237. package/dist/services/workspace-operation-log-store.js +110 -0
  238. package/dist/services/workspace-operation-log-store.js.map +1 -0
  239. package/dist/services/workspace-operations.d.ts +44 -0
  240. package/dist/services/workspace-operations.d.ts.map +1 -0
  241. package/dist/services/workspace-operations.js +204 -0
  242. package/dist/services/workspace-operations.js.map +1 -0
  243. package/dist/services/workspace-runtime.d.ts +43 -5
  244. package/dist/services/workspace-runtime.d.ts.map +1 -1
  245. package/dist/services/workspace-runtime.js +413 -30
  246. package/dist/services/workspace-runtime.js.map +1 -1
  247. package/dist/ui-branding.d.ts +10 -1
  248. package/dist/ui-branding.d.ts.map +1 -1
  249. package/dist/ui-branding.js +164 -14
  250. package/dist/ui-branding.js.map +1 -1
  251. package/dist/version.d.ts +2 -0
  252. package/dist/version.d.ts.map +1 -0
  253. package/dist/version.js +5 -0
  254. package/dist/version.js.map +1 -0
  255. package/package.json +32 -14
  256. package/skills/paperclip/SKILL.md +34 -20
  257. package/skills/paperclip-create-plugin/SKILL.md +101 -0
  258. package/ui-dist/assets/{_basePickBy-B0xbZITw.js → _basePickBy-Chytvk8p.js} +1 -1
  259. package/ui-dist/assets/{_baseUniq-Cfd5u3qc.js → _baseUniq-BVL8b2zA.js} +1 -1
  260. package/ui-dist/assets/{arc-7Xbu8tBF.js → arc-D5hJS7gD.js} +1 -1
  261. package/ui-dist/assets/{architectureDiagram-VXUJARFQ-C8F7ZRYc.js → architectureDiagram-VXUJARFQ-BFq3iN58.js} +1 -1
  262. package/ui-dist/assets/{blockDiagram-VD42YOAC-Dp08a65A.js → blockDiagram-VD42YOAC-B69ok7vL.js} +1 -1
  263. package/ui-dist/assets/{c4Diagram-YG6GDRKO-BJfslTgZ.js → c4Diagram-YG6GDRKO-FE0D9aiA.js} +1 -1
  264. package/ui-dist/assets/channel-CiKAknwU.js +1 -0
  265. package/ui-dist/assets/{chunk-4BX2VUAB-BhaYWH7e.js → chunk-4BX2VUAB-SAhF6g-l.js} +1 -1
  266. package/ui-dist/assets/{chunk-55IACEB6-BOzJUsYW.js → chunk-55IACEB6-yxKD70bX.js} +1 -1
  267. package/ui-dist/assets/{chunk-B4BG7PRW-CbVcziyE.js → chunk-B4BG7PRW-qB4VaAIx.js} +1 -1
  268. package/ui-dist/assets/{chunk-DI55MBZ5-DghPtP3y.js → chunk-DI55MBZ5-B4NIq1Ee.js} +1 -1
  269. package/ui-dist/assets/{chunk-FMBD7UC4-CB095Kfn.js → chunk-FMBD7UC4-B5kLoRe2.js} +1 -1
  270. package/ui-dist/assets/{chunk-QN33PNHL-DfpzfDqJ.js → chunk-QN33PNHL-BVVG2n_X.js} +1 -1
  271. package/ui-dist/assets/{chunk-QZHKN3VN-Df3d5z1y.js → chunk-QZHKN3VN-ncMubclp.js} +1 -1
  272. package/ui-dist/assets/{chunk-TZMSLE5B-B6tX6bZI.js → chunk-TZMSLE5B-DSyjQk8C.js} +1 -1
  273. package/ui-dist/assets/classDiagram-2ON5EDUG-B93oQX02.js +1 -0
  274. package/ui-dist/assets/classDiagram-v2-WZHVMYZB-B93oQX02.js +1 -0
  275. package/ui-dist/assets/clone-Dld-3yq0.js +1 -0
  276. package/ui-dist/assets/{cose-bilkent-S5V4N54A-38wg_s9V.js → cose-bilkent-S5V4N54A-BAikNewC.js} +1 -1
  277. package/ui-dist/assets/{dagre-6UL2VRFP-DPVj3XLS.js → dagre-6UL2VRFP-j223UI8_.js} +1 -1
  278. package/ui-dist/assets/{diagram-PSM6KHXK-BJh89zUA.js → diagram-PSM6KHXK-Bhg27ZsN.js} +1 -1
  279. package/ui-dist/assets/{diagram-QEK2KX5R-Bw0m_j10.js → diagram-QEK2KX5R-BmtcrTHq.js} +1 -1
  280. package/ui-dist/assets/{diagram-S2PKOQOG-D7_M2F3u.js → diagram-S2PKOQOG-x8XuP7dH.js} +1 -1
  281. package/ui-dist/assets/{erDiagram-Q2GNP2WA-CLsjqTWP.js → erDiagram-Q2GNP2WA-Dc8mHvB-.js} +1 -1
  282. package/ui-dist/assets/{flowDiagram-NV44I4VS-BZZ7ezVB.js → flowDiagram-NV44I4VS-Br08v6xs.js} +1 -1
  283. package/ui-dist/assets/{ganttDiagram-JELNMOA3-KzsFuwBt.js → ganttDiagram-JELNMOA3-CksKhiV8.js} +1 -1
  284. package/ui-dist/assets/{gitGraphDiagram-V2S2FVAM-DSHtY7Vu.js → gitGraphDiagram-V2S2FVAM-DmitztAD.js} +1 -1
  285. package/ui-dist/assets/{graph-luIG1UAS.js → graph-Xzh7bNfz.js} +1 -1
  286. package/ui-dist/assets/{index-nFjLambq.js → index-B-MPJNeS.js} +1 -1
  287. package/ui-dist/assets/{index-RUBFVv6t.js → index-BAOC35TS.js} +1 -1
  288. package/ui-dist/assets/{index-CaR9XM4h.js → index-BCtrpKdJ.js} +1 -1
  289. package/ui-dist/assets/{index-itc7BfMy.js → index-B_mlwDCG.js} +1 -1
  290. package/ui-dist/assets/{index-1gX09-Fl.js → index-Bp8oJMwx.js} +1 -1
  291. package/ui-dist/assets/{index-B_3g3Rie.js → index-BqOfMG1d.js} +1 -1
  292. package/ui-dist/assets/{index-uR3zjYaD.js → index-C0hw7cTu.js} +1 -1
  293. package/ui-dist/assets/{index-Ds7vLTSK.js → index-C1ENEd6Y.js} +1 -1
  294. package/ui-dist/assets/{index-CeDCs_2i.js → index-CGB1OHQi.js} +1 -1
  295. package/ui-dist/assets/{index-DBy0vJy3.js → index-CZlfAt7E.js} +1 -1
  296. package/ui-dist/assets/{index-00kuG4sI.js → index-CeL-QouZ.js} +1 -1
  297. package/ui-dist/assets/{index-Bv4xCjxl.js → index-Cz0TxJbw.js} +1 -1
  298. package/ui-dist/assets/{index-DJf8diAA.js → index-DBxUCwDG.js} +1 -1
  299. package/ui-dist/assets/{index-DnIPDZLp.js → index-DGzQUMWC.js} +1 -1
  300. package/ui-dist/assets/{index-CbGtsjW7.js → index-DI9dat7c.js} +1 -1
  301. package/ui-dist/assets/{index-BfB4lKJN.js → index-DMpo-QSZ.js} +1 -1
  302. package/ui-dist/assets/{index-DcfLFstG.js → index-DQ6xyFaN.js} +1 -1
  303. package/ui-dist/assets/{index-B1ZMzzs0.js → index-DWMQ1Fyj.js} +1 -1
  304. package/ui-dist/assets/index-DbrFgvLd.css +1 -0
  305. package/ui-dist/assets/{index-C8XyGAr9.js → index-Er4i9aLN.js} +1 -1
  306. package/ui-dist/assets/{index-C2SZYIDA.js → index-I5K-yQx5.js} +1 -1
  307. package/ui-dist/assets/index-MuodIbDJ.js +1120 -0
  308. package/ui-dist/assets/{index-BeeKMqNU.js → index-auLN8BHe.js} +1 -1
  309. package/ui-dist/assets/{index-DoTq-BeR.js → index-xw01-Pl4.js} +1 -1
  310. package/ui-dist/assets/{infoDiagram-HS3SLOUP-CDEfWpme.js → infoDiagram-HS3SLOUP-DHb4TS1W.js} +1 -1
  311. package/ui-dist/assets/{journeyDiagram-XKPGCS4Q-i7nsbg_Y.js → journeyDiagram-XKPGCS4Q-CLRBeXVU.js} +1 -1
  312. package/ui-dist/assets/{kanban-definition-3W4ZIXB7-DDlx1qVE.js → kanban-definition-3W4ZIXB7-CsQp6woE.js} +1 -1
  313. package/ui-dist/assets/{layout-C7AtmJzX.js → layout-DwD9tZ5r.js} +1 -1
  314. package/ui-dist/assets/{linear-C5jHT-WP.js → linear-DF9n_1d3.js} +1 -1
  315. package/ui-dist/assets/{mermaid.core-C8YQ4fcY.js → mermaid.core-CDm4Crkq.js} +4 -4
  316. package/ui-dist/assets/{mindmap-definition-VGOIOE7T-B9m9PuUg.js → mindmap-definition-VGOIOE7T-CVzU1x4i.js} +1 -1
  317. package/ui-dist/assets/{pieDiagram-ADFJNKIX-SvKywCSE.js → pieDiagram-ADFJNKIX-CWgl0Up8.js} +1 -1
  318. package/ui-dist/assets/{quadrantDiagram-AYHSOK5B-QfBPm7Y1.js → quadrantDiagram-AYHSOK5B-CcedyN6Q.js} +1 -1
  319. package/ui-dist/assets/{requirementDiagram-UZGBJVZJ-DnfQQuwi.js → requirementDiagram-UZGBJVZJ-DZ4BVz3s.js} +1 -1
  320. package/ui-dist/assets/{sankeyDiagram-TZEHDZUN-DvLkjzIW.js → sankeyDiagram-TZEHDZUN-CLHEx34B.js} +1 -1
  321. package/ui-dist/assets/{sequenceDiagram-WL72ISMW-5Lq2rWBc.js → sequenceDiagram-WL72ISMW-nmTJbPyy.js} +1 -1
  322. package/ui-dist/assets/{stateDiagram-FKZM4ZOC-DcYPHDyi.js → stateDiagram-FKZM4ZOC-_UGwFEqN.js} +1 -1
  323. package/ui-dist/assets/stateDiagram-v2-4FDKWEC3-CvFVoOUd.js +1 -0
  324. package/ui-dist/assets/{timeline-definition-IT6M3QCI-lrN4JmWa.js → timeline-definition-IT6M3QCI-Bibk8Daj.js} +1 -1
  325. package/ui-dist/assets/{treemap-GDKQZRPO-DFJKIBTQ.js → treemap-GDKQZRPO-Ch3rlaqT.js} +1 -1
  326. package/ui-dist/assets/{xychartDiagram-PRI3JC2R-CT47vtdm.js → xychartDiagram-PRI3JC2R-DBUudr-E.js} +1 -1
  327. package/ui-dist/index.html +4 -2
  328. package/skills/create-agent-adapter/SKILL.md +0 -718
  329. package/ui-dist/assets/channel-BViQDbSq.js +0 -1
  330. package/ui-dist/assets/classDiagram-2ON5EDUG-CjMCmxMT.js +0 -1
  331. package/ui-dist/assets/classDiagram-v2-WZHVMYZB-CjMCmxMT.js +0 -1
  332. package/ui-dist/assets/clone-Dbn9wtE1.js +0 -1
  333. package/ui-dist/assets/index-BHP9dico.js +0 -1006
  334. package/ui-dist/assets/index-BfNaDZnn.css +0 -1
  335. package/ui-dist/assets/stateDiagram-v2-4FDKWEC3-nv50YYrl.js +0 -1
@@ -0,0 +1,108 @@
1
+ /**
2
+ * PluginCapabilityValidator — enforces the capability model at both
3
+ * install-time and runtime.
4
+ *
5
+ * Every plugin declares the capabilities it requires in its manifest
6
+ * (`manifest.capabilities`). This service checks those declarations
7
+ * against a mapping of operations → required capabilities so that:
8
+ *
9
+ * 1. **Install-time validation** — `validateManifestCapabilities()`
10
+ * ensures that declared features (tools, jobs, webhooks, UI slots)
11
+ * have matching capability entries, giving operators clear feedback
12
+ * before a plugin is activated.
13
+ *
14
+ * 2. **Runtime gating** — `checkOperation()` / `assertOperation()` are
15
+ * called on every worker→host bridge call to enforce least-privilege
16
+ * access. If a plugin attempts an operation it did not declare, the
17
+ * call is rejected with a 403 error.
18
+ *
19
+ * @see PLUGIN_SPEC.md §15 — Capability Model
20
+ * @see host-client-factory.ts — SDK-side capability gating
21
+ */
22
+ import type { PluginCapability, PaperclipPluginManifestV1, PluginUiSlotType } from "@paperclipai/shared";
23
+ /**
24
+ * Result of a capability check. When `allowed` is false, `missing` contains
25
+ * the capabilities that the plugin does not declare but the operation requires.
26
+ */
27
+ export interface CapabilityCheckResult {
28
+ allowed: boolean;
29
+ missing: PluginCapability[];
30
+ operation?: string;
31
+ pluginId?: string;
32
+ }
33
+ export interface PluginCapabilityValidator {
34
+ /**
35
+ * Check whether a plugin has a specific capability.
36
+ */
37
+ hasCapability(manifest: PaperclipPluginManifestV1, capability: PluginCapability): boolean;
38
+ /**
39
+ * Check whether a plugin has all of the specified capabilities.
40
+ */
41
+ hasAllCapabilities(manifest: PaperclipPluginManifestV1, capabilities: PluginCapability[]): CapabilityCheckResult;
42
+ /**
43
+ * Check whether a plugin has at least one of the specified capabilities.
44
+ */
45
+ hasAnyCapability(manifest: PaperclipPluginManifestV1, capabilities: PluginCapability[]): boolean;
46
+ /**
47
+ * Check whether a plugin is allowed to perform the named operation.
48
+ *
49
+ * Operations are mapped to required capabilities via OPERATION_CAPABILITIES.
50
+ * Unknown operations are rejected by default.
51
+ */
52
+ checkOperation(manifest: PaperclipPluginManifestV1, operation: string): CapabilityCheckResult;
53
+ /**
54
+ * Assert that a plugin is allowed to perform an operation.
55
+ * Throws a 403 HttpError if the capability check fails.
56
+ */
57
+ assertOperation(manifest: PaperclipPluginManifestV1, operation: string): void;
58
+ /**
59
+ * Assert that a plugin has a specific capability.
60
+ * Throws a 403 HttpError if the capability is missing.
61
+ */
62
+ assertCapability(manifest: PaperclipPluginManifestV1, capability: PluginCapability): void;
63
+ /**
64
+ * Check whether a plugin can register the given UI slot type.
65
+ */
66
+ checkUiSlot(manifest: PaperclipPluginManifestV1, slotType: PluginUiSlotType): CapabilityCheckResult;
67
+ /**
68
+ * Validate that a manifest's declared capabilities are consistent with its
69
+ * declared features (tools, jobs, webhooks, UI slots).
70
+ *
71
+ * Returns all missing capabilities rather than failing on the first one.
72
+ * This is useful for install-time validation to give comprehensive feedback.
73
+ */
74
+ validateManifestCapabilities(manifest: PaperclipPluginManifestV1): CapabilityCheckResult;
75
+ /**
76
+ * Get the capabilities required for a named operation.
77
+ * Returns an empty array if the operation is unknown.
78
+ */
79
+ getRequiredCapabilities(operation: string): readonly PluginCapability[];
80
+ /**
81
+ * Get the capability required for a UI slot type.
82
+ */
83
+ getUiSlotCapability(slotType: PluginUiSlotType): PluginCapability;
84
+ }
85
+ /**
86
+ * Create a PluginCapabilityValidator.
87
+ *
88
+ * This service enforces capability gates for plugin operations. The host
89
+ * uses it to verify that a plugin's declared capabilities permit the
90
+ * operation it is attempting, both at install time (manifest validation)
91
+ * and at runtime (bridge call gating).
92
+ *
93
+ * Usage:
94
+ * ```ts
95
+ * const validator = pluginCapabilityValidator();
96
+ *
97
+ * // Runtime: gate a bridge call
98
+ * validator.assertOperation(plugin.manifestJson, "issues.create");
99
+ *
100
+ * // Install time: validate manifest consistency
101
+ * const result = validator.validateManifestCapabilities(manifest);
102
+ * if (!result.allowed) {
103
+ * throw badRequest("Missing capabilities", result.missing);
104
+ * }
105
+ * ```
106
+ */
107
+ export declare function pluginCapabilityValidator(): PluginCapabilityValidator;
108
+ //# sourceMappingURL=plugin-capability-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-capability-validator.d.ts","sourceRoot":"","sources":["../../src/services/plugin-capability-validator.ts"],"names":[],"m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mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;CACnE;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yBAAyB,IAAI,yBAAyB,CA8KrE"}
@@ -0,0 +1,268 @@
1
+ import { forbidden } from "../errors.js";
2
+ import { logger } from "../middleware/logger.js";
3
+ // ---------------------------------------------------------------------------
4
+ // Capability requirement mappings
5
+ // ---------------------------------------------------------------------------
6
+ /**
7
+ * Maps high-level operations to the capabilities they require.
8
+ *
9
+ * When the bridge receives a call from a plugin worker, the host looks up
10
+ * the operation in this map and checks the plugin's declared capabilities.
11
+ * If any required capability is missing, the call is rejected.
12
+ *
13
+ * @see PLUGIN_SPEC.md §15 — Capability Model
14
+ */
15
+ const OPERATION_CAPABILITIES = {
16
+ // Data read operations
17
+ "companies.list": ["companies.read"],
18
+ "companies.get": ["companies.read"],
19
+ "projects.list": ["projects.read"],
20
+ "projects.get": ["projects.read"],
21
+ "project.workspaces.list": ["project.workspaces.read"],
22
+ "project.workspaces.get": ["project.workspaces.read"],
23
+ "issues.list": ["issues.read"],
24
+ "issues.get": ["issues.read"],
25
+ "issue.comments.list": ["issue.comments.read"],
26
+ "issue.comments.get": ["issue.comments.read"],
27
+ "agents.list": ["agents.read"],
28
+ "agents.get": ["agents.read"],
29
+ "goals.list": ["goals.read"],
30
+ "goals.get": ["goals.read"],
31
+ "activity.list": ["activity.read"],
32
+ "activity.get": ["activity.read"],
33
+ "costs.list": ["costs.read"],
34
+ "costs.get": ["costs.read"],
35
+ // Data write operations
36
+ "issues.create": ["issues.create"],
37
+ "issues.update": ["issues.update"],
38
+ "issue.comments.create": ["issue.comments.create"],
39
+ "activity.log": ["activity.log.write"],
40
+ "metrics.write": ["metrics.write"],
41
+ // Plugin state operations
42
+ "plugin.state.get": ["plugin.state.read"],
43
+ "plugin.state.list": ["plugin.state.read"],
44
+ "plugin.state.set": ["plugin.state.write"],
45
+ "plugin.state.delete": ["plugin.state.write"],
46
+ // Runtime / Integration operations
47
+ "events.subscribe": ["events.subscribe"],
48
+ "events.emit": ["events.emit"],
49
+ "jobs.schedule": ["jobs.schedule"],
50
+ "jobs.cancel": ["jobs.schedule"],
51
+ "webhooks.receive": ["webhooks.receive"],
52
+ "http.request": ["http.outbound"],
53
+ "secrets.resolve": ["secrets.read-ref"],
54
+ // Agent tools
55
+ "agent.tools.register": ["agent.tools.register"],
56
+ "agent.tools.execute": ["agent.tools.register"],
57
+ };
58
+ /**
59
+ * Maps UI slot types to the capability required to register them.
60
+ *
61
+ * @see PLUGIN_SPEC.md §19 — UI Extension Model
62
+ */
63
+ const UI_SLOT_CAPABILITIES = {
64
+ sidebar: "ui.sidebar.register",
65
+ sidebarPanel: "ui.sidebar.register",
66
+ projectSidebarItem: "ui.sidebar.register",
67
+ page: "ui.page.register",
68
+ detailTab: "ui.detailTab.register",
69
+ taskDetailView: "ui.detailTab.register",
70
+ dashboardWidget: "ui.dashboardWidget.register",
71
+ globalToolbarButton: "ui.action.register",
72
+ toolbarButton: "ui.action.register",
73
+ contextMenuItem: "ui.action.register",
74
+ commentAnnotation: "ui.commentAnnotation.register",
75
+ commentContextMenuItem: "ui.action.register",
76
+ settingsPage: "instance.settings.register",
77
+ };
78
+ /**
79
+ * Launcher placement zones align with host UI surfaces and therefore inherit
80
+ * the same capability requirements as the equivalent slot type.
81
+ */
82
+ const LAUNCHER_PLACEMENT_CAPABILITIES = {
83
+ page: "ui.page.register",
84
+ detailTab: "ui.detailTab.register",
85
+ taskDetailView: "ui.detailTab.register",
86
+ dashboardWidget: "ui.dashboardWidget.register",
87
+ sidebar: "ui.sidebar.register",
88
+ sidebarPanel: "ui.sidebar.register",
89
+ projectSidebarItem: "ui.sidebar.register",
90
+ globalToolbarButton: "ui.action.register",
91
+ toolbarButton: "ui.action.register",
92
+ contextMenuItem: "ui.action.register",
93
+ commentAnnotation: "ui.commentAnnotation.register",
94
+ commentContextMenuItem: "ui.action.register",
95
+ settingsPage: "instance.settings.register",
96
+ };
97
+ /**
98
+ * Maps feature declarations in the manifest to their required capabilities.
99
+ */
100
+ const FEATURE_CAPABILITIES = {
101
+ tools: "agent.tools.register",
102
+ jobs: "jobs.schedule",
103
+ webhooks: "webhooks.receive",
104
+ };
105
+ // ---------------------------------------------------------------------------
106
+ // Factory
107
+ // ---------------------------------------------------------------------------
108
+ /**
109
+ * Create a PluginCapabilityValidator.
110
+ *
111
+ * This service enforces capability gates for plugin operations. The host
112
+ * uses it to verify that a plugin's declared capabilities permit the
113
+ * operation it is attempting, both at install time (manifest validation)
114
+ * and at runtime (bridge call gating).
115
+ *
116
+ * Usage:
117
+ * ```ts
118
+ * const validator = pluginCapabilityValidator();
119
+ *
120
+ * // Runtime: gate a bridge call
121
+ * validator.assertOperation(plugin.manifestJson, "issues.create");
122
+ *
123
+ * // Install time: validate manifest consistency
124
+ * const result = validator.validateManifestCapabilities(manifest);
125
+ * if (!result.allowed) {
126
+ * throw badRequest("Missing capabilities", result.missing);
127
+ * }
128
+ * ```
129
+ */
130
+ export function pluginCapabilityValidator() {
131
+ const log = logger.child({ service: "plugin-capability-validator" });
132
+ // -----------------------------------------------------------------------
133
+ // Internal helpers
134
+ // -----------------------------------------------------------------------
135
+ function capabilitySet(manifest) {
136
+ return new Set(manifest.capabilities);
137
+ }
138
+ function buildForbiddenMessage(manifest, operation, missing) {
139
+ return (`Plugin '${manifest.id}' is not allowed to perform '${operation}'. ` +
140
+ `Missing required capabilities: ${missing.join(", ")}`);
141
+ }
142
+ // -----------------------------------------------------------------------
143
+ // Public API
144
+ // -----------------------------------------------------------------------
145
+ return {
146
+ hasCapability(manifest, capability) {
147
+ return manifest.capabilities.includes(capability);
148
+ },
149
+ hasAllCapabilities(manifest, capabilities) {
150
+ const declared = capabilitySet(manifest);
151
+ const missing = capabilities.filter((cap) => !declared.has(cap));
152
+ return {
153
+ allowed: missing.length === 0,
154
+ missing,
155
+ pluginId: manifest.id,
156
+ };
157
+ },
158
+ hasAnyCapability(manifest, capabilities) {
159
+ const declared = capabilitySet(manifest);
160
+ return capabilities.some((cap) => declared.has(cap));
161
+ },
162
+ checkOperation(manifest, operation) {
163
+ const required = OPERATION_CAPABILITIES[operation];
164
+ if (!required) {
165
+ log.warn({ pluginId: manifest.id, operation }, "capability check for unknown operation – rejecting by default");
166
+ return {
167
+ allowed: false,
168
+ missing: [],
169
+ operation,
170
+ pluginId: manifest.id,
171
+ };
172
+ }
173
+ const declared = capabilitySet(manifest);
174
+ const missing = required.filter((cap) => !declared.has(cap));
175
+ if (missing.length > 0) {
176
+ log.debug({ pluginId: manifest.id, operation, missing }, "capability check failed");
177
+ }
178
+ return {
179
+ allowed: missing.length === 0,
180
+ missing,
181
+ operation,
182
+ pluginId: manifest.id,
183
+ };
184
+ },
185
+ assertOperation(manifest, operation) {
186
+ const result = this.checkOperation(manifest, operation);
187
+ if (!result.allowed) {
188
+ const msg = result.missing.length > 0
189
+ ? buildForbiddenMessage(manifest, operation, result.missing)
190
+ : `Plugin '${manifest.id}' attempted unknown operation '${operation}'`;
191
+ throw forbidden(msg);
192
+ }
193
+ },
194
+ assertCapability(manifest, capability) {
195
+ if (!this.hasCapability(manifest, capability)) {
196
+ throw forbidden(`Plugin '${manifest.id}' lacks required capability '${capability}'`);
197
+ }
198
+ },
199
+ checkUiSlot(manifest, slotType) {
200
+ const required = UI_SLOT_CAPABILITIES[slotType];
201
+ if (!required) {
202
+ return {
203
+ allowed: false,
204
+ missing: [],
205
+ operation: `ui.${slotType}.register`,
206
+ pluginId: manifest.id,
207
+ };
208
+ }
209
+ const has = manifest.capabilities.includes(required);
210
+ return {
211
+ allowed: has,
212
+ missing: has ? [] : [required],
213
+ operation: `ui.${slotType}.register`,
214
+ pluginId: manifest.id,
215
+ };
216
+ },
217
+ validateManifestCapabilities(manifest) {
218
+ const declared = capabilitySet(manifest);
219
+ const allMissing = [];
220
+ // Check feature declarations → required capabilities
221
+ for (const [feature, requiredCap] of Object.entries(FEATURE_CAPABILITIES)) {
222
+ const featureValue = manifest[feature];
223
+ if (Array.isArray(featureValue) && featureValue.length > 0) {
224
+ if (!declared.has(requiredCap)) {
225
+ allMissing.push(requiredCap);
226
+ }
227
+ }
228
+ }
229
+ // Check UI slots → required capabilities
230
+ const uiSlots = manifest.ui?.slots ?? [];
231
+ if (uiSlots.length > 0) {
232
+ for (const slot of uiSlots) {
233
+ const requiredCap = UI_SLOT_CAPABILITIES[slot.type];
234
+ if (requiredCap && !declared.has(requiredCap)) {
235
+ if (!allMissing.includes(requiredCap)) {
236
+ allMissing.push(requiredCap);
237
+ }
238
+ }
239
+ }
240
+ }
241
+ // Check launcher declarations → required capabilities
242
+ const launchers = [
243
+ ...(manifest.launchers ?? []),
244
+ ...(manifest.ui?.launchers ?? []),
245
+ ];
246
+ if (launchers.length > 0) {
247
+ for (const launcher of launchers) {
248
+ const requiredCap = LAUNCHER_PLACEMENT_CAPABILITIES[launcher.placementZone];
249
+ if (requiredCap && !declared.has(requiredCap) && !allMissing.includes(requiredCap)) {
250
+ allMissing.push(requiredCap);
251
+ }
252
+ }
253
+ }
254
+ return {
255
+ allowed: allMissing.length === 0,
256
+ missing: allMissing,
257
+ pluginId: manifest.id,
258
+ };
259
+ },
260
+ getRequiredCapabilities(operation) {
261
+ return OPERATION_CAPABILITIES[operation] ?? [];
262
+ },
263
+ getUiSlotCapability(slotType) {
264
+ return UI_SLOT_CAPABILITIES[slotType];
265
+ },
266
+ };
267
+ }
268
+ //# sourceMappingURL=plugin-capability-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-capability-validator.js","sourceRoot":"","sources":["../../src/services/plugin-capability-validator.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,8EAA8E;AAC9E,kCAAkC;AAClC,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,sBAAsB,GAAgD;IAC1E,uBAAuB;IACv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,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;wBACnF,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBAC/B,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC;gBAChC,OAAO,EAAE,UAAU;gBACnB,QAAQ,EAAE,QAAQ,CAAC,EAAE;aACtB,CAAC;QACJ,CAAC;QAED,uBAAuB,CAAC,SAAS;YAC/B,OAAO,sBAAsB,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACjD,CAAC;QAED,mBAAmB,CAAC,QAAQ;YAC1B,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @fileoverview Validates plugin instance configuration against its JSON Schema.
3
+ *
4
+ * Uses Ajv to validate `configJson` values against the `instanceConfigSchema`
5
+ * declared in a plugin's manifest. This ensures that invalid configuration is
6
+ * rejected at the API boundary, not discovered later at worker startup.
7
+ *
8
+ * @module server/services/plugin-config-validator
9
+ */
10
+ import type { JsonSchema } from "@paperclipai/shared";
11
+ export interface ConfigValidationResult {
12
+ valid: boolean;
13
+ errors?: {
14
+ field: string;
15
+ message: string;
16
+ }[];
17
+ }
18
+ /**
19
+ * Validate a config object against a JSON Schema.
20
+ *
21
+ * @param configJson - The configuration values to validate.
22
+ * @param schema - The JSON Schema from the plugin manifest's `instanceConfigSchema`.
23
+ * @returns Validation result with structured field errors on failure.
24
+ */
25
+ export declare function validateInstanceConfig(configJson: Record<string, unknown>, schema: JsonSchema): ConfigValidationResult;
26
+ //# sourceMappingURL=plugin-config-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-config-validator.d.ts","sourceRoot":"","sources":["../../src/services/plugin-config-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,MAAM,EAAE,UAAU,GACjB,sBAAsB,CAwBxB"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @fileoverview Validates plugin instance configuration against its JSON Schema.
3
+ *
4
+ * Uses Ajv to validate `configJson` values against the `instanceConfigSchema`
5
+ * declared in a plugin's manifest. This ensures that invalid configuration is
6
+ * rejected at the API boundary, not discovered later at worker startup.
7
+ *
8
+ * @module server/services/plugin-config-validator
9
+ */
10
+ import Ajv from "ajv";
11
+ import addFormats from "ajv-formats";
12
+ /**
13
+ * Validate a config object against a JSON Schema.
14
+ *
15
+ * @param configJson - The configuration values to validate.
16
+ * @param schema - The JSON Schema from the plugin manifest's `instanceConfigSchema`.
17
+ * @returns Validation result with structured field errors on failure.
18
+ */
19
+ export function validateInstanceConfig(configJson, schema) {
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ const AjvCtor = Ajv.default ?? Ajv;
22
+ const ajv = new AjvCtor({ allErrors: true });
23
+ // ajv-formats v3 default export is a FormatsPlugin object; call it as a plugin.
24
+ const applyFormats = addFormats.default ?? addFormats;
25
+ applyFormats(ajv);
26
+ // Register the secret-ref format used by plugin manifests to mark fields that
27
+ // hold a Paperclip secret UUID rather than a raw value. The format is a UI
28
+ // hint only — UUID validation happens in the secrets handler at resolve time.
29
+ ajv.addFormat("secret-ref", { validate: () => true });
30
+ const validate = ajv.compile(schema);
31
+ const valid = validate(configJson);
32
+ if (valid) {
33
+ return { valid: true };
34
+ }
35
+ const errors = (validate.errors ?? []).map((err) => ({
36
+ field: err.instancePath || "/",
37
+ message: err.message ?? "validation failed",
38
+ }));
39
+ return { valid: false, errors };
40
+ }
41
+ //# sourceMappingURL=plugin-config-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-config-validator.js","sourceRoot":"","sources":["../../src/services/plugin-config-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,GAAyB,MAAM,KAAK,CAAC;AAC5C,OAAO,UAAU,MAAM,aAAa,CAAC;AAQrC;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAAmC,EACnC,MAAkB;IAElB,8DAA8D;IAC9D,MAAM,OAAO,GAAI,GAAW,CAAC,OAAO,IAAI,GAAG,CAAC;IAC5C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,gFAAgF;IAChF,MAAM,YAAY,GAAI,UAAkB,CAAC,OAAO,IAAI,UAAU,CAAC;IAC/D,YAAY,CAAC,GAAG,CAAC,CAAC;IAClB,8EAA8E;IAC9E,2EAA2E;IAC3E,8EAA8E;IAC9E,GAAG,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAEnC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAgB,EAAE,EAAE,CAAC,CAAC;QAChE,KAAK,EAAE,GAAG,CAAC,YAAY,IAAI,GAAG;QAC9B,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,mBAAmB;KAC5C,CAAC,CAAC,CAAC;IAEJ,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAClC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
2
+ import type { PluginLifecycleManager } from "./plugin-lifecycle.js";
3
+ export interface PluginDevWatcher {
4
+ /** Start watching a local-path plugin directory. */
5
+ watch(pluginId: string, packagePath: string): void;
6
+ /** Stop watching a specific plugin. */
7
+ unwatch(pluginId: string): void;
8
+ /** Stop all watchers and clean up. */
9
+ close(): void;
10
+ }
11
+ export type ResolvePluginPackagePath = (pluginId: string) => Promise<string | null | undefined>;
12
+ export interface PluginDevWatcherFsDeps {
13
+ existsSync?: typeof existsSync;
14
+ readFileSync?: typeof readFileSync;
15
+ readdirSync?: typeof readdirSync;
16
+ statSync?: typeof statSync;
17
+ }
18
+ type PluginWatchTarget = {
19
+ path: string;
20
+ recursive: boolean;
21
+ kind: "file" | "dir";
22
+ };
23
+ export declare function resolvePluginWatchTargets(packagePath: string, fsDeps?: Pick<PluginDevWatcherFsDeps, "existsSync" | "readFileSync" | "readdirSync" | "statSync">): PluginWatchTarget[];
24
+ /**
25
+ * Create a PluginDevWatcher that monitors local plugin directories and
26
+ * restarts workers on file changes.
27
+ */
28
+ export declare function createPluginDevWatcher(lifecycle: PluginLifecycleManager, resolvePluginPackagePath?: ResolvePluginPackagePath, fsDeps?: PluginDevWatcherFsDeps): PluginDevWatcher;
29
+ export {};
30
+ //# sourceMappingURL=plugin-dev-watcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-dev-watcher.d.ts","sourceRoot":"","sources":["../../src/services/plugin-dev-watcher.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MA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