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.
- package/package.json +2 -2
- package/packages/happy2-server/PLUGINS.md +281 -39
- package/packages/happy2-server/README.md +8 -7
- package/packages/happy2-server/dist/index.d.ts +3 -1
- package/packages/happy2-server/dist/index.d.ts.map +1 -1
- package/packages/happy2-server/dist/index.js +2 -0
- package/packages/happy2-server/dist/index.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentChatBind.d.ts +1 -0
- package/packages/happy2-server/dist/modules/agent/agentChatBind.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentChatBind.js +4 -0
- package/packages/happy2-server/dist/modules/agent/agentChatBind.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentChatGetContext.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js +3 -1
- package/packages/happy2-server/dist/modules/agent/agentChatGetContext.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentCreate.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentCreate.js +1 -0
- package/packages/happy2-server/dist/modules/agent/agentCreate.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.d.ts +4 -2
- package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.js +8 -8
- package/packages/happy2-server/dist/modules/agent/agentEffortBindingList.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.d.ts +3 -3
- package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.js +4 -4
- package/packages/happy2-server/dist/modules/agent/agentEffortGetContext.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.d.ts +4 -4
- package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.js +57 -41
- package/packages/happy2-server/dist/modules/agent/agentEffortUpdate.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentImageCommitChange.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageCreate.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageCreate.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentImageCreate.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageGet.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageGet.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentImageGet.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.d.ts +2 -1
- package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js +11 -4
- package/packages/happy2-server/dist/modules/agent/agentImageGetChangeContext.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageList.d.ts +2 -2
- package/packages/happy2-server/dist/modules/agent/agentImageList.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageList.js +8 -4
- package/packages/happy2-server/dist/modules/agent/agentImageList.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentImageRequestBuild.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentImageSetDefault.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentDelete.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentSecretAssignmentList.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentSecretAttachToAgent.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentSecretAttachToChannel.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.d.ts +4 -3
- package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.js +5 -5
- package/packages/happy2-server/dist/modules/agent/agentSecretAuthorizeManagement.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromAgent.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.d.ts +2 -2
- package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.js +4 -4
- package/packages/happy2-server/dist/modules/agent/agentSecretDetachFromChannel.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.d.ts +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.js +3 -3
- package/packages/happy2-server/dist/modules/agent/agentSecretRecordRegistration.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.d.ts +4 -0
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.js +15 -0
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.js.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.d.ts +2 -0
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.js +17 -0
- package/packages/happy2-server/dist/modules/agent/agentSkillHomeGet.test.js.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.d.ts +23 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.js +70 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnGetPluginContext.js.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.d.ts +4 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.js +207 -9
- package/packages/happy2-server/dist/modules/agent/agentTurnStreamReply.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.d.ts +8 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.js +86 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceGet.js.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.d.ts +19 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.js +87 -0
- package/packages/happy2-server/dist/modules/agent/agentTurnTraceStart.js.map +1 -0
- package/packages/happy2-server/dist/modules/agent/impl/agentChatContext.d.ts +2 -1
- package/packages/happy2-server/dist/modules/agent/impl/agentChatContext.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/impl/agentEffortContext.d.ts +4 -1
- package/packages/happy2-server/dist/modules/agent/impl/agentEffortContext.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.d.ts +3 -3
- package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.js +26 -40
- package/packages/happy2-server/dist/modules/agent/impl/agentEffortContextDb.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.js +63 -2
- package/packages/happy2-server/dist/modules/agent/impl/finishAgentTurn.js.map +1 -1
- package/packages/happy2-server/dist/modules/agent/types.d.ts +53 -0
- package/packages/happy2-server/dist/modules/agent/types.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agents/daemon.d.ts +31 -2
- package/packages/happy2-server/dist/modules/agents/daemon.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agents/daemon.js +12 -2
- package/packages/happy2-server/dist/modules/agents/daemon.js.map +1 -1
- package/packages/happy2-server/dist/modules/agents/service.d.ts +11 -6
- package/packages/happy2-server/dist/modules/agents/service.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/agents/service.js +498 -50
- package/packages/happy2-server/dist/modules/agents/service.js.map +1 -1
- package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.d.ts +12 -0
- package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.js +27 -0
- package/packages/happy2-server/dist/modules/auth/developmentTokenCreate.js.map +1 -0
- package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.d.ts +8 -0
- package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.js +22 -0
- package/packages/happy2-server/dist/modules/auth/developmentTokenFindActive.js.map +1 -0
- package/packages/happy2-server/dist/modules/auth/methods.d.ts +1 -0
- package/packages/happy2-server/dist/modules/auth/methods.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/auth/methods.js +10 -6
- package/packages/happy2-server/dist/modules/auth/methods.js.map +1 -1
- package/packages/happy2-server/dist/modules/auth/service.d.ts +2 -0
- package/packages/happy2-server/dist/modules/auth/service.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/auth/service.js +26 -0
- package/packages/happy2-server/dist/modules/auth/service.js.map +1 -1
- package/packages/happy2-server/dist/modules/auth/tokens.d.ts +21 -0
- package/packages/happy2-server/dist/modules/auth/tokens.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/auth/tokens.js +97 -3
- package/packages/happy2-server/dist/modules/auth/tokens.js.map +1 -1
- package/packages/happy2-server/dist/modules/auth/tokens.test.js +77 -0
- package/packages/happy2-server/dist/modules/auth/tokens.test.js.map +1 -1
- package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.d.ts +17 -0
- package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.js +98 -0
- package/packages/happy2-server/dist/modules/chat/asAgentTurnTrace.js.map +1 -0
- package/packages/happy2-server/dist/modules/chat/asServiceMessage.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/chat/asServiceMessage.js +13 -5
- package/packages/happy2-server/dist/modules/chat/asServiceMessage.js.map +1 -1
- package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.d.ts +19 -0
- package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.js +87 -0
- package/packages/happy2-server/dist/modules/chat/channelCreateWithMembers.js.map +1 -0
- package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.d.ts +15 -0
- package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.js +38 -0
- package/packages/happy2-server/dist/modules/chat/channelMembersUpdate.js.map +1 -0
- package/packages/happy2-server/dist/modules/chat/chatAppendAudit.d.ts +1 -1
- package/packages/happy2-server/dist/modules/chat/chatAppendAudit.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.d.ts +20 -0
- package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.js +38 -0
- package/packages/happy2-server/dist/modules/chat/chatUpdateMetadata.js.map +1 -0
- package/packages/happy2-server/dist/modules/chat/types.d.ts +6 -0
- package/packages/happy2-server/dist/modules/chat/types.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/chat/types.js.map +1 -1
- package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.d.ts +7 -0
- package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.js +19 -0
- package/packages/happy2-server/dist/modules/chat/userRequireActiveHuman.js.map +1 -0
- package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.d.ts +2 -2
- package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.js +8 -5
- package/packages/happy2-server/dist/modules/chat/userRequireServerAdmin.js.map +1 -1
- package/packages/happy2-server/dist/modules/config/defaults.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/config/defaults.js +1 -0
- package/packages/happy2-server/dist/modules/config/defaults.js.map +1 -1
- package/packages/happy2-server/dist/modules/config/defaults.test.js +1 -0
- package/packages/happy2-server/dist/modules/config/defaults.test.js.map +1 -1
- package/packages/happy2-server/dist/modules/config/loader.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/config/loader.js +4 -0
- package/packages/happy2-server/dist/modules/config/loader.js.map +1 -1
- package/packages/happy2-server/dist/modules/config/loader.test.js +12 -0
- package/packages/happy2-server/dist/modules/config/loader.test.js.map +1 -1
- package/packages/happy2-server/dist/modules/config/type.d.ts +3 -0
- package/packages/happy2-server/dist/modules/config/type.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/message/messageGetProjection.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/message/messageGetProjection.js +28 -0
- package/packages/happy2-server/dist/modules/message/messageGetProjection.js.map +1 -1
- package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.d.ts +4 -0
- package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.js +39 -0
- package/packages/happy2-server/dist/modules/permission/impl/permissionEffectiveDb.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.d.ts +10 -0
- package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.js +31 -0
- package/packages/happy2-server/dist/modules/permission/impl/permissionMutationRecord.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/permissionGetEffective.d.ts +8 -0
- package/packages/happy2-server/dist/modules/permission/permissionGetEffective.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/permissionGetEffective.js +13 -0
- package/packages/happy2-server/dist/modules/permission/permissionGetEffective.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleCreate.d.ts +16 -0
- package/packages/happy2-server/dist/modules/permission/roleCreate.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleCreate.js +70 -0
- package/packages/happy2-server/dist/modules/permission/roleCreate.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleDelete.d.ts +11 -0
- package/packages/happy2-server/dist/modules/permission/roleDelete.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleDelete.js +41 -0
- package/packages/happy2-server/dist/modules/permission/roleDelete.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleList.d.ts +8 -0
- package/packages/happy2-server/dist/modules/permission/roleList.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleList.js +36 -0
- package/packages/happy2-server/dist/modules/permission/roleList.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleUpdate.d.ts +14 -0
- package/packages/happy2-server/dist/modules/permission/roleUpdate.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/roleUpdate.js +78 -0
- package/packages/happy2-server/dist/modules/permission/roleUpdate.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/types.d.ts +24 -0
- package/packages/happy2-server/dist/modules/permission/types.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/types.js +10 -0
- package/packages/happy2-server/dist/modules/permission/types.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionGet.d.ts +16 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionGet.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionGet.js +33 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionGet.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.d.ts +12 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.js +44 -0
- package/packages/happy2-server/dist/modules/permission/userPermissionUpdate.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.d.ts +8 -0
- package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.js +12 -0
- package/packages/happy2-server/dist/modules/permission/userRequireAnyPermission.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRequirePermission.d.ts +8 -0
- package/packages/happy2-server/dist/modules/permission/userRequirePermission.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRequirePermission.js +12 -0
- package/packages/happy2-server/dist/modules/permission/userRequirePermission.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRoleAssign.d.ts +12 -0
- package/packages/happy2-server/dist/modules/permission/userRoleAssign.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRoleAssign.js +46 -0
- package/packages/happy2-server/dist/modules/permission/userRoleAssign.js.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRoleUnassign.d.ts +12 -0
- package/packages/happy2-server/dist/modules/permission/userRoleUnassign.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/permission/userRoleUnassign.js +53 -0
- package/packages/happy2-server/dist/modules/permission/userRoleUnassign.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/archive.d.ts +7 -0
- package/packages/happy2-server/dist/modules/plugin/archive.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/archive.js +222 -0
- package/packages/happy2-server/dist/modules/plugin/archive.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/catalog.d.ts +5 -1
- package/packages/happy2-server/dist/modules/plugin/catalog.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/catalog.js +35 -16
- package/packages/happy2-server/dist/modules/plugin/catalog.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/catalog.test.js +6 -2
- package/packages/happy2-server/dist/modules/plugin/catalog.test.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts +1 -0
- package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/httpBridge.js +7 -0
- package/packages/happy2-server/dist/modules/plugin/httpBridge.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.d.ts +5 -0
- package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.js +106 -0
- package/packages/happy2-server/dist/modules/plugin/impl/apiPermissions.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js +12 -2
- package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.d.ts +3 -0
- package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.js +68 -0
- package/packages/happy2-server/dist/modules/plugin/impl/asManagementRequest.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js +12 -3
- package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts +19 -0
- package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js +4 -2
- package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js +14 -0
- package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.d.ts +345 -0
- package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.js +22 -0
- package/packages/happy2-server/dist/modules/plugin/impl/managementRequestSelection.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.d.ts +11 -0
- package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.js +2 -0
- package/packages/happy2-server/dist/modules/plugin/impl/pluginSkillSource.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.d.ts +16 -0
- package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.js +67 -0
- package/packages/happy2-server/dist/modules/plugin/packageLinkDownloader.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts +27 -1
- package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/packageStore.js +234 -15
- package/packages/happy2-server/dist/modules/plugin/packageStore.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/packageStore.test.d.ts +2 -0
- package/packages/happy2-server/dist/modules/plugin/packageStore.test.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/packageStore.test.js +50 -0
- package/packages/happy2-server/dist/modules/plugin/packageStore.test.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.d.ts +5 -0
- package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.js +26 -0
- package/packages/happy2-server/dist/modules/plugin/pluginAgentCallContextGet.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.d.ts +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js +3 -3
- package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js +7 -3
- package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.d.ts +2 -0
- package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.js +44 -0
- package/packages/happy2-server/dist/modules/plugin/pluginDeveloperServer.test.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts +3 -1
- package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginGetImage.d.ts +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js +3 -3
- package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginGetSource.d.ts +13 -0
- package/packages/happy2-server/dist/modules/plugin/pluginGetSource.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginGetSource.js +37 -0
- package/packages/happy2-server/dist/modules/plugin/pluginGetSource.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts +4 -2
- package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginInstall.js +36 -5
- package/packages/happy2-server/dist/modules/plugin/pluginInstall.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.d.ts +7 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.js +18 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetContainerName.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.d.ts +13 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.js +35 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRequestUninstallContext.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js +3 -1
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.d.ts +6 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.js +17 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetUninstallContext.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.d.ts +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js +3 -3
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.d.ts +18 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.js +92 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationPermissionsUpdate.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.d.ts +16 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.js +71 -0
- package/packages/happy2-server/dist/modules/plugin/pluginInstallationUninstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginList.d.ts +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginList.js +3 -3
- package/packages/happy2-server/dist/modules/plugin/pluginList.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.d.ts +21 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.js +71 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginInstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.d.ts +12 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.js +56 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestBeginUninstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.d.ts +11 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.js +44 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteInstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.d.ts +10 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.js +41 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCompleteUninstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.d.ts +26 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.js +78 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts +25 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.js +76 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.d.ts +11 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.js +48 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestDeny.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.d.ts +12 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.js +42 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestGetPackage.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.d.ts +5 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.js +18 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestList.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts +4 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.js +11 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts +5 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js +75 -0
- package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.d.ts +12 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.js +33 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillPackageListReady.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.d.ts +8 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.js +24 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListInstalled.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.d.ts +8 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.js +25 -0
- package/packages/happy2-server/dist/modules/plugin/pluginSkillsListReady.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginUninstall.d.ts +13 -0
- package/packages/happy2-server/dist/modules/plugin/pluginUninstall.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/pluginUninstall.js +63 -0
- package/packages/happy2-server/dist/modules/plugin/pluginUninstall.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/runtime.d.ts +1 -0
- package/packages/happy2-server/dist/modules/plugin/runtime.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/runtime.js +1 -0
- package/packages/happy2-server/dist/modules/plugin/runtime.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/service.d.ts +157 -5
- package/packages/happy2-server/dist/modules/plugin/service.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/service.js +789 -19
- package/packages/happy2-server/dist/modules/plugin/service.js.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/source.d.ts +35 -0
- package/packages/happy2-server/dist/modules/plugin/source.d.ts.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/source.js +189 -0
- package/packages/happy2-server/dist/modules/plugin/source.js.map +1 -0
- package/packages/happy2-server/dist/modules/plugin/types.d.ts +116 -11
- package/packages/happy2-server/dist/modules/plugin/types.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/plugin/types.js +9 -0
- package/packages/happy2-server/dist/modules/plugin/types.js.map +1 -1
- package/packages/happy2-server/dist/modules/realtime/events.d.ts +3 -0
- package/packages/happy2-server/dist/modules/realtime/events.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/realtime/events.js +37 -5
- package/packages/happy2-server/dist/modules/realtime/events.js.map +1 -1
- package/packages/happy2-server/dist/modules/realtime/local.test.js +2 -0
- package/packages/happy2-server/dist/modules/realtime/local.test.js.map +1 -1
- package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js +4 -2
- package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js.map +1 -1
- package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js +4 -1
- package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js.map +1 -1
- package/packages/happy2-server/dist/modules/sandbox/types.d.ts +1 -0
- package/packages/happy2-server/dist/modules/sandbox/types.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/schema.d.ts +8024 -5446
- package/packages/happy2-server/dist/modules/schema.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/schema.js +140 -0
- package/packages/happy2-server/dist/modules/schema.js.map +1 -1
- package/packages/happy2-server/dist/modules/sync/syncGetDifference.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/sync/syncGetDifference.js +2 -0
- package/packages/happy2-server/dist/modules/sync/syncGetDifference.js.map +1 -1
- package/packages/happy2-server/dist/modules/user/userAdministrationList.js +2 -2
- package/packages/happy2-server/dist/modules/user/userAdministrationList.js.map +1 -1
- package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.js +49 -6
- package/packages/happy2-server/dist/modules/user/userAdministrationUpdate.js.map +1 -1
- package/packages/happy2-server/dist/modules/user/userCreateProfile.d.ts.map +1 -1
- package/packages/happy2-server/dist/modules/user/userCreateProfile.js +17 -2
- package/packages/happy2-server/dist/modules/user/userCreateProfile.js.map +1 -1
- package/packages/happy2-server/dist/routes/agents.d.ts.map +1 -1
- package/packages/happy2-server/dist/routes/agents.js +4 -2
- package/packages/happy2-server/dist/routes/agents.js.map +1 -1
- package/packages/happy2-server/dist/routes/auth.d.ts.map +1 -1
- package/packages/happy2-server/dist/routes/auth.js +12 -0
- package/packages/happy2-server/dist/routes/auth.js.map +1 -1
- package/packages/happy2-server/dist/routes/collaboration.d.ts.map +1 -1
- package/packages/happy2-server/dist/routes/collaboration.js +7 -0
- package/packages/happy2-server/dist/routes/collaboration.js.map +1 -1
- package/packages/happy2-server/dist/routes/files.d.ts.map +1 -1
- package/packages/happy2-server/dist/routes/files.js +2 -0
- package/packages/happy2-server/dist/routes/files.js.map +1 -1
- package/packages/happy2-server/dist/routes/permissions.d.ts +6 -0
- package/packages/happy2-server/dist/routes/permissions.d.ts.map +1 -0
- package/packages/happy2-server/dist/routes/permissions.js +207 -0
- package/packages/happy2-server/dist/routes/permissions.js.map +1 -0
- package/packages/happy2-server/dist/routes/pluginHost.d.ts +2 -1
- package/packages/happy2-server/dist/routes/pluginHost.d.ts.map +1 -1
- package/packages/happy2-server/dist/routes/pluginHost.js +356 -5
- package/packages/happy2-server/dist/routes/pluginHost.js.map +1 -1
- package/packages/happy2-server/dist/routes/plugins.d.ts.map +1 -1
- package/packages/happy2-server/dist/routes/plugins.js +375 -7
- package/packages/happy2-server/dist/routes/plugins.js.map +1 -1
- package/packages/happy2-server/dist/server.d.ts +4 -0
- package/packages/happy2-server/dist/server.d.ts.map +1 -1
- package/packages/happy2-server/dist/server.js +12 -7
- package/packages/happy2-server/dist/server.js.map +1 -1
- package/packages/happy2-server/dist/web/assets/index-Dn5SZu3y.js +39 -0
- package/packages/happy2-server/dist/web/assets/index-Dys3sWv8.css +2 -0
- package/packages/happy2-server/dist/web/index.html +2 -2
- package/packages/happy2-server/drizzle/0023_roles_and_permissions.sql +82 -0
- package/packages/happy2-server/drizzle/0024_session_bound_dev_tokens.sql +11 -0
- package/packages/happy2-server/drizzle/0025_plugin_skills.sql +8 -0
- package/packages/happy2-server/drizzle/0026_agent_turn_traces.sql +35 -0
- package/packages/happy2-server/drizzle/0027_chat_agent_effort.sql +9 -0
- package/packages/happy2-server/drizzle/0028_plugin_api_permissions.sql +1 -0
- package/packages/happy2-server/drizzle/0029_plugin_management_requests.sql +35 -0
- package/packages/happy2-server/drizzle/meta/_journal.json +49 -0
- package/packages/happy2-server/happy2.example.toml +6 -0
- package/packages/happy2-server/plugins/README.md +7 -1
- package/packages/happy2-server/plugins/chat-management/container/Dockerfile +6 -0
- package/packages/happy2-server/plugins/chat-management/plugin.json +17 -0
- package/packages/happy2-server/plugins/chat-management/plugin.png +0 -0
- package/packages/happy2-server/plugins/chat-management/server.mjs +280 -0
- package/packages/happy2-server/plugins/plugin-developer/container/Dockerfile +6 -0
- package/packages/happy2-server/plugins/plugin-developer/plugin.json +17 -0
- package/packages/happy2-server/plugins/plugin-developer/plugin.png +0 -0
- package/packages/happy2-server/plugins/plugin-developer/server.mjs +155 -0
- package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/SKILL.md +59 -0
- package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/host-api.md +63 -0
- package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/installing.md +86 -0
- package/packages/happy2-server/plugins/plugin-developer/skills/happy2-plugin-development/references/package-format.md +137 -0
- package/packages/happy2-server/dist/web/assets/index-9SGCQLg7.js +0 -46
- 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.
|
|
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,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
|
+
}
|
|
Binary file
|
|
@@ -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,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
|
+
}
|
|
Binary file
|
|
@@ -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
|
+
}
|