@downcity/agent 1.1.32 → 1.1.35

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 (854) hide show
  1. package/README.md +26 -84
  2. package/bin/config/Defaults.js +1 -1
  3. package/bin/config/Defaults.js.map +1 -1
  4. package/bin/config/DowncitySchema.d.ts.map +1 -1
  5. package/bin/config/DowncitySchema.js +2 -8
  6. package/bin/config/DowncitySchema.js.map +1 -1
  7. package/bin/config/Paths.d.ts +2 -2
  8. package/bin/config/Paths.js +2 -2
  9. package/bin/config/project/AgentInitializer.d.ts.map +1 -1
  10. package/bin/config/project/AgentInitializer.js +2 -2
  11. package/bin/config/project/AgentInitializer.js.map +1 -1
  12. package/bin/core/AgentContextTypes.d.ts +10 -10
  13. package/bin/core/AgentContextTypes.d.ts.map +1 -1
  14. package/bin/core/AgentContextTypes.js +1 -1
  15. package/bin/core/AgentCore.d.ts +14 -13
  16. package/bin/core/AgentCore.d.ts.map +1 -1
  17. package/bin/core/AgentCore.js +63 -90
  18. package/bin/core/AgentCore.js.map +1 -1
  19. package/bin/core/AgentCoreTypes.d.ts +4 -4
  20. package/bin/core/AgentCoreTypes.d.ts.map +1 -1
  21. package/bin/core/AgentCoreTypes.js +1 -1
  22. package/bin/{session → executor}/Executor.d.ts +4 -4
  23. package/bin/executor/Executor.d.ts.map +1 -0
  24. package/bin/executor/Executor.js.map +1 -0
  25. package/bin/{session → executor}/SessionRunScope.d.ts +5 -5
  26. package/bin/executor/SessionRunScope.d.ts.map +1 -0
  27. package/bin/{session → executor}/SessionRunScope.js +1 -1
  28. package/bin/executor/SessionRunScope.js.map +1 -0
  29. package/bin/{session → executor}/composer/compaction/SessionCompactionComposer.d.ts +1 -1
  30. package/bin/executor/composer/compaction/SessionCompactionComposer.d.ts.map +1 -0
  31. package/bin/executor/composer/compaction/SessionCompactionComposer.js.map +1 -0
  32. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts.map +1 -0
  33. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionComposer.js.map +1 -0
  34. package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts +2 -2
  35. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +1 -0
  36. package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +1 -0
  37. package/bin/{session → executor}/composer/context/LocalSessionContextComposer.d.ts +2 -2
  38. package/bin/executor/composer/context/LocalSessionContextComposer.d.ts.map +1 -0
  39. package/bin/executor/composer/context/LocalSessionContextComposer.js.map +1 -0
  40. package/bin/{session → executor}/composer/context/SessionContextComposer.d.ts +2 -2
  41. package/bin/executor/composer/context/SessionContextComposer.d.ts.map +1 -0
  42. package/bin/executor/composer/context/SessionContextComposer.js.map +1 -0
  43. package/bin/{session → executor}/composer/history/SessionHistoryComposer.d.ts +2 -2
  44. package/bin/executor/composer/history/SessionHistoryComposer.d.ts.map +1 -0
  45. package/bin/executor/composer/history/SessionHistoryComposer.js.map +1 -0
  46. package/bin/{session → executor}/composer/history/SessionHistoryWriter.d.ts +2 -2
  47. package/bin/executor/composer/history/SessionHistoryWriter.d.ts.map +1 -0
  48. package/bin/executor/composer/history/SessionHistoryWriter.js.map +1 -0
  49. package/bin/{session → executor}/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts +2 -2
  50. package/bin/executor/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts.map +1 -0
  51. package/bin/executor/composer/history/jsonl/JsonlSessionHistoryComposer.js.map +1 -0
  52. package/bin/executor/composer/system/SessionSystemComposer.d.ts.map +1 -0
  53. package/bin/executor/composer/system/SessionSystemComposer.js.map +1 -0
  54. package/bin/{session → executor}/composer/system/default/DefaultSessionSystemComposer.d.ts +1 -1
  55. package/bin/executor/composer/system/default/DefaultSessionSystemComposer.d.ts.map +1 -0
  56. package/bin/executor/composer/system/default/DefaultSessionSystemComposer.js.map +1 -0
  57. package/bin/executor/composer/system/default/InitPromptAssets.d.ts.map +1 -0
  58. package/bin/executor/composer/system/default/InitPromptAssets.js.map +1 -0
  59. package/bin/executor/composer/system/default/InitPrompts.d.ts.map +1 -0
  60. package/bin/executor/composer/system/default/InitPrompts.js.map +1 -0
  61. package/bin/executor/composer/system/default/PromptRenderer.d.ts.map +1 -0
  62. package/bin/executor/composer/system/default/PromptRenderer.js.map +1 -0
  63. package/bin/executor/composer/system/default/StaticPromptCatalog.d.ts.map +1 -0
  64. package/bin/executor/composer/system/default/StaticPromptCatalog.js.map +1 -0
  65. package/bin/{session → executor}/composer/system/default/SystemDomain.d.ts +9 -9
  66. package/bin/executor/composer/system/default/SystemDomain.d.ts.map +1 -0
  67. package/bin/{session → executor}/composer/system/default/SystemDomain.js +17 -17
  68. package/bin/executor/composer/system/default/SystemDomain.js.map +1 -0
  69. package/bin/executor/composer/system/default/SystemPromptAssets.d.ts.map +1 -0
  70. package/bin/executor/composer/system/default/SystemPromptAssets.js.map +1 -0
  71. package/bin/executor/composer/system/default/assets/core.prompt.d.ts.map +1 -0
  72. package/bin/{session → executor}/composer/system/default/assets/core.prompt.js +1 -1
  73. package/bin/executor/composer/system/default/assets/core.prompt.js.map +1 -0
  74. package/bin/executor/composer/system/default/assets/init/PROFILE.md.d.ts.map +1 -0
  75. package/bin/{session → executor}/composer/system/default/assets/init/PROFILE.md.js +1 -1
  76. package/bin/executor/composer/system/default/assets/init/PROFILE.md.js.map +1 -0
  77. package/bin/executor/composer/system/default/assets/init/SOUL.md.d.ts.map +1 -0
  78. package/bin/{session → executor}/composer/system/default/assets/init/SOUL.md.js +1 -1
  79. package/bin/executor/composer/system/default/assets/init/SOUL.md.js.map +1 -0
  80. package/bin/{session → executor}/composer/system/default/assets/plugin.prompt.d.ts +1 -1
  81. package/bin/executor/composer/system/default/assets/plugin.prompt.d.ts.map +1 -0
  82. package/bin/executor/composer/system/default/assets/plugin.prompt.js +8 -0
  83. package/bin/executor/composer/system/default/assets/plugin.prompt.js.map +1 -0
  84. package/bin/executor/composer/system/default/assets/task.prompt.d.ts.map +1 -0
  85. package/bin/{session → executor}/composer/system/default/assets/task.prompt.js +1 -1
  86. package/bin/executor/composer/system/default/assets/task.prompt.js.map +1 -0
  87. package/bin/executor/composer/system/default/variables/GeoContext.d.ts.map +1 -0
  88. package/bin/executor/composer/system/default/variables/GeoContext.js.map +1 -0
  89. package/bin/executor/composer/system/default/variables/PromptTypes.d.ts.map +1 -0
  90. package/bin/executor/composer/system/default/variables/PromptTypes.js.map +1 -0
  91. package/bin/executor/composer/system/default/variables/VariableReplacer.d.ts.map +1 -0
  92. package/bin/executor/composer/system/default/variables/VariableReplacer.js.map +1 -0
  93. package/bin/executor/core-engine/CoreEngineError.d.ts.map +1 -0
  94. package/bin/executor/core-engine/CoreEngineError.js.map +1 -0
  95. package/bin/{session → executor}/core-engine/CoreEngineLoopDecision.d.ts +1 -1
  96. package/bin/executor/core-engine/CoreEngineLoopDecision.d.ts.map +1 -0
  97. package/bin/executor/core-engine/CoreEngineLoopDecision.js.map +1 -0
  98. package/bin/{session → executor}/core-engine/CoreEngineMessageState.d.ts +1 -1
  99. package/bin/executor/core-engine/CoreEngineMessageState.d.ts.map +1 -0
  100. package/bin/executor/core-engine/CoreEngineMessageState.js.map +1 -0
  101. package/bin/{session → executor}/core-engine/CoreEngineSignals.d.ts +1 -1
  102. package/bin/executor/core-engine/CoreEngineSignals.d.ts.map +1 -0
  103. package/bin/executor/core-engine/CoreEngineSignals.js.map +1 -0
  104. package/bin/{session → executor}/core-engine/CoreEngineUiStreamCollector.d.ts +1 -1
  105. package/bin/executor/core-engine/CoreEngineUiStreamCollector.d.ts.map +1 -0
  106. package/bin/executor/core-engine/CoreEngineUiStreamCollector.js.map +1 -0
  107. package/bin/executor/ids/resolveSessionId.d.ts.map +1 -0
  108. package/bin/executor/ids/resolveSessionId.js.map +1 -0
  109. package/bin/{session → executor}/messages/AssistantResultPersistence.d.ts +1 -1
  110. package/bin/executor/messages/AssistantResultPersistence.d.ts.map +1 -0
  111. package/bin/executor/messages/AssistantResultPersistence.js.map +1 -0
  112. package/bin/{session → executor}/messages/SessionAttachmentMapper.d.ts +1 -1
  113. package/bin/executor/messages/SessionAttachmentMapper.d.ts.map +1 -0
  114. package/bin/executor/messages/SessionAttachmentMapper.js.map +1 -0
  115. package/bin/{session → executor}/messages/SessionMessageCodec.d.ts +1 -1
  116. package/bin/executor/messages/SessionMessageCodec.d.ts.map +1 -0
  117. package/bin/executor/messages/SessionMessageCodec.js.map +1 -0
  118. package/bin/{session → executor}/messages/SessionMessageLog.d.ts +1 -1
  119. package/bin/executor/messages/SessionMessageLog.d.ts.map +1 -0
  120. package/bin/executor/messages/SessionMessageLog.js.map +1 -0
  121. package/bin/{session → executor}/messages/SessionStepEventMapper.d.ts +1 -1
  122. package/bin/executor/messages/SessionStepEventMapper.d.ts.map +1 -0
  123. package/bin/executor/messages/SessionStepEventMapper.js.map +1 -0
  124. package/bin/{session → executor}/store/history/SessionHistoryStore.d.ts +2 -2
  125. package/bin/executor/store/history/SessionHistoryStore.d.ts.map +1 -0
  126. package/bin/executor/store/history/SessionHistoryStore.js.map +1 -0
  127. package/bin/{session → executor}/store/history/jsonl/JsonlSessionHistoryStore.d.ts +3 -3
  128. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +1 -0
  129. package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js.map +1 -0
  130. package/bin/{session → executor}/tools/shell/ShellToolBridge.d.ts +5 -5
  131. package/bin/executor/tools/shell/ShellToolBridge.d.ts.map +1 -0
  132. package/bin/{session → executor}/tools/shell/ShellToolBridge.js +3 -3
  133. package/bin/executor/tools/shell/ShellToolBridge.js.map +1 -0
  134. package/bin/{session → executor}/tools/shell/ShellToolDefinition.d.ts +2 -2
  135. package/bin/executor/tools/shell/ShellToolDefinition.d.ts.map +1 -0
  136. package/bin/{session → executor}/tools/shell/ShellToolDefinition.js +2 -2
  137. package/bin/executor/tools/shell/ShellToolDefinition.js.map +1 -0
  138. package/bin/{session → executor}/tools/shell/ShellToolFormatting.d.ts +2 -2
  139. package/bin/executor/tools/shell/ShellToolFormatting.d.ts.map +1 -0
  140. package/bin/{session → executor}/tools/shell/ShellToolFormatting.js +2 -2
  141. package/bin/executor/tools/shell/ShellToolFormatting.js.map +1 -0
  142. package/bin/executor/tools/shell/ShellToolSchemas.d.ts.map +1 -0
  143. package/bin/{session → executor}/tools/shell/ShellToolSchemas.js +1 -1
  144. package/bin/executor/tools/shell/ShellToolSchemas.js.map +1 -0
  145. package/bin/{session → executor}/types/SessionExecutor.d.ts +1 -1
  146. package/bin/executor/types/SessionExecutor.d.ts.map +1 -0
  147. package/bin/executor/types/SessionExecutor.js.map +1 -0
  148. package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -0
  149. package/bin/executor/types/SessionHistoryMeta.js.map +1 -0
  150. package/bin/executor/types/SessionHistoryPaths.d.ts.map +1 -0
  151. package/bin/executor/types/SessionHistoryPaths.js.map +1 -0
  152. package/bin/executor/types/SessionLoop.d.ts.map +1 -0
  153. package/bin/executor/types/SessionLoop.js.map +1 -0
  154. package/bin/executor/types/SessionMessages.d.ts.map +1 -0
  155. package/bin/executor/types/SessionMessages.js.map +1 -0
  156. package/bin/executor/types/SessionPrompts.d.ts.map +1 -0
  157. package/bin/executor/types/SessionPrompts.js.map +1 -0
  158. package/bin/{session → executor}/types/SessionRun.d.ts +2 -2
  159. package/bin/executor/types/SessionRun.d.ts.map +1 -0
  160. package/bin/executor/types/SessionRun.js.map +1 -0
  161. package/bin/index.d.ts +26 -26
  162. package/bin/index.d.ts.map +1 -1
  163. package/bin/index.js +19 -19
  164. package/bin/index.js.map +1 -1
  165. package/bin/plugin/builtins/asr/Plugin.d.ts +7 -3
  166. package/bin/plugin/builtins/asr/Plugin.d.ts.map +1 -1
  167. package/bin/plugin/builtins/asr/Plugin.js +404 -394
  168. package/bin/plugin/builtins/asr/Plugin.js.map +1 -1
  169. package/bin/plugin/builtins/auth/Plugin.d.ts +7 -3
  170. package/bin/plugin/builtins/auth/Plugin.d.ts.map +1 -1
  171. package/bin/plugin/builtins/auth/Plugin.js +133 -123
  172. package/bin/plugin/builtins/auth/Plugin.js.map +1 -1
  173. package/bin/plugin/builtins/chat/Action.d.ts +4 -4
  174. package/bin/plugin/builtins/chat/Action.js +5 -5
  175. package/bin/plugin/builtins/chat/Action.js.map +1 -1
  176. package/bin/plugin/builtins/chat/ChatPlugin.js +3 -3
  177. package/bin/plugin/builtins/chat/ChatPlugin.js.map +1 -1
  178. package/bin/plugin/builtins/chat/ChatPluginTypes.d.ts +1 -1
  179. package/bin/plugin/builtins/chat/PROMPT.direct.d.ts +1 -1
  180. package/bin/plugin/builtins/chat/PROMPT.direct.d.ts.map +1 -1
  181. package/bin/plugin/builtins/chat/PROMPT.direct.js +1 -1
  182. package/bin/plugin/builtins/chat/PROMPT.direct.js.map +1 -1
  183. package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.d.ts → ChannelAccountManager.d.ts} +4 -4
  184. package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.d.ts.map → ChannelAccountManager.d.ts.map} +1 -1
  185. package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.js → ChannelAccountManager.js} +4 -4
  186. package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.js.map → ChannelAccountManager.js.map} +1 -1
  187. package/bin/plugin/builtins/chat/channels/feishu/types/FeishuChannel.d.ts +1 -1
  188. package/bin/plugin/builtins/chat/channels/feishu/types/FeishuChannel.js +1 -1
  189. package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.d.ts +1 -1
  190. package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.d.ts.map +1 -1
  191. package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.js +1 -1
  192. package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.js.map +1 -1
  193. package/bin/plugin/builtins/chat/channels/qq/types/QqChannel.d.ts +1 -1
  194. package/bin/plugin/builtins/chat/channels/qq/types/QqChannel.js +1 -1
  195. package/bin/plugin/builtins/chat/runtime/ChatActionExecution.d.ts +1 -1
  196. package/bin/plugin/builtins/chat/runtime/ChatActionExecution.js +2 -2
  197. package/bin/plugin/builtins/chat/runtime/ChatActionExecution.js.map +1 -1
  198. package/bin/plugin/builtins/chat/runtime/ChatActionInput.d.ts +1 -1
  199. package/bin/plugin/builtins/chat/runtime/ChatActionInput.js +1 -1
  200. package/bin/plugin/builtins/chat/runtime/ChatChannelConfig.js +8 -8
  201. package/bin/plugin/builtins/chat/runtime/ChatChannelConfig.js.map +1 -1
  202. package/bin/plugin/builtins/chat/runtime/ChatChannelCore.js +11 -11
  203. package/bin/plugin/builtins/chat/runtime/ChatChannelCore.js.map +1 -1
  204. package/bin/plugin/builtins/chat/runtime/ChatChannelFacade.d.ts +1 -1
  205. package/bin/plugin/builtins/chat/runtime/ChatChannelFacade.js +1 -1
  206. package/bin/plugin/builtins/chat/runtime/ChatChannelLifecycle.d.ts +1 -1
  207. package/bin/plugin/builtins/chat/runtime/ChatChannelLifecycle.js +1 -1
  208. package/bin/plugin/builtins/chat/runtime/ChatMetaStore.d.ts +2 -2
  209. package/bin/plugin/builtins/chat/runtime/ChatMetaStore.js +2 -2
  210. package/bin/plugin/builtins/chat/runtime/ChatPluginActionRegistry.d.ts +3 -3
  211. package/bin/plugin/builtins/chat/runtime/ChatPluginActionRegistry.js +3 -3
  212. package/bin/plugin/builtins/chat/runtime/ChatPluginSystem.js +2 -2
  213. package/bin/plugin/builtins/chat/runtime/ChatPluginSystem.js.map +1 -1
  214. package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.d.ts +3 -3
  215. package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.d.ts.map +1 -1
  216. package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.js +4 -4
  217. package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.js.map +1 -1
  218. package/bin/plugin/builtins/chat/runtime/ChatQueueStore.d.ts +4 -4
  219. package/bin/plugin/builtins/chat/runtime/ChatQueueStore.js +4 -4
  220. package/bin/plugin/builtins/chat/runtime/ChatQueueStore.js.map +1 -1
  221. package/bin/plugin/builtins/chat/runtime/ChatQueueWorker.d.ts +3 -3
  222. package/bin/plugin/builtins/chat/runtime/ChatQueueWorker.js +3 -3
  223. package/bin/plugin/builtins/chat/runtime/ChatSession.d.ts +6 -6
  224. package/bin/plugin/builtins/chat/runtime/ChatSession.d.ts.map +1 -1
  225. package/bin/plugin/builtins/chat/runtime/ChatSession.js +1 -1
  226. package/bin/plugin/builtins/chat/runtime/ChatSession.js.map +1 -1
  227. package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.d.ts +3 -3
  228. package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.d.ts.map +1 -1
  229. package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.js +2 -2
  230. package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.js.map +1 -1
  231. package/bin/plugin/builtins/chat/runtime/ChatSessionTypes.d.ts +2 -2
  232. package/bin/plugin/builtins/chat/runtime/ChatSessionTypes.d.ts.map +1 -1
  233. package/bin/plugin/builtins/chat/runtime/ChatkeySend.d.ts +1 -1
  234. package/bin/plugin/builtins/chat/runtime/ChatkeySend.js +1 -1
  235. package/bin/plugin/builtins/chat/runtime/InboundAugment.d.ts +1 -1
  236. package/bin/plugin/builtins/chat/runtime/InboundAugment.js +1 -1
  237. package/bin/plugin/builtins/chat/runtime/PluginDispatch.d.ts +2 -2
  238. package/bin/plugin/builtins/chat/runtime/PluginDispatch.js +2 -2
  239. package/bin/plugin/builtins/chat/runtime/PluginPoints.d.ts +10 -10
  240. package/bin/plugin/builtins/chat/runtime/PluginPoints.js +10 -10
  241. package/bin/plugin/builtins/chat/runtime/SystemPrompt.js +1 -1
  242. package/bin/plugin/builtins/chat/runtime/SystemPrompt.js.map +1 -1
  243. package/bin/plugin/builtins/chat/runtime/UIMessageTransformer.d.ts +1 -1
  244. package/bin/plugin/builtins/chat/runtime/UIMessageTransformer.d.ts.map +1 -1
  245. package/bin/plugin/builtins/chat/runtime/UserVisibleText.d.ts +1 -1
  246. package/bin/plugin/builtins/chat/runtime/UserVisibleText.d.ts.map +1 -1
  247. package/bin/plugin/builtins/chat/types/ChannelContext.d.ts +1 -1
  248. package/bin/plugin/builtins/chat/types/ChannelContext.js +1 -1
  249. package/bin/plugin/builtins/chat/types/ChannelStatus.d.ts +1 -1
  250. package/bin/plugin/builtins/chat/types/ChatMessageMarkup.d.ts +1 -1
  251. package/bin/plugin/builtins/chat/types/ChatMessageMarkup.js +1 -1
  252. package/bin/plugin/builtins/chat/types/ChatMeta.d.ts +2 -2
  253. package/bin/plugin/builtins/chat/types/ChatMeta.js +2 -2
  254. package/bin/plugin/builtins/chat/types/ChatPlugin.d.ts +6 -6
  255. package/bin/plugin/builtins/chat/types/ChatPlugin.js +3 -3
  256. package/bin/plugin/builtins/chat/types/ChatPluginActionPayload.d.ts +2 -2
  257. package/bin/plugin/builtins/chat/types/ChatPluginActionPayload.js +2 -2
  258. package/bin/plugin/builtins/chat/types/ChatPromptContext.d.ts +2 -2
  259. package/bin/plugin/builtins/chat/types/ChatRuntime.d.ts +3 -3
  260. package/bin/plugin/builtins/chat/types/ChatRuntime.js +2 -2
  261. package/bin/plugin/builtins/contact/Action.d.ts +3 -3
  262. package/bin/plugin/builtins/contact/Action.js +2 -2
  263. package/bin/plugin/builtins/contact/ContactPlugin.js +2 -2
  264. package/bin/plugin/builtins/contact/ContactPlugin.js.map +1 -1
  265. package/bin/plugin/builtins/contact/runtime/ContactPromptAssets.d.ts +2 -2
  266. package/bin/plugin/builtins/contact/runtime/ContactPromptAssets.js +2 -2
  267. package/bin/plugin/builtins/contact/runtime/Paths.d.ts +1 -1
  268. package/bin/plugin/builtins/contact/runtime/Paths.js +1 -1
  269. package/bin/plugin/builtins/contact/runtime/RemoteClient.d.ts +1 -1
  270. package/bin/plugin/builtins/contact/runtime/RemoteClient.js +2 -2
  271. package/bin/plugin/builtins/contact/runtime/RemoteClient.js.map +1 -1
  272. package/bin/plugin/builtins/contact/types/ContactCheck.d.ts +2 -2
  273. package/bin/plugin/builtins/contact/types/ContactCheck.d.ts.map +1 -1
  274. package/bin/plugin/builtins/contact/types/ContactCommand.d.ts +1 -1
  275. package/bin/plugin/builtins/contact/types/ContactCommand.js +1 -1
  276. package/bin/plugin/builtins/memory/MemoryPlugin.d.ts +1 -1
  277. package/bin/plugin/builtins/memory/MemoryPlugin.js +1 -1
  278. package/bin/plugin/builtins/memory/runtime/Search.js +1 -1
  279. package/bin/plugin/builtins/memory/runtime/Search.js.map +1 -1
  280. package/bin/plugin/builtins/memory/runtime/Store.d.ts +3 -3
  281. package/bin/plugin/builtins/memory/runtime/Store.js +3 -3
  282. package/bin/plugin/builtins/shell/ShellRuntimeTypes.d.ts +4 -4
  283. package/bin/plugin/builtins/shell/ShellRuntimeTypes.js +3 -3
  284. package/bin/plugin/builtins/shell/runtime/ShellActionRuntime.d.ts +2 -2
  285. package/bin/plugin/builtins/shell/runtime/ShellActionRuntime.js +2 -2
  286. package/bin/plugin/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts +2 -2
  287. package/bin/plugin/builtins/shell/runtime/ShellActionRuntimeSupport.js +2 -2
  288. package/bin/plugin/builtins/shell/runtime/ShellProcessEvents.d.ts +1 -1
  289. package/bin/plugin/builtins/shell/runtime/ShellRuntimeEnvironment.js +1 -1
  290. package/bin/plugin/builtins/shell/runtime/ShellRuntimeEnvironment.js.map +1 -1
  291. package/bin/plugin/builtins/shell/types/ShellPlugin.d.ts +4 -4
  292. package/bin/plugin/builtins/shell/types/ShellPlugin.js +2 -2
  293. package/bin/plugin/builtins/skill/Plugin.d.ts +8 -4
  294. package/bin/plugin/builtins/skill/Plugin.d.ts.map +1 -1
  295. package/bin/plugin/builtins/skill/Plugin.js +215 -205
  296. package/bin/plugin/builtins/skill/Plugin.js.map +1 -1
  297. package/bin/plugin/builtins/skill/runtime/SystemProvider.js +1 -1
  298. package/bin/plugin/builtins/skill/runtime/SystemProvider.js.map +1 -1
  299. package/bin/plugin/builtins/task/PROMPT.d.ts +1 -1
  300. package/bin/plugin/builtins/task/PROMPT.d.ts.map +1 -1
  301. package/bin/plugin/builtins/task/PROMPT.js +1 -1
  302. package/bin/plugin/builtins/task/PROMPT.js.map +1 -1
  303. package/bin/plugin/builtins/task/Scheduler.d.ts +4 -4
  304. package/bin/plugin/builtins/task/Scheduler.d.ts.map +1 -1
  305. package/bin/plugin/builtins/task/Scheduler.js +2 -2
  306. package/bin/plugin/builtins/task/runtime/CronTrigger.d.ts +4 -4
  307. package/bin/plugin/builtins/task/runtime/CronTrigger.d.ts.map +1 -1
  308. package/bin/plugin/builtins/task/runtime/CronTrigger.js +2 -2
  309. package/bin/plugin/builtins/task/runtime/CronTrigger.js.map +1 -1
  310. package/bin/plugin/builtins/task/runtime/TaskActionExecution.d.ts +1 -1
  311. package/bin/plugin/builtins/task/runtime/TaskActionExecution.js +1 -1
  312. package/bin/plugin/builtins/task/runtime/TaskActionInput.d.ts +1 -1
  313. package/bin/plugin/builtins/task/runtime/TaskActionInput.js +2 -2
  314. package/bin/plugin/builtins/task/runtime/TaskActionInput.js.map +1 -1
  315. package/bin/plugin/builtins/task/runtime/TaskPluginActionRegistry.d.ts +3 -3
  316. package/bin/plugin/builtins/task/runtime/TaskPluginActionRegistry.js +3 -3
  317. package/bin/plugin/builtins/task/runtime/TaskPromptAssets.d.ts.map +1 -1
  318. package/bin/plugin/builtins/task/runtime/TaskPromptAssets.js +2 -2
  319. package/bin/plugin/builtins/task/runtime/TaskPromptAssets.js.map +1 -1
  320. package/bin/plugin/builtins/task/runtime/TaskRunChatDispatch.d.ts +2 -2
  321. package/bin/plugin/builtins/task/runtime/TaskRunChatDispatch.js +2 -2
  322. package/bin/plugin/builtins/task/runtime/TaskRunnerRound.d.ts +1 -1
  323. package/bin/plugin/builtins/task/runtime/TaskRunnerRound.d.ts.map +1 -1
  324. package/bin/plugin/builtins/task/runtime/TaskRunnerRound.js +1 -1
  325. package/bin/plugin/builtins/task/runtime/TaskRunnerRound.js.map +1 -1
  326. package/bin/plugin/builtins/task/runtime/TaskRunnerSession.d.ts +1 -1
  327. package/bin/plugin/builtins/task/runtime/TaskRunnerSession.d.ts.map +1 -1
  328. package/bin/plugin/builtins/task/runtime/TaskRunnerSession.js +8 -8
  329. package/bin/plugin/builtins/task/runtime/TaskRunnerSession.js.map +1 -1
  330. package/bin/plugin/builtins/task/runtime/TaskRunnerTypes.d.ts +2 -2
  331. package/bin/plugin/builtins/task/runtime/TaskRunnerTypes.d.ts.map +1 -1
  332. package/bin/plugin/builtins/task/types/Cron.d.ts +3 -3
  333. package/bin/plugin/builtins/task/types/Cron.d.ts.map +1 -1
  334. package/bin/plugin/builtins/task/types/TaskPluginTypes.d.ts +3 -3
  335. package/bin/plugin/builtins/task/types/TaskPluginTypes.js +3 -3
  336. package/bin/plugin/builtins/tts/Plugin.d.ts +7 -3
  337. package/bin/plugin/builtins/tts/Plugin.d.ts.map +1 -1
  338. package/bin/plugin/builtins/tts/Plugin.js +419 -409
  339. package/bin/plugin/builtins/tts/Plugin.js.map +1 -1
  340. package/bin/plugin/builtins/web/Plugin.d.ts +7 -3
  341. package/bin/plugin/builtins/web/Plugin.d.ts.map +1 -1
  342. package/bin/plugin/builtins/web/Plugin.js +380 -370
  343. package/bin/plugin/builtins/web/Plugin.js.map +1 -1
  344. package/bin/plugin/builtins/workboard/Plugin.d.ts +7 -3
  345. package/bin/plugin/builtins/workboard/Plugin.d.ts.map +1 -1
  346. package/bin/plugin/builtins/workboard/Plugin.js +64 -54
  347. package/bin/plugin/builtins/workboard/Plugin.js.map +1 -1
  348. package/bin/plugin/builtins/workboard/runtime/Collector.d.ts +1 -1
  349. package/bin/plugin/builtins/workboard/runtime/Collector.js +2 -2
  350. package/bin/plugin/builtins/workboard/runtime/Collector.js.map +1 -1
  351. package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts +2 -2
  352. package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts.map +1 -1
  353. package/bin/plugin/builtins/workboard/runtime/Normalizer.js +1 -1
  354. package/bin/plugin/builtins/workboard/runtime/Normalizer.js.map +1 -1
  355. package/bin/plugin/core/BasePlugin.d.ts +2 -2
  356. package/bin/plugin/core/BasePlugin.js +2 -2
  357. package/bin/plugin/core/BuiltinPluginClasses.d.ts +8 -3
  358. package/bin/plugin/core/BuiltinPluginClasses.d.ts.map +1 -1
  359. package/bin/plugin/core/BuiltinPluginClasses.js +19 -2
  360. package/bin/plugin/core/BuiltinPluginClasses.js.map +1 -1
  361. package/bin/plugin/core/Catalog.d.ts +4 -3
  362. package/bin/plugin/core/Catalog.d.ts.map +1 -1
  363. package/bin/plugin/core/Catalog.js +3 -3
  364. package/bin/plugin/core/Catalog.js.map +1 -1
  365. package/bin/plugin/core/HttpRoutes.d.ts +2 -2
  366. package/bin/plugin/core/HttpRoutes.d.ts.map +1 -1
  367. package/bin/plugin/core/HttpRoutes.js +6 -6
  368. package/bin/plugin/core/HttpRoutes.js.map +1 -1
  369. package/bin/plugin/core/LocalExecution.d.ts.map +1 -1
  370. package/bin/plugin/core/LocalExecution.js +15 -0
  371. package/bin/plugin/core/LocalExecution.js.map +1 -1
  372. package/bin/plugin/core/PluginActionRunner.d.ts.map +1 -1
  373. package/bin/plugin/core/PluginActionRunner.js +0 -1
  374. package/bin/plugin/core/PluginActionRunner.js.map +1 -1
  375. package/bin/plugin/core/PluginClassRegistry.d.ts +24 -4
  376. package/bin/plugin/core/PluginClassRegistry.d.ts.map +1 -1
  377. package/bin/plugin/core/PluginClassRegistry.js +30 -4
  378. package/bin/plugin/core/PluginClassRegistry.js.map +1 -1
  379. package/bin/plugin/core/PluginCommand.d.ts +2 -2
  380. package/bin/plugin/core/PluginCommand.js +4 -4
  381. package/bin/plugin/core/PluginCommand.js.map +1 -1
  382. package/bin/plugin/core/PluginCommandRequest.d.ts +4 -4
  383. package/bin/plugin/core/PluginCommandRequest.js +3 -3
  384. package/bin/plugin/core/PluginStateController.js +2 -2
  385. package/bin/plugin/core/PluginStateController.js.map +1 -1
  386. package/bin/plugin/core/schedule/Store.d.ts +2 -2
  387. package/bin/plugin/core/schedule/Store.js +2 -2
  388. package/bin/plugin/core/schedule/Time.d.ts +1 -1
  389. package/bin/plugin/core/schedule/Time.js +1 -1
  390. package/bin/plugin/types/Plugin.d.ts +17 -21
  391. package/bin/plugin/types/Plugin.d.ts.map +1 -1
  392. package/bin/plugin/types/PluginApi.d.ts +3 -3
  393. package/bin/plugin/types/PluginApi.d.ts.map +1 -1
  394. package/bin/plugin/types/PluginApi.js +1 -1
  395. package/bin/plugin/types/PluginState.d.ts +1 -1
  396. package/bin/plugin/types/PluginState.d.ts.map +1 -1
  397. package/bin/plugin/types/Plugins.d.ts +2 -2
  398. package/bin/plugin/types/Plugins.d.ts.map +1 -1
  399. package/bin/runtime/host/AgentHostRuntime.js +1 -1
  400. package/bin/runtime/host/daemon/Api.d.ts +2 -2
  401. package/bin/runtime/host/daemon/Api.js +1 -1
  402. package/bin/runtime/sandbox/types/SandboxRuntime.d.ts +1 -1
  403. package/bin/runtime/sandbox/types/SandboxRuntime.js +1 -1
  404. package/bin/runtime/server/http/Server.d.ts +8 -8
  405. package/bin/runtime/server/http/Server.d.ts.map +1 -1
  406. package/bin/runtime/server/http/Server.js +8 -30
  407. package/bin/runtime/server/http/Server.js.map +1 -1
  408. package/bin/runtime/server/http/control/ExecuteBySession.d.ts +1 -1
  409. package/bin/runtime/server/http/control/MessageTimeline.d.ts +1 -1
  410. package/bin/runtime/server/http/control/MessageTimeline.d.ts.map +1 -1
  411. package/bin/runtime/server/http/control/OverviewRoutes.d.ts +1 -1
  412. package/bin/runtime/server/http/control/OverviewRoutes.d.ts.map +1 -1
  413. package/bin/runtime/server/http/control/OverviewRoutes.js +2 -6
  414. package/bin/runtime/server/http/control/OverviewRoutes.js.map +1 -1
  415. package/bin/runtime/server/http/control/SessionRoutes.js +1 -1
  416. package/bin/runtime/server/http/control/SessionRoutes.js.map +1 -1
  417. package/bin/runtime/server/http/control/TaskRoutes.d.ts +1 -1
  418. package/bin/runtime/server/http/control/TaskRoutes.js +1 -1
  419. package/bin/runtime/server/http/plugins/plugins.d.ts +3 -3
  420. package/bin/runtime/server/http/plugins/plugins.d.ts.map +1 -1
  421. package/bin/runtime/server/http/plugins/plugins.js +61 -4
  422. package/bin/runtime/server/http/plugins/plugins.js.map +1 -1
  423. package/bin/runtime/server/http/sdk/Router.d.ts +2 -2
  424. package/bin/runtime/server/http/sdk/Router.d.ts.map +1 -1
  425. package/bin/runtime/server/http/sdk/Router.js +2 -2
  426. package/bin/runtime/server/http/sdk/Router.js.map +1 -1
  427. package/bin/runtime/server/http/sdk/SessionRoutes.d.ts +2 -2
  428. package/bin/runtime/server/http/sdk/SessionRoutes.d.ts.map +1 -1
  429. package/bin/runtime/server/http/sdk/SessionRoutes.js +72 -13
  430. package/bin/runtime/server/http/sdk/SessionRoutes.js.map +1 -1
  431. package/bin/runtime/server/rpc/Server.d.ts +2 -4
  432. package/bin/runtime/server/rpc/Server.d.ts.map +1 -1
  433. package/bin/runtime/server/rpc/Server.js +7 -12
  434. package/bin/runtime/server/rpc/Server.js.map +1 -1
  435. package/bin/sdk/Agent.d.ts +21 -20
  436. package/bin/sdk/Agent.d.ts.map +1 -1
  437. package/bin/sdk/Agent.js +46 -33
  438. package/bin/sdk/Agent.js.map +1 -1
  439. package/bin/sdk/AgentSdkTypes.d.ts +310 -38
  440. package/bin/sdk/AgentSdkTypes.d.ts.map +1 -1
  441. package/bin/sdk/AgentSdkTypes.js +1 -1
  442. package/bin/sdk/RemoteAgent.d.ts +9 -57
  443. package/bin/sdk/RemoteAgent.d.ts.map +1 -1
  444. package/bin/sdk/RemoteAgent.js +62 -14
  445. package/bin/sdk/RemoteAgent.js.map +1 -1
  446. package/bin/sdk/Session.d.ts +15 -16
  447. package/bin/sdk/Session.d.ts.map +1 -1
  448. package/bin/sdk/Session.js +47 -35
  449. package/bin/sdk/Session.js.map +1 -1
  450. package/bin/sdk/SessionSystemBuilder.d.ts +8 -8
  451. package/bin/sdk/SessionSystemBuilder.d.ts.map +1 -1
  452. package/bin/sdk/SessionSystemBuilder.js +6 -6
  453. package/bin/sdk/SessionSystemBuilder.js.map +1 -1
  454. package/bin/sdk/session/Browse.d.ts +76 -0
  455. package/bin/sdk/session/Browse.d.ts.map +1 -0
  456. package/bin/sdk/session/Browse.js +418 -0
  457. package/bin/sdk/session/Browse.js.map +1 -0
  458. package/bin/sdk/session/Metadata.d.ts +1 -1
  459. package/bin/sdk/session/Metadata.d.ts.map +1 -1
  460. package/bin/sdk/session/Persistence.d.ts +1 -1
  461. package/bin/sdk/session/Persistence.d.ts.map +1 -1
  462. package/bin/sdk/session/Persistence.js +1 -1
  463. package/bin/sdk/session/Persistence.js.map +1 -1
  464. package/bin/sdk/session/RuntimeSessionPort.d.ts +4 -4
  465. package/bin/sdk/session/RuntimeSessionPort.d.ts.map +1 -1
  466. package/bin/sdk/session/RuntimeSessionPort.js +3 -3
  467. package/bin/sdk/session/index.d.ts +2 -1
  468. package/bin/sdk/session/index.d.ts.map +1 -1
  469. package/bin/sdk/session/index.js +2 -1
  470. package/bin/sdk/session/index.js.map +1 -1
  471. package/bin/sdk/session/runtime/SessionPromptRuntime.d.ts +2 -2
  472. package/bin/sdk/session/runtime/SessionPromptRuntime.d.ts.map +1 -1
  473. package/bin/types/config/DowncityConfig.d.ts +132 -96
  474. package/bin/types/config/DowncityConfig.d.ts.map +1 -1
  475. package/bin/types/runtime/host/AgentHost.d.ts +1 -1
  476. package/bin/types/runtime/host/AgentHost.js +1 -1
  477. package/bin/types/runtime/http/InlineInstant.d.ts +2 -2
  478. package/bin/types/runtime/http/InlineInstant.d.ts.map +1 -1
  479. package/bin/types/runtime/platform/PlatformGateway.d.ts +10 -10
  480. package/bin/types/runtime/platform/PlatformGateway.d.ts.map +1 -1
  481. package/bin/types/sdk/AgentSessionEvent.d.ts +1 -1
  482. package/bin/types/sdk/AgentSessionEvent.d.ts.map +1 -1
  483. package/bin/types/sdk/AgentSessionTurn.d.ts +1 -1
  484. package/bin/types/sdk/AgentSessionTurn.d.ts.map +1 -1
  485. package/package.json +2 -2
  486. package/scripts/session-prompt-runtime.test.mjs +30 -10
  487. package/src/config/Defaults.ts +1 -1
  488. package/src/config/DowncitySchema.ts +2 -8
  489. package/src/config/Paths.ts +2 -2
  490. package/src/config/project/AgentInitializer.ts +4 -5
  491. package/src/core/AgentContextTypes.ts +10 -10
  492. package/src/core/AgentCore.ts +86 -93
  493. package/src/core/AgentCoreTypes.ts +4 -4
  494. package/src/{session → executor}/Executor.ts +21 -21
  495. package/src/{session → executor}/README.md +5 -5
  496. package/src/{session → executor}/SessionRunScope.ts +5 -5
  497. package/src/{session → executor}/composer/compaction/SessionCompactionComposer.ts +1 -1
  498. package/src/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionComposer.ts +1 -1
  499. package/src/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionExecutor.ts +2 -2
  500. package/src/{session → executor}/composer/context/LocalSessionContextComposer.ts +4 -4
  501. package/src/{session → executor}/composer/context/SessionContextComposer.ts +2 -2
  502. package/src/{session → executor}/composer/history/SessionHistoryComposer.ts +2 -2
  503. package/src/{session → executor}/composer/history/SessionHistoryWriter.ts +2 -2
  504. package/src/{session → executor}/composer/history/jsonl/JsonlSessionHistoryComposer.ts +3 -3
  505. package/src/{session → executor}/composer/system/default/DefaultSessionSystemComposer.ts +4 -4
  506. package/src/{session → executor}/composer/system/default/InitPromptAssets.ts +2 -2
  507. package/src/{session → executor}/composer/system/default/InitPrompts.ts +1 -1
  508. package/src/{session → executor}/composer/system/default/PromptRenderer.ts +1 -1
  509. package/src/{session → executor}/composer/system/default/StaticPromptCatalog.ts +1 -1
  510. package/src/{session → executor}/composer/system/default/SystemDomain.ts +26 -26
  511. package/src/{session → executor}/composer/system/default/SystemPromptAssets.ts +3 -3
  512. package/src/{session → executor}/composer/system/default/assets/core.prompt.ts +1 -1
  513. package/src/{session → executor}/composer/system/default/assets/init/PROFILE.md.ts +1 -1
  514. package/src/{session → executor}/composer/system/default/assets/init/SOUL.md.ts +1 -1
  515. package/src/{session → executor}/composer/system/default/assets/plugin.prompt.ts +2 -2
  516. package/src/{session → executor}/composer/system/default/assets/plugin.prompt.ts.txt +2 -2
  517. package/src/{session → executor}/composer/system/default/assets/task.prompt.ts +1 -1
  518. package/src/{session → executor}/composer/system/default/variables/GeoContext.ts +1 -1
  519. package/src/{session → executor}/composer/system/default/variables/VariableReplacer.ts +2 -2
  520. package/src/{session → executor}/core-engine/CoreEngineLoopDecision.ts +1 -1
  521. package/src/{session → executor}/core-engine/CoreEngineMessageState.ts +2 -2
  522. package/src/{session → executor}/core-engine/CoreEngineSignals.ts +1 -1
  523. package/src/{session → executor}/core-engine/CoreEngineUiStreamCollector.ts +3 -3
  524. package/src/{session → executor}/messages/AssistantResultPersistence.ts +1 -1
  525. package/src/{session → executor}/messages/SessionAttachmentMapper.ts +1 -1
  526. package/src/{session → executor}/messages/SessionMessageCodec.ts +2 -2
  527. package/src/{session → executor}/messages/SessionMessageLog.ts +1 -1
  528. package/src/{session → executor}/messages/SessionStepEventMapper.ts +1 -1
  529. package/src/{session → executor}/store/history/SessionHistoryStore.ts +2 -2
  530. package/src/{session → executor}/store/history/jsonl/JsonlSessionHistoryStore.ts +6 -6
  531. package/src/{session → executor}/tools/shell/ShellToolBridge.ts +6 -6
  532. package/src/{session → executor}/tools/shell/ShellToolDefinition.ts +2 -2
  533. package/src/{session → executor}/tools/shell/ShellToolFormatting.ts +3 -3
  534. package/src/{session → executor}/tools/shell/ShellToolSchemas.ts +1 -1
  535. package/src/{session → executor}/types/SessionExecutor.ts +1 -1
  536. package/src/{session → executor}/types/SessionRun.ts +2 -2
  537. package/src/index.ts +43 -28
  538. package/src/plugin/builtins/asr/Plugin.ts +24 -11
  539. package/src/plugin/builtins/auth/Plugin.ts +19 -6
  540. package/src/plugin/builtins/chat/Action.ts +5 -5
  541. package/src/plugin/builtins/chat/ChatPlugin.ts +3 -3
  542. package/src/plugin/builtins/chat/ChatPluginTypes.ts +1 -1
  543. package/src/plugin/builtins/chat/PROMPT.direct.ts +1 -1
  544. package/src/plugin/builtins/chat/PROMPT.direct.ts.txt +1 -1
  545. package/src/plugin/builtins/chat/accounts/{ChannelAccountService.ts → ChannelAccountManager.ts} +3 -3
  546. package/src/plugin/builtins/chat/channels/feishu/types/FeishuChannel.ts +1 -1
  547. package/src/plugin/builtins/chat/channels/qq/PROMPT.direct.ts +1 -1
  548. package/src/plugin/builtins/chat/channels/qq/PROMPT.direct.ts.txt +1 -1
  549. package/src/plugin/builtins/chat/channels/qq/types/QqChannel.ts +1 -1
  550. package/src/plugin/builtins/chat/runtime/ChatActionExecution.ts +2 -2
  551. package/src/plugin/builtins/chat/runtime/ChatActionInput.ts +1 -1
  552. package/src/plugin/builtins/chat/runtime/ChatChannelConfig.ts +8 -8
  553. package/src/plugin/builtins/chat/runtime/ChatChannelCore.ts +14 -14
  554. package/src/plugin/builtins/chat/runtime/ChatChannelFacade.ts +1 -1
  555. package/src/plugin/builtins/chat/runtime/ChatChannelLifecycle.ts +1 -1
  556. package/src/plugin/builtins/chat/runtime/ChatMetaStore.ts +2 -2
  557. package/src/plugin/builtins/chat/runtime/ChatPluginActionRegistry.ts +3 -3
  558. package/src/plugin/builtins/chat/runtime/ChatPluginSystem.ts +2 -2
  559. package/src/plugin/builtins/chat/runtime/ChatPromptAssets.ts +4 -4
  560. package/src/plugin/builtins/chat/runtime/ChatQueueStore.ts +5 -5
  561. package/src/plugin/builtins/chat/runtime/ChatQueueWorker.ts +3 -3
  562. package/src/plugin/builtins/chat/runtime/ChatSession.ts +7 -7
  563. package/src/plugin/builtins/chat/runtime/ChatSessionContextComposer.ts +4 -4
  564. package/src/plugin/builtins/chat/runtime/ChatSessionTypes.ts +2 -2
  565. package/src/plugin/builtins/chat/runtime/ChatkeySend.ts +1 -1
  566. package/src/plugin/builtins/chat/runtime/InboundAugment.ts +1 -1
  567. package/src/plugin/builtins/chat/runtime/PluginDispatch.ts +2 -2
  568. package/src/plugin/builtins/chat/runtime/PluginPoints.ts +10 -10
  569. package/src/plugin/builtins/chat/runtime/SystemPrompt.ts +1 -1
  570. package/src/plugin/builtins/chat/runtime/UIMessageTransformer.ts +1 -1
  571. package/src/plugin/builtins/chat/runtime/UserVisibleText.ts +1 -1
  572. package/src/plugin/builtins/chat/types/ChannelContext.ts +1 -1
  573. package/src/plugin/builtins/chat/types/ChannelStatus.ts +1 -1
  574. package/src/plugin/builtins/chat/types/ChatMessageMarkup.ts +1 -1
  575. package/src/plugin/builtins/chat/types/ChatMeta.ts +2 -2
  576. package/src/plugin/builtins/chat/types/ChatPlugin.ts +6 -6
  577. package/src/plugin/builtins/chat/types/ChatPluginActionPayload.ts +2 -2
  578. package/src/plugin/builtins/chat/types/ChatPromptContext.ts +2 -2
  579. package/src/plugin/builtins/chat/types/ChatRuntime.ts +3 -3
  580. package/src/plugin/builtins/contact/Action.ts +3 -3
  581. package/src/plugin/builtins/contact/ContactPlugin.ts +2 -2
  582. package/src/plugin/builtins/contact/runtime/ChatRuntime.ts +1 -1
  583. package/src/plugin/builtins/contact/runtime/ContactPromptAssets.ts +2 -2
  584. package/src/plugin/builtins/contact/runtime/Paths.ts +1 -1
  585. package/src/plugin/builtins/contact/runtime/RemoteClient.ts +2 -2
  586. package/src/plugin/builtins/contact/types/ContactCheck.ts +2 -2
  587. package/src/plugin/builtins/contact/types/ContactCommand.ts +1 -1
  588. package/src/plugin/builtins/memory/MemoryPlugin.ts +1 -1
  589. package/src/plugin/builtins/memory/runtime/Search.ts +1 -1
  590. package/src/plugin/builtins/memory/runtime/Store.ts +3 -3
  591. package/src/plugin/builtins/shell/ShellRuntimeTypes.ts +4 -4
  592. package/src/plugin/builtins/shell/runtime/ShellActionRuntime.ts +2 -2
  593. package/src/plugin/builtins/shell/runtime/ShellActionRuntimeSupport.ts +2 -2
  594. package/src/plugin/builtins/shell/runtime/ShellProcessEvents.ts +1 -1
  595. package/src/plugin/builtins/shell/runtime/ShellRuntimeEnvironment.ts +1 -1
  596. package/src/plugin/builtins/shell/types/ShellPlugin.ts +4 -4
  597. package/src/plugin/builtins/skill/Plugin.ts +21 -8
  598. package/src/plugin/builtins/skill/runtime/SystemProvider.ts +1 -1
  599. package/src/plugin/builtins/task/PROMPT.ts +1 -1
  600. package/src/plugin/builtins/task/PROMPT.ts.txt +5 -5
  601. package/src/plugin/builtins/task/Scheduler.ts +4 -4
  602. package/src/plugin/builtins/task/runtime/CronTrigger.ts +9 -9
  603. package/src/plugin/builtins/task/runtime/TaskActionExecution.ts +1 -1
  604. package/src/plugin/builtins/task/runtime/TaskActionInput.ts +2 -2
  605. package/src/plugin/builtins/task/runtime/TaskPluginActionRegistry.ts +3 -3
  606. package/src/plugin/builtins/task/runtime/TaskPromptAssets.ts +2 -2
  607. package/src/plugin/builtins/task/runtime/TaskRunChatDispatch.ts +2 -2
  608. package/src/plugin/builtins/task/runtime/TaskRunnerRound.ts +2 -2
  609. package/src/plugin/builtins/task/runtime/TaskRunnerSession.ts +10 -10
  610. package/src/plugin/builtins/task/runtime/TaskRunnerTypes.ts +2 -2
  611. package/src/plugin/builtins/task/types/Cron.ts +3 -3
  612. package/src/plugin/builtins/task/types/TaskPluginTypes.ts +3 -3
  613. package/src/plugin/builtins/tts/Plugin.ts +23 -10
  614. package/src/plugin/builtins/web/Plugin.ts +23 -10
  615. package/src/plugin/builtins/workboard/Plugin.ts +71 -58
  616. package/src/plugin/builtins/workboard/runtime/Collector.ts +2 -2
  617. package/src/plugin/builtins/workboard/runtime/Normalizer.ts +3 -3
  618. package/src/plugin/core/BasePlugin.ts +2 -2
  619. package/src/plugin/core/BuiltinPluginClasses.ts +20 -3
  620. package/src/plugin/core/Catalog.ts +6 -5
  621. package/src/plugin/core/HttpRoutes.ts +6 -6
  622. package/src/plugin/core/LocalExecution.ts +15 -0
  623. package/src/plugin/core/PluginActionRunner.ts +0 -1
  624. package/src/plugin/core/PluginClassRegistry.ts +33 -4
  625. package/src/plugin/core/PluginCommand.ts +4 -4
  626. package/src/plugin/core/PluginCommandRequest.ts +4 -4
  627. package/src/plugin/core/PluginStateController.ts +2 -2
  628. package/src/plugin/core/schedule/Store.ts +2 -2
  629. package/src/plugin/core/schedule/Time.ts +1 -1
  630. package/src/plugin/types/Plugin.ts +18 -22
  631. package/src/plugin/types/PluginApi.ts +3 -3
  632. package/src/plugin/types/PluginState.ts +0 -5
  633. package/src/plugin/types/Plugins.ts +2 -2
  634. package/src/runtime/host/AgentHostRuntime.ts +1 -1
  635. package/src/runtime/host/daemon/Api.ts +2 -2
  636. package/src/runtime/sandbox/types/SandboxRuntime.ts +1 -1
  637. package/src/runtime/server/http/Server.ts +19 -51
  638. package/src/runtime/server/http/control/MessageTimeline.ts +1 -1
  639. package/src/runtime/server/http/control/OverviewRoutes.ts +2 -6
  640. package/src/runtime/server/http/control/SessionRoutes.ts +1 -1
  641. package/src/runtime/server/http/control/TaskRoutes.ts +1 -1
  642. package/src/runtime/server/http/plugins/plugins.ts +71 -4
  643. package/src/runtime/server/http/sdk/Router.ts +3 -3
  644. package/src/runtime/server/http/sdk/SessionRoutes.ts +82 -14
  645. package/src/runtime/server/rpc/Server.ts +13 -20
  646. package/src/sdk/Agent.ts +57 -39
  647. package/src/sdk/AgentSdkTypes.ts +358 -40
  648. package/src/sdk/RemoteAgent.ts +93 -21
  649. package/src/sdk/Session.ts +61 -43
  650. package/src/sdk/SessionSystemBuilder.ts +12 -12
  651. package/src/sdk/session/Browse.ts +519 -0
  652. package/src/sdk/session/Metadata.ts +1 -1
  653. package/src/sdk/session/Persistence.ts +3 -3
  654. package/src/sdk/session/RuntimeSessionPort.ts +4 -4
  655. package/src/sdk/session/index.ts +10 -1
  656. package/src/sdk/session/runtime/SessionPromptRuntime.ts +2 -2
  657. package/src/types/config/DowncityConfig.ts +143 -96
  658. package/src/types/runtime/host/AgentHost.ts +1 -1
  659. package/src/types/runtime/http/InlineInstant.ts +2 -2
  660. package/src/types/runtime/platform/PlatformGateway.ts +10 -10
  661. package/src/types/sdk/AgentSessionEvent.ts +1 -1
  662. package/src/types/sdk/AgentSessionTurn.ts +1 -1
  663. package/tsconfig.json +1 -2
  664. package/tsconfig.tsbuildinfo +1 -1
  665. package/bin/plugin/core/Plugins.d.ts +0 -20
  666. package/bin/plugin/core/Plugins.d.ts.map +0 -1
  667. package/bin/plugin/core/Plugins.js +0 -33
  668. package/bin/plugin/core/Plugins.js.map +0 -1
  669. package/bin/runtime/host/PluginRuntime.d.ts +0 -24
  670. package/bin/runtime/host/PluginRuntime.d.ts.map +0 -1
  671. package/bin/runtime/host/PluginRuntime.js +0 -31
  672. package/bin/runtime/host/PluginRuntime.js.map +0 -1
  673. package/bin/runtime/server/http/services/services.d.ts +0 -25
  674. package/bin/runtime/server/http/services/services.d.ts.map +0 -1
  675. package/bin/runtime/server/http/services/services.js +0 -82
  676. package/bin/runtime/server/http/services/services.js.map +0 -1
  677. package/bin/session/Executor.d.ts.map +0 -1
  678. package/bin/session/Executor.js.map +0 -1
  679. package/bin/session/SessionRunScope.d.ts.map +0 -1
  680. package/bin/session/SessionRunScope.js.map +0 -1
  681. package/bin/session/composer/compaction/SessionCompactionComposer.d.ts.map +0 -1
  682. package/bin/session/composer/compaction/SessionCompactionComposer.js.map +0 -1
  683. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts.map +0 -1
  684. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.js.map +0 -1
  685. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +0 -1
  686. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +0 -1
  687. package/bin/session/composer/context/LocalSessionContextComposer.d.ts.map +0 -1
  688. package/bin/session/composer/context/LocalSessionContextComposer.js.map +0 -1
  689. package/bin/session/composer/context/SessionContextComposer.d.ts.map +0 -1
  690. package/bin/session/composer/context/SessionContextComposer.js.map +0 -1
  691. package/bin/session/composer/history/SessionHistoryComposer.d.ts.map +0 -1
  692. package/bin/session/composer/history/SessionHistoryComposer.js.map +0 -1
  693. package/bin/session/composer/history/SessionHistoryWriter.d.ts.map +0 -1
  694. package/bin/session/composer/history/SessionHistoryWriter.js.map +0 -1
  695. package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts.map +0 -1
  696. package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.js.map +0 -1
  697. package/bin/session/composer/system/SessionSystemComposer.d.ts.map +0 -1
  698. package/bin/session/composer/system/SessionSystemComposer.js.map +0 -1
  699. package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts.map +0 -1
  700. package/bin/session/composer/system/default/DefaultSessionSystemComposer.js.map +0 -1
  701. package/bin/session/composer/system/default/InitPromptAssets.d.ts.map +0 -1
  702. package/bin/session/composer/system/default/InitPromptAssets.js.map +0 -1
  703. package/bin/session/composer/system/default/InitPrompts.d.ts.map +0 -1
  704. package/bin/session/composer/system/default/InitPrompts.js.map +0 -1
  705. package/bin/session/composer/system/default/PromptRenderer.d.ts.map +0 -1
  706. package/bin/session/composer/system/default/PromptRenderer.js.map +0 -1
  707. package/bin/session/composer/system/default/StaticPromptCatalog.d.ts.map +0 -1
  708. package/bin/session/composer/system/default/StaticPromptCatalog.js.map +0 -1
  709. package/bin/session/composer/system/default/SystemDomain.d.ts.map +0 -1
  710. package/bin/session/composer/system/default/SystemDomain.js.map +0 -1
  711. package/bin/session/composer/system/default/SystemPromptAssets.d.ts.map +0 -1
  712. package/bin/session/composer/system/default/SystemPromptAssets.js.map +0 -1
  713. package/bin/session/composer/system/default/assets/core.prompt.d.ts.map +0 -1
  714. package/bin/session/composer/system/default/assets/core.prompt.js.map +0 -1
  715. package/bin/session/composer/system/default/assets/init/PROFILE.md.d.ts.map +0 -1
  716. package/bin/session/composer/system/default/assets/init/PROFILE.md.js.map +0 -1
  717. package/bin/session/composer/system/default/assets/init/SOUL.md.d.ts.map +0 -1
  718. package/bin/session/composer/system/default/assets/init/SOUL.md.js.map +0 -1
  719. package/bin/session/composer/system/default/assets/plugin.prompt.d.ts.map +0 -1
  720. package/bin/session/composer/system/default/assets/plugin.prompt.js +0 -8
  721. package/bin/session/composer/system/default/assets/plugin.prompt.js.map +0 -1
  722. package/bin/session/composer/system/default/assets/task.prompt.d.ts.map +0 -1
  723. package/bin/session/composer/system/default/assets/task.prompt.js.map +0 -1
  724. package/bin/session/composer/system/default/variables/GeoContext.d.ts.map +0 -1
  725. package/bin/session/composer/system/default/variables/GeoContext.js.map +0 -1
  726. package/bin/session/composer/system/default/variables/PromptTypes.d.ts.map +0 -1
  727. package/bin/session/composer/system/default/variables/PromptTypes.js.map +0 -1
  728. package/bin/session/composer/system/default/variables/VariableReplacer.d.ts.map +0 -1
  729. package/bin/session/composer/system/default/variables/VariableReplacer.js.map +0 -1
  730. package/bin/session/core-engine/CoreEngineError.d.ts.map +0 -1
  731. package/bin/session/core-engine/CoreEngineError.js.map +0 -1
  732. package/bin/session/core-engine/CoreEngineLoopDecision.d.ts.map +0 -1
  733. package/bin/session/core-engine/CoreEngineLoopDecision.js.map +0 -1
  734. package/bin/session/core-engine/CoreEngineMessageState.d.ts.map +0 -1
  735. package/bin/session/core-engine/CoreEngineMessageState.js.map +0 -1
  736. package/bin/session/core-engine/CoreEngineSignals.d.ts.map +0 -1
  737. package/bin/session/core-engine/CoreEngineSignals.js.map +0 -1
  738. package/bin/session/core-engine/CoreEngineUiStreamCollector.d.ts.map +0 -1
  739. package/bin/session/core-engine/CoreEngineUiStreamCollector.js.map +0 -1
  740. package/bin/session/ids/resolveSessionId.d.ts.map +0 -1
  741. package/bin/session/ids/resolveSessionId.js.map +0 -1
  742. package/bin/session/messages/AssistantResultPersistence.d.ts.map +0 -1
  743. package/bin/session/messages/AssistantResultPersistence.js.map +0 -1
  744. package/bin/session/messages/SessionAttachmentMapper.d.ts.map +0 -1
  745. package/bin/session/messages/SessionAttachmentMapper.js.map +0 -1
  746. package/bin/session/messages/SessionMessageCodec.d.ts.map +0 -1
  747. package/bin/session/messages/SessionMessageCodec.js.map +0 -1
  748. package/bin/session/messages/SessionMessageLog.d.ts.map +0 -1
  749. package/bin/session/messages/SessionMessageLog.js.map +0 -1
  750. package/bin/session/messages/SessionStepEventMapper.d.ts.map +0 -1
  751. package/bin/session/messages/SessionStepEventMapper.js.map +0 -1
  752. package/bin/session/store/history/SessionHistoryStore.d.ts.map +0 -1
  753. package/bin/session/store/history/SessionHistoryStore.js.map +0 -1
  754. package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +0 -1
  755. package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.js.map +0 -1
  756. package/bin/session/tools/shell/ShellToolBridge.d.ts.map +0 -1
  757. package/bin/session/tools/shell/ShellToolBridge.js.map +0 -1
  758. package/bin/session/tools/shell/ShellToolDefinition.d.ts.map +0 -1
  759. package/bin/session/tools/shell/ShellToolDefinition.js.map +0 -1
  760. package/bin/session/tools/shell/ShellToolFormatting.d.ts.map +0 -1
  761. package/bin/session/tools/shell/ShellToolFormatting.js.map +0 -1
  762. package/bin/session/tools/shell/ShellToolSchemas.d.ts.map +0 -1
  763. package/bin/session/tools/shell/ShellToolSchemas.js.map +0 -1
  764. package/bin/session/types/SessionExecutor.d.ts.map +0 -1
  765. package/bin/session/types/SessionExecutor.js.map +0 -1
  766. package/bin/session/types/SessionHistoryMeta.d.ts.map +0 -1
  767. package/bin/session/types/SessionHistoryMeta.js.map +0 -1
  768. package/bin/session/types/SessionHistoryPaths.d.ts.map +0 -1
  769. package/bin/session/types/SessionHistoryPaths.js.map +0 -1
  770. package/bin/session/types/SessionLoop.d.ts.map +0 -1
  771. package/bin/session/types/SessionLoop.js.map +0 -1
  772. package/bin/session/types/SessionMessages.d.ts.map +0 -1
  773. package/bin/session/types/SessionMessages.js.map +0 -1
  774. package/bin/session/types/SessionPrompts.d.ts.map +0 -1
  775. package/bin/session/types/SessionPrompts.js.map +0 -1
  776. package/bin/session/types/SessionRun.d.ts.map +0 -1
  777. package/bin/session/types/SessionRun.js.map +0 -1
  778. package/src/plugin/core/Plugins.ts +0 -39
  779. package/src/runtime/host/PluginRuntime.ts +0 -42
  780. package/src/runtime/server/http/services/services.ts +0 -114
  781. /package/bin/{session → executor}/Executor.js +0 -0
  782. /package/bin/{session → executor}/composer/compaction/SessionCompactionComposer.js +0 -0
  783. /package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts +0 -0
  784. /package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionComposer.js +0 -0
  785. /package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js +0 -0
  786. /package/bin/{session → executor}/composer/context/LocalSessionContextComposer.js +0 -0
  787. /package/bin/{session → executor}/composer/context/SessionContextComposer.js +0 -0
  788. /package/bin/{session → executor}/composer/history/SessionHistoryComposer.js +0 -0
  789. /package/bin/{session → executor}/composer/history/SessionHistoryWriter.js +0 -0
  790. /package/bin/{session → executor}/composer/history/jsonl/JsonlSessionHistoryComposer.js +0 -0
  791. /package/bin/{session → executor}/composer/system/SessionSystemComposer.d.ts +0 -0
  792. /package/bin/{session → executor}/composer/system/SessionSystemComposer.js +0 -0
  793. /package/bin/{session → executor}/composer/system/default/DefaultSessionSystemComposer.js +0 -0
  794. /package/bin/{session → executor}/composer/system/default/InitPromptAssets.d.ts +0 -0
  795. /package/bin/{session → executor}/composer/system/default/InitPromptAssets.js +0 -0
  796. /package/bin/{session → executor}/composer/system/default/InitPrompts.d.ts +0 -0
  797. /package/bin/{session → executor}/composer/system/default/InitPrompts.js +0 -0
  798. /package/bin/{session → executor}/composer/system/default/PromptRenderer.d.ts +0 -0
  799. /package/bin/{session → executor}/composer/system/default/PromptRenderer.js +0 -0
  800. /package/bin/{session → executor}/composer/system/default/StaticPromptCatalog.d.ts +0 -0
  801. /package/bin/{session → executor}/composer/system/default/StaticPromptCatalog.js +0 -0
  802. /package/bin/{session → executor}/composer/system/default/SystemPromptAssets.d.ts +0 -0
  803. /package/bin/{session → executor}/composer/system/default/SystemPromptAssets.js +0 -0
  804. /package/bin/{session → executor}/composer/system/default/assets/core.prompt.d.ts +0 -0
  805. /package/bin/{session → executor}/composer/system/default/assets/init/PROFILE.md.d.ts +0 -0
  806. /package/bin/{session → executor}/composer/system/default/assets/init/SOUL.md.d.ts +0 -0
  807. /package/bin/{session → executor}/composer/system/default/assets/task.prompt.d.ts +0 -0
  808. /package/bin/{session → executor}/composer/system/default/variables/GeoContext.d.ts +0 -0
  809. /package/bin/{session → executor}/composer/system/default/variables/GeoContext.js +0 -0
  810. /package/bin/{session → executor}/composer/system/default/variables/PromptTypes.d.ts +0 -0
  811. /package/bin/{session → executor}/composer/system/default/variables/PromptTypes.js +0 -0
  812. /package/bin/{session → executor}/composer/system/default/variables/VariableReplacer.d.ts +0 -0
  813. /package/bin/{session → executor}/composer/system/default/variables/VariableReplacer.js +0 -0
  814. /package/bin/{session → executor}/core-engine/CoreEngineError.d.ts +0 -0
  815. /package/bin/{session → executor}/core-engine/CoreEngineError.js +0 -0
  816. /package/bin/{session → executor}/core-engine/CoreEngineLoopDecision.js +0 -0
  817. /package/bin/{session → executor}/core-engine/CoreEngineMessageState.js +0 -0
  818. /package/bin/{session → executor}/core-engine/CoreEngineSignals.js +0 -0
  819. /package/bin/{session → executor}/core-engine/CoreEngineUiStreamCollector.js +0 -0
  820. /package/bin/{session → executor}/ids/resolveSessionId.d.ts +0 -0
  821. /package/bin/{session → executor}/ids/resolveSessionId.js +0 -0
  822. /package/bin/{session → executor}/messages/AssistantResultPersistence.js +0 -0
  823. /package/bin/{session → executor}/messages/SessionAttachmentMapper.js +0 -0
  824. /package/bin/{session → executor}/messages/SessionMessageCodec.js +0 -0
  825. /package/bin/{session → executor}/messages/SessionMessageLog.js +0 -0
  826. /package/bin/{session → executor}/messages/SessionStepEventMapper.js +0 -0
  827. /package/bin/{session → executor}/store/history/SessionHistoryStore.js +0 -0
  828. /package/bin/{session → executor}/store/history/jsonl/JsonlSessionHistoryStore.js +0 -0
  829. /package/bin/{session → executor}/tools/shell/ShellToolSchemas.d.ts +0 -0
  830. /package/bin/{session → executor}/types/SessionExecutor.js +0 -0
  831. /package/bin/{session → executor}/types/SessionHistoryMeta.d.ts +0 -0
  832. /package/bin/{session → executor}/types/SessionHistoryMeta.js +0 -0
  833. /package/bin/{session → executor}/types/SessionHistoryPaths.d.ts +0 -0
  834. /package/bin/{session → executor}/types/SessionHistoryPaths.js +0 -0
  835. /package/bin/{session → executor}/types/SessionLoop.d.ts +0 -0
  836. /package/bin/{session → executor}/types/SessionLoop.js +0 -0
  837. /package/bin/{session → executor}/types/SessionMessages.d.ts +0 -0
  838. /package/bin/{session → executor}/types/SessionMessages.js +0 -0
  839. /package/bin/{session → executor}/types/SessionPrompts.d.ts +0 -0
  840. /package/bin/{session → executor}/types/SessionPrompts.js +0 -0
  841. /package/bin/{session → executor}/types/SessionRun.js +0 -0
  842. /package/src/{session → executor}/composer/system/SessionSystemComposer.ts +0 -0
  843. /package/src/{session → executor}/composer/system/default/assets/core.prompt.ts.txt +0 -0
  844. /package/src/{session → executor}/composer/system/default/assets/init/PROFILE.md.ts.txt +0 -0
  845. /package/src/{session → executor}/composer/system/default/assets/init/SOUL.md.ts.txt +0 -0
  846. /package/src/{session → executor}/composer/system/default/assets/task.prompt.ts.txt +0 -0
  847. /package/src/{session → executor}/composer/system/default/variables/PromptTypes.ts +0 -0
  848. /package/src/{session → executor}/core-engine/CoreEngineError.ts +0 -0
  849. /package/src/{session → executor}/ids/resolveSessionId.ts +0 -0
  850. /package/src/{session → executor}/types/SessionHistoryMeta.ts +0 -0
  851. /package/src/{session → executor}/types/SessionHistoryPaths.ts +0 -0
  852. /package/src/{session → executor}/types/SessionLoop.ts +0 -0
  853. /package/src/{session → executor}/types/SessionMessages.ts +0 -0
  854. /package/src/{session → executor}/types/SessionPrompts.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Service Schedule 持久化存储。
