happy2 0.0.11 → 0.0.13

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 (443) hide show
  1. package/README.md +10 -0
  2. package/package.json +2 -2
  3. package/packages/happy2-server/PLUGINS.md +205 -45
  4. package/packages/happy2-server/README.md +19 -7
  5. package/packages/happy2-server/dist/daemon.d.ts +39 -0
  6. package/packages/happy2-server/dist/daemon.d.ts.map +1 -0
  7. package/packages/happy2-server/dist/daemon.js +302 -0
  8. package/packages/happy2-server/dist/daemon.js.map +1 -0
  9. package/packages/happy2-server/dist/daemon.test.d.ts +2 -0
  10. package/packages/happy2-server/dist/daemon.test.d.ts.map +1 -0
  11. package/packages/happy2-server/dist/daemon.test.js +245 -0
  12. package/packages/happy2-server/dist/daemon.test.js.map +1 -0
  13. package/packages/happy2-server/dist/index.d.ts +3 -2
  14. package/packages/happy2-server/dist/index.d.ts.map +1 -1
  15. package/packages/happy2-server/dist/index.js +2 -1
  16. package/packages/happy2-server/dist/index.js.map +1 -1
  17. package/packages/happy2-server/dist/modules/agent/agentChatBind.d.ts +1 -0
  18. package/packages/happy2-server/dist/modules/agent/agentChatBind.d.ts.map +1 -1
  19. package/packages/happy2-server/dist/modules/agent/agentChatBind.js +4 -0
  20. package/packages/happy2-server/dist/modules/agent/agentChatBind.js.map +1 -1
  21. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.d.ts.map +1 -1
  22. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js +3 -1
  23. package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js.map +1 -1
  24. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.d.ts +7 -0
  25. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.d.ts.map +1 -0
  26. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.js +15 -0
  27. package/packages/happy2-server/dist/modules/agent/agentChatGetIdBySession.js.map +1 -0
  28. package/packages/happy2-server/dist/modules/agent/agentCreate.d.ts.map +1 -1
  29. package/packages/happy2-server/dist/modules/agent/agentCreate.js +1 -0
  30. package/packages/happy2-server/dist/modules/agent/agentCreate.js.map +1 -1
  31. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.d.ts +4 -2
  32. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.d.ts.map +1 -1
  33. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.js +8 -8
  34. package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.js.map +1 -1
  35. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.d.ts +3 -3
  36. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.d.ts.map +1 -1
  37. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.js +4 -4
  38. package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.js.map +1 -1
  39. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.d.ts +4 -4
  40. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.d.ts.map +1 -1
  41. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.js +57 -41
  42. package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.js.map +1 -1
  43. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.d.ts +1 -1
  44. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js +3 -3
  45. package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js.map +1 -1
  46. package/packages/happy2-server/dist/modules/agent/agentImageCreate.d.ts +1 -1
  47. package/packages/happy2-server/dist/modules/agent/agentImageCreate.js +3 -3
  48. package/packages/happy2-server/dist/modules/agent/agentImageCreate.js.map +1 -1
  49. package/packages/happy2-server/dist/modules/agent/agentImageGet.d.ts +1 -1
  50. package/packages/happy2-server/dist/modules/agent/agentImageGet.js +3 -3
  51. package/packages/happy2-server/dist/modules/agent/agentImageGet.js.map +1 -1
  52. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.d.ts +2 -1
  53. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.d.ts.map +1 -1
  54. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js +11 -4
  55. package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js.map +1 -1
  56. package/packages/happy2-server/dist/modules/agent/agentImageList.d.ts +2 -2
  57. package/packages/happy2-server/dist/modules/agent/agentImageList.d.ts.map +1 -1
  58. package/packages/happy2-server/dist/modules/agent/agentImageList.js +8 -4
  59. package/packages/happy2-server/dist/modules/agent/agentImageList.js.map +1 -1
  60. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.d.ts +1 -1
  61. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js +3 -3
  62. package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js.map +1 -1
  63. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.d.ts +1 -1
  64. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js +3 -3
  65. package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js.map +1 -1
  66. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.d.ts +1 -1
  67. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.js +3 -3
  68. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.js.map +1 -1
  69. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.d.ts +1 -1
  70. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.js +3 -3
  71. package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.js.map +1 -1
  72. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.d.ts +1 -1
  73. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.js +3 -3
  74. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.js.map +1 -1
  75. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.d.ts +1 -1
  76. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.js +3 -3
  77. package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.js.map +1 -1
  78. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.d.ts +4 -3
  79. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.d.ts.map +1 -1
  80. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.js +5 -5
  81. package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.js.map +1 -1
  82. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.d.ts +1 -1
  83. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.js +3 -3
  84. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.js.map +1 -1
  85. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.d.ts +2 -2
  86. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.js +4 -4
  87. package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.js.map +1 -1
  88. package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.d.ts +1 -1
  89. package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.js +3 -3
  90. package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.js.map +1 -1
  91. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.d.ts +4 -0
  92. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.d.ts.map +1 -1
  93. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.js +207 -9
  94. package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.js.map +1 -1
  95. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.d.ts +8 -0
  96. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.d.ts.map +1 -0
  97. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.js +86 -0
  98. package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.js.map +1 -0
  99. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.d.ts +19 -0
  100. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.d.ts.map +1 -0
  101. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.js +87 -0
  102. package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.js.map +1 -0
  103. package/packages/happy2-server/dist/modules/agent/impl/agentChatContext.d.ts +2 -1
  104. package/packages/happy2-server/dist/modules/agent/impl/agentChatContext.d.ts.map +1 -1
  105. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContext.d.ts +4 -1
  106. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContext.d.ts.map +1 -1
  107. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.d.ts +3 -3
  108. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.d.ts.map +1 -1
  109. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.js +26 -40
  110. package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.js.map +1 -1
  111. package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.d.ts.map +1 -1
  112. package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.js +63 -2
  113. package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.js.map +1 -1
  114. package/packages/happy2-server/dist/modules/agent/types.d.ts +53 -0
  115. package/packages/happy2-server/dist/modules/agent/types.d.ts.map +1 -1
  116. package/packages/happy2-server/dist/modules/agents/daemon.d.ts +31 -2
  117. package/packages/happy2-server/dist/modules/agents/daemon.d.ts.map +1 -1
  118. package/packages/happy2-server/dist/modules/agents/daemon.js +12 -2
  119. package/packages/happy2-server/dist/modules/agents/daemon.js.map +1 -1
  120. package/packages/happy2-server/dist/modules/agents/service.d.ts +13 -6
  121. package/packages/happy2-server/dist/modules/agents/service.d.ts.map +1 -1
  122. package/packages/happy2-server/dist/modules/agents/service.js +497 -49
  123. package/packages/happy2-server/dist/modules/agents/service.js.map +1 -1
  124. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.d.ts +12 -0
  125. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.d.ts.map +1 -0
  126. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.js +27 -0
  127. package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.js.map +1 -0
  128. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.d.ts +8 -0
  129. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.d.ts.map +1 -0
  130. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.js +22 -0
  131. package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.js.map +1 -0
  132. package/packages/happy2-server/dist/modules/auth/methods.d.ts +1 -0
  133. package/packages/happy2-server/dist/modules/auth/methods.d.ts.map +1 -1
  134. package/packages/happy2-server/dist/modules/auth/methods.js +10 -6
  135. package/packages/happy2-server/dist/modules/auth/methods.js.map +1 -1
  136. package/packages/happy2-server/dist/modules/auth/service.d.ts +2 -0
  137. package/packages/happy2-server/dist/modules/auth/service.d.ts.map +1 -1
  138. package/packages/happy2-server/dist/modules/auth/service.js +26 -0
  139. package/packages/happy2-server/dist/modules/auth/service.js.map +1 -1
  140. package/packages/happy2-server/dist/modules/auth/tokens.d.ts +13 -0
  141. package/packages/happy2-server/dist/modules/auth/tokens.d.ts.map +1 -1
  142. package/packages/happy2-server/dist/modules/auth/tokens.js +59 -0
  143. package/packages/happy2-server/dist/modules/auth/tokens.js.map +1 -1
  144. package/packages/happy2-server/dist/modules/auth/tokens.test.d.ts +2 -0
  145. package/packages/happy2-server/dist/modules/auth/tokens.test.d.ts.map +1 -0
  146. package/packages/happy2-server/dist/modules/auth/tokens.test.js +48 -0
  147. package/packages/happy2-server/dist/modules/auth/tokens.test.js.map +1 -0
  148. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.d.ts +17 -0
  149. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.d.ts.map +1 -0
  150. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.js +98 -0
  151. package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.js.map +1 -0
  152. package/packages/happy2-server/dist/modules/chat/asServiceMessage.d.ts.map +1 -1
  153. package/packages/happy2-server/dist/modules/chat/asServiceMessage.js +13 -5
  154. package/packages/happy2-server/dist/modules/chat/asServiceMessage.js.map +1 -1
  155. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.d.ts +20 -0
  156. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.d.ts.map +1 -0
  157. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.js +38 -0
  158. package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.js.map +1 -0
  159. package/packages/happy2-server/dist/modules/chat/types.d.ts +6 -0
  160. package/packages/happy2-server/dist/modules/chat/types.d.ts.map +1 -1
  161. package/packages/happy2-server/dist/modules/chat/types.js.map +1 -1
  162. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.d.ts +7 -0
  163. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.d.ts.map +1 -0
  164. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.js +19 -0
  165. package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.js.map +1 -0
  166. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.d.ts +2 -2
  167. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.d.ts.map +1 -1
  168. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.js +8 -5
  169. package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.js.map +1 -1
  170. package/packages/happy2-server/dist/modules/config/defaults.d.ts.map +1 -1
  171. package/packages/happy2-server/dist/modules/config/defaults.js +3 -0
  172. package/packages/happy2-server/dist/modules/config/defaults.js.map +1 -1
  173. package/packages/happy2-server/dist/modules/config/defaults.test.js +1 -0
  174. package/packages/happy2-server/dist/modules/config/defaults.test.js.map +1 -1
  175. package/packages/happy2-server/dist/modules/config/loader.d.ts.map +1 -1
  176. package/packages/happy2-server/dist/modules/config/loader.js +9 -0
  177. package/packages/happy2-server/dist/modules/config/loader.js.map +1 -1
  178. package/packages/happy2-server/dist/modules/config/loader.test.js +27 -0
  179. package/packages/happy2-server/dist/modules/config/loader.test.js.map +1 -1
  180. package/packages/happy2-server/dist/modules/config/type.d.ts +5 -0
  181. package/packages/happy2-server/dist/modules/config/type.d.ts.map +1 -1
  182. package/packages/happy2-server/dist/modules/message/messageGetProjection.d.ts.map +1 -1
  183. package/packages/happy2-server/dist/modules/message/messageGetProjection.js +28 -0
  184. package/packages/happy2-server/dist/modules/message/messageGetProjection.js.map +1 -1
  185. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.d.ts +4 -0
  186. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.d.ts.map +1 -0
  187. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.js +39 -0
  188. package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.js.map +1 -0
  189. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.d.ts +10 -0
  190. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.d.ts.map +1 -0
  191. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.js +31 -0
  192. package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.js.map +1 -0
  193. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.d.ts +8 -0
  194. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.d.ts.map +1 -0
  195. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.js +13 -0
  196. package/packages/happy2-server/dist/modules/permission/permissionGetEffective.js.map +1 -0
  197. package/packages/happy2-server/dist/modules/permission/roleCreate.d.ts +16 -0
  198. package/packages/happy2-server/dist/modules/permission/roleCreate.d.ts.map +1 -0
  199. package/packages/happy2-server/dist/modules/permission/roleCreate.js +70 -0
  200. package/packages/happy2-server/dist/modules/permission/roleCreate.js.map +1 -0
  201. package/packages/happy2-server/dist/modules/permission/roleDelete.d.ts +11 -0
  202. package/packages/happy2-server/dist/modules/permission/roleDelete.d.ts.map +1 -0
  203. package/packages/happy2-server/dist/modules/permission/roleDelete.js +41 -0
  204. package/packages/happy2-server/dist/modules/permission/roleDelete.js.map +1 -0
  205. package/packages/happy2-server/dist/modules/permission/roleList.d.ts +8 -0
  206. package/packages/happy2-server/dist/modules/permission/roleList.d.ts.map +1 -0
  207. package/packages/happy2-server/dist/modules/permission/roleList.js +36 -0
  208. package/packages/happy2-server/dist/modules/permission/roleList.js.map +1 -0
  209. package/packages/happy2-server/dist/modules/permission/roleUpdate.d.ts +14 -0
  210. package/packages/happy2-server/dist/modules/permission/roleUpdate.d.ts.map +1 -0
  211. package/packages/happy2-server/dist/modules/permission/roleUpdate.js +78 -0
  212. package/packages/happy2-server/dist/modules/permission/roleUpdate.js.map +1 -0
  213. package/packages/happy2-server/dist/modules/permission/types.d.ts +24 -0
  214. package/packages/happy2-server/dist/modules/permission/types.d.ts.map +1 -0
  215. package/packages/happy2-server/dist/modules/permission/types.js +10 -0
  216. package/packages/happy2-server/dist/modules/permission/types.js.map +1 -0
  217. package/packages/happy2-server/dist/modules/permission/userPermissionGet.d.ts +16 -0
  218. package/packages/happy2-server/dist/modules/permission/userPermissionGet.d.ts.map +1 -0
  219. package/packages/happy2-server/dist/modules/permission/userPermissionGet.js +33 -0
  220. package/packages/happy2-server/dist/modules/permission/userPermissionGet.js.map +1 -0
  221. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.d.ts +12 -0
  222. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.d.ts.map +1 -0
  223. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.js +44 -0
  224. package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.js.map +1 -0
  225. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.d.ts +8 -0
  226. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.d.ts.map +1 -0
  227. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.js +12 -0
  228. package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.js.map +1 -0
  229. package/packages/happy2-server/dist/modules/permission/userRequirePermission.d.ts +8 -0
  230. package/packages/happy2-server/dist/modules/permission/userRequirePermission.d.ts.map +1 -0
  231. package/packages/happy2-server/dist/modules/permission/userRequirePermission.js +12 -0
  232. package/packages/happy2-server/dist/modules/permission/userRequirePermission.js.map +1 -0
  233. package/packages/happy2-server/dist/modules/permission/userRoleAssign.d.ts +12 -0
  234. package/packages/happy2-server/dist/modules/permission/userRoleAssign.d.ts.map +1 -0
  235. package/packages/happy2-server/dist/modules/permission/userRoleAssign.js +46 -0
  236. package/packages/happy2-server/dist/modules/permission/userRoleAssign.js.map +1 -0
  237. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.d.ts +12 -0
  238. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.d.ts.map +1 -0
  239. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.js +53 -0
  240. package/packages/happy2-server/dist/modules/permission/userRoleUnassign.js.map +1 -0
  241. package/packages/happy2-server/dist/modules/plugin/archive.d.ts +7 -0
  242. package/packages/happy2-server/dist/modules/plugin/archive.d.ts.map +1 -0
  243. package/packages/happy2-server/dist/modules/plugin/archive.js +222 -0
  244. package/packages/happy2-server/dist/modules/plugin/archive.js.map +1 -0
  245. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts +5 -1
  246. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts.map +1 -1
  247. package/packages/happy2-server/dist/modules/plugin/catalog.js +75 -15
  248. package/packages/happy2-server/dist/modules/plugin/catalog.js.map +1 -1
  249. package/packages/happy2-server/dist/modules/plugin/catalog.test.js +37 -0
  250. package/packages/happy2-server/dist/modules/plugin/catalog.test.js.map +1 -1
  251. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts +1 -0
  252. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts.map +1 -1
  253. package/packages/happy2-server/dist/modules/plugin/httpBridge.js +7 -0
  254. package/packages/happy2-server/dist/modules/plugin/httpBridge.js.map +1 -1
  255. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts.map +1 -1
  256. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js +3 -2
  257. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js.map +1 -1
  258. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts.map +1 -1
  259. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js +17 -3
  260. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js.map +1 -1
  261. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.d.ts +3 -0
  262. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.d.ts.map +1 -0
  263. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.js +12 -0
  264. package/packages/happy2-server/dist/modules/plugin/impl/effectiveContainer.js.map +1 -0
  265. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts.map +1 -1
  266. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js +11 -0
  267. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js.map +1 -1
  268. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.d.ts +11 -0
  269. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.d.ts.map +1 -0
  270. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.js +2 -0
  271. package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.js.map +1 -0
  272. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts +13 -0
  273. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts.map +1 -1
  274. package/packages/happy2-server/dist/modules/plugin/packageStore.js +122 -14
  275. package/packages/happy2-server/dist/modules/plugin/packageStore.js.map +1 -1
  276. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.d.ts +1 -1
  277. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js +3 -3
  278. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js.map +1 -1
  279. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts.map +1 -1
  280. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js +15 -1
  281. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js.map +1 -1
  282. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.d.ts +10 -0
  283. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.d.ts.map +1 -0
  284. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.js +20 -0
  285. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceAuthorize.js.map +1 -0
  286. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.d.ts +12 -0
  287. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.d.ts.map +1 -0
  288. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.js +44 -0
  289. package/packages/happy2-server/dist/modules/plugin/pluginContainerInstanceInvalidate.js.map +1 -0
  290. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts +3 -1
  291. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts.map +1 -1
  292. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js +1 -1
  293. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js.map +1 -1
  294. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.d.ts +1 -1
  295. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js +3 -3
  296. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js.map +1 -1
  297. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.d.ts +13 -0
  298. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.d.ts.map +1 -0
  299. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.js +37 -0
  300. package/packages/happy2-server/dist/modules/plugin/pluginGetSource.js.map +1 -0
  301. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts.map +1 -1
  302. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js +28 -9
  303. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js.map +1 -1
  304. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts.map +1 -1
  305. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js +18 -7
  306. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js.map +1 -1
  307. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.d.ts +1 -1
  308. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js +3 -3
  309. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js.map +1 -1
  310. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.d.ts +14 -0
  311. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.d.ts.map +1 -0
  312. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.js +20 -0
  313. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListForHost.js.map +1 -0
  314. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.d.ts +1 -0
  315. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.d.ts.map +1 -1
  316. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.js +1 -0
  317. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.js.map +1 -1
  318. package/packages/happy2-server/dist/modules/plugin/pluginList.d.ts +1 -1
  319. package/packages/happy2-server/dist/modules/plugin/pluginList.js +3 -3
  320. package/packages/happy2-server/dist/modules/plugin/pluginList.js.map +1 -1
  321. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.d.ts +11 -0
  322. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.d.ts.map +1 -0
  323. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.js +43 -0
  324. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsList.js.map +1 -0
  325. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.d.ts +15 -0
  326. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.d.ts.map +1 -0
  327. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.js +37 -0
  328. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsListReady.js.map +1 -0
  329. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.d.ts +16 -0
  330. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.d.ts.map +1 -0
  331. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.js +71 -0
  332. package/packages/happy2-server/dist/modules/plugin/pluginMcpToolsReplace.js.map +1 -0
  333. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.d.ts +8 -0
  334. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.d.ts.map +1 -0
  335. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.js +24 -0
  336. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.js.map +1 -0
  337. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.d.ts +8 -0
  338. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.d.ts.map +1 -0
  339. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.js +25 -0
  340. package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.js.map +1 -0
  341. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.d.ts +13 -0
  342. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.d.ts.map +1 -0
  343. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.js +63 -0
  344. package/packages/happy2-server/dist/modules/plugin/pluginUninstall.js.map +1 -0
  345. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts +20 -0
  346. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts.map +1 -1
  347. package/packages/happy2-server/dist/modules/plugin/runtime.js +88 -2
  348. package/packages/happy2-server/dist/modules/plugin/runtime.js.map +1 -1
  349. package/packages/happy2-server/dist/modules/plugin/service.d.ts +64 -5
  350. package/packages/happy2-server/dist/modules/plugin/service.d.ts.map +1 -1
  351. package/packages/happy2-server/dist/modules/plugin/service.js +552 -173
  352. package/packages/happy2-server/dist/modules/plugin/service.js.map +1 -1
  353. package/packages/happy2-server/dist/modules/plugin/source.d.ts +35 -0
  354. package/packages/happy2-server/dist/modules/plugin/source.d.ts.map +1 -0
  355. package/packages/happy2-server/dist/modules/plugin/source.js +189 -0
  356. package/packages/happy2-server/dist/modules/plugin/source.js.map +1 -0
  357. package/packages/happy2-server/dist/modules/plugin/types.d.ts +87 -11
  358. package/packages/happy2-server/dist/modules/plugin/types.d.ts.map +1 -1
  359. package/packages/happy2-server/dist/modules/plugin/types.js +1 -0
  360. package/packages/happy2-server/dist/modules/plugin/types.js.map +1 -1
  361. package/packages/happy2-server/dist/modules/realtime/events.d.ts +3 -0
  362. package/packages/happy2-server/dist/modules/realtime/events.d.ts.map +1 -1
  363. package/packages/happy2-server/dist/modules/realtime/events.js +37 -5
  364. package/packages/happy2-server/dist/modules/realtime/events.js.map +1 -1
  365. package/packages/happy2-server/dist/modules/realtime/local.test.js +2 -0
  366. package/packages/happy2-server/dist/modules/realtime/local.test.js.map +1 -1
  367. package/packages/happy2-server/dist/modules/sandbox/index.d.ts +1 -1
  368. package/packages/happy2-server/dist/modules/sandbox/index.d.ts.map +1 -1
  369. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts +8 -1
  370. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts.map +1 -1
  371. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js +105 -3
  372. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js.map +1 -1
  373. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js +82 -3
  374. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js.map +1 -1
  375. package/packages/happy2-server/dist/modules/sandbox/types.d.ts +17 -0
  376. package/packages/happy2-server/dist/modules/sandbox/types.d.ts.map +1 -1
  377. package/packages/happy2-server/dist/modules/schema.d.ts +2245 -233
  378. package/packages/happy2-server/dist/modules/schema.d.ts.map +1 -1
  379. package/packages/happy2-server/dist/modules/schema.js +120 -0
  380. package/packages/happy2-server/dist/modules/schema.js.map +1 -1
  381. package/packages/happy2-server/dist/modules/sync/syncGetDifference.d.ts.map +1 -1
  382. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js +2 -0
  383. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js.map +1 -1
  384. package/packages/happy2-server/dist/modules/user/userAdministrationList.js +2 -2
  385. package/packages/happy2-server/dist/modules/user/userAdministrationList.js.map +1 -1
  386. package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.d.ts.map +1 -1
  387. package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.js +49 -6
  388. package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.js.map +1 -1
  389. package/packages/happy2-server/dist/modules/user/userCreateProfile.d.ts.map +1 -1
  390. package/packages/happy2-server/dist/modules/user/userCreateProfile.js +17 -2
  391. package/packages/happy2-server/dist/modules/user/userCreateProfile.js.map +1 -1
  392. package/packages/happy2-server/dist/routes/agents.d.ts.map +1 -1
  393. package/packages/happy2-server/dist/routes/agents.js +4 -2
  394. package/packages/happy2-server/dist/routes/agents.js.map +1 -1
  395. package/packages/happy2-server/dist/routes/auth.d.ts.map +1 -1
  396. package/packages/happy2-server/dist/routes/auth.js +12 -0
  397. package/packages/happy2-server/dist/routes/auth.js.map +1 -1
  398. package/packages/happy2-server/dist/routes/collaboration.d.ts.map +1 -1
  399. package/packages/happy2-server/dist/routes/collaboration.js +7 -0
  400. package/packages/happy2-server/dist/routes/collaboration.js.map +1 -1
  401. package/packages/happy2-server/dist/routes/files.d.ts.map +1 -1
  402. package/packages/happy2-server/dist/routes/files.js +2 -0
  403. package/packages/happy2-server/dist/routes/files.js.map +1 -1
  404. package/packages/happy2-server/dist/routes/permissions.d.ts +6 -0
  405. package/packages/happy2-server/dist/routes/permissions.d.ts.map +1 -0
  406. package/packages/happy2-server/dist/routes/permissions.js +207 -0
  407. package/packages/happy2-server/dist/routes/permissions.js.map +1 -0
  408. package/packages/happy2-server/dist/routes/pluginHost.d.ts +6 -0
  409. package/packages/happy2-server/dist/routes/pluginHost.d.ts.map +1 -0
  410. package/packages/happy2-server/dist/routes/pluginHost.js +106 -0
  411. package/packages/happy2-server/dist/routes/pluginHost.js.map +1 -0
  412. package/packages/happy2-server/dist/routes/plugins.d.ts.map +1 -1
  413. package/packages/happy2-server/dist/routes/plugins.js +159 -5
  414. package/packages/happy2-server/dist/routes/plugins.js.map +1 -1
  415. package/packages/happy2-server/dist/runner.js +20 -1
  416. package/packages/happy2-server/dist/runner.js.map +1 -1
  417. package/packages/happy2-server/dist/server.d.ts +4 -0
  418. package/packages/happy2-server/dist/server.d.ts.map +1 -1
  419. package/packages/happy2-server/dist/server.js +23 -1
  420. package/packages/happy2-server/dist/server.js.map +1 -1
  421. package/packages/happy2-server/dist/systemService.d.ts.map +1 -1
  422. package/packages/happy2-server/dist/systemService.js +16 -1
  423. package/packages/happy2-server/dist/systemService.js.map +1 -1
  424. package/packages/happy2-server/dist/systemService.test.js +15 -1
  425. package/packages/happy2-server/dist/systemService.test.js.map +1 -1
  426. package/packages/happy2-server/dist/web/assets/index-BaPUPGPe.css +2 -0
  427. package/packages/happy2-server/dist/web/assets/index-BnhFxR3U.js +39 -0
  428. package/packages/happy2-server/dist/web/index.html +2 -2
  429. package/packages/happy2-server/drizzle/0022_plugin_container_runtime_tools.sql +16 -0
  430. package/packages/happy2-server/drizzle/0023_roles_and_permissions.sql +82 -0
  431. package/packages/happy2-server/drizzle/0024_session_bound_dev_tokens.sql +11 -0
  432. package/packages/happy2-server/drizzle/0025_plugin_skills.sql +8 -0
  433. package/packages/happy2-server/drizzle/0026_agent_turn_traces.sql +35 -0
  434. package/packages/happy2-server/drizzle/0027_chat_agent_effort.sql +9 -0
  435. package/packages/happy2-server/drizzle/meta/_journal.json +42 -0
  436. package/packages/happy2-server/happy2.example.toml +14 -0
  437. package/packages/happy2-server/plugins/README.md +3 -1
  438. package/packages/happy2-server/plugins/chat-management/container/Dockerfile +6 -0
  439. package/packages/happy2-server/plugins/chat-management/plugin.json +17 -0
  440. package/packages/happy2-server/plugins/chat-management/plugin.png +0 -0
  441. package/packages/happy2-server/plugins/chat-management/server.mjs +113 -0
  442. package/packages/happy2-server/dist/web/assets/index-9SGCQLg7.js +0 -46
  443. package/packages/happy2-server/dist/web/assets/index-DWXBQDJB.css +0 -2
