@downcity/agent 1.1.51 → 1.1.63
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 +5 -4
- package/bin/agent/Agent.d.ts.map +1 -1
- package/bin/agent/Agent.js.map +1 -1
- package/bin/config/AgentInitializer.d.ts +1 -1
- package/bin/config/AgentInitializer.js +1 -1
- package/bin/config/DowncitySchema.js +1 -1
- package/bin/config/DowncitySchema.js.map +1 -1
- package/bin/config/ExecutionBinding.d.ts +1 -1
- package/bin/config/ExecutionBinding.js +1 -1
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +1 -1
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js +0 -4
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +1 -1
- package/bin/executor/composer/system/default/InitPrompts.d.ts +1 -1
- package/bin/executor/composer/system/default/InitPrompts.js +1 -1
- package/bin/executor/composer/system/default/SystemDomain.js +1 -1
- package/bin/executor/composer/system/default/assets/core.prompt.d.ts +1 -1
- package/bin/executor/composer/system/default/assets/core.prompt.js +1 -1
- package/bin/executor/composer/system/default/assets/plugin.prompt.d.ts +1 -1
- package/bin/executor/composer/system/default/assets/plugin.prompt.js +1 -1
- package/bin/executor/composer/system/default/assets/task.prompt.d.ts +1 -1
- package/bin/executor/composer/system/default/assets/task.prompt.js +1 -1
- package/bin/executor/messages/ChatMessageMarkupTypes.d.ts +1 -1
- package/bin/executor/messages/ChatMessageMarkupTypes.js +1 -1
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts +1 -2
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +1 -1
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js +17 -56
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js.map +1 -1
- package/bin/executor/tools/shell/ShellToolBridge.js +1 -1
- package/bin/executor/tools/shell/ShellToolBridge.js.map +1 -1
- package/bin/executor/tools/shell/ShellToolDefinition.d.ts +2 -2
- package/bin/executor/tools/shell/ShellToolFormatting.d.ts +1 -1
- package/bin/executor/tools/shell/ShellToolFormatting.js +7 -7
- package/bin/executor/tools/shell/ShellToolFormatting.js.map +1 -1
- package/bin/executor/tools/shell/ShellToolSchemas.d.ts +7 -75
- package/bin/executor/tools/shell/ShellToolSchemas.d.ts.map +1 -1
- package/bin/executor/types/SessionHistoryMeta.d.ts +5 -24
- package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -1
- package/bin/executor/types/SessionHistoryMeta.js +1 -1
- package/bin/index.d.ts +3 -2
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +1 -0
- package/bin/index.js.map +1 -1
- package/bin/model/CityModelAdapter.d.ts +23 -0
- package/bin/model/CityModelAdapter.d.ts.map +1 -0
- package/bin/model/CityModelAdapter.js +454 -0
- package/bin/model/CityModelAdapter.js.map +1 -0
- package/bin/runtime/host/daemon/Paths.d.ts +1 -1
- package/bin/runtime/host/daemon/Paths.js +1 -1
- package/bin/runtime/host/daemon/ProjectSetup.js +2 -2
- package/bin/session/Session.d.ts +1 -0
- package/bin/session/Session.d.ts.map +1 -1
- package/bin/session/Session.js +32 -6
- package/bin/session/Session.js.map +1 -1
- package/bin/session/SessionTitle.d.ts +49 -0
- package/bin/session/SessionTitle.d.ts.map +1 -0
- package/bin/session/SessionTitle.js +130 -0
- package/bin/session/SessionTitle.js.map +1 -0
- package/bin/session/browse/Browse.d.ts +2 -1
- package/bin/session/browse/Browse.d.ts.map +1 -1
- package/bin/session/browse/Browse.js +18 -15
- package/bin/session/browse/Browse.js.map +1 -1
- package/bin/session/index.d.ts +2 -1
- package/bin/session/index.d.ts.map +1 -1
- package/bin/session/index.js +2 -1
- package/bin/session/index.js.map +1 -1
- package/bin/session/storage/Metadata.d.ts +4 -0
- package/bin/session/storage/Metadata.d.ts.map +1 -1
- package/bin/session/storage/Metadata.js +12 -25
- package/bin/session/storage/Metadata.js.map +1 -1
- package/bin/session/storage/Persistence.d.ts.map +1 -1
- package/bin/session/storage/Persistence.js +1 -4
- package/bin/session/storage/Persistence.js.map +1 -1
- package/bin/types/agent/AgentTypes.d.ts +9 -5
- package/bin/types/agent/AgentTypes.d.ts.map +1 -1
- package/bin/types/config/AgentProject.d.ts +1 -1
- package/bin/types/config/DowncityConfig.d.ts +3 -3
- package/bin/types/config/ExecutionBinding.d.ts +4 -4
- package/bin/types/config/ExecutionBinding.js +1 -1
- package/bin/types/runtime/auth/AuthPermission.js +2 -2
- package/bin/types/runtime/auth/AuthPermission.js.map +1 -1
- package/bin/types/runtime/host/Store.d.ts +3 -177
- package/bin/types/runtime/host/Store.d.ts.map +1 -1
- package/bin/types/runtime/host/Store.js +7 -0
- package/bin/types/runtime/host/Store.js.map +1 -1
- package/bin/types/runtime/http/InlineInstant.d.ts +1 -1
- package/bin/types/runtime/platform/Platform.d.ts +1 -1
- package/package.json +19 -18
- package/scripts/city-model-tool-loop.test.mjs +181 -0
- package/src/agent/Agent.ts +3 -2
- package/src/config/AgentInitializer.ts +1 -1
- package/src/config/DowncitySchema.ts +1 -1
- package/src/config/ExecutionBinding.ts +1 -1
- package/src/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.ts +0 -4
- package/src/executor/composer/system/default/InitPrompts.ts +1 -1
- package/src/executor/composer/system/default/SystemDomain.ts +1 -1
- package/src/executor/composer/system/default/assets/core.prompt.ts +1 -1
- package/src/executor/composer/system/default/assets/core.prompt.ts.txt +1 -1
- package/src/executor/composer/system/default/assets/plugin.prompt.ts +1 -1
- package/src/executor/composer/system/default/assets/plugin.prompt.ts.txt +18 -18
- package/src/executor/composer/system/default/assets/task.prompt.ts +1 -1
- package/src/executor/composer/system/default/assets/task.prompt.ts.txt +1 -1
- package/src/executor/messages/ChatMessageMarkupTypes.ts +1 -1
- package/src/executor/store/history/jsonl/JsonlSessionHistoryStore.ts +17 -57
- package/src/executor/tools/shell/ShellToolBridge.ts +1 -1
- package/src/executor/tools/shell/ShellToolFormatting.ts +7 -7
- package/src/executor/types/SessionHistoryMeta.ts +5 -25
- package/src/index.ts +5 -5
- package/src/model/CityModelAdapter.ts +553 -0
- package/src/runtime/host/daemon/Paths.ts +1 -1
- package/src/runtime/host/daemon/ProjectSetup.ts +2 -2
- package/src/session/Session.ts +40 -6
- package/src/session/SessionTitle.ts +192 -0
- package/src/session/browse/Browse.ts +22 -13
- package/src/session/index.ts +5 -0
- package/src/session/storage/Metadata.ts +14 -29
- package/src/session/storage/Persistence.ts +1 -4
- package/src/types/agent/AgentTypes.ts +10 -5
- package/src/types/config/AgentProject.ts +1 -1
- package/src/types/config/DowncityConfig.ts +3 -3
- package/src/types/config/ExecutionBinding.ts +4 -4
- package/src/types/runtime/auth/AuthPermission.ts +2 -2
- package/src/types/runtime/host/Store.ts +3 -182
- package/src/types/runtime/http/InlineInstant.ts +1 -1
- package/src/types/runtime/platform/Platform.ts +1 -1
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,195 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 平台宿主存储类型定义。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
5
|
+
* - Town 只保存平台级 env、channel account 与安全配置。
|
|
6
|
+
* - 模型能力由 City AIService 暴露,Town 不再声明 provider/model 存储类型。
|
|
7
7
|
*/
|
|
8
|
-
import type { LlmProviderType } from "@/types/config/LlmConfig.js";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Channel Account 支持的渠道类型。
|
|
12
11
|
*/
|
|
13
12
|
export type StoredChannelAccountChannel = "telegram" | "feishu" | "qq";
|
|
14
13
|
|
|
15
|
-
/**
|
|
16
|
-
* 模型 provider 记录。
|
|
17
|
-
*/
|
|
18
|
-
export interface StoredModelProvider {
|
|
19
|
-
/**
|
|
20
|
-
* provider 主键 ID(例如:`openai_main`、`default`)。
|
|
21
|
-
*/
|
|
22
|
-
id: string;
|
|
23
|
-
/**
|
|
24
|
-
* provider 类型(决定 SDK 分支与默认网关行为)。
|
|
25
|
-
*/
|
|
26
|
-
type: LlmProviderType;
|
|
27
|
-
/**
|
|
28
|
-
* provider 基础地址(可选)。
|
|
29
|
-
*/
|
|
30
|
-
baseUrl?: string;
|
|
31
|
-
/**
|
|
32
|
-
* provider API Key(解密后的明文;仅在运行时内存中使用)。
|
|
33
|
-
*/
|
|
34
|
-
apiKey?: string;
|
|
35
|
-
/**
|
|
36
|
-
* 创建时间(ISO 字符串)。
|
|
37
|
-
*/
|
|
38
|
-
createdAt: string;
|
|
39
|
-
/**
|
|
40
|
-
* 更新时间(ISO 字符串)。
|
|
41
|
-
*/
|
|
42
|
-
updatedAt: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* provider 元信息。
|
|
47
|
-
*
|
|
48
|
-
* 关键点(中文)
|
|
49
|
-
* - 仅保留同步读取所需的轻量字段。
|
|
50
|
-
* - 不包含解密后的 API Key,避免在只读展示链路中泄露敏感信息。
|
|
51
|
-
*/
|
|
52
|
-
export interface StoredProviderMeta {
|
|
53
|
-
/**
|
|
54
|
-
* provider 主键 ID。
|
|
55
|
-
*/
|
|
56
|
-
id: string;
|
|
57
|
-
/**
|
|
58
|
-
* provider 类型。
|
|
59
|
-
*/
|
|
60
|
-
type: LlmProviderType;
|
|
61
|
-
/**
|
|
62
|
-
* provider 基础地址(可选)。
|
|
63
|
-
*/
|
|
64
|
-
baseUrl?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 模型记录。
|
|
69
|
-
*/
|
|
70
|
-
export interface StoredModel {
|
|
71
|
-
/**
|
|
72
|
-
* 模型主键 ID(例如:`default`、`fast`、`quality`)。
|
|
73
|
-
*/
|
|
74
|
-
id: string;
|
|
75
|
-
/**
|
|
76
|
-
* 关联 provider ID。
|
|
77
|
-
*/
|
|
78
|
-
providerId: string;
|
|
79
|
-
/**
|
|
80
|
-
* 上游模型名称(例如 `gpt-4o-mini`)。
|
|
81
|
-
*/
|
|
82
|
-
name: string;
|
|
83
|
-
/**
|
|
84
|
-
* 采样温度(可选)。
|
|
85
|
-
*/
|
|
86
|
-
temperature?: number;
|
|
87
|
-
/**
|
|
88
|
-
* 最大输出 token(可选)。
|
|
89
|
-
*/
|
|
90
|
-
maxTokens?: number;
|
|
91
|
-
/**
|
|
92
|
-
* topP(可选)。
|
|
93
|
-
*/
|
|
94
|
-
topP?: number;
|
|
95
|
-
/**
|
|
96
|
-
* frequencyPenalty(可选)。
|
|
97
|
-
*/
|
|
98
|
-
frequencyPenalty?: number;
|
|
99
|
-
/**
|
|
100
|
-
* presencePenalty(可选)。
|
|
101
|
-
*/
|
|
102
|
-
presencePenalty?: number;
|
|
103
|
-
/**
|
|
104
|
-
* Anthropic 版本字段(可选)。
|
|
105
|
-
*/
|
|
106
|
-
anthropicVersion?: string;
|
|
107
|
-
/**
|
|
108
|
-
* 是否暂停该模型。
|
|
109
|
-
*
|
|
110
|
-
* 关键点(中文)
|
|
111
|
-
* - 暂停后禁止作为 `execution.modelId` 被运行时加载。
|
|
112
|
-
* - 用于模型维护窗口、成本管控或临时故障隔离。
|
|
113
|
-
*/
|
|
114
|
-
isPaused: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* 创建时间(ISO 字符串)。
|
|
117
|
-
*/
|
|
118
|
-
createdAt: string;
|
|
119
|
-
/**
|
|
120
|
-
* 更新时间(ISO 字符串)。
|
|
121
|
-
*/
|
|
122
|
-
updatedAt: string;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* provider 写入参数。
|
|
127
|
-
*/
|
|
128
|
-
export interface UpsertModelProviderInput {
|
|
129
|
-
/**
|
|
130
|
-
* provider ID。
|
|
131
|
-
*/
|
|
132
|
-
id: string;
|
|
133
|
-
/**
|
|
134
|
-
* provider 类型。
|
|
135
|
-
*/
|
|
136
|
-
type: LlmProviderType;
|
|
137
|
-
/**
|
|
138
|
-
* provider baseUrl(可选)。
|
|
139
|
-
*/
|
|
140
|
-
baseUrl?: string;
|
|
141
|
-
/**
|
|
142
|
-
* provider apiKey(可选)。
|
|
143
|
-
*/
|
|
144
|
-
apiKey?: string;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* model 写入参数。
|
|
149
|
-
*/
|
|
150
|
-
export interface UpsertModelInput {
|
|
151
|
-
/**
|
|
152
|
-
* 模型 ID。
|
|
153
|
-
*/
|
|
154
|
-
id: string;
|
|
155
|
-
/**
|
|
156
|
-
* provider ID。
|
|
157
|
-
*/
|
|
158
|
-
providerId: string;
|
|
159
|
-
/**
|
|
160
|
-
* 上游模型名称。
|
|
161
|
-
*/
|
|
162
|
-
name: string;
|
|
163
|
-
/**
|
|
164
|
-
* 采样温度(可选)。
|
|
165
|
-
*/
|
|
166
|
-
temperature?: number;
|
|
167
|
-
/**
|
|
168
|
-
* 最大输出 token(可选)。
|
|
169
|
-
*/
|
|
170
|
-
maxTokens?: number;
|
|
171
|
-
/**
|
|
172
|
-
* topP(可选)。
|
|
173
|
-
*/
|
|
174
|
-
topP?: number;
|
|
175
|
-
/**
|
|
176
|
-
* frequencyPenalty(可选)。
|
|
177
|
-
*/
|
|
178
|
-
frequencyPenalty?: number;
|
|
179
|
-
/**
|
|
180
|
-
* presencePenalty(可选)。
|
|
181
|
-
*/
|
|
182
|
-
presencePenalty?: number;
|
|
183
|
-
/**
|
|
184
|
-
* Anthropic 版本字段(可选)。
|
|
185
|
-
*/
|
|
186
|
-
anthropicVersion?: string;
|
|
187
|
-
/**
|
|
188
|
-
* 是否暂停该模型(可选)。
|
|
189
|
-
*/
|
|
190
|
-
isPaused?: boolean;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
14
|
/**
|
|
194
15
|
* 平台环境变量记录。
|
|
195
16
|
*/
|