@downcity/plugins 1.0.215 → 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
|
@@ -222,7 +222,7 @@ export async function writeTaskRunInputArtifact(
|
|
|
222
222
|
`- title: ${params.task.frontmatter.title}`,
|
|
223
223
|
`- when: \`${params.task.frontmatter.when}\``,
|
|
224
224
|
`- status: \`${params.task.frontmatter.status}\``,
|
|
225
|
-
`-
|
|
225
|
+
`- session_id: \`${params.task.frontmatter.session_id}\``,
|
|
226
226
|
`- kind: \`${params.taskKind}\``,
|
|
227
227
|
...(params.taskKind === "agent"
|
|
228
228
|
? [`- review: \`${String(params.reviewEnabled)}\``]
|
|
@@ -274,7 +274,7 @@ function buildDialogueLines(params: WriteTaskRunArtifactsParams): string[] {
|
|
|
274
274
|
lines.push("```");
|
|
275
275
|
lines.push("");
|
|
276
276
|
if (round.executorAssistantMessageSnapshot) {
|
|
277
|
-
lines.push("### Executor
|
|
277
|
+
lines.push("### Executor result text snapshot");
|
|
278
278
|
lines.push("");
|
|
279
279
|
lines.push("```json");
|
|
280
280
|
lines.push(round.executorAssistantMessageSnapshot);
|
|
@@ -321,7 +321,7 @@ function buildDialogueLines(params: WriteTaskRunArtifactsParams): string[] {
|
|
|
321
321
|
}
|
|
322
322
|
if (round.userSimulatorAssistantMessageSnapshot) {
|
|
323
323
|
lines.push("");
|
|
324
|
-
lines.push("
|
|
324
|
+
lines.push("result text snapshot:");
|
|
325
325
|
lines.push("```json");
|
|
326
326
|
lines.push(round.userSimulatorAssistantMessageSnapshot);
|
|
327
327
|
lines.push("```");
|
|
@@ -461,7 +461,7 @@ export async function writeTaskRunArtifacts(
|
|
|
461
461
|
taskId: params.task.taskId,
|
|
462
462
|
timestamp: params.timestamp,
|
|
463
463
|
executionId: params.executionId,
|
|
464
|
-
|
|
464
|
+
session_id: params.task.frontmatter.session_id,
|
|
465
465
|
trigger: params.trigger,
|
|
466
466
|
status: params.status,
|
|
467
467
|
executionStatus: params.executionStatus,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 回发失败只记录日志,不影响 task run 自身状态。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type { PluginContext } from "@downcity/agent";
|
|
11
11
|
import type { ShipTaskDefinitionV1 } from "@/task/types/Task.js";
|
|
12
12
|
|
|
13
13
|
function resolveTaskFinalText(params: {
|
|
@@ -35,15 +35,15 @@ function resolveTaskFinalText(params: {
|
|
|
35
35
|
* 通过 chat plugin runtime 发送 task 最终结果。
|
|
36
36
|
*/
|
|
37
37
|
export async function dispatchTaskRunCompletionToChat(params: {
|
|
38
|
-
context:
|
|
38
|
+
context: PluginContext;
|
|
39
39
|
task: ShipTaskDefinitionV1;
|
|
40
40
|
executionId: string;
|
|
41
41
|
outputText: string;
|
|
42
42
|
errorText: string;
|
|
43
43
|
resultErrors: string[];
|
|
44
44
|
}): Promise<void> {
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
45
|
+
const session_id = String(params.task.frontmatter.session_id || "").trim();
|
|
46
|
+
if (!session_id) return;
|
|
47
47
|
|
|
48
48
|
const finalText = resolveTaskFinalText({
|
|
49
49
|
outputText: params.outputText,
|
|
@@ -53,19 +53,19 @@ export async function dispatchTaskRunCompletionToChat(params: {
|
|
|
53
53
|
if (!finalText) return;
|
|
54
54
|
|
|
55
55
|
try {
|
|
56
|
-
const sent = await params.context.plugins.
|
|
56
|
+
const sent = await params.context.plugins.run_action({
|
|
57
57
|
plugin: "chat",
|
|
58
58
|
action: "send",
|
|
59
59
|
payload: {
|
|
60
|
-
|
|
60
|
+
chat_key: session_id,
|
|
61
61
|
text: finalText,
|
|
62
|
-
|
|
62
|
+
reply_to_message: true,
|
|
63
63
|
},
|
|
64
64
|
});
|
|
65
65
|
if (!sent.success) {
|
|
66
66
|
params.context.logger.warn("[TASK] Task completion chat send failed", {
|
|
67
67
|
taskId: params.task.taskId,
|
|
68
|
-
|
|
68
|
+
session_id,
|
|
69
69
|
executionId: params.executionId,
|
|
70
70
|
error: sent.error || "chat send failed",
|
|
71
71
|
});
|
|
@@ -73,7 +73,7 @@ export async function dispatchTaskRunCompletionToChat(params: {
|
|
|
73
73
|
} catch (error) {
|
|
74
74
|
params.context.logger.warn("[TASK] Task completion chat send failed", {
|
|
75
75
|
taskId: params.task.taskId,
|
|
76
|
-
|
|
76
|
+
session_id,
|
|
77
77
|
executionId: params.executionId,
|
|
78
78
|
error: String(error),
|
|
79
79
|
});
|
|
@@ -75,7 +75,7 @@ export function createRunProgressWriter(params: {
|
|
|
75
75
|
phase: current.phase,
|
|
76
76
|
message: current.message,
|
|
77
77
|
startedAt: params.startedAt,
|
|
78
|
-
|
|
78
|
+
updated_at: now,
|
|
79
79
|
...(typeof current.endedAt === "number" ? { endedAt: current.endedAt } : {}),
|
|
80
80
|
...(current.runStatus ? { runStatus: current.runStatus } : {}),
|
|
81
81
|
...(current.executionStatus ? { executionStatus: current.executionStatus } : {}),
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import fs from "fs-extra";
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
11
|
+
import type { PluginContext } from "@downcity/agent";
|
|
12
|
+
import type { SessionTurnExecutionResult } from "@downcity/agent";
|
|
13
|
+
import type { SessionTurnContext } from "@downcity/agent";
|
|
14
|
+
import { create_session_turn_context } from "@downcity/agent";
|
|
14
15
|
import type { JsonObject } from "@downcity/agent";
|
|
16
|
+
import { SessionAssistantOutputAdapter } from "@downcity/agent";
|
|
15
17
|
import type {
|
|
16
18
|
ChatSendOutputPick,
|
|
17
19
|
ScriptExecutionResult,
|
|
@@ -63,21 +65,6 @@ export function tryExtractJsonObject(text: string): JsonObject | null {
|
|
|
63
65
|
return null;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
function extractTextFromAssistantMessageParts(parts: unknown): string {
|
|
67
|
-
if (!Array.isArray(parts)) return "";
|
|
68
|
-
const texts: string[] = [];
|
|
69
|
-
for (const part of parts) {
|
|
70
|
-
if (!part || typeof part !== "object") continue;
|
|
71
|
-
const p = part as { type?: unknown; text?: unknown };
|
|
72
|
-
if (p.type !== "text" && p.type !== "input_text") continue;
|
|
73
|
-
if (typeof p.text !== "string") continue;
|
|
74
|
-
const value = p.text.trim();
|
|
75
|
-
if (!value) continue;
|
|
76
|
-
texts.push(value);
|
|
77
|
-
}
|
|
78
|
-
return texts.join("\n").trim();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
68
|
/**
|
|
82
69
|
* 从 assistant 输出中提取 task 的最终结果文本。
|
|
83
70
|
*
|
|
@@ -87,12 +74,10 @@ function extractTextFromAssistantMessageParts(parts: unknown): string {
|
|
|
87
74
|
* - task 的过程内容保留在 `messages.jsonl / dialogue.md`;`output.md` 只记录最后 assistant 文本。
|
|
88
75
|
*/
|
|
89
76
|
export function pickAgentOutput(
|
|
90
|
-
|
|
77
|
+
text: string,
|
|
91
78
|
): ChatSendOutputPick {
|
|
92
79
|
return {
|
|
93
|
-
text:
|
|
94
|
-
(assistantMessage as { parts?: unknown } | null)?.parts,
|
|
95
|
-
),
|
|
80
|
+
text: String(text || "").trim(),
|
|
96
81
|
delivered: false,
|
|
97
82
|
};
|
|
98
83
|
}
|
|
@@ -223,16 +208,16 @@ export function buildUserSimulatorQuery(params: {
|
|
|
223
208
|
*/
|
|
224
209
|
export async function runAgentRound(params: {
|
|
225
210
|
taskSessionRuntime: TaskSessionRuntimePort;
|
|
226
|
-
|
|
211
|
+
session_id: string;
|
|
227
212
|
taskId: string;
|
|
228
213
|
query: string;
|
|
229
214
|
actorId: string;
|
|
230
215
|
actorName: string;
|
|
231
|
-
}): Promise<{ outputText: string; delivered: boolean; rawResult:
|
|
216
|
+
}): Promise<{ outputText: string; delivered: boolean; rawResult: SessionTurnExecutionResult }> {
|
|
232
217
|
try {
|
|
233
218
|
await appendTaskRoundUserMessage({
|
|
234
219
|
taskSessionRuntime: params.taskSessionRuntime,
|
|
235
|
-
|
|
220
|
+
session_id: params.session_id,
|
|
236
221
|
taskId: params.taskId,
|
|
237
222
|
query: params.query,
|
|
238
223
|
actorId: params.actorId,
|
|
@@ -242,13 +227,30 @@ export async function runAgentRound(params: {
|
|
|
242
227
|
// ignore
|
|
243
228
|
}
|
|
244
229
|
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
230
|
+
const turn_id = `task:${params.taskId}:${params.actorId}:${Date.now()}`;
|
|
231
|
+
const assistant_output = new SessionAssistantOutputAdapter({
|
|
232
|
+
turn_id,
|
|
233
|
+
messages: params.taskSessionRuntime.get_messages(params.session_id),
|
|
234
|
+
});
|
|
235
|
+
const turn_context = create_task_turn_context(
|
|
236
|
+
params.session_id,
|
|
237
|
+
turn_id,
|
|
238
|
+
assistant_output,
|
|
239
|
+
);
|
|
240
|
+
let result: SessionTurnExecutionResult;
|
|
241
|
+
try {
|
|
242
|
+
result = await params.taskSessionRuntime.get_executor(params.session_id).execute({
|
|
248
243
|
query: params.query,
|
|
249
|
-
|
|
244
|
+
turn_context,
|
|
250
245
|
});
|
|
251
|
-
|
|
246
|
+
await assistant_output.finish({
|
|
247
|
+
status: result.success ? "completed" : "failed",
|
|
248
|
+
...(result.error ? { error: result.error } : {}),
|
|
249
|
+
});
|
|
250
|
+
} finally {
|
|
251
|
+
await turn_context.lifecycle.dispose();
|
|
252
|
+
}
|
|
253
|
+
const outputPick = pickAgentOutput(result.text);
|
|
252
254
|
|
|
253
255
|
if (!result.success) {
|
|
254
256
|
const reason = outputPick.text || "agent run returned success=false";
|
|
@@ -270,9 +272,9 @@ export async function runAgentRound(params: {
|
|
|
270
272
|
* 执行 script 类型任务。
|
|
271
273
|
*/
|
|
272
274
|
export async function runScriptTask(params: {
|
|
273
|
-
context:
|
|
275
|
+
context: PluginContext;
|
|
274
276
|
runDirAbs: string;
|
|
275
|
-
|
|
277
|
+
session_id: string;
|
|
276
278
|
scriptBody: string;
|
|
277
279
|
}): Promise<ScriptExecutionResult> {
|
|
278
280
|
const body = String(params.scriptBody || "");
|
|
@@ -283,7 +285,7 @@ export async function runScriptTask(params: {
|
|
|
283
285
|
|
|
284
286
|
const childEnv: NodeJS.ProcessEnv = {
|
|
285
287
|
...process.env,
|
|
286
|
-
DC_SESSION_ID: params.
|
|
288
|
+
DC_SESSION_ID: params.session_id,
|
|
287
289
|
};
|
|
288
290
|
stripTaskSecretEnv(childEnv);
|
|
289
291
|
const shell = params.context.shell;
|
|
@@ -291,7 +293,7 @@ export async function runScriptTask(params: {
|
|
|
291
293
|
throw new Error("Script task execution requires Agent to be configured with a Shell.");
|
|
292
294
|
}
|
|
293
295
|
const execResult = await shell.run_safe_command({
|
|
294
|
-
execution_id: `task-script:${params.
|
|
296
|
+
execution_id: `task-script:${params.session_id}`,
|
|
295
297
|
execution_dir: params.runDirAbs,
|
|
296
298
|
cmd: `sh "${scriptAbs.replace(/(["\\$`])/g, "\\$1")}"`,
|
|
297
299
|
cwd: params.runDirAbs,
|
|
@@ -309,15 +311,18 @@ export async function runScriptTask(params: {
|
|
|
309
311
|
}
|
|
310
312
|
|
|
311
313
|
/**
|
|
312
|
-
* 创建 task runner 的显式
|
|
314
|
+
* 创建 task runner 的显式 Session Turn Context。
|
|
313
315
|
*/
|
|
314
|
-
function
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
function create_task_turn_context(
|
|
317
|
+
session_id: string,
|
|
318
|
+
turn_id: string,
|
|
319
|
+
assistant_output: SessionAssistantOutputAdapter,
|
|
320
|
+
): SessionTurnContext {
|
|
321
|
+
return create_session_turn_context({
|
|
322
|
+
session_id: session_id,
|
|
323
|
+
turn_id,
|
|
324
|
+
assistant_output,
|
|
325
|
+
});
|
|
321
326
|
}
|
|
322
327
|
|
|
323
328
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 这里集中处理 script 执行、结果校验与进度更新,Runner 主链只消费归一化结果。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { PluginContext } from "@downcity/agent";
|
|
10
10
|
import type {
|
|
11
11
|
ShipTaskRunExecutionStatusV1,
|
|
12
12
|
ShipTaskRunResultStatusV1,
|
|
@@ -23,15 +23,15 @@ export interface RunScriptTaskBranchParams {
|
|
|
23
23
|
/**
|
|
24
24
|
* 当前 Agent 执行上下文。
|
|
25
25
|
*/
|
|
26
|
-
context:
|
|
26
|
+
context: PluginContext;
|
|
27
27
|
/**
|
|
28
28
|
* 当前 run 目录绝对路径。
|
|
29
29
|
*/
|
|
30
30
|
runDirAbs: string;
|
|
31
31
|
/**
|
|
32
|
-
* script 任务绑定的
|
|
32
|
+
* script 任务绑定的 session_id。
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
session_id: string;
|
|
35
35
|
/**
|
|
36
36
|
* script 正文。
|
|
37
37
|
*/
|
|
@@ -111,7 +111,7 @@ export async function runScriptTaskBranch(
|
|
|
111
111
|
const scriptResult = await runScriptTask({
|
|
112
112
|
context: params.context,
|
|
113
113
|
runDirAbs: params.runDirAbs,
|
|
114
|
-
|
|
114
|
+
session_id: params.session_id,
|
|
115
115
|
scriptBody: params.scriptBody,
|
|
116
116
|
});
|
|
117
117
|
outputText = scriptResult.outputText;
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import type { LanguageModel, Tool } from "ai";
|
|
13
|
-
import type {
|
|
13
|
+
import type { PluginContext } from "@downcity/agent";
|
|
14
14
|
import { Executor } from "@downcity/agent";
|
|
15
|
-
import type {
|
|
15
|
+
import type { SessionTurnExecutionResult } from "@downcity/agent";
|
|
16
16
|
import type { TaskSessionRuntimePort } from "@/task/runtime/TaskRunnerTypes.js";
|
|
17
17
|
import {
|
|
18
18
|
DefaultSessionComposer,
|
|
19
|
-
|
|
19
|
+
create_session_message_store,
|
|
20
20
|
SessionMessages,
|
|
21
21
|
} from "@downcity/agent";
|
|
22
22
|
import { DefaultSessionSystemComposer } from "@downcity/agent";
|
|
@@ -31,7 +31,7 @@ import type {
|
|
|
31
31
|
*/
|
|
32
32
|
export async function appendTaskRoundUserMessage(params: {
|
|
33
33
|
taskSessionRuntime: TaskSessionRuntimePort;
|
|
34
|
-
|
|
34
|
+
session_id: string;
|
|
35
35
|
taskId: string;
|
|
36
36
|
query: string;
|
|
37
37
|
actorId: string;
|
|
@@ -39,7 +39,7 @@ export async function appendTaskRoundUserMessage(params: {
|
|
|
39
39
|
}): Promise<void> {
|
|
40
40
|
const text = String(params.query || "").trim();
|
|
41
41
|
if (!text) return;
|
|
42
|
-
const messages = params.taskSessionRuntime.get_messages(params.
|
|
42
|
+
const messages = params.taskSessionRuntime.get_messages(params.session_id);
|
|
43
43
|
await messages.append_user_message({
|
|
44
44
|
turn_id:
|
|
45
45
|
`task:${params.taskId}:${params.actorId}:${Date.now()}`,
|
|
@@ -61,13 +61,13 @@ export async function appendTaskRoundUserMessage(params: {
|
|
|
61
61
|
* - task runner 自己维护独立 history,不复用原 session 的消息落盘。
|
|
62
62
|
*/
|
|
63
63
|
export function createTaskSessionRuntimePort(params: {
|
|
64
|
-
context:
|
|
64
|
+
context: PluginContext;
|
|
65
65
|
model: LanguageModel;
|
|
66
66
|
runDirAbs: string;
|
|
67
67
|
runSessionId: string;
|
|
68
68
|
userSimulatorSessionId: string;
|
|
69
69
|
/** 当前 task 显式继承的 Agent env 快照。 */
|
|
70
|
-
|
|
70
|
+
workspace_env?: Readonly<Record<string, string>>;
|
|
71
71
|
/** 当前 task 显式继承的 Agent instruction 快照。 */
|
|
72
72
|
agent_systems?: readonly string[];
|
|
73
73
|
}): TaskSessionRuntimePort {
|
|
@@ -78,16 +78,16 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
78
78
|
runSessionId,
|
|
79
79
|
userSimulatorSessionId,
|
|
80
80
|
} = params;
|
|
81
|
-
const effective_env = params.
|
|
82
|
-
? { ...params.
|
|
83
|
-
: { ...context.
|
|
81
|
+
const effective_env = params.workspace_env
|
|
82
|
+
? { ...params.workspace_env }
|
|
83
|
+
: { ...context.workspace_env };
|
|
84
84
|
const effective_systems = params.agent_systems
|
|
85
85
|
? [...params.agent_systems]
|
|
86
|
-
: [...context.
|
|
86
|
+
: [...context.instructions];
|
|
87
87
|
const systemComposer = new DefaultSessionSystemComposer({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
project_root: context.workspace_path,
|
|
89
|
+
get_static_system_prompts: () => [...effective_systems],
|
|
90
|
+
get_context: () => context,
|
|
91
91
|
profile: "task",
|
|
92
92
|
});
|
|
93
93
|
const messages_by_session_id = new Map<string, SessionMessages>();
|
|
@@ -105,7 +105,7 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
105
105
|
|
|
106
106
|
const key = String(session_id || "").trim();
|
|
107
107
|
if (!key) {
|
|
108
|
-
throw new Error("TaskSessionRuntimePort requires a non-empty
|
|
108
|
+
throw new Error("TaskSessionRuntimePort requires a non-empty session_id");
|
|
109
109
|
}
|
|
110
110
|
const runMessagesDirPath =
|
|
111
111
|
key === runSessionId
|
|
@@ -117,7 +117,8 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
117
117
|
const messages_dir_path = runMessagesDirPath || path.join(runDirAbs, key);
|
|
118
118
|
const created = new SessionMessages({
|
|
119
119
|
session_id: key,
|
|
120
|
-
store:
|
|
120
|
+
store: create_session_message_store({
|
|
121
|
+
files: context.files,
|
|
121
122
|
session_id: key,
|
|
122
123
|
file_path: path.join(messages_dir_path, "active.jsonl"),
|
|
123
124
|
assistant_message_file_path: path.join(
|
|
@@ -137,14 +138,7 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
137
138
|
const composed = await super.compose(input);
|
|
138
139
|
return {
|
|
139
140
|
...composed,
|
|
140
|
-
system: await systemComposer.resolve(
|
|
141
|
-
sessionId: input.session.session_id,
|
|
142
|
-
agentEnv: input.state.env,
|
|
143
|
-
agentSystems: input.state.systems,
|
|
144
|
-
injectedUserMessages: [],
|
|
145
|
-
deferredPersistedUserMessages: [],
|
|
146
|
-
pendingAssistantFileParts: [],
|
|
147
|
-
}),
|
|
141
|
+
system: await systemComposer.resolve(input),
|
|
148
142
|
system_blocks: undefined,
|
|
149
143
|
};
|
|
150
144
|
}
|
|
@@ -154,10 +148,10 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
154
148
|
get_messages(session_id: string): SessionMessages {
|
|
155
149
|
return resolve_task_messages(session_id);
|
|
156
150
|
},
|
|
157
|
-
|
|
158
|
-
const key = String(
|
|
151
|
+
get_executor(session_id: string): SessionExecutor {
|
|
152
|
+
const key = String(session_id || "").trim();
|
|
159
153
|
if (!key) {
|
|
160
|
-
throw new Error("TaskSessionRuntimePort.
|
|
154
|
+
throw new Error("TaskSessionRuntimePort.get_executor requires a non-empty session_id");
|
|
161
155
|
}
|
|
162
156
|
const existing = runtimesBySessionId.get(key);
|
|
163
157
|
if (existing) return existing;
|
|
@@ -165,13 +159,13 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
165
159
|
const messages = resolve_task_messages(key);
|
|
166
160
|
const composer = new TaskSessionComposer();
|
|
167
161
|
const created = new Executor({
|
|
168
|
-
|
|
162
|
+
session_id: key,
|
|
169
163
|
composer,
|
|
170
|
-
get_compose_input: async (
|
|
164
|
+
get_compose_input: async (turn_context, retry_count) => ({
|
|
171
165
|
session: {
|
|
172
166
|
agent_id: "task",
|
|
173
167
|
session_id: key,
|
|
174
|
-
project_root: context.
|
|
168
|
+
project_root: context.workspace_path,
|
|
175
169
|
created_at: created_at_by_session_id.get(key) || Date.now(),
|
|
176
170
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC",
|
|
177
171
|
},
|
|
@@ -186,17 +180,38 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
186
180
|
},
|
|
187
181
|
history: await messages.context_snapshot(),
|
|
188
182
|
turn: {
|
|
189
|
-
...(
|
|
183
|
+
...(turn_context?.session.turn_id
|
|
184
|
+
? { turn_id: turn_context.session.turn_id }
|
|
185
|
+
: {}),
|
|
190
186
|
retry_count,
|
|
191
187
|
},
|
|
192
188
|
}),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
189
|
+
compact_history: async () => {
|
|
190
|
+
try {
|
|
191
|
+
const plan = await composer.compact({
|
|
192
|
+
session: {
|
|
193
|
+
agent_id: "task",
|
|
194
|
+
session_id: key,
|
|
195
|
+
project_root: context.workspace_path,
|
|
196
|
+
created_at: created_at_by_session_id.get(key) || Date.now(),
|
|
197
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC",
|
|
198
|
+
},
|
|
199
|
+
model,
|
|
200
|
+
history: await messages.context_snapshot(),
|
|
201
|
+
});
|
|
202
|
+
if (!plan) {
|
|
203
|
+
return { compacted: false, reason: "nothing_to_compact" };
|
|
204
|
+
}
|
|
205
|
+
await messages.compact_active({
|
|
206
|
+
through_sequence: plan.through_sequence,
|
|
207
|
+
summary: plan.summary,
|
|
208
|
+
});
|
|
209
|
+
return { compacted: true };
|
|
210
|
+
} catch {
|
|
211
|
+
return { compacted: false, reason: "compact_failed" };
|
|
212
|
+
}
|
|
198
213
|
},
|
|
199
|
-
|
|
214
|
+
get_model: () => model,
|
|
200
215
|
logger: context.logger,
|
|
201
216
|
});
|
|
202
217
|
runtimesBySessionId.set(key, created);
|
|
@@ -208,18 +223,15 @@ export function createTaskSessionRuntimePort(params: {
|
|
|
208
223
|
/**
|
|
209
224
|
* 把 task session 的 assistant 消息落盘到对应 run context history Store。
|
|
210
225
|
*/
|
|
211
|
-
export async function
|
|
226
|
+
export async function appendTaskDeferredMessages(params: {
|
|
212
227
|
taskSessionRuntime: TaskSessionRuntimePort;
|
|
213
|
-
|
|
228
|
+
session_id: string;
|
|
214
229
|
taskId: string;
|
|
215
|
-
rawResult:
|
|
230
|
+
rawResult: SessionTurnExecutionResult;
|
|
216
231
|
}): Promise<void> {
|
|
217
|
-
const { taskSessionRuntime,
|
|
218
|
-
const messages = taskSessionRuntime.get_messages(
|
|
219
|
-
|
|
220
|
-
await messages.append_record(rawResult.assistantMessage);
|
|
221
|
-
}
|
|
222
|
-
const deferredUserMessages = rawResult.deferredPersistedUserMessages || [];
|
|
232
|
+
const { taskSessionRuntime, session_id, rawResult } = params;
|
|
233
|
+
const messages = taskSessionRuntime.get_messages(session_id);
|
|
234
|
+
const deferredUserMessages = rawResult.deferred_persisted_user_messages || [];
|
|
223
235
|
for (const deferred of deferredUserMessages) {
|
|
224
236
|
await messages.append_record(deferred);
|
|
225
237
|
}
|
|
@@ -123,7 +123,7 @@ export type DialogueRoundRecord = {
|
|
|
123
123
|
*/
|
|
124
124
|
executorDelivered: boolean;
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* 执行器最终文本的调试快照。
|
|
127
127
|
*/
|
|
128
128
|
executorAssistantMessageSnapshot?: string;
|
|
129
129
|
/**
|
|
@@ -143,7 +143,7 @@ export type DialogueRoundRecord = {
|
|
|
143
143
|
*/
|
|
144
144
|
userSimulatorOutput?: string;
|
|
145
145
|
/**
|
|
146
|
-
*
|
|
146
|
+
* 模拟用户最终文本的调试快照。
|
|
147
147
|
*/
|
|
148
148
|
userSimulatorAssistantMessageSnapshot?: string;
|
|
149
149
|
/**
|
|
@@ -175,11 +175,11 @@ export type ScriptExecutionResult = {
|
|
|
175
175
|
*/
|
|
176
176
|
export type TaskSessionRuntimePort = {
|
|
177
177
|
/**
|
|
178
|
-
* 获取指定
|
|
178
|
+
* 获取指定 session_id 对应的 Session 执行端口。
|
|
179
179
|
*/
|
|
180
|
-
|
|
180
|
+
get_executor(session_id: string): SessionExecutor;
|
|
181
181
|
/**
|
|
182
|
-
* 获取指定
|
|
182
|
+
* 获取指定 session_id 对应的 canonical Session Messages。
|
|
183
183
|
*/
|
|
184
184
|
get_messages(session_id: string): SessionMessages;
|
|
185
185
|
};
|
package/src/task/types/Task.ts
CHANGED
|
@@ -16,8 +16,8 @@ export type ShipTaskFrontmatterV1 = {
|
|
|
16
16
|
when: string;
|
|
17
17
|
/** 任务描述(给执行器的意图说明) */
|
|
18
18
|
description: string;
|
|
19
|
-
/** 任务执行会话标识(
|
|
20
|
-
|
|
19
|
+
/** 任务执行会话标识(session_id) */
|
|
20
|
+
session_id: string;
|
|
21
21
|
/** 任务执行类型(agent=交给 agent 执行;script=直接执行 task 正文脚本) */
|
|
22
22
|
kind?: ShipTaskKind;
|
|
23
23
|
/** 是否启用 review 多轮复核(仅 `kind=agent` 生效;默认 false,false 时单轮执行) */
|
|
@@ -100,7 +100,7 @@ export type ShipTaskRunProgressV1 = {
|
|
|
100
100
|
/** 开始时间(ms) */
|
|
101
101
|
startedAt: number;
|
|
102
102
|
/** 最近更新时间(ms) */
|
|
103
|
-
|
|
103
|
+
updated_at: number;
|
|
104
104
|
/** 结束时间(ms,完成后可选) */
|
|
105
105
|
endedAt?: number;
|
|
106
106
|
/** 最终 run 状态(完成后可选) */
|
|
@@ -127,7 +127,7 @@ export type ShipTaskRunMetaV1 = {
|
|
|
127
127
|
/** 本次执行唯一 ID */
|
|
128
128
|
executionId: string;
|
|
129
129
|
/** 任务执行会话标识 */
|
|
130
|
-
|
|
130
|
+
session_id: string;
|
|
131
131
|
/** 触发来源 */
|
|
132
132
|
trigger: ShipTaskRunTriggerV1;
|
|
133
133
|
/** 最终状态(综合执行阶段 + 结果校验) */
|
|
@@ -22,7 +22,7 @@ export type TaskCreateRequest = {
|
|
|
22
22
|
/** 任务描述。 */
|
|
23
23
|
description: string;
|
|
24
24
|
/** 任务会话标识。 */
|
|
25
|
-
|
|
25
|
+
session_id: string;
|
|
26
26
|
/** 任务执行类型。 */
|
|
27
27
|
kind?: ShipTaskKind;
|
|
28
28
|
/** 是否启用 review 多轮复核。 */
|
|
@@ -62,7 +62,7 @@ export type TaskUpdateRequest = {
|
|
|
62
62
|
/** 新任务描述。 */
|
|
63
63
|
description?: string;
|
|
64
64
|
/** 新会话标识。 */
|
|
65
|
-
|
|
65
|
+
session_id?: string;
|
|
66
66
|
/** 新任务执行类型。 */
|
|
67
67
|
kind?: ShipTaskKind;
|
|
68
68
|
/** 是否启用 review 多轮复核。 */
|
|
@@ -96,7 +96,7 @@ export type TaskListItemView = {
|
|
|
96
96
|
/** 当前是否正在执行。 */
|
|
97
97
|
running?: boolean;
|
|
98
98
|
/** 任务会话标识。 */
|
|
99
|
-
|
|
99
|
+
session_id: string;
|
|
100
100
|
/** 任务执行类型。 */
|
|
101
101
|
kind?: ShipTaskKind;
|
|
102
102
|
/** 是否启用 review 多轮复核。 */
|
package/src/web/Plugin.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
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
|
-
import type {
|
|
14
|
+
import type { PluginContext } from "@downcity/agent";
|
|
15
15
|
import type { JsonObject, JsonValue, PluginActionResult } from "@downcity/agent";
|
|
16
16
|
import { WEB_PLUGIN_PROMPT } from "@/web/WebPromptAssets.js";
|
|
17
17
|
import { render_web_install_prompt } from "@/web/runtime/Prompt.js";
|
|
@@ -79,7 +79,7 @@ export class WebPlugin extends BasePlugin {
|
|
|
79
79
|
* WebPlugin 对外 action。
|
|
80
80
|
*/
|
|
81
81
|
readonly actions = {
|
|
82
|
-
[WEB_PLUGIN_ACTIONS.install]:
|
|
82
|
+
[WEB_PLUGIN_ACTIONS.install]: create_action({
|
|
83
83
|
description:
|
|
84
84
|
"Return instructions for installing web-related Skills and CLIs. This action does not install anything.",
|
|
85
85
|
input_schema: {
|
|
@@ -117,7 +117,7 @@ export class WebPlugin extends BasePlugin {
|
|
|
117
117
|
.option("--target <target>", "web-access、agent-browser 或 all")
|
|
118
118
|
.option("--scope <scope>", "agent-browser CLI 安装位置:user 或 project");
|
|
119
119
|
},
|
|
120
|
-
|
|
120
|
+
map_input({ opts }): JsonObject {
|
|
121
121
|
return {
|
|
122
122
|
...(get_install_target_opt(opts)
|
|
123
123
|
? { target: get_install_target_opt(opts) }
|
|
@@ -145,7 +145,7 @@ export class WebPlugin extends BasePlugin {
|
|
|
145
145
|
/**
|
|
146
146
|
* 注入联网方法论提示词。
|
|
147
147
|
*/
|
|
148
|
-
system(_context:
|
|
148
|
+
system(_context: PluginContext): string {
|
|
149
149
|
return WEB_PLUGIN_PROMPT;
|
|
150
150
|
}
|
|
151
151
|
}
|