downcity 1.1.364 → 1.1.394

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 (709) hide show
  1. package/README.md +19 -4
  2. package/bin/city/agent/AgentChat.d.ts.map +1 -1
  3. package/bin/city/agent/AgentChat.js +35 -15
  4. package/bin/city/agent/AgentChat.js.map +1 -1
  5. package/bin/city/agent/AgentChatHelpers.d.ts +11 -11
  6. package/bin/city/agent/AgentChatHelpers.d.ts.map +1 -1
  7. package/bin/city/agent/AgentChatHelpers.js +74 -74
  8. package/bin/city/agent/AgentChatHelpers.js.map +1 -1
  9. package/bin/city/agent/AgentChatInteractiveRenderer.js +2 -2
  10. package/bin/city/agent/AgentChatInteractiveRenderer.js.map +1 -1
  11. package/bin/city/agent/AgentChatRemote.d.ts +3 -3
  12. package/bin/city/agent/AgentChatRemote.d.ts.map +1 -1
  13. package/bin/city/agent/AgentChatRemote.js +16 -16
  14. package/bin/city/agent/AgentChatRemote.js.map +1 -1
  15. package/bin/city/agent/AgentChatTui.d.ts +16 -8
  16. package/bin/city/agent/AgentChatTui.d.ts.map +1 -1
  17. package/bin/city/agent/AgentChatTui.js +5 -2
  18. package/bin/city/agent/AgentChatTui.js.map +1 -1
  19. package/bin/city/agent/AgentChatTypes.d.ts +17 -17
  20. package/bin/city/agent/AgentChatTypes.d.ts.map +1 -1
  21. package/bin/city/agent/AgentExecutionModelRecovery.d.ts +2 -2
  22. package/bin/city/agent/AgentExecutionModelRecovery.d.ts.map +1 -1
  23. package/bin/city/agent/AgentExecutionModelRecovery.js +14 -15
  24. package/bin/city/agent/AgentExecutionModelRecovery.js.map +1 -1
  25. package/bin/city/agent/AgentHttpGateway.d.ts +9 -4
  26. package/bin/city/agent/AgentHttpGateway.d.ts.map +1 -1
  27. package/bin/city/agent/AgentHttpGateway.js +33 -30
  28. package/bin/city/agent/AgentHttpGateway.js.map +1 -1
  29. package/bin/city/agent/AgentManager.js +2 -2
  30. package/bin/city/agent/AgentManager.js.map +1 -1
  31. package/bin/city/agent/AgentManagerHelpers.d.ts +3 -30
  32. package/bin/city/agent/AgentManagerHelpers.d.ts.map +1 -1
  33. package/bin/city/agent/AgentManagerHelpers.js +78 -335
  34. package/bin/city/agent/AgentManagerHelpers.js.map +1 -1
  35. package/bin/city/agent/AgentManagerTypes.d.ts +4 -5
  36. package/bin/city/agent/AgentManagerTypes.d.ts.map +1 -1
  37. package/bin/city/agent/AgentModel.d.ts +1 -1
  38. package/bin/city/agent/AgentModel.d.ts.map +1 -1
  39. package/bin/city/agent/AgentModel.js +28 -26
  40. package/bin/city/agent/AgentModel.js.map +1 -1
  41. package/bin/city/agent/AgentSelection.d.ts +27 -35
  42. package/bin/city/agent/AgentSelection.d.ts.map +1 -1
  43. package/bin/city/agent/AgentSelection.js +91 -186
  44. package/bin/city/agent/AgentSelection.js.map +1 -1
  45. package/bin/city/agent/Init.d.ts +12 -4
  46. package/bin/city/agent/Init.d.ts.map +1 -1
  47. package/bin/city/agent/Init.js +70 -132
  48. package/bin/city/agent/Init.js.map +1 -1
  49. package/bin/city/agent/ManagedAgentRuntime.d.ts +28 -0
  50. package/bin/city/agent/ManagedAgentRuntime.d.ts.map +1 -0
  51. package/bin/city/agent/ManagedAgentRuntime.js +151 -0
  52. package/bin/city/agent/ManagedAgentRuntime.js.map +1 -0
  53. package/bin/city/agent/Restart.d.ts +2 -1
  54. package/bin/city/agent/Restart.d.ts.map +1 -1
  55. package/bin/city/agent/Restart.js +9 -10
  56. package/bin/city/agent/Restart.js.map +1 -1
  57. package/bin/city/agent/Run.d.ts +5 -19
  58. package/bin/city/agent/Run.d.ts.map +1 -1
  59. package/bin/city/agent/Run.js +18 -128
  60. package/bin/city/agent/Run.js.map +1 -1
  61. package/bin/city/agent/Start.d.ts +2 -1
  62. package/bin/city/agent/Start.d.ts.map +1 -1
  63. package/bin/city/agent/Start.js +9 -10
  64. package/bin/city/agent/Start.js.map +1 -1
  65. package/bin/city/agent/Status.d.ts +2 -1
  66. package/bin/city/agent/Status.d.ts.map +1 -1
  67. package/bin/city/agent/Status.js +16 -17
  68. package/bin/city/agent/Status.js.map +1 -1
  69. package/bin/city/agent/Stop.d.ts +2 -1
  70. package/bin/city/agent/Stop.d.ts.map +1 -1
  71. package/bin/city/agent/Stop.js +5 -8
  72. package/bin/city/agent/Stop.js.map +1 -1
  73. package/bin/city/agent/control/ExecuteBySession.d.ts +3 -4
  74. package/bin/city/agent/control/ExecuteBySession.d.ts.map +1 -1
  75. package/bin/city/agent/control/ExecuteBySession.js +6 -7
  76. package/bin/city/agent/control/ExecuteBySession.js.map +1 -1
  77. package/bin/city/agent/control/ExecuteInput.d.ts +2 -2
  78. package/bin/city/agent/control/ExecuteInput.d.ts.map +1 -1
  79. package/bin/city/agent/control/ExecuteInput.js +12 -12
  80. package/bin/city/agent/control/ExecuteInput.js.map +1 -1
  81. package/bin/city/agent/control/Helpers.d.ts +1 -1
  82. package/bin/city/agent/control/Helpers.d.ts.map +1 -1
  83. package/bin/city/agent/control/Helpers.js +1 -1
  84. package/bin/city/agent/control/Helpers.js.map +1 -1
  85. package/bin/city/agent/control/MessageTimeline.js +12 -12
  86. package/bin/city/agent/control/MessageTimeline.js.map +1 -1
  87. package/bin/city/agent/control/SessionSummary.d.ts +12 -0
  88. package/bin/city/agent/control/SessionSummary.d.ts.map +1 -0
  89. package/bin/city/agent/control/SessionSummary.js +20 -0
  90. package/bin/city/agent/control/SessionSummary.js.map +1 -0
  91. package/bin/city/agent/control/TaskStore.d.ts +3 -3
  92. package/bin/city/agent/control/TaskStore.d.ts.map +1 -1
  93. package/bin/city/agent/control/TaskStore.js +8 -8
  94. package/bin/city/agent/control/TaskStore.js.map +1 -1
  95. package/bin/city/agent/control/types/ControlSessionExecute.d.ts +1 -1
  96. package/bin/city/agent/control/types/ControlSessionExecute.js +1 -1
  97. package/bin/city/agent/control/types/ControlViewData.d.ts +9 -9
  98. package/bin/city/agent/control/types/ControlViewData.d.ts.map +1 -1
  99. package/bin/city/agent/create/AgentCreateWorkspace.d.ts +11 -0
  100. package/bin/city/agent/create/AgentCreateWorkspace.d.ts.map +1 -0
  101. package/bin/city/agent/create/AgentCreateWorkspace.js +66 -0
  102. package/bin/city/agent/create/AgentCreateWorkspace.js.map +1 -0
  103. package/bin/city/agent/create/NativeDirectoryPicker.d.ts +9 -0
  104. package/bin/city/agent/create/NativeDirectoryPicker.d.ts.map +1 -0
  105. package/bin/city/agent/create/NativeDirectoryPicker.js +140 -0
  106. package/bin/city/agent/create/NativeDirectoryPicker.js.map +1 -0
  107. package/bin/city/agent/http/control/ControlApiRoutes.js +1 -1
  108. package/bin/city/agent/http/control/ControlApiRoutes.js.map +1 -1
  109. package/bin/city/agent/http/control/ControlChatAccessRoutes.d.ts +2 -2
  110. package/bin/city/agent/http/control/ControlChatAccessRoutes.d.ts.map +1 -1
  111. package/bin/city/agent/http/control/ControlChatAccessRoutes.js +9 -9
  112. package/bin/city/agent/http/control/ControlChatAccessRoutes.js.map +1 -1
  113. package/bin/city/agent/http/control/ControlRouter.d.ts +2 -2
  114. package/bin/city/agent/http/control/ControlRouter.d.ts.map +1 -1
  115. package/bin/city/agent/http/control/ControlRouter.js +1 -1
  116. package/bin/city/agent/http/control/ControlRouter.js.map +1 -1
  117. package/bin/city/agent/http/control/OverviewRoutes.d.ts.map +1 -1
  118. package/bin/city/agent/http/control/OverviewRoutes.js +8 -17
  119. package/bin/city/agent/http/control/OverviewRoutes.js.map +1 -1
  120. package/bin/city/agent/http/control/SessionRoutes.d.ts +1 -1
  121. package/bin/city/agent/http/control/SessionRoutes.d.ts.map +1 -1
  122. package/bin/city/agent/http/control/SessionRoutes.js +65 -163
  123. package/bin/city/agent/http/control/SessionRoutes.js.map +1 -1
  124. package/bin/city/agent/http/control/TaskRoutes.d.ts.map +1 -1
  125. package/bin/city/agent/http/control/TaskRoutes.js +25 -29
  126. package/bin/city/agent/http/control/TaskRoutes.js.map +1 -1
  127. package/bin/city/agent/http/control/types/ControlRoutes.d.ts +2 -2
  128. package/bin/city/agent/http/control/types/ControlRoutes.d.ts.map +1 -1
  129. package/bin/city/agent/http/execute/execute.d.ts +2 -2
  130. package/bin/city/agent/http/execute/execute.d.ts.map +1 -1
  131. package/bin/city/agent/http/execute/execute.js +9 -9
  132. package/bin/city/agent/http/execute/execute.js.map +1 -1
  133. package/bin/city/agent/http/plugins/plugins.d.ts +3 -3
  134. package/bin/city/agent/http/plugins/plugins.d.ts.map +1 -1
  135. package/bin/city/agent/http/plugins/plugins.js +19 -68
  136. package/bin/city/agent/http/plugins/plugins.js.map +1 -1
  137. package/bin/city/agent/http/static/static.d.ts +2 -2
  138. package/bin/city/agent/http/static/static.d.ts.map +1 -1
  139. package/bin/city/agent/http/static/static.js +4 -4
  140. package/bin/city/agent/http/static/static.js.map +1 -1
  141. package/bin/city/agent/runtime/ExecutionBinding.d.ts +31 -0
  142. package/bin/city/agent/runtime/ExecutionBinding.d.ts.map +1 -0
  143. package/bin/city/agent/runtime/ExecutionBinding.js +46 -0
  144. package/bin/city/agent/runtime/ExecutionBinding.js.map +1 -0
  145. package/bin/city/agent/setup/AgentInitializer.d.ts +31 -0
  146. package/bin/city/agent/setup/AgentInitializer.d.ts.map +1 -0
  147. package/bin/city/agent/setup/AgentInitializer.js +109 -0
  148. package/bin/city/agent/setup/AgentInitializer.js.map +1 -0
  149. package/bin/city/agent/setup/EnvFile.d.ts +31 -0
  150. package/bin/city/agent/setup/EnvFile.d.ts.map +1 -0
  151. package/bin/city/agent/setup/EnvFile.js +92 -0
  152. package/bin/city/agent/setup/EnvFile.js.map +1 -0
  153. package/bin/city/agent/setup/Gitignore.d.ts +21 -0
  154. package/bin/city/agent/setup/Gitignore.d.ts.map +1 -0
  155. package/bin/city/agent/setup/Gitignore.js +46 -0
  156. package/bin/city/agent/setup/Gitignore.js.map +1 -0
  157. package/bin/city/agent/tui/AgentChatTuiCoordinator.d.ts +42 -48
  158. package/bin/city/agent/tui/AgentChatTuiCoordinator.d.ts.map +1 -1
  159. package/bin/city/agent/tui/AgentChatTuiCoordinator.js +208 -116
  160. package/bin/city/agent/tui/AgentChatTuiCoordinator.js.map +1 -1
  161. package/bin/city/agent/tui/PiTuiChatRenderer.d.ts +3 -3
  162. package/bin/city/agent/tui/PiTuiChatRenderer.d.ts.map +1 -1
  163. package/bin/city/agent/tui/PiTuiChatRenderer.js +10 -20
  164. package/bin/city/agent/tui/PiTuiChatRenderer.js.map +1 -1
  165. package/bin/city/agent/tui/commands/dispatch.js +3 -0
  166. package/bin/city/agent/tui/commands/dispatch.js.map +1 -1
  167. package/bin/city/agent/tui/commands/host.d.ts +2 -0
  168. package/bin/city/agent/tui/commands/host.d.ts.map +1 -1
  169. package/bin/city/agent/tui/commands/registry.d.ts.map +1 -1
  170. package/bin/city/agent/tui/commands/registry.js +6 -0
  171. package/bin/city/agent/tui/commands/registry.js.map +1 -1
  172. package/bin/city/agent/tui/components/AgentHeader.d.ts.map +1 -1
  173. package/bin/city/agent/tui/components/AgentHeader.js +11 -1
  174. package/bin/city/agent/tui/components/AgentHeader.js.map +1 -1
  175. package/bin/city/agent/tui/components/AssistantMessage.d.ts +17 -37
  176. package/bin/city/agent/tui/components/AssistantMessage.d.ts.map +1 -1
  177. package/bin/city/agent/tui/components/AssistantMessage.js +86 -74
  178. package/bin/city/agent/tui/components/AssistantMessage.js.map +1 -1
  179. package/bin/city/agent/tui/components/ChatFooter.js +3 -3
  180. package/bin/city/agent/tui/components/ChatFooter.js.map +1 -1
  181. package/bin/city/agent/tui/components/MessageList.d.ts +41 -105
  182. package/bin/city/agent/tui/components/MessageList.d.ts.map +1 -1
  183. package/bin/city/agent/tui/components/MessageList.js +142 -184
  184. package/bin/city/agent/tui/components/MessageList.js.map +1 -1
  185. package/bin/city/agent/tui/components/ToolActivity.d.ts +25 -0
  186. package/bin/city/agent/tui/components/ToolActivity.d.ts.map +1 -0
  187. package/bin/city/agent/tui/components/ToolActivity.js +76 -0
  188. package/bin/city/agent/tui/components/ToolActivity.js.map +1 -0
  189. package/bin/city/agent/tui/components/index.d.ts +1 -1
  190. package/bin/city/agent/tui/components/index.d.ts.map +1 -1
  191. package/bin/city/agent/tui/components/index.js +1 -1
  192. package/bin/city/agent/tui/components/index.js.map +1 -1
  193. package/bin/city/agent/tui/controllers/StreamingUI.d.ts +22 -70
  194. package/bin/city/agent/tui/controllers/StreamingUI.d.ts.map +1 -1
  195. package/bin/city/agent/tui/controllers/StreamingUI.js +50 -179
  196. package/bin/city/agent/tui/controllers/StreamingUI.js.map +1 -1
  197. package/bin/city/agent/tui/controllers/TranscriptNavigation.d.ts +2 -6
  198. package/bin/city/agent/tui/controllers/TranscriptNavigation.d.ts.map +1 -1
  199. package/bin/city/agent/tui/controllers/TranscriptNavigation.js +2 -18
  200. package/bin/city/agent/tui/controllers/TranscriptNavigation.js.map +1 -1
  201. package/bin/city/agent/tui/dialogs/QuestionDialog.d.ts +55 -0
  202. package/bin/city/agent/tui/dialogs/QuestionDialog.d.ts.map +1 -0
  203. package/bin/city/agent/tui/dialogs/QuestionDialog.js +188 -0
  204. package/bin/city/agent/tui/dialogs/QuestionDialog.js.map +1 -0
  205. package/bin/city/agent/tui/dialogs/SecurityPolicyDialog.d.ts +36 -0
  206. package/bin/city/agent/tui/dialogs/SecurityPolicyDialog.d.ts.map +1 -0
  207. package/bin/city/agent/tui/dialogs/SecurityPolicyDialog.js +71 -0
  208. package/bin/city/agent/tui/dialogs/SecurityPolicyDialog.js.map +1 -0
  209. package/bin/city/agent/tui/dialogs/SessionPicker.d.ts +4 -4
  210. package/bin/city/agent/tui/dialogs/SessionPicker.d.ts.map +1 -1
  211. package/bin/city/agent/tui/dialogs/SessionPicker.js +12 -12
  212. package/bin/city/agent/tui/dialogs/SessionPicker.js.map +1 -1
  213. package/bin/city/agent/tui/presentation/ToolActivityPresentation.d.ts +11 -0
  214. package/bin/city/agent/tui/presentation/ToolActivityPresentation.d.ts.map +1 -0
  215. package/bin/city/agent/tui/presentation/ToolActivityPresentation.js +118 -0
  216. package/bin/city/agent/tui/presentation/ToolActivityPresentation.js.map +1 -0
  217. package/bin/city/agent/tui/types/ToolActivity.d.ts +27 -0
  218. package/bin/city/agent/tui/types/ToolActivity.d.ts.map +1 -0
  219. package/bin/city/agent/tui/types/ToolActivity.js +8 -0
  220. package/bin/city/agent/tui/types/ToolActivity.js.map +1 -0
  221. package/bin/city/agent/tui/types/TranscriptNotice.d.ts +18 -0
  222. package/bin/city/agent/tui/types/TranscriptNotice.d.ts.map +1 -0
  223. package/bin/city/agent/tui/types/TranscriptNotice.js +8 -0
  224. package/bin/city/agent/tui/types/TranscriptNotice.js.map +1 -0
  225. package/bin/city/agent/tui/types.d.ts +5 -124
  226. package/bin/city/agent/tui/types.d.ts.map +1 -1
  227. package/bin/city/agent/tui/types.js +2 -2
  228. package/bin/city/command/AgentCommand.d.ts.map +1 -1
  229. package/bin/city/command/AgentCommand.js +61 -141
  230. package/bin/city/command/AgentCommand.js.map +1 -1
  231. package/bin/city/command/EnvCommand.d.ts +2 -7
  232. package/bin/city/command/EnvCommand.d.ts.map +1 -1
  233. package/bin/city/command/EnvCommand.js +97 -251
  234. package/bin/city/command/EnvCommand.js.map +1 -1
  235. package/bin/city/command/GatewayCommand.d.ts +1 -1
  236. package/bin/city/command/GatewayCommand.d.ts.map +1 -1
  237. package/bin/city/command/GatewayCommand.js +1 -44
  238. package/bin/city/command/GatewayCommand.js.map +1 -1
  239. package/bin/city/command/PluginCommand.d.ts +6 -7
  240. package/bin/city/command/PluginCommand.d.ts.map +1 -1
  241. package/bin/city/command/PluginCommand.js +390 -195
  242. package/bin/city/command/PluginCommand.js.map +1 -1
  243. package/bin/city/command/TokenCommand.d.ts +4 -9
  244. package/bin/city/command/TokenCommand.d.ts.map +1 -1
  245. package/bin/city/command/TokenCommand.js +83 -102
  246. package/bin/city/command/TokenCommand.js.map +1 -1
  247. package/bin/city/config/Paths.d.ts +0 -20
  248. package/bin/city/config/Paths.d.ts.map +1 -1
  249. package/bin/city/config/Paths.js +0 -46
  250. package/bin/city/config/Paths.js.map +1 -1
  251. package/bin/city/env/EnvBroadcast.d.ts +11 -0
  252. package/bin/city/env/EnvBroadcast.d.ts.map +1 -0
  253. package/bin/city/env/EnvBroadcast.js +42 -0
  254. package/bin/city/env/EnvBroadcast.js.map +1 -0
  255. package/bin/city/env/EnvFileStore.d.ts +37 -0
  256. package/bin/city/env/EnvFileStore.d.ts.map +1 -0
  257. package/bin/city/env/EnvFileStore.js +129 -0
  258. package/bin/city/env/EnvFileStore.js.map +1 -0
  259. package/bin/city/env/EnvService.d.ts +17 -0
  260. package/bin/city/env/EnvService.d.ts.map +1 -0
  261. package/bin/city/env/EnvService.js +80 -0
  262. package/bin/city/env/EnvService.js.map +1 -0
  263. package/bin/city/env/InteractiveEnvManager.d.ts +8 -0
  264. package/bin/city/env/InteractiveEnvManager.d.ts.map +1 -0
  265. package/bin/city/env/InteractiveEnvManager.js +95 -0
  266. package/bin/city/env/InteractiveEnvManager.js.map +1 -0
  267. package/bin/city/env/ProcessEnv.d.ts +10 -4
  268. package/bin/city/env/ProcessEnv.d.ts.map +1 -1
  269. package/bin/city/env/ProcessEnv.js +30 -18
  270. package/bin/city/env/ProcessEnv.js.map +1 -1
  271. package/bin/city/index.d.ts +1 -1
  272. package/bin/city/index.d.ts.map +1 -1
  273. package/bin/city/index.js +1 -14
  274. package/bin/city/index.js.map +1 -1
  275. package/bin/city/process/daemon/Api.d.ts +4 -3
  276. package/bin/city/process/daemon/Api.d.ts.map +1 -1
  277. package/bin/city/process/daemon/CliArgs.d.ts +1 -1
  278. package/bin/city/process/daemon/CliArgs.d.ts.map +1 -1
  279. package/bin/city/process/daemon/CliArgs.js +4 -4
  280. package/bin/city/process/daemon/CliArgs.js.map +1 -1
  281. package/bin/city/process/daemon/Client.d.ts +2 -2
  282. package/bin/city/process/daemon/Client.d.ts.map +1 -1
  283. package/bin/city/process/daemon/Client.js +4 -4
  284. package/bin/city/process/daemon/Client.js.map +1 -1
  285. package/bin/city/process/daemon/DaemonRpcClient.d.ts +14 -0
  286. package/bin/city/process/daemon/DaemonRpcClient.d.ts.map +1 -0
  287. package/bin/city/process/daemon/DaemonRpcClient.js +101 -0
  288. package/bin/city/process/daemon/DaemonRpcClient.js.map +1 -0
  289. package/bin/city/process/daemon/Manager.d.ts +16 -16
  290. package/bin/city/process/daemon/Manager.d.ts.map +1 -1
  291. package/bin/city/process/daemon/Manager.js +104 -118
  292. package/bin/city/process/daemon/Manager.js.map +1 -1
  293. package/bin/city/process/daemon/Types.d.ts +22 -11
  294. package/bin/city/process/daemon/Types.d.ts.map +1 -1
  295. package/bin/city/process/daemon/Types.js +3 -3
  296. package/bin/city/process/daemon/Types.js.map +1 -1
  297. package/bin/city/process/plugin/InteractivePluginManager.d.ts +12 -0
  298. package/bin/city/process/plugin/InteractivePluginManager.d.ts.map +1 -0
  299. package/bin/city/process/plugin/InteractivePluginManager.js +270 -0
  300. package/bin/city/process/plugin/InteractivePluginManager.js.map +1 -0
  301. package/bin/city/process/plugin/InteractivePluginResourceManager.d.ts +14 -0
  302. package/bin/city/process/plugin/InteractivePluginResourceManager.d.ts.map +1 -0
  303. package/bin/city/process/plugin/InteractivePluginResourceManager.js +214 -0
  304. package/bin/city/process/plugin/InteractivePluginResourceManager.js.map +1 -0
  305. package/bin/city/process/plugin/PluginBindingConfiguration.d.ts +19 -0
  306. package/bin/city/process/plugin/PluginBindingConfiguration.d.ts.map +1 -0
  307. package/bin/city/process/plugin/PluginBindingConfiguration.js +31 -0
  308. package/bin/city/process/plugin/PluginBindingConfiguration.js.map +1 -0
  309. package/bin/city/process/plugin/PluginCatalog.d.ts +14 -0
  310. package/bin/city/process/plugin/PluginCatalog.d.ts.map +1 -0
  311. package/bin/city/process/plugin/PluginCatalog.js +38 -0
  312. package/bin/city/process/plugin/PluginCatalog.js.map +1 -0
  313. package/bin/city/process/plugin/PluginConfigForm.d.ts +22 -0
  314. package/bin/city/process/plugin/PluginConfigForm.d.ts.map +1 -0
  315. package/bin/city/process/plugin/PluginConfigForm.js +355 -0
  316. package/bin/city/process/plugin/PluginConfigForm.js.map +1 -0
  317. package/bin/city/process/plugin/PluginConfigValidator.d.ts +17 -0
  318. package/bin/city/process/plugin/PluginConfigValidator.d.ts.map +1 -0
  319. package/bin/city/process/plugin/PluginConfigValidator.js +54 -0
  320. package/bin/city/process/plugin/PluginConfigValidator.js.map +1 -0
  321. package/bin/city/process/plugin/PluginInstaller.d.ts +18 -0
  322. package/bin/city/process/plugin/PluginInstaller.d.ts.map +1 -0
  323. package/bin/city/process/plugin/PluginInstaller.js +320 -0
  324. package/bin/city/process/plugin/PluginInstaller.js.map +1 -0
  325. package/bin/city/process/plugin/PluginResourceSchema.d.ts +38 -0
  326. package/bin/city/process/plugin/PluginResourceSchema.d.ts.map +1 -0
  327. package/bin/city/process/plugin/PluginResourceSchema.js +176 -0
  328. package/bin/city/process/plugin/PluginResourceSchema.js.map +1 -0
  329. package/bin/city/process/plugin/PluginResourceService.d.ts +32 -0
  330. package/bin/city/process/plugin/PluginResourceService.d.ts.map +1 -0
  331. package/bin/city/process/plugin/PluginResourceService.js +139 -0
  332. package/bin/city/process/plugin/PluginResourceService.js.map +1 -0
  333. package/bin/city/process/registry/CityPaths.d.ts +24 -18
  334. package/bin/city/process/registry/CityPaths.d.ts.map +1 -1
  335. package/bin/city/process/registry/CityPaths.js +43 -25
  336. package/bin/city/process/registry/CityPaths.js.map +1 -1
  337. package/bin/city/process/registry/ManagedAgentRepository.d.ts +36 -0
  338. package/bin/city/process/registry/ManagedAgentRepository.d.ts.map +1 -0
  339. package/bin/city/process/registry/ManagedAgentRepository.js +148 -0
  340. package/bin/city/process/registry/ManagedAgentRepository.js.map +1 -0
  341. package/bin/city/process/registry/PluginRepository.d.ts +39 -0
  342. package/bin/city/process/registry/PluginRepository.d.ts.map +1 -0
  343. package/bin/city/process/registry/PluginRepository.js +178 -0
  344. package/bin/city/process/registry/PluginRepository.js.map +1 -0
  345. package/bin/city/process/registry/PluginResourceRepository.d.ts +23 -0
  346. package/bin/city/process/registry/PluginResourceRepository.d.ts.map +1 -0
  347. package/bin/city/process/registry/PluginResourceRepository.js +112 -0
  348. package/bin/city/process/registry/PluginResourceRepository.js.map +1 -0
  349. package/bin/city/runtime/auth/AuthMiddleware.d.ts +3 -3
  350. package/bin/city/runtime/auth/AuthMiddleware.d.ts.map +1 -1
  351. package/bin/city/runtime/auth/AuthMiddleware.js +1 -1
  352. package/bin/city/runtime/auth/AuthMiddleware.js.map +1 -1
  353. package/bin/city/runtime/auth/AuthService.d.ts +23 -107
  354. package/bin/city/runtime/auth/AuthService.d.ts.map +1 -1
  355. package/bin/city/runtime/auth/AuthService.js +74 -276
  356. package/bin/city/runtime/auth/AuthService.js.map +1 -1
  357. package/bin/city/runtime/auth/RoutePolicy.d.ts +20 -20
  358. package/bin/city/runtime/auth/RoutePolicy.d.ts.map +1 -1
  359. package/bin/city/runtime/auth/RoutePolicy.js +33 -209
  360. package/bin/city/runtime/auth/RoutePolicy.js.map +1 -1
  361. package/bin/city/runtime/city-model/CreateRuntimeModel.d.ts +2 -2
  362. package/bin/city/runtime/city-model/CreateRuntimeModel.d.ts.map +1 -1
  363. package/bin/city/runtime/city-model/CreateRuntimeModel.js +3 -3
  364. package/bin/city/runtime/city-model/CreateRuntimeModel.js.map +1 -1
  365. package/bin/city/runtime/city-model/ExecutionModelBinding.d.ts +0 -4
  366. package/bin/city/runtime/city-model/ExecutionModelBinding.d.ts.map +1 -1
  367. package/bin/city/runtime/city-model/ExecutionModelBinding.js +3 -18
  368. package/bin/city/runtime/city-model/ExecutionModelBinding.js.map +1 -1
  369. package/bin/city/runtime/plugins/DowncityPlugins.d.ts +19 -0
  370. package/bin/city/runtime/plugins/DowncityPlugins.d.ts.map +1 -0
  371. package/bin/city/runtime/plugins/DowncityPlugins.js +227 -0
  372. package/bin/city/runtime/plugins/DowncityPlugins.js.map +1 -0
  373. package/bin/city/runtime/plugins/PluginAssembler.d.ts +19 -0
  374. package/bin/city/runtime/plugins/PluginAssembler.d.ts.map +1 -0
  375. package/bin/city/runtime/plugins/PluginAssembler.js +42 -0
  376. package/bin/city/runtime/plugins/PluginAssembler.js.map +1 -0
  377. package/bin/city/runtime/plugins/PluginTypeLoader.d.ts +23 -0
  378. package/bin/city/runtime/plugins/PluginTypeLoader.d.ts.map +1 -0
  379. package/bin/city/runtime/plugins/PluginTypeLoader.js +106 -0
  380. package/bin/city/runtime/plugins/PluginTypeLoader.js.map +1 -0
  381. package/bin/city/runtime/store/StoreAgentTokenRepository.d.ts +23 -0
  382. package/bin/city/runtime/store/StoreAgentTokenRepository.d.ts.map +1 -0
  383. package/bin/city/runtime/store/StoreAgentTokenRepository.js +54 -0
  384. package/bin/city/runtime/store/StoreAgentTokenRepository.js.map +1 -0
  385. package/bin/city/runtime/store/StoreManagedAgentRepository.d.ts +21 -0
  386. package/bin/city/runtime/store/StoreManagedAgentRepository.d.ts.map +1 -0
  387. package/bin/city/runtime/store/StoreManagedAgentRepository.js +70 -0
  388. package/bin/city/runtime/store/StoreManagedAgentRepository.js.map +1 -0
  389. package/bin/city/runtime/store/StorePluginRepository.d.ts +27 -0
  390. package/bin/city/runtime/store/StorePluginRepository.d.ts.map +1 -0
  391. package/bin/city/runtime/store/StorePluginRepository.js +116 -0
  392. package/bin/city/runtime/store/StorePluginRepository.js.map +1 -0
  393. package/bin/city/runtime/store/StorePluginResourceRepository.d.ts +19 -0
  394. package/bin/city/runtime/store/StorePluginResourceRepository.d.ts.map +1 -0
  395. package/bin/city/runtime/store/StorePluginResourceRepository.js +60 -0
  396. package/bin/city/runtime/store/StorePluginResourceRepository.js.map +1 -0
  397. package/bin/city/runtime/store/StoreSchema.d.ts.map +1 -1
  398. package/bin/city/runtime/store/StoreSchema.js +253 -169
  399. package/bin/city/runtime/store/StoreSchema.js.map +1 -1
  400. package/bin/city/runtime/store/StoreSecureSettings.js +2 -2
  401. package/bin/city/runtime/store/StoreSecureSettings.js.map +1 -1
  402. package/bin/city/runtime/store/StoreShared.d.ts +0 -5
  403. package/bin/city/runtime/store/StoreShared.d.ts.map +1 -1
  404. package/bin/city/runtime/store/StoreShared.js +0 -10
  405. package/bin/city/runtime/store/StoreShared.js.map +1 -1
  406. package/bin/city/runtime/store/index.d.ts +1 -70
  407. package/bin/city/runtime/store/index.d.ts.map +1 -1
  408. package/bin/city/runtime/store/index.js +6 -108
  409. package/bin/city/runtime/store/index.js.map +1 -1
  410. package/bin/city/shared/CityAgentRuntime.d.ts +5 -8
  411. package/bin/city/shared/CityAgentRuntime.d.ts.map +1 -1
  412. package/bin/city/shared/CityAgentRuntime.js +21 -41
  413. package/bin/city/shared/CityAgentRuntime.js.map +1 -1
  414. package/bin/city/shared/CityBalance.d.ts +1 -1
  415. package/bin/city/shared/CityBalance.d.ts.map +1 -1
  416. package/bin/city/shared/CityBalance.js +22 -20
  417. package/bin/city/shared/CityBalance.js.map +1 -1
  418. package/bin/city/shared/FederationConnection.d.ts +1 -1
  419. package/bin/city/shared/FederationConnection.js +1 -1
  420. package/bin/city/shared/PluginTargetSupport.d.ts +16 -66
  421. package/bin/city/shared/PluginTargetSupport.d.ts.map +1 -1
  422. package/bin/city/shared/PluginTargetSupport.js +34 -186
  423. package/bin/city/shared/PluginTargetSupport.js.map +1 -1
  424. package/bin/city/tui/FederationManagerFormat.d.ts.map +1 -1
  425. package/bin/city/tui/FederationManagerFormat.js +4 -5
  426. package/bin/city/tui/FederationManagerFormat.js.map +1 -1
  427. package/bin/city/tui/FederationManagerPrompts.d.ts +1 -1
  428. package/bin/city/tui/FederationManagerPrompts.d.ts.map +1 -1
  429. package/bin/city/tui/FederationManagerPrompts.js +5 -5
  430. package/bin/city/tui/FederationManagerPrompts.js.map +1 -1
  431. package/bin/city/tui/FederationManagerState.js +6 -6
  432. package/bin/city/tui/FederationManagerState.js.map +1 -1
  433. package/bin/city/types/AgentChatInteractive.d.ts +10 -14
  434. package/bin/city/types/AgentChatInteractive.d.ts.map +1 -1
  435. package/bin/city/types/AgentModel.d.ts +0 -2
  436. package/bin/city/types/AgentModel.d.ts.map +1 -1
  437. package/bin/city/types/ChatAccessCommand.d.ts +2 -2
  438. package/bin/city/types/ChatAccessCommand.d.ts.map +1 -1
  439. package/bin/city/types/CityBalance.d.ts +13 -55
  440. package/bin/city/types/CityBalance.d.ts.map +1 -1
  441. package/bin/city/types/CityBalance.js +1 -1
  442. package/bin/city/types/FederationMembership.d.ts +1 -1
  443. package/bin/city/types/FederationMembership.js +1 -1
  444. package/bin/city/types/agent/AgentCreateWorkspace.d.ts +19 -0
  445. package/bin/city/types/agent/AgentCreateWorkspace.d.ts.map +1 -0
  446. package/bin/city/types/agent/AgentCreateWorkspace.js +5 -0
  447. package/bin/city/types/agent/AgentCreateWorkspace.js.map +1 -0
  448. package/bin/city/types/agent/AgentSelection.d.ts +26 -0
  449. package/bin/city/types/agent/AgentSelection.d.ts.map +1 -0
  450. package/bin/city/types/agent/AgentSelection.js +9 -0
  451. package/bin/city/types/agent/AgentSelection.js.map +1 -0
  452. package/bin/city/types/agent/ManagedAgent.d.ts +57 -0
  453. package/bin/city/types/agent/ManagedAgent.d.ts.map +1 -0
  454. package/bin/city/types/agent/ManagedAgent.js +10 -0
  455. package/bin/city/types/agent/ManagedAgent.js.map +1 -0
  456. package/bin/city/types/agent/ManagedAgentRuntime.d.ts +15 -0
  457. package/bin/city/types/agent/ManagedAgentRuntime.d.ts.map +1 -0
  458. package/bin/city/types/agent/ManagedAgentRuntime.js +7 -0
  459. package/bin/city/types/agent/ManagedAgentRuntime.js.map +1 -0
  460. package/bin/city/types/auth/AgentToken.d.ts +37 -0
  461. package/bin/city/types/auth/AgentToken.d.ts.map +1 -0
  462. package/bin/city/types/auth/AgentToken.js +7 -0
  463. package/bin/city/types/auth/AgentToken.js.map +1 -0
  464. package/bin/city/types/config/AgentProject.d.ts +58 -0
  465. package/bin/city/types/config/AgentProject.d.ts.map +1 -0
  466. package/bin/city/types/config/AgentProject.js +9 -0
  467. package/bin/city/types/config/AgentProject.js.map +1 -0
  468. package/bin/city/types/config/DowncityConfig.d.ts +46 -0
  469. package/bin/city/types/config/DowncityConfig.d.ts.map +1 -0
  470. package/bin/city/types/config/DowncityConfig.js +2 -0
  471. package/bin/city/types/config/DowncityConfig.js.map +1 -0
  472. package/bin/city/types/config/EnvFile.d.ts +30 -0
  473. package/bin/city/types/config/EnvFile.d.ts.map +1 -0
  474. package/bin/city/types/config/EnvFile.js +10 -0
  475. package/bin/city/types/config/EnvFile.js.map +1 -0
  476. package/bin/city/types/config/ExecutionBinding.d.ts +26 -0
  477. package/bin/city/types/config/ExecutionBinding.d.ts.map +1 -0
  478. package/bin/city/types/config/ExecutionBinding.js +10 -0
  479. package/bin/city/types/config/ExecutionBinding.js.map +1 -0
  480. package/bin/city/types/config/LlmConfig.d.ts +102 -0
  481. package/bin/city/types/config/LlmConfig.d.ts.map +1 -0
  482. package/bin/city/types/config/LlmConfig.js +12 -0
  483. package/bin/city/types/config/LlmConfig.js.map +1 -0
  484. package/bin/city/types/env/EnvBroadcast.d.ts +18 -0
  485. package/bin/city/types/env/EnvBroadcast.d.ts.map +1 -0
  486. package/bin/city/types/env/EnvBroadcast.js +5 -0
  487. package/bin/city/types/env/EnvBroadcast.js.map +1 -0
  488. package/bin/city/types/env/EnvTarget.d.ts +29 -0
  489. package/bin/city/types/env/EnvTarget.d.ts.map +1 -0
  490. package/bin/city/types/env/EnvTarget.js +5 -0
  491. package/bin/city/types/env/EnvTarget.js.map +1 -0
  492. package/bin/city/types/plugin/AgentPluginBinding.d.ts +37 -0
  493. package/bin/city/types/plugin/AgentPluginBinding.d.ts.map +1 -0
  494. package/bin/city/types/plugin/AgentPluginBinding.js +7 -0
  495. package/bin/city/types/plugin/AgentPluginBinding.js.map +1 -0
  496. package/bin/city/types/plugin/PluginCatalog.d.ts +28 -0
  497. package/bin/city/types/plugin/PluginCatalog.d.ts.map +1 -0
  498. package/bin/city/types/plugin/PluginCatalog.js +3 -0
  499. package/bin/city/types/plugin/PluginCatalog.js.map +1 -0
  500. package/bin/city/types/plugin/PluginConfigForm.d.ts +12 -0
  501. package/bin/city/types/plugin/PluginConfigForm.d.ts.map +1 -0
  502. package/bin/city/types/plugin/PluginConfigForm.js +3 -0
  503. package/bin/city/types/plugin/PluginConfigForm.js.map +1 -0
  504. package/bin/city/types/plugin/PluginInstallation.d.ts +104 -0
  505. package/bin/city/types/plugin/PluginInstallation.d.ts.map +1 -0
  506. package/bin/city/types/plugin/PluginInstallation.js +13 -0
  507. package/bin/city/types/plugin/PluginInstallation.js.map +1 -0
  508. package/bin/city/types/plugin/PluginResource.d.ts +55 -0
  509. package/bin/city/types/plugin/PluginResource.d.ts.map +1 -0
  510. package/bin/city/types/plugin/PluginResource.js +10 -0
  511. package/bin/city/types/plugin/PluginResource.js.map +1 -0
  512. package/bin/city/types/runtime/InlineInstant.d.ts +82 -0
  513. package/bin/city/types/runtime/InlineInstant.d.ts.map +1 -0
  514. package/bin/city/types/runtime/InlineInstant.js +10 -0
  515. package/bin/city/types/runtime/InlineInstant.js.map +1 -0
  516. package/bin/city/types/runtime/Platform.d.ts +310 -0
  517. package/bin/city/types/runtime/Platform.d.ts.map +1 -0
  518. package/bin/city/types/runtime/Platform.js +10 -0
  519. package/bin/city/types/runtime/Platform.js.map +1 -0
  520. package/bin/city/types/runtime/PlatformGateway.d.ts +41 -0
  521. package/bin/city/types/runtime/PlatformGateway.d.ts.map +1 -0
  522. package/bin/city/types/runtime/PlatformGateway.js +2 -0
  523. package/bin/city/types/runtime/PlatformGateway.js.map +1 -0
  524. package/bin/city/utils/Id.d.ts +1 -1
  525. package/bin/city/utils/Id.d.ts.map +1 -1
  526. package/bin/city/utils/Id.js +1 -1
  527. package/bin/city/utils/Id.js.map +1 -1
  528. package/bin/federation/admin/commands/credits.d.ts +11 -0
  529. package/bin/federation/admin/commands/credits.d.ts.map +1 -0
  530. package/bin/federation/admin/commands/credits.js +157 -0
  531. package/bin/federation/admin/commands/credits.js.map +1 -0
  532. package/bin/federation/admin/commands/payment.d.ts.map +1 -1
  533. package/bin/federation/admin/commands/payment.js +1 -1
  534. package/bin/federation/admin/commands/payment.js.map +1 -1
  535. package/bin/federation/admin/dashboard/dashboard-data.js +5 -5
  536. package/bin/federation/admin/dashboard/dashboard-data.js.map +1 -1
  537. package/bin/federation/admin/dashboard/dashboard-format.js +5 -5
  538. package/bin/federation/admin/dashboard/dashboard-format.js.map +1 -1
  539. package/bin/federation/admin/dashboard/dashboard-metrics.js +11 -11
  540. package/bin/federation/admin/dashboard/dashboard-metrics.js.map +1 -1
  541. package/bin/federation/admin/loop.js +7 -7
  542. package/bin/federation/admin/loop.js.map +1 -1
  543. package/bin/federation/bureau/InteractiveBureauTokenManager.d.ts +11 -0
  544. package/bin/federation/bureau/InteractiveBureauTokenManager.d.ts.map +1 -0
  545. package/bin/federation/bureau/InteractiveBureauTokenManager.js +166 -0
  546. package/bin/federation/bureau/InteractiveBureauTokenManager.js.map +1 -0
  547. package/bin/federation/bureau/commands/bureau.d.ts +10 -2
  548. package/bin/federation/bureau/commands/bureau.d.ts.map +1 -1
  549. package/bin/federation/bureau/commands/bureau.js +72 -9
  550. package/bin/federation/bureau/commands/bureau.js.map +1 -1
  551. package/bin/federation/core/update.d.ts +6 -0
  552. package/bin/federation/core/update.d.ts.map +1 -1
  553. package/bin/federation/core/update.js +9 -7
  554. package/bin/federation/core/update.js.map +1 -1
  555. package/bin/federation/create/templates/CloudflareWorkersTemplate.js +2 -2
  556. package/bin/federation/create/templates/LocalNodeTemplate.js +2 -2
  557. package/bin/federation/index.d.ts.map +1 -1
  558. package/bin/federation/index.js +12 -6
  559. package/bin/federation/index.js.map +1 -1
  560. package/bin/federation/types/AdminDashboard.d.ts +8 -8
  561. package/bin/federation/types/AdminDashboard.d.ts.map +1 -1
  562. package/bin/federation/types/FederationBureau.d.ts +7 -0
  563. package/bin/federation/types/FederationBureau.d.ts.map +1 -1
  564. package/bin/shared/IndexSupport.d.ts +4 -7
  565. package/bin/shared/IndexSupport.d.ts.map +1 -1
  566. package/bin/shared/IndexSupport.js +5 -23
  567. package/bin/shared/IndexSupport.js.map +1 -1
  568. package/bin/shared/types/CliReporter.d.ts +1 -1
  569. package/package.json +16 -14
  570. package/bin/city/agent/AgentHistory.d.ts +0 -14
  571. package/bin/city/agent/AgentHistory.d.ts.map +0 -1
  572. package/bin/city/agent/AgentHistory.js +0 -95
  573. package/bin/city/agent/AgentHistory.js.map +0 -1
  574. package/bin/city/agent/AgentHistoryTypes.d.ts +0 -24
  575. package/bin/city/agent/AgentHistoryTypes.d.ts.map +0 -1
  576. package/bin/city/agent/AgentHistoryTypes.js +0 -9
  577. package/bin/city/agent/AgentHistoryTypes.js.map +0 -1
  578. package/bin/city/agent/AgentSelectionTypes.d.ts +0 -30
  579. package/bin/city/agent/AgentSelectionTypes.d.ts.map +0 -1
  580. package/bin/city/agent/AgentSelectionTypes.js +0 -5
  581. package/bin/city/agent/AgentSelectionTypes.js.map +0 -1
  582. package/bin/city/agent/control/SessionSummaryStore.d.ts +0 -18
  583. package/bin/city/agent/control/SessionSummaryStore.d.ts.map +0 -1
  584. package/bin/city/agent/control/SessionSummaryStore.js +0 -66
  585. package/bin/city/agent/control/SessionSummaryStore.js.map +0 -1
  586. package/bin/city/agent/tui/components/ToolCallBlock.d.ts +0 -85
  587. package/bin/city/agent/tui/components/ToolCallBlock.d.ts.map +0 -1
  588. package/bin/city/agent/tui/components/ToolCallBlock.js +0 -320
  589. package/bin/city/agent/tui/components/ToolCallBlock.js.map +0 -1
  590. package/bin/city/agent/tui/history/HistoryLoader.d.ts +0 -10
  591. package/bin/city/agent/tui/history/HistoryLoader.d.ts.map +0 -1
  592. package/bin/city/agent/tui/history/HistoryLoader.js +0 -89
  593. package/bin/city/agent/tui/history/HistoryLoader.js.map +0 -1
  594. package/bin/city/command/ChatAccessCommand.d.ts +0 -30
  595. package/bin/city/command/ChatAccessCommand.d.ts.map +0 -1
  596. package/bin/city/command/ChatAccessCommand.js +0 -278
  597. package/bin/city/command/ChatAccessCommand.js.map +0 -1
  598. package/bin/city/command/ChatCommand.d.ts +0 -14
  599. package/bin/city/command/ChatCommand.d.ts.map +0 -1
  600. package/bin/city/command/ChatCommand.js +0 -33
  601. package/bin/city/command/ChatCommand.js.map +0 -1
  602. package/bin/city/command/ConfigCommand.d.ts +0 -14
  603. package/bin/city/command/ConfigCommand.d.ts.map +0 -1
  604. package/bin/city/command/ConfigCommand.js +0 -268
  605. package/bin/city/command/ConfigCommand.js.map +0 -1
  606. package/bin/city/command/ManagedPluginActionCommand.d.ts +0 -15
  607. package/bin/city/command/ManagedPluginActionCommand.d.ts.map +0 -1
  608. package/bin/city/command/ManagedPluginActionCommand.js +0 -351
  609. package/bin/city/command/ManagedPluginActionCommand.js.map +0 -1
  610. package/bin/city/command/PluginScheduleCommand.d.ts +0 -37
  611. package/bin/city/command/PluginScheduleCommand.d.ts.map +0 -1
  612. package/bin/city/command/PluginScheduleCommand.js +0 -310
  613. package/bin/city/command/PluginScheduleCommand.js.map +0 -1
  614. package/bin/city/command/plugin/PluginHelpers.d.ts +0 -69
  615. package/bin/city/command/plugin/PluginHelpers.d.ts.map +0 -1
  616. package/bin/city/command/plugin/PluginHelpers.js +0 -339
  617. package/bin/city/command/plugin/PluginHelpers.js.map +0 -1
  618. package/bin/city/command/token/TokenActions.d.ts +0 -25
  619. package/bin/city/command/token/TokenActions.d.ts.map +0 -1
  620. package/bin/city/command/token/TokenActions.js +0 -98
  621. package/bin/city/command/token/TokenActions.js.map +0 -1
  622. package/bin/city/command/token/TokenHelpers.d.ts +0 -47
  623. package/bin/city/command/token/TokenHelpers.d.ts.map +0 -1
  624. package/bin/city/command/token/TokenHelpers.js +0 -135
  625. package/bin/city/command/token/TokenHelpers.js.map +0 -1
  626. package/bin/city/command/token/TokenPrompts.d.ts +0 -13
  627. package/bin/city/command/token/TokenPrompts.d.ts.map +0 -1
  628. package/bin/city/command/token/TokenPrompts.js +0 -328
  629. package/bin/city/command/token/TokenPrompts.js.map +0 -1
  630. package/bin/city/command/token/TokenRender.d.ts +0 -21
  631. package/bin/city/command/token/TokenRender.d.ts.map +0 -1
  632. package/bin/city/command/token/TokenRender.js +0 -81
  633. package/bin/city/command/token/TokenRender.js.map +0 -1
  634. package/bin/city/process/registry/AgentConfigStore.d.ts +0 -29
  635. package/bin/city/process/registry/AgentConfigStore.d.ts.map +0 -1
  636. package/bin/city/process/registry/AgentConfigStore.js +0 -96
  637. package/bin/city/process/registry/AgentConfigStore.js.map +0 -1
  638. package/bin/city/process/registry/CityRegistry.d.ts +0 -50
  639. package/bin/city/process/registry/CityRegistry.d.ts.map +0 -1
  640. package/bin/city/process/registry/CityRegistry.js +0 -256
  641. package/bin/city/process/registry/CityRegistry.js.map +0 -1
  642. package/bin/city/runtime/auth/AuthEnv.d.ts +0 -45
  643. package/bin/city/runtime/auth/AuthEnv.d.ts.map +0 -1
  644. package/bin/city/runtime/auth/AuthEnv.js +0 -63
  645. package/bin/city/runtime/auth/AuthEnv.js.map +0 -1
  646. package/bin/city/runtime/auth/AuthRoutes.d.ts +0 -17
  647. package/bin/city/runtime/auth/AuthRoutes.d.ts.map +0 -1
  648. package/bin/city/runtime/auth/AuthRoutes.js +0 -78
  649. package/bin/city/runtime/auth/AuthRoutes.js.map +0 -1
  650. package/bin/city/runtime/auth/AuthStore.d.ts +0 -164
  651. package/bin/city/runtime/auth/AuthStore.d.ts.map +0 -1
  652. package/bin/city/runtime/auth/AuthStore.js +0 -437
  653. package/bin/city/runtime/auth/AuthStore.js.map +0 -1
  654. package/bin/city/runtime/auth/CliAuthStateStore.d.ts +0 -33
  655. package/bin/city/runtime/auth/CliAuthStateStore.d.ts.map +0 -1
  656. package/bin/city/runtime/auth/CliAuthStateStore.js +0 -30
  657. package/bin/city/runtime/auth/CliAuthStateStore.js.map +0 -1
  658. package/bin/city/runtime/auth/PasswordHasher.d.ts +0 -16
  659. package/bin/city/runtime/auth/PasswordHasher.d.ts.map +0 -1
  660. package/bin/city/runtime/auth/PasswordHasher.js +0 -37
  661. package/bin/city/runtime/auth/PasswordHasher.js.map +0 -1
  662. package/bin/city/runtime/gateway/runtime/GatewayInit.d.ts +0 -13
  663. package/bin/city/runtime/gateway/runtime/GatewayInit.d.ts.map +0 -1
  664. package/bin/city/runtime/gateway/runtime/GatewayInit.js +0 -43
  665. package/bin/city/runtime/gateway/runtime/GatewayInit.js.map +0 -1
  666. package/bin/city/runtime/plugins/CityBuiltinPlugins.d.ts +0 -42
  667. package/bin/city/runtime/plugins/CityBuiltinPlugins.d.ts.map +0 -1
  668. package/bin/city/runtime/plugins/CityBuiltinPlugins.js +0 -134
  669. package/bin/city/runtime/plugins/CityBuiltinPlugins.js.map +0 -1
  670. package/bin/city/runtime/store/StoreAgentConfigRepository.d.ts +0 -28
  671. package/bin/city/runtime/store/StoreAgentConfigRepository.d.ts.map +0 -1
  672. package/bin/city/runtime/store/StoreAgentConfigRepository.js +0 -81
  673. package/bin/city/runtime/store/StoreAgentConfigRepository.js.map +0 -1
  674. package/bin/city/runtime/store/StoreChannelAccountRepository.d.ts +0 -34
  675. package/bin/city/runtime/store/StoreChannelAccountRepository.d.ts.map +0 -1
  676. package/bin/city/runtime/store/StoreChannelAccountRepository.js +0 -198
  677. package/bin/city/runtime/store/StoreChannelAccountRepository.js.map +0 -1
  678. package/bin/city/runtime/store/StoreEnvRepository.d.ts +0 -54
  679. package/bin/city/runtime/store/StoreEnvRepository.d.ts.map +0 -1
  680. package/bin/city/runtime/store/StoreEnvRepository.js +0 -187
  681. package/bin/city/runtime/store/StoreEnvRepository.js.map +0 -1
  682. package/bin/city/shared/ChatAccessManager.d.ts +0 -10
  683. package/bin/city/shared/ChatAccessManager.d.ts.map +0 -1
  684. package/bin/city/shared/ChatAccessManager.js +0 -145
  685. package/bin/city/shared/ChatAccessManager.js.map +0 -1
  686. package/bin/city/shared/ChatManager.d.ts +0 -14
  687. package/bin/city/shared/ChatManager.d.ts.map +0 -1
  688. package/bin/city/shared/ChatManager.js +0 -460
  689. package/bin/city/shared/ChatManager.js.map +0 -1
  690. package/bin/city/shared/ChatManagerTypes.d.ts +0 -23
  691. package/bin/city/shared/ChatManagerTypes.d.ts.map +0 -1
  692. package/bin/city/shared/ChatManagerTypes.js +0 -5
  693. package/bin/city/shared/ChatManagerTypes.js.map +0 -1
  694. package/bin/city/shared/ManagedPluginRemote.d.ts +0 -30
  695. package/bin/city/shared/ManagedPluginRemote.d.ts.map +0 -1
  696. package/bin/city/shared/ManagedPluginRemote.js +0 -200
  697. package/bin/city/shared/ManagedPluginRemote.js.map +0 -1
  698. package/bin/city/shared/Update.d.ts +0 -43
  699. package/bin/city/shared/Update.d.ts.map +0 -1
  700. package/bin/city/shared/Update.js +0 -180
  701. package/bin/city/shared/Update.js.map +0 -1
  702. package/bin/city/types/AgentConfig.d.ts +0 -41
  703. package/bin/city/types/AgentConfig.d.ts.map +0 -1
  704. package/bin/city/types/AgentConfig.js +0 -9
  705. package/bin/city/types/AgentConfig.js.map +0 -1
  706. package/bin/federation/admin/commands/balance.d.ts +0 -7
  707. package/bin/federation/admin/commands/balance.d.ts.map +0 -1
  708. package/bin/federation/admin/commands/balance.js +0 -257
  709. package/bin/federation/admin/commands/balance.js.map +0 -1
