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
@@ -0,0 +1,44 @@
1
+ import { and, eq, sql } from "drizzle-orm";
2
+ import { withTransaction } from "../drizzle.js";
3
+ import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
4
+ import { chatAppendAudit } from "../chat/chatAppendAudit.js";
5
+ import { chatHint } from "../chat/chatHint.js";
6
+ import { pluginManagementRequests } from "../schema.js";
7
+ import { syncSequenceNext } from "../sync/syncSequenceNext.js";
8
+ /** Finalizes a claimed pluginManagementRequests install as approved or failed and advances the originating chats point in one transaction. This completion boundary makes the runtime outcome, audit evidence, and reactive card resolution converge durably. */
9
+ export async function pluginManagementRequestCompleteInstall(executor, input) {
10
+ return withTransaction(executor, async (tx) => {
11
+ const status = input.error ? "failed" : "approved";
12
+ const updated = await tx
13
+ .update(pluginManagementRequests)
14
+ .set({
15
+ status,
16
+ lastError: input.error,
17
+ resolvedAt: sql `CURRENT_TIMESTAMP`,
18
+ updatedAt: sql `CURRENT_TIMESTAMP`,
19
+ })
20
+ .where(and(eq(pluginManagementRequests.id, input.requestId), eq(pluginManagementRequests.chatId, input.chatId), eq(pluginManagementRequests.status, "processing"), eq(pluginManagementRequests.installationId, input.installationId)))
21
+ .returning({ id: pluginManagementRequests.id });
22
+ if (updated.length !== 1)
23
+ throw new Error("Claimed plugin install request was not found");
24
+ await chatAppendAudit(tx, {
25
+ actorUserId: input.actorUserId,
26
+ action: input.error ? "plugin.install_failed" : "plugin.install_approved",
27
+ targetType: "plugin_management_request",
28
+ targetId: input.requestId,
29
+ chatId: input.chatId,
30
+ after: {
31
+ installationId: input.installationId,
32
+ ...(input.error ? { error: input.error } : {}),
33
+ },
34
+ });
35
+ const sequence = await syncSequenceNext(tx);
36
+ await tx
37
+ .update(pluginManagementRequests)
38
+ .set({ syncSequence: sequence })
39
+ .where(eq(pluginManagementRequests.id, input.requestId));
40
+ const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, input.error ? "plugin.install_failed" : "plugin.install_approved", input.requestId);
41
+ return chatHint(sequence, input.chatId, mutation.pts);
42
+ });
43
+ }
44
+ //# sourceMappingURL=pluginManagementRequestCompleteInstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestCompleteInstall.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCompleteInstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,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BACH,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACjD;SACJ,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,EAAE;aACH,MAAM,CAAC,wBAAwB,CAAC;aAChC,GAAG,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;aAC/B,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAC7D,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAC1C,EAAE,EACF,QAAQ,EACR,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,yBAAyB,EACjE,KAAK,CAAC,SAAS,CAClB,CAAC;QACF,OAAO,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import type { MutationHint } from "../chat/types.js";
3
+ /** Finalizes a claimed pluginManagementRequests uninstall as approved or failed and advances the originating chats point in one transaction. This completion boundary records the runtime-removal outcome with audit and reactive card evidence. */
4
+ export declare function pluginManagementRequestCompleteUninstall(executor: DrizzleExecutor, input: {
5
+ actorUserId: string;
6
+ chatId: string;
7
+ requestId: string;
8
+ error?: string;
9
+ }): Promise<MutationHint>;
10
+ //# sourceMappingURL=pluginManagementRequestCompleteUninstall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestCompleteUninstall.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCompleteUninstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,oPAAoP;AACpP,wBAAsB,wCAAwC,CAC1D,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAClF,OAAO,CAAC,YAAY,CAAC,CA2CvB"}
@@ -0,0 +1,41 @@
1
+ import { and, eq, sql } from "drizzle-orm";
2
+ import { withTransaction } from "../drizzle.js";
3
+ import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
4
+ import { chatAppendAudit } from "../chat/chatAppendAudit.js";
5
+ import { chatHint } from "../chat/chatHint.js";
6
+ import { pluginManagementRequests } from "../schema.js";
7
+ import { syncSequenceNext } from "../sync/syncSequenceNext.js";
8
+ /** Finalizes a claimed pluginManagementRequests uninstall as approved or failed and advances the originating chats point in one transaction. This completion boundary records the runtime-removal outcome with audit and reactive card evidence. */
9
+ export async function pluginManagementRequestCompleteUninstall(executor, input) {
10
+ return withTransaction(executor, async (tx) => {
11
+ const status = input.error ? "failed" : "approved";
12
+ const updated = await tx
13
+ .update(pluginManagementRequests)
14
+ .set({
15
+ status,
16
+ lastError: input.error,
17
+ resolvedAt: sql `CURRENT_TIMESTAMP`,
18
+ updatedAt: sql `CURRENT_TIMESTAMP`,
19
+ })
20
+ .where(and(eq(pluginManagementRequests.id, input.requestId), eq(pluginManagementRequests.chatId, input.chatId), eq(pluginManagementRequests.status, "processing")))
21
+ .returning({ id: pluginManagementRequests.id });
22
+ if (updated.length !== 1)
23
+ throw new Error("Claimed plugin uninstall request was not found");
24
+ await chatAppendAudit(tx, {
25
+ actorUserId: input.actorUserId,
26
+ action: input.error ? "plugin.uninstall_failed" : "plugin.uninstall_approved",
27
+ targetType: "plugin_management_request",
28
+ targetId: input.requestId,
29
+ chatId: input.chatId,
30
+ after: input.error ? { error: input.error } : undefined,
31
+ });
32
+ const sequence = await syncSequenceNext(tx);
33
+ await tx
34
+ .update(pluginManagementRequests)
35
+ .set({ syncSequence: sequence })
36
+ .where(eq(pluginManagementRequests.id, input.requestId));
37
+ const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, input.error ? "plugin.uninstall_failed" : "plugin.uninstall_approved", input.requestId);
38
+ return chatHint(sequence, input.chatId, mutation.pts);
39
+ });
40
+ }
41
+ //# sourceMappingURL=pluginManagementRequestCompleteUninstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestCompleteUninstall.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCompleteUninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,oPAAoP;AACpP,MAAM,CAAC,KAAK,UAAU,wCAAwC,CAC1D,QAAyB,EACzB,KAAiF;IAEjF,OAAO,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC;QACnD,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EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAC7D,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAC1C,EAAE,EACF,QAAQ,EACR,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,2BAA2B,EACrE,KAAK,CAAC,SAAS,CAClB,CAAC;QACF,OAAO,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import type { MutationHint } from "../chat/types.js";
3
+ import { type PluginManagementRequestSummary } from "./types.js";
4
+ /** Creates one idempotent pluginManagementRequests install for an immutable staged package and advances the originating chats point in one transaction. This boundary binds audit and reactive approval evidence to the exact agent call before installation authority exists. */
5
+ export declare function pluginManagementRequestCreateInstall(executor: DrizzleExecutor, input: {
6
+ id: string;
7
+ actorUserId: string;
8
+ agentUserId: string;
9
+ callId: string;
10
+ chatId: string;
11
+ requesterInstallationId: string;
12
+ displayName: string;
13
+ shortName: string;
14
+ description: string;
15
+ reason?: string;
16
+ sourceKind: "archive" | "link";
17
+ sourceReference: string;
18
+ packageDigest: string;
19
+ packageDirectory: string;
20
+ installationId: string;
21
+ }): Promise<{
22
+ created: boolean;
23
+ hint?: MutationHint;
24
+ request: PluginManagementRequestSummary;
25
+ }>;
26
+ //# sourceMappingURL=pluginManagementRequestCreateInstall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestCreateInstall.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateInstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EAAe,KAAK,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAE9E,kRAAkR;AAClR,wBAAsB,oCAAoC,CACtD,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE;IACH,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CAC1B,GACF,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,8BAA8B,CAAA;CAAE,CAAC,CA8E7F"}
@@ -0,0 +1,78 @@
1
+ import { and, eq } from "drizzle-orm";
2
+ import { withTransaction } from "../drizzle.js";
3
+ import { chatAppendAudit } from "../chat/chatAppendAudit.js";
4
+ import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
5
+ import { chatGetAccess } from "../chat/chatGetAccess.js";
6
+ import { chatHint } from "../chat/chatHint.js";
7
+ import { pluginManagementRequests } from "../schema.js";
8
+ import { syncSequenceNext } from "../sync/syncSequenceNext.js";
9
+ import { asPluginManagementRequest } from "./impl/asManagementRequest.js";
10
+ import { pluginManagementRequestSelection } from "./impl/managementRequestSelection.js";
11
+ import { PluginError } from "./types.js";
12
+ /** Creates one idempotent pluginManagementRequests install for an immutable staged package and advances the originating chats point in one transaction. This boundary binds audit and reactive approval evidence to the exact agent call before installation authority exists. */
13
+ export async function pluginManagementRequestCreateInstall(executor, input) {
14
+ return withTransaction(executor, async (tx) => {
15
+ const access = await chatGetAccess(tx, input.actorUserId, input.chatId, true);
16
+ if (!access)
17
+ throw new PluginError("forbidden", "The originating user cannot access this chat");
18
+ const [existing] = await tx
19
+ .select(pluginManagementRequestSelection)
20
+ .from(pluginManagementRequests)
21
+ .where(and(eq(pluginManagementRequests.requesterInstallationId, input.requesterInstallationId), eq(pluginManagementRequests.callId, input.callId), eq(pluginManagementRequests.action, "install")))
22
+ .limit(1);
23
+ if (existing)
24
+ return { created: false, request: asPluginManagementRequest(existing) };
25
+ await tx.insert(pluginManagementRequests).values({
26
+ id: input.id,
27
+ action: "install",
28
+ status: "pending",
29
+ chatId: input.chatId,
30
+ actorUserId: input.actorUserId,
31
+ agentUserId: input.agentUserId,
32
+ requesterInstallationId: input.requesterInstallationId,
33
+ callId: input.callId,
34
+ displayName: input.displayName,
35
+ shortName: input.shortName,
36
+ description: input.description,
37
+ reason: input.reason,
38
+ sourceKind: input.sourceKind,
39
+ sourceReference: input.sourceReference,
40
+ packageDigest: input.packageDigest,
41
+ packageDirectory: input.packageDirectory,
42
+ installationId: input.installationId,
43
+ });
44
+ await chatAppendAudit(tx, {
45
+ actorUserId: input.actorUserId,
46
+ action: "plugin.install_requested",
47
+ targetType: "plugin_management_request",
48
+ targetId: input.id,
49
+ chatId: input.chatId,
50
+ after: {
51
+ agentUserId: input.agentUserId,
52
+ requesterInstallationId: input.requesterInstallationId,
53
+ shortName: input.shortName,
54
+ sourceKind: input.sourceKind,
55
+ sourceReference: input.sourceReference,
56
+ },
57
+ });
58
+ const sequence = await syncSequenceNext(tx);
59
+ await tx
60
+ .update(pluginManagementRequests)
61
+ .set({ syncSequence: sequence })
62
+ .where(eq(pluginManagementRequests.id, input.id));
63
+ const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, "plugin.install_requested", input.id);
64
+ const [created] = await tx
65
+ .select(pluginManagementRequestSelection)
66
+ .from(pluginManagementRequests)
67
+ .where(eq(pluginManagementRequests.id, input.id))
68
+ .limit(1);
69
+ if (!created)
70
+ throw new Error("Plugin management request projection was not found");
71
+ return {
72
+ created: true,
73
+ hint: chatHint(sequence, input.chatId, mutation.pts),
74
+ request: asPluginManagementRequest(created),
75
+ };
76
+ });
77
+ }
78
+ //# sourceMappingURL=pluginManagementRequestCreateInstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestCreateInstall.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateInstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAuC,MAAM,YAAY,CAAC;AAE9E,kRAAkR;AAClR,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACtD,QAAyB,EACzB,KAgBC;IAED,OAAO,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,M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CAAC;QACpF,OAAO;YACH,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;YACpD,OAAO,EAAE,yBAAyB,CAAC,OAAO,CAAC;SAC9C,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import type { MutationHint } from "../chat/types.js";
3
+ import { type PluginManagementRequestSummary, type PluginSource } from "./types.js";
4
+ /** Creates one idempotent pluginManagementRequests uninstall with a validated metadata snapshot and advances the originating chats point in one transaction. This boundary binds human review and audit evidence to the exact agent call and installation target. */
5
+ export declare function pluginManagementRequestCreateUninstall(executor: DrizzleExecutor, input: {
6
+ id: string;
7
+ actorUserId: string;
8
+ agentUserId: string;
9
+ callId: string;
10
+ chatId: string;
11
+ requesterInstallationId: string;
12
+ targetInstallationId: string;
13
+ displayName: string;
14
+ shortName: string;
15
+ description: string;
16
+ reason?: string;
17
+ source: PluginSource;
18
+ packageDigest: string;
19
+ packageDirectory: string;
20
+ }): Promise<{
21
+ created: boolean;
22
+ hint?: MutationHint;
23
+ request: PluginManagementRequestSummary;
24
+ }>;
25
+ //# sourceMappingURL=pluginManagementRequestCreateUninstall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestCreateUninstall.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateUninstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EAAe,KAAK,8BAA8B,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjG,qQAAqQ;AACrQ,wBAAsB,sCAAsC,CACxD,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE;IACH,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC5B,GACF,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,8BAA8B,CAAA;CAAE,CAAC,CA4E7F"}
@@ -0,0 +1,76 @@
1
+ import { and, eq } from "drizzle-orm";
2
+ import { withTransaction } from "../drizzle.js";
3
+ import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
4
+ import { chatAppendAudit } from "../chat/chatAppendAudit.js";
5
+ import { chatGetAccess } from "../chat/chatGetAccess.js";
6
+ import { chatHint } from "../chat/chatHint.js";
7
+ import { pluginManagementRequests } from "../schema.js";
8
+ import { syncSequenceNext } from "../sync/syncSequenceNext.js";
9
+ import { asPluginManagementRequest } from "./impl/asManagementRequest.js";
10
+ import { pluginManagementRequestSelection } from "./impl/managementRequestSelection.js";
11
+ import { PluginError } from "./types.js";
12
+ /** Creates one idempotent pluginManagementRequests uninstall with a validated metadata snapshot and advances the originating chats point in one transaction. This boundary binds human review and audit evidence to the exact agent call and installation target. */
13
+ export async function pluginManagementRequestCreateUninstall(executor, input) {
14
+ return withTransaction(executor, async (tx) => {
15
+ if (!(await chatGetAccess(tx, input.actorUserId, input.chatId, true)))
16
+ throw new PluginError("forbidden", "The originating user cannot access this chat");
17
+ const [existing] = await tx
18
+ .select(pluginManagementRequestSelection)
19
+ .from(pluginManagementRequests)
20
+ .where(and(eq(pluginManagementRequests.requesterInstallationId, input.requesterInstallationId), eq(pluginManagementRequests.callId, input.callId), eq(pluginManagementRequests.action, "uninstall")))
21
+ .limit(1);
22
+ if (existing)
23
+ return { created: false, request: asPluginManagementRequest(existing) };
24
+ await tx.insert(pluginManagementRequests).values({
25
+ id: input.id,
26
+ action: "uninstall",
27
+ status: "pending",
28
+ chatId: input.chatId,
29
+ actorUserId: input.actorUserId,
30
+ agentUserId: input.agentUserId,
31
+ requesterInstallationId: input.requesterInstallationId,
32
+ callId: input.callId,
33
+ displayName: input.displayName,
34
+ shortName: input.shortName,
35
+ description: input.description,
36
+ reason: input.reason,
37
+ sourceKind: input.source.kind,
38
+ sourceReference: input.source.reference,
39
+ packageDigest: input.packageDigest,
40
+ packageDirectory: input.packageDirectory,
41
+ targetInstallationId: input.targetInstallationId,
42
+ });
43
+ await chatAppendAudit(tx, {
44
+ actorUserId: input.actorUserId,
45
+ action: "plugin.uninstall_requested",
46
+ targetType: "plugin_management_request",
47
+ targetId: input.id,
48
+ chatId: input.chatId,
49
+ after: {
50
+ agentUserId: input.agentUserId,
51
+ requesterInstallationId: input.requesterInstallationId,
52
+ targetInstallationId: input.targetInstallationId,
53
+ shortName: input.shortName,
54
+ },
55
+ });
56
+ const sequence = await syncSequenceNext(tx);
57
+ await tx
58
+ .update(pluginManagementRequests)
59
+ .set({ syncSequence: sequence })
60
+ .where(eq(pluginManagementRequests.id, input.id));
61
+ const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, "plugin.uninstall_requested", input.id);
62
+ const [created] = await tx
63
+ .select(pluginManagementRequestSelection)
64
+ .from(pluginManagementRequests)
65
+ .where(eq(pluginManagementRequests.id, input.id))
66
+ .limit(1);
67
+ if (!created)
68
+ throw new Error("Plugin uninstall request projection was not found");
69
+ return {
70
+ created: true,
71
+ hint: chatHint(sequence, input.chatId, mutation.pts),
72
+ request: asPluginManagementRequest(created),
73
+ };
74
+ });
75
+ }
76
+ //# sourceMappingURL=pluginManagementRequestCreateUninstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestCreateUninstall.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateUninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,WAAW,EAA0D,MAAM,YAAY,CAAC;AAEjG,qQAAqQ;AACrQ,MAAM,CAAC,KAAK,UAAU,sCAAsC,CACxD,QAAyB,EACzB,KAeC;IAED,OAAO,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;QAC1C,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACjE,MAAM,IAAI,WAAW,CAAC,WAAW,EAAE,8CAA8C,CAAC,CAAC;QACvF,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,EAAE;aACtB,MAAM,CAAC,gCAAgC,CAAC;aACxC,IAAI,CAAC,w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AC"}
@@ -0,0 +1,11 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import type { MutationHint } from "../chat/types.js";
3
+ import type { PluginManagementRequestAction } from "./types.js";
4
+ /** Denies one pending pluginManagementRequests row and advances the originating chats point for a chat-member administrator in one transaction. This resolution boundary keeps authorization, audit evidence, and the reactive card state consistent. */
5
+ export declare function pluginManagementRequestDeny(executor: DrizzleExecutor, input: {
6
+ actorUserId: string;
7
+ chatId: string;
8
+ requestId: string;
9
+ action: PluginManagementRequestAction;
10
+ }): Promise<MutationHint>;
11
+ //# sourceMappingURL=pluginManagementRequestDeny.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestDeny.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestDeny.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEhE,yPAAyP;AACzP,wBAAsB,2BAA2B,CAC7C,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,6BAA6B,CAAC;CACzC,GACF,OAAO,CAAC,YAAY,CAAC,CAiDvB"}
@@ -0,0 +1,48 @@
1
+ import { and, eq, sql } from "drizzle-orm";
2
+ import { withTransaction } from "../drizzle.js";
3
+ import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
4
+ import { chatAppendAudit } from "../chat/chatAppendAudit.js";
5
+ import { chatGetAccess } from "../chat/chatGetAccess.js";
6
+ import { chatHint } from "../chat/chatHint.js";
7
+ import { userRequireServerAdmin } from "../chat/userRequireServerAdmin.js";
8
+ import { pluginManagementRequests } from "../schema.js";
9
+ import { syncSequenceNext } from "../sync/syncSequenceNext.js";
10
+ import { PluginError } from "./types.js";
11
+ /** Denies one pending pluginManagementRequests row and advances the originating chats point for a chat-member administrator in one transaction. This resolution boundary keeps authorization, audit evidence, and the reactive card state consistent. */
12
+ export async function pluginManagementRequestDeny(executor, input) {
13
+ return withTransaction(executor, async (tx) => {
14
+ await userRequireServerAdmin(tx, input.actorUserId);
15
+ if (!(await chatGetAccess(tx, input.actorUserId, input.chatId, true)))
16
+ throw new PluginError("forbidden", "Chat membership is required");
17
+ const updated = await tx
18
+ .update(pluginManagementRequests)
19
+ .set({
20
+ status: "denied",
21
+ resolvedByUserId: input.actorUserId,
22
+ resolvedAt: sql `CURRENT_TIMESTAMP`,
23
+ updatedAt: sql `CURRENT_TIMESTAMP`,
24
+ })
25
+ .where(and(eq(pluginManagementRequests.id, input.requestId), eq(pluginManagementRequests.chatId, input.chatId), eq(pluginManagementRequests.action, input.action), eq(pluginManagementRequests.status, "pending")))
26
+ .returning({
27
+ id: pluginManagementRequests.id,
28
+ action: pluginManagementRequests.action,
29
+ });
30
+ if (updated.length !== 1)
31
+ throw new PluginError("conflict", `Plugin ${input.action} request is not pending`);
32
+ await chatAppendAudit(tx, {
33
+ actorUserId: input.actorUserId,
34
+ action: `plugin.${updated[0].action}_denied`,
35
+ targetType: "plugin_management_request",
36
+ targetId: input.requestId,
37
+ chatId: input.chatId,
38
+ });
39
+ const sequence = await syncSequenceNext(tx);
40
+ await tx
41
+ .update(pluginManagementRequests)
42
+ .set({ syncSequence: sequence })
43
+ .where(eq(pluginManagementRequests.id, input.requestId));
44
+ const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, `plugin.${updated[0].action}_denied`, input.requestId);
45
+ return chatHint(sequence, input.chatId, mutation.pts);
46
+ });
47
+ }
48
+ //# sourceMappingURL=pluginManagementRequestDeny.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestDeny.js","sourceRoot":"","sources":["../../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SAAS,CAClB,CAAC;QACF,OAAO,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import { type PluginSource } from "./types.js";
3
+ export interface PluginManagementRequestPackage {
4
+ id: string;
5
+ chatId: string;
6
+ packageDigest: string;
7
+ packageDirectory: string;
8
+ source: PluginSource;
9
+ }
10
+ /** Returns the private staged-package coordinates for one visible approval and does not mutate durable state. This boundary lets the package store integrity-check an image or approved operation without exposing filesystem paths through routes. */
11
+ export declare function pluginManagementRequestGetPackage(executor: DrizzleExecutor, actorUserId: string, chatId: string, requestId: string): Promise<PluginManagementRequestPackage>;
12
+ //# sourceMappingURL=pluginManagementRequestGetPackage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestGetPackage.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestGetPackage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,8BAA8B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,uPAAuP;AACvP,wBAAsB,iCAAiC,CACnD,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,8BAA8B,CAAC,CAyCzC"}
@@ -0,0 +1,42 @@
1
+ import { and, eq } from "drizzle-orm";
2
+ import { chatGetAccess } from "../chat/chatGetAccess.js";
3
+ import { pluginManagementRequests } from "../schema.js";
4
+ import { PluginError } from "./types.js";
5
+ /** Returns the private staged-package coordinates for one visible approval and does not mutate durable state. This boundary lets the package store integrity-check an image or approved operation without exposing filesystem paths through routes. */
6
+ export async function pluginManagementRequestGetPackage(executor, actorUserId, chatId, requestId) {
7
+ if (!(await chatGetAccess(executor, actorUserId, chatId, true)))
8
+ throw new PluginError("forbidden", "Chat membership is required");
9
+ const [row] = await executor
10
+ .select({
11
+ id: pluginManagementRequests.id,
12
+ chatId: pluginManagementRequests.chatId,
13
+ action: pluginManagementRequests.action,
14
+ status: pluginManagementRequests.status,
15
+ sourceKind: pluginManagementRequests.sourceKind,
16
+ sourceReference: pluginManagementRequests.sourceReference,
17
+ packageDigest: pluginManagementRequests.packageDigest,
18
+ packageDirectory: pluginManagementRequests.packageDirectory,
19
+ })
20
+ .from(pluginManagementRequests)
21
+ .where(and(eq(pluginManagementRequests.id, requestId), eq(pluginManagementRequests.chatId, chatId)))
22
+ .limit(1);
23
+ if (!row)
24
+ throw new PluginError("not_found", "Plugin management request was not found");
25
+ if (row.status !== "pending" && row.status !== "processing")
26
+ throw new PluginError("not_found", "Plugin management request image is no longer retained");
27
+ if ((row.sourceKind !== "archive" &&
28
+ row.sourceKind !== "builtin" &&
29
+ row.sourceKind !== "link") ||
30
+ !row.sourceReference ||
31
+ !row.packageDigest ||
32
+ !row.packageDirectory)
33
+ throw new Error("Plugin management request has incomplete package metadata");
34
+ return {
35
+ id: row.id,
36
+ chatId: row.chatId,
37
+ packageDigest: row.packageDigest,
38
+ packageDirectory: row.packageDirectory,
39
+ source: { kind: row.sourceKind, reference: row.sourceReference },
40
+ };
41
+ }
42
+ //# sourceMappingURL=pluginManagementRequestGetPackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestGetPackage.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestGetPackage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE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IAAI,WAAW,CAAC,WAAW,EAAE,uDAAuD,CAAC,CAAC;IAChG,IACI,CAAC,GAAG,CAAC,UAAU,KAAK,SAAS;QACzB,GAAG,CAAC,UAAU,KAAK,SAAS;QAC5B,GAAG,CAAC,UAAU,KAAK,MAAM,CAAC;QAC9B,CAAC,GAAG,CAAC,eAAe;QACpB,CAAC,GAAG,CAAC,aAAa;QAClB,CAAC,GAAG,CAAC,gBAAgB;QAErB,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IACjF,OAAO;QACH,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;QACtC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,CAAC,eAAe,EAAE;KACnE,CAAC;AACN,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import { type PluginManagementRequestSummary } from "./types.js";
3
+ /** Lists durable plugin approval cards for one accessible chat and does not mutate durable state. This projection boundary requires active membership while excluding staged filesystem paths and other private package internals. */
4
+ export declare function pluginManagementRequestList(executor: DrizzleExecutor, actorUserId: string, chatId: string): Promise<PluginManagementRequestSummary[]>;
5
+ //# sourceMappingURL=pluginManagementRequestList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestList.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestList.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,OAAO,EAAe,KAAK,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAE9E,sOAAsO;AACtO,wBAAsB,2BAA2B,CAC7C,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,8BAA8B,EAAE,CAAC,CAS3C"}
@@ -0,0 +1,18 @@
1
+ import { desc, eq } from "drizzle-orm";
2
+ import { chatGetAccess } from "../chat/chatGetAccess.js";
3
+ import { pluginManagementRequests } from "../schema.js";
4
+ import { asPluginManagementRequest } from "./impl/asManagementRequest.js";
5
+ import { pluginManagementRequestSelection } from "./impl/managementRequestSelection.js";
6
+ import { PluginError } from "./types.js";
7
+ /** Lists durable plugin approval cards for one accessible chat and does not mutate durable state. This projection boundary requires active membership while excluding staged filesystem paths and other private package internals. */
8
+ export async function pluginManagementRequestList(executor, actorUserId, chatId) {
9
+ if (!(await chatGetAccess(executor, actorUserId, chatId, true)))
10
+ throw new PluginError("forbidden", "Chat membership is required");
11
+ const rows = await executor
12
+ .select(pluginManagementRequestSelection)
13
+ .from(pluginManagementRequests)
14
+ .where(eq(pluginManagementRequests.chatId, chatId))
15
+ .orderBy(desc(pluginManagementRequests.createdAt), desc(pluginManagementRequests.id));
16
+ return rows.map(asPluginManagementRequest);
17
+ }
18
+ //# sourceMappingURL=pluginManagementRequestList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestList.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAuC,MAAM,YAAY,CAAC;AAE9E,sOAAsO;AACtO,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC7C,QAAyB,EACzB,WAAmB,EACnB,MAAc;IAEd,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3D,MAAM,IAAI,WAAW,CAAC,WAAW,EAAE,6BAA6B,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,MAAM,QAAQ;SACtB,MAAM,CAAC,gCAAgC,CAAC;SACxC,IAAI,CAAC,wBAAwB,CAAC;SAC9B,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAClD,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1F,OAAO,IAAI,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ /** Lists terminal pluginManagementRequests whose staged package directories can be reclaimed and does not mutate durable state. This restart-cleanup boundary prevents resolved approval snapshots from accumulating after a process stops between resolution and filesystem cleanup. */
3
+ export declare function pluginManagementRequestListTerminalIds(executor: DrizzleExecutor): Promise<string[]>;
4
+ //# sourceMappingURL=pluginManagementRequestListTerminalIds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestListTerminalIds.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestListTerminalIds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,yRAAyR;AACzR,wBAAsB,sCAAsC,CACxD,QAAQ,EAAE,eAAe,GAC1B,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB"}
@@ -0,0 +1,11 @@
1
+ import { inArray } from "drizzle-orm";
2
+ import { pluginManagementRequests } from "../schema.js";
3
+ /** Lists terminal pluginManagementRequests whose staged package directories can be reclaimed and does not mutate durable state. This restart-cleanup boundary prevents resolved approval snapshots from accumulating after a process stops between resolution and filesystem cleanup. */
4
+ export async function pluginManagementRequestListTerminalIds(executor) {
5
+ const rows = await executor
6
+ .select({ id: pluginManagementRequests.id })
7
+ .from(pluginManagementRequests)
8
+ .where(inArray(pluginManagementRequests.status, ["approved", "denied", "failed"]));
9
+ return rows.map(({ id }) => id);
10
+ }
11
+ //# sourceMappingURL=pluginManagementRequestListTerminalIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestListTerminalIds.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestListTerminalIds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,yRAAyR;AACzR,MAAM,CAAC,KAAK,UAAU,sCAAsC,CACxD,QAAyB;IAEzB,MAAM,IAAI,GAAG,MAAM,QAAQ;SACtB,MAAM,CAAC,EAAE,EAAE,EAAE,wBAAwB,CAAC,EAAE,EAAE,CAAC;SAC3C,IAAI,CAAC,wBAAwB,CAAC;SAC9B,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { DrizzleExecutor } from "../drizzle.js";
2
+ import type { MutationHint } from "../chat/types.js";
3
+ /** Resolves pluginManagementRequests left processing by a stopped complete-server process according to the durable installation outcome. This restart boundary prevents approval cards from remaining permanently claimed while preserving audit and reactive chat evidence for the recovered terminal state. */
4
+ export declare function pluginManagementRequestRecoverProcessing(executor: DrizzleExecutor): Promise<MutationHint[]>;
5
+ //# sourceMappingURL=pluginManagementRequestRecoverProcessing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginManagementRequestRecoverProcessing.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestRecoverProcessing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,iTAAiT;AACjT,wBAAsB,wCAAwC,CAC1D,QAAQ,EAAE,eAAe,GAC1B,OAAO,CAAC,YAAY,EAAE,CAAC,CA+EzB"}