@downcity/plugins 1.0.216 → 1.0.236
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/bin/chat/Action.d.ts +51 -51
- package/bin/chat/Action.d.ts.map +1 -1
- package/bin/chat/Action.js +109 -108
- package/bin/chat/Action.js.map +1 -1
- package/bin/chat/ChatPlugin.d.ts +7 -7
- package/bin/chat/ChatPlugin.d.ts.map +1 -1
- package/bin/chat/ChatPlugin.js +4 -4
- package/bin/chat/ChatPlugin.js.map +1 -1
- package/bin/chat/Index.d.ts +3 -0
- package/bin/chat/Index.d.ts.map +1 -1
- package/bin/chat/Index.js +1 -0
- package/bin/chat/Index.js.map +1 -1
- package/bin/chat/PROMPT.direct.d.ts +1 -1
- package/bin/chat/PROMPT.direct.d.ts.map +1 -1
- package/bin/chat/PROMPT.direct.js +1 -1
- package/bin/chat/PROMPT.direct.js.map +1 -1
- package/bin/chat/access/ChatAccessActions.js +6 -6
- package/bin/chat/access/ChatAccessActions.js.map +1 -1
- package/bin/chat/access/ChatAccessRuntime.d.ts +4 -4
- package/bin/chat/access/ChatAccessRuntime.d.ts.map +1 -1
- package/bin/chat/access/ChatAccessRuntime.js +1 -1
- package/bin/chat/access/ChatAccessRuntime.js.map +1 -1
- package/bin/chat/access/ChatAccessStore.js +5 -5
- package/bin/chat/access/ChatAccessStore.js.map +1 -1
- package/bin/chat/channels/BaseChatChannel.d.ts +17 -17
- package/bin/chat/channels/BaseChatChannel.d.ts.map +1 -1
- package/bin/chat/channels/BaseChatChannel.js +19 -19
- package/bin/chat/channels/BaseChatChannel.js.map +1 -1
- package/bin/chat/channels/BaseChatChannelQueue.d.ts +6 -6
- package/bin/chat/channels/BaseChatChannelQueue.d.ts.map +1 -1
- package/bin/chat/channels/BaseChatChannelQueue.js +32 -32
- package/bin/chat/channels/BaseChatChannelQueue.js.map +1 -1
- package/bin/chat/channels/BaseChatChannelSupport.d.ts +14 -14
- package/bin/chat/channels/BaseChatChannelSupport.d.ts.map +1 -1
- package/bin/chat/channels/BaseChatChannelSupport.js +13 -13
- package/bin/chat/channels/BaseChatChannelSupport.js.map +1 -1
- package/bin/chat/channels/RuntimeChannel.d.ts +23 -28
- package/bin/chat/channels/RuntimeChannel.d.ts.map +1 -1
- package/bin/chat/channels/RuntimeChannel.js +39 -57
- package/bin/chat/channels/RuntimeChannel.js.map +1 -1
- package/bin/chat/channels/feishu/Feishu.d.ts +7 -7
- package/bin/chat/channels/feishu/Feishu.d.ts.map +1 -1
- package/bin/chat/channels/feishu/Feishu.js +31 -31
- package/bin/chat/channels/feishu/Feishu.js.map +1 -1
- package/bin/chat/channels/feishu/FeishuInbound.js +3 -3
- package/bin/chat/channels/feishu/FeishuInbound.js.map +1 -1
- package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts +10 -10
- package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts.map +1 -1
- package/bin/chat/channels/feishu/FeishuMessageHandler.js +17 -17
- package/bin/chat/channels/feishu/FeishuMessageHandler.js.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts +6 -6
- package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformClient.js +9 -9
- package/bin/chat/channels/feishu/FeishuPlatformClient.js.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformLookup.js +6 -6
- package/bin/chat/channels/feishu/FeishuPlatformLookup.js.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts +2 -2
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.js +7 -7
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.js.map +1 -1
- package/bin/chat/channels/feishu/InboundAttachment.d.ts +1 -1
- package/bin/chat/channels/feishu/InboundAttachment.d.ts.map +1 -1
- package/bin/chat/channels/feishu/InboundAttachment.js +5 -5
- package/bin/chat/channels/feishu/InboundAttachment.js.map +1 -1
- package/bin/chat/channels/feishu/PostMessage.js +8 -8
- package/bin/chat/channels/feishu/PostMessage.js.map +1 -1
- package/bin/chat/channels/feishu/ReplyContext.d.ts +1 -1
- package/bin/chat/channels/feishu/ReplyContext.d.ts.map +1 -1
- package/bin/chat/channels/feishu/ReplyContext.js +2 -2
- package/bin/chat/channels/feishu/ReplyContext.js.map +1 -1
- package/bin/chat/channels/feishu/Shared.js +3 -3
- package/bin/chat/channels/feishu/Shared.js.map +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.d.ts +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.d.ts.map +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.js +1 -1
- package/bin/chat/channels/qq/PROMPT.direct.js.map +1 -1
- package/bin/chat/channels/qq/QQ.d.ts +3 -3
- package/bin/chat/channels/qq/QQ.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQ.js +20 -20
- package/bin/chat/channels/qq/QQ.js.map +1 -1
- package/bin/chat/channels/qq/QQEventCapture.d.ts +1 -1
- package/bin/chat/channels/qq/QQEventCapture.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQEventCapture.js +3 -3
- package/bin/chat/channels/qq/QQEventCapture.js.map +1 -1
- package/bin/chat/channels/qq/QQGatewayAuth.d.ts +1 -1
- package/bin/chat/channels/qq/QQGatewayAuth.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQGatewayClient.d.ts +2 -2
- package/bin/chat/channels/qq/QQGatewayClient.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQGatewayClient.js +11 -11
- package/bin/chat/channels/qq/QQGatewayClient.js.map +1 -1
- package/bin/chat/channels/qq/QQGatewayConnection.d.ts +1 -1
- package/bin/chat/channels/qq/QQGatewayConnection.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQGatewaySend.d.ts +2 -2
- package/bin/chat/channels/qq/QQGatewaySend.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQGatewaySend.js +3 -3
- package/bin/chat/channels/qq/QQGatewaySend.js.map +1 -1
- package/bin/chat/channels/qq/QQInbound.js +5 -5
- package/bin/chat/channels/qq/QQInbound.js.map +1 -1
- package/bin/chat/channels/qq/QQInboundDedupe.d.ts +2 -2
- package/bin/chat/channels/qq/QQInboundDedupe.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQInboundDedupe.js +5 -5
- package/bin/chat/channels/qq/QQInboundDedupe.js.map +1 -1
- package/bin/chat/channels/qq/QQMessageHandler.d.ts +9 -9
- package/bin/chat/channels/qq/QQMessageHandler.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQMessageHandler.js +34 -34
- package/bin/chat/channels/qq/QQMessageHandler.js.map +1 -1
- package/bin/chat/channels/qq/QQSendSupport.js +2 -2
- package/bin/chat/channels/qq/QQSendSupport.js.map +1 -1
- package/bin/chat/channels/qq/QQSupport.d.ts +5 -5
- package/bin/chat/channels/qq/QQSupport.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQSupport.js +5 -5
- package/bin/chat/channels/qq/QQSupport.js.map +1 -1
- package/bin/chat/channels/qq/types/QqChannel.d.ts +1 -1
- package/bin/chat/channels/qq/types/QqChannel.d.ts.map +1 -1
- package/bin/chat/channels/telegram/ApiClient.d.ts +2 -2
- package/bin/chat/channels/telegram/ApiClient.d.ts.map +1 -1
- package/bin/chat/channels/telegram/ApiClient.js +6 -6
- package/bin/chat/channels/telegram/ApiClient.js.map +1 -1
- package/bin/chat/channels/telegram/Bot.d.ts +4 -4
- package/bin/chat/channels/telegram/Bot.d.ts.map +1 -1
- package/bin/chat/channels/telegram/Bot.js +14 -14
- package/bin/chat/channels/telegram/Bot.js.map +1 -1
- package/bin/chat/channels/telegram/BotInfo.js +1 -1
- package/bin/chat/channels/telegram/BotInfo.js.map +1 -1
- package/bin/chat/channels/telegram/ReplyContext.js +3 -3
- package/bin/chat/channels/telegram/ReplyContext.js.map +1 -1
- package/bin/chat/channels/telegram/Shared.js +3 -3
- package/bin/chat/channels/telegram/Shared.js.map +1 -1
- package/bin/chat/channels/telegram/StateStore.d.ts +1 -1
- package/bin/chat/channels/telegram/StateStore.d.ts.map +1 -1
- package/bin/chat/channels/telegram/StateStore.js +2 -2
- package/bin/chat/channels/telegram/StateStore.js.map +1 -1
- package/bin/chat/channels/telegram/TelegramInbound.d.ts +3 -3
- package/bin/chat/channels/telegram/TelegramInbound.d.ts.map +1 -1
- package/bin/chat/channels/telegram/TelegramInbound.js +4 -4
- package/bin/chat/channels/telegram/TelegramInbound.js.map +1 -1
- package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts +8 -8
- package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts.map +1 -1
- package/bin/chat/channels/telegram/TelegramMessageHandler.js +25 -25
- package/bin/chat/channels/telegram/TelegramMessageHandler.js.map +1 -1
- package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts +2 -2
- package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts.map +1 -1
- package/bin/chat/channels/telegram/TelegramPendingUpdates.js +7 -7
- package/bin/chat/channels/telegram/TelegramPendingUpdates.js.map +1 -1
- package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts +4 -4
- package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts.map +1 -1
- package/bin/chat/channels/telegram/TelegramPlatformClient.js +7 -7
- package/bin/chat/channels/telegram/TelegramPlatformClient.js.map +1 -1
- package/bin/chat/config/ChatPluginConfig.d.ts +67 -0
- package/bin/chat/config/ChatPluginConfig.d.ts.map +1 -0
- package/bin/chat/config/ChatPluginConfig.js +237 -0
- package/bin/chat/config/ChatPluginConfig.js.map +1 -0
- package/bin/chat/runtime/ChannelContextStore.d.ts +21 -21
- package/bin/chat/runtime/ChannelContextStore.d.ts.map +1 -1
- package/bin/chat/runtime/ChannelContextStore.js +74 -74
- package/bin/chat/runtime/ChannelContextStore.js.map +1 -1
- package/bin/chat/runtime/ChatActionExecution.d.ts +23 -23
- package/bin/chat/runtime/ChatActionExecution.d.ts.map +1 -1
- package/bin/chat/runtime/ChatActionExecution.js +70 -70
- package/bin/chat/runtime/ChatActionExecution.js.map +1 -1
- package/bin/chat/runtime/ChatActionInput.js +19 -19
- package/bin/chat/runtime/ChatActionInput.js.map +1 -1
- package/bin/chat/runtime/ChatChannelActions.d.ts +4 -4
- package/bin/chat/runtime/ChatChannelActions.d.ts.map +1 -1
- package/bin/chat/runtime/ChatChannelConfig.d.ts +4 -4
- package/bin/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
- package/bin/chat/runtime/ChatChannelConfig.js +9 -9
- package/bin/chat/runtime/ChatChannelConfig.js.map +1 -1
- package/bin/chat/runtime/ChatChannelCore.d.ts +11 -12
- package/bin/chat/runtime/ChatChannelCore.d.ts.map +1 -1
- package/bin/chat/runtime/ChatChannelCore.js +5 -17
- package/bin/chat/runtime/ChatChannelCore.js.map +1 -1
- package/bin/chat/runtime/ChatChannelLifecycle.d.ts +3 -3
- package/bin/chat/runtime/ChatChannelLifecycle.d.ts.map +1 -1
- package/bin/chat/runtime/ChatChannelLifecycle.js +5 -5
- package/bin/chat/runtime/ChatChannelLifecycle.js.map +1 -1
- package/bin/chat/runtime/ChatHistoryStore.d.ts +11 -11
- package/bin/chat/runtime/ChatHistoryStore.d.ts.map +1 -1
- package/bin/chat/runtime/ChatHistoryStore.js +26 -26
- package/bin/chat/runtime/ChatHistoryStore.js.map +1 -1
- package/bin/chat/runtime/ChatIngressStore.d.ts +4 -4
- package/bin/chat/runtime/ChatIngressStore.d.ts.map +1 -1
- package/bin/chat/runtime/ChatIngressStore.js +2 -2
- package/bin/chat/runtime/ChatIngressStore.js.map +1 -1
- package/bin/chat/runtime/ChatMetaStore.d.ts +19 -19
- package/bin/chat/runtime/ChatMetaStore.d.ts.map +1 -1
- package/bin/chat/runtime/ChatMetaStore.js +27 -27
- package/bin/chat/runtime/ChatMetaStore.js.map +1 -1
- package/bin/chat/runtime/ChatPluginActionRegistry.d.ts.map +1 -1
- package/bin/chat/runtime/ChatPluginActionRegistry.js +53 -59
- package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -1
- package/bin/chat/runtime/ChatPluginSystem.d.ts +4 -4
- package/bin/chat/runtime/ChatPluginSystem.d.ts.map +1 -1
- package/bin/chat/runtime/ChatPluginSystem.js +5 -5
- package/bin/chat/runtime/ChatPluginSystem.js.map +1 -1
- package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts +6 -6
- package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts.map +1 -1
- package/bin/chat/runtime/ChatQueueReplyDispatch.js +41 -41
- package/bin/chat/runtime/ChatQueueReplyDispatch.js.map +1 -1
- package/bin/chat/runtime/ChatQueueStore.d.ts +3 -3
- package/bin/chat/runtime/ChatQueueStore.d.ts.map +1 -1
- package/bin/chat/runtime/ChatQueueStore.js +2 -2
- package/bin/chat/runtime/ChatQueueStore.js.map +1 -1
- package/bin/chat/runtime/ChatQueueWorker.d.ts +2 -2
- package/bin/chat/runtime/ChatQueueWorker.d.ts.map +1 -1
- package/bin/chat/runtime/ChatQueueWorker.js +30 -32
- package/bin/chat/runtime/ChatQueueWorker.js.map +1 -1
- package/bin/chat/runtime/ChatQueueWorkerSupport.d.ts +1 -1
- package/bin/chat/runtime/ChatQueueWorkerSupport.js +15 -15
- package/bin/chat/runtime/ChatQueueWorkerSupport.js.map +1 -1
- package/bin/chat/runtime/ChatSendActionInput.js +51 -51
- package/bin/chat/runtime/ChatSendActionInput.js.map +1 -1
- package/bin/chat/runtime/ChatSendMetadata.d.ts +1 -1
- package/bin/chat/runtime/ChatSendMetadata.js +12 -12
- package/bin/chat/runtime/ChatSendMetadata.js.map +1 -1
- package/bin/chat/runtime/ChatSendRegistry.d.ts +1 -1
- package/bin/chat/runtime/ChatSessionDelete.d.ts +7 -7
- package/bin/chat/runtime/ChatSessionDelete.d.ts.map +1 -1
- package/bin/chat/runtime/ChatSessionDelete.js +15 -15
- package/bin/chat/runtime/ChatSessionDelete.js.map +1 -1
- package/bin/chat/runtime/ChatStorage.d.ts +1 -1
- package/bin/chat/runtime/ChatStorage.js +3 -3
- package/bin/chat/runtime/ChatStorage.js.map +1 -1
- package/bin/chat/runtime/ChatkeySend.d.ts +21 -21
- package/bin/chat/runtime/ChatkeySend.d.ts.map +1 -1
- package/bin/chat/runtime/ChatkeySend.js +33 -33
- package/bin/chat/runtime/ChatkeySend.js.map +1 -1
- package/bin/chat/runtime/DirectDispatchParser.d.ts +2 -2
- package/bin/chat/runtime/DirectDispatchParser.js +20 -20
- package/bin/chat/runtime/DirectDispatchParser.js.map +1 -1
- package/bin/chat/runtime/EnqueueDispatch.d.ts +3 -3
- package/bin/chat/runtime/EnqueueDispatch.d.ts.map +1 -1
- package/bin/chat/runtime/InboundAugment.d.ts +3 -3
- package/bin/chat/runtime/InboundAugment.d.ts.map +1 -1
- package/bin/chat/runtime/InboundAugment.js +6 -6
- package/bin/chat/runtime/InboundAugment.js.map +1 -1
- package/bin/chat/runtime/QueuedUserMessage.js +5 -5
- package/bin/chat/runtime/QueuedUserMessage.js.map +1 -1
- package/bin/chat/runtime/ReplyContextFormatter.js +7 -7
- package/bin/chat/runtime/ReplyContextFormatter.js.map +1 -1
- package/bin/chat/runtime/ReplyDispatch.d.ts +7 -7
- package/bin/chat/runtime/ReplyDispatch.d.ts.map +1 -1
- package/bin/chat/runtime/ReplyDispatch.js +3 -3
- package/bin/chat/runtime/ReplyDispatch.js.map +1 -1
- package/bin/chat/runtime/SystemPrompt.d.ts +4 -4
- package/bin/chat/runtime/SystemPrompt.d.ts.map +1 -1
- package/bin/chat/runtime/SystemPrompt.js +10 -10
- package/bin/chat/runtime/SystemPrompt.js.map +1 -1
- package/bin/chat/types/ChannelContext.d.ts +11 -11
- package/bin/chat/types/ChannelContext.d.ts.map +1 -1
- package/bin/chat/types/ChannelContext.js +2 -2
- package/bin/chat/types/ChatCommand.d.ts +31 -31
- package/bin/chat/types/ChatCommand.d.ts.map +1 -1
- package/bin/chat/types/ChatDispatcher.d.ts +3 -3
- package/bin/chat/types/ChatDispatcher.d.ts.map +1 -1
- package/bin/chat/types/ChatHistory.d.ts +2 -2
- package/bin/chat/types/ChatHistory.d.ts.map +1 -1
- package/bin/chat/types/ChatMeta.d.ts +4 -4
- package/bin/chat/types/ChatMeta.d.ts.map +1 -1
- package/bin/chat/types/ChatMeta.js +1 -1
- package/bin/chat/types/ChatPlugin.d.ts +9 -9
- package/bin/chat/types/ChatPlugin.d.ts.map +1 -1
- package/bin/chat/types/ChatPluginActionPayload.d.ts +13 -13
- package/bin/chat/types/ChatPluginActionPayload.d.ts.map +1 -1
- package/bin/chat/types/ChatPluginOptions.d.ts +6 -6
- package/bin/chat/types/ChatPluginOptions.d.ts.map +1 -1
- package/bin/chat/types/ChatPluginResource.d.ts +68 -0
- package/bin/chat/types/ChatPluginResource.d.ts.map +1 -0
- package/bin/chat/types/ChatPluginResource.js +10 -0
- package/bin/chat/types/ChatPluginResource.js.map +1 -0
- package/bin/chat/types/ChatPromptContext.d.ts +8 -8
- package/bin/chat/types/ChatPromptContext.d.ts.map +1 -1
- package/bin/chat/types/ChatQueue.d.ts +2 -2
- package/bin/chat/types/ChatQueue.d.ts.map +1 -1
- package/bin/chat/types/ChatQueueWorker.d.ts +3 -3
- package/bin/chat/types/ChatQueueWorker.d.ts.map +1 -1
- package/bin/chat/types/ChatRuntimeAccount.d.ts +39 -0
- package/bin/chat/types/ChatRuntimeAccount.d.ts.map +1 -0
- package/bin/chat/types/ChatRuntimeAccount.js +10 -0
- package/bin/chat/types/ChatRuntimeAccount.js.map +1 -0
- package/bin/chat/types/DirectDispatch.d.ts +13 -13
- package/bin/chat/types/DirectDispatch.d.ts.map +1 -1
- package/bin/chat/types/DirectDispatch.js +1 -1
- package/bin/chat/types/FeishuInboundAttachment.d.ts +1 -1
- package/bin/chat/types/FeishuInboundAttachment.d.ts.map +1 -1
- package/bin/chat/types/QqInboundDedupe.d.ts +1 -1
- package/bin/chat/types/QqInboundDedupe.d.ts.map +1 -1
- package/bin/chat/types/ReplyContext.d.ts +1 -1
- package/bin/chat/types/ReplyContext.d.ts.map +1 -1
- package/bin/chat.d.ts +4 -3
- package/bin/chat.d.ts.map +1 -1
- package/bin/chat.js +2 -2
- package/bin/chat.js.map +1 -1
- package/bin/contact/Action.d.ts +11 -11
- package/bin/contact/Action.d.ts.map +1 -1
- package/bin/contact/Action.js +27 -27
- package/bin/contact/Action.js.map +1 -1
- package/bin/contact/ContactPlugin.js +33 -33
- package/bin/contact/ContactPlugin.js.map +1 -1
- package/bin/contact/runtime/ChatRuntime.d.ts +2 -2
- package/bin/contact/runtime/ChatRuntime.d.ts.map +1 -1
- package/bin/contact/runtime/ChatRuntime.js +8 -23
- package/bin/contact/runtime/ChatRuntime.js.map +1 -1
- package/bin/contact/runtime/ContactStore.d.ts +8 -8
- package/bin/contact/runtime/ContactStore.d.ts.map +1 -1
- package/bin/contact/runtime/ContactStore.js +24 -24
- package/bin/contact/runtime/ContactStore.js.map +1 -1
- package/bin/contact/runtime/InboxStore.d.ts +6 -6
- package/bin/contact/runtime/InboxStore.d.ts.map +1 -1
- package/bin/contact/runtime/InboxStore.js +16 -16
- package/bin/contact/runtime/InboxStore.js.map +1 -1
- package/bin/contact/runtime/LinkApproval.js +17 -17
- package/bin/contact/runtime/LinkApproval.js.map +1 -1
- package/bin/contact/runtime/LinkCode.d.ts +1 -1
- package/bin/contact/runtime/LinkCode.d.ts.map +1 -1
- package/bin/contact/runtime/LinkCode.js +6 -6
- package/bin/contact/runtime/LinkCode.js.map +1 -1
- package/bin/contact/runtime/LinkStore.d.ts +2 -2
- package/bin/contact/runtime/LinkStore.d.ts.map +1 -1
- package/bin/contact/runtime/LinkStore.js +7 -7
- package/bin/contact/runtime/LinkStore.js.map +1 -1
- package/bin/contact/runtime/Paths.d.ts +14 -14
- package/bin/contact/runtime/Paths.d.ts.map +1 -1
- package/bin/contact/runtime/Paths.js +28 -28
- package/bin/contact/runtime/Paths.js.map +1 -1
- package/bin/contact/runtime/RemoteClient.d.ts +1 -1
- package/bin/contact/runtime/RemoteClient.js +18 -18
- package/bin/contact/runtime/RemoteClient.js.map +1 -1
- package/bin/contact/runtime/ShareBundle.d.ts +3 -3
- package/bin/contact/runtime/ShareBundle.d.ts.map +1 -1
- package/bin/contact/runtime/ShareBundle.js +5 -5
- package/bin/contact/runtime/ShareBundle.js.map +1 -1
- package/bin/contact/types/Contact.d.ts +2 -2
- package/bin/contact/types/Contact.d.ts.map +1 -1
- package/bin/contact/types/ContactApproval.d.ts +2 -2
- package/bin/contact/types/ContactApproval.d.ts.map +1 -1
- package/bin/contact/types/ContactChat.d.ts +1 -1
- package/bin/contact/types/ContactChat.d.ts.map +1 -1
- package/bin/contact/types/ContactLink.d.ts +4 -4
- package/bin/contact/types/ContactLink.d.ts.map +1 -1
- package/bin/image/ImagePlugin.d.ts +3 -3
- package/bin/image/ImagePlugin.d.ts.map +1 -1
- package/bin/image/ImagePlugin.js +25 -10
- package/bin/image/ImagePlugin.js.map +1 -1
- package/bin/image/types/ImagePlugin.d.ts +3 -3
- package/bin/image/types/ImagePlugin.d.ts.map +1 -1
- package/bin/image/types/ImagePlugin.js +1 -1
- package/bin/memory/Action.d.ts +7 -7
- package/bin/memory/Action.d.ts.map +1 -1
- package/bin/memory/Action.js +11 -11
- package/bin/memory/Action.js.map +1 -1
- package/bin/memory/MemoryPlugin.d.ts +3 -3
- package/bin/memory/MemoryPlugin.d.ts.map +1 -1
- package/bin/memory/MemoryPlugin.js +21 -21
- package/bin/memory/MemoryPlugin.js.map +1 -1
- package/bin/memory/runtime/Search.d.ts +3 -3
- package/bin/memory/runtime/Search.d.ts.map +1 -1
- package/bin/memory/runtime/Search.js +2 -2
- package/bin/memory/runtime/Search.js.map +1 -1
- package/bin/memory/runtime/Store.d.ts +2 -2
- package/bin/memory/runtime/Store.d.ts.map +1 -1
- package/bin/memory/runtime/Store.js +1 -1
- package/bin/memory/runtime/Store.js.map +1 -1
- package/bin/memory/runtime/SystemProvider.d.ts +3 -3
- package/bin/memory/runtime/SystemProvider.d.ts.map +1 -1
- package/bin/memory/runtime/SystemProvider.js +1 -1
- package/bin/memory/runtime/SystemProvider.js.map +1 -1
- package/bin/memory/runtime/Writer.d.ts +8 -8
- package/bin/memory/runtime/Writer.d.ts.map +1 -1
- package/bin/memory/runtime/Writer.js +14 -14
- package/bin/memory/runtime/Writer.js.map +1 -1
- package/bin/memory/types/Memory.d.ts +3 -3
- package/bin/memory/types/Memory.d.ts.map +1 -1
- package/bin/skill/Action.d.ts +4 -4
- package/bin/skill/Action.d.ts.map +1 -1
- package/bin/skill/Action.js +9 -9
- package/bin/skill/Action.js.map +1 -1
- package/bin/skill/Plugin.js +16 -16
- package/bin/skill/Plugin.js.map +1 -1
- package/bin/skill/runtime/Discovery.d.ts +2 -2
- package/bin/skill/runtime/Discovery.d.ts.map +1 -1
- package/bin/skill/runtime/Discovery.js +3 -3
- package/bin/skill/runtime/Discovery.js.map +1 -1
- package/bin/skill/runtime/Paths.d.ts +1 -1
- package/bin/skill/runtime/Paths.d.ts.map +1 -1
- package/bin/skill/runtime/Paths.js +6 -6
- package/bin/skill/runtime/Paths.js.map +1 -1
- package/bin/skill/runtime/Store.d.ts +3 -3
- package/bin/skill/runtime/Store.d.ts.map +1 -1
- package/bin/skill/runtime/Store.js +19 -19
- package/bin/skill/runtime/Store.js.map +1 -1
- package/bin/skill/runtime/SystemProvider.d.ts +2 -2
- package/bin/skill/runtime/SystemProvider.d.ts.map +1 -1
- package/bin/skill/runtime/SystemProvider.js +4 -4
- package/bin/skill/runtime/SystemProvider.js.map +1 -1
- package/bin/skill/runtime/Types.d.ts +3 -3
- package/bin/skill/runtime/Types.d.ts.map +1 -1
- package/bin/sound/Plugin.d.ts +5 -5
- package/bin/sound/Plugin.d.ts.map +1 -1
- package/bin/sound/Plugin.js +23 -11
- package/bin/sound/Plugin.js.map +1 -1
- package/bin/task/Action.d.ts +10 -10
- package/bin/task/Action.d.ts.map +1 -1
- package/bin/task/Action.js +31 -31
- package/bin/task/Action.js.map +1 -1
- package/bin/task/PROMPT.d.ts +1 -1
- package/bin/task/PROMPT.d.ts.map +1 -1
- package/bin/task/PROMPT.js +1 -1
- package/bin/task/PROMPT.js.map +1 -1
- package/bin/task/Scheduler.d.ts +2 -2
- package/bin/task/Scheduler.d.ts.map +1 -1
- package/bin/task/Scheduler.js +8 -8
- package/bin/task/Scheduler.js.map +1 -1
- package/bin/task/TaskPlugin.d.ts +3 -3
- package/bin/task/TaskPlugin.d.ts.map +1 -1
- package/bin/task/TaskPlugin.js +23 -20
- package/bin/task/TaskPlugin.js.map +1 -1
- package/bin/task/runtime/Model.d.ts +2 -2
- package/bin/task/runtime/Model.d.ts.map +1 -1
- package/bin/task/runtime/Model.js +11 -11
- package/bin/task/runtime/Model.js.map +1 -1
- package/bin/task/runtime/Paths.d.ts +6 -6
- package/bin/task/runtime/Paths.d.ts.map +1 -1
- package/bin/task/runtime/Paths.js +11 -11
- package/bin/task/runtime/Paths.js.map +1 -1
- package/bin/task/runtime/Runner.d.ts +4 -4
- package/bin/task/runtime/Runner.d.ts.map +1 -1
- package/bin/task/runtime/Runner.js +17 -17
- package/bin/task/runtime/Runner.js.map +1 -1
- package/bin/task/runtime/Store.d.ts +7 -7
- package/bin/task/runtime/Store.d.ts.map +1 -1
- package/bin/task/runtime/Store.js +15 -15
- package/bin/task/runtime/Store.js.map +1 -1
- package/bin/task/runtime/TaskActionExecution.d.ts +12 -12
- package/bin/task/runtime/TaskActionExecution.d.ts.map +1 -1
- package/bin/task/runtime/TaskActionExecution.js +7 -7
- package/bin/task/runtime/TaskActionExecution.js.map +1 -1
- package/bin/task/runtime/TaskActionInput.js +10 -10
- package/bin/task/runtime/TaskActionInput.js.map +1 -1
- package/bin/task/runtime/TaskPluginActionRegistry.js +26 -26
- package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -1
- package/bin/task/runtime/TaskRunArtifacts.js +4 -4
- package/bin/task/runtime/TaskRunArtifacts.js.map +1 -1
- package/bin/task/runtime/TaskRunChatDispatch.d.ts +2 -2
- package/bin/task/runtime/TaskRunChatDispatch.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunChatDispatch.js +7 -7
- package/bin/task/runtime/TaskRunChatDispatch.js.map +1 -1
- package/bin/task/runtime/TaskRunnerProgress.js +1 -1
- package/bin/task/runtime/TaskRunnerProgress.js.map +1 -1
- package/bin/task/runtime/TaskRunnerRound.d.ts +7 -7
- package/bin/task/runtime/TaskRunnerRound.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunnerRound.js +34 -38
- package/bin/task/runtime/TaskRunnerRound.js.map +1 -1
- package/bin/task/runtime/TaskRunnerScript.d.ts +4 -4
- package/bin/task/runtime/TaskRunnerScript.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunnerScript.js +1 -1
- package/bin/task/runtime/TaskRunnerScript.js.map +1 -1
- package/bin/task/runtime/TaskRunnerSession.d.ts +8 -8
- package/bin/task/runtime/TaskRunnerSession.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunnerSession.js +52 -39
- package/bin/task/runtime/TaskRunnerSession.js.map +1 -1
- package/bin/task/runtime/TaskRunnerTypes.d.ts +5 -5
- package/bin/task/runtime/TaskRunnerTypes.d.ts.map +1 -1
- package/bin/task/types/Task.d.ts +4 -4
- package/bin/task/types/Task.d.ts.map +1 -1
- package/bin/task/types/TaskCommand.d.ts +3 -3
- package/bin/task/types/TaskCommand.d.ts.map +1 -1
- package/bin/web/Plugin.d.ts +2 -2
- package/bin/web/Plugin.d.ts.map +1 -1
- package/bin/web/Plugin.js +3 -3
- package/bin/web/Plugin.js.map +1 -1
- package/bin/workboard/Plugin.d.ts.map +1 -1
- package/bin/workboard/Plugin.js +6 -7
- package/bin/workboard/Plugin.js.map +1 -1
- package/bin/workboard/runtime/Collector.d.ts +2 -2
- package/bin/workboard/runtime/Collector.d.ts.map +1 -1
- package/bin/workboard/runtime/Collector.js +4 -4
- package/bin/workboard/runtime/Collector.js.map +1 -1
- package/bin/workboard/runtime/Normalizer.d.ts +3 -3
- package/bin/workboard/runtime/Normalizer.d.ts.map +1 -1
- package/bin/workboard/runtime/Normalizer.js +11 -11
- package/bin/workboard/runtime/Normalizer.js.map +1 -1
- package/bin/workboard/runtime/SessionSummary.d.ts +5 -5
- package/bin/workboard/runtime/SessionSummary.d.ts.map +1 -1
- package/bin/workboard/runtime/SessionSummary.js +4 -4
- package/bin/workboard/runtime/SessionSummary.js.map +1 -1
- package/bin/workboard/runtime/Store.d.ts +5 -5
- package/bin/workboard/runtime/Store.d.ts.map +1 -1
- package/bin/workboard/runtime/Store.js.map +1 -1
- package/bin/workboard/types/Workboard.d.ts +2 -2
- package/bin/workboard/types/Workboard.d.ts.map +1 -1
- package/bin/workboard/types/Workboard.js +1 -1
- package/package.json +3 -3
- package/scripts/chat-access.test.mjs +2 -2
- package/scripts/chat-channel-config.test.mjs +25 -3
- package/scripts/chat-storage.test.mjs +7 -7
- package/scripts/skill-plugin.test.mjs +4 -4
- package/scripts/sound-plugin.test.mjs +12 -8
- package/scripts/web-plugin.test.mjs +4 -4
- package/src/chat/Action.ts +154 -153
- package/src/chat/ChatPlugin.ts +12 -12
- package/src/chat/Index.ts +12 -0
- package/src/chat/PROMPT.direct.ts +1 -1
- package/src/chat/access/ChatAccessActions.ts +6 -6
- package/src/chat/access/ChatAccessRuntime.ts +5 -5
- package/src/chat/access/ChatAccessStore.ts +5 -5
- package/src/chat/channels/BaseChatChannel.ts +32 -32
- package/src/chat/channels/BaseChatChannelQueue.ts +38 -38
- package/src/chat/channels/BaseChatChannelSupport.ts +25 -25
- package/src/chat/channels/RuntimeChannel.ts +53 -74
- package/src/chat/channels/feishu/Feishu.ts +35 -35
- package/src/chat/channels/feishu/FeishuInbound.ts +3 -3
- package/src/chat/channels/feishu/FeishuMessageHandler.ts +29 -29
- package/src/chat/channels/feishu/FeishuPlatformClient.ts +15 -15
- package/src/chat/channels/feishu/FeishuPlatformLookup.ts +7 -7
- package/src/chat/channels/feishu/FeishuPlatformMessaging.ts +7 -7
- package/src/chat/channels/feishu/InboundAttachment.ts +6 -6
- package/src/chat/channels/feishu/PostMessage.ts +8 -8
- package/src/chat/channels/feishu/ReplyContext.ts +3 -3
- package/src/chat/channels/feishu/Shared.ts +3 -3
- package/src/chat/channels/qq/PROMPT.direct.ts +1 -1
- package/src/chat/channels/qq/QQ.ts +26 -26
- package/src/chat/channels/qq/QQEventCapture.ts +3 -3
- package/src/chat/channels/qq/QQGatewayAuth.ts +1 -1
- package/src/chat/channels/qq/QQGatewayClient.ts +12 -12
- package/src/chat/channels/qq/QQGatewayConnection.ts +1 -1
- package/src/chat/channels/qq/QQGatewaySend.ts +6 -6
- package/src/chat/channels/qq/QQInbound.ts +5 -5
- package/src/chat/channels/qq/QQInboundDedupe.ts +6 -6
- package/src/chat/channels/qq/QQMessageHandler.ts +43 -43
- package/src/chat/channels/qq/QQSendSupport.ts +2 -2
- package/src/chat/channels/qq/QQSupport.ts +10 -10
- package/src/chat/channels/qq/types/QqChannel.ts +1 -1
- package/src/chat/channels/telegram/ApiClient.ts +7 -7
- package/src/chat/channels/telegram/Bot.ts +17 -17
- package/src/chat/channels/telegram/BotInfo.ts +1 -1
- package/src/chat/channels/telegram/ReplyContext.ts +3 -3
- package/src/chat/channels/telegram/Shared.ts +3 -3
- package/src/chat/channels/telegram/StateStore.ts +2 -2
- package/src/chat/channels/telegram/TelegramInbound.ts +4 -4
- package/src/chat/channels/telegram/TelegramMessageHandler.ts +35 -35
- package/src/chat/channels/telegram/TelegramPendingUpdates.ts +9 -9
- package/src/chat/channels/telegram/TelegramPlatformClient.ts +11 -11
- package/src/chat/config/ChatPluginConfig.ts +266 -0
- package/src/chat/runtime/ChannelContextStore.ts +88 -88
- package/src/chat/runtime/ChatActionExecution.ts +87 -87
- package/src/chat/runtime/ChatActionInput.ts +19 -19
- package/src/chat/runtime/ChatChannelActions.ts +4 -4
- package/src/chat/runtime/ChatChannelConfig.ts +14 -14
- package/src/chat/runtime/ChatChannelCore.ts +17 -26
- package/src/chat/runtime/ChatChannelLifecycle.ts +12 -12
- package/src/chat/runtime/ChatHistoryStore.ts +39 -39
- package/src/chat/runtime/ChatIngressStore.ts +6 -6
- package/src/chat/runtime/ChatMetaStore.ts +37 -37
- package/src/chat/runtime/ChatPluginActionRegistry.ts +56 -62
- package/src/chat/runtime/ChatPluginSystem.ts +9 -9
- package/src/chat/runtime/ChatQueueReplyDispatch.ts +47 -47
- package/src/chat/runtime/ChatQueueStore.ts +4 -4
- package/src/chat/runtime/ChatQueueWorker.ts +38 -44
- package/src/chat/runtime/ChatQueueWorkerSupport.ts +18 -18
- package/src/chat/runtime/ChatSendActionInput.ts +53 -53
- package/src/chat/runtime/ChatSendMetadata.ts +15 -15
- package/src/chat/runtime/ChatSendRegistry.ts +1 -1
- package/src/chat/runtime/ChatSessionDelete.ts +19 -19
- package/src/chat/runtime/ChatStorage.ts +3 -3
- package/src/chat/runtime/ChatkeySend.ts +43 -43
- package/src/chat/runtime/DirectDispatchParser.ts +21 -21
- package/src/chat/runtime/EnqueueDispatch.ts +3 -3
- package/src/chat/runtime/InboundAugment.ts +8 -8
- package/src/chat/runtime/QueuedUserMessage.ts +6 -6
- package/src/chat/runtime/ReplyContextFormatter.ts +6 -6
- package/src/chat/runtime/ReplyDispatch.ts +9 -9
- package/src/chat/runtime/SystemPrompt.ts +14 -14
- package/src/chat/types/ChannelContext.ts +11 -11
- package/src/chat/types/ChatCommand.ts +31 -31
- package/src/chat/types/ChatDispatcher.ts +3 -3
- package/src/chat/types/ChatHistory.ts +2 -2
- package/src/chat/types/ChatMeta.ts +4 -4
- package/src/chat/types/ChatPlugin.ts +9 -9
- package/src/chat/types/ChatPluginActionPayload.ts +13 -13
- package/src/chat/types/ChatPluginOptions.ts +6 -6
- package/src/chat/types/ChatPluginResource.ts +95 -0
- package/src/chat/types/ChatPromptContext.ts +8 -8
- package/src/chat/types/ChatQueue.ts +2 -2
- package/src/chat/types/ChatQueueWorker.ts +3 -3
- package/src/chat/types/ChatRuntimeAccount.ts +52 -0
- package/src/chat/types/DirectDispatch.ts +13 -13
- package/src/chat/types/FeishuInboundAttachment.ts +1 -1
- package/src/chat/types/QqInboundDedupe.ts +1 -1
- package/src/chat/types/ReplyContext.ts +1 -1
- package/src/chat.ts +13 -3
- package/src/contact/Action.ts +40 -40
- package/src/contact/ContactPlugin.ts +49 -49
- package/src/contact/runtime/ChatRuntime.ts +10 -26
- package/src/contact/runtime/ContactStore.ts +24 -24
- package/src/contact/runtime/InboxStore.ts +16 -16
- package/src/contact/runtime/LinkApproval.ts +19 -19
- package/src/contact/runtime/LinkCode.ts +7 -7
- package/src/contact/runtime/LinkStore.ts +7 -7
- package/src/contact/runtime/Paths.ts +28 -28
- package/src/contact/runtime/RemoteClient.ts +19 -19
- package/src/contact/runtime/ShareBundle.ts +8 -8
- package/src/contact/types/Contact.ts +2 -2
- package/src/contact/types/ContactApproval.ts +2 -2
- package/src/contact/types/ContactChat.ts +1 -1
- package/src/contact/types/ContactLink.ts +4 -4
- package/src/image/ImagePlugin.ts +32 -16
- package/src/image/types/ImagePlugin.ts +3 -3
- package/src/memory/Action.ts +18 -18
- package/src/memory/MemoryPlugin.ts +25 -25
- package/src/memory/runtime/Search.ts +6 -6
- package/src/memory/runtime/Store.ts +3 -3
- package/src/memory/runtime/SystemProvider.ts +4 -4
- package/src/memory/runtime/Writer.ts +24 -24
- package/src/memory/types/Memory.ts +3 -3
- package/src/skill/Action.ts +10 -10
- package/src/skill/Plugin.ts +16 -16
- package/src/skill/runtime/Discovery.ts +3 -3
- package/src/skill/runtime/Paths.ts +6 -6
- package/src/skill/runtime/Store.ts +19 -19
- package/src/skill/runtime/SystemProvider.ts +5 -5
- package/src/skill/runtime/Types.ts +3 -3
- package/src/sound/Plugin.ts +31 -18
- package/src/task/Action.ts +40 -40
- package/src/task/PROMPT.ts +1 -1
- package/src/task/Scheduler.ts +10 -10
- package/src/task/TaskPlugin.ts +32 -30
- package/src/task/runtime/Model.ts +12 -12
- package/src/task/runtime/Paths.ts +11 -11
- package/src/task/runtime/Runner.ts +21 -21
- package/src/task/runtime/Store.ts +21 -21
- package/src/task/runtime/TaskActionExecution.ts +19 -19
- package/src/task/runtime/TaskActionInput.ts +10 -10
- package/src/task/runtime/TaskPluginActionRegistry.ts +27 -27
- package/src/task/runtime/TaskRunArtifacts.ts +4 -4
- package/src/task/runtime/TaskRunChatDispatch.ts +9 -9
- package/src/task/runtime/TaskRunnerProgress.ts +1 -1
- package/src/task/runtime/TaskRunnerRound.ts +47 -42
- package/src/task/runtime/TaskRunnerScript.ts +5 -5
- package/src/task/runtime/TaskRunnerSession.ts +58 -46
- package/src/task/runtime/TaskRunnerTypes.ts +5 -5
- package/src/task/types/Task.ts +4 -4
- package/src/task/types/TaskCommand.ts +3 -3
- package/src/web/Plugin.ts +5 -5
- package/src/workboard/Plugin.ts +8 -9
- package/src/workboard/runtime/Collector.ts +6 -6
- package/src/workboard/runtime/Normalizer.ts +14 -14
- package/src/workboard/runtime/SessionSummary.ts +9 -9
- package/src/workboard/runtime/Store.ts +6 -6
- package/src/workboard/types/Workboard.ts +2 -2
- package/bin/chat/accounts/ChannelAccountManager.d.ts +0 -61
- package/bin/chat/accounts/ChannelAccountManager.d.ts.map +0 -1
- package/bin/chat/accounts/ChannelAccountManager.js +0 -264
- package/bin/chat/accounts/ChannelAccountManager.js.map +0 -1
- package/bin/chat/accounts/Crypto.d.ts +0 -20
- package/bin/chat/accounts/Crypto.d.ts.map +0 -1
- package/bin/chat/accounts/Crypto.js +0 -75
- package/bin/chat/accounts/Crypto.js.map +0 -1
- package/bin/chat/accounts/Store.d.ts +0 -38
- package/bin/chat/accounts/Store.d.ts.map +0 -1
- package/bin/chat/accounts/Store.js +0 -220
- package/bin/chat/accounts/Store.js.map +0 -1
- package/bin/chat/channels/Configuration.d.ts +0 -27
- package/bin/chat/channels/Configuration.d.ts.map +0 -1
- package/bin/chat/channels/Configuration.js +0 -19
- package/bin/chat/channels/Configuration.js.map +0 -1
- package/bin/chat/channels/ConfigurationRegistry.d.ts +0 -18
- package/bin/chat/channels/ConfigurationRegistry.d.ts.map +0 -1
- package/bin/chat/channels/ConfigurationRegistry.js +0 -31
- package/bin/chat/channels/ConfigurationRegistry.js.map +0 -1
- package/bin/chat/channels/feishu/Configuration.d.ts +0 -17
- package/bin/chat/channels/feishu/Configuration.d.ts.map +0 -1
- package/bin/chat/channels/feishu/Configuration.js +0 -59
- package/bin/chat/channels/feishu/Configuration.js.map +0 -1
- package/bin/chat/channels/qq/Configuration.d.ts +0 -17
- package/bin/chat/channels/qq/Configuration.d.ts.map +0 -1
- package/bin/chat/channels/qq/Configuration.js +0 -59
- package/bin/chat/channels/qq/Configuration.js.map +0 -1
- package/bin/chat/channels/telegram/Configuration.d.ts +0 -17
- package/bin/chat/channels/telegram/Configuration.d.ts.map +0 -1
- package/bin/chat/channels/telegram/Configuration.js +0 -59
- package/bin/chat/channels/telegram/Configuration.js.map +0 -1
- package/bin/chat/types/ChannelAccount.d.ts +0 -226
- package/bin/chat/types/ChannelAccount.d.ts.map +0 -1
- package/bin/chat/types/ChannelAccount.js +0 -9
- package/bin/chat/types/ChannelAccount.js.map +0 -1
- package/bin/chat/types/ChannelConfiguration.d.ts +0 -146
- package/bin/chat/types/ChannelConfiguration.d.ts.map +0 -1
- package/bin/chat/types/ChannelConfiguration.js +0 -9
- package/bin/chat/types/ChannelConfiguration.js.map +0 -1
- package/src/chat/accounts/ChannelAccountManager.ts +0 -314
- package/src/chat/accounts/Crypto.ts +0 -83
- package/src/chat/accounts/Store.ts +0 -287
- package/src/chat/channels/Configuration.ts +0 -35
- package/src/chat/channels/ConfigurationRegistry.ts +0 -43
- package/src/chat/channels/feishu/Configuration.ts +0 -65
- package/src/chat/channels/qq/Configuration.ts +0 -64
- package/src/chat/channels/telegram/Configuration.ts +0 -65
- package/src/chat/types/ChannelAccount.ts +0 -232
- package/src/chat/types/ChannelConfiguration.ts +0 -160
package/src/workboard/Plugin.ts
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { BasePlugin } from "@downcity/agent";
|
|
11
|
-
import {
|
|
11
|
+
import { create_action } from "@downcity/agent";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import type {
|
|
14
14
|
PluginActions,
|
|
15
15
|
PluginHttpDefinition,
|
|
16
16
|
} from "@downcity/agent";
|
|
17
|
-
import type {
|
|
17
|
+
import type { PluginContext } from "@downcity/agent";
|
|
18
18
|
import type { JsonValue } from "@downcity/agent";
|
|
19
19
|
import { getWorkboardSnapshotStore } from "@/workboard/runtime/Store.js";
|
|
20
20
|
import type { WorkboardSnapshotResponse } from "@/workboard/types/Workboard.js";
|
|
@@ -23,7 +23,7 @@ import type { WorkboardSnapshotResponse } from "@/workboard/types/Workboard.js";
|
|
|
23
23
|
* 读取 workboard 快照。
|
|
24
24
|
*/
|
|
25
25
|
async function readWorkboardSnapshot(
|
|
26
|
-
context:
|
|
26
|
+
context: PluginContext,
|
|
27
27
|
): Promise<WorkboardSnapshotResponse> {
|
|
28
28
|
const snapshot = await getWorkboardSnapshotStore({
|
|
29
29
|
contextResolver: () => context,
|
|
@@ -58,7 +58,7 @@ export class WorkboardPlugin extends BasePlugin {
|
|
|
58
58
|
* Workboard 对外 action。
|
|
59
59
|
*/
|
|
60
60
|
readonly actions: PluginActions = {
|
|
61
|
-
snapshot:
|
|
61
|
+
snapshot: create_action({
|
|
62
62
|
description: "Read the current structured runtime snapshot from the workboard.",
|
|
63
63
|
input_schema: {
|
|
64
64
|
zod: z.object({}).passthrough(),
|
|
@@ -82,18 +82,17 @@ export class WorkboardPlugin extends BasePlugin {
|
|
|
82
82
|
*/
|
|
83
83
|
readonly http: PluginHttpDefinition = {
|
|
84
84
|
server: {
|
|
85
|
-
|
|
85
|
+
auth_policies: [
|
|
86
86
|
{
|
|
87
87
|
path: "/api/workboard/*",
|
|
88
88
|
method: "GET",
|
|
89
|
-
|
|
90
|
-
anyPermissions: ["agent.read"],
|
|
89
|
+
require_auth: true,
|
|
91
90
|
},
|
|
92
91
|
],
|
|
93
|
-
register({ app,
|
|
92
|
+
register({ app, get_context }) {
|
|
94
93
|
app.get("/api/workboard/snapshot", async (c) => {
|
|
95
94
|
try {
|
|
96
|
-
return c.json(await readWorkboardSnapshot(
|
|
95
|
+
return c.json(await readWorkboardSnapshot(get_context()));
|
|
97
96
|
} catch (error) {
|
|
98
97
|
return c.json(
|
|
99
98
|
{
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { listTaskDefinitions } from "@/task/Action.js";
|
|
10
|
-
import {
|
|
11
|
-
import type {
|
|
10
|
+
import { list_plugin_states } from "@downcity/agent";
|
|
11
|
+
import type { PluginContext } from "@downcity/agent";
|
|
12
12
|
import type { WorkboardSnapshot } from "@/workboard/types/Workboard.js";
|
|
13
13
|
import { listWorkboardSessionSummaries } from "@/workboard/runtime/SessionSummary.js";
|
|
14
14
|
import {
|
|
@@ -26,7 +26,7 @@ const WORKBOARD_RECENT_LIMIT = 8;
|
|
|
26
26
|
* 采集当前 workboard 快照。
|
|
27
27
|
*/
|
|
28
28
|
export async function collectWorkboardSnapshot(
|
|
29
|
-
context:
|
|
29
|
+
context: PluginContext,
|
|
30
30
|
): Promise<WorkboardSnapshot> {
|
|
31
31
|
const collectedAt = new Date().toISOString();
|
|
32
32
|
const executingSessionIds = new Set(context.sessions.list_executing_session_ids());
|
|
@@ -35,8 +35,8 @@ export async function collectWorkboardSnapshot(
|
|
|
35
35
|
limit: WORKBOARD_RECENT_LIMIT + Math.max(executingSessionIds.size, 1),
|
|
36
36
|
executingSessionIds,
|
|
37
37
|
});
|
|
38
|
-
const runtimePlugins =
|
|
39
|
-
const taskResult = await listTaskDefinitions({
|
|
38
|
+
const runtimePlugins = list_plugin_states({ context });
|
|
39
|
+
const taskResult = await listTaskDefinitions({ project_root: context.workspace_path });
|
|
40
40
|
const degradedCount = runtimePlugins.filter(
|
|
41
41
|
(item) => item.status !== "ready",
|
|
42
42
|
).length;
|
|
@@ -52,7 +52,7 @@ export async function collectWorkboardSnapshot(
|
|
|
52
52
|
|
|
53
53
|
const safeCurrent = current.length > 0
|
|
54
54
|
? current
|
|
55
|
-
: [buildIdleActivity({
|
|
55
|
+
: [buildIdleActivity({ updated_at: collectedAt, recentCount: recent.length })];
|
|
56
56
|
|
|
57
57
|
return {
|
|
58
58
|
agent: toWorkboardAgentSummary({
|
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
WorkboardSignalItem,
|
|
16
16
|
WorkboardSummary,
|
|
17
17
|
} from "@/workboard/types/Workboard.js";
|
|
18
|
-
import type {
|
|
18
|
+
import type { PluginContext } from "@downcity/agent";
|
|
19
19
|
|
|
20
20
|
function toIsoString(timestamp?: number): string {
|
|
21
21
|
if (!timestamp || !Number.isFinite(timestamp)) {
|
|
@@ -60,18 +60,18 @@ function buildMomentum(params: { currentCount: number; recentCount: number }): s
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function buildRunningSummary(item: WorkboardSessionSummary): string {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
if (
|
|
66
|
-
if (
|
|
63
|
+
const message_count = typeof item.message_count === "number" ? item.message_count : 0;
|
|
64
|
+
if (message_count >= 24) return "正在延展一段较长的工作脉络,并持续生成新的内容。";
|
|
65
|
+
if (message_count >= 8) return "正在承接连续输入,逐步形成新的阶段结果。";
|
|
66
|
+
if (message_count > 0) return "正在回应当前输入,并把工作继续向前展开。";
|
|
67
67
|
return "当前处于活跃展开之中。";
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
function buildRecentSummary(item: WorkboardSessionSummary, index: number): string {
|
|
71
|
-
const
|
|
72
|
-
if (index === 0 &&
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
71
|
+
const message_count = typeof item.message_count === "number" ? item.message_count : 0;
|
|
72
|
+
if (index === 0 && message_count > 0) return "刚刚完成一段新的展开,正在短暂停留。";
|
|
73
|
+
if (message_count >= 12) return "近期完成了一次较长的内容延展。";
|
|
74
|
+
if (message_count > 0) return "近期完成了一次常规更新。";
|
|
75
75
|
return "近期出现了一次轻微变化。";
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -79,7 +79,7 @@ function buildRecentSummary(item: WorkboardSessionSummary, index: number): strin
|
|
|
79
79
|
* 构建 agent 顶部公开摘要。
|
|
80
80
|
*/
|
|
81
81
|
export function toWorkboardAgentSummary(params: {
|
|
82
|
-
context:
|
|
82
|
+
context: PluginContext;
|
|
83
83
|
collectedAt: string;
|
|
84
84
|
currentCount: number;
|
|
85
85
|
recentCount: number;
|
|
@@ -114,7 +114,7 @@ export function toRunningActivity(params: {
|
|
|
114
114
|
title,
|
|
115
115
|
summary: buildRunningSummary(params.item),
|
|
116
116
|
status: "active",
|
|
117
|
-
|
|
117
|
+
updated_at: toIsoString(params.item.updated_at),
|
|
118
118
|
tags: ["public", "active"],
|
|
119
119
|
};
|
|
120
120
|
}
|
|
@@ -134,7 +134,7 @@ export function toRecentActivity(params: {
|
|
|
134
134
|
title,
|
|
135
135
|
summary: buildRecentSummary(params.item, params.index),
|
|
136
136
|
status: params.index === 0 ? "steady" : "waiting",
|
|
137
|
-
|
|
137
|
+
updated_at: toIsoString(params.item.updated_at),
|
|
138
138
|
tags: ["public", "recent"],
|
|
139
139
|
};
|
|
140
140
|
}
|
|
@@ -143,7 +143,7 @@ export function toRecentActivity(params: {
|
|
|
143
143
|
* 构建空闲占位项。
|
|
144
144
|
*/
|
|
145
145
|
export function buildIdleActivity(params: {
|
|
146
|
-
|
|
146
|
+
updated_at: string;
|
|
147
147
|
recentCount: number;
|
|
148
148
|
}): WorkboardActivityItem {
|
|
149
149
|
return {
|
|
@@ -154,7 +154,7 @@ export function buildIdleActivity(params: {
|
|
|
154
154
|
? "刚刚有过新的更新,现在等待下一次输入。"
|
|
155
155
|
: "当前没有明显变化,等待新的触发。",
|
|
156
156
|
status: "waiting",
|
|
157
|
-
|
|
157
|
+
updated_at: params.updated_at,
|
|
158
158
|
tags: ["public", "idle"],
|
|
159
159
|
};
|
|
160
160
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 这里只读取消息数量、更新时间与执行中状态,不暴露消息内容。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { PluginContext } from "@downcity/agent";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Workboard 内部 session 摘要。
|
|
@@ -15,15 +15,15 @@ export interface WorkboardSessionSummary {
|
|
|
15
15
|
/**
|
|
16
16
|
* session 稳定标识,仅供内部排序和执行态匹配使用,不会进入公开输出。
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
session_id: string;
|
|
19
19
|
/**
|
|
20
20
|
* 当前 session 消息数量。
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
message_count: number;
|
|
23
23
|
/**
|
|
24
24
|
* 最近更新时间戳。
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
updated_at?: number;
|
|
27
27
|
/**
|
|
28
28
|
* 当前 session 是否仍在执行。
|
|
29
29
|
*/
|
|
@@ -37,7 +37,7 @@ export async function listWorkboardSessionSummaries(params: {
|
|
|
37
37
|
/**
|
|
38
38
|
* Agent runtime context。
|
|
39
39
|
*/
|
|
40
|
-
context:
|
|
40
|
+
context: PluginContext;
|
|
41
41
|
/**
|
|
42
42
|
* 返回上限。
|
|
43
43
|
*/
|
|
@@ -51,10 +51,10 @@ export async function listWorkboardSessionSummaries(params: {
|
|
|
51
51
|
limit: Math.max(1, params.limit),
|
|
52
52
|
});
|
|
53
53
|
return page.items.map((item) => ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...(typeof item.
|
|
57
|
-
...(item.executing || params.executingSessionIds?.has(item.
|
|
54
|
+
session_id: item.session_id,
|
|
55
|
+
message_count: item.message_count,
|
|
56
|
+
...(typeof item.updated_at === "number" ? { updated_at: item.updated_at } : {}),
|
|
57
|
+
...(item.executing || params.executingSessionIds?.has(item.session_id)
|
|
58
58
|
? { executing: true }
|
|
59
59
|
: {}),
|
|
60
60
|
}));
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* - route 与 action 共享同一份快照,确保 workboard 展示一致。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { PluginContext } from "@downcity/agent";
|
|
10
10
|
import type { WorkboardSnapshot } from "@/workboard/types/Workboard.js";
|
|
11
11
|
import { collectWorkboardSnapshot } from "@/workboard/runtime/Collector.js";
|
|
12
12
|
|
|
13
|
-
type
|
|
13
|
+
type PluginContextResolver = () => PluginContext;
|
|
14
14
|
|
|
15
15
|
const DEFAULT_WORKBOARD_INTERVAL_MS = 5_000;
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ const DEFAULT_WORKBOARD_INTERVAL_MS = 5_000;
|
|
|
18
18
|
* Workboard 快照存储器。
|
|
19
19
|
*/
|
|
20
20
|
class WorkboardSnapshotStore {
|
|
21
|
-
private contextResolver:
|
|
21
|
+
private contextResolver: PluginContextResolver;
|
|
22
22
|
|
|
23
23
|
private readonly intervalMs: number;
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ class WorkboardSnapshotStore {
|
|
|
29
29
|
private inflight: Promise<WorkboardSnapshot> | null = null;
|
|
30
30
|
|
|
31
31
|
constructor(params: {
|
|
32
|
-
contextResolver:
|
|
32
|
+
contextResolver: PluginContextResolver;
|
|
33
33
|
intervalMs?: number;
|
|
34
34
|
}) {
|
|
35
35
|
this.contextResolver = params.contextResolver;
|
|
@@ -39,7 +39,7 @@ class WorkboardSnapshotStore {
|
|
|
39
39
|
/**
|
|
40
40
|
* 更新上下文 resolver。
|
|
41
41
|
*/
|
|
42
|
-
setContextResolver(resolver:
|
|
42
|
+
setContextResolver(resolver: PluginContextResolver): void {
|
|
43
43
|
this.contextResolver = resolver;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -96,7 +96,7 @@ let sharedStore: WorkboardSnapshotStore | null = null;
|
|
|
96
96
|
* 读取共享 workboard 快照缓存。
|
|
97
97
|
*/
|
|
98
98
|
export function getWorkboardSnapshotStore(params: {
|
|
99
|
-
contextResolver:
|
|
99
|
+
contextResolver: PluginContextResolver;
|
|
100
100
|
}): WorkboardSnapshotStore {
|
|
101
101
|
if (!sharedStore) {
|
|
102
102
|
sharedStore = new WorkboardSnapshotStore({
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - workboard 是对外展示面板,类型只保留公开安全的模糊状态。
|
|
6
|
-
* - 不暴露
|
|
6
|
+
* - 不暴露 session_id、路径、模型、service 名称、task 明细等内部信息。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -48,7 +48,7 @@ export interface WorkboardActivityItem {
|
|
|
48
48
|
/**
|
|
49
49
|
* 最近更新时间(ISO8601)。
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
updated_at: string;
|
|
52
52
|
/**
|
|
53
53
|
* 对外安全标签。
|
|
54
54
|
*/
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chat account 管理器。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 统一封装 agent 运行时下 chat account 的 CRUD 与探测。
|
|
6
|
-
* - 账号凭据只在写入路径接收明文;列表与读取路径返回脱敏结果。
|
|
7
|
-
* - city / vibecape 等上层产品都应直接复用这个实现,而不是各自维护副本。
|
|
8
|
-
*/
|
|
9
|
-
import type { ChatChannelAccountCreateInput, ChatChannelAccountListResult, ChatChannelAccountProbeResult, ChatChannelAccountUpsertInput } from "../../chat/types/ChannelAccount.js";
|
|
10
|
-
/**
|
|
11
|
-
* ChatChannelAccountManager。
|
|
12
|
-
*/
|
|
13
|
-
export declare class ChatChannelAccountManager {
|
|
14
|
-
constructor();
|
|
15
|
-
/**
|
|
16
|
-
* 生成唯一 chat account id。
|
|
17
|
-
*
|
|
18
|
-
* 关键点(中文)
|
|
19
|
-
* - 账号 id 统一由系统生成,避免用户手填导致冲突或命名不一致。
|
|
20
|
-
* - 若碰撞则自动追加随机后缀重试。
|
|
21
|
-
*/
|
|
22
|
-
private generateUniqueAccountId;
|
|
23
|
-
/**
|
|
24
|
-
* 探测 bot 凭据并返回自动填充信息。
|
|
25
|
-
*/
|
|
26
|
-
probe(input: {
|
|
27
|
-
channel: string;
|
|
28
|
-
botToken?: string;
|
|
29
|
-
appId?: string;
|
|
30
|
-
appSecret?: string;
|
|
31
|
-
domain?: string;
|
|
32
|
-
sandbox?: boolean;
|
|
33
|
-
}): Promise<ChatChannelAccountProbeResult>;
|
|
34
|
-
/**
|
|
35
|
-
* 使用凭据创建账号。
|
|
36
|
-
*
|
|
37
|
-
* 关键点(中文)
|
|
38
|
-
* - 默认先尝试探测 bot 信息,成功时自动填充名称与身份。
|
|
39
|
-
* - 探测失败但用户提供了名称时,仍允许先保存,便于后续排障。
|
|
40
|
-
*/
|
|
41
|
-
create(input: ChatChannelAccountCreateInput): Promise<{
|
|
42
|
-
id: string;
|
|
43
|
-
probed: boolean;
|
|
44
|
-
message?: string;
|
|
45
|
-
}>;
|
|
46
|
-
/**
|
|
47
|
-
* 列出账户池(脱敏)。
|
|
48
|
-
*/
|
|
49
|
-
list(): Promise<ChatChannelAccountListResult>;
|
|
50
|
-
/**
|
|
51
|
-
* 新增或更新账号。
|
|
52
|
-
*/
|
|
53
|
-
upsert(input: ChatChannelAccountUpsertInput): Promise<{
|
|
54
|
-
id: string;
|
|
55
|
-
}>;
|
|
56
|
-
/**
|
|
57
|
-
* 删除账号。
|
|
58
|
-
*/
|
|
59
|
-
remove(idInput: string): Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=ChannelAccountManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelAccountManager.d.ts","sourceRoot":"","sources":["../../../src/chat/accounts/ChannelAccountManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EACV,6BAA6B,EAE7B,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AAkDxC;;GAEG;AACH,qBAAa,yBAAyB;;IAGpC;;;;;;OAMG;YACW,uBAAuB;IAerC;;OAEG;IACG,KAAK,CAAC,KAAK,EAAE;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAmC1C;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC;QAC1D,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IAiDF;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAQnD;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IA4D3E;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAK7C"}
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chat account 管理器。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 统一封装 agent 运行时下 chat account 的 CRUD 与探测。
|
|
6
|
-
* - 账号凭据只在写入路径接收明文;列表与读取路径返回脱敏结果。
|
|
7
|
-
* - city / vibecape 等上层产品都应直接复用这个实现,而不是各自维护副本。
|
|
8
|
-
*/
|
|
9
|
-
import crypto from "node:crypto";
|
|
10
|
-
import { resolveChatChannelBotInfo } from "../../chat/channels/BotInfoProvider.js";
|
|
11
|
-
import { getStoredChannelAccountSync, listStoredChannelAccountsSync, normalizeChannelAccountChannel, removeStoredChannelAccount, upsertStoredChannelAccount, } from "./Store.js";
|
|
12
|
-
const SUPPORTED_CHANNELS = [
|
|
13
|
-
"telegram",
|
|
14
|
-
"feishu",
|
|
15
|
-
"qq",
|
|
16
|
-
];
|
|
17
|
-
function maskSecret(value) {
|
|
18
|
-
const raw = String(value || "").trim();
|
|
19
|
-
if (!raw)
|
|
20
|
-
return "";
|
|
21
|
-
if (raw.length <= 8)
|
|
22
|
-
return "***";
|
|
23
|
-
return `${raw.slice(0, 4)}***${raw.slice(-4)}`;
|
|
24
|
-
}
|
|
25
|
-
function assertChannel(input) {
|
|
26
|
-
const channel = String(input || "").trim().toLowerCase();
|
|
27
|
-
if (!SUPPORTED_CHANNELS.includes(channel)) {
|
|
28
|
-
throw new Error(`Unsupported channel: ${input}. Supported: ${SUPPORTED_CHANNELS.join(", ")}`);
|
|
29
|
-
}
|
|
30
|
-
return channel;
|
|
31
|
-
}
|
|
32
|
-
function normalizeOptionalText(value) {
|
|
33
|
-
const text = String(value || "").trim();
|
|
34
|
-
return text || undefined;
|
|
35
|
-
}
|
|
36
|
-
function normalizeChannelAccountIdToken(value) {
|
|
37
|
-
const token = String(value || "")
|
|
38
|
-
.trim()
|
|
39
|
-
.toLowerCase()
|
|
40
|
-
.replace(/[^a-z0-9_-]+/g, "-")
|
|
41
|
-
.replace(/-+/g, "-")
|
|
42
|
-
.replace(/^-+/, "")
|
|
43
|
-
.replace(/-+$/, "");
|
|
44
|
-
return token || "bot";
|
|
45
|
-
}
|
|
46
|
-
function pickFirstNonEmpty(inputs) {
|
|
47
|
-
for (const input of inputs) {
|
|
48
|
-
const text = String(input || "").trim();
|
|
49
|
-
if (text)
|
|
50
|
-
return text;
|
|
51
|
-
}
|
|
52
|
-
return "";
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* ChatChannelAccountManager。
|
|
56
|
-
*/
|
|
57
|
-
export class ChatChannelAccountManager {
|
|
58
|
-
constructor() { }
|
|
59
|
-
/**
|
|
60
|
-
* 生成唯一 chat account id。
|
|
61
|
-
*
|
|
62
|
-
* 关键点(中文)
|
|
63
|
-
* - 账号 id 统一由系统生成,避免用户手填导致冲突或命名不一致。
|
|
64
|
-
* - 若碰撞则自动追加随机后缀重试。
|
|
65
|
-
*/
|
|
66
|
-
async generateUniqueAccountId(params) {
|
|
67
|
-
const seed = normalizeChannelAccountIdToken(params.seed || "");
|
|
68
|
-
const prefix = `${params.channel}-${seed}`.slice(0, 36);
|
|
69
|
-
for (let index = 0; index < 8; index += 1) {
|
|
70
|
-
const suffix = crypto.randomBytes(3).toString("hex");
|
|
71
|
-
const candidate = `${prefix}-${suffix}`.slice(0, 64);
|
|
72
|
-
const existing = getStoredChannelAccountSync(candidate);
|
|
73
|
-
if (!existing)
|
|
74
|
-
return candidate;
|
|
75
|
-
}
|
|
76
|
-
return `${params.channel}-${Date.now().toString(36)}`;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* 探测 bot 凭据并返回自动填充信息。
|
|
80
|
-
*/
|
|
81
|
-
async probe(input) {
|
|
82
|
-
const channel = assertChannel(input.channel);
|
|
83
|
-
const botInfo = await resolveChatChannelBotInfo({
|
|
84
|
-
channel,
|
|
85
|
-
credentials: {
|
|
86
|
-
botToken: normalizeOptionalText(input.botToken),
|
|
87
|
-
appId: normalizeOptionalText(input.appId),
|
|
88
|
-
appSecret: normalizeOptionalText(input.appSecret),
|
|
89
|
-
domain: normalizeOptionalText(input.domain),
|
|
90
|
-
sandbox: input.sandbox === true,
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
const accountId = await this.generateUniqueAccountId({
|
|
94
|
-
channel,
|
|
95
|
-
seed: pickFirstNonEmpty([
|
|
96
|
-
botInfo.idSeed,
|
|
97
|
-
botInfo.botUserId,
|
|
98
|
-
botInfo.identity,
|
|
99
|
-
botInfo.name,
|
|
100
|
-
"bot",
|
|
101
|
-
]),
|
|
102
|
-
});
|
|
103
|
-
return {
|
|
104
|
-
channel,
|
|
105
|
-
accountId,
|
|
106
|
-
name: botInfo.name,
|
|
107
|
-
identity: botInfo.identity,
|
|
108
|
-
owner: botInfo.owner,
|
|
109
|
-
creator: botInfo.creator,
|
|
110
|
-
botUserId: botInfo.botUserId,
|
|
111
|
-
message: botInfo.message,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* 使用凭据创建账号。
|
|
116
|
-
*
|
|
117
|
-
* 关键点(中文)
|
|
118
|
-
* - 默认先尝试探测 bot 信息,成功时自动填充名称与身份。
|
|
119
|
-
* - 探测失败但用户提供了名称时,仍允许先保存,便于后续排障。
|
|
120
|
-
*/
|
|
121
|
-
async create(input) {
|
|
122
|
-
const channel = assertChannel(input.channel);
|
|
123
|
-
let probeResult = null;
|
|
124
|
-
if (input.probe !== false) {
|
|
125
|
-
try {
|
|
126
|
-
probeResult = await this.probe({
|
|
127
|
-
channel,
|
|
128
|
-
botToken: input.botToken,
|
|
129
|
-
appId: input.appId,
|
|
130
|
-
appSecret: input.appSecret,
|
|
131
|
-
domain: input.domain,
|
|
132
|
-
sandbox: input.sandbox,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
if (!normalizeOptionalText(input.name)) {
|
|
137
|
-
throw error;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const id = probeResult?.accountId ||
|
|
142
|
-
(await this.generateUniqueAccountId({
|
|
143
|
-
channel,
|
|
144
|
-
seed: pickFirstNonEmpty([input.name, input.appId, "bot"]),
|
|
145
|
-
}));
|
|
146
|
-
const name = normalizeOptionalText(input.name) || probeResult?.name || `${channel} bot`;
|
|
147
|
-
await this.upsert({
|
|
148
|
-
id,
|
|
149
|
-
channel,
|
|
150
|
-
name,
|
|
151
|
-
identity: probeResult?.identity,
|
|
152
|
-
owner: probeResult?.owner,
|
|
153
|
-
creator: probeResult?.creator,
|
|
154
|
-
botToken: input.botToken,
|
|
155
|
-
appId: input.appId,
|
|
156
|
-
appSecret: input.appSecret,
|
|
157
|
-
domain: input.domain,
|
|
158
|
-
sandbox: input.sandbox,
|
|
159
|
-
});
|
|
160
|
-
return {
|
|
161
|
-
id,
|
|
162
|
-
probed: Boolean(probeResult),
|
|
163
|
-
message: probeResult?.message,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* 列出账户池(脱敏)。
|
|
168
|
-
*/
|
|
169
|
-
async list() {
|
|
170
|
-
return {
|
|
171
|
-
items: listStoredChannelAccountsSync().map((account) => toChannelAccountListItem(account)),
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* 新增或更新账号。
|
|
176
|
-
*/
|
|
177
|
-
async upsert(input) {
|
|
178
|
-
const id = String(input.id || "").trim();
|
|
179
|
-
if (!id)
|
|
180
|
-
throw new Error("chat account id cannot be empty");
|
|
181
|
-
const name = String(input.name || "").trim();
|
|
182
|
-
if (!name)
|
|
183
|
-
throw new Error("chat account name cannot be empty");
|
|
184
|
-
const channel = normalizeChannelAccountChannel(input.channel);
|
|
185
|
-
if (input.botToken !== undefined && input.clearBotToken === true) {
|
|
186
|
-
throw new Error("botToken and clearBotToken cannot be used together");
|
|
187
|
-
}
|
|
188
|
-
if (input.appId !== undefined && input.clearAppId === true) {
|
|
189
|
-
throw new Error("appId and clearAppId cannot be used together");
|
|
190
|
-
}
|
|
191
|
-
if (input.appSecret !== undefined && input.clearAppSecret === true) {
|
|
192
|
-
throw new Error("appSecret and clearAppSecret cannot be used together");
|
|
193
|
-
}
|
|
194
|
-
const current = getStoredChannelAccountSync(id);
|
|
195
|
-
const nextBotToken = input.clearBotToken
|
|
196
|
-
? undefined
|
|
197
|
-
: input.botToken !== undefined
|
|
198
|
-
? normalizeOptionalText(input.botToken)
|
|
199
|
-
: current?.botToken;
|
|
200
|
-
const nextAppId = input.clearAppId
|
|
201
|
-
? undefined
|
|
202
|
-
: input.appId !== undefined
|
|
203
|
-
? normalizeOptionalText(input.appId)
|
|
204
|
-
: current?.appId;
|
|
205
|
-
const nextAppSecret = input.clearAppSecret
|
|
206
|
-
? undefined
|
|
207
|
-
: input.appSecret !== undefined
|
|
208
|
-
? normalizeOptionalText(input.appSecret)
|
|
209
|
-
: current?.appSecret;
|
|
210
|
-
const nextIdentity = Object.prototype.hasOwnProperty.call(input, "identity")
|
|
211
|
-
? normalizeOptionalText(input.identity)
|
|
212
|
-
: current?.identity;
|
|
213
|
-
const nextOwner = Object.prototype.hasOwnProperty.call(input, "owner")
|
|
214
|
-
? normalizeOptionalText(input.owner)
|
|
215
|
-
: current?.owner;
|
|
216
|
-
const nextCreator = Object.prototype.hasOwnProperty.call(input, "creator")
|
|
217
|
-
? normalizeOptionalText(input.creator)
|
|
218
|
-
: current?.creator;
|
|
219
|
-
await upsertStoredChannelAccount({
|
|
220
|
-
id,
|
|
221
|
-
channel,
|
|
222
|
-
name,
|
|
223
|
-
identity: nextIdentity,
|
|
224
|
-
owner: nextOwner,
|
|
225
|
-
creator: nextCreator,
|
|
226
|
-
botToken: nextBotToken,
|
|
227
|
-
appId: nextAppId,
|
|
228
|
-
appSecret: nextAppSecret,
|
|
229
|
-
domain: normalizeOptionalText(input.domain),
|
|
230
|
-
sandbox: input.sandbox === true,
|
|
231
|
-
});
|
|
232
|
-
return { id };
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* 删除账号。
|
|
236
|
-
*/
|
|
237
|
-
async remove(idInput) {
|
|
238
|
-
const id = String(idInput || "").trim();
|
|
239
|
-
if (!id)
|
|
240
|
-
throw new Error("chat account id cannot be empty");
|
|
241
|
-
await removeStoredChannelAccount(id);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
function toChannelAccountListItem(account) {
|
|
245
|
-
return {
|
|
246
|
-
id: account.id,
|
|
247
|
-
channel: account.channel,
|
|
248
|
-
name: account.name,
|
|
249
|
-
identity: account.identity,
|
|
250
|
-
owner: account.owner,
|
|
251
|
-
creator: account.creator,
|
|
252
|
-
domain: account.domain,
|
|
253
|
-
sandbox: account.sandbox === true,
|
|
254
|
-
hasBotToken: !!String(account.botToken || "").trim(),
|
|
255
|
-
hasAppId: !!String(account.appId || "").trim(),
|
|
256
|
-
hasAppSecret: !!String(account.appSecret || "").trim(),
|
|
257
|
-
botTokenMasked: maskSecret(account.botToken),
|
|
258
|
-
appIdMasked: maskSecret(account.appId),
|
|
259
|
-
appSecretMasked: maskSecret(account.appSecret),
|
|
260
|
-
createdAt: account.createdAt,
|
|
261
|
-
updatedAt: account.updatedAt,
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
//# sourceMappingURL=ChannelAccountManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelAccountManager.js","sourceRoot":"","sources":["../../../src/chat/accounts/ChannelAccountManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAUpB,MAAM,kBAAkB,GAA2C;IACjE,UAAU;IACV,QAAQ;IACR,IAAI;CACL,CAAC;AAEF,SAAS,UAAU,CAAC,KAAyB;IAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,GAAG,CAAC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S;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Channel account 默认存储加密工具。
|
|
3
|
-
*
|
|
4
|
-
* 职责说明(中文)
|
|
5
|
-
* - 负责默认 chat account 存储中的敏感字段加解密。
|
|
6
|
-
* - 复用 `DC_PLATFORM_ROOT` 下的平台级 `model-db.key`。
|
|
7
|
-
*
|
|
8
|
-
* 边界说明(中文)
|
|
9
|
-
* - 这里只处理“字符串 <-> 密文”的转换,不负责数据库读写。
|
|
10
|
-
* - 加密算法与密钥文件路径属于默认实现细节,上层不直接感知。
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* 同步加密字符串。
|
|
14
|
-
*/
|
|
15
|
-
export declare function encryptTextSync(plainText: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* 同步解密字符串。
|
|
18
|
-
*/
|
|
19
|
-
export declare function decryptTextSync(cipherText: string): string;
|
|
20
|
-
//# sourceMappingURL=Crypto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Crypto.d.ts","sourceRoot":"","sources":["../../../src/chat/accounts/Crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA4CH;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAa1D"}
|