@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
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ControlPlaneStatus:city gateway / control plane 命令的状态展示辅助。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 聚合 city 后台、gateway/control plane 与受管 agent 的状态面板输出。
|
|
6
|
+
* - 与进程控制逻辑解耦,便于后续继续拆分命令入口文件。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
getControlPlaneRuntimeStatus,
|
|
11
|
+
} from "./ControlPlaneRuntime.js";
|
|
12
|
+
import type { ManagedAgentProcessView } from "@downcity/agent";
|
|
13
|
+
import {
|
|
14
|
+
getManagedAgentRegistryPath,
|
|
15
|
+
getCityPidPath,
|
|
16
|
+
} from "@/process/registry/CityPaths.js";
|
|
17
|
+
import { isCityProcessAlive, readCityPid } from "@/process/registry/CityRuntime.js";
|
|
18
|
+
import { emitCliBlock, emitCliList } from "../shared/CliReporter.js";
|
|
19
|
+
import { resolveRunningManagedAgents } from "./ControlPlaneProcess.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 打印当前受管 agent 面板。
|
|
23
|
+
*/
|
|
24
|
+
export function printRunningManagedAgents(views: ManagedAgentProcessView[]): void {
|
|
25
|
+
if (views.length === 0) {
|
|
26
|
+
emitCliBlock({
|
|
27
|
+
tone: "info",
|
|
28
|
+
title: "Managed agents",
|
|
29
|
+
summary: "0 active",
|
|
30
|
+
note: "no running agent daemon",
|
|
31
|
+
});
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emitCliList({
|
|
35
|
+
tone: "accent",
|
|
36
|
+
title: "Managed agents",
|
|
37
|
+
summary: `${views.length} active`,
|
|
38
|
+
items: views.map((item) => ({
|
|
39
|
+
title: item.projectRoot.split("/").filter(Boolean).at(-1) || item.projectRoot,
|
|
40
|
+
facts: [
|
|
41
|
+
{
|
|
42
|
+
label: "project",
|
|
43
|
+
value: item.projectRoot,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "started at",
|
|
47
|
+
value: item.startedAt,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "updated at",
|
|
51
|
+
value: item.updatedAt,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
})),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 打印 city 后台、control plane 与受管 agent 的状态面板。
|
|
60
|
+
*/
|
|
61
|
+
export async function controlPlaneStatusCommand(): Promise<void> {
|
|
62
|
+
const pidPath = getCityPidPath();
|
|
63
|
+
|
|
64
|
+
const cityPid = await readCityPid();
|
|
65
|
+
const running = Boolean(cityPid && isCityProcessAlive(cityPid));
|
|
66
|
+
emitCliBlock({
|
|
67
|
+
tone: running ? "success" : cityPid ? "warning" : "info",
|
|
68
|
+
title: "City runtime",
|
|
69
|
+
summary: running ? "running" : cityPid ? "stale" : "stopped",
|
|
70
|
+
facts: [
|
|
71
|
+
{
|
|
72
|
+
label: "registry",
|
|
73
|
+
value: getManagedAgentRegistryPath(),
|
|
74
|
+
},
|
|
75
|
+
...(cityPid && !running
|
|
76
|
+
? [
|
|
77
|
+
{
|
|
78
|
+
label: "warning",
|
|
79
|
+
value: "stale pid file detected",
|
|
80
|
+
},
|
|
81
|
+
]
|
|
82
|
+
: []),
|
|
83
|
+
...(pidPath
|
|
84
|
+
? [
|
|
85
|
+
{
|
|
86
|
+
label: "pid file",
|
|
87
|
+
value: pidPath,
|
|
88
|
+
},
|
|
89
|
+
]
|
|
90
|
+
: []),
|
|
91
|
+
],
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const ui = await getControlPlaneRuntimeStatus();
|
|
95
|
+
emitCliBlock({
|
|
96
|
+
tone: ui.running ? "success" : "info",
|
|
97
|
+
title: "Console",
|
|
98
|
+
summary: ui.running ? "running" : "stopped",
|
|
99
|
+
facts: ui.url
|
|
100
|
+
? [
|
|
101
|
+
{
|
|
102
|
+
label: "url",
|
|
103
|
+
value: ui.url,
|
|
104
|
+
},
|
|
105
|
+
]
|
|
106
|
+
: [],
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
const runningAgents = await resolveRunningManagedAgents({
|
|
111
|
+
syncRegistry: false,
|
|
112
|
+
});
|
|
113
|
+
printRunningManagedAgents(runningAgents);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
emitCliBlock({
|
|
116
|
+
tone: "warning",
|
|
117
|
+
title: "Managed agents",
|
|
118
|
+
summary: "unavailable",
|
|
119
|
+
facts: [
|
|
120
|
+
{
|
|
121
|
+
label: "detail",
|
|
122
|
+
value: String(error),
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* 打印 control plane 独立状态面板。
|
|
131
|
+
*/
|
|
132
|
+
export function printControlPlaneStatusPanel(status: {
|
|
133
|
+
running: boolean;
|
|
134
|
+
pid?: number;
|
|
135
|
+
pidPath: string;
|
|
136
|
+
logPath: string;
|
|
137
|
+
url?: string;
|
|
138
|
+
}): void {
|
|
139
|
+
emitCliBlock({
|
|
140
|
+
tone: status.running ? "success" : "info",
|
|
141
|
+
title: "Console",
|
|
142
|
+
summary: status.running ? "running" : "stopped",
|
|
143
|
+
facts: status.url
|
|
144
|
+
? [
|
|
145
|
+
{
|
|
146
|
+
label: "url",
|
|
147
|
+
value: status.url,
|
|
148
|
+
},
|
|
149
|
+
]
|
|
150
|
+
: [],
|
|
151
|
+
});
|
|
152
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `city model` 命令共享工具。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 统一封装 provider / model 子命令共用的解析、脱敏、错误输出逻辑。
|
|
6
|
+
* - 保持 `Model.ts` 只负责命令装配,不再承载具体业务实现。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { printResult } from "@/utils/cli/CliOutput.js";
|
|
10
|
+
import {
|
|
11
|
+
ModelPresetManager,
|
|
12
|
+
type ModelPreset,
|
|
13
|
+
} from "@/cli/model/preset/ModelPresetManager.js";
|
|
14
|
+
import type { LlmProviderType } from "@downcity/agent";
|
|
15
|
+
import { PlatformStore } from "@downcity/agent";
|
|
16
|
+
|
|
17
|
+
const SUPPORTED_PROVIDER_TYPES: readonly LlmProviderType[] = [
|
|
18
|
+
"anthropic",
|
|
19
|
+
"openai",
|
|
20
|
+
"deepseek",
|
|
21
|
+
"gemini",
|
|
22
|
+
"open-compatible",
|
|
23
|
+
"open-responses",
|
|
24
|
+
"moonshot-cn",
|
|
25
|
+
"moonshot-ai",
|
|
26
|
+
"kimi-code",
|
|
27
|
+
"xai",
|
|
28
|
+
"huggingface",
|
|
29
|
+
"openrouter",
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const modelManager = new ModelPresetManager();
|
|
33
|
+
|
|
34
|
+
function maskSecret(value: string | undefined): string | undefined {
|
|
35
|
+
const raw = String(value || "").trim();
|
|
36
|
+
if (!raw) return undefined;
|
|
37
|
+
if (raw.length <= 8) return "***";
|
|
38
|
+
return `${raw.slice(0, 4)}***${raw.slice(-4)}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function toSafeProviderView<T extends { apiKey?: string }>(provider: T): T & {
|
|
42
|
+
apiKeyMasked?: string;
|
|
43
|
+
} {
|
|
44
|
+
const masked = maskSecret(provider.apiKey);
|
|
45
|
+
return {
|
|
46
|
+
...provider,
|
|
47
|
+
apiKey: masked ? "***masked***" : undefined,
|
|
48
|
+
apiKeyMasked: masked,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { parseBoolean as parseBooleanOption } from "../shared/IndexSupport.js";
|
|
53
|
+
|
|
54
|
+
export function parseNumberOption(value: string): number {
|
|
55
|
+
const num = Number(value);
|
|
56
|
+
if (!Number.isFinite(num) || Number.isNaN(num)) {
|
|
57
|
+
throw new Error(`Invalid number: ${value}`);
|
|
58
|
+
}
|
|
59
|
+
return num;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function parsePositiveIntegerOption(value: string): number {
|
|
63
|
+
const num = Number.parseInt(value, 10);
|
|
64
|
+
if (!Number.isFinite(num) || Number.isNaN(num) || !Number.isInteger(num) || num <= 0) {
|
|
65
|
+
throw new Error(`Invalid positive integer: ${value}`);
|
|
66
|
+
}
|
|
67
|
+
return num;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function assertProviderType(inputType: string): LlmProviderType {
|
|
71
|
+
const candidate = String(inputType || "").trim() as LlmProviderType;
|
|
72
|
+
if (!SUPPORTED_PROVIDER_TYPES.includes(candidate)) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
`Unsupported provider type: ${inputType}. Supported: ${SUPPORTED_PROVIDER_TYPES.join(", ")}`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return candidate;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function getSupportedProviderTypes(): readonly LlmProviderType[] {
|
|
81
|
+
return SUPPORTED_PROVIDER_TYPES;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function resolveModelPresetOrThrow(input?: string): ModelPreset | undefined {
|
|
85
|
+
const presetId = String(input || "").trim();
|
|
86
|
+
if (!presetId) return undefined;
|
|
87
|
+
const preset = modelManager.getPreset(presetId);
|
|
88
|
+
if (!preset) throw new Error(`Unknown model preset: ${presetId}`);
|
|
89
|
+
return preset;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export async function runStoreCommand(
|
|
93
|
+
options: { json?: boolean },
|
|
94
|
+
handler: (store: PlatformStore) => Promise<{
|
|
95
|
+
title: string;
|
|
96
|
+
payload: Record<string, unknown>;
|
|
97
|
+
}>,
|
|
98
|
+
): Promise<void> {
|
|
99
|
+
const asJson = options.json !== false;
|
|
100
|
+
let store: PlatformStore | null = null;
|
|
101
|
+
try {
|
|
102
|
+
store = new PlatformStore();
|
|
103
|
+
const result = await handler(store);
|
|
104
|
+
printResult({
|
|
105
|
+
asJson,
|
|
106
|
+
success: true,
|
|
107
|
+
title: result.title,
|
|
108
|
+
payload: result.payload,
|
|
109
|
+
});
|
|
110
|
+
} catch (error) {
|
|
111
|
+
printResult({
|
|
112
|
+
asJson,
|
|
113
|
+
success: false,
|
|
114
|
+
title: "platform model command failed",
|
|
115
|
+
payload: {
|
|
116
|
+
error:
|
|
117
|
+
error instanceof Error &&
|
|
118
|
+
String(error.message || "").includes("unable to open database file")
|
|
119
|
+
? 'Platform model store is unavailable. Run "city init" first.'
|
|
120
|
+
: error instanceof Error
|
|
121
|
+
? error.message
|
|
122
|
+
: String(error),
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
process.exitCode = 1;
|
|
126
|
+
} finally {
|
|
127
|
+
store?.close();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `city model create` 交互命令。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - `create` 是 model 命令组里“直接进入创建流程”的快捷入口。
|
|
6
|
+
* - provider 创建后可立即测试并批量导入发现到的远端模型。
|
|
7
|
+
* - 模型创建支持两种方式:手动输入 或 从 Provider 发现并多选创建。
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import prompts from "prompts";
|
|
11
|
+
import type { Command } from "commander";
|
|
12
|
+
import { PlatformStore } from "@downcity/agent";
|
|
13
|
+
import { printResult } from "@/utils/cli/CliOutput.js";
|
|
14
|
+
import {
|
|
15
|
+
discoverProviderModels,
|
|
16
|
+
type ProviderDiscoveryResult,
|
|
17
|
+
} from "./ModelSupport.js";
|
|
18
|
+
import {
|
|
19
|
+
assertProviderType,
|
|
20
|
+
getSupportedProviderTypes,
|
|
21
|
+
parseBooleanOption,
|
|
22
|
+
parseNumberOption,
|
|
23
|
+
parsePositiveIntegerOption,
|
|
24
|
+
} from "./ModelCommandShared.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 运行 `city model create` 交互流程。
|
|
28
|
+
*
|
|
29
|
+
* 关键点(中文)
|
|
30
|
+
* - 既供 `city model create` 直接调用,也供裸 `city model` manager 复用。
|
|
31
|
+
*/
|
|
32
|
+
export async function runInteractiveModelCreateFlow(options: { json?: boolean }): Promise<void> {
|
|
33
|
+
const asJson = options.json !== false;
|
|
34
|
+
let store: PlatformStore | null = null;
|
|
35
|
+
try {
|
|
36
|
+
store = new PlatformStore();
|
|
37
|
+
const createChoice = await prompts({
|
|
38
|
+
type: "select",
|
|
39
|
+
name: "mode",
|
|
40
|
+
message: "选择创建类型",
|
|
41
|
+
choices: [
|
|
42
|
+
{ title: "创建 Provider", value: "provider" },
|
|
43
|
+
{ title: "创建 Model", value: "model" },
|
|
44
|
+
],
|
|
45
|
+
initial: 0,
|
|
46
|
+
});
|
|
47
|
+
const mode = String(createChoice.mode || "").trim();
|
|
48
|
+
if (!mode) {
|
|
49
|
+
printResult({
|
|
50
|
+
asJson,
|
|
51
|
+
success: false,
|
|
52
|
+
title: "platform model create cancelled",
|
|
53
|
+
payload: { error: "Cancelled" },
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (mode === "provider") {
|
|
59
|
+
await runInteractiveProviderCreate(store, asJson);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
await runInteractiveModelCreate(store, asJson);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
printResult({
|
|
66
|
+
asJson,
|
|
67
|
+
success: false,
|
|
68
|
+
title: "platform model create failed",
|
|
69
|
+
payload: { error: error instanceof Error ? error.message : String(error) },
|
|
70
|
+
});
|
|
71
|
+
process.exitCode = 1;
|
|
72
|
+
} finally {
|
|
73
|
+
store?.close();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function runInteractiveProviderCreate(
|
|
78
|
+
store: PlatformStore,
|
|
79
|
+
asJson: boolean,
|
|
80
|
+
): Promise<void> {
|
|
81
|
+
const providerResp = (await prompts([
|
|
82
|
+
{
|
|
83
|
+
type: "text",
|
|
84
|
+
name: "providerId",
|
|
85
|
+
message: "Provider ID",
|
|
86
|
+
validate: (value: string) =>
|
|
87
|
+
String(value || "").trim().length > 0 ? true : "providerId 不能为空",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "select",
|
|
91
|
+
name: "providerType",
|
|
92
|
+
message: "Provider 类型",
|
|
93
|
+
choices: getSupportedProviderTypes().map((item) => ({ title: item, value: item })),
|
|
94
|
+
initial: 0,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: "text",
|
|
98
|
+
name: "baseUrl",
|
|
99
|
+
message: "Base URL(可选,留空使用默认)",
|
|
100
|
+
initial: "",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: "text",
|
|
104
|
+
name: "apiKey",
|
|
105
|
+
message: "API Key(支持 ${ENV_VAR})",
|
|
106
|
+
validate: (value: string) =>
|
|
107
|
+
String(value || "").trim().length > 0 ? true : "apiKey 不能为空",
|
|
108
|
+
},
|
|
109
|
+
])) as {
|
|
110
|
+
providerId?: string;
|
|
111
|
+
providerType?: string;
|
|
112
|
+
baseUrl?: string;
|
|
113
|
+
apiKey?: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const providerId = String(providerResp.providerId || "").trim();
|
|
117
|
+
const providerType = assertProviderType(String(providerResp.providerType || ""));
|
|
118
|
+
if (!providerId) throw new Error("providerId cannot be empty");
|
|
119
|
+
const current = await store.getProvider(providerId);
|
|
120
|
+
if (current) throw new Error(`Provider already exists: ${providerId}`);
|
|
121
|
+
|
|
122
|
+
const providerInput = {
|
|
123
|
+
id: providerId,
|
|
124
|
+
type: providerType,
|
|
125
|
+
...(String(providerResp.baseUrl || "").trim()
|
|
126
|
+
? { baseUrl: String(providerResp.baseUrl || "").trim() }
|
|
127
|
+
: {}),
|
|
128
|
+
apiKey: String(providerResp.apiKey || "").trim(),
|
|
129
|
+
};
|
|
130
|
+
await store.upsertProvider(providerInput);
|
|
131
|
+
|
|
132
|
+
const testConfirm = (await prompts({
|
|
133
|
+
type: "confirm",
|
|
134
|
+
name: "testNow",
|
|
135
|
+
message: "立即测试 provider 并尝试发现可用模型?",
|
|
136
|
+
initial: true,
|
|
137
|
+
})) as { testNow?: boolean };
|
|
138
|
+
|
|
139
|
+
let discovery: ProviderDiscoveryResult | undefined;
|
|
140
|
+
if (testConfirm.testNow === true) {
|
|
141
|
+
discovery = await discoverProviderModels({
|
|
142
|
+
providerId,
|
|
143
|
+
providerType,
|
|
144
|
+
baseUrl: providerInput.baseUrl,
|
|
145
|
+
apiKey: providerInput.apiKey,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const autoAdded: string[] = [];
|
|
150
|
+
if (discovery?.ok && discovery.models.length > 0) {
|
|
151
|
+
const modelPick = (await prompts({
|
|
152
|
+
type: "multiselect",
|
|
153
|
+
name: "modelIds",
|
|
154
|
+
message: "选择要自动添加到模型池的模型(可多选)",
|
|
155
|
+
choices: discovery.models.slice(0, 40).map((id) => ({
|
|
156
|
+
title: id,
|
|
157
|
+
value: id,
|
|
158
|
+
selected: false,
|
|
159
|
+
})),
|
|
160
|
+
})) as { modelIds?: string[] };
|
|
161
|
+
|
|
162
|
+
const picked = Array.isArray(modelPick.modelIds) ? modelPick.modelIds : [];
|
|
163
|
+
for (const remoteModelName of picked) {
|
|
164
|
+
const id = String(remoteModelName || "").trim();
|
|
165
|
+
if (!id) continue;
|
|
166
|
+
const exists = store.getModel(id);
|
|
167
|
+
if (exists) continue;
|
|
168
|
+
store.upsertModel({
|
|
169
|
+
id,
|
|
170
|
+
providerId,
|
|
171
|
+
name: id,
|
|
172
|
+
});
|
|
173
|
+
autoAdded.push(id);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
printResult({
|
|
178
|
+
asJson,
|
|
179
|
+
success: true,
|
|
180
|
+
title: "provider created",
|
|
181
|
+
payload: {
|
|
182
|
+
providerId,
|
|
183
|
+
providerType,
|
|
184
|
+
encryptedStorage: "provider.apiKey will be stored encrypted in ~/.downcity/downcity.db",
|
|
185
|
+
...(discovery
|
|
186
|
+
? {
|
|
187
|
+
test: {
|
|
188
|
+
ok: discovery.ok,
|
|
189
|
+
status: discovery.status,
|
|
190
|
+
discoveredModels: discovery.models.length,
|
|
191
|
+
error: discovery.error,
|
|
192
|
+
},
|
|
193
|
+
}
|
|
194
|
+
: {}),
|
|
195
|
+
autoAddedModels: autoAdded,
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function runInteractiveModelCreate(
|
|
201
|
+
store: PlatformStore,
|
|
202
|
+
asJson: boolean,
|
|
203
|
+
): Promise<void> {
|
|
204
|
+
const providers = await store.listProviders();
|
|
205
|
+
if (providers.length === 0) {
|
|
206
|
+
throw new Error(
|
|
207
|
+
"No provider found. Please run `city model create` and choose provider first.",
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// 关键点(中文):提供两种创建方式 — 手动输入 或 从 Provider 发现并多选。
|
|
212
|
+
const createMethodChoice = await prompts({
|
|
213
|
+
type: "select",
|
|
214
|
+
name: "method",
|
|
215
|
+
message: "选择模型创建方式",
|
|
216
|
+
choices: [
|
|
217
|
+
{ title: "从 Provider 发现并多选创建(推荐)", value: "discover" },
|
|
218
|
+
{ title: "手动输入模型信息", value: "manual" },
|
|
219
|
+
],
|
|
220
|
+
initial: 0,
|
|
221
|
+
});
|
|
222
|
+
const method = String(createMethodChoice.method || "").trim();
|
|
223
|
+
|
|
224
|
+
if (method === "discover") {
|
|
225
|
+
await runInteractiveModelDiscoverCreate(store, providers, asJson);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
await runInteractiveModelManualCreate(store, providers, asJson);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 从 Provider 发现可用模型并多选批量创建。
|
|
234
|
+
*
|
|
235
|
+
* 关键点(中文)
|
|
236
|
+
* - 无需用户手填模型 ID/名称,直接从 provider API 拉取可用模型列表。
|
|
237
|
+
* - 支持添加前缀(如 `my/`、`hf/`),便于区分不同 provider 的同名模型。
|
|
238
|
+
* - 自动跳过已存在的模型 ID。
|
|
239
|
+
*/
|
|
240
|
+
async function runInteractiveModelDiscoverCreate(
|
|
241
|
+
store: PlatformStore,
|
|
242
|
+
providers: Awaited<ReturnType<PlatformStore["listProviders"]>>,
|
|
243
|
+
asJson: boolean,
|
|
244
|
+
): Promise<void> {
|
|
245
|
+
const providerResp = await prompts([
|
|
246
|
+
{
|
|
247
|
+
type: "select",
|
|
248
|
+
name: "providerId",
|
|
249
|
+
message: "选择要发现的 Provider",
|
|
250
|
+
choices: providers.map((provider) => ({
|
|
251
|
+
title: `${provider.id} (${provider.type})`,
|
|
252
|
+
value: provider.id,
|
|
253
|
+
})),
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
type: "text",
|
|
257
|
+
name: "prefix",
|
|
258
|
+
message: "模型 ID 前缀(可选,如 my/、hf/)",
|
|
259
|
+
initial: "",
|
|
260
|
+
},
|
|
261
|
+
]);
|
|
262
|
+
|
|
263
|
+
const providerId = String(providerResp.providerId || "").trim();
|
|
264
|
+
if (!providerId) throw new Error("providerId cannot be empty");
|
|
265
|
+
const prefix = String(providerResp.prefix || "").trim();
|
|
266
|
+
|
|
267
|
+
const provider = await store.getProvider(providerId);
|
|
268
|
+
if (!provider) throw new Error(`Provider not found: ${providerId}`);
|
|
269
|
+
|
|
270
|
+
const discovery = await discoverProviderModels({
|
|
271
|
+
providerId,
|
|
272
|
+
providerType: provider.type,
|
|
273
|
+
baseUrl: provider.baseUrl,
|
|
274
|
+
apiKey: provider.apiKey,
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
if (!discovery.ok || discovery.models.length === 0) {
|
|
278
|
+
throw new Error(
|
|
279
|
+
discovery.error || `Provider ${providerId} 未返回可用模型`,
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const modelPick = (await prompts({
|
|
284
|
+
type: "multiselect",
|
|
285
|
+
name: "modelIds",
|
|
286
|
+
message: `发现 ${discovery.models.length} 个模型,选择要添加的(空格选择,回车确认)`,
|
|
287
|
+
choices: discovery.models.slice(0, 70).map((name) => {
|
|
288
|
+
const modelId = prefix ? `${prefix}${name}` : name;
|
|
289
|
+
const exists = store.getModel(modelId);
|
|
290
|
+
return {
|
|
291
|
+
title: exists ? `${name} → ${modelId} (已存在)` : `${name} → ${modelId}`,
|
|
292
|
+
value: name,
|
|
293
|
+
disabled: Boolean(exists),
|
|
294
|
+
selected: false,
|
|
295
|
+
};
|
|
296
|
+
}),
|
|
297
|
+
hint: "空格选中/取消,回车确认",
|
|
298
|
+
})) as { modelIds?: string[] };
|
|
299
|
+
|
|
300
|
+
const picked = Array.isArray(modelPick.modelIds) ? modelPick.modelIds : [];
|
|
301
|
+
const autoAdded: string[] = [];
|
|
302
|
+
for (const remoteModelName of picked) {
|
|
303
|
+
const name = String(remoteModelName || "").trim();
|
|
304
|
+
if (!name) continue;
|
|
305
|
+
const modelId = prefix ? `${prefix}${name}` : name;
|
|
306
|
+
if (store.getModel(modelId)) continue;
|
|
307
|
+
store.upsertModel({ id: modelId, providerId, name });
|
|
308
|
+
autoAdded.push(modelId);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
printResult({
|
|
312
|
+
asJson,
|
|
313
|
+
success: true,
|
|
314
|
+
title: "models created from provider discovery",
|
|
315
|
+
payload: {
|
|
316
|
+
providerId,
|
|
317
|
+
prefix: prefix || undefined,
|
|
318
|
+
discoveredCount: discovery.models.length,
|
|
319
|
+
addedCount: autoAdded.length,
|
|
320
|
+
addedModelIds: autoAdded,
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* 手动输入模型信息并创建(原有流程)。
|
|
327
|
+
*
|
|
328
|
+
* 关键点(中文)
|
|
329
|
+
* - 保留原有手动创建能力,供需要自定义模型 ID 或参数的用户使用。
|
|
330
|
+
*/
|
|
331
|
+
async function runInteractiveModelManualCreate(
|
|
332
|
+
store: PlatformStore,
|
|
333
|
+
providers: Awaited<ReturnType<PlatformStore["listProviders"]>>,
|
|
334
|
+
asJson: boolean,
|
|
335
|
+
): Promise<void> {
|
|
336
|
+
const modelResp = (await prompts([
|
|
337
|
+
{
|
|
338
|
+
type: "text",
|
|
339
|
+
name: "modelId",
|
|
340
|
+
message: "Model ID(本地标识)",
|
|
341
|
+
validate: (value: string) =>
|
|
342
|
+
String(value || "").trim().length > 0 ? true : "modelId 不能为空",
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
type: "select",
|
|
346
|
+
name: "providerId",
|
|
347
|
+
message: "选择 Provider",
|
|
348
|
+
choices: providers.map((provider) => ({
|
|
349
|
+
title: `${provider.id} (${provider.type})`,
|
|
350
|
+
value: provider.id,
|
|
351
|
+
})),
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
type: "text",
|
|
355
|
+
name: "modelName",
|
|
356
|
+
message: "上游模型名(如 gpt-4o / claude-sonnet-4-5)",
|
|
357
|
+
validate: (value: string) =>
|
|
358
|
+
String(value || "").trim().length > 0 ? true : "modelName 不能为空",
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
type: "text",
|
|
362
|
+
name: "temperature",
|
|
363
|
+
message: "temperature(可选,留空跳过)",
|
|
364
|
+
initial: "",
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
type: "text",
|
|
368
|
+
name: "maxTokens",
|
|
369
|
+
message: "maxTokens(可选,留空跳过)",
|
|
370
|
+
initial: "",
|
|
371
|
+
},
|
|
372
|
+
])) as {
|
|
373
|
+
modelId?: string;
|
|
374
|
+
providerId?: string;
|
|
375
|
+
modelName?: string;
|
|
376
|
+
temperature?: string;
|
|
377
|
+
maxTokens?: string;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
const modelId = String(modelResp.modelId || "").trim();
|
|
381
|
+
const providerId = String(modelResp.providerId || "").trim();
|
|
382
|
+
const modelName = String(modelResp.modelName || "").trim();
|
|
383
|
+
if (!modelId) throw new Error("modelId cannot be empty");
|
|
384
|
+
if (!providerId) throw new Error("providerId cannot be empty");
|
|
385
|
+
if (!modelName) throw new Error("modelName cannot be empty");
|
|
386
|
+
if (store.getModel(modelId)) throw new Error(`Model already exists: ${modelId}`);
|
|
387
|
+
|
|
388
|
+
store.upsertModel({
|
|
389
|
+
id: modelId,
|
|
390
|
+
providerId,
|
|
391
|
+
name: modelName,
|
|
392
|
+
...(String(modelResp.temperature || "").trim()
|
|
393
|
+
? { temperature: parseNumberOption(String(modelResp.temperature)) }
|
|
394
|
+
: {}),
|
|
395
|
+
...(String(modelResp.maxTokens || "").trim()
|
|
396
|
+
? { maxTokens: parsePositiveIntegerOption(String(modelResp.maxTokens)) }
|
|
397
|
+
: {}),
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
printResult({
|
|
401
|
+
asJson,
|
|
402
|
+
success: true,
|
|
403
|
+
title: "model created",
|
|
404
|
+
payload: {
|
|
405
|
+
modelId,
|
|
406
|
+
providerId,
|
|
407
|
+
modelName,
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* 注册 `city model create` 交互命令。
|
|
414
|
+
*/
|
|
415
|
+
export function registerModelCreateCommand(model: Command): void {
|
|
416
|
+
model
|
|
417
|
+
.command("create")
|
|
418
|
+
.description("直接进入创建 provider 或 model 的交互流程")
|
|
419
|
+
.option("--json [enabled]", "以 JSON 输出", parseBooleanOption, true)
|
|
420
|
+
.helpOption("--help", "display help for command")
|
|
421
|
+
.action(async (options: { json?: boolean }) => {
|
|
422
|
+
await runInteractiveModelCreateFlow(options);
|
|
423
|
+
});
|
|
424
|
+
}
|