@downcity/agent 1.1.13 → 1.1.14
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/{runtime → core}/AgentContextTypes.d.ts +6 -6
- package/bin/core/AgentContextTypes.d.ts.map +1 -0
- package/bin/{runtime → core}/AgentContextTypes.js +2 -2
- package/bin/core/AgentContextTypes.js.map +1 -0
- package/bin/core/AgentCore.d.ts +87 -0
- package/bin/core/AgentCore.d.ts.map +1 -0
- package/bin/core/AgentCore.js +467 -0
- package/bin/core/AgentCore.js.map +1 -0
- package/bin/{runtime/AgentRuntimeTypes.d.ts → core/AgentCoreTypes.d.ts} +7 -7
- package/bin/core/AgentCoreTypes.d.ts.map +1 -0
- package/bin/core/AgentCoreTypes.js +10 -0
- package/bin/core/AgentCoreTypes.js.map +1 -0
- package/bin/host/runtime/PluginRuntime.d.ts +1 -1
- package/bin/host/runtime/PluginRuntime.d.ts.map +1 -1
- package/bin/index.d.ts +6 -8
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +2 -5
- package/bin/index.js.map +1 -1
- package/bin/plugin/builtins/asr/InboundAugment.d.ts +1 -1
- package/bin/plugin/builtins/asr/InboundAugment.d.ts.map +1 -1
- package/bin/plugin/builtins/auth/runtime/AuthorizationConfig.d.ts +1 -1
- package/bin/plugin/builtins/auth/runtime/AuthorizationConfig.d.ts.map +1 -1
- package/bin/plugin/builtins/auth/runtime/AuthorizationStore.d.ts +1 -1
- package/bin/plugin/builtins/auth/runtime/AuthorizationStore.d.ts.map +1 -1
- package/bin/plugin/builtins/voice/InboundAugment.d.ts +1 -1
- package/bin/plugin/builtins/voice/InboundAugment.d.ts.map +1 -1
- package/bin/plugin/builtins/workboard/runtime/Collector.d.ts +1 -1
- package/bin/plugin/builtins/workboard/runtime/Collector.d.ts.map +1 -1
- package/bin/plugin/builtins/workboard/runtime/Collector.js +1 -1
- package/bin/plugin/builtins/workboard/runtime/Collector.js.map +1 -1
- package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts +1 -1
- package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts.map +1 -1
- package/bin/plugin/builtins/workboard/runtime/Store.d.ts +1 -1
- package/bin/plugin/builtins/workboard/runtime/Store.d.ts.map +1 -1
- package/bin/plugin/core/Activation.d.ts +2 -2
- package/bin/plugin/core/Activation.d.ts.map +1 -1
- package/bin/plugin/core/HookRegistry.d.ts +1 -1
- package/bin/plugin/core/HookRegistry.d.ts.map +1 -1
- package/bin/plugin/core/HttpRoutes.d.ts +1 -1
- package/bin/plugin/core/HttpRoutes.d.ts.map +1 -1
- package/bin/plugin/core/LocalExecution.d.ts.map +1 -1
- package/bin/plugin/core/LocalExecution.js +18 -20
- package/bin/plugin/core/LocalExecution.js.map +1 -1
- package/bin/plugin/core/PluginRegistry.d.ts +1 -1
- package/bin/plugin/core/PluginRegistry.d.ts.map +1 -1
- package/bin/plugin/types/Plugin.d.ts +1 -1
- package/bin/plugin/types/Plugin.d.ts.map +1 -1
- package/bin/sandbox/SandboxConfigResolver.d.ts +1 -1
- package/bin/sandbox/SandboxConfigResolver.d.ts.map +1 -1
- package/bin/sandbox/SandboxRunner.d.ts +1 -1
- package/bin/sandbox/SandboxRunner.d.ts.map +1 -1
- package/bin/sdk/Agent.d.ts +25 -23
- package/bin/sdk/Agent.d.ts.map +1 -1
- package/bin/sdk/Agent.js +86 -365
- package/bin/sdk/Agent.js.map +1 -1
- package/bin/sdk/AgentSdkTypes.d.ts +138 -0
- package/bin/sdk/AgentSdkTypes.d.ts.map +1 -1
- package/bin/sdk/HttpServer.d.ts +9 -19
- package/bin/sdk/HttpServer.d.ts.map +1 -1
- package/bin/sdk/HttpServer.js +26 -156
- package/bin/sdk/HttpServer.js.map +1 -1
- package/bin/sdk/RpcServer.d.ts +9 -10
- package/bin/sdk/RpcServer.d.ts.map +1 -1
- package/bin/sdk/RpcServer.js +22 -178
- package/bin/sdk/RpcServer.js.map +1 -1
- package/bin/sdk/Session.d.ts +2 -2
- package/bin/sdk/Session.d.ts.map +1 -1
- package/bin/sdk/Session.js +7 -1
- package/bin/sdk/Session.js.map +1 -1
- package/bin/sdk/SessionServicePort.d.ts +1 -1
- package/bin/sdk/SessionServicePort.d.ts.map +1 -1
- package/bin/server/http/Server.d.ts +10 -1
- package/bin/server/http/Server.d.ts.map +1 -1
- package/bin/server/http/Server.js +41 -15
- package/bin/server/http/Server.js.map +1 -1
- package/bin/server/http/control/AuthControlService.d.ts +1 -1
- package/bin/server/http/control/AuthControlService.d.ts.map +1 -1
- package/bin/server/http/control/ControlAuthorizationRoutes.d.ts +1 -1
- package/bin/server/http/control/ControlAuthorizationRoutes.d.ts.map +1 -1
- package/bin/server/http/control/ControlRouter.d.ts +18 -2
- package/bin/server/http/control/ControlRouter.d.ts.map +1 -1
- package/bin/server/http/control/ControlRouter.js +10 -8
- package/bin/server/http/control/ControlRouter.js.map +1 -1
- package/bin/server/http/control/ExecuteBySession.d.ts +2 -2
- package/bin/server/http/control/ExecuteBySession.d.ts.map +1 -1
- package/bin/server/http/control/OverviewRoutes.d.ts.map +1 -1
- package/bin/server/http/control/OverviewRoutes.js +6 -2
- package/bin/server/http/control/OverviewRoutes.js.map +1 -1
- package/bin/server/http/control/SessionSummaryStore.d.ts +1 -1
- package/bin/server/http/control/SessionSummaryStore.d.ts.map +1 -1
- package/bin/server/http/control/types/ControlRoutes.d.ts +2 -2
- package/bin/server/http/control/types/ControlRoutes.d.ts.map +1 -1
- package/bin/server/http/execute/execute.d.ts +13 -2
- package/bin/server/http/execute/execute.d.ts.map +1 -1
- package/bin/server/http/execute/execute.js +73 -71
- package/bin/server/http/execute/execute.js.map +1 -1
- package/bin/server/http/plugins/plugins.d.ts +13 -2
- package/bin/server/http/plugins/plugins.d.ts.map +1 -1
- package/bin/server/http/plugins/plugins.js +42 -40
- package/bin/server/http/plugins/plugins.js.map +1 -1
- package/bin/server/http/services/services.d.ts +12 -8
- package/bin/server/http/services/services.d.ts.map +1 -1
- package/bin/server/http/services/services.js +57 -64
- package/bin/server/http/services/services.js.map +1 -1
- package/bin/server/http/static/static.d.ts +13 -2
- package/bin/server/http/static/static.d.ts.map +1 -1
- package/bin/server/http/static/static.js +81 -79
- package/bin/server/http/static/static.js.map +1 -1
- package/bin/server/rpc/Server.d.ts +5 -3
- package/bin/server/rpc/Server.d.ts.map +1 -1
- package/bin/server/rpc/Server.js +22 -12
- package/bin/server/rpc/Server.js.map +1 -1
- package/bin/service/builtins/BaseService.d.ts +2 -2
- package/bin/service/builtins/BaseService.d.ts.map +1 -1
- package/bin/service/builtins/chat/Action.d.ts +1 -1
- package/bin/service/builtins/chat/Action.d.ts.map +1 -1
- package/bin/service/builtins/chat/ChatService.d.ts +2 -2
- package/bin/service/builtins/chat/ChatService.d.ts.map +1 -1
- package/bin/service/builtins/chat/ChatServiceTypes.d.ts +1 -1
- package/bin/service/builtins/chat/ChatServiceTypes.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/BaseChatChannel.d.ts +1 -1
- package/bin/service/builtins/chat/channels/BaseChatChannel.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/BaseChatChannelQueue.d.ts +1 -1
- package/bin/service/builtins/chat/channels/BaseChatChannelQueue.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/BaseChatChannelSupport.d.ts +1 -1
- package/bin/service/builtins/chat/channels/BaseChatChannelSupport.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/feishu/Feishu.d.ts +1 -1
- package/bin/service/builtins/chat/channels/feishu/Feishu.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.d.ts +1 -1
- package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/feishu/FeishuPlatformClient.d.ts +1 -1
- package/bin/service/builtins/chat/channels/feishu/FeishuPlatformClient.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/qq/QQ.d.ts +1 -1
- package/bin/service/builtins/chat/channels/qq/QQ.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/qq/QQMessageHandler.d.ts +1 -1
- package/bin/service/builtins/chat/channels/qq/QQMessageHandler.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/qq/QQSupport.d.ts +1 -1
- package/bin/service/builtins/chat/channels/qq/QQSupport.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/telegram/Bot.d.ts +1 -1
- package/bin/service/builtins/chat/channels/telegram/Bot.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.d.ts +1 -1
- package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/telegram/TelegramPlatformClient.d.ts +1 -1
- package/bin/service/builtins/chat/channels/telegram/TelegramPlatformClient.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChannelContextStore.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChannelContextStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatActionExecution.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatActionExecution.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatActionInput.d.ts +3 -36
- package/bin/service/builtins/chat/runtime/ChatActionInput.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatActionInput.js +3 -118
- package/bin/service/builtins/chat/runtime/ChatActionInput.js.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelActions.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelActions.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelConfig.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelLifecycle.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelLifecycle.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatHistoryStore.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatHistoryStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatIngressStore.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatIngressStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatMetaStore.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatMetaStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueReplyDispatch.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueReplyDispatch.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueSessionBridge.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueSessionBridge.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueStore.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueWorker.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatQueueWorker.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatServiceActions.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatServiceActions.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatServiceActions.js +2 -109
- package/bin/service/builtins/chat/runtime/ChatServiceActions.js.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatServiceSystem.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatServiceSystem.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatSessionDelete.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatSessionDelete.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatkeySend.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatkeySend.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/EnqueueDispatch.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/EnqueueDispatch.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/InboundAugment.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/InboundAugment.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/PluginDispatch.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/PluginDispatch.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ReplyDispatch.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ReplyDispatch.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/SystemPrompt.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/SystemPrompt.d.ts.map +1 -1
- package/bin/service/builtins/contact/Action.d.ts +2 -2
- package/bin/service/builtins/contact/Action.d.ts.map +1 -1
- package/bin/service/builtins/contact/Action.js +2 -58
- package/bin/service/builtins/contact/Action.js.map +1 -1
- package/bin/service/builtins/contact/ContactService.d.ts +1 -1
- package/bin/service/builtins/contact/ContactService.d.ts.map +1 -1
- package/bin/service/builtins/contact/runtime/ChatRuntime.d.ts +1 -1
- package/bin/service/builtins/contact/runtime/ChatRuntime.d.ts.map +1 -1
- package/bin/service/builtins/contact/runtime/ContactPayload.d.ts +0 -7
- package/bin/service/builtins/contact/runtime/ContactPayload.d.ts.map +1 -1
- package/bin/service/builtins/contact/runtime/ContactPayload.js +0 -9
- package/bin/service/builtins/contact/runtime/ContactPayload.js.map +1 -1
- package/bin/service/builtins/contact/runtime/RemoteClient.d.ts +1 -1
- package/bin/service/builtins/contact/runtime/RemoteClient.d.ts.map +1 -1
- package/bin/service/builtins/contact/runtime/RemoteClient.js +37 -19
- package/bin/service/builtins/contact/runtime/RemoteClient.js.map +1 -1
- package/bin/service/builtins/contact/runtime/ShareBundle.d.ts +1 -1
- package/bin/service/builtins/contact/runtime/ShareBundle.d.ts.map +1 -1
- package/bin/service/builtins/memory/Action.d.ts +1 -1
- package/bin/service/builtins/memory/Action.d.ts.map +1 -1
- package/bin/service/builtins/memory/MemoryService.d.ts +1 -1
- package/bin/service/builtins/memory/MemoryService.d.ts.map +1 -1
- package/bin/service/builtins/memory/MemoryService.js +0 -27
- package/bin/service/builtins/memory/MemoryService.js.map +1 -1
- package/bin/service/builtins/memory/runtime/Flush.d.ts +1 -1
- package/bin/service/builtins/memory/runtime/Flush.d.ts.map +1 -1
- package/bin/service/builtins/memory/runtime/Search.d.ts +1 -1
- package/bin/service/builtins/memory/runtime/Search.d.ts.map +1 -1
- package/bin/service/builtins/memory/runtime/Store.d.ts +1 -1
- package/bin/service/builtins/memory/runtime/Store.d.ts.map +1 -1
- package/bin/service/builtins/memory/runtime/SystemProvider.d.ts +1 -1
- package/bin/service/builtins/memory/runtime/SystemProvider.d.ts.map +1 -1
- package/bin/service/builtins/memory/runtime/Writer.d.ts +1 -1
- package/bin/service/builtins/memory/runtime/Writer.d.ts.map +1 -1
- package/bin/service/builtins/schedule/ScheduleService.d.ts +39 -0
- package/bin/service/builtins/schedule/ScheduleService.d.ts.map +1 -0
- package/bin/service/builtins/schedule/ScheduleService.js +106 -0
- package/bin/service/builtins/schedule/ScheduleService.js.map +1 -0
- package/bin/service/builtins/shell/ShellRuntimeTypes.d.ts +1 -1
- package/bin/service/builtins/shell/ShellRuntimeTypes.d.ts.map +1 -1
- package/bin/service/builtins/shell/ShellService.d.ts +2 -2
- package/bin/service/builtins/shell/ShellService.d.ts.map +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionResponse.d.ts +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionResponse.d.ts.map +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionRuntime.d.ts +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionRuntime.d.ts.map +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts.map +1 -1
- package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.d.ts +1 -1
- package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.d.ts.map +1 -1
- package/bin/service/builtins/task/Action.d.ts +1 -1
- package/bin/service/builtins/task/Action.d.ts.map +1 -1
- package/bin/service/builtins/task/Scheduler.d.ts +1 -1
- package/bin/service/builtins/task/Scheduler.d.ts.map +1 -1
- package/bin/service/builtins/task/TaskService.d.ts +2 -2
- package/bin/service/builtins/task/TaskService.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/CronRuntime.d.ts +1 -1
- package/bin/service/builtins/task/runtime/CronRuntime.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/Runner.d.ts +1 -1
- package/bin/service/builtins/task/runtime/Runner.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskActionExecution.d.ts +1 -1
- package/bin/service/builtins/task/runtime/TaskActionExecution.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskActionInput.d.ts +2 -31
- package/bin/service/builtins/task/runtime/TaskActionInput.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskActionInput.js +2 -141
- package/bin/service/builtins/task/runtime/TaskActionInput.js.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunChatDispatch.d.ts +1 -1
- package/bin/service/builtins/task/runtime/TaskRunChatDispatch.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerRound.d.ts +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerRound.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerScript.d.ts +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerScript.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerSession.d.ts +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerSession.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskServiceActions.d.ts +1 -1
- package/bin/service/builtins/task/runtime/TaskServiceActions.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskServiceActions.js +2 -30
- package/bin/service/builtins/task/runtime/TaskServiceActions.js.map +1 -1
- package/bin/service/core/Manager.d.ts +0 -1
- package/bin/service/core/Manager.d.ts.map +1 -1
- package/bin/service/core/Manager.js +0 -1
- package/bin/service/core/Manager.js.map +1 -1
- package/bin/service/core/ServiceActionRunner.d.ts +1 -1
- package/bin/service/core/ServiceActionRunner.d.ts.map +1 -1
- package/bin/service/core/ServiceActionRunner.js +3 -1
- package/bin/service/core/ServiceActionRunner.js.map +1 -1
- package/bin/service/core/ServiceClassRegistry.d.ts +1 -1
- package/bin/service/core/ServiceClassRegistry.d.ts.map +1 -1
- package/bin/service/core/ServiceCommandRequest.d.ts +36 -0
- package/bin/service/core/ServiceCommandRequest.d.ts.map +1 -0
- package/bin/service/core/ServiceCommandRequest.js +53 -0
- package/bin/service/core/ServiceCommandRequest.js.map +1 -0
- package/bin/service/core/ServiceManager.d.ts +1 -1
- package/bin/service/core/ServiceManager.d.ts.map +1 -1
- package/bin/service/core/ServiceStateController.d.ts +20 -7
- package/bin/service/core/ServiceStateController.d.ts.map +1 -1
- package/bin/service/core/ServiceStateController.js +23 -20
- package/bin/service/core/ServiceStateController.js.map +1 -1
- package/bin/service/core/ServiceSystemProviders.d.ts +1 -1
- package/bin/service/core/ServiceSystemProviders.d.ts.map +1 -1
- package/bin/service/core/Services.d.ts +1 -1
- package/bin/service/core/Services.d.ts.map +1 -1
- package/bin/service/core/Services.js +2 -0
- package/bin/service/core/Services.js.map +1 -1
- package/bin/service/schedule/Executor.d.ts +1 -1
- package/bin/service/schedule/Executor.d.ts.map +1 -1
- package/bin/service/types/Service.d.ts +1 -23
- package/bin/service/types/Service.d.ts.map +1 -1
- package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts +1 -1
- package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts.map +1 -1
- package/bin/session/composer/system/default/SystemDomain.d.ts +1 -1
- package/bin/session/composer/system/default/SystemDomain.d.ts.map +1 -1
- package/bin/session/tools/shell/ShellToolBridge.d.ts +1 -1
- package/bin/session/tools/shell/ShellToolBridge.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/{runtime → core}/AgentContextTypes.ts +6 -7
- package/src/core/AgentCore.ts +527 -0
- package/src/{runtime/AgentRuntimeTypes.ts → core/AgentCoreTypes.ts} +6 -6
- package/src/host/runtime/PluginRuntime.ts +1 -1
- package/src/index.ts +24 -21
- package/src/plugin/builtins/asr/InboundAugment.ts +1 -1
- package/src/plugin/builtins/auth/runtime/AuthorizationConfig.ts +1 -1
- package/src/plugin/builtins/auth/runtime/AuthorizationStore.ts +1 -1
- package/src/plugin/builtins/voice/InboundAugment.ts +1 -1
- package/src/plugin/builtins/workboard/runtime/Collector.ts +2 -2
- package/src/plugin/builtins/workboard/runtime/Normalizer.ts +1 -1
- package/src/plugin/builtins/workboard/runtime/Store.ts +1 -1
- package/src/plugin/core/Activation.ts +2 -2
- package/src/plugin/core/HookRegistry.ts +1 -1
- package/src/plugin/core/HttpRoutes.ts +1 -1
- package/src/plugin/core/LocalExecution.ts +21 -20
- package/src/plugin/core/PluginRegistry.ts +1 -1
- package/src/plugin/types/Plugin.ts +1 -1
- package/src/sandbox/SandboxConfigResolver.ts +1 -1
- package/src/sandbox/SandboxRunner.ts +1 -1
- package/src/sdk/Agent.ts +99 -393
- package/src/sdk/AgentSdkTypes.ts +158 -0
- package/src/sdk/HttpServer.ts +27 -192
- package/src/sdk/RpcServer.ts +24 -211
- package/src/sdk/Session.ts +12 -2
- package/src/sdk/SessionServicePort.ts +1 -1
- package/src/server/http/Server.ts +63 -18
- package/src/server/http/control/AuthControlService.ts +1 -1
- package/src/server/http/control/ControlAuthorizationRoutes.ts +1 -1
- package/src/server/http/control/ControlRouter.ts +27 -11
- package/src/server/http/control/ExecuteBySession.ts +2 -2
- package/src/server/http/control/OverviewRoutes.ts +6 -2
- package/src/server/http/control/SessionSummaryStore.ts +1 -1
- package/src/server/http/control/types/ControlRoutes.ts +2 -2
- package/src/server/http/execute/execute.ts +107 -91
- package/src/server/http/plugins/plugins.ts +60 -44
- package/src/server/http/services/services.ts +68 -64
- package/src/server/http/static/static.ts +95 -79
- package/src/server/rpc/Server.ts +26 -15
- package/src/service/builtins/BaseService.ts +2 -2
- package/src/service/builtins/chat/Action.ts +1 -1
- package/src/service/builtins/chat/ChatService.ts +2 -2
- package/src/service/builtins/chat/ChatServiceTypes.ts +1 -1
- package/src/service/builtins/chat/channels/BaseChatChannel.ts +1 -1
- package/src/service/builtins/chat/channels/BaseChatChannelQueue.ts +1 -1
- package/src/service/builtins/chat/channels/BaseChatChannelSupport.ts +1 -1
- package/src/service/builtins/chat/channels/feishu/Feishu.ts +1 -1
- package/src/service/builtins/chat/channels/feishu/FeishuMessageHandler.ts +1 -1
- package/src/service/builtins/chat/channels/feishu/FeishuPlatformClient.ts +1 -1
- package/src/service/builtins/chat/channels/qq/QQ.ts +1 -1
- package/src/service/builtins/chat/channels/qq/QQMessageHandler.ts +1 -1
- package/src/service/builtins/chat/channels/qq/QQSupport.ts +1 -1
- package/src/service/builtins/chat/channels/telegram/Bot.ts +1 -1
- package/src/service/builtins/chat/channels/telegram/TelegramMessageHandler.ts +1 -1
- package/src/service/builtins/chat/channels/telegram/TelegramPlatformClient.ts +1 -1
- package/src/service/builtins/chat/runtime/ChannelContextStore.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatActionExecution.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatActionInput.ts +2 -158
- package/src/service/builtins/chat/runtime/ChatChannelActions.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatChannelConfig.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatChannelCore.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatChannelLifecycle.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatHistoryStore.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatIngressStore.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatMetaStore.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatQueueReplyDispatch.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatQueueSessionBridge.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatQueueStore.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatQueueWorker.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatServiceActions.ts +1 -118
- package/src/service/builtins/chat/runtime/ChatServiceSystem.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatSessionDelete.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatkeySend.ts +1 -1
- package/src/service/builtins/chat/runtime/EnqueueDispatch.ts +1 -1
- package/src/service/builtins/chat/runtime/InboundAugment.ts +1 -1
- package/src/service/builtins/chat/runtime/PluginDispatch.ts +1 -1
- package/src/service/builtins/chat/runtime/ReplyDispatch.ts +1 -1
- package/src/service/builtins/chat/runtime/SystemPrompt.ts +1 -1
- package/src/service/builtins/contact/Action.ts +2 -59
- package/src/service/builtins/contact/ContactService.ts +2 -2
- package/src/service/builtins/contact/runtime/ChatRuntime.ts +1 -1
- package/src/service/builtins/contact/runtime/ContactPayload.ts +0 -12
- package/src/service/builtins/contact/runtime/RemoteClient.ts +40 -19
- package/src/service/builtins/contact/runtime/ShareBundle.ts +1 -1
- package/src/service/builtins/memory/Action.ts +1 -1
- package/src/service/builtins/memory/MemoryService.ts +1 -28
- package/src/service/builtins/memory/runtime/Flush.ts +1 -1
- package/src/service/builtins/memory/runtime/Search.ts +1 -1
- package/src/service/builtins/memory/runtime/Store.ts +1 -1
- package/src/service/builtins/memory/runtime/SystemProvider.ts +1 -1
- package/src/service/builtins/memory/runtime/Writer.ts +1 -1
- package/src/service/builtins/schedule/ScheduleService.ts +131 -0
- package/src/service/builtins/shell/ShellRuntimeTypes.ts +1 -1
- package/src/service/builtins/shell/ShellService.ts +2 -2
- package/src/service/builtins/shell/runtime/ShellActionResponse.ts +1 -1
- package/src/service/builtins/shell/runtime/ShellActionRuntime.ts +1 -1
- package/src/service/builtins/shell/runtime/ShellActionRuntimeSupport.ts +1 -1
- package/src/service/builtins/shell/runtime/ShellRuntimeEnvironment.ts +1 -1
- package/src/service/builtins/task/Action.ts +1 -1
- package/src/service/builtins/task/Scheduler.ts +1 -1
- package/src/service/builtins/task/TaskService.ts +2 -2
- package/src/service/builtins/task/runtime/CronRuntime.ts +1 -1
- package/src/service/builtins/task/runtime/Runner.ts +1 -1
- package/src/service/builtins/task/runtime/TaskActionExecution.ts +1 -1
- package/src/service/builtins/task/runtime/TaskActionInput.ts +3 -185
- package/src/service/builtins/task/runtime/TaskRunChatDispatch.ts +1 -1
- package/src/service/builtins/task/runtime/TaskRunnerRound.ts +1 -1
- package/src/service/builtins/task/runtime/TaskRunnerScript.ts +1 -1
- package/src/service/builtins/task/runtime/TaskRunnerSession.ts +1 -1
- package/src/service/builtins/task/runtime/TaskServiceActions.ts +1 -35
- package/src/service/core/Manager.ts +0 -1
- package/src/service/core/ServiceActionRunner.ts +4 -2
- package/src/service/core/ServiceClassRegistry.ts +1 -1
- package/src/service/core/ServiceCommandRequest.ts +93 -0
- package/src/service/core/ServiceManager.ts +0 -1
- package/src/service/core/ServiceStateController.ts +45 -20
- package/src/service/core/ServiceSystemProviders.ts +1 -1
- package/src/service/core/Services.ts +3 -1
- package/src/service/schedule/Executor.ts +1 -1
- package/src/service/types/Service.ts +1 -24
- package/src/session/composer/system/default/DefaultSessionSystemComposer.ts +1 -1
- package/src/session/composer/system/default/SystemDomain.ts +1 -1
- package/src/session/tools/shell/ShellToolBridge.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/bin/runtime/AgentContext.d.ts +0 -23
- package/bin/runtime/AgentContext.d.ts.map +0 -1
- package/bin/runtime/AgentContext.js +0 -149
- package/bin/runtime/AgentContext.js.map +0 -1
- package/bin/runtime/AgentContextTypes.d.ts.map +0 -1
- package/bin/runtime/AgentContextTypes.js.map +0 -1
- package/bin/runtime/AgentRuntime.d.ts +0 -37
- package/bin/runtime/AgentRuntime.d.ts.map +0 -1
- package/bin/runtime/AgentRuntime.js +0 -291
- package/bin/runtime/AgentRuntime.js.map +0 -1
- package/bin/runtime/AgentRuntimeState.d.ts +0 -42
- package/bin/runtime/AgentRuntimeState.d.ts.map +0 -1
- package/bin/runtime/AgentRuntimeState.js +0 -172
- package/bin/runtime/AgentRuntimeState.js.map +0 -1
- package/bin/runtime/AgentRuntimeTypes.d.ts.map +0 -1
- package/bin/runtime/AgentRuntimeTypes.js +0 -10
- package/bin/runtime/AgentRuntimeTypes.js.map +0 -1
- package/bin/service/core/ServiceActionApi.d.ts +0 -15
- package/bin/service/core/ServiceActionApi.d.ts.map +0 -1
- package/bin/service/core/ServiceActionApi.js +0 -234
- package/bin/service/core/ServiceActionApi.js.map +0 -1
- package/bin/service/schedule/Runtime.d.ts +0 -17
- package/bin/service/schedule/Runtime.d.ts.map +0 -1
- package/bin/service/schedule/Runtime.js +0 -64
- package/bin/service/schedule/Runtime.js.map +0 -1
- package/src/runtime/AgentContext.ts +0 -182
- package/src/runtime/AgentRuntime.ts +0 -366
- package/src/runtime/AgentRuntimeState.ts +0 -213
- package/src/service/core/ServiceActionApi.ts +0 -304
- package/src/service/schedule/Runtime.ts +0 -78
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatActionInput:chat service 的 CLI
|
|
2
|
+
* ChatActionInput:chat service 的 CLI 输入映射模块。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* -
|
|
5
|
+
* - 这里统一处理命令行到 action payload 的转换。
|
|
6
6
|
* - 所有校验错误都尽量在输入层 fail-fast,避免进入执行层后才发现参数非法。
|
|
7
7
|
* - `chat send` 的 frontmatter / <file> 协议也在这里完成标准化解析。
|
|
8
8
|
*/
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
readHistoryDirectionOrThrow,
|
|
29
29
|
} from "./ChatActionInputSupport.js";
|
|
30
30
|
export {
|
|
31
|
-
mapChatSendApiInput,
|
|
32
31
|
mapChatSendCommandInput,
|
|
33
32
|
} from "./ChatSendActionInput.js";
|
|
34
33
|
|
|
@@ -42,32 +41,6 @@ export function mapChatChannelCommandInput(
|
|
|
42
41
|
};
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
export function mapChatChannelApiInput(
|
|
46
|
-
body: JsonValue,
|
|
47
|
-
): { channel?: ReturnType<typeof resolveChatChannelNameOrThrow> } {
|
|
48
|
-
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
49
|
-
return {};
|
|
50
|
-
}
|
|
51
|
-
const channelRaw =
|
|
52
|
-
typeof (body as JsonObject).channel === "string"
|
|
53
|
-
? String((body as JsonObject).channel).trim()
|
|
54
|
-
: "";
|
|
55
|
-
if (!channelRaw) return {};
|
|
56
|
-
return {
|
|
57
|
-
channel: resolveChatChannelNameOrThrow(channelRaw),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function mapChatChannelApiQueryInput(query?: {
|
|
62
|
-
channel?: string;
|
|
63
|
-
}): { channel?: ReturnType<typeof resolveChatChannelNameOrThrow> } {
|
|
64
|
-
const channelRaw = String(query?.channel || "").trim();
|
|
65
|
-
if (!channelRaw) return {};
|
|
66
|
-
return {
|
|
67
|
-
channel: resolveChatChannelNameOrThrow(channelRaw),
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
44
|
export function mapChatListCommandInput(
|
|
72
45
|
input: ServiceActionCommandInput,
|
|
73
46
|
): ChatListActionPayload {
|
|
@@ -83,23 +56,6 @@ export function mapChatListCommandInput(
|
|
|
83
56
|
};
|
|
84
57
|
}
|
|
85
58
|
|
|
86
|
-
export function mapChatListApiInput(query?: {
|
|
87
|
-
channel?: string;
|
|
88
|
-
limit?: string;
|
|
89
|
-
q?: string;
|
|
90
|
-
}): ChatListActionPayload {
|
|
91
|
-
const channelRaw = String(query?.channel || "").trim();
|
|
92
|
-
const limitRaw = String(query?.limit || "").trim();
|
|
93
|
-
const q = String(query?.q || "").trim();
|
|
94
|
-
const channel = channelRaw ? resolveChatChannelNameOrThrow(channelRaw) : undefined;
|
|
95
|
-
const limit = limitRaw ? parsePositiveIntOptionOrThrow(limitRaw, "limit") : undefined;
|
|
96
|
-
return {
|
|
97
|
-
...(channel ? { channel } : {}),
|
|
98
|
-
...(typeof limit === "number" ? { limit } : {}),
|
|
99
|
-
...(q ? { q } : {}),
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
59
|
export function mapChatInfoCommandInput(
|
|
104
60
|
input: ServiceActionCommandInput,
|
|
105
61
|
): ChatInfoActionPayload {
|
|
@@ -111,18 +67,6 @@ export function mapChatInfoCommandInput(
|
|
|
111
67
|
};
|
|
112
68
|
}
|
|
113
69
|
|
|
114
|
-
export function mapChatInfoApiInput(query?: {
|
|
115
|
-
chatKey?: string;
|
|
116
|
-
sessionId?: string;
|
|
117
|
-
}): ChatInfoActionPayload {
|
|
118
|
-
const chatKey = String(query?.chatKey || "").trim();
|
|
119
|
-
const sessionId = String(query?.sessionId || "").trim();
|
|
120
|
-
return {
|
|
121
|
-
...(chatKey ? { chatKey } : {}),
|
|
122
|
-
...(sessionId ? { sessionId } : {}),
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
70
|
export function mapChatConfigureCommandInput(
|
|
127
71
|
input: ServiceActionCommandInput,
|
|
128
72
|
): ChatConfigureActionPayload {
|
|
@@ -151,31 +95,6 @@ export function mapChatConfigureCommandInput(
|
|
|
151
95
|
};
|
|
152
96
|
}
|
|
153
97
|
|
|
154
|
-
export async function mapChatConfigureApiInput(c: {
|
|
155
|
-
req: {
|
|
156
|
-
json: () => Promise<JsonValue>;
|
|
157
|
-
};
|
|
158
|
-
}): Promise<ChatConfigureActionPayload> {
|
|
159
|
-
const body = await c.req.json().catch(() => ({} as JsonValue));
|
|
160
|
-
if (!isJsonObject(body)) {
|
|
161
|
-
throw new Error("Invalid JSON body");
|
|
162
|
-
}
|
|
163
|
-
const channelRaw = typeof body.channel === "string" ? String(body.channel).trim() : "";
|
|
164
|
-
if (!channelRaw) {
|
|
165
|
-
throw new Error("Missing channel");
|
|
166
|
-
}
|
|
167
|
-
const configRaw = body.config;
|
|
168
|
-
if (!isJsonObject(configRaw)) {
|
|
169
|
-
throw new Error("Missing config object");
|
|
170
|
-
}
|
|
171
|
-
const restart = typeof body.restart === "boolean" ? body.restart : undefined;
|
|
172
|
-
return {
|
|
173
|
-
channel: resolveChatChannelNameOrThrow(channelRaw),
|
|
174
|
-
config: configRaw as Record<string, JsonValue>,
|
|
175
|
-
...(typeof restart === "boolean" ? { restart } : {}),
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
98
|
export function mapChatHistoryCommandInput(
|
|
180
99
|
input: ServiceActionCommandInput,
|
|
181
100
|
): ChatHistoryActionPayload {
|
|
@@ -213,47 +132,6 @@ export function mapChatHistoryCommandInput(
|
|
|
213
132
|
};
|
|
214
133
|
}
|
|
215
134
|
|
|
216
|
-
export function mapChatHistoryApiInput(query: {
|
|
217
|
-
chatKey?: string;
|
|
218
|
-
sessionId?: string;
|
|
219
|
-
limit?: string;
|
|
220
|
-
direction?: string;
|
|
221
|
-
beforeTs?: string;
|
|
222
|
-
afterTs?: string;
|
|
223
|
-
}): ChatHistoryActionPayload {
|
|
224
|
-
const direction = readHistoryDirectionOrThrow(String(query.direction || ""));
|
|
225
|
-
const limitText = String(query.limit || "").trim();
|
|
226
|
-
const limit = limitText
|
|
227
|
-
? parsePositiveIntOptionOrThrow(limitText, "limit")
|
|
228
|
-
: undefined;
|
|
229
|
-
const beforeTs = parseOptionalTimestampOrThrow(
|
|
230
|
-
String(query.beforeTs || ""),
|
|
231
|
-
"beforeTs",
|
|
232
|
-
);
|
|
233
|
-
const afterTs = parseOptionalTimestampOrThrow(
|
|
234
|
-
String(query.afterTs || ""),
|
|
235
|
-
"afterTs",
|
|
236
|
-
);
|
|
237
|
-
if (
|
|
238
|
-
typeof beforeTs === "number" &&
|
|
239
|
-
typeof afterTs === "number" &&
|
|
240
|
-
afterTs >= beforeTs
|
|
241
|
-
) {
|
|
242
|
-
throw new Error("Invalid range: afterTs must be less than beforeTs.");
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const chatKey = String(query.chatKey || "").trim();
|
|
246
|
-
const sessionId = String(query.sessionId || "").trim();
|
|
247
|
-
return {
|
|
248
|
-
...(chatKey ? { chatKey } : {}),
|
|
249
|
-
...(sessionId ? { sessionId } : {}),
|
|
250
|
-
...(typeof limit === "number" ? { limit } : {}),
|
|
251
|
-
...(direction ? { direction } : {}),
|
|
252
|
-
...(typeof beforeTs === "number" ? { beforeTs } : {}),
|
|
253
|
-
...(typeof afterTs === "number" ? { afterTs } : {}),
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
|
|
257
135
|
export function mapChatReactCommandInput(
|
|
258
136
|
input: ServiceActionCommandInput,
|
|
259
137
|
): ChatReactActionPayload {
|
|
@@ -277,27 +155,6 @@ export function mapChatReactCommandInput(
|
|
|
277
155
|
};
|
|
278
156
|
}
|
|
279
157
|
|
|
280
|
-
export function mapChatReactApiInput(body: JsonValue): ChatReactActionPayload {
|
|
281
|
-
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
282
|
-
throw new Error("Invalid JSON body");
|
|
283
|
-
}
|
|
284
|
-
const payload = body as JsonObject;
|
|
285
|
-
const chatKey =
|
|
286
|
-
typeof payload.chatKey === "string" ? payload.chatKey.trim() : undefined;
|
|
287
|
-
const emoji = typeof payload.emoji === "string" ? payload.emoji.trim() : undefined;
|
|
288
|
-
const messageId =
|
|
289
|
-
typeof payload.messageId === "string" || typeof payload.messageId === "number"
|
|
290
|
-
? String(payload.messageId).trim()
|
|
291
|
-
: undefined;
|
|
292
|
-
const big = payload.big === true;
|
|
293
|
-
return {
|
|
294
|
-
...(chatKey ? { chatKey } : {}),
|
|
295
|
-
...(emoji ? { emoji } : {}),
|
|
296
|
-
...(messageId ? { messageId } : {}),
|
|
297
|
-
...(big ? { big: true } : {}),
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
|
|
301
158
|
export function mapChatDeleteCommandInput(
|
|
302
159
|
input: ServiceActionCommandInput,
|
|
303
160
|
): ChatDeleteActionPayload {
|
|
@@ -308,16 +165,3 @@ export function mapChatDeleteCommandInput(
|
|
|
308
165
|
...(sessionId ? { sessionId } : {}),
|
|
309
166
|
};
|
|
310
167
|
}
|
|
311
|
-
|
|
312
|
-
export function mapChatDeleteApiInput(body: JsonValue): ChatDeleteActionPayload {
|
|
313
|
-
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
314
|
-
return {};
|
|
315
|
-
}
|
|
316
|
-
const payload = body as JsonObject;
|
|
317
|
-
const chatKey = typeof payload.chatKey === "string" ? payload.chatKey.trim() : "";
|
|
318
|
-
const sessionId = typeof payload.sessionId === "string" ? payload.sessionId.trim() : "";
|
|
319
|
-
return {
|
|
320
|
-
...(chatKey ? { chatKey } : {}),
|
|
321
|
-
...(sessionId ? { sessionId } : {}),
|
|
322
|
-
};
|
|
323
|
-
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 对外只暴露 action 级入口,供 ChatServiceActions 装配使用。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
11
|
import type { ChatChannelState } from "@/service/builtins/chat/types/ChatRuntime.js";
|
|
12
12
|
import type {
|
|
13
13
|
ChatCloseActionPayload,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import fs from "node:fs/promises";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import type { JsonObject, JsonValue } from "@/types/common/Json.js";
|
|
13
|
-
import type { AgentContext } from "@/
|
|
13
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
14
14
|
import type { StoredChannelAccount } from "@/types/host/Store.js";
|
|
15
15
|
import type {
|
|
16
16
|
ChatChannelName,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 目标是让 chat channel 子模块共享同一套最小公共基元。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
11
|
import type { StoredChannelAccount } from "@/types/host/Store.js";
|
|
12
12
|
import type { ChatChannelName } from "@/service/builtins/chat/types/ChannelStatus.js";
|
|
13
13
|
import type { ChatChannelState } from "@/service/builtins/chat/types/ChatRuntime.js";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 本模块不处理 downcity.json 写入,也不负责 action 输入输出包装。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
11
|
import type { ChatChannelState } from "@/service/builtins/chat/types/ChatRuntime.js";
|
|
12
12
|
import type { ChatChannelName } from "@/service/builtins/chat/types/ChannelStatus.js";
|
|
13
13
|
import { createTelegramBot } from "@/service/builtins/chat/channels/telegram/Bot.js";
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import fs from "fs-extra";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { generateId } from "@/utils/Id.js";
|
|
13
|
-
import type { AgentContext } from "@/
|
|
13
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
14
14
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
15
15
|
import type { ChatDispatchChannel } from "@/service/builtins/chat/types/ChatDispatcher.js";
|
|
16
16
|
import type {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 后续 extension / control UI / 其他外部入口都应复用这里
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
11
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
12
12
|
import type { ChatDispatchChannel } from "@/service/builtins/chat/types/ChatDispatcher.js";
|
|
13
13
|
import { appendInboundChatHistory } from "./ChatHistoryStore.js";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 底层数据落在 `.downcity/channel/meta.json`,由 ChannelContextStore 统一维护
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
11
|
import type { ChatMetaV1 } from "@/service/builtins/chat/types/ChatMeta.js";
|
|
12
12
|
import type { ChatDispatchChannel } from "@/service/builtins/chat/types/ChatDispatcher.js";
|
|
13
13
|
import {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { Logger } from "@/utils/logger/Logger.js";
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
11
|
import { parseDirectDispatchAssistantText } from "./DirectDispatchParser.js";
|
|
12
12
|
import { sendActionByChatKey } from "./ChatkeySend.js";
|
|
13
13
|
import { sendChatTextByChatKey } from "../Action.js";
|
|
@@ -11,7 +11,7 @@ import { drainDeferredPersistedUserMessages } from "@session/SessionRunScope.js"
|
|
|
11
11
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
12
12
|
import type { SessionRunResult } from "@/session/types/SessionRun.js";
|
|
13
13
|
import type { SessionUserMessageV1 } from "@/session/types/SessionMessages.js";
|
|
14
|
-
import type { SessionPort } from "@/
|
|
14
|
+
import type { SessionPort } from "@/core/AgentContextTypes.js";
|
|
15
15
|
import type { ChatQueueItem } from "@/service/builtins/chat/types/ChatQueue.js";
|
|
16
16
|
import { resolveAssistantMessageForPersistence } from "./UserVisibleText.js";
|
|
17
17
|
|
|
@@ -12,7 +12,7 @@ import type { SessionRunResult } from "@/session/types/SessionRun.js";
|
|
|
12
12
|
import type {
|
|
13
13
|
SessionUserMessageV1,
|
|
14
14
|
} from "@/session/types/SessionMessages.js";
|
|
15
|
-
import type { AgentContext } from "@/
|
|
15
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
16
16
|
import type { ChatQueueWorkerConfig } from "@/service/builtins/chat/types/ChatQueueWorker.js";
|
|
17
17
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
18
18
|
import type { ChatQueueItem } from "@/service/builtins/chat/types/ChatQueue.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ChatServiceActions:chat service 的 action 注册表模块。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - 这里专门负责把 chat 的 CLI/
|
|
5
|
+
* - 这里专门负责把 chat 的 CLI/execute 定义装配成 `ServiceActions`。
|
|
6
6
|
* - ChatService 本体只保留实例状态与 lifecycle,不再承载大段 action 声明。
|
|
7
7
|
* - action 执行仍然复用各 runtime 模块,确保行为与现有实现保持一致。
|
|
8
8
|
*/
|
|
@@ -25,25 +25,15 @@ import type {
|
|
|
25
25
|
ChatStatusActionPayload,
|
|
26
26
|
ChatTestActionPayload,
|
|
27
27
|
} from "@/service/builtins/chat/types/ChatService.js";
|
|
28
|
-
import type { JsonValue } from "@/types/common/Json.js";
|
|
29
28
|
import type { ChatChannelState } from "@/service/builtins/chat/types/ChatRuntime.js";
|
|
30
29
|
import {
|
|
31
|
-
mapChatChannelApiInput,
|
|
32
|
-
mapChatChannelApiQueryInput,
|
|
33
30
|
mapChatChannelCommandInput,
|
|
34
|
-
mapChatConfigureApiInput,
|
|
35
31
|
mapChatConfigureCommandInput,
|
|
36
|
-
mapChatDeleteApiInput,
|
|
37
32
|
mapChatDeleteCommandInput,
|
|
38
|
-
mapChatHistoryApiInput,
|
|
39
33
|
mapChatHistoryCommandInput,
|
|
40
|
-
mapChatInfoApiInput,
|
|
41
34
|
mapChatInfoCommandInput,
|
|
42
|
-
mapChatListApiInput,
|
|
43
35
|
mapChatListCommandInput,
|
|
44
|
-
mapChatReactApiInput,
|
|
45
36
|
mapChatReactCommandInput,
|
|
46
|
-
mapChatSendApiInput,
|
|
47
37
|
mapChatSendCommandInput,
|
|
48
38
|
} from "./ChatActionInput.js";
|
|
49
39
|
import {
|
|
@@ -119,14 +109,6 @@ export function createChatServiceActions(params: {
|
|
|
119
109
|
},
|
|
120
110
|
mapInput: mapChatChannelCommandInput,
|
|
121
111
|
},
|
|
122
|
-
api: {
|
|
123
|
-
method: "GET",
|
|
124
|
-
mapInput(c) {
|
|
125
|
-
return mapChatChannelApiQueryInput({
|
|
126
|
-
channel: c.req.query("channel"),
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
112
|
execute: async (actionParams) => {
|
|
131
113
|
return executeChatStatusAction({
|
|
132
114
|
state: params.channelState,
|
|
@@ -143,12 +125,6 @@ export function createChatServiceActions(params: {
|
|
|
143
125
|
},
|
|
144
126
|
mapInput: mapChatChannelCommandInput,
|
|
145
127
|
},
|
|
146
|
-
api: {
|
|
147
|
-
method: "POST",
|
|
148
|
-
async mapInput(c) {
|
|
149
|
-
return mapChatChannelApiInput(await c.req.json().catch(() => ({})));
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
128
|
execute: async (actionParams) => {
|
|
153
129
|
return executeChatTestAction({
|
|
154
130
|
state: params.channelState,
|
|
@@ -165,12 +141,6 @@ export function createChatServiceActions(params: {
|
|
|
165
141
|
},
|
|
166
142
|
mapInput: mapChatChannelCommandInput,
|
|
167
143
|
},
|
|
168
|
-
api: {
|
|
169
|
-
method: "POST",
|
|
170
|
-
async mapInput(c) {
|
|
171
|
-
return mapChatChannelApiInput(await c.req.json().catch(() => ({})));
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
144
|
execute: async (actionParams) => {
|
|
175
145
|
return executeChatReconnectAction({
|
|
176
146
|
state: params.channelState,
|
|
@@ -187,12 +157,6 @@ export function createChatServiceActions(params: {
|
|
|
187
157
|
},
|
|
188
158
|
mapInput: mapChatChannelCommandInput,
|
|
189
159
|
},
|
|
190
|
-
api: {
|
|
191
|
-
method: "POST",
|
|
192
|
-
async mapInput(c) {
|
|
193
|
-
return mapChatChannelApiInput(await c.req.json().catch(() => ({})));
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
160
|
execute: async (actionParams) => {
|
|
197
161
|
return executeChatOpenAction({
|
|
198
162
|
state: params.channelState,
|
|
@@ -209,12 +173,6 @@ export function createChatServiceActions(params: {
|
|
|
209
173
|
},
|
|
210
174
|
mapInput: mapChatChannelCommandInput,
|
|
211
175
|
},
|
|
212
|
-
api: {
|
|
213
|
-
method: "POST",
|
|
214
|
-
async mapInput(c) {
|
|
215
|
-
return mapChatChannelApiInput(await c.req.json().catch(() => ({})));
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
176
|
execute: async (actionParams) => {
|
|
219
177
|
return executeChatCloseAction({
|
|
220
178
|
state: params.channelState,
|
|
@@ -231,14 +189,6 @@ export function createChatServiceActions(params: {
|
|
|
231
189
|
},
|
|
232
190
|
mapInput: mapChatChannelCommandInput,
|
|
233
191
|
},
|
|
234
|
-
api: {
|
|
235
|
-
method: "GET",
|
|
236
|
-
mapInput(c) {
|
|
237
|
-
return mapChatChannelApiQueryInput({
|
|
238
|
-
channel: c.req.query("channel"),
|
|
239
|
-
});
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
192
|
execute: async (actionParams) => {
|
|
243
193
|
return executeChatConfigurationAction({
|
|
244
194
|
context: actionParams.context,
|
|
@@ -260,12 +210,6 @@ export function createChatServiceActions(params: {
|
|
|
260
210
|
},
|
|
261
211
|
mapInput: mapChatConfigureCommandInput,
|
|
262
212
|
},
|
|
263
|
-
api: {
|
|
264
|
-
method: "POST",
|
|
265
|
-
async mapInput(c) {
|
|
266
|
-
return mapChatConfigureApiInput(c);
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
213
|
execute: async (actionParams) => {
|
|
270
214
|
return executeChatConfigureAction({
|
|
271
215
|
state: params.channelState,
|
|
@@ -285,16 +229,6 @@ export function createChatServiceActions(params: {
|
|
|
285
229
|
},
|
|
286
230
|
mapInput: mapChatListCommandInput,
|
|
287
231
|
},
|
|
288
|
-
api: {
|
|
289
|
-
method: "GET",
|
|
290
|
-
mapInput(c) {
|
|
291
|
-
return mapChatListApiInput({
|
|
292
|
-
channel: c.req.query("channel"),
|
|
293
|
-
limit: c.req.query("limit"),
|
|
294
|
-
q: c.req.query("q"),
|
|
295
|
-
});
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
232
|
execute: async (actionParams) => {
|
|
299
233
|
return executeChatListAction({
|
|
300
234
|
context: actionParams.context,
|
|
@@ -312,15 +246,6 @@ export function createChatServiceActions(params: {
|
|
|
312
246
|
},
|
|
313
247
|
mapInput: mapChatInfoCommandInput,
|
|
314
248
|
},
|
|
315
|
-
api: {
|
|
316
|
-
method: "GET",
|
|
317
|
-
mapInput(c) {
|
|
318
|
-
return mapChatInfoApiInput({
|
|
319
|
-
chatKey: c.req.query("chatKey"),
|
|
320
|
-
sessionId: c.req.query("sessionId"),
|
|
321
|
-
});
|
|
322
|
-
},
|
|
323
|
-
},
|
|
324
249
|
execute: async (actionParams) => {
|
|
325
250
|
return executeChatInfoAction({
|
|
326
251
|
context: actionParams.context,
|
|
@@ -346,12 +271,6 @@ export function createChatServiceActions(params: {
|
|
|
346
271
|
},
|
|
347
272
|
mapInput: mapChatSendCommandInput,
|
|
348
273
|
},
|
|
349
|
-
api: {
|
|
350
|
-
method: "POST",
|
|
351
|
-
async mapInput(c) {
|
|
352
|
-
return mapChatSendApiInput(await c.req.json());
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
274
|
execute: async (actionParams) => {
|
|
356
275
|
return executeChatSendAction({
|
|
357
276
|
context: actionParams.context,
|
|
@@ -375,12 +294,6 @@ export function createChatServiceActions(params: {
|
|
|
375
294
|
},
|
|
376
295
|
mapInput: mapChatReactCommandInput,
|
|
377
296
|
},
|
|
378
|
-
api: {
|
|
379
|
-
method: "POST",
|
|
380
|
-
async mapInput(c) {
|
|
381
|
-
return mapChatReactApiInput(await c.req.json());
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
297
|
execute: async (actionParams) => {
|
|
385
298
|
return executeChatReactAction({
|
|
386
299
|
context: actionParams.context,
|
|
@@ -402,17 +315,6 @@ export function createChatServiceActions(params: {
|
|
|
402
315
|
};
|
|
403
316
|
},
|
|
404
317
|
},
|
|
405
|
-
api: {
|
|
406
|
-
method: "GET",
|
|
407
|
-
mapInput(c) {
|
|
408
|
-
const chatKey = String(c.req.query("chatKey") || "").trim();
|
|
409
|
-
const sessionId = String(c.req.query("sessionId") || "").trim();
|
|
410
|
-
return {
|
|
411
|
-
...(chatKey ? { chatKey } : {}),
|
|
412
|
-
...(sessionId ? { sessionId } : {}),
|
|
413
|
-
};
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
318
|
execute: async (actionParams) => {
|
|
417
319
|
return executeChatContextAction({
|
|
418
320
|
context: actionParams.context,
|
|
@@ -430,12 +332,6 @@ export function createChatServiceActions(params: {
|
|
|
430
332
|
},
|
|
431
333
|
mapInput: mapChatDeleteCommandInput,
|
|
432
334
|
},
|
|
433
|
-
api: {
|
|
434
|
-
method: "POST",
|
|
435
|
-
async mapInput(c) {
|
|
436
|
-
return mapChatDeleteApiInput(await c.req.json().catch(() => ({} as JsonValue)));
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
335
|
execute: async (actionParams) => {
|
|
440
336
|
return executeChatDeleteAction({
|
|
441
337
|
context: actionParams.context,
|
|
@@ -460,19 +356,6 @@ export function createChatServiceActions(params: {
|
|
|
460
356
|
},
|
|
461
357
|
mapInput: mapChatHistoryCommandInput,
|
|
462
358
|
},
|
|
463
|
-
api: {
|
|
464
|
-
method: "GET",
|
|
465
|
-
mapInput(c) {
|
|
466
|
-
return mapChatHistoryApiInput({
|
|
467
|
-
chatKey: c.req.query("chatKey"),
|
|
468
|
-
sessionId: c.req.query("sessionId"),
|
|
469
|
-
limit: c.req.query("limit"),
|
|
470
|
-
direction: c.req.query("direction"),
|
|
471
|
-
beforeTs: c.req.query("beforeTs"),
|
|
472
|
-
afterTs: c.req.query("afterTs"),
|
|
473
|
-
});
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
359
|
execute: async (actionParams) => {
|
|
477
360
|
return executeChatHistoryAction({
|
|
478
361
|
context: actionParams.context,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 当前请求只注入当前 channel 的 prompt,避免平台规则串味。
|
|
7
7
|
* - 该模块只负责 prompt 解析与拼装,不承担运行态控制职责。
|
|
8
8
|
*/
|
|
9
|
-
import type { AgentContext } from "@/
|
|
9
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
10
10
|
import {
|
|
11
11
|
buildCurrentChatEnvironmentPrompt,
|
|
12
12
|
resolveCurrentChatEnvironmentPromptInput,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import fs from "fs-extra";
|
|
12
12
|
import path from "node:path";
|
|
13
|
-
import type { AgentContext } from "@/
|
|
13
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
14
14
|
import { resolveChatQueueStore } from "@/service/builtins/chat/runtime/ChatQueue.js";
|
|
15
15
|
import { removeChatMetaBySessionId } from "@/service/builtins/chat/runtime/ChatMetaStore.js";
|
|
16
16
|
|
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
ChatDispatchAction,
|
|
15
15
|
ChatDispatchChannel,
|
|
16
16
|
} from "@/service/builtins/chat/types/ChatDispatcher.js";
|
|
17
|
-
import type { AgentContext } from "@/
|
|
17
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
18
18
|
import { readChatMetaBySessionId } from "./ChatMetaStore.js";
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 最终拼装顺序固定为:attachmentText -> pluginSections -> bodyText。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { AgentContext } from "@/
|
|
9
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
10
10
|
import type { ChatInboundAugmentInput } from "@/service/builtins/chat/types/ChatPlugin.js";
|
|
11
11
|
import type { JsonValue } from "@/types/common/Json.js";
|
|
12
12
|
import { CHAT_PLUGIN_POINTS } from "@/service/builtins/chat/runtime/PluginPoints.js";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 这里封装 chat 领域的 plugin 点调用语义,保持 service 边界稳定。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { AgentContext } from "@/
|
|
9
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
10
10
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
11
11
|
import type {
|
|
12
12
|
AuthObservePrincipalPayload,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 仅服务 agent 执行生命周期,不覆盖手动 `chat send`。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { AgentContext } from "@/
|
|
9
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
10
10
|
import type { ChatReplyDispatchInput, ChatReplyEffectInput } from "@/service/builtins/chat/types/ChatPlugin.js";
|
|
11
11
|
import type { JsonValue } from "@/types/common/Json.js";
|
|
12
12
|
import type { ChatDispatchChannel } from "@/service/builtins/chat/types/ChatDispatcher.js";
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { getSessionRunScope } from "@session/SessionRunScope.js";
|
|
11
|
-
import type { AgentContext } from "@/
|
|
11
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
12
12
|
import type { ChatEnvironmentPromptInput } from "@/service/builtins/chat/types/ChatPromptContext.js";
|
|
13
13
|
import { readChatMetaBySessionId } from "@/service/builtins/chat/runtime/ChatMetaStore.js";
|
|
14
14
|
|