package/README.md CHANGED
@@ -7,10 +7,10 @@ npm install -g downcity
7
7
  downcity -v
8
8
  ```
9
9
 
10
- 安装后会得到 `city` / `downcity` 与 `fed` / `downfed` 两组命令:
10
+ 安装后会得到 `city` / `downcity` 与 `fed` / `downfed` 两个相互独立的工具:
11
11
 
12
- - `fed` 创建、部署和管理 Federation;Local Node.js 和 Cloudflare Workers 都通过 `fed deploy` 部署。
13
- - `city` 管理本机 Agent、插件、chat 与 Federation 用户登录态。
12
+ - `city` 是本机 City 容器,基于 `City()` 与 Agent SDK 管理全局 Agent、运行时、Plugin 与控制台。
13
+ - `fed` 是 Federation Server Manager;TUI 用于注册和管理 Server,项目命令读取当前目录的 `federation.json`。Local Node.js 和 Cloudflare Workers 都通过 `fed deploy` 部署。
14
14
 
15
15
  ```bash
16
16
  fed create ./my-fed
@@ -22,10 +22,25 @@ fed
22
22
 
23
23
  `fed create` 默认生成 Local Node.js + SQLite 项目。Local deploy 会自动注入并保存 admin key。无参数执行 `fed` 会进入系统级 Federation 管理面板,已部署实例不依赖当前工作目录。
