@downcity/agent 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/agent/AgentContext.d.ts.map +1 -1
- package/bin/agent/AgentContext.js +1 -0
- package/bin/agent/AgentContext.js.map +1 -1
- package/bin/agent/AgentContextTypes.d.ts +5 -1
- package/bin/agent/AgentContextTypes.d.ts.map +1 -1
- package/bin/agent/AgentRuntime.d.ts +6 -1
- package/bin/agent/AgentRuntime.d.ts.map +1 -1
- package/bin/agent/AgentRuntime.js +22 -3
- package/bin/agent/AgentRuntime.js.map +1 -1
- package/bin/agent/AgentRuntimeState.d.ts.map +1 -1
- package/bin/agent/AgentRuntimeState.js +58 -2
- package/bin/agent/AgentRuntimeState.js.map +1 -1
- package/bin/agent/AgentRuntimeTypes.d.ts +5 -1
- package/bin/agent/AgentRuntimeTypes.d.ts.map +1 -1
- package/bin/agent/project/AgentInitializer.d.ts +3 -2
- package/bin/agent/project/AgentInitializer.d.ts.map +1 -1
- package/bin/agent/project/AgentInitializer.js +34 -44
- package/bin/agent/project/AgentInitializer.js.map +1 -1
- package/bin/config/Config.d.ts.map +1 -1
- package/bin/config/Config.js +2 -21
- package/bin/config/Config.js.map +1 -1
- package/bin/config/Paths.d.ts +1 -5
- package/bin/config/Paths.d.ts.map +1 -1
- package/bin/config/Paths.js +2 -8
- package/bin/config/Paths.js.map +1 -1
- package/bin/host/daemon/ProjectSetup.d.ts +2 -1
- package/bin/host/daemon/ProjectSetup.d.ts.map +1 -1
- package/bin/host/daemon/ProjectSetup.js +14 -21
- package/bin/host/daemon/ProjectSetup.js.map +1 -1
- package/bin/host/runtime/AgentHostRuntime.d.ts.map +1 -1
- package/bin/host/runtime/AgentHostRuntime.js +1 -2
- package/bin/host/runtime/AgentHostRuntime.js.map +1 -1
- package/bin/host/runtime/CityPaths.d.ts +0 -3
- package/bin/host/runtime/CityPaths.d.ts.map +1 -1
- package/bin/host/runtime/CityPaths.js +0 -3
- package/bin/host/runtime/CityPaths.js.map +1 -1
- package/bin/host/sdk/Agent.d.ts +1 -0
- package/bin/host/sdk/Agent.d.ts.map +1 -1
- package/bin/host/sdk/Agent.js +24 -2
- package/bin/host/sdk/Agent.js.map +1 -1
- package/bin/host/sdk/AgentSdkTypes.d.ts +9 -0
- package/bin/host/sdk/AgentSdkTypes.d.ts.map +1 -1
- package/bin/http/Server.d.ts.map +1 -1
- package/bin/http/Server.js +1 -11
- package/bin/http/Server.js.map +1 -1
- package/bin/http/auth/AuthEnv.d.ts +0 -9
- package/bin/http/auth/AuthEnv.d.ts.map +1 -1
- package/bin/http/auth/AuthEnv.js +0 -9
- package/bin/http/auth/AuthEnv.js.map +1 -1
- package/bin/http/auth/CliAuthStateStore.d.ts +0 -4
- package/bin/http/auth/CliAuthStateStore.d.ts.map +1 -1
- package/bin/http/auth/CliAuthStateStore.js +0 -4
- package/bin/http/auth/CliAuthStateStore.js.map +1 -1
- package/bin/http/control/ModelRoutes.d.ts.map +1 -1
- package/bin/http/control/ModelRoutes.js +3 -8
- package/bin/http/control/ModelRoutes.js.map +1 -1
- package/bin/index.d.ts +2 -6
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +2 -6
- package/bin/index.js.map +1 -1
- package/bin/model/CreateModel.d.ts +2 -2
- package/bin/model/CreateModel.d.ts.map +1 -1
- package/bin/model/CreateModel.js +13 -12
- package/bin/model/CreateModel.js.map +1 -1
- package/bin/plugin/Activation.d.ts +4 -0
- package/bin/plugin/Activation.d.ts.map +1 -1
- package/bin/plugin/Activation.js +2 -2
- package/bin/plugin/Activation.js.map +1 -1
- package/bin/plugin/LocalExecution.d.ts.map +1 -1
- package/bin/plugin/LocalExecution.js +23 -2
- package/bin/plugin/LocalExecution.js.map +1 -1
- package/bin/plugin/PluginRegistry.js +2 -2
- package/bin/plugin/PluginRegistry.js.map +1 -1
- package/bin/plugins/asr/Plugin.d.ts.map +1 -1
- package/bin/plugins/asr/Plugin.js +4 -5
- package/bin/plugins/asr/Plugin.js.map +1 -1
- package/bin/plugins/auth/Plugin.d.ts.map +1 -1
- package/bin/plugins/auth/Plugin.js +1 -0
- package/bin/plugins/auth/Plugin.js.map +1 -1
- package/bin/plugins/auth/runtime/AuthorizationConfig.d.ts +4 -4
- package/bin/plugins/auth/runtime/AuthorizationConfig.d.ts.map +1 -1
- package/bin/plugins/auth/runtime/AuthorizationConfig.js +28 -26
- package/bin/plugins/auth/runtime/AuthorizationConfig.js.map +1 -1
- package/bin/plugins/auth/runtime/AuthorizationPolicy.d.ts +2 -0
- package/bin/plugins/auth/runtime/AuthorizationPolicy.d.ts.map +1 -1
- package/bin/plugins/auth/runtime/AuthorizationPolicy.js +3 -2
- package/bin/plugins/auth/runtime/AuthorizationPolicy.js.map +1 -1
- package/bin/plugins/auth/runtime/AuthorizationStore.d.ts +1 -1
- package/bin/plugins/auth/runtime/AuthorizationStore.d.ts.map +1 -1
- package/bin/plugins/auth/runtime/AuthorizationStore.js +3 -4
- package/bin/plugins/auth/runtime/AuthorizationStore.js.map +1 -1
- package/bin/plugins/skill/Plugin.js +2 -2
- package/bin/plugins/skill/Plugin.js.map +1 -1
- package/bin/plugins/tts/Plugin.d.ts.map +1 -1
- package/bin/plugins/tts/Plugin.js +4 -5
- package/bin/plugins/tts/Plugin.js.map +1 -1
- package/bin/plugins/web/Plugin.d.ts.map +1 -1
- package/bin/plugins/web/Plugin.js +4 -5
- package/bin/plugins/web/Plugin.js.map +1 -1
- package/bin/plugins/workboard/Plugin.js +2 -2
- package/bin/plugins/workboard/Plugin.js.map +1 -1
- package/bin/service/builtins/chat/accounts/ChannelAccountService.d.ts +4 -1
- package/bin/service/builtins/chat/accounts/ChannelAccountService.d.ts.map +1 -1
- package/bin/service/builtins/chat/accounts/ChannelAccountService.js +64 -91
- package/bin/service/builtins/chat/accounts/ChannelAccountService.js.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelActions.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelActions.js +11 -18
- package/bin/service/builtins/chat/runtime/ChatChannelActions.js.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts.map +1 -1
- package/bin/service/builtins/chat/runtime/ChatChannelCore.js +9 -17
- package/bin/service/builtins/chat/runtime/ChatChannelCore.js.map +1 -1
- package/bin/service/builtins/memory/Action.d.ts +1 -5
- package/bin/service/builtins/memory/Action.d.ts.map +1 -1
- package/bin/service/builtins/memory/Action.js +4 -42
- package/bin/service/builtins/memory/Action.js.map +1 -1
- package/bin/service/builtins/memory/MemoryService.d.ts.map +1 -1
- package/bin/service/builtins/memory/MemoryService.js +2 -32
- package/bin/service/builtins/memory/MemoryService.js.map +1 -1
- package/bin/service/builtins/memory/runtime/Search.d.ts +7 -3
- package/bin/service/builtins/memory/runtime/Search.d.ts.map +1 -1
- package/bin/service/builtins/memory/runtime/Search.js +220 -16
- package/bin/service/builtins/memory/runtime/Search.js.map +1 -1
- package/bin/service/builtins/memory/runtime/Store.d.ts +9 -50
- package/bin/service/builtins/memory/runtime/Store.d.ts.map +1 -1
- package/bin/service/builtins/memory/runtime/Store.js +10 -130
- package/bin/service/builtins/memory/runtime/Store.js.map +1 -1
- package/bin/service/builtins/memory/runtime/Writer.d.ts.map +1 -1
- package/bin/service/builtins/memory/runtime/Writer.js +1 -2
- package/bin/service/builtins/memory/runtime/Writer.js.map +1 -1
- package/bin/service/builtins/memory/types/Memory.d.ts +3 -57
- package/bin/service/builtins/memory/types/Memory.d.ts.map +1 -1
- package/bin/service/schedule/Store.d.ts +22 -25
- package/bin/service/schedule/Store.d.ts.map +1 -1
- package/bin/service/schedule/Store.js +172 -154
- package/bin/service/schedule/Store.js.map +1 -1
- package/bin/session/composer/system/default/SystemDomain.d.ts.map +1 -1
- package/bin/session/composer/system/default/SystemDomain.js +1 -0
- package/bin/session/composer/system/default/SystemDomain.js.map +1 -1
- package/bin/shared/types/AgentHost.d.ts +120 -4
- package/bin/shared/types/AgentHost.d.ts.map +1 -1
- package/bin/shared/types/Plugin.d.ts +5 -1
- package/bin/shared/types/Plugin.d.ts.map +1 -1
- package/package.json +1 -4
- package/src/agent/AgentContext.ts +1 -0
- package/src/agent/AgentContextTypes.ts +5 -0
- package/src/agent/AgentRuntime.ts +32 -3
- package/src/agent/AgentRuntimeState.ts +66 -2
- package/src/agent/AgentRuntimeTypes.ts +5 -0
- package/src/agent/project/AgentInitializer.ts +40 -42
- package/src/config/Config.ts +2 -17
- package/src/config/Paths.ts +2 -9
- package/src/host/daemon/ProjectSetup.ts +19 -21
- package/src/host/runtime/AgentHostRuntime.ts +0 -2
- package/src/host/runtime/CityPaths.ts +0 -3
- package/src/host/sdk/Agent.ts +26 -2
- package/src/host/sdk/AgentSdkTypes.ts +10 -0
- package/src/http/Server.ts +0 -13
- package/src/http/auth/AuthEnv.ts +0 -9
- package/src/http/auth/CliAuthStateStore.ts +0 -4
- package/src/http/control/ModelRoutes.ts +3 -9
- package/src/index.ts +2 -12
- package/src/model/CreateModel.ts +15 -13
- package/src/plugin/Activation.ts +6 -2
- package/src/plugin/LocalExecution.ts +24 -2
- package/src/plugin/PluginRegistry.ts +2 -2
- package/src/plugins/asr/Plugin.ts +4 -5
- package/src/plugins/auth/Plugin.ts +1 -0
- package/src/plugins/auth/runtime/AuthorizationConfig.ts +47 -37
- package/src/plugins/auth/runtime/AuthorizationPolicy.ts +5 -2
- package/src/plugins/auth/runtime/AuthorizationStore.ts +6 -5
- package/src/plugins/skill/Plugin.ts +2 -2
- package/src/plugins/tts/Plugin.ts +4 -5
- package/src/plugins/web/Plugin.ts +4 -5
- package/src/plugins/workboard/Plugin.ts +2 -2
- package/src/service/builtins/chat/accounts/ChannelAccountService.ts +42 -62
- package/src/service/builtins/chat/runtime/ChatChannelActions.ts +12 -18
- package/src/service/builtins/chat/runtime/ChatChannelCore.ts +9 -14
- package/src/service/builtins/memory/Action.ts +6 -47
- package/src/service/builtins/memory/MemoryService.ts +1 -33
- package/src/service/builtins/memory/runtime/Search.ts +256 -16
- package/src/service/builtins/memory/runtime/Store.ts +13 -185
- package/src/service/builtins/memory/runtime/Writer.ts +1 -2
- package/src/service/builtins/memory/types/Memory.ts +2 -59
- package/src/service/schedule/Store.ts +215 -175
- package/src/session/composer/system/default/SystemDomain.ts +1 -0
- package/src/shared/types/AgentHost.ts +138 -4
- package/src/shared/types/Plugin.ts +5 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/bin/http/auth/AuthMiddleware.d.ts +0 -36
- package/bin/http/auth/AuthMiddleware.d.ts.map +0 -1
- package/bin/http/auth/AuthMiddleware.js +0 -37
- package/bin/http/auth/AuthMiddleware.js.map +0 -1
- package/bin/http/auth/AuthRoutes.d.ts +0 -17
- package/bin/http/auth/AuthRoutes.d.ts.map +0 -1
- package/bin/http/auth/AuthRoutes.js +0 -78
- package/bin/http/auth/AuthRoutes.js.map +0 -1
- package/bin/http/auth/AuthService.d.ts +0 -119
- package/bin/http/auth/AuthService.d.ts.map +0 -1
- package/bin/http/auth/AuthService.js +0 -307
- package/bin/http/auth/AuthService.js.map +0 -1
- package/bin/http/auth/AuthStore.d.ts +0 -165
- package/bin/http/auth/AuthStore.d.ts.map +0 -1
- package/bin/http/auth/AuthStore.js +0 -442
- package/bin/http/auth/AuthStore.js.map +0 -1
- package/bin/http/auth/RoutePolicy.d.ts +0 -30
- package/bin/http/auth/RoutePolicy.d.ts.map +0 -1
- package/bin/http/auth/RoutePolicy.js +0 -229
- package/bin/http/auth/RoutePolicy.js.map +0 -1
- package/bin/plugin/Lifecycle.d.ts +0 -33
- package/bin/plugin/Lifecycle.d.ts.map +0 -1
- package/bin/plugin/Lifecycle.js +0 -102
- package/bin/plugin/Lifecycle.js.map +0 -1
- package/bin/service/builtins/memory/runtime/Indexer.d.ts +0 -71
- package/bin/service/builtins/memory/runtime/Indexer.d.ts.map +0 -1
- package/bin/service/builtins/memory/runtime/Indexer.js +0 -345
- package/bin/service/builtins/memory/runtime/Indexer.js.map +0 -1
- package/bin/service/schedule/Schema.d.ts +0 -171
- package/bin/service/schedule/Schema.d.ts.map +0 -1
- package/bin/service/schedule/Schema.js +0 -26
- package/bin/service/schedule/Schema.js.map +0 -1
- package/bin/shared/utils/store/StoreChannelAccountRepository.d.ts +0 -34
- package/bin/shared/utils/store/StoreChannelAccountRepository.d.ts.map +0 -1
- package/bin/shared/utils/store/StoreChannelAccountRepository.js +0 -198
- package/bin/shared/utils/store/StoreChannelAccountRepository.js.map +0 -1
- package/bin/shared/utils/store/StoreEnvRepository.d.ts +0 -98
- package/bin/shared/utils/store/StoreEnvRepository.d.ts.map +0 -1
- package/bin/shared/utils/store/StoreEnvRepository.js +0 -334
- package/bin/shared/utils/store/StoreEnvRepository.js.map +0 -1
- package/bin/shared/utils/store/StoreModelRepository.d.ts +0 -61
- package/bin/shared/utils/store/StoreModelRepository.d.ts.map +0 -1
- package/bin/shared/utils/store/StoreModelRepository.js +0 -278
- package/bin/shared/utils/store/StoreModelRepository.js.map +0 -1
- package/bin/shared/utils/store/StoreSchema.d.ts +0 -13
- package/bin/shared/utils/store/StoreSchema.d.ts.map +0 -1
- package/bin/shared/utils/store/StoreSchema.js +0 -319
- package/bin/shared/utils/store/StoreSchema.js.map +0 -1
- package/bin/shared/utils/store/StoreSecureSettings.d.ts +0 -33
- package/bin/shared/utils/store/StoreSecureSettings.d.ts.map +0 -1
- package/bin/shared/utils/store/StoreSecureSettings.js +0 -91
- package/bin/shared/utils/store/StoreSecureSettings.js.map +0 -1
- package/bin/shared/utils/store/StoreShared.d.ts +0 -44
- package/bin/shared/utils/store/StoreShared.d.ts.map +0 -1
- package/bin/shared/utils/store/StoreShared.js +0 -40
- package/bin/shared/utils/store/StoreShared.js.map +0 -1
- package/bin/shared/utils/store/crypto.d.ts +0 -24
- package/bin/shared/utils/store/crypto.d.ts.map +0 -1
- package/bin/shared/utils/store/crypto.js +0 -101
- package/bin/shared/utils/store/crypto.js.map +0 -1
- package/bin/shared/utils/store/index.d.ts +0 -230
- package/bin/shared/utils/store/index.d.ts.map +0 -1
- package/bin/shared/utils/store/index.js +0 -360
- package/bin/shared/utils/store/index.js.map +0 -1
- package/bin/shared/utils/store/schema.d.ts +0 -690
- package/bin/shared/utils/store/schema.d.ts.map +0 -1
- package/bin/shared/utils/store/schema.js +0 -81
- package/bin/shared/utils/store/schema.js.map +0 -1
- 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/RoutePolicy.ts +0 -255
- package/src/plugin/Lifecycle.ts +0 -116
- package/src/service/builtins/memory/runtime/Indexer.ts +0 -466
- package/src/service/schedule/Schema.ts +0 -34
- package/src/shared/utils/store/StoreChannelAccountRepository.ts +0 -269
- package/src/shared/utils/store/StoreEnvRepository.ts +0 -452
- package/src/shared/utils/store/StoreModelRepository.ts +0 -324
- package/src/shared/utils/store/StoreSchema.ts +0 -344
- package/src/shared/utils/store/StoreSecureSettings.ts +0 -126
- package/src/shared/utils/store/StoreShared.ts +0 -67
- package/src/shared/utils/store/crypto.ts +0 -112
- package/src/shared/utils/store/index.ts +0 -497
- package/src/shared/utils/store/schema.ts +0 -103
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentHost.d.ts","sourceRoot":"","sources":["../../../src/shared/types/AgentHost.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentHost.d.ts","sourceRoot":"","sources":["../../../src/shared/types/AgentHost.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAA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OAAO,EAAE,eAAe,CAAC;QACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,oBAAoB,GAAG,IAAI,CAAC;IAChC;;OAEG;IACH,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,CAAC;IAC1E;;OAEG;IACH,4BAA4B,CAC1B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,uBAAuB,GAClC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACpC;;OAEG;IACH,4BAA4B,CAAC,MAAM,EAAE;QACnC,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,wBAAwB,CAAC;QAClC,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACrC;;OAEG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7C;;OAEG;IACH,gBAAgB,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9D;;OAEG;IACH,wBAAwB,CAAC,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC5D;;OAEG;IACH,sBAAsB,CAAC,CACrB,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,YAAY,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC,CAAC;IACH;;OAEG;IACH,kCAAkC,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAChE"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Command } from "commander";
|
|
10
10
|
import type { Context as HonoContext, Hono } from "hono";
|
|
11
|
-
import type { AgentPathRuntime, AgentPluginConfigRuntime } from "../../shared/types/AgentHost.js";
|
|
11
|
+
import type { AgentPathRuntime, AgentPlatformRuntime, AgentPluginConfigRuntime } from "../../shared/types/AgentHost.js";
|
|
12
12
|
import type { AgentContext, StructuredConfig } from "../../agent/AgentContextTypes.js";
|
|
13
13
|
import type { Logger } from "../utils/logger/Logger.js";
|
|
14
14
|
import type { DowncityConfig } from "../../shared/types/DowncityConfig.js";
|
|
@@ -55,6 +55,10 @@ export interface PluginCommandContext {
|
|
|
55
55
|
* 当前可见的 plugin 配置持久化能力集合。
|
|
56
56
|
*/
|
|
57
57
|
pluginConfig: AgentPluginConfigRuntime;
|
|
58
|
+
/**
|
|
59
|
+
* 当前可见的平台能力集合。
|
|
60
|
+
*/
|
|
61
|
+
platform: AgentPlatformRuntime;
|
|
58
62
|
}
|
|
59
63
|
/**
|
|
60
64
|
* Service 调用参数。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../../src/shared/types/Plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAE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;OAMG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D;;OAEG;IACH,YAAY,CAAC,EAAE,CACb,OAAO,EAAE,oBAAoB,KAC1B,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IACtD;;OAEG;IACH,IAAI,CAAC,EAAE,oBAAoB,CAAC;CAC7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@downcity/agent",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Downcity Agent 运行时 — 执行壳,通过 RPC/HTTP 调用 City 的能力",
|
|
6
6
|
"main": "./bin/index.js",
|
|
@@ -23,10 +23,8 @@
|
|
|
23
23
|
"@larksuiteoapi/node-sdk": "^1.40.0",
|
|
24
24
|
"@openrouter/ai-sdk-provider": "^2.2.3",
|
|
25
25
|
"ai": "^6.0.57",
|
|
26
|
-
"better-sqlite3": "^11.10.0",
|
|
27
26
|
"commander": "^12.0.0",
|
|
28
27
|
"dotenv": "^16.4.0",
|
|
29
|
-
"drizzle-orm": "^0.36.4",
|
|
30
28
|
"execa": "^9.5.0",
|
|
31
29
|
"fs-extra": "^11.2.0",
|
|
32
30
|
"hono": "^4.0.0",
|
|
@@ -36,7 +34,6 @@
|
|
|
36
34
|
"zod": "^3.24.0"
|
|
37
35
|
},
|
|
38
36
|
"devDependencies": {
|
|
39
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
40
37
|
"@types/fs-extra": "^11.0.4",
|
|
41
38
|
"@types/js-yaml": "^4.0.0",
|
|
42
39
|
"@types/node": "^22.0.0",
|
|
@@ -160,6 +160,7 @@ export function createAgentContext(input: AgentRuntime): AgentContext {
|
|
|
160
160
|
systems: input.systems,
|
|
161
161
|
paths: input.paths,
|
|
162
162
|
pluginConfig: input.pluginConfig,
|
|
163
|
+
platform: input.platform,
|
|
163
164
|
session: buildSessionPort(input),
|
|
164
165
|
invoke: serviceInvokePort,
|
|
165
166
|
chat: buildChatPort(() => context),
|
|
@@ -12,6 +12,7 @@ import type { Logger } from "@shared/utils/logger/Logger.js";
|
|
|
12
12
|
import type { AgentRuntime } from "@/agent/AgentRuntimeTypes.js";
|
|
13
13
|
import type {
|
|
14
14
|
AgentPathRuntime,
|
|
15
|
+
AgentPlatformRuntime,
|
|
15
16
|
AgentPluginConfigRuntime,
|
|
16
17
|
} from "@/shared/types/AgentHost.js";
|
|
17
18
|
import type { DowncityConfig } from "@/shared/types/DowncityConfig.js";
|
|
@@ -350,6 +351,10 @@ export interface AgentContext {
|
|
|
350
351
|
* 当前可见的 plugin 配置持久化能力集合。
|
|
351
352
|
*/
|
|
352
353
|
pluginConfig: AgentPluginConfigRuntime;
|
|
354
|
+
/**
|
|
355
|
+
* 当前可见的平台能力集合。
|
|
356
|
+
*/
|
|
357
|
+
platform: AgentPlatformRuntime;
|
|
353
358
|
/**
|
|
354
359
|
* Session 能力入口。
|
|
355
360
|
*
|
|
@@ -58,6 +58,7 @@ import {
|
|
|
58
58
|
createAgentPluginConfigRuntime,
|
|
59
59
|
} from "@/host/runtime/AgentHostRuntime.js";
|
|
60
60
|
import { updateAgentRuntimeConfig } from "@/agent/AgentRuntimeState.js";
|
|
61
|
+
import type { AgentPlatformRuntime } from "@/shared/types/AgentHost.js";
|
|
61
62
|
|
|
62
63
|
export type { AgentRuntimeBase, AgentRuntime } from "@/agent/AgentRuntimeState.js";
|
|
63
64
|
export {
|
|
@@ -72,6 +73,19 @@ export { getAgentContext } from "@/agent/AgentContext.js";
|
|
|
72
73
|
let staticPromptCatalog: StaticPromptCatalog | null = null;
|
|
73
74
|
let configWatchPath: string | null = null;
|
|
74
75
|
|
|
76
|
+
const EMPTY_RUNTIME_PLATFORM: AgentPlatformRuntime = {
|
|
77
|
+
getGlobalEnv: () => ({}),
|
|
78
|
+
getAgentEnv: () => ({}),
|
|
79
|
+
listModels: () => [],
|
|
80
|
+
listProviders: async () => [],
|
|
81
|
+
getModel: () => null,
|
|
82
|
+
getChannelAccount: () => null,
|
|
83
|
+
readChatAuthorizationConfig: () => ({ roles: {}, channels: {} }),
|
|
84
|
+
writeChatAuthorizationConfig: async (_projectRoot, nextConfig) => nextConfig,
|
|
85
|
+
setChatAuthorizationUserRole: async () => ({ roles: {}, channels: {} }),
|
|
86
|
+
isPluginEnabled: (pluginName) => pluginName === "auth",
|
|
87
|
+
};
|
|
88
|
+
|
|
75
89
|
/**
|
|
76
90
|
* 原子更新 AgentRuntime.systems(同时覆盖 base + ready)。
|
|
77
91
|
*/
|
|
@@ -212,7 +226,14 @@ function createSessionHistoryComposer(
|
|
|
212
226
|
* 关键点(中文)
|
|
213
227
|
* - 只有 api 执行模式:从 console 模型池创建模型 → LocalSessionExecutor → LocalSessionCore。
|
|
214
228
|
*/
|
|
215
|
-
export async function initAgentRuntime(
|
|
229
|
+
export async function initAgentRuntime(
|
|
230
|
+
cwd: string,
|
|
231
|
+
options?: {
|
|
232
|
+
platform?: AgentPlatformRuntime;
|
|
233
|
+
globalEnv?: Record<string, string>;
|
|
234
|
+
projectEnv?: Record<string, string>;
|
|
235
|
+
},
|
|
236
|
+
): Promise<void> {
|
|
216
237
|
stopAgentHotReload();
|
|
217
238
|
resetPluginManager();
|
|
218
239
|
|
|
@@ -222,8 +243,12 @@ export async function initAgentRuntime(cwd: string): Promise<void> {
|
|
|
222
243
|
defaultLogger.bindProjectRoot(rootPath);
|
|
223
244
|
ensureRuntimeProjectReady(rootPath);
|
|
224
245
|
|
|
225
|
-
const
|
|
226
|
-
const
|
|
246
|
+
const platform = options?.platform || EMPTY_RUNTIME_PLATFORM;
|
|
247
|
+
const globalEnv = options?.globalEnv || platform?.getGlobalEnv() || loadGlobalEnvFromStore();
|
|
248
|
+
const projectEnv =
|
|
249
|
+
options?.projectEnv ||
|
|
250
|
+
platform?.getAgentEnv(rootPath) ||
|
|
251
|
+
loadAgentEnvSnapshot(rootPath);
|
|
227
252
|
const config = loadDowncityConfig(rootPath, {
|
|
228
253
|
projectEnv,
|
|
229
254
|
globalEnv,
|
|
@@ -242,6 +267,7 @@ export async function initAgentRuntime(cwd: string): Promise<void> {
|
|
|
242
267
|
systems: [],
|
|
243
268
|
paths: createAgentPathRuntime(rootPath),
|
|
244
269
|
pluginConfig: createAgentPluginConfigRuntime(rootPath),
|
|
270
|
+
platform: platform,
|
|
245
271
|
});
|
|
246
272
|
|
|
247
273
|
const systems = loadStaticSystemPrompts(rootPath);
|
|
@@ -255,6 +281,7 @@ export async function initAgentRuntime(cwd: string): Promise<void> {
|
|
|
255
281
|
systems,
|
|
256
282
|
paths: createAgentPathRuntime(rootPath),
|
|
257
283
|
pluginConfig: createAgentPluginConfigRuntime(rootPath),
|
|
284
|
+
platform: platform,
|
|
258
285
|
});
|
|
259
286
|
|
|
260
287
|
const primaryModelId = readProjectPrimaryModelId(config);
|
|
@@ -262,6 +289,7 @@ export async function initAgentRuntime(cwd: string): Promise<void> {
|
|
|
262
289
|
config,
|
|
263
290
|
getSessionRunScope: getSessionRunScope,
|
|
264
291
|
projectRoot: rootPath,
|
|
292
|
+
platform,
|
|
265
293
|
});
|
|
266
294
|
|
|
267
295
|
const compactionComposer = new JsonlSessionCompactionComposer({
|
|
@@ -326,6 +354,7 @@ export async function initAgentRuntime(cwd: string): Promise<void> {
|
|
|
326
354
|
systems,
|
|
327
355
|
paths: createAgentPathRuntime(rootPath),
|
|
328
356
|
pluginConfig: createAgentPluginConfigRuntime(rootPath),
|
|
357
|
+
platform: platform,
|
|
329
358
|
model,
|
|
330
359
|
getSession,
|
|
331
360
|
listExecutingSessionIds: () =>
|
|
@@ -15,8 +15,10 @@ import type {
|
|
|
15
15
|
import type { DowncityConfig } from "@/shared/types/DowncityConfig.js";
|
|
16
16
|
import type {
|
|
17
17
|
AgentPathRuntime,
|
|
18
|
+
AgentPlatformRuntime,
|
|
18
19
|
AgentPluginConfigRuntime,
|
|
19
20
|
} from "@/shared/types/AgentHost.js";
|
|
21
|
+
import type { ChatChannelName } from "@/service/builtins/chat/types/ChannelStatus.js";
|
|
20
22
|
export type { AgentRuntime, AgentRuntimeBase } from "@/agent/AgentRuntimeTypes.js";
|
|
21
23
|
|
|
22
24
|
let baseState: AgentRuntimeBase | null = null;
|
|
@@ -29,7 +31,6 @@ const EMPTY_PATHS: AgentPathRuntime = {
|
|
|
29
31
|
getDowncityChannelDirPath: () => ".downcity/channel",
|
|
30
32
|
getDowncityChannelMetaPath: () => ".downcity/channel/meta.json",
|
|
31
33
|
getDowncityChatHistoryPath: (sessionId) => `.downcity/chat/${sessionId}/history.jsonl`,
|
|
32
|
-
getDowncityMemoryIndexPath: () => ".downcity/memory/index.sqlite",
|
|
33
34
|
getDowncityMemoryLongTermPath: () => ".downcity/memory/MEMORY.md",
|
|
34
35
|
getDowncityMemoryDailyDirPath: () => ".downcity/memory/daily",
|
|
35
36
|
getDowncityMemoryDailyPath: (date) => `.downcity/memory/daily/${date}.md`,
|
|
@@ -43,6 +44,53 @@ const EMPTY_PLUGIN_CONFIG: AgentPluginConfigRuntime = {
|
|
|
43
44
|
},
|
|
44
45
|
};
|
|
45
46
|
|
|
47
|
+
const EMPTY_PLATFORM: AgentPlatformRuntime = {
|
|
48
|
+
getGlobalEnv: () => ({}),
|
|
49
|
+
getAgentEnv: () => ({}),
|
|
50
|
+
listModels: () => [],
|
|
51
|
+
listProviders: async () => [],
|
|
52
|
+
getModel: () => null,
|
|
53
|
+
getChannelAccount: () => null,
|
|
54
|
+
listChannelAccounts: async () => [],
|
|
55
|
+
probeChannelAccount: async () => {
|
|
56
|
+
throw new Error("Channel account probing is not available in this runtime");
|
|
57
|
+
},
|
|
58
|
+
createChannelAccount: async () => {
|
|
59
|
+
throw new Error("Channel account creation is not available in this runtime");
|
|
60
|
+
},
|
|
61
|
+
updateChannelAccount: async () => {
|
|
62
|
+
throw new Error("Channel account update is not available in this runtime");
|
|
63
|
+
},
|
|
64
|
+
removeChannelAccount: async () => {
|
|
65
|
+
throw new Error("Channel account removal is not available in this runtime");
|
|
66
|
+
},
|
|
67
|
+
resolveChannelAccount: (_params: {
|
|
68
|
+
projectRoot: string;
|
|
69
|
+
channel: ChatChannelName;
|
|
70
|
+
channelAccountId?: string;
|
|
71
|
+
}) => null,
|
|
72
|
+
readChatAuthorizationConfig: () => ({
|
|
73
|
+
roles: {},
|
|
74
|
+
channels: {},
|
|
75
|
+
}),
|
|
76
|
+
writeChatAuthorizationConfig: async (_projectRoot, nextConfig) => nextConfig,
|
|
77
|
+
setChatAuthorizationUserRole: async () => ({
|
|
78
|
+
roles: {},
|
|
79
|
+
channels: {},
|
|
80
|
+
}),
|
|
81
|
+
isPluginEnabled: (pluginName) => pluginName === "auth",
|
|
82
|
+
setPluginEnabled: () => {
|
|
83
|
+
throw new Error("Plugin lifecycle management is not available in this runtime");
|
|
84
|
+
},
|
|
85
|
+
listPlatformModelChoices: async () => [],
|
|
86
|
+
initializeAgentProject: async () => {
|
|
87
|
+
throw new Error("Agent project initialization is not available in this runtime");
|
|
88
|
+
},
|
|
89
|
+
ensureRuntimeExecutionBindingReady: () => {
|
|
90
|
+
throw new Error("Execution binding validation is not available in this runtime");
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
46
94
|
function normalizeReadyState(input: AgentRuntime): AgentRuntime {
|
|
47
95
|
if (typeof input.getSession !== "function") {
|
|
48
96
|
throw new Error("AgentRuntime requires getSession");
|
|
@@ -58,6 +106,7 @@ function normalizeReadyState(input: AgentRuntime): AgentRuntime {
|
|
|
58
106
|
systems: input.systems,
|
|
59
107
|
paths: input.paths || EMPTY_PATHS,
|
|
60
108
|
pluginConfig: input.pluginConfig || EMPTY_PLUGIN_CONFIG,
|
|
109
|
+
platform: input.platform || EMPTY_PLATFORM,
|
|
61
110
|
model: input.model,
|
|
62
111
|
getSession: input.getSession,
|
|
63
112
|
listExecutingSessionIds:
|
|
@@ -68,11 +117,26 @@ function normalizeReadyState(input: AgentRuntime): AgentRuntime {
|
|
|
68
117
|
};
|
|
69
118
|
}
|
|
70
119
|
|
|
120
|
+
function normalizeBaseState(input: AgentRuntimeBase): AgentRuntimeBase {
|
|
121
|
+
return {
|
|
122
|
+
cwd: input.cwd,
|
|
123
|
+
rootPath: input.rootPath,
|
|
124
|
+
logger: input.logger,
|
|
125
|
+
config: input.config,
|
|
126
|
+
env: input.env,
|
|
127
|
+
globalEnv: input.globalEnv,
|
|
128
|
+
systems: input.systems,
|
|
129
|
+
paths: input.paths || EMPTY_PATHS,
|
|
130
|
+
pluginConfig: input.pluginConfig || EMPTY_PLUGIN_CONFIG,
|
|
131
|
+
platform: input.platform || EMPTY_PLATFORM,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
71
135
|
/**
|
|
72
136
|
* 设置 agent 基础状态。
|
|
73
137
|
*/
|
|
74
138
|
export function setAgentRuntimeBase(next: AgentRuntimeBase): void {
|
|
75
|
-
baseState = next;
|
|
139
|
+
baseState = normalizeBaseState(next);
|
|
76
140
|
readyState = null;
|
|
77
141
|
}
|
|
78
142
|
|
|
@@ -12,6 +12,7 @@ import type { Logger } from "@shared/utils/logger/Logger.js";
|
|
|
12
12
|
import type { DowncityConfig } from "@/shared/types/DowncityConfig.js";
|
|
13
13
|
import type {
|
|
14
14
|
AgentPathRuntime,
|
|
15
|
+
AgentPlatformRuntime,
|
|
15
16
|
AgentPluginConfigRuntime,
|
|
16
17
|
} from "@/shared/types/AgentHost.js";
|
|
17
18
|
import type { BaseService } from "@/service/builtins/BaseService.js";
|
|
@@ -57,6 +58,10 @@ export interface AgentRuntimeBase {
|
|
|
57
58
|
* 当前 agent 可见的 plugin 配置持久化能力集合。
|
|
58
59
|
*/
|
|
59
60
|
pluginConfig: AgentPluginConfigRuntime;
|
|
61
|
+
/**
|
|
62
|
+
* 当前 agent 可见的平台能力集合。
|
|
63
|
+
*/
|
|
64
|
+
platform: AgentPlatformRuntime;
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
/**
|
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
} from "@session/composer/system/default/InitPrompts.js";
|
|
36
36
|
import { renderTemplateVariables } from "@/shared/utils/Template.js";
|
|
37
37
|
import { ensureDir, saveJson } from "@/shared/utils/storage/index.js";
|
|
38
|
-
import { PlatformStore } from "@/shared/utils/store/index.js";
|
|
39
38
|
import type {
|
|
40
39
|
AgentProjectChannel,
|
|
41
40
|
AgentProjectInitializationInput,
|
|
@@ -43,6 +42,7 @@ import type {
|
|
|
43
42
|
} from "@/shared/types/AgentProject.js";
|
|
44
43
|
import { assertProjectExecutionTarget } from "@/agent/project/ProjectExecutionBinding.js";
|
|
45
44
|
import type { ExecutionBindingConfig } from "@/shared/types/ExecutionBinding.js";
|
|
45
|
+
import type { AgentPlatformRuntime } from "@/shared/types/AgentHost.js";
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* 平台模型选项。
|
|
@@ -78,32 +78,29 @@ export function normalizeDefaultAgentName(input: string): string {
|
|
|
78
78
|
/**
|
|
79
79
|
* 读取平台全局模型选项。
|
|
80
80
|
*/
|
|
81
|
-
export async function listPlatformModelChoices(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
} finally {
|
|
105
|
-
store.close();
|
|
106
|
-
}
|
|
81
|
+
export async function listPlatformModelChoices(
|
|
82
|
+
platform: Pick<AgentPlatformRuntime, "listModels" | "listProviders">,
|
|
83
|
+
): Promise<PlatformModelChoice[]> {
|
|
84
|
+
const models = platform.listModels();
|
|
85
|
+
const providers = await platform.listProviders();
|
|
86
|
+
const providerMap = new Map(providers.map((item) => [item.id, item] as const));
|
|
87
|
+
return models
|
|
88
|
+
.map((item) => {
|
|
89
|
+
const id = String(item.id || "").trim();
|
|
90
|
+
if (!id) return null;
|
|
91
|
+
const providerId = String(item.providerId || "").trim();
|
|
92
|
+
const providerType = String(providerMap.get(providerId)?.type || "").trim();
|
|
93
|
+
const providerLabel = providerId
|
|
94
|
+
? providerType
|
|
95
|
+
? `${providerId} (${providerType})`
|
|
96
|
+
: providerId
|
|
97
|
+
: "-";
|
|
98
|
+
return {
|
|
99
|
+
title: `${id} · ${providerLabel}`,
|
|
100
|
+
value: id,
|
|
101
|
+
};
|
|
102
|
+
})
|
|
103
|
+
.filter((item): item is PlatformModelChoice => item !== null);
|
|
107
104
|
}
|
|
108
105
|
|
|
109
106
|
function parseEnvKeys(content: string): Set<string> {
|
|
@@ -182,23 +179,20 @@ async function appendMissingEnvEntries(params: {
|
|
|
182
179
|
/**
|
|
183
180
|
* 校验 API 主模型可用。
|
|
184
181
|
*/
|
|
185
|
-
function assertApiPrimaryModelReady(
|
|
182
|
+
function assertApiPrimaryModelReady(
|
|
183
|
+
primaryModelId: string,
|
|
184
|
+
platform: Pick<AgentPlatformRuntime, "getModel">,
|
|
185
|
+
): void {
|
|
186
186
|
const normalizedModelId = String(primaryModelId || "").trim();
|
|
187
187
|
if (!normalizedModelId) {
|
|
188
188
|
throw new Error("execution.modelId is required");
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
if (model.isPaused === true) {
|
|
198
|
-
throw new Error(`Model is paused: ${normalizedModelId}`);
|
|
199
|
-
}
|
|
200
|
-
} finally {
|
|
201
|
-
store.close();
|
|
190
|
+
const model = platform.getModel(normalizedModelId);
|
|
191
|
+
if (!model) {
|
|
192
|
+
throw new Error(`Model not found in platform model pool: ${normalizedModelId}`);
|
|
193
|
+
}
|
|
194
|
+
if (model.isPaused === true) {
|
|
195
|
+
throw new Error(`Model is paused: ${normalizedModelId}`);
|
|
202
196
|
}
|
|
203
197
|
}
|
|
204
198
|
|
|
@@ -228,6 +222,7 @@ export async function isAgentProjectInitialized(projectRoot: string): Promise<bo
|
|
|
228
222
|
*/
|
|
229
223
|
export async function initializeAgentProject(
|
|
230
224
|
input: AgentProjectInitializationInput,
|
|
225
|
+
platform?: Pick<AgentPlatformRuntime, "listModels" | "listProviders" | "getModel">,
|
|
231
226
|
): Promise<AgentProjectInitializationResult> {
|
|
232
227
|
const projectRoot = path.resolve(String(input.projectRoot || "").trim() || ".");
|
|
233
228
|
const projectBaseName = path.basename(projectRoot);
|
|
@@ -248,11 +243,14 @@ export async function initializeAgentProject(
|
|
|
248
243
|
execution,
|
|
249
244
|
});
|
|
250
245
|
if (primaryModelId) {
|
|
251
|
-
|
|
246
|
+
if (!platform) {
|
|
247
|
+
throw new Error("initializeAgentProject requires platform runtime");
|
|
248
|
+
}
|
|
249
|
+
const platformModelChoices = await listPlatformModelChoices(platform);
|
|
252
250
|
if (platformModelChoices.length === 0) {
|
|
253
251
|
throw new Error("Platform model pool is empty. Please configure at least one model first.");
|
|
254
252
|
}
|
|
255
|
-
assertApiPrimaryModelReady(primaryModelId);
|
|
253
|
+
assertApiPrimaryModelReady(primaryModelId, platform);
|
|
256
254
|
}
|
|
257
255
|
|
|
258
256
|
await ensureDir(projectRoot);
|
package/src/config/Config.ts
CHANGED
|
@@ -11,7 +11,6 @@ import fs from "fs-extra";
|
|
|
11
11
|
import path from "path";
|
|
12
12
|
import type { DowncityConfig } from "@/shared/types/DowncityConfig.js";
|
|
13
13
|
import type { JsonObject, JsonValue } from "@/shared/types/Json.js";
|
|
14
|
-
import { PlatformStore } from "@/shared/utils/store/index.js";
|
|
15
14
|
import { assertProjectExecutionTarget } from "@/agent/project/ProjectExecutionBinding.js";
|
|
16
15
|
|
|
17
16
|
export type { DowncityConfig };
|
|
@@ -20,14 +19,7 @@ export type { DowncityConfig };
|
|
|
20
19
|
* 读取平台共享环境变量(`env_entries.scope=global`)。
|
|
21
20
|
*/
|
|
22
21
|
export function loadGlobalEnvFromStore(): Record<string, string> {
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
return store.getGlobalEnvMapSync();
|
|
26
|
-
} catch {
|
|
27
|
-
return {};
|
|
28
|
-
} finally {
|
|
29
|
-
store.close();
|
|
30
|
-
}
|
|
22
|
+
return {};
|
|
31
23
|
}
|
|
32
24
|
|
|
33
25
|
/**
|
|
@@ -36,14 +28,7 @@ export function loadGlobalEnvFromStore(): Record<string, string> {
|
|
|
36
28
|
export function loadAgentEnvFromStore(agentId: string): Record<string, string> {
|
|
37
29
|
const normalizedAgentId = String(agentId || "").trim();
|
|
38
30
|
if (!normalizedAgentId) return {};
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
return store.getAgentEnvMapSync(normalizedAgentId);
|
|
42
|
-
} catch {
|
|
43
|
-
return {};
|
|
44
|
-
} finally {
|
|
45
|
-
store.close();
|
|
46
|
-
}
|
|
31
|
+
return {};
|
|
47
32
|
}
|
|
48
33
|
|
|
49
34
|
/**
|
package/src/config/Paths.ts
CHANGED
|
@@ -111,20 +111,13 @@ export function getDowncityMemoryDailyPath(cwd: string, date: string): string {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
115
|
-
*/
|
|
116
|
-
export function getDowncityMemoryIndexPath(cwd: string): string {
|
|
117
|
-
return path.join(getDowncityMemoryDirPath(cwd), "index.sqlite");
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Service Schedule SQLite 路径。
|
|
114
|
+
* Service Schedule JSONL 路径。
|
|
122
115
|
*
|
|
123
116
|
* 关键点(中文)
|
|
124
117
|
* - 调度任务属于项目 runtime 本地状态,因此放在项目 `.downcity/` 下。
|
|
125
118
|
*/
|
|
126
119
|
export function getDowncityScheduleDbPath(cwd: string): string {
|
|
127
|
-
return path.join(getDowncityDirPath(cwd), "schedule.
|
|
120
|
+
return path.join(getDowncityDirPath(cwd), "schedule.jsonl");
|
|
128
121
|
}
|
|
129
122
|
|
|
130
123
|
export function getDowncityDataDirPath(cwd: string): string {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import fs from "fs-extra";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { loadDowncityConfig } from "@/config/Config.js";
|
|
12
|
-
import {
|
|
12
|
+
import type { AgentPlatformRuntime } from "@/shared/types/AgentHost.js";
|
|
13
13
|
import {
|
|
14
14
|
readProjectExecutionBinding,
|
|
15
15
|
readProjectPrimaryModelId,
|
|
@@ -84,7 +84,10 @@ export function ensureRuntimeProjectReady(projectRoot: string): void {
|
|
|
84
84
|
* - 若走 local 模式,则 `lmp` plugin 必须启用且本地模型文件必须存在。
|
|
85
85
|
* - 若模型被 pause,也要在启动前直接拒绝,避免进程拉起后秒退。
|
|
86
86
|
*/
|
|
87
|
-
export function ensureRuntimeExecutionBindingReady(
|
|
87
|
+
export function ensureRuntimeExecutionBindingReady(
|
|
88
|
+
projectRoot: string,
|
|
89
|
+
platform?: Pick<AgentPlatformRuntime, "getModel">,
|
|
90
|
+
): void {
|
|
88
91
|
let primaryModelId = "";
|
|
89
92
|
try {
|
|
90
93
|
const config = loadDowncityConfig(projectRoot);
|
|
@@ -103,24 +106,19 @@ export function ensureRuntimeExecutionBindingReady(projectRoot: string): void {
|
|
|
103
106
|
process.exit(1);
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
console.error(` fix: run \`city model pause ${primaryModelId} --enabled false\``);
|
|
121
|
-
process.exit(1);
|
|
122
|
-
}
|
|
123
|
-
} finally {
|
|
124
|
-
store.close();
|
|
109
|
+
const model = platform?.getModel(primaryModelId);
|
|
110
|
+
if (!model) {
|
|
111
|
+
console.error("❌ Model not found in platform model pool");
|
|
112
|
+
console.error(` project: ${projectRoot}`);
|
|
113
|
+
console.error(` execution.modelId: ${primaryModelId}`);
|
|
114
|
+
console.error(" fix: run `city model create` or `city model list`");
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
if (model.isPaused === true) {
|
|
118
|
+
console.error("❌ Model is paused");
|
|
119
|
+
console.error(` project: ${projectRoot}`);
|
|
120
|
+
console.error(` execution.modelId: ${primaryModelId}`);
|
|
121
|
+
console.error(` fix: run \`city model pause ${primaryModelId} --enabled false\``);
|
|
122
|
+
process.exit(1);
|
|
125
123
|
}
|
|
126
124
|
}
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
getDowncityDirPath,
|
|
15
15
|
getDowncityMemoryDailyDirPath,
|
|
16
16
|
getDowncityMemoryDailyPath,
|
|
17
|
-
getDowncityMemoryIndexPath,
|
|
18
17
|
getDowncityMemoryLongTermPath,
|
|
19
18
|
getDowncitySessionDirPath,
|
|
20
19
|
getDowncitySessionRootDirPath,
|
|
@@ -38,7 +37,6 @@ export function createAgentPathRuntime(projectRoot: string): AgentPathRuntime {
|
|
|
38
37
|
getDowncityChannelDirPath: () => getDowncityChannelDirPath(rootPath),
|
|
39
38
|
getDowncityChannelMetaPath: () => getDowncityChannelMetaPath(rootPath),
|
|
40
39
|
getDowncityChatHistoryPath: (sessionId) => getDowncityChatHistoryPath(rootPath, sessionId),
|
|
41
|
-
getDowncityMemoryIndexPath: () => getDowncityMemoryIndexPath(rootPath),
|
|
42
40
|
getDowncityMemoryLongTermPath: () => getDowncityMemoryLongTermPath(rootPath),
|
|
43
41
|
getDowncityMemoryDailyDirPath: () => getDowncityMemoryDailyDirPath(rootPath),
|
|
44
42
|
getDowncityMemoryDailyPath: (date) => getDowncityMemoryDailyPath(rootPath, date),
|