downcity 1.1.39 → 1.1.69
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 +10 -251
- package/bin/city/index.js +8 -0
- package/bin/town/index.js +8 -0
- package/city/admin/auth-error.d.ts +34 -0
- package/city/admin/auth-error.d.ts.map +1 -0
- package/city/admin/auth-error.js +51 -0
- package/city/admin/auth-error.js.map +1 -0
- package/city/admin/commands/accounts.d.ts +6 -0
- package/city/admin/commands/accounts.d.ts.map +1 -0
- package/city/admin/commands/accounts.js +44 -0
- package/city/admin/commands/accounts.js.map +1 -0
- package/city/admin/commands/balance.d.ts +6 -0
- package/city/admin/commands/balance.d.ts.map +1 -0
- package/city/admin/commands/balance.js +153 -0
- package/city/admin/commands/balance.js.map +1 -0
- package/city/admin/commands/config.d.ts +10 -0
- package/city/admin/commands/config.d.ts.map +1 -0
- package/city/admin/commands/config.js +11 -0
- package/city/admin/commands/config.js.map +1 -0
- package/city/admin/commands/custom.d.ts +6 -0
- package/city/admin/commands/custom.d.ts.map +1 -0
- package/city/admin/commands/custom.js +47 -0
- package/city/admin/commands/custom.js.map +1 -0
- package/city/admin/commands/instruction.d.ts +9 -0
- package/city/admin/commands/instruction.d.ts.map +1 -0
- package/city/admin/commands/instruction.js +10 -0
- package/city/admin/commands/instruction.js.map +1 -0
- package/city/admin/commands/models.d.ts +14 -0
- package/city/admin/commands/models.d.ts.map +1 -0
- package/city/admin/commands/models.js +61 -0
- package/city/admin/commands/models.js.map +1 -0
- package/city/admin/commands/payment.d.ts +6 -0
- package/city/admin/commands/payment.d.ts.map +1 -0
- package/city/admin/commands/payment.js +59 -0
- package/city/admin/commands/payment.js.map +1 -0
- package/city/admin/commands/service-env.d.ts +11 -0
- package/city/admin/commands/service-env.d.ts.map +1 -0
- package/city/admin/commands/service-env.js +248 -0
- package/city/admin/commands/service-env.js.map +1 -0
- package/city/admin/commands/towns.d.ts +6 -0
- package/city/admin/commands/towns.d.ts.map +1 -0
- package/city/admin/commands/towns.js +80 -0
- package/city/admin/commands/towns.js.map +1 -0
- package/city/admin/commands/usage.d.ts +6 -0
- package/city/admin/commands/usage.d.ts.map +1 -0
- package/city/admin/commands/usage.js +44 -0
- package/city/admin/commands/usage.js.map +1 -0
- package/city/admin/loop.d.ts +6 -0
- package/city/admin/loop.d.ts.map +1 -0
- package/city/admin/loop.js +74 -0
- package/city/admin/loop.js.map +1 -0
- package/city/app.d.ts +13 -0
- package/city/app.d.ts.map +1 -0
- package/city/app.js +123 -0
- package/city/app.js.map +1 -0
- package/city/auth/admin.d.ts +8 -0
- package/city/auth/admin.d.ts.map +1 -0
- package/city/auth/admin.js +18 -0
- package/city/auth/admin.js.map +1 -0
- package/city/auth/mode-select.d.ts +11 -0
- package/city/auth/mode-select.d.ts.map +1 -0
- package/city/auth/mode-select.js +33 -0
- package/city/auth/mode-select.js.map +1 -0
- package/city/auth/server-switch.d.ts +22 -0
- package/city/auth/server-switch.d.ts.map +1 -0
- package/city/auth/server-switch.js +242 -0
- package/city/auth/server-switch.js.map +1 -0
- package/city/auth/user.d.ts +19 -0
- package/city/auth/user.d.ts.map +1 -0
- package/city/auth/user.js +261 -0
- package/city/auth/user.js.map +1 -0
- package/city/core/browser.d.ts +12 -0
- package/city/core/browser.d.ts.map +1 -0
- package/city/core/browser.js +29 -0
- package/city/core/browser.js.map +1 -0
- package/city/core/env.d.ts +15 -0
- package/city/core/env.d.ts.map +1 -0
- package/city/core/env.js +67 -0
- package/city/core/env.js.map +1 -0
- package/city/core/session.d.ts +97 -0
- package/city/core/session.d.ts.map +1 -0
- package/city/core/session.js +286 -0
- package/city/core/session.js.map +1 -0
- package/city/core/stripe.d.ts +26 -0
- package/city/core/stripe.d.ts.map +1 -0
- package/city/core/stripe.js +22 -0
- package/city/core/stripe.js.map +1 -0
- package/city/core/ui.d.ts +29 -0
- package/city/core/ui.d.ts.map +1 -0
- package/city/core/ui.js +59 -0
- package/city/core/ui.js.map +1 -0
- package/city/core/update.d.ts +20 -0
- package/city/core/update.d.ts.map +1 -0
- package/city/core/update.js +195 -0
- package/city/core/update.js.map +1 -0
- package/city/create/commands/create.d.ts +19 -0
- package/city/create/commands/create.d.ts.map +1 -0
- package/city/create/commands/create.js +287 -0
- package/city/create/commands/create.js.map +1 -0
- package/city/deploy/commands/deploy.d.ts +28 -0
- package/city/deploy/commands/deploy.d.ts.map +1 -0
- package/city/deploy/commands/deploy.js +41 -0
- package/city/deploy/commands/deploy.js.map +1 -0
- package/city/deploy/config/CityDeployTargetResolver.d.ts +14 -0
- package/city/deploy/config/CityDeployTargetResolver.d.ts.map +1 -0
- package/city/deploy/config/CityDeployTargetResolver.js +36 -0
- package/city/deploy/config/CityDeployTargetResolver.js.map +1 -0
- package/city/deploy/config/CityProjectConfigReader.d.ts +14 -0
- package/city/deploy/config/CityProjectConfigReader.d.ts.map +1 -0
- package/city/deploy/config/CityProjectConfigReader.js +127 -0
- package/city/deploy/config/CityProjectConfigReader.js.map +1 -0
- package/city/deploy/config/CityProjectEnvLoader.d.ts +22 -0
- package/city/deploy/config/CityProjectEnvLoader.d.ts.map +1 -0
- package/city/deploy/config/CityProjectEnvLoader.js +168 -0
- package/city/deploy/config/CityProjectEnvLoader.js.map +1 -0
- package/city/deploy/runtime/CloudflareAccountResolver.d.ts +30 -0
- package/city/deploy/runtime/CloudflareAccountResolver.d.ts.map +1 -0
- package/city/deploy/runtime/CloudflareAccountResolver.js +217 -0
- package/city/deploy/runtime/CloudflareAccountResolver.js.map +1 -0
- package/city/deploy/runtime/CloudflareWorkersDeployer.d.ts +14 -0
- package/city/deploy/runtime/CloudflareWorkersDeployer.d.ts.map +1 -0
- package/city/deploy/runtime/CloudflareWorkersDeployer.js +179 -0
- package/city/deploy/runtime/CloudflareWorkersDeployer.js.map +1 -0
- package/city/deploy/runtime/CommandRunner.d.ts +26 -0
- package/city/deploy/runtime/CommandRunner.d.ts.map +1 -0
- package/city/deploy/runtime/CommandRunner.js +56 -0
- package/city/deploy/runtime/CommandRunner.js.map +1 -0
- package/city/deploy/runtime/D1DatabaseResolver.d.ts +33 -0
- package/city/deploy/runtime/D1DatabaseResolver.d.ts.map +1 -0
- package/city/deploy/runtime/D1DatabaseResolver.js +129 -0
- package/city/deploy/runtime/D1DatabaseResolver.js.map +1 -0
- package/city/deploy/runtime/PackageScriptRunner.d.ts +20 -0
- package/city/deploy/runtime/PackageScriptRunner.d.ts.map +1 -0
- package/city/deploy/runtime/PackageScriptRunner.js +71 -0
- package/city/deploy/runtime/PackageScriptRunner.js.map +1 -0
- package/city/deploy/runtime/WranglerConfigWriter.d.ts +19 -0
- package/city/deploy/runtime/WranglerConfigWriter.d.ts.map +1 -0
- package/city/deploy/runtime/WranglerConfigWriter.js +46 -0
- package/city/deploy/runtime/WranglerConfigWriter.js.map +1 -0
- package/city/index.d.ts +11 -0
- package/city/index.d.ts.map +1 -0
- package/city/index.js +77 -0
- package/city/index.js.map +1 -0
- package/city/shared/CliError.d.ts.map +1 -0
- package/city/shared/CliError.js.map +1 -0
- package/city/shared/CliReporter.d.ts.map +1 -0
- package/city/shared/CliReporter.js +279 -0
- package/city/shared/CliReporter.js.map +1 -0
- package/city/shared/CliReporterTypes.d.ts +165 -0
- package/city/shared/CliReporterTypes.d.ts.map +1 -0
- package/city/shared/CliReporterTypes.js.map +1 -0
- package/city/shared/IndexSupport.d.ts +39 -0
- package/city/shared/IndexSupport.d.ts.map +1 -0
- package/city/shared/IndexSupport.js +146 -0
- package/city/shared/IndexSupport.js.map +1 -0
- package/city/types/CityProjectConfig.d.ts +86 -0
- package/city/types/CityProjectConfig.d.ts.map +1 -0
- package/city/types/CityProjectConfig.js +10 -0
- package/city/types/CityProjectConfig.js.map +1 -0
- package/city/user/balance.d.ts +31 -0
- package/city/user/balance.d.ts.map +1 -0
- package/city/user/balance.js +131 -0
- package/city/user/balance.js.map +1 -0
- package/city/user/loop.d.ts +12 -0
- package/city/user/loop.d.ts.map +1 -0
- package/city/user/loop.js +89 -0
- package/city/user/loop.js.map +1 -0
- package/city/user/models.d.ts +10 -0
- package/city/user/models.d.ts.map +1 -0
- package/city/user/models.js +39 -0
- package/city/user/models.js.map +1 -0
- package/package.json +49 -52
- package/public/app.js +11 -377
- package/public/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/public/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/public/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/public/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/public/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/public/styles.css +2 -1
- package/town/agent/AgentChat.d.ts +23 -0
- package/town/agent/AgentChat.d.ts.map +1 -0
- package/town/agent/AgentChat.js +447 -0
- package/town/agent/AgentChat.js.map +1 -0
- package/town/agent/AgentChatTypes.d.ts +77 -0
- package/town/agent/AgentChatTypes.d.ts.map +1 -0
- package/town/agent/AgentChatTypes.js +12 -0
- package/town/agent/AgentChatTypes.js.map +1 -0
- package/town/agent/AgentHistory.d.ts +14 -0
- package/town/agent/AgentHistory.d.ts.map +1 -0
- package/town/agent/AgentHistory.js +158 -0
- package/town/agent/AgentHistory.js.map +1 -0
- package/town/agent/AgentHistoryTypes.d.ts.map +1 -0
- package/town/agent/AgentHistoryTypes.js.map +1 -0
- package/town/agent/AgentManager.d.ts +12 -0
- package/town/agent/AgentManager.d.ts.map +1 -0
- package/town/agent/AgentManager.js +586 -0
- package/town/agent/AgentManager.js.map +1 -0
- package/town/agent/AgentManagerTypes.d.ts +13 -0
- package/town/agent/AgentManagerTypes.d.ts.map +1 -0
- package/town/agent/AgentManagerTypes.js +5 -0
- package/town/agent/AgentManagerTypes.js.map +1 -0
- package/town/agent/AgentReset.d.ts +13 -0
- package/town/agent/AgentReset.d.ts.map +1 -0
- package/town/agent/AgentReset.js +141 -0
- package/town/agent/AgentReset.js.map +1 -0
- package/town/agent/AgentSelection.d.ts +43 -0
- package/town/agent/AgentSelection.d.ts.map +1 -0
- package/town/agent/AgentSelection.js +243 -0
- package/town/agent/AgentSelection.js.map +1 -0
- package/town/agent/AgentSelectionTypes.d.ts +30 -0
- package/town/agent/AgentSelectionTypes.d.ts.map +1 -0
- package/town/agent/AgentSelectionTypes.js.map +1 -0
- package/town/agent/Init.d.ts +24 -0
- package/town/agent/Init.d.ts.map +1 -0
- package/town/agent/Init.js +254 -0
- package/town/agent/Init.js.map +1 -0
- package/town/agent/Restart.d.ts +19 -0
- package/town/agent/Restart.d.ts.map +1 -0
- package/town/agent/Restart.js +60 -0
- package/town/agent/Restart.js.map +1 -0
- package/town/agent/Run.d.ts +24 -0
- package/town/agent/Run.d.ts.map +1 -0
- package/town/agent/Run.js +136 -0
- package/town/agent/Run.js.map +1 -0
- package/town/agent/Start.d.ts +23 -0
- package/town/agent/Start.d.ts.map +1 -0
- package/town/agent/Start.js +63 -0
- package/town/agent/Start.js.map +1 -0
- package/town/agent/Status.d.ts +16 -0
- package/town/agent/Status.d.ts.map +1 -0
- package/town/agent/Status.js +103 -0
- package/town/agent/Status.js.map +1 -0
- package/town/agent/Stop.d.ts +18 -0
- package/town/agent/Stop.d.ts.map +1 -0
- package/town/agent/Stop.js +44 -0
- package/town/agent/Stop.js.map +1 -0
- package/town/config/DowncitySchema.d.ts.map +1 -0
- package/town/config/DowncitySchema.js +253 -0
- package/town/config/DowncitySchema.js.map +1 -0
- package/town/config/Paths.d.ts +61 -0
- package/town/config/Paths.d.ts.map +1 -0
- package/town/config/Paths.js +161 -0
- package/town/config/Paths.js.map +1 -0
- package/town/control/ControlGateway.d.ts +102 -0
- package/town/control/ControlGateway.d.ts.map +1 -0
- package/town/control/ControlGateway.js +295 -0
- package/town/control/ControlGateway.js.map +1 -0
- package/town/control/EnvApiRoutes.d.ts +18 -0
- package/town/control/EnvApiRoutes.d.ts.map +1 -0
- package/town/control/EnvApiRoutes.js +156 -0
- package/town/control/EnvApiRoutes.js.map +1 -0
- package/town/control/ModelApiRoutes.d.ts +33 -0
- package/town/control/ModelApiRoutes.d.ts.map +1 -0
- package/town/control/ModelApiRoutes.js +84 -0
- package/town/control/ModelApiRoutes.js.map +1 -0
- package/town/control/PlatformApiRoutes.d.ts +133 -0
- package/town/control/PlatformApiRoutes.d.ts.map +1 -0
- package/town/control/PlatformApiRoutes.js +292 -0
- package/town/control/PlatformApiRoutes.js.map +1 -0
- package/town/control/PluginApiRoutes.js +289 -0
- package/town/control/PluginApiRoutes.js.map +1 -0
- package/town/control/gateway/AgentActions.d.ts +107 -0
- package/town/control/gateway/AgentActions.d.ts.map +1 -0
- package/town/control/gateway/AgentActions.js +335 -0
- package/town/control/gateway/AgentActions.js.map +1 -0
- package/town/control/gateway/AgentCatalog.d.ts +80 -0
- package/town/control/gateway/AgentCatalog.d.ts.map +1 -0
- package/town/control/gateway/AgentCatalog.js +470 -0
- package/town/control/gateway/AgentCatalog.js.map +1 -0
- package/town/control/gateway/Proxy.js +47 -0
- package/town/control/instant/InstantSessionRunner.d.ts.map +1 -0
- package/town/control/instant/InstantSessionRunner.js +188 -0
- package/town/control/instant/InstantSessionRunner.js.map +1 -0
- package/town/control-plane/ControlPlaneAuthBootstrap.d.ts +25 -0
- package/town/control-plane/ControlPlaneAuthBootstrap.d.ts.map +1 -0
- package/town/control-plane/ControlPlaneAuthBootstrap.js +56 -0
- package/town/control-plane/ControlPlaneAuthBootstrap.js.map +1 -0
- package/town/control-plane/ControlPlaneCommand.d.ts +29 -0
- package/town/control-plane/ControlPlaneCommand.d.ts.map +1 -0
- package/town/control-plane/ControlPlaneCommand.js +174 -0
- package/town/control-plane/ControlPlaneCommand.js.map +1 -0
- package/town/control-plane/ControlPlaneInit.d.ts +16 -0
- package/town/control-plane/ControlPlaneInit.d.ts.map +1 -0
- package/town/control-plane/ControlPlaneInit.js +55 -0
- package/town/control-plane/ControlPlaneInit.js.map +1 -0
- package/town/control-plane/ControlPlaneProcess.d.ts +61 -0
- package/town/control-plane/ControlPlaneProcess.d.ts.map +1 -0
- package/town/control-plane/ControlPlaneProcess.js +403 -0
- package/town/control-plane/ControlPlaneProcess.js.map +1 -0
- package/town/control-plane/ControlPlanePublicManager.d.ts +17 -0
- package/town/control-plane/ControlPlanePublicManager.d.ts.map +1 -0
- package/town/control-plane/ControlPlanePublicManager.js +229 -0
- package/town/control-plane/ControlPlanePublicManager.js.map +1 -0
- package/town/control-plane/ControlPlanePublicMode.d.ts +53 -0
- package/town/control-plane/ControlPlanePublicMode.d.ts.map +1 -0
- package/town/control-plane/ControlPlanePublicMode.js +106 -0
- package/town/control-plane/ControlPlanePublicMode.js.map +1 -0
- package/town/control-plane/ControlPlaneRuntime.d.ts +98 -0
- package/town/control-plane/ControlPlaneRuntime.d.ts.map +1 -0
- package/town/control-plane/ControlPlaneRuntime.js +517 -0
- package/town/control-plane/ControlPlaneRuntime.js.map +1 -0
- package/town/control-plane/ControlPlaneStatus.d.ts +27 -0
- package/town/control-plane/ControlPlaneStatus.d.ts.map +1 -0
- package/town/control-plane/ControlPlaneStatus.js +181 -0
- package/town/control-plane/ControlPlaneStatus.js.map +1 -0
- package/town/env/ProcessEnv.d.ts +24 -0
- package/town/env/ProcessEnv.d.ts.map +1 -0
- package/town/env/ProcessEnv.js +41 -0
- package/town/env/ProcessEnv.js.map +1 -0
- package/town/http/auth/AuthEnv.d.ts +45 -0
- package/town/http/auth/AuthEnv.js +63 -0
- package/town/http/auth/AuthStore.js +442 -0
- package/town/index.d.ts +11 -0
- package/town/index.d.ts.map +1 -0
- package/town/index.js +116 -0
- package/town/index.js.map +1 -0
- package/town/model/Model.d.ts +13 -0
- package/town/model/Model.d.ts.map +1 -0
- package/town/model/Model.js +27 -0
- package/town/model/Model.js.map +1 -0
- package/town/model/ModelCommandShared.d.ts +9 -0
- package/town/model/ModelCommandShared.d.ts.map +1 -0
- package/town/model/ModelCommandShared.js +9 -0
- package/town/model/ModelCommandShared.js.map +1 -0
- package/town/model/ModelManager.d.ts +12 -0
- package/town/model/ModelManager.d.ts.map +1 -0
- package/town/model/ModelManager.js +146 -0
- package/town/model/ModelManager.js.map +1 -0
- package/town/model/ModelReadCommand.d.ts +14 -0
- package/town/model/ModelReadCommand.d.ts.map +1 -0
- package/town/model/ModelReadCommand.js +156 -0
- package/town/model/ModelReadCommand.js.map +1 -0
- package/town/model/ModelSupport.d.ts +24 -0
- package/town/model/ModelSupport.d.ts.map +1 -0
- package/town/model/ModelSupport.js +51 -0
- package/town/model/ModelSupport.js.map +1 -0
- package/town/model/runtime/CityAiServiceBinding.d.ts +95 -0
- package/town/model/runtime/CityAiServiceBinding.d.ts.map +1 -0
- package/town/model/runtime/CityAiServiceBinding.js +157 -0
- package/town/model/runtime/CityAiServiceBinding.js.map +1 -0
- package/town/model/runtime/CreateRuntimeModel.d.ts +47 -0
- package/town/model/runtime/CreateRuntimeModel.d.ts.map +1 -0
- package/town/model/runtime/CreateRuntimeModel.js +61 -0
- package/town/model/runtime/CreateRuntimeModel.js.map +1 -0
- package/town/model/runtime/ExecutionModelBinding.d.ts +26 -0
- package/town/model/runtime/ExecutionModelBinding.d.ts.map +1 -0
- package/town/model/runtime/ExecutionModelBinding.js +42 -0
- package/town/model/runtime/ExecutionModelBinding.js.map +1 -0
- package/town/platform/PluginLifecycle.d.ts +51 -0
- package/town/platform/PluginLifecycle.d.ts.map +1 -0
- package/town/platform/PluginLifecycle.js +98 -0
- package/town/platform/PluginLifecycle.js.map +1 -0
- package/town/platform/store/StoreEnvRepository.d.ts +54 -0
- package/town/platform/store/StoreEnvRepository.d.ts.map +1 -0
- package/town/platform/store/StoreEnvRepository.js +187 -0
- package/town/platform/store/StoreEnvRepository.js.map +1 -0
- package/town/platform/store/StoreSchema.d.ts.map +1 -0
- package/town/platform/store/StoreSchema.js +235 -0
- package/town/platform/store/StoreSchema.js.map +1 -0
- package/town/platform/store/crypto.js +101 -0
- package/town/platform/store/index.d.ts +147 -0
- package/town/platform/store/index.d.ts.map +1 -0
- package/town/platform/store/index.js +242 -0
- package/town/platform/store/index.js.map +1 -0
- package/town/platform/store/schema.d.ts +408 -0
- package/town/platform/store/schema.d.ts.map +1 -0
- package/town/platform/store/schema.js +53 -0
- package/town/platform/store/schema.js.map +1 -0
- package/town/process/daemon/Api.d.ts +60 -0
- package/town/process/daemon/Api.js +10 -0
- package/town/process/daemon/CliArgs.d.ts +18 -0
- package/town/process/daemon/CliArgs.d.ts.map +1 -0
- package/town/process/daemon/CliArgs.js +49 -0
- package/town/process/daemon/CliArgs.js.map +1 -0
- package/town/process/daemon/Client.d.ts +47 -0
- package/town/process/daemon/Client.d.ts.map +1 -0
- package/town/process/daemon/Client.js +208 -0
- package/town/process/daemon/Client.js.map +1 -0
- package/town/process/daemon/Manager.d.ts +92 -0
- package/town/process/daemon/Manager.d.ts.map +1 -0
- package/town/process/daemon/Manager.js +288 -0
- package/town/process/daemon/Manager.js.map +1 -0
- package/town/process/registry/AgentHostRuntime.js +48 -0
- package/town/process/registry/ProcessSweep.d.ts +76 -0
- package/town/process/registry/ProcessSweep.d.ts.map +1 -0
- package/town/process/registry/ProcessSweep.js +202 -0
- package/town/process/registry/ProcessSweep.js.map +1 -0
- package/town/process/registry/TownPaths.d.ts +53 -0
- package/town/process/registry/TownPaths.d.ts.map +1 -0
- package/town/process/registry/TownPaths.js +78 -0
- package/town/process/registry/TownPaths.js.map +1 -0
- package/town/process/registry/TownRegistry.d.ts +51 -0
- package/town/process/registry/TownRegistry.d.ts.map +1 -0
- package/town/process/registry/TownRegistry.js +217 -0
- package/town/process/registry/TownRegistry.js.map +1 -0
- package/town/process/registry/TownRuntime.d.ts +21 -0
- package/town/process/registry/TownRuntime.d.ts.map +1 -0
- package/town/process/registry/TownRuntime.js +45 -0
- package/town/process/registry/TownRuntime.js.map +1 -0
- package/town/shared/Alias.d.ts +21 -0
- package/town/shared/Alias.d.ts.map +1 -0
- package/town/shared/Alias.js +118 -0
- package/town/shared/Alias.js.map +1 -0
- package/town/shared/Chat.d.ts +13 -0
- package/town/shared/Chat.d.ts.map +1 -0
- package/town/shared/Chat.js +27 -0
- package/town/shared/Chat.js.map +1 -0
- package/town/shared/ChatAuth.d.ts +40 -0
- package/town/shared/ChatAuth.d.ts.map +1 -0
- package/town/shared/ChatAuth.js +150 -0
- package/town/shared/ChatAuth.js.map +1 -0
- package/town/shared/ChatManager.d.ts +13 -0
- package/town/shared/ChatManager.d.ts.map +1 -0
- package/town/shared/ChatManager.js +386 -0
- package/town/shared/ChatManager.js.map +1 -0
- package/town/shared/ChatManagerTypes.d.ts +6 -0
- package/town/shared/ChatManagerTypes.d.ts.map +1 -0
- package/town/shared/ChatManagerTypes.js +5 -0
- package/town/shared/ChatManagerTypes.js.map +1 -0
- package/town/shared/CityConnection.d.ts +20 -0
- package/town/shared/CityConnection.d.ts.map +1 -0
- package/town/shared/CityConnection.js +502 -0
- package/town/shared/CityConnection.js.map +1 -0
- package/town/shared/CliAuthToken.d.ts +25 -0
- package/town/shared/CliAuthToken.d.ts.map +1 -0
- package/town/shared/CliAuthToken.js +31 -0
- package/town/shared/CliAuthToken.js.map +1 -0
- package/town/shared/CliError.d.ts +62 -0
- package/town/shared/CliError.d.ts.map +1 -0
- package/town/shared/CliError.js +30 -0
- package/town/shared/CliError.js.map +1 -0
- package/town/shared/CliReporter.d.ts +50 -0
- package/town/shared/CliReporter.d.ts.map +1 -0
- package/town/shared/CliReporter.js +279 -0
- package/town/shared/CliReporter.js.map +1 -0
- package/town/shared/CliReporterTypes.d.ts +165 -0
- package/town/shared/CliReporterTypes.d.ts.map +1 -0
- package/town/shared/CliReporterTypes.js +10 -0
- package/town/shared/CliReporterTypes.js.map +1 -0
- package/town/shared/Config.d.ts +14 -0
- package/town/shared/Config.d.ts.map +1 -0
- package/town/shared/Config.js +249 -0
- package/town/shared/Config.js.map +1 -0
- package/town/shared/Env.d.ts +14 -0
- package/town/shared/Env.d.ts.map +1 -0
- package/town/shared/Env.js +288 -0
- package/town/shared/Env.js.map +1 -0
- package/town/shared/IndexAgentCommand.d.ts +24 -0
- package/town/shared/IndexAgentCommand.d.ts.map +1 -0
- package/town/shared/IndexAgentCommand.js +210 -0
- package/town/shared/IndexAgentCommand.js.map +1 -0
- package/town/shared/IndexSupport.d.ts +39 -0
- package/town/shared/IndexSupport.d.ts.map +1 -0
- package/town/shared/IndexSupport.js +146 -0
- package/town/shared/IndexSupport.js.map +1 -0
- package/town/shared/ManagedPluginActionCommands.d.ts +15 -0
- package/town/shared/ManagedPluginActionCommands.d.ts.map +1 -0
- package/town/shared/ManagedPluginActionCommands.js +345 -0
- package/town/shared/ManagedPluginActionCommands.js.map +1 -0
- package/town/shared/ManagedPluginRemote.d.ts +30 -0
- package/town/shared/ManagedPluginRemote.d.ts.map +1 -0
- package/town/shared/ManagedPluginRemote.js +200 -0
- package/town/shared/ManagedPluginRemote.js.map +1 -0
- package/town/shared/PluginScheduleCommand.d.ts +37 -0
- package/town/shared/PluginScheduleCommand.d.ts.map +1 -0
- package/town/shared/PluginScheduleCommand.js +272 -0
- package/town/shared/PluginScheduleCommand.js.map +1 -0
- package/town/shared/PluginTargetSupport.d.ts +82 -0
- package/town/shared/PluginTargetSupport.d.ts.map +1 -0
- package/town/shared/PluginTargetSupport.js +224 -0
- package/town/shared/PluginTargetSupport.js.map +1 -0
- package/town/shared/Plugins.d.ts +15 -0
- package/town/shared/Plugins.d.ts.map +1 -0
- package/town/shared/Plugins.js +783 -0
- package/town/shared/Plugins.js.map +1 -0
- package/town/shared/PortHints.d.ts +35 -0
- package/town/shared/PortHints.d.ts.map +1 -0
- package/town/shared/PortHints.js +58 -0
- package/town/shared/PortHints.js.map +1 -0
- package/town/shared/PublicAccess.d.ts.map +1 -0
- package/town/shared/PublicAccess.js.map +1 -0
- package/town/shared/PublicHostEnv.d.ts +14 -0
- package/town/shared/PublicHostEnv.d.ts.map +1 -0
- package/town/shared/PublicHostEnv.js +104 -0
- package/town/shared/PublicHostEnv.js.map +1 -0
- package/town/shared/PublicHostEnvTypes.d.ts +35 -0
- package/town/shared/PublicHostEnvTypes.d.ts.map +1 -0
- package/town/shared/PublicHostEnvTypes.js +5 -0
- package/town/shared/PublicHostEnvTypes.js.map +1 -0
- package/town/shared/Token.d.ts +14 -0
- package/town/shared/Token.d.ts.map +1 -0
- package/town/shared/Token.js +638 -0
- package/town/shared/Token.js.map +1 -0
- package/town/shared/TownAgentRuntime.d.ts +35 -0
- package/town/shared/TownAgentRuntime.d.ts.map +1 -0
- package/town/shared/TownAgentRuntime.js +95 -0
- package/town/shared/TownAgentRuntime.js.map +1 -0
- package/town/shared/TownCliPath.d.ts +13 -0
- package/town/shared/TownCliPath.d.ts.map +1 -0
- package/town/shared/TownCliPath.js +36 -0
- package/town/shared/TownCliPath.js.map +1 -0
- package/town/shared/TownManager.d.ts +22 -0
- package/town/shared/TownManager.d.ts.map +1 -0
- package/town/shared/TownManager.js +124 -0
- package/town/shared/TownManager.js.map +1 -0
- package/town/shared/Update.d.ts +43 -0
- package/town/shared/Update.d.ts.map +1 -0
- package/town/shared/Update.js +179 -0
- package/town/shared/Update.js.map +1 -0
- package/town/types/TownCityConnection.d.ts +92 -0
- package/town/types/TownCityConnection.d.ts.map +1 -0
- package/town/types/TownCityConnection.js +9 -0
- package/town/types/TownCityConnection.js.map +1 -0
- package/town/utils/cli/CliOutput.d.ts +51 -0
- package/town/utils/cli/CliOutput.d.ts.map +1 -0
- package/town/utils/cli/CliOutput.js +117 -0
- package/town/utils/cli/CliOutput.js.map +1 -0
- package/town/utils/storage.d.ts +4 -0
- package/town/utils/storage.d.ts.map +1 -0
- package/town/utils/storage.js +17 -0
- package/town/utils/storage.js.map +1 -0
- package/bin/cli/Index.d.ts +0 -11
- package/bin/cli/Index.d.ts.map +0 -1
- package/bin/cli/Index.js +0 -117
- package/bin/cli/Index.js.map +0 -1
- package/bin/cli/agent/AgentChat.d.ts +0 -22
- package/bin/cli/agent/AgentChat.d.ts.map +0 -1
- package/bin/cli/agent/AgentChat.js +0 -568
- package/bin/cli/agent/AgentChat.js.map +0 -1
- package/bin/cli/agent/AgentChatTypes.d.ts +0 -81
- package/bin/cli/agent/AgentChatTypes.d.ts.map +0 -1
- package/bin/cli/agent/AgentChatTypes.js +0 -12
- package/bin/cli/agent/AgentChatTypes.js.map +0 -1
- package/bin/cli/agent/AgentHistory.d.ts +0 -14
- package/bin/cli/agent/AgentHistory.d.ts.map +0 -1
- package/bin/cli/agent/AgentHistory.js +0 -158
- package/bin/cli/agent/AgentHistory.js.map +0 -1
- package/bin/cli/agent/AgentHistoryTypes.d.ts.map +0 -1
- package/bin/cli/agent/AgentHistoryTypes.js.map +0 -1
- package/bin/cli/agent/AgentManager.d.ts +0 -12
- package/bin/cli/agent/AgentManager.d.ts.map +0 -1
- package/bin/cli/agent/AgentManager.js +0 -602
- package/bin/cli/agent/AgentManager.js.map +0 -1
- package/bin/cli/agent/AgentManagerTypes.d.ts +0 -13
- package/bin/cli/agent/AgentManagerTypes.d.ts.map +0 -1
- package/bin/cli/agent/AgentManagerTypes.js +0 -5
- package/bin/cli/agent/AgentManagerTypes.js.map +0 -1
- package/bin/cli/agent/AgentReset.d.ts +0 -13
- package/bin/cli/agent/AgentReset.d.ts.map +0 -1
- package/bin/cli/agent/AgentReset.js +0 -167
- package/bin/cli/agent/AgentReset.js.map +0 -1
- package/bin/cli/agent/AgentSelection.d.ts +0 -43
- package/bin/cli/agent/AgentSelection.d.ts.map +0 -1
- package/bin/cli/agent/AgentSelection.js +0 -243
- package/bin/cli/agent/AgentSelection.js.map +0 -1
- package/bin/cli/agent/AgentSelectionTypes.d.ts +0 -30
- package/bin/cli/agent/AgentSelectionTypes.d.ts.map +0 -1
- package/bin/cli/agent/AgentSelectionTypes.js.map +0 -1
- package/bin/cli/agent/Init.d.ts +0 -24
- package/bin/cli/agent/Init.d.ts.map +0 -1
- package/bin/cli/agent/Init.js +0 -254
- package/bin/cli/agent/Init.js.map +0 -1
- package/bin/cli/agent/Restart.d.ts +0 -19
- package/bin/cli/agent/Restart.d.ts.map +0 -1
- package/bin/cli/agent/Restart.js +0 -60
- package/bin/cli/agent/Restart.js.map +0 -1
- package/bin/cli/agent/Run.d.ts +0 -24
- package/bin/cli/agent/Run.d.ts.map +0 -1
- package/bin/cli/agent/Run.js +0 -116
- package/bin/cli/agent/Run.js.map +0 -1
- package/bin/cli/agent/Start.d.ts +0 -23
- package/bin/cli/agent/Start.d.ts.map +0 -1
- package/bin/cli/agent/Start.js +0 -63
- package/bin/cli/agent/Start.js.map +0 -1
- package/bin/cli/agent/Status.d.ts +0 -16
- package/bin/cli/agent/Status.d.ts.map +0 -1
- package/bin/cli/agent/Status.js +0 -103
- package/bin/cli/agent/Status.js.map +0 -1
- package/bin/cli/agent/Stop.d.ts +0 -18
- package/bin/cli/agent/Stop.d.ts.map +0 -1
- package/bin/cli/agent/Stop.js +0 -44
- package/bin/cli/agent/Stop.js.map +0 -1
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.d.ts +0 -25
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.js +0 -56
- package/bin/cli/control-plane/ControlPlaneAuthBootstrap.js.map +0 -1
- package/bin/cli/control-plane/ControlPlaneCommand.d.ts +0 -29
- package/bin/cli/control-plane/ControlPlaneCommand.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlaneCommand.js +0 -170
- package/bin/cli/control-plane/ControlPlaneCommand.js.map +0 -1
- package/bin/cli/control-plane/ControlPlaneInit.d.ts +0 -17
- package/bin/cli/control-plane/ControlPlaneInit.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlaneInit.js +0 -76
- package/bin/cli/control-plane/ControlPlaneInit.js.map +0 -1
- package/bin/cli/control-plane/ControlPlaneProcess.d.ts +0 -61
- package/bin/cli/control-plane/ControlPlaneProcess.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlaneProcess.js +0 -395
- package/bin/cli/control-plane/ControlPlaneProcess.js.map +0 -1
- package/bin/cli/control-plane/ControlPlanePublicManager.d.ts +0 -17
- package/bin/cli/control-plane/ControlPlanePublicManager.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlanePublicManager.js +0 -229
- package/bin/cli/control-plane/ControlPlanePublicManager.js.map +0 -1
- package/bin/cli/control-plane/ControlPlanePublicMode.d.ts +0 -53
- package/bin/cli/control-plane/ControlPlanePublicMode.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlanePublicMode.js +0 -106
- package/bin/cli/control-plane/ControlPlanePublicMode.js.map +0 -1
- package/bin/cli/control-plane/ControlPlaneRuntime.d.ts +0 -98
- package/bin/cli/control-plane/ControlPlaneRuntime.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlaneRuntime.js +0 -517
- package/bin/cli/control-plane/ControlPlaneRuntime.js.map +0 -1
- package/bin/cli/control-plane/ControlPlaneStatus.d.ts +0 -27
- package/bin/cli/control-plane/ControlPlaneStatus.d.ts.map +0 -1
- package/bin/cli/control-plane/ControlPlaneStatus.js +0 -149
- package/bin/cli/control-plane/ControlPlaneStatus.js.map +0 -1
- package/bin/cli/model/Model.d.ts +0 -13
- package/bin/cli/model/Model.d.ts.map +0 -1
- package/bin/cli/model/Model.js +0 -31
- package/bin/cli/model/Model.js.map +0 -1
- package/bin/cli/model/ModelCommandShared.d.ts +0 -28
- package/bin/cli/model/ModelCommandShared.d.ts.map +0 -1
- package/bin/cli/model/ModelCommandShared.js +0 -109
- package/bin/cli/model/ModelCommandShared.js.map +0 -1
- package/bin/cli/model/ModelCreateCommand.d.ts +0 -23
- package/bin/cli/model/ModelCreateCommand.d.ts.map +0 -1
- package/bin/cli/model/ModelCreateCommand.js +0 -367
- package/bin/cli/model/ModelCreateCommand.js.map +0 -1
- package/bin/cli/model/ModelManageCommand.d.ts +0 -13
- package/bin/cli/model/ModelManageCommand.d.ts.map +0 -1
- package/bin/cli/model/ModelManageCommand.js +0 -442
- package/bin/cli/model/ModelManageCommand.js.map +0 -1
- package/bin/cli/model/ModelManager.d.ts +0 -13
- package/bin/cli/model/ModelManager.d.ts.map +0 -1
- package/bin/cli/model/ModelManager.js +0 -890
- package/bin/cli/model/ModelManager.js.map +0 -1
- package/bin/cli/model/ModelManagerTypes.d.ts +0 -115
- package/bin/cli/model/ModelManagerTypes.d.ts.map +0 -1
- package/bin/cli/model/ModelManagerTypes.js +0 -5
- package/bin/cli/model/ModelManagerTypes.js.map +0 -1
- package/bin/cli/model/ModelReadCommand.d.ts +0 -13
- package/bin/cli/model/ModelReadCommand.d.ts.map +0 -1
- package/bin/cli/model/ModelReadCommand.js +0 -198
- package/bin/cli/model/ModelReadCommand.js.map +0 -1
- package/bin/cli/model/ModelSupport.d.ts +0 -40
- package/bin/cli/model/ModelSupport.d.ts.map +0 -1
- package/bin/cli/model/ModelSupport.js +0 -201
- package/bin/cli/model/ModelSupport.js.map +0 -1
- package/bin/cli/model/preset/ModelPresetManager.d.ts +0 -71
- package/bin/cli/model/preset/ModelPresetManager.d.ts.map +0 -1
- package/bin/cli/model/preset/ModelPresetManager.js +0 -187
- package/bin/cli/model/preset/ModelPresetManager.js.map +0 -1
- package/bin/cli/shared/Alias.d.ts +0 -21
- package/bin/cli/shared/Alias.d.ts.map +0 -1
- package/bin/cli/shared/Alias.js +0 -115
- package/bin/cli/shared/Alias.js.map +0 -1
- package/bin/cli/shared/Chat.d.ts +0 -13
- package/bin/cli/shared/Chat.d.ts.map +0 -1
- package/bin/cli/shared/Chat.js +0 -27
- package/bin/cli/shared/Chat.js.map +0 -1
- package/bin/cli/shared/ChatAuth.d.ts +0 -40
- package/bin/cli/shared/ChatAuth.d.ts.map +0 -1
- package/bin/cli/shared/ChatAuth.js +0 -150
- package/bin/cli/shared/ChatAuth.js.map +0 -1
- package/bin/cli/shared/ChatManager.d.ts +0 -13
- package/bin/cli/shared/ChatManager.d.ts.map +0 -1
- package/bin/cli/shared/ChatManager.js +0 -386
- package/bin/cli/shared/ChatManager.js.map +0 -1
- package/bin/cli/shared/ChatManagerTypes.d.ts +0 -6
- package/bin/cli/shared/ChatManagerTypes.d.ts.map +0 -1
- package/bin/cli/shared/ChatManagerTypes.js +0 -5
- package/bin/cli/shared/ChatManagerTypes.js.map +0 -1
- package/bin/cli/shared/CliError.d.ts.map +0 -1
- package/bin/cli/shared/CliError.js.map +0 -1
- package/bin/cli/shared/CliReporter.d.ts.map +0 -1
- package/bin/cli/shared/CliReporter.js +0 -278
- package/bin/cli/shared/CliReporter.js.map +0 -1
- package/bin/cli/shared/CliReporterTypes.d.ts +0 -157
- package/bin/cli/shared/CliReporterTypes.d.ts.map +0 -1
- package/bin/cli/shared/CliReporterTypes.js.map +0 -1
- package/bin/cli/shared/Config.d.ts +0 -14
- package/bin/cli/shared/Config.d.ts.map +0 -1
- package/bin/cli/shared/Config.js +0 -239
- package/bin/cli/shared/Config.js.map +0 -1
- package/bin/cli/shared/Env.d.ts +0 -14
- package/bin/cli/shared/Env.d.ts.map +0 -1
- package/bin/cli/shared/Env.js +0 -419
- package/bin/cli/shared/Env.js.map +0 -1
- package/bin/cli/shared/IndexAgentCommand.d.ts +0 -24
- package/bin/cli/shared/IndexAgentCommand.d.ts.map +0 -1
- package/bin/cli/shared/IndexAgentCommand.js +0 -219
- package/bin/cli/shared/IndexAgentCommand.js.map +0 -1
- package/bin/cli/shared/IndexSupport.d.ts +0 -39
- package/bin/cli/shared/IndexSupport.d.ts.map +0 -1
- package/bin/cli/shared/IndexSupport.js +0 -123
- package/bin/cli/shared/IndexSupport.js.map +0 -1
- package/bin/cli/shared/ManagedPluginActionCommands.d.ts +0 -15
- package/bin/cli/shared/ManagedPluginActionCommands.d.ts.map +0 -1
- package/bin/cli/shared/ManagedPluginActionCommands.js +0 -344
- package/bin/cli/shared/ManagedPluginActionCommands.js.map +0 -1
- package/bin/cli/shared/ManagedPluginRemote.d.ts +0 -30
- package/bin/cli/shared/ManagedPluginRemote.d.ts.map +0 -1
- package/bin/cli/shared/ManagedPluginRemote.js +0 -200
- package/bin/cli/shared/ManagedPluginRemote.js.map +0 -1
- package/bin/cli/shared/PluginScheduleCommand.d.ts +0 -37
- package/bin/cli/shared/PluginScheduleCommand.d.ts.map +0 -1
- package/bin/cli/shared/PluginScheduleCommand.js +0 -272
- package/bin/cli/shared/PluginScheduleCommand.js.map +0 -1
- package/bin/cli/shared/PluginTargetSupport.d.ts +0 -82
- package/bin/cli/shared/PluginTargetSupport.d.ts.map +0 -1
- package/bin/cli/shared/PluginTargetSupport.js +0 -224
- package/bin/cli/shared/PluginTargetSupport.js.map +0 -1
- package/bin/cli/shared/Plugins.d.ts +0 -14
- package/bin/cli/shared/Plugins.d.ts.map +0 -1
- package/bin/cli/shared/Plugins.js +0 -608
- package/bin/cli/shared/Plugins.js.map +0 -1
- package/bin/cli/shared/PortHints.d.ts +0 -35
- package/bin/cli/shared/PortHints.d.ts.map +0 -1
- package/bin/cli/shared/PortHints.js +0 -58
- package/bin/cli/shared/PortHints.js.map +0 -1
- package/bin/cli/shared/PublicAccess.d.ts.map +0 -1
- package/bin/cli/shared/PublicAccess.js.map +0 -1
- package/bin/cli/shared/PublicHostEnv.d.ts +0 -14
- package/bin/cli/shared/PublicHostEnv.d.ts.map +0 -1
- package/bin/cli/shared/PublicHostEnv.js +0 -104
- package/bin/cli/shared/PublicHostEnv.js.map +0 -1
- package/bin/cli/shared/PublicHostEnvTypes.d.ts +0 -23
- package/bin/cli/shared/PublicHostEnvTypes.d.ts.map +0 -1
- package/bin/cli/shared/PublicHostEnvTypes.js +0 -5
- package/bin/cli/shared/PublicHostEnvTypes.js.map +0 -1
- package/bin/cli/shared/Reset.d.ts +0 -11
- package/bin/cli/shared/Reset.d.ts.map +0 -1
- package/bin/cli/shared/Reset.js +0 -91
- package/bin/cli/shared/Reset.js.map +0 -1
- package/bin/cli/shared/Token.d.ts +0 -14
- package/bin/cli/shared/Token.d.ts.map +0 -1
- package/bin/cli/shared/Token.js +0 -638
- package/bin/cli/shared/Token.js.map +0 -1
- package/bin/cli/shared/Update.d.ts +0 -43
- package/bin/cli/shared/Update.d.ts.map +0 -1
- package/bin/cli/shared/Update.js +0 -179
- package/bin/cli/shared/Update.js.map +0 -1
- package/bin/config/DowncitySchema.d.ts.map +0 -1
- package/bin/config/DowncitySchema.js +0 -361
- package/bin/config/DowncitySchema.js.map +0 -1
- package/bin/config/Paths.d.ts +0 -117
- package/bin/config/Paths.d.ts.map +0 -1
- package/bin/config/Paths.js +0 -203
- package/bin/config/Paths.js.map +0 -1
- package/bin/control/ControlGateway.d.ts +0 -102
- package/bin/control/ControlGateway.d.ts.map +0 -1
- package/bin/control/ControlGateway.js +0 -284
- package/bin/control/ControlGateway.js.map +0 -1
- package/bin/control/EnvApiRoutes.d.ts +0 -18
- package/bin/control/EnvApiRoutes.d.ts.map +0 -1
- package/bin/control/EnvApiRoutes.js +0 -228
- package/bin/control/EnvApiRoutes.js.map +0 -1
- package/bin/control/ModelApiRoutes.d.ts +0 -35
- package/bin/control/ModelApiRoutes.d.ts.map +0 -1
- package/bin/control/ModelApiRoutes.js +0 -237
- package/bin/control/ModelApiRoutes.js.map +0 -1
- package/bin/control/ModelPoolService.d.ts +0 -9
- package/bin/control/ModelPoolService.d.ts.map +0 -1
- package/bin/control/ModelPoolService.js +0 -9
- package/bin/control/ModelPoolService.js.map +0 -1
- package/bin/control/PlatformApiRoutes.d.ts +0 -133
- package/bin/control/PlatformApiRoutes.d.ts.map +0 -1
- package/bin/control/PlatformApiRoutes.js +0 -292
- package/bin/control/PlatformApiRoutes.js.map +0 -1
- package/bin/control/PluginApiRoutes.js +0 -289
- package/bin/control/PluginApiRoutes.js.map +0 -1
- package/bin/control/gateway/AgentActions.d.ts +0 -107
- package/bin/control/gateway/AgentActions.d.ts.map +0 -1
- package/bin/control/gateway/AgentActions.js +0 -335
- package/bin/control/gateway/AgentActions.js.map +0 -1
- package/bin/control/gateway/AgentCatalog.d.ts +0 -83
- package/bin/control/gateway/AgentCatalog.d.ts.map +0 -1
- package/bin/control/gateway/AgentCatalog.js +0 -484
- package/bin/control/gateway/AgentCatalog.js.map +0 -1
- package/bin/control/gateway/Proxy.js +0 -47
- package/bin/control/instant/InstantSessionRunner.d.ts.map +0 -1
- package/bin/control/instant/InstantSessionRunner.js +0 -186
- package/bin/control/instant/InstantSessionRunner.js.map +0 -1
- package/bin/http/auth/AuthEnv.d.ts +0 -45
- package/bin/http/auth/AuthEnv.js +0 -63
- package/bin/http/auth/AuthStore.js +0 -442
- package/bin/model/runtime/CreateRuntimeModel.d.ts +0 -44
- package/bin/model/runtime/CreateRuntimeModel.d.ts.map +0 -1
- package/bin/model/runtime/CreateRuntimeModel.js +0 -356
- package/bin/model/runtime/CreateRuntimeModel.js.map +0 -1
- package/bin/model/runtime/ExecutionModelBinding.d.ts +0 -46
- package/bin/model/runtime/ExecutionModelBinding.d.ts.map +0 -1
- package/bin/model/runtime/ExecutionModelBinding.js +0 -96
- package/bin/model/runtime/ExecutionModelBinding.js.map +0 -1
- package/bin/model/service/ModelPoolService.d.ts +0 -145
- package/bin/model/service/ModelPoolService.d.ts.map +0 -1
- package/bin/model/service/ModelPoolService.js +0 -424
- package/bin/model/service/ModelPoolService.js.map +0 -1
- package/bin/platform/PluginLifecycle.d.ts +0 -51
- package/bin/platform/PluginLifecycle.d.ts.map +0 -1
- package/bin/platform/PluginLifecycle.js +0 -98
- package/bin/platform/PluginLifecycle.js.map +0 -1
- package/bin/platform/store/StoreEnvRepository.d.ts +0 -98
- package/bin/platform/store/StoreEnvRepository.d.ts.map +0 -1
- package/bin/platform/store/StoreEnvRepository.js +0 -334
- package/bin/platform/store/StoreEnvRepository.js.map +0 -1
- package/bin/platform/store/StoreModelRepository.d.ts +0 -61
- package/bin/platform/store/StoreModelRepository.d.ts.map +0 -1
- package/bin/platform/store/StoreModelRepository.js +0 -278
- package/bin/platform/store/StoreModelRepository.js.map +0 -1
- package/bin/platform/store/StoreSchema.d.ts.map +0 -1
- package/bin/platform/store/StoreSchema.js +0 -319
- package/bin/platform/store/StoreSchema.js.map +0 -1
- package/bin/platform/store/crypto.js +0 -101
- package/bin/platform/store/index.d.ts +0 -230
- package/bin/platform/store/index.d.ts.map +0 -1
- package/bin/platform/store/index.js +0 -360
- package/bin/platform/store/index.js.map +0 -1
- package/bin/platform/store/schema.d.ts +0 -690
- package/bin/platform/store/schema.d.ts.map +0 -1
- package/bin/platform/store/schema.js +0 -81
- package/bin/platform/store/schema.js.map +0 -1
- package/bin/process/daemon/Api.d.ts +0 -60
- package/bin/process/daemon/Api.js +0 -10
- package/bin/process/daemon/CliArgs.d.ts +0 -17
- package/bin/process/daemon/CliArgs.d.ts.map +0 -1
- package/bin/process/daemon/CliArgs.js +0 -30
- package/bin/process/daemon/CliArgs.js.map +0 -1
- package/bin/process/daemon/Client.d.ts +0 -31
- package/bin/process/daemon/Client.d.ts.map +0 -1
- package/bin/process/daemon/Client.js +0 -158
- package/bin/process/daemon/Client.js.map +0 -1
- package/bin/process/daemon/Manager.d.ts +0 -92
- package/bin/process/daemon/Manager.d.ts.map +0 -1
- package/bin/process/daemon/Manager.js +0 -287
- package/bin/process/daemon/Manager.js.map +0 -1
- package/bin/process/registry/AgentHostRuntime.js +0 -48
- package/bin/process/registry/CityPaths.d.ts +0 -53
- package/bin/process/registry/CityPaths.d.ts.map +0 -1
- package/bin/process/registry/CityPaths.js +0 -78
- package/bin/process/registry/CityPaths.js.map +0 -1
- package/bin/process/registry/CityRegistry.d.ts +0 -51
- package/bin/process/registry/CityRegistry.d.ts.map +0 -1
- package/bin/process/registry/CityRegistry.js +0 -217
- package/bin/process/registry/CityRegistry.js.map +0 -1
- package/bin/process/registry/CityRuntime.d.ts +0 -21
- package/bin/process/registry/CityRuntime.d.ts.map +0 -1
- package/bin/process/registry/CityRuntime.js +0 -45
- package/bin/process/registry/CityRuntime.js.map +0 -1
- package/bin/process/registry/ProcessSweep.d.ts +0 -76
- package/bin/process/registry/ProcessSweep.d.ts.map +0 -1
- package/bin/process/registry/ProcessSweep.js +0 -202
- package/bin/process/registry/ProcessSweep.js.map +0 -1
- package/bin/process/rpc/Client.d.ts +0 -13
- package/bin/process/rpc/Client.d.ts.map +0 -1
- package/bin/process/rpc/Client.js +0 -98
- package/bin/process/rpc/Client.js.map +0 -1
- package/bin/process/rpc/Paths.d.ts +0 -14
- package/bin/process/rpc/Paths.d.ts.map +0 -1
- package/bin/process/rpc/Paths.js +0 -36
- package/bin/process/rpc/Paths.js.map +0 -1
- package/bin/utils/cli/CliOutput.d.ts +0 -51
- package/bin/utils/cli/CliOutput.d.ts.map +0 -1
- package/bin/utils/cli/CliOutput.js +0 -117
- package/bin/utils/cli/CliOutput.js.map +0 -1
- package/bin/utils/storage.d.ts +0 -5
- package/bin/utils/storage.d.ts.map +0 -1
- package/bin/utils/storage.js +0 -23
- package/bin/utils/storage.js.map +0 -1
- package/public/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/public/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/public/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/scripts/bump-patch.mjs +0 -29
- package/scripts/copy-prompt-assets.mjs +0 -72
- package/scripts/ensure-cli-executable.mjs +0 -20
- package/scripts/lint-import-boundaries.mjs +0 -74
- package/src/cli/Index.ts +0 -142
- package/src/cli/agent/AgentChat.ts +0 -727
- package/src/cli/agent/AgentChatTypes.ts +0 -86
- package/src/cli/agent/AgentHistory.ts +0 -192
- package/src/cli/agent/AgentHistoryTypes.ts +0 -39
- package/src/cli/agent/AgentManager.ts +0 -667
- package/src/cli/agent/AgentManagerTypes.ts +0 -29
- package/src/cli/agent/AgentReset.ts +0 -181
- package/src/cli/agent/AgentSelection.ts +0 -297
- package/src/cli/agent/AgentSelectionTypes.ts +0 -36
- package/src/cli/agent/Init.ts +0 -297
- package/src/cli/agent/Restart.ts +0 -68
- package/src/cli/agent/Run.ts +0 -142
- package/src/cli/agent/Start.ts +0 -72
- package/src/cli/agent/Status.ts +0 -116
- package/src/cli/agent/Stop.ts +0 -45
- package/src/cli/control-plane/ControlPlaneAuthBootstrap.ts +0 -72
- package/src/cli/control-plane/ControlPlaneCommand.ts +0 -243
- package/src/cli/control-plane/ControlPlaneInit.ts +0 -83
- package/src/cli/control-plane/ControlPlaneProcess.ts +0 -497
- package/src/cli/control-plane/ControlPlanePublicManager.ts +0 -280
- package/src/cli/control-plane/ControlPlanePublicMode.ts +0 -141
- package/src/cli/control-plane/ControlPlaneRuntime.ts +0 -613
- package/src/cli/control-plane/ControlPlaneStatus.ts +0 -166
- package/src/cli/model/Model.ts +0 -34
- package/src/cli/model/ModelCommandShared.ts +0 -129
- package/src/cli/model/ModelCreateCommand.ts +0 -424
- package/src/cli/model/ModelManageCommand.ts +0 -520
- package/src/cli/model/ModelManager.ts +0 -974
- package/src/cli/model/ModelManagerTypes.ts +0 -119
- package/src/cli/model/ModelReadCommand.ts +0 -207
- package/src/cli/model/ModelSupport.ts +0 -223
- package/src/cli/model/preset/ModelPresetManager.ts +0 -242
- package/src/cli/shared/Alias.ts +0 -138
- package/src/cli/shared/Chat.ts +0 -30
- package/src/cli/shared/ChatAuth.ts +0 -201
- package/src/cli/shared/ChatManager.ts +0 -445
- package/src/cli/shared/ChatManagerTypes.ts +0 -19
- package/src/cli/shared/CliError.ts +0 -72
- package/src/cli/shared/CliReporter.ts +0 -362
- package/src/cli/shared/CliReporterTypes.ts +0 -167
- package/src/cli/shared/Config.ts +0 -301
- package/src/cli/shared/Env.ts +0 -556
- package/src/cli/shared/IndexAgentCommand.ts +0 -305
- package/src/cli/shared/IndexSupport.ts +0 -138
- package/src/cli/shared/ManagedPluginActionCommands.ts +0 -419
- package/src/cli/shared/ManagedPluginRemote.ts +0 -230
- package/src/cli/shared/PluginScheduleCommand.ts +0 -306
- package/src/cli/shared/PluginTargetSupport.ts +0 -275
- package/src/cli/shared/Plugins.ts +0 -733
- package/src/cli/shared/PortHints.ts +0 -80
- package/src/cli/shared/PublicAccess.ts +0 -106
- package/src/cli/shared/PublicHostEnv.ts +0 -116
- package/src/cli/shared/PublicHostEnvTypes.ts +0 -27
- package/src/cli/shared/Reset.ts +0 -93
- package/src/cli/shared/Token.ts +0 -702
- package/src/cli/shared/Update.ts +0 -217
- package/src/config/DowncitySchema.ts +0 -371
- package/src/config/Paths.ts +0 -294
- package/src/control/AgentStatusApiRoutes.ts +0 -225
- package/src/control/ChannelAccountApiRoutes.ts +0 -119
- package/src/control/ControlGateway.ts +0 -464
- package/src/control/EnvApiRoutes.ts +0 -257
- package/src/control/ModelApiRoutes.ts +0 -336
- package/src/control/ModelPoolService.ts +0 -9
- package/src/control/PlatformApiRoutes.ts +0 -495
- package/src/control/PluginApiRoutes.ts +0 -447
- package/src/control/gateway/AgentActions.ts +0 -440
- package/src/control/gateway/AgentCatalog.ts +0 -611
- package/src/control/gateway/FrontendAssets.ts +0 -79
- package/src/control/gateway/GatewaySupport.ts +0 -59
- package/src/control/gateway/Proxy.ts +0 -62
- package/src/control/instant/InstantApiRoutes.ts +0 -74
- package/src/control/instant/InstantSessionRunner.ts +0 -280
- package/src/control/instant/InstantSystemComposer.ts +0 -59
- package/src/http/auth/AuthEnv.ts +0 -71
- package/src/http/auth/AuthError.ts +0 -31
- package/src/http/auth/AuthMiddleware.ts +0 -61
- package/src/http/auth/AuthRoutes.ts +0 -100
- package/src/http/auth/AuthService.ts +0 -367
- package/src/http/auth/AuthStore.ts +0 -572
- package/src/http/auth/CliAuthStateStore.ts +0 -50
- package/src/http/auth/PasswordHasher.ts +0 -37
- package/src/http/auth/RoutePolicy.ts +0 -255
- package/src/http/auth/TokenService.ts +0 -36
- package/src/model/runtime/CreateRuntimeModel.ts +0 -437
- package/src/model/runtime/ExecutionModelBinding.ts +0 -120
- package/src/model/service/ModelPoolService.ts +0 -525
- package/src/platform/PluginLifecycle.ts +0 -132
- package/src/platform/store/StoreChannelAccountRepository.ts +0 -269
- package/src/platform/store/StoreEnvRepository.ts +0 -452
- package/src/platform/store/StoreModelRepository.ts +0 -324
- package/src/platform/store/StoreSchema.ts +0 -344
- package/src/platform/store/StoreSecureSettings.ts +0 -126
- package/src/platform/store/StoreShared.ts +0 -67
- package/src/platform/store/crypto.ts +0 -112
- package/src/platform/store/index.ts +0 -497
- package/src/platform/store/schema.ts +0 -103
- package/src/process/daemon/Api.ts +0 -64
- package/src/process/daemon/CliArgs.ts +0 -39
- package/src/process/daemon/Client.ts +0 -182
- package/src/process/daemon/Manager.ts +0 -344
- package/src/process/daemon/PortAllocator.ts +0 -64
- package/src/process/registry/AgentHostRuntime.ts +0 -69
- package/src/process/registry/CityPaths.ts +0 -87
- package/src/process/registry/CityRegistry.ts +0 -256
- package/src/process/registry/CityRuntime.ts +0 -45
- package/src/process/registry/ProcessSweep.ts +0 -256
- package/src/process/rpc/Client.ts +0 -113
- package/src/process/rpc/Paths.ts +0 -43
- package/src/utils/Id.ts +0 -13
- package/src/utils/cli/CliOutput.ts +0 -170
- package/src/utils/cli/Spinner.ts +0 -161
- package/src/utils/storage.ts +0 -26
- package/tsconfig.json +0 -26
- /package/{bin/cli → city}/shared/CliError.d.ts +0 -0
- /package/{bin/cli → city}/shared/CliError.js +0 -0
- /package/{bin/cli → city}/shared/CliReporter.d.ts +0 -0
- /package/{bin/cli → city}/shared/CliReporterTypes.js +0 -0
- /package/{bin/cli → town}/agent/AgentHistoryTypes.d.ts +0 -0
- /package/{bin/cli → town}/agent/AgentHistoryTypes.js +0 -0
- /package/{bin/cli → town}/agent/AgentSelectionTypes.js +0 -0
- /package/{bin → town}/config/DowncitySchema.d.ts +0 -0
- /package/{bin → town}/control/AgentStatusApiRoutes.d.ts +0 -0
- /package/{bin → town}/control/AgentStatusApiRoutes.d.ts.map +0 -0
- /package/{bin → town}/control/AgentStatusApiRoutes.js +0 -0
- /package/{bin → town}/control/AgentStatusApiRoutes.js.map +0 -0
- /package/{bin → town}/control/ChannelAccountApiRoutes.d.ts +0 -0
- /package/{bin → town}/control/ChannelAccountApiRoutes.d.ts.map +0 -0
- /package/{bin → town}/control/ChannelAccountApiRoutes.js +0 -0
- /package/{bin → town}/control/ChannelAccountApiRoutes.js.map +0 -0
- /package/{bin → town}/control/PluginApiRoutes.d.ts +0 -0
- /package/{bin → town}/control/PluginApiRoutes.d.ts.map +0 -0
- /package/{bin → town}/control/gateway/FrontendAssets.d.ts +0 -0
- /package/{bin → town}/control/gateway/FrontendAssets.d.ts.map +0 -0
- /package/{bin → town}/control/gateway/FrontendAssets.js +0 -0
- /package/{bin → town}/control/gateway/FrontendAssets.js.map +0 -0
- /package/{bin → town}/control/gateway/GatewaySupport.d.ts +0 -0
- /package/{bin → town}/control/gateway/GatewaySupport.d.ts.map +0 -0
- /package/{bin → town}/control/gateway/GatewaySupport.js +0 -0
- /package/{bin → town}/control/gateway/GatewaySupport.js.map +0 -0
- /package/{bin → town}/control/gateway/Proxy.d.ts +0 -0
- /package/{bin → town}/control/gateway/Proxy.d.ts.map +0 -0
- /package/{bin → town}/control/gateway/Proxy.js.map +0 -0
- /package/{bin → town}/control/instant/InstantApiRoutes.d.ts +0 -0
- /package/{bin → town}/control/instant/InstantApiRoutes.d.ts.map +0 -0
- /package/{bin → town}/control/instant/InstantApiRoutes.js +0 -0
- /package/{bin → town}/control/instant/InstantApiRoutes.js.map +0 -0
- /package/{bin → town}/control/instant/InstantSessionRunner.d.ts +0 -0
- /package/{bin → town}/control/instant/InstantSystemComposer.d.ts +0 -0
- /package/{bin → town}/control/instant/InstantSystemComposer.d.ts.map +0 -0
- /package/{bin → town}/control/instant/InstantSystemComposer.js +0 -0
- /package/{bin → town}/control/instant/InstantSystemComposer.js.map +0 -0
- /package/{bin → town}/http/auth/AuthEnv.d.ts.map +0 -0
- /package/{bin → town}/http/auth/AuthEnv.js.map +0 -0
- /package/{bin → town}/http/auth/AuthError.d.ts +0 -0
- /package/{bin → town}/http/auth/AuthError.d.ts.map +0 -0
- /package/{bin → town}/http/auth/AuthError.js +0 -0
- /package/{bin → town}/http/auth/AuthError.js.map +0 -0
- /package/{bin → town}/http/auth/AuthMiddleware.d.ts +0 -0
- /package/{bin → town}/http/auth/AuthMiddleware.d.ts.map +0 -0
- /package/{bin → town}/http/auth/AuthMiddleware.js +0 -0
- /package/{bin → town}/http/auth/AuthMiddleware.js.map +0 -0
- /package/{bin → town}/http/auth/AuthRoutes.d.ts +0 -0
- /package/{bin → town}/http/auth/AuthRoutes.d.ts.map +0 -0
- /package/{bin → town}/http/auth/AuthRoutes.js +0 -0
- /package/{bin → town}/http/auth/AuthRoutes.js.map +0 -0
- /package/{bin → town}/http/auth/AuthService.d.ts +0 -0
- /package/{bin → town}/http/auth/AuthService.d.ts.map +0 -0
- /package/{bin → town}/http/auth/AuthService.js +0 -0
- /package/{bin → town}/http/auth/AuthService.js.map +0 -0
- /package/{bin → town}/http/auth/AuthStore.d.ts +0 -0
- /package/{bin → town}/http/auth/AuthStore.d.ts.map +0 -0
- /package/{bin → town}/http/auth/AuthStore.js.map +0 -0
- /package/{bin → town}/http/auth/CliAuthStateStore.d.ts +0 -0
- /package/{bin → town}/http/auth/CliAuthStateStore.d.ts.map +0 -0
- /package/{bin → town}/http/auth/CliAuthStateStore.js +0 -0
- /package/{bin → town}/http/auth/CliAuthStateStore.js.map +0 -0
- /package/{bin → town}/http/auth/PasswordHasher.d.ts +0 -0
- /package/{bin → town}/http/auth/PasswordHasher.d.ts.map +0 -0
- /package/{bin → town}/http/auth/PasswordHasher.js +0 -0
- /package/{bin → town}/http/auth/PasswordHasher.js.map +0 -0
- /package/{bin → town}/http/auth/RoutePolicy.d.ts +0 -0
- /package/{bin → town}/http/auth/RoutePolicy.d.ts.map +0 -0
- /package/{bin → town}/http/auth/RoutePolicy.js +0 -0
- /package/{bin → town}/http/auth/RoutePolicy.js.map +0 -0
- /package/{bin → town}/http/auth/TokenService.d.ts +0 -0
- /package/{bin → town}/http/auth/TokenService.d.ts.map +0 -0
- /package/{bin → town}/http/auth/TokenService.js +0 -0
- /package/{bin → town}/http/auth/TokenService.js.map +0 -0
- /package/{bin → town}/platform/store/StoreChannelAccountRepository.d.ts +0 -0
- /package/{bin → town}/platform/store/StoreChannelAccountRepository.d.ts.map +0 -0
- /package/{bin → town}/platform/store/StoreChannelAccountRepository.js +0 -0
- /package/{bin → town}/platform/store/StoreChannelAccountRepository.js.map +0 -0
- /package/{bin → town}/platform/store/StoreSchema.d.ts +0 -0
- /package/{bin → town}/platform/store/StoreSecureSettings.d.ts +0 -0
- /package/{bin → town}/platform/store/StoreSecureSettings.d.ts.map +0 -0
- /package/{bin → town}/platform/store/StoreSecureSettings.js +0 -0
- /package/{bin → town}/platform/store/StoreSecureSettings.js.map +0 -0
- /package/{bin → town}/platform/store/StoreShared.d.ts +0 -0
- /package/{bin → town}/platform/store/StoreShared.d.ts.map +0 -0
- /package/{bin → town}/platform/store/StoreShared.js +0 -0
- /package/{bin → town}/platform/store/StoreShared.js.map +0 -0
- /package/{bin → town}/platform/store/crypto.d.ts +0 -0
- /package/{bin → town}/platform/store/crypto.d.ts.map +0 -0
- /package/{bin → town}/platform/store/crypto.js.map +0 -0
- /package/{bin → town}/process/daemon/Api.d.ts.map +0 -0
- /package/{bin → town}/process/daemon/Api.js.map +0 -0
- /package/{bin → town}/process/daemon/PortAllocator.d.ts +0 -0
- /package/{bin → town}/process/daemon/PortAllocator.d.ts.map +0 -0
- /package/{bin → town}/process/daemon/PortAllocator.js +0 -0
- /package/{bin → town}/process/daemon/PortAllocator.js.map +0 -0
- /package/{bin → town}/process/registry/AgentHostRuntime.d.ts +0 -0
- /package/{bin → town}/process/registry/AgentHostRuntime.d.ts.map +0 -0
- /package/{bin → town}/process/registry/AgentHostRuntime.js.map +0 -0
- /package/{bin/cli → town}/shared/PublicAccess.d.ts +0 -0
- /package/{bin/cli → town}/shared/PublicAccess.js +0 -0
- /package/{bin → town}/utils/Id.d.ts +0 -0
- /package/{bin → town}/utils/Id.d.ts.map +0 -0
- /package/{bin → town}/utils/Id.js +0 -0
- /package/{bin → town}/utils/Id.js.map +0 -0
- /package/{bin → town}/utils/cli/Spinner.d.ts +0 -0
- /package/{bin → town}/utils/cli/Spinner.d.ts.map +0 -0
- /package/{bin → town}/utils/cli/Spinner.js +0 -0
- /package/{bin → town}/utils/cli/Spinner.js.map +0 -0
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 受 agent 托管的 plugin action CLI 注册器。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 负责把需要运行中 agent 承载的 plugin actions 挂到 commander(`city <plugin> <action>`)。
|
|
6
|
-
* - 仅处理 CLI 参数映射与远程调用,不承载 plugin 状态机逻辑。
|
|
7
|
-
* - 命令注册表与调度时间解析统一复用 agent 包实现,避免 city 维护第二套事实源。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import path from "node:path";
|
|
11
|
-
import type { Command } from "commander";
|
|
12
|
-
import {
|
|
13
|
-
callAgentTransport,
|
|
14
|
-
parseActionScheduleRunAtMsOrThrow,
|
|
15
|
-
} from "@downcity/agent";
|
|
16
|
-
import { listPluginsWithLifecycle } from "@downcity/agent";
|
|
17
|
-
import type { BasePlugin, PluginAction } from "@downcity/agent";
|
|
18
|
-
import type { JsonObject, JsonValue } from "@downcity/agent";
|
|
19
|
-
import type { PluginActionScheduleInput } from "@downcity/agent";
|
|
20
|
-
import type { PluginCommandResponse } from "@downcity/agent";
|
|
21
|
-
import type { PluginCliBaseOptions } from "@downcity/agent";
|
|
22
|
-
import { printResult } from "@/utils/cli/CliOutput.js";
|
|
23
|
-
import { parseBoolean, parsePort } from "./IndexSupport.js";
|
|
24
|
-
import { runManagedPluginControlCommand } from "./ManagedPluginRemote.js";
|
|
25
|
-
|
|
26
|
-
const CHAT_PLUGIN_HELP_TEXT = [
|
|
27
|
-
"",
|
|
28
|
-
"Chat quick guide:",
|
|
29
|
-
" 直接输出 assistant 文本会发送到当前 chat channel。",
|
|
30
|
-
" 跨 chat 发送请使用 `city chat send --chat-key <chatKey>`。",
|
|
31
|
-
" 如果要发正文/附件/定时消息,先看 `city chat send --help` 与 `city chat react --help`。",
|
|
32
|
-
"",
|
|
33
|
-
"Common examples:",
|
|
34
|
-
" city chat send --text 'done'",
|
|
35
|
-
" city chat send --chat-key <chatKey> --text 'done'",
|
|
36
|
-
" city chat react --message-id <messageId> --emoji '✅'",
|
|
37
|
-
" city chat context",
|
|
38
|
-
" city chat history --limit 30",
|
|
39
|
-
].join("\n");
|
|
40
|
-
|
|
41
|
-
const CHAT_HELP_HOOK_ATTACHED = Symbol("chat-help-hook-attached");
|
|
42
|
-
|
|
43
|
-
type PluginCliBridgeOptions = {
|
|
44
|
-
path?: string;
|
|
45
|
-
host?: string;
|
|
46
|
-
port?: number;
|
|
47
|
-
token?: string;
|
|
48
|
-
json?: boolean;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
function resolveProjectRoot(pathInput?: string): string {
|
|
52
|
-
return path.resolve(String(pathInput || "."));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function toJsonValue(input: unknown): JsonValue | undefined {
|
|
56
|
-
if (input === null) return null;
|
|
57
|
-
if (typeof input === "string") return input;
|
|
58
|
-
if (typeof input === "number") {
|
|
59
|
-
return Number.isFinite(input) ? input : undefined;
|
|
60
|
-
}
|
|
61
|
-
if (typeof input === "boolean") return input;
|
|
62
|
-
|
|
63
|
-
if (Array.isArray(input)) {
|
|
64
|
-
const values: JsonValue[] = [];
|
|
65
|
-
for (const item of input) {
|
|
66
|
-
const value = toJsonValue(item);
|
|
67
|
-
if (value === undefined) continue;
|
|
68
|
-
values.push(value);
|
|
69
|
-
}
|
|
70
|
-
return values;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (typeof input === "object" && input) {
|
|
74
|
-
const output: JsonObject = {};
|
|
75
|
-
for (const [key, value] of Object.entries(
|
|
76
|
-
input as Record<string, unknown>,
|
|
77
|
-
)) {
|
|
78
|
-
const normalized = toJsonValue(value);
|
|
79
|
-
if (normalized === undefined) continue;
|
|
80
|
-
output[key] = normalized;
|
|
81
|
-
}
|
|
82
|
-
return output;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return undefined;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function toPluginActionCommandOpts(
|
|
89
|
-
options: Record<string, unknown>,
|
|
90
|
-
): Record<string, JsonValue> {
|
|
91
|
-
const reservedKeys = new Set(["path", "host", "port", "token", "json", "delay", "time"]);
|
|
92
|
-
const normalized: Record<string, JsonValue> = {};
|
|
93
|
-
for (const [key, value] of Object.entries(options)) {
|
|
94
|
-
if (reservedKeys.has(key)) continue;
|
|
95
|
-
const nextValue = toJsonValue(value);
|
|
96
|
-
if (nextValue === undefined) continue;
|
|
97
|
-
normalized[key] = nextValue;
|
|
98
|
-
}
|
|
99
|
-
return normalized;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function toPluginCliBridgeOptions(
|
|
103
|
-
options: Record<string, unknown>,
|
|
104
|
-
): PluginCliBridgeOptions {
|
|
105
|
-
return {
|
|
106
|
-
path: typeof options.path === "string" ? options.path : ".",
|
|
107
|
-
host: typeof options.host === "string" ? options.host : undefined,
|
|
108
|
-
port: typeof options.port === "number" ? options.port : undefined,
|
|
109
|
-
token: typeof options.token === "string" ? options.token : undefined,
|
|
110
|
-
json: options.json !== false,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function flattenPluginActionCommandArgs(values: unknown[]): string[] {
|
|
115
|
-
const out: string[] = [];
|
|
116
|
-
const pushValue = (value: unknown): void => {
|
|
117
|
-
if (value === undefined || value === null) return;
|
|
118
|
-
if (Array.isArray(value)) {
|
|
119
|
-
for (const item of value) pushValue(item);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const text = String(value).trim();
|
|
123
|
-
if (!text) return;
|
|
124
|
-
out.push(text);
|
|
125
|
-
};
|
|
126
|
-
for (const value of values) {
|
|
127
|
-
pushValue(value);
|
|
128
|
-
}
|
|
129
|
-
return out;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function isCommanderCommandLike(value: unknown): value is Command {
|
|
133
|
-
return Boolean(
|
|
134
|
-
value &&
|
|
135
|
-
typeof value === "object" &&
|
|
136
|
-
typeof (value as { opts?: unknown }).opts === "function",
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function isPlainOptionsObject(
|
|
141
|
-
value: unknown,
|
|
142
|
-
): value is Record<string, unknown> {
|
|
143
|
-
return Boolean(
|
|
144
|
-
value &&
|
|
145
|
-
typeof value === "object" &&
|
|
146
|
-
!Array.isArray(value) &&
|
|
147
|
-
typeof (value as { opts?: unknown }).opts !== "function",
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* 判断 command 是否已定义指定长参数。
|
|
153
|
-
*/
|
|
154
|
-
function hasLongOption(command: Command, longFlag: string): boolean {
|
|
155
|
-
return command.options.some((item) => item.long === longFlag);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* 从 CLI 选项中提取通用调度输入。
|
|
160
|
-
*/
|
|
161
|
-
function extractCommandScheduleInput(
|
|
162
|
-
options: Record<string, unknown>,
|
|
163
|
-
): PluginActionScheduleInput | undefined {
|
|
164
|
-
const runAtMs = parseActionScheduleRunAtMsOrThrow({
|
|
165
|
-
delay: options.delay as string | number | undefined,
|
|
166
|
-
time: options.time as string | number | undefined,
|
|
167
|
-
});
|
|
168
|
-
if (typeof runAtMs !== "number") return undefined;
|
|
169
|
-
return { runAtMs };
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function registerPluginActionCommand(params: {
|
|
173
|
-
program: Command;
|
|
174
|
-
plugin: BasePlugin;
|
|
175
|
-
actionName: string;
|
|
176
|
-
action: PluginAction<JsonValue, JsonValue>;
|
|
177
|
-
}): void {
|
|
178
|
-
const commandSpec = params.action.command;
|
|
179
|
-
if (!commandSpec) return;
|
|
180
|
-
|
|
181
|
-
const pluginCommand =
|
|
182
|
-
params.program.commands.find((item) => item.name() === params.plugin.name) ||
|
|
183
|
-
params.program
|
|
184
|
-
.command(params.plugin.name)
|
|
185
|
-
.description(`${params.plugin.name} plugin actions`)
|
|
186
|
-
.helpOption("--help", "display help for command");
|
|
187
|
-
|
|
188
|
-
if (
|
|
189
|
-
params.plugin.name === "chat" &&
|
|
190
|
-
!(pluginCommand as Command & { [CHAT_HELP_HOOK_ATTACHED]?: boolean })[
|
|
191
|
-
CHAT_HELP_HOOK_ATTACHED
|
|
192
|
-
]
|
|
193
|
-
) {
|
|
194
|
-
const chatCommand = pluginCommand as Command & {
|
|
195
|
-
[CHAT_HELP_HOOK_ATTACHED]?: boolean;
|
|
196
|
-
};
|
|
197
|
-
chatCommand.on("--help", () => {
|
|
198
|
-
console.log(CHAT_PLUGIN_HELP_TEXT);
|
|
199
|
-
});
|
|
200
|
-
chatCommand[CHAT_HELP_HOOK_ATTACHED] = true;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const actionCommand = pluginCommand
|
|
204
|
-
.command(params.actionName)
|
|
205
|
-
.description(commandSpec.description)
|
|
206
|
-
.helpOption("--help", "display help for command")
|
|
207
|
-
.option("--path <path>", "项目根目录(默认当前目录)", ".")
|
|
208
|
-
.option("--host <host>", "Server host(覆盖自动解析)")
|
|
209
|
-
.option("--port <port>", "Server port(覆盖自动解析)", parsePort)
|
|
210
|
-
.option("--token <token>", "覆盖 Bearer Token(仅远程 HTTP 调用需要;默认本地走 IPC)")
|
|
211
|
-
.option("--json [enabled]", "以 JSON 输出", parseBoolean, true);
|
|
212
|
-
|
|
213
|
-
commandSpec.configure?.(actionCommand);
|
|
214
|
-
if (!hasLongOption(actionCommand, "--delay")) {
|
|
215
|
-
actionCommand.option("--delay <ms>", "延迟执行毫秒数(所有 plugin action 通用)");
|
|
216
|
-
}
|
|
217
|
-
if (!hasLongOption(actionCommand, "--time")) {
|
|
218
|
-
actionCommand.option(
|
|
219
|
-
"--time <time>",
|
|
220
|
-
"定时执行时间(Unix 时间戳秒/毫秒或 ISO 时间,所有 plugin action 通用)",
|
|
221
|
-
);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
actionCommand.action(async (...rawArgs: unknown[]) => {
|
|
225
|
-
const last = rawArgs.at(-1);
|
|
226
|
-
const commandLike = isCommanderCommandLike(last) ? last : null;
|
|
227
|
-
const positionalArgs = commandLike
|
|
228
|
-
? flattenPluginActionCommandArgs(
|
|
229
|
-
Array.isArray(commandLike.processedArgs)
|
|
230
|
-
? (commandLike.processedArgs as unknown[])
|
|
231
|
-
: [],
|
|
232
|
-
)
|
|
233
|
-
: (() => {
|
|
234
|
-
const fallbackLast = rawArgs.at(-1);
|
|
235
|
-
const fallbackPositional = isPlainOptionsObject(fallbackLast)
|
|
236
|
-
? rawArgs.slice(0, -1)
|
|
237
|
-
: rawArgs;
|
|
238
|
-
return flattenPluginActionCommandArgs(fallbackPositional);
|
|
239
|
-
})();
|
|
240
|
-
const allOptions = commandLike
|
|
241
|
-
? ((commandLike.opts() as Record<string, unknown>) || {})
|
|
242
|
-
: (() => {
|
|
243
|
-
const fallbackLast = rawArgs.at(-1);
|
|
244
|
-
return isPlainOptionsObject(fallbackLast) ? fallbackLast : {};
|
|
245
|
-
})();
|
|
246
|
-
const actionOptions = toPluginActionCommandOpts(allOptions);
|
|
247
|
-
const bridgeOptions = toPluginCliBridgeOptions(allOptions);
|
|
248
|
-
let schedule: PluginActionScheduleInput | undefined;
|
|
249
|
-
try {
|
|
250
|
-
schedule = extractCommandScheduleInput(allOptions);
|
|
251
|
-
} catch (error) {
|
|
252
|
-
printResult({
|
|
253
|
-
asJson: bridgeOptions.json,
|
|
254
|
-
success: false,
|
|
255
|
-
title: `${params.plugin.name}.${params.actionName} failed`,
|
|
256
|
-
payload: {
|
|
257
|
-
error: `Failed to parse schedule input: ${String(error)}`,
|
|
258
|
-
},
|
|
259
|
-
});
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
let payload: JsonValue;
|
|
264
|
-
try {
|
|
265
|
-
payload = await commandSpec.mapInput({
|
|
266
|
-
args: positionalArgs,
|
|
267
|
-
opts: actionOptions,
|
|
268
|
-
});
|
|
269
|
-
} catch (error) {
|
|
270
|
-
printResult({
|
|
271
|
-
asJson: bridgeOptions.json,
|
|
272
|
-
success: false,
|
|
273
|
-
title: `${params.plugin.name}.${params.actionName} failed`,
|
|
274
|
-
payload: {
|
|
275
|
-
error: `Failed to parse command input: ${String(error)}`,
|
|
276
|
-
},
|
|
277
|
-
});
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
const remote = await callAgentTransport<PluginCommandResponse>({
|
|
282
|
-
projectRoot: resolveProjectRoot(bridgeOptions.path),
|
|
283
|
-
path: "/api/plugins/command",
|
|
284
|
-
method: "POST",
|
|
285
|
-
host: bridgeOptions.host,
|
|
286
|
-
port: bridgeOptions.port,
|
|
287
|
-
authToken: bridgeOptions.token,
|
|
288
|
-
body: {
|
|
289
|
-
pluginName: params.plugin.name,
|
|
290
|
-
command: params.actionName,
|
|
291
|
-
payload,
|
|
292
|
-
...(schedule ? { schedule } : {}),
|
|
293
|
-
} as unknown as JsonValue,
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
if (remote.success && remote.data) {
|
|
297
|
-
const data = remote.data;
|
|
298
|
-
printResult({
|
|
299
|
-
asJson: bridgeOptions.json,
|
|
300
|
-
success: Boolean(data.success),
|
|
301
|
-
title: data.success
|
|
302
|
-
? `${params.plugin.name}.${params.actionName} ok`
|
|
303
|
-
: `${params.plugin.name}.${params.actionName} failed`,
|
|
304
|
-
payload: {
|
|
305
|
-
...(data.data !== undefined ? { data: data.data } : {}),
|
|
306
|
-
...(data.message ? { message: data.message } : {}),
|
|
307
|
-
...(data.error ? { error: data.error } : {}),
|
|
308
|
-
},
|
|
309
|
-
});
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
printResult({
|
|
314
|
-
asJson: bridgeOptions.json,
|
|
315
|
-
success: false,
|
|
316
|
-
title: `${params.plugin.name}.${params.actionName} failed`,
|
|
317
|
-
payload: {
|
|
318
|
-
error: remote.error || "Unknown error",
|
|
319
|
-
},
|
|
320
|
-
});
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
function hasPluginSubcommand(command: Command, name: string): boolean {
|
|
325
|
-
return command.commands.some((item) => item.name() === name);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
function attachPluginLifecycleOptions(command: Command): Command {
|
|
329
|
-
return command
|
|
330
|
-
.option("--path <path>", "项目根目录(默认当前目录)", ".")
|
|
331
|
-
.option("--host <host>", "Server host(覆盖自动解析)")
|
|
332
|
-
.option("--port <port>", "Server port(覆盖自动解析)", parsePort)
|
|
333
|
-
.option("--token <token>", "覆盖 Bearer Token(仅远程 HTTP 调用需要;默认本地走 IPC)")
|
|
334
|
-
.option("--json [enabled]", "以 JSON 输出", parseBoolean, true);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function registerPluginLifecycleCommands(params: {
|
|
338
|
-
program: Command;
|
|
339
|
-
plugin: BasePlugin;
|
|
340
|
-
}): void {
|
|
341
|
-
if (!params.plugin.lifecycle?.start && !params.plugin.lifecycle?.stop) {
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
const pluginCommand =
|
|
346
|
-
params.program.commands.find((item) => item.name() === params.plugin.name) ||
|
|
347
|
-
params.program
|
|
348
|
-
.command(params.plugin.name)
|
|
349
|
-
.description(`${params.plugin.name} plugin actions`)
|
|
350
|
-
.helpOption("--help", "display help for command");
|
|
351
|
-
|
|
352
|
-
const lifecycleCommands = [
|
|
353
|
-
{
|
|
354
|
-
name: "start",
|
|
355
|
-
description: `启动 ${params.plugin.name} plugin`,
|
|
356
|
-
action: "start" as const,
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
name: "stop",
|
|
360
|
-
description: `停止 ${params.plugin.name} plugin`,
|
|
361
|
-
action: "stop" as const,
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
name: "restart",
|
|
365
|
-
description: `重启 ${params.plugin.name} plugin`,
|
|
366
|
-
action: "restart" as const,
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
name: "status",
|
|
370
|
-
description: `查看 ${params.plugin.name} plugin 运行状态`,
|
|
371
|
-
action: "status" as const,
|
|
372
|
-
},
|
|
373
|
-
];
|
|
374
|
-
|
|
375
|
-
for (const item of lifecycleCommands) {
|
|
376
|
-
if (hasPluginSubcommand(pluginCommand, item.name)) {
|
|
377
|
-
continue;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
attachPluginLifecycleOptions(
|
|
381
|
-
pluginCommand
|
|
382
|
-
.command(item.name)
|
|
383
|
-
.description(item.description)
|
|
384
|
-
.helpOption("--help", "display help for command"),
|
|
385
|
-
).action(async (options: PluginCliBaseOptions) => {
|
|
386
|
-
await runManagedPluginControlCommand({
|
|
387
|
-
pluginName: params.plugin.name,
|
|
388
|
-
action: item.action,
|
|
389
|
-
options,
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* 注册所有受 agent 托管的 plugin actions CLI 命令。
|
|
397
|
-
*/
|
|
398
|
-
export function registerManagedPluginCommandsForCli(
|
|
399
|
-
program: Command,
|
|
400
|
-
pluginsInput: BasePlugin[],
|
|
401
|
-
): void {
|
|
402
|
-
const plugins = listPluginsWithLifecycle(pluginsInput);
|
|
403
|
-
for (const plugin of plugins) {
|
|
404
|
-
for (const [actionName, action] of Object.entries(plugin.actions)) {
|
|
405
|
-
registerPluginActionCommand({
|
|
406
|
-
program,
|
|
407
|
-
plugin,
|
|
408
|
-
actionName,
|
|
409
|
-
action: action as PluginAction<JsonValue, JsonValue>,
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
for (const plugin of plugins) {
|
|
414
|
-
registerPluginLifecycleCommands({
|
|
415
|
-
program,
|
|
416
|
-
plugin,
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
}
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `city plugin` 运行态远程 Agent server 调用辅助。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 统一处理 list/control/command 三类需要访问 Agent server 的命令。
|
|
6
|
-
* - 这里不负责命令注册,只负责 transport 调用与结果输出。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { callAgentTransport } from "@downcity/agent";
|
|
10
|
-
import { printResult } from "@/utils/cli/CliOutput.js";
|
|
11
|
-
import type {
|
|
12
|
-
PluginCliBaseOptions,
|
|
13
|
-
PluginCommandResponse,
|
|
14
|
-
PluginControlAction,
|
|
15
|
-
PluginControlResponse,
|
|
16
|
-
PluginStateListResponse,
|
|
17
|
-
} from "@downcity/agent";
|
|
18
|
-
import {
|
|
19
|
-
parseCommandPayload,
|
|
20
|
-
resolvePluginProjectRoot,
|
|
21
|
-
validateAgentProjectRoot,
|
|
22
|
-
} from "./PluginTargetSupport.js";
|
|
23
|
-
|
|
24
|
-
const PLUGIN_COMMAND_TIMEOUT_MS = 120_000;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 执行 `plugin list`。
|
|
28
|
-
*/
|
|
29
|
-
export async function runManagedPluginListCommand(options: PluginCliBaseOptions): Promise<void> {
|
|
30
|
-
const resolved = await resolvePluginProjectRoot(options);
|
|
31
|
-
if (!resolved.projectRoot) {
|
|
32
|
-
printResult({
|
|
33
|
-
asJson: options.json,
|
|
34
|
-
success: false,
|
|
35
|
-
title: "plugin list failed",
|
|
36
|
-
payload: {
|
|
37
|
-
error: resolved.error || "Failed to resolve agent project path",
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const projectRoot = resolved.projectRoot;
|
|
43
|
-
const pathError = validateAgentProjectRoot(projectRoot);
|
|
44
|
-
if (pathError) {
|
|
45
|
-
printResult({
|
|
46
|
-
asJson: options.json,
|
|
47
|
-
success: false,
|
|
48
|
-
title: "plugin list failed",
|
|
49
|
-
payload: {
|
|
50
|
-
error: pathError,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const remote = await callAgentTransport<PluginStateListResponse>({
|
|
56
|
-
projectRoot,
|
|
57
|
-
path: "/api/plugins/list",
|
|
58
|
-
method: "GET",
|
|
59
|
-
host: options.host,
|
|
60
|
-
port: options.port,
|
|
61
|
-
authToken: options.token,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
if (remote.success && remote.data) {
|
|
65
|
-
printResult({
|
|
66
|
-
asJson: options.json,
|
|
67
|
-
success: Boolean(remote.data.success),
|
|
68
|
-
title: remote.data.success ? "plugin listed" : "plugin list failed",
|
|
69
|
-
payload: {
|
|
70
|
-
...(Array.isArray(remote.data.plugins) ? { plugins: remote.data.plugins } : {}),
|
|
71
|
-
...(remote.data.error ? { error: remote.data.error } : {}),
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
printResult({
|
|
78
|
-
asJson: options.json,
|
|
79
|
-
success: false,
|
|
80
|
-
title: "plugin list failed",
|
|
81
|
-
payload: {
|
|
82
|
-
error: remote.error || "Unknown error",
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 执行 `plugin status/start/stop/restart`。
|
|
89
|
-
*/
|
|
90
|
-
export async function runManagedPluginControlCommand(params: {
|
|
91
|
-
pluginName: string;
|
|
92
|
-
action: PluginControlAction;
|
|
93
|
-
options: PluginCliBaseOptions;
|
|
94
|
-
}): Promise<void> {
|
|
95
|
-
const resolved = await resolvePluginProjectRoot(params.options);
|
|
96
|
-
if (!resolved.projectRoot) {
|
|
97
|
-
printResult({
|
|
98
|
-
asJson: params.options.json,
|
|
99
|
-
success: false,
|
|
100
|
-
title: `plugin ${params.action} failed`,
|
|
101
|
-
payload: {
|
|
102
|
-
error: resolved.error || "Failed to resolve agent project path",
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const projectRoot = resolved.projectRoot;
|
|
108
|
-
const pathError = validateAgentProjectRoot(projectRoot);
|
|
109
|
-
if (pathError) {
|
|
110
|
-
printResult({
|
|
111
|
-
asJson: params.options.json,
|
|
112
|
-
success: false,
|
|
113
|
-
title: `plugin ${params.action} failed`,
|
|
114
|
-
payload: {
|
|
115
|
-
error: pathError,
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
const remote = await callAgentTransport<PluginControlResponse>({
|
|
121
|
-
projectRoot,
|
|
122
|
-
path: "/api/plugins/control",
|
|
123
|
-
method: "POST",
|
|
124
|
-
host: params.options.host,
|
|
125
|
-
port: params.options.port,
|
|
126
|
-
authToken: params.options.token,
|
|
127
|
-
body: {
|
|
128
|
-
pluginName: params.pluginName,
|
|
129
|
-
action: params.action,
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
if (remote.success && remote.data) {
|
|
134
|
-
printResult({
|
|
135
|
-
asJson: params.options.json,
|
|
136
|
-
success: Boolean(remote.data.success),
|
|
137
|
-
title: remote.data.success ? `plugin ${params.action} ok` : `plugin ${params.action} failed`,
|
|
138
|
-
payload: {
|
|
139
|
-
...(remote.data.plugin ? { plugin: remote.data.plugin } : {}),
|
|
140
|
-
...(remote.data.error ? { error: remote.data.error } : {}),
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
printResult({
|
|
147
|
-
asJson: params.options.json,
|
|
148
|
-
success: false,
|
|
149
|
-
title: `plugin ${params.action} failed`,
|
|
150
|
-
payload: {
|
|
151
|
-
error: remote.error || "Unknown error",
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* 执行 `plugin command` 桥接。
|
|
158
|
-
*/
|
|
159
|
-
export async function runManagedPluginCommandBridge(params: {
|
|
160
|
-
pluginName: string;
|
|
161
|
-
command: string;
|
|
162
|
-
payloadRaw?: string;
|
|
163
|
-
options: PluginCliBaseOptions;
|
|
164
|
-
}): Promise<void> {
|
|
165
|
-
const resolved = await resolvePluginProjectRoot(params.options);
|
|
166
|
-
if (!resolved.projectRoot) {
|
|
167
|
-
printResult({
|
|
168
|
-
asJson: params.options.json,
|
|
169
|
-
success: false,
|
|
170
|
-
title: "plugin command failed",
|
|
171
|
-
payload: {
|
|
172
|
-
error: resolved.error || "Failed to resolve agent project path",
|
|
173
|
-
},
|
|
174
|
-
});
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
const projectRoot = resolved.projectRoot;
|
|
178
|
-
const pathError = validateAgentProjectRoot(projectRoot);
|
|
179
|
-
if (pathError) {
|
|
180
|
-
printResult({
|
|
181
|
-
asJson: params.options.json,
|
|
182
|
-
success: false,
|
|
183
|
-
title: "plugin command failed",
|
|
184
|
-
payload: {
|
|
185
|
-
error: pathError,
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const remote = await callAgentTransport<PluginCommandResponse>({
|
|
191
|
-
projectRoot,
|
|
192
|
-
path: "/api/plugins/command",
|
|
193
|
-
method: "POST",
|
|
194
|
-
timeoutMs: PLUGIN_COMMAND_TIMEOUT_MS,
|
|
195
|
-
host: params.options.host,
|
|
196
|
-
port: params.options.port,
|
|
197
|
-
authToken: params.options.token,
|
|
198
|
-
body: {
|
|
199
|
-
pluginName: params.pluginName,
|
|
200
|
-
command: params.command,
|
|
201
|
-
...(params.payloadRaw !== undefined
|
|
202
|
-
? { payload: parseCommandPayload(params.payloadRaw) }
|
|
203
|
-
: {}),
|
|
204
|
-
},
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
if (remote.success && remote.data) {
|
|
208
|
-
printResult({
|
|
209
|
-
asJson: params.options.json,
|
|
210
|
-
success: Boolean(remote.data.success),
|
|
211
|
-
title: remote.data.success ? "plugin command ok" : "plugin command failed",
|
|
212
|
-
payload: {
|
|
213
|
-
...(remote.data.plugin ? { plugin: remote.data.plugin } : {}),
|
|
214
|
-
...(remote.data.message ? { message: remote.data.message } : {}),
|
|
215
|
-
...(remote.data.data !== undefined ? { data: remote.data.data } : {}),
|
|
216
|
-
...(remote.data.error ? { error: remote.data.error } : {}),
|
|
217
|
-
},
|
|
218
|
-
});
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
printResult({
|
|
223
|
-
asJson: params.options.json,
|
|
224
|
-
success: false,
|
|
225
|
-
title: "plugin command failed",
|
|
226
|
-
payload: {
|
|
227
|
-
error: remote.error || "Unknown error",
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
}
|