24
24
 
25
+ City 的主要命令:
26
+
27
+ ```bash
28
+ city agent create .
29
+ city agent start <agent_id>
30
+ city agent token create <agent_id> --name local
31
+ city plugin action <plugin_name> <action_name> <agent_id> --input '{}'
32
+ ```
33
+
34
+ `city agent start` 创建的 Agent 默认启用 `ask_question` Tool。使用
35
+ `city agent chat <agent_id>` 交互时,模型可以在缺少关键信息时显示文本、单选或多选问题;
36
+ 回答会通过 Session Interaction 提交,并在同一轮模型执行中继续处理。
37
+
38
+ Agent 与 Plugin Binding 统一保存在全局数据库;Plugin 配置不进入 Agent SDK 的运行时 Plugin 对象。未传 `agent_id` 时,TTY 打开全局 Agent 选择器,非交互环境直接报错。
39
+
25
40
  为独立产品后端登记 Bureau:
26
41
 
27
42
  ```bash
28
43
  fed bureau token
29
44
  ```
30
45
 
31
- 命令在 CLI 本地生成 `bureau_token`,Federation 只保存 hash,并将明文输出一次。把明文写入 Bureau 服务器的 `DOWNCITY_BUREAU_TOKEN` 环境变量;Federation 与 Bureau 不需要部署在同一台服务器。注册记录可用 `fed bureau list` 查看,使用 `fed bureau revoke <token_id>` 撤销。
46
+ 命令打开 Bureau Token 交互式管理界面,可创建、查看和撤销 Token。创建时必须输入用途,也可以直接运行 `fed bureau token create`。CLI 在本地生成 `bureau_token`,Federation 保存用途和 hash,并将明文输出一次。把明文写入 Bureau 服务器的 `DOWNCITY_BUREAU_TOKEN` 环境变量;Federation 与 Bureau 不需要部署在同一台服务器。脚本中可用 `fed bureau token list` 查看,使用 `fed bureau token revoke <token_id>` 撤销。
@@ -1 +1 @@
1
- {"version":3,"file":"AgentChat.d.ts","sourceRoot":"","sources":["../../../src/city/agent/AgentChat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAW1E;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiH7E"}
1
+ {"version":3,"file":"AgentChat.d.ts","sourceRoot":"","sources":["../../../src/city/agent/AgentChat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAU1E;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsI7E"}
@@ -12,7 +12,6 @@ import { emitCliBlock } from "../../shared/CliReporter.js";
12
12
  import { createRemoteChatSession, listRemoteChatSessions, } from "./AgentChatRemote.js";
13
13
  import { run_agent_chat_tui } from "./AgentChatTui.js";
14
14
  import { normalizeChatMessage, resolveAgentChatSessionOptions, resolveChatTargetAgentId, resolveInteractiveChatSession, runOneShotChat, runSdkPromptTurn, } from "./AgentChatHelpers.js";
15
- import { session_messages_to_entries } from "./tui/history/HistoryLoader.js";
16
15
  /**
17
16
  * `city agent chat` 统一入口。
18
17
  */
@@ -26,13 +25,13 @@ export async function chatCommand(options) {
26
25
  });
27
26
  return;
28
27
  }
