@downcity/agent 1.1.10 → 1.1.12
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/README.md +612 -139
- package/bin/config/Config.d.ts +1 -1
- package/bin/config/Config.d.ts.map +1 -1
- package/bin/config/Config.js +4 -5
- package/bin/config/Config.js.map +1 -1
- package/bin/config/DowncityDefault.d.ts +1 -1
- package/bin/config/DowncitySchema.d.ts +1 -1
- package/bin/config/DowncitySchema.d.ts.map +1 -1
- package/bin/config/Paths.d.ts +1 -1
- package/bin/config/Paths.js +2 -2
- package/bin/host/daemon/Api.d.ts +2 -2
- package/bin/host/daemon/Api.d.ts.map +1 -1
- package/bin/host/daemon/Api.js +1 -1
- package/bin/host/daemon/Client.js +2 -2
- package/bin/host/daemon/Client.js.map +1 -1
- package/bin/host/daemon/Paths.d.ts +20 -0
- package/bin/host/daemon/Paths.d.ts.map +1 -0
- package/bin/host/daemon/Paths.js +23 -0
- package/bin/host/daemon/Paths.js.map +1 -0
- package/bin/host/daemon/ProjectSetup.d.ts +1 -1
- package/bin/host/daemon/ProjectSetup.js +1 -1
- package/bin/host/daemon/ProjectSetup.js.map +1 -1
- package/bin/host/runtime/AgentHostRuntime.d.ts +1 -1
- package/bin/host/runtime/AgentHostRuntime.js +2 -2
- package/bin/host/runtime/PluginRuntime.d.ts +1 -1
- package/bin/host/runtime/PluginRuntime.d.ts.map +1 -1
- package/bin/index.d.ts +59 -77
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +42 -82
- package/bin/index.js.map +1 -1
- package/bin/model/CreateModel.d.ts +2 -2
- package/bin/model/CreateModel.js +1 -1
- package/bin/model/CreateModel.js.map +1 -1
- package/bin/model/ModelManager.d.ts +1 -1
- package/bin/plugin/builtins/asr/Config.d.ts +43 -0
- package/bin/plugin/builtins/asr/Config.d.ts.map +1 -0
- package/bin/plugin/builtins/asr/Config.js +107 -0
- package/bin/plugin/builtins/asr/Config.js.map +1 -0
- package/bin/plugin/builtins/asr/Dependency.d.ts +1 -1
- package/bin/plugin/builtins/asr/Dependency.d.ts.map +1 -1
- package/bin/plugin/builtins/asr/InboundAugment.d.ts +17 -0
- package/bin/plugin/builtins/asr/InboundAugment.d.ts.map +1 -0
- package/bin/plugin/builtins/asr/InboundAugment.js +47 -0
- package/bin/plugin/builtins/asr/InboundAugment.js.map +1 -0
- package/bin/plugin/builtins/asr/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/asr/Plugin.js +3 -126
- package/bin/plugin/builtins/asr/Plugin.js.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/AuthorizationPolicy.d.ts +2 -2
- 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/skill/Config.d.ts +1 -1
- package/bin/plugin/builtins/skill/runtime/SystemProvider.d.ts +1 -1
- package/bin/plugin/builtins/skill/types/ClaudeSkill.d.ts +1 -1
- package/bin/plugin/builtins/skill/types/ClaudeSkill.d.ts.map +1 -1
- package/bin/plugin/builtins/tts/Dependency.d.ts +1 -1
- package/bin/plugin/builtins/tts/Dependency.d.ts.map +1 -1
- package/bin/plugin/builtins/tts/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/tts/Plugin.js +1 -52
- package/bin/plugin/builtins/tts/Plugin.js.map +1 -1
- package/bin/plugin/builtins/tts/PluginSupport.d.ts +25 -0
- package/bin/plugin/builtins/tts/PluginSupport.d.ts.map +1 -0
- package/bin/plugin/builtins/tts/PluginSupport.js +72 -0
- package/bin/plugin/builtins/tts/PluginSupport.js.map +1 -0
- package/bin/plugin/builtins/tts/types/TtsPlugin.d.ts +1 -1
- package/bin/plugin/builtins/tts/types/TtsPlugin.d.ts.map +1 -1
- package/bin/plugin/builtins/voice/Config.d.ts +43 -0
- package/bin/plugin/builtins/voice/Config.d.ts.map +1 -0
- package/bin/plugin/builtins/voice/Config.js +104 -0
- package/bin/plugin/builtins/voice/Config.js.map +1 -0
- package/bin/plugin/builtins/voice/Dependency.d.ts +1 -1
- package/bin/plugin/builtins/voice/Dependency.d.ts.map +1 -1
- package/bin/plugin/builtins/voice/InboundAugment.d.ts +17 -0
- package/bin/plugin/builtins/voice/InboundAugment.d.ts.map +1 -0
- package/bin/plugin/builtins/voice/InboundAugment.js +47 -0
- package/bin/plugin/builtins/voice/InboundAugment.js.map +1 -0
- package/bin/plugin/builtins/voice/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/voice/Plugin.js +3 -123
- package/bin/plugin/builtins/voice/Plugin.js.map +1 -1
- package/bin/plugin/builtins/voice/types/VoicePlugin.d.ts +1 -1
- package/bin/plugin/builtins/voice/types/VoicePlugin.d.ts.map +1 -1
- package/bin/plugin/builtins/web/runtime/Source.d.ts +1 -1
- package/bin/plugin/builtins/web/runtime/Source.d.ts.map +1 -1
- package/bin/plugin/builtins/web/types/WebPlugin.d.ts +1 -1
- package/bin/plugin/builtins/web/types/WebPlugin.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 +2 -2
- 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 +2 -2
- package/bin/plugin/core/HookRegistry.d.ts.map +1 -1
- package/bin/plugin/core/HttpRoutes.d.ts +2 -2
- package/bin/plugin/core/HttpRoutes.d.ts.map +1 -1
- package/bin/plugin/core/LocalExecution.d.ts +1 -1
- package/bin/plugin/core/LocalExecution.d.ts.map +1 -1
- package/bin/plugin/core/LocalExecution.js +1 -1
- package/bin/plugin/core/LocalExecution.js.map +1 -1
- package/bin/plugin/core/PluginManager.d.ts +2 -2
- package/bin/plugin/core/PluginManager.js +2 -2
- package/bin/plugin/core/PluginRegistry.d.ts +2 -2
- package/bin/plugin/core/PluginRegistry.d.ts.map +1 -1
- package/bin/plugin/core/ProjectConfigStore.d.ts +1 -1
- package/bin/plugin/types/Plugin.d.ts +5 -5
- package/bin/plugin/types/Plugin.d.ts.map +1 -1
- package/bin/plugin/types/PluginApi.d.ts +1 -1
- package/bin/plugin/types/PluginApi.d.ts.map +1 -1
- package/bin/{agent/project → project}/AgentInitializer.d.ts +2 -2
- package/bin/project/AgentInitializer.d.ts.map +1 -0
- package/bin/{agent/project → project}/AgentInitializer.js +7 -7
- package/bin/project/AgentInitializer.js.map +1 -0
- package/bin/{agent/project → project}/ProjectExecutionBinding.d.ts +2 -2
- package/bin/project/ProjectExecutionBinding.d.ts.map +1 -0
- package/bin/project/ProjectExecutionBinding.js.map +1 -0
- package/bin/{agent/project → project}/types/AgentProject.d.ts +2 -2
- package/bin/project/types/AgentProject.d.ts.map +1 -0
- package/bin/project/types/AgentProject.js.map +1 -0
- package/bin/{agent → runtime}/AgentContext.d.ts +2 -2
- package/bin/runtime/AgentContext.d.ts.map +1 -0
- package/bin/{agent → runtime}/AgentContext.js +1 -1
- package/bin/runtime/AgentContext.js.map +1 -0
- package/bin/{agent → runtime}/AgentContextTypes.d.ts +4 -4
- package/bin/runtime/AgentContextTypes.d.ts.map +1 -0
- package/bin/runtime/AgentContextTypes.js.map +1 -0
- package/bin/{agent → runtime}/AgentRuntime.d.ts +4 -4
- package/bin/runtime/AgentRuntime.d.ts.map +1 -0
- package/bin/{agent → runtime}/AgentRuntime.js +6 -6
- package/bin/runtime/AgentRuntime.js.map +1 -0
- package/bin/{agent → runtime}/AgentRuntimeState.d.ts +3 -3
- package/bin/runtime/AgentRuntimeState.d.ts.map +1 -0
- package/bin/runtime/AgentRuntimeState.js.map +1 -0
- package/bin/{agent → runtime}/AgentRuntimeTypes.d.ts +2 -2
- package/bin/runtime/AgentRuntimeTypes.d.ts.map +1 -0
- package/bin/runtime/AgentRuntimeTypes.js.map +1 -0
- 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/{host/sdk → sdk}/Agent.d.ts +17 -12
- package/bin/sdk/Agent.d.ts.map +1 -0
- package/bin/{host/sdk → sdk}/Agent.js +73 -29
- package/bin/sdk/Agent.js.map +1 -0
- package/bin/{host/sdk → sdk}/AgentSdkTypes.d.ts +100 -5
- package/bin/sdk/AgentSdkTypes.d.ts.map +1 -0
- package/bin/sdk/AgentSdkTypes.js.map +1 -0
- package/bin/sdk/AsyncQueue.d.ts.map +1 -0
- package/bin/sdk/AsyncQueue.js.map +1 -0
- package/bin/{host/sdk → sdk}/HttpServer.d.ts +1 -1
- package/bin/sdk/HttpServer.d.ts.map +1 -0
- package/bin/{host/sdk → sdk}/HttpServer.js +8 -0
- package/bin/sdk/HttpServer.js.map +1 -0
- package/bin/sdk/Paths.d.ts.map +1 -0
- package/bin/sdk/Paths.js.map +1 -0
- package/bin/{host/sdk → sdk}/RemoteAgent.d.ts +6 -2
- package/bin/sdk/RemoteAgent.d.ts.map +1 -0
- package/bin/{host/sdk → sdk}/RemoteAgent.js +14 -0
- package/bin/sdk/RemoteAgent.js.map +1 -0
- package/bin/{host/sdk → sdk}/RpcServer.d.ts +1 -1
- package/bin/sdk/RpcServer.d.ts.map +1 -0
- package/bin/{host/sdk → sdk}/RpcServer.js +15 -1
- package/bin/sdk/RpcServer.js.map +1 -0
- package/bin/sdk/SdkSessionSystemComposer.d.ts +106 -0
- package/bin/sdk/SdkSessionSystemComposer.d.ts.map +1 -0
- package/bin/sdk/SdkSessionSystemComposer.js +150 -0
- package/bin/sdk/SdkSessionSystemComposer.js.map +1 -0
- package/bin/{host/sdk → sdk}/Session.d.ts +23 -18
- package/bin/sdk/Session.d.ts.map +1 -0
- package/bin/{host/sdk → sdk}/Session.js +86 -165
- package/bin/sdk/Session.js.map +1 -0
- package/bin/{host/sdk → sdk}/SessionMetadata.d.ts +5 -1
- package/bin/sdk/SessionMetadata.d.ts.map +1 -0
- package/bin/{host/sdk → sdk}/SessionMetadata.js +17 -1
- package/bin/sdk/SessionMetadata.js.map +1 -0
- package/bin/sdk/SessionPersistence.d.ts +63 -0
- package/bin/sdk/SessionPersistence.d.ts.map +1 -0
- package/bin/sdk/SessionPersistence.js +52 -0
- package/bin/sdk/SessionPersistence.js.map +1 -0
- package/bin/sdk/SessionServicePort.d.ts +34 -0
- package/bin/sdk/SessionServicePort.d.ts.map +1 -0
- package/bin/sdk/SessionServicePort.js +36 -0
- package/bin/sdk/SessionServicePort.js.map +1 -0
- package/bin/sdk/StreamEvents.d.ts +36 -0
- package/bin/sdk/StreamEvents.d.ts.map +1 -0
- package/bin/{host/sdk → sdk}/StreamEvents.js +27 -0
- package/bin/sdk/StreamEvents.js.map +1 -0
- package/bin/server/http/Server.d.ts.map +1 -0
- package/bin/{host → server}/http/Server.js +7 -7
- package/bin/server/http/Server.js.map +1 -0
- package/bin/server/http/auth/AuthEnv.d.ts.map +1 -0
- package/bin/server/http/auth/AuthEnv.js.map +1 -0
- package/bin/server/http/auth/AuthError.d.ts.map +1 -0
- package/bin/server/http/auth/AuthError.js.map +1 -0
- package/bin/server/http/auth/CliAuthStateStore.d.ts.map +1 -0
- package/bin/server/http/auth/CliAuthStateStore.js.map +1 -0
- package/bin/server/http/auth/PasswordHasher.d.ts.map +1 -0
- package/bin/server/http/auth/PasswordHasher.js.map +1 -0
- package/bin/server/http/auth/TokenService.d.ts.map +1 -0
- package/bin/server/http/auth/TokenService.js.map +1 -0
- package/bin/{host → server}/http/control/AuthControlService.d.ts +2 -2
- package/bin/server/http/control/AuthControlService.d.ts.map +1 -0
- package/bin/server/http/control/AuthControlService.js.map +1 -0
- package/bin/server/http/control/CommonHelpers.d.ts.map +1 -0
- package/bin/server/http/control/CommonHelpers.js.map +1 -0
- package/bin/{host → server}/http/control/ControlApiRoutes.d.ts +1 -1
- package/bin/server/http/control/ControlApiRoutes.d.ts.map +1 -0
- package/bin/{host → server}/http/control/ControlApiRoutes.js +5 -5
- package/bin/server/http/control/ControlApiRoutes.js.map +1 -0
- package/bin/{host → server}/http/control/ControlAuthorizationRoutes.d.ts +1 -1
- package/bin/server/http/control/ControlAuthorizationRoutes.d.ts.map +1 -0
- package/bin/{host → server}/http/control/ControlAuthorizationRoutes.js +2 -2
- package/bin/server/http/control/ControlAuthorizationRoutes.js.map +1 -0
- package/bin/{host → server}/http/control/ControlRouter.d.ts +1 -1
- package/bin/server/http/control/ControlRouter.d.ts.map +1 -0
- package/bin/{host → server}/http/control/ControlRouter.js +3 -3
- package/bin/server/http/control/ControlRouter.js.map +1 -0
- package/bin/{host → server}/http/control/ExecuteBySession.d.ts +3 -3
- package/bin/server/http/control/ExecuteBySession.d.ts.map +1 -0
- package/bin/server/http/control/ExecuteBySession.js.map +1 -0
- package/bin/{host → server}/http/control/ExecuteInput.d.ts +1 -1
- package/bin/server/http/control/ExecuteInput.d.ts.map +1 -0
- package/bin/server/http/control/ExecuteInput.js.map +1 -0
- package/bin/server/http/control/Helpers.d.ts.map +1 -0
- package/bin/{host/http/control/Helpers.d.ts.map → server/http/control/Helpers.js.map} +1 -1
- package/bin/{host → server}/http/control/MessageTimeline.d.ts +1 -1
- package/bin/server/http/control/MessageTimeline.d.ts.map +1 -0
- package/bin/server/http/control/MessageTimeline.js.map +1 -0
- package/bin/{host → server}/http/control/ModelRoutes.d.ts +1 -1
- package/bin/server/http/control/ModelRoutes.d.ts.map +1 -0
- package/bin/{host → server}/http/control/ModelRoutes.js +1 -1
- package/bin/server/http/control/ModelRoutes.js.map +1 -0
- package/bin/{host → server}/http/control/OverviewRoutes.d.ts +1 -1
- package/bin/server/http/control/OverviewRoutes.d.ts.map +1 -0
- package/bin/server/http/control/OverviewRoutes.js.map +1 -0
- package/bin/{host → server}/http/control/SessionRoutes.d.ts +1 -1
- package/bin/server/http/control/SessionRoutes.d.ts.map +1 -0
- package/bin/server/http/control/SessionRoutes.js.map +1 -0
- package/bin/{host → server}/http/control/SessionSummaryStore.d.ts +2 -2
- package/bin/server/http/control/SessionSummaryStore.d.ts.map +1 -0
- package/bin/server/http/control/SessionSummaryStore.js.map +1 -0
- package/bin/{host → server}/http/control/TaskRoutes.d.ts +1 -1
- package/bin/server/http/control/TaskRoutes.d.ts.map +1 -0
- package/bin/server/http/control/TaskRoutes.js.map +1 -0
- package/bin/{host → server}/http/control/TaskStore.d.ts +1 -1
- package/bin/server/http/control/TaskStore.d.ts.map +1 -0
- package/bin/server/http/control/TaskStore.js.map +1 -0
- package/bin/server/http/control/types/AuthControl.d.ts.map +1 -0
- package/bin/server/http/control/types/AuthControl.js.map +1 -0
- package/bin/{host → server}/http/control/types/ControlRoutes.d.ts +2 -2
- package/bin/server/http/control/types/ControlRoutes.d.ts.map +1 -0
- package/bin/server/http/control/types/ControlRoutes.js.map +1 -0
- package/bin/server/http/control/types/ControlSessionExecute.d.ts.map +1 -0
- package/bin/server/http/control/types/ControlSessionExecute.js.map +1 -0
- package/bin/{host → server}/http/control/types/ControlViewData.d.ts +1 -1
- package/bin/server/http/control/types/ControlViewData.d.ts.map +1 -0
- package/bin/server/http/control/types/ControlViewData.js.map +1 -0
- package/bin/server/http/execute/execute.d.ts.map +1 -0
- package/bin/{host → server}/http/execute/execute.js +1 -1
- package/bin/server/http/execute/execute.js.map +1 -0
- package/bin/server/http/health/health.d.ts.map +1 -0
- package/bin/server/http/health/health.js.map +1 -0
- package/bin/server/http/plugins/plugins.d.ts.map +1 -0
- package/bin/{host → server}/http/plugins/plugins.js +1 -1
- package/bin/server/http/plugins/plugins.js.map +1 -0
- package/bin/server/http/services/services.d.ts.map +1 -0
- package/bin/{host → server}/http/services/services.js +1 -1
- package/bin/server/http/services/services.js.map +1 -0
- package/bin/server/http/static/static.d.ts.map +1 -0
- package/bin/{host → server}/http/static/static.js +1 -1
- package/bin/server/http/static/static.js.map +1 -0
- package/bin/{host → server}/rpc/Server.d.ts +3 -3
- package/bin/server/rpc/Server.d.ts.map +1 -0
- package/bin/{host → server}/rpc/Server.js +2 -2
- package/bin/server/rpc/Server.js.map +1 -0
- 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 +3 -3
- package/bin/service/builtins/chat/ChatService.d.ts.map +1 -1
- package/bin/service/builtins/chat/ChatServiceTypes.d.ts +2 -2
- package/bin/service/builtins/chat/ChatServiceTypes.d.ts.map +1 -1
- package/bin/service/builtins/chat/accounts/ChannelAccountService.d.ts +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 +2 -2
- 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/Feishu.js +39 -171
- package/bin/service/builtins/chat/channels/feishu/Feishu.js.map +1 -1
- package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.d.ts +155 -0
- package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.d.ts.map +1 -0
- package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.js +247 -0
- package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.js.map +1 -0
- 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/feishu/FeishuPlatformLookup.d.ts +1 -1
- package/bin/service/builtins/chat/channels/feishu/FeishuPlatformLookup.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/feishu/types/FeishuChannel.d.ts +1 -1
- package/bin/service/builtins/chat/channels/feishu/types/FeishuChannel.js +1 -1
- package/bin/service/builtins/chat/channels/qq/QQ.d.ts +5 -5
- package/bin/service/builtins/chat/channels/qq/QQ.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/qq/QQ.js +33 -231
- package/bin/service/builtins/chat/channels/qq/QQ.js.map +1 -1
- package/bin/service/builtins/chat/channels/qq/QQGatewayClient.d.ts +0 -24
- package/bin/service/builtins/chat/channels/qq/QQGatewayClient.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/qq/QQGatewayClient.js +68 -227
- package/bin/service/builtins/chat/channels/qq/QQGatewayClient.js.map +1 -1
- package/bin/service/builtins/chat/channels/qq/QQGatewayConnection.d.ts +65 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayConnection.d.ts.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayConnection.js +110 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayConnection.js.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayHeartbeat.d.ts +59 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayHeartbeat.d.ts.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayHeartbeat.js +58 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayHeartbeat.js.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayProtocol.d.ts +86 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayProtocol.d.ts.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayProtocol.js +93 -0
- package/bin/service/builtins/chat/channels/qq/QQGatewayProtocol.js.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQMessageHandler.d.ts +129 -0
- package/bin/service/builtins/chat/channels/qq/QQMessageHandler.d.ts.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQMessageHandler.js +284 -0
- package/bin/service/builtins/chat/channels/qq/QQMessageHandler.js.map +1 -0
- package/bin/service/builtins/chat/channels/qq/QQSupport.d.ts +2 -2
- package/bin/service/builtins/chat/channels/qq/QQSupport.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/qq/types/QqChannel.d.ts +2 -2
- package/bin/service/builtins/chat/channels/qq/types/QqChannel.d.ts.map +1 -1
- package/bin/service/builtins/chat/channels/qq/types/QqChannel.js +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/Bot.js +35 -293
- package/bin/service/builtins/chat/channels/telegram/Bot.js.map +1 -1
- package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.d.ts +142 -0
- package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.d.ts.map +1 -0
- package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.js +267 -0
- package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.js.map +1 -0
- package/bin/service/builtins/chat/channels/telegram/TelegramPendingUpdates.d.ts +55 -0
- package/bin/service/builtins/chat/channels/telegram/TelegramPendingUpdates.d.ts.map +1 -0
- package/bin/service/builtins/chat/channels/telegram/TelegramPendingUpdates.js +125 -0
- package/bin/service/builtins/chat/channels/telegram/TelegramPendingUpdates.js.map +1 -0
- 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 +2 -2
- package/bin/service/builtins/chat/runtime/ChatActionExecution.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatActionInput.d.ts +3 -11
- package/bin/service/builtins/chat/runtime/ChatActionInput.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatActionInput.js +3 -232
- package/bin/service/builtins/chat/runtime/ChatActionInput.js.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatActionInputSupport.d.ts +33 -0
- package/bin/service/builtins/chat/runtime/ChatActionInputSupport.d.ts.map +1 -0
- package/bin/service/builtins/chat/runtime/ChatActionInputSupport.js +66 -0
- package/bin/service/builtins/chat/runtime/ChatActionInputSupport.js.map +1 -0
- 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 +3 -3
- package/bin/service/builtins/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts +2 -2
- 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 +2 -2
- package/bin/service/builtins/chat/runtime/ChatHistoryStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatIngressStore.d.ts +2 -2
- package/bin/service/builtins/chat/runtime/ChatIngressStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatMetaStore.d.ts +3 -3
- package/bin/service/builtins/chat/runtime/ChatMetaStore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatMetaStore.js +2 -2
- 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 +2 -2
- 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/ChatSendActionInput.d.ts +23 -0
- package/bin/service/builtins/chat/runtime/ChatSendActionInput.d.ts.map +1 -0
- package/bin/service/builtins/chat/runtime/ChatSendActionInput.js +205 -0
- package/bin/service/builtins/chat/runtime/ChatSendActionInput.js.map +1 -0
- 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 +2 -2
- package/bin/service/builtins/chat/runtime/ChatkeySend.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatkeySend.js +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/ReplyContextFormatter.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ReplyContextFormatter.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/chat/runtime/UIMessageTransformer.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/UIMessageTransformer.d.ts.map +1 -1
- package/bin/service/builtins/chat/types/ChannelAccount.d.ts +1 -1
- package/bin/service/builtins/chat/types/ChatHistory.d.ts +1 -1
- package/bin/service/builtins/chat/types/ChatHistory.d.ts.map +1 -1
- package/bin/service/builtins/chat/types/ChatMeta.d.ts +1 -1
- package/bin/service/builtins/chat/types/ChatMeta.js +1 -1
- package/bin/service/builtins/chat/types/ChatQueue.d.ts +1 -1
- package/bin/service/builtins/chat/types/ChatQueue.d.ts.map +1 -1
- package/bin/service/builtins/chat/types/ChatService.d.ts +1 -1
- package/bin/service/builtins/chat/types/ChatService.d.ts.map +1 -1
- package/bin/service/builtins/contact/Action.d.ts +57 -4
- package/bin/service/builtins/contact/Action.d.ts.map +1 -1
- package/bin/service/builtins/contact/Action.js +272 -4
- 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/ContactService.js +19 -293
- package/bin/service/builtins/contact/ContactService.js.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 +24 -0
- package/bin/service/builtins/contact/runtime/ContactPayload.d.ts.map +1 -0
- package/bin/service/builtins/contact/runtime/ContactPayload.js +32 -0
- package/bin/service/builtins/contact/runtime/ContactPayload.js.map +1 -0
- 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/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 +2 -2
- 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/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/memory/types/Memory.d.ts +1 -1
- package/bin/service/builtins/memory/types/Memory.d.ts.map +1 -1
- 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 +52 -0
- package/bin/service/builtins/shell/runtime/ShellActionResponse.d.ts.map +1 -0
- package/bin/service/builtins/shell/runtime/ShellActionResponse.js +73 -0
- package/bin/service/builtins/shell/runtime/ShellActionResponse.js.map +1 -0
- 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/ShellActionRuntime.js +3 -26
- package/bin/service/builtins/shell/runtime/ShellActionRuntime.js.map +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts +4 -32
- package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts.map +1 -1
- package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.js +3 -131
- package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.js.map +1 -1
- package/bin/service/builtins/shell/runtime/ShellProcessEvents.d.ts +22 -0
- package/bin/service/builtins/shell/runtime/ShellProcessEvents.d.ts.map +1 -0
- package/bin/service/builtins/shell/runtime/ShellProcessEvents.js +41 -0
- package/bin/service/builtins/shell/runtime/ShellProcessEvents.js.map +1 -0
- package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.d.ts +21 -0
- package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.d.ts.map +1 -0
- package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.js +75 -0
- package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.js.map +1 -0
- 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/Model.d.ts +1 -1
- package/bin/service/builtins/task/runtime/Model.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/Paths.d.ts +1 -1
- package/bin/service/builtins/task/runtime/Paths.js +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/Runner.js +17 -64
- package/bin/service/builtins/task/runtime/Runner.js.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 +1 -1
- package/bin/service/builtins/task/runtime/TaskActionInput.d.ts.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 +2 -2
- package/bin/service/builtins/task/runtime/TaskRunnerRound.d.ts.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerRound.js +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerRound.js.map +1 -1
- package/bin/service/builtins/task/runtime/TaskRunnerScript.d.ts +81 -0
- package/bin/service/builtins/task/runtime/TaskRunnerScript.d.ts.map +1 -0
- package/bin/service/builtins/task/runtime/TaskRunnerScript.js +96 -0
- package/bin/service/builtins/task/runtime/TaskRunnerScript.js.map +1 -0
- 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/core/Manager.d.ts +3 -3
- package/bin/service/core/Manager.js +3 -3
- package/bin/service/core/ServiceActionApi.d.ts +1 -1
- package/bin/service/core/ServiceActionApi.d.ts.map +1 -1
- package/bin/service/core/ServiceActionRunner.d.ts +2 -2
- package/bin/service/core/ServiceActionRunner.d.ts.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/ServiceManager.d.ts +2 -2
- package/bin/service/core/ServiceManager.js +2 -2
- package/bin/service/core/ServiceStateController.d.ts +1 -1
- package/bin/service/core/ServiceStateController.d.ts.map +1 -1
- package/bin/service/core/ServiceStateController.js +1 -1
- 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/schedule/Executor.d.ts +1 -1
- package/bin/service/schedule/Executor.d.ts.map +1 -1
- package/bin/service/schedule/Runtime.d.ts +1 -1
- package/bin/service/schedule/Runtime.d.ts.map +1 -1
- package/bin/service/types/Service.d.ts +2 -2
- package/bin/service/types/Service.d.ts.map +1 -1
- package/bin/service/types/ServiceSchedule.d.ts +1 -1
- package/bin/service/types/ServiceSchedule.d.ts.map +1 -1
- package/bin/service/types/ServiceState.d.ts +1 -1
- package/bin/service/types/ServiceState.js +1 -1
- package/bin/service/types/Services.d.ts +1 -1
- package/bin/service/types/Services.d.ts.map +1 -1
- package/bin/session/Session.d.ts +1 -1
- package/bin/session/Session.d.ts.map +1 -1
- package/bin/session/composer/history/SessionHistoryWriter.d.ts +1 -1
- package/bin/session/composer/history/SessionHistoryWriter.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/executors/local/LocalSessionCore.d.ts +1 -9
- package/bin/session/executors/local/LocalSessionCore.d.ts.map +1 -1
- package/bin/session/executors/local/LocalSessionCore.js +8 -392
- package/bin/session/executors/local/LocalSessionCore.js.map +1 -1
- package/bin/session/executors/local/SessionExecutionError.d.ts +26 -0
- package/bin/session/executors/local/SessionExecutionError.d.ts.map +1 -0
- package/bin/session/executors/local/SessionExecutionError.js +34 -0
- package/bin/session/executors/local/SessionExecutionError.js.map +1 -0
- package/bin/session/executors/local/SessionModelMessageState.d.ts +63 -0
- package/bin/session/executors/local/SessionModelMessageState.d.ts.map +1 -0
- package/bin/session/executors/local/SessionModelMessageState.js +90 -0
- package/bin/session/executors/local/SessionModelMessageState.js.map +1 -0
- package/bin/session/executors/local/SessionSignals.d.ts +1 -1
- package/bin/session/executors/local/SessionSignals.d.ts.map +1 -1
- package/bin/session/executors/local/SessionToolLoopRunner.d.ts +44 -0
- package/bin/session/executors/local/SessionToolLoopRunner.d.ts.map +1 -0
- package/bin/session/executors/local/SessionToolLoopRunner.js +261 -0
- package/bin/session/executors/local/SessionToolLoopRunner.js.map +1 -0
- package/bin/session/executors/local/SessionUiStreamCollector.d.ts +33 -0
- package/bin/session/executors/local/SessionUiStreamCollector.d.ts.map +1 -0
- package/bin/session/executors/local/SessionUiStreamCollector.js +64 -0
- package/bin/session/executors/local/SessionUiStreamCollector.js.map +1 -0
- package/bin/session/tools/shell/ShellToolBridge.d.ts +2 -2
- package/bin/session/tools/shell/ShellToolBridge.d.ts.map +1 -1
- package/bin/session/tools/shell/ShellToolDefinition.d.ts +1 -1
- package/bin/session/tools/shell/ShellToolDefinition.d.ts.map +1 -1
- package/bin/session/tools/shell/ShellToolFormatting.js +1 -1
- package/bin/session/tools/shell/ShellToolFormatting.js.map +1 -1
- package/bin/session/types/SessionHistoryMeta.d.ts +2 -0
- package/bin/session/types/SessionHistoryMeta.d.ts.map +1 -1
- package/bin/session/types/SessionMessages.d.ts +1 -1
- package/bin/session/types/SessionMessages.d.ts.map +1 -1
- package/bin/transport/rpc/Client.d.ts.map +1 -0
- package/bin/transport/rpc/Client.js.map +1 -0
- package/bin/transport/rpc/Paths.d.ts.map +1 -0
- package/bin/{host → transport}/rpc/Paths.js +21 -2
- package/bin/transport/rpc/Paths.js.map +1 -0
- package/bin/transport/rpc/Transport.d.ts.map +1 -0
- package/bin/transport/rpc/Transport.js.map +1 -0
- package/bin/types/auth/AuthPermission.d.ts.map +1 -0
- package/bin/types/auth/AuthPermission.js.map +1 -0
- package/bin/types/auth/AuthRoute.d.ts.map +1 -0
- package/bin/types/auth/AuthRoute.js.map +1 -0
- package/bin/types/auth/AuthToken.d.ts.map +1 -0
- package/bin/types/auth/AuthToken.js.map +1 -0
- package/bin/types/auth/AuthTypes.d.ts.map +1 -0
- package/bin/types/auth/AuthTypes.js.map +1 -0
- package/bin/types/common/Json.d.ts.map +1 -0
- package/bin/types/common/Json.js.map +1 -0
- package/bin/types/common/Template.d.ts.map +1 -0
- package/bin/types/common/Template.js.map +1 -0
- package/bin/{config/types → types/config}/DowncityConfig.d.ts +3 -3
- package/bin/{config/types → types/config}/DowncityConfig.d.ts.map +1 -1
- package/bin/types/config/DowncityConfig.js.map +1 -0
- package/bin/{config/types → types/config}/ExecutionBinding.d.ts.map +1 -1
- package/bin/types/config/ExecutionBinding.js.map +1 -0
- package/bin/{config/types → types/config}/LlmConfig.d.ts.map +1 -1
- package/bin/types/config/LlmConfig.js.map +1 -0
- package/bin/{config/types → types/config}/ModelBinding.d.ts.map +1 -1
- package/bin/types/config/ModelBinding.js.map +1 -0
- package/bin/{config/types → types/config}/Start.d.ts.map +1 -1
- package/bin/types/config/Start.js.map +1 -0
- package/bin/{host/daemon/types → types/daemon}/Daemon.d.ts +1 -1
- package/bin/types/daemon/Daemon.d.ts.map +1 -0
- package/bin/{host/daemon/types → types/daemon}/Daemon.js +1 -1
- package/bin/types/daemon/Daemon.js.map +1 -0
- package/bin/{host/types → types/host}/AgentHost.d.ts +6 -6
- package/bin/{host/types → types/host}/AgentHost.d.ts.map +1 -1
- package/bin/types/host/AgentHost.js +10 -0
- package/bin/types/host/AgentHost.js.map +1 -0
- package/bin/{host/types → types/host}/Store.d.ts +1 -1
- package/bin/{host/types → types/host}/Store.d.ts.map +1 -1
- package/bin/{host/types → types/host}/Store.js.map +1 -1
- package/bin/types/http/InlineInstant.d.ts.map +1 -0
- package/bin/types/http/InlineInstant.js.map +1 -0
- package/bin/types/platform/Platform.d.ts.map +1 -0
- package/bin/types/platform/Platform.js.map +1 -0
- package/bin/types/platform/PlatformGateway.d.ts.map +1 -0
- package/bin/types/platform/PlatformGateway.js.map +1 -0
- package/bin/{host/rpc/types → types/rpc}/LocalRpc.d.ts +2 -2
- package/bin/types/rpc/LocalRpc.d.ts.map +1 -0
- package/bin/types/rpc/LocalRpc.js.map +1 -0
- package/bin/utils/Template.d.ts +1 -1
- package/bin/utils/Template.d.ts.map +1 -1
- package/bin/utils/logger/Fetch.d.ts +1 -1
- package/bin/utils/logger/Fetch.d.ts.map +1 -1
- package/bin/utils/logger/FormatRequest.d.ts +1 -1
- package/bin/utils/logger/FormatRequest.d.ts.map +1 -1
- package/bin/utils/logger/FormatRequest.js +1 -1
- package/bin/utils/logger/FormatRequest.js.map +1 -1
- package/bin/utils/logger/FormatResponse.d.ts +1 -1
- package/bin/utils/logger/FormatResponse.d.ts.map +1 -1
- package/bin/utils/logger/FormatShared.d.ts +1 -1
- package/bin/utils/logger/FormatShared.d.ts.map +1 -1
- package/bin/utils/logger/Logger.d.ts +1 -1
- package/bin/utils/logger/Logger.d.ts.map +1 -1
- package/bin/utils/storage/index.d.ts +1 -1
- package/bin/utils/storage/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/config/Config.ts +6 -7
- package/src/config/DowncityDefault.ts +1 -1
- package/src/config/DowncitySchema.ts +1 -1
- package/src/config/Paths.ts +2 -2
- package/src/host/daemon/Api.ts +2 -2
- package/src/host/daemon/Client.ts +3 -3
- package/src/host/daemon/Paths.ts +33 -0
- package/src/host/daemon/ProjectSetup.ts +2 -2
- package/src/host/runtime/AgentHostRuntime.ts +4 -4
- package/src/host/runtime/PluginRuntime.ts +1 -1
- package/src/index.ts +280 -159
- package/src/model/CreateModel.ts +4 -4
- package/src/model/ModelManager.ts +1 -1
- package/src/plugin/builtins/asr/Config.ts +138 -0
- package/src/plugin/builtins/asr/Dependency.ts +1 -1
- package/src/plugin/builtins/asr/InboundAugment.ts +59 -0
- package/src/plugin/builtins/asr/Plugin.ts +9 -160
- package/src/plugin/builtins/auth/Plugin.ts +1 -1
- package/src/plugin/builtins/auth/runtime/AuthorizationConfig.ts +1 -1
- package/src/plugin/builtins/auth/runtime/AuthorizationPolicy.ts +2 -2
- package/src/plugin/builtins/auth/runtime/AuthorizationStore.ts +1 -1
- package/src/plugin/builtins/skill/Action.ts +1 -1
- package/src/plugin/builtins/skill/Config.ts +1 -1
- package/src/plugin/builtins/skill/Plugin.ts +1 -1
- package/src/plugin/builtins/skill/runtime/Discovery.ts +1 -1
- package/src/plugin/builtins/skill/runtime/SystemProvider.ts +1 -1
- package/src/plugin/builtins/skill/types/ClaudeSkill.ts +1 -1
- package/src/plugin/builtins/tts/Dependency.ts +1 -1
- package/src/plugin/builtins/tts/Plugin.ts +6 -63
- package/src/plugin/builtins/tts/PluginSupport.ts +85 -0
- package/src/plugin/builtins/tts/types/TtsPlugin.ts +1 -1
- package/src/plugin/builtins/voice/Config.ts +135 -0
- package/src/plugin/builtins/voice/Dependency.ts +1 -1
- package/src/plugin/builtins/voice/InboundAugment.ts +59 -0
- package/src/plugin/builtins/voice/Plugin.ts +9 -158
- package/src/plugin/builtins/voice/types/VoicePlugin.ts +1 -1
- package/src/plugin/builtins/web/Plugin.ts +1 -1
- package/src/plugin/builtins/web/runtime/Config.ts +1 -1
- package/src/plugin/builtins/web/runtime/Source.ts +1 -1
- package/src/plugin/builtins/web/types/WebPlugin.ts +1 -1
- package/src/plugin/builtins/workboard/runtime/Collector.ts +2 -2
- package/src/plugin/builtins/workboard/runtime/Normalizer.ts +2 -2
- package/src/plugin/builtins/workboard/runtime/Store.ts +1 -1
- package/src/plugin/core/Activation.ts +2 -2
- package/src/plugin/core/HookRegistry.ts +2 -2
- package/src/plugin/core/HttpRoutes.ts +2 -2
- package/src/plugin/core/LocalExecution.ts +2 -2
- package/src/plugin/core/PluginCommand.ts +1 -1
- package/src/plugin/core/PluginManager.ts +2 -2
- package/src/plugin/core/PluginRegistry.ts +2 -2
- package/src/plugin/core/ProjectConfigStore.ts +1 -1
- package/src/plugin/types/Plugin.ts +5 -5
- package/src/plugin/types/PluginApi.ts +1 -1
- package/src/{agent/project → project}/AgentInitializer.ts +4 -4
- package/src/{agent/project → project}/ProjectExecutionBinding.ts +2 -2
- package/src/{agent/project → project}/types/AgentProject.ts +2 -2
- package/src/{agent → runtime}/AgentContext.ts +4 -4
- package/src/{agent → runtime}/AgentContextTypes.ts +4 -4
- package/src/{agent → runtime}/AgentRuntime.ts +8 -8
- package/src/{agent → runtime}/AgentRuntimeState.ts +4 -4
- package/src/{agent → runtime}/AgentRuntimeTypes.ts +2 -2
- package/src/sandbox/SandboxConfigResolver.ts +1 -1
- package/src/sandbox/SandboxRunner.ts +1 -1
- package/src/{host/sdk → sdk}/Agent.ts +80 -28
- package/src/{host/sdk → sdk}/AgentSdkTypes.ts +115 -2
- package/src/{host/sdk → sdk}/HttpServer.ts +10 -1
- package/src/{host/sdk → sdk}/RemoteAgent.ts +25 -1
- package/src/{host/sdk → sdk}/RpcServer.ts +21 -3
- package/src/sdk/SdkSessionSystemComposer.ts +261 -0
- package/src/{host/sdk → sdk}/Session.ts +103 -178
- package/src/{host/sdk → sdk}/SessionMetadata.ts +19 -1
- package/src/sdk/SessionPersistence.ts +113 -0
- package/src/sdk/SessionServicePort.ts +62 -0
- package/src/{host/sdk → sdk}/StreamEvents.ts +45 -2
- package/src/{host → server}/http/Server.ts +7 -7
- package/src/{host → server}/http/control/AuthControlService.ts +3 -3
- package/src/{host → server}/http/control/ControlApiRoutes.ts +6 -6
- package/src/{host → server}/http/control/ControlAuthorizationRoutes.ts +3 -3
- package/src/{host → server}/http/control/ControlRouter.ts +3 -3
- package/src/{host → server}/http/control/ExecuteBySession.ts +4 -4
- package/src/{host → server}/http/control/ExecuteInput.ts +1 -1
- package/src/{host → server}/http/control/MessageTimeline.ts +1 -1
- package/src/{host → server}/http/control/ModelRoutes.ts +2 -2
- package/src/{host → server}/http/control/OverviewRoutes.ts +1 -1
- package/src/{host → server}/http/control/SessionRoutes.ts +2 -2
- package/src/{host → server}/http/control/SessionSummaryStore.ts +2 -2
- package/src/{host → server}/http/control/TaskRoutes.ts +1 -1
- package/src/{host → server}/http/control/TaskStore.ts +1 -1
- package/src/{host → server}/http/control/types/ControlRoutes.ts +2 -2
- package/src/{host → server}/http/control/types/ControlViewData.ts +1 -1
- package/src/{host → server}/http/execute/execute.ts +1 -1
- package/src/{host → server}/http/plugins/plugins.ts +1 -1
- package/src/{host → server}/http/services/services.ts +1 -1
- package/src/{host → server}/http/static/static.ts +1 -1
- package/src/{host → server}/rpc/Server.ts +7 -7
- package/src/service/builtins/BaseService.ts +2 -2
- package/src/service/builtins/README.md +32 -11
- package/src/service/builtins/chat/Action.ts +1 -1
- package/src/service/builtins/chat/ChatService.ts +3 -3
- package/src/service/builtins/chat/ChatServiceTypes.ts +2 -2
- package/src/service/builtins/chat/accounts/ChannelAccountService.ts +2 -2
- package/src/service/builtins/chat/channels/BaseChatChannel.ts +1 -1
- package/src/service/builtins/chat/channels/BaseChatChannelQueue.ts +2 -2
- package/src/service/builtins/chat/channels/BaseChatChannelSupport.ts +2 -2
- package/src/service/builtins/chat/channels/feishu/Feishu.ts +65 -232
- package/src/service/builtins/chat/channels/feishu/FeishuMessageHandler.ts +483 -0
- package/src/service/builtins/chat/channels/feishu/FeishuPlatformClient.ts +1 -1
- package/src/service/builtins/chat/channels/feishu/FeishuPlatformLookup.ts +1 -1
- package/src/service/builtins/chat/channels/feishu/types/FeishuChannel.ts +1 -1
- package/src/service/builtins/chat/channels/qq/QQ.ts +56 -291
- package/src/service/builtins/chat/channels/qq/QQGatewayClient.ts +76 -250
- package/src/service/builtins/chat/channels/qq/QQGatewayConnection.ts +175 -0
- package/src/service/builtins/chat/channels/qq/QQGatewayHeartbeat.ts +114 -0
- package/src/service/builtins/chat/channels/qq/QQGatewayProtocol.ts +176 -0
- package/src/service/builtins/chat/channels/qq/QQGatewaySupport.ts +1 -1
- package/src/service/builtins/chat/channels/qq/QQInbound.ts +1 -1
- package/src/service/builtins/chat/channels/qq/QQMessageHandler.ts +465 -0
- package/src/service/builtins/chat/channels/qq/QQSendSupport.ts +1 -1
- package/src/service/builtins/chat/channels/qq/QQSupport.ts +2 -2
- package/src/service/builtins/chat/channels/qq/types/QqChannel.ts +2 -2
- package/src/service/builtins/chat/channels/telegram/Bot.ts +57 -352
- package/src/service/builtins/chat/channels/telegram/StateStore.ts +1 -1
- package/src/service/builtins/chat/channels/telegram/TelegramMessageHandler.ts +485 -0
- package/src/service/builtins/chat/channels/telegram/TelegramPendingUpdates.ts +204 -0
- 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 +2 -2
- package/src/service/builtins/chat/runtime/ChatActionInput.ts +14 -281
- package/src/service/builtins/chat/runtime/ChatActionInputSupport.ts +85 -0
- package/src/service/builtins/chat/runtime/ChatChannelActions.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatChannelConfig.ts +3 -3
- package/src/service/builtins/chat/runtime/ChatChannelCore.ts +2 -2
- package/src/service/builtins/chat/runtime/ChatChannelLifecycle.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatHistoryStore.ts +2 -2
- package/src/service/builtins/chat/runtime/ChatIngressStore.ts +2 -2
- package/src/service/builtins/chat/runtime/ChatMetaStore.ts +3 -3
- package/src/service/builtins/chat/runtime/ChatQueueReplyDispatch.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatQueueSessionBridge.ts +2 -2
- package/src/service/builtins/chat/runtime/ChatQueueStore.ts +1 -1
- package/src/service/builtins/chat/runtime/ChatQueueWorker.ts +2 -2
- package/src/service/builtins/chat/runtime/ChatSendActionInput.ts +255 -0
- package/src/service/builtins/chat/runtime/ChatServiceActions.ts +1 -1
- 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 +2 -2
- package/src/service/builtins/chat/runtime/EnqueueDispatch.ts +2 -2
- package/src/service/builtins/chat/runtime/InboundAugment.ts +2 -2
- package/src/service/builtins/chat/runtime/PluginDispatch.ts +2 -2
- package/src/service/builtins/chat/runtime/ReplyContextFormatter.ts +1 -1
- package/src/service/builtins/chat/runtime/ReplyDispatch.ts +2 -2
- package/src/service/builtins/chat/runtime/SystemPrompt.ts +1 -1
- package/src/service/builtins/chat/runtime/UIMessageTransformer.ts +1 -1
- package/src/service/builtins/chat/types/ChannelAccount.ts +1 -1
- package/src/service/builtins/chat/types/ChatHistory.ts +1 -1
- package/src/service/builtins/chat/types/ChatMeta.ts +1 -1
- package/src/service/builtins/chat/types/ChatQueue.ts +1 -1
- package/src/service/builtins/chat/types/ChatService.ts +1 -1
- package/src/service/builtins/contact/Action.ts +368 -4
- package/src/service/builtins/contact/ContactService.ts +30 -324
- package/src/service/builtins/contact/runtime/ChatRuntime.ts +1 -1
- package/src/service/builtins/contact/runtime/ContactPayload.ts +38 -0
- package/src/service/builtins/contact/runtime/RemoteClient.ts +1 -1
- package/src/service/builtins/contact/runtime/ShareBundle.ts +1 -1
- package/src/service/builtins/memory/Action.ts +2 -2
- package/src/service/builtins/memory/MemoryService.ts +2 -2
- 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/memory/types/Memory.ts +1 -1
- 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 +135 -0
- package/src/service/builtins/shell/runtime/ShellActionRuntime.ts +3 -38
- package/src/service/builtins/shell/runtime/ShellActionRuntimeSupport.ts +11 -165
- package/src/service/builtins/shell/runtime/ShellProcessEvents.ts +65 -0
- package/src/service/builtins/shell/runtime/ShellRuntimeEnvironment.ts +75 -0
- package/src/service/builtins/task/Action.ts +2 -2
- 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/Model.ts +1 -1
- package/src/service/builtins/task/runtime/Paths.ts +1 -1
- package/src/service/builtins/task/runtime/Runner.ts +17 -63
- package/src/service/builtins/task/runtime/TaskActionExecution.ts +1 -1
- package/src/service/builtins/task/runtime/TaskActionInput.ts +1 -1
- package/src/service/builtins/task/runtime/TaskRunChatDispatch.ts +1 -1
- package/src/service/builtins/task/runtime/TaskRunnerRound.ts +3 -3
- package/src/service/builtins/task/runtime/TaskRunnerScript.ts +175 -0
- package/src/service/builtins/task/runtime/TaskRunnerSession.ts +1 -1
- package/src/service/core/Manager.ts +3 -3
- package/src/service/core/ServiceActionApi.ts +2 -2
- package/src/service/core/ServiceActionRunner.ts +2 -2
- package/src/service/core/ServiceClassRegistry.ts +1 -1
- package/src/service/core/ServiceManager.ts +2 -2
- package/src/service/core/ServiceStateController.ts +2 -2
- package/src/service/core/ServiceSystemProviders.ts +1 -1
- package/src/service/core/Services.ts +1 -1
- package/src/service/schedule/Executor.ts +1 -1
- package/src/service/schedule/Runtime.ts +1 -1
- package/src/service/schedule/Store.ts +1 -1
- package/src/service/types/Service.ts +2 -2
- package/src/service/types/ServiceSchedule.ts +1 -1
- package/src/service/types/ServiceState.ts +1 -1
- package/src/service/types/Services.ts +1 -1
- package/src/session/Session.ts +1 -1
- package/src/session/composer/history/SessionHistoryWriter.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 +10 -498
- package/src/session/executors/local/SessionExecutionError.ts +47 -0
- package/src/session/executors/local/SessionModelMessageState.ts +133 -0
- package/src/session/executors/local/SessionSignals.ts +1 -1
- package/src/session/executors/local/SessionToolLoopRunner.ts +350 -0
- package/src/session/executors/local/SessionUiStreamCollector.ts +96 -0
- package/src/session/messages/SessionStepEventMapper.ts +1 -1
- package/src/session/tools/shell/ShellToolBridge.ts +2 -2
- package/src/session/tools/shell/ShellToolDefinition.ts +1 -1
- package/src/session/tools/shell/ShellToolFormatting.ts +1 -1
- package/src/session/types/SessionHistoryMeta.ts +2 -0
- package/src/session/types/SessionMessages.ts +1 -1
- package/src/{host → transport}/rpc/Client.ts +1 -1
- package/src/{host → transport}/rpc/Paths.ts +22 -2
- package/src/{config/types → types/config}/DowncityConfig.ts +3 -3
- package/src/{host/daemon/types → types/daemon}/Daemon.ts +1 -1
- package/src/{host/types → types/host}/AgentHost.ts +6 -6
- package/src/{host/types → types/host}/Store.ts +1 -1
- package/src/{host/rpc/types → types/rpc}/LocalRpc.ts +1 -1
- package/src/utils/Template.ts +1 -1
- package/src/utils/logger/Fetch.ts +1 -1
- package/src/utils/logger/FormatRequest.ts +2 -2
- package/src/utils/logger/FormatResponse.ts +1 -1
- package/src/utils/logger/FormatShared.ts +1 -1
- package/src/utils/logger/Logger.ts +1 -1
- package/src/utils/storage/index.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/bin/agent/AgentContext.d.ts.map +0 -1
- package/bin/agent/AgentContext.js.map +0 -1
- package/bin/agent/AgentContextTypes.d.ts.map +0 -1
- package/bin/agent/AgentContextTypes.js.map +0 -1
- package/bin/agent/AgentRuntime.d.ts.map +0 -1
- package/bin/agent/AgentRuntime.js.map +0 -1
- package/bin/agent/AgentRuntimeState.d.ts.map +0 -1
- package/bin/agent/AgentRuntimeState.js.map +0 -1
- package/bin/agent/AgentRuntimeTypes.d.ts.map +0 -1
- package/bin/agent/AgentRuntimeTypes.js.map +0 -1
- package/bin/agent/project/AgentInitializer.d.ts.map +0 -1
- package/bin/agent/project/AgentInitializer.js.map +0 -1
- package/bin/agent/project/ProjectExecutionBinding.d.ts.map +0 -1
- package/bin/agent/project/ProjectExecutionBinding.js.map +0 -1
- package/bin/agent/project/types/AgentProject.d.ts.map +0 -1
- package/bin/agent/project/types/AgentProject.js.map +0 -1
- package/bin/config/types/DowncityConfig.js.map +0 -1
- package/bin/config/types/ExecutionBinding.js.map +0 -1
- package/bin/config/types/LlmConfig.js.map +0 -1
- package/bin/config/types/ModelBinding.js.map +0 -1
- package/bin/config/types/Start.js.map +0 -1
- package/bin/host/daemon/Manager.d.ts +0 -92
- package/bin/host/daemon/Manager.d.ts.map +0 -1
- package/bin/host/daemon/Manager.js +0 -287
- package/bin/host/daemon/Manager.js.map +0 -1
- package/bin/host/daemon/types/Daemon.d.ts.map +0 -1
- package/bin/host/daemon/types/Daemon.js.map +0 -1
- package/bin/host/http/Server.d.ts.map +0 -1
- package/bin/host/http/Server.js.map +0 -1
- package/bin/host/http/auth/AuthEnv.d.ts.map +0 -1
- package/bin/host/http/auth/AuthEnv.js.map +0 -1
- package/bin/host/http/auth/AuthError.d.ts.map +0 -1
- package/bin/host/http/auth/AuthError.js.map +0 -1
- package/bin/host/http/auth/CliAuthStateStore.d.ts.map +0 -1
- package/bin/host/http/auth/CliAuthStateStore.js.map +0 -1
- package/bin/host/http/auth/PasswordHasher.d.ts.map +0 -1
- package/bin/host/http/auth/PasswordHasher.js.map +0 -1
- package/bin/host/http/auth/TokenService.d.ts.map +0 -1
- package/bin/host/http/auth/TokenService.js.map +0 -1
- package/bin/host/http/auth/types/AuthPermission.d.ts.map +0 -1
- package/bin/host/http/auth/types/AuthPermission.js.map +0 -1
- package/bin/host/http/auth/types/AuthRoute.d.ts.map +0 -1
- package/bin/host/http/auth/types/AuthRoute.js.map +0 -1
- package/bin/host/http/auth/types/AuthToken.d.ts.map +0 -1
- package/bin/host/http/auth/types/AuthToken.js.map +0 -1
- package/bin/host/http/auth/types/AuthTypes.d.ts.map +0 -1
- package/bin/host/http/auth/types/AuthTypes.js.map +0 -1
- package/bin/host/http/control/AuthControlService.d.ts.map +0 -1
- package/bin/host/http/control/AuthControlService.js.map +0 -1
- package/bin/host/http/control/CommonHelpers.d.ts.map +0 -1
- package/bin/host/http/control/CommonHelpers.js.map +0 -1
- package/bin/host/http/control/ControlApiRoutes.d.ts.map +0 -1
- package/bin/host/http/control/ControlApiRoutes.js.map +0 -1
- package/bin/host/http/control/ControlAuthorizationRoutes.d.ts.map +0 -1
- package/bin/host/http/control/ControlAuthorizationRoutes.js.map +0 -1
- package/bin/host/http/control/ControlRouter.d.ts.map +0 -1
- package/bin/host/http/control/ControlRouter.js.map +0 -1
- package/bin/host/http/control/ExecuteBySession.d.ts.map +0 -1
- package/bin/host/http/control/ExecuteBySession.js.map +0 -1
- package/bin/host/http/control/ExecuteInput.d.ts.map +0 -1
- package/bin/host/http/control/ExecuteInput.js.map +0 -1
- package/bin/host/http/control/Helpers.js.map +0 -1
- package/bin/host/http/control/MessageTimeline.d.ts.map +0 -1
- package/bin/host/http/control/MessageTimeline.js.map +0 -1
- package/bin/host/http/control/ModelRoutes.d.ts.map +0 -1
- package/bin/host/http/control/ModelRoutes.js.map +0 -1
- package/bin/host/http/control/OverviewRoutes.d.ts.map +0 -1
- package/bin/host/http/control/OverviewRoutes.js.map +0 -1
- package/bin/host/http/control/SessionRoutes.d.ts.map +0 -1
- package/bin/host/http/control/SessionRoutes.js.map +0 -1
- package/bin/host/http/control/SessionSummaryStore.d.ts.map +0 -1
- package/bin/host/http/control/SessionSummaryStore.js.map +0 -1
- package/bin/host/http/control/TaskRoutes.d.ts.map +0 -1
- package/bin/host/http/control/TaskRoutes.js.map +0 -1
- package/bin/host/http/control/TaskStore.d.ts.map +0 -1
- package/bin/host/http/control/TaskStore.js.map +0 -1
- package/bin/host/http/control/types/AuthControl.d.ts.map +0 -1
- package/bin/host/http/control/types/AuthControl.js.map +0 -1
- package/bin/host/http/control/types/ControlRoutes.d.ts.map +0 -1
- package/bin/host/http/control/types/ControlRoutes.js.map +0 -1
- package/bin/host/http/control/types/ControlSessionExecute.d.ts.map +0 -1
- package/bin/host/http/control/types/ControlSessionExecute.js.map +0 -1
- package/bin/host/http/control/types/ControlViewData.d.ts.map +0 -1
- package/bin/host/http/control/types/ControlViewData.js.map +0 -1
- package/bin/host/http/execute/execute.d.ts.map +0 -1
- package/bin/host/http/execute/execute.js.map +0 -1
- package/bin/host/http/execute/types/InlineInstant.d.ts.map +0 -1
- package/bin/host/http/execute/types/InlineInstant.js.map +0 -1
- package/bin/host/http/health/health.d.ts.map +0 -1
- package/bin/host/http/health/health.js.map +0 -1
- package/bin/host/http/plugins/plugins.d.ts.map +0 -1
- package/bin/host/http/plugins/plugins.js.map +0 -1
- package/bin/host/http/services/services.d.ts.map +0 -1
- package/bin/host/http/services/services.js.map +0 -1
- package/bin/host/http/static/static.d.ts.map +0 -1
- package/bin/host/http/static/static.js.map +0 -1
- package/bin/host/rpc/Client.d.ts.map +0 -1
- package/bin/host/rpc/Client.js.map +0 -1
- package/bin/host/rpc/Paths.d.ts.map +0 -1
- package/bin/host/rpc/Paths.js.map +0 -1
- package/bin/host/rpc/Server.d.ts.map +0 -1
- package/bin/host/rpc/Server.js.map +0 -1
- package/bin/host/rpc/Transport.d.ts.map +0 -1
- package/bin/host/rpc/Transport.js.map +0 -1
- package/bin/host/rpc/types/LocalRpc.d.ts.map +0 -1
- package/bin/host/rpc/types/LocalRpc.js.map +0 -1
- package/bin/host/runtime/CityPaths.d.ts +0 -50
- package/bin/host/runtime/CityPaths.d.ts.map +0 -1
- package/bin/host/runtime/CityPaths.js +0 -75
- package/bin/host/runtime/CityPaths.js.map +0 -1
- package/bin/host/runtime/CityRegistry.d.ts +0 -51
- package/bin/host/runtime/CityRegistry.d.ts.map +0 -1
- package/bin/host/runtime/CityRegistry.js +0 -217
- package/bin/host/runtime/CityRegistry.js.map +0 -1
- package/bin/host/runtime/CityRuntime.d.ts +0 -21
- package/bin/host/runtime/CityRuntime.d.ts.map +0 -1
- package/bin/host/runtime/CityRuntime.js +0 -45
- package/bin/host/runtime/CityRuntime.js.map +0 -1
- package/bin/host/runtime/ProcessSweep.d.ts +0 -76
- package/bin/host/runtime/ProcessSweep.d.ts.map +0 -1
- package/bin/host/runtime/ProcessSweep.js +0 -188
- package/bin/host/runtime/ProcessSweep.js.map +0 -1
- package/bin/host/runtime/types/Platform.d.ts.map +0 -1
- package/bin/host/runtime/types/Platform.js.map +0 -1
- package/bin/host/runtime/types/PlatformGateway.d.ts.map +0 -1
- package/bin/host/runtime/types/PlatformGateway.js.map +0 -1
- package/bin/host/sdk/Agent.d.ts.map +0 -1
- package/bin/host/sdk/Agent.js.map +0 -1
- package/bin/host/sdk/AgentSdkTypes.d.ts.map +0 -1
- package/bin/host/sdk/AgentSdkTypes.js.map +0 -1
- package/bin/host/sdk/AsyncQueue.d.ts.map +0 -1
- package/bin/host/sdk/AsyncQueue.js.map +0 -1
- package/bin/host/sdk/HttpServer.d.ts.map +0 -1
- package/bin/host/sdk/HttpServer.js.map +0 -1
- package/bin/host/sdk/Paths.d.ts.map +0 -1
- package/bin/host/sdk/Paths.js.map +0 -1
- package/bin/host/sdk/RemoteAgent.d.ts.map +0 -1
- package/bin/host/sdk/RemoteAgent.js.map +0 -1
- package/bin/host/sdk/RpcServer.d.ts.map +0 -1
- package/bin/host/sdk/RpcServer.js.map +0 -1
- package/bin/host/sdk/SdkSessionSystemComposer.d.ts +0 -43
- package/bin/host/sdk/SdkSessionSystemComposer.d.ts.map +0 -1
- package/bin/host/sdk/SdkSessionSystemComposer.js +0 -71
- package/bin/host/sdk/SdkSessionSystemComposer.js.map +0 -1
- package/bin/host/sdk/Session.d.ts.map +0 -1
- package/bin/host/sdk/Session.js.map +0 -1
- package/bin/host/sdk/SessionMetadata.d.ts.map +0 -1
- package/bin/host/sdk/SessionMetadata.js.map +0 -1
- package/bin/host/sdk/StreamEvents.d.ts +0 -14
- package/bin/host/sdk/StreamEvents.d.ts.map +0 -1
- package/bin/host/sdk/StreamEvents.js.map +0 -1
- package/bin/host/types/AgentHost.js +0 -10
- package/bin/host/types/AgentHost.js.map +0 -1
- package/bin/utils/types/Json.d.ts.map +0 -1
- package/bin/utils/types/Json.js.map +0 -1
- package/bin/utils/types/Template.d.ts.map +0 -1
- package/bin/utils/types/Template.js.map +0 -1
- package/src/host/daemon/Manager.ts +0 -344
- package/src/host/runtime/CityPaths.ts +0 -84
- package/src/host/runtime/CityRegistry.ts +0 -256
- package/src/host/runtime/CityRuntime.ts +0 -45
- package/src/host/runtime/ProcessSweep.ts +0 -239
- package/src/host/sdk/SdkSessionSystemComposer.ts +0 -113
- /package/bin/{agent/project → project}/ProjectExecutionBinding.js +0 -0
- /package/bin/{agent/project → project}/types/AgentProject.js +0 -0
- /package/bin/{agent → runtime}/AgentContextTypes.js +0 -0
- /package/bin/{agent → runtime}/AgentRuntimeState.js +0 -0
- /package/bin/{agent → runtime}/AgentRuntimeTypes.js +0 -0
- /package/bin/{host/sdk → sdk}/AgentSdkTypes.js +0 -0
- /package/bin/{host/sdk → sdk}/AsyncQueue.d.ts +0 -0
- /package/bin/{host/sdk → sdk}/AsyncQueue.js +0 -0
- /package/bin/{host/sdk → sdk}/Paths.d.ts +0 -0
- /package/bin/{host/sdk → sdk}/Paths.js +0 -0
- /package/bin/{host → server}/http/Server.d.ts +0 -0
- /package/bin/{host → server}/http/auth/AuthEnv.d.ts +0 -0
- /package/bin/{host → server}/http/auth/AuthEnv.js +0 -0
- /package/bin/{host → server}/http/auth/AuthError.d.ts +0 -0
- /package/bin/{host → server}/http/auth/AuthError.js +0 -0
- /package/bin/{host → server}/http/auth/CliAuthStateStore.d.ts +0 -0
- /package/bin/{host → server}/http/auth/CliAuthStateStore.js +0 -0
- /package/bin/{host → server}/http/auth/PasswordHasher.d.ts +0 -0
- /package/bin/{host → server}/http/auth/PasswordHasher.js +0 -0
- /package/bin/{host → server}/http/auth/TokenService.d.ts +0 -0
- /package/bin/{host → server}/http/auth/TokenService.js +0 -0
- /package/bin/{host → server}/http/control/AuthControlService.js +0 -0
- /package/bin/{host → server}/http/control/CommonHelpers.d.ts +0 -0
- /package/bin/{host → server}/http/control/CommonHelpers.js +0 -0
- /package/bin/{host → server}/http/control/ExecuteBySession.js +0 -0
- /package/bin/{host → server}/http/control/ExecuteInput.js +0 -0
- /package/bin/{host → server}/http/control/Helpers.d.ts +0 -0
- /package/bin/{host → server}/http/control/Helpers.js +0 -0
- /package/bin/{host → server}/http/control/MessageTimeline.js +0 -0
- /package/bin/{host → server}/http/control/OverviewRoutes.js +0 -0
- /package/bin/{host → server}/http/control/SessionRoutes.js +0 -0
- /package/bin/{host → server}/http/control/SessionSummaryStore.js +0 -0
- /package/bin/{host → server}/http/control/TaskRoutes.js +0 -0
- /package/bin/{host → server}/http/control/TaskStore.js +0 -0
- /package/bin/{host → server}/http/control/types/AuthControl.d.ts +0 -0
- /package/bin/{host → server}/http/control/types/AuthControl.js +0 -0
- /package/bin/{host → server}/http/control/types/ControlRoutes.js +0 -0
- /package/bin/{host → server}/http/control/types/ControlSessionExecute.d.ts +0 -0
- /package/bin/{host → server}/http/control/types/ControlSessionExecute.js +0 -0
- /package/bin/{host → server}/http/control/types/ControlViewData.js +0 -0
- /package/bin/{host → server}/http/execute/execute.d.ts +0 -0
- /package/bin/{host → server}/http/health/health.d.ts +0 -0
- /package/bin/{host → server}/http/health/health.js +0 -0
- /package/bin/{host → server}/http/plugins/plugins.d.ts +0 -0
- /package/bin/{host → server}/http/services/services.d.ts +0 -0
- /package/bin/{host → server}/http/static/static.d.ts +0 -0
- /package/bin/{host → transport}/rpc/Client.d.ts +0 -0
- /package/bin/{host → transport}/rpc/Client.js +0 -0
- /package/bin/{host → transport}/rpc/Paths.d.ts +0 -0
- /package/bin/{host → transport}/rpc/Transport.d.ts +0 -0
- /package/bin/{host → transport}/rpc/Transport.js +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthPermission.d.ts +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthPermission.js +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthRoute.d.ts +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthRoute.js +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthToken.d.ts +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthToken.js +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthTypes.d.ts +0 -0
- /package/bin/{host/http/auth/types → types/auth}/AuthTypes.js +0 -0
- /package/bin/{utils/types → types/common}/Json.d.ts +0 -0
- /package/bin/{utils/types → types/common}/Json.js +0 -0
- /package/bin/{utils/types → types/common}/Template.d.ts +0 -0
- /package/bin/{utils/types → types/common}/Template.js +0 -0
- /package/bin/{config/types → types/config}/DowncityConfig.js +0 -0
- /package/bin/{config/types → types/config}/ExecutionBinding.d.ts +0 -0
- /package/bin/{config/types → types/config}/ExecutionBinding.js +0 -0
- /package/bin/{config/types → types/config}/LlmConfig.d.ts +0 -0
- /package/bin/{config/types → types/config}/LlmConfig.js +0 -0
- /package/bin/{config/types → types/config}/ModelBinding.d.ts +0 -0
- /package/bin/{config/types → types/config}/ModelBinding.js +0 -0
- /package/bin/{config/types → types/config}/Start.d.ts +0 -0
- /package/bin/{config/types → types/config}/Start.js +0 -0
- /package/bin/{host/types → types/host}/Store.js +0 -0
- /package/bin/{host/http/execute/types → types/http}/InlineInstant.d.ts +0 -0
- /package/bin/{host/http/execute/types → types/http}/InlineInstant.js +0 -0
- /package/bin/{host/runtime/types → types/platform}/Platform.d.ts +0 -0
- /package/bin/{host/runtime/types → types/platform}/Platform.js +0 -0
- /package/bin/{host/runtime/types → types/platform}/PlatformGateway.d.ts +0 -0
- /package/bin/{host/runtime/types → types/platform}/PlatformGateway.js +0 -0
- /package/bin/{host/rpc/types → types/rpc}/LocalRpc.js +0 -0
- /package/src/{host/sdk → sdk}/AsyncQueue.ts +0 -0
- /package/src/{host/sdk → sdk}/Paths.ts +0 -0
- /package/src/{host → server}/http/auth/AuthEnv.ts +0 -0
- /package/src/{host → server}/http/auth/AuthError.ts +0 -0
- /package/src/{host → server}/http/auth/CliAuthStateStore.ts +0 -0
- /package/src/{host → server}/http/auth/PasswordHasher.ts +0 -0
- /package/src/{host → server}/http/auth/TokenService.ts +0 -0
- /package/src/{host → server}/http/control/CommonHelpers.ts +0 -0
- /package/src/{host → server}/http/control/Helpers.ts +0 -0
- /package/src/{host → server}/http/control/types/AuthControl.ts +0 -0
- /package/src/{host → server}/http/control/types/ControlSessionExecute.ts +0 -0
- /package/src/{host → server}/http/health/health.ts +0 -0
- /package/src/{host → transport}/rpc/Transport.ts +0 -0
- /package/src/{host/http/auth/types → types/auth}/AuthPermission.ts +0 -0
- /package/src/{host/http/auth/types → types/auth}/AuthRoute.ts +0 -0
- /package/src/{host/http/auth/types → types/auth}/AuthToken.ts +0 -0
- /package/src/{host/http/auth/types → types/auth}/AuthTypes.ts +0 -0
- /package/src/{utils/types → types/common}/Json.ts +0 -0
- /package/src/{utils/types → types/common}/Template.ts +0 -0
- /package/src/{config/types → types/config}/ExecutionBinding.ts +0 -0
- /package/src/{config/types → types/config}/LlmConfig.ts +0 -0
- /package/src/{config/types → types/config}/ModelBinding.ts +0 -0
- /package/src/{config/types → types/config}/Start.ts +0 -0
- /package/src/{host/http/execute/types → types/http}/InlineInstant.ts +0 -0
- /package/src/{host/runtime/types → types/platform}/Platform.ts +0 -0
- /package/src/{host/runtime/types → types/platform}/PlatformGateway.ts +0 -0
|
@@ -7,17 +7,14 @@
|
|
|
7
7
|
* - QQBot 不再直接维护底层 ws / token 细节,只保留渠道编排职责。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import WebSocket
|
|
10
|
+
import WebSocket from "ws";
|
|
11
11
|
import type { Logger } from "@/utils/logger/Logger.js";
|
|
12
|
-
import type { JsonObject } from "@/
|
|
12
|
+
import type { JsonObject } from "@/types/common/Json.js";
|
|
13
13
|
import type {
|
|
14
14
|
QQEventCaptureConfig,
|
|
15
|
-
QQGatewayPayload,
|
|
16
15
|
QqDispatchHandler,
|
|
17
16
|
QqGatewayRuntimeStatus,
|
|
18
17
|
} from "@/service/builtins/chat/channels/qq/types/QqChannel.js";
|
|
19
|
-
import { EventType, OpCode } from "@/service/builtins/chat/channels/qq/types/QqChannel.js";
|
|
20
|
-
import { captureQqWsPayload } from "./QQEventCapture.js";
|
|
21
18
|
import {
|
|
22
19
|
fetchQqAccessToken,
|
|
23
20
|
fetchQqGatewayUrl,
|
|
@@ -25,14 +22,19 @@ import {
|
|
|
25
22
|
} from "./QQGatewayAuth.js";
|
|
26
23
|
import {
|
|
27
24
|
buildQqGatewayRuntimeStatus,
|
|
28
|
-
getQqHeartbeatAckTimeoutMs,
|
|
29
|
-
hasQqHealthyHeartbeat,
|
|
30
|
-
hasQqHeartbeatTimeout,
|
|
31
|
-
parseQqGatewayPayload,
|
|
32
25
|
resolveQqGatewayApiBase,
|
|
33
26
|
resolveQqGatewayWsUrl,
|
|
34
27
|
} from "./QQGatewaySupport.js";
|
|
35
28
|
import { sendQqMessageWithRetry } from "./QQGatewaySend.js";
|
|
29
|
+
import { connectQqGatewayWebSocket } from "./QQGatewayConnection.js";
|
|
30
|
+
import {
|
|
31
|
+
handleQqGatewayPayload,
|
|
32
|
+
sendQqGatewayIdentify,
|
|
33
|
+
} from "./QQGatewayProtocol.js";
|
|
34
|
+
import {
|
|
35
|
+
normalizeQqHeartbeatIntervalMs,
|
|
36
|
+
sendQqGatewayHeartbeat,
|
|
37
|
+
} from "./QQGatewayHeartbeat.js";
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* QQGatewayClient 构造参数。
|
|
@@ -263,41 +265,6 @@ export class QQGatewayClient {
|
|
|
263
265
|
});
|
|
264
266
|
}
|
|
265
267
|
|
|
266
|
-
/**
|
|
267
|
-
* 计算心跳 ACK 超时阈值。
|
|
268
|
-
*/
|
|
269
|
-
private getHeartbeatAckTimeoutMs(): number {
|
|
270
|
-
return getQqHeartbeatAckTimeoutMs(this.heartbeatIntervalMs);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* 是否发生心跳 ACK 超时。
|
|
275
|
-
*/
|
|
276
|
-
private hasHeartbeatTimeout(nowMs: number = Date.now()): boolean {
|
|
277
|
-
return hasQqHeartbeatTimeout(
|
|
278
|
-
{
|
|
279
|
-
heartbeatIntervalMs: this.heartbeatIntervalMs,
|
|
280
|
-
pendingHeartbeatSinceMs: this.pendingHeartbeatSinceMs,
|
|
281
|
-
wsReadyAtMs: this.wsReadyAtMs,
|
|
282
|
-
},
|
|
283
|
-
nowMs,
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* 心跳是否健康。
|
|
289
|
-
*/
|
|
290
|
-
private hasHealthyHeartbeat(nowMs: number = Date.now()): boolean {
|
|
291
|
-
return hasQqHealthyHeartbeat(
|
|
292
|
-
{
|
|
293
|
-
heartbeatIntervalMs: this.heartbeatIntervalMs,
|
|
294
|
-
pendingHeartbeatSinceMs: this.pendingHeartbeatSinceMs,
|
|
295
|
-
wsReadyAtMs: this.wsReadyAtMs,
|
|
296
|
-
},
|
|
297
|
-
nowMs,
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
268
|
/**
|
|
302
269
|
* 重置网关活性状态。
|
|
303
270
|
*/
|
|
@@ -395,189 +362,63 @@ export class QQGatewayClient {
|
|
|
395
362
|
* 建立 WebSocket 连接。
|
|
396
363
|
*/
|
|
397
364
|
private async connectWebSocket(gatewayUrl: string): Promise<void> {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
(
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
this.stopHeartbeat();
|
|
412
|
-
this.resetWsLivenessState();
|
|
413
|
-
|
|
414
|
-
return new Promise((resolve, reject) => {
|
|
415
|
-
let settled = false;
|
|
416
|
-
const resolveOnce = () => {
|
|
417
|
-
if (settled) return;
|
|
418
|
-
settled = true;
|
|
419
|
-
resolve();
|
|
420
|
-
};
|
|
421
|
-
const rejectOnce = (error: Error) => {
|
|
422
|
-
if (settled) return;
|
|
423
|
-
settled = true;
|
|
424
|
-
reject(error);
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
const ws = new WebSocket(gatewayUrl);
|
|
428
|
-
this.ws = ws;
|
|
429
|
-
|
|
430
|
-
ws.on("open", () => {
|
|
431
|
-
if (this.ws !== ws) return;
|
|
432
|
-
this.logger.info("WebSocket 连接已建立");
|
|
365
|
+
await connectQqGatewayWebSocket({
|
|
366
|
+
gatewayUrl,
|
|
367
|
+
logger: this.logger,
|
|
368
|
+
captureConfig: this.captureConfig,
|
|
369
|
+
getCurrentSocket: () => this.ws,
|
|
370
|
+
setCurrentSocket: (ws) => {
|
|
371
|
+
this.ws = ws;
|
|
372
|
+
},
|
|
373
|
+
resetLivenessState: () => this.resetWsLivenessState(),
|
|
374
|
+
stopHeartbeat: () => this.stopHeartbeat(),
|
|
375
|
+
clearReconnectTimer: () => this.clearReconnectTimer(),
|
|
376
|
+
resetReconnectAttempts: () => {
|
|
433
377
|
this.reconnectAttempts = 0;
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}
|
|
447
|
-
this.logger.debug(
|
|
448
|
-
`收到 WebSocket 消息: op=${payload.op}, t=${payload.t || "N/A"}`,
|
|
449
|
-
);
|
|
450
|
-
await captureQqWsPayload({
|
|
451
|
-
config: this.captureConfig,
|
|
452
|
-
logger: this.logger,
|
|
453
|
-
payload,
|
|
454
|
-
});
|
|
455
|
-
await this.handleWebSocketMessage(payload);
|
|
456
|
-
} catch (error) {
|
|
457
|
-
this.logger.error("处理 WebSocket 消息失败", {
|
|
458
|
-
error: String(error),
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
|
|
463
|
-
ws.on("close", (code: number, reason: Buffer) => {
|
|
464
|
-
if (this.ws !== ws) return;
|
|
465
|
-
const reasonText = Buffer.isBuffer(reason)
|
|
466
|
-
? reason.toString("utf-8")
|
|
467
|
-
: String(reason || "");
|
|
468
|
-
this.logger.warn(`WebSocket 连接关闭: ${code} - ${reasonText}`);
|
|
469
|
-
this.ws = null;
|
|
470
|
-
this.stopHeartbeat();
|
|
471
|
-
this.resetWsLivenessState();
|
|
472
|
-
this.scheduleReconnect(`ws_closed:${code}`);
|
|
473
|
-
rejectOnce(
|
|
474
|
-
new Error(`QQ websocket closed before ready: ${code} ${reasonText}`),
|
|
475
|
-
);
|
|
476
|
-
});
|
|
477
|
-
|
|
478
|
-
ws.on("error", (error: Error) => {
|
|
479
|
-
if (this.ws !== ws) return;
|
|
480
|
-
this.logger.error("WebSocket 错误", { error: String(error) });
|
|
481
|
-
rejectOnce(error);
|
|
482
|
-
});
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* 解析原始 Gateway 载荷。
|
|
488
|
-
*/
|
|
489
|
-
private parseGatewayPayload(rawData: RawData): QQGatewayPayload | null {
|
|
490
|
-
return parseQqGatewayPayload(rawData);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* 处理网关消息。
|
|
495
|
-
*/
|
|
496
|
-
private async handleWebSocketMessage(payload: QQGatewayPayload): Promise<void> {
|
|
497
|
-
const { op, d, s, t } = payload;
|
|
498
|
-
if (s) {
|
|
499
|
-
this.lastSeq = s;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
switch (op) {
|
|
503
|
-
case OpCode.Hello: {
|
|
504
|
-
const heartbeatIntervalMs =
|
|
505
|
-
typeof d?.heartbeat_interval === "number" ? d.heartbeat_interval : 30000;
|
|
506
|
-
this.startHeartbeat(heartbeatIntervalMs);
|
|
507
|
-
await this.sendIdentify();
|
|
508
|
-
break;
|
|
509
|
-
}
|
|
510
|
-
case OpCode.Dispatch: {
|
|
511
|
-
const eventType = String(t || "");
|
|
512
|
-
if (eventType === EventType.READY) {
|
|
513
|
-
this.wsContextId = typeof d?.context_id === "string" ? d.context_id : "";
|
|
514
|
-
this.wsReadyAtMs = Date.now();
|
|
515
|
-
} else if (eventType === EventType.RESUMED) {
|
|
516
|
-
this.wsReadyAtMs = Date.now();
|
|
517
|
-
}
|
|
518
|
-
await this.onDispatch({
|
|
519
|
-
eventType,
|
|
520
|
-
data: d || {},
|
|
521
|
-
});
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
case OpCode.HeartbeatAck:
|
|
525
|
-
this.lastHeartbeatAckAtMs = Date.now();
|
|
526
|
-
this.pendingHeartbeatSinceMs = 0;
|
|
527
|
-
this.logger.debug("收到心跳响应");
|
|
528
|
-
break;
|
|
529
|
-
case OpCode.Reconnect:
|
|
530
|
-
this.logger.warn("服务端要求重连");
|
|
531
|
-
this.closeSocketForRecovery("server_reconnect_opcode");
|
|
532
|
-
break;
|
|
533
|
-
case OpCode.InvalidContext:
|
|
534
|
-
this.logger.error("无效的 Context,需要重新鉴权");
|
|
535
|
-
this.clearAccessTokenCache();
|
|
536
|
-
setTimeout(async () => {
|
|
537
|
-
try {
|
|
378
|
+
},
|
|
379
|
+
scheduleReconnect: (reason, delayMs) =>
|
|
380
|
+
this.scheduleReconnect(reason, delayMs),
|
|
381
|
+
handlePayload: async (payload) => {
|
|
382
|
+
await handleQqGatewayPayload({
|
|
383
|
+
logger: this.logger,
|
|
384
|
+
payload,
|
|
385
|
+
setLastSeq: (seq) => {
|
|
386
|
+
this.lastSeq = seq;
|
|
387
|
+
},
|
|
388
|
+
startHeartbeat: (intervalMs) => this.startHeartbeat(intervalMs),
|
|
389
|
+
sendIdentify: async () => {
|
|
538
390
|
await this.sendIdentify();
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
391
|
+
},
|
|
392
|
+
markReady: (contextId) => {
|
|
393
|
+
this.wsContextId = contextId;
|
|
394
|
+
this.wsReadyAtMs = Date.now();
|
|
395
|
+
},
|
|
396
|
+
markResumed: () => {
|
|
397
|
+
this.wsReadyAtMs = Date.now();
|
|
398
|
+
},
|
|
399
|
+
markHeartbeatAck: () => {
|
|
400
|
+
this.lastHeartbeatAckAtMs = Date.now();
|
|
401
|
+
this.pendingHeartbeatSinceMs = 0;
|
|
402
|
+
},
|
|
403
|
+
clearAccessTokenCache: () => this.clearAccessTokenCache(),
|
|
404
|
+
closeSocketForRecovery: (reason) => this.closeSocketForRecovery(reason),
|
|
405
|
+
onDispatch: async (dispatch) => {
|
|
406
|
+
await this.onDispatch(dispatch);
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
},
|
|
410
|
+
});
|
|
545
411
|
}
|
|
546
412
|
|
|
547
413
|
/**
|
|
548
414
|
* 发送鉴权请求。
|
|
549
415
|
*/
|
|
550
416
|
private async sendIdentify(): Promise<void> {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
op: OpCode.Identify,
|
|
557
|
-
d: {
|
|
558
|
-
token: authToken,
|
|
559
|
-
intents,
|
|
560
|
-
shard: [0, 1],
|
|
561
|
-
properties: {
|
|
562
|
-
$os: "linux",
|
|
563
|
-
$browser: "downcity",
|
|
564
|
-
$device: "downcity",
|
|
565
|
-
},
|
|
566
|
-
},
|
|
567
|
-
};
|
|
568
|
-
|
|
569
|
-
this.logger.debug(`Identify payload: ${JSON.stringify(identifyPayload)}`);
|
|
570
|
-
this.ws?.send(JSON.stringify(identifyPayload));
|
|
571
|
-
this.logger.info("已发送鉴权请求");
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* 获取订阅事件位掩码。
|
|
576
|
-
*/
|
|
577
|
-
private getIntents(): number {
|
|
578
|
-
const GROUP_AND_C2C_EVENT = 1 << 25;
|
|
579
|
-
const AUDIO_ACTION = 1 << 29;
|
|
580
|
-
return GROUP_AND_C2C_EVENT | AUDIO_ACTION;
|
|
417
|
+
await sendQqGatewayIdentify({
|
|
418
|
+
socket: this.ws,
|
|
419
|
+
logger: this.logger,
|
|
420
|
+
getAuthToken: () => this.getAuthToken(),
|
|
421
|
+
});
|
|
581
422
|
}
|
|
582
423
|
|
|
583
424
|
/**
|
|
@@ -585,8 +426,7 @@ export class QQGatewayClient {
|
|
|
585
426
|
*/
|
|
586
427
|
private startHeartbeat(intervalMs: number): void {
|
|
587
428
|
this.stopHeartbeat();
|
|
588
|
-
this.heartbeatIntervalMs =
|
|
589
|
-
Number.isFinite(intervalMs) && intervalMs > 0 ? Math.trunc(intervalMs) : 30000;
|
|
429
|
+
this.heartbeatIntervalMs = normalizeQqHeartbeatIntervalMs(intervalMs);
|
|
590
430
|
this.pendingHeartbeatSinceMs = 0;
|
|
591
431
|
this.lastHeartbeatSentAtMs = 0;
|
|
592
432
|
this.sendHeartbeat();
|
|
@@ -599,35 +439,21 @@ export class QQGatewayClient {
|
|
|
599
439
|
* 发送单次心跳。
|
|
600
440
|
*/
|
|
601
441
|
private sendHeartbeat(): void {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
this.
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
};
|
|
618
|
-
try {
|
|
619
|
-
ws.send(JSON.stringify(heartbeatPayload));
|
|
620
|
-
this.lastHeartbeatSentAtMs = now;
|
|
621
|
-
if (!this.pendingHeartbeatSinceMs) {
|
|
622
|
-
this.pendingHeartbeatSinceMs = now;
|
|
623
|
-
}
|
|
624
|
-
this.logger.debug("发送心跳");
|
|
625
|
-
} catch (error) {
|
|
626
|
-
this.logger.warn("发送 QQ 心跳失败,准备重连", {
|
|
627
|
-
error: String(error),
|
|
628
|
-
});
|
|
629
|
-
this.closeSocketForRecovery("heartbeat_send_failed");
|
|
630
|
-
}
|
|
442
|
+
sendQqGatewayHeartbeat({
|
|
443
|
+
socket: this.ws,
|
|
444
|
+
logger: this.logger,
|
|
445
|
+
lastSeq: this.lastSeq,
|
|
446
|
+
heartbeatIntervalMs: this.heartbeatIntervalMs,
|
|
447
|
+
wsReadyAtMs: this.wsReadyAtMs,
|
|
448
|
+
pendingHeartbeatSinceMs: this.pendingHeartbeatSinceMs,
|
|
449
|
+
markHeartbeatSent: (nowMs) => {
|
|
450
|
+
this.lastHeartbeatSentAtMs = nowMs;
|
|
451
|
+
},
|
|
452
|
+
markPendingHeartbeat: (nowMs) => {
|
|
453
|
+
this.pendingHeartbeatSinceMs = nowMs;
|
|
454
|
+
},
|
|
455
|
+
closeSocketForRecovery: (reason) => this.closeSocketForRecovery(reason),
|
|
456
|
+
});
|
|
631
457
|
}
|
|
632
458
|
|
|
633
459
|
/**
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QQ Gateway WebSocket 连接事件绑定。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 只负责创建 WebSocket、绑定 open/message/close/error 事件。
|
|
6
|
+
* - runtime 状态仍由 `QQGatewayClient` 持有,避免连接 helper 变成第二个状态源。
|
|
7
|
+
* - message 解析与原始事件捕获在这里完成,业务 payload 交回 client 编排。
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import WebSocket, { type RawData } from "ws";
|
|
11
|
+
import type { Logger } from "@/utils/logger/Logger.js";
|
|
12
|
+
import type {
|
|
13
|
+
QQEventCaptureConfig,
|
|
14
|
+
QQGatewayPayload,
|
|
15
|
+
} from "@/service/builtins/chat/channels/qq/types/QqChannel.js";
|
|
16
|
+
import { captureQqWsPayload } from "./QQEventCapture.js";
|
|
17
|
+
import { parseQqGatewayPayload } from "./QQGatewaySupport.js";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* QQ Gateway WebSocket 连接参数。
|
|
21
|
+
*/
|
|
22
|
+
export interface ConnectQqGatewayWebSocketParams {
|
|
23
|
+
/**
|
|
24
|
+
* Gateway WebSocket URL。
|
|
25
|
+
*/
|
|
26
|
+
gatewayUrl: string;
|
|
27
|
+
/**
|
|
28
|
+
* 日志器。
|
|
29
|
+
*/
|
|
30
|
+
logger: Logger;
|
|
31
|
+
/**
|
|
32
|
+
* 原始事件捕获配置。
|
|
33
|
+
*/
|
|
34
|
+
captureConfig: QQEventCaptureConfig;
|
|
35
|
+
/**
|
|
36
|
+
* 当前 WebSocket。
|
|
37
|
+
*/
|
|
38
|
+
getCurrentSocket(): WebSocket | null;
|
|
39
|
+
/**
|
|
40
|
+
* 更新当前 WebSocket。
|
|
41
|
+
*/
|
|
42
|
+
setCurrentSocket(ws: WebSocket | null): void;
|
|
43
|
+
/**
|
|
44
|
+
* 重置连接活性状态。
|
|
45
|
+
*/
|
|
46
|
+
resetLivenessState(): void;
|
|
47
|
+
/**
|
|
48
|
+
* 停止心跳。
|
|
49
|
+
*/
|
|
50
|
+
stopHeartbeat(): void;
|
|
51
|
+
/**
|
|
52
|
+
* 清理重连 timer。
|
|
53
|
+
*/
|
|
54
|
+
clearReconnectTimer(): void;
|
|
55
|
+
/**
|
|
56
|
+
* 重置重连次数。
|
|
57
|
+
*/
|
|
58
|
+
resetReconnectAttempts(): void;
|
|
59
|
+
/**
|
|
60
|
+
* 计划重连。
|
|
61
|
+
*/
|
|
62
|
+
scheduleReconnect(reason: string, delayMs?: number): void;
|
|
63
|
+
/**
|
|
64
|
+
* 处理已解析的 Gateway payload。
|
|
65
|
+
*/
|
|
66
|
+
handlePayload(payload: QQGatewayPayload): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 建立 QQ Gateway WebSocket。
|
|
71
|
+
*/
|
|
72
|
+
export async function connectQqGatewayWebSocket(
|
|
73
|
+
params: ConnectQqGatewayWebSocketParams,
|
|
74
|
+
): Promise<void> {
|
|
75
|
+
params.logger.info(`正在连接 WebSocket: ${params.gatewayUrl}`);
|
|
76
|
+
closePreviousSocket(params.getCurrentSocket());
|
|
77
|
+
params.stopHeartbeat();
|
|
78
|
+
params.resetLivenessState();
|
|
79
|
+
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
let settled = false;
|
|
82
|
+
const resolveOnce = () => {
|
|
83
|
+
if (settled) return;
|
|
84
|
+
settled = true;
|
|
85
|
+
resolve();
|
|
86
|
+
};
|
|
87
|
+
const rejectOnce = (error: Error) => {
|
|
88
|
+
if (settled) return;
|
|
89
|
+
settled = true;
|
|
90
|
+
reject(error);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const ws = new WebSocket(params.gatewayUrl);
|
|
94
|
+
params.setCurrentSocket(ws);
|
|
95
|
+
|
|
96
|
+
ws.on("open", () => {
|
|
97
|
+
if (params.getCurrentSocket() !== ws) return;
|
|
98
|
+
params.logger.info("WebSocket 连接已建立");
|
|
99
|
+
params.resetReconnectAttempts();
|
|
100
|
+
params.clearReconnectTimer();
|
|
101
|
+
params.resetLivenessState();
|
|
102
|
+
resolveOnce();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
ws.on("message", async (data: RawData) => {
|
|
106
|
+
if (params.getCurrentSocket() !== ws) return;
|
|
107
|
+
await handleSocketMessage(params, data);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
ws.on("close", (code: number, reason: Buffer) => {
|
|
111
|
+
if (params.getCurrentSocket() !== ws) return;
|
|
112
|
+
const reasonText = Buffer.isBuffer(reason)
|
|
113
|
+
? reason.toString("utf-8")
|
|
114
|
+
: String(reason || "");
|
|
115
|
+
params.logger.warn(`WebSocket 连接关闭: ${code} - ${reasonText}`);
|
|
116
|
+
params.setCurrentSocket(null);
|
|
117
|
+
params.stopHeartbeat();
|
|
118
|
+
params.resetLivenessState();
|
|
119
|
+
params.scheduleReconnect(`ws_closed:${code}`);
|
|
120
|
+
rejectOnce(new Error(`QQ websocket closed before ready: ${code} ${reasonText}`));
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
ws.on("error", (error: Error) => {
|
|
124
|
+
if (params.getCurrentSocket() !== ws) return;
|
|
125
|
+
params.logger.error("WebSocket 错误", { error: String(error) });
|
|
126
|
+
rejectOnce(error);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 关闭旧 socket。
|
|
133
|
+
*/
|
|
134
|
+
function closePreviousSocket(previousWs: WebSocket | null): void {
|
|
135
|
+
if (
|
|
136
|
+
previousWs &&
|
|
137
|
+
(previousWs.readyState === WebSocket.OPEN ||
|
|
138
|
+
previousWs.readyState === WebSocket.CONNECTING)
|
|
139
|
+
) {
|
|
140
|
+
try {
|
|
141
|
+
previousWs.close();
|
|
142
|
+
} catch {
|
|
143
|
+
// 关键点(中文):旧连接关闭失败不影响新连接建立。
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 解析、捕获并分发一条 socket message。
|
|
150
|
+
*/
|
|
151
|
+
async function handleSocketMessage(
|
|
152
|
+
params: ConnectQqGatewayWebSocketParams,
|
|
153
|
+
data: RawData,
|
|
154
|
+
): Promise<void> {
|
|
155
|
+
try {
|
|
156
|
+
const payload = parseQqGatewayPayload(data);
|
|
157
|
+
if (!payload) {
|
|
158
|
+
params.logger.warn("收到无法解析的 QQ WebSocket 消息,已忽略");
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
params.logger.debug(
|
|
162
|
+
`收到 WebSocket 消息: op=${payload.op}, t=${payload.t || "N/A"}`,
|
|
163
|
+
);
|
|
164
|
+
await captureQqWsPayload({
|
|
165
|
+
config: params.captureConfig,
|
|
166
|
+
logger: params.logger,
|
|
167
|
+
payload,
|
|
168
|
+
});
|
|
169
|
+
await params.handlePayload(payload);
|
|
170
|
+
} catch (error) {
|
|
171
|
+
params.logger.error("处理 WebSocket 消息失败", {
|
|
172
|
+
error: String(error),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QQ Gateway 心跳发送辅助。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 只负责心跳 interval 归一化与单次 heartbeat payload 发送。
|
|
6
|
+
* - 心跳状态仍由 `QQGatewayClient` 持有,避免 helper 内部隐藏状态。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import WebSocket from "ws";
|
|
10
|
+
import type { Logger } from "@/utils/logger/Logger.js";
|
|
11
|
+
import { OpCode } from "@/service/builtins/chat/channels/qq/types/QqChannel.js";
|
|
12
|
+
import {
|
|
13
|
+
getQqHeartbeatAckTimeoutMs,
|
|
14
|
+
hasQqHeartbeatTimeout,
|
|
15
|
+
} from "./QQGatewaySupport.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* QQ Gateway heartbeat 发送参数。
|
|
19
|
+
*/
|
|
20
|
+
export interface SendQqGatewayHeartbeatParams {
|
|
21
|
+
/**
|
|
22
|
+
* 当前 socket。
|
|
23
|
+
*/
|
|
24
|
+
socket: WebSocket | null;
|
|
25
|
+
/**
|
|
26
|
+
* 日志器。
|
|
27
|
+
*/
|
|
28
|
+
logger: Logger;
|
|
29
|
+
/**
|
|
30
|
+
* 最近一次服务端序列号。
|
|
31
|
+
*/
|
|
32
|
+
lastSeq: number;
|
|
33
|
+
/**
|
|
34
|
+
* 心跳间隔。
|
|
35
|
+
*/
|
|
36
|
+
heartbeatIntervalMs: number;
|
|
37
|
+
/**
|
|
38
|
+
* WebSocket READY 时间。
|
|
39
|
+
*/
|
|
40
|
+
wsReadyAtMs: number;
|
|
41
|
+
/**
|
|
42
|
+
* 待 ACK 心跳开始时间。
|
|
43
|
+
*/
|
|
44
|
+
pendingHeartbeatSinceMs: number;
|
|
45
|
+
/**
|
|
46
|
+
* 标记心跳发送成功。
|
|
47
|
+
*/
|
|
48
|
+
markHeartbeatSent(nowMs: number): void;
|
|
49
|
+
/**
|
|
50
|
+
* 标记待 ACK 心跳开始时间。
|
|
51
|
+
*/
|
|
52
|
+
markPendingHeartbeat(nowMs: number): void;
|
|
53
|
+
/**
|
|
54
|
+
* 触发 socket 自愈关闭。
|
|
55
|
+
*/
|
|
56
|
+
closeSocketForRecovery(reason: string): void;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 归一化心跳间隔。
|
|
61
|
+
*/
|
|
62
|
+
export function normalizeQqHeartbeatIntervalMs(intervalMs: number): number {
|
|
63
|
+
return Number.isFinite(intervalMs) && intervalMs > 0
|
|
64
|
+
? Math.trunc(intervalMs)
|
|
65
|
+
: 30000;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 发送单次 QQ Gateway heartbeat。
|
|
70
|
+
*/
|
|
71
|
+
export function sendQqGatewayHeartbeat(
|
|
72
|
+
params: SendQqGatewayHeartbeatParams,
|
|
73
|
+
): void {
|
|
74
|
+
const ws = params.socket;
|
|
75
|
+
if (!ws || ws.readyState !== WebSocket.OPEN) return;
|
|
76
|
+
const now = Date.now();
|
|
77
|
+
if (
|
|
78
|
+
hasQqHeartbeatTimeout(
|
|
79
|
+
{
|
|
80
|
+
heartbeatIntervalMs: params.heartbeatIntervalMs,
|
|
81
|
+
pendingHeartbeatSinceMs: params.pendingHeartbeatSinceMs,
|
|
82
|
+
wsReadyAtMs: params.wsReadyAtMs,
|
|
83
|
+
},
|
|
84
|
+
now,
|
|
85
|
+
)
|
|
86
|
+
) {
|
|
87
|
+
params.logger.warn("QQ 心跳 ACK 超时,准备重连", {
|
|
88
|
+
pendingHeartbeatSinceMs: params.pendingHeartbeatSinceMs,
|
|
89
|
+
heartbeatAckTimeoutMs: getQqHeartbeatAckTimeoutMs(
|
|
90
|
+
params.heartbeatIntervalMs,
|
|
91
|
+
),
|
|
92
|
+
});
|
|
93
|
+
params.closeSocketForRecovery("heartbeat_ack_timeout");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const heartbeatPayload = {
|
|
98
|
+
op: OpCode.Heartbeat,
|
|
99
|
+
d: params.lastSeq || null,
|
|
100
|
+
};
|
|
101
|
+
try {
|
|
102
|
+
ws.send(JSON.stringify(heartbeatPayload));
|
|
103
|
+
params.markHeartbeatSent(now);
|
|
104
|
+
if (!params.pendingHeartbeatSinceMs) {
|
|
105
|
+
params.markPendingHeartbeat(now);
|
|
106
|
+
}
|
|
107
|
+
params.logger.debug("发送心跳");
|
|
108
|
+
} catch (error) {
|
|
109
|
+
params.logger.warn("发送 QQ 心跳失败,准备重连", {
|
|
110
|
+
error: String(error),
|
|
111
|
+
});
|
|
112
|
+
params.closeSocketForRecovery("heartbeat_send_failed");
|
|
113
|
+
}
|
|
114
|
+
}
|