happy2 0.0.9 → 0.0.12

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 (286) hide show
  1. package/README.md +29 -0
  2. package/package.json +7 -3
  3. package/packages/happy2-server/PLUGINS.md +402 -0
  4. package/packages/happy2-server/README.md +39 -0
  5. package/packages/happy2-server/dist/daemon.d.ts +39 -0
  6. package/packages/happy2-server/dist/daemon.d.ts.map +1 -0
  7. package/packages/happy2-server/dist/daemon.js +302 -0
  8. package/packages/happy2-server/dist/daemon.js.map +1 -0
  9. package/packages/happy2-server/dist/daemon.test.d.ts +2 -0
  10. package/packages/happy2-server/dist/daemon.test.d.ts.map +1 -0
  11. package/packages/happy2-server/dist/daemon.test.js +245 -0
  12. package/packages/happy2-server/dist/daemon.test.js.map +1 -0
  13. package/packages/happy2-server/dist/index.d.ts +7 -1
  14. package/packages/happy2-server/dist/index.d.ts.map +1 -1
  15. package/packages/happy2-server/dist/index.js +5 -1
  16. package/packages/happy2-server/dist/index.js.map +1 -1
  17. package/packages/happy2-server/dist/modules/agents/daemon.d.ts +10 -13
  18. package/packages/happy2-server/dist/modules/agents/daemon.d.ts.map +1 -1
  19. package/packages/happy2-server/dist/modules/agents/daemon.js +19 -5
  20. package/packages/happy2-server/dist/modules/agents/daemon.js.map +1 -1
  21. package/packages/happy2-server/dist/modules/agents/service.d.ts +9 -1
  22. package/packages/happy2-server/dist/modules/agents/service.d.ts.map +1 -1
  23. package/packages/happy2-server/dist/modules/agents/service.js +59 -2
  24. package/packages/happy2-server/dist/modules/agents/service.js.map +1 -1
  25. package/packages/happy2-server/dist/modules/auth/tokens.d.ts +7 -0
  26. package/packages/happy2-server/dist/modules/auth/tokens.d.ts.map +1 -1
  27. package/packages/happy2-server/dist/modules/auth/tokens.js +33 -0
  28. package/packages/happy2-server/dist/modules/auth/tokens.js.map +1 -1
  29. package/packages/happy2-server/dist/modules/auth/tokens.test.d.ts +2 -0
  30. package/packages/happy2-server/dist/modules/auth/tokens.test.d.ts.map +1 -0
  31. package/packages/happy2-server/dist/modules/auth/tokens.test.js +28 -0
  32. package/packages/happy2-server/dist/modules/auth/tokens.test.js.map +1 -0
  33. package/packages/happy2-server/dist/modules/chat/types.d.ts +1 -1
  34. package/packages/happy2-server/dist/modules/chat/types.d.ts.map +1 -1
  35. package/packages/happy2-server/dist/modules/config/defaults.d.ts.map +1 -1
  36. package/packages/happy2-server/dist/modules/config/defaults.js +5 -0
  37. package/packages/happy2-server/dist/modules/config/defaults.js.map +1 -1
  38. package/packages/happy2-server/dist/modules/config/loader.d.ts.map +1 -1
  39. package/packages/happy2-server/dist/modules/config/loader.js +9 -0
  40. package/packages/happy2-server/dist/modules/config/loader.js.map +1 -1
  41. package/packages/happy2-server/dist/modules/config/loader.test.js +15 -0
  42. package/packages/happy2-server/dist/modules/config/loader.test.js.map +1 -1
  43. package/packages/happy2-server/dist/modules/config/paths.d.ts +1 -0
  44. package/packages/happy2-server/dist/modules/config/paths.d.ts.map +1 -1
  45. package/packages/happy2-server/dist/modules/config/paths.js +1 -0
  46. package/packages/happy2-server/dist/modules/config/paths.js.map +1 -1
  47. package/packages/happy2-server/dist/modules/config/paths.test.js +1 -0
  48. package/packages/happy2-server/dist/modules/config/paths.test.js.map +1 -1
  49. package/packages/happy2-server/dist/modules/config/type.d.ts +5 -0
  50. package/packages/happy2-server/dist/modules/config/type.d.ts.map +1 -1
  51. package/packages/happy2-server/dist/modules/integrations/transport.d.ts.map +1 -1
  52. package/packages/happy2-server/dist/modules/integrations/transport.js +8 -1
  53. package/packages/happy2-server/dist/modules/integrations/transport.js.map +1 -1
  54. package/packages/happy2-server/dist/modules/integrations/types.d.ts +2 -0
  55. package/packages/happy2-server/dist/modules/integrations/types.d.ts.map +1 -1
  56. package/packages/happy2-server/dist/modules/integrations/types.js.map +1 -1
  57. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts +13 -0
  58. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts.map +1 -0
  59. package/packages/happy2-server/dist/modules/plugin/catalog.js +400 -0
  60. package/packages/happy2-server/dist/modules/plugin/catalog.js.map +1 -0
  61. package/packages/happy2-server/dist/modules/plugin/catalog.test.d.ts +2 -0
  62. package/packages/happy2-server/dist/modules/plugin/catalog.test.d.ts.map +1 -0
  63. package/packages/happy2-server/dist/modules/plugin/catalog.test.js +172 -0
  64. package/packages/happy2-server/dist/modules/plugin/catalog.test.js.map +1 -0
  65. package/packages/happy2-server/dist/modules/plugin/functions.test.d.ts +2 -0
  66. package/packages/happy2-server/dist/modules/plugin/functions.test.d.ts.map +1 -0
  67. package/packages/happy2-server/dist/modules/plugin/functions.test.js +123 -0
  68. package/packages/happy2-server/dist/modules/plugin/functions.test.js.map +1 -0
  69. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts +19 -0
  70. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts.map +1 -0
  71. package/packages/happy2-server/dist/modules/plugin/httpBridge.js +206 -0
  72. package/packages/happy2-server/dist/modules/plugin/httpBridge.js.map +1 -0
  73. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts +3 -0
  74. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts.map +1 -0
  75. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js +47 -0
  76. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js.map +1 -0
  77. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts +3 -0
  78. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts.map +1 -0
  79. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js +82 -0
  80. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js.map +1 -0
  81. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.d.ts +3 -0
  82. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.d.ts.map +1 -0
  83. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.js +12 -0
  84. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.js.map +1 -0
  85. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts +288 -0
  86. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts.map +1 -0
  87. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js +19 -0
  88. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js.map +1 -0
  89. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts +3 -0
  90. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts.map +1 -0
  91. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js +63 -0
  92. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js.map +1 -0
  93. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.d.ts +2 -0
  94. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.d.ts.map +1 -0
  95. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js +17 -0
  96. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js.map +1 -0
  97. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.d.ts +3 -0
  98. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.d.ts.map +1 -0
  99. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.js +16 -0
  100. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.js.map +1 -0
  101. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.d.ts +339 -0
  102. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.d.ts.map +1 -0
  103. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.js +22 -0
  104. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.js.map +1 -0
  105. package/packages/happy2-server/dist/modules/plugin/index.d.ts +3 -0
  106. package/packages/happy2-server/dist/modules/plugin/index.d.ts.map +1 -0
  107. package/packages/happy2-server/dist/modules/plugin/index.js +3 -0
  108. package/packages/happy2-server/dist/modules/plugin/index.js.map +1 -0
  109. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts +15 -0
  110. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts.map +1 -0
  111. package/packages/happy2-server/dist/modules/plugin/packageStore.js +90 -0
  112. package/packages/happy2-server/dist/modules/plugin/packageStore.js.map +1 -0
  113. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.d.ts +7 -0
  114. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.d.ts.map +1 -0
  115. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js +9 -0
  116. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js.map +1 -0
  117. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts +9 -0
  118. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts.map +1 -0
  119. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js +64 -0
  120. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js.map +1 -0
  121. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.d.ts +10 -0
  122. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.d.ts.map +1 -0
  123. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.js +20 -0
  124. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.js.map +1 -0
  125. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.d.ts +12 -0
  126. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.d.ts.map +1 -0
  127. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.js +44 -0
  128. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.js.map +1 -0
  129. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts +9 -0
  130. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts.map +1 -0
  131. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js +15 -0
  132. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js.map +1 -0
  133. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.d.ts +23 -0
  134. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.d.ts.map +1 -0
  135. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.js +54 -0
  136. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.js.map +1 -0
  137. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.d.ts +13 -0
  138. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.d.ts.map +1 -0
  139. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.js +37 -0
  140. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.js.map +1 -0
  141. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.d.ts +17 -0
  142. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.d.ts.map +1 -0
  143. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js +29 -0
  144. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js.map +1 -0
  145. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts +27 -0
  146. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts.map +1 -0
  147. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js +180 -0
  148. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js.map +1 -0
  149. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts +9 -0
  150. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts.map +1 -0
  151. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js +122 -0
  152. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js.map +1 -0
  153. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.d.ts +11 -0
  154. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.d.ts.map +1 -0
  155. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.js +18 -0
  156. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.js.map +1 -0
  157. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.d.ts +8 -0
  158. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.d.ts.map +1 -0
  159. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js +19 -0
  160. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js.map +1 -0
  161. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.d.ts +14 -0
  162. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.d.ts.map +1 -0
  163. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.js +20 -0
  164. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.js.map +1 -0
  165. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.d.ts +7 -0
  166. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.d.ts.map +1 -0
  167. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.js +13 -0
  168. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.js.map +1 -0
  169. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.d.ts +7 -0
  170. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.d.ts.map +1 -0
  171. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.js +16 -0
  172. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.js.map +1 -0
  173. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.d.ts +16 -0
  174. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.d.ts.map +1 -0
  175. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.js +38 -0
  176. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.js.map +1 -0
  177. package/packages/happy2-server/dist/modules/plugin/pluginList.d.ts +8 -0
  178. package/packages/happy2-server/dist/modules/plugin/pluginList.d.ts.map +1 -0
  179. package/packages/happy2-server/dist/modules/plugin/pluginList.js +17 -0
  180. package/packages/happy2-server/dist/modules/plugin/pluginList.js.map +1 -0
  181. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.d.ts +11 -0
  182. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.d.ts.map +1 -0
  183. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.js +43 -0
  184. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.js.map +1 -0
  185. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.d.ts +15 -0
  186. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.d.ts.map +1 -0
  187. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.js +37 -0
  188. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.js.map +1 -0
  189. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.d.ts +16 -0
  190. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.d.ts.map +1 -0
  191. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.js +71 -0
  192. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.js.map +1 -0
  193. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.d.ts +14 -0
  194. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.d.ts.map +1 -0
  195. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.js +51 -0
  196. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.js.map +1 -0
  197. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts +56 -0
  198. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts.map +1 -0
  199. package/packages/happy2-server/dist/modules/plugin/runtime.js +147 -0
  200. package/packages/happy2-server/dist/modules/plugin/runtime.js.map +1 -0
  201. package/packages/happy2-server/dist/modules/plugin/secrets.d.ts +17 -0
  202. package/packages/happy2-server/dist/modules/plugin/secrets.d.ts.map +1 -0
  203. package/packages/happy2-server/dist/modules/plugin/secrets.js +56 -0
  204. package/packages/happy2-server/dist/modules/plugin/secrets.js.map +1 -0
  205. package/packages/happy2-server/dist/modules/plugin/secrets.test.d.ts +2 -0
  206. package/packages/happy2-server/dist/modules/plugin/secrets.test.d.ts.map +1 -0
  207. package/packages/happy2-server/dist/modules/plugin/secrets.test.js +14 -0
  208. package/packages/happy2-server/dist/modules/plugin/secrets.test.js.map +1 -0
  209. package/packages/happy2-server/dist/modules/plugin/service.d.ts +60 -0
  210. package/packages/happy2-server/dist/modules/plugin/service.d.ts.map +1 -0
  211. package/packages/happy2-server/dist/modules/plugin/service.js +584 -0
  212. package/packages/happy2-server/dist/modules/plugin/service.js.map +1 -0
  213. package/packages/happy2-server/dist/modules/plugin/types.d.ts +194 -0
  214. package/packages/happy2-server/dist/modules/plugin/types.d.ts.map +1 -0
  215. package/packages/happy2-server/dist/modules/plugin/types.js +10 -0
  216. package/packages/happy2-server/dist/modules/plugin/types.js.map +1 -0
  217. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.d.ts +19 -0
  218. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.d.ts.map +1 -0
  219. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.js +97 -0
  220. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.js.map +1 -0
  221. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.d.ts +2 -0
  222. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.d.ts.map +1 -0
  223. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.js +74 -0
  224. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.js.map +1 -0
  225. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.d.ts +29 -0
  226. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.d.ts.map +1 -0
  227. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.js +126 -0
  228. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.js.map +1 -0
  229. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.d.ts +2 -0
  230. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.d.ts.map +1 -0
  231. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.js +75 -0
  232. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.js.map +1 -0
  233. package/packages/happy2-server/dist/modules/sandbox/index.d.ts +1 -1
  234. package/packages/happy2-server/dist/modules/sandbox/index.d.ts.map +1 -1
  235. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts +9 -1
  236. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts.map +1 -1
  237. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js +218 -4
  238. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js.map +1 -1
  239. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js +157 -2
  240. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js.map +1 -1
  241. package/packages/happy2-server/dist/modules/sandbox/types.d.ts +24 -0
  242. package/packages/happy2-server/dist/modules/sandbox/types.d.ts.map +1 -1
  243. package/packages/happy2-server/dist/modules/schema.d.ts +7781 -5489
  244. package/packages/happy2-server/dist/modules/schema.d.ts.map +1 -1
  245. package/packages/happy2-server/dist/modules/schema.js +87 -1
  246. package/packages/happy2-server/dist/modules/schema.js.map +1 -1
  247. package/packages/happy2-server/dist/modules/sync/syncGetDifference.d.ts.map +1 -1
  248. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js +2 -0
  249. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js.map +1 -1
  250. package/packages/happy2-server/dist/routes/pluginHost.d.ts +6 -0
  251. package/packages/happy2-server/dist/routes/pluginHost.d.ts.map +1 -0
  252. package/packages/happy2-server/dist/routes/pluginHost.js +37 -0
  253. package/packages/happy2-server/dist/routes/pluginHost.js.map +1 -0
  254. package/packages/happy2-server/dist/routes/plugins.d.ts +8 -0
  255. package/packages/happy2-server/dist/routes/plugins.d.ts.map +1 -0
  256. package/packages/happy2-server/dist/routes/plugins.js +198 -0
  257. package/packages/happy2-server/dist/routes/plugins.js.map +1 -0
  258. package/packages/happy2-server/dist/runner.js +64 -19
  259. package/packages/happy2-server/dist/runner.js.map +1 -1
  260. package/packages/happy2-server/dist/server.d.ts +8 -0
  261. package/packages/happy2-server/dist/server.d.ts.map +1 -1
  262. package/packages/happy2-server/dist/server.js +65 -3
  263. package/packages/happy2-server/dist/server.js.map +1 -1
  264. package/packages/happy2-server/dist/systemService.d.ts +48 -0
  265. package/packages/happy2-server/dist/systemService.d.ts.map +1 -0
  266. package/packages/happy2-server/dist/systemService.js +323 -0
  267. package/packages/happy2-server/dist/systemService.js.map +1 -0
  268. package/packages/happy2-server/dist/systemService.test.d.ts +2 -0
  269. package/packages/happy2-server/dist/systemService.test.d.ts.map +1 -0
  270. package/packages/happy2-server/dist/systemService.test.js +280 -0
  271. package/packages/happy2-server/dist/systemService.test.js.map +1 -0
  272. package/packages/happy2-server/dist/web/assets/index-9SGCQLg7.js +46 -0
  273. package/packages/happy2-server/dist/web/assets/{index-DZ1uRLgV.css → index-DWXBQDJB.css} +1 -1
  274. package/packages/happy2-server/dist/web/index.html +2 -2
  275. package/packages/happy2-server/drizzle/0020_plugins.sql +61 -0
  276. package/packages/happy2-server/drizzle/0021_plugin_function_results.sql +11 -0
  277. package/packages/happy2-server/drizzle/0022_plugin_container_runtime_tools.sql +16 -0
  278. package/packages/happy2-server/drizzle/meta/_journal.json +21 -0
  279. package/packages/happy2-server/happy2.example.toml +13 -0
  280. package/packages/happy2-server/plugins/README.md +7 -0
  281. package/packages/happy2-server/plugins/hello/container/Dockerfile +6 -0
  282. package/packages/happy2-server/plugins/hello/plugin.json +16 -0
  283. package/packages/happy2-server/plugins/hello/plugin.png +0 -0
  284. package/packages/happy2-server/plugins/hello/server.mjs +75 -0
  285. package/packages/happy2-server/plugins/hello/skills/hello/SKILL.md +11 -0
  286. package/packages/happy2-server/dist/web/assets/index-DH1SOwNV.js +0 -46