2
+ * Plugin Schedule 持久化存储。
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 调度任务改为使用项目内 `jsonl` 事件流持久化,不再依赖 SQLite。
@@ -120,7 +120,7 @@ function compareJobs(a: ScheduledJobRecord, b: ScheduledJobRecord): number {
120
120
  }
121
121
 
122
122
  /**
123
- * Service Schedule Store。
123
+ * Plugin Schedule Store。
124
124
  */
125
125
  export class PluginScheduleStore {
126
126
  private readonly filePath: string;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Service Schedule 时间解析工具。
2
+ * Plugin Schedule 时间解析工具。
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 统一解析 `--delay` / `--time` 对应的调度时间。
@@ -137,7 +137,7 @@ export interface PluginStateControlResult {
137
137
  *
138
138
  * 关键点(中文)
139
139
  * - 这里表达的是“CLI 命令执行 plugin 时真正需要的最小上下文”。
140
- * - plugin 命令不应依赖 session、service invoke、agent runtime 等长期宿主对象。
140
+ * - plugin 命令不应依赖 session、plugin invoke、agent runtime 等长期宿主对象。
141
141
  * - agent runtime 在需要复用 action 时,直接传入自身更完整的 AgentContext 即可。
142
142
  */
143
143
  export interface PluginCommandContext {
@@ -180,13 +180,13 @@ export interface PluginCommandContext {
180
180
  }
181
181
 
182
182
  /**
183
- * Service 调用参数。
183
+ * Plugin action 调用参数。
184
184
  */
185
- export interface PluginServiceInvokeParams {
185
+ export interface PluginActionInvokeParams {
186
186
  /**
187
- * 目标 service 名称。
187
+ * 目标 plugin 名称。
188
188
  */
189
- service: string;
189
+ plugin: string;
190
190
  /**
191
191
  * 目标 action 名称。
192
192
  */
@@ -198,9 +198,9 @@ export interface PluginServiceInvokeParams {
198
198
  }
199
199
 
200
200
  /**
201
- * Service 调用结果。
201
+ * Plugin action 调用结果。
202
202
  */
203
- export interface PluginServiceInvokeResult {
203
+ export interface PluginActionInvokeResult {
204
204
  /**
205
205
  * 调用是否成功。
206
206
  */
@@ -216,15 +216,15 @@ export interface PluginServiceInvokeResult {
216
216
  }
217
217
 
218
218
  /**
219
- * Service 调用端口。
219
+ * Plugin action 调用端口。
220
220
  */
221
- export interface PluginServiceInvokePort {
221
+ export interface PluginActionInvokePort {
222
222
  /**
223
- * 调用指定 service action。
223
+ * 调用指定 plugin action。
224
224
  */
225
225
  invoke(
226
- params: PluginServiceInvokeParams,
227
- ): Promise<PluginServiceInvokeResult>;
226
+ params: PluginActionInvokeParams,
227
+ ): Promise<PluginActionInvokeResult>;
228
228
  }
229
229
 
230
230
  /**
@@ -267,7 +267,7 @@ export interface PluginCommandResult {
267
267
  * Plugin 生命周期兼容定义。
268
268
  *
269
269
  * 关键点(中文)
270
- * - 这是从旧 service lifecycle 过渡过来的兼容层。
270
+ * - 这是从旧运行生命周期过渡过来的兼容层。
271
271
  * - 新代码优先直接实现 `start/stop/command`。
272
272
  */
273
273
  export interface PluginLifecycle {
@@ -608,10 +608,6 @@ export interface PluginAction<
608
608
  * 当前插件名称。
609
609
  */
610
610
  pluginName: string;
611
- /**
612
- * 兼容旧 service action 参数名。
613
- */
614
- serviceName?: string;
615
611
  /**
616
612
  * 当前 Action 名称。
617
613
  */
@@ -816,13 +812,13 @@ export interface PluginUsageDefinition {
816
812
  }
817
813
 
818
814
  /**
819
- * Plugin runtime HTTP 注入参数。
815
+ * Plugin HTTP 注入参数。
820
816
  *
821
817
  * 关键点(中文)
822
818
  * - plugin 只声明自己的路由与鉴权策略,不感知 server 装配细节。
823
819
  * - console 会复用相同路径策略保护代理请求,但不会重复注册路由本身。
824
820
  */
825
- export interface PluginRuntimeHttpRegistration {
821
+ export interface PluginHttpRegistration {
826
822
  /**
827
823
  * 该组路由对应的鉴权策略列表。
828
824
  */
@@ -851,9 +847,9 @@ export interface PluginRuntimeHttpRegistration {
851
847
  */
852
848
  export interface PluginHttpDefinition {
853
849
  /**
854
- * runtime HTTP 路由注入(可选)。
850
+ * server HTTP 路由注入(可选)。
855
851
  */
856
- runtime?: PluginRuntimeHttpRegistration;
852
+ server?: PluginHttpRegistration;
857
853
  }
858
854
 
859
855
  /**
@@ -909,7 +905,7 @@ export interface Plugin {
909
905
  */
910
906
  system?: (context: AgentContext) => string | Promise<string>;
911
907
  /**
912
- * 旧 service lifecycle 兼容定义(可选)。
908
+ * 旧生命周期兼容定义(可选)。
913
909
  */
914
910
  lifecycle?: PluginLifecycle;
915
911
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plugin 管理命令与 API 类型。
2
+ * plugin catalog / availability / action API 类型。
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 统一描述 CLI -> daemon 的 plugin 管理协议。
@@ -73,9 +73,9 @@ export interface PluginAvailabilityView {
73
73
  }
74
74
 
75
75
  /**
76
- * plugin list 响应。
76
+ * plugin catalog 响应。
77
77
  */
78
- export interface PluginListResponse {
78
+ export interface PluginCatalogResponse {
79
79
  /**
80
80
  * 请求是否成功。
81
81
  */
@@ -8,9 +8,4 @@ export type {
8
8
  PluginStateControlResult,
9
9
  PluginStateRecord,
10
10
  PluginStateSnapshot,
11
- PluginState as ServiceState,
12
- PluginStateControlAction as ServiceStateControlAction,
13
- PluginStateControlResult as ServiceStateControlResult,
14
- PluginStateRecord as ServiceStateRecord,
15
- PluginStateSnapshot as ServiceStateSnapshot,
16
11
  } from "@/plugin/types/Plugin.js";
@@ -29,9 +29,9 @@ export type PluginStateView = {
29
29
  };
30
30
 
31
31
  /**
32
- * plugin 列表响应。
32
+ * plugin 状态列表响应。
33
33
  */
34
- export type PluginListResponse = {
34
+ export type PluginStateListResponse = {
35
35
  success: boolean;
36
36
  plugins?: PluginStateView[];
37
37
  error?: string;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - agent runtime 负责创建这些宿主能力对象,再注入到 AgentRuntime。
6
- * - service / session / plugin 只消费这些对象,不直接依赖具体宿主实现。
6
+ * - plugin runtime / session / plugin 作者 API 只消费这些对象,不直接依赖具体宿主实现。
7
7
  * - 当前先收敛路径与 plugin 配置持久化两类宿主能力。
8
8
  */
9
9
  import {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 这里描述的是 CLI 与 agent daemon 之间的远程访问契约,不包含具体 HTTP 实现。
6
- * - service 等上层模块只依赖这些协议类型,不需要感知 city/daemon 的内部实现细节。
6
+ * - plugin runtime 等上层模块只依赖这些协议类型,不需要感知 city/daemon 的内部实现细节。
7
7
  * - 该文件属于 agent daemon 访问协议边界,而不是通用 HTTP 类型目录。
8
8
  */
9
9
 
@@ -40,7 +40,7 @@ export type DaemonJsonApiCallParams = {
40
40
  *
41
41
  * 说明(中文)
42
42
  * - 仅本地 IPC transport 当前会消费该参数。
43
- * - 用于 `session execute`、`service command` 这类可能持续几十秒的请求,
43
+ * - 用于 `session execute`、`plugin command` 这类可能持续几十秒的请求,
44
44
  * 避免被默认短超时误判成“Agent server 未启动”。
45
45
  */
46
46
  timeoutMs?: number;
@@ -4,7 +4,7 @@
4
4
  * 关键点(中文)
5
5
  * - 这里放的是 agent 执行层内部使用的最小 sandbox 运行时类型。
6
6
  * - 当前只围绕 `SandboxRunner` 设计,不引入复杂 provider / policy / binding 对象。
7
- * - 目标是让 `ShellService` 可以直接把命令交给 `SandboxRunner` 执行。
7
+ * - 目标是让 shell plugin runtime 可以直接把命令交给 `SandboxRunner` 执行。
8
8
  */
9
9
 
10
10
  import type { ChildProcessWithoutNullStreams } from "node:child_process";
@@ -16,9 +16,6 @@ import { finished } from "node:stream/promises";
16
16
  import { logger as serverLogger } from "@/utils/logger/Logger.js";
17
17
  import { createExecuteRouter } from "@/runtime/server/http/execute/execute.js";
18
18
  import { healthRouter } from "@/runtime/server/http/health/health.js";
19
- import {
20
- createServicesRouter,
21
- } from "@/runtime/server/http/services/services.js";
22
19
  import { createPluginsRouter } from "@/runtime/server/http/plugins/plugins.js";
23
20
  import { createStaticRouter } from "@/runtime/server/http/static/static.js";
24
21
  import { createControlRouter } from "@/runtime/server/http/control/ControlRouter.js";
@@ -28,7 +25,7 @@ import {
28
25
  } from "@/plugin/core/HttpRoutes.js";
29
26
  import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
30
27
  import type { AgentContext } from "@/core/AgentContextTypes.js";
31
- import type { AgentCore } from "@/core/AgentCore.js";
28
+ import type { AgentSessionCollection } from "@/sdk/AgentSdkTypes.js";
32
29
 
33
30
  /**
34
31
  * Server 启动参数。
@@ -38,12 +35,12 @@ export interface ServerStartOptions {
38
35
  port: number;
39
36
  /** HTTP 服务监听主机。 */
40
37
  host: string;
41
- /** 可选实例级 agent core。 */
42
- core?: Pick<AgentCore, "getContext" | "getRuntime" | "session" | "sessions">;
43
- /** 可选实例级 runtime 读取函数。 */
44
- getAgentRuntime?: () => AgentRuntime;
45
- /** 可选实例级 context 读取函数。 */
46
- getAgentContext?: () => AgentContext;
38
+ /** 当前 agent runtime 读取函数。 */
39
+ getAgentRuntime: () => AgentRuntime;
40
+ /** 当前 agent context 读取函数。 */
41
+ getAgentContext: () => AgentContext;
42
+ /** 可选 SDK Session 集合绑定。 */
43
+ sessionCollection?: AgentSessionCollection;
47
44
  }
48
45
 
49
46
  /**
@@ -58,41 +55,16 @@ export interface ServerInstance {
58
55
  stop(): Promise<void>;
59
56
  }
60
57
 
61
- type AgentServerBindings = {
62
- getAgentRuntime: () => AgentRuntime;
63
- getAgentContext: () => AgentContext;
64
- };
65
-
66
- function resolveServerBindings(options: Pick<
67
- ServerStartOptions,
68
- "core" | "getAgentRuntime" | "getAgentContext"
69
- >): AgentServerBindings {
70
- const core = options.core;
71
- if (core) {
72
- return {
73
- getAgentRuntime: () => core.getRuntime(),
74
- getAgentContext: () => core.getContext(),
75
- };
76
- }
77
- if (options.getAgentRuntime && options.getAgentContext) {
78
- return {
79
- getAgentRuntime: options.getAgentRuntime,
80
- getAgentContext: options.getAgentContext,
81
- };
82
- }
83
- throw new Error(
84
- "createServerApp/startServer requires either core or both getAgentRuntime/getAgentContext",
85
- );
86
- }
87
-
88
58
  /**
89
59
  * 创建主 Hono 应用。
90
60
  */
91
61
  export function createServerApp(
92
- options: Pick<ServerStartOptions, "core" | "getAgentRuntime" | "getAgentContext">,
62
+ options: Pick<
63
+ ServerStartOptions,
64
+ "getAgentRuntime" | "getAgentContext" | "sessionCollection"
65
+ >,
93
66
  ): Hono {
94
67
  const app = new Hono();
95
- const bindings = resolveServerBindings(options);
96
68
 
97
69
  app.use("*", logger());
98
70
  app.use(
@@ -106,29 +78,25 @@ export function createServerApp(
106
78
 
107
79
  // 关键点(中文):按路由域挂载,server 模块只保留装配职责。
108
80
  app.route("/", createStaticRouter({
109
- getAgentRuntime: bindings.getAgentRuntime,
81
+ getAgentRuntime: options.getAgentRuntime,
110
82
  }));
111
83
  app.route("/", healthRouter);
112
- const servicesRouter = createServicesRouter({
113
- getAgentContext: bindings.getAgentContext,
114
- });
115
- app.route("/", servicesRouter);
116
84
  app.route("/", createPluginsRouter({
117
- getAgentContext: bindings.getAgentContext,
85
+ getAgentContext: options.getAgentContext,
118
86
  }));
119
87
  app.route("/", createExecuteRouter({
120
- getAgentRuntime: bindings.getAgentRuntime,
88
+ getAgentRuntime: options.getAgentRuntime,
121
89
  }));
122
90
  app.route("/", createControlRouter({
123
- getAgentRuntime: bindings.getAgentRuntime,
124
- getAgentContext: bindings.getAgentContext,
91
+ getAgentRuntime: options.getAgentRuntime,
92
+ getAgentContext: options.getAgentContext,
125
93
  }));
126
- if (options.core) {
127
- app.route("/", createSdkRouter(options.core));
94
+ if (options.sessionCollection) {
95
+ app.route("/", createSdkRouter(options.sessionCollection));
128
96
  }
129
97
  registerBuiltinPluginHttpRoutes({
130
98
  app,
131
- getContext: bindings.getAgentContext,
99
+ getContext: options.getAgentContext,
132
100
  });
133
101
 
134
102
  return app;
@@ -16,7 +16,7 @@ import {
16
16
  import type {
17
17
  SessionMessageV1,
18
18
  SessionMetadataV1,
19
- } from "@/session/types/SessionMessages.js";
19
+ } from "@/executor/types/SessionMessages.js";
20
20
  import { pickLastSuccessfulChatSendText } from "@/plugin/builtins/chat/runtime/UserVisibleText.js";
21
21
  import { extractToolCallsFromUiMessage } from "@/plugin/builtins/chat/runtime/UIMessageTransformer.js";
22
22
  import type { ControlTimelineEvent, ControlTimelineRole } from "@/runtime/server/http/control/types/ControlViewData.js";
@@ -2,7 +2,7 @@
2
2
  * Control 概览路由。
3
3
  *
4
4
  * 关键点(中文)
5
- * - 聚合 overview 与 runtime plugins 两块轻量只读接口。
5
+ * - 聚合 overview 与 plugin 运行态两块轻量只读接口。
6
6
  * - 只负责路由层拼装,不承载复杂业务状态机。
7
7
  */
8
8
 
@@ -85,7 +85,6 @@ export function registerControlOverviewRoutes(
85
85
  total: sessions.length,
86
86
  items: sessions,
87
87
  },
88
- services: runtimePlugins,
89
88
  plugins: runtimePlugins,
90
89
  tasks: {
91
90
  total: tasks.length,
@@ -99,13 +98,10 @@ export function registerControlOverviewRoutes(
99
98
  });
100
99
  }
101
100
 
102
- for (const routePath of buildControlRouteAliases("/services")) {
101
+ for (const routePath of buildControlRouteAliases("/plugins/list")) {
103
102
  app.get(routePath, (c) => {
104
103
  return c.json({
105
104
  success: true,
106
- services: listPluginStates({
107
- context: params.getAgentContext(),
108
- }),
109
105
  plugins: listPluginStates({
110
106
  context: params.getAgentContext(),
111
107
  }),
@@ -10,7 +10,7 @@
10
10
  import type { SystemModelMessage } from "ai";
11
11
  import fs from "fs-extra";
12
12
  import { dirname } from "path";
13
- import { resolveSessionSystemMessages } from "@session/composer/system/default/SystemDomain.js";
13
+ import { resolveSessionSystemMessages } from "@executor/composer/system/default/SystemDomain.js";
14
14
  import {
15
15
  getDowncityChatHistoryPath,
16
16
  getDowncitySessionMessagesArchiveDirPath,
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 聚合 tasks/runs/logs 相关接口。
6
- * - 任务动作统一复用 task runtime plugin command,不在 UI 层重复实现业务语义。
6
+ * - 任务动作统一复用 task plugin runtime command,不在 UI 层重复实现业务语义。
7
7
  */
8
8
 
9
9
  import fs from "fs-extra";
@@ -2,13 +2,20 @@
2
2
  * Plugin 路由模块。
3
3
  *
4
4
  * 职责说明:
5
- * 1. 提供 plugin 列表接口。
6
- * 2. 提供 plugin 可用性检查接口。
7
- * 3. 提供 plugin action 桥接接口。
5
+ * 1. 提供 plugin catalog / state / availability 接口。
6
+ * 2. 提供 plugin lifecycle 控制接口。
7
+ * 3. 提供 plugin command / action 桥接接口。
8
8
  */
9
9
 
10
10
  import { Hono } from "hono";
11
11
  import type { AgentContext } from "@/core/AgentContextTypes.js";
12
+ import {
13
+ controlPluginState,
14
+ listPluginStates,
15
+ } from "@/plugin/core/PluginStateController.js";
16
+ import type { PluginStateControlAction } from "@/plugin/types/Plugin.js";
17
+ import { parsePluginCommandRequestBody } from "@/plugin/core/PluginCommandRequest.js";
18
+ import { runPluginCommand } from "@/plugin/core/PluginActionRunner.js";
12
19
 
13
20
  /**
14
21
  * Plugin 路由参数。
@@ -28,13 +35,73 @@ export function createPluginsRouter(
28
35
  ): Hono {
29
36
  const router = new Hono();
30
37
 
31
- router.get("/api/plugins/list", (c) => {
38
+ router.get("/api/plugins/catalog", (c) => {
32
39
  return c.json({
33
40
  success: true,
34
41
  plugins: options.getAgentContext().plugins.list(),
35
42
  });
36
43
  });
37
44
 
45
+ router.get("/api/plugins/list", (c) => {
46
+ return c.json({
47
+ success: true,
48
+ plugins: listPluginStates({
49
+ context: options.getAgentContext(),
50
+ }),
51
+ });
52
+ });
53
+
54
+ router.post("/api/plugins/control", async (c) => {
55
+ const body = await c.req.json().catch(() => null);
56
+ const pluginName = String(body?.pluginName || "").trim();
57
+ const action = String(body?.action || "")
58
+ .trim()
59
+ .toLowerCase();
60
+
61
+ if (!pluginName) {
62
+ return c.json({ success: false, error: "pluginName is required" }, 400);
63
+ }
64
+ if (!action) {
65
+ return c.json({ success: false, error: "action is required" }, 400);
66
+ }
67
+ if (!["start", "stop", "restart", "status"].includes(action)) {
68
+ return c.json({ success: false, error: "invalid action" }, 400);
69
+ }
70
+
71
+ const result = await controlPluginState({
72
+ pluginName,
73
+ action: action as PluginStateControlAction,
74
+ context: options.getAgentContext(),
75
+ });
76
+ return c.json(result, result.success ? 200 : 400);
77
+ });
78
+
79
+ router.post("/api/plugins/command", async (c) => {
80
+ const body = await c.req.json().catch(() => null);
81
+ let requestBody;
82
+ try {
83
+ requestBody = parsePluginCommandRequestBody(body);
84
+ } catch (error) {
85
+ return c.json({ success: false, error: String(error) }, 400);
86
+ }
87
+
88
+ if (!requestBody.pluginName) {
89
+ return c.json({ success: false, error: "pluginName is required" }, 400);
90
+ }
91
+ if (!requestBody.command) {
92
+ return c.json({ success: false, error: "command is required" }, 400);
93
+ }
94
+
95
+ const result = await runPluginCommand({
96
+ pluginName: requestBody.pluginName,
97
+ command: requestBody.command,
98
+ payload: requestBody.payload,
99
+ schedule: requestBody.schedule,
100
+ context: options.getAgentContext(),
101
+ });
102
+ return c.json(result, result.success ? 200 : 400);
103
+ });
104
+
38
105
  router.post("/api/plugins/availability", async (c) => {
39
106
  const body = await c.req.json().catch(() => null);
40
107
  const pluginName = String(body?.pluginName || "").trim();
@@ -7,16 +7,16 @@
7
7
  */
8
8
 
9
9
  import { Hono } from "hono";
10
- import type { AgentCore } from "@/core/AgentCore.js";
10
+ import type { AgentSessionCollection } from "@/sdk/AgentSdkTypes.js";
11
11
  import { registerSdkSessionRoutes } from "@/runtime/server/http/sdk/SessionRoutes.js";
12
12
 
13
13
  /**
14
14
  * 创建 SDK HTTP router。
15
15
  */
16
16
  export function createSdkRouter(
17
- core: Pick<AgentCore, "session" | "sessions">,
17
+ sessionCollection: AgentSessionCollection,
18
18
  ): Hono {
19
19
  const router = new Hono();
20
- registerSdkSessionRoutes(router, core);
20
+ registerSdkSessionRoutes(router, sessionCollection);
21
21
  return router;
22
22
  }