happy2 0.0.13 → 0.0.15

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 (300) hide show
  1. package/package.json +1 -1
  2. package/packages/happy2-server/PLUGINS.md +202 -42
  3. package/packages/happy2-server/dist/index.d.ts +1 -0
  4. package/packages/happy2-server/dist/index.d.ts.map +1 -1
  5. package/packages/happy2-server/dist/index.js +1 -0
  6. package/packages/happy2-server/dist/index.js.map +1 -1
  7. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.d.ts.map +1 -1
  8. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js +1 -1
  9. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js.map +1 -1
  10. package/packages/happy2-server/dist/modules/agent/agentConversationCreate.d.ts.map +1 -1
  11. package/packages/happy2-server/dist/modules/agent/agentConversationCreate.js +1 -1
  12. package/packages/happy2-server/dist/modules/agent/agentConversationCreate.js.map +1 -1
  13. package/packages/happy2-server/dist/modules/agent/agentCreate.d.ts.map +1 -1
  14. package/packages/happy2-server/dist/modules/agent/agentCreate.js +2 -2
  15. package/packages/happy2-server/dist/modules/agent/agentCreate.js.map +1 -1
  16. package/packages/happy2-server/dist/modules/agent/agentDefaultCreate.d.ts.map +1 -1
  17. package/packages/happy2-server/dist/modules/agent/agentDefaultCreate.js +1 -1
  18. package/packages/happy2-server/dist/modules/agent/agentDefaultCreate.js.map +1 -1
  19. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js +1 -1
  20. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js.map +1 -1
  21. package/packages/happy2-server/dist/modules/agent/agentImageCreate.d.ts +4 -3
  22. package/packages/happy2-server/dist/modules/agent/agentImageCreate.d.ts.map +1 -1
  23. package/packages/happy2-server/dist/modules/agent/agentImageCreate.js +73 -23
  24. package/packages/happy2-server/dist/modules/agent/agentImageCreate.js.map +1 -1
  25. package/packages/happy2-server/dist/modules/agent/agentImageDeactivate.d.ts +15 -0
  26. package/packages/happy2-server/dist/modules/agent/agentImageDeactivate.d.ts.map +1 -0
  27. package/packages/happy2-server/dist/modules/agent/agentImageDeactivate.js +92 -0
  28. package/packages/happy2-server/dist/modules/agent/agentImageDeactivate.js.map +1 -0
  29. package/packages/happy2-server/dist/modules/agent/agentImageDockerfileGetForHost.d.ts +12 -0
  30. package/packages/happy2-server/dist/modules/agent/agentImageDockerfileGetForHost.d.ts.map +1 -0
  31. package/packages/happy2-server/dist/modules/agent/agentImageDockerfileGetForHost.js +28 -0
  32. package/packages/happy2-server/dist/modules/agent/agentImageDockerfileGetForHost.js.map +1 -0
  33. package/packages/happy2-server/dist/modules/agent/agentImageFindDefinition.d.ts.map +1 -1
  34. package/packages/happy2-server/dist/modules/agent/agentImageFindDefinition.js +2 -2
  35. package/packages/happy2-server/dist/modules/agent/agentImageFindDefinition.js.map +1 -1
  36. package/packages/happy2-server/dist/modules/agent/agentImageGet.js +2 -2
  37. package/packages/happy2-server/dist/modules/agent/agentImageGet.js.map +1 -1
  38. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js +1 -1
  39. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js.map +1 -1
  40. package/packages/happy2-server/dist/modules/agent/agentImageGetReadyDefault.d.ts.map +1 -1
  41. package/packages/happy2-server/dist/modules/agent/agentImageGetReadyDefault.js +2 -2
  42. package/packages/happy2-server/dist/modules/agent/agentImageGetReadyDefault.js.map +1 -1
  43. package/packages/happy2-server/dist/modules/agent/agentImageList.d.ts.map +1 -1
  44. package/packages/happy2-server/dist/modules/agent/agentImageList.js +2 -1
  45. package/packages/happy2-server/dist/modules/agent/agentImageList.js.map +1 -1
  46. package/packages/happy2-server/dist/modules/agent/agentImageListForHost.d.ts +17 -0
  47. package/packages/happy2-server/dist/modules/agent/agentImageListForHost.d.ts.map +1 -0
  48. package/packages/happy2-server/dist/modules/agent/agentImageListForHost.js +38 -0
  49. package/packages/happy2-server/dist/modules/agent/agentImageListForHost.js.map +1 -0
  50. package/packages/happy2-server/dist/modules/agent/agentImageListRequestedBuildIds.d.ts.map +1 -1
  51. package/packages/happy2-server/dist/modules/agent/agentImageListRequestedBuildIds.js +2 -2
  52. package/packages/happy2-server/dist/modules/agent/agentImageListRequestedBuildIds.js.map +1 -1
  53. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js +3 -3
  54. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js.map +1 -1
  55. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.d.ts +4 -3
  56. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.d.ts.map +1 -1
  57. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js +10 -6
  58. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js.map +1 -1
  59. package/packages/happy2-server/dist/modules/agent/agentImageTakeBuild.js +2 -2
  60. package/packages/happy2-server/dist/modules/agent/agentImageTakeBuild.js.map +1 -1
  61. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.d.ts +4 -0
  62. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.d.ts.map +1 -0
  63. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.js +15 -0
  64. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.js.map +1 -0
  65. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.d.ts +2 -0
  66. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.d.ts.map +1 -0
  67. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.js +17 -0
  68. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.js.map +1 -0
  69. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.d.ts +23 -0
  70. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.d.ts.map +1 -0
  71. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.js +70 -0
  72. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.js.map +1 -0
  73. package/packages/happy2-server/dist/modules/agents/service.d.ts +23 -6
  74. package/packages/happy2-server/dist/modules/agents/service.d.ts.map +1 -1
  75. package/packages/happy2-server/dist/modules/agents/service.js +21 -7
  76. package/packages/happy2-server/dist/modules/agents/service.js.map +1 -1
  77. package/packages/happy2-server/dist/modules/auth/tokens.d.ts +15 -0
  78. package/packages/happy2-server/dist/modules/auth/tokens.d.ts.map +1 -1
  79. package/packages/happy2-server/dist/modules/auth/tokens.js +74 -6
  80. package/packages/happy2-server/dist/modules/auth/tokens.js.map +1 -1
  81. package/packages/happy2-server/dist/modules/auth/tokens.test.js +57 -0
  82. package/packages/happy2-server/dist/modules/auth/tokens.test.js.map +1 -1
  83. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.d.ts +19 -0
  84. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.d.ts.map +1 -0
  85. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.js +87 -0
  86. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.js.map +1 -0
  87. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.d.ts +15 -0
  88. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.d.ts.map +1 -0
  89. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.js +38 -0
  90. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.js.map +1 -0
  91. package/packages/happy2-server/dist/modules/chat/chatAppendAudit.d.ts +1 -1
  92. package/packages/happy2-server/dist/modules/chat/chatAppendAudit.d.ts.map +1 -1
  93. package/packages/happy2-server/dist/modules/draft/draftList.d.ts +8 -0
  94. package/packages/happy2-server/dist/modules/draft/draftList.d.ts.map +1 -0
  95. package/packages/happy2-server/dist/modules/draft/draftList.js +27 -0
  96. package/packages/happy2-server/dist/modules/draft/draftList.js.map +1 -0
  97. package/packages/happy2-server/dist/modules/draft/draftUpdate.d.ts +16 -0
  98. package/packages/happy2-server/dist/modules/draft/draftUpdate.d.ts.map +1 -0
  99. package/packages/happy2-server/dist/modules/draft/draftUpdate.js +64 -0
  100. package/packages/happy2-server/dist/modules/draft/draftUpdate.js.map +1 -0
  101. package/packages/happy2-server/dist/modules/draft/types.d.ts +7 -0
  102. package/packages/happy2-server/dist/modules/draft/types.d.ts.map +1 -0
  103. package/packages/happy2-server/dist/modules/draft/types.js +2 -0
  104. package/packages/happy2-server/dist/modules/draft/types.js.map +1 -0
  105. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts.map +1 -1
  106. package/packages/happy2-server/dist/modules/plugin/catalog.js +3 -3
  107. package/packages/happy2-server/dist/modules/plugin/catalog.js.map +1 -1
  108. package/packages/happy2-server/dist/modules/plugin/catalog.test.js +2 -2
  109. package/packages/happy2-server/dist/modules/plugin/catalog.test.js.map +1 -1
  110. package/packages/happy2-server/dist/modules/plugin/environmentManagementServer.test.d.ts +2 -0
  111. package/packages/happy2-server/dist/modules/plugin/environmentManagementServer.test.d.ts.map +1 -0
  112. package/packages/happy2-server/dist/modules/plugin/environmentManagementServer.test.js +183 -0
  113. package/packages/happy2-server/dist/modules/plugin/environmentManagementServer.test.js.map +1 -0
  114. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.d.ts +5 -0
  115. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.d.ts.map +1 -0
  116. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.js +128 -0
  117. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.js.map +1 -0
  118. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts.map +1 -1
  119. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js +10 -1
  120. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js.map +1 -1
  121. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.d.ts +3 -0
  122. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.d.ts.map +1 -0
  123. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.js +68 -0
  124. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.js.map +1 -0
  125. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts.map +1 -1
  126. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js +10 -2
  127. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js.map +1 -1
  128. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts +19 -0
  129. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts.map +1 -1
  130. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js +1 -0
  131. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js.map +1 -1
  132. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts.map +1 -1
  133. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js +4 -2
  134. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js.map +1 -1
  135. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js +14 -0
  136. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js.map +1 -1
  137. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.d.ts +345 -0
  138. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.d.ts.map +1 -0
  139. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.js +22 -0
  140. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.js.map +1 -0
  141. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.d.ts +16 -0
  142. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.d.ts.map +1 -0
  143. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.js +73 -0
  144. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.js.map +1 -0
  145. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.test.d.ts +2 -0
  146. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.test.d.ts.map +1 -0
  147. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.test.js +37 -0
  148. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.test.js.map +1 -0
  149. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts +14 -1
  150. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts.map +1 -1
  151. package/packages/happy2-server/dist/modules/plugin/packageStore.js +112 -1
  152. package/packages/happy2-server/dist/modules/plugin/packageStore.js.map +1 -1
  153. package/packages/happy2-server/dist/modules/plugin/packageStore.test.d.ts +2 -0
  154. package/packages/happy2-server/dist/modules/plugin/packageStore.test.d.ts.map +1 -0
  155. package/packages/happy2-server/dist/modules/plugin/packageStore.test.js +50 -0
  156. package/packages/happy2-server/dist/modules/plugin/packageStore.test.js.map +1 -0
  157. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.d.ts +5 -0
  158. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.d.ts.map +1 -0
  159. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.js +26 -0
  160. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.js.map +1 -0
  161. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts.map +1 -1
  162. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js +7 -3
  163. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js.map +1 -1
  164. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.d.ts +2 -0
  165. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.d.ts.map +1 -0
  166. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.js +44 -0
  167. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.js.map +1 -0
  168. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts +4 -2
  169. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts.map +1 -1
  170. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js +21 -4
  171. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js.map +1 -1
  172. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.d.ts +7 -0
  173. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.d.ts.map +1 -0
  174. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.js +18 -0
  175. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.js.map +1 -0
  176. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.d.ts +13 -0
  177. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.d.ts.map +1 -0
  178. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.js +35 -0
  179. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.js.map +1 -0
  180. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts.map +1 -1
  181. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js +8 -2
  182. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js.map +1 -1
  183. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.d.ts +6 -0
  184. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.d.ts.map +1 -0
  185. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.js +17 -0
  186. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.js.map +1 -0
  187. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.d.ts +18 -0
  188. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.d.ts.map +1 -0
  189. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.js +92 -0
  190. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.js.map +1 -0
  191. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.d.ts +16 -0
  192. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.d.ts.map +1 -0
  193. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.js +71 -0
  194. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.js.map +1 -0
  195. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.d.ts +21 -0
  196. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.d.ts.map +1 -0
  197. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.js +71 -0
  198. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.js.map +1 -0
  199. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.d.ts +12 -0
  200. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.d.ts.map +1 -0
  201. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.js +56 -0
  202. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.js.map +1 -0
  203. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.d.ts +11 -0
  204. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.d.ts.map +1 -0
  205. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.js +44 -0
  206. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.js.map +1 -0
  207. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.d.ts +10 -0
  208. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.d.ts.map +1 -0
  209. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.js +41 -0
  210. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.js.map +1 -0
  211. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.d.ts +26 -0
  212. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.d.ts.map +1 -0
  213. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.js +78 -0
  214. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.js.map +1 -0
  215. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts +25 -0
  216. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts.map +1 -0
  217. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.js +76 -0
  218. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.js.map +1 -0
  219. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.d.ts +11 -0
  220. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.d.ts.map +1 -0
  221. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.js +48 -0
  222. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.js.map +1 -0
  223. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.d.ts +12 -0
  224. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.d.ts.map +1 -0
  225. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.js +42 -0
  226. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.js.map +1 -0
  227. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.d.ts +5 -0
  228. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.d.ts.map +1 -0
  229. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.js +18 -0
  230. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.js.map +1 -0
  231. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts +4 -0
  232. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts.map +1 -0
  233. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.js +11 -0
  234. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.js.map +1 -0
  235. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts +5 -0
  236. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts.map +1 -0
  237. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js +75 -0
  238. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js.map +1 -0
  239. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.d.ts +12 -0
  240. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.d.ts.map +1 -0
  241. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.js +33 -0
  242. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.js.map +1 -0
  243. package/packages/happy2-server/dist/modules/plugin/service.d.ts +108 -7
  244. package/packages/happy2-server/dist/modules/plugin/service.d.ts.map +1 -1
  245. package/packages/happy2-server/dist/modules/plugin/service.js +463 -26
  246. package/packages/happy2-server/dist/modules/plugin/service.js.map +1 -1
  247. package/packages/happy2-server/dist/modules/plugin/types.d.ts +75 -9
  248. package/packages/happy2-server/dist/modules/plugin/types.d.ts.map +1 -1
  249. package/packages/happy2-server/dist/modules/plugin/types.js +12 -0
  250. package/packages/happy2-server/dist/modules/plugin/types.js.map +1 -1
  251. package/packages/happy2-server/dist/modules/schema.d.ts +4526 -3290
  252. package/packages/happy2-server/dist/modules/schema.d.ts.map +1 -1
  253. package/packages/happy2-server/dist/modules/schema.js +49 -0
  254. package/packages/happy2-server/dist/modules/schema.js.map +1 -1
  255. package/packages/happy2-server/dist/modules/sync/syncGetDifference.d.ts.map +1 -1
  256. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js +2 -0
  257. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js.map +1 -1
  258. package/packages/happy2-server/dist/routes/collaboration.d.ts.map +1 -1
  259. package/packages/happy2-server/dist/routes/collaboration.js +38 -1
  260. package/packages/happy2-server/dist/routes/collaboration.js.map +1 -1
  261. package/packages/happy2-server/dist/routes/pluginHost.d.ts +4 -1
  262. package/packages/happy2-server/dist/routes/pluginHost.d.ts.map +1 -1
  263. package/packages/happy2-server/dist/routes/pluginHost.js +401 -6
  264. package/packages/happy2-server/dist/routes/pluginHost.js.map +1 -1
  265. package/packages/happy2-server/dist/routes/plugins.d.ts.map +1 -1
  266. package/packages/happy2-server/dist/routes/plugins.js +229 -3
  267. package/packages/happy2-server/dist/routes/plugins.js.map +1 -1
  268. package/packages/happy2-server/dist/server.d.ts +2 -0
  269. package/packages/happy2-server/dist/server.d.ts.map +1 -1
  270. package/packages/happy2-server/dist/server.js +9 -7
  271. package/packages/happy2-server/dist/server.js.map +1 -1
  272. package/packages/happy2-server/dist/web/assets/index-BT_VezYx.js +39 -0
  273. package/packages/happy2-server/dist/web/assets/{index-BaPUPGPe.css → index-Dys3sWv8.css} +1 -1
  274. package/packages/happy2-server/dist/web/index.html +2 -2
  275. package/packages/happy2-server/drizzle/0028_plugin_api_permissions.sql +1 -0
  276. package/packages/happy2-server/drizzle/0029_plugin_management_requests.sql +35 -0
  277. package/packages/happy2-server/drizzle/0030_personal_synced_drafts.sql +11 -0
  278. package/packages/happy2-server/drizzle/0031_agent_image_deactivation.sql +1 -0
  279. package/packages/happy2-server/drizzle/meta/_journal.json +28 -0
  280. package/packages/happy2-server/plugins/README.md +9 -3
  281. package/packages/happy2-server/plugins/chat-management/plugin.json +3 -3
  282. package/packages/happy2-server/plugins/chat-management/server.mjs +184 -17
  283. package/packages/happy2-server/plugins/environment-management/container/Dockerfile +6 -0
  284. package/packages/happy2-server/plugins/environment-management/plugin.json +17 -0
  285. package/packages/happy2-server/plugins/environment-management/plugin.png +0 -0
  286. package/packages/happy2-server/plugins/environment-management/server.mjs +234 -0
  287. package/packages/happy2-server/plugins/environment-management/skills/happy2-environment-management/SKILL.md +41 -0
  288. package/packages/happy2-server/plugins/plugin-developer/container/Dockerfile +6 -0
  289. package/packages/happy2-server/plugins/plugin-developer/plugin.json +17 -0
  290. package/packages/happy2-server/plugins/plugin-developer/plugin.png +0 -0
  291. package/packages/happy2-server/plugins/plugin-developer/server.mjs +155 -0
  292. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/SKILL.md +59 -0
  293. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/host-api.md +88 -0
  294. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/installing.md +86 -0
  295. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/package-format.md +140 -0
  296. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.d.ts +0 -7
  297. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.d.ts.map +0 -1
  298. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.js +0 -15
  299. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.js.map +0 -1
  300. package/packages/happy2-server/dist/web/assets/index-BnhFxR3U.js +0 -39