@@ -13,8 +13,8 @@
13
13
  background: #131217;
14
14
  }
15
15
  </style>
16
- <script type="module" crossorigin src="/assets/index-9SGCQLg7.js"></script>
17
- <link rel="stylesheet" crossorigin href="/assets/index-DWXBQDJB.css">
16
+ <script type="module" crossorigin src="/assets/index-BnhFxR3U.js"></script>
17
+ <link rel="stylesheet" crossorigin href="/assets/index-BaPUPGPe.css">
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
@@ -0,0 +1,16 @@
1
+ ALTER TABLE `plugin_installations` ADD `mcp_tools_synced_at` text;
2
+ --> statement-breakpoint
3
+ ALTER TABLE `plugin_installations` ADD `container_instance_id` text;
4
+ --> statement-breakpoint
5
+ CREATE TABLE `plugin_mcp_tools` (
6
+ `installation_id` text NOT NULL,
7
+ `name` text NOT NULL,
8
+ `title` text,
9
+ `description` text,
10
+ `input_schema_json` text NOT NULL,
11
+ `output_schema_json` text,
12
+ `annotations_json` text,
13
+ `synced_at` text NOT NULL,
14
+ PRIMARY KEY(`installation_id`, `name`),
15
+ FOREIGN KEY (`installation_id`) REFERENCES `plugin_installations`(`id`) ON UPDATE no action ON DELETE cascade
16
+ );
@@ -0,0 +1,82 @@
1
+ CREATE TABLE `roles` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `name` text NOT NULL COLLATE NOCASE,
4
+ `description` text,
5
+ `builtin_kind` text,
6
+ `created_by_user_id` text,
7
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
8
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
9
+ FOREIGN KEY (`created_by_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
10
+ CHECK (`builtin_kind` IS NULL OR `builtin_kind` IN ('admin', 'member'))
11
+ );
12
+ --> statement-breakpoint
13
+ CREATE UNIQUE INDEX `roles_name_unique` ON `roles` (`name`);
14
+ --> statement-breakpoint
15
+ CREATE UNIQUE INDEX `roles_builtin_kind_unique` ON `roles` (`builtin_kind`) WHERE `builtin_kind` IS NOT NULL;
16
+ --> statement-breakpoint
17
+ CREATE TABLE `role_permissions` (
18
+ `role_id` text NOT NULL,
19
+ `permission` text NOT NULL,
20
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
21
+ PRIMARY KEY(`role_id`, `permission`),
22
+ FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON UPDATE no action ON DELETE cascade,
23
+ CHECK (`permission` IN ('manageSecrets', 'assignSecrets', 'manageImages', 'assignImagesToChats', 'managePlugins', 'viewAllMembers', 'manageAdminRoles'))
24
+ );
25
+ --> statement-breakpoint
26
+ CREATE TABLE `user_roles` (
27
+ `user_id` text NOT NULL,
28
+ `role_id` text NOT NULL,
29
+ `assigned_by_user_id` text,
30
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
31
+ PRIMARY KEY(`user_id`, `role_id`),
32
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
33
+ FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON UPDATE no action ON DELETE cascade,
34
+ FOREIGN KEY (`assigned_by_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null
35
+ );
36
+ --> statement-breakpoint
37
+ CREATE INDEX `user_roles_role_id_index` ON `user_roles` (`role_id`);
38
+ --> statement-breakpoint
39
+ CREATE TABLE `user_permissions` (
40
+ `user_id` text NOT NULL,
41
+ `permission` text NOT NULL,
42
+ `granted_by_user_id` text,
43
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
44
+ PRIMARY KEY(`user_id`, `permission`),
45
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
46
+ FOREIGN KEY (`granted_by_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
47
+ CHECK (`permission` IN ('manageSecrets', 'assignSecrets', 'manageImages', 'assignImagesToChats', 'managePlugins', 'viewAllMembers', 'manageAdminRoles'))
48
+ );
49
+ --> statement-breakpoint
50
+ INSERT INTO `roles` (`id`, `name`, `description`, `builtin_kind`)
51
+ VALUES
52
+ ('happy2_builtin_admins', 'Admins', 'Server administrators', 'admin'),
53
+ ('happy2_builtin_members', 'Members', 'All server members', 'member');
54
+ --> statement-breakpoint
55
+ INSERT INTO `role_permissions` (`role_id`, `permission`)
56
+ VALUES
57
+ ('happy2_builtin_admins', 'manageSecrets'),
58
+ ('happy2_builtin_admins', 'assignSecrets'),
59
+ ('happy2_builtin_admins', 'manageImages'),
60
+ ('happy2_builtin_admins', 'assignImagesToChats'),
61
+ ('happy2_builtin_admins', 'managePlugins'),
62
+ ('happy2_builtin_admins', 'viewAllMembers');
63
+ --> statement-breakpoint
64
+ INSERT INTO `user_roles` (`user_id`, `role_id`)
65
+ SELECT `id`, 'happy2_builtin_members' FROM `users` WHERE `kind` = 'human' AND `deleted_at` IS NULL;
66
+ --> statement-breakpoint
67
+ INSERT INTO `user_roles` (`user_id`, `role_id`)
68
+ SELECT `id`, 'happy2_builtin_admins' FROM `users` WHERE `kind` = 'human' AND `role` = 'admin' AND `deleted_at` IS NULL;
69
+ --> statement-breakpoint
70
+ CREATE TRIGGER `roles_prevent_builtin_delete`
71
+ BEFORE DELETE ON `roles`
72
+ WHEN OLD.`builtin_kind` IS NOT NULL
73
+ BEGIN
74
+ SELECT RAISE(ABORT, 'built-in roles cannot be deleted');
75
+ END;
76
+ --> statement-breakpoint
77
+ CREATE TRIGGER `roles_prevent_builtin_kind_change`
78
+ BEFORE UPDATE OF `builtin_kind` ON `roles`
79
+ WHEN OLD.`builtin_kind` IS NOT NEW.`builtin_kind`
80
+ BEGIN
81
+ SELECT RAISE(ABORT, 'built-in role markers cannot be changed');
82
+ END;
@@ -0,0 +1,11 @@
1
+ CREATE TABLE `auth_dev_tokens` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `session_id` text NOT NULL,
4
+ `token_hash` text NOT NULL,
5
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
6
+ FOREIGN KEY (`session_id`) REFERENCES `auth_sessions`(`id`) ON UPDATE no action ON DELETE cascade
7
+ );
8
+ --> statement-breakpoint
9
+ CREATE UNIQUE INDEX `auth_dev_tokens_token_hash_unique` ON `auth_dev_tokens` (`token_hash`);
10
+ --> statement-breakpoint
11
+ CREATE INDEX `auth_dev_tokens_session_id_index` ON `auth_dev_tokens` (`session_id`);
@@ -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;
@@ -155,6 +155,48 @@
155
155
  "when": 1784418000000,
156
156
  "tag": "0021_plugin_function_results",
157
157
  "breakpoints": true
158
+ },
159
+ {
160
+ "idx": 22,
161
+ "version": "6",
162
+ "when": 1784420000000,
163
+ "tag": "0022_plugin_container_runtime_tools",
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
158
200
  }
159
201
  ]
160
202
  }
@@ -9,6 +9,14 @@ public_url = "http://127.0.0.1:3000"
9
9
  # A wrong nonzero value lets clients spoof rate-limit and access telemetry IPs.
10
10
  trusted_proxy_hops = 0
11
11
 
12
+ [plugins]
13
+ # Dedicated capability-only listener reached by plugin containers through the
14
+ # happy2.host.internal container-host mapping.
15
+ # The cross-platform host-gateway path requires a non-loopback bind. Firewall
16
+ # this fixed port from untrusted LANs; it is not a public product API.
17
+ host_api_host = "0.0.0.0"
18
+ host_api_port = 3001
19
+
12
20
  [database]
13
21
  # A local file works for one host. Use a shared libSQL endpoint when auth and
14
22
  # API are independently deployed, so every instance sees the same sessions.
@@ -82,6 +90,12 @@ expiry_days = 30
82
90
  [auth.password]
83
91
  enabled = true
84
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
+
85
99
  [auth.magic_link]
86
100
  enabled = false
87
101
  from = "Happy (2) <noreply@happy2.example.com>"
@@ -4,4 +4,6 @@ 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 a chat-scoped Plugin API capability without
8
+ accepting a chat identifier from tool arguments. Product plugins should be added
9
+ here as separate, 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.0.0",
4
+ "displayName": "Chat Management",
5
+ "shortName": "chat-management",
6
+ "description": "Lets an agent update the title and description of its current chat.",
7
+ "variables": [],
8
+ "container": {
9
+ "dockerfile": "container/Dockerfile",
10
+ "permissions": ["chats:update"]
11
+ },
12
+ "mcp": {
13
+ "type": "stdio",
14
+ "command": "node",
15
+ "args": ["/plugin/server.mjs"]
16
+ }
17
+ }
@@ -0,0 +1,113 @@
1
+ import { createInterface } from "node:readline";
2
+
3
+ const CHAT_META_KEY = "happy2/chat";
4
+ const lines = createInterface({ input: process.stdin, crlfDelay: Infinity });
5
+
6
+ for await (const line of lines) {
7
+ if (!line.trim()) continue;
8
+ let request;
9
+ try {
10
+ request = JSON.parse(line);
11
+ } catch {
12
+ continue;
13
+ }
14
+ if (request.id === undefined) continue;
15
+ const response = await handle(request).catch((error) => ({
16
+ result: {
17
+ isError: true,
18
+ content: [
19
+ {
20
+ type: "text",
21
+ text: error instanceof Error ? error.message : "The chat could not be updated.",
22
+ },
23
+ ],
24
+ },
25
+ }));
26
+ process.stdout.write(`${JSON.stringify({ jsonrpc: "2.0", id: request.id, ...response })}\n`);
27
+ }
28
+
29
+ async function handle(request) {
30
+ if (request.method === "initialize") {
31
+ return {
32
+ result: {
33
+ protocolVersion: request.params?.protocolVersion ?? "2025-06-18",
34
+ capabilities: { tools: {} },
35
+ serverInfo: { name: "happy2-chat-management", version: "1.0.0" },
36
+ },
37
+ };
38
+ }
39
+ if (request.method === "ping") return { result: {} };
40
+ if (request.method === "tools/list") {
41
+ return {
42
+ result: {
43
+ tools: [
44
+ {
45
+ name: "chat_update",
46
+ title: "Update current chat",
47
+ description:
48
+ "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.",
49
+ inputSchema: {
50
+ type: "object",
51
+ properties: {
52
+ title: {
53
+ type: "string",
54
+ minLength: 1,
55
+ maxLength: 100,
56
+ description: "The new title for the current chat.",
57
+ },
58
+ description: {
59
+ type: ["string", "null"],
60
+ maxLength: 500,
61
+ description:
62
+ "The new description, or null to clear the current description.",
63
+ },
64
+ },
65
+ anyOf: [{ required: ["title"] }, { required: ["description"] }],
66
+ additionalProperties: false,
67
+ },
68
+ },
69
+ ],
70
+ },
71
+ };
72
+ }
73
+ if (request.method === "tools/call" && request.params?.name === "chat_update")
74
+ return { result: await updateChat(request.params) };
75
+ return {
76
+ error: { code: -32601, message: `Method not found: ${String(request.method)}` },
77
+ };
78
+ }
79
+
80
+ async function updateChat(params) {
81
+ const chat = params?._meta?.[CHAT_META_KEY];
82
+ if (!chat || typeof chat.id !== "string" || typeof chat.token !== "string")
83
+ throw new Error("This tool must be called from an active Happy chat.");
84
+ const apiUrl = process.env.HAPPY2_PLUGIN_API_URL;
85
+ const runtimeToken = process.env.HAPPY2_PLUGIN_API_TOKEN;
86
+ if (!apiUrl || !runtimeToken) throw new Error("The Happy Plugin API is unavailable.");
87
+ const input = params.arguments;
88
+ if (!input || typeof input !== "object" || Array.isArray(input))
89
+ throw new Error("A chat update is required.");
90
+ const response = await fetch(`${apiUrl}/chats/updateChat`, {
91
+ method: "POST",
92
+ headers: {
93
+ authorization: `Bearer ${runtimeToken}`,
94
+ "content-type": "application/json",
95
+ "x-happy2-chat-token": chat.token,
96
+ },
97
+ body: JSON.stringify(input),
98
+ });
99
+ const result = await response.json().catch(() => undefined);
100
+ if (!response.ok)
101
+ throw new Error(
102
+ typeof result?.message === "string" ? result.message : "The chat could not be updated.",
103
+ );
104
+ return {
105
+ content: [
106
+ {
107
+ type: "text",
108
+ text: `Updated chat ${result.chat.id}.`,
109
+ },
110
+ ],
111
+ structuredContent: { chat: result.chat },
112
+ };
113
+ }