@downcity/city 1.1.4 → 1.1.5
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 +245 -0
- package/bin/cli/Index.js +12 -12
- package/bin/cli/Index.js.map +1 -1
- package/bin/cli/agent/AgentChat.d.ts +22 -0
- package/bin/cli/agent/AgentChat.d.ts.map +1 -0
- package/bin/cli/agent/AgentChat.js +357 -0
- package/bin/cli/agent/AgentChat.js.map +1 -0
- package/bin/cli/agent/AgentChatTypes.d.ts +87 -0
- package/bin/cli/agent/AgentChatTypes.d.ts.map +1 -0
- package/bin/cli/agent/AgentChatTypes.js +12 -0
- package/bin/cli/agent/AgentChatTypes.js.map +1 -0
- package/bin/cli/agent/AgentHistory.d.ts +14 -0
- package/bin/cli/agent/AgentHistory.d.ts.map +1 -0
- package/bin/cli/agent/AgentHistory.js +157 -0
- package/bin/cli/agent/AgentHistory.js.map +1 -0
- package/bin/cli/agent/AgentHistoryTypes.d.ts +36 -0
- package/bin/cli/agent/AgentHistoryTypes.d.ts.map +1 -0
- package/bin/cli/agent/AgentHistoryTypes.js +9 -0
- package/bin/cli/agent/AgentHistoryTypes.js.map +1 -0
- package/bin/cli/agent/AgentManager.d.ts.map +1 -0
- package/bin/cli/agent/AgentManager.js +602 -0
- package/bin/cli/agent/AgentManager.js.map +1 -0
- package/bin/cli/agent/AgentManagerTypes.d.ts +13 -0
- package/bin/cli/agent/AgentManagerTypes.d.ts.map +1 -0
- package/bin/cli/agent/AgentManagerTypes.js +5 -0
- package/bin/cli/agent/AgentManagerTypes.js.map +1 -0
- package/bin/cli/agent/AgentReset.d.ts +13 -0
- package/bin/cli/agent/AgentReset.d.ts.map +1 -0
- package/bin/cli/agent/AgentReset.js +167 -0
- package/bin/cli/agent/AgentReset.js.map +1 -0
- package/bin/cli/agent/AgentSelection.d.ts +43 -0
- package/bin/cli/agent/AgentSelection.d.ts.map +1 -0
- package/bin/cli/agent/AgentSelection.js +243 -0
- package/bin/cli/agent/AgentSelection.js.map +1 -0
- package/bin/cli/agent/AgentSelectionTypes.d.ts +30 -0
- package/bin/cli/agent/AgentSelectionTypes.d.ts.map +1 -0
- package/bin/cli/agent/AgentSelectionTypes.js +5 -0
- package/bin/cli/agent/AgentSelectionTypes.js.map +1 -0
- package/bin/cli/agent/Init.d.ts.map +1 -0
- package/bin/cli/agent/Init.js +252 -0
- package/bin/cli/agent/Init.js.map +1 -0
- package/bin/cli/agent/Restart.d.ts +19 -0
- package/bin/cli/agent/Restart.d.ts.map +1 -0
- package/bin/cli/agent/Restart.js +60 -0
- package/bin/cli/agent/Restart.js.map +1 -0
- package/bin/cli/agent/Run.d.ts +24 -0
- package/bin/cli/agent/Run.d.ts.map +1 -0
- package/bin/cli/agent/Run.js +119 -0
- package/bin/cli/agent/Run.js.map +1 -0
- package/bin/cli/agent/Start.d.ts +23 -0
- package/bin/cli/agent/Start.d.ts.map +1 -0
- package/bin/cli/agent/Start.js +63 -0
- package/bin/cli/agent/Start.js.map +1 -0
- package/bin/cli/agent/Status.d.ts.map +1 -0
- package/bin/cli/agent/Status.js +103 -0
- package/bin/cli/agent/Status.js.map +1 -0
- package/bin/cli/agent/Stop.d.ts.map +1 -0
- package/bin/cli/agent/Stop.js +44 -0
- package/bin/cli/agent/Stop.js.map +1 -0
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.d.ts +25 -0
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.d.ts.map +1 -0
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.js +56 -0
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.js.map +1 -0
- package/bin/cli/control-plane/ControlPlaneCommand.d.ts +29 -0
- package/bin/cli/control-plane/ControlPlaneCommand.d.ts.map +1 -0
- package/bin/cli/control-plane/ControlPlaneCommand.js +152 -0
- package/bin/cli/control-plane/ControlPlaneCommand.js.map +1 -0
- package/bin/cli/control-plane/ControlPlaneInit.d.ts +17 -0
- package/bin/cli/control-plane/ControlPlaneInit.d.ts.map +1 -0
- package/bin/cli/control-plane/ControlPlaneInit.js +76 -0
- package/bin/cli/control-plane/ControlPlaneInit.js.map +1 -0
- package/bin/cli/control-plane/ControlPlaneProcess.d.ts +61 -0
- package/bin/cli/control-plane/ControlPlaneProcess.d.ts.map +1 -0
- package/bin/cli/control-plane/ControlPlaneProcess.js +395 -0
- package/bin/cli/control-plane/ControlPlaneProcess.js.map +1 -0
- package/bin/cli/control-plane/ControlPlaneRuntime.d.ts +98 -0
- package/bin/cli/control-plane/ControlPlaneRuntime.d.ts.map +1 -0
- package/bin/cli/control-plane/ControlPlaneRuntime.js +515 -0
- package/bin/cli/control-plane/ControlPlaneRuntime.js.map +1 -0
- package/bin/cli/control-plane/ControlPlaneStatus.d.ts +27 -0
- package/bin/cli/control-plane/ControlPlaneStatus.d.ts.map +1 -0
- package/bin/cli/control-plane/ControlPlaneStatus.js +135 -0
- package/bin/cli/control-plane/ControlPlaneStatus.js.map +1 -0
- package/bin/cli/model/Model.d.ts.map +1 -0
- package/bin/cli/model/Model.js.map +1 -0
- package/bin/cli/model/ModelCommandShared.d.ts +28 -0
- package/bin/cli/model/ModelCommandShared.d.ts.map +1 -0
- package/bin/cli/model/ModelCommandShared.js +109 -0
- package/bin/cli/model/ModelCommandShared.js.map +1 -0
- package/bin/cli/model/ModelCreateCommand.d.ts.map +1 -0
- package/bin/cli/model/ModelCreateCommand.js +367 -0
- package/bin/cli/model/ModelCreateCommand.js.map +1 -0
- package/bin/cli/model/ModelManageCommand.d.ts.map +1 -0
- package/bin/cli/model/ModelManageCommand.js.map +1 -0
- package/bin/cli/model/ModelManager.d.ts.map +1 -0
- package/bin/cli/model/ModelManager.js +588 -0
- package/bin/cli/model/ModelManager.js.map +1 -0
- package/bin/cli/model/ModelManagerTypes.d.ts +21 -0
- package/bin/cli/model/ModelManagerTypes.d.ts.map +1 -0
- package/bin/cli/model/ModelManagerTypes.js +5 -0
- package/bin/cli/model/ModelManagerTypes.js.map +1 -0
- package/bin/cli/model/ModelReadCommand.d.ts +13 -0
- package/bin/cli/model/ModelReadCommand.d.ts.map +1 -0
- package/bin/cli/model/ModelReadCommand.js +198 -0
- package/bin/cli/model/ModelReadCommand.js.map +1 -0
- package/bin/cli/model/ModelSupport.d.ts +40 -0
- package/bin/cli/model/ModelSupport.d.ts.map +1 -0
- package/bin/cli/model/ModelSupport.js +201 -0
- package/bin/cli/model/ModelSupport.js.map +1 -0
- package/bin/cli/model/preset/ModelPresetManager.d.ts +71 -0
- package/bin/cli/model/preset/ModelPresetManager.d.ts.map +1 -0
- package/bin/cli/model/preset/ModelPresetManager.js +187 -0
- package/bin/cli/model/preset/ModelPresetManager.js.map +1 -0
- package/bin/cli/service/ServiceActionCommands.d.ts.map +1 -0
- package/bin/cli/service/ServiceActionCommands.js +343 -0
- package/bin/cli/service/ServiceActionCommands.js.map +1 -0
- package/bin/cli/service/ServiceCommandRemote.d.ts +30 -0
- package/bin/cli/service/ServiceCommandRemote.d.ts.map +1 -0
- package/bin/cli/service/ServiceCommandRemote.js +200 -0
- package/bin/cli/service/ServiceCommandRemote.js.map +1 -0
- package/bin/cli/service/ServiceCommandSupport.d.ts +82 -0
- package/bin/cli/service/ServiceCommandSupport.d.ts.map +1 -0
- package/bin/cli/service/ServiceCommandSupport.js +224 -0
- package/bin/cli/service/ServiceCommandSupport.js.map +1 -0
- package/bin/cli/service/ServiceScheduleCommand.d.ts +36 -0
- package/bin/cli/service/ServiceScheduleCommand.d.ts.map +1 -0
- package/bin/cli/service/ServiceScheduleCommand.js +271 -0
- package/bin/cli/service/ServiceScheduleCommand.js.map +1 -0
- package/bin/cli/service/Services.d.ts.map +1 -0
- package/bin/cli/service/Services.js +154 -0
- package/bin/cli/service/Services.js.map +1 -0
- package/bin/cli/shared/Alias.d.ts.map +1 -0
- package/bin/cli/shared/Alias.js.map +1 -0
- package/bin/cli/shared/Chat.d.ts.map +1 -0
- package/bin/cli/shared/Chat.js.map +1 -0
- package/bin/cli/shared/ChatAuth.d.ts.map +1 -0
- package/bin/cli/shared/ChatAuth.js +151 -0
- package/bin/cli/shared/ChatAuth.js.map +1 -0
- package/bin/cli/shared/ChatManager.d.ts.map +1 -0
- package/bin/cli/shared/ChatManager.js +383 -0
- package/bin/cli/shared/ChatManager.js.map +1 -0
- package/bin/cli/shared/ChatManagerTypes.d.ts +6 -0
- package/bin/cli/shared/ChatManagerTypes.d.ts.map +1 -0
- package/bin/cli/shared/ChatManagerTypes.js +5 -0
- package/bin/cli/shared/ChatManagerTypes.js.map +1 -0
- package/bin/cli/shared/CliError.d.ts.map +1 -0
- package/bin/cli/shared/CliError.js.map +1 -0
- package/bin/cli/shared/CliReporter.d.ts +50 -0
- package/bin/cli/shared/CliReporter.d.ts.map +1 -0
- package/bin/cli/shared/CliReporter.js.map +1 -0
- package/bin/cli/shared/CliReporterTypes.d.ts +157 -0
- package/bin/cli/shared/CliReporterTypes.d.ts.map +1 -0
- package/bin/cli/shared/CliReporterTypes.js +10 -0
- package/bin/cli/shared/CliReporterTypes.js.map +1 -0
- package/bin/cli/shared/Config.d.ts.map +1 -0
- package/bin/cli/shared/Config.js +239 -0
- package/bin/cli/shared/Config.js.map +1 -0
- package/bin/cli/shared/Env.d.ts +14 -0
- package/bin/cli/shared/Env.d.ts.map +1 -0
- package/bin/cli/shared/Env.js +419 -0
- package/bin/cli/shared/Env.js.map +1 -0
- package/bin/cli/shared/IndexAgentCommand.d.ts.map +1 -0
- package/bin/cli/shared/IndexAgentCommand.js +218 -0
- package/bin/cli/shared/IndexAgentCommand.js.map +1 -0
- package/bin/cli/shared/IndexSupport.d.ts.map +1 -0
- package/bin/cli/shared/IndexSupport.js +123 -0
- package/bin/cli/shared/IndexSupport.js.map +1 -0
- package/bin/cli/shared/Plugins.d.ts.map +1 -0
- package/bin/cli/shared/Plugins.js +472 -0
- package/bin/cli/shared/Plugins.js.map +1 -0
- package/bin/cli/shared/PortHints.d.ts +35 -0
- package/bin/cli/shared/PortHints.d.ts.map +1 -0
- package/bin/cli/shared/PortHints.js +58 -0
- package/bin/cli/shared/PortHints.js.map +1 -0
- package/bin/cli/shared/PublicAccess.d.ts +24 -0
- package/bin/cli/shared/PublicAccess.d.ts.map +1 -0
- package/bin/cli/shared/PublicAccess.js +100 -0
- package/bin/cli/shared/PublicAccess.js.map +1 -0
- package/bin/cli/shared/PublicHostEnv.d.ts +14 -0
- package/bin/cli/shared/PublicHostEnv.d.ts.map +1 -0
- package/bin/cli/shared/PublicHostEnv.js +104 -0
- package/bin/cli/shared/PublicHostEnv.js.map +1 -0
- package/bin/cli/shared/PublicHostEnvTypes.d.ts +23 -0
- package/bin/cli/shared/PublicHostEnvTypes.d.ts.map +1 -0
- package/bin/cli/shared/PublicHostEnvTypes.js +5 -0
- package/bin/cli/shared/PublicHostEnvTypes.js.map +1 -0
- package/bin/cli/shared/Reset.d.ts.map +1 -0
- package/bin/cli/shared/Reset.js.map +1 -0
- package/bin/cli/shared/Token.d.ts.map +1 -0
- package/bin/cli/shared/Token.js +638 -0
- package/bin/cli/shared/Token.js.map +1 -0
- package/bin/cli/shared/Update.d.ts.map +1 -0
- package/bin/cli/shared/Update.js +150 -0
- package/bin/cli/shared/Update.js.map +1 -0
- package/bin/config/DowncitySchema.d.ts +3 -0
- package/bin/config/DowncitySchema.d.ts.map +1 -0
- package/bin/config/DowncitySchema.js +367 -0
- package/bin/config/DowncitySchema.js.map +1 -0
- package/bin/control/AgentStatusApiRoutes.d.ts +28 -0
- package/bin/control/AgentStatusApiRoutes.d.ts.map +1 -0
- package/bin/control/AgentStatusApiRoutes.js +165 -0
- package/bin/control/AgentStatusApiRoutes.js.map +1 -0
- package/bin/control/ChannelAccountApiRoutes.d.ts +15 -0
- package/bin/control/ChannelAccountApiRoutes.d.ts.map +1 -0
- package/bin/control/ChannelAccountApiRoutes.js +93 -0
- package/bin/control/ChannelAccountApiRoutes.js.map +1 -0
- package/bin/control/ControlGateway.d.ts +102 -0
- package/bin/control/ControlGateway.d.ts.map +1 -0
- package/bin/control/ControlGateway.js +283 -0
- package/bin/control/ControlGateway.js.map +1 -0
- package/bin/control/EnvApiRoutes.d.ts +18 -0
- package/bin/control/EnvApiRoutes.d.ts.map +1 -0
- package/bin/control/EnvApiRoutes.js +228 -0
- package/bin/control/EnvApiRoutes.js.map +1 -0
- package/bin/control/ModelApiRoutes.d.ts +35 -0
- package/bin/control/ModelApiRoutes.d.ts.map +1 -0
- package/bin/control/ModelApiRoutes.js +237 -0
- package/bin/control/ModelApiRoutes.js.map +1 -0
- package/bin/control/ModelPoolService.d.ts +126 -0
- package/bin/control/ModelPoolService.d.ts.map +1 -0
- package/bin/control/ModelPoolService.js +327 -0
- package/bin/control/ModelPoolService.js.map +1 -0
- package/bin/control/PlatformApiRoutes.d.ts +133 -0
- package/bin/control/PlatformApiRoutes.d.ts.map +1 -0
- package/bin/control/PlatformApiRoutes.js +292 -0
- package/bin/control/PlatformApiRoutes.js.map +1 -0
- package/bin/control/PluginApiRoutes.d.ts +28 -0
- package/bin/control/PluginApiRoutes.d.ts.map +1 -0
- package/bin/control/PluginApiRoutes.js +282 -0
- package/bin/control/PluginApiRoutes.js.map +1 -0
- package/bin/control/gateway/AgentActions.d.ts +107 -0
- package/bin/control/gateway/AgentActions.d.ts.map +1 -0
- package/bin/control/gateway/AgentActions.js +314 -0
- package/bin/control/gateway/AgentActions.js.map +1 -0
- package/bin/control/gateway/AgentCatalog.d.ts +83 -0
- package/bin/control/gateway/AgentCatalog.d.ts.map +1 -0
- package/bin/control/gateway/AgentCatalog.js +484 -0
- package/bin/control/gateway/AgentCatalog.js.map +1 -0
- package/bin/control/gateway/FrontendAssets.d.ts +21 -0
- package/bin/control/gateway/FrontendAssets.d.ts.map +1 -0
- package/bin/control/gateway/FrontendAssets.js +77 -0
- package/bin/control/gateway/FrontendAssets.js.map +1 -0
- package/bin/control/gateway/GatewaySupport.d.ts +34 -0
- package/bin/control/gateway/GatewaySupport.d.ts.map +1 -0
- package/bin/control/gateway/GatewaySupport.js +32 -0
- package/bin/control/gateway/GatewaySupport.js.map +1 -0
- package/bin/control/gateway/Proxy.d.ts +16 -0
- package/bin/control/gateway/Proxy.d.ts.map +1 -0
- package/bin/control/gateway/Proxy.js +47 -0
- package/bin/control/gateway/Proxy.js.map +1 -0
- package/bin/control/instant/InstantApiRoutes.d.ts +19 -0
- package/bin/control/instant/InstantApiRoutes.d.ts.map +1 -0
- package/bin/control/instant/InstantApiRoutes.js +58 -0
- package/bin/control/instant/InstantApiRoutes.js.map +1 -0
- package/bin/control/instant/InstantSessionService.d.ts +36 -0
- package/bin/control/instant/InstantSessionService.d.ts.map +1 -0
- package/bin/control/instant/InstantSessionService.js +183 -0
- package/bin/control/instant/InstantSessionService.js.map +1 -0
- package/bin/control/instant/InstantSystemComposer.d.ts +34 -0
- package/bin/control/instant/InstantSystemComposer.d.ts.map +1 -0
- package/bin/control/instant/InstantSystemComposer.js +38 -0
- package/bin/control/instant/InstantSystemComposer.js.map +1 -0
- package/bin/http/auth/AuthMiddleware.d.ts +1 -1
- package/bin/http/auth/AuthMiddleware.d.ts.map +1 -1
- package/bin/http/auth/AuthService.d.ts +2 -2
- package/bin/http/auth/AuthService.d.ts.map +1 -1
- package/bin/http/auth/AuthService.js +1 -1
- package/bin/http/auth/AuthService.js.map +1 -1
- package/bin/http/auth/AuthStore.d.ts +4 -4
- package/bin/http/auth/AuthStore.d.ts.map +1 -1
- package/bin/http/auth/AuthStore.js +7 -7
- package/bin/http/auth/AuthStore.js.map +1 -1
- package/bin/http/auth/RoutePolicy.d.ts +3 -3
- package/bin/http/auth/RoutePolicy.d.ts.map +1 -1
- package/bin/http/auth/RoutePolicy.js +6 -6
- package/bin/http/auth/RoutePolicy.js.map +1 -1
- package/bin/process/daemon/Api.d.ts +60 -0
- package/bin/process/daemon/Api.d.ts.map +1 -0
- package/bin/process/daemon/Api.js.map +1 -0
- package/bin/process/daemon/CliArgs.d.ts +17 -0
- package/bin/process/daemon/CliArgs.d.ts.map +1 -0
- package/bin/process/daemon/CliArgs.js +30 -0
- package/bin/process/daemon/CliArgs.js.map +1 -0
- package/bin/process/daemon/Client.d.ts.map +1 -0
- package/bin/process/daemon/Client.js +158 -0
- package/bin/process/daemon/Client.js.map +1 -0
- package/bin/process/daemon/Manager.d.ts +92 -0
- package/bin/process/daemon/Manager.d.ts.map +1 -0
- package/bin/process/daemon/Manager.js +287 -0
- package/bin/process/daemon/Manager.js.map +1 -0
- package/bin/process/daemon/PortAllocator.d.ts.map +1 -0
- package/bin/process/daemon/PortAllocator.js.map +1 -0
- package/bin/process/registry/AgentHostRuntime.d.ts +10 -0
- package/bin/process/registry/AgentHostRuntime.d.ts.map +1 -0
- package/bin/process/registry/AgentHostRuntime.js +47 -0
- package/bin/process/registry/AgentHostRuntime.js.map +1 -0
- package/bin/process/registry/CityPaths.d.ts +53 -0
- package/bin/process/registry/CityPaths.d.ts.map +1 -0
- package/bin/process/registry/CityPaths.js +78 -0
- package/bin/process/registry/CityPaths.js.map +1 -0
- package/bin/process/registry/CityRegistry.d.ts +51 -0
- package/bin/process/registry/CityRegistry.d.ts.map +1 -0
- package/bin/process/registry/CityRegistry.js +217 -0
- package/bin/process/registry/CityRegistry.js.map +1 -0
- package/bin/process/registry/CityRuntime.d.ts +21 -0
- package/bin/process/registry/CityRuntime.d.ts.map +1 -0
- package/bin/process/registry/CityRuntime.js +45 -0
- package/bin/process/registry/CityRuntime.js.map +1 -0
- package/bin/process/registry/PluginRuntime.d.ts +24 -0
- package/bin/process/registry/PluginRuntime.d.ts.map +1 -0
- package/bin/process/registry/PluginRuntime.js.map +1 -0
- package/bin/process/registry/ProcessSweep.d.ts +76 -0
- package/bin/process/registry/ProcessSweep.d.ts.map +1 -0
- package/bin/process/registry/ProcessSweep.js +202 -0
- package/bin/process/registry/ProcessSweep.js.map +1 -0
- package/bin/process/rpc/Client.d.ts +13 -0
- package/bin/process/rpc/Client.d.ts.map +1 -0
- package/bin/process/rpc/Client.js.map +1 -0
- package/bin/process/rpc/Paths.d.ts.map +1 -0
- package/bin/process/rpc/Paths.js +36 -0
- package/bin/process/rpc/Paths.js.map +1 -0
- package/bin/utils/cli/CliOutput.d.ts +1 -1
- package/bin/utils/cli/CliOutput.d.ts.map +1 -1
- package/bin/utils/cli/CliOutput.js +1 -1
- package/bin/utils/cli/CliOutput.js.map +1 -1
- package/bin/utils/storage.d.ts +1 -1
- package/bin/utils/storage.d.ts.map +1 -1
- package/package.json +2 -2
- package/scripts/lint-import-boundaries.mjs +17 -85
- package/src/cli/Index.ts +12 -12
- package/src/cli/agent/AgentChat.ts +415 -0
- package/src/cli/agent/AgentChatTypes.ts +92 -0
- package/src/cli/agent/AgentHistory.ts +187 -0
- package/src/cli/agent/AgentHistoryTypes.ts +39 -0
- package/src/cli/agent/AgentManager.ts +667 -0
- package/src/cli/agent/AgentManagerTypes.ts +29 -0
- package/src/cli/agent/AgentReset.ts +181 -0
- package/src/cli/agent/AgentSelection.ts +297 -0
- package/src/cli/agent/AgentSelectionTypes.ts +36 -0
- package/src/cli/agent/Init.ts +291 -0
- package/src/cli/agent/Restart.ts +68 -0
- package/src/cli/agent/Run.ts +148 -0
- package/src/cli/agent/Start.ts +72 -0
- package/src/cli/agent/Status.ts +116 -0
- package/src/cli/agent/Stop.ts +45 -0
- package/src/cli/control-plane/ControlPlaneAuthBootstrap.ts +72 -0
- package/src/cli/control-plane/ControlPlaneCommand.ts +216 -0
- package/src/cli/control-plane/ControlPlaneInit.ts +83 -0
- package/src/cli/control-plane/ControlPlaneProcess.ts +497 -0
- package/src/cli/control-plane/ControlPlaneRuntime.ts +611 -0
- package/src/cli/control-plane/ControlPlaneStatus.ts +152 -0
- package/src/cli/model/ModelCommandShared.ts +129 -0
- package/src/cli/model/ModelCreateCommand.ts +424 -0
- package/src/cli/model/ModelManageCommand.ts +516 -0
- package/src/cli/model/ModelManager.ts +631 -0
- package/src/cli/model/ModelManagerTypes.ts +37 -0
- package/src/cli/model/ModelReadCommand.ts +207 -0
- package/src/cli/model/ModelSupport.ts +223 -0
- package/src/cli/model/preset/ModelPresetManager.ts +242 -0
- package/src/cli/service/ServiceActionCommands.ts +416 -0
- package/src/cli/service/ServiceCommandRemote.ts +230 -0
- package/src/cli/service/ServiceCommandSupport.ts +275 -0
- package/src/cli/service/ServiceScheduleCommand.ts +305 -0
- package/src/cli/service/Services.ts +189 -0
- package/src/cli/shared/ChatAuth.ts +203 -0
- package/src/cli/shared/ChatManager.ts +441 -0
- package/src/cli/shared/ChatManagerTypes.ts +19 -0
- package/src/cli/shared/CliReporter.ts +362 -0
- package/src/cli/shared/CliReporterTypes.ts +167 -0
- package/src/cli/shared/Config.ts +301 -0
- package/src/cli/shared/Env.ts +556 -0
- package/src/cli/shared/IndexAgentCommand.ts +302 -0
- package/src/cli/shared/IndexSupport.ts +138 -0
- package/src/cli/shared/Plugins.ts +567 -0
- package/src/cli/shared/PortHints.ts +80 -0
- package/src/cli/shared/PublicAccess.ts +106 -0
- package/src/cli/shared/PublicHostEnv.ts +116 -0
- package/src/cli/shared/PublicHostEnvTypes.ts +27 -0
- package/src/cli/shared/Token.ts +702 -0
- package/src/cli/shared/Update.ts +183 -0
- package/src/config/DowncitySchema.ts +377 -0
- package/src/control/AgentStatusApiRoutes.ts +225 -0
- package/src/control/ChannelAccountApiRoutes.ts +119 -0
- package/src/control/ControlGateway.ts +463 -0
- package/src/control/EnvApiRoutes.ts +257 -0
- package/src/control/ModelApiRoutes.ts +336 -0
- package/src/control/ModelPoolService.ts +395 -0
- package/src/control/PlatformApiRoutes.ts +495 -0
- package/src/control/PluginApiRoutes.ts +439 -0
- package/src/control/gateway/AgentActions.ts +413 -0
- package/src/control/gateway/AgentCatalog.ts +611 -0
- package/src/control/gateway/FrontendAssets.ts +79 -0
- package/src/control/gateway/GatewaySupport.ts +59 -0
- package/src/control/gateway/Proxy.ts +62 -0
- package/src/control/instant/InstantApiRoutes.ts +74 -0
- package/src/control/instant/InstantSessionService.ts +278 -0
- package/src/control/instant/InstantSystemComposer.ts +60 -0
- package/src/http/auth/AuthMiddleware.ts +1 -1
- package/src/http/auth/AuthService.ts +3 -3
- package/src/http/auth/AuthStore.ts +11 -11
- package/src/http/auth/RoutePolicy.ts +8 -8
- package/src/process/daemon/Api.ts +64 -0
- package/src/process/daemon/CliArgs.ts +39 -0
- package/src/process/daemon/Client.ts +182 -0
- package/src/process/daemon/Manager.ts +344 -0
- package/src/process/registry/AgentHostRuntime.ts +65 -0
- package/src/process/registry/CityPaths.ts +87 -0
- package/src/process/registry/CityRegistry.ts +256 -0
- package/src/process/registry/CityRuntime.ts +45 -0
- package/src/process/registry/PluginRuntime.ts +42 -0
- package/src/process/registry/ProcessSweep.ts +256 -0
- package/src/process/rpc/Client.ts +113 -0
- package/src/process/rpc/Paths.ts +43 -0
- package/src/utils/cli/CliOutput.ts +2 -2
- package/src/utils/storage.ts +1 -1
- package/tsconfig.json +3 -1
- package/bin/cli/AgentChat.d.ts +0 -22
- package/bin/cli/AgentChat.d.ts.map +0 -1
- package/bin/cli/AgentChat.js +0 -357
- package/bin/cli/AgentChat.js.map +0 -1
- package/bin/cli/AgentHistory.d.ts +0 -14
- package/bin/cli/AgentHistory.d.ts.map +0 -1
- package/bin/cli/AgentHistory.js +0 -157
- package/bin/cli/AgentHistory.js.map +0 -1
- package/bin/cli/AgentManager.d.ts.map +0 -1
- package/bin/cli/AgentManager.js +0 -602
- package/bin/cli/AgentManager.js.map +0 -1
- package/bin/cli/AgentReset.d.ts +0 -13
- package/bin/cli/AgentReset.d.ts.map +0 -1
- package/bin/cli/AgentReset.js +0 -167
- package/bin/cli/AgentReset.js.map +0 -1
- package/bin/cli/AgentSelection.d.ts +0 -43
- package/bin/cli/AgentSelection.d.ts.map +0 -1
- package/bin/cli/AgentSelection.js +0 -243
- package/bin/cli/AgentSelection.js.map +0 -1
- package/bin/cli/Alias.d.ts.map +0 -1
- package/bin/cli/Alias.js.map +0 -1
- package/bin/cli/Chat.d.ts.map +0 -1
- package/bin/cli/Chat.js.map +0 -1
- package/bin/cli/ChatAuth.d.ts.map +0 -1
- package/bin/cli/ChatAuth.js +0 -152
- package/bin/cli/ChatAuth.js.map +0 -1
- package/bin/cli/ChatManager.d.ts.map +0 -1
- package/bin/cli/ChatManager.js +0 -383
- package/bin/cli/ChatManager.js.map +0 -1
- package/bin/cli/CliReporter.d.ts +0 -50
- package/bin/cli/CliReporter.d.ts.map +0 -1
- package/bin/cli/CliReporter.js.map +0 -1
- package/bin/cli/Config.d.ts.map +0 -1
- package/bin/cli/Config.js +0 -239
- package/bin/cli/Config.js.map +0 -1
- package/bin/cli/Console.d.ts +0 -97
- package/bin/cli/Console.d.ts.map +0 -1
- package/bin/cli/Console.js +0 -514
- package/bin/cli/Console.js.map +0 -1
- package/bin/cli/ConsoleAuthBootstrap.d.ts +0 -25
- package/bin/cli/ConsoleAuthBootstrap.d.ts.map +0 -1
- package/bin/cli/ConsoleAuthBootstrap.js +0 -56
- package/bin/cli/ConsoleAuthBootstrap.js.map +0 -1
- package/bin/cli/ConsoleInit.d.ts +0 -17
- package/bin/cli/ConsoleInit.d.ts.map +0 -1
- package/bin/cli/ConsoleInit.js +0 -76
- package/bin/cli/ConsoleInit.js.map +0 -1
- package/bin/cli/Env.d.ts +0 -14
- package/bin/cli/Env.d.ts.map +0 -1
- package/bin/cli/Env.js +0 -419
- package/bin/cli/Env.js.map +0 -1
- package/bin/cli/IndexAgentCommand.d.ts.map +0 -1
- package/bin/cli/IndexAgentCommand.js +0 -218
- package/bin/cli/IndexAgentCommand.js.map +0 -1
- package/bin/cli/IndexConsoleCommand.d.ts +0 -24
- package/bin/cli/IndexConsoleCommand.d.ts.map +0 -1
- package/bin/cli/IndexConsoleCommand.js +0 -147
- package/bin/cli/IndexConsoleCommand.js.map +0 -1
- package/bin/cli/IndexConsoleProcess.d.ts +0 -61
- package/bin/cli/IndexConsoleProcess.d.ts.map +0 -1
- package/bin/cli/IndexConsoleProcess.js +0 -395
- package/bin/cli/IndexConsoleProcess.js.map +0 -1
- package/bin/cli/IndexConsoleStatus.d.ts +0 -27
- package/bin/cli/IndexConsoleStatus.d.ts.map +0 -1
- package/bin/cli/IndexConsoleStatus.js +0 -135
- package/bin/cli/IndexConsoleStatus.js.map +0 -1
- package/bin/cli/IndexSupport.d.ts.map +0 -1
- package/bin/cli/IndexSupport.js +0 -123
- package/bin/cli/IndexSupport.js.map +0 -1
- package/bin/cli/Init.d.ts.map +0 -1
- package/bin/cli/Init.js +0 -252
- package/bin/cli/Init.js.map +0 -1
- package/bin/cli/Model.d.ts.map +0 -1
- package/bin/cli/Model.js.map +0 -1
- package/bin/cli/ModelCommandShared.d.ts +0 -28
- package/bin/cli/ModelCommandShared.d.ts.map +0 -1
- package/bin/cli/ModelCommandShared.js +0 -109
- package/bin/cli/ModelCommandShared.js.map +0 -1
- package/bin/cli/ModelCreateCommand.d.ts.map +0 -1
- package/bin/cli/ModelCreateCommand.js +0 -367
- package/bin/cli/ModelCreateCommand.js.map +0 -1
- package/bin/cli/ModelManageCommand.d.ts.map +0 -1
- package/bin/cli/ModelManageCommand.js.map +0 -1
- package/bin/cli/ModelManager.d.ts.map +0 -1
- package/bin/cli/ModelManager.js +0 -588
- package/bin/cli/ModelManager.js.map +0 -1
- package/bin/cli/ModelReadCommand.d.ts +0 -13
- package/bin/cli/ModelReadCommand.d.ts.map +0 -1
- package/bin/cli/ModelReadCommand.js +0 -198
- package/bin/cli/ModelReadCommand.js.map +0 -1
- package/bin/cli/ModelSupport.d.ts +0 -40
- package/bin/cli/ModelSupport.d.ts.map +0 -1
- package/bin/cli/ModelSupport.js +0 -201
- package/bin/cli/ModelSupport.js.map +0 -1
- package/bin/cli/Plugins.d.ts.map +0 -1
- package/bin/cli/Plugins.js +0 -474
- package/bin/cli/Plugins.js.map +0 -1
- package/bin/cli/PortHints.d.ts +0 -35
- package/bin/cli/PortHints.d.ts.map +0 -1
- package/bin/cli/PortHints.js +0 -58
- package/bin/cli/PortHints.js.map +0 -1
- package/bin/cli/PublicAccess.d.ts +0 -24
- package/bin/cli/PublicAccess.d.ts.map +0 -1
- package/bin/cli/PublicAccess.js +0 -100
- package/bin/cli/PublicAccess.js.map +0 -1
- package/bin/cli/PublicHostEnv.d.ts +0 -14
- package/bin/cli/PublicHostEnv.d.ts.map +0 -1
- package/bin/cli/PublicHostEnv.js +0 -104
- package/bin/cli/PublicHostEnv.js.map +0 -1
- package/bin/cli/Reset.d.ts.map +0 -1
- package/bin/cli/Reset.js.map +0 -1
- package/bin/cli/Restart.d.ts +0 -19
- package/bin/cli/Restart.d.ts.map +0 -1
- package/bin/cli/Restart.js +0 -60
- package/bin/cli/Restart.js.map +0 -1
- package/bin/cli/Run.d.ts +0 -24
- package/bin/cli/Run.d.ts.map +0 -1
- package/bin/cli/Run.js +0 -119
- package/bin/cli/Run.js.map +0 -1
- package/bin/cli/ServiceActionCommands.d.ts.map +0 -1
- package/bin/cli/ServiceActionCommands.js +0 -345
- package/bin/cli/ServiceActionCommands.js.map +0 -1
- package/bin/cli/ServiceCommandRemote.d.ts +0 -30
- package/bin/cli/ServiceCommandRemote.d.ts.map +0 -1
- package/bin/cli/ServiceCommandRemote.js +0 -200
- package/bin/cli/ServiceCommandRemote.js.map +0 -1
- package/bin/cli/ServiceCommandSupport.d.ts +0 -82
- package/bin/cli/ServiceCommandSupport.d.ts.map +0 -1
- package/bin/cli/ServiceCommandSupport.js +0 -224
- package/bin/cli/ServiceCommandSupport.js.map +0 -1
- package/bin/cli/ServiceScheduleCommand.d.ts +0 -36
- package/bin/cli/ServiceScheduleCommand.d.ts.map +0 -1
- package/bin/cli/ServiceScheduleCommand.js +0 -271
- package/bin/cli/ServiceScheduleCommand.js.map +0 -1
- package/bin/cli/Services.d.ts.map +0 -1
- package/bin/cli/Services.js +0 -154
- package/bin/cli/Services.js.map +0 -1
- package/bin/cli/Start.d.ts +0 -23
- package/bin/cli/Start.d.ts.map +0 -1
- package/bin/cli/Start.js +0 -63
- package/bin/cli/Start.js.map +0 -1
- package/bin/cli/Status.d.ts.map +0 -1
- package/bin/cli/Status.js +0 -103
- package/bin/cli/Status.js.map +0 -1
- package/bin/cli/Stop.d.ts.map +0 -1
- package/bin/cli/Stop.js +0 -44
- package/bin/cli/Stop.js.map +0 -1
- package/bin/cli/Token.d.ts.map +0 -1
- package/bin/cli/Token.js +0 -638
- package/bin/cli/Token.js.map +0 -1
- package/bin/cli/Update.d.ts.map +0 -1
- package/bin/cli/Update.js +0 -150
- package/bin/cli/Update.js.map +0 -1
- package/bin/console/AgentStatusApiRoutes.d.ts +0 -28
- package/bin/console/AgentStatusApiRoutes.d.ts.map +0 -1
- package/bin/console/AgentStatusApiRoutes.js +0 -165
- package/bin/console/AgentStatusApiRoutes.js.map +0 -1
- package/bin/console/ChannelAccountApiRoutes.d.ts +0 -15
- package/bin/console/ChannelAccountApiRoutes.d.ts.map +0 -1
- package/bin/console/ChannelAccountApiRoutes.js +0 -93
- package/bin/console/ChannelAccountApiRoutes.js.map +0 -1
- package/bin/console/ConsoleClient.d.ts +0 -53
- package/bin/console/ConsoleClient.d.ts.map +0 -1
- package/bin/console/ConsoleClient.js +0 -258
- package/bin/console/ConsoleClient.js.map +0 -1
- package/bin/console/ConsoleGateway.d.ts +0 -102
- package/bin/console/ConsoleGateway.d.ts.map +0 -1
- package/bin/console/ConsoleGateway.js +0 -283
- package/bin/console/ConsoleGateway.js.map +0 -1
- package/bin/console/ConsoleGatewayRoutes.d.ts +0 -133
- package/bin/console/ConsoleGatewayRoutes.d.ts.map +0 -1
- package/bin/console/ConsoleGatewayRoutes.js +0 -292
- package/bin/console/ConsoleGatewayRoutes.js.map +0 -1
- package/bin/console/EnvApiRoutes.d.ts +0 -18
- package/bin/console/EnvApiRoutes.d.ts.map +0 -1
- package/bin/console/EnvApiRoutes.js +0 -228
- package/bin/console/EnvApiRoutes.js.map +0 -1
- package/bin/console/InlineInstantRoutes.d.ts +0 -19
- package/bin/console/InlineInstantRoutes.d.ts.map +0 -1
- package/bin/console/InlineInstantRoutes.js +0 -58
- package/bin/console/InlineInstantRoutes.js.map +0 -1
- package/bin/console/InlineInstantSessionService.d.ts +0 -36
- package/bin/console/InlineInstantSessionService.d.ts.map +0 -1
- package/bin/console/InlineInstantSessionService.js +0 -190
- package/bin/console/InlineInstantSessionService.js.map +0 -1
- package/bin/console/InlineInstantSystemComposer.d.ts +0 -34
- package/bin/console/InlineInstantSystemComposer.d.ts.map +0 -1
- package/bin/console/InlineInstantSystemComposer.js +0 -40
- package/bin/console/InlineInstantSystemComposer.js.map +0 -1
- package/bin/console/ModelApiRoutes.d.ts +0 -35
- package/bin/console/ModelApiRoutes.d.ts.map +0 -1
- package/bin/console/ModelApiRoutes.js +0 -237
- package/bin/console/ModelApiRoutes.js.map +0 -1
- package/bin/console/ModelPoolService.d.ts +0 -126
- package/bin/console/ModelPoolService.d.ts.map +0 -1
- package/bin/console/ModelPoolService.js +0 -327
- package/bin/console/ModelPoolService.js.map +0 -1
- package/bin/console/PluginApiRoutes.d.ts +0 -28
- package/bin/console/PluginApiRoutes.d.ts.map +0 -1
- package/bin/console/PluginApiRoutes.js +0 -299
- package/bin/console/PluginApiRoutes.js.map +0 -1
- package/bin/console/gateway/AgentActions.d.ts +0 -107
- package/bin/console/gateway/AgentActions.d.ts.map +0 -1
- package/bin/console/gateway/AgentActions.js +0 -314
- package/bin/console/gateway/AgentActions.js.map +0 -1
- package/bin/console/gateway/AgentCatalog.d.ts +0 -83
- package/bin/console/gateway/AgentCatalog.d.ts.map +0 -1
- package/bin/console/gateway/AgentCatalog.js +0 -484
- package/bin/console/gateway/AgentCatalog.js.map +0 -1
- package/bin/console/gateway/FrontendAssets.d.ts +0 -21
- package/bin/console/gateway/FrontendAssets.d.ts.map +0 -1
- package/bin/console/gateway/FrontendAssets.js +0 -77
- package/bin/console/gateway/FrontendAssets.js.map +0 -1
- package/bin/console/gateway/GatewaySupport.d.ts +0 -34
- package/bin/console/gateway/GatewaySupport.d.ts.map +0 -1
- package/bin/console/gateway/GatewaySupport.js +0 -32
- package/bin/console/gateway/GatewaySupport.js.map +0 -1
- package/bin/console/gateway/Proxy.d.ts +0 -16
- package/bin/console/gateway/Proxy.d.ts.map +0 -1
- package/bin/console/gateway/Proxy.js +0 -47
- package/bin/console/gateway/Proxy.js.map +0 -1
- package/bin/constants/DowncitySchema.d.ts +0 -3
- package/bin/constants/DowncitySchema.d.ts.map +0 -1
- package/bin/constants/DowncitySchema.js +0 -367
- package/bin/constants/DowncitySchema.js.map +0 -1
- package/bin/daemon/Api.d.ts +0 -60
- package/bin/daemon/Api.d.ts.map +0 -1
- package/bin/daemon/Api.js.map +0 -1
- package/bin/daemon/CliArgs.d.ts +0 -17
- package/bin/daemon/CliArgs.d.ts.map +0 -1
- package/bin/daemon/CliArgs.js +0 -30
- package/bin/daemon/CliArgs.js.map +0 -1
- package/bin/daemon/Client.d.ts.map +0 -1
- package/bin/daemon/Client.js +0 -158
- package/bin/daemon/Client.js.map +0 -1
- package/bin/daemon/Manager.d.ts +0 -92
- package/bin/daemon/Manager.d.ts.map +0 -1
- package/bin/daemon/Manager.js +0 -287
- package/bin/daemon/Manager.js.map +0 -1
- package/bin/daemon/PortAllocator.d.ts.map +0 -1
- package/bin/daemon/PortAllocator.js.map +0 -1
- package/bin/http/dashboard/AuthDashboardService.d.ts +0 -30
- package/bin/http/dashboard/AuthDashboardService.d.ts.map +0 -1
- package/bin/http/dashboard/AuthDashboardService.js +0 -120
- package/bin/http/dashboard/AuthDashboardService.js.map +0 -1
- package/bin/http/dashboard/CommonHelpers.d.ts +0 -24
- package/bin/http/dashboard/CommonHelpers.d.ts.map +0 -1
- package/bin/http/dashboard/CommonHelpers.js +0 -46
- package/bin/http/dashboard/CommonHelpers.js.map +0 -1
- package/bin/http/dashboard/ExecuteInput.d.ts +0 -18
- package/bin/http/dashboard/ExecuteInput.d.ts.map +0 -1
- package/bin/http/dashboard/ExecuteInput.js +0 -201
- package/bin/http/dashboard/ExecuteInput.js.map +0 -1
- package/bin/http/dashboard/MessageTimeline.d.ts +0 -22
- package/bin/http/dashboard/MessageTimeline.d.ts.map +0 -1
- package/bin/http/dashboard/MessageTimeline.js +0 -226
- package/bin/http/dashboard/MessageTimeline.js.map +0 -1
- package/bin/http/dashboard/SessionSummaryStore.d.ts +0 -19
- package/bin/http/dashboard/SessionSummaryStore.d.ts.map +0 -1
- package/bin/http/dashboard/SessionSummaryStore.js +0 -62
- package/bin/http/dashboard/SessionSummaryStore.js.map +0 -1
- package/bin/http/dashboard/TaskStore.d.ts +0 -33
- package/bin/http/dashboard/TaskStore.d.ts.map +0 -1
- package/bin/http/dashboard/TaskStore.js +0 -157
- package/bin/http/dashboard/TaskStore.js.map +0 -1
- package/bin/model/ModelCommand.d.ts +0 -60
- package/bin/model/ModelCommand.d.ts.map +0 -1
- package/bin/model/ModelCommand.js +0 -46
- package/bin/model/ModelCommand.js.map +0 -1
- package/bin/model/ModelManager.d.ts +0 -71
- package/bin/model/ModelManager.d.ts.map +0 -1
- package/bin/model/ModelManager.js +0 -187
- package/bin/model/ModelManager.js.map +0 -1
- package/bin/registry/AgentHostRuntime.d.ts +0 -10
- package/bin/registry/AgentHostRuntime.d.ts.map +0 -1
- package/bin/registry/AgentHostRuntime.js +0 -47
- package/bin/registry/AgentHostRuntime.js.map +0 -1
- package/bin/registry/CityPaths.d.ts +0 -61
- package/bin/registry/CityPaths.d.ts.map +0 -1
- package/bin/registry/CityPaths.js +0 -90
- package/bin/registry/CityPaths.js.map +0 -1
- package/bin/registry/CityRegistry.d.ts +0 -51
- package/bin/registry/CityRegistry.d.ts.map +0 -1
- package/bin/registry/CityRegistry.js +0 -217
- package/bin/registry/CityRegistry.js.map +0 -1
- package/bin/registry/CityRuntime.d.ts +0 -21
- package/bin/registry/CityRuntime.d.ts.map +0 -1
- package/bin/registry/CityRuntime.js +0 -45
- package/bin/registry/CityRuntime.js.map +0 -1
- package/bin/registry/PluginRuntime.d.ts +0 -24
- package/bin/registry/PluginRuntime.d.ts.map +0 -1
- package/bin/registry/PluginRuntime.js.map +0 -1
- package/bin/registry/ProcessSweep.d.ts +0 -76
- package/bin/registry/ProcessSweep.d.ts.map +0 -1
- package/bin/registry/ProcessSweep.js +0 -202
- package/bin/registry/ProcessSweep.js.map +0 -1
- package/bin/rpc/Client.d.ts +0 -13
- package/bin/rpc/Client.d.ts.map +0 -1
- package/bin/rpc/Client.js.map +0 -1
- package/bin/rpc/Paths.d.ts.map +0 -1
- package/bin/rpc/Paths.js +0 -36
- package/bin/rpc/Paths.js.map +0 -1
- package/bin/sandbox/MacOsSeatbeltSandbox.d.ts +0 -16
- package/bin/sandbox/MacOsSeatbeltSandbox.d.ts.map +0 -1
- package/bin/sandbox/MacOsSeatbeltSandbox.js +0 -152
- package/bin/sandbox/MacOsSeatbeltSandbox.js.map +0 -1
- package/bin/sandbox/SandboxConfigResolver.d.ts +0 -31
- package/bin/sandbox/SandboxConfigResolver.d.ts.map +0 -1
- package/bin/sandbox/SandboxConfigResolver.js +0 -113
- package/bin/sandbox/SandboxConfigResolver.js.map +0 -1
- package/bin/sandbox/SandboxRunner.d.ts +0 -46
- package/bin/sandbox/SandboxRunner.d.ts.map +0 -1
- package/bin/sandbox/SandboxRunner.js +0 -70
- package/bin/sandbox/SandboxRunner.js.map +0 -1
- package/bin/store/StoreChannelAccountRepository.d.ts +0 -34
- package/bin/store/StoreChannelAccountRepository.d.ts.map +0 -1
- package/bin/store/StoreChannelAccountRepository.js +0 -198
- package/bin/store/StoreChannelAccountRepository.js.map +0 -1
- package/bin/store/StoreEnvRepository.d.ts +0 -98
- package/bin/store/StoreEnvRepository.d.ts.map +0 -1
- package/bin/store/StoreEnvRepository.js +0 -334
- package/bin/store/StoreEnvRepository.js.map +0 -1
- package/bin/store/StoreModelRepository.d.ts +0 -61
- package/bin/store/StoreModelRepository.d.ts.map +0 -1
- package/bin/store/StoreModelRepository.js +0 -278
- package/bin/store/StoreModelRepository.js.map +0 -1
- package/bin/store/StoreSchema.d.ts +0 -13
- package/bin/store/StoreSchema.d.ts.map +0 -1
- package/bin/store/StoreSchema.js +0 -319
- package/bin/store/StoreSchema.js.map +0 -1
- package/bin/store/StoreSecureSettings.d.ts +0 -33
- package/bin/store/StoreSecureSettings.d.ts.map +0 -1
- package/bin/store/StoreSecureSettings.js +0 -91
- package/bin/store/StoreSecureSettings.js.map +0 -1
- package/bin/store/StoreShared.d.ts +0 -44
- package/bin/store/StoreShared.d.ts.map +0 -1
- package/bin/store/StoreShared.js +0 -40
- package/bin/store/StoreShared.js.map +0 -1
- package/bin/store/crypto.d.ts +0 -24
- package/bin/store/crypto.d.ts.map +0 -1
- package/bin/store/crypto.js +0 -101
- package/bin/store/crypto.js.map +0 -1
- package/bin/store/index.d.ts +0 -230
- package/bin/store/index.d.ts.map +0 -1
- package/bin/store/index.js +0 -360
- package/bin/store/index.js.map +0 -1
- package/bin/store/schema.d.ts +0 -690
- package/bin/store/schema.d.ts.map +0 -1
- package/bin/store/schema.js +0 -81
- package/bin/store/schema.js.map +0 -1
- package/bin/types/chat/ChatSession.d.ts +0 -30
- package/bin/types/chat/ChatSession.d.ts.map +0 -1
- package/bin/types/chat/ChatSession.js +0 -9
- package/bin/types/chat/ChatSession.js.map +0 -1
- package/bin/types/city/PublicHostEnv.d.ts +0 -72
- package/bin/types/city/PublicHostEnv.d.ts.map +0 -1
- package/bin/types/city/PublicHostEnv.js +0 -9
- package/bin/types/city/PublicHostEnv.js.map +0 -1
- package/bin/types/cli/AgentChat.d.ts +0 -147
- package/bin/types/cli/AgentChat.d.ts.map +0 -1
- package/bin/types/cli/AgentChat.js +0 -12
- package/bin/types/cli/AgentChat.js.map +0 -1
- package/bin/types/cli/AgentHistory.d.ts +0 -127
- package/bin/types/cli/AgentHistory.d.ts.map +0 -1
- package/bin/types/cli/AgentHistory.js +0 -9
- package/bin/types/cli/AgentHistory.js.map +0 -1
- package/bin/types/cli/AgentManager.d.ts +0 -113
- package/bin/types/cli/AgentManager.d.ts.map +0 -1
- package/bin/types/cli/AgentManager.js +0 -9
- package/bin/types/cli/AgentManager.js.map +0 -1
- package/bin/types/cli/AgentSelection.d.ts +0 -146
- package/bin/types/cli/AgentSelection.d.ts.map +0 -1
- package/bin/types/cli/AgentSelection.js +0 -9
- package/bin/types/cli/AgentSelection.js.map +0 -1
- package/bin/types/cli/ChatManager.d.ts +0 -64
- package/bin/types/cli/ChatManager.d.ts.map +0 -1
- package/bin/types/cli/ChatManager.js +0 -9
- package/bin/types/cli/ChatManager.js.map +0 -1
- package/bin/types/cli/CliError.d.ts.map +0 -1
- package/bin/types/cli/CliError.js.map +0 -1
- package/bin/types/cli/CliReporter.d.ts +0 -157
- package/bin/types/cli/CliReporter.d.ts.map +0 -1
- package/bin/types/cli/CliReporter.js +0 -10
- package/bin/types/cli/CliReporter.js.map +0 -1
- package/bin/types/cli/ModelManager.d.ts +0 -127
- package/bin/types/cli/ModelManager.d.ts.map +0 -1
- package/bin/types/cli/ModelManager.js +0 -9
- package/bin/types/cli/ModelManager.js.map +0 -1
- package/bin/types/contact/Contact.d.ts +0 -78
- package/bin/types/contact/Contact.d.ts.map +0 -1
- package/bin/types/contact/Contact.js +0 -9
- package/bin/types/contact/Contact.js.map +0 -1
- package/bin/types/contact/ContactApproval.d.ts +0 -145
- package/bin/types/contact/ContactApproval.d.ts.map +0 -1
- package/bin/types/contact/ContactApproval.js +0 -9
- package/bin/types/contact/ContactApproval.js.map +0 -1
- package/bin/types/contact/ContactChat.d.ts +0 -46
- package/bin/types/contact/ContactChat.d.ts.map +0 -1
- package/bin/types/contact/ContactChat.js +0 -9
- package/bin/types/contact/ContactChat.js.map +0 -1
- package/bin/types/contact/ContactCheck.d.ts +0 -66
- package/bin/types/contact/ContactCheck.d.ts.map +0 -1
- package/bin/types/contact/ContactCheck.js +0 -9
- package/bin/types/contact/ContactCheck.js.map +0 -1
- package/bin/types/contact/ContactCommand.d.ts +0 -93
- package/bin/types/contact/ContactCommand.d.ts.map +0 -1
- package/bin/types/contact/ContactCommand.js +0 -8
- package/bin/types/contact/ContactCommand.js.map +0 -1
- package/bin/types/contact/ContactEndpoint.d.ts +0 -12
- package/bin/types/contact/ContactEndpoint.d.ts.map +0 -1
- package/bin/types/contact/ContactEndpoint.js +0 -9
- package/bin/types/contact/ContactEndpoint.js.map +0 -1
- package/bin/types/contact/ContactLink.d.ts +0 -160
- package/bin/types/contact/ContactLink.d.ts.map +0 -1
- package/bin/types/contact/ContactLink.js +0 -9
- package/bin/types/contact/ContactLink.js.map +0 -1
- package/bin/types/contact/ContactShare.d.ts +0 -163
- package/bin/types/contact/ContactShare.d.ts.map +0 -1
- package/bin/types/contact/ContactShare.js +0 -9
- package/bin/types/contact/ContactShare.js.map +0 -1
- package/bin/types/sandbox/SandboxRuntime.d.ts +0 -318
- package/bin/types/sandbox/SandboxRuntime.d.ts.map +0 -1
- package/bin/types/sandbox/SandboxRuntime.js +0 -10
- package/bin/types/sandbox/SandboxRuntime.js.map +0 -1
- package/bin/types/store/Store.d.ts +0 -26
- package/bin/types/store/Store.d.ts.map +0 -1
- package/bin/types/store/Store.js +0 -9
- package/bin/types/store/Store.js.map +0 -1
- package/bin/types/task/TaskRunner.d.ts +0 -186
- package/bin/types/task/TaskRunner.d.ts.map +0 -1
- package/bin/types/task/TaskRunner.js +0 -9
- package/bin/types/task/TaskRunner.js.map +0 -1
- package/src/cli/AgentChat.ts +0 -415
- package/src/cli/AgentHistory.ts +0 -187
- package/src/cli/AgentManager.ts +0 -667
- package/src/cli/AgentReset.ts +0 -181
- package/src/cli/AgentSelection.ts +0 -297
- package/src/cli/ChatAuth.ts +0 -203
- package/src/cli/ChatManager.ts +0 -439
- package/src/cli/CliReporter.ts +0 -362
- package/src/cli/Config.ts +0 -301
- package/src/cli/Console.ts +0 -610
- package/src/cli/ConsoleAuthBootstrap.ts +0 -72
- package/src/cli/ConsoleInit.ts +0 -83
- package/src/cli/Env.ts +0 -556
- package/src/cli/IndexAgentCommand.ts +0 -303
- package/src/cli/IndexConsoleCommand.ts +0 -211
- package/src/cli/IndexConsoleProcess.ts +0 -497
- package/src/cli/IndexConsoleStatus.ts +0 -152
- package/src/cli/IndexSupport.ts +0 -138
- package/src/cli/Init.ts +0 -291
- package/src/cli/ModelCommandShared.ts +0 -126
- package/src/cli/ModelCreateCommand.ts +0 -424
- package/src/cli/ModelManageCommand.ts +0 -516
- package/src/cli/ModelManager.ts +0 -631
- package/src/cli/ModelReadCommand.ts +0 -207
- package/src/cli/ModelSupport.ts +0 -223
- package/src/cli/Plugins.ts +0 -568
- package/src/cli/PortHints.ts +0 -80
- package/src/cli/PublicAccess.ts +0 -106
- package/src/cli/PublicHostEnv.ts +0 -116
- package/src/cli/Restart.ts +0 -68
- package/src/cli/Run.ts +0 -148
- package/src/cli/ServiceActionCommands.ts +0 -414
- package/src/cli/ServiceCommandRemote.ts +0 -230
- package/src/cli/ServiceCommandSupport.ts +0 -275
- package/src/cli/ServiceScheduleCommand.ts +0 -305
- package/src/cli/Services.ts +0 -189
- package/src/cli/Start.ts +0 -72
- package/src/cli/Status.ts +0 -116
- package/src/cli/Stop.ts +0 -45
- package/src/cli/Token.ts +0 -702
- package/src/cli/Update.ts +0 -183
- package/src/console/AgentStatusApiRoutes.ts +0 -225
- package/src/console/ChannelAccountApiRoutes.ts +0 -119
- package/src/console/ConsoleClient.ts +0 -293
- package/src/console/ConsoleGateway.ts +0 -463
- package/src/console/ConsoleGatewayRoutes.ts +0 -495
- package/src/console/EnvApiRoutes.ts +0 -257
- package/src/console/InlineInstantRoutes.ts +0 -74
- package/src/console/InlineInstantSessionService.ts +0 -277
- package/src/console/InlineInstantSystemComposer.ts +0 -58
- package/src/console/ModelApiRoutes.ts +0 -336
- package/src/console/ModelPoolService.ts +0 -395
- package/src/console/PluginApiRoutes.ts +0 -453
- package/src/console/gateway/AgentActions.ts +0 -413
- package/src/console/gateway/AgentCatalog.ts +0 -606
- package/src/console/gateway/FrontendAssets.ts +0 -79
- package/src/console/gateway/GatewaySupport.ts +0 -59
- package/src/console/gateway/Proxy.ts +0 -62
- package/src/constants/DowncitySchema.ts +0 -377
- package/src/daemon/Api.ts +0 -64
- package/src/daemon/CliArgs.ts +0 -39
- package/src/daemon/Client.ts +0 -182
- package/src/daemon/Manager.ts +0 -344
- package/src/http/dashboard/AuthDashboardService.ts +0 -161
- package/src/http/dashboard/CommonHelpers.ts +0 -50
- package/src/http/dashboard/ExecuteInput.ts +0 -236
- package/src/http/dashboard/MessageTimeline.ts +0 -269
- package/src/http/dashboard/SessionSummaryStore.ts +0 -77
- package/src/http/dashboard/TaskStore.ts +0 -222
- package/src/model/ModelCommand.ts +0 -95
- package/src/model/ModelManager.ts +0 -242
- package/src/registry/AgentHostRuntime.ts +0 -65
- package/src/registry/CityPaths.ts +0 -101
- package/src/registry/CityRegistry.ts +0 -256
- package/src/registry/CityRuntime.ts +0 -45
- package/src/registry/PluginRuntime.ts +0 -42
- package/src/registry/ProcessSweep.ts +0 -256
- package/src/rpc/Client.ts +0 -110
- package/src/rpc/Paths.ts +0 -43
- package/src/sandbox/MacOsSeatbeltSandbox.ts +0 -196
- package/src/sandbox/SandboxConfigResolver.ts +0 -134
- package/src/sandbox/SandboxRunner.ts +0 -101
- package/src/store/StoreChannelAccountRepository.ts +0 -269
- package/src/store/StoreEnvRepository.ts +0 -452
- package/src/store/StoreModelRepository.ts +0 -324
- package/src/store/StoreSchema.ts +0 -344
- package/src/store/StoreSecureSettings.ts +0 -126
- package/src/store/StoreShared.ts +0 -67
- package/src/store/crypto.ts +0 -112
- package/src/store/index.ts +0 -497
- package/src/store/schema.ts +0 -103
- package/src/types/chat/ChatSession.ts +0 -32
- package/src/types/city/PublicHostEnv.ts +0 -76
- package/src/types/cli/AgentChat.ts +0 -172
- package/src/types/cli/AgentHistory.ts +0 -146
- package/src/types/cli/AgentManager.ts +0 -119
- package/src/types/cli/AgentSelection.ts +0 -162
- package/src/types/cli/ChatManager.ts +0 -65
- package/src/types/cli/CliReporter.ts +0 -167
- package/src/types/cli/ModelManager.ts +0 -139
- package/src/types/contact/Contact.ts +0 -82
- package/src/types/contact/ContactApproval.ts +0 -150
- package/src/types/contact/ContactChat.ts +0 -47
- package/src/types/contact/ContactCheck.ts +0 -67
- package/src/types/contact/ContactCommand.ts +0 -98
- package/src/types/contact/ContactEndpoint.ts +0 -16
- package/src/types/contact/ContactLink.ts +0 -169
- package/src/types/contact/ContactShare.ts +0 -172
- package/src/types/sandbox/SandboxRuntime.ts +0 -377
- package/src/types/store/Store.ts +0 -27
- package/src/types/task/TaskRunner.ts +0 -199
- /package/bin/cli/{AgentManager.d.ts → agent/AgentManager.d.ts} +0 -0
- /package/bin/cli/{Init.d.ts → agent/Init.d.ts} +0 -0
- /package/bin/cli/{Status.d.ts → agent/Status.d.ts} +0 -0
- /package/bin/cli/{Stop.d.ts → agent/Stop.d.ts} +0 -0
- /package/bin/cli/{Model.d.ts → model/Model.d.ts} +0 -0
- /package/bin/cli/{Model.js → model/Model.js} +0 -0
- /package/bin/cli/{ModelCreateCommand.d.ts → model/ModelCreateCommand.d.ts} +0 -0
- /package/bin/cli/{ModelManageCommand.d.ts → model/ModelManageCommand.d.ts} +0 -0
- /package/bin/cli/{ModelManageCommand.js → model/ModelManageCommand.js} +0 -0
- /package/bin/cli/{ModelManager.d.ts → model/ModelManager.d.ts} +0 -0
- /package/bin/cli/{ServiceActionCommands.d.ts → service/ServiceActionCommands.d.ts} +0 -0
- /package/bin/cli/{Services.d.ts → service/Services.d.ts} +0 -0
- /package/bin/cli/{Alias.d.ts → shared/Alias.d.ts} +0 -0
- /package/bin/cli/{Alias.js → shared/Alias.js} +0 -0
- /package/bin/cli/{Chat.d.ts → shared/Chat.d.ts} +0 -0
- /package/bin/cli/{Chat.js → shared/Chat.js} +0 -0
- /package/bin/cli/{ChatAuth.d.ts → shared/ChatAuth.d.ts} +0 -0
- /package/bin/cli/{ChatManager.d.ts → shared/ChatManager.d.ts} +0 -0
- /package/bin/{types/cli → cli/shared}/CliError.d.ts +0 -0
- /package/bin/{types/cli → cli/shared}/CliError.js +0 -0
- /package/bin/cli/{CliReporter.js → shared/CliReporter.js} +0 -0
- /package/bin/cli/{Config.d.ts → shared/Config.d.ts} +0 -0
- /package/bin/cli/{IndexAgentCommand.d.ts → shared/IndexAgentCommand.d.ts} +0 -0
- /package/bin/cli/{IndexSupport.d.ts → shared/IndexSupport.d.ts} +0 -0
- /package/bin/cli/{Plugins.d.ts → shared/Plugins.d.ts} +0 -0
- /package/bin/cli/{Reset.d.ts → shared/Reset.d.ts} +0 -0
- /package/bin/cli/{Reset.js → shared/Reset.js} +0 -0
- /package/bin/cli/{Token.d.ts → shared/Token.d.ts} +0 -0
- /package/bin/cli/{Update.d.ts → shared/Update.d.ts} +0 -0
- /package/bin/{daemon → process/daemon}/Api.js +0 -0
- /package/bin/{daemon → process/daemon}/Client.d.ts +0 -0
- /package/bin/{daemon → process/daemon}/PortAllocator.d.ts +0 -0
- /package/bin/{daemon → process/daemon}/PortAllocator.js +0 -0
- /package/bin/{registry → process/registry}/PluginRuntime.js +0 -0
- /package/bin/{rpc → process/rpc}/Client.js +0 -0
- /package/bin/{rpc → process/rpc}/Paths.d.ts +0 -0
- /package/src/cli/{Model.ts → model/Model.ts} +0 -0
- /package/src/cli/{Alias.ts → shared/Alias.ts} +0 -0
- /package/src/cli/{Chat.ts → shared/Chat.ts} +0 -0
- /package/src/{types/cli → cli/shared}/CliError.ts +0 -0
- /package/src/cli/{Reset.ts → shared/Reset.ts} +0 -0
- /package/src/{daemon → process/daemon}/PortAllocator.ts +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# @downcity/city
|
|
2
|
+
|
|
3
|
+
`@downcity/city` 是 Downcity 的平台层与多 Agent 宿主管理包。
|
|
4
|
+
|
|
5
|
+
它负责 CLI、控制面、city runtime 进程管理、全局配置存储,以及多个 agent 的注册与调度。
|
|
6
|
+
它依赖 `@downcity/agent` 提供单 Agent runtime、service、plugin、control API、sandbox 与执行能力,但不重复实现这些内核。
|
|
7
|
+
|
|
8
|
+
## 包定位
|
|
9
|
+
|
|
10
|
+
- 面向平台层和宿主管理层。
|
|
11
|
+
- 管理多个 Agent 项目与后台进程。
|
|
12
|
+
- 提供控制面 gateway / control plane。
|
|
13
|
+
- 提供全局模型池、全局环境变量、全局 chat channel account 存储。
|
|
14
|
+
|
|
15
|
+
## 与其他包的边界
|
|
16
|
+
|
|
17
|
+
- `@downcity/city`
|
|
18
|
+
- 多 Agent 管理。
|
|
19
|
+
- 平台 CLI。
|
|
20
|
+
- 控制面 gateway / control plane。
|
|
21
|
+
- city 级全局 store。
|
|
22
|
+
|
|
23
|
+
- `@downcity/agent`
|
|
24
|
+
- 单 Agent runtime。
|
|
25
|
+
- 单 Agent control API。
|
|
26
|
+
- service / plugin / sandbox / tool loop / session 执行。
|
|
27
|
+
|
|
28
|
+
- `@downcity/ui`
|
|
29
|
+
- React UI 组件与前端展示层。
|
|
30
|
+
|
|
31
|
+
## 根目录结构
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
packages/city
|
|
35
|
+
├── bin/ # 编译输出目录,CLI 实际执行入口
|
|
36
|
+
├── public/ # 控制面前端静态资源
|
|
37
|
+
├── scripts/ # 构建和发布辅助脚本
|
|
38
|
+
├── src/ # 源码目录
|
|
39
|
+
├── package.json # 包信息、CLI bin、脚本
|
|
40
|
+
└── tsconfig.json # TypeScript 配置
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 源码结构树
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
src
|
|
47
|
+
├── cli/
|
|
48
|
+
│ ├── agent/
|
|
49
|
+
│ ├── control-plane/
|
|
50
|
+
│ ├── model/
|
|
51
|
+
│ │ └── preset/
|
|
52
|
+
│ ├── service/
|
|
53
|
+
│ ├── shared/
|
|
54
|
+
│ └── Index.ts
|
|
55
|
+
├── config/
|
|
56
|
+
├── control/
|
|
57
|
+
│ ├── instant/
|
|
58
|
+
│ └── gateway/
|
|
59
|
+
├── http/
|
|
60
|
+
│ └── auth/
|
|
61
|
+
├── process/
|
|
62
|
+
│ ├── daemon/
|
|
63
|
+
│ ├── registry/
|
|
64
|
+
│ └── rpc/
|
|
65
|
+
├── types/
|
|
66
|
+
│ ├── chat/
|
|
67
|
+
│ ├── contact/
|
|
68
|
+
│ └── task/
|
|
69
|
+
└── utils/
|
|
70
|
+
└── cli/
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 目录职责
|
|
74
|
+
|
|
75
|
+
- `src/cli/`
|
|
76
|
+
- CLI 命令实现与装配。
|
|
77
|
+
- 已按子域拆分,避免扁平堆积。
|
|
78
|
+
|
|
79
|
+
- `src/cli/agent/`
|
|
80
|
+
- `city agent ...` 命令。
|
|
81
|
+
- 包括 agent create、start、stop、restart、status、chat、history、交互式 manager。
|
|
82
|
+
|
|
83
|
+
- `src/cli/control-plane/`
|
|
84
|
+
- `city` 顶层 runtime 命令与 `city console ...` 命令。
|
|
85
|
+
- 这层语义是 control plane / gateway 宿主管理,而不是单 Agent API。
|
|
86
|
+
|
|
87
|
+
- `src/cli/model/`
|
|
88
|
+
- `city model ...` 命令。
|
|
89
|
+
- 面向 city 全局模型池的 CLI 管理。
|
|
90
|
+
|
|
91
|
+
- `src/cli/model/preset/`
|
|
92
|
+
- city 侧模型预设目录。
|
|
93
|
+
- 只保留命令交互需要的预设定义,不再复制全局 store 实现。
|
|
94
|
+
|
|
95
|
+
- `src/cli/service/`
|
|
96
|
+
- `city service ...` 与服务 action 命令桥接。
|
|
97
|
+
- 负责把 CLI 命令转发到单 Agent runtime。
|
|
98
|
+
|
|
99
|
+
- `src/cli/shared/`
|
|
100
|
+
- 多个 CLI 子域共用的基础能力。
|
|
101
|
+
- 包括 reporter、错误类型、env、token、plugin、chat manager、命令参数辅助等。
|
|
102
|
+
|
|
103
|
+
- `src/config/`
|
|
104
|
+
- city 自己的静态配置结构。
|
|
105
|
+
- 包括路径规则、schema 常量。
|
|
106
|
+
|
|
107
|
+
- `src/control/`
|
|
108
|
+
- 平台控制面 HTTP gateway。
|
|
109
|
+
- 负责聚合多 Agent 视图、控制动作、前端资源、模型池与 channel account API。
|
|
110
|
+
- 这是 gateway / control plane,不是单 Agent control API。
|
|
111
|
+
|
|
112
|
+
- `src/control/instant/`
|
|
113
|
+
- control plane 下的即时执行子域。
|
|
114
|
+
- 放置 instant-run 路由、临时 session service 和即时 system composer。
|
|
115
|
+
|
|
116
|
+
- `src/control/gateway/`
|
|
117
|
+
- gateway 的读写辅助模块。
|
|
118
|
+
- 包括 agent catalog、agent actions、proxy、frontend assets 等。
|
|
119
|
+
|
|
120
|
+
## 命名说明
|
|
121
|
+
|
|
122
|
+
- `city/cli/control-plane`
|
|
123
|
+
- 这里承载 city gateway / control plane 的命令面与进程管理面。
|
|
124
|
+
- CLI 命令对用户仍保留 `city console`,但源码结构已经按 control plane 语义命名。
|
|
125
|
+
|
|
126
|
+
- `city/control`
|
|
127
|
+
- 这里承载的是多 agent 聚合控制面,不是单 agent control API。
|
|
128
|
+
|
|
129
|
+
- `@downcity/agent/http/control`
|
|
130
|
+
- 这里承载的是 single-agent control API。
|
|
131
|
+
- 当前统一路径是 `/api/control/*`。
|
|
132
|
+
|
|
133
|
+
- `src/http/auth/`
|
|
134
|
+
- city 控制面自己的鉴权体系。
|
|
135
|
+
- 包括 token、middleware、route policy、store。
|
|
136
|
+
|
|
137
|
+
- `src/process/`
|
|
138
|
+
- city runtime 进程侧能力。
|
|
139
|
+
- 统一承接 daemon、registry、local rpc,不再散落在顶层目录。
|
|
140
|
+
|
|
141
|
+
- `src/process/daemon/`
|
|
142
|
+
- Agent daemon 的 pid/log/meta/启停管理。
|
|
143
|
+
- 负责后台拉起 agent 前台进程。
|
|
144
|
+
|
|
145
|
+
- `src/process/registry/`
|
|
146
|
+
- city runtime 与多 Agent registry 状态。
|
|
147
|
+
- 记录哪些 agent 已登记、哪些 daemon 正在运行、Console/city pid 路径等。
|
|
148
|
+
|
|
149
|
+
- `src/process/rpc/`
|
|
150
|
+
- city 侧 local RPC 客户端辅助。
|
|
151
|
+
- 用于本机调用 Agent 暴露的 IPC 接口。
|
|
152
|
+
|
|
153
|
+
- `src/types/`
|
|
154
|
+
- 当前仅保留尚未进一步归位的领域类型。
|
|
155
|
+
- 目前主要是 `chat / contact / task` 三组。
|
|
156
|
+
- CLI、store、city 自己的高频类型已经贴回对应模块邻近位置。
|
|
157
|
+
|
|
158
|
+
- `src/utils/`
|
|
159
|
+
- 平台层通用工具。
|
|
160
|
+
|
|
161
|
+
- `src/utils/cli/`
|
|
162
|
+
- CLI 输出、spinner 等命令行体验辅助。
|
|
163
|
+
|
|
164
|
+
## 关键调用关系
|
|
165
|
+
|
|
166
|
+
### 1. CLI 主入口
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
src/cli/Index.ts
|
|
170
|
+
-> control-plane/
|
|
171
|
+
-> agent/
|
|
172
|
+
-> model/
|
|
173
|
+
-> service/
|
|
174
|
+
-> shared/
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 2. 启动 city runtime 与 Console
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
city start
|
|
181
|
+
-> src/cli/control-plane/ControlPlaneCommand.ts
|
|
182
|
+
-> src/cli/control-plane/ControlPlaneProcess.ts
|
|
183
|
+
-> src/process/registry/*
|
|
184
|
+
-> src/control/ControlGateway.ts
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 3. 启动 Agent daemon
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
city agent start
|
|
191
|
+
-> src/cli/agent/Start.ts
|
|
192
|
+
-> src/process/daemon/Manager.ts
|
|
193
|
+
-> detached child process
|
|
194
|
+
-> @downcity/agent runtime
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### 4. 控制面读写 Agent
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
browser / UI
|
|
201
|
+
-> src/control/ControlGateway.ts
|
|
202
|
+
-> src/control/gateway/*
|
|
203
|
+
-> src/process/registry/*
|
|
204
|
+
-> 转发到单 Agent HTTP / RPC
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### 5. 全局模型池
|
|
208
|
+
|
|
209
|
+
```text
|
|
210
|
+
city model ...
|
|
211
|
+
-> src/cli/model/*
|
|
212
|
+
-> @downcity/agent PlatformStore
|
|
213
|
+
-> src/cli/model/preset/*
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## 当前最重要的入口文件
|
|
217
|
+
|
|
218
|
+
- `src/cli/Index.ts`
|
|
219
|
+
- CLI 主入口。
|
|
220
|
+
|
|
221
|
+
- `src/cli/control-plane/ControlPlaneCommand.ts`
|
|
222
|
+
- 顶层 city / control plane 命令装配。
|
|
223
|
+
|
|
224
|
+
- `src/cli/shared/IndexAgentCommand.ts`
|
|
225
|
+
- `city agent` 命令树装配。
|
|
226
|
+
|
|
227
|
+
- `src/control/ControlGateway.ts`
|
|
228
|
+
- 平台控制面 gateway 主入口。
|
|
229
|
+
|
|
230
|
+
- `src/process/daemon/Manager.ts`
|
|
231
|
+
- agent daemon 生命周期管理核心。
|
|
232
|
+
|
|
233
|
+
- `src/process/registry/CityRegistry.ts`
|
|
234
|
+
- 多 Agent registry 核心。
|
|
235
|
+
|
|
236
|
+
## 维护约定
|
|
237
|
+
|
|
238
|
+
- 不要把单 Agent 执行逻辑重新实现到这个包里。
|
|
239
|
+
- sandbox、tool loop、session 执行、service 内核统一来自 `@downcity/agent`。
|
|
240
|
+
- 全局 store 也统一来自 `@downcity/agent`,不要在 city 再复制一份持久化实现。
|
|
241
|
+
- `control/` 是平台 gateway / control plane。
|
|
242
|
+
- 单 Agent 的 HTTP control API 语义应该留在 `@downcity/agent`。
|
|
243
|
+
- `process/` 统一放 city 的进程管理、registry、RPC,不要再散落回顶层。
|
|
244
|
+
- `config/` 只放静态配置/schema/路径,不混入运行时 store 逻辑。
|
|
245
|
+
- CLI 类型、store 类型、city 自有小类型优先就近放在对应模块旁边。
|
package/bin/cli/Index.js
CHANGED
|
@@ -11,17 +11,17 @@ import { readFileSync } from "fs";
|
|
|
11
11
|
import { basename, dirname, join } from "path";
|
|
12
12
|
import { fileURLToPath } from "url";
|
|
13
13
|
import { Command, Option } from "commander";
|
|
14
|
-
import { registerAllPluginsForCli } from "@downcity/agent
|
|
15
|
-
import { registerServicesCommand } from "./Services.js";
|
|
16
|
-
import { registerPluginsCommand } from "./Plugins.js";
|
|
17
|
-
import { registerAllServicesForCli } from "./ServiceActionCommands.js";
|
|
18
|
-
import {
|
|
19
|
-
import { registerAgentCommands } from "./IndexAgentCommand.js";
|
|
20
|
-
import { registerEnvCommand } from "./Env.js";
|
|
21
|
-
import { registerTokenCommand } from "./Token.js";
|
|
22
|
-
import { registerResetCommand } from "./Reset.js";
|
|
23
|
-
import { registerChatCommand } from "./Chat.js";
|
|
24
|
-
import { setCliVerbosity } from "./CliReporter.js";
|
|
14
|
+
import { registerAllPluginsForCli } from "@downcity/agent";
|
|
15
|
+
import { registerServicesCommand } from "./service/Services.js";
|
|
16
|
+
import { registerPluginsCommand } from "./shared/Plugins.js";
|
|
17
|
+
import { registerAllServicesForCli } from "./service/ServiceActionCommands.js";
|
|
18
|
+
import { registerControlPlaneCommands } from "./control-plane/ControlPlaneCommand.js";
|
|
19
|
+
import { registerAgentCommands } from "./shared/IndexAgentCommand.js";
|
|
20
|
+
import { registerEnvCommand } from "./shared/Env.js";
|
|
21
|
+
import { registerTokenCommand } from "./shared/Token.js";
|
|
22
|
+
import { registerResetCommand } from "./shared/Reset.js";
|
|
23
|
+
import { registerChatCommand } from "./shared/Chat.js";
|
|
24
|
+
import { setCliVerbosity } from "./shared/CliReporter.js";
|
|
25
25
|
const __filename = fileURLToPath(import.meta.url);
|
|
26
26
|
const __dirname = dirname(__filename);
|
|
27
27
|
const cliPath = join(__dirname, "./Index.js");
|
|
@@ -34,7 +34,7 @@ program
|
|
|
34
34
|
program.helpOption("--help", "display help for command");
|
|
35
35
|
program.option("-q, --quiet", "仅输出错误信息");
|
|
36
36
|
program.option("--verbose", "输出详细进度");
|
|
37
|
-
|
|
37
|
+
registerControlPlaneCommands(program, {
|
|
38
38
|
version: packageJson.version,
|
|
39
39
|
cliPath,
|
|
40
40
|
});
|
package/bin/cli/Index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/cli/Index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/cli/Index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE9C,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CACtC,CAAC;AAEzB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC;KAC7C,WAAW,CAAC,iCAAiC,CAAC;KAC9C,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAEjD,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;AAEzD,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACzC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAEtC,4BAA4B,CAAC,OAAO,EAAE;IACpC,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,OAAO;CACR,CAAC,CAAC;AAEH,qBAAqB,CAAC,OAAO,EAAE;IAC7B,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,gBAAgB,EAAE,MAAM;CACzB,CAAC,CAAC;AACH,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC5B,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAE7B,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACjC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAEhC,2DAA2D;AAC3D,yBAAyB,CAAC,OAAO,CAAC,CAAC;AACnC,+CAA+C;AAC/C,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAElC,OAAO,CAAC,kBAAkB,EAAE,CAAC;AAC7B,OAAO,CAAC,wBAAwB,EAAE,CAAC;AACnC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;IAC7B,OAAO,CAAC,UAAU,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,0DAA0D;AAC1D,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE;IACxC,MAAM,IAAI,GAAG,WAAW,CAAC,eAAe,EAA0C,CAAC;IACnF,IAAI,IAAI,CAAC,KAAK;QAAE,eAAe,CAAC,OAAO,CAAC,CAAC;SACpC,IAAI,IAAI,CAAC,OAAO;QAAE,eAAe,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC;AAEH,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `city agent chat` 命令实现。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 统一覆盖交互式持续对话与一次性消息模式,不再保留独立 `quest` 命令。
|
|
6
|
+
* - 目标 agent 始终按 managed agent registry 名称解析,不依赖当前工作目录。
|
|
7
|
+
* - 默认使用独立 local-cli 主会话:`local-cli-chat-main`。
|
|
8
|
+
*/
|
|
9
|
+
import type { AgentChatCliOptions, AgentChatExecutionOutcome, AgentChatTransportOptions } from "./AgentChatTypes.js";
|
|
10
|
+
/**
|
|
11
|
+
* 向目标 agent 的 Console 主会话发送一轮消息。
|
|
12
|
+
*/
|
|
13
|
+
export declare function executeAgentChatTurn(params: {
|
|
14
|
+
agentName: string;
|
|
15
|
+
message: string;
|
|
16
|
+
transport?: AgentChatTransportOptions;
|
|
17
|
+
}): Promise<AgentChatExecutionOutcome>;
|
|
18
|
+
/**
|
|
19
|
+
* `city agent chat` 统一入口。
|
|
20
|
+
*/
|
|
21
|
+
export declare function chatCommand(options: AgentChatCliOptions): Promise<void>;
|
|
22
|
+
//# sourceMappingURL=AgentChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentChat.d.ts","sourceRoot":"","sources":["../../../src/cli/agent/AgentChat.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmBH,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAEzB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAkG7B;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAiFrC;AA8JD;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoC7E"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `city agent chat` 命令实现。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 统一覆盖交互式持续对话与一次性消息模式,不再保留独立 `quest` 命令。
|
|
6
|
+
* - 目标 agent 始终按 managed agent registry 名称解析,不依赖当前工作目录。
|
|
7
|
+
* - 默认使用独立 local-cli 主会话:`local-cli-chat-main`。
|
|
8
|
+
*/
|
|
9
|
+
import { createInterface } from "node:readline/promises";
|
|
10
|
+
import chalk from "chalk";
|
|
11
|
+
import prompts from "prompts";
|
|
12
|
+
import { callAgentTransport } from "@downcity/agent";
|
|
13
|
+
import { emitCliBlock } from "../shared/CliReporter.js";
|
|
14
|
+
import { runWithSpinner, } from "../../utils/cli/Spinner.js";
|
|
15
|
+
import { printResult } from "../../utils/cli/CliOutput.js";
|
|
16
|
+
import { resolveProjectRootByAgentName, validateAgentProjectRoot, } from "../service/ServiceCommandSupport.js";
|
|
17
|
+
import { listRegisteredAgentsForCli } from "./AgentSelection.js";
|
|
18
|
+
import { AGENT_CHAT_DEFAULT_SESSION_ID } from "./AgentChatTypes.js";
|
|
19
|
+
const AGENT_CHAT_EXECUTE_TIMEOUT_MS = 120_000;
|
|
20
|
+
function normalizeChatMessage(input) {
|
|
21
|
+
return String(input || "").trim();
|
|
22
|
+
}
|
|
23
|
+
function isChatSuccess(payload) {
|
|
24
|
+
if (!payload || payload.success !== true)
|
|
25
|
+
return false;
|
|
26
|
+
if (payload.result?.success === false)
|
|
27
|
+
return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
async function resolveChatTargetAgentName(inputName) {
|
|
31
|
+
const explicit = String(inputName || "").trim();
|
|
32
|
+
if (explicit)
|
|
33
|
+
return explicit;
|
|
34
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
35
|
+
emitCliBlock({
|
|
36
|
+
tone: "error",
|
|
37
|
+
title: "Agent name is required",
|
|
38
|
+
note: "Use `city agent chat --to <agentName>` or run this command in an interactive terminal.",
|
|
39
|
+
});
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const runningAgents = (await listRegisteredAgentsForCli()).filter((item) => item.status === "running");
|
|
43
|
+
if (runningAgents.length === 0) {
|
|
44
|
+
emitCliBlock({
|
|
45
|
+
tone: "error",
|
|
46
|
+
title: "No running agents",
|
|
47
|
+
note: "Run `city agent start` first.",
|
|
48
|
+
});
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const response = (await prompts({
|
|
52
|
+
type: "select",
|
|
53
|
+
name: "agentName",
|
|
54
|
+
message: "选择要聊天的 Agent",
|
|
55
|
+
choices: runningAgents.map((agent) => ({
|
|
56
|
+
title: agent.name,
|
|
57
|
+
description: agent.projectRoot,
|
|
58
|
+
value: agent.name,
|
|
59
|
+
})),
|
|
60
|
+
initial: 0,
|
|
61
|
+
}));
|
|
62
|
+
const agentName = String(response.agentName || "").trim();
|
|
63
|
+
if (!agentName) {
|
|
64
|
+
emitCliBlock({
|
|
65
|
+
tone: "info",
|
|
66
|
+
title: "Agent chat cancelled",
|
|
67
|
+
});
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return agentName;
|
|
71
|
+
}
|
|
72
|
+
function printAssistantReply(replyText) {
|
|
73
|
+
const text = String(replyText || "").trim();
|
|
74
|
+
if (!text) {
|
|
75
|
+
emitCliBlock({
|
|
76
|
+
tone: "info",
|
|
77
|
+
title: "No visible reply",
|
|
78
|
+
note: "The turn completed, but no user-visible text was returned.",
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
console.log(`\n${text}\n`);
|
|
83
|
+
}
|
|
84
|
+
function printQueuedResult(params) {
|
|
85
|
+
emitCliBlock({
|
|
86
|
+
tone: "info",
|
|
87
|
+
title: "Turn queued",
|
|
88
|
+
facts: [
|
|
89
|
+
{
|
|
90
|
+
label: "agent",
|
|
91
|
+
value: params.agentName,
|
|
92
|
+
},
|
|
93
|
+
...(params.payload.result?.queueItemId
|
|
94
|
+
? [
|
|
95
|
+
{
|
|
96
|
+
label: "queue item",
|
|
97
|
+
value: params.payload.result.queueItemId,
|
|
98
|
+
},
|
|
99
|
+
]
|
|
100
|
+
: []),
|
|
101
|
+
],
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 向目标 agent 的 Console 主会话发送一轮消息。
|
|
106
|
+
*/
|
|
107
|
+
export async function executeAgentChatTurn(params) {
|
|
108
|
+
const agentName = String(params.agentName || "").trim();
|
|
109
|
+
const message = normalizeChatMessage(params.message);
|
|
110
|
+
const sessionId = AGENT_CHAT_DEFAULT_SESSION_ID;
|
|
111
|
+
if (!agentName) {
|
|
112
|
+
return {
|
|
113
|
+
agentName: "",
|
|
114
|
+
sessionId,
|
|
115
|
+
success: false,
|
|
116
|
+
error: "Missing target agent name.",
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (!message) {
|
|
120
|
+
return {
|
|
121
|
+
agentName,
|
|
122
|
+
sessionId,
|
|
123
|
+
success: false,
|
|
124
|
+
error: "Chat message is required.",
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const resolved = await resolveProjectRootByAgentName(agentName);
|
|
128
|
+
if (!resolved.projectRoot) {
|
|
129
|
+
return {
|
|
130
|
+
agentName,
|
|
131
|
+
sessionId,
|
|
132
|
+
success: false,
|
|
133
|
+
error: resolved.error || "Failed to resolve agent project path",
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const pathError = validateAgentProjectRoot(resolved.projectRoot);
|
|
137
|
+
if (pathError) {
|
|
138
|
+
return {
|
|
139
|
+
agentName,
|
|
140
|
+
projectRoot: resolved.projectRoot,
|
|
141
|
+
sessionId,
|
|
142
|
+
success: false,
|
|
143
|
+
error: pathError,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
const remote = await callAgentTransport({
|
|
147
|
+
projectRoot: resolved.projectRoot,
|
|
148
|
+
path: `/api/control/sessions/${encodeURIComponent(sessionId)}/execute`,
|
|
149
|
+
method: "POST",
|
|
150
|
+
timeoutMs: AGENT_CHAT_EXECUTE_TIMEOUT_MS,
|
|
151
|
+
host: params.transport?.host,
|
|
152
|
+
port: params.transport?.port,
|
|
153
|
+
authToken: params.transport?.token,
|
|
154
|
+
body: {
|
|
155
|
+
instructions: message,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
if (!remote.success || !remote.data) {
|
|
159
|
+
return {
|
|
160
|
+
agentName,
|
|
161
|
+
projectRoot: resolved.projectRoot,
|
|
162
|
+
sessionId,
|
|
163
|
+
success: false,
|
|
164
|
+
error: remote.error || "Agent daemon unreachable or returned empty error (try `city agent restart`)",
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
agentName,
|
|
169
|
+
projectRoot: resolved.projectRoot,
|
|
170
|
+
sessionId: String(remote.data.sessionId || sessionId),
|
|
171
|
+
success: isChatSuccess(remote.data),
|
|
172
|
+
payload: remote.data,
|
|
173
|
+
...(isChatSuccess(remote.data)
|
|
174
|
+
? {}
|
|
175
|
+
: {
|
|
176
|
+
error: String(remote.data.result?.error || remote.data.error || "").trim() ||
|
|
177
|
+
"Daemon error (check `city agent status` and `city agent doctor`)",
|
|
178
|
+
}),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
async function runOneShotChat(params) {
|
|
182
|
+
const outcome = await runWithSpinner(async () => {
|
|
183
|
+
return await executeAgentChatTurn({
|
|
184
|
+
agentName: params.agentName,
|
|
185
|
+
message: params.message,
|
|
186
|
+
transport: {
|
|
187
|
+
host: params.options.host,
|
|
188
|
+
port: params.options.port,
|
|
189
|
+
token: params.options.token,
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
}, {
|
|
193
|
+
text: `${params.agentName} is replying...`,
|
|
194
|
+
disabled: params.options.json === true,
|
|
195
|
+
});
|
|
196
|
+
if (params.options.json === true) {
|
|
197
|
+
printResult({
|
|
198
|
+
asJson: true,
|
|
199
|
+
success: outcome.success,
|
|
200
|
+
title: "agent chat",
|
|
201
|
+
payload: {
|
|
202
|
+
agent: params.agentName,
|
|
203
|
+
...(outcome.projectRoot ? { projectRoot: outcome.projectRoot } : {}),
|
|
204
|
+
sessionId: outcome.sessionId,
|
|
205
|
+
...(outcome.payload?.result ? { result: outcome.payload.result } : {}),
|
|
206
|
+
...(outcome.error ? { error: outcome.error } : {}),
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (!outcome.success || !outcome.payload) {
|
|
212
|
+
emitCliBlock({
|
|
213
|
+
tone: "error",
|
|
214
|
+
title: "Agent chat failed",
|
|
215
|
+
facts: [
|
|
216
|
+
{
|
|
217
|
+
label: "agent",
|
|
218
|
+
value: params.agentName,
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
label: "error",
|
|
222
|
+
value: outcome.error || "Agent daemon returned empty error (check config with `city agent status`)",
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
});
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (outcome.payload.result?.queued === true) {
|
|
229
|
+
printQueuedResult({
|
|
230
|
+
agentName: params.agentName,
|
|
231
|
+
payload: outcome.payload,
|
|
232
|
+
});
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
printAssistantReply(String(outcome.payload.result?.userVisible || ""));
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* 启动交互式持续对话。
|
|
239
|
+
*/
|
|
240
|
+
async function runInteractiveChat(params) {
|
|
241
|
+
const prompt = `${chalk.cyan(params.agentName)} ${chalk.dim("›")} `;
|
|
242
|
+
const helpText = [
|
|
243
|
+
`${chalk.dim("/exit, /quit — 退出对话")}`,
|
|
244
|
+
`${chalk.dim("/clear — 清屏")}`,
|
|
245
|
+
`${chalk.dim("/help — 显示此帮助")}`,
|
|
246
|
+
`${chalk.dim("Ctrl+C — 退出对话")}`,
|
|
247
|
+
];
|
|
248
|
+
emitCliBlock({
|
|
249
|
+
tone: "info",
|
|
250
|
+
title: `Agent chat · ${params.agentName}`,
|
|
251
|
+
note: `Session: local-cli-chat-main · ${helpText[0].replace(chalk.dim(""), "").trim()}`,
|
|
252
|
+
});
|
|
253
|
+
console.log(helpText.join("\n"));
|
|
254
|
+
const rl = createInterface({
|
|
255
|
+
input: process.stdin,
|
|
256
|
+
output: process.stdout,
|
|
257
|
+
terminal: true,
|
|
258
|
+
});
|
|
259
|
+
try {
|
|
260
|
+
while (true) {
|
|
261
|
+
const line = await rl.question(prompt);
|
|
262
|
+
const text = normalizeChatMessage(line);
|
|
263
|
+
if (!text)
|
|
264
|
+
continue;
|
|
265
|
+
if (text === "/exit" || text === "/quit")
|
|
266
|
+
break;
|
|
267
|
+
if (text === "/clear") {
|
|
268
|
+
console.clear();
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (text === "/help") {
|
|
272
|
+
console.log(helpText.join("\n"));
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
const outcome = await runWithSpinner(async () => {
|
|
276
|
+
return await executeAgentChatTurn({
|
|
277
|
+
agentName: params.agentName,
|
|
278
|
+
message: text,
|
|
279
|
+
transport: {
|
|
280
|
+
host: params.options.host,
|
|
281
|
+
port: params.options.port,
|
|
282
|
+
token: params.options.token,
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
}, {
|
|
286
|
+
text: `${params.agentName} is replying...`,
|
|
287
|
+
});
|
|
288
|
+
if (!outcome.success || !outcome.payload) {
|
|
289
|
+
emitCliBlock({
|
|
290
|
+
tone: "error",
|
|
291
|
+
title: "Agent chat failed",
|
|
292
|
+
facts: [
|
|
293
|
+
{
|
|
294
|
+
label: "agent",
|
|
295
|
+
value: params.agentName,
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
label: "error",
|
|
299
|
+
value: outcome.error || "Agent daemon returned empty error (check config with `city agent status`)",
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
});
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
if (outcome.payload.result?.queued === true) {
|
|
306
|
+
printQueuedResult({
|
|
307
|
+
agentName: params.agentName,
|
|
308
|
+
payload: outcome.payload,
|
|
309
|
+
});
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
printAssistantReply(String(outcome.payload.result?.userVisible || ""));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
finally {
|
|
316
|
+
rl.close();
|
|
317
|
+
}
|
|
318
|
+
console.log(chalk.dim("Chat ended."));
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* `city agent chat` 统一入口。
|
|
322
|
+
*/
|
|
323
|
+
export async function chatCommand(options) {
|
|
324
|
+
const agentName = await resolveChatTargetAgentName(options.to);
|
|
325
|
+
if (!agentName)
|
|
326
|
+
return;
|
|
327
|
+
const oneShotMessage = normalizeChatMessage(String(options.message || ""));
|
|
328
|
+
if (oneShotMessage) {
|
|
329
|
+
await runOneShotChat({
|
|
330
|
+
agentName,
|
|
331
|
+
message: oneShotMessage,
|
|
332
|
+
options,
|
|
333
|
+
});
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (options.json === true) {
|
|
337
|
+
emitCliBlock({
|
|
338
|
+
tone: "error",
|
|
339
|
+
title: "JSON mode requires --message",
|
|
340
|
+
note: "Use `city agent chat --message <text> --json` for one-shot structured output.",
|
|
341
|
+
});
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
345
|
+
emitCliBlock({
|
|
346
|
+
tone: "error",
|
|
347
|
+
title: "Interactive terminal required",
|
|
348
|
+
note: "Use this command in a local terminal with TTY support, or pass `--message` for one-shot mode.",
|
|
349
|
+
});
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
await runInteractiveChat({
|
|
353
|
+
agentName,
|
|
354
|
+
options,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=AgentChat.js.map
|