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,26 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import type { MutationHint } from "../chat/types.js";
|
|
3
|
+
import { type PluginManagementRequestSummary } from "./types.js";
|
|
4
|
+
/** Creates one idempotent pluginManagementRequests install for an immutable staged package and advances the originating chats point in one transaction. This boundary binds audit and reactive approval evidence to the exact agent call before installation authority exists. */
|
|
5
|
+
export declare function pluginManagementRequestCreateInstall(executor: DrizzleExecutor, input: {
|
|
6
|
+
id: string;
|
|
7
|
+
actorUserId: string;
|
|
8
|
+
agentUserId: string;
|
|
9
|
+
callId: string;
|
|
10
|
+
chatId: string;
|
|
11
|
+
requesterInstallationId: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
shortName: string;
|
|
14
|
+
description: string;
|
|
15
|
+
reason?: string;
|
|
16
|
+
sourceKind: "archive" | "link";
|
|
17
|
+
sourceReference: string;
|
|
18
|
+
packageDigest: string;
|
|
19
|
+
packageDirectory: string;
|
|
20
|
+
installationId: string;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
created: boolean;
|
|
23
|
+
hint?: MutationHint;
|
|
24
|
+
request: PluginManagementRequestSummary;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=pluginManagementRequestCreateInstall.d.ts.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestCreateInstall.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateInstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EAAe,KAAK,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAE9E,kRAAkR;AAClR,wBAAsB,oCAAoC,CACtD,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE;IACH,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CAC1B,GACF,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,8BAA8B,CAAA;CAAE,CAAC,CA8E7F"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { and, eq } from "drizzle-orm";
|
|
2
|
+
import { withTransaction } from "../drizzle.js";
|
|
3
|
+
import { chatAppendAudit } from "../chat/chatAppendAudit.js";
|
|
4
|
+
import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
|
|
5
|
+
import { chatGetAccess } from "../chat/chatGetAccess.js";
|
|
6
|
+
import { chatHint } from "../chat/chatHint.js";
|
|
7
|
+
import { pluginManagementRequests } from "../schema.js";
|
|
8
|
+
import { syncSequenceNext } from "../sync/syncSequenceNext.js";
|
|
9
|
+
import { asPluginManagementRequest } from "./impl/asManagementRequest.js";
|
|
10
|
+
import { pluginManagementRequestSelection } from "./impl/managementRequestSelection.js";
|
|
11
|
+
import { PluginError } from "./types.js";
|
|
12
|
+
/** Creates one idempotent pluginManagementRequests install for an immutable staged package and advances the originating chats point in one transaction. This boundary binds audit and reactive approval evidence to the exact agent call before installation authority exists. */
|
|
13
|
+
export async function pluginManagementRequestCreateInstall(executor, input) {
|
|
14
|
+
return withTransaction(executor, async (tx) => {
|
|
15
|
+
const access = await chatGetAccess(tx, input.actorUserId, input.chatId, true);
|
|
16
|
+
if (!access)
|
|
17
|
+
throw new PluginError("forbidden", "The originating user cannot access this chat");
|
|
18
|
+
const [existing] = await tx
|
|
19
|
+
.select(pluginManagementRequestSelection)
|
|
20
|
+
.from(pluginManagementRequests)
|
|
21
|
+
.where(and(eq(pluginManagementRequests.requesterInstallationId, input.requesterInstallationId), eq(pluginManagementRequests.callId, input.callId), eq(pluginManagementRequests.action, "install")))
|
|
22
|
+
.limit(1);
|
|
23
|
+
if (existing)
|
|
24
|
+
return { created: false, request: asPluginManagementRequest(existing) };
|
|
25
|
+
await tx.insert(pluginManagementRequests).values({
|
|
26
|
+
id: input.id,
|
|
27
|
+
action: "install",
|
|
28
|
+
status: "pending",
|
|
29
|
+
chatId: input.chatId,
|
|
30
|
+
actorUserId: input.actorUserId,
|
|
31
|
+
agentUserId: input.agentUserId,
|
|
32
|
+
requesterInstallationId: input.requesterInstallationId,
|
|
33
|
+
callId: input.callId,
|
|
34
|
+
displayName: input.displayName,
|
|
35
|
+
shortName: input.shortName,
|
|
36
|
+
description: input.description,
|
|
37
|
+
reason: input.reason,
|
|
38
|
+
sourceKind: input.sourceKind,
|
|
39
|
+
sourceReference: input.sourceReference,
|
|
40
|
+
packageDigest: input.packageDigest,
|
|
41
|
+
packageDirectory: input.packageDirectory,
|
|
42
|
+
installationId: input.installationId,
|
|
43
|
+
});
|
|
44
|
+
await chatAppendAudit(tx, {
|
|
45
|
+
actorUserId: input.actorUserId,
|
|
46
|
+
action: "plugin.install_requested",
|
|
47
|
+
targetType: "plugin_management_request",
|
|
48
|
+
targetId: input.id,
|
|
49
|
+
chatId: input.chatId,
|
|
50
|
+
after: {
|
|
51
|
+
agentUserId: input.agentUserId,
|
|
52
|
+
requesterInstallationId: input.requesterInstallationId,
|
|
53
|
+
shortName: input.shortName,
|
|
54
|
+
sourceKind: input.sourceKind,
|
|
55
|
+
sourceReference: input.sourceReference,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const sequence = await syncSequenceNext(tx);
|
|
59
|
+
await tx
|
|
60
|
+
.update(pluginManagementRequests)
|
|
61
|
+
.set({ syncSequence: sequence })
|
|
62
|
+
.where(eq(pluginManagementRequests.id, input.id));
|
|
63
|
+
const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, "plugin.install_requested", input.id);
|
|
64
|
+
const [created] = await tx
|
|
65
|
+
.select(pluginManagementRequestSelection)
|
|
66
|
+
.from(pluginManagementRequests)
|
|
67
|
+
.where(eq(pluginManagementRequests.id, input.id))
|
|
68
|
+
.limit(1);
|
|
69
|
+
if (!created)
|
|
70
|
+
throw new Error("Plugin management request projection was not found");
|
|
71
|
+
return {
|
|
72
|
+
created: true,
|
|
73
|
+
hint: chatHint(sequence, input.chatId, mutation.pts),
|
|
74
|
+
request: asPluginManagementRequest(created),
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=pluginManagementRequestCreateInstall.js.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateInstall.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestCreateInstall.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateInstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE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AE,CAAC,CAAC;QAC5C,MAAM,EAAE;aACH,MAAM,CAAC,wBAAwB,CAAC;aAChC,GAAG,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;aAC/B,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAC1C,EAAE,EACF,QAAQ,EACR,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,MAAM,EACZ,0BAA0B,EAC1B,KAAK,CAAC,EAAE,CACX,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE;aACrB,MAAM,CAAC,gCAAgC,CAAC;aACxC,IAAI,CAAC,wBAAwB,CAAC;aAC9B,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;aAChD,KAAK,CAAC,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACpF,OAAO;YACH,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;YACpD,OAAO,EAAE,yBAAyB,CAAC,OAAO,CAAC;SAC9C,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import type { MutationHint } from "../chat/types.js";
|
|
3
|
+
import { type PluginManagementRequestSummary, type PluginSource } from "./types.js";
|
|
4
|
+
/** Creates one idempotent pluginManagementRequests uninstall with a validated metadata snapshot and advances the originating chats point in one transaction. This boundary binds human review and audit evidence to the exact agent call and installation target. */
|
|
5
|
+
export declare function pluginManagementRequestCreateUninstall(executor: DrizzleExecutor, input: {
|
|
6
|
+
id: string;
|
|
7
|
+
actorUserId: string;
|
|
8
|
+
agentUserId: string;
|
|
9
|
+
callId: string;
|
|
10
|
+
chatId: string;
|
|
11
|
+
requesterInstallationId: string;
|
|
12
|
+
targetInstallationId: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
shortName: string;
|
|
15
|
+
description: string;
|
|
16
|
+
reason?: string;
|
|
17
|
+
source: PluginSource;
|
|
18
|
+
packageDigest: string;
|
|
19
|
+
packageDirectory: string;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
created: boolean;
|
|
22
|
+
hint?: MutationHint;
|
|
23
|
+
request: PluginManagementRequestSummary;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=pluginManagementRequestCreateUninstall.d.ts.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestCreateUninstall.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateUninstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EAAe,KAAK,8BAA8B,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjG,qQAAqQ;AACrQ,wBAAsB,sCAAsC,CACxD,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE;IACH,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC5B,GACF,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,8BAA8B,CAAA;CAAE,CAAC,CA4E7F"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { and, eq } from "drizzle-orm";
|
|
2
|
+
import { withTransaction } from "../drizzle.js";
|
|
3
|
+
import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
|
|
4
|
+
import { chatAppendAudit } from "../chat/chatAppendAudit.js";
|
|
5
|
+
import { chatGetAccess } from "../chat/chatGetAccess.js";
|
|
6
|
+
import { chatHint } from "../chat/chatHint.js";
|
|
7
|
+
import { pluginManagementRequests } from "../schema.js";
|
|
8
|
+
import { syncSequenceNext } from "../sync/syncSequenceNext.js";
|
|
9
|
+
import { asPluginManagementRequest } from "./impl/asManagementRequest.js";
|
|
10
|
+
import { pluginManagementRequestSelection } from "./impl/managementRequestSelection.js";
|
|
11
|
+
import { PluginError } from "./types.js";
|
|
12
|
+
/** Creates one idempotent pluginManagementRequests uninstall with a validated metadata snapshot and advances the originating chats point in one transaction. This boundary binds human review and audit evidence to the exact agent call and installation target. */
|
|
13
|
+
export async function pluginManagementRequestCreateUninstall(executor, input) {
|
|
14
|
+
return withTransaction(executor, async (tx) => {
|
|
15
|
+
if (!(await chatGetAccess(tx, input.actorUserId, input.chatId, true)))
|
|
16
|
+
throw new PluginError("forbidden", "The originating user cannot access this chat");
|
|
17
|
+
const [existing] = await tx
|
|
18
|
+
.select(pluginManagementRequestSelection)
|
|
19
|
+
.from(pluginManagementRequests)
|
|
20
|
+
.where(and(eq(pluginManagementRequests.requesterInstallationId, input.requesterInstallationId), eq(pluginManagementRequests.callId, input.callId), eq(pluginManagementRequests.action, "uninstall")))
|
|
21
|
+
.limit(1);
|
|
22
|
+
if (existing)
|
|
23
|
+
return { created: false, request: asPluginManagementRequest(existing) };
|
|
24
|
+
await tx.insert(pluginManagementRequests).values({
|
|
25
|
+
id: input.id,
|
|
26
|
+
action: "uninstall",
|
|
27
|
+
status: "pending",
|
|
28
|
+
chatId: input.chatId,
|
|
29
|
+
actorUserId: input.actorUserId,
|
|
30
|
+
agentUserId: input.agentUserId,
|
|
31
|
+
requesterInstallationId: input.requesterInstallationId,
|
|
32
|
+
callId: input.callId,
|
|
33
|
+
displayName: input.displayName,
|
|
34
|
+
shortName: input.shortName,
|
|
35
|
+
description: input.description,
|
|
36
|
+
reason: input.reason,
|
|
37
|
+
sourceKind: input.source.kind,
|
|
38
|
+
sourceReference: input.source.reference,
|
|
39
|
+
packageDigest: input.packageDigest,
|
|
40
|
+
packageDirectory: input.packageDirectory,
|
|
41
|
+
targetInstallationId: input.targetInstallationId,
|
|
42
|
+
});
|
|
43
|
+
await chatAppendAudit(tx, {
|
|
44
|
+
actorUserId: input.actorUserId,
|
|
45
|
+
action: "plugin.uninstall_requested",
|
|
46
|
+
targetType: "plugin_management_request",
|
|
47
|
+
targetId: input.id,
|
|
48
|
+
chatId: input.chatId,
|
|
49
|
+
after: {
|
|
50
|
+
agentUserId: input.agentUserId,
|
|
51
|
+
requesterInstallationId: input.requesterInstallationId,
|
|
52
|
+
targetInstallationId: input.targetInstallationId,
|
|
53
|
+
shortName: input.shortName,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
const sequence = await syncSequenceNext(tx);
|
|
57
|
+
await tx
|
|
58
|
+
.update(pluginManagementRequests)
|
|
59
|
+
.set({ syncSequence: sequence })
|
|
60
|
+
.where(eq(pluginManagementRequests.id, input.id));
|
|
61
|
+
const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, "plugin.uninstall_requested", input.id);
|
|
62
|
+
const [created] = await tx
|
|
63
|
+
.select(pluginManagementRequestSelection)
|
|
64
|
+
.from(pluginManagementRequests)
|
|
65
|
+
.where(eq(pluginManagementRequests.id, input.id))
|
|
66
|
+
.limit(1);
|
|
67
|
+
if (!created)
|
|
68
|
+
throw new Error("Plugin uninstall request projection was not found");
|
|
69
|
+
return {
|
|
70
|
+
created: true,
|
|
71
|
+
hint: chatHint(sequence, input.chatId, mutation.pts),
|
|
72
|
+
request: asPluginManagementRequest(created),
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=pluginManagementRequestCreateUninstall.js.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestCreateUninstall.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestCreateUninstall.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestCreateUninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,WAAW,EAA0D,MAAM,YAAY,CAAC;AAEjG,qQAAqQ;AACrQ,MAAM,CAAC,K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C,EAAE,CAAC,wBAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;aAChD,KAAK,CAAC,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACnF,OAAO;YACH,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;YACpD,OAAO,EAAE,yBAAyB,CAAC,OAAO,CAAC;SAC9C,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import type { MutationHint } from "../chat/types.js";
|
|
3
|
+
import type { PluginManagementRequestAction } from "./types.js";
|
|
4
|
+
/** Denies one pending pluginManagementRequests row and advances the originating chats point for a chat-member administrator in one transaction. This resolution boundary keeps authorization, audit evidence, and the reactive card state consistent. */
|
|
5
|
+
export declare function pluginManagementRequestDeny(executor: DrizzleExecutor, input: {
|
|
6
|
+
actorUserId: string;
|
|
7
|
+
chatId: string;
|
|
8
|
+
requestId: string;
|
|
9
|
+
action: PluginManagementRequestAction;
|
|
10
|
+
}): Promise<MutationHint>;
|
|
11
|
+
//# sourceMappingURL=pluginManagementRequestDeny.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestDeny.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestDeny.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEhE,yPAAyP;AACzP,wBAAsB,2BAA2B,CAC7C,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,6BAA6B,CAAC;CACzC,GACF,OAAO,CAAC,YAAY,CAAC,CAiDvB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { and, eq, sql } from "drizzle-orm";
|
|
2
|
+
import { withTransaction } from "../drizzle.js";
|
|
3
|
+
import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
|
|
4
|
+
import { chatAppendAudit } from "../chat/chatAppendAudit.js";
|
|
5
|
+
import { chatGetAccess } from "../chat/chatGetAccess.js";
|
|
6
|
+
import { chatHint } from "../chat/chatHint.js";
|
|
7
|
+
import { userRequireServerAdmin } from "../chat/userRequireServerAdmin.js";
|
|
8
|
+
import { pluginManagementRequests } from "../schema.js";
|
|
9
|
+
import { syncSequenceNext } from "../sync/syncSequenceNext.js";
|
|
10
|
+
import { PluginError } from "./types.js";
|
|
11
|
+
/** Denies one pending pluginManagementRequests row and advances the originating chats point for a chat-member administrator in one transaction. This resolution boundary keeps authorization, audit evidence, and the reactive card state consistent. */
|
|
12
|
+
export async function pluginManagementRequestDeny(executor, input) {
|
|
13
|
+
return withTransaction(executor, async (tx) => {
|
|
14
|
+
await userRequireServerAdmin(tx, input.actorUserId);
|
|
15
|
+
if (!(await chatGetAccess(tx, input.actorUserId, input.chatId, true)))
|
|
16
|
+
throw new PluginError("forbidden", "Chat membership is required");
|
|
17
|
+
const updated = await tx
|
|
18
|
+
.update(pluginManagementRequests)
|
|
19
|
+
.set({
|
|
20
|
+
status: "denied",
|
|
21
|
+
resolvedByUserId: input.actorUserId,
|
|
22
|
+
resolvedAt: sql `CURRENT_TIMESTAMP`,
|
|
23
|
+
updatedAt: sql `CURRENT_TIMESTAMP`,
|
|
24
|
+
})
|
|
25
|
+
.where(and(eq(pluginManagementRequests.id, input.requestId), eq(pluginManagementRequests.chatId, input.chatId), eq(pluginManagementRequests.action, input.action), eq(pluginManagementRequests.status, "pending")))
|
|
26
|
+
.returning({
|
|
27
|
+
id: pluginManagementRequests.id,
|
|
28
|
+
action: pluginManagementRequests.action,
|
|
29
|
+
});
|
|
30
|
+
if (updated.length !== 1)
|
|
31
|
+
throw new PluginError("conflict", `Plugin ${input.action} request is not pending`);
|
|
32
|
+
await chatAppendAudit(tx, {
|
|
33
|
+
actorUserId: input.actorUserId,
|
|
34
|
+
action: `plugin.${updated[0].action}_denied`,
|
|
35
|
+
targetType: "plugin_management_request",
|
|
36
|
+
targetId: input.requestId,
|
|
37
|
+
chatId: input.chatId,
|
|
38
|
+
});
|
|
39
|
+
const sequence = await syncSequenceNext(tx);
|
|
40
|
+
await tx
|
|
41
|
+
.update(pluginManagementRequests)
|
|
42
|
+
.set({ syncSequence: sequence })
|
|
43
|
+
.where(eq(pluginManagementRequests.id, input.requestId));
|
|
44
|
+
const mutation = await chatAdvanceWithSequence(tx, sequence, input.actorUserId, input.chatId, `plugin.${updated[0].action}_denied`, input.requestId);
|
|
45
|
+
return chatHint(sequence, input.chatId, mutation.pts);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=pluginManagementRequestDeny.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestDeny.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestDeny.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAA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CAAC,MAAM;SAC1C,CAAC,CAAC;QACP,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YACpB,MAAM,IAAI,WAAW,CAAC,UAAU,EAAE,UAAU,KAAK,CAAC,MAAM,yBAAyB,CAAC,CAAC;QACvF,MAAM,eAAe,CAAC,EAAE,EAAE;YACtB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,MAAM,EAAE,UAAU,OAAO,CAAC,CAAC,CAAE,CAAC,MAAM,SAAS;YAC7C,UAAU,EAAE,2BAA2B;YACvC,QAAQ,EAAE,KAAK,CAAC,SAAS;YACzB,MAAM,EAAE,KAAK,CAAC,MAAM;SACvB,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,EAAE;aACH,MAAM,CAAC,wBAAwB,CAAC;aAChC,GAAG,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;aAC/B,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAC7D,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAC1C,EAAE,EACF,QAAQ,EACR,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,MAAM,EACZ,UAAU,OAAO,CAAC,CAAC,CAAE,CAAC,MAAM,SAAS,EACrC,KAAK,CAAC,SAAS,CAClB,CAAC;QACF,OAAO,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import { type PluginSource } from "./types.js";
|
|
3
|
+
export interface PluginManagementRequestPackage {
|
|
4
|
+
id: string;
|
|
5
|
+
chatId: string;
|
|
6
|
+
packageDigest: string;
|
|
7
|
+
packageDirectory: string;
|
|
8
|
+
source: PluginSource;
|
|
9
|
+
}
|
|
10
|
+
/** Returns the private staged-package coordinates for one visible approval and does not mutate durable state. This boundary lets the package store integrity-check an image or approved operation without exposing filesystem paths through routes. */
|
|
11
|
+
export declare function pluginManagementRequestGetPackage(executor: DrizzleExecutor, actorUserId: string, chatId: string, requestId: string): Promise<PluginManagementRequestPackage>;
|
|
12
|
+
//# sourceMappingURL=pluginManagementRequestGetPackage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestGetPackage.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestGetPackage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,8BAA8B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,uPAAuP;AACvP,wBAAsB,iCAAiC,CACnD,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,8BAA8B,CAAC,CAyCzC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { and, eq } from "drizzle-orm";
|
|
2
|
+
import { chatGetAccess } from "../chat/chatGetAccess.js";
|
|
3
|
+
import { pluginManagementRequests } from "../schema.js";
|
|
4
|
+
import { PluginError } from "./types.js";
|
|
5
|
+
/** Returns the private staged-package coordinates for one visible approval and does not mutate durable state. This boundary lets the package store integrity-check an image or approved operation without exposing filesystem paths through routes. */
|
|
6
|
+
export async function pluginManagementRequestGetPackage(executor, actorUserId, chatId, requestId) {
|
|
7
|
+
if (!(await chatGetAccess(executor, actorUserId, chatId, true)))
|
|
8
|
+
throw new PluginError("forbidden", "Chat membership is required");
|
|
9
|
+
const [row] = await executor
|
|
10
|
+
.select({
|
|
11
|
+
id: pluginManagementRequests.id,
|
|
12
|
+
chatId: pluginManagementRequests.chatId,
|
|
13
|
+
action: pluginManagementRequests.action,
|
|
14
|
+
status: pluginManagementRequests.status,
|
|
15
|
+
sourceKind: pluginManagementRequests.sourceKind,
|
|
16
|
+
sourceReference: pluginManagementRequests.sourceReference,
|
|
17
|
+
packageDigest: pluginManagementRequests.packageDigest,
|
|
18
|
+
packageDirectory: pluginManagementRequests.packageDirectory,
|
|
19
|
+
})
|
|
20
|
+
.from(pluginManagementRequests)
|
|
21
|
+
.where(and(eq(pluginManagementRequests.id, requestId), eq(pluginManagementRequests.chatId, chatId)))
|
|
22
|
+
.limit(1);
|
|
23
|
+
if (!row)
|
|
24
|
+
throw new PluginError("not_found", "Plugin management request was not found");
|
|
25
|
+
if (row.status !== "pending" && row.status !== "processing")
|
|
26
|
+
throw new PluginError("not_found", "Plugin management request image is no longer retained");
|
|
27
|
+
if ((row.sourceKind !== "archive" &&
|
|
28
|
+
row.sourceKind !== "builtin" &&
|
|
29
|
+
row.sourceKind !== "link") ||
|
|
30
|
+
!row.sourceReference ||
|
|
31
|
+
!row.packageDigest ||
|
|
32
|
+
!row.packageDirectory)
|
|
33
|
+
throw new Error("Plugin management request has incomplete package metadata");
|
|
34
|
+
return {
|
|
35
|
+
id: row.id,
|
|
36
|
+
chatId: row.chatId,
|
|
37
|
+
packageDigest: row.packageDigest,
|
|
38
|
+
packageDirectory: row.packageDirectory,
|
|
39
|
+
source: { kind: row.sourceKind, reference: row.sourceReference },
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=pluginManagementRequestGetPackage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestGetPackage.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginMan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MAAM,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,YAAY;QACvD,MAAM,IAAI,WAAW,CAAC,WAAW,EAAE,uDAAuD,CAAC,CAAC;IAChG,IACI,CAAC,GAAG,CAAC,UAAU,KAAK,SAAS;QACzB,GAAG,CAAC,UAAU,KAAK,SAAS;QAC5B,GAAG,CAAC,UAAU,KAAK,MAAM,CAAC;QAC9B,CAAC,GAAG,CAAC,eAAe;QACpB,CAAC,GAAG,CAAC,aAAa;QAClB,CAAC,GAAG,CAAC,gBAAgB;QAErB,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IACjF,OAAO;QACH,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;QACtC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,CAAC,eAAe,EAAE;KACnE,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import { type PluginManagementRequestSummary } from "./types.js";
|
|
3
|
+
/** Lists durable plugin approval cards for one accessible chat and does not mutate durable state. This projection boundary requires active membership while excluding staged filesystem paths and other private package internals. */
|
|
4
|
+
export declare function pluginManagementRequestList(executor: DrizzleExecutor, actorUserId: string, chatId: string): Promise<PluginManagementRequestSummary[]>;
|
|
5
|
+
//# sourceMappingURL=pluginManagementRequestList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestList.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestList.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,OAAO,EAAe,KAAK,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAE9E,sOAAsO;AACtO,wBAAsB,2BAA2B,CAC7C,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,8BAA8B,EAAE,CAAC,CAS3C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { desc, eq } from "drizzle-orm";
|
|
2
|
+
import { chatGetAccess } from "../chat/chatGetAccess.js";
|
|
3
|
+
import { pluginManagementRequests } from "../schema.js";
|
|
4
|
+
import { asPluginManagementRequest } from "./impl/asManagementRequest.js";
|
|
5
|
+
import { pluginManagementRequestSelection } from "./impl/managementRequestSelection.js";
|
|
6
|
+
import { PluginError } from "./types.js";
|
|
7
|
+
/** Lists durable plugin approval cards for one accessible chat and does not mutate durable state. This projection boundary requires active membership while excluding staged filesystem paths and other private package internals. */
|
|
8
|
+
export async function pluginManagementRequestList(executor, actorUserId, chatId) {
|
|
9
|
+
if (!(await chatGetAccess(executor, actorUserId, chatId, true)))
|
|
10
|
+
throw new PluginError("forbidden", "Chat membership is required");
|
|
11
|
+
const rows = await executor
|
|
12
|
+
.select(pluginManagementRequestSelection)
|
|
13
|
+
.from(pluginManagementRequests)
|
|
14
|
+
.where(eq(pluginManagementRequests.chatId, chatId))
|
|
15
|
+
.orderBy(desc(pluginManagementRequests.createdAt), desc(pluginManagementRequests.id));
|
|
16
|
+
return rows.map(asPluginManagementRequest);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=pluginManagementRequestList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestList.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAuC,MAAM,YAAY,CAAC;AAE9E,sOAAsO;AACtO,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC7C,QAAyB,EACzB,WAAmB,EACnB,MAAc;IAEd,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3D,MAAM,IAAI,WAAW,CAAC,WAAW,EAAE,6BAA6B,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,MAAM,QAAQ;SACtB,MAAM,CAAC,gCAAgC,CAAC;SACxC,IAAI,CAAC,wBAAwB,CAAC;SAC9B,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAClD,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1F,OAAO,IAAI,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAC/C,CAAC"}
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
/** Lists terminal pluginManagementRequests whose staged package directories can be reclaimed and does not mutate durable state. This restart-cleanup boundary prevents resolved approval snapshots from accumulating after a process stops between resolution and filesystem cleanup. */
|
|
3
|
+
export declare function pluginManagementRequestListTerminalIds(executor: DrizzleExecutor): Promise<string[]>;
|
|
4
|
+
//# sourceMappingURL=pluginManagementRequestListTerminalIds.d.ts.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestListTerminalIds.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestListTerminalIds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,yRAAyR;AACzR,wBAAsB,sCAAsC,CACxD,QAAQ,EAAE,eAAe,GAC1B,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { inArray } from "drizzle-orm";
|
|
2
|
+
import { pluginManagementRequests } from "../schema.js";
|
|
3
|
+
/** Lists terminal pluginManagementRequests whose staged package directories can be reclaimed and does not mutate durable state. This restart-cleanup boundary prevents resolved approval snapshots from accumulating after a process stops between resolution and filesystem cleanup. */
|
|
4
|
+
export async function pluginManagementRequestListTerminalIds(executor) {
|
|
5
|
+
const rows = await executor
|
|
6
|
+
.select({ id: pluginManagementRequests.id })
|
|
7
|
+
.from(pluginManagementRequests)
|
|
8
|
+
.where(inArray(pluginManagementRequests.status, ["approved", "denied", "failed"]));
|
|
9
|
+
return rows.map(({ id }) => id);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=pluginManagementRequestListTerminalIds.js.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestListTerminalIds.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestListTerminalIds.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestListTerminalIds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,yRAAyR;AACzR,MAAM,CAAC,KAAK,UAAU,sCAAsC,CACxD,QAAyB;IAEzB,MAAM,IAAI,GAAG,MAAM,QAAQ;SACtB,MAAM,CAAC,EAAE,EAAE,EAAE,wBAAwB,CAAC,EAAE,EAAE,CAAC;SAC3C,IAAI,CAAC,wBAAwB,CAAC;SAC9B,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC"}
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import type { MutationHint } from "../chat/types.js";
|
|
3
|
+
/** Resolves pluginManagementRequests left processing by a stopped complete-server process according to the durable installation outcome. This restart boundary prevents approval cards from remaining permanently claimed while preserving audit and reactive chat evidence for the recovered terminal state. */
|
|
4
|
+
export declare function pluginManagementRequestRecoverProcessing(executor: DrizzleExecutor): Promise<MutationHint[]>;
|
|
5
|
+
//# sourceMappingURL=pluginManagementRequestRecoverProcessing.d.ts.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestRecoverProcessing.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestRecoverProcessing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,iTAAiT;AACjT,wBAAsB,wCAAwC,CAC1D,QAAQ,EAAE,eAAe,GAC1B,OAAO,CAAC,YAAY,EAAE,CAAC,CA+EzB"}
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { and, eq, sql } from "drizzle-orm";
|
|
2
|
+
import { withTransaction } from "../drizzle.js";
|
|
3
|
+
import { chatAdvanceWithSequence } from "../chat/chatAdvanceWithSequence.js";
|
|
4
|
+
import { chatAppendAudit } from "../chat/chatAppendAudit.js";
|
|
5
|
+
import { chatHint } from "../chat/chatHint.js";
|
|
6
|
+
import { pluginInstallations, pluginManagementRequests } from "../schema.js";
|
|
7
|
+
import { syncSequenceNext } from "../sync/syncSequenceNext.js";
|
|
8
|
+
/** Resolves pluginManagementRequests left processing by a stopped complete-server process according to the durable installation outcome. This restart boundary prevents approval cards from remaining permanently claimed while preserving audit and reactive chat evidence for the recovered terminal state. */
|
|
9
|
+
export async function pluginManagementRequestRecoverProcessing(executor) {
|
|
10
|
+
return withTransaction(executor, async (tx) => {
|
|
11
|
+
const rows = await tx
|
|
12
|
+
.select({
|
|
13
|
+
id: pluginManagementRequests.id,
|
|
14
|
+
action: pluginManagementRequests.action,
|
|
15
|
+
chatId: pluginManagementRequests.chatId,
|
|
16
|
+
installationId: pluginManagementRequests.installationId,
|
|
17
|
+
targetInstallationId: pluginManagementRequests.targetInstallationId,
|
|
18
|
+
resolvedByUserId: pluginManagementRequests.resolvedByUserId,
|
|
19
|
+
})
|
|
20
|
+
.from(pluginManagementRequests)
|
|
21
|
+
.where(eq(pluginManagementRequests.status, "processing"));
|
|
22
|
+
const hints = [];
|
|
23
|
+
for (const row of rows) {
|
|
24
|
+
if (row.action !== "install" && row.action !== "uninstall")
|
|
25
|
+
throw new Error(`Unknown processing plugin request action ${row.action}`);
|
|
26
|
+
const durableId = row.action === "install" ? row.installationId : row.targetInstallationId;
|
|
27
|
+
const [installation] = durableId
|
|
28
|
+
? await tx
|
|
29
|
+
.select({ id: pluginInstallations.id })
|
|
30
|
+
.from(pluginInstallations)
|
|
31
|
+
.where(eq(pluginInstallations.id, durableId))
|
|
32
|
+
.limit(1)
|
|
33
|
+
: [];
|
|
34
|
+
const approved = row.action === "install"
|
|
35
|
+
? Boolean(row.installationId && installation)
|
|
36
|
+
: row.action === "uninstall"
|
|
37
|
+
? Boolean(row.targetInstallationId && !installation)
|
|
38
|
+
: false;
|
|
39
|
+
const error = approved
|
|
40
|
+
? undefined
|
|
41
|
+
: "The server stopped before the plugin operation completed.";
|
|
42
|
+
const updated = await tx
|
|
43
|
+
.update(pluginManagementRequests)
|
|
44
|
+
.set({
|
|
45
|
+
status: approved ? "approved" : "failed",
|
|
46
|
+
lastError: error,
|
|
47
|
+
resolvedAt: sql `CURRENT_TIMESTAMP`,
|
|
48
|
+
updatedAt: sql `CURRENT_TIMESTAMP`,
|
|
49
|
+
})
|
|
50
|
+
.where(and(eq(pluginManagementRequests.id, row.id), eq(pluginManagementRequests.status, "processing")))
|
|
51
|
+
.returning({ id: pluginManagementRequests.id });
|
|
52
|
+
if (updated.length !== 1)
|
|
53
|
+
throw new Error("Processing plugin management request disappeared during recovery");
|
|
54
|
+
const action = `plugin.${row.action}_${approved ? "approved" : "failed"}`;
|
|
55
|
+
if (row.resolvedByUserId)
|
|
56
|
+
await chatAppendAudit(tx, {
|
|
57
|
+
actorUserId: row.resolvedByUserId,
|
|
58
|
+
action,
|
|
59
|
+
targetType: "plugin_management_request",
|
|
60
|
+
targetId: row.id,
|
|
61
|
+
chatId: row.chatId,
|
|
62
|
+
after: { recoveredAfterRestart: true, ...(error ? { error } : {}) },
|
|
63
|
+
});
|
|
64
|
+
const sequence = await syncSequenceNext(tx);
|
|
65
|
+
await tx
|
|
66
|
+
.update(pluginManagementRequests)
|
|
67
|
+
.set({ syncSequence: sequence })
|
|
68
|
+
.where(eq(pluginManagementRequests.id, row.id));
|
|
69
|
+
const mutation = await chatAdvanceWithSequence(tx, sequence, row.resolvedByUserId ?? undefined, row.chatId, action, row.id);
|
|
70
|
+
hints.push(chatHint(sequence, row.chatId, mutation.pts));
|
|
71
|
+
}
|
|
72
|
+
return hints;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=pluginManagementRequestRecoverProcessing.js.map
|
package/packages/happy2-server/dist/modules/plugin/pluginManagementRequestRecoverProcessing.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManagementRequestRecoverProcessing.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginManagementRequestRecoverProcessing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,iTAAiT;AACjT,MAAM,CAAC,KAAK,UAAU,wCAAwC,CAC1D,QAAyB;IAEzB,OAAO,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,MAAM,EAAE;aAChB,MAAM,CAAC;YACJ,EAAE,EAAE,wBAAwB,CAAC,EAAE;YAC/B,MAAM,EAAE,wBAAwB,CAAC,MAAM;YACvC,MAAM,EAAE,wBAAwB,CAAC,MAAM;YACvC,cAAc,EAAE,wBAAwB,CAAC,cAAc;YACvD,oBAAoB,EAAE,wBAAwB,CAAC,oBAAoB;YACnE,gBAAgB,EAAE,wBAAwB,CAAC,gBAAgB;SAC9D,CAAC;aACD,IAAI,CAAC,wBAAwB,CAAC;aAC9B,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;QAC9D,MAAM,KAAK,GAAmB,EAAE,CAAC;QACjC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC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C,GAAG,CAAC,MAAM,EACV,MAAM,EACN,GAAG,CAAC,EAAE,CACT,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import type { PluginSource } from "./types.js";
|
|
3
|
+
export interface PluginReadySkillPackage {
|
|
4
|
+
pluginId: string;
|
|
5
|
+
shortName: string;
|
|
6
|
+
packageDigest: string;
|
|
7
|
+
packageDirectory: string;
|
|
8
|
+
source: PluginSource;
|
|
9
|
+
}
|
|
10
|
+
/** Lists each durable plugin package with at least one ready installation and does not mutate durable state. This worker boundary exposes only immutable package coordinates needed to reconcile skills into an isolated agent home. */
|
|
11
|
+
export declare function pluginSkillPackageListReady(executor: DrizzleExecutor): Promise<PluginReadySkillPackage[]>;
|
|
12
|
+
//# sourceMappingURL=pluginSkillPackageListReady.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginSkillPackageListReady.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginSkillPackageListReady.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,wOAAwO;AACxO,wBAAsB,2BAA2B,CAC7C,QAAQ,EAAE,eAAe,GAC1B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CA8BpC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { eq } from "drizzle-orm";
|
|
2
|
+
import { pluginInstallations, plugins } from "../schema.js";
|
|
3
|
+
/** Lists each durable plugin package with at least one ready installation and does not mutate durable state. This worker boundary exposes only immutable package coordinates needed to reconcile skills into an isolated agent home. */
|
|
4
|
+
export async function pluginSkillPackageListReady(executor) {
|
|
5
|
+
const rows = await executor
|
|
6
|
+
.select({
|
|
7
|
+
pluginId: plugins.id,
|
|
8
|
+
shortName: plugins.shortName,
|
|
9
|
+
packageDigest: plugins.packageDigest,
|
|
10
|
+
packageDirectory: plugins.packageDirectory,
|
|
11
|
+
sourceKind: plugins.sourceKind,
|
|
12
|
+
sourceReference: plugins.sourceReference,
|
|
13
|
+
})
|
|
14
|
+
.from(plugins)
|
|
15
|
+
.innerJoin(pluginInstallations, eq(pluginInstallations.pluginId, plugins.id))
|
|
16
|
+
.where(eq(pluginInstallations.status, "ready"))
|
|
17
|
+
.groupBy(plugins.id)
|
|
18
|
+
.orderBy(plugins.shortName, plugins.id);
|
|
19
|
+
return rows.map((row) => {
|
|
20
|
+
if (row.sourceKind !== "builtin" &&
|
|
21
|
+
row.sourceKind !== "archive" &&
|
|
22
|
+
row.sourceKind !== "link")
|
|
23
|
+
throw new Error(`Unknown plugin source kind ${row.sourceKind}`);
|
|
24
|
+
return {
|
|
25
|
+
pluginId: row.pluginId,
|
|
26
|
+
shortName: row.shortName,
|
|
27
|
+
packageDigest: row.packageDigest,
|
|
28
|
+
packageDirectory: row.packageDirectory,
|
|
29
|
+
source: { kind: row.sourceKind, reference: row.sourceReference },
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=pluginSkillPackageListReady.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginSkillPackageListReady.js","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginSkillPackageListReady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YACtC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,CAAC,eAAe,EAAE;SACnE,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DrizzleExecutor } from "../drizzle.js";
|
|
2
|
+
import type { PluginSkillSourceRecord } from "./impl/pluginSkillSource.js";
|
|
3
|
+
/**
|
|
4
|
+
* Lists durable skill metadata for plugin packages that still have an installation so a previously accepted Rig callback remains resolvable across runtime status changes and server restarts.
|
|
5
|
+
* Distinct projection keeps repeated installations from making one static skill ambiguous while package deletion remains authoritative revocation.
|
|
6
|
+
*/
|
|
7
|
+
export declare function pluginSkillsListInstalled(executor: DrizzleExecutor): Promise<PluginSkillSourceRecord[]>;
|
|
8
|
+
//# sourceMappingURL=pluginSkillsListInstalled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginSkillsListInstalled.d.ts","sourceRoot":"","sources":["../../../sources/modules/plugin/pluginSkillsListInstalled.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;;GAGG;AACH,wBAAsB,yBAAyB,CAC3C,QAAQ,EAAE,eAAe,GAC1B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAgBpC"}
|