@downcity/agent 1.1.12 → 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} +10 -10
- 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 +8 -10
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +4 -7
- 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 +27 -25
- 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 +8 -8
- package/bin/sdk/Session.d.ts.map +1 -1
- package/bin/sdk/Session.js +48 -54
- package/bin/sdk/Session.js.map +1 -1
- package/bin/sdk/SessionMetadata.d.ts +3 -3
- package/bin/sdk/SessionMetadata.d.ts.map +1 -1
- package/bin/sdk/SessionMetadata.js +5 -5
- package/bin/sdk/SessionMetadata.js.map +1 -1
- package/bin/sdk/SessionPersistence.d.ts +6 -6
- package/bin/sdk/SessionPersistence.d.ts.map +1 -1
- package/bin/sdk/SessionPersistence.js +7 -7
- package/bin/sdk/SessionPersistence.js.map +1 -1
- package/bin/sdk/SessionServicePort.d.ts +6 -6
- package/bin/sdk/SessionServicePort.d.ts.map +1 -1
- package/bin/sdk/SessionServicePort.js +9 -9
- package/bin/sdk/SessionServicePort.js.map +1 -1
- package/bin/sdk/{SdkSessionSystemComposer.d.ts → SessionSystemBuilder.d.ts} +7 -7
- package/bin/sdk/SessionSystemBuilder.d.ts.map +1 -0
- package/bin/sdk/{SdkSessionSystemComposer.js → SessionSystemBuilder.js} +14 -14
- package/bin/sdk/SessionSystemBuilder.js.map +1 -0
- 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/ChatSession.d.ts +27 -8
- package/bin/service/builtins/chat/runtime/ChatSession.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatSession.js +9 -4
- package/bin/service/builtins/chat/runtime/ChatSession.js.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 +2 -2
- package/bin/service/builtins/task/runtime/Runner.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/Runner.js +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 +3 -3
- package/bin/service/builtins/task/runtime/TaskRunnerSession.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerSession.js +4 -4
- package/bin/service/builtins/task/runtime/TaskRunnerSession.js.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerTypes.d.ts +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/{Session.d.ts → Executor.d.ts} +54 -17
- package/bin/session/Executor.d.ts.map +1 -0
- package/bin/session/{Session.js → Executor.js} +60 -23
- package/bin/session/Executor.js.map +1 -0
- package/bin/session/composer/SessionComposer.d.ts +1 -1
- package/bin/session/composer/SessionComposer.js +1 -1
- package/bin/session/composer/compaction/SessionCompactionComposer.d.ts +2 -2
- package/bin/session/composer/execution/LocalSessionExecutionComposer.d.ts +1 -1
- package/bin/session/composer/execution/LocalSessionExecutionComposer.js +1 -1
- package/bin/session/composer/execution/SessionExecutionComposer.d.ts +1 -1
- package/bin/session/composer/history/SessionHistoryComposer.d.ts +1 -1
- package/bin/session/composer/system/SessionSystemComposer.d.ts +1 -1
- package/bin/session/composer/system/SessionSystemComposer.js +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/executors/local/{LocalSessionCore.d.ts → Runner.d.ts} +10 -10
- package/bin/session/executors/local/Runner.d.ts.map +1 -0
- package/bin/session/executors/local/{LocalSessionCore.js → Runner.js} +11 -11
- package/bin/session/executors/local/Runner.js.map +1 -0
- package/bin/session/executors/local/SessionExecutionError.d.ts +1 -1
- package/bin/session/executors/local/SessionExecutionError.js +1 -1
- package/bin/session/executors/local/SessionLoopDecision.d.ts +3 -3
- package/bin/session/executors/local/SessionLoopDecision.js +3 -3
- package/bin/session/executors/local/SessionModelMessageState.d.ts +2 -2
- package/bin/session/executors/local/SessionModelMessageState.js +2 -2
- package/bin/session/executors/local/SessionSignals.d.ts +3 -3
- package/bin/session/executors/local/SessionSignals.js +3 -3
- package/bin/session/executors/local/SessionToolLoopRunner.d.ts +1 -1
- package/bin/session/executors/local/SessionToolLoopRunner.js +2 -2
- package/bin/session/executors/local/SessionToolLoopRunner.js.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/bin/session/types/SessionLoop.d.ts +1 -1
- package/bin/session/types/SessionLoop.js +1 -1
- package/bin/session/types/SessionRun.d.ts +2 -2
- package/bin/session/types/SessionRun.js +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} +9 -9
- package/src/host/runtime/PluginRuntime.ts +1 -1
- package/src/index.ts +26 -23
- 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 +101 -395
- 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 +64 -68
- package/src/sdk/SessionMetadata.ts +5 -5
- package/src/sdk/SessionPersistence.ts +13 -13
- package/src/sdk/SessionServicePort.ts +14 -14
- package/src/sdk/{SdkSessionSystemComposer.ts → SessionSystemBuilder.ts} +24 -24
- 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/ChatSession.ts +37 -13
- 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 +2 -2
- 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 +5 -5
- package/src/service/builtins/task/runtime/TaskRunnerTypes.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/{Session.ts → Executor.ts} +96 -26
- package/src/session/composer/SessionComposer.ts +1 -1
- package/src/session/composer/compaction/SessionCompactionComposer.ts +2 -2
- package/src/session/composer/execution/LocalSessionExecutionComposer.ts +1 -1
- package/src/session/composer/execution/SessionExecutionComposer.ts +1 -1
- package/src/session/composer/history/SessionHistoryComposer.ts +1 -1
- package/src/session/composer/system/SessionSystemComposer.ts +1 -1
- package/src/session/composer/system/default/DefaultSessionSystemComposer.ts +1 -1
- package/src/session/composer/system/default/SystemDomain.ts +1 -1
- package/src/session/executors/local/{LocalSessionCore.ts → Runner.ts} +13 -13
- package/src/session/executors/local/SessionExecutionError.ts +1 -1
- package/src/session/executors/local/SessionLoopDecision.ts +3 -3
- package/src/session/executors/local/SessionModelMessageState.ts +2 -2
- package/src/session/executors/local/SessionSignals.ts +3 -3
- package/src/session/executors/local/SessionToolLoopRunner.ts +2 -2
- package/src/session/tools/shell/ShellToolBridge.ts +1 -1
- package/src/session/types/SessionLoop.ts +1 -1
- package/src/session/types/SessionRun.ts +2 -2
- 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 -296
- 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/sdk/SdkSessionSystemComposer.d.ts.map +0 -1
- package/bin/sdk/SdkSessionSystemComposer.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/bin/session/Session.d.ts.map +0 -1
- package/bin/session/Session.js.map +0 -1
- package/bin/session/executors/local/LocalSessionCore.d.ts.map +0 -1
- package/bin/session/executors/local/LocalSessionCore.js.map +0 -1
- package/bin/session/executors/local/LocalSessionExecutor.d.ts +0 -61
- package/bin/session/executors/local/LocalSessionExecutor.d.ts.map +0 -1
- package/bin/session/executors/local/LocalSessionExecutor.js +0 -36
- package/bin/session/executors/local/LocalSessionExecutor.js.map +0 -1
- package/src/runtime/AgentContext.ts +0 -182
- package/src/runtime/AgentRuntime.ts +0 -376
- package/src/runtime/AgentRuntimeState.ts +0 -213
- package/src/service/core/ServiceActionApi.ts +0 -304
- package/src/service/schedule/Runtime.ts +0 -78
- package/src/session/executors/local/LocalSessionExecutor.ts +0 -89
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* - Manager.ts 只作为门面导出,真正逻辑在这里分层实现。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
|
+
import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
|
|
11
12
|
import type {
|
|
12
13
|
ServiceStateControlAction,
|
|
13
14
|
ServiceStateControlResult,
|
|
14
15
|
ServiceStateRecord,
|
|
15
16
|
ServiceStateSnapshot,
|
|
16
17
|
} from "@/service/types/ServiceState.js";
|
|
17
|
-
import { getAgentRuntime } from "@/runtime/AgentRuntimeState.js";
|
|
18
18
|
import {
|
|
19
19
|
getRegisteredStaticServiceInstances,
|
|
20
20
|
listRegisteredServices,
|
|
@@ -31,17 +31,27 @@ function nowMs(): number {
|
|
|
31
31
|
* 列出当前进程内可见的 service 实例。
|
|
32
32
|
*
|
|
33
33
|
* 关键点(中文)
|
|
34
|
-
* -
|
|
35
|
-
* -
|
|
34
|
+
* - 优先读取显式传入的实例级 context/runtime。
|
|
35
|
+
* - 若调用方未传入实例上下文,则只退回静态装配实例,方便测试与只读场景。
|
|
36
36
|
*/
|
|
37
|
-
export function listServiceInstances(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
export function listServiceInstances(input?: {
|
|
38
|
+
context?: AgentContext;
|
|
39
|
+
runtime?: AgentRuntime;
|
|
40
|
+
}): BaseService[] {
|
|
41
|
+
return listServiceInstancesFor(input);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function listServiceInstancesFor(input?: {
|
|
45
|
+
context?: AgentContext;
|
|
46
|
+
runtime?: AgentRuntime;
|
|
47
|
+
}): BaseService[] {
|
|
48
|
+
const contextServices = input?.context?.agent?.services;
|
|
49
|
+
if (contextServices instanceof Map && contextServices.size > 0) {
|
|
50
|
+
return [...contextServices.values()];
|
|
51
|
+
}
|
|
52
|
+
const runtimeServices = input?.runtime?.services;
|
|
53
|
+
if (runtimeServices instanceof Map && runtimeServices.size > 0) {
|
|
54
|
+
return [...runtimeServices.values()];
|
|
45
55
|
}
|
|
46
56
|
return [...getRegisteredStaticServiceInstances().values()];
|
|
47
57
|
}
|
|
@@ -51,10 +61,14 @@ export function listServiceInstances(): BaseService[] {
|
|
|
51
61
|
*/
|
|
52
62
|
export function resolveServiceByName(
|
|
53
63
|
name: string,
|
|
64
|
+
input?: {
|
|
65
|
+
context?: AgentContext;
|
|
66
|
+
runtime?: AgentRuntime;
|
|
67
|
+
},
|
|
54
68
|
): BaseService | null {
|
|
55
69
|
const key = String(name || "").trim();
|
|
56
70
|
if (!key) return null;
|
|
57
|
-
return
|
|
71
|
+
return listServiceInstancesFor(input).find((service) => service.name === key) || null;
|
|
58
72
|
}
|
|
59
73
|
|
|
60
74
|
/**
|
|
@@ -153,8 +167,11 @@ export function getServiceRootCommandNames(): string[] {
|
|
|
153
167
|
/**
|
|
154
168
|
* 列出全部 service 状态快照。
|
|
155
169
|
*/
|
|
156
|
-
export function listServiceStates(
|
|
157
|
-
|
|
170
|
+
export function listServiceStates(input?: {
|
|
171
|
+
context?: AgentContext;
|
|
172
|
+
runtime?: AgentRuntime;
|
|
173
|
+
}): ServiceStateSnapshot[] {
|
|
174
|
+
return listServiceInstancesFor(input)
|
|
158
175
|
.map((service) =>
|
|
159
176
|
toServiceStateSnapshot(ensureServiceStateRecord(service), service),
|
|
160
177
|
)
|
|
@@ -164,8 +181,14 @@ export function listServiceStates(): ServiceStateSnapshot[] {
|
|
|
164
181
|
/**
|
|
165
182
|
* 判断指定 service 是否处于运行中。
|
|
166
183
|
*/
|
|
167
|
-
export function isServiceRunning(
|
|
168
|
-
|
|
184
|
+
export function isServiceRunning(
|
|
185
|
+
serviceName: string,
|
|
186
|
+
input?: {
|
|
187
|
+
context?: AgentContext;
|
|
188
|
+
runtime?: AgentRuntime;
|
|
189
|
+
},
|
|
190
|
+
): boolean {
|
|
191
|
+
const service = resolveServiceByName(serviceName, input);
|
|
169
192
|
if (!service) return false;
|
|
170
193
|
return ensureServiceStateRecord(service).state === "running";
|
|
171
194
|
}
|
|
@@ -238,7 +261,9 @@ export async function controlServiceState(params: {
|
|
|
238
261
|
action: ServiceStateControlAction;
|
|
239
262
|
context: AgentContext;
|
|
240
263
|
}): Promise<ServiceStateControlResult> {
|
|
241
|
-
const service = resolveServiceByName(params.serviceName
|
|
264
|
+
const service = resolveServiceByName(params.serviceName, {
|
|
265
|
+
context: params.context,
|
|
266
|
+
});
|
|
242
267
|
if (!service) {
|
|
243
268
|
return {
|
|
244
269
|
success: false,
|
|
@@ -277,7 +302,7 @@ export async function startAllServices(
|
|
|
277
302
|
results: ServiceStateControlResult[];
|
|
278
303
|
}> {
|
|
279
304
|
const results: ServiceStateControlResult[] = [];
|
|
280
|
-
for (const service of
|
|
305
|
+
for (const service of listServiceInstancesFor({ context })) {
|
|
281
306
|
results.push(
|
|
282
307
|
await controlServiceState({
|
|
283
308
|
serviceName: service.name,
|
|
@@ -300,7 +325,7 @@ export async function stopAllServices(context: AgentContext): Promise<{
|
|
|
300
325
|
results: ServiceStateControlResult[];
|
|
301
326
|
}> {
|
|
302
327
|
const results: ServiceStateControlResult[] = [];
|
|
303
|
-
for (const service of
|
|
328
|
+
for (const service of listServiceInstancesFor({ context })) {
|
|
304
329
|
results.push(
|
|
305
330
|
await controlServiceState({
|
|
306
331
|
serviceName: service.name,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 这样也能避开 `task -> runner -> prompt system -> service class registry` 的循环依赖。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AgentContext } from "@/
|
|
10
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
11
11
|
import { buildChatServiceSystem } from "@/service/builtins/chat/runtime/ChatServiceSystem.js";
|
|
12
12
|
import { buildContactServiceSystemText } from "@/service/builtins/contact/runtime/SystemProvider.js";
|
|
13
13
|
import { buildMemoryServiceSystemText } from "@/service/builtins/memory/runtime/SystemProvider.js";
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* - 这里只声明“有哪些 service class”,不承载运行态逻辑。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { AgentRuntime } from "@/
|
|
9
|
+
import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
|
|
10
10
|
import type { BaseService } from "@/service/builtins/BaseService.js";
|
|
11
11
|
import { ChatService } from "@/service/builtins/chat/ChatService.js";
|
|
12
12
|
import { TaskService } from "@/service/builtins/task/TaskService.js";
|
|
13
13
|
import { MemoryService } from "@/service/builtins/memory/MemoryService.js";
|
|
14
14
|
import { ShellService } from "@/service/builtins/shell/ShellService.js";
|
|
15
15
|
import { ContactService } from "@/service/builtins/contact/ContactService.js";
|
|
16
|
+
import { ScheduleService } from "@/service/builtins/schedule/ScheduleService.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* 单个 service class 构造器。
|
|
@@ -27,6 +28,7 @@ export type ServiceClass<T extends BaseService = BaseService> = new (
|
|
|
27
28
|
export const SERVICE_CLASSES: ServiceClass[] = [
|
|
28
29
|
ChatService,
|
|
29
30
|
ContactService,
|
|
31
|
+
ScheduleService,
|
|
30
32
|
TaskService,
|
|
31
33
|
MemoryService,
|
|
32
34
|
ShellService,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 不负责调度入口和轮询生命周期管理。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { AgentContext } from "@/
|
|
9
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
10
10
|
import type { ServiceScheduleStore } from "./Store.js";
|
|
11
11
|
import { runServiceCommand } from "@/service/core/Manager.js";
|
|
12
12
|
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { Command } from "commander";
|
|
11
|
-
import type {
|
|
12
|
-
import type { AgentContext } from "@/runtime/AgentContextTypes.js";
|
|
11
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
13
12
|
import type { JsonValue } from "@/types/common/Json.js";
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -94,24 +93,6 @@ export type ServiceActionCommand<P extends JsonValue = JsonValue> = {
|
|
|
94
93
|
mapInput: (input: ServiceActionCommandInput) => P | Promise<P>;
|
|
95
94
|
};
|
|
96
95
|
|
|
97
|
-
/**
|
|
98
|
-
* Action HTTP 定义。
|
|
99
|
-
*/
|
|
100
|
-
export type ServiceActionApi<P extends JsonValue = JsonValue> = {
|
|
101
|
-
/**
|
|
102
|
-
* HTTP 方法。
|
|
103
|
-
*/
|
|
104
|
-
method?: "GET" | "POST" | "PUT" | "DELETE";
|
|
105
|
-
/**
|
|
106
|
-
* 自定义路由路径;省略时走默认 `/service/<service>/<action>`。
|
|
107
|
-
*/
|
|
108
|
-
path?: string;
|
|
109
|
-
/**
|
|
110
|
-
* 把 HTTP 请求映射为结构化 payload。
|
|
111
|
-
*/
|
|
112
|
-
mapInput?: (ctx: HonoContext) => P | Promise<P>;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
96
|
/**
|
|
116
97
|
* 单个 service action 定义。
|
|
117
98
|
*/
|
|
@@ -123,10 +104,6 @@ export type ServiceAction<
|
|
|
123
104
|
* CLI 定义;省略则该 action 不暴露为 CLI 子命令。
|
|
124
105
|
*/
|
|
125
106
|
command?: ServiceActionCommand<P>;
|
|
126
|
-
/**
|
|
127
|
-
* HTTP API 定义;省略则该 action 不注册 HTTP 路由。
|
|
128
|
-
*/
|
|
129
|
-
api?: ServiceActionApi<P>;
|
|
130
107
|
/**
|
|
131
108
|
* action 的实际执行函数。
|
|
132
109
|
*/
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Executor:单个 session 的执行编排器。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
5
|
+
* - SDK 对外对象叫 `Session`,这里是内部执行层。
|
|
6
|
+
* - 一个 Executor 只对应一个固定的 `sessionId`。
|
|
7
|
+
* - 负责 history 写入、run scope、executing 状态与本地 Runner 的懒创建。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import type { LanguageModel, Tool } from "ai";
|
|
10
11
|
import { SessionHistoryWriter } from "@session/composer/history/SessionHistoryWriter.js";
|
|
11
12
|
import type { SessionHistoryComposer } from "@session/composer/history/SessionHistoryComposer.js";
|
|
12
13
|
import { withSessionRunScope } from "@session/SessionRunScope.js";
|
|
13
14
|
import type { SessionRunScope } from "@session/SessionRunScope.js";
|
|
14
15
|
import { buildSessionStepEventMessages } from "@session/messages/SessionStepEventMapper.js";
|
|
16
|
+
import { JsonlSessionCompactionComposer } from "@session/composer/compaction/jsonl/JsonlSessionCompactionComposer.js";
|
|
17
|
+
import { LocalSessionExecutionComposer } from "@session/composer/execution/LocalSessionExecutionComposer.js";
|
|
18
|
+
import type { SessionCompactionComposer } from "@session/composer/compaction/SessionCompactionComposer.js";
|
|
19
|
+
import type { SessionExecutionComposer } from "@session/composer/execution/SessionExecutionComposer.js";
|
|
20
|
+
import type { SessionSystemComposer } from "@session/composer/system/SessionSystemComposer.js";
|
|
21
|
+
import { Runner } from "@session/executors/local/Runner.js";
|
|
22
|
+
import type { Logger } from "@/utils/logger/Logger.js";
|
|
15
23
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
16
24
|
import type { SessionMessageV1 } from "@/session/types/SessionMessages.js";
|
|
17
25
|
import type { SessionExecutor } from "@/session/types/SessionExecutor.js";
|
|
18
26
|
import type { SessionRunResult } from "@/session/types/SessionRun.js";
|
|
19
27
|
|
|
20
|
-
type
|
|
28
|
+
type ExecutorOptions = {
|
|
21
29
|
/**
|
|
22
30
|
* 当前会话 ID。
|
|
23
31
|
*/
|
|
@@ -29,9 +37,34 @@ type SessionOptions = {
|
|
|
29
37
|
historyComposer: SessionHistoryComposer;
|
|
30
38
|
|
|
31
39
|
/**
|
|
32
|
-
*
|
|
40
|
+
* 读取当前 session 使用的模型实例。
|
|
33
41
|
*/
|
|
34
|
-
|
|
42
|
+
getModel: () => LanguageModel | undefined;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 统一日志器。
|
|
46
|
+
*/
|
|
47
|
+
logger: Logger;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 当前 session 对应的 compaction Composer。
|
|
51
|
+
*/
|
|
52
|
+
compactionComposer?: SessionCompactionComposer;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 当前 session 对应的 system Composer。
|
|
56
|
+
*/
|
|
57
|
+
systemComposer: SessionSystemComposer;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 获取当前可用工具集合。
|
|
61
|
+
*/
|
|
62
|
+
getTools: () => Record<string, Tool>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 可选自定义 execution Composer。
|
|
66
|
+
*/
|
|
67
|
+
executionComposer?: SessionExecutionComposer;
|
|
35
68
|
|
|
36
69
|
/**
|
|
37
70
|
* session 更新后的异步回调。
|
|
@@ -40,30 +73,41 @@ type SessionOptions = {
|
|
|
40
73
|
};
|
|
41
74
|
|
|
42
75
|
/**
|
|
43
|
-
*
|
|
76
|
+
* Executor 单实例实现。
|
|
44
77
|
*/
|
|
45
|
-
export class
|
|
78
|
+
export class Executor implements SessionExecutor {
|
|
46
79
|
/**
|
|
47
80
|
* 当前 session 标识。
|
|
48
81
|
*/
|
|
49
82
|
readonly sessionId: string;
|
|
50
83
|
|
|
51
84
|
private readonly historyComposer: SessionHistoryComposer;
|
|
52
|
-
private readonly
|
|
85
|
+
private readonly getModel: ExecutorOptions["getModel"];
|
|
86
|
+
private readonly logger: Logger;
|
|
87
|
+
private readonly compactionComposer: SessionCompactionComposer;
|
|
88
|
+
private readonly systemComposer: SessionSystemComposer;
|
|
89
|
+
private readonly getTools: ExecutorOptions["getTools"];
|
|
90
|
+
private readonly runnerExecutionComposer?: SessionExecutionComposer;
|
|
53
91
|
private readonly historyWriter: SessionHistoryWriter;
|
|
54
92
|
|
|
55
|
-
private
|
|
93
|
+
private runner: Runner | null = null;
|
|
56
94
|
private executing = false;
|
|
57
95
|
|
|
58
|
-
constructor(options:
|
|
96
|
+
constructor(options: ExecutorOptions) {
|
|
59
97
|
const sessionId = String(options.sessionId || "").trim();
|
|
60
98
|
if (!sessionId) {
|
|
61
|
-
throw new Error("
|
|
99
|
+
throw new Error("Executor requires a non-empty sessionId");
|
|
62
100
|
}
|
|
63
101
|
|
|
64
102
|
this.sessionId = sessionId;
|
|
65
103
|
this.historyComposer = options.historyComposer;
|
|
66
|
-
this.
|
|
104
|
+
this.getModel = options.getModel;
|
|
105
|
+
this.logger = options.logger;
|
|
106
|
+
this.compactionComposer =
|
|
107
|
+
options.compactionComposer || new JsonlSessionCompactionComposer();
|
|
108
|
+
this.systemComposer = options.systemComposer;
|
|
109
|
+
this.getTools = options.getTools;
|
|
110
|
+
this.runnerExecutionComposer = options.executionComposer;
|
|
67
111
|
this.historyWriter = new SessionHistoryWriter({
|
|
68
112
|
sessionId,
|
|
69
113
|
getHistoryComposer: () => this.getHistoryComposer(),
|
|
@@ -86,26 +130,52 @@ export class Session {
|
|
|
86
130
|
}
|
|
87
131
|
|
|
88
132
|
/**
|
|
89
|
-
* 获取当前 session
|
|
133
|
+
* 获取当前 session 的执行端口。
|
|
134
|
+
*
|
|
135
|
+
* 关键点(中文)
|
|
136
|
+
* - 兼容 runtime/service 端口语义:Executor 自己就是执行端口。
|
|
90
137
|
*/
|
|
91
138
|
getExecutor(): SessionExecutor {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 获取或创建当前本地 Runner。
|
|
144
|
+
*/
|
|
145
|
+
private getRunner(): Runner {
|
|
146
|
+
if (this.runner) return this.runner;
|
|
147
|
+
const model = this.getModel();
|
|
148
|
+
if (!model) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
`Executor for session "${this.sessionId}" requires a configured model`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
const created = new Runner({
|
|
154
|
+
model,
|
|
155
|
+
logger: this.logger,
|
|
156
|
+
historyComposer: this.getHistoryComposer(),
|
|
157
|
+
compactionComposer: this.compactionComposer,
|
|
158
|
+
systemComposer: this.systemComposer,
|
|
159
|
+
executionComposer:
|
|
160
|
+
this.runnerExecutionComposer ||
|
|
161
|
+
new LocalSessionExecutionComposer({
|
|
162
|
+
sessionId: this.sessionId,
|
|
163
|
+
getTools: this.getTools,
|
|
164
|
+
}),
|
|
165
|
+
});
|
|
166
|
+
this.runner = created;
|
|
95
167
|
return created;
|
|
96
168
|
}
|
|
97
169
|
|
|
98
170
|
/**
|
|
99
|
-
* 清理当前 session
|
|
171
|
+
* 清理当前 session 的 Runner 缓存。
|
|
100
172
|
*
|
|
101
173
|
* 关键点(中文)
|
|
102
|
-
* - 这里只清
|
|
103
|
-
* - history 是事实源,不应随着
|
|
174
|
+
* - 这里只清 Runner,不清 history Composer。
|
|
175
|
+
* - history 是事实源,不应随着 Runner 一起丢失。
|
|
104
176
|
*/
|
|
105
177
|
clearExecutor(): void {
|
|
106
|
-
|
|
107
|
-
this.executor = null;
|
|
108
|
-
|
|
178
|
+
this.runner = null;
|
|
109
179
|
}
|
|
110
180
|
|
|
111
181
|
/**
|
|
@@ -153,7 +223,7 @@ export class Session {
|
|
|
153
223
|
if (this.executing) {
|
|
154
224
|
// 关键点(中文):同一个 Session 实例只允许一个活跃 run,
|
|
155
225
|
// 否则 step 回调、scope 与执行器状态都会互相污染。
|
|
156
|
-
throw new Error("
|
|
226
|
+
throw new Error("Executor.run does not support concurrent execution");
|
|
157
227
|
}
|
|
158
228
|
const query = String(params.query || "").trim();
|
|
159
229
|
const sessionRunScope: Omit<SessionRunScope, "sessionId"> = {
|
|
@@ -206,7 +276,7 @@ export class Session {
|
|
|
206
276
|
...sessionRunScope,
|
|
207
277
|
onAssistantStepCallback: wrappedOnAssistantStepCallback,
|
|
208
278
|
},
|
|
209
|
-
() => this.
|
|
279
|
+
() => this.getRunner().run({ query }),
|
|
210
280
|
);
|
|
211
281
|
if (persistedAssistantStepCount <= 0) return result;
|
|
212
282
|
|
|
@@ -30,7 +30,7 @@ export type SessionCompactionInput = {
|
|
|
30
30
|
system: SystemModelMessage[];
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* 当前重试次数(由
|
|
33
|
+
* 当前重试次数(由 Runner 递增)。
|
|
34
34
|
*/
|
|
35
35
|
retryCount: number;
|
|
36
36
|
};
|
|
@@ -57,7 +57,7 @@ export abstract class SessionCompactionComposer extends SessionComposer {
|
|
|
57
57
|
*
|
|
58
58
|
* 关键点(中文)
|
|
59
59
|
* - 由 compaction Composer 实现侧维护错误识别策略。
|
|
60
|
-
* -
|
|
60
|
+
* - Runner 不感知具体错误文案,只按该布尔结果决定是否重试。
|
|
61
61
|
*/
|
|
62
62
|
abstract shouldCompactOnError(error: unknown): boolean;
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ export abstract class SessionExecutionComposer extends SessionComposer {
|
|
|
65
65
|
* 构造 fallback assistant 消息。
|
|
66
66
|
*
|
|
67
67
|
* 关键点(中文)
|
|
68
|
-
* - fallback 消息构造由 execution Composer 内部实现,
|
|
68
|
+
* - fallback 消息构造由 execution Composer 内部实现,Runner 不直接依赖 history Composer。
|
|
69
69
|
*/
|
|
70
70
|
abstract buildFallbackAssistantMessage(text: string): SessionMessageV1;
|
|
71
71
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
SessionSystemComposer,
|
|
11
11
|
} from "@session/composer/system/SessionSystemComposer.js";
|
|
12
12
|
import { getSessionRunScope } from "@session/SessionRunScope.js";
|
|
13
|
-
import type { AgentContext } from "@/
|
|
13
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveSessionSystemMessages,
|
|
16
16
|
type SystemProfile,
|
|
@@ -11,7 +11,7 @@ import { transformPromptsIntoSystemMessages } from "@session/composer/system/def
|
|
|
11
11
|
import { isPluginEnabled } from "@/plugin/core/Activation.js";
|
|
12
12
|
import { PLUGINS } from "@/plugin/core/Plugins.js";
|
|
13
13
|
import { SERVICE_SYSTEM_PROVIDERS } from "@/service/core/ServiceSystemProviders.js";
|
|
14
|
-
import type { AgentContext } from "@/
|
|
14
|
+
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
15
15
|
import { buildRuntimeClockSystemPrompt } from "@session/composer/system/default/variables/VariableReplacer.js";
|
|
16
16
|
import {
|
|
17
17
|
CORE_SYSTEM_PROMPT,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Runner:本地 Session 执行内核。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这个类只做“流程编排”,不承载业务策略。
|
|
@@ -33,9 +33,9 @@ import { SessionToolLoopRunner } from "@session/executors/local/SessionToolLoopR
|
|
|
33
33
|
const MAX_COMPACTION_RETRY_ATTEMPTS = 3;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Runner 构造参数。
|
|
37
37
|
*/
|
|
38
|
-
type
|
|
38
|
+
type RunnerOptions = {
|
|
39
39
|
/** 当前模型实例。 */
|
|
40
40
|
model: LanguageModel;
|
|
41
41
|
|
|
@@ -57,9 +57,9 @@ type LocalSessionCoreOptions = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Runner 主类。
|
|
61
61
|
*/
|
|
62
|
-
export class
|
|
62
|
+
export class Runner {
|
|
63
63
|
/** 模型实例:用于真正执行 streamText。 */
|
|
64
64
|
private readonly model: LanguageModel;
|
|
65
65
|
|
|
@@ -78,7 +78,7 @@ export class LocalSessionCore {
|
|
|
78
78
|
/** system 解析器:用于解析 system messages。 */
|
|
79
79
|
private readonly systemComposer: SessionSystemComposer;
|
|
80
80
|
|
|
81
|
-
/** 运行互斥锁:防止同一个
|
|
81
|
+
/** 运行互斥锁:防止同一个 Runner 实例并发 run。 */
|
|
82
82
|
private isRunning = false;
|
|
83
83
|
|
|
84
84
|
/** context-length 重试计数。 */
|
|
@@ -87,7 +87,7 @@ export class LocalSessionCore {
|
|
|
87
87
|
/**
|
|
88
88
|
* 构造函数。
|
|
89
89
|
*/
|
|
90
|
-
constructor(options:
|
|
90
|
+
constructor(options: RunnerOptions) {
|
|
91
91
|
// 注入模型。
|
|
92
92
|
this.model = options.model;
|
|
93
93
|
|
|
@@ -109,7 +109,7 @@ export class LocalSessionCore {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
|
-
* 执行一次
|
|
112
|
+
* 执行一次 Runner run。
|
|
113
113
|
*
|
|
114
114
|
* 关键点(中文)
|
|
115
115
|
* - 这里只做入口控制,不直接做模型调用。
|
|
@@ -118,7 +118,7 @@ export class LocalSessionCore {
|
|
|
118
118
|
async run(input: SessionRunInput): Promise<SessionRunResult> {
|
|
119
119
|
// 如果当前实例已经在运行,则直接拒绝并发调用。
|
|
120
120
|
if (this.isRunning) {
|
|
121
|
-
throw new Error("
|
|
121
|
+
throw new Error("Runner.run does not support concurrent execution");
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
// 标记运行中。
|
|
@@ -140,7 +140,7 @@ export class LocalSessionCore {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* 执行一次
|
|
143
|
+
* 执行一次 Runner run(带可压缩错误重试)。
|
|
144
144
|
*
|
|
145
145
|
* 关键点(中文)
|
|
146
146
|
* - 正常:准备输入 -> 执行。
|
|
@@ -159,7 +159,7 @@ export class LocalSessionCore {
|
|
|
159
159
|
// 执行组装好的运行输入。
|
|
160
160
|
return await this.executePreparedRun(prepared);
|
|
161
161
|
} catch (error) {
|
|
162
|
-
// 是否应压缩重试由 compaction Composer 决策,
|
|
162
|
+
// 是否应压缩重试由 compaction Composer 决策,Runner 只消费布尔结果。
|
|
163
163
|
if (this.compactionComposer.shouldCompactOnError(error)) {
|
|
164
164
|
// 记录压缩重试日志,便于观测问题频率。
|
|
165
165
|
await this.logger.log("info", "[agent] compacting", {
|
|
@@ -187,7 +187,7 @@ export class LocalSessionCore {
|
|
|
187
187
|
const errorMsg = String(error);
|
|
188
188
|
|
|
189
189
|
// 记录错误日志。
|
|
190
|
-
await this.logger.log("error", "
|
|
190
|
+
await this.logger.log("error", "Runner execution failed", {
|
|
191
191
|
error: errorMsg,
|
|
192
192
|
});
|
|
193
193
|
|
|
@@ -213,7 +213,7 @@ export class LocalSessionCore {
|
|
|
213
213
|
private async prepareExecuteInput(query: string): Promise<SessionExecuteInput> {
|
|
214
214
|
// 基础安全检查:historyComposer 必须携带 sessionId。
|
|
215
215
|
if (!String(this.historyComposer.sessionId || "").trim()) {
|
|
216
|
-
throw new Error("
|
|
216
|
+
throw new Error("Runner.run requires historyComposer.sessionId");
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
// 让 execution Composer 组装运行上下文(例如 tools 与 request 作用域)。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SessionLoopDecision:
|
|
2
|
+
* SessionLoopDecision:Runner 执行循环的纯决策模块。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - 把 “是否继续下一轮” 的分支优先级从
|
|
5
|
+
* - 把 “是否继续下一轮” 的分支优先级从 Runner 主流程中拆出。
|
|
6
6
|
* - 保持纯函数,不依赖模型、持久化或 logger,便于直接测试。
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
} from "@/session/types/SessionLoop.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* 评估当前 step 完成后,
|
|
16
|
+
* 评估当前 step 完成后,Runner 是否应继续下一轮。
|
|
17
17
|
*
|
|
18
18
|
* 优先级(中文)
|
|
19
19
|
* 1. 不完整响应恢复
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Session 模型消息运行态。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* -
|
|
5
|
+
* - Runner 同时维护 session 语义消息与模型消息。
|
|
6
6
|
* - 新增 user 消息可优先做增量转换,失败时再回退为全量重算。
|
|
7
7
|
* - assistant UI 消息只需要进入 session 语义基线;模型侧使用 SDK 返回的 response messages。
|
|
8
8
|
*/
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "@session/messages/SessionMessageCodec.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Runner 单轮执行期间的消息基线。
|
|
19
19
|
*/
|
|
20
20
|
export class SessionModelMessageState {
|
|
21
21
|
/**
|