@downcity/agent 1.1.207 → 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.
Files changed (292) hide show
  1. package/bin/agent/local/Agent.d.ts +3 -3
  2. package/bin/agent/local/Agent.d.ts.map +1 -1
  3. package/bin/agent/local/Agent.js +0 -3
  4. package/bin/agent/local/Agent.js.map +1 -1
  5. package/bin/agent/local/AgentInstructions.d.ts +2 -1
  6. package/bin/agent/local/AgentInstructions.d.ts.map +1 -1
  7. package/bin/agent/local/AgentInstructions.js +10 -10
  8. package/bin/agent/local/AgentInstructions.js.map +1 -1
  9. package/bin/agent/local/services/AgentAssemblyService.d.ts +3 -8
  10. package/bin/agent/local/services/AgentAssemblyService.d.ts.map +1 -1
  11. package/bin/agent/local/services/AgentAssemblyService.js +0 -1
  12. package/bin/agent/local/services/AgentAssemblyService.js.map +1 -1
  13. package/bin/agent/local/services/AgentSessions.d.ts +5 -7
  14. package/bin/agent/local/services/AgentSessions.d.ts.map +1 -1
  15. package/bin/agent/local/services/AgentSessions.js +2 -3
  16. package/bin/agent/local/services/AgentSessions.js.map +1 -1
  17. package/bin/agent/remote/RemoteAgent.d.ts +3 -1
  18. package/bin/agent/remote/RemoteAgent.d.ts.map +1 -1
  19. package/bin/agent/remote/RemoteAgent.js.map +1 -1
  20. package/bin/agent/remote/RemoteSession.d.ts +10 -1
  21. package/bin/agent/remote/RemoteSession.d.ts.map +1 -1
  22. package/bin/agent/remote/RemoteSession.js +18 -0
  23. package/bin/agent/remote/RemoteSession.js.map +1 -1
  24. package/bin/agent/remote/RemoteTransport.d.ts +5 -1
  25. package/bin/agent/remote/RemoteTransport.d.ts.map +1 -1
  26. package/bin/agent/remote/transports/HttpRemoteAgentTransport.d.ts +4 -1
  27. package/bin/agent/remote/transports/HttpRemoteAgentTransport.d.ts.map +1 -1
  28. package/bin/agent/remote/transports/HttpRemoteAgentTransport.js +7 -0
  29. package/bin/agent/remote/transports/HttpRemoteAgentTransport.js.map +1 -1
  30. package/bin/agent/remote/transports/RpcRemoteAgentTransport.d.ts +4 -1
  31. package/bin/agent/remote/transports/RpcRemoteAgentTransport.d.ts.map +1 -1
  32. package/bin/agent/remote/transports/RpcRemoteAgentTransport.js +1 -0
  33. package/bin/agent/remote/transports/RpcRemoteAgentTransport.js.map +1 -1
  34. package/bin/executor/Executor.d.ts +0 -16
  35. package/bin/executor/Executor.d.ts.map +1 -1
  36. package/bin/executor/Executor.js +0 -16
  37. package/bin/executor/Executor.js.map +1 -1
  38. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts +1 -3
  39. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +1 -1
  40. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js +1 -5
  41. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +1 -1
  42. package/bin/executor/composer/history/SessionHistoryWriter.d.ts +0 -10
  43. package/bin/executor/composer/history/SessionHistoryWriter.d.ts.map +1 -1
  44. package/bin/executor/composer/history/SessionHistoryWriter.js +31 -61
  45. package/bin/executor/composer/history/SessionHistoryWriter.js.map +1 -1
  46. package/bin/executor/composer/system/default/StaticPromptCatalog.d.ts +4 -0
  47. package/bin/executor/composer/system/default/StaticPromptCatalog.d.ts.map +1 -1
  48. package/bin/executor/composer/system/default/StaticPromptCatalog.js +4 -0
  49. package/bin/executor/composer/system/default/StaticPromptCatalog.js.map +1 -1
  50. package/bin/executor/composer/system/default/SystemDomain.d.ts +1 -1
  51. package/bin/executor/composer/system/default/SystemDomain.d.ts.map +1 -1
  52. package/bin/executor/composer/system/default/SystemDomain.js +2 -7
  53. package/bin/executor/composer/system/default/SystemDomain.js.map +1 -1
  54. package/bin/executor/composer/system/default/SystemPromptAssets.d.ts +0 -4
  55. package/bin/executor/composer/system/default/SystemPromptAssets.d.ts.map +1 -1
  56. package/bin/executor/composer/system/default/SystemPromptAssets.js +0 -5
  57. package/bin/executor/composer/system/default/SystemPromptAssets.js.map +1 -1
  58. package/bin/executor/composer/system/default/assets/core.prompt.d.ts +1 -1
  59. package/bin/executor/composer/system/default/assets/core.prompt.d.ts.map +1 -1
  60. package/bin/executor/composer/system/default/assets/core.prompt.js +1 -1
  61. package/bin/executor/composer/system/default/assets/core.prompt.js.map +1 -1
  62. package/bin/executor/messages/AssistantFileResource.d.ts.map +1 -1
  63. package/bin/executor/messages/AssistantFileResource.js +58 -15
  64. package/bin/executor/messages/AssistantFileResource.js.map +1 -1
  65. package/bin/executor/services/ExecutorInflightService.d.ts +0 -5
  66. package/bin/executor/services/ExecutorInflightService.d.ts.map +1 -1
  67. package/bin/executor/services/ExecutorInflightService.js +0 -6
  68. package/bin/executor/services/ExecutorInflightService.js.map +1 -1
  69. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts +4 -0
  70. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +1 -1
  71. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js +115 -3
  72. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js.map +1 -1
  73. package/bin/executor/types/SessionHistoryMeta.d.ts +6 -0
  74. package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -1
  75. package/bin/index.d.ts +38 -6
  76. package/bin/index.d.ts.map +1 -1
  77. package/bin/index.js +14 -1
  78. package/bin/index.js.map +1 -1
  79. package/bin/plugin/core/ActionScheduleExecutor.js +1 -1
  80. package/bin/plugin/core/ActionScheduleExecutor.js.map +1 -1
  81. package/bin/plugin/core/BasePlugin.d.ts +7 -9
  82. package/bin/plugin/core/BasePlugin.d.ts.map +1 -1
  83. package/bin/plugin/core/BasePlugin.js +1 -14
  84. package/bin/plugin/core/BasePlugin.js.map +1 -1
  85. package/bin/plugin/core/HookRegistry.d.ts +1 -1
  86. package/bin/plugin/core/HookRegistry.d.ts.map +1 -1
  87. package/bin/plugin/core/PluginActionFactory.d.ts +1 -5
  88. package/bin/plugin/core/PluginActionFactory.d.ts.map +1 -1
  89. package/bin/plugin/core/PluginActionFactory.js +0 -3
  90. package/bin/plugin/core/PluginActionFactory.js.map +1 -1
  91. package/bin/plugin/core/PluginActionRunner.d.ts +6 -4
  92. package/bin/plugin/core/PluginActionRunner.d.ts.map +1 -1
  93. package/bin/plugin/core/PluginActionRunner.js +2 -2
  94. package/bin/plugin/core/PluginActionRunner.js.map +1 -1
  95. package/bin/plugin/core/PluginCatalog.d.ts +2 -1
  96. package/bin/plugin/core/PluginCatalog.d.ts.map +1 -1
  97. package/bin/plugin/core/PluginCatalog.js.map +1 -1
  98. package/bin/plugin/core/PluginCommand.d.ts +1 -1
  99. package/bin/plugin/core/PluginCommand.d.ts.map +1 -1
  100. package/bin/plugin/core/PluginCommand.js.map +1 -1
  101. package/bin/plugin/core/PluginHttpRoutes.d.ts +1 -1
  102. package/bin/plugin/core/PluginHttpRoutes.d.ts.map +1 -1
  103. package/bin/plugin/core/PluginLocalExecution.d.ts +4 -1
  104. package/bin/plugin/core/PluginLocalExecution.d.ts.map +1 -1
  105. package/bin/plugin/core/PluginLocalExecution.js +0 -1
  106. package/bin/plugin/core/PluginLocalExecution.js.map +1 -1
  107. package/bin/plugin/core/PluginRegistry.d.ts +4 -2
  108. package/bin/plugin/core/PluginRegistry.d.ts.map +1 -1
  109. package/bin/plugin/core/PluginRegistry.js +7 -6
  110. package/bin/plugin/core/PluginRegistry.js.map +1 -1
  111. package/bin/plugin/core/PluginStateController.d.ts +7 -27
  112. package/bin/plugin/core/PluginStateController.d.ts.map +1 -1
  113. package/bin/plugin/core/PluginStateController.js +5 -39
  114. package/bin/plugin/core/PluginStateController.js.map +1 -1
  115. package/bin/plugin/types/PluginApi.d.ts +3 -79
  116. package/bin/plugin/types/PluginApi.d.ts.map +1 -1
  117. package/bin/rpc/Client.d.ts +11 -6
  118. package/bin/rpc/Client.d.ts.map +1 -1
  119. package/bin/rpc/Client.js +2 -0
  120. package/bin/rpc/Client.js.map +1 -1
  121. package/bin/session/Session.d.ts +2 -5
  122. package/bin/session/Session.d.ts.map +1 -1
  123. package/bin/session/Session.js +3 -16
  124. package/bin/session/Session.js.map +1 -1
  125. package/bin/session/SessionSystemBuilder.d.ts +1 -1
  126. package/bin/session/SessionSystemBuilder.d.ts.map +1 -1
  127. package/bin/session/browse/Browse.d.ts +4 -6
  128. package/bin/session/browse/Browse.d.ts.map +1 -1
  129. package/bin/session/browse/Browse.js +71 -71
  130. package/bin/session/browse/Browse.js.map +1 -1
  131. package/bin/session/preview/SessionMessagePreview.d.ts +13 -0
  132. package/bin/session/preview/SessionMessagePreview.d.ts.map +1 -0
  133. package/bin/session/preview/SessionMessagePreview.js +61 -0
  134. package/bin/session/preview/SessionMessagePreview.js.map +1 -0
  135. package/bin/session/services/SessionStateService.d.ts +1 -1
  136. package/bin/session/services/SessionStateService.d.ts.map +1 -1
  137. package/bin/session/services/SessionStateService.js +2 -2
  138. package/bin/session/services/SessionStateService.js.map +1 -1
  139. package/bin/session/services/SessionViewService.d.ts +2 -1
  140. package/bin/session/services/SessionViewService.d.ts.map +1 -1
  141. package/bin/session/services/SessionViewService.js +4 -1
  142. package/bin/session/services/SessionViewService.js.map +1 -1
  143. package/bin/session/storage/Metadata.d.ts.map +1 -1
  144. package/bin/session/storage/Metadata.js +23 -0
  145. package/bin/session/storage/Metadata.js.map +1 -1
  146. package/bin/session/storage/Persistence.d.ts +1 -1
  147. package/bin/session/storage/Persistence.d.ts.map +1 -1
  148. package/bin/session/storage/RuntimeSessionPort.d.ts +0 -12
  149. package/bin/session/storage/RuntimeSessionPort.d.ts.map +1 -1
  150. package/bin/session/storage/RuntimeSessionPort.js +0 -8
  151. package/bin/session/storage/RuntimeSessionPort.js.map +1 -1
  152. package/bin/types/plugin/PluginAction.d.ts +0 -10
  153. package/bin/types/plugin/PluginAction.d.ts.map +1 -1
  154. package/bin/types/plugin/PluginCommand.d.ts +2 -3
  155. package/bin/types/plugin/PluginCommand.d.ts.map +1 -1
  156. package/bin/types/plugin/PluginControl.d.ts +74 -0
  157. package/bin/types/plugin/PluginControl.d.ts.map +1 -0
  158. package/bin/types/plugin/PluginControl.js +9 -0
  159. package/bin/types/plugin/PluginControl.js.map +1 -0
  160. package/bin/types/plugin/PluginDefinition.d.ts +1 -1
  161. package/bin/types/plugin/PluginDefinition.d.ts.map +1 -1
  162. package/bin/types/plugin/PluginRuntime.d.ts +1 -3
  163. package/bin/types/plugin/PluginRuntime.d.ts.map +1 -1
  164. package/bin/types/plugin/PluginState.d.ts +3 -16
  165. package/bin/types/plugin/PluginState.d.ts.map +1 -1
  166. package/bin/types/rpc/RpcProtocol.d.ts +3 -3
  167. package/bin/types/rpc/RpcProtocol.d.ts.map +1 -1
  168. package/bin/types/runtime/agent/AgentContext.d.ts +1 -9
  169. package/bin/types/runtime/agent/AgentContext.d.ts.map +1 -1
  170. package/bin/types/runtime/agent/AgentContext.js.map +1 -1
  171. package/bin/types/session/SessionLocalState.d.ts +1 -1
  172. package/bin/types/session/SessionLocalState.d.ts.map +1 -1
  173. package/package.json +4 -7
  174. package/scripts/agent-ready.test.mjs +38 -0
  175. package/scripts/assistant-file-resource.test.mjs +39 -0
  176. package/scripts/city-model-tool-loop.test.mjs +18 -30
  177. package/scripts/image-plugin-job.test.mjs +13 -13
  178. package/scripts/plugin-tool-bridge.test.mjs +2 -3
  179. package/scripts/remote-session-reconnect.test.mjs +67 -0
  180. package/scripts/session-history-writer-error.test.mjs +57 -0
  181. package/scripts/session-list-title.test.mjs +114 -23
  182. package/scripts/session-system-blocks.test.mjs +73 -0
  183. package/src/agent/local/Agent.ts +4 -10
  184. package/src/agent/local/AgentInstructions.ts +11 -11
  185. package/src/agent/local/services/AgentAssemblyService.ts +3 -9
  186. package/src/agent/local/services/AgentSessions.ts +8 -15
  187. package/src/agent/remote/RemoteAgent.ts +5 -4
  188. package/src/agent/remote/RemoteSession.ts +21 -2
  189. package/src/agent/remote/RemoteTransport.ts +6 -2
  190. package/src/agent/remote/transports/HttpRemoteAgentTransport.ts +13 -3
  191. package/src/agent/remote/transports/RpcRemoteAgentTransport.ts +6 -2
  192. package/src/executor/Executor.ts +0 -23
  193. package/src/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.ts +2 -8
  194. package/src/executor/composer/history/SessionHistoryWriter.ts +33 -64
  195. package/src/executor/composer/system/default/StaticPromptCatalog.ts +4 -0
  196. package/src/executor/composer/system/default/SystemDomain.ts +1 -9
  197. package/src/executor/composer/system/default/SystemPromptAssets.ts +0 -6
  198. package/src/executor/composer/system/default/assets/core.prompt.ts +1 -1
  199. package/src/executor/composer/system/default/assets/core.prompt.ts.txt +37 -15
  200. package/src/executor/messages/AssistantFileResource.ts +61 -17
  201. package/src/executor/services/ExecutorInflightService.ts +0 -10
  202. package/src/executor/store/history/jsonl/JsonlSessionHistoryStore.ts +130 -4
  203. package/src/executor/types/SessionHistoryMeta.ts +6 -0
  204. package/src/index.ts +100 -29
  205. package/src/plugin/core/ActionScheduleExecutor.ts +1 -1
  206. package/src/plugin/core/BasePlugin.ts +8 -22
  207. package/src/plugin/core/HookRegistry.ts +1 -1
  208. package/src/plugin/core/PluginActionFactory.ts +1 -8
  209. package/src/plugin/core/PluginActionRunner.ts +8 -11
  210. package/src/plugin/core/PluginCatalog.ts +2 -5
  211. package/src/plugin/core/PluginCommand.ts +2 -1
  212. package/src/plugin/core/PluginHttpRoutes.ts +1 -1
  213. package/src/plugin/core/PluginLocalExecution.ts +4 -7
  214. package/src/plugin/core/PluginRegistry.ts +10 -10
  215. package/src/plugin/core/PluginStateController.ts +12 -60
  216. package/src/plugin/types/PluginApi.ts +6 -81
  217. package/src/rpc/Client.ts +22 -16
  218. package/src/session/Session.ts +5 -21
  219. package/src/session/SessionSystemBuilder.ts +1 -1
  220. package/src/session/browse/Browse.ts +103 -84
  221. package/src/session/preview/SessionMessagePreview.ts +75 -0
  222. package/src/session/services/SessionStateService.ts +3 -4
  223. package/src/session/services/SessionViewService.ts +6 -6
  224. package/src/session/storage/Metadata.ts +26 -0
  225. package/src/session/storage/Persistence.ts +1 -1
  226. package/src/session/storage/RuntimeSessionPort.ts +0 -20
  227. package/src/types/plugin/PluginAction.ts +0 -10
  228. package/src/types/plugin/PluginCommand.ts +2 -3
  229. package/src/types/plugin/PluginControl.ts +80 -0
  230. package/src/types/plugin/PluginDefinition.ts +1 -1
  231. package/src/types/plugin/PluginRuntime.ts +1 -3
  232. package/src/types/plugin/PluginState.ts +3 -20
  233. package/src/types/rpc/RpcProtocol.ts +4 -4
  234. package/src/types/runtime/agent/AgentContext.ts +1 -9
  235. package/src/types/session/SessionLocalState.ts +1 -1
  236. package/tsconfig.tsbuildinfo +1 -1
  237. package/bin/config/DowncitySchema.d.ts +0 -20
  238. package/bin/config/DowncitySchema.d.ts.map +0 -1
  239. package/bin/config/DowncitySchema.js +0 -160
  240. package/bin/config/DowncitySchema.js.map +0 -1
  241. package/bin/executor/composer/system/default/assets/plugin.prompt.d.ts +0 -7
  242. package/bin/executor/composer/system/default/assets/plugin.prompt.d.ts.map +0 -1
  243. package/bin/executor/composer/system/default/assets/plugin.prompt.js +0 -8
  244. package/bin/executor/composer/system/default/assets/plugin.prompt.js.map +0 -1
  245. package/bin/plugin/core/Activation.d.ts +0 -18
  246. package/bin/plugin/core/Activation.d.ts.map +0 -1
  247. package/bin/plugin/core/Activation.js +0 -21
  248. package/bin/plugin/core/Activation.js.map +0 -1
  249. package/bin/plugin/core/Manager.d.ts +0 -7
  250. package/bin/plugin/core/Manager.d.ts.map +0 -1
  251. package/bin/plugin/core/Manager.js +0 -6
  252. package/bin/plugin/core/Manager.js.map +0 -1
  253. package/bin/plugin/types/Plugin.d.ts +0 -15
  254. package/bin/plugin/types/Plugin.d.ts.map +0 -1
  255. package/bin/plugin/types/Plugin.js +0 -9
  256. package/bin/plugin/types/Plugin.js.map +0 -1
  257. package/bin/plugin/types/PluginLifecycle.d.ts +0 -34
  258. package/bin/plugin/types/PluginLifecycle.d.ts.map +0 -1
  259. package/bin/plugin/types/PluginLifecycle.js +0 -9
  260. package/bin/plugin/types/PluginLifecycle.js.map +0 -1
  261. package/bin/plugin/types/PluginState.d.ts +0 -5
  262. package/bin/plugin/types/PluginState.d.ts.map +0 -1
  263. package/bin/plugin/types/PluginState.js +0 -5
  264. package/bin/plugin/types/PluginState.js.map +0 -1
  265. package/bin/plugin/types/Plugins.d.ts +0 -61
  266. package/bin/plugin/types/Plugins.d.ts.map +0 -1
  267. package/bin/plugin/types/Plugins.js +0 -5
  268. package/bin/plugin/types/Plugins.js.map +0 -1
  269. package/bin/session/index.d.ts +0 -15
  270. package/bin/session/index.d.ts.map +0 -1
  271. package/bin/session/index.js +0 -15
  272. package/bin/session/index.js.map +0 -1
  273. package/bin/types/agent/AgentTypes.d.ts +0 -18
  274. package/bin/types/agent/AgentTypes.d.ts.map +0 -1
  275. package/bin/types/agent/AgentTypes.js +0 -10
  276. package/bin/types/agent/AgentTypes.js.map +0 -1
  277. package/bin/utils/logger/Format.d.ts +0 -11
  278. package/bin/utils/logger/Format.d.ts.map +0 -1
  279. package/bin/utils/logger/Format.js +0 -10
  280. package/bin/utils/logger/Format.js.map +0 -1
  281. package/src/config/DowncitySchema.ts +0 -175
  282. package/src/executor/composer/system/default/assets/plugin.prompt.ts +0 -9
  283. package/src/executor/composer/system/default/assets/plugin.prompt.ts.txt +0 -20
  284. package/src/plugin/core/Activation.ts +0 -26
  285. package/src/plugin/core/Manager.ts +0 -17
  286. package/src/plugin/types/Plugin.ts +0 -63
  287. package/src/plugin/types/PluginLifecycle.ts +0 -35
  288. package/src/plugin/types/PluginState.ts +0 -12
  289. package/src/plugin/types/Plugins.ts +0 -67
  290. package/src/session/index.ts +0 -57
  291. package/src/types/agent/AgentTypes.ts +0 -58
  292. 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,9 +0,0 @@
