@downcity/plugins 1.0.216 → 1.0.233
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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import type { Command } from "commander";
|
|
11
11
|
import type { PluginActions } from "@downcity/agent";
|
|
12
|
-
import {
|
|
12
|
+
import { create_action } from "@downcity/agent";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import type {
|
|
15
15
|
ChatDeleteActionPayload,
|
|
@@ -53,34 +53,28 @@ import {
|
|
|
53
53
|
const CHAT_SEND_HELP_TEXT = [
|
|
54
54
|
"",
|
|
55
55
|
"消息协议:",
|
|
56
|
-
" frontmatter metadata 字段语义与
|
|
56
|
+
" frontmatter metadata 字段语义与 Chat send action 输入一致。",
|
|
57
57
|
" 附件使用 `<file type=\"...\">path</file>`,支持 `document/photo/voice/audio/video`。",
|
|
58
58
|
" 正文与 `<file>` 可以交错出现,运行时会按原顺序发送。",
|
|
59
59
|
"",
|
|
60
60
|
"常用示例:",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
" cat <<'EOF' | downcity chat send --stdin --chat-key <chatKey>",
|
|
64
|
-
" 第一行",
|
|
65
|
-
" 第二行",
|
|
66
|
-
" EOF",
|
|
67
|
-
" downcity chat send --text-file ./result.md --chat-key <chatKey>",
|
|
61
|
+
" city plugin action chat send <agent_id> --input '{\"text\":\"done\"}' --token <token>",
|
|
62
|
+
" city plugin action chat send <agent_id> --input '{\"chat_key\":\"<chat_key>\",\"text\":\"done\"}' --token <token>",
|
|
68
63
|
"",
|
|
69
64
|
"说明:",
|
|
70
65
|
" 当前会话可省略 `--chat-key`;跨 chat 发送时必须显式传 `--chat-key`。",
|
|
71
|
-
"
|
|
66
|
+
" `delay` 与 `time` 互斥;ISO 时间必须带时区。",
|
|
72
67
|
].join("\n");
|
|
73
68
|
|
|
74
69
|
const CHAT_REACT_HELP_TEXT = [
|
|
75
70
|
"",
|
|
76
71
|
"常用示例:",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
" downcity chat react --chat-key <chatKey> --message-id <messageId> --emoji '🔥'",
|
|
72
|
+
" city plugin action chat react <agent_id> --input '{\"emoji\":\"👍\"}' --token <token>",
|
|
73
|
+
" city plugin action chat react <agent_id> --input '{\"chat_key\":\"<chat_key>\",\"message_id\":\"<message_id>\",\"emoji\":\"🔥\"}' --token <token>",
|
|
80
74
|
"",
|
|
81
75
|
"说明:",
|
|
82
76
|
" 当前会话可省略 `--chat-key`;跨 chat 操作时显式传 `--chat-key`。",
|
|
83
|
-
" `react` 需要目标消息,优先使用显式
|
|
77
|
+
" `react` 需要目标消息,优先使用显式 `message_id`。",
|
|
84
78
|
].join("\n");
|
|
85
79
|
|
|
86
80
|
function attachCommandHelpText(command: Command, text: string): void {
|
|
@@ -96,7 +90,7 @@ export function createChatPluginActions(params: {
|
|
|
96
90
|
channelState: ChatChannelState;
|
|
97
91
|
}): PluginActions {
|
|
98
92
|
return {
|
|
99
|
-
status:
|
|
93
|
+
status: create_action({
|
|
100
94
|
description: "View chat channel connection status.",
|
|
101
95
|
input_schema: {
|
|
102
96
|
zod: z.object({}).passthrough(),
|
|
@@ -107,7 +101,7 @@ export function createChatPluginActions(params: {
|
|
|
107
101
|
configure(command: Command) {
|
|
108
102
|
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
109
103
|
},
|
|
110
|
-
|
|
104
|
+
map_input: mapChatChannelCommandInput,
|
|
111
105
|
},
|
|
112
106
|
execute: async (actionParams) => {
|
|
113
107
|
return executeChatStatusAction({
|
|
@@ -117,7 +111,7 @@ export function createChatPluginActions(params: {
|
|
|
117
111
|
});
|
|
118
112
|
},
|
|
119
113
|
}),
|
|
120
|
-
test:
|
|
114
|
+
test: create_action({
|
|
121
115
|
description: "Test chat channel connectivity.",
|
|
122
116
|
input_schema: {
|
|
123
117
|
zod: z.object({}).passthrough(),
|
|
@@ -128,7 +122,7 @@ export function createChatPluginActions(params: {
|
|
|
128
122
|
configure(command: Command) {
|
|
129
123
|
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
130
124
|
},
|
|
131
|
-
|
|
125
|
+
map_input: mapChatChannelCommandInput,
|
|
132
126
|
},
|
|
133
127
|
execute: async (actionParams) => {
|
|
134
128
|
return executeChatTestAction({
|
|
@@ -138,7 +132,7 @@ export function createChatPluginActions(params: {
|
|
|
138
132
|
});
|
|
139
133
|
},
|
|
140
134
|
}),
|
|
141
|
-
reconnect:
|
|
135
|
+
reconnect: create_action({
|
|
142
136
|
description: "Reconnect chat channels, all by default.",
|
|
143
137
|
input_schema: {
|
|
144
138
|
zod: z.object({}).passthrough(),
|
|
@@ -149,7 +143,7 @@ export function createChatPluginActions(params: {
|
|
|
149
143
|
configure(command: Command) {
|
|
150
144
|
command.option("--channel <name>", "Specify channel (telegram|feishu|qq).");
|
|
151
145
|
},
|
|
152
|
-
|
|
146
|
+
map_input: mapChatChannelCommandInput,
|
|
153
147
|
},
|
|
154
148
|
execute: async (actionParams) => {
|
|
155
149
|
return executeChatReconnectAction({
|
|
@@ -159,21 +153,21 @@ export function createChatPluginActions(params: {
|
|
|
159
153
|
});
|
|
160
154
|
},
|
|
161
155
|
}),
|
|
162
|
-
list:
|
|
156
|
+
list: create_action({
|
|
163
157
|
description: "List chat conversations recorded by the current agent.",
|
|
164
158
|
input_schema: {
|
|
165
159
|
zod: z.object({}).passthrough(),
|
|
166
160
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
167
161
|
},
|
|
168
162
|
command: {
|
|
169
|
-
description: "List chat conversations recorded by the current agent (chatTitle/
|
|
163
|
+
description: "List chat conversations recorded by the current agent (chatTitle/chat_key).",
|
|
170
164
|
configure(command: Command) {
|
|
171
165
|
command
|
|
172
166
|
.option("--channel <name>", "Filter by channel (telegram|feishu|qq).")
|
|
173
167
|
.option("--limit <n>", "Return the latest N records, default 50.")
|
|
174
|
-
.option("--q <text>", "Keyword filter (title/chatId/
|
|
168
|
+
.option("--q <text>", "Keyword filter (title/chatId/session_id/actor).");
|
|
175
169
|
},
|
|
176
|
-
|
|
170
|
+
map_input: mapChatListCommandInput,
|
|
177
171
|
},
|
|
178
172
|
execute: async (actionParams) => {
|
|
179
173
|
return executeChatListAction({
|
|
@@ -182,7 +176,7 @@ export function createChatPluginActions(params: {
|
|
|
182
176
|
});
|
|
183
177
|
},
|
|
184
178
|
}),
|
|
185
|
-
info:
|
|
179
|
+
info: create_action({
|
|
186
180
|
description: "View route, paths, and context snapshot for a specified chat conversation.",
|
|
187
181
|
input_schema: {
|
|
188
182
|
zod: z.object({}).passthrough(),
|
|
@@ -192,27 +186,27 @@ export function createChatPluginActions(params: {
|
|
|
192
186
|
description: "View specified chat conversation info (route/local paths/context snapshot).",
|
|
193
187
|
configure(command: Command) {
|
|
194
188
|
command
|
|
195
|
-
.option("--chat-key <
|
|
196
|
-
.option("--session-id <
|
|
189
|
+
.option("--chat-key <chat_key>", "Target chat_key; reads DC_CTX_CHAT_KEY if omitted.")
|
|
190
|
+
.option("--session-id <session_id>", "Explicit session_id, with higher priority.");
|
|
197
191
|
},
|
|
198
|
-
|
|
192
|
+
map_input: mapChatInfoCommandInput,
|
|
199
193
|
},
|
|
200
194
|
execute: async (actionParams) => {
|
|
201
195
|
return executeChatInfoAction({
|
|
202
196
|
context: actionParams.context,
|
|
203
197
|
payload: actionParams.input as ChatInfoActionPayload,
|
|
204
|
-
|
|
198
|
+
execution_context: actionParams.execution_context,
|
|
205
199
|
});
|
|
206
200
|
},
|
|
207
201
|
}),
|
|
208
|
-
send:
|
|
209
|
-
description: "Send a message to the target
|
|
202
|
+
send: create_action({
|
|
203
|
+
description: "Send a message to the target chat_key, supporting text, attachments, and delay.",
|
|
210
204
|
input_schema: {
|
|
211
205
|
zod: z.object({}).passthrough(),
|
|
212
206
|
json_schema: { type: "object", properties: {}, additionalProperties: true },
|
|
213
207
|
},
|
|
214
208
|
command: {
|
|
215
|
-
description: "Send a message to the target
|
|
209
|
+
description: "Send a message to the target chat_key.",
|
|
216
210
|
configure(command: Command) {
|
|
217
211
|
command
|
|
218
212
|
.option("--text <text>", "Message body.")
|
|
@@ -221,22 +215,22 @@ export function createChatPluginActions(params: {
|
|
|
221
215
|
.option("--reply", "Explicitly reply to the target message with reply_to_message.", false)
|
|
222
216
|
.option("--message-id <id>", "Explicit reply target message ID.")
|
|
223
217
|
.option(
|
|
224
|
-
"--chat-key <
|
|
225
|
-
"Target
|
|
218
|
+
"--chat-key <chat_key>",
|
|
219
|
+
"Target chat_key; reads DC_CTX_CHAT_KEY if omitted.",
|
|
226
220
|
);
|
|
227
221
|
attachCommandHelpText(command, CHAT_SEND_HELP_TEXT);
|
|
228
222
|
},
|
|
229
|
-
|
|
223
|
+
map_input: mapChatSendCommandInput,
|
|
230
224
|
},
|
|
231
225
|
execute: async (actionParams) => {
|
|
232
226
|
return executeChatSendAction({
|
|
233
227
|
context: actionParams.context,
|
|
234
228
|
payload: actionParams.input as ChatSendActionPayload,
|
|
235
|
-
|
|
229
|
+
execution_context: actionParams.execution_context,
|
|
236
230
|
});
|
|
237
231
|
},
|
|
238
232
|
}),
|
|
239
|
-
react:
|
|
233
|
+
react: create_action({
|
|
240
234
|
description: "React to a target message, currently supported only by Telegram.",
|
|
241
235
|
input_schema: {
|
|
242
236
|
zod: z.object({}).passthrough(),
|
|
@@ -250,22 +244,22 @@ export function createChatPluginActions(params: {
|
|
|
250
244
|
.option("--big", "Use large reaction effect (Telegram is_big).", false)
|
|
251
245
|
.option("--message-id <id>", "Target message ID; defaults to chat meta when available.")
|
|
252
246
|
.option(
|
|
253
|
-
"--chat-key <
|
|
254
|
-
"Target
|
|
247
|
+
"--chat-key <chat_key>",
|
|
248
|
+
"Target chat_key; reads DC_CTX_CHAT_KEY if omitted.",
|
|
255
249
|
);
|
|
256
250
|
attachCommandHelpText(command, CHAT_REACT_HELP_TEXT);
|
|
257
251
|
},
|
|
258
|
-
|
|
252
|
+
map_input: mapChatReactCommandInput,
|
|
259
253
|
},
|
|
260
254
|
execute: async (actionParams) => {
|
|
261
255
|
return executeChatReactAction({
|
|
262
256
|
context: actionParams.context,
|
|
263
257
|
payload: actionParams.input as ChatReactActionPayload,
|
|
264
|
-
|
|
258
|
+
execution_context: actionParams.execution_context,
|
|
265
259
|
});
|
|
266
260
|
},
|
|
267
261
|
}),
|
|
268
|
-
context:
|
|
262
|
+
context: create_action({
|
|
269
263
|
description: "View current conversation context snapshot.",
|
|
270
264
|
input_schema: {
|
|
271
265
|
zod: z.object({}).passthrough(),
|
|
@@ -274,13 +268,13 @@ export function createChatPluginActions(params: {
|
|
|
274
268
|
command: {
|
|
275
269
|
description: "View current conversation context snapshot.",
|
|
276
270
|
configure(command: Command) {
|
|
277
|
-
command.option("--chat-key <
|
|
271
|
+
command.option("--chat-key <chat_key>", "Explicitly override chat_key.");
|
|
278
272
|
},
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
typeof input.opts.
|
|
273
|
+
map_input(input) {
|
|
274
|
+
const chat_key =
|
|
275
|
+
typeof input.opts.chat_key === "string" ? String(input.opts.chat_key).trim() : "";
|
|
282
276
|
return {
|
|
283
|
-
...(
|
|
277
|
+
...(chat_key ? { chat_key } : {}),
|
|
284
278
|
};
|
|
285
279
|
},
|
|
286
280
|
},
|
|
@@ -288,11 +282,11 @@ export function createChatPluginActions(params: {
|
|
|
288
282
|
return executeChatContextAction({
|
|
289
283
|
context: actionParams.context,
|
|
290
284
|
payload: actionParams.input as ChatSessionActionPayload,
|
|
291
|
-
|
|
285
|
+
execution_context: actionParams.execution_context,
|
|
292
286
|
});
|
|
293
287
|
},
|
|
294
288
|
}),
|
|
295
|
-
delete:
|
|
289
|
+
delete: create_action({
|
|
296
290
|
description: "Permanently delete a specified chat conversation, including mapping, history, and context.",
|
|
297
291
|
input_schema: {
|
|
298
292
|
zod: z.object({}).passthrough(),
|
|
@@ -302,20 +296,20 @@ export function createChatPluginActions(params: {
|
|
|
302
296
|
description: "Permanently delete a specified chat conversation, including mapping, history, and context.",
|
|
303
297
|
configure(command: Command) {
|
|
304
298
|
command
|
|
305
|
-
.option("--chat-key <
|
|
306
|
-
.option("--session-id <
|
|
299
|
+
.option("--chat-key <chat_key>", "Explicit chat_key.")
|
|
300
|
+
.option("--session-id <session_id>", "Explicit session_id.");
|
|
307
301
|
},
|
|
308
|
-
|
|
302
|
+
map_input: mapChatDeleteCommandInput,
|
|
309
303
|
},
|
|
310
304
|
execute: async (actionParams) => {
|
|
311
305
|
return executeChatDeleteAction({
|
|
312
306
|
context: actionParams.context,
|
|
313
307
|
payload: actionParams.input as ChatDeleteActionPayload,
|
|
314
|
-
|
|
308
|
+
execution_context: actionParams.execution_context,
|
|
315
309
|
});
|
|
316
310
|
},
|
|
317
311
|
}),
|
|
318
|
-
history:
|
|
312
|
+
history: create_action({
|
|
319
313
|
description: "Read chat history messages.",
|
|
320
314
|
input_schema: {
|
|
321
315
|
zod: z.object({}).passthrough(),
|
|
@@ -325,8 +319,8 @@ export function createChatPluginActions(params: {
|
|
|
325
319
|
description: "Read chat history messages, defaulting to the latest 30.",
|
|
326
320
|
configure(command: Command) {
|
|
327
321
|
command
|
|
328
|
-
.option("--chat-key <
|
|
329
|
-
.option("--session-id <
|
|
322
|
+
.option("--chat-key <chat_key>", "Explicitly override chat_key.")
|
|
323
|
+
.option("--session-id <session_id>", "Explicitly override session_id.")
|
|
330
324
|
.option("--limit <n>", "Return the latest N records, default 30.")
|
|
331
325
|
.option(
|
|
332
326
|
"--direction <direction>",
|
|
@@ -335,24 +329,24 @@ export function createChatPluginActions(params: {
|
|
|
335
329
|
.option("--before-ts <ts>", "Return only records with ts lower than this value, in milliseconds.")
|
|
336
330
|
.option("--after-ts <ts>", "Return only records with ts greater than this value, in milliseconds.");
|
|
337
331
|
},
|
|
338
|
-
|
|
332
|
+
map_input: mapChatHistoryCommandInput,
|
|
339
333
|
},
|
|
340
334
|
execute: async (actionParams) => {
|
|
341
335
|
return executeChatHistoryAction({
|
|
342
336
|
context: actionParams.context,
|
|
343
337
|
payload: actionParams.input as ChatHistoryActionPayload,
|
|
344
|
-
|
|
338
|
+
execution_context: actionParams.execution_context,
|
|
345
339
|
});
|
|
346
340
|
},
|
|
347
341
|
}),
|
|
348
|
-
history_clear:
|
|
342
|
+
history_clear: create_action({
|
|
349
343
|
description: "Clear the Chat Plugin event history for one Session.",
|
|
350
344
|
input_schema: {
|
|
351
|
-
zod: z.object({
|
|
345
|
+
zod: z.object({ session_id: z.string().min(1) }),
|
|
352
346
|
json_schema: {
|
|
353
347
|
type: "object",
|
|
354
|
-
properties: {
|
|
355
|
-
required: ["
|
|
348
|
+
properties: { session_id: { type: "string" } },
|
|
349
|
+
required: ["session_id"],
|
|
356
350
|
additionalProperties: false,
|
|
357
351
|
},
|
|
358
352
|
},
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* - 当前请求只注入当前 chat platform 的 prompt,避免平台规则串味。
|
|
7
7
|
* - 该模块只负责 prompt 解析与拼装,不承担运行态控制职责。
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { PluginContext } from "@downcity/agent";
|
|
10
|
+
import type { PluginExecutionContext } from "@downcity/agent";
|
|
11
11
|
import {
|
|
12
12
|
buildCurrentChatEnvironmentPrompt,
|
|
13
13
|
resolveCurrentChatEnvironmentPromptInput,
|
|
@@ -42,12 +42,12 @@ function resolveCurrentChatPromptChannel(
|
|
|
42
42
|
* - 若当前 context 不是 chat platform(如 Console UI)或尚无路由元信息,则不注入 platform prompt。
|
|
43
43
|
*/
|
|
44
44
|
export async function buildCurrentChannelPrompts(
|
|
45
|
-
context:
|
|
46
|
-
|
|
45
|
+
context: PluginContext,
|
|
46
|
+
execution_context?: PluginExecutionContext,
|
|
47
47
|
): Promise<string[]> {
|
|
48
48
|
const chatEnvironment = await resolveCurrentChatEnvironmentPromptInput(
|
|
49
49
|
context,
|
|
50
|
-
|
|
50
|
+
execution_context,
|
|
51
51
|
);
|
|
52
52
|
if (!chatEnvironment) return [];
|
|
53
53
|
const channel = resolveCurrentChatPromptChannel(
|
|
@@ -63,13 +63,13 @@ export async function buildCurrentChannelPrompts(
|
|
|
63
63
|
* 构建 chat plugin 注入到 session 的 system 文本。
|
|
64
64
|
*/
|
|
65
65
|
export async function buildChatPluginSystem(
|
|
66
|
-
context:
|
|
67
|
-
|
|
66
|
+
context: PluginContext,
|
|
67
|
+
execution_context?: PluginExecutionContext,
|
|
68
68
|
): Promise<string> {
|
|
69
69
|
return [
|
|
70
70
|
CHAT_PLUGIN_PROMPT,
|
|
71
|
-
await buildCurrentChatEnvironmentPrompt(context,
|
|
72
|
-
...(await buildCurrentChannelPrompts(context,
|
|
71
|
+
await buildCurrentChatEnvironmentPrompt(context, execution_context),
|
|
72
|
+
...(await buildCurrentChannelPrompts(context, execution_context)),
|
|
73
73
|
]
|
|
74
74
|
.filter(Boolean)
|
|
75
75
|
.join("\n\n");
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { Logger } from "@downcity/agent";
|
|
10
|
-
import type {
|
|
10
|
+
import type { PluginContext } from "@downcity/agent";
|
|
11
11
|
import { parseDirectDispatchAssistantText } from "./DirectDispatchParser.js";
|
|
12
12
|
import { sendActionByChatKey } from "./ChatkeySend.js";
|
|
13
13
|
import { sendChatTextByChatKey } from "../Action.js";
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
*/
|
|
23
23
|
export async function dispatchAssistantTextDirect(params: {
|
|
24
24
|
logger: Logger;
|
|
25
|
-
context:
|
|
26
|
-
|
|
25
|
+
context: PluginContext;
|
|
26
|
+
session_id: string;
|
|
27
27
|
assistantText: string;
|
|
28
28
|
phase?: "step" | "final" | "error";
|
|
29
29
|
}): Promise<boolean> {
|
|
30
30
|
const plan = parseDirectDispatchAssistantText({
|
|
31
31
|
assistantText: params.assistantText,
|
|
32
|
-
fallbackChatKey: params.
|
|
32
|
+
fallbackChatKey: params.session_id,
|
|
33
33
|
});
|
|
34
34
|
if (!plan) return false;
|
|
35
35
|
let textDispatchSucceeded = false;
|
|
@@ -37,18 +37,18 @@ export async function dispatchAssistantTextDirect(params: {
|
|
|
37
37
|
if (plan.text) {
|
|
38
38
|
const target = await resolveChatReplyTarget({
|
|
39
39
|
context: params.context,
|
|
40
|
-
|
|
40
|
+
chat_key: plan.text.chat_key,
|
|
41
41
|
});
|
|
42
42
|
const preparedText = await prepareChatReplyText({
|
|
43
43
|
context: params.context,
|
|
44
44
|
input: {
|
|
45
|
-
|
|
45
|
+
chat_key: plan.text.chat_key,
|
|
46
46
|
...(target.channel ? { channel: target.channel } : {}),
|
|
47
47
|
...(typeof target.chatId === "string" ? { chatId: target.chatId } : {}),
|
|
48
|
-
...(typeof plan.text.
|
|
49
|
-
? {
|
|
50
|
-
: typeof target.
|
|
51
|
-
? {
|
|
48
|
+
...(typeof plan.text.message_id === "string"
|
|
49
|
+
? { message_id: plan.text.message_id }
|
|
50
|
+
: typeof target.message_id === "string"
|
|
51
|
+
? { message_id: target.message_id }
|
|
52
52
|
: {}),
|
|
53
53
|
text: plan.text.text,
|
|
54
54
|
phase: params.phase || "final",
|
|
@@ -57,27 +57,27 @@ export async function dispatchAssistantTextDirect(params: {
|
|
|
57
57
|
});
|
|
58
58
|
const textResult = await sendChatTextByChatKey({
|
|
59
59
|
context: params.context,
|
|
60
|
-
|
|
60
|
+
chat_key: plan.text.chat_key,
|
|
61
61
|
text: preparedText,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
...(typeof plan.text.
|
|
65
|
-
? {
|
|
62
|
+
reply_to_message: plan.text.reply_to_message,
|
|
63
|
+
message_id: plan.text.message_id,
|
|
64
|
+
...(typeof plan.text.delay_ms === "number"
|
|
65
|
+
? { delay_ms: plan.text.delay_ms }
|
|
66
66
|
: {}),
|
|
67
|
-
...(typeof plan.text.
|
|
68
|
-
? {
|
|
67
|
+
...(typeof plan.text.send_at_ms === "number"
|
|
68
|
+
? { send_at_ms: plan.text.send_at_ms }
|
|
69
69
|
: {}),
|
|
70
70
|
});
|
|
71
71
|
await emitChatReplyEffect({
|
|
72
72
|
context: params.context,
|
|
73
73
|
input: {
|
|
74
|
-
|
|
74
|
+
chat_key: plan.text.chat_key,
|
|
75
75
|
...(target.channel ? { channel: target.channel } : {}),
|
|
76
76
|
...(typeof target.chatId === "string" ? { chatId: target.chatId } : {}),
|
|
77
|
-
...(typeof plan.text.
|
|
78
|
-
? {
|
|
79
|
-
: typeof target.
|
|
80
|
-
? {
|
|
77
|
+
...(typeof plan.text.message_id === "string"
|
|
78
|
+
? { message_id: plan.text.message_id }
|
|
79
|
+
: typeof target.message_id === "string"
|
|
80
|
+
? { message_id: target.message_id }
|
|
81
81
|
: {}),
|
|
82
82
|
text: preparedText,
|
|
83
83
|
phase: params.phase || "final",
|
|
@@ -88,8 +88,8 @@ export async function dispatchAssistantTextDirect(params: {
|
|
|
88
88
|
});
|
|
89
89
|
if (!textResult.success) {
|
|
90
90
|
params.logger.warn("Direct chat text dispatch failed", {
|
|
91
|
-
|
|
92
|
-
targetChatKey: plan.text.
|
|
91
|
+
session_id: params.session_id,
|
|
92
|
+
targetChatKey: plan.text.chat_key,
|
|
93
93
|
error: textResult.error || "chat send failed",
|
|
94
94
|
});
|
|
95
95
|
} else {
|
|
@@ -100,16 +100,16 @@ export async function dispatchAssistantTextDirect(params: {
|
|
|
100
100
|
for (const reaction of plan.reactions) {
|
|
101
101
|
const reactResult = await sendActionByChatKey({
|
|
102
102
|
context: params.context,
|
|
103
|
-
|
|
103
|
+
chat_key: reaction.chat_key,
|
|
104
104
|
action: "react",
|
|
105
|
-
|
|
105
|
+
message_id: reaction.message_id,
|
|
106
106
|
reactionEmoji: reaction.emoji,
|
|
107
107
|
reactionIsBig: reaction.big,
|
|
108
108
|
});
|
|
109
109
|
if (!reactResult.success) {
|
|
110
110
|
params.logger.warn("Direct chat reaction dispatch failed", {
|
|
111
|
-
|
|
112
|
-
targetChatKey: reaction.
|
|
111
|
+
session_id: params.session_id,
|
|
112
|
+
targetChatKey: reaction.chat_key,
|
|
113
113
|
error: reactResult.error || "chat react failed",
|
|
114
114
|
});
|
|
115
115
|
}
|
|
@@ -123,28 +123,28 @@ export async function dispatchAssistantTextDirect(params: {
|
|
|
123
123
|
*/
|
|
124
124
|
export async function dispatchTextToChannel(params: {
|
|
125
125
|
logger: Logger;
|
|
126
|
-
context:
|
|
127
|
-
|
|
126
|
+
context: PluginContext;
|
|
127
|
+
session_id: string;
|
|
128
128
|
text: string;
|
|
129
|
-
|
|
129
|
+
message_id?: string;
|
|
130
130
|
phase?: "step" | "final" | "error";
|
|
131
131
|
}): Promise<boolean> {
|
|
132
132
|
const text = String(params.text || "").trim();
|
|
133
133
|
if (!text) return false;
|
|
134
134
|
const target = await resolveChatReplyTarget({
|
|
135
135
|
context: params.context,
|
|
136
|
-
|
|
136
|
+
chat_key: params.session_id,
|
|
137
137
|
});
|
|
138
138
|
const preparedText = await prepareChatReplyText({
|
|
139
139
|
context: params.context,
|
|
140
140
|
input: {
|
|
141
|
-
|
|
141
|
+
chat_key: params.session_id,
|
|
142
142
|
...(target.channel ? { channel: target.channel } : {}),
|
|
143
143
|
...(typeof target.chatId === "string" ? { chatId: target.chatId } : {}),
|
|
144
|
-
...(typeof params.
|
|
145
|
-
? {
|
|
146
|
-
: typeof target.
|
|
147
|
-
? {
|
|
144
|
+
...(typeof params.message_id === "string"
|
|
145
|
+
? { message_id: params.message_id }
|
|
146
|
+
: typeof target.message_id === "string"
|
|
147
|
+
? { message_id: target.message_id }
|
|
148
148
|
: {}),
|
|
149
149
|
text,
|
|
150
150
|
phase: params.phase || "final",
|
|
@@ -154,23 +154,23 @@ export async function dispatchTextToChannel(params: {
|
|
|
154
154
|
|
|
155
155
|
const result = await sendChatTextByChatKey({
|
|
156
156
|
context: params.context,
|
|
157
|
-
|
|
157
|
+
chat_key: params.session_id,
|
|
158
158
|
text: preparedText,
|
|
159
|
-
|
|
160
|
-
...(typeof params.
|
|
161
|
-
? {
|
|
159
|
+
reply_to_message: true,
|
|
160
|
+
...(typeof params.message_id === "string" && params.message_id
|
|
161
|
+
? { message_id: params.message_id }
|
|
162
162
|
: {}),
|
|
163
163
|
});
|
|
164
164
|
await emitChatReplyEffect({
|
|
165
165
|
context: params.context,
|
|
166
166
|
input: {
|
|
167
|
-
|
|
167
|
+
chat_key: params.session_id,
|
|
168
168
|
...(target.channel ? { channel: target.channel } : {}),
|
|
169
169
|
...(typeof target.chatId === "string" ? { chatId: target.chatId } : {}),
|
|
170
|
-
...(typeof params.
|
|
171
|
-
? {
|
|
172
|
-
: typeof target.
|
|
173
|
-
? {
|
|
170
|
+
...(typeof params.message_id === "string"
|
|
171
|
+
? { message_id: params.message_id }
|
|
172
|
+
: typeof target.message_id === "string"
|
|
173
|
+
? { message_id: target.message_id }
|
|
174
174
|
: {}),
|
|
175
175
|
text: preparedText,
|
|
176
176
|
phase: params.phase || "final",
|
|
@@ -182,7 +182,7 @@ export async function dispatchTextToChannel(params: {
|
|
|
182
182
|
|
|
183
183
|
if (!result.success) {
|
|
184
184
|
params.logger.warn("ChatQueueWorker forced channel dispatch failed", {
|
|
185
|
-
|
|
185
|
+
session_id: params.session_id,
|
|
186
186
|
error: result.error || "chat send failed",
|
|
187
187
|
});
|
|
188
188
|
return false;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 旧的 `ChatQueue.ts` 会保留共享门面,逐步迁移到显式实例注入。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type { PluginContext } from "@downcity/agent";
|
|
11
11
|
import type {
|
|
12
12
|
ChatQueueEnqueueParams,
|
|
13
13
|
ChatQueueEnqueueResult,
|
|
@@ -58,7 +58,7 @@ export interface ChatQueueStorePort {
|
|
|
58
58
|
*
|
|
59
59
|
* 关键点(中文)
|
|
60
60
|
* - 迁移阶段仍保留一份共享实例,避免一次性改动所有旧入口。
|
|
61
|
-
* - 新代码应优先通过 `
|
|
61
|
+
* - 新代码应优先通过 `PluginContext.agent` 解析显式 queue store。
|
|
62
62
|
*/
|
|
63
63
|
/**
|
|
64
64
|
* Chat queue 实例级存储。
|
|
@@ -96,7 +96,7 @@ export class ChatQueueStore implements ChatQueueStorePort {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
enqueue(params: ChatQueueEnqueueParams): ChatQueueEnqueueResult {
|
|
99
|
-
const laneKey = this.normalizeLaneKey(params.
|
|
99
|
+
const laneKey = this.normalizeLaneKey(params.session_id);
|
|
100
100
|
const lane = this.getLane(laneKey);
|
|
101
101
|
const item: ChatQueueItem = {
|
|
102
102
|
...params,
|
|
@@ -174,7 +174,7 @@ export function getSharedChatQueueStore(): ChatQueueStore {
|
|
|
174
174
|
* - 新路径优先读取当前 Agent 注册的 ChatPlugin 实例。
|
|
175
175
|
* - 迁移阶段若拿不到,则回退到共享 queue store,保证旧入口可继续工作。
|
|
176
176
|
*/
|
|
177
|
-
export function resolveChatQueueStore(context?:
|
|
177
|
+
export function resolveChatQueueStore(context?: PluginContext): ChatQueueStorePort {
|
|
178
178
|
const chatService = context?.plugins.get("chat") as
|
|
179
179
|
| { queueStore?: ChatQueueStorePort }
|
|
180
180
|
| undefined;
|