happy2 0.0.12 → 0.0.14

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 (520) hide show
  1. package/package.json +2 -2
  2. package/packages/happy2-server/PLUGINS.md +281 -39
  3. package/packages/happy2-server/README.md +8 -7
  4. package/packages/happy2-server/dist/index.d.ts +3 -1
  5. package/packages/happy2-server/dist/index.d.ts.map +1 -1
  6. package/packages/happy2-server/dist/index.js +2 -0
  7. package/packages/happy2-server/dist/index.js.map +1 -1
  8. package/packages/happy2-server/dist/modules/agent/agentChatBind.d.ts +1 -0
  9. package/packages/happy2-server/dist/modules/agent/agentChatBind.d.ts.map +1 -1
  10. package/packages/happy2-server/dist/modules/agent/agentChatBind.js +4 -0
  11. package/packages/happy2-server/dist/modules/agent/agentChatBind.js.map +1 -1
  12. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.d.ts.map +1 -1
  13. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js +3 -1
  14. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js.map +1 -1
  15. package/packages/happy2-server/dist/modules/agent/agentCreate.d.ts.map +1 -1
  16. package/packages/happy2-server/dist/modules/agent/agentCreate.js +1 -0
  17. package/packages/happy2-server/dist/modules/agent/agentCreate.js.map +1 -1
  18. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.d.ts +4 -2
  19. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.d.ts.map +1 -1
  20. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.js +8 -8
  21. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.js.map +1 -1
  22. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.d.ts +3 -3
  23. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.d.ts.map +1 -1
  24. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.js +4 -4
  25. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.js.map +1 -1
  26. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.d.ts +4 -4
  27. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.d.ts.map +1 -1
  28. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.js +57 -41
  29. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.js.map +1 -1
  30. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.d.ts +1 -1
  31. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js +3 -3
  32. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js.map +1 -1
  33. package/packages/happy2-server/dist/modules/agent/agentImageCreate.d.ts +1 -1
  34. package/packages/happy2-server/dist/modules/agent/agentImageCreate.js +3 -3
  35. package/packages/happy2-server/dist/modules/agent/agentImageCreate.js.map +1 -1
  36. package/packages/happy2-server/dist/modules/agent/agentImageGet.d.ts +1 -1
  37. package/packages/happy2-server/dist/modules/agent/agentImageGet.js +3 -3
  38. package/packages/happy2-server/dist/modules/agent/agentImageGet.js.map +1 -1
  39. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.d.ts +2 -1
  40. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.d.ts.map +1 -1
  41. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js +11 -4
  42. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js.map +1 -1
  43. package/packages/happy2-server/dist/modules/agent/agentImageList.d.ts +2 -2
  44. package/packages/happy2-server/dist/modules/agent/agentImageList.d.ts.map +1 -1
  45. package/packages/happy2-server/dist/modules/agent/agentImageList.js +8 -4
  46. package/packages/happy2-server/dist/modules/agent/agentImageList.js.map +1 -1
  47. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.d.ts +1 -1
  48. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js +3 -3
  49. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js.map +1 -1
  50. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.d.ts +1 -1
  51. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js +3 -3
  52. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js.map +1 -1
  53. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.d.ts +1 -1
  54. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.js +3 -3
  55. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.js.map +1 -1
  56. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.d.ts +1 -1
  57. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.js +3 -3
  58. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.js.map +1 -1
  59. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.d.ts +1 -1
  60. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.js +3 -3
  61. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.js.map +1 -1
  62. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.d.ts +1 -1
  63. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.js +3 -3
  64. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.js.map +1 -1
  65. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.d.ts +4 -3
  66. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.d.ts.map +1 -1
  67. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.js +5 -5
  68. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.js.map +1 -1
  69. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.d.ts +1 -1
  70. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.js +3 -3
  71. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.js.map +1 -1
  72. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.d.ts +2 -2
  73. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.js +4 -4
  74. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.js.map +1 -1
  75. package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.d.ts +1 -1
  76. package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.js +3 -3
  77. package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.js.map +1 -1
  78. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.d.ts +4 -0
  79. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.d.ts.map +1 -0
  80. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.js +15 -0
  81. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.js.map +1 -0
  82. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.d.ts +2 -0
  83. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.d.ts.map +1 -0
  84. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.js +17 -0
  85. package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.js.map +1 -0
  86. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.d.ts +23 -0
  87. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.d.ts.map +1 -0
  88. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.js +70 -0
  89. package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.js.map +1 -0
  90. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.d.ts +4 -0
  91. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.d.ts.map +1 -1
  92. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.js +207 -9
  93. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.js.map +1 -1
  94. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.d.ts +8 -0
  95. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.d.ts.map +1 -0
  96. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.js +86 -0
  97. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.js.map +1 -0
  98. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.d.ts +19 -0
  99. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.d.ts.map +1 -0
  100. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.js +87 -0
  101. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.js.map +1 -0
  102. package/packages/happy2-server/dist/modules/agent/impl/agentChatContext.d.ts +2 -1
  103. package/packages/happy2-server/dist/modules/agent/impl/agentChatContext.d.ts.map +1 -1
  104. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContext.d.ts +4 -1
  105. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContext.d.ts.map +1 -1
  106. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.d.ts +3 -3
  107. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.d.ts.map +1 -1
  108. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.js +26 -40
  109. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.js.map +1 -1
  110. package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.d.ts.map +1 -1
  111. package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.js +63 -2
  112. package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.js.map +1 -1
  113. package/packages/happy2-server/dist/modules/agent/types.d.ts +53 -0
  114. package/packages/happy2-server/dist/modules/agent/types.d.ts.map +1 -1
  115. package/packages/happy2-server/dist/modules/agents/daemon.d.ts +31 -2
  116. package/packages/happy2-server/dist/modules/agents/daemon.d.ts.map +1 -1
  117. package/packages/happy2-server/dist/modules/agents/daemon.js +12 -2
  118. package/packages/happy2-server/dist/modules/agents/daemon.js.map +1 -1
  119. package/packages/happy2-server/dist/modules/agents/service.d.ts +11 -6
  120. package/packages/happy2-server/dist/modules/agents/service.d.ts.map +1 -1
  121. package/packages/happy2-server/dist/modules/agents/service.js +498 -50
  122. package/packages/happy2-server/dist/modules/agents/service.js.map +1 -1
  123. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.d.ts +12 -0
  124. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.d.ts.map +1 -0
  125. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.js +27 -0
  126. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.js.map +1 -0
  127. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.d.ts +8 -0
  128. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.d.ts.map +1 -0
  129. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.js +22 -0
  130. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.js.map +1 -0
  131. package/packages/happy2-server/dist/modules/auth/methods.d.ts +1 -0
  132. package/packages/happy2-server/dist/modules/auth/methods.d.ts.map +1 -1
  133. package/packages/happy2-server/dist/modules/auth/methods.js +10 -6
  134. package/packages/happy2-server/dist/modules/auth/methods.js.map +1 -1
  135. package/packages/happy2-server/dist/modules/auth/service.d.ts +2 -0
  136. package/packages/happy2-server/dist/modules/auth/service.d.ts.map +1 -1
  137. package/packages/happy2-server/dist/modules/auth/service.js +26 -0
  138. package/packages/happy2-server/dist/modules/auth/service.js.map +1 -1
  139. package/packages/happy2-server/dist/modules/auth/tokens.d.ts +21 -0
  140. package/packages/happy2-server/dist/modules/auth/tokens.d.ts.map +1 -1
  141. package/packages/happy2-server/dist/modules/auth/tokens.js +97 -3
  142. package/packages/happy2-server/dist/modules/auth/tokens.js.map +1 -1
  143. package/packages/happy2-server/dist/modules/auth/tokens.test.js +77 -0
  144. package/packages/happy2-server/dist/modules/auth/tokens.test.js.map +1 -1
  145. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.d.ts +17 -0
  146. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.d.ts.map +1 -0
  147. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.js +98 -0
  148. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.js.map +1 -0
  149. package/packages/happy2-server/dist/modules/chat/asServiceMessage.d.ts.map +1 -1
  150. package/packages/happy2-server/dist/modules/chat/asServiceMessage.js +13 -5
  151. package/packages/happy2-server/dist/modules/chat/asServiceMessage.js.map +1 -1
  152. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.d.ts +19 -0
  153. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.d.ts.map +1 -0
  154. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.js +87 -0
  155. package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.js.map +1 -0
  156. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.d.ts +15 -0
  157. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.d.ts.map +1 -0
  158. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.js +38 -0
  159. package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.js.map +1 -0
  160. package/packages/happy2-server/dist/modules/chat/chatAppendAudit.d.ts +1 -1
  161. package/packages/happy2-server/dist/modules/chat/chatAppendAudit.d.ts.map +1 -1
  162. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.d.ts +20 -0
  163. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.d.ts.map +1 -0
  164. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.js +38 -0
  165. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.js.map +1 -0
  166. package/packages/happy2-server/dist/modules/chat/types.d.ts +6 -0
  167. package/packages/happy2-server/dist/modules/chat/types.d.ts.map +1 -1
  168. package/packages/happy2-server/dist/modules/chat/types.js.map +1 -1
  169. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.d.ts +7 -0
  170. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.d.ts.map +1 -0
  171. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.js +19 -0
  172. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.js.map +1 -0
  173. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.d.ts +2 -2
  174. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.d.ts.map +1 -1
  175. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.js +8 -5
  176. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.js.map +1 -1
  177. package/packages/happy2-server/dist/modules/config/defaults.d.ts.map +1 -1
  178. package/packages/happy2-server/dist/modules/config/defaults.js +1 -0
  179. package/packages/happy2-server/dist/modules/config/defaults.js.map +1 -1
  180. package/packages/happy2-server/dist/modules/config/defaults.test.js +1 -0
  181. package/packages/happy2-server/dist/modules/config/defaults.test.js.map +1 -1
  182. package/packages/happy2-server/dist/modules/config/loader.d.ts.map +1 -1
  183. package/packages/happy2-server/dist/modules/config/loader.js +4 -0
  184. package/packages/happy2-server/dist/modules/config/loader.js.map +1 -1
  185. package/packages/happy2-server/dist/modules/config/loader.test.js +12 -0
  186. package/packages/happy2-server/dist/modules/config/loader.test.js.map +1 -1
  187. package/packages/happy2-server/dist/modules/config/type.d.ts +3 -0
  188. package/packages/happy2-server/dist/modules/config/type.d.ts.map +1 -1
  189. package/packages/happy2-server/dist/modules/message/messageGetProjection.d.ts.map +1 -1
  190. package/packages/happy2-server/dist/modules/message/messageGetProjection.js +28 -0
  191. package/packages/happy2-server/dist/modules/message/messageGetProjection.js.map +1 -1
  192. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.d.ts +4 -0
  193. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.d.ts.map +1 -0
  194. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.js +39 -0
  195. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.js.map +1 -0
  196. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.d.ts +10 -0
  197. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.d.ts.map +1 -0
  198. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.js +31 -0
  199. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.js.map +1 -0
  200. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.d.ts +8 -0
  201. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.d.ts.map +1 -0
  202. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.js +13 -0
  203. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.js.map +1 -0
  204. package/packages/happy2-server/dist/modules/permission/roleCreate.d.ts +16 -0
  205. package/packages/happy2-server/dist/modules/permission/roleCreate.d.ts.map +1 -0
  206. package/packages/happy2-server/dist/modules/permission/roleCreate.js +70 -0
  207. package/packages/happy2-server/dist/modules/permission/roleCreate.js.map +1 -0
  208. package/packages/happy2-server/dist/modules/permission/roleDelete.d.ts +11 -0
  209. package/packages/happy2-server/dist/modules/permission/roleDelete.d.ts.map +1 -0
  210. package/packages/happy2-server/dist/modules/permission/roleDelete.js +41 -0
  211. package/packages/happy2-server/dist/modules/permission/roleDelete.js.map +1 -0
  212. package/packages/happy2-server/dist/modules/permission/roleList.d.ts +8 -0
  213. package/packages/happy2-server/dist/modules/permission/roleList.d.ts.map +1 -0
  214. package/packages/happy2-server/dist/modules/permission/roleList.js +36 -0
  215. package/packages/happy2-server/dist/modules/permission/roleList.js.map +1 -0
  216. package/packages/happy2-server/dist/modules/permission/roleUpdate.d.ts +14 -0
  217. package/packages/happy2-server/dist/modules/permission/roleUpdate.d.ts.map +1 -0
  218. package/packages/happy2-server/dist/modules/permission/roleUpdate.js +78 -0
  219. package/packages/happy2-server/dist/modules/permission/roleUpdate.js.map +1 -0
  220. package/packages/happy2-server/dist/modules/permission/types.d.ts +24 -0
  221. package/packages/happy2-server/dist/modules/permission/types.d.ts.map +1 -0
  222. package/packages/happy2-server/dist/modules/permission/types.js +10 -0
  223. package/packages/happy2-server/dist/modules/permission/types.js.map +1 -0
  224. package/packages/happy2-server/dist/modules/permission/userPermissionGet.d.ts +16 -0
  225. package/packages/happy2-server/dist/modules/permission/userPermissionGet.d.ts.map +1 -0
  226. package/packages/happy2-server/dist/modules/permission/userPermissionGet.js +33 -0
  227. package/packages/happy2-server/dist/modules/permission/userPermissionGet.js.map +1 -0
  228. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.d.ts +12 -0
  229. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.d.ts.map +1 -0
  230. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.js +44 -0
  231. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.js.map +1 -0
  232. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.d.ts +8 -0
  233. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.d.ts.map +1 -0
  234. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.js +12 -0
  235. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.js.map +1 -0
  236. package/packages/happy2-server/dist/modules/permission/userRequirePermission.d.ts +8 -0
  237. package/packages/happy2-server/dist/modules/permission/userRequirePermission.d.ts.map +1 -0
  238. package/packages/happy2-server/dist/modules/permission/userRequirePermission.js +12 -0
  239. package/packages/happy2-server/dist/modules/permission/userRequirePermission.js.map +1 -0
  240. package/packages/happy2-server/dist/modules/permission/userRoleAssign.d.ts +12 -0
  241. package/packages/happy2-server/dist/modules/permission/userRoleAssign.d.ts.map +1 -0
  242. package/packages/happy2-server/dist/modules/permission/userRoleAssign.js +46 -0
  243. package/packages/happy2-server/dist/modules/permission/userRoleAssign.js.map +1 -0
  244. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.d.ts +12 -0
  245. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.d.ts.map +1 -0
  246. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.js +53 -0
  247. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.js.map +1 -0
  248. package/packages/happy2-server/dist/modules/plugin/archive.d.ts +7 -0
  249. package/packages/happy2-server/dist/modules/plugin/archive.d.ts.map +1 -0
  250. package/packages/happy2-server/dist/modules/plugin/archive.js +222 -0
  251. package/packages/happy2-server/dist/modules/plugin/archive.js.map +1 -0
  252. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts +5 -1
  253. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts.map +1 -1
  254. package/packages/happy2-server/dist/modules/plugin/catalog.js +35 -16
  255. package/packages/happy2-server/dist/modules/plugin/catalog.js.map +1 -1
  256. package/packages/happy2-server/dist/modules/plugin/catalog.test.js +6 -2
  257. package/packages/happy2-server/dist/modules/plugin/catalog.test.js.map +1 -1
  258. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts +1 -0
  259. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts.map +1 -1
  260. package/packages/happy2-server/dist/modules/plugin/httpBridge.js +7 -0
  261. package/packages/happy2-server/dist/modules/plugin/httpBridge.js.map +1 -1
  262. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.d.ts +5 -0
  263. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.d.ts.map +1 -0
  264. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.js +106 -0
  265. package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.js.map +1 -0
  266. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts.map +1 -1
  267. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js +12 -2
  268. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js.map +1 -1
  269. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.d.ts +3 -0
  270. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.d.ts.map +1 -0
  271. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.js +68 -0
  272. package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.js.map +1 -0
  273. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts.map +1 -1
  274. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js +12 -3
  275. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js.map +1 -1
  276. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts +19 -0
  277. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts.map +1 -1
  278. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js +1 -0
  279. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js.map +1 -1
  280. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts.map +1 -1
  281. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js +4 -2
  282. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js.map +1 -1
  283. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js +14 -0
  284. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js.map +1 -1
  285. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.d.ts +345 -0
  286. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.d.ts.map +1 -0
  287. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.js +22 -0
  288. package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.js.map +1 -0
  289. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.d.ts +11 -0
  290. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.d.ts.map +1 -0
  291. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.js +2 -0
  292. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.js.map +1 -0
  293. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.d.ts +16 -0
  294. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.d.ts.map +1 -0
  295. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.js +67 -0
  296. package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.js.map +1 -0
  297. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts +27 -1
  298. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts.map +1 -1
  299. package/packages/happy2-server/dist/modules/plugin/packageStore.js +234 -15
  300. package/packages/happy2-server/dist/modules/plugin/packageStore.js.map +1 -1
  301. package/packages/happy2-server/dist/modules/plugin/packageStore.test.d.ts +2 -0
  302. package/packages/happy2-server/dist/modules/plugin/packageStore.test.d.ts.map +1 -0
  303. package/packages/happy2-server/dist/modules/plugin/packageStore.test.js +50 -0
  304. package/packages/happy2-server/dist/modules/plugin/packageStore.test.js.map +1 -0
  305. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.d.ts +5 -0
  306. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.d.ts.map +1 -0
  307. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.js +26 -0
  308. package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.js.map +1 -0
  309. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.d.ts +1 -1
  310. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js +3 -3
  311. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js.map +1 -1
  312. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts.map +1 -1
  313. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js +7 -3
  314. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js.map +1 -1
  315. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.d.ts +2 -0
  316. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.d.ts.map +1 -0
  317. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.js +44 -0
  318. package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.js.map +1 -0
  319. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts +3 -1
  320. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts.map +1 -1
  321. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js +1 -1
  322. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js.map +1 -1
  323. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.d.ts +1 -1
  324. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js +3 -3
  325. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js.map +1 -1
  326. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.d.ts +13 -0
  327. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.d.ts.map +1 -0
  328. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.js +37 -0
  329. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.js.map +1 -0
  330. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts +4 -2
  331. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts.map +1 -1
  332. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js +36 -5
  333. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js.map +1 -1
  334. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.d.ts +7 -0
  335. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.d.ts.map +1 -0
  336. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.js +18 -0
  337. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.js.map +1 -0
  338. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.d.ts +13 -0
  339. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.d.ts.map +1 -0
  340. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.js +35 -0
  341. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.js.map +1 -0
  342. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts.map +1 -1
  343. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js +3 -1
  344. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js.map +1 -1
  345. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.d.ts +6 -0
  346. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.d.ts.map +1 -0
  347. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.js +17 -0
  348. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.js.map +1 -0
  349. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.d.ts +1 -1
  350. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js +3 -3
  351. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js.map +1 -1
  352. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.d.ts +18 -0
  353. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.d.ts.map +1 -0
  354. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.js +92 -0
  355. package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.js.map +1 -0
  356. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.d.ts +16 -0
  357. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.d.ts.map +1 -0
  358. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.js +71 -0
  359. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.js.map +1 -0
  360. package/packages/happy2-server/dist/modules/plugin/pluginList.d.ts +1 -1
  361. package/packages/happy2-server/dist/modules/plugin/pluginList.js +3 -3
  362. package/packages/happy2-server/dist/modules/plugin/pluginList.js.map +1 -1
  363. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.d.ts +21 -0
  364. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.d.ts.map +1 -0
  365. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.js +71 -0
  366. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.js.map +1 -0
  367. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.d.ts +12 -0
  368. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.d.ts.map +1 -0
  369. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.js +56 -0
  370. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.js.map +1 -0
  371. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.d.ts +11 -0
  372. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.d.ts.map +1 -0
  373. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.js +44 -0
  374. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.js.map +1 -0
  375. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.d.ts +10 -0
  376. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.d.ts.map +1 -0
  377. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.js +41 -0
  378. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.js.map +1 -0
  379. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.d.ts +26 -0
  380. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.d.ts.map +1 -0
  381. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.js +78 -0
  382. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.js.map +1 -0
  383. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts +25 -0
  384. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts.map +1 -0
  385. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.js +76 -0
  386. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.js.map +1 -0
  387. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.d.ts +11 -0
  388. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.d.ts.map +1 -0
  389. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.js +48 -0
  390. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.js.map +1 -0
  391. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.d.ts +12 -0
  392. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.d.ts.map +1 -0
  393. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.js +42 -0
  394. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.js.map +1 -0
  395. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.d.ts +5 -0
  396. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.d.ts.map +1 -0
  397. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.js +18 -0
  398. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.js.map +1 -0
  399. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts +4 -0
  400. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts.map +1 -0
  401. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.js +11 -0
  402. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.js.map +1 -0
  403. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts +5 -0
  404. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts.map +1 -0
  405. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js +75 -0
  406. package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js.map +1 -0
  407. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.d.ts +12 -0
  408. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.d.ts.map +1 -0
  409. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.js +33 -0
  410. package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.js.map +1 -0
  411. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.d.ts +8 -0
  412. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.d.ts.map +1 -0
  413. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.js +24 -0
  414. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.js.map +1 -0
  415. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.d.ts +8 -0
  416. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.d.ts.map +1 -0
  417. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.js +25 -0
  418. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.js.map +1 -0
  419. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.d.ts +13 -0
  420. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.d.ts.map +1 -0
  421. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.js +63 -0
  422. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.js.map +1 -0
  423. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts +1 -0
  424. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts.map +1 -1
  425. package/packages/happy2-server/dist/modules/plugin/runtime.js +1 -0
  426. package/packages/happy2-server/dist/modules/plugin/runtime.js.map +1 -1
  427. package/packages/happy2-server/dist/modules/plugin/service.d.ts +157 -5
  428. package/packages/happy2-server/dist/modules/plugin/service.d.ts.map +1 -1
  429. package/packages/happy2-server/dist/modules/plugin/service.js +789 -19
  430. package/packages/happy2-server/dist/modules/plugin/service.js.map +1 -1
  431. package/packages/happy2-server/dist/modules/plugin/source.d.ts +35 -0
  432. package/packages/happy2-server/dist/modules/plugin/source.d.ts.map +1 -0
  433. package/packages/happy2-server/dist/modules/plugin/source.js +189 -0
  434. package/packages/happy2-server/dist/modules/plugin/source.js.map +1 -0
  435. package/packages/happy2-server/dist/modules/plugin/types.d.ts +116 -11
  436. package/packages/happy2-server/dist/modules/plugin/types.d.ts.map +1 -1
  437. package/packages/happy2-server/dist/modules/plugin/types.js +9 -0
  438. package/packages/happy2-server/dist/modules/plugin/types.js.map +1 -1
  439. package/packages/happy2-server/dist/modules/realtime/events.d.ts +3 -0
  440. package/packages/happy2-server/dist/modules/realtime/events.d.ts.map +1 -1
  441. package/packages/happy2-server/dist/modules/realtime/events.js +37 -5
  442. package/packages/happy2-server/dist/modules/realtime/events.js.map +1 -1
  443. package/packages/happy2-server/dist/modules/realtime/local.test.js +2 -0
  444. package/packages/happy2-server/dist/modules/realtime/local.test.js.map +1 -1
  445. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts.map +1 -1
  446. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js +4 -2
  447. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js.map +1 -1
  448. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js +4 -1
  449. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js.map +1 -1
  450. package/packages/happy2-server/dist/modules/sandbox/types.d.ts +1 -0
  451. package/packages/happy2-server/dist/modules/sandbox/types.d.ts.map +1 -1
  452. package/packages/happy2-server/dist/modules/schema.d.ts +8024 -5446
  453. package/packages/happy2-server/dist/modules/schema.d.ts.map +1 -1
  454. package/packages/happy2-server/dist/modules/schema.js +140 -0
  455. package/packages/happy2-server/dist/modules/schema.js.map +1 -1
  456. package/packages/happy2-server/dist/modules/sync/syncGetDifference.d.ts.map +1 -1
  457. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js +2 -0
  458. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js.map +1 -1
  459. package/packages/happy2-server/dist/modules/user/userAdministrationList.js +2 -2
  460. package/packages/happy2-server/dist/modules/user/userAdministrationList.js.map +1 -1
  461. package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.d.ts.map +1 -1
  462. package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.js +49 -6
  463. package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.js.map +1 -1
  464. package/packages/happy2-server/dist/modules/user/userCreateProfile.d.ts.map +1 -1
  465. package/packages/happy2-server/dist/modules/user/userCreateProfile.js +17 -2
  466. package/packages/happy2-server/dist/modules/user/userCreateProfile.js.map +1 -1
  467. package/packages/happy2-server/dist/routes/agents.d.ts.map +1 -1
  468. package/packages/happy2-server/dist/routes/agents.js +4 -2
  469. package/packages/happy2-server/dist/routes/agents.js.map +1 -1
  470. package/packages/happy2-server/dist/routes/auth.d.ts.map +1 -1
  471. package/packages/happy2-server/dist/routes/auth.js +12 -0
  472. package/packages/happy2-server/dist/routes/auth.js.map +1 -1
  473. package/packages/happy2-server/dist/routes/collaboration.d.ts.map +1 -1
  474. package/packages/happy2-server/dist/routes/collaboration.js +7 -0
  475. package/packages/happy2-server/dist/routes/collaboration.js.map +1 -1
  476. package/packages/happy2-server/dist/routes/files.d.ts.map +1 -1
  477. package/packages/happy2-server/dist/routes/files.js +2 -0
  478. package/packages/happy2-server/dist/routes/files.js.map +1 -1
  479. package/packages/happy2-server/dist/routes/permissions.d.ts +6 -0
  480. package/packages/happy2-server/dist/routes/permissions.d.ts.map +1 -0
  481. package/packages/happy2-server/dist/routes/permissions.js +207 -0
  482. package/packages/happy2-server/dist/routes/permissions.js.map +1 -0
  483. package/packages/happy2-server/dist/routes/pluginHost.d.ts +2 -1
  484. package/packages/happy2-server/dist/routes/pluginHost.d.ts.map +1 -1
  485. package/packages/happy2-server/dist/routes/pluginHost.js +356 -5
  486. package/packages/happy2-server/dist/routes/pluginHost.js.map +1 -1
  487. package/packages/happy2-server/dist/routes/plugins.d.ts.map +1 -1
  488. package/packages/happy2-server/dist/routes/plugins.js +375 -7
  489. package/packages/happy2-server/dist/routes/plugins.js.map +1 -1
  490. package/packages/happy2-server/dist/server.d.ts +4 -0
  491. package/packages/happy2-server/dist/server.d.ts.map +1 -1
  492. package/packages/happy2-server/dist/server.js +12 -7
  493. package/packages/happy2-server/dist/server.js.map +1 -1
  494. package/packages/happy2-server/dist/web/assets/index-Dn5SZu3y.js +39 -0
  495. package/packages/happy2-server/dist/web/assets/index-Dys3sWv8.css +2 -0
  496. package/packages/happy2-server/dist/web/index.html +2 -2
  497. package/packages/happy2-server/drizzle/0023_roles_and_permissions.sql +82 -0
  498. package/packages/happy2-server/drizzle/0024_session_bound_dev_tokens.sql +11 -0
  499. package/packages/happy2-server/drizzle/0025_plugin_skills.sql +8 -0
  500. package/packages/happy2-server/drizzle/0026_agent_turn_traces.sql +35 -0
  501. package/packages/happy2-server/drizzle/0027_chat_agent_effort.sql +9 -0
  502. package/packages/happy2-server/drizzle/0028_plugin_api_permissions.sql +1 -0
  503. package/packages/happy2-server/drizzle/0029_plugin_management_requests.sql +35 -0
  504. package/packages/happy2-server/drizzle/meta/_journal.json +49 -0
  505. package/packages/happy2-server/happy2.example.toml +6 -0
  506. package/packages/happy2-server/plugins/README.md +7 -1
  507. package/packages/happy2-server/plugins/chat-management/container/Dockerfile +6 -0
  508. package/packages/happy2-server/plugins/chat-management/plugin.json +17 -0
  509. package/packages/happy2-server/plugins/chat-management/plugin.png +0 -0
  510. package/packages/happy2-server/plugins/chat-management/server.mjs +280 -0
  511. package/packages/happy2-server/plugins/plugin-developer/container/Dockerfile +6 -0
  512. package/packages/happy2-server/plugins/plugin-developer/plugin.json +17 -0
  513. package/packages/happy2-server/plugins/plugin-developer/plugin.png +0 -0
  514. package/packages/happy2-server/plugins/plugin-developer/server.mjs +155 -0
  515. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/SKILL.md +59 -0
  516. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/host-api.md +63 -0
  517. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/installing.md +86 -0
  518. package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/package-format.md +137 -0
  519. package/packages/happy2-server/dist/web/assets/index-9SGCQLg7.js +0 -46
  520. package/packages/happy2-server/dist/web/assets/index-DWXBQDJB.css +0 -2