@@ -7,6 +7,7 @@ export const pluginInstallationSelection = {
7
7
  sourceReference: plugins.sourceReference,
8
8
  sourceVersion: plugins.sourceVersion,
9
9
  packageDigest: plugins.packageDigest,
10
+ grantedPermissionsJson: pluginInstallations.grantedPermissionsJson,
10
11
  containerImageId: pluginInstallations.containerImageId,
11
12
  status: pluginInstallations.status,
12
13
  statusDetail: pluginInstallations.statusDetail,
@@ -1 +1 @@
1
- {"version":3,"file":"installationSelection.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installationSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,EAAE,EAAE,mBAAmB,CAAC,EAAE;IAC1B,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IACtC,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,eAAe,EAAE,OAAO,CAAC,eAAe;IACxC,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,gBAAgB,EAAE,mBAAmB,CAAC,gBAAgB;IACtD,MAAM,EAAE,mBAAmB,CAAC,MAAM;IAClC,YAAY,EAAE,mBAAmB,CAAC,YAAY;IAC9C,SAAS,EAAE,mBAAmB,CAAC,SAAS;IACxC,iBAAiB,EAAE,mBAAmB,CAAC,iBAAiB;IACxD,WAAW,EAAE,mBAAmB,CAAC,WAAW;IAC5C,SAAS,EAAE,mBAAmB,CAAC,SAAS;IACxC,OAAO,EAAE,mBAAmB,CAAC,OAAO;CACvC,CAAC"}
1
+ {"version":3,"file":"installationSelection.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installationSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,EAAE,EAAE,mBAAmB,CAAC,EAAE;IAC1B,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IACtC,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,eAAe,EAAE,OAAO,CAAC,eAAe;IACxC,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,sBAAsB,EAAE,mBAAmB,CAAC,sBAAsB;IAClE,gBAAgB,EAAE,mBAAmB,CAAC,gBAAgB;IACtD,MAAM,EAAE,mBAAmB,CAAC,MAAM;IAClC,YAAY,EAAE,mBAAmB,CAAC,YAAY;IAC9C,SAAS,EAAE,mBAAmB,CAAC,SAAS;IACxC,iBAAiB,EAAE,mBAAmB,CAAC,iBAAiB;IACxD,WAAW,EAAE,mBAAmB,CAAC,WAAW;IAC5C,SAAS,EAAE,mBAAmB,CAAC,SAAS;IACxC,OAAO,EAAE,mBAAmB,CAAC,OAAO;CACvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"installedManifest.d.ts","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installedManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAqBhE"}
1
+ {"version":3,"file":"installedManifest.d.ts","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installedManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,cAAc,EACtB,MAAM,aAAa,CAAC;AAErB,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAqBhE"}
@@ -1,4 +1,4 @@
1
- import { PluginError } from "../types.js";
1
+ import { PluginError, pluginHostPermissions, } from "../types.js";
2
2
  export function installedManifest(source) {
3
3
  let value;
4
4
  try {
@@ -30,7 +30,9 @@ function container(value) {
30
30
  Array.isArray(value.args) &&
31
31
  value.args.every((argument) => typeof argument === "string") &&
32
32
  Array.isArray(value.permissions) &&
33
- value.permissions.every((permission) => permission === "chats:update" || permission === "plugins:list"));
33
+ value.permissions.every((permission) => typeof permission === "string" &&
34
+ pluginHostPermissions.includes(permission)) &&
35
+ new Set(value.permissions).size === value.permissions.length);
34
36
  }
35
37
  function variable(value) {
36
38
  return (record(value) &&
@@ -1 +1 @@
1
- {"version":3,"file":"installedManifest.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installedManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAC;AAE/D,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC5C,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;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,KAAK,CAAC,SAAS,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CACnF,CAAC;AACN,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC1B,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,UAAU;IACf,OAAO,IAAI,WAAW,CAAC,sBAAsB,EAAE,yCAAyC,CAAC,CAAC;AAC9F,CAAC"}
1
+ {"version":3,"file":"installedManifest.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installedManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,qBAAqB,GAGxB,MAAM,aAAa,CAAC;AAErB,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC5C,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACL,MAAM,UAAU,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,MAAM,UAAU,EAAE,CAAC;IACvC,IACI,KAAK,CAAC,aAAa,KAAK,CAAC;QACzB,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QACjC,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ;QACrC,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QACnC,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ;QACrC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;QAC/B,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;QAEhC,MAAM,UAAU,EAAE,CAAC;IACvB,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC;Q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AC;AAED,SAAS,GAAG,CAAC,KAAc;IACvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACjC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;QACvB,OAAO,CACH,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ;YAC7B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;YACrB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAC7E,CAAC;IACN,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,CACH,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QACjC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC;QAC5D,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS;YAC1B,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CACnF,CAAC;AACN,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC1B,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,UAAU;IACf,OAAO,IAAI,WAAW,CAAC,sBAAsB,EAAE,yCAAyC,CAAC,CAAC;AAC9F,CAAC"}
@@ -13,5 +13,19 @@ describe("installedManifest", () => {
13
13
  mcp: { type: "remote", url: "https://example.com", headers: null },
14
14
  }))).toThrow("Installed plugin manifest is unreadable");
15
15
  });
