@downcity/agent 1.1.208 → 1.1.210
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/local/Agent.d.ts +3 -3
- package/bin/agent/local/Agent.d.ts.map +1 -1
- package/bin/agent/local/Agent.js +0 -3
- package/bin/agent/local/Agent.js.map +1 -1
- package/bin/agent/local/AgentInstructions.d.ts +1 -1
- package/bin/agent/local/AgentInstructions.d.ts.map +1 -1
- package/bin/agent/local/services/AgentAssemblyService.d.ts +3 -8
- package/bin/agent/local/services/AgentAssemblyService.d.ts.map +1 -1
- package/bin/agent/local/services/AgentAssemblyService.js +0 -1
- package/bin/agent/local/services/AgentAssemblyService.js.map +1 -1
- package/bin/agent/local/services/AgentSessions.d.ts +5 -7
- package/bin/agent/local/services/AgentSessions.d.ts.map +1 -1
- package/bin/agent/local/services/AgentSessions.js +2 -3
- package/bin/agent/local/services/AgentSessions.js.map +1 -1
- package/bin/agent/remote/RemoteAgent.d.ts +3 -1
- package/bin/agent/remote/RemoteAgent.d.ts.map +1 -1
- package/bin/agent/remote/RemoteAgent.js.map +1 -1
- package/bin/agent/remote/RemoteSession.d.ts +10 -1
- package/bin/agent/remote/RemoteSession.d.ts.map +1 -1
- package/bin/agent/remote/RemoteSession.js +18 -0
- package/bin/agent/remote/RemoteSession.js.map +1 -1
- package/bin/agent/remote/RemoteTransport.d.ts +5 -1
- package/bin/agent/remote/RemoteTransport.d.ts.map +1 -1
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.d.ts +4 -1
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.d.ts.map +1 -1
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.js +7 -0
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.js.map +1 -1
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.d.ts +4 -1
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.d.ts.map +1 -1
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.js +1 -0
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.js.map +1 -1
- package/bin/executor/Executor.d.ts +0 -16
- package/bin/executor/Executor.d.ts.map +1 -1
- package/bin/executor/Executor.js +0 -16
- package/bin/executor/Executor.js.map +1 -1
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts +1 -3
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +1 -1
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js +1 -5
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +1 -1
- package/bin/executor/composer/history/SessionHistoryWriter.d.ts +0 -10
- package/bin/executor/composer/history/SessionHistoryWriter.d.ts.map +1 -1
- package/bin/executor/composer/history/SessionHistoryWriter.js +31 -61
- package/bin/executor/composer/history/SessionHistoryWriter.js.map +1 -1
- package/bin/executor/messages/AssistantFileResource.d.ts.map +1 -1
- package/bin/executor/messages/AssistantFileResource.js +58 -15
- package/bin/executor/messages/AssistantFileResource.js.map +1 -1
- package/bin/executor/services/ExecutorInflightService.d.ts +0 -5
- package/bin/executor/services/ExecutorInflightService.d.ts.map +1 -1
- package/bin/executor/services/ExecutorInflightService.js +0 -6
- package/bin/executor/services/ExecutorInflightService.js.map +1 -1
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts +4 -0
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +1 -1
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js +115 -3
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js.map +1 -1
- package/bin/executor/types/SessionHistoryMeta.d.ts +6 -0
- package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -1
- package/bin/index.d.ts +38 -6
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +14 -1
- package/bin/index.js.map +1 -1
- package/bin/plugin/core/ActionScheduleExecutor.js +1 -1
- package/bin/plugin/core/ActionScheduleExecutor.js.map +1 -1
- package/bin/plugin/core/BasePlugin.d.ts +7 -9
- package/bin/plugin/core/BasePlugin.d.ts.map +1 -1
- package/bin/plugin/core/BasePlugin.js +1 -14
- package/bin/plugin/core/BasePlugin.js.map +1 -1
- package/bin/plugin/core/HookRegistry.d.ts +1 -1
- package/bin/plugin/core/HookRegistry.d.ts.map +1 -1
- package/bin/plugin/core/PluginActionFactory.d.ts +1 -5
- package/bin/plugin/core/PluginActionFactory.d.ts.map +1 -1
- package/bin/plugin/core/PluginActionFactory.js +0 -3
- package/bin/plugin/core/PluginActionFactory.js.map +1 -1
- package/bin/plugin/core/PluginActionRunner.d.ts +6 -4
- package/bin/plugin/core/PluginActionRunner.d.ts.map +1 -1
- package/bin/plugin/core/PluginActionRunner.js +2 -2
- package/bin/plugin/core/PluginActionRunner.js.map +1 -1
- package/bin/plugin/core/PluginCatalog.d.ts +2 -1
- package/bin/plugin/core/PluginCatalog.d.ts.map +1 -1
- package/bin/plugin/core/PluginCatalog.js.map +1 -1
- package/bin/plugin/core/PluginCommand.d.ts +1 -1
- package/bin/plugin/core/PluginCommand.d.ts.map +1 -1
- package/bin/plugin/core/PluginCommand.js.map +1 -1
- package/bin/plugin/core/PluginHttpRoutes.d.ts +1 -1
- package/bin/plugin/core/PluginHttpRoutes.d.ts.map +1 -1
- package/bin/plugin/core/PluginLocalExecution.d.ts +4 -1
- package/bin/plugin/core/PluginLocalExecution.d.ts.map +1 -1
- package/bin/plugin/core/PluginLocalExecution.js +0 -1
- package/bin/plugin/core/PluginLocalExecution.js.map +1 -1
- package/bin/plugin/core/PluginRegistry.d.ts +4 -2
- package/bin/plugin/core/PluginRegistry.d.ts.map +1 -1
- package/bin/plugin/core/PluginRegistry.js +7 -6
- package/bin/plugin/core/PluginRegistry.js.map +1 -1
- package/bin/plugin/core/PluginStateController.d.ts +7 -27
- package/bin/plugin/core/PluginStateController.d.ts.map +1 -1
- package/bin/plugin/core/PluginStateController.js +5 -39
- package/bin/plugin/core/PluginStateController.js.map +1 -1
- package/bin/plugin/types/PluginApi.d.ts +3 -79
- package/bin/plugin/types/PluginApi.d.ts.map +1 -1
- package/bin/rpc/Client.d.ts +11 -6
- package/bin/rpc/Client.d.ts.map +1 -1
- package/bin/rpc/Client.js +2 -0
- package/bin/rpc/Client.js.map +1 -1
- package/bin/session/Session.d.ts +2 -5
- package/bin/session/Session.d.ts.map +1 -1
- package/bin/session/Session.js +3 -16
- package/bin/session/Session.js.map +1 -1
- package/bin/session/SessionSystemBuilder.d.ts +1 -1
- package/bin/session/SessionSystemBuilder.d.ts.map +1 -1
- package/bin/session/browse/Browse.d.ts +4 -6
- package/bin/session/browse/Browse.d.ts.map +1 -1
- package/bin/session/browse/Browse.js +71 -71
- package/bin/session/browse/Browse.js.map +1 -1
- package/bin/session/preview/SessionMessagePreview.d.ts +13 -0
- package/bin/session/preview/SessionMessagePreview.d.ts.map +1 -0
- package/bin/session/preview/SessionMessagePreview.js +61 -0
- package/bin/session/preview/SessionMessagePreview.js.map +1 -0
- package/bin/session/services/SessionStateService.d.ts +1 -1
- package/bin/session/services/SessionStateService.d.ts.map +1 -1
- package/bin/session/services/SessionStateService.js +2 -2
- package/bin/session/services/SessionStateService.js.map +1 -1
- package/bin/session/services/SessionViewService.d.ts +2 -1
- package/bin/session/services/SessionViewService.d.ts.map +1 -1
- package/bin/session/services/SessionViewService.js +4 -1
- package/bin/session/services/SessionViewService.js.map +1 -1
- package/bin/session/storage/Metadata.d.ts.map +1 -1
- package/bin/session/storage/Metadata.js +23 -0
- package/bin/session/storage/Metadata.js.map +1 -1
- package/bin/session/storage/Persistence.d.ts +1 -1
- package/bin/session/storage/Persistence.d.ts.map +1 -1
- package/bin/session/storage/RuntimeSessionPort.d.ts +0 -12
- package/bin/session/storage/RuntimeSessionPort.d.ts.map +1 -1
- package/bin/session/storage/RuntimeSessionPort.js +0 -8
- package/bin/session/storage/RuntimeSessionPort.js.map +1 -1
- package/bin/types/plugin/PluginAction.d.ts +0 -10
- package/bin/types/plugin/PluginAction.d.ts.map +1 -1
- package/bin/types/plugin/PluginCommand.d.ts +2 -3
- package/bin/types/plugin/PluginCommand.d.ts.map +1 -1
- package/bin/types/plugin/PluginControl.d.ts +74 -0
- package/bin/types/plugin/PluginControl.d.ts.map +1 -0
- package/bin/types/plugin/PluginControl.js +9 -0
- package/bin/types/plugin/PluginControl.js.map +1 -0
- package/bin/types/plugin/PluginDefinition.d.ts +1 -1
- package/bin/types/plugin/PluginDefinition.d.ts.map +1 -1
- package/bin/types/plugin/PluginRuntime.d.ts +1 -3
- package/bin/types/plugin/PluginRuntime.d.ts.map +1 -1
- package/bin/types/plugin/PluginState.d.ts +3 -16
- package/bin/types/plugin/PluginState.d.ts.map +1 -1
- package/bin/types/rpc/RpcProtocol.d.ts +3 -3
- package/bin/types/rpc/RpcProtocol.d.ts.map +1 -1
- package/bin/types/runtime/agent/AgentContext.d.ts +1 -9
- package/bin/types/runtime/agent/AgentContext.d.ts.map +1 -1
- package/bin/types/runtime/agent/AgentContext.js.map +1 -1
- package/bin/types/session/SessionLocalState.d.ts +1 -1
- package/bin/types/session/SessionLocalState.d.ts.map +1 -1
- package/package.json +4 -7
- package/scripts/agent-ready.test.mjs +38 -0
- package/scripts/assistant-file-resource.test.mjs +39 -0
- package/scripts/city-model-tool-loop.test.mjs +18 -30
- package/scripts/image-plugin-job.test.mjs +13 -13
- package/scripts/plugin-tool-bridge.test.mjs +2 -3
- package/scripts/remote-session-reconnect.test.mjs +67 -0
- package/scripts/session-history-writer-error.test.mjs +57 -0
- package/scripts/session-list-title.test.mjs +114 -23
- package/src/agent/local/Agent.ts +4 -10
- package/src/agent/local/AgentInstructions.ts +1 -1
- package/src/agent/local/services/AgentAssemblyService.ts +3 -9
- package/src/agent/local/services/AgentSessions.ts +8 -15
- package/src/agent/remote/RemoteAgent.ts +5 -4
- package/src/agent/remote/RemoteSession.ts +21 -2
- package/src/agent/remote/RemoteTransport.ts +6 -2
- package/src/agent/remote/transports/HttpRemoteAgentTransport.ts +13 -3
- package/src/agent/remote/transports/RpcRemoteAgentTransport.ts +6 -2
- package/src/executor/Executor.ts +0 -23
- package/src/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.ts +2 -8
- package/src/executor/composer/history/SessionHistoryWriter.ts +33 -64
- package/src/executor/messages/AssistantFileResource.ts +61 -17
- package/src/executor/services/ExecutorInflightService.ts +0 -10
- package/src/executor/store/history/jsonl/JsonlSessionHistoryStore.ts +130 -4
- package/src/executor/types/SessionHistoryMeta.ts +6 -0
- package/src/index.ts +100 -29
- package/src/plugin/core/ActionScheduleExecutor.ts +1 -1
- package/src/plugin/core/BasePlugin.ts +8 -22
- package/src/plugin/core/HookRegistry.ts +1 -1
- package/src/plugin/core/PluginActionFactory.ts +1 -8
- package/src/plugin/core/PluginActionRunner.ts +8 -11
- package/src/plugin/core/PluginCatalog.ts +2 -5
- package/src/plugin/core/PluginCommand.ts +2 -1
- package/src/plugin/core/PluginHttpRoutes.ts +1 -1
- package/src/plugin/core/PluginLocalExecution.ts +4 -7
- package/src/plugin/core/PluginRegistry.ts +10 -10
- package/src/plugin/core/PluginStateController.ts +12 -60
- package/src/plugin/types/PluginApi.ts +6 -81
- package/src/rpc/Client.ts +22 -16
- package/src/session/Session.ts +5 -21
- package/src/session/SessionSystemBuilder.ts +1 -1
- package/src/session/browse/Browse.ts +103 -84
- package/src/session/preview/SessionMessagePreview.ts +75 -0
- package/src/session/services/SessionStateService.ts +3 -4
- package/src/session/services/SessionViewService.ts +6 -6
- package/src/session/storage/Metadata.ts +26 -0
- package/src/session/storage/Persistence.ts +1 -1
- package/src/session/storage/RuntimeSessionPort.ts +0 -20
- package/src/types/plugin/PluginAction.ts +0 -10
- package/src/types/plugin/PluginCommand.ts +2 -3
- package/src/types/plugin/PluginControl.ts +80 -0
- package/src/types/plugin/PluginDefinition.ts +1 -1
- package/src/types/plugin/PluginRuntime.ts +1 -3
- package/src/types/plugin/PluginState.ts +3 -20
- package/src/types/rpc/RpcProtocol.ts +4 -4
- package/src/types/runtime/agent/AgentContext.ts +1 -9
- package/src/types/session/SessionLocalState.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/bin/config/DowncitySchema.d.ts +0 -20
- package/bin/config/DowncitySchema.d.ts.map +0 -1
- package/bin/config/DowncitySchema.js +0 -160
- package/bin/config/DowncitySchema.js.map +0 -1
- package/bin/plugin/core/Activation.d.ts +0 -18
- package/bin/plugin/core/Activation.d.ts.map +0 -1
- package/bin/plugin/core/Activation.js +0 -21
- package/bin/plugin/core/Activation.js.map +0 -1
- package/bin/plugin/core/Manager.d.ts +0 -7
- package/bin/plugin/core/Manager.d.ts.map +0 -1
- package/bin/plugin/core/Manager.js +0 -6
- package/bin/plugin/core/Manager.js.map +0 -1
- package/bin/plugin/types/Plugin.d.ts +0 -15
- package/bin/plugin/types/Plugin.d.ts.map +0 -1
- package/bin/plugin/types/Plugin.js +0 -9
- package/bin/plugin/types/Plugin.js.map +0 -1
- package/bin/plugin/types/PluginLifecycle.d.ts +0 -34
- package/bin/plugin/types/PluginLifecycle.d.ts.map +0 -1
- package/bin/plugin/types/PluginLifecycle.js +0 -9
- package/bin/plugin/types/PluginLifecycle.js.map +0 -1
- package/bin/plugin/types/PluginState.d.ts +0 -5
- package/bin/plugin/types/PluginState.d.ts.map +0 -1
- package/bin/plugin/types/PluginState.js +0 -5
- package/bin/plugin/types/PluginState.js.map +0 -1
- package/bin/plugin/types/Plugins.d.ts +0 -61
- package/bin/plugin/types/Plugins.d.ts.map +0 -1
- package/bin/plugin/types/Plugins.js +0 -5
- package/bin/plugin/types/Plugins.js.map +0 -1
- package/bin/session/index.d.ts +0 -15
- package/bin/session/index.d.ts.map +0 -1
- package/bin/session/index.js +0 -15
- package/bin/session/index.js.map +0 -1
- package/bin/types/agent/AgentTypes.d.ts +0 -18
- package/bin/types/agent/AgentTypes.d.ts.map +0 -1
- package/bin/types/agent/AgentTypes.js +0 -10
- package/bin/types/agent/AgentTypes.js.map +0 -1
- package/bin/utils/logger/Format.d.ts +0 -11
- package/bin/utils/logger/Format.d.ts.map +0 -1
- package/bin/utils/logger/Format.js +0 -10
- package/bin/utils/logger/Format.js.map +0 -1
- package/src/config/DowncitySchema.ts +0 -175
- package/src/plugin/core/Activation.ts +0 -26
- package/src/plugin/core/Manager.ts +0 -17
- package/src/plugin/types/Plugin.ts +0 -63
- package/src/plugin/types/PluginLifecycle.ts +0 -35
- package/src/plugin/types/PluginState.ts +0 -12
- package/src/plugin/types/Plugins.ts +0 -67
- package/src/session/index.ts +0 -57
- package/src/types/agent/AgentTypes.ts +0 -58
- package/src/utils/logger/Format.ts +0 -15
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `downcity.json` Schema 定义模块。
|
|
3
|
-
*
|
|
4
|
-
* 职责说明(中文)
|
|
5
|
-
* - 提供旧版 `downcity.json` 的 JSON Schema 常量。
|
|
6
|
-
* - 保留给迁移场景与编辑器辅助,不再作为新 Agent 项目的默认配置入口。
|
|
7
|
-
*
|
|
8
|
-
* 边界说明(中文)
|
|
9
|
-
* - 这里是静态 schema 常量,不负责运行时配置装配或业务校验逻辑。
|
|
10
|
-
* - 当 schema 与运行时实现存在差异时,应同时更新配置解析与用户文档。
|
|
11
|
-
*/
|
|
12
|
-
import type { JsonObject } from "@/types/common/Json.js";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* `downcity.json` 的本地 Schema 常量。
|
|
16
|
-
*
|
|
17
|
-
* 关键点(中文)
|
|
18
|
-
* - 该结构主要面向 legacy 文件的 IDE 校验与用户编辑体验,不替代运行时断言。
|
|
19
|
-
*/
|
|
20
|
-
export const DOWNCITY_JSON_SCHEMA: JsonObject = {
|
|
21
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
22
|
-
$id: "https://downcity.ai/schemas/downcity.schema.json",
|
|
23
|
-
title: "Downcity downcity.json",
|
|
24
|
-
type: "object",
|
|
25
|
-
additionalProperties: true,
|
|
26
|
-
properties: {
|
|
27
|
-
$schema: {
|
|
28
|
-
type: "string",
|
|
29
|
-
description:
|
|
30
|
-
"JSON Schema reference for editor/IDE validation (e.g. ./.downcity/schema/downcity.schema.json).",
|
|
31
|
-
},
|
|
32
|
-
id: { type: "string" },
|
|
33
|
-
version: { type: "string" },
|
|
34
|
-
start: {
|
|
35
|
-
type: "object",
|
|
36
|
-
additionalProperties: true,
|
|
37
|
-
properties: {
|
|
38
|
-
port: { type: "integer", minimum: 1, maximum: 65535 },
|
|
39
|
-
host: { type: "string" },
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
execution: {
|
|
43
|
-
type: "object",
|
|
44
|
-
additionalProperties: true,
|
|
45
|
-
properties: {
|
|
46
|
-
type: {
|
|
47
|
-
type: "string",
|
|
48
|
-
enum: ["api"],
|
|
49
|
-
},
|
|
50
|
-
modelId: {
|
|
51
|
-
type: "string",
|
|
52
|
-
description:
|
|
53
|
-
"API 执行模式下绑定的 City AIService 模型 ID。",
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
required: ["type", "modelId"],
|
|
57
|
-
},
|
|
58
|
-
plugins: {
|
|
59
|
-
type: "object",
|
|
60
|
-
additionalProperties: true,
|
|
61
|
-
properties: {
|
|
62
|
-
chat: {
|
|
63
|
-
type: "object",
|
|
64
|
-
additionalProperties: true,
|
|
65
|
-
properties: {
|
|
66
|
-
queue: {
|
|
67
|
-
type: "object",
|
|
68
|
-
additionalProperties: true,
|
|
69
|
-
properties: {
|
|
70
|
-
maxConcurrency: { type: "integer", minimum: 1, maximum: 32 },
|
|
71
|
-
mergeDebounceMs: { type: "integer", minimum: 0, maximum: 60000 },
|
|
72
|
-
mergeMaxWaitMs: { type: "integer", minimum: 0, maximum: 120000 },
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
egress: {
|
|
76
|
-
type: "object",
|
|
77
|
-
additionalProperties: true,
|
|
78
|
-
properties: {
|
|
79
|
-
chatSendMaxCallsPerRun: { type: "integer", minimum: 1, maximum: 500 },
|
|
80
|
-
chatSendIdempotency: { type: "boolean" },
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
channels: {
|
|
84
|
-
type: "object",
|
|
85
|
-
additionalProperties: true,
|
|
86
|
-
description:
|
|
87
|
-
"Chat platform channels (Telegram / Feishu / QQ...).",
|
|
88
|
-
properties: {
|
|
89
|
-
telegram: {
|
|
90
|
-
type: "object",
|
|
91
|
-
additionalProperties: true,
|
|
92
|
-
properties: {
|
|
93
|
-
enabled: { type: "boolean" },
|
|
94
|
-
channelAccountId: { type: "string" },
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
feishu: {
|
|
98
|
-
type: "object",
|
|
99
|
-
additionalProperties: true,
|
|
100
|
-
properties: {
|
|
101
|
-
enabled: { type: "boolean" },
|
|
102
|
-
channelAccountId: { type: "string" },
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
qq: {
|
|
106
|
-
type: "object",
|
|
107
|
-
additionalProperties: true,
|
|
108
|
-
properties: {
|
|
109
|
-
enabled: { type: "boolean" },
|
|
110
|
-
channelAccountId: { type: "string" },
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
llm: {
|
|
120
|
-
type: "object",
|
|
121
|
-
additionalProperties: true,
|
|
122
|
-
properties: {
|
|
123
|
-
providers: {
|
|
124
|
-
type: "object",
|
|
125
|
-
additionalProperties: {
|
|
126
|
-
type: "object",
|
|
127
|
-
additionalProperties: true,
|
|
128
|
-
properties: {
|
|
129
|
-
type: {
|
|
130
|
-
type: "string",
|
|
131
|
-
enum: [
|
|
132
|
-
"anthropic",
|
|
133
|
-
"openai",
|
|
134
|
-
"deepseek",
|
|
135
|
-
"gemini",
|
|
136
|
-
"open-compatible",
|
|
137
|
-
"open-responses",
|
|
138
|
-
"moonshot-cn",
|
|
139
|
-
"moonshot-ai",
|
|
140
|
-
"kimi-code",
|
|
141
|
-
"xai",
|
|
142
|
-
"huggingface",
|
|
143
|
-
"openrouter",
|
|
144
|
-
],
|
|
145
|
-
},
|
|
146
|
-
baseUrl: { type: "string" },
|
|
147
|
-
apiKey: { type: "string" },
|
|
148
|
-
},
|
|
149
|
-
required: ["type"],
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
models: {
|
|
153
|
-
type: "object",
|
|
154
|
-
additionalProperties: {
|
|
155
|
-
type: "object",
|
|
156
|
-
additionalProperties: true,
|
|
157
|
-
properties: {
|
|
158
|
-
provider: { type: "string" },
|
|
159
|
-
name: { type: "string" },
|
|
160
|
-
temperature: { type: "number" },
|
|
161
|
-
maxTokens: { type: "number" },
|
|
162
|
-
topP: { type: "number" },
|
|
163
|
-
frequencyPenalty: { type: "number" },
|
|
164
|
-
presencePenalty: { type: "number" },
|
|
165
|
-
anthropicVersion: { type: "string" },
|
|
166
|
-
},
|
|
167
|
-
required: ["provider", "name"],
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
logMessages: { type: "boolean" },
|
|
171
|
-
},
|
|
172
|
-
required: ["providers", "models"],
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin 激活兼容工具。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 新模型不再读取 `downcity.json.plugins.<name>.enabled`。
|
|
6
|
-
* - 传入 plugin 本身就表示调用方希望它可见;Agent runtime 以注册表作为真实边界。
|
|
7
|
-
* - 该函数仅为旧内部集成保留,后续应优先使用 `context.plugins.has/status`。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { Plugin } from "@/plugin/types/Plugin.js";
|
|
11
|
-
import type { AgentContext } from "@/types/runtime/agent/AgentContext.js";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 判断当前 plugin 是否可被视为启用。
|
|
15
|
-
*/
|
|
16
|
-
export function isPluginEnabled(params: {
|
|
17
|
-
plugin: Plugin;
|
|
18
|
-
context?: Pick<AgentContext, "plugins">;
|
|
19
|
-
}): boolean {
|
|
20
|
-
const pluginName = String(params.plugin.name || "").trim();
|
|
21
|
-
if (!pluginName) return false;
|
|
22
|
-
if (params.context?.plugins) {
|
|
23
|
-
return params.context.plugins.status(pluginName)?.status === "ready";
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Manager 门面模块。
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type {
|
|
6
|
-
PluginStateControlAction,
|
|
7
|
-
PluginStateControlResult,
|
|
8
|
-
PluginStateSnapshot,
|
|
9
|
-
} from "@/plugin/types/Plugin.js";
|
|
10
|
-
export {
|
|
11
|
-
controlPluginState,
|
|
12
|
-
isPluginRunning,
|
|
13
|
-
listPluginStates,
|
|
14
|
-
} from "@/plugin/core/PluginStateController.js";
|
|
15
|
-
export {
|
|
16
|
-
runPluginCommand,
|
|
17
|
-
} from "@/plugin/core/PluginActionRunner.js";
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin 类型 facade。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 保留旧的 `@/plugin/types/Plugin.js` 导入路径。
|
|
6
|
-
* - 真实类型按职责拆到 `src/types/plugin/*`,避免单文件继续膨胀。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export type {
|
|
10
|
-
PluginState,
|
|
11
|
-
PluginStateControlAction,
|
|
12
|
-
PluginStateControlResult,
|
|
13
|
-
PluginRuntimeRecord,
|
|
14
|
-
PluginSnapshot,
|
|
15
|
-
PluginStateSnapshot,
|
|
16
|
-
} from "@/types/plugin/PluginState.js";
|
|
17
|
-
export type {
|
|
18
|
-
PluginCommandContext,
|
|
19
|
-
PluginCommandParams,
|
|
20
|
-
PluginCommandResult,
|
|
21
|
-
PluginLifecycle,
|
|
22
|
-
} from "@/types/plugin/PluginCommand.js";
|
|
23
|
-
export type {
|
|
24
|
-
PluginAction,
|
|
25
|
-
PluginActionApi,
|
|
26
|
-
PluginActionCommand,
|
|
27
|
-
PluginActionCommandInput,
|
|
28
|
-
PluginActionExample,
|
|
29
|
-
PluginActionInvokeParams,
|
|
30
|
-
PluginActionInvokePort,
|
|
31
|
-
PluginActionInvokeResult,
|
|
32
|
-
PluginActionInputSchema,
|
|
33
|
-
PluginActionMetadata,
|
|
34
|
-
PluginActionResult,
|
|
35
|
-
PluginActions,
|
|
36
|
-
} from "@/types/plugin/PluginAction.js";
|
|
37
|
-
export type {
|
|
38
|
-
PluginAvailability,
|
|
39
|
-
PluginConfigDefinition,
|
|
40
|
-
PluginEffectHook,
|
|
41
|
-
PluginGuardHook,
|
|
42
|
-
PluginHooks,
|
|
43
|
-
PluginPipelineHook,
|
|
44
|
-
AgentPlugins,
|
|
45
|
-
PluginActionReadView,
|
|
46
|
-
PluginResolveHook,
|
|
47
|
-
PluginResolves,
|
|
48
|
-
PluginReadView,
|
|
49
|
-
PluginView,
|
|
50
|
-
} from "@/types/plugin/PluginRuntime.js";
|
|
51
|
-
export type {
|
|
52
|
-
PluginSetupDefinition,
|
|
53
|
-
PluginSetupField,
|
|
54
|
-
PluginSetupFieldOption,
|
|
55
|
-
PluginUsageDefinition,
|
|
56
|
-
PluginUsageField,
|
|
57
|
-
PluginUsageFieldOption,
|
|
58
|
-
} from "@/types/plugin/PluginSetup.js";
|
|
59
|
-
export type {
|
|
60
|
-
PluginHttpDefinition,
|
|
61
|
-
PluginHttpRegistration,
|
|
62
|
-
} from "@/types/plugin/PluginHttp.js";
|
|
63
|
-
export type { Plugin } from "@/types/plugin/PluginDefinition.js";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin 生命周期配置类型定义。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - Plugin 是否启用属于 city 级全局状态,不属于单个 agent 项目。
|
|
6
|
-
* - 该文件只描述 city 级 lifecycle 数据,不承载 agent 局部参数。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 单个 plugin 的 city 级生命周期配置。
|
|
11
|
-
*/
|
|
12
|
-
export interface CityPluginLifecycleItem {
|
|
13
|
-
/**
|
|
14
|
-
* 当前 plugin 是否在 city 级被启用。
|
|
15
|
-
*/
|
|
16
|
-
enabled: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 最近更新时间(ISO 字符串)。
|
|
19
|
-
*/
|
|
20
|
-
updatedAt: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* city 级 plugin 生命周期配置映射。
|
|
25
|
-
*/
|
|
26
|
-
export interface CityPluginLifecycleConfig {
|
|
27
|
-
/**
|
|
28
|
-
* 插件生命周期配置对象映射。
|
|
29
|
-
*
|
|
30
|
-
* 说明(中文)
|
|
31
|
-
* - key 为 plugin 稳定名称。
|
|
32
|
-
* - value 为该 plugin 的 city 级启用状态快照。
|
|
33
|
-
*/
|
|
34
|
-
[pluginName: string]: CityPluginLifecycleItem | undefined;
|
|
35
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* plugin 管理命令类型。
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { JsonValue } from "@/types/common/Json.js";
|
|
6
|
-
|
|
7
|
-
export type PluginControlAction = "status" | "unregister";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 单个 plugin 的对外状态视图。
|
|
11
|
-
*/
|
|
12
|
-
export type PluginStateView = {
|
|
13
|
-
/** plugin 稳定名称。 */
|
|
14
|
-
name: string;
|
|
15
|
-
/** 当前注册状态。 */
|
|
16
|
-
state: "ready" | "error";
|
|
17
|
-
/** 当前注册状态。 */
|
|
18
|
-
status: "ready" | "error";
|
|
19
|
-
/** 注册时间(毫秒时间戳)。 */
|
|
20
|
-
registered_at: number;
|
|
21
|
-
/** 最近更新时间(毫秒时间戳)。 */
|
|
22
|
-
updated_at: number;
|
|
23
|
-
/** 兼容旧字段的最近一次状态更新时间。 */
|
|
24
|
-
updatedAt: number;
|
|
25
|
-
/** 最近一次错误信息。 */
|
|
26
|
-
lastError?: string;
|
|
27
|
-
/** 最近一次错误信息。 */
|
|
28
|
-
last_error?: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* plugin 状态列表响应。
|
|
33
|
-
*/
|
|
34
|
-
export type PluginStateListResponse = {
|
|
35
|
-
success: boolean;
|
|
36
|
-
plugins?: PluginStateView[];
|
|
37
|
-
error?: string;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* plugin 生命周期控制响应。
|
|
42
|
-
*/
|
|
43
|
-
export type PluginControlResponse = {
|
|
44
|
-
success: boolean;
|
|
45
|
-
plugin?: PluginStateView;
|
|
46
|
-
error?: string;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* plugin command/action 执行响应。
|
|
51
|
-
*/
|
|
52
|
-
export type PluginCommandResponse = {
|
|
53
|
-
success: boolean;
|
|
54
|
-
plugin?: PluginStateView;
|
|
55
|
-
message?: string;
|
|
56
|
-
data?: JsonValue;
|
|
57
|
-
error?: string;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type PluginCliBaseOptions = {
|
|
61
|
-
path?: string;
|
|
62
|
-
agent?: string;
|
|
63
|
-
host?: string;
|
|
64
|
-
port?: number;
|
|
65
|
-
token?: string;
|
|
66
|
-
json?: boolean;
|
|
67
|
-
};
|
package/src/session/index.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session 模块聚合入口。
|
|
3
|
-
*
|
|
4
|
-
* 职责说明(中文)
|
|
5
|
-
* - 统一暴露 `session/` 目录下的本地 Session 实现与相关辅助能力。
|
|
6
|
-
* - 让 `Session` 相关代码收敛在一个目录树中,避免实现散落在 Agent 入口模块里。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { Session } from "./Session.js";
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
getSdkAgentDirPath,
|
|
13
|
-
getSdkAgentArchivedSessionDirPath,
|
|
14
|
-
getSdkAgentArchivedSessionMessagesDirPath,
|
|
15
|
-
getSdkAgentArchivedSessionMessagesPath,
|
|
16
|
-
getSdkAgentArchivedSessionMetaPath,
|
|
17
|
-
getSdkAgentArchivedSessionsDirPath,
|
|
18
|
-
getSdkAgentSessionArchiveDirPath,
|
|
19
|
-
getSdkAgentSessionArchiveFilePath,
|
|
20
|
-
getSdkAgentSessionDirPath,
|
|
21
|
-
getSdkAgentSessionInflightPath,
|
|
22
|
-
getSdkAgentSessionMessagesDirPath,
|
|
23
|
-
getSdkAgentSessionMessagesPath,
|
|
24
|
-
getSdkAgentSessionMetaPath,
|
|
25
|
-
getSdkAgentSessionsRootDirPath,
|
|
26
|
-
getSdkAgentsRootDirPath,
|
|
27
|
-
getSdkDowncityDirPath,
|
|
28
|
-
} from "./storage/Paths.js";
|
|
29
|
-
export {
|
|
30
|
-
inferModelLabel,
|
|
31
|
-
normalizeSessionTitle,
|
|
32
|
-
patchSessionModelLabel,
|
|
33
|
-
readSessionMetadata,
|
|
34
|
-
readSessionMetadataFromPath,
|
|
35
|
-
resolveSystemTimezone,
|
|
36
|
-
writeSessionMetadata,
|
|
37
|
-
} from "./storage/Metadata.js";
|
|
38
|
-
export {
|
|
39
|
-
ensureSessionTitle,
|
|
40
|
-
} from "./SessionTitle.js";
|
|
41
|
-
export {
|
|
42
|
-
persistSdkAssistantResult,
|
|
43
|
-
touchSessionMetadata,
|
|
44
|
-
} from "./storage/Persistence.js";
|
|
45
|
-
export {
|
|
46
|
-
createRuntimeSessionPort,
|
|
47
|
-
} from "./storage/RuntimeSessionPort.js";
|
|
48
|
-
export {
|
|
49
|
-
buildSessionRecordsPage,
|
|
50
|
-
buildSessionInfo,
|
|
51
|
-
listArchivedAgentSessionSummaryPage,
|
|
52
|
-
listAgentSessionSummaryPage,
|
|
53
|
-
loadSessionArchiveMessagesFromPath,
|
|
54
|
-
loadSessionMessagesFromPath,
|
|
55
|
-
resolveSessionMessagePreview,
|
|
56
|
-
toSessionTimelineEvents,
|
|
57
|
-
} from "./browse/Browse.js";
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent 对外类型 facade。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 保留旧的 `@/types/agent/AgentTypes.js` 导入路径。
|
|
6
|
-
* - 真实类型按职责拆到 AgentOptions / RemoteAgentOptions / SessionTypes / SessionActor。
|
|
7
|
-
* - 这里不承载具体字段定义,避免单文件继续膨胀。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export type { AgentModel } from "@/model/CityModelAdapter.js";
|
|
11
|
-
export type {
|
|
12
|
-
SessionComposerFactoryContext,
|
|
13
|
-
SessionComposerInput,
|
|
14
|
-
SessionComposerOptions,
|
|
15
|
-
} from "@/types/session/SessionComposerOptions.js";
|
|
16
|
-
export type {
|
|
17
|
-
AgentManagedSession,
|
|
18
|
-
SessionOptions,
|
|
19
|
-
} from "@/types/session/SessionOptions.js";
|
|
20
|
-
export type {
|
|
21
|
-
AgentOptions,
|
|
22
|
-
AgentSessionConstructor,
|
|
23
|
-
} from "@/types/agent/AgentOptions.js";
|
|
24
|
-
export type { RemoteAgentOptions } from "@/types/agent/RemoteAgentOptions.js";
|
|
25
|
-
export type {
|
|
26
|
-
RemoteAgentPluginActionInput,
|
|
27
|
-
RemoteAgentPluginActionResult,
|
|
28
|
-
} from "@/types/agent/RemoteAgentPluginAction.js";
|
|
29
|
-
export type {
|
|
30
|
-
AgentArchiveSessionInput,
|
|
31
|
-
AgentArchiveSessionsInput,
|
|
32
|
-
AgentArchiveSessionResult,
|
|
33
|
-
AgentArchiveSessionsResult,
|
|
34
|
-
AgentCleanArchiveResult,
|
|
35
|
-
AgentCreateSessionInput,
|
|
36
|
-
AgentListSessionsInput,
|
|
37
|
-
AgentSessionConfigSnapshot,
|
|
38
|
-
AgentSessionForkInput,
|
|
39
|
-
AgentSessionRecordsInput,
|
|
40
|
-
AgentSessionRecordsPage,
|
|
41
|
-
AgentSessionRecordsView,
|
|
42
|
-
AgentSessionInfo,
|
|
43
|
-
AgentSessionSetInput,
|
|
44
|
-
AgentSessionSummary,
|
|
45
|
-
AgentSessionSummaryPage,
|
|
46
|
-
AgentSessionSystemBlock,
|
|
47
|
-
AgentSessionSystemBlockSource,
|
|
48
|
-
AgentSessionSystemSessionInfo,
|
|
49
|
-
AgentSessionSystemSnapshot,
|
|
50
|
-
AgentSessionTimelineEvent,
|
|
51
|
-
} from "@/types/agent/SessionTypes.js";
|
|
52
|
-
export type { AgentSessionStopResult } from "@/types/sdk/AgentSessionStop.js";
|
|
53
|
-
export type {
|
|
54
|
-
AgentSession,
|
|
55
|
-
AgentSessionActor,
|
|
56
|
-
AgentSessions,
|
|
57
|
-
RemoteAgentSession,
|
|
58
|
-
} from "@/types/agent/SessionActor.js";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LLM 请求/响应日志格式化公共入口。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 外部模块只从这里导入,内部拆分对调用方透明。
|
|
6
|
-
* - `ProviderFetch` 仍然保留在 facade,避免影响 `Fetch.ts` 的类型入口。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { parseFetchRequestForLog } from "./FormatRequest.js";
|
|
10
|
-
export { parseFetchResponseForLog } from "./FormatResponse.js";
|
|
11
|
-
|
|
12
|
-
export type ProviderFetch = (
|
|
13
|
-
input: string | URL | Request,
|
|
14
|
-
init?: RequestInit,
|
|
15
|
-
) => Promise<Response>;
|