@@ -0,0 +1,339 @@
1
+ export declare const pluginSelection: {
2
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
3
+ name: "id";
4
+ tableName: "plugins";
5
+ dataType: "string";
6
+ columnType: "SQLiteText";
7
+ data: string;
8
+ driverParam: string;
9
+ notNull: true;
10
+ hasDefault: false;
11
+ isPrimaryKey: true;
12
+ isAutoincrement: false;
13
+ hasRuntimeDefault: false;
14
+ enumValues: [string, ...string[]];
15
+ baseColumn: never;
16
+ identity: undefined;
17
+ generated: undefined;
18
+ }, {}, {
19
+ length: number | undefined;
20
+ }>;
21
+ displayName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
22
+ name: "display_name";
23
+ tableName: "plugins";
24
+ dataType: "string";
25
+ columnType: "SQLiteText";
26
+ data: string;
27
+ driverParam: string;
28
+ notNull: true;
29
+ hasDefault: false;
30
+ isPrimaryKey: false;
31
+ isAutoincrement: false;
32
+ hasRuntimeDefault: false;
33
+ enumValues: [string, ...string[]];
34
+ baseColumn: never;
35
+ identity: undefined;
36
+ generated: undefined;
37
+ }, {}, {
38
+ length: number | undefined;
39
+ }>;
40
+ shortName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
41
+ name: "short_name";
42
+ tableName: "plugins";
43
+ dataType: "string";
44
+ columnType: "SQLiteText";
45
+ data: string;
46
+ driverParam: string;
47
+ notNull: true;
48
+ hasDefault: false;
49
+ isPrimaryKey: false;
50
+ isAutoincrement: false;
51
+ hasRuntimeDefault: false;
52
+ enumValues: [string, ...string[]];
53
+ baseColumn: never;
54
+ identity: undefined;
55
+ generated: undefined;
56
+ }, {}, {
57
+ length: number | undefined;
58
+ }>;
59
+ description: import("drizzle-orm/sqlite-core").SQLiteColumn<{
60
+ name: "description";
61
+ tableName: "plugins";
62
+ dataType: "string";
63
+ columnType: "SQLiteText";
64
+ data: string;
65
+ driverParam: string;
66
+ notNull: true;
67
+ hasDefault: false;
68
+ isPrimaryKey: false;
69
+ isAutoincrement: false;
70
+ hasRuntimeDefault: false;
71
+ enumValues: [string, ...string[]];
72
+ baseColumn: never;
73
+ identity: undefined;
74
+ generated: undefined;
75
+ }, {}, {
76
+ length: number | undefined;
77
+ }>;
78
+ sourceKind: import("drizzle-orm/sqlite-core").SQLiteColumn<{
79
+ name: "source_kind";
80
+ tableName: "plugins";
81
+ dataType: "string";
82
+ columnType: "SQLiteText";
83
+ data: string;
84
+ driverParam: string;
85
+ notNull: true;
86
+ hasDefault: false;
87
+ isPrimaryKey: false;
88
+ isAutoincrement: false;
89
+ hasRuntimeDefault: false;
90
+ enumValues: [string, ...string[]];
91
+ baseColumn: never;
92
+ identity: undefined;
93
+ generated: undefined;
94
+ }, {}, {
95
+ length: number | undefined;
96
+ }>;
97
+ sourceReference: import("drizzle-orm/sqlite-core").SQLiteColumn<{
98
+ name: "source_reference";
99
+ tableName: "plugins";
100
+ dataType: "string";
101
+ columnType: "SQLiteText";
102
+ data: string;
103
+ driverParam: string;
104
+ notNull: true;
105
+ hasDefault: false;
106
+ isPrimaryKey: false;
107
+ isAutoincrement: false;
108
+ hasRuntimeDefault: false;
109
+ enumValues: [string, ...string[]];
110
+ baseColumn: never;
111
+ identity: undefined;
112
+ generated: undefined;
113
+ }, {}, {
114
+ length: number | undefined;
115
+ }>;
116
+ sourceVersion: import("drizzle-orm/sqlite-core").SQLiteColumn<{
117
+ name: "source_version";
118
+ tableName: "plugins";
119
+ dataType: "string";
120
+ columnType: "SQLiteText";
121
+ data: string;
122
+ driverParam: string;
123
+ notNull: true;
124
+ hasDefault: false;
125
+ isPrimaryKey: false;
126
+ isAutoincrement: false;
127
+ hasRuntimeDefault: false;
128
+ enumValues: [string, ...string[]];
129
+ baseColumn: never;
130
+ identity: undefined;
131
+ generated: undefined;
132
+ }, {}, {
133
+ length: number | undefined;
134
+ }>;
135
+ packageDigest: import("drizzle-orm/sqlite-core").SQLiteColumn<{
136
+ name: "package_digest";
137
+ tableName: "plugins";
138
+ dataType: "string";
139
+ columnType: "SQLiteText";
140
+ data: string;
141
+ driverParam: string;
142
+ notNull: true;
143
+ hasDefault: false;
144
+ isPrimaryKey: false;
145
+ isAutoincrement: false;
146
+ hasRuntimeDefault: false;
147
+ enumValues: [string, ...string[]];
148
+ baseColumn: never;
149
+ identity: undefined;
150
+ generated: undefined;
151
+ }, {}, {
152
+ length: number | undefined;
153
+ }>;
154
+ manifestJson: import("drizzle-orm/sqlite-core").SQLiteColumn<{
155
+ name: "manifest_json";
156
+ tableName: "plugins";
157
+ dataType: "string";
158
+ columnType: "SQLiteText";
159
+ data: string;
160
+ driverParam: string;
161
+ notNull: true;
162
+ hasDefault: false;
163
+ isPrimaryKey: false;
164
+ isAutoincrement: false;
165
+ hasRuntimeDefault: false;
166
+ enumValues: [string, ...string[]];
167
+ baseColumn: never;
168
+ identity: undefined;
169
+ generated: undefined;
170
+ }, {}, {
171
+ length: number | undefined;
172
+ }>;
173
+ imageContentType: import("drizzle-orm/sqlite-core").SQLiteColumn<{
174
+ name: "image_content_type";
175
+ tableName: "plugins";
176
+ dataType: "string";
177
+ columnType: "SQLiteText";
178
+ data: string;
179
+ driverParam: string;
180
+ notNull: true;
181
+ hasDefault: false;
182
+ isPrimaryKey: false;
183
+ isAutoincrement: false;
184
+ hasRuntimeDefault: false;
185
+ enumValues: [string, ...string[]];
186
+ baseColumn: never;
187
+ identity: undefined;
188
+ generated: undefined;
189
+ }, {}, {
190
+ length: number | undefined;
191
+ }>;
192
+ imageSize: import("drizzle-orm/sqlite-core").SQLiteColumn<{
193
+ name: "image_size";
194
+ tableName: "plugins";
195
+ dataType: "number";
196
+ columnType: "SQLiteInteger";
197
+ data: number;
198
+ driverParam: number;
199
+ notNull: true;
200
+ hasDefault: false;
201
+ isPrimaryKey: false;
202
+ isAutoincrement: false;
203
+ hasRuntimeDefault: false;
204
+ enumValues: undefined;
205
+ baseColumn: never;
206
+ identity: undefined;
207
+ generated: undefined;
208
+ }, {}, {}>;
209
+ imageWidth: import("drizzle-orm/sqlite-core").SQLiteColumn<{
210
+ name: "image_width";
211
+ tableName: "plugins";
212
+ dataType: "number";
213
+ columnType: "SQLiteInteger";
214
+ data: number;
215
+ driverParam: number;
216
+ notNull: true;
217
+ hasDefault: false;
218
+ isPrimaryKey: false;
219
+ isAutoincrement: false;
220
+ hasRuntimeDefault: false;
221
+ enumValues: undefined;
222
+ baseColumn: never;
223
+ identity: undefined;
224
+ generated: undefined;
225
+ }, {}, {}>;
226
+ imageHeight: import("drizzle-orm/sqlite-core").SQLiteColumn<{
227
+ name: "image_height";
228
+ tableName: "plugins";
229
+ dataType: "number";
230
+ columnType: "SQLiteInteger";
231
+ data: number;
232
+ driverParam: number;
233
+ notNull: true;
234
+ hasDefault: false;
235
+ isPrimaryKey: false;
236
+ isAutoincrement: false;
237
+ hasRuntimeDefault: false;
238
+ enumValues: undefined;
239
+ baseColumn: never;
240
+ identity: undefined;
241
+ generated: undefined;
242
+ }, {}, {}>;
243
+ imageThumbhash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
244
+ name: "image_thumbhash";
245
+ tableName: "plugins";
246
+ dataType: "string";
247
+ columnType: "SQLiteText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: true;
251
+ hasDefault: false;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: false;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {
260
+ length: number | undefined;
261
+ }>;
262
+ imageChecksumSha256: import("drizzle-orm/sqlite-core").SQLiteColumn<{
263
+ name: "image_checksum_sha256";
264
+ tableName: "plugins";
265
+ dataType: "string";
266
+ columnType: "SQLiteText";
267
+ data: string;
268
+ driverParam: string;
269
+ notNull: true;
270
+ hasDefault: false;
271
+ isPrimaryKey: false;
272
+ isAutoincrement: false;
273
+ hasRuntimeDefault: false;
274
+ enumValues: [string, ...string[]];
275
+ baseColumn: never;
276
+ identity: undefined;
277
+ generated: undefined;
278
+ }, {}, {
279
+ length: number | undefined;
280
+ }>;
281
+ installedByUserId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
282
+ name: "installed_by_user_id";
283
+ tableName: "plugins";
284
+ dataType: "string";
285
+ columnType: "SQLiteText";
286
+ data: string;
287
+ driverParam: string;
288
+ notNull: false;
289
+ hasDefault: false;
290
+ isPrimaryKey: false;
291
+ isAutoincrement: false;
292
+ hasRuntimeDefault: false;
293
+ enumValues: [string, ...string[]];
294
+ baseColumn: never;
295
+ identity: undefined;
296
+ generated: undefined;
297
+ }, {}, {
298
+ length: number | undefined;
299
+ }>;
300
+ installedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
301
+ name: "installed_at";
302
+ tableName: "plugins";
303
+ dataType: "string";
304
+ columnType: "SQLiteText";
305
+ data: string;
306
+ driverParam: string;
307
+ notNull: true;
308
+ hasDefault: true;
309
+ isPrimaryKey: false;
310
+ isAutoincrement: false;
311
+ hasRuntimeDefault: false;
312
+ enumValues: [string, ...string[]];
313
+ baseColumn: never;
314
+ identity: undefined;
315
+ generated: undefined;
316
+ }, {}, {
317
+ length: number | undefined;
318
+ }>;
319
+ updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
320
+ name: "updated_at";
321
+ tableName: "plugins";
322
+ dataType: "string";
323
+ columnType: "SQLiteText";
324
+ data: string;
325
+ driverParam: string;
326
+ notNull: true;
327
+ hasDefault: true;
328
+ isPrimaryKey: false;
329
+ isAutoincrement: false;
330
+ hasRuntimeDefault: false;
331
+ enumValues: [string, ...string[]];
332
+ baseColumn: never;
333
+ identity: undefined;
334
+ generated: undefined;
335
+ }, {}, {
336
+ length: number | undefined;
337
+ }>;
338
+ };
339
+ //# sourceMappingURL=pluginSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginSelection.d.ts","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/pluginSelection.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;IACxB,EAAE;;;;;;;;;;;;;;;;;;;IACF,WAAW;;;;;;;;;;;;;;;;;;;IACX,SAAS;;;;;;;;;;;;;;;;;;;IACT,WAAW;;;;;;;;;;;;;;;;;;;IACX,UAAU;;;;;;;;;;;;;;;;;;;IACV,eAAe;;;;;;;;;;;;;;;;;;;IACf,aAAa;;;;;;;;;;;;;;;;;;;IACb,aAAa;;;;;;;;;;;;;;;;;;;IACb,YAAY;;;;;;;;;;;;;;;;;;;IACZ,gBAAgB;;;;;;;;;;;;;;;;;;;IAChB,SAAS;;;;;;;;;;;;;;;;;IACT,UAAU;;;;;;;;;;;;;;;;;IACV,WAAW;;;;;;;;;;;;;;;;;IACX,cAAc;;;;;;;;;;;;;;;;;;;IACd,mBAAmB;;;;;;;;;;;;;;;;;;;IACnB,iBAAiB;;;;;;;;;;;;;;;;;;;IACjB,WAAW;;;;;;;;;;;;;;;;;;;IACX,SAAS;;;;;;;;;;;;;;;;;;;CACZ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { plugins } from "../../schema.js";
2
+ export const pluginSelection = {
3
+ id: plugins.id,
4
+ displayName: plugins.displayName,
5
+ shortName: plugins.shortName,
6
+ description: plugins.description,
7
+ sourceKind: plugins.sourceKind,
8
+ sourceReference: plugins.sourceReference,
9
+ sourceVersion: plugins.sourceVersion,
10
+ packageDigest: plugins.packageDigest,
11
+ manifestJson: plugins.manifestJson,
12
+ imageContentType: plugins.imageContentType,
13
+ imageSize: plugins.imageSize,
14
+ imageWidth: plugins.imageWidth,
15
+ imageHeight: plugins.imageHeight,
16
+ imageThumbhash: plugins.imageThumbhash,
17
+ imageChecksumSha256: plugins.imageChecksumSha256,
18
+ installedByUserId: plugins.installedByUserId,
19
+ installedAt: plugins.installedAt,
20
+ updatedAt: plugins.updatedAt,
21
+ };
22
+ //# sourceMappingURL=pluginSelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginSelection.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/pluginSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,EAAE,EAAE,OAAO,CAAC,EAAE;IACd,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,eAAe,EAAE,OAAO,CAAC,eAAe;IACxC,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;IAC1C,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,cAAc,EAAE,OAAO,CAAC,cAAc;IACtC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;IAChD,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;IAC5C,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,SAAS,EAAE,OAAO,CAAC,SAAS;CAC/B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { PluginCatalog, pluginCatalogLoad, pluginPackageLoad } from "./catalog.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnF,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { PluginCatalog, pluginCatalogLoad, pluginPackageLoad } from "./catalog.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../sources/modules/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnF,cAAc,YAAY,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { PluginPackage } from "./types.js";
2
+ /** Persists one exact package snapshot per system plugin so catalog changes cannot mutate installed metadata or files. */
3
+ export declare class PluginPackageStore {
4
+ private readonly root;
5
+ constructor(root: string);
6
+ install(plugin: PluginPackage, pluginId: string): Promise<{
7
+ packageDirectory: string;
8
+ imageStorageKey: string;
9
+ }>;
10
+ remove(pluginId: string): Promise<void>;
11
+ verify(pluginId: string, recordedDirectory: string, shortName: string, packageDigest: string): Promise<void>;
12
+ readImage(pluginId: string, recordedDirectory: string, imageStorageKey: string, shortName: string, packageDigest: string): Promise<Buffer>;
13
+ private path;
14
+ }
15
+ //# sourceMappingURL=packageStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageStore.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/packageStore.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,0HAA0H;AAC1H,qBAAa,kBAAkB;IACf,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAjC,YAA6B,IAAI,EAAE,MAAM,EAAI;IAEvC,OAAO,CACT,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC,CAyChE;IAEK,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5C;IAEK,MAAM,CACR,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,MAAM,EACzB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CAYf;IAEK,SAAS,CACX,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,CAKjB;IAED,OAAO,CAAC,IAAI;CAQf"}
@@ -0,0 +1,90 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { cp, lstat, mkdir, readFile, realpath, rename, rm } from "node:fs/promises";
3
+ import { join, resolve, sep } from "node:path";
4
+ import { pluginPackageLoad } from "./catalog.js";
5
+ /** Persists one exact package snapshot per system plugin so catalog changes cannot mutate installed metadata or files. */
6
+ export class PluginPackageStore {
7
+ root;
8
+ constructor(root) {
9
+ this.root = root;
10
+ }
11
+ async install(plugin, pluginId) {
12
+ await mkdir(this.root, { recursive: true, mode: 0o700 });
13
+ const destination = this.path(pluginId);
14
+ const staging = resolve(this.root, `.${pluginId}.staging-${randomUUID()}`);
15
+ await rm(staging, { force: true, recursive: true });
16
+ try {
17
+ await cp(plugin.directory, staging, {
18
+ recursive: true,
19
+ errorOnExist: true,
20
+ force: false,
21
+ });
22
+ const copied = await pluginPackageLoad(staging, plugin.source.reference);
23
+ if (copied.packageDigest !== plugin.packageDigest)
24
+ throw new Error("Plugin package changed while its system snapshot was copied");
25
+ if (await pathExists(destination)) {
26
+ await this.verify(pluginId, destination, plugin.manifest.shortName, plugin.packageDigest);
27
+ }
28
+ else {
29
+ try {
30
+ await rename(staging, destination);
31
+ }
32
+ catch (publishError) {
33
+ if (!(await pathExists(destination)))
34
+ throw publishError;
35
+ await this.verify(pluginId, destination, plugin.manifest.shortName, plugin.packageDigest);
36
+ }
37
+ }
38
+ return {
39
+ packageDirectory: await realpath(destination),
40
+ imageStorageKey: `${pluginId}/plugin.png`,
41
+ };
42
+ }
43
+ finally {
44
+ await rm(staging, { force: true, recursive: true });
45
+ }
46
+ }
47
+ async remove(pluginId) {
48
+ await rm(this.path(pluginId), { force: true, recursive: true });
49
+ }
50
+ async verify(pluginId, recordedDirectory, shortName, packageDigest) {
51
+ const [canonicalRoot, storedDirectory, actualDirectory] = await Promise.all([
52
+ realpath(this.root),
53
+ realpath(this.path(pluginId)),
54
+ realpath(recordedDirectory),
55
+ ]);
56
+ const expectedDirectory = resolve(canonicalRoot, pluginId);
57
+ if (storedDirectory !== expectedDirectory || actualDirectory !== expectedDirectory)
58
+ throw new Error("Installed plugin package is outside the plugin package store");
59
+ const plugin = await pluginPackageLoad(actualDirectory, shortName);
60
+ if (plugin.packageDigest !== packageDigest)
61
+ throw new Error("Installed plugin package no longer matches its recorded digest");
62
+ }
63
+ async readImage(pluginId, recordedDirectory, imageStorageKey, shortName, packageDigest) {
64
+ await this.verify(pluginId, recordedDirectory, shortName, packageDigest);
65
+ if (imageStorageKey !== `${pluginId}/plugin.png`)
66
+ throw new Error("Installed plugin image storage key is invalid");
67
+ return readFile(join(this.path(pluginId), "plugin.png"));
68
+ }
69
+ path(pluginId) {
70
+ if (!/^[a-z0-9]+$/.test(pluginId))
71
+ throw new Error("Invalid system plugin id");
72
+ const destination = resolve(this.root, pluginId);
73
+ const root = resolve(this.root);
74
+ if (!destination.startsWith(`${root}${sep}`))
75
+ throw new Error("Invalid plugin package path");
76
+ return join(root, pluginId);
77
+ }
78
+ }
79
+ async function pathExists(path) {
80
+ try {
81
+ await lstat(path);
82
+ return true;
83
+ }
84
+ catch (error) {
85
+ if (error.code === "ENOENT")
86
+ return false;
87
+ throw error;
88
+ }
89
+ }
90
+ //# sourceMappingURL=packageStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageStore.js","sourceRoot":"","sources":["../../../sources/modules/plugin/packageStore.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ /**
3
+ * Requires an active server administrator before plugin package or configuration work begins.
4
+ * This read-only authorization boundary does not mutate durable state and prevents unauthorised callers from triggering package-copy or lifecycle side effects.
5
+ */
6
+ export declare function pluginAuthorizeManagement(executor: DrizzleExecutor, actorUserId: string): Promise<void>;
7
+ //# sourceMappingURL=pluginAuthorizeManagement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginAuthorizeManagement.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginAuthorizeManagement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC3C,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -0,0 +1,9 @@
1
+ import { userRequireServerAdmin } from "../chat/userRequireServerAdmin.js";
2
+ /**
3
+ * Requires an active server administrator before plugin package or configuration work begins.
4
+ * This read-only authorization boundary does not mutate durable state and prevents unauthorised callers from triggering package-copy or lifecycle side effects.
5
+ */
6
+ export async function pluginAuthorizeManagement(executor, actorUserId) {
7
+ await userRequireServerAdmin(executor, actorUserId);
8
+ }
9
+ //# sourceMappingURL=pluginAuthorizeManagement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginAuthorizeManagement.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginAuthorizeManagement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC3C,QAAyB,EACzB,WAAmB;IAEnB,MAAM,sBAAsB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import type { PluginCatalog } from "./catalog.js";
3
+ import type { PluginCatalogItem } from "./types.js";
4
+ /**
5
+ * Projects the validated built-in catalog together with administrator-visible installation health and update availability.
6
+ * This read-only boundary does not mutate durable state; it joins package metadata to authorized installation summaries without exposing configured values.
7
+ */
8
+ export declare function pluginCatalogList(executor: DrizzleExecutor, catalog: PluginCatalog, actorUserId: string): Promise<PluginCatalogItem[]>;
9
+ //# sourceMappingURL=pluginCatalogList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginCatalogList.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginCatalogList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD;;;GAGG;AACH,wBAAsB,iBAAiB,CACnC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA0D9B"}
@@ -0,0 +1,64 @@
1
+ import { pluginInstallationList } from "./pluginInstallationList.js";
2
+ import { pluginList } from "./pluginList.js";
3
+ import { effectiveContainer } from "./impl/effectiveContainer.js";
4
+ /**
5
+ * Projects the validated built-in catalog together with administrator-visible installation health and update availability.
6
+ * This read-only boundary does not mutate durable state; it joins package metadata to authorized installation summaries without exposing configured values.
7
+ */
8
+ export async function pluginCatalogList(executor, catalog, actorUserId) {
9
+ const [installations, systemPlugins] = await Promise.all([
10
+ pluginInstallationList(executor, actorUserId),
11
+ pluginList(executor, actorUserId),
12
+ ]);
13
+ const systemByShortName = new Map(systemPlugins.map((plugin) => [plugin.shortName, plugin]));
14
+ return catalog.list().map((plugin) => {
15
+ const systemPlugin = systemByShortName.get(plugin.manifest.shortName);
16
+ const catalogMcp = plugin.manifest.mcp;
17
+ const catalogContainer = effectiveContainer(plugin.manifest);
18
+ const mcp = systemPlugin
19
+ ? systemPlugin.mcp
20
+ : catalogMcp
21
+ ? {
22
+ type: catalogMcp.type,
23
+ container: catalogMcp.type === "remote"
24
+ ? "none"
25
+ : catalogContainer?.dockerfile
26
+ ? "bundled"
27
+ : "selection_required",
28
+ }
29
+ : undefined;
30
+ const container = systemPlugin
31
+ ? systemPlugin.container
32
+ : catalogContainer
33
+ ? {
34
+ image: catalogContainer.dockerfile
35
+ ? "bundled"
36
+ : "selection_required",
37
+ command: Boolean(catalogContainer.command),
38
+ permissions: catalogContainer.permissions,
39
+ }
40
+ : undefined;
41
+ return {
42
+ displayName: plugin.manifest.displayName,
43
+ shortName: plugin.manifest.shortName,
44
+ description: plugin.manifest.description,
45
+ version: plugin.manifest.version,
46
+ packageDigest: plugin.packageDigest,
47
+ iconUrl: `/v0/admin/plugins/${plugin.manifest.shortName}/icon`,
48
+ skills: plugin.skills,
49
+ variables: systemPlugin?.variables ?? plugin.manifest.variables,
50
+ ...(mcp ? { mcp } : {}),
51
+ ...(container ? { container } : {}),
52
+ ...(systemPlugin
53
+ ? {
54
+ systemPlugin: {
55
+ ...systemPlugin,
56
+ updateAvailable: systemPlugin.packageDigest !== plugin.packageDigest,
57
+ installations: installations.filter(({ pluginId }) => pluginId === systemPlugin.id),
58
+ },
59
+ }
60
+ : {}),
61
+ };
62
+ });
63
+ }
64
+ //# sourceMappingURL=pluginCatalogList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginCatalogList.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginCatalogList.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,10 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ /**
3
+ * Resolves a signed plugin capability only while its exact durable container incarnation remains the ready installation authority.
4
+ * This database check makes replacement or invalidation revoke every token issued for an older incarnation without persisting token material.
5
+ */
6
+ export declare function pluginContainerInstanceAuthorize(executor: DrizzleExecutor, installationId: string, containerInstanceId: string): Promise<{
7
+ installationId: string;
8
+ containerName: string;
9
+ } | undefined>;
10
+ //# sourceMappingURL=pluginContainerInstanceAuthorize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginContainerInstanceAuthorize.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginContainerInstanceAuthorize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD;;;GAGG;AACH,wBAAsB,gCAAgC,CAClD,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,MAAM,EACtB,mBAAmB,EAAE,MAAM,GAC5B,OAAO,CAAC;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,CAkBxE"}
@@ -0,0 +1,20 @@
1
+ import { and, eq } from "drizzle-orm";
2
+ import { pluginInstallations } from "../schema.js";
3
+ /**
4
+ * Resolves a signed plugin capability only while its exact durable container incarnation remains the ready installation authority.
5
+ * This database check makes replacement or invalidation revoke every token issued for an older incarnation without persisting token material.
6
+ */
7
+ export async function pluginContainerInstanceAuthorize(executor, installationId, containerInstanceId) {
8
+ const [row] = await executor
9
+ .select({
10
+ installationId: pluginInstallations.id,
11
+ containerName: pluginInstallations.containerName,
12
+ })
13
+ .from(pluginInstallations)
14
+ .where(and(eq(pluginInstallations.id, installationId), eq(pluginInstallations.containerInstanceId, containerInstanceId), eq(pluginInstallations.status, "ready")))
15
+ .limit(1);
16
+ return row?.containerName
17
+ ? { installationId: row.installationId, containerName: row.containerName }
18
+ : undefined;
19
+ }
20
+ //# sourceMappingURL=pluginContainerInstanceAuthorize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginContainerInstanceAuthorize.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginContainerInstanceAuthorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAClD,QAAyB,EACzB,cAAsB,EACtB,mBAA2B;IAE3B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,QAAQ;SACvB,MAAM,CAAC;QACJ,cAAc,EAAE,mBAAmB,CAAC,EAAE;QACtC,aAAa,EAAE,mBAAmB,CAAC,aAAa;KACnD,CAAC;SACD,IAAI,CAAC,mBAAmB,CAAC;SACzB,KAAK,CACF,GAAG,CACC,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE,cAAc,CAAC,EAC1C,EAAE,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,EAChE,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAC1C,CACJ;SACA,KAAK,CAAC,CAAC,CAAC,CAAC;IACd,OAAO,GAAG,EAAE,aAAa;QACrB,CAAC,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,CAAC,aAAa,EAAE;QAC1E,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC"}