16
+ it("accepts the channel-management host capability", () => {
17
+ expect(installedManifest(JSON.stringify({
18
+ schemaVersion: 1,
19
+ version: "1.0.0",
20
+ displayName: "Channels",
21
+ shortName: "channels",
22
+ description: "Manages channels",
23
+ variables: [],
24
+ container: {
25
+ args: [],
26
+ permissions: ["channels:manage"],
27
+ },
28
+ })).container?.permissions).toEqual(["channels:manage"]);
29
+ });
16
30
  });
17
31
  //# sourceMappingURL=installedManifest.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"installedManifest.test.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installedManifest.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACpE,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,yCAAyC,CAAC,CAAC;QAC3F,MAAM,CAAC,GAAG,EAAE,CACR,iBAAiB,CACb,IAAI,CAAC,SAAS,CAAC;YACX,aAAa,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,QAAQ;YACrB,SAAS,EAAE,QAAQ;YACnB,WAAW,EAAE,iBAAiB;YAC9B,SAAS,EAAE,EAAE;YACb,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE;SACrE,CAAC,CACL,CACJ,CAAC,OAAO,CAAC,yCAAyC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"installedManifest.test.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/installedManifest.test.ts"],"names":[],"mappings":"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
1
+ export declare const pluginManagementRequestSelection: {
2
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
3
+ name: "id";
4
+ tableName: "plugin_management_requests";
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
+ action: import("drizzle-orm/sqlite-core").SQLiteColumn<{
22
+ name: "action";
23
+ tableName: "plugin_management_requests";
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
+ status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
41
+ name: "status";
42
+ tableName: "plugin_management_requests";
43
+ dataType: "string";
44
+ columnType: "SQLiteText";
45
+ data: string;
46
+ driverParam: string;
47
+ notNull: true;
48
+ hasDefault: true;
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
+ chatId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
60
+ name: "chat_id";
61
+ tableName: "plugin_management_requests";
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
+ agentUserId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
79
+ name: "agent_user_id";
80
+ tableName: "plugin_management_requests";
81
+ dataType: "string";
82
+ columnType: "SQLiteText";
83
+ data: string;
84
+ driverParam: string;
85
+ notNull: false;
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
+ requesterInstallationId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
98
+ name: "requester_installation_id";
99
+ tableName: "plugin_management_requests";
100
+ dataType: "string";
101
+ columnType: "SQLiteText";
102
+ data: string;
103
+ driverParam: string;
104
+ notNull: false;
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
+ displayName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
117
+ name: "display_name";
118
+ tableName: "plugin_management_requests";
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
+ shortName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
136
+ name: "short_name";
137
+ tableName: "plugin_management_requests";
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
+ description: import("drizzle-orm/sqlite-core").SQLiteColumn<{
155
+ name: "description";
156
+ tableName: "plugin_management_requests";
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
+ reason: import("drizzle-orm/sqlite-core").SQLiteColumn<{
174
+ name: "reason";
175
+ tableName: "plugin_management_requests";
176
+ dataType: "string";
177
+ columnType: "SQLiteText";
178
+ data: string;
179
+ driverParam: string;
180
+ notNull: false;
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
+ sourceKind: import("drizzle-orm/sqlite-core").SQLiteColumn<{
193
+ name: "source_kind";
194
+ tableName: "plugin_management_requests";
195
+ dataType: "string";
196
+ columnType: "SQLiteText";
197
+ data: string;
198
+ driverParam: string;
199
+ notNull: false;
200
+ hasDefault: false;
201
+ isPrimaryKey: false;
202
+ isAutoincrement: false;
203
+ hasRuntimeDefault: false;
204
+ enumValues: [string, ...string[]];
205
+ baseColumn: never;
206
+ identity: undefined;
207
+ generated: undefined;
208
+ }, {}, {
209
+ length: number | undefined;
210
+ }>;
211
+ sourceReference: import("drizzle-orm/sqlite-core").SQLiteColumn<{
212
+ name: "source_reference";
213
+ tableName: "plugin_management_requests";
214
+ dataType: "string";
215
+ columnType: "SQLiteText";
216
+ data: string;
217
+ driverParam: string;
218
+ notNull: false;
219
+ hasDefault: false;
220
+ isPrimaryKey: false;
221
+ isAutoincrement: false;
222
+ hasRuntimeDefault: false;
223
+ enumValues: [string, ...string[]];
224
+ baseColumn: never;
225
+ identity: undefined;
226
+ generated: undefined;
227
+ }, {}, {
228
+ length: number | undefined;
229
+ }>;
230
+ targetInstallationId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
231
+ name: "target_installation_id";
232
+ tableName: "plugin_management_requests";
233
+ dataType: "string";
234
+ columnType: "SQLiteText";
235
+ data: string;
236
+ driverParam: string;
237
+ notNull: false;
238
+ hasDefault: false;
239
+ isPrimaryKey: false;
240
+ isAutoincrement: false;
241
+ hasRuntimeDefault: false;
242
+ enumValues: [string, ...string[]];
243
+ baseColumn: never;
244
+ identity: undefined;
245
+ generated: undefined;
246
+ }, {}, {
247
+ length: number | undefined;
248
+ }>;
249
+ installationId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
250
+ name: "installation_id";
251
+ tableName: "plugin_management_requests";
252
+ dataType: "string";
253
+ columnType: "SQLiteText";
254
+ data: string;
255
+ driverParam: string;
256
+ notNull: false;
257
+ hasDefault: false;
258
+ isPrimaryKey: false;
259
+ isAutoincrement: false;
260
+ hasRuntimeDefault: false;
261
+ enumValues: [string, ...string[]];
262
+ baseColumn: never;
263
+ identity: undefined;
264
+ generated: undefined;
265
+ }, {}, {
266
+ length: number | undefined;
267
+ }>;
268
+ resolvedByUserId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
269
+ name: "resolved_by_user_id";
270
+ tableName: "plugin_management_requests";
271
+ dataType: "string";
272
+ columnType: "SQLiteText";
273
+ data: string;
274
+ driverParam: string;
275
+ notNull: false;
276
+ hasDefault: false;
277
+ isPrimaryKey: false;
278
+ isAutoincrement: false;
279
+ hasRuntimeDefault: false;
280
+ enumValues: [string, ...string[]];
281
+ baseColumn: never;
282
+ identity: undefined;
283
+ generated: undefined;
284
+ }, {}, {
285
+ length: number | undefined;
286
+ }>;
287
+ resolvedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
288
+ name: "resolved_at";
289
+ tableName: "plugin_management_requests";
290
+ dataType: "string";
291
+ columnType: "SQLiteText";
292
+ data: string;
293
+ driverParam: string;
294
+ notNull: false;
295
+ hasDefault: false;
296
+ isPrimaryKey: false;
297
+ isAutoincrement: false;
298
+ hasRuntimeDefault: false;
299
+ enumValues: [string, ...string[]];
300
+ baseColumn: never;
301
+ identity: undefined;
302
+ generated: undefined;
303
+ }, {}, {
304
+ length: number | undefined;
305
+ }>;
306
+ lastError: import("drizzle-orm/sqlite-core").SQLiteColumn<{
307
+ name: "last_error";
308
+ tableName: "plugin_management_requests";
309
+ dataType: "string";
310
+ columnType: "SQLiteText";
311
+ data: string;
312
+ driverParam: string;
313
+ notNull: false;
314
+ hasDefault: false;
315
+ isPrimaryKey: false;
316
+ isAutoincrement: false;
317
+ hasRuntimeDefault: false;
318
+ enumValues: [string, ...string[]];
319
+ baseColumn: never;
320
+ identity: undefined;
321
+ generated: undefined;
322
+ }, {}, {
323
+ length: number | undefined;
324
+ }>;
325
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
326
+ name: "created_at";
327
+ tableName: "plugin_management_requests";
328
+ dataType: "string";
329
+ columnType: "SQLiteText";
330
+ data: string;
331
+ driverParam: string;
332
+ notNull: true;
333
+ hasDefault: true;
334
+ isPrimaryKey: false;
335
+ isAutoincrement: false;
336
+ hasRuntimeDefault: false;
337
+ enumValues: [string, ...string[]];
338
+ baseColumn: never;
339
+ identity: undefined;
340
+ generated: undefined;
341
+ }, {}, {
342
+ length: number | undefined;
343
+ }>;
344
+ };
345
+ //# sourceMappingURL=managementRequestSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managementRequestSelection.d.ts","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/managementRequestSelection.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gCAAgC;IACzC,EAAE;;;;;;;;;;;;;;;;;;;IACF,MAAM;;;;;;;;;;;;;;;;;;;IACN,MAAM;;;;;;;;;;;;;;;;;;;IACN,MAAM;;;;;;;;;;;;;;;;;;;IACN,WAAW;;;;;;;;;;;;;;;;;;;IACX,uBAAuB;;;;;;;;;;;;;;;;;;;IACvB,WAAW;;;;;;;;;;;;;;;;;;;IACX,SAAS;;;;;;;;;;;;;;;;;;;IACT,WAAW;;;;;;;;;;;;;;;;;;;IACX,MAAM;;;;;;;;;;;;;;;;;;;IACN,UAAU;;;;;;;;;;;;;;;;;;;IACV,eAAe;;;;;;;;;;;;;;;;;;;IACf,oBAAoB;;;;;;;;;;;;;;;;;;;IACpB,cAAc;;;;;;;;;;;;;;;;;;;IACd,gBAAgB;;;;;;;;;;;;;;;;;;;IAChB,UAAU;;;;;;;;;;;;;;;;;;;IACV,SAAS;;;;;;;;;;;;;;;;;;;IACT,SAAS;;;;;;;;;;;;;;;;;;;CACZ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { pluginManagementRequests } from "../../schema.js";
2
+ export const pluginManagementRequestSelection = {
3
+ id: pluginManagementRequests.id,
4
+ action: pluginManagementRequests.action,
5
+ status: pluginManagementRequests.status,
6
+ chatId: pluginManagementRequests.chatId,
7
+ agentUserId: pluginManagementRequests.agentUserId,
8
+ requesterInstallationId: pluginManagementRequests.requesterInstallationId,
9
+ displayName: pluginManagementRequests.displayName,
10
+ shortName: pluginManagementRequests.shortName,
11
+ description: pluginManagementRequests.description,
12
+ reason: pluginManagementRequests.reason,
13
+ sourceKind: pluginManagementRequests.sourceKind,
14
+ sourceReference: pluginManagementRequests.sourceReference,
15
+ targetInstallationId: pluginManagementRequests.targetInstallationId,
16
+ installationId: pluginManagementRequests.installationId,
17
+ resolvedByUserId: pluginManagementRequests.resolvedByUserId,
18
+ resolvedAt: pluginManagementRequests.resolvedAt,
19
+ lastError: pluginManagementRequests.lastError,
20
+ createdAt: pluginManagementRequests.createdAt,
21
+ };
22
+ //# sourceMappingURL=managementRequestSelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managementRequestSelection.js","sourceRoot":"","sources":["../../../../sources/modules/plugin/impl/managementRequestSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC5C,EAAE,EAAE,wBAAwB,CAAC,EAAE;IAC/B,MAAM,EAAE,wBAAwB,CAAC,MAAM;IACvC,MAAM,EAAE,wBAAwB,CAAC,MAAM;IACvC,MAAM,EAAE,wBAAwB,CAAC,MAAM;IACvC,WAAW,EAAE,wBAAwB,CAAC,WAAW;IACjD,uBAAuB,EAAE,wBAAwB,CAAC,uBAAuB;IACzE,WAAW,EAAE,wBAAwB,CAAC,WAAW;IACjD,SAAS,EAAE,wBAAwB,CAAC,SAAS;IAC7C,WAAW,EAAE,wBAAwB,CAAC,WAAW;IACjD,MAAM,EAAE,wBAAwB,CAAC,MAAM;IACvC,UAAU,EAAE,wBAAwB,CAAC,UAAU;IAC/C,eAAe,EAAE,wBAAwB,CAAC,eAAe;IACzD,oBAAoB,EAAE,wBAAwB,CAAC,oBAAoB;IACnE,cAAc,EAAE,wBAAwB,CAAC,cAAc;IACvD,gBAAgB,EAAE,wBAAwB,CAAC,gBAAgB;IAC3D,UAAU,EAAE,wBAAwB,CAAC,UAAU;IAC/C,SAAS,EAAE,wBAAwB,CAAC,SAAS;IAC7C,SAAS,EAAE,wBAAwB,CAAC,SAAS;CAChD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { WebhookUrlPolicy } from "../integrations/ssrf.js";
2
+ export interface PluginPackageLinkDownload {
3
+ body: Buffer;
4
+ url: string;
5
+ }
6
+ export interface PluginPackageLinkDownloader {
7
+ download(url: string, signal?: AbortSignal): Promise<PluginPackageLinkDownload>;
8
+ }
9
+ /** Downloads bounded plugin ZIP links through the server's public-address policy with DNS-pinned HTTPS sockets and revalidated redirects. */
10
+ export declare class NodePluginPackageLinkDownloader implements PluginPackageLinkDownloader {
11
+ private readonly policy;
12
+ constructor(policy: WebhookUrlPolicy);
13
+ download(url: string, signal?: AbortSignal): Promise<PluginPackageLinkDownload>;
14
+ private downloadFollowing;
15
+ }
16
+ //# sourceMappingURL=packageLinkDownloader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageLinkDownloader.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/packageLinkDownloader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAMhE,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,2BAA2B;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACnF;AAED,6IAA6I;AAC7I,qBAAa,+BAAgC,YAAW,2BAA2B;IACnE,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAnC,YAA6B,MAAM,EAAE,gBAAgB,EAAI;IAEnD,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAUpF;YAEa,iBAAiB;CAoBlC"}
@@ -0,0 +1,73 @@
1
+ import { request } from "node:https";
2
+ const MAX_ARCHIVE_BYTES = 20 * 1024 * 1024;
3
+ const DOWNLOAD_TIMEOUT_MS = 20_000;
4
+ const MAX_REDIRECTS = 3;
5
+ /** Downloads bounded plugin ZIP links through the server's public-address policy with DNS-pinned HTTPS sockets and revalidated redirects. */
6
+ export class NodePluginPackageLinkDownloader {
7
+ policy;
8
+ constructor(policy) {
9
+ this.policy = policy;
10
+ }
11
+ async download(url, signal) {
12
+ const timeout = AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS);
13
+ const bounded = signal ? AbortSignal.any([signal, timeout]) : timeout;
14
+ try {
15
+ return await this.downloadFollowing(url, bounded, 0);
16
+ }
17
+ catch (error) {
18
+ if (timeout.aborted && !signal?.aborted)
19
+ throw new Error("Plugin link download timed out");
20
+ throw error;
21
+ }
22
+ }
23
+ async downloadFollowing(input, signal, redirects) {
24
+ const resolved = await this.policy.resolveForDelivery(input);
25
+ const response = await downloadPinned(resolved.url, resolved.addresses[0], signal);
26
+ if (response.statusCode >= 300 && response.statusCode < 400 && response.location) {
27
+ if (redirects >= MAX_REDIRECTS)
28
+ throw new Error("Plugin link redirected too many times");
29
+ return this.downloadFollowing(new URL(response.location, resolved.url).toString(), signal, redirects + 1);
30
+ }
31
+ if (response.statusCode < 200 || response.statusCode >= 300)
32
+ throw new Error(`Plugin link returned HTTP ${response.statusCode}`);
33
+ return { body: response.body, url: resolved.url };
34
+ }
35
+ }
36
+ function downloadPinned(input, address, signal) {
37
+ const url = new URL(input);
38
+ const lookup = (_hostname, options, callback) => {
39
+ if (options.all)
40
+ callback(null, [address]);
41
+ else
42
+ callback(null, address.address, address.family);
43
+ };
44
+ return new Promise((resolve, reject) => {
45
+ const requestHandle = request(url, {
46
+ headers: { accept: "application/zip, application/octet-stream" },
47
+ lookup,
48
+ signal,
49
+ }, (response) => {
50
+ const chunks = [];
51
+ let bytes = 0;
52
+ response.on("data", (chunk) => {
53
+ bytes += chunk.byteLength;
54
+ if (bytes > MAX_ARCHIVE_BYTES) {
55
+ response.destroy(new Error("Plugin link exceeds 20 MiB"));
56
+ return;
57
+ }
58
+ chunks.push(chunk);
59
+ });
60
+ response.once("error", reject);
61
+ response.once("end", () => resolve({
62
+ body: Buffer.concat(chunks),
63
+ ...(typeof response.headers.location === "string"
64
+ ? { location: response.headers.location }
65
+ : {}),
66
+ statusCode: response.statusCode ?? 0,
67
+ }));
68
+ });
69
+ requestHandle.once("error", reject);
70
+ requestHandle.end();
71
+ });
72
+ }
73
+ //# sourceMappingURL=packageLinkDownloader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageLinkDownloader.js","sourceRoot":"","sources":["../../../sources/modules/plugin/packageLinkDownloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3C,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACnC,MAAM,aAAa,GAAG,CAAC,CAAC;AAWxB,6IAA6I;AAC7I,MAAM,OAAO,+BAA+B;IACX,MAAM;IAAnC,YAA6B,MAAwB;sBAAxB,MAAM;IAAqB,CAAC;IAEzD,KAAK,CAAC,QAAQ,CAAC,GAAW,EAAE,MAAoB;QAC5C,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACtE,IAAI,CAAC;YACD,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACzD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO;gBACnC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;YACtD,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAC3B,KAAa,EACb,MAA+B,EAC/B,SAAiB;QAEjB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC7D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ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageLinkDownloader.test.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/packageLinkDownloader.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import { EventEmitter } from "node:events";
2
+ import { describe, expect, test, vi } from "vitest";
3
+ const request = vi.hoisted(() => vi.fn());
4
+ vi.mock("node:https", () => ({ request }));
5
+ import { NodePluginPackageLinkDownloader } from "./packageLinkDownloader.js";
6
+ describe("NodePluginPackageLinkDownloader", () => {
7
+ test("returns the pinned address array when Node requests all lookup results", async () => {
8
+ request.mockImplementation((_url, options, onResponse) => {
9
+ const handle = new EventEmitter();
10
+ handle.end = () => {
11
+ options.lookup("downloads.example.com", { all: true }, (error, addresses) => {
12
+ expect(error).toBeNull();
13
+ expect(addresses).toEqual([{ address: "93.184.216.34", family: 4 }]);
14
+ const response = new EventEmitter();
15
+ response.headers = {};
16
+ response.statusCode = 200;
17
+ onResponse(response);
18
+ response.emit("data", Buffer.from("zip"));
19
+ response.emit("end");
20
+ });
21
+ };
22
+ return handle;
23
+ });
24
+ const downloader = new NodePluginPackageLinkDownloader({
25
+ validateForStorage: (url) => url,
26
+ resolveForDelivery: async (url) => ({
27
+ url,
28
+ addresses: [{ address: "93.184.216.34", family: 4 }],
29
+ }),
30
+ });
31
+ await expect(downloader.download("https://downloads.example.com/plugin.zip")).resolves.toEqual({
32
+ body: Buffer.from("zip"),
33
+ url: "https://downloads.example.com/plugin.zip",
34
+ });
35
+ });
36
+ });
37
+ //# sourceMappingURL=packageLinkDownloader.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageLinkDownloader.test.js","sourceRoot":"","sources":["../../../sources/modules/plugin/packageLinkDownloader.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAA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,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,IAAI,+BAA+B,CAAC;YACnD,kBAAkB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG;YAChC,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;gBAChC,GAAG;gBACH,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;aACvD,CAAC;SACL,CAAC,CAAC;QAEH,MAAM,MAAM,CACR,UAAU,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAClE,CAAC,QAAQ,CAAC,OAAO,CAAC;YACf,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YACxB,GAAG,EAAE,0CAA0C;SAClD,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,4 +1,9 @@
1
- import type { PluginPackage } from "./types.js";
1
+ import type { PluginPackage, PluginSource } from "./types.js";
2
+ import type { PluginReadySkillPackage } from "./pluginSkillPackageListReady.js";
3
+ export interface PreparedPluginPackage {
4
+ plugin: PluginPackage;
5
+ cleanup(): Promise<void>;
6
+ }
2
7
  /** Persists one exact package snapshot per system plugin so catalog changes cannot mutate installed metadata or files. */
