@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
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - 把最终产物写入 run 目录的具体格式委托给 `TaskRunArtifacts.ts`。
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type { PluginContext } from "@downcity/agent";
|
|
12
12
|
import type {
|
|
13
13
|
DialogueRoundRecord,
|
|
14
14
|
UserSimulatorDecision,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import { ensureRunDir, readTask } from "./Store.js";
|
|
29
29
|
import { createRunProgressWriter, serializeDebugSnapshot, summarizeText } from "./TaskRunnerProgress.js";
|
|
30
30
|
import {
|
|
31
|
-
|
|
31
|
+
appendTaskDeferredMessages,
|
|
32
32
|
createTaskSessionRuntimePort,
|
|
33
33
|
} from "./TaskRunnerSession.js";
|
|
34
34
|
import {
|
|
@@ -75,13 +75,13 @@ function buildTaskExecutionFailureText(params: {
|
|
|
75
75
|
* 3) 产物落盘(messages.jsonl / output.md / result.md / error.md / run.json)。
|
|
76
76
|
*/
|
|
77
77
|
export async function runTaskNow(params: {
|
|
78
|
-
context:
|
|
78
|
+
context: PluginContext;
|
|
79
79
|
taskId: string;
|
|
80
80
|
trigger: ShipTaskRunTriggerV1;
|
|
81
81
|
executionId?: string;
|
|
82
|
-
|
|
82
|
+
project_root?: string;
|
|
83
83
|
/** 发起该任务的 Session step 已提交生效的 env 快照。 */
|
|
84
|
-
|
|
84
|
+
workspace_env?: Readonly<Record<string, string>>;
|
|
85
85
|
/** 发起该任务的 Session step 已提交生效的 instruction 快照。 */
|
|
86
86
|
agent_systems?: readonly string[];
|
|
87
87
|
}): Promise<{
|
|
@@ -102,19 +102,19 @@ export async function runTaskNow(params: {
|
|
|
102
102
|
runDirRel: string;
|
|
103
103
|
}> {
|
|
104
104
|
const context = params.context;
|
|
105
|
-
const root = String(params.
|
|
106
|
-
if (!root) throw new Error("
|
|
105
|
+
const root = String(params.project_root || context.workspace_path || "").trim();
|
|
106
|
+
if (!root) throw new Error("project_root is required");
|
|
107
107
|
|
|
108
108
|
const startedAt = Date.now();
|
|
109
109
|
const timestamp = formatTaskRunTimestamp(new Date(startedAt));
|
|
110
110
|
const executionId = String(params.executionId || `${params.taskId}:${timestamp}`).trim();
|
|
111
111
|
|
|
112
|
-
const task = await readTask({ taskId: params.taskId,
|
|
112
|
+
const task = await readTask({ taskId: params.taskId, project_root: root });
|
|
113
113
|
const runDirAbs = getTaskRunDir(root, task.taskId, timestamp);
|
|
114
114
|
const { runDirRel } = await ensureRunDir({
|
|
115
115
|
taskId: task.taskId,
|
|
116
116
|
timestamp,
|
|
117
|
-
|
|
117
|
+
project_root: root,
|
|
118
118
|
});
|
|
119
119
|
const filePaths = createTaskRunFilePaths(runDirAbs);
|
|
120
120
|
|
|
@@ -171,7 +171,7 @@ export async function runTaskNow(params: {
|
|
|
171
171
|
const scriptResult = await runScriptTaskBranch({
|
|
172
172
|
context,
|
|
173
173
|
runDirAbs,
|
|
174
|
-
|
|
174
|
+
session_id: task.frontmatter.session_id,
|
|
175
175
|
scriptBody: task.body,
|
|
176
176
|
runProgress,
|
|
177
177
|
});
|
|
@@ -186,8 +186,8 @@ export async function runTaskNow(params: {
|
|
|
186
186
|
errorText = scriptResult.errorText;
|
|
187
187
|
} else {
|
|
188
188
|
const task_model = context.sessions
|
|
189
|
-
.runtime(task.frontmatter.
|
|
190
|
-
.
|
|
189
|
+
.runtime(task.frontmatter.session_id)
|
|
190
|
+
.get_model();
|
|
191
191
|
if (!task_model) {
|
|
192
192
|
throw new Error(`Task "${task.taskId}" requires a configured model`);
|
|
193
193
|
}
|
|
@@ -197,7 +197,7 @@ export async function runTaskNow(params: {
|
|
|
197
197
|
runDirAbs,
|
|
198
198
|
runSessionId,
|
|
199
199
|
userSimulatorSessionId,
|
|
200
|
-
...(params.
|
|
200
|
+
...(params.workspace_env ? { workspace_env: params.workspace_env } : {}),
|
|
201
201
|
...(params.agent_systems ? { agent_systems: params.agent_systems } : {}),
|
|
202
202
|
});
|
|
203
203
|
let lastRoundRuleErrors: string[] = [];
|
|
@@ -232,7 +232,7 @@ export async function runTaskNow(params: {
|
|
|
232
232
|
});
|
|
233
233
|
const executorRound = await runAgentRound({
|
|
234
234
|
taskSessionRuntime,
|
|
235
|
-
|
|
235
|
+
session_id: runSessionId,
|
|
236
236
|
taskId: task.taskId,
|
|
237
237
|
query: executorQuery,
|
|
238
238
|
actorId: "scheduler",
|
|
@@ -242,13 +242,13 @@ export async function runTaskNow(params: {
|
|
|
242
242
|
executorDelivered = executorRound.delivered;
|
|
243
243
|
outputText = executorRound.outputText;
|
|
244
244
|
executorAssistantMessageSnapshot = serializeDebugSnapshot(
|
|
245
|
-
executorRound.rawResult.
|
|
245
|
+
{ text: executorRound.rawResult.text },
|
|
246
246
|
);
|
|
247
247
|
|
|
248
248
|
try {
|
|
249
|
-
await
|
|
249
|
+
await appendTaskDeferredMessages({
|
|
250
250
|
taskSessionRuntime,
|
|
251
|
-
|
|
251
|
+
session_id: runSessionId,
|
|
252
252
|
taskId: task.taskId,
|
|
253
253
|
rawResult: executorRound.rawResult,
|
|
254
254
|
});
|
|
@@ -306,7 +306,7 @@ export async function runTaskNow(params: {
|
|
|
306
306
|
});
|
|
307
307
|
const simulatorRound = await runAgentRound({
|
|
308
308
|
taskSessionRuntime,
|
|
309
|
-
|
|
309
|
+
session_id: userSimulatorSessionId,
|
|
310
310
|
taskId: task.taskId,
|
|
311
311
|
query: userSimulatorQuery,
|
|
312
312
|
actorId: "user_simulator",
|
|
@@ -314,12 +314,12 @@ export async function runTaskNow(params: {
|
|
|
314
314
|
});
|
|
315
315
|
userSimulatorOutput = simulatorRound.outputText;
|
|
316
316
|
userSimulatorAssistantMessageSnapshot = serializeDebugSnapshot(
|
|
317
|
-
simulatorRound.rawResult.
|
|
317
|
+
{ text: simulatorRound.rawResult.text },
|
|
318
318
|
);
|
|
319
319
|
try {
|
|
320
|
-
await
|
|
320
|
+
await appendTaskDeferredMessages({
|
|
321
321
|
taskSessionRuntime,
|
|
322
|
-
|
|
322
|
+
session_id: userSimulatorSessionId,
|
|
323
323
|
taskId: task.taskId,
|
|
324
324
|
rawResult: simulatorRound.rawResult,
|
|
325
325
|
});
|
|
@@ -31,7 +31,7 @@ export type TaskListItem = {
|
|
|
31
31
|
body?: string;
|
|
32
32
|
when: string;
|
|
33
33
|
status: string;
|
|
34
|
-
|
|
34
|
+
session_id: string;
|
|
35
35
|
kind?: "agent" | "script";
|
|
36
36
|
review?: boolean;
|
|
37
37
|
taskMdPath: string;
|
|
@@ -55,8 +55,8 @@ function isDirectoryNameTimestamp(name: string): boolean {
|
|
|
55
55
|
* - 遍历 `.downcity/task/*` 目录并解析每个 `task.md`。
|
|
56
56
|
* - 通过子目录时间戳推断 `lastRunTimestamp`。
|
|
57
57
|
*/
|
|
58
|
-
export async function listTasks(
|
|
59
|
-
const root = String(
|
|
58
|
+
export async function listTasks(project_root: string): Promise<TaskListItem[]> {
|
|
59
|
+
const root = String(project_root || "").trim();
|
|
60
60
|
if (!root) return [];
|
|
61
61
|
|
|
62
62
|
const dir = getTaskRootDir(root);
|
|
@@ -88,7 +88,7 @@ export async function listTasks(projectRoot: string): Promise<TaskListItem[]> {
|
|
|
88
88
|
taskId,
|
|
89
89
|
markdown: raw,
|
|
90
90
|
taskMdPath,
|
|
91
|
-
|
|
91
|
+
project_root: root,
|
|
92
92
|
});
|
|
93
93
|
if (!parsed.ok) continue;
|
|
94
94
|
|
|
@@ -114,7 +114,7 @@ export async function listTasks(projectRoot: string): Promise<TaskListItem[]> {
|
|
|
114
114
|
...(parsed.task.body ? { body: parsed.task.body } : {}),
|
|
115
115
|
when: parsed.task.frontmatter.when,
|
|
116
116
|
status: parsed.task.frontmatter.status,
|
|
117
|
-
|
|
117
|
+
session_id: parsed.task.frontmatter.session_id,
|
|
118
118
|
kind: parsed.task.frontmatter.kind || "agent",
|
|
119
119
|
...(parsed.task.frontmatter.kind === "agent"
|
|
120
120
|
? { review: Boolean(parsed.task.frontmatter.review) }
|
|
@@ -136,11 +136,11 @@ export async function listTasks(projectRoot: string): Promise<TaskListItem[]> {
|
|
|
136
136
|
* - 若磁盘中存在同 title 多定义,会拒绝并提示冲突。
|
|
137
137
|
*/
|
|
138
138
|
export async function resolveTaskIdByTitle(params: {
|
|
139
|
-
|
|
139
|
+
project_root: string;
|
|
140
140
|
title: string;
|
|
141
141
|
}): Promise<string> {
|
|
142
|
-
const root = String(params.
|
|
143
|
-
if (!root) throw new Error("
|
|
142
|
+
const root = String(params.project_root || "").trim();
|
|
143
|
+
if (!root) throw new Error("project_root is required");
|
|
144
144
|
const title = String(params.title || "").trim();
|
|
145
145
|
if (!title) throw new Error("title is required");
|
|
146
146
|
|
|
@@ -156,9 +156,9 @@ export async function resolveTaskIdByTitle(params: {
|
|
|
156
156
|
/**
|
|
157
157
|
* 读取单个任务定义。
|
|
158
158
|
*/
|
|
159
|
-
export async function readTask(params: { taskId: string;
|
|
160
|
-
const root = String(params.
|
|
161
|
-
if (!root) throw new Error("
|
|
159
|
+
export async function readTask(params: { taskId: string; project_root: string }): Promise<ShipTaskDefinitionV1> {
|
|
160
|
+
const root = String(params.project_root || "").trim();
|
|
161
|
+
if (!root) throw new Error("project_root is required");
|
|
162
162
|
const taskId = normalizeTaskId(params.taskId);
|
|
163
163
|
|
|
164
164
|
const taskMdPath = getTaskMdPath(root, taskId);
|
|
@@ -167,7 +167,7 @@ export async function readTask(params: { taskId: string; projectRoot: string }):
|
|
|
167
167
|
taskId,
|
|
168
168
|
markdown: raw,
|
|
169
169
|
taskMdPath,
|
|
170
|
-
|
|
170
|
+
project_root: root,
|
|
171
171
|
});
|
|
172
172
|
if (!parsed.ok) throw new Error(parsed.error);
|
|
173
173
|
return parsed.task;
|
|
@@ -178,10 +178,10 @@ export async function readTask(params: { taskId: string; projectRoot: string }):
|
|
|
178
178
|
*/
|
|
179
179
|
export async function deleteTask(params: {
|
|
180
180
|
taskId: string;
|
|
181
|
-
|
|
181
|
+
project_root: string;
|
|
182
182
|
}): Promise<{ taskId: string; taskDirPath: string }> {
|
|
183
|
-
const root = String(params.
|
|
184
|
-
if (!root) throw new Error("
|
|
183
|
+
const root = String(params.project_root || "").trim();
|
|
184
|
+
if (!root) throw new Error("project_root is required");
|
|
185
185
|
const taskId = normalizeTaskId(params.taskId);
|
|
186
186
|
|
|
187
187
|
const taskMdPath = getTaskMdPath(root, taskId);
|
|
@@ -208,11 +208,11 @@ export async function writeTask(params: {
|
|
|
208
208
|
taskId: string;
|
|
209
209
|
frontmatter: ShipTaskFrontmatterV1;
|
|
210
210
|
body: string;
|
|
211
|
-
|
|
211
|
+
project_root: string;
|
|
212
212
|
overwrite?: boolean;
|
|
213
213
|
}): Promise<{ taskId: string; taskMdPath: string }> {
|
|
214
|
-
const root = String(params.
|
|
215
|
-
if (!root) throw new Error("
|
|
214
|
+
const root = String(params.project_root || "").trim();
|
|
215
|
+
if (!root) throw new Error("project_root is required");
|
|
216
216
|
const taskId = normalizeTaskId(params.taskId);
|
|
217
217
|
|
|
218
218
|
const dir = getTaskDir(root, taskId);
|
|
@@ -239,10 +239,10 @@ export async function writeTask(params: {
|
|
|
239
239
|
export async function ensureRunDir(params: {
|
|
240
240
|
taskId: string;
|
|
241
241
|
timestamp: string;
|
|
242
|
-
|
|
242
|
+
project_root: string;
|
|
243
243
|
}): Promise<{ runDir: string; runDirRel: string }> {
|
|
244
|
-
const root = String(params.
|
|
245
|
-
if (!root) throw new Error("
|
|
244
|
+
const root = String(params.project_root || "").trim();
|
|
245
|
+
if (!root) throw new Error("project_root is required");
|
|
246
246
|
const taskId = normalizeTaskId(params.taskId);
|
|
247
247
|
const runDir = getTaskRunDir(root, taskId, params.timestamp);
|
|
248
248
|
await fs.ensureDir(runDir);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* - task 定义变更后的 scheduler reload 通过回调注入,避免执行层依赖具体 service 实现。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { PluginContext } from "@downcity/agent";
|
|
10
|
+
import type { PluginExecutionContext } from "@downcity/agent";
|
|
11
11
|
import type {
|
|
12
12
|
TaskCronRegisterResult,
|
|
13
13
|
TaskListActionPayload,
|
|
@@ -42,7 +42,7 @@ export type TaskSchedulerReloadPort = (params: {
|
|
|
42
42
|
/**
|
|
43
43
|
* 当前执行上下文。
|
|
44
44
|
*/
|
|
45
|
-
context:
|
|
45
|
+
context: PluginContext;
|
|
46
46
|
/**
|
|
47
47
|
* 触发本次 reload 的变更动作。
|
|
48
48
|
*/
|
|
@@ -66,10 +66,10 @@ export type { TaskCronRegisterResult } from "@/task/types/TaskPluginTypes.js";
|
|
|
66
66
|
* - 重载失败不阻断主操作,仅记录 warning 供排查。
|
|
67
67
|
*/
|
|
68
68
|
export async function reloadTaskSchedulerAfterMutation(params: {
|
|
69
|
-
context:
|
|
69
|
+
context: PluginContext;
|
|
70
70
|
action: "create" | "update" | "delete" | "status";
|
|
71
71
|
title: string;
|
|
72
|
-
reloadScheduler: (context:
|
|
72
|
+
reloadScheduler: (context: PluginContext) => Promise<TaskCronRegisterResult>;
|
|
73
73
|
}): Promise<TaskSchedulerReloadResult> {
|
|
74
74
|
try {
|
|
75
75
|
const result = await params.reloadScheduler(params.context);
|
|
@@ -108,13 +108,13 @@ export async function reloadTaskSchedulerAfterMutation(params: {
|
|
|
108
108
|
* 执行 `task.list` action。
|
|
109
109
|
*/
|
|
110
110
|
export async function executeTaskListAction(params: {
|
|
111
|
-
context:
|
|
111
|
+
context: PluginContext;
|
|
112
112
|
payload: TaskListActionPayload;
|
|
113
113
|
}) {
|
|
114
114
|
return {
|
|
115
115
|
success: true,
|
|
116
116
|
data: await listTaskDefinitions({
|
|
117
|
-
|
|
117
|
+
project_root: params.context.workspace_path,
|
|
118
118
|
...(params.payload.status ? { status: params.payload.status } : {}),
|
|
119
119
|
}),
|
|
120
120
|
};
|
|
@@ -124,13 +124,13 @@ export async function executeTaskListAction(params: {
|
|
|
124
124
|
* 执行 `task.create` action。
|
|
125
125
|
*/
|
|
126
126
|
export async function executeTaskCreateAction(params: {
|
|
127
|
-
context:
|
|
127
|
+
context: PluginContext;
|
|
128
128
|
payload: TaskCreateRequest;
|
|
129
129
|
reloadSchedulerAfterMutation: TaskSchedulerReloadPort;
|
|
130
130
|
}) {
|
|
131
131
|
const payload = params.payload;
|
|
132
132
|
const result = await createTaskDefinition({
|
|
133
|
-
|
|
133
|
+
project_root: params.context.workspace_path,
|
|
134
134
|
request: payload,
|
|
135
135
|
});
|
|
136
136
|
if (!result.success) {
|
|
@@ -157,15 +157,15 @@ export async function executeTaskCreateAction(params: {
|
|
|
157
157
|
* 执行 `task.run` action。
|
|
158
158
|
*/
|
|
159
159
|
export async function executeTaskRunAction(params: {
|
|
160
|
-
context:
|
|
160
|
+
context: PluginContext;
|
|
161
161
|
payload: TaskRunRequest;
|
|
162
|
-
|
|
162
|
+
execution_context?: PluginExecutionContext;
|
|
163
163
|
}) {
|
|
164
164
|
const result = await runTaskDefinition({
|
|
165
165
|
context: params.context,
|
|
166
|
-
|
|
166
|
+
project_root: params.context.workspace_path,
|
|
167
167
|
request: params.payload,
|
|
168
|
-
|
|
168
|
+
execution_context: params.execution_context,
|
|
169
169
|
});
|
|
170
170
|
if (!result.success) {
|
|
171
171
|
return {
|
|
@@ -183,13 +183,13 @@ export async function executeTaskRunAction(params: {
|
|
|
183
183
|
* 执行 `task.delete` action。
|
|
184
184
|
*/
|
|
185
185
|
export async function executeTaskDeleteAction(params: {
|
|
186
|
-
context:
|
|
186
|
+
context: PluginContext;
|
|
187
187
|
payload: TaskDeleteRequest;
|
|
188
188
|
reloadSchedulerAfterMutation: TaskSchedulerReloadPort;
|
|
189
189
|
}) {
|
|
190
190
|
const payload = params.payload;
|
|
191
191
|
const result = await deleteTaskDefinition({
|
|
192
|
-
|
|
192
|
+
project_root: params.context.workspace_path,
|
|
193
193
|
request: payload,
|
|
194
194
|
});
|
|
195
195
|
if (!result.success) {
|
|
@@ -216,13 +216,13 @@ export async function executeTaskDeleteAction(params: {
|
|
|
216
216
|
* 执行 `task.update` action。
|
|
217
217
|
*/
|
|
218
218
|
export async function executeTaskUpdateAction(params: {
|
|
219
|
-
context:
|
|
219
|
+
context: PluginContext;
|
|
220
220
|
payload: TaskUpdateRequest;
|
|
221
221
|
reloadSchedulerAfterMutation: TaskSchedulerReloadPort;
|
|
222
222
|
}) {
|
|
223
223
|
const payload = params.payload;
|
|
224
224
|
const result = await updateTaskDefinition({
|
|
225
|
-
|
|
225
|
+
project_root: params.context.workspace_path,
|
|
226
226
|
request: payload,
|
|
227
227
|
});
|
|
228
228
|
if (!result.success) {
|
|
@@ -249,13 +249,13 @@ export async function executeTaskUpdateAction(params: {
|
|
|
249
249
|
* 执行 `task.status` action。
|
|
250
250
|
*/
|
|
251
251
|
export async function executeTaskStatusAction(params: {
|
|
252
|
-
context:
|
|
252
|
+
context: PluginContext;
|
|
253
253
|
payload: TaskSetStatusRequest;
|
|
254
254
|
reloadSchedulerAfterMutation: TaskSchedulerReloadPort;
|
|
255
255
|
}) {
|
|
256
256
|
const payload = params.payload;
|
|
257
257
|
const result = await setTaskStatus({
|
|
258
|
-
|
|
258
|
+
project_root: params.context.workspace_path,
|
|
259
259
|
request: payload,
|
|
260
260
|
});
|
|
261
261
|
if (!result.success) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 参数校验尽量前置到输入层,避免进入执行层后才发现字段非法。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { resolve_session_id } from "@downcity/agent";
|
|
10
10
|
import type { JsonValue } from "@downcity/agent";
|
|
11
11
|
import type { PluginActionCommandInput } from "@downcity/agent";
|
|
12
12
|
import type { ShipTaskKind, ShipTaskStatus } from "@/task/types/Task.js";
|
|
@@ -69,13 +69,13 @@ function readTaskKindOrThrow(value?: string): ShipTaskKind | undefined {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function resolveSessionIdOrThrow(input?: string): string {
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
72
|
+
const session_id = resolve_session_id({ session_id: input });
|
|
73
|
+
if (!session_id) {
|
|
74
74
|
throw new Error(
|
|
75
|
-
"Missing
|
|
75
|
+
"Missing session_id. Provide --session-id or ensure DC_SESSION_ID is available.",
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
|
-
return
|
|
78
|
+
return session_id;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function mapTaskListCommandInput(
|
|
@@ -93,7 +93,7 @@ function mapTaskCreateCommandInput(
|
|
|
93
93
|
if (!title) throw new Error("Missing title");
|
|
94
94
|
if (!description) throw new Error("Missing description");
|
|
95
95
|
|
|
96
|
-
const
|
|
96
|
+
const session_id = resolveSessionIdOrThrow(getStringOpt(opts, "session_id"));
|
|
97
97
|
const kind = readTaskKindOrThrow(getStringOpt(opts, "kind"));
|
|
98
98
|
const review = getBooleanLikeOpt(opts, "review");
|
|
99
99
|
const status = readTaskStatusOrThrow(getStringOpt(opts, "status"));
|
|
@@ -107,7 +107,7 @@ function mapTaskCreateCommandInput(
|
|
|
107
107
|
title,
|
|
108
108
|
when: String(getStringOpt(opts, "when") || "@manual").trim() || "@manual",
|
|
109
109
|
description,
|
|
110
|
-
|
|
110
|
+
session_id,
|
|
111
111
|
...(kind ? { kind } : {}),
|
|
112
112
|
...(typeof review === "boolean" ? { review } : {}),
|
|
113
113
|
...(resolvedStatus ? { status: resolvedStatus } : {}),
|
|
@@ -154,7 +154,7 @@ function mapTaskUpdateCommandInput(params: {
|
|
|
154
154
|
typeof getStringOpt(opts, "title") === "string" ||
|
|
155
155
|
typeof getStringOpt(opts, "when") === "string" ||
|
|
156
156
|
typeof getStringOpt(opts, "description") === "string" ||
|
|
157
|
-
typeof getStringOpt(opts, "
|
|
157
|
+
typeof getStringOpt(opts, "session_id") === "string" ||
|
|
158
158
|
typeof kind === "string" ||
|
|
159
159
|
typeof review === "boolean" ||
|
|
160
160
|
getBooleanOpt(opts, "clearWhen") === true ||
|
|
@@ -177,8 +177,8 @@ function mapTaskUpdateCommandInput(params: {
|
|
|
177
177
|
...(typeof getStringOpt(opts, "description") === "string"
|
|
178
178
|
? { description: getStringOpt(opts, "description") }
|
|
179
179
|
: {}),
|
|
180
|
-
...(typeof getStringOpt(opts, "
|
|
181
|
-
? {
|
|
180
|
+
...(typeof getStringOpt(opts, "session_id") === "string"
|
|
181
|
+
? { session_id: getStringOpt(opts, "session_id") }
|
|
182
182
|
: {}),
|
|
183
183
|
...(typeof kind === "string" ? { kind } : {}),
|
|
184
184
|
...(typeof review === "boolean" ? { review } : {}),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import type { Command } from "commander";
|
|
10
10
|
import type { PluginActions } from "@downcity/agent";
|
|
11
|
-
import {
|
|
11
|
+
import { create_action } from "@downcity/agent";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import type { TaskListActionPayload } from "@/task/types/TaskPluginTypes.js";
|
|
14
14
|
import type {
|
|
@@ -49,7 +49,7 @@ const TASK_CREATE_SCHEMA = z.object({
|
|
|
49
49
|
title: z.string(),
|
|
50
50
|
when: z.string(),
|
|
51
51
|
description: z.string(),
|
|
52
|
-
|
|
52
|
+
session_id: z.string(),
|
|
53
53
|
kind: TASK_KIND_SCHEMA.optional(),
|
|
54
54
|
review: z.boolean().optional(),
|
|
55
55
|
status: TASK_STATUS_SCHEMA.optional(),
|
|
@@ -63,7 +63,7 @@ const TASK_UPDATE_SCHEMA = z.object({
|
|
|
63
63
|
when: z.string().optional(),
|
|
64
64
|
clearWhen: z.boolean().optional(),
|
|
65
65
|
description: z.string().optional(),
|
|
66
|
-
|
|
66
|
+
session_id: z.string().optional(),
|
|
67
67
|
kind: TASK_KIND_SCHEMA.optional(),
|
|
68
68
|
review: z.boolean().optional(),
|
|
69
69
|
status: TASK_STATUS_SCHEMA.optional(),
|
|
@@ -92,7 +92,7 @@ export function createTaskPluginActions(params: {
|
|
|
92
92
|
reloadSchedulerAfterMutation: TaskSchedulerReloadPort;
|
|
93
93
|
}): PluginActions {
|
|
94
94
|
return {
|
|
95
|
-
list:
|
|
95
|
+
list: create_action({
|
|
96
96
|
description: "List task definitions, optionally filtered by status.",
|
|
97
97
|
input_schema: {
|
|
98
98
|
zod: TASK_LIST_SCHEMA,
|
|
@@ -119,7 +119,7 @@ export function createTaskPluginActions(params: {
|
|
|
119
119
|
"Filter by status (enabled|paused|disabled).",
|
|
120
120
|
);
|
|
121
121
|
},
|
|
122
|
-
|
|
122
|
+
map_input: mapTaskListCommandPayload,
|
|
123
123
|
},
|
|
124
124
|
execute: async (actionParams) => {
|
|
125
125
|
return executeTaskListAction({
|
|
@@ -128,18 +128,18 @@ export function createTaskPluginActions(params: {
|
|
|
128
128
|
});
|
|
129
129
|
},
|
|
130
130
|
}),
|
|
131
|
-
create:
|
|
131
|
+
create: create_action({
|
|
132
132
|
description: "Create a task definition.",
|
|
133
133
|
input_schema: {
|
|
134
134
|
zod: TASK_CREATE_SCHEMA,
|
|
135
135
|
json_schema: {
|
|
136
136
|
type: "object",
|
|
137
|
-
required: ["title", "when", "description", "
|
|
137
|
+
required: ["title", "when", "description", "session_id"],
|
|
138
138
|
properties: {
|
|
139
139
|
title: { type: "string", description: "Task name and unique semantic identifier." },
|
|
140
140
|
when: { type: "string", description: "Trigger condition (@manual | cron | time:ISO8601)." },
|
|
141
141
|
description: { type: "string", description: "Task description." },
|
|
142
|
-
|
|
142
|
+
session_id: { type: "string", description: "Task execution session_id." },
|
|
143
143
|
kind: { type: "string", enum: ["agent", "script"], description: "Execution kind." },
|
|
144
144
|
review: { type: "boolean", description: "Whether to enable multi-turn review." },
|
|
145
145
|
status: { type: "string", enum: ["enabled", "paused", "disabled"], description: "Task status." },
|
|
@@ -155,7 +155,7 @@ export function createTaskPluginActions(params: {
|
|
|
155
155
|
title: "daily-report",
|
|
156
156
|
when: "@manual",
|
|
157
157
|
description: "Generate a daily report",
|
|
158
|
-
|
|
158
|
+
session_id: "session-1",
|
|
159
159
|
status: "enabled",
|
|
160
160
|
},
|
|
161
161
|
},
|
|
@@ -170,8 +170,8 @@ export function createTaskPluginActions(params: {
|
|
|
170
170
|
.option("--kind <kind>", "Execution kind (agent|script).", "agent")
|
|
171
171
|
.option("--review <review>", "Whether to enable multi-turn review (true|false).")
|
|
172
172
|
.option(
|
|
173
|
-
"--session-id <
|
|
174
|
-
"Task execution
|
|
173
|
+
"--session-id <session_id>",
|
|
174
|
+
"Task execution session_id. If omitted, DC_SESSION_ID is used when available.",
|
|
175
175
|
)
|
|
176
176
|
.option(
|
|
177
177
|
"--status <status>",
|
|
@@ -185,7 +185,7 @@ export function createTaskPluginActions(params: {
|
|
|
185
185
|
.option("--body <body>", "Task body.")
|
|
186
186
|
.option("--overwrite", "Overwrite an existing task.md.", false);
|
|
187
187
|
},
|
|
188
|
-
|
|
188
|
+
map_input: mapTaskCreateCommandPayload,
|
|
189
189
|
},
|
|
190
190
|
execute: async (actionParams) => {
|
|
191
191
|
return executeTaskCreateAction({
|
|
@@ -195,7 +195,7 @@ export function createTaskPluginActions(params: {
|
|
|
195
195
|
});
|
|
196
196
|
},
|
|
197
197
|
}),
|
|
198
|
-
run:
|
|
198
|
+
run: create_action({
|
|
199
199
|
description: "Run a task manually.",
|
|
200
200
|
input_schema: {
|
|
201
201
|
zod: TASK_RUN_SCHEMA,
|
|
@@ -216,17 +216,17 @@ export function createTaskPluginActions(params: {
|
|
|
216
216
|
.argument("<title>")
|
|
217
217
|
.option("--reason <reason>", "Reason for manual run.");
|
|
218
218
|
},
|
|
219
|
-
|
|
219
|
+
map_input: mapTaskRunCommandPayload,
|
|
220
220
|
},
|
|
221
221
|
execute: async (actionParams) => {
|
|
222
222
|
return executeTaskRunAction({
|
|
223
223
|
context: actionParams.context,
|
|
224
224
|
payload: actionParams.input as TaskRunRequest,
|
|
225
|
-
|
|
225
|
+
execution_context: actionParams.execution_context,
|
|
226
226
|
});
|
|
227
227
|
},
|
|
228
228
|
}),
|
|
229
|
-
delete:
|
|
229
|
+
delete: create_action({
|
|
230
230
|
description: "Delete a task definition and historical run directories.",
|
|
231
231
|
input_schema: {
|
|
232
232
|
zod: TASK_DELETE_SCHEMA,
|
|
@@ -244,7 +244,7 @@ export function createTaskPluginActions(params: {
|
|
|
244
244
|
configure(command: Command) {
|
|
245
245
|
command.argument("<title>");
|
|
246
246
|
},
|
|
247
|
-
|
|
247
|
+
map_input: mapTaskDeleteCommandPayload,
|
|
248
248
|
},
|
|
249
249
|
execute: async (actionParams) => {
|
|
250
250
|
return executeTaskDeleteAction({
|
|
@@ -254,7 +254,7 @@ export function createTaskPluginActions(params: {
|
|
|
254
254
|
});
|
|
255
255
|
},
|
|
256
256
|
}),
|
|
257
|
-
update:
|
|
257
|
+
update: create_action({
|
|
258
258
|
description: "Update a task definition.",
|
|
259
259
|
input_schema: {
|
|
260
260
|
zod: TASK_UPDATE_SCHEMA,
|
|
@@ -267,7 +267,7 @@ export function createTaskPluginActions(params: {
|
|
|
267
267
|
when: { type: "string", description: "New trigger condition." },
|
|
268
268
|
clearWhen: { type: "boolean", description: "Whether to clear the trigger condition." },
|
|
269
269
|
description: { type: "string", description: "New description." },
|
|
270
|
-
|
|
270
|
+
session_id: { type: "string", description: "New session_id." },
|
|
271
271
|
kind: { type: "string", enum: ["agent", "script"] },
|
|
272
272
|
review: { type: "boolean" },
|
|
273
273
|
status: { type: "string", enum: ["enabled", "paused", "disabled"] },
|
|
@@ -293,7 +293,7 @@ export function createTaskPluginActions(params: {
|
|
|
293
293
|
.option("--kind <kind>", "Execution kind (agent|script).")
|
|
294
294
|
.option("--review <review>", "Whether to enable multi-turn review (true|false).")
|
|
295
295
|
.option("--clear-when", "Clear when and fall back to @manual.", false)
|
|
296
|
-
.option("--session-id <
|
|
296
|
+
.option("--session-id <session_id>", "Task execution session_id.")
|
|
297
297
|
.option("--status <status>", "Status (enabled|paused|disabled).")
|
|
298
298
|
.option(
|
|
299
299
|
"--activate",
|
|
@@ -303,7 +303,7 @@ export function createTaskPluginActions(params: {
|
|
|
303
303
|
.option("--body <body>", "Set task body.")
|
|
304
304
|
.option("--clear-body", "Clear task body.", false);
|
|
305
305
|
},
|
|
306
|
-
|
|
306
|
+
map_input: mapTaskUpdateCommandPayload,
|
|
307
307
|
},
|
|
308
308
|
execute: async (actionParams) => {
|
|
309
309
|
return executeTaskUpdateAction({
|
|
@@ -313,7 +313,7 @@ export function createTaskPluginActions(params: {
|
|
|
313
313
|
});
|
|
314
314
|
},
|
|
315
315
|
}),
|
|
316
|
-
status:
|
|
316
|
+
status: create_action({
|
|
317
317
|
description: "Set task status (enabled|paused|disabled).",
|
|
318
318
|
input_schema: {
|
|
319
319
|
zod: TASK_STATUS_REQ_SCHEMA,
|
|
@@ -334,7 +334,7 @@ export function createTaskPluginActions(params: {
|
|
|
334
334
|
configure(command: Command) {
|
|
335
335
|
command.argument("<title>").argument("<status>");
|
|
336
336
|
},
|
|
337
|
-
|
|
337
|
+
map_input: mapTaskStatusCommandPayload,
|
|
338
338
|
},
|
|
339
339
|
execute: async (actionParams) => {
|
|
340
340
|
return executeTaskStatusAction({
|
|
@@ -344,7 +344,7 @@ export function createTaskPluginActions(params: {
|
|
|
344
344
|
});
|
|
345
345
|
},
|
|
346
346
|
}),
|
|
347
|
-
enable:
|
|
347
|
+
enable: create_action({
|
|
348
348
|
description: "Enable a task (status=enabled).",
|
|
349
349
|
input_schema: {
|
|
350
350
|
zod: z.object({ title: z.string() }),
|
|
@@ -360,7 +360,7 @@ export function createTaskPluginActions(params: {
|
|
|
360
360
|
configure(command: Command) {
|
|
361
361
|
command.argument("<title>");
|
|
362
362
|
},
|
|
363
|
-
|
|
363
|
+
map_input: mapTaskEnableCommandPayload,
|
|
364
364
|
},
|
|
365
365
|
execute: async (actionParams) => {
|
|
366
366
|
return executeTaskStatusAction({
|
|
@@ -370,7 +370,7 @@ export function createTaskPluginActions(params: {
|
|
|
370
370
|
});
|
|
371
371
|
},
|
|
372
372
|
}),
|
|
373
|
-
disable:
|
|
373
|
+
disable: create_action({
|
|
374
374
|
description: "Disable a task (status=disabled).",
|
|
375
375
|
input_schema: {
|
|
376
376
|
zod: z.object({ title: z.string() }),
|
|
@@ -386,7 +386,7 @@ export function createTaskPluginActions(params: {
|
|
|
386
386
|
configure(command: Command) {
|
|
387
387
|
command.argument("<title>");
|
|
388
388
|
},
|
|
389
|
-
|
|
389
|
+
map_input: mapTaskDisableCommandPayload,
|
|
390
390
|
},
|
|
391
391
|
execute: async (actionParams) => {
|
|
392
392
|
return executeTaskStatusAction({
|