29
- const agentId = await resolveChatTargetAgentId(options.to);
30
- if (!agentId)
28
+ const agent_id = await resolveChatTargetAgentId(options.to);
29
+ if (!agent_id)
31
30
  return;
32
31
  const oneShotMessage = normalizeChatMessage(String(options.message || ""));
33
32
  if (oneShotMessage) {
34
33
  await runOneShotChat({
35
- agentId,
34
+ agent_id,
36
35
  message: oneShotMessage,
37
36
  options,
38
37
  });
@@ -55,7 +54,7 @@ export async function chatCommand(options) {
55
54
  return;
56
55
  }
57
56
  const interactive = await resolveInteractiveChatSession({
58
- agentId,
57
+ agent_id,
59
58
  options,
60
59
  transport: {
61
60
  host: options.host,
@@ -74,34 +73,55 @@ export async function chatCommand(options) {
74
73
  }
75
74
  try {
76
75
  await run_agent_chat_tui({
77
- agent_id: agentId,
78
- session_id: interactive.target.sessionId,
76
+ agent_id: agent_id,
77
+ session_id: interactive.target.session_id,
79
78
  list_sessions: async () => await listRemoteChatSessions({
80
79
  remote_agent: interactive.remote_agent,
81
80
  }),
82
81
  create_session: async () => await createRemoteChatSession({
83
82
  remote_agent: interactive.remote_agent,
84
83
  }),
85
- load_session_history: async (session_id) => {
84
+ load_session_context: async (session_id) => {
86
85
  const session = await interactive.remote_agent.sessions.get(session_id);
87
- const [info, messages] = await Promise.all([
86
+ const [info, messages, status, interactions] = await Promise.all([
88
87
  session.get_info(),
89
88
  session.messages(),
89
+ session.status(),
90
+ session.interactions(),
90
91
  ]);
91
92
  const title = info.title?.trim() || "Untitled";
92
- const entries = session_messages_to_entries(messages.items);
93
- return { title, entries };
93
+ return {
94
+ title,
95
+ messages: messages.items,
96
+ security: status.security,
97
+ interactions,
98
+ };
94
99
  },
95
- resolve_approval: async (session_id, approval_id, decision) => {
100
+ get_session_status: async (session_id) => {
96
101
  const session = await interactive.remote_agent.sessions.get(session_id);
97
- return await session.resolve_approval({ approval_id, decision });
102
+ return await session.status();
103
+ },
104
+ set_session_security: async (session_id, mode) => {
105
+ const session = await interactive.remote_agent.sessions.get(session_id);
106
+ await session.set({ security: { approval_mode: mode } });
107
+ },
108
+ stop_session: async (session_id) => {
109
+ const session = await interactive.remote_agent.sessions.get(session_id);
110
+ return await session.stop();
111
+ },
112
+ respond_interaction: async (session_id, interaction_id, response) => {
113
+ const session = await interactive.remote_agent.sessions.get(session_id);
114
+ return await session.respond({
115
+ interaction_id,
116
+ response,
117
+ });
98
118
  },
99
119
  run_turn: async ({ session_id, message, interactive_renderer }) => {
100
120
  const outcome = await runSdkPromptTurn({
101
- agentId,
121
+ agent_id,
102
122
  message,
103
123
  sessionOptions: {
104
- sessionId: session_id,
124
+ session_id: session_id,
105
125
  newSession: false,
106
126
  },
107
127
  transport: {
@@ -1 +1 @@
1
- {"version":3,"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AAE,cAAc,EAAE,QAAQ,EAAE,EAAE;gBAClE,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBACxE,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC;oBAC3B,cAAc;oBACd,QAAQ;iBACT,CAAC,CAAC;YACL,CAAC;YACD,QAAQ,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE,EAAE;gBAChE,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC;oBACrC,QAAQ;oBACR,OAAO;oBACP,cAAc,EAAE;wBACd,UAAU,EAAE,UAAU;wBACtB,UAAU,EAAE,KAAK;qBAClB;oBACD,SAAS,EAAE;wBACT,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,IAAI,EAAE,OAAO,CAAC,IAAI;qBACnB;oBACD,mBAAmB,EAAE,oBAAoB;iBAC1C,CAAC,CAAC;gBAEH,OAAO;oBACL,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,oBAAoB,EAAE,OAAO,CAAC,kBAAkB;oBAChD,IAAI,EAAE,OAAO,CAAC,IAAI;iBACnB,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;AACH,CAAC"}
@@ -13,11 +13,11 @@ import type { AgentChatCliOptions, AgentChatExecutionOutcome, AgentChatSessionOp
13
13
  import type { AgentChatInteractiveRendererPort } from "../types/AgentChatInteractive.js";
14
14
  export type ResolvedAgentChatTarget = {
15
15
  /** 目标 agent id。 */
16
- agentId: string;
16
+ agent_id: string;
17
17
  /** 目标项目根目录。 */
18
- projectRoot: string;
19
- /** 当前 chat 绑定的 sessionId。 */
20
- sessionId: string;
18
+ project_root: string;
19
+ /** 当前 chat 绑定的 session_id。 */
20
+ session_id: string;
21
21
  /** 当前 chat 是否要求创建全新的 session。 */
22
22
  createNewSession: boolean;
23
23
  };
@@ -49,11 +49,11 @@ export declare function resolveAgentChatTarget(agentIdInput: string, sessionOpti
49
49
  }>;
50
50
  export declare function printAssistantReply(replyText: string): void;
51
51
  export declare function printAgentChatFailure(params: {
52
- agentId: string;
52
+ agent_id: string;
53
53
  error?: string;
54
54
  }): void;
55
55
  export declare function resolveInteractiveChatSession(params: {
56
- agentId: string;
56
+ agent_id: string;
57
57
  options: AgentChatCliOptions;
58
58
  transport?: {
59
59
  host?: string;
@@ -68,7 +68,7 @@ export declare function resolveInteractiveChatSession(params: {
68
68
  error?: string;
69
69
  }>;
70
70
  export declare function runSdkPromptTurn(params: {
71
- agentId: string;
71
+ agent_id: string;
72
72
  message: string;
73
73
  sessionOptions?: AgentChatSessionOptions;
74
74
  transport?: {
@@ -81,15 +81,15 @@ export declare function runSdkPromptTurn(params: {
81
81
  success: boolean;
82
82
  error?: string;
83
83
  emittedVisibleText: boolean;
84
- sessionId: string;
85
- projectRoot?: string;
84
+ session_id: string;
85
+ project_root?: string;
86
86
  text?: string;
87
87
  }>;
88
88
  /**
89
89
  * 向目标 agent 的 SDK actor session 发送一轮消息。
90
90
  */
91
91
  export declare function executeAgentChatTurn(params: {
92
- agentId: string;
92
+ agent_id: string;
93
93
  message: string;
94
94
  sessionOptions?: AgentChatSessionOptions;
95
95
  transport?: {
@@ -98,7 +98,7 @@ export declare function executeAgentChatTurn(params: {
98
98
  };
99
99
  }): Promise<AgentChatExecutionOutcome>;
100
100
  export declare function runOneShotChat(params: {
101
- agentId: string;
101
+ agent_id: string;
102
102
  message: string;
103
103
  options: AgentChatCliOptions;
104
104
  }): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"AgentChatHelpers.d.ts","sourceRoot":"","sources":["../../../src/city/agent/AgentChatHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,WAAW,E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,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,gCAAgC,CAAC;CACxD,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CA4HD;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC,SAAS,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAyCrC;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,mBAAmB,CAAC;CAC9B,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDhB"}
@@ -12,7 +12,7 @@ import prompts from "../tui/Prompts.js";
12
12
  import { emitCliBlock } from "../../shared/CliReporter.js";
13
13
  import { printResult } from "../utils/cli/CliOutput.js";
14
14
  import { resolveProjectRootByAgentId, validateAgentProjectRoot, } from "../shared/PluginTargetSupport.js";
15
- import { listRegisteredAgentsForCli } from "./AgentSelection.js";
15
+ import { list_registered_agents_for_cli } from "./AgentSelection.js";
16
16
  import { createAgentChatSessionId, createRemoteAgent, createRemoteChatSession, getOrCreateRemoteSession, buildAgentChatFailureText, listRemoteChatSessions, } from "./AgentChatRemote.js";
17
17
  import { AGENT_CHAT_DEFAULT_SESSION_ID, } from "./AgentChatTypes.js";
18
18
  export function normalizeChatMessage(input) {
@@ -27,7 +27,7 @@ export function normalizeChatMessage(input) {
27
27
  * - `--session-id` 与 `--new-session` 互斥,避免“复用”和“新建”语义冲突。
28
28
  */
29
29
  export function resolveAgentChatSessionOptions(input) {
30
- const explicit_session_id = String(input?.sessionId || "").trim();
30
+ const explicit_session_id = String(input?.session_id || "").trim();
31
31
  const should_create_new_session = input?.newSession === true;
32
32
  if (explicit_session_id && should_create_new_session) {
33
33
  return {
@@ -49,7 +49,7 @@ export function resolveAgentChatSessionOptions(input) {
49
49
  };
50
50
  }
51
51
  export function hasExplicitSessionSelection(input) {
52
- return Boolean(String(input.sessionId || "").trim() || input.newSession === true);
52
+ return Boolean(String(input.session_id || "").trim() || input.newSession === true);
53
53
  }
54
54
  export async function resolveChatTargetAgentId(inputId) {
55
55
  const explicit = String(inputId || "").trim();
@@ -58,103 +58,103 @@ export async function resolveChatTargetAgentId(inputId) {
58
58
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
59
59
  emitCliBlock({
60
60
  tone: "error",
61
- title: "Agent id is required",
61
+ title: "Agent ID is required",
62
62
  note: "Use `city agent chat --to <id>` or run this command in an interactive terminal.",
63
63
  });
64
64
  return null;
65
65
  }
66
- const runningAgents = (await listRegisteredAgentsForCli()).filter((item) => item.status === "running");
67
- if (runningAgents.length === 0) {
66
+ const registered_agents = await list_registered_agents_for_cli();
67
+ if (registered_agents.length === 0) {
68
68
  emitCliBlock({
69
69
  tone: "error",
70
- title: "No running agents",
71
- note: "Run `city agent start` first.",
70
+ title: "No managed agents",
71
+ note: "Run `city agent create <workspace_path>` first.",
72
72
  });
73
73
  return null;
74
74
  }
75
75
  const response = (await prompts({
76
76
  type: "select",
77
- name: "agentId",
77
+ name: "agent_id",
78
78
  message: "选择要聊天的 Agent",
79
- choices: runningAgents.map((agent) => ({
80
- title: agent.id,
81
- description: agent.projectRoot,
82
- value: agent.id,
79
+ choices: registered_agents.map((agent) => ({
80
+ title: agent.agent_id,
81
+ description: `${agent.status} · ${agent.workspace_path}`,
82
+ value: agent.agent_id,
83
83
  })),
84
84
  initial: 0,
85
85
  }));
86
- const agentId = String(response.agentId || "").trim();
87
- if (!agentId) {
86
+ const agent_id = String(response.agent_id || "").trim();
87
+ if (!agent_id) {
88
88
  emitCliBlock({
89
89
  tone: "info",
90
90
  title: "Agent chat cancelled",
91
91
  });
92
92
  return null;
93
93
  }
94
- return agentId;
94
+ return agent_id;
95
95
  }
96
96
  export async function resolveAgentChatTarget(agentIdInput, sessionOptions) {
97
- const agentId = String(agentIdInput || "").trim();
97
+ const agent_id = String(agentIdInput || "").trim();
98
98
  const resolved_session = resolveAgentChatSessionOptions(sessionOptions);
99
- const sessionId = resolved_session.success
99
+ const session_id = resolved_session.success
100
100
  ? resolved_session.session_id
101
101
  : AGENT_CHAT_DEFAULT_SESSION_ID;
102
102
  if (!resolved_session.success) {
103
103
  return {
104
104
  success: false,
105
105
  outcome: {
106
- agentId,
107
- sessionId,
106
+ agent_id,
107
+ session_id,
108
108
  success: false,
109
109
  error: resolved_session.error,
110
110
  },
111
111
  };
112
112
  }
113
- if (!agentId) {
113
+ if (!agent_id) {
114
114
  return {
115
115
  success: false,
116
116
  outcome: {
117
- agentId: "",
118
- sessionId,
117
+ agent_id: "",
118
+ session_id,
119
119
  success: false,
120
120
  error: "Missing target agent id.",
121
121
  },
122
122
  };
123
123
  }
124
- const resolved = await resolveProjectRootByAgentId(agentId);
125
- if (!resolved.projectRoot) {
124
+ const resolved = await resolveProjectRootByAgentId(agent_id);
125
+ if (!resolved.project_root) {
126
126
  return {
127
127
  success: false,
128
128
  outcome: {
129
- agentId,
130
- sessionId,
129
+ agent_id,
130
+ session_id,
131
131
  success: false,
132
132
  error: resolved.error || "Failed to resolve agent project path",
133
133
  },
134
134
  };
135
135
  }
136
- const pathError = validateAgentProjectRoot(resolved.projectRoot);
136
+ const pathError = validateAgentProjectRoot(resolved.project_root);
137
137
  if (pathError) {
138
138
  return {
139
139
  success: false,
140
140
  outcome: {
141
- agentId,
142
- projectRoot: resolved.projectRoot,
143
- sessionId,
141
+ agent_id,
142
+ project_root: resolved.project_root,
143
+ session_id,
144
144
  success: false,
145
145
  error: pathError,
146
146
  },
147
147
  };
148
148
  }
149
- const registeredAgents = await listRegisteredAgentsForCli();
150
- const registeredAgent = registeredAgents.find((item) => item.projectRoot === resolved.projectRoot || item.id === agentId);
149
+ const registeredAgents = await list_registered_agents_for_cli();
150
+ const registeredAgent = registeredAgents.find((item) => item.workspace_path === resolved.project_root || item.agent_id === agent_id);
151
151
  if (registeredAgent && registeredAgent.status !== "running") {
152
152
  return {
153
153
  success: false,
154
154
  outcome: {
155
- agentId,
156
- projectRoot: resolved.projectRoot,
157
- sessionId,
155
+ agent_id,
156
+ project_root: resolved.project_root,
157
+ session_id,
158
158
  success: false,
159
159
  error: "Agent is not running. Run `city agent start` first.",
160
160
  },
@@ -163,9 +163,9 @@ export async function resolveAgentChatTarget(agentIdInput, sessionOptions) {
163
163
  return {
164
164
  success: true,
165
165
  target: {
166
- agentId,
167
- projectRoot: resolved.projectRoot,
168
- sessionId,
166
+ agent_id,
167
+ project_root: resolved.project_root,
168
+ session_id,
169
169
  createNewSession: resolved_session.create_new_session,
170
170
  },
171
171
  };
@@ -189,7 +189,7 @@ export function printAgentChatFailure(params) {
189
189
  facts: [
190
190
  {
191
191
  label: "agent",
192
- value: params.agentId,
192
+ value: params.agent_id,
193
193
  },
194
194
  {
195
195
  label: "error",
@@ -206,8 +206,8 @@ export async function resolveInteractiveChatSession(params) {
206
206
  error: preselected_session.error,
207
207
  };
208
208
  }
209
- const resolved = await resolveAgentChatTarget(params.agentId, {
210
- sessionId: preselected_session.session_id,
209
+ const resolved = await resolveAgentChatTarget(params.agent_id, {
210
+ session_id: preselected_session.session_id,
211
211
  newSession: false,
212
212
  });
213
213
  if (!resolved.success) {
@@ -218,7 +218,7 @@ export async function resolveInteractiveChatSession(params) {
218
218
  }
219
219
  resolved.target.createNewSession = preselected_session.create_new_session;
220
220
  const remote_agent = await createRemoteAgent({
221
- projectRoot: resolved.target.projectRoot,
221
+ agent_id: resolved.target.agent_id,
222
222
  transport: params.transport,
223
223
  });
224
224
  if (hasExplicitSessionSelection(params.options)) {
@@ -227,7 +227,7 @@ export async function resolveInteractiveChatSession(params) {
227
227
  remote_agent,
228
228
  session_id: preselected_session.session_id,
229
229
  });
230
- resolved.target.sessionId = created.session_id;
230
+ resolved.target.session_id = created.session_id;
231
231
  resolved.target.createNewSession = false;
232
232
  }
233
233
  return {
@@ -241,7 +241,7 @@ export async function resolveInteractiveChatSession(params) {
241
241
  // 用户仍可在 TUI 内通过 /session 命令随时切换。
242
242
  const latest_session_id = await resolveLatestChatSessionId({ remote_agent });
243
243
  if (latest_session_id) {
244
- resolved.target.sessionId = latest_session_id;
244
+ resolved.target.session_id = latest_session_id;
245
245
  }
246
246
  return {
247
247
  success: true,
@@ -253,7 +253,7 @@ export async function resolveInteractiveChatSession(params) {
253
253
  * 解析最近活跃的 chat session id。
254
254
  *
255
255
  * 说明(中文)
256
- * - 按 `updatedAt` 取最新的会话;缺失 `updatedAt` 视为最旧。
256
+ * - 按 `updated_at` 取最新的会话;缺失 `updated_at` 视为最旧。
257
257
  * - 列表为空时返回 null,由调用方回落到默认 session。
258
258
  *
259
259
  * @param params.remote_agent 远程 agent 句柄。
@@ -272,11 +272,11 @@ async function resolveLatestChatSessionId(params) {
272
272
  }
273
273
  let latest = sessions[0];
274
274
  for (const candidate of sessions) {
275
- if ((candidate.updatedAt ?? 0) > (latest.updatedAt ?? 0)) {
275
+ if ((candidate.updated_at ?? 0) > (latest.updated_at ?? 0)) {
276
276
  latest = candidate;
277
277
  }
278
278
  }
279
- return latest.sessionId;
279
+ return latest.session_id;
280
280
  }
281
281
  export async function runSdkPromptTurn(params) {
282
282
  const message = normalizeChatMessage(params.message);
@@ -286,30 +286,30 @@ export async function runSdkPromptTurn(params) {
286
286
  success: false,
287
287
  error: "Chat message is required.",
288
288
  emittedVisibleText: false,
289
- sessionId: resolved_session.success
289
+ session_id: resolved_session.success
290
290
  ? resolved_session.session_id
291
291
  : AGENT_CHAT_DEFAULT_SESSION_ID,
292
292
  text: "",
293
293
  };
294
294
  }
295
- const resolved = await resolveAgentChatTarget(params.agentId, params.sessionOptions);
295
+ const resolved = await resolveAgentChatTarget(params.agent_id, params.sessionOptions);
296
296
  if (!resolved.success) {
297
297
  return {
298
298
  success: false,
299
299
  error: resolved.outcome.error,
300
300
  emittedVisibleText: false,
301
- sessionId: resolved.outcome.sessionId,
302
- ...(resolved.outcome.projectRoot ? { projectRoot: resolved.outcome.projectRoot } : {}),
301
+ session_id: resolved.outcome.session_id,
302
+ ...(resolved.outcome.project_root ? { project_root: resolved.outcome.project_root } : {}),
303
303
  text: "",
304
304
  };
305
305
  }
306
306
  const remote_agent = await createRemoteAgent({
307
- projectRoot: resolved.target.projectRoot,
307
+ agent_id: resolved.target.agent_id,
308
308
  transport: params.transport,
309
309
  });
310
310
  const session = await getOrCreateRemoteSession({
311
311
  remote_agent,
312
- session_id: resolved.target.sessionId,
312
+ session_id: resolved.target.session_id,
313
313
  create_new_session: resolved.target.createNewSession,
314
314
  });
315
315
  let printed_leading_newline = false;
@@ -371,8 +371,8 @@ export async function runSdkPromptTurn(params) {
371
371
  success: result.success,
372
372
  ...(result.error ? { error: result.error } : {}),
373
373
  emittedVisibleText: emitted_visible_text,
374
- sessionId: resolved.target.sessionId,
375
- projectRoot: resolved.target.projectRoot,
374
+ session_id: resolved.target.session_id,
375
+ project_root: resolved.target.project_root,
376
376
  text: final_text,
377
377
  };
378
378
  }
@@ -388,8 +388,8 @@ export async function runSdkPromptTurn(params) {
388
388
  success: false,
389
389
  error: error instanceof Error ? error.message : String(error),
390
390
  emittedVisibleText: emitted_visible_text,
391
- sessionId: resolved.target.sessionId,
392
- projectRoot: resolved.target.projectRoot,
391
+ session_id: resolved.target.session_id,
392
+ project_root: resolved.target.project_root,
393
393
  text: final_text,
394
394
  };
395
395
  }
@@ -404,32 +404,32 @@ export async function runSdkPromptTurn(params) {
404
404
  export async function executeAgentChatTurn(params) {
405
405
  const message = normalizeChatMessage(params.message);
406
406
  const resolved_session = resolveAgentChatSessionOptions(params.sessionOptions);
407
- const sessionId = resolved_session.success
407
+ const session_id = resolved_session.success
408
408
  ? resolved_session.session_id
409
409
  : AGENT_CHAT_DEFAULT_SESSION_ID;
410
410
  if (!message) {
411
411
  return {
412
- agentId: String(params.agentId || "").trim(),
413
- sessionId,
412
+ agent_id: String(params.agent_id || "").trim(),
413
+ session_id,
414
414
  success: false,
415
415
  error: "Chat message is required.",
416
416
  };
417
417
  }
418
418
  const outcome = await runSdkPromptTurn({
419
- agentId: params.agentId,
419
+ agent_id: params.agent_id,
420
420
  message,
421
421
  sessionOptions: params.sessionOptions,
422
422
  transport: params.transport,
423
423
  renderText: false,
424
424
  });
425
425
  return {
426
- agentId: params.agentId,
427
- ...(outcome.projectRoot ? { projectRoot: outcome.projectRoot } : {}),
428
- sessionId: outcome.sessionId,
426
+ agent_id: params.agent_id,
427
+ ...(outcome.project_root ? { project_root: outcome.project_root } : {}),
428
+ session_id: outcome.session_id,
429
429
  success: outcome.success,
430
430
  payload: {
431
431
  success: outcome.success,
432
- sessionId: outcome.sessionId,
432
+ session_id: outcome.session_id,
433
433
  result: {
434
434
  success: outcome.success,
435
435
  userVisible: outcome.text || "",
@@ -443,10 +443,10 @@ export async function executeAgentChatTurn(params) {
443
443
  export async function runOneShotChat(params) {
444
444
  if (params.options.json === true) {
445
445
  const outcome = await executeAgentChatTurn({
446
- agentId: params.agentId,
446
+ agent_id: params.agent_id,
447
447
  message: params.message,
448
448
  sessionOptions: {
449
- sessionId: params.options.sessionId,
449
+ session_id: params.options.session_id,
450
450
  newSession: params.options.newSession,
451
451
  },
452
452
  transport: {
@@ -459,9 +459,9 @@ export async function runOneShotChat(params) {
459
459
  success: outcome.success,
460
460
  title: "agent chat",
461
461
  payload: {
462
- agent: params.agentId,
463
- ...(outcome.projectRoot ? { projectRoot: outcome.projectRoot } : {}),
464
- sessionId: outcome.sessionId,
462
+ agent: params.agent_id,
463
+ ...(outcome.project_root ? { project_root: outcome.project_root } : {}),
464
+ session_id: outcome.session_id,
465
465
  ...(outcome.payload?.result ? { result: outcome.payload.result } : {}),
466
466
  ...(outcome.error ? { error: outcome.error } : {}),
467
467
  },
@@ -469,10 +469,10 @@ export async function runOneShotChat(params) {
469
469
  return;
470
470
  }
471
471
  const outcome = await runSdkPromptTurn({
472
- agentId: params.agentId,
472
+ agent_id: params.agent_id,
473
473
  message: params.message,
474
474
  sessionOptions: {
475
- sessionId: params.options.sessionId,
475
+ session_id: params.options.session_id,
476
476
  newSession: params.options.newSession,
477
477
  },
478
478
  transport: {
@@ -482,7 +482,7 @@ export async function runOneShotChat(params) {
482
482
  });
483
483
  if (!outcome.success) {
484
484
  printAgentChatFailure({
485
- agentId: params.agentId,
485
+ agent_id: params.agent_id,
486
486
  error: outcome.error,
487
487
  });
488
488
  return;