@downcity/agent 1.1.51 → 1.1.62

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.
Files changed (125) hide show
  1. package/README.md +5 -4
  2. package/bin/agent/Agent.d.ts.map +1 -1
  3. package/bin/agent/Agent.js.map +1 -1
  4. package/bin/config/AgentInitializer.d.ts +1 -1
  5. package/bin/config/AgentInitializer.js +1 -1
  6. package/bin/config/DowncitySchema.js +1 -1
  7. package/bin/config/DowncitySchema.js.map +1 -1
  8. package/bin/config/ExecutionBinding.d.ts +1 -1
  9. package/bin/config/ExecutionBinding.js +1 -1
  10. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +1 -1
  11. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js +0 -4
  12. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +1 -1
  13. package/bin/executor/composer/system/default/InitPrompts.d.ts +1 -1
  14. package/bin/executor/composer/system/default/InitPrompts.js +1 -1
  15. package/bin/executor/composer/system/default/SystemDomain.js +1 -1
  16. package/bin/executor/composer/system/default/assets/core.prompt.d.ts +1 -1
  17. package/bin/executor/composer/system/default/assets/core.prompt.js +1 -1
  18. package/bin/executor/composer/system/default/assets/plugin.prompt.d.ts +1 -1
  19. package/bin/executor/composer/system/default/assets/plugin.prompt.js +1 -1
  20. package/bin/executor/composer/system/default/assets/task.prompt.d.ts +1 -1
  21. package/bin/executor/composer/system/default/assets/task.prompt.js +1 -1
  22. package/bin/executor/messages/ChatMessageMarkupTypes.d.ts +1 -1
  23. package/bin/executor/messages/ChatMessageMarkupTypes.js +1 -1
  24. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts +1 -2
  25. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +1 -1
  26. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js +17 -56
  27. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js.map +1 -1
  28. package/bin/executor/tools/shell/ShellToolBridge.js +1 -1
  29. package/bin/executor/tools/shell/ShellToolBridge.js.map +1 -1
  30. package/bin/executor/tools/shell/ShellToolDefinition.d.ts +2 -2
  31. package/bin/executor/tools/shell/ShellToolFormatting.d.ts +1 -1
  32. package/bin/executor/tools/shell/ShellToolFormatting.js +7 -7
  33. package/bin/executor/tools/shell/ShellToolFormatting.js.map +1 -1
  34. package/bin/executor/tools/shell/ShellToolSchemas.d.ts +7 -75
  35. package/bin/executor/tools/shell/ShellToolSchemas.d.ts.map +1 -1
  36. package/bin/executor/types/SessionHistoryMeta.d.ts +5 -24
  37. package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -1
  38. package/bin/executor/types/SessionHistoryMeta.js +1 -1
  39. package/bin/index.d.ts +3 -2
  40. package/bin/index.d.ts.map +1 -1
  41. package/bin/index.js +1 -0
  42. package/bin/index.js.map +1 -1
  43. package/bin/model/CityModelAdapter.d.ts +23 -0
  44. package/bin/model/CityModelAdapter.d.ts.map +1 -0
  45. package/bin/model/CityModelAdapter.js +338 -0
  46. package/bin/model/CityModelAdapter.js.map +1 -0
  47. package/bin/runtime/host/daemon/Paths.d.ts +1 -1
  48. package/bin/runtime/host/daemon/Paths.js +1 -1
  49. package/bin/runtime/host/daemon/ProjectSetup.js +2 -2
  50. package/bin/session/Session.d.ts +1 -0
  51. package/bin/session/Session.d.ts.map +1 -1
  52. package/bin/session/Session.js +32 -6
  53. package/bin/session/Session.js.map +1 -1
  54. package/bin/session/SessionTitle.d.ts +49 -0
  55. package/bin/session/SessionTitle.d.ts.map +1 -0
  56. package/bin/session/SessionTitle.js +130 -0
  57. package/bin/session/SessionTitle.js.map +1 -0
  58. package/bin/session/browse/Browse.d.ts +2 -1
  59. package/bin/session/browse/Browse.d.ts.map +1 -1
  60. package/bin/session/browse/Browse.js +18 -15
  61. package/bin/session/browse/Browse.js.map +1 -1
  62. package/bin/session/index.d.ts +2 -1
  63. package/bin/session/index.d.ts.map +1 -1
  64. package/bin/session/index.js +2 -1
  65. package/bin/session/index.js.map +1 -1
  66. package/bin/session/storage/Metadata.d.ts +4 -0
  67. package/bin/session/storage/Metadata.d.ts.map +1 -1
  68. package/bin/session/storage/Metadata.js +12 -25
  69. package/bin/session/storage/Metadata.js.map +1 -1
  70. package/bin/session/storage/Persistence.d.ts.map +1 -1
  71. package/bin/session/storage/Persistence.js +1 -4
  72. package/bin/session/storage/Persistence.js.map +1 -1
  73. package/bin/types/agent/AgentTypes.d.ts +9 -5
  74. package/bin/types/agent/AgentTypes.d.ts.map +1 -1
  75. package/bin/types/config/AgentProject.d.ts +1 -1
  76. package/bin/types/config/DowncityConfig.d.ts +3 -3
  77. package/bin/types/config/ExecutionBinding.d.ts +4 -4
  78. package/bin/types/config/ExecutionBinding.js +1 -1
  79. package/bin/types/runtime/auth/AuthPermission.js +2 -2
  80. package/bin/types/runtime/auth/AuthPermission.js.map +1 -1
  81. package/bin/types/runtime/host/Store.d.ts +3 -177
  82. package/bin/types/runtime/host/Store.d.ts.map +1 -1
  83. package/bin/types/runtime/host/Store.js +7 -0
  84. package/bin/types/runtime/host/Store.js.map +1 -1
  85. package/bin/types/runtime/http/InlineInstant.d.ts +1 -1
  86. package/bin/types/runtime/platform/Platform.d.ts +1 -1
  87. package/package.json +19 -18
  88. package/src/agent/Agent.ts +3 -2
  89. package/src/config/AgentInitializer.ts +1 -1
  90. package/src/config/DowncitySchema.ts +1 -1
  91. package/src/config/ExecutionBinding.ts +1 -1
  92. package/src/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.ts +0 -4
  93. package/src/executor/composer/system/default/InitPrompts.ts +1 -1
  94. package/src/executor/composer/system/default/SystemDomain.ts +1 -1
  95. package/src/executor/composer/system/default/assets/core.prompt.ts +1 -1
  96. package/src/executor/composer/system/default/assets/core.prompt.ts.txt +1 -1
  97. package/src/executor/composer/system/default/assets/plugin.prompt.ts +1 -1
  98. package/src/executor/composer/system/default/assets/plugin.prompt.ts.txt +18 -18
  99. package/src/executor/composer/system/default/assets/task.prompt.ts +1 -1
  100. package/src/executor/composer/system/default/assets/task.prompt.ts.txt +1 -1
  101. package/src/executor/messages/ChatMessageMarkupTypes.ts +1 -1
  102. package/src/executor/store/history/jsonl/JsonlSessionHistoryStore.ts +17 -57
  103. package/src/executor/tools/shell/ShellToolBridge.ts +1 -1
  104. package/src/executor/tools/shell/ShellToolFormatting.ts +7 -7
  105. package/src/executor/types/SessionHistoryMeta.ts +5 -25
  106. package/src/index.ts +5 -5
  107. package/src/model/CityModelAdapter.ts +384 -0
  108. package/src/runtime/host/daemon/Paths.ts +1 -1
  109. package/src/runtime/host/daemon/ProjectSetup.ts +2 -2
  110. package/src/session/Session.ts +40 -6
  111. package/src/session/SessionTitle.ts +192 -0
  112. package/src/session/browse/Browse.ts +22 -13
  113. package/src/session/index.ts +5 -0
  114. package/src/session/storage/Metadata.ts +14 -29
  115. package/src/session/storage/Persistence.ts +1 -4
  116. package/src/types/agent/AgentTypes.ts +10 -5
  117. package/src/types/config/AgentProject.ts +1 -1
  118. package/src/types/config/DowncityConfig.ts +3 -3
  119. package/src/types/config/ExecutionBinding.ts +4 -4
  120. package/src/types/runtime/auth/AuthPermission.ts +2 -2
  121. package/src/types/runtime/host/Store.ts +3 -182
  122. package/src/types/runtime/http/InlineInstant.ts +1 -1
  123. package/src/types/runtime/platform/Platform.ts +1 -1
  124. package/tsconfig.json +1 -0
  125. package/tsconfig.tsbuildinfo +1 -1