3
8
  export declare class PluginPackageStore {
4
9
  private readonly root;
@@ -7,6 +12,13 @@ export declare class PluginPackageStore {
7
12
  packageDirectory: string;
8
13
  imageStorageKey: string;
9
14
  }>;
15
+ prepareArchive(archive: Buffer, source: PluginSource): Promise<PreparedPluginPackage>;
16
+ stageRequest(plugin: PluginPackage, requestId: string): Promise<string>;
17
+ loadRequest(requestId: string, recordedDirectory: string, source: PluginSource, packageDigest: string): Promise<PluginPackage>;
18
+ loadInstalled(pluginId: string, recordedDirectory: string, shortName: string, packageDigest: string, source: PluginSource): Promise<PluginPackage>;
19
+ readRequestImage(requestId: string, recordedDirectory: string, source: PluginSource, packageDigest: string): Promise<Buffer>;
20
+ removeRequest(requestId: string): Promise<void>;
21
+ syncSkills(installed: readonly PluginReadySkillPackage[], agentHome: string): Promise<void>;
10
22
  remove(pluginId: string): Promise<void>;
11
23
  cleanupTemporary(): Promise<void>;
12
24
  createDownloadDirectory(): Promise<string>;
@@ -24,5 +36,6 @@ export declare class PluginPackageStore {
24
36
  readImage(pluginId: string, recordedDirectory: string, imageStorageKey: string, shortName: string, packageDigest: string): Promise<Buffer>;
25
37
  private path;
26
38
  private load;
39
+ private requestPath;
27
40
  }
28
41
  //# sourceMappingURL=packageStore.d.ts.map