@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
package/src/skill/Plugin.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { BasePlugin } from "@downcity/agent";
|
|
12
|
-
import {
|
|
12
|
+
import { create_action } from "@downcity/agent";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import type { Plugin } from "@downcity/agent";
|
|
15
15
|
import type { JsonObject, JsonValue } from "@downcity/agent";
|
|
@@ -60,17 +60,17 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
60
60
|
title: "Skill Catalog And Loader",
|
|
61
61
|
description:
|
|
62
62
|
"Lists and reads local skills, and injects scan-aware discovery and installation guidance into system prompts.",
|
|
63
|
-
async system(context,
|
|
63
|
+
async system(context, execution_context) {
|
|
64
64
|
const dynamicText = String(
|
|
65
65
|
await buildSkillsSystemText({
|
|
66
|
-
rootPath: context.
|
|
66
|
+
rootPath: context.workspace_path,
|
|
67
67
|
options,
|
|
68
|
-
},
|
|
68
|
+
}, execution_context),
|
|
69
69
|
).trim();
|
|
70
70
|
return [SKILL_PLUGIN_PROMPT, dynamicText].filter(Boolean).join("\n\n");
|
|
71
71
|
},
|
|
72
72
|
actions: {
|
|
73
|
-
[SKILL_PLUGIN_ACTIONS.find]:
|
|
73
|
+
[SKILL_PLUGIN_ACTIONS.find]: create_action({
|
|
74
74
|
description:
|
|
75
75
|
"Return shell instructions for finding a skill. This action does not execute the search.",
|
|
76
76
|
input_schema: {
|
|
@@ -100,7 +100,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
100
100
|
configure(command) {
|
|
101
101
|
command.argument("<query>");
|
|
102
102
|
},
|
|
103
|
-
|
|
103
|
+
map_input({ args }): SkillPluginFindPayload {
|
|
104
104
|
const query = String(args[0] || "").trim();
|
|
105
105
|
if (!query) throw new Error("Missing query");
|
|
106
106
|
return { query };
|
|
@@ -119,7 +119,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
119
119
|
};
|
|
120
120
|
},
|
|
121
121
|
}),
|
|
122
|
-
[SKILL_PLUGIN_ACTIONS.install]:
|
|
122
|
+
[SKILL_PLUGIN_ACTIONS.install]: create_action({
|
|
123
123
|
description:
|
|
124
124
|
"Return scan-aware shell instructions for installing a skill. This action does not install anything.",
|
|
125
125
|
input_schema: {
|
|
@@ -149,7 +149,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
149
149
|
configure(command) {
|
|
150
150
|
command.argument("<spec>");
|
|
151
151
|
},
|
|
152
|
-
|
|
152
|
+
map_input({ args }): SkillPluginInstallPayload {
|
|
153
153
|
const spec = String(args[0] || "").trim();
|
|
154
154
|
if (!spec) throw new Error("Missing spec");
|
|
155
155
|
return { spec };
|
|
@@ -164,7 +164,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
164
164
|
kind: "instructions",
|
|
165
165
|
spec: payload.spec,
|
|
166
166
|
prompt: render_skill_install_prompt(
|
|
167
|
-
params.context.
|
|
167
|
+
params.context.workspace_path,
|
|
168
168
|
options,
|
|
169
169
|
payload.spec,
|
|
170
170
|
),
|
|
@@ -172,7 +172,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
172
172
|
};
|
|
173
173
|
},
|
|
174
174
|
}),
|
|
175
|
-
[SKILL_PLUGIN_ACTIONS.list]:
|
|
175
|
+
[SKILL_PLUGIN_ACTIONS.list]: create_action({
|
|
176
176
|
description: "List currently learned skills discoverable locally.",
|
|
177
177
|
input_schema: {
|
|
178
178
|
zod: z.object({}).passthrough(),
|
|
@@ -189,7 +189,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
189
189
|
],
|
|
190
190
|
command: {
|
|
191
191
|
description: "List currently learned skills discoverable locally.",
|
|
192
|
-
|
|
192
|
+
map_input() {
|
|
193
193
|
return {};
|
|
194
194
|
},
|
|
195
195
|
},
|
|
@@ -199,11 +199,11 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
199
199
|
execute(params): PluginActionResult<JsonObject> {
|
|
200
200
|
return {
|
|
201
201
|
success: true,
|
|
202
|
-
data: listSkills(params.context.
|
|
202
|
+
data: listSkills(params.context.workspace_path, options) as unknown as JsonObject,
|
|
203
203
|
};
|
|
204
204
|
},
|
|
205
205
|
}),
|
|
206
|
-
[SKILL_PLUGIN_ACTIONS.lookup]:
|
|
206
|
+
[SKILL_PLUGIN_ACTIONS.lookup]: create_action({
|
|
207
207
|
description: "Read learned skill content (SKILL.md).",
|
|
208
208
|
input_schema: {
|
|
209
209
|
zod: z.object({
|
|
@@ -228,7 +228,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
228
228
|
configure(command) {
|
|
229
229
|
command.argument("<name>");
|
|
230
230
|
},
|
|
231
|
-
|
|
231
|
+
map_input({ args }): SkillPluginLookupPayload {
|
|
232
232
|
const name = String(args[0] || "").trim();
|
|
233
233
|
if (!name) throw new Error("Missing name");
|
|
234
234
|
return { name };
|
|
@@ -236,7 +236,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
236
236
|
},
|
|
237
237
|
api: {
|
|
238
238
|
method: "POST",
|
|
239
|
-
async
|
|
239
|
+
async map_input(c): Promise<SkillPluginLookupPayload> {
|
|
240
240
|
const body = readJsonObject(await c.req.json());
|
|
241
241
|
const name = String(body.name || "").trim();
|
|
242
242
|
if (!name) throw new Error("Missing name");
|
|
@@ -246,7 +246,7 @@ function createSkillPluginDefinition(options: SkillPluginOptions): Plugin {
|
|
|
246
246
|
async execute(params): Promise<PluginActionResult<JsonObject>> {
|
|
247
247
|
const payload = params.input as SkillPluginLookupPayload;
|
|
248
248
|
const result = await lookupSkill({
|
|
249
|
-
|
|
249
|
+
project_root: params.context.workspace_path,
|
|
250
250
|
request: {
|
|
251
251
|
name: payload.name,
|
|
252
252
|
},
|
|
@@ -57,7 +57,7 @@ function shouldIgnoreSkill(
|
|
|
57
57
|
* 扫描并发现本地 skills。
|
|
58
58
|
*
|
|
59
59
|
* 关键点(中文)
|
|
60
|
-
* - skills 的扫描根目录与
|
|
60
|
+
* - skills 的扫描根目录与 project_root 强相关(默认 `.agents/skills`)
|
|
61
61
|
* - 这里做成同步函数:启动时扫描一次,产出 prompt section 与 tools 索引
|
|
62
62
|
*/
|
|
63
63
|
/**
|
|
@@ -68,10 +68,10 @@ function shouldIgnoreSkill(
|
|
|
68
68
|
* 4) 最终按 name 排序,保证输出稳定
|
|
69
69
|
*/
|
|
70
70
|
export function discoverSkillsSync(
|
|
71
|
-
|
|
71
|
+
project_root: string,
|
|
72
72
|
options?: SkillPluginOptions | null,
|
|
73
73
|
): SkillDefinition[] {
|
|
74
|
-
const root = String(
|
|
74
|
+
const root = String(project_root || "").trim();
|
|
75
75
|
if (!root) return [];
|
|
76
76
|
const resolvedOptions = resolveSkillPluginOptions(options);
|
|
77
77
|
const roots = getSkillSearchRoots(root, resolvedOptions);
|
|
@@ -29,15 +29,15 @@ function normalizeSkillRootCandidate(candidate: string): string {
|
|
|
29
29
|
return normalized;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function resolveSkillRootPath(
|
|
32
|
+
function resolveSkillRootPath(project_root: string, raw: string): string {
|
|
33
33
|
const expanded = expandHome(raw);
|
|
34
34
|
return path.isAbsolute(expanded)
|
|
35
35
|
? path.normalize(expanded)
|
|
36
|
-
: path.resolve(
|
|
36
|
+
: path.resolve(project_root, expanded);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export function getSkillSearchRoots(
|
|
40
|
-
|
|
40
|
+
project_root: string,
|
|
41
41
|
options?: SkillPluginOptions | null,
|
|
42
42
|
): SkillRoot[] {
|
|
43
43
|
const skillPluginOptions = resolveSkillPluginOptions(options);
|
|
@@ -58,7 +58,7 @@ export function getSkillSearchRoots(
|
|
|
58
58
|
|
|
59
59
|
// 1) project roots(最高优先级)
|
|
60
60
|
for (const raw of rawProject) {
|
|
61
|
-
const resolved = normalizeSkillRootCandidate(resolveSkillRootPath(
|
|
61
|
+
const resolved = normalizeSkillRootCandidate(resolveSkillRootPath(project_root, raw));
|
|
62
62
|
roots.push({
|
|
63
63
|
source: "project",
|
|
64
64
|
raw,
|
|
@@ -71,7 +71,7 @@ export function getSkillSearchRoots(
|
|
|
71
71
|
|
|
72
72
|
// 2) constructor paths:用户显式传入的路径,统一视为 custom 来源
|
|
73
73
|
for (const raw of rawConfigured) {
|
|
74
|
-
const resolved = normalizeSkillRootCandidate(resolveSkillRootPath(
|
|
74
|
+
const resolved = normalizeSkillRootCandidate(resolveSkillRootPath(project_root, raw));
|
|
75
75
|
roots.push({
|
|
76
76
|
source: "custom",
|
|
77
77
|
raw,
|
|
@@ -84,7 +84,7 @@ export function getSkillSearchRoots(
|
|
|
84
84
|
|
|
85
85
|
// 3) home root(用户目录)
|
|
86
86
|
for (const raw of rawHome) {
|
|
87
|
-
const resolved = normalizeSkillRootCandidate(resolveSkillRootPath(
|
|
87
|
+
const resolved = normalizeSkillRootCandidate(resolveSkillRootPath(project_root, raw));
|
|
88
88
|
roots.push({
|
|
89
89
|
source: "home",
|
|
90
90
|
raw,
|
|
@@ -15,15 +15,15 @@ import type {
|
|
|
15
15
|
const sessionSkillStateStore = new Map<string, SessionSkillStateInternal>();
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* 归一化
|
|
18
|
+
* 归一化 session_id。
|
|
19
19
|
*
|
|
20
20
|
* 关键点(中文)
|
|
21
|
-
* - 空
|
|
21
|
+
* - 空 session_id 视为调用错误,直接抛异常,避免污染全局状态。
|
|
22
22
|
*/
|
|
23
|
-
function normalizeSessionId(
|
|
24
|
-
const value = String(
|
|
23
|
+
function normalizeSessionId(session_id: string): string {
|
|
24
|
+
const value = String(session_id || "").trim();
|
|
25
25
|
if (!value) {
|
|
26
|
-
throw new Error("
|
|
26
|
+
throw new Error("session_id is required for session skills state");
|
|
27
27
|
}
|
|
28
28
|
return value;
|
|
29
29
|
}
|
|
@@ -31,14 +31,14 @@ function normalizeSessionId(sessionId: string): string {
|
|
|
31
31
|
/**
|
|
32
32
|
* 获取或创建 session 技能状态。
|
|
33
33
|
*/
|
|
34
|
-
function getOrCreateState(
|
|
35
|
-
const key = normalizeSessionId(
|
|
34
|
+
function getOrCreateState(session_id: string): SessionSkillStateInternal {
|
|
35
|
+
const key = normalizeSessionId(session_id);
|
|
36
36
|
const existing = sessionSkillStateStore.get(key);
|
|
37
37
|
if (existing) return existing;
|
|
38
38
|
|
|
39
39
|
const created: SessionSkillStateInternal = {
|
|
40
40
|
allSkillsById: new Map(),
|
|
41
|
-
|
|
41
|
+
updated_at: Date.now(),
|
|
42
42
|
};
|
|
43
43
|
sessionSkillStateStore.set(key, created);
|
|
44
44
|
return created;
|
|
@@ -51,10 +51,10 @@ function getOrCreateState(sessionId: string): SessionSkillStateInternal {
|
|
|
51
51
|
* - 以 id 归一化后整体替换,避免残留脏状态。
|
|
52
52
|
*/
|
|
53
53
|
export function setSessionAvailableSkills(
|
|
54
|
-
|
|
54
|
+
session_id: string,
|
|
55
55
|
skills: SkillDefinition[],
|
|
56
56
|
): void {
|
|
57
|
-
const state = getOrCreateState(
|
|
57
|
+
const state = getOrCreateState(session_id);
|
|
58
58
|
const next = new Map<string, SkillDefinition>();
|
|
59
59
|
|
|
60
60
|
for (const skill of Array.isArray(skills) ? skills : []) {
|
|
@@ -64,35 +64,35 @@ export function setSessionAvailableSkills(
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
state.allSkillsById = next;
|
|
67
|
-
state.
|
|
67
|
+
state.updated_at = Date.now();
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* 获取会话技能状态快照。
|
|
72
72
|
*/
|
|
73
|
-
export function getSessionSkillState(
|
|
74
|
-
const key = normalizeSessionId(
|
|
73
|
+
export function getSessionSkillState(session_id: string): SessionSkillStateSnapshot {
|
|
74
|
+
const key = normalizeSessionId(session_id);
|
|
75
75
|
const state = sessionSkillStateStore.get(key);
|
|
76
76
|
|
|
77
77
|
if (!state) {
|
|
78
78
|
return {
|
|
79
|
-
|
|
79
|
+
session_id: key,
|
|
80
80
|
allSkills: [],
|
|
81
|
-
|
|
81
|
+
updated_at: 0,
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
return {
|
|
86
|
-
|
|
86
|
+
session_id: key,
|
|
87
87
|
allSkills: Array.from(state.allSkillsById.values()),
|
|
88
|
-
|
|
88
|
+
updated_at: state.updated_at,
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* 清理会话技能状态。
|
|
94
94
|
*/
|
|
95
|
-
export function clearSessionSkillState(
|
|
96
|
-
const key = normalizeSessionId(
|
|
95
|
+
export function clearSessionSkillState(session_id: string): void {
|
|
96
|
+
const key = normalizeSessionId(session_id);
|
|
97
97
|
sessionSkillStateStore.delete(key);
|
|
98
98
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - `lookup` 行为为无状态:由 action 读取 SKILL.md 后通过协议注入 user message
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type { PluginExecutionContext } from "@downcity/agent";
|
|
11
11
|
import { discoverSkillsSync } from "./Discovery.js";
|
|
12
12
|
import { render_skills_prompt_section } from "./Prompt.js";
|
|
13
13
|
import { setSessionAvailableSkills } from "./Store.js";
|
|
@@ -28,16 +28,16 @@ type SkillSystemRuntime = {
|
|
|
28
28
|
*/
|
|
29
29
|
export async function buildSkillsSystemText(
|
|
30
30
|
runtime: SkillSystemRuntime,
|
|
31
|
-
|
|
31
|
+
execution_context?: PluginExecutionContext,
|
|
32
32
|
): Promise<string> {
|
|
33
|
-
const
|
|
33
|
+
const session_id = String(execution_context?.session_id || "").trim();
|
|
34
34
|
const discoveredSkills = discoverSkillsSync(
|
|
35
35
|
runtime.rootPath,
|
|
36
36
|
runtime.options,
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
if (
|
|
40
|
-
setSessionAvailableSkills(
|
|
39
|
+
if (session_id) {
|
|
40
|
+
setSessionAvailableSkills(session_id, discoveredSkills);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return render_skills_prompt_section(
|
|
@@ -8,9 +8,9 @@ import type { SkillDefinition } from "@/skill/types/SkillDefinition.js";
|
|
|
8
8
|
* - core 不依赖该结构
|
|
9
9
|
*/
|
|
10
10
|
export type SessionSkillStateSnapshot = {
|
|
11
|
-
|
|
11
|
+
session_id: string;
|
|
12
12
|
allSkills: SkillDefinition[];
|
|
13
|
-
|
|
13
|
+
updated_at: number;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -18,5 +18,5 @@ export type SessionSkillStateSnapshot = {
|
|
|
18
18
|
*/
|
|
19
19
|
export type SessionSkillStateInternal = {
|
|
20
20
|
allSkillsById: Map<string, SkillDefinition>;
|
|
21
|
-
|
|
21
|
+
updated_at: number;
|
|
22
22
|
};
|
package/src/sound/Plugin.ts
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* - 对 Agent 暴露 `models`、`asr`、`tts` 三个 action。
|
|
6
6
|
* - 模型目录与真实 ASR/TTS 能力全部由 FED/City constructor 回调注入。
|
|
7
7
|
* - 本地音频只负责读取并转换为 data URL,不加载或运行任何本地语音模型。
|
|
8
|
-
* - TTS
|
|
8
|
+
* - TTS 返回已经落盘的本地音频 UIMessage Parts,并由 Action 声明 Assistant Message。
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import fs from "node:fs/promises";
|
|
12
12
|
import path from "node:path";
|
|
13
|
-
import { BasePlugin,
|
|
13
|
+
import { BasePlugin, create_action } from "@downcity/agent";
|
|
14
14
|
import { z } from "zod";
|
|
15
|
-
import type {
|
|
15
|
+
import type { PluginContext, JsonObject, JsonValue } from "@downcity/agent";
|
|
16
16
|
import { CHAT_PLUGIN_POINTS } from "@/chat/runtime/PluginPoints.js";
|
|
17
17
|
import type {
|
|
18
18
|
ChatInboundAugmentInput,
|
|
@@ -224,12 +224,12 @@ async function local_audio_to_data_url(input: {
|
|
|
224
224
|
* 把 Agent 公开 ASR 输入解析为可直接发送给 FED 的输入。
|
|
225
225
|
*/
|
|
226
226
|
async function resolve_asr_input(
|
|
227
|
-
context:
|
|
227
|
+
context: PluginContext,
|
|
228
228
|
input: SoundPluginAsrInput,
|
|
229
229
|
): Promise<SoundPluginAsrInput> {
|
|
230
230
|
if (!input.audio_path) return input;
|
|
231
231
|
const local = await local_audio_to_data_url({
|
|
232
|
-
root_path: context.
|
|
232
|
+
root_path: context.workspace_path,
|
|
233
233
|
audio_path: input.audio_path,
|
|
234
234
|
media_type: input.media_type,
|
|
235
235
|
});
|
|
@@ -372,6 +372,16 @@ function normalize_tts_result(result: SoundPluginTtsResult): SoundPluginTtsResul
|
|
|
372
372
|
if (!has_audio_file) {
|
|
373
373
|
throw new TypeError("SoundPlugin tts UIMessage must contain an audio file part");
|
|
374
374
|
}
|
|
375
|
+
for (const part of record.parts) {
|
|
376
|
+
const part_record = to_record(part);
|
|
377
|
+
if (part_record?.type !== "file") continue;
|
|
378
|
+
const url = String(part_record.url || "").trim();
|
|
379
|
+
if (!url || url.startsWith("data:") || /^https?:\/\//i.test(url)) {
|
|
380
|
+
throw new TypeError(
|
|
381
|
+
"SoundPlugin tts file parts must be saved locally before returning",
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
375
385
|
return result;
|
|
376
386
|
}
|
|
377
387
|
|
|
@@ -401,12 +411,12 @@ function append_voice_text(
|
|
|
401
411
|
input: ChatInboundAugmentInput,
|
|
402
412
|
voice_blocks: string[],
|
|
403
413
|
): ChatInboundAugmentInput {
|
|
404
|
-
const current = String(input.
|
|
414
|
+
const current = String(input.body_text || "").trim();
|
|
405
415
|
const addition = voice_blocks.map((item) => item.trim()).filter(Boolean).join("\n\n");
|
|
406
416
|
if (!addition) return input;
|
|
407
417
|
return {
|
|
408
418
|
...input,
|
|
409
|
-
|
|
419
|
+
body_text: [current, addition].filter(Boolean).join("\n\n"),
|
|
410
420
|
};
|
|
411
421
|
}
|
|
412
422
|
|
|
@@ -464,7 +474,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
464
474
|
/**
|
|
465
475
|
* SoundPlugin 给 Agent 的使用说明。
|
|
466
476
|
*/
|
|
467
|
-
system(_context:
|
|
477
|
+
system(_context: PluginContext): string {
|
|
468
478
|
return [
|
|
469
479
|
"# Sound Plugin",
|
|
470
480
|
"",
|
|
@@ -488,7 +498,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
488
498
|
"## Results",
|
|
489
499
|
"",
|
|
490
500
|
"ASR returns transcript text and may include timed segments, language, and duration.",
|
|
491
|
-
"TTS returns an AI SDK UIMessage
|
|
501
|
+
"TTS returns an AI SDK UIMessage whose audio file part already points to a local file, and that part is attached to the assistant response.",
|
|
492
502
|
"Do not invent a transcript or audio result when a FED call fails.",
|
|
493
503
|
"",
|
|
494
504
|
`When unsure, use \`plugin_read { plugin: \"${this.name}\", action: \"...\" }\` to inspect the complete schema.`,
|
|
@@ -499,7 +509,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
499
509
|
* 执行一次 ASR 转写。
|
|
500
510
|
*/
|
|
501
511
|
private async transcribe(
|
|
502
|
-
context:
|
|
512
|
+
context: PluginContext,
|
|
503
513
|
input: SoundPluginAsrInput,
|
|
504
514
|
): Promise<SoundPluginAsrResult> {
|
|
505
515
|
const model = resolve_model_id("asr", input.model, this.default_asr_model);
|
|
@@ -531,7 +541,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
531
541
|
*/
|
|
532
542
|
private async auto_transcribe_inbound(input: {
|
|
533
543
|
/** 当前 Agent 上下文。 */
|
|
534
|
-
context:
|
|
544
|
+
context: PluginContext;
|
|
535
545
|
/** chat 入站管道值。 */
|
|
536
546
|
value: JsonValue;
|
|
537
547
|
}): Promise<JsonValue> {
|
|
@@ -552,7 +562,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
552
562
|
...(attachment.contentType ? { media_type: attachment.contentType } : {}),
|
|
553
563
|
...(attachment.fileName ? { filename: attachment.fileName } : {}),
|
|
554
564
|
});
|
|
555
|
-
const src = to_display_src(input.context.
|
|
565
|
+
const src = to_display_src(input.context.workspace_path, attachment);
|
|
556
566
|
voice_blocks.push(
|
|
557
567
|
`<voice src="${escape_xml_attr(src)}">${escape_xml_text(result.text)}</voice>`,
|
|
558
568
|
);
|
|
@@ -569,7 +579,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
569
579
|
readonly hooks = {
|
|
570
580
|
pipeline: {
|
|
571
581
|
[CHAT_PLUGIN_POINTS.augmentInbound]: [
|
|
572
|
-
async ({ context, value }: { context:
|
|
582
|
+
async ({ context, value }: { context: PluginContext; value: JsonValue }) =>
|
|
573
583
|
await this.auto_transcribe_inbound({ context, value }),
|
|
574
584
|
],
|
|
575
585
|
},
|
|
@@ -579,7 +589,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
579
589
|
* 显式 action 集合。
|
|
580
590
|
*/
|
|
581
591
|
readonly actions = {
|
|
582
|
-
models:
|
|
592
|
+
models: create_action({
|
|
583
593
|
description: "List FED models that support ASR or TTS.",
|
|
584
594
|
input_schema: {
|
|
585
595
|
zod: SOUND_MODELS_INPUT_SCHEMA,
|
|
@@ -617,7 +627,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
617
627
|
}
|
|
618
628
|
},
|
|
619
629
|
}),
|
|
620
|
-
asr:
|
|
630
|
+
asr: create_action({
|
|
621
631
|
description:
|
|
622
632
|
"Transcribe audio with a FED ASR model. Local audio paths are converted to data URLs before the FED call.",
|
|
623
633
|
input_schema: {
|
|
@@ -640,7 +650,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
640
650
|
{ title: "Local audio", payload: { model: "asr-model-id", audio_path: "./input.wav" } },
|
|
641
651
|
{ title: "Remote audio", payload: { model: "asr-model-id", url: "https://example.com/audio.mp3" } },
|
|
642
652
|
],
|
|
643
|
-
execute: async ({ context, input }: { context:
|
|
653
|
+
execute: async ({ context, input }: { context: PluginContext; input: JsonValue }) => {
|
|
644
654
|
try {
|
|
645
655
|
const result = await this.transcribe(context, normalize_asr_payload(input));
|
|
646
656
|
return {
|
|
@@ -654,7 +664,7 @@ export class SoundPlugin extends BasePlugin {
|
|
|
654
664
|
}
|
|
655
665
|
},
|
|
656
666
|
}),
|
|
657
|
-
tts:
|
|
667
|
+
tts: create_action({
|
|
658
668
|
description:
|
|
659
669
|
"Synthesize speech with a FED TTS model and return an AI SDK UIMessage containing audio.",
|
|
660
670
|
input_schema: {
|
|
@@ -686,8 +696,11 @@ export class SoundPlugin extends BasePlugin {
|
|
|
686
696
|
const result = await this.synthesize(normalize_tts_payload(input));
|
|
687
697
|
return {
|
|
688
698
|
success: true,
|
|
689
|
-
data: result as unknown as JsonObject,
|
|
690
699
|
message: "speech synthesized",
|
|
700
|
+
messages: [{
|
|
701
|
+
role: "assistant" as const,
|
|
702
|
+
parts: result.parts,
|
|
703
|
+
}],
|
|
691
704
|
};
|
|
692
705
|
} catch (error) {
|
|
693
706
|
const message = describe_error(error);
|