@@ -1,195 +1,16 @@
1
1
  /**
2
- * 模型存储(SQLite)类型定义。
2
+ * 平台宿主存储类型定义。
3
3
  *
4
4
  * 关键点(中文)
5
- * - 该类型用于平台控制面全局模型池(provider/model)的统一读写。
6
- * - agent 项目只通过 `execution.modelId` 绑定模型 ID,不直接持有 provider 细节。
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
  */
@@ -40,7 +40,7 @@ export interface PlatformInlineInstantRunInput {
40
40
  pageContext?: string;
41
41
 
42
42
  /**
43
- * `model` executor 对应的模型池 modelId。
43
+ * `model` executor 对应的 City AIService modelId。
44
44
  */
45
45
  modelId?: string;
46
46
 
@@ -402,7 +402,7 @@ export interface ManagedAgentRegistryV1 {
402
402
  }
403
403
 
404
404
  /**
405
- * `city agent list --running` 输出可复用的受管 agent 运行态视图。
405
+ * `town agent list --running` 输出可复用的受管 agent 运行态视图。
406
406
  */
407
407
  export interface ManagedAgentProcessView {
408
408
  /**
package/tsconfig.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "module": "NodeNext",
5
5
  "moduleResolution": "NodeNext",
6
6
  "lib": ["ES2022"],
7
+ "types": ["node"],
7
8
  "outDir": "./bin",
8
9
  "rootDir": "src",
9
10
  "paths": {