@@ -0,0 +1,8 @@
1
+ CREATE TABLE `plugin_skills` (
2
+ `plugin_id` text NOT NULL,
3
+ `name` text NOT NULL,
4
+ `description` text NOT NULL,
5
+ `directory` text NOT NULL,
6
+ PRIMARY KEY(`plugin_id`, `name`),
7
+ FOREIGN KEY (`plugin_id`) REFERENCES `plugins`(`id`) ON UPDATE no action ON DELETE cascade
8
+ );
@@ -0,0 +1,35 @@
1
+ ALTER TABLE `agent_turns` ADD `trace_latest_kind` text;
2
+ --> statement-breakpoint
3
+ ALTER TABLE `agent_turns` ADD `trace_latest_title` text;
4
+ --> statement-breakpoint
5
+ ALTER TABLE `agent_turns` ADD `trace_latest_detail` text;
6
+ --> statement-breakpoint
7
+ ALTER TABLE `agent_turns` ADD `trace_latest_at` integer;
8
+ --> statement-breakpoint
9
+ ALTER TABLE `agent_turns` ADD `trace_entry_count` integer DEFAULT 0 NOT NULL;
10
+ --> statement-breakpoint
11
+ ALTER TABLE `agent_turns` ADD `trace_subagents_json` text DEFAULT '[]' NOT NULL;
12
+ --> statement-breakpoint
13
+ ALTER TABLE `agent_turns` ADD `trace_background_terminals_json` text DEFAULT '[]' NOT NULL;
14
+ --> statement-breakpoint
15
+ CREATE TABLE `agent_turn_trace_entries` (
16
+ `id` text PRIMARY KEY NOT NULL,
17
+ `user_message_id` text NOT NULL,
18
+ `agent_user_id` text NOT NULL,
19
+ `trace_key` text NOT NULL,
20
+ `session_event_id` text NOT NULL,
21
+ `kind` text NOT NULL,
22
+ `title` text NOT NULL,
23
+ `detail` text,
24
+ `status` text NOT NULL,
25
+ `occurred_at` integer NOT NULL,
26
+ `completed_at` integer,
27
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
28
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
29
+ FOREIGN KEY (`user_message_id`) REFERENCES `messages`(`id`) ON UPDATE no action ON DELETE cascade,
30
+ FOREIGN KEY (`agent_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
31
+ );
32
+ --> statement-breakpoint
33
+ CREATE UNIQUE INDEX `agent_turn_trace_entries_turn_key_unique` ON `agent_turn_trace_entries` (`user_message_id`,`agent_user_id`,`trace_key`);
34
+ --> statement-breakpoint
35
+ CREATE INDEX `agent_turn_trace_entries_turn_time_index` ON `agent_turn_trace_entries` (`user_message_id`,`agent_user_id`,`occurred_at`);
@@ -0,0 +1,9 @@
1
+ ALTER TABLE `agent_rig_bindings` ADD COLUMN `effort` TEXT;
2
+ --> statement-breakpoint
3
+ UPDATE `agent_rig_bindings`
4
+ SET `effort` = (
5
+ SELECT `users`.`agent_effort`
6
+ FROM `users`
7
+ WHERE `users`.`id` = `agent_rig_bindings`.`user_id`
8
+ )
9
+ WHERE `effort` IS NULL;
@@ -0,0 +1 @@
1
+ ALTER TABLE `plugin_installations` ADD `granted_permissions_json` text DEFAULT '[]' NOT NULL;
@@ -0,0 +1,35 @@
1
+ CREATE TABLE `plugin_management_requests` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `action` text NOT NULL,
4
+ `status` text DEFAULT 'pending' NOT NULL,
5
+ `chat_id` text NOT NULL,
6
+ `actor_user_id` text,
7
+ `agent_user_id` text,
8
+ `requester_installation_id` text,
9
+ `call_id` text NOT NULL,
10
+ `display_name` text NOT NULL,
11
+ `short_name` text NOT NULL,
12
+ `description` text NOT NULL,
13
+ `reason` text,
14
+ `source_kind` text,
15
+ `source_reference` text,
16
+ `package_digest` text,
17
+ `package_directory` text,
18
+ `target_installation_id` text,
19
+ `installation_id` text,
20
+ `resolved_by_user_id` text,
21
+ `resolved_at` text,
22
+ `last_error` text,
23
+ `sync_sequence` integer DEFAULT 0 NOT NULL,
24
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
25
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
26
+ FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`) ON UPDATE no action ON DELETE cascade,
27
+ FOREIGN KEY (`actor_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
28
+ FOREIGN KEY (`agent_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
29
+ FOREIGN KEY (`requester_installation_id`) REFERENCES `plugin_installations`(`id`) ON UPDATE no action ON DELETE set null,
30
+ FOREIGN KEY (`resolved_by_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null
31
+ );
32
+ --> statement-breakpoint
33
+ CREATE INDEX `plugin_management_requests_chat_index` ON `plugin_management_requests` (`chat_id`,`created_at`);
34
+ --> statement-breakpoint
35
+ CREATE UNIQUE INDEX `plugin_management_requests_call_unique` ON `plugin_management_requests` (`requester_installation_id`,`call_id`,`action`);
@@ -162,6 +162,55 @@
162
162
  "when": 1784420000000,
163
163
  "tag": "0022_plugin_container_runtime_tools",
164
164
  "breakpoints": true
165
+ },
166
+ {
167
+ "idx": 23,
168
+ "version": "6",
169
+ "when": 1784421000000,
170
+ "tag": "0023_roles_and_permissions",
171
+ "breakpoints": true
172
+ },
173
+ {
174
+ "idx": 24,
175
+ "version": "6",
176
+ "when": 1784422000000,
177
+ "tag": "0024_session_bound_dev_tokens",
178
+ "breakpoints": true
179
+ },
180
+ {
181
+ "idx": 25,
182
+ "version": "6",
183
+ "when": 1784425000000,
184
+ "tag": "0025_plugin_skills",
185
+ "breakpoints": true
186
+ },
187
+ {
188
+ "idx": 26,
189
+ "version": "6",
190
+ "when": 1784426000000,
191
+ "tag": "0026_agent_turn_traces",
192
+ "breakpoints": true
193
+ },
194
+ {
195
+ "idx": 27,
196
+ "version": "6",
197
+ "when": 1784427000000,
198
+ "tag": "0027_chat_agent_effort",
199
+ "breakpoints": true
200
+ },
201
+ {
202
+ "idx": 28,
203
+ "version": "6",
204
+ "when": 1784430000000,
205
+ "tag": "0028_plugin_api_permissions",
206
+ "breakpoints": true
207
+ },
208
+ {
209
+ "idx": 29,
210
+ "version": "6",
211
+ "when": 1784433600000,
212
+ "tag": "0029_plugin_management_requests",
213
+ "breakpoints": true
165
214
  }
166
215
  ]
167
216
  }
@@ -90,6 +90,12 @@ expiry_days = 30
90
90
  [auth.password]
91
91
  enabled = true
92
92
 
93
+ # Allows an authenticated Settings session to create an opaque bearer token for
94
+ # local web development. Every token inherits its backing session's expiry and
95
+ # revocation; leave disabled on servers that do not need remote UI development.
96
+ [auth.dev_tokens]
97
+ enabled = false
98
+
93
99
  [auth.magic_link]
94
100
  enabled = false
95
101
  from = "Happy (2) <noreply@happy2.example.com>"
@@ -4,4 +4,10 @@ Each child directory is one immutable, built-in plugin package. See
4
4
  [`../PLUGINS.md`](../PLUGINS.md) for the manifest and package contract.
5
5
 
6
6
  `hello` is the minimal built-in example with both a skill and a bundled stdio MCP
7
- tool. Product plugins should be added here as separate, reviewable changes.
7
+ tool. `chat-management` demonstrates installation-bound chat and referenced-user
8
+ capabilities: it updates the current chat, manages channel membership, and creates
9
+ private channels with either an informational opening message or an agent-triggering
10
+ prompt. `plugin-developer` provides Happy2 plugin authoring/install documentation
11
+ and chat-scoped MCP tools that request administrator approval for linked install
12
+ or uninstall actions. Product plugins should be added here as separate,
13
+ reviewable changes.
@@ -0,0 +1,6 @@
1
+ FROM node:22-alpine
2
+
3
+ WORKDIR /plugin
4
+ COPY server.mjs /plugin/server.mjs
5
+
6
+ CMD ["sleep", "infinity"]
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "version": "1.1.0",
4
+ "displayName": "Chat Management",
5
+ "shortName": "chat-management",
6
+ "description": "Lets an agent update its current chat, manage channel members, and create new channels with an initial people or agent message.",
7
+ "variables": [],
8
+ "container": {
9
+ "dockerfile": "container/Dockerfile",
10
+ "permissions": ["chats:update", "channels:manage"]
11
+ },
12
+ "mcp": {
13
+ "type": "stdio",
14
+ "command": "node",
15
+ "args": ["/plugin/server.mjs"]
16
+ }
17
+ }
@@ -0,0 +1,280 @@
1
+ import { createInterface } from "node:readline";
2
+ import { randomUUID } from "node:crypto";
3
+
4
+ const CHAT_META_KEY = "happy2/chat";
5
+ const USERS_META_KEY = "happy2/users";
6
+ const lines = createInterface({ input: process.stdin, crlfDelay: Infinity });
7
+
8
+ for await (const line of lines) {
9
+ if (!line.trim()) continue;
10
+ let request;
11
+ try {
12
+ request = JSON.parse(line);
13
+ } catch {
14
+ continue;
15
+ }
16
+ if (request.id === undefined) continue;
17
+ const response = await handle(request).catch((error) => ({
18
+ result: {
19
+ isError: true,
20
+ content: [
21
+ {
22
+ type: "text",
23
+ text: error instanceof Error ? error.message : "The chat could not be updated.",
24
+ },
25
+ ],
26
+ },
27
+ }));
28
+ process.stdout.write(`${JSON.stringify({ jsonrpc: "2.0", id: request.id, ...response })}\n`);
29
+ }
30
+
31
+ async function handle(request) {
32
+ if (request.method === "initialize") {
33
+ return {
34
+ result: {
35
+ protocolVersion: request.params?.protocolVersion ?? "2025-06-18",
36
+ capabilities: { tools: {} },
37
+ serverInfo: { name: "happy2-chat-management", version: "1.1.0" },
38
+ },
39
+ };
40
+ }
41
+ if (request.method === "ping") return { result: {} };
42
+ if (request.method === "tools/list") {
43
+ return {
44
+ result: {
45
+ tools: [
46
+ {
47
+ name: "chat_update",
48
+ title: "Update current chat",
49
+ description:
50
+ "Changes the title or description of the current chat. Omit a field to leave it unchanged; pass null or an empty string to clear the description.",
51
+ inputSchema: {
52
+ type: "object",
53
+ properties: {
54
+ title: {
55
+ type: "string",
56
+ minLength: 1,
57
+ maxLength: 100,
58
+ description: "The new title for the current chat.",
59
+ },
60
+ description: {
61
+ type: ["string", "null"],
62
+ maxLength: 500,
63
+ description:
64
+ "The new description, or null to clear the current description.",
65
+ },
66
+ },
67
+ anyOf: [{ required: ["title"] }, { required: ["description"] }],
68
+ additionalProperties: false,
69
+ },
70
+ },
71
+ {
72
+ name: "channel_members_update",
73
+ title: "Add or remove channel members",
74
+ description:
75
+ "Adds or removes users from the current channel. This never changes direct-message membership. Identify users by the @username shown in the triggering conversation; only users supplied in Happy's signed metadata are available.",
76
+ inputSchema: {
77
+ type: "object",
78
+ properties: {
79
+ addUsers: {
80
+ type: "array",
81
+ maxItems: 100,
82
+ uniqueItems: true,
83
+ items: { type: "string", minLength: 1 },
84
+ description: "Usernames (with or without @) to add.",
85
+ },
86
+ removeUsers: {
87
+ type: "array",
88
+ maxItems: 100,
89
+ uniqueItems: true,
90
+ items: { type: "string", minLength: 1 },
91
+ description: "Usernames (with or without @) to remove.",
92
+ },
93
+ },
94
+ anyOf: [{ required: ["addUsers"] }, { required: ["removeUsers"] }],
95
+ additionalProperties: false,
96
+ },
97
+ },
98
+ {
99
+ name: "channel_create",
100
+ title: "Create a channel",
101
+ description:
102
+ "Creates a private channel owned by the user who triggered this turn, adds selected referenced users, and optionally posts an initial message. An agents message starts the current agent working; a people message only shares context and does not trigger inference.",
103
+ inputSchema: {
104
+ type: "object",
105
+ properties: {
106
+ name: {
107
+ type: "string",
108
+ minLength: 1,
109
+ maxLength: 100,
110
+ description: "Channel title.",
111
+ },
112
+ description: {
113
+ type: "string",
114
+ minLength: 1,
115
+ maxLength: 500,
116
+ description: "Optional channel description.",
117
+ },
118
+ members: {
119
+ type: "array",
120
+ maxItems: 100,
121
+ uniqueItems: true,
122
+ items: { type: "string", minLength: 1 },
123
+ description:
124
+ "Referenced usernames (with or without @) to add. The triggering user is already the owner.",
125
+ },
126
+ initialMessage: {
127
+ type: "object",
128
+ properties: {
129
+ text: {
130
+ type: "string",
131
+ minLength: 1,
132
+ maxLength: 40000,
133
+ description:
134
+ "A copied or rephrased opening prompt or informational message.",
135
+ },
136
+ audience: {
137
+ type: "string",
138
+ enum: ["agents", "people"],
139
+ description:
140
+ "agents starts the current agent; people posts without inference.",
141
+ },
142
+ },
143
+ required: ["text", "audience"],
144
+ additionalProperties: false,
145
+ },
146
+ },
147
+ required: ["name"],
148
+ additionalProperties: false,
149
+ },
150
+ },
151
+ ],
152
+ },
153
+ };
154
+ }
155
+ if (request.method === "tools/call" && request.params?.name === "chat_update")
156
+ return { result: await updateChat(request.params) };
157
+ if (request.method === "tools/call" && request.params?.name === "channel_members_update")
158
+ return { result: await updateChannelMembers(request.params) };
159
+ if (request.method === "tools/call" && request.params?.name === "channel_create")
160
+ return { result: await createChannel(request.params) };
161
+ return {
162
+ error: { code: -32601, message: `Method not found: ${String(request.method)}` },
163
+ };
164
+ }
165
+
166
+ async function updateChat(params) {
167
+ const { chat } = capabilityContext(params);
168
+ const input = params.arguments;
169
+ if (!input || typeof input !== "object" || Array.isArray(input))
170
+ throw new Error("A chat update is required.");
171
+ const result = await callHost("/chats/updateChat", chat.token, input);
172
+ return {
173
+ content: [
174
+ {
175
+ type: "text",
176
+ text: `Updated chat ${result.chat.id}.`,
177
+ },
178
+ ],
179
+ structuredContent: { chat: result.chat },
180
+ };
181
+ }
182
+
183
+ async function updateChannelMembers(params) {
184
+ const { chat, users } = capabilityContext(params);
185
+ const input = params.arguments;
186
+ if (!input || typeof input !== "object" || Array.isArray(input))
187
+ throw new Error("A channel membership update is required.");
188
+ const add = resolveUsers(input.addUsers ?? [], users, "addUsers");
189
+ const remove = resolveUsers(input.removeUsers ?? [], users, "removeUsers");
190
+ if (!add.length && !remove.length)
191
+ throw new Error("At least one user must be added or removed.");
192
+ const result = await callHost("/channels/updateMembers", chat.token, { add, remove });
193
+ return {
194
+ content: [
195
+ {
196
+ type: "text",
197
+ text: `Updated members of channel ${result.chatId}: added ${result.addedUserIds.length}, removed ${result.removedUserIds.length}.`,
198
+ },
199
+ ],
200
+ structuredContent: result,
201
+ };
202
+ }
203
+
204
+ async function createChannel(params) {
205
+ const { chat, users } = capabilityContext(params);
206
+ const input = params.arguments;
207
+ if (!input || typeof input !== "object" || Array.isArray(input))
208
+ throw new Error("A channel definition is required.");
209
+ const members = resolveUsers(input.members ?? [], users, "members");
210
+ const result = await callHost("/channels/createChannel", chat.token, {
211
+ ...input,
212
+ members,
213
+ idempotencyKey: randomUUID(),
214
+ });
215
+ return {
216
+ content: [
217
+ {
218
+ type: "text",
219
+ text: `Created channel ${result.chat.id}${result.initialMessage ? " and posted its initial message" : ""}.`,
220
+ },
221
+ ],
222
+ structuredContent: result,
223
+ };
224
+ }
225
+
226
+ function capabilityContext(params) {
227
+ const chat = params?._meta?.[CHAT_META_KEY];
228
+ if (!chat || typeof chat.id !== "string" || typeof chat.token !== "string")
229
+ throw new Error("This tool must be called from an active Happy chat.");
230
+ const users = params?._meta?.[USERS_META_KEY];
231
+ if (!Array.isArray(users)) throw new Error("Happy did not provide referenced-user metadata.");
232
+ return { chat, users };
233
+ }
234
+
235
+ function resolveUsers(selectors, users, name) {
236
+ if (!Array.isArray(selectors)) throw new Error(`${name} must be an array.`);
237
+ const resolved = selectors.map((selector) => {
238
+ if (typeof selector !== "string" || !selector.trim())
239
+ throw new Error(`${name} must contain usernames.`);
240
+ const normalized = selector.trim().replace(/^@/, "").toLowerCase();
241
+ const matches = users.filter(
242
+ (user) =>
243
+ user &&
244
+ typeof user === "object" &&
245
+ (user.id === selector.trim() ||
246
+ (typeof user.username === "string" &&
247
+ user.username.toLowerCase() === normalized)),
248
+ );
249
+ if (matches.length !== 1)
250
+ throw new Error(`User ${selector} is not uniquely available in this turn.`);
251
+ const user = matches[0];
252
+ if (typeof user.id !== "string" || typeof user.token !== "string")
253
+ throw new Error(`User ${selector} has malformed capability metadata.`);
254
+ return { id: user.id, token: user.token };
255
+ });
256
+ if (new Set(resolved.map(({ id }) => id)).size !== resolved.length)
257
+ throw new Error(`${name} contains a duplicate user.`);
258
+ return resolved;
259
+ }
260
+
261
+ async function callHost(path, chatToken, body) {
262
+ const apiUrl = process.env.HAPPY2_PLUGIN_API_URL;
263
+ const runtimeToken = process.env.HAPPY2_PLUGIN_API_TOKEN;
264
+ if (!apiUrl || !runtimeToken) throw new Error("The Happy Plugin API is unavailable.");
265
+ const response = await fetch(`${apiUrl}${path}`, {
266
+ method: "POST",
267
+ headers: {
268
+ authorization: `Bearer ${runtimeToken}`,
269
+ "content-type": "application/json",
270
+ "x-happy2-chat-token": chatToken,
271
+ },
272
+ body: JSON.stringify(body),
273
+ });
274
+ const result = await response.json().catch(() => undefined);
275
+ if (!response.ok)
276
+ throw new Error(
277
+ typeof result?.message === "string" ? result.message : "The chat action failed.",
278
+ );
279
+ return result;
280
+ }
@@ -0,0 +1,6 @@
1
+ FROM node:22-alpine
2
+
3
+ WORKDIR /plugin
4
+ COPY server.mjs /plugin/server.mjs
5
+
6
+ CMD ["sleep", "infinity"]
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "version": "1.0.0",
4
+ "displayName": "Plugin Developer",
5
+ "shortName": "plugin-developer",
6
+ "description": "Helps agents design, validate, inspect, and request installation of Happy2 plugins.",
7
+ "variables": [],
8
+ "container": {
9
+ "dockerfile": "container/Dockerfile",
10
+ "permissions": ["plugins:list", "plugins:request-install", "plugins:request-uninstall"]
11
+ },
12
+ "mcp": {
13
+ "type": "stdio",
14
+ "command": "node",
15
+ "args": ["/plugin/server.mjs"]
16
+ }
17
+ }
@@ -0,0 +1,155 @@
1
+ import { createInterface } from "node:readline";
2
+
3
+ async function handle(request) {
4
+ if (request.method === "initialize") {
5
+ return {
6
+ result: {
7
+ protocolVersion: request.params?.protocolVersion ?? "2025-06-18",
8
+ capabilities: { tools: {} },
9
+ serverInfo: { name: "happy2-plugin-developer", version: "1.0.0" },
10
+ },
11
+ };
12
+ }
13
+ if (request.method === "ping") return { result: {} };
14
+ if (request.method === "tools/list") return { result: { tools } };
15
+ if (request.method === "tools/call") return callTool(request.params);
16
+ return { error: { code: -32601, message: `Method not found: ${String(request.method)}` } };
17
+ }
18
+
19
+ const tools = [
20
+ {
21
+ name: "happy2_plugins_list",
22
+ title: "List installed Happy2 plugins",
23
+ description:
24
+ "Lists installed Happy2 plugin identities, versions, installation IDs, and health.",
25
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
26
+ },
27
+ {
28
+ name: "happy2_plugin_install_from_link",
29
+ title: "Request Happy2 plugin installation",
30
+ description:
31
+ "Downloads and validates a Happy2 plugin ZIP link, then posts a human approval request in the current chat. It never installs without approval.",
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ sourceUrl: {
36
+ type: "string",
37
+ description: "Public HTTPS URL of a Happy2 plugin ZIP package.",
38
+ },
39
+ reason: {
40
+ type: "string",
41
+ description: "Short explanation of why this chat needs the plugin.",
42
+ },
43
+ },
44
+ required: ["sourceUrl"],
45
+ additionalProperties: false,
46
+ },
47
+ },
48
+ {
49
+ name: "happy2_plugin_uninstall",
50
+ title: "Request Happy2 plugin uninstall",
51
+ description:
52
+ "Posts a human approval request in the current chat to uninstall one Happy2 plugin installation. It never uninstalls without approval.",
53
+ inputSchema: {
54
+ type: "object",
55
+ properties: {
56
+ installationId: {
57
+ type: "string",
58
+ description: "Installation ID returned by happy2_plugins_list.",
59
+ },
60
+ reason: {
61
+ type: "string",
62
+ description: "Short explanation of why this installation should be removed.",
63
+ },
64
+ },
65
+ required: ["installationId"],
66
+ additionalProperties: false,
67
+ },
68
+ },
69
+ ];
70
+
71
+ const lines = createInterface({ input: process.stdin, crlfDelay: Infinity });
72
+
73
+ for await (const line of lines) {
74
+ if (!line.trim()) continue;
75
+ let request;
76
+ try {
77
+ request = JSON.parse(line);
78
+ } catch {
79
+ continue;
80
+ }
81
+ if (request.id === undefined) continue;
82
+ const response = await handle(request).catch((error) => ({
83
+ result: {
84
+ isError: true,
85
+ content: [
86
+ { type: "text", text: error instanceof Error ? error.message : String(error) },
87
+ ],
88
+ },
89
+ }));
90
+ process.stdout.write(`${JSON.stringify({ jsonrpc: "2.0", id: request.id, ...response })}\n`);
91
+ }
92
+
93
+ async function callTool(params) {
94
+ if (params?.name === "happy2_plugins_list") {
95
+ const result = await hostRequest("GET", "/plugins");
96
+ return textResult(JSON.stringify(result, null, 2));
97
+ }
98
+ if (params?.name === "happy2_plugin_install_from_link") {
99
+ const sourceUrl = text(params.arguments?.sourceUrl, "sourceUrl", 4_096);
100
+ const reason = optionalText(params.arguments?.reason, "reason", 1_000);
101
+ const result = await hostRequest("POST", "/plugin-install-requests", {
102
+ sourceUrl,
103
+ ...(reason ? { reason } : {}),
104
+ });
105
+ return textResult(
106
+ `Happy2 posted an installation approval in this chat. Request: ${JSON.stringify(result.approval)}`,
107
+ );
108
+ }
109
+ if (params?.name === "happy2_plugin_uninstall") {
110
+ const installationId = text(params.arguments?.installationId, "installationId", 128);
111
+ const reason = optionalText(params.arguments?.reason, "reason", 1_000);
112
+ const result = await hostRequest("POST", "/plugin-uninstall-requests", {
113
+ installationId,
114
+ ...(reason ? { reason } : {}),
115
+ });
116
+ return textResult(
117
+ `Happy2 posted an uninstall approval in this chat. Request: ${JSON.stringify(result.approval)}`,
118
+ );
119
+ }
120
+ return { result: { isError: true, content: [{ type: "text", text: "Unknown tool" }] } };
121
+ }
122
+
123
+ async function hostRequest(method, path, body) {
124
+ const base = process.env.HAPPY2_PLUGIN_API_URL;
125
+ const token = process.env.HAPPY2_PLUGIN_API_TOKEN;
126
+ if (!base || !token) throw new Error("Happy2 plugin host API is unavailable");
127
+ const response = await fetch(new URL(path, base), {
128
+ method,
129
+ headers: {
130
+ authorization: `Bearer ${token}`,
131
+ ...(body ? { "content-type": "application/json" } : {}),
132
+ },
133
+ ...(body ? { body: JSON.stringify(body) } : {}),
134
+ });
135
+ const result = await response.json().catch(() => undefined);
136
+ if (!response.ok)
137
+ throw new Error(
138
+ result?.message ?? `Happy2 plugin host API returned HTTP ${response.status}`,
139
+ );
140
+ return result;
141
+ }
142
+
143
+ function textResult(text) {
144
+ return { result: { content: [{ type: "text", text }] } };
145
+ }
146
+
147
+ function text(value, name, maximum) {
148
+ if (typeof value !== "string" || !value.trim() || value.length > maximum)
149
+ throw new Error(`${name} must contain between 1 and ${maximum} characters`);
150
+ return value.trim();
151
+ }
152
+
153
+ function optionalText(value, name, maximum) {
154
+ return value === undefined ? undefined : text(value, name, maximum);
155
+ }