1
- /**
2
- * 自动生成文件,请勿手改。
3
- * 源文件:由同路径 `*.ts.txt` 生成。
4
- */
5
-
6
- // Source: src/executor/composer/system/default/assets/plugin.prompt.ts.txt
7
- const TEXT_MODULE_CONTENT = "# Plugin State\n\nYou are working in a plugin-based execution environment.\n\n## Plugin Call Rules\n\n- When you need plugin capabilities, prefer invoking the plugin action through the available tools.\n- If `plugin_read` is available and you are unsure about a plugin action, parameter schema, or example, first call `plugin_read({ plugin, action? })` to read metadata.\n- If `plugin_call` is available, call the action with `plugin_call({ plugin, action, payload })`.\n- `plugin_call.plugin` is the plugin name, for example `skill`, `task`, `memory`, or `contact`.\n- `plugin_call.action` is the action name, for example `list`, `lookup`, `create`, or `run`.\n- `plugin_call.payload` is a structured JSON payload. Pass `{}` when there are no parameters. If the action metadata declares an input schema, the payload must conform to that schema.\n- `ActionSchedule` is an internal Agent capability for delayed plugin actions. It is not a standalone plugin.\n\n## Available Plugin Overview\n\n- Current built-in managed plugins: `shell` / `chat` / `task` / `memory` / `contact`.\n- Current built-in local plugins: `auth` / `skill`.\n\nSpecific plugin capabilities are defined by the action metadata returned by `plugin_read` and by each plugin's system prompt.\n";
8
-
9
- export default TEXT_MODULE_CONTENT;
@@ -1,20 +0,0 @@
1
- # Plugin State
2
-
3
- You are working in a plugin-based execution environment.
4
-
5
- ## Plugin Call Rules
6
-
7
- - When you need plugin capabilities, prefer invoking the plugin action through the available tools.
8
- - If `plugin_read` is available and you are unsure about a plugin action, parameter schema, or example, first call `plugin_read({ plugin, action? })` to read metadata.
9
- - If `plugin_call` is available, call the action with `plugin_call({ plugin, action, payload })`.
10
- - `plugin_call.plugin` is the plugin name, for example `skill`, `task`, `memory`, or `contact`.
11
- - `plugin_call.action` is the action name, for example `list`, `lookup`, `create`, or `run`.
12
- - `plugin_call.payload` is a structured JSON payload. Pass `{}` when there are no parameters. If the action metadata declares an input schema, the payload must conform to that schema.
13
- - `ActionSchedule` is an internal Agent capability for delayed plugin actions. It is not a standalone plugin.
14
-
15
- ## Available Plugin Overview
16
-
17
- - Current built-in managed plugins: `shell` / `chat` / `task` / `memory` / `contact`.
18
- - Current built-in local plugins: `auth` / `skill`.
19
-
20
- Specific plugin capabilities are defined by the action metadata returned by `plugin_read` and by each plugin's system prompt.
@@ -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,12 +0,0 @@
1
- /**
2
- * PluginState:plugin 运行状态相关共享类型导出。
3
- */
4
-
5
- export type {
6
- PluginState,
7
- PluginStateControlAction,
8
- PluginStateControlResult,
9
- PluginRuntimeRecord,
10
- PluginSnapshot,
11
- PluginStateSnapshot,
12
- } from "@/types/plugin/PluginState.js";
@@ -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
- };
@@ -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>;