@downcity/agent 1.1.12 → 1.1.14

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 (548) hide show
  1. package/bin/{runtime → core}/AgentContextTypes.d.ts +6 -6
  2. package/bin/core/AgentContextTypes.d.ts.map +1 -0
  3. package/bin/{runtime → core}/AgentContextTypes.js +2 -2
  4. package/bin/core/AgentContextTypes.js.map +1 -0
  5. package/bin/core/AgentCore.d.ts +87 -0
  6. package/bin/core/AgentCore.d.ts.map +1 -0
  7. package/bin/core/AgentCore.js +467 -0
  8. package/bin/core/AgentCore.js.map +1 -0
  9. package/bin/{runtime/AgentRuntimeTypes.d.ts → core/AgentCoreTypes.d.ts} +10 -10
  10. package/bin/core/AgentCoreTypes.d.ts.map +1 -0
  11. package/bin/core/AgentCoreTypes.js +10 -0
  12. package/bin/core/AgentCoreTypes.js.map +1 -0
  13. package/bin/host/runtime/PluginRuntime.d.ts +1 -1
  14. package/bin/host/runtime/PluginRuntime.d.ts.map +1 -1
  15. package/bin/index.d.ts +8 -10
  16. package/bin/index.d.ts.map +1 -1
  17. package/bin/index.js +4 -7
  18. package/bin/index.js.map +1 -1
  19. package/bin/plugin/builtins/asr/InboundAugment.d.ts +1 -1
  20. package/bin/plugin/builtins/asr/InboundAugment.d.ts.map +1 -1
  21. package/bin/plugin/builtins/auth/runtime/AuthorizationConfig.d.ts +1 -1
  22. package/bin/plugin/builtins/auth/runtime/AuthorizationConfig.d.ts.map +1 -1
  23. package/bin/plugin/builtins/auth/runtime/AuthorizationStore.d.ts +1 -1
  24. package/bin/plugin/builtins/auth/runtime/AuthorizationStore.d.ts.map +1 -1
  25. package/bin/plugin/builtins/voice/InboundAugment.d.ts +1 -1
  26. package/bin/plugin/builtins/voice/InboundAugment.d.ts.map +1 -1
  27. package/bin/plugin/builtins/workboard/runtime/Collector.d.ts +1 -1
  28. package/bin/plugin/builtins/workboard/runtime/Collector.d.ts.map +1 -1
  29. package/bin/plugin/builtins/workboard/runtime/Collector.js +1 -1
  30. package/bin/plugin/builtins/workboard/runtime/Collector.js.map +1 -1
  31. package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts +1 -1
  32. package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts.map +1 -1
  33. package/bin/plugin/builtins/workboard/runtime/Store.d.ts +1 -1
  34. package/bin/plugin/builtins/workboard/runtime/Store.d.ts.map +1 -1
  35. package/bin/plugin/core/Activation.d.ts +2 -2
  36. package/bin/plugin/core/Activation.d.ts.map +1 -1
  37. package/bin/plugin/core/HookRegistry.d.ts +1 -1
  38. package/bin/plugin/core/HookRegistry.d.ts.map +1 -1
  39. package/bin/plugin/core/HttpRoutes.d.ts +1 -1
  40. package/bin/plugin/core/HttpRoutes.d.ts.map +1 -1
  41. package/bin/plugin/core/LocalExecution.d.ts.map +1 -1
  42. package/bin/plugin/core/LocalExecution.js +18 -20
  43. package/bin/plugin/core/LocalExecution.js.map +1 -1
  44. package/bin/plugin/core/PluginRegistry.d.ts +1 -1
  45. package/bin/plugin/core/PluginRegistry.d.ts.map +1 -1
  46. package/bin/plugin/types/Plugin.d.ts +1 -1
  47. package/bin/plugin/types/Plugin.d.ts.map +1 -1
  48. package/bin/sandbox/SandboxConfigResolver.d.ts +1 -1
  49. package/bin/sandbox/SandboxConfigResolver.d.ts.map +1 -1
  50. package/bin/sandbox/SandboxRunner.d.ts +1 -1
  51. package/bin/sandbox/SandboxRunner.d.ts.map +1 -1
  52. package/bin/sdk/Agent.d.ts +27 -25
  53. package/bin/sdk/Agent.d.ts.map +1 -1
  54. package/bin/sdk/Agent.js +86 -365
  55. package/bin/sdk/Agent.js.map +1 -1
  56. package/bin/sdk/AgentSdkTypes.d.ts +138 -0
  57. package/bin/sdk/AgentSdkTypes.d.ts.map +1 -1
  58. package/bin/sdk/HttpServer.d.ts +9 -19
  59. package/bin/sdk/HttpServer.d.ts.map +1 -1
  60. package/bin/sdk/HttpServer.js +26 -156
  61. package/bin/sdk/HttpServer.js.map +1 -1
  62. package/bin/sdk/RpcServer.d.ts +9 -10
  63. package/bin/sdk/RpcServer.d.ts.map +1 -1
  64. package/bin/sdk/RpcServer.js +22 -178
  65. package/bin/sdk/RpcServer.js.map +1 -1
  66. package/bin/sdk/Session.d.ts +8 -8
  67. package/bin/sdk/Session.d.ts.map +1 -1
  68. package/bin/sdk/Session.js +48 -54
  69. package/bin/sdk/Session.js.map +1 -1
  70. package/bin/sdk/SessionMetadata.d.ts +3 -3
  71. package/bin/sdk/SessionMetadata.d.ts.map +1 -1
  72. package/bin/sdk/SessionMetadata.js +5 -5
  73. package/bin/sdk/SessionMetadata.js.map +1 -1
  74. package/bin/sdk/SessionPersistence.d.ts +6 -6
  75. package/bin/sdk/SessionPersistence.d.ts.map +1 -1
  76. package/bin/sdk/SessionPersistence.js +7 -7
  77. package/bin/sdk/SessionPersistence.js.map +1 -1
  78. package/bin/sdk/SessionServicePort.d.ts +6 -6
  79. package/bin/sdk/SessionServicePort.d.ts.map +1 -1
  80. package/bin/sdk/SessionServicePort.js +9 -9
  81. package/bin/sdk/SessionServicePort.js.map +1 -1
  82. package/bin/sdk/{SdkSessionSystemComposer.d.ts → SessionSystemBuilder.d.ts} +7 -7
  83. package/bin/sdk/SessionSystemBuilder.d.ts.map +1 -0
  84. package/bin/sdk/{SdkSessionSystemComposer.js → SessionSystemBuilder.js} +14 -14
  85. package/bin/sdk/SessionSystemBuilder.js.map +1 -0
  86. package/bin/server/http/Server.d.ts +10 -1
  87. package/bin/server/http/Server.d.ts.map +1 -1
  88. package/bin/server/http/Server.js +41 -15
  89. package/bin/server/http/Server.js.map +1 -1
  90. package/bin/server/http/control/AuthControlService.d.ts +1 -1
  91. package/bin/server/http/control/AuthControlService.d.ts.map +1 -1
  92. package/bin/server/http/control/ControlAuthorizationRoutes.d.ts +1 -1
  93. package/bin/server/http/control/ControlAuthorizationRoutes.d.ts.map +1 -1
  94. package/bin/server/http/control/ControlRouter.d.ts +18 -2
  95. package/bin/server/http/control/ControlRouter.d.ts.map +1 -1
  96. package/bin/server/http/control/ControlRouter.js +10 -8
  97. package/bin/server/http/control/ControlRouter.js.map +1 -1
  98. package/bin/server/http/control/ExecuteBySession.d.ts +2 -2
  99. package/bin/server/http/control/ExecuteBySession.d.ts.map +1 -1
  100. package/bin/server/http/control/OverviewRoutes.d.ts.map +1 -1
  101. package/bin/server/http/control/OverviewRoutes.js +6 -2
  102. package/bin/server/http/control/OverviewRoutes.js.map +1 -1
  103. package/bin/server/http/control/SessionSummaryStore.d.ts +1 -1
  104. package/bin/server/http/control/SessionSummaryStore.d.ts.map +1 -1
  105. package/bin/server/http/control/types/ControlRoutes.d.ts +2 -2
  106. package/bin/server/http/control/types/ControlRoutes.d.ts.map +1 -1
  107. package/bin/server/http/execute/execute.d.ts +13 -2
  108. package/bin/server/http/execute/execute.d.ts.map +1 -1
  109. package/bin/server/http/execute/execute.js +73 -71
  110. package/bin/server/http/execute/execute.js.map +1 -1
  111. package/bin/server/http/plugins/plugins.d.ts +13 -2
  112. package/bin/server/http/plugins/plugins.d.ts.map +1 -1
  113. package/bin/server/http/plugins/plugins.js +42 -40
  114. package/bin/server/http/plugins/plugins.js.map +1 -1
  115. package/bin/server/http/services/services.d.ts +12 -8
  116. package/bin/server/http/services/services.d.ts.map +1 -1
  117. package/bin/server/http/services/services.js +57 -64
  118. package/bin/server/http/services/services.js.map +1 -1
  119. package/bin/server/http/static/static.d.ts +13 -2
  120. package/bin/server/http/static/static.d.ts.map +1 -1
  121. package/bin/server/http/static/static.js +81 -79
  122. package/bin/server/http/static/static.js.map +1 -1
  123. package/bin/server/rpc/Server.d.ts +5 -3
  124. package/bin/server/rpc/Server.d.ts.map +1 -1
  125. package/bin/server/rpc/Server.js +22 -12
  126. package/bin/server/rpc/Server.js.map +1 -1
  127. package/bin/service/builtins/BaseService.d.ts +2 -2
  128. package/bin/service/builtins/BaseService.d.ts.map +1 -1
  129. package/bin/service/builtins/chat/Action.d.ts +1 -1
  130. package/bin/service/builtins/chat/Action.d.ts.map +1 -1
  131. package/bin/service/builtins/chat/ChatService.d.ts +2 -2
  132. package/bin/service/builtins/chat/ChatService.d.ts.map +1 -1
  133. package/bin/service/builtins/chat/ChatServiceTypes.d.ts +1 -1
  134. package/bin/service/builtins/chat/ChatServiceTypes.d.ts.map +1 -1
  135. package/bin/service/builtins/chat/channels/BaseChatChannel.d.ts +1 -1
  136. package/bin/service/builtins/chat/channels/BaseChatChannel.d.ts.map +1 -1
  137. package/bin/service/builtins/chat/channels/BaseChatChannelQueue.d.ts +1 -1
  138. package/bin/service/builtins/chat/channels/BaseChatChannelQueue.d.ts.map +1 -1
  139. package/bin/service/builtins/chat/channels/BaseChatChannelSupport.d.ts +1 -1
  140. package/bin/service/builtins/chat/channels/BaseChatChannelSupport.d.ts.map +1 -1
  141. package/bin/service/builtins/chat/channels/feishu/Feishu.d.ts +1 -1
  142. package/bin/service/builtins/chat/channels/feishu/Feishu.d.ts.map +1 -1
  143. package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.d.ts +1 -1
  144. package/bin/service/builtins/chat/channels/feishu/FeishuMessageHandler.d.ts.map +1 -1
  145. package/bin/service/builtins/chat/channels/feishu/FeishuPlatformClient.d.ts +1 -1
  146. package/bin/service/builtins/chat/channels/feishu/FeishuPlatformClient.d.ts.map +1 -1
  147. package/bin/service/builtins/chat/channels/qq/QQ.d.ts +1 -1
  148. package/bin/service/builtins/chat/channels/qq/QQ.d.ts.map +1 -1
  149. package/bin/service/builtins/chat/channels/qq/QQMessageHandler.d.ts +1 -1
  150. package/bin/service/builtins/chat/channels/qq/QQMessageHandler.d.ts.map +1 -1
  151. package/bin/service/builtins/chat/channels/qq/QQSupport.d.ts +1 -1
  152. package/bin/service/builtins/chat/channels/qq/QQSupport.d.ts.map +1 -1
  153. package/bin/service/builtins/chat/channels/telegram/Bot.d.ts +1 -1
  154. package/bin/service/builtins/chat/channels/telegram/Bot.d.ts.map +1 -1
  155. package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.d.ts +1 -1
  156. package/bin/service/builtins/chat/channels/telegram/TelegramMessageHandler.d.ts.map +1 -1
  157. package/bin/service/builtins/chat/channels/telegram/TelegramPlatformClient.d.ts +1 -1
  158. package/bin/service/builtins/chat/channels/telegram/TelegramPlatformClient.d.ts.map +1 -1
  159. package/bin/service/builtins/chat/runtime/ChannelContextStore.d.ts +1 -1
  160. package/bin/service/builtins/chat/runtime/ChannelContextStore.d.ts.map +1 -1
  161. package/bin/service/builtins/chat/runtime/ChatActionExecution.d.ts +1 -1
  162. package/bin/service/builtins/chat/runtime/ChatActionExecution.d.ts.map +1 -1
  163. package/bin/service/builtins/chat/runtime/ChatActionInput.d.ts +3 -36
  164. package/bin/service/builtins/chat/runtime/ChatActionInput.d.ts.map +1 -1
  165. package/bin/service/builtins/chat/runtime/ChatActionInput.js +3 -118
  166. package/bin/service/builtins/chat/runtime/ChatActionInput.js.map +1 -1
  167. package/bin/service/builtins/chat/runtime/ChatChannelActions.d.ts +1 -1
  168. package/bin/service/builtins/chat/runtime/ChatChannelActions.d.ts.map +1 -1
  169. package/bin/service/builtins/chat/runtime/ChatChannelConfig.d.ts +1 -1
  170. package/bin/service/builtins/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
  171. package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts +1 -1
  172. package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts.map +1 -1
  173. package/bin/service/builtins/chat/runtime/ChatChannelLifecycle.d.ts +1 -1
  174. package/bin/service/builtins/chat/runtime/ChatChannelLifecycle.d.ts.map +1 -1
  175. package/bin/service/builtins/chat/runtime/ChatHistoryStore.d.ts +1 -1
  176. package/bin/service/builtins/chat/runtime/ChatHistoryStore.d.ts.map +1 -1
  177. package/bin/service/builtins/chat/runtime/ChatIngressStore.d.ts +1 -1
  178. package/bin/service/builtins/chat/runtime/ChatIngressStore.d.ts.map +1 -1
  179. package/bin/service/builtins/chat/runtime/ChatMetaStore.d.ts +1 -1
  180. package/bin/service/builtins/chat/runtime/ChatMetaStore.d.ts.map +1 -1
  181. package/bin/service/builtins/chat/runtime/ChatQueueReplyDispatch.d.ts +1 -1
  182. package/bin/service/builtins/chat/runtime/ChatQueueReplyDispatch.d.ts.map +1 -1
  183. package/bin/service/builtins/chat/runtime/ChatQueueSessionBridge.d.ts +1 -1
  184. package/bin/service/builtins/chat/runtime/ChatQueueSessionBridge.d.ts.map +1 -1
  185. package/bin/service/builtins/chat/runtime/ChatQueueStore.d.ts +1 -1
  186. package/bin/service/builtins/chat/runtime/ChatQueueStore.d.ts.map +1 -1
  187. package/bin/service/builtins/chat/runtime/ChatQueueWorker.d.ts +1 -1
  188. package/bin/service/builtins/chat/runtime/ChatQueueWorker.d.ts.map +1 -1
  189. package/bin/service/builtins/chat/runtime/ChatServiceActions.d.ts +1 -1
  190. package/bin/service/builtins/chat/runtime/ChatServiceActions.d.ts.map +1 -1
  191. package/bin/service/builtins/chat/runtime/ChatServiceActions.js +2 -109
  192. package/bin/service/builtins/chat/runtime/ChatServiceActions.js.map +1 -1
  193. package/bin/service/builtins/chat/runtime/ChatServiceSystem.d.ts +1 -1
  194. package/bin/service/builtins/chat/runtime/ChatServiceSystem.d.ts.map +1 -1
  195. package/bin/service/builtins/chat/runtime/ChatSession.d.ts +27 -8
  196. package/bin/service/builtins/chat/runtime/ChatSession.d.ts.map +1 -1
  197. package/bin/service/builtins/chat/runtime/ChatSession.js +9 -4
  198. package/bin/service/builtins/chat/runtime/ChatSession.js.map +1 -1
  199. package/bin/service/builtins/chat/runtime/ChatSessionDelete.d.ts +1 -1
  200. package/bin/service/builtins/chat/runtime/ChatSessionDelete.d.ts.map +1 -1
  201. package/bin/service/builtins/chat/runtime/ChatkeySend.d.ts +1 -1
  202. package/bin/service/builtins/chat/runtime/ChatkeySend.d.ts.map +1 -1
  203. package/bin/service/builtins/chat/runtime/EnqueueDispatch.d.ts +1 -1
  204. package/bin/service/builtins/chat/runtime/EnqueueDispatch.d.ts.map +1 -1
  205. package/bin/service/builtins/chat/runtime/InboundAugment.d.ts +1 -1
  206. package/bin/service/builtins/chat/runtime/InboundAugment.d.ts.map +1 -1
  207. package/bin/service/builtins/chat/runtime/PluginDispatch.d.ts +1 -1
  208. package/bin/service/builtins/chat/runtime/PluginDispatch.d.ts.map +1 -1
  209. package/bin/service/builtins/chat/runtime/ReplyDispatch.d.ts +1 -1
  210. package/bin/service/builtins/chat/runtime/ReplyDispatch.d.ts.map +1 -1
  211. package/bin/service/builtins/chat/runtime/SystemPrompt.d.ts +1 -1
  212. package/bin/service/builtins/chat/runtime/SystemPrompt.d.ts.map +1 -1
  213. package/bin/service/builtins/contact/Action.d.ts +2 -2
  214. package/bin/service/builtins/contact/Action.d.ts.map +1 -1
  215. package/bin/service/builtins/contact/Action.js +2 -58
  216. package/bin/service/builtins/contact/Action.js.map +1 -1
  217. package/bin/service/builtins/contact/ContactService.d.ts +1 -1
  218. package/bin/service/builtins/contact/ContactService.d.ts.map +1 -1
  219. package/bin/service/builtins/contact/runtime/ChatRuntime.d.ts +1 -1
  220. package/bin/service/builtins/contact/runtime/ChatRuntime.d.ts.map +1 -1
  221. package/bin/service/builtins/contact/runtime/ContactPayload.d.ts +0 -7
  222. package/bin/service/builtins/contact/runtime/ContactPayload.d.ts.map +1 -1
  223. package/bin/service/builtins/contact/runtime/ContactPayload.js +0 -9
  224. package/bin/service/builtins/contact/runtime/ContactPayload.js.map +1 -1
  225. package/bin/service/builtins/contact/runtime/RemoteClient.d.ts +1 -1
  226. package/bin/service/builtins/contact/runtime/RemoteClient.d.ts.map +1 -1
  227. package/bin/service/builtins/contact/runtime/RemoteClient.js +37 -19
  228. package/bin/service/builtins/contact/runtime/RemoteClient.js.map +1 -1
  229. package/bin/service/builtins/contact/runtime/ShareBundle.d.ts +1 -1
  230. package/bin/service/builtins/contact/runtime/ShareBundle.d.ts.map +1 -1
  231. package/bin/service/builtins/memory/Action.d.ts +1 -1
  232. package/bin/service/builtins/memory/Action.d.ts.map +1 -1
  233. package/bin/service/builtins/memory/MemoryService.d.ts +1 -1
  234. package/bin/service/builtins/memory/MemoryService.d.ts.map +1 -1
  235. package/bin/service/builtins/memory/MemoryService.js +0 -27
  236. package/bin/service/builtins/memory/MemoryService.js.map +1 -1
  237. package/bin/service/builtins/memory/runtime/Flush.d.ts +1 -1
  238. package/bin/service/builtins/memory/runtime/Flush.d.ts.map +1 -1
  239. package/bin/service/builtins/memory/runtime/Search.d.ts +1 -1
  240. package/bin/service/builtins/memory/runtime/Search.d.ts.map +1 -1
  241. package/bin/service/builtins/memory/runtime/Store.d.ts +1 -1
  242. package/bin/service/builtins/memory/runtime/Store.d.ts.map +1 -1
  243. package/bin/service/builtins/memory/runtime/SystemProvider.d.ts +1 -1
  244. package/bin/service/builtins/memory/runtime/SystemProvider.d.ts.map +1 -1
  245. package/bin/service/builtins/memory/runtime/Writer.d.ts +1 -1
  246. package/bin/service/builtins/memory/runtime/Writer.d.ts.map +1 -1
  247. package/bin/service/builtins/schedule/ScheduleService.d.ts +39 -0
  248. package/bin/service/builtins/schedule/ScheduleService.d.ts.map +1 -0
  249. package/bin/service/builtins/schedule/ScheduleService.js +106 -0
  250. package/bin/service/builtins/schedule/ScheduleService.js.map +1 -0
  251. package/bin/service/builtins/shell/ShellRuntimeTypes.d.ts +1 -1
  252. package/bin/service/builtins/shell/ShellRuntimeTypes.d.ts.map +1 -1
  253. package/bin/service/builtins/shell/ShellService.d.ts +2 -2
  254. package/bin/service/builtins/shell/ShellService.d.ts.map +1 -1
  255. package/bin/service/builtins/shell/runtime/ShellActionResponse.d.ts +1 -1
  256. package/bin/service/builtins/shell/runtime/ShellActionResponse.d.ts.map +1 -1
  257. package/bin/service/builtins/shell/runtime/ShellActionRuntime.d.ts +1 -1
  258. package/bin/service/builtins/shell/runtime/ShellActionRuntime.d.ts.map +1 -1
  259. package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts +1 -1
  260. package/bin/service/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts.map +1 -1
  261. package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.d.ts +1 -1
  262. package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.d.ts.map +1 -1
  263. package/bin/service/builtins/task/Action.d.ts +1 -1
  264. package/bin/service/builtins/task/Action.d.ts.map +1 -1
  265. package/bin/service/builtins/task/Scheduler.d.ts +1 -1
  266. package/bin/service/builtins/task/Scheduler.d.ts.map +1 -1
  267. package/bin/service/builtins/task/TaskService.d.ts +2 -2
  268. package/bin/service/builtins/task/TaskService.d.ts.map +1 -1
  269. package/bin/service/builtins/task/runtime/CronRuntime.d.ts +1 -1
  270. package/bin/service/builtins/task/runtime/CronRuntime.d.ts.map +1 -1
  271. package/bin/service/builtins/task/runtime/Runner.d.ts +2 -2
  272. package/bin/service/builtins/task/runtime/Runner.d.ts.map +1 -1
  273. package/bin/service/builtins/task/runtime/Runner.js +1 -1
  274. package/bin/service/builtins/task/runtime/TaskActionExecution.d.ts +1 -1
  275. package/bin/service/builtins/task/runtime/TaskActionExecution.d.ts.map +1 -1
  276. package/bin/service/builtins/task/runtime/TaskActionInput.d.ts +2 -31
  277. package/bin/service/builtins/task/runtime/TaskActionInput.d.ts.map +1 -1
  278. package/bin/service/builtins/task/runtime/TaskActionInput.js +2 -141
  279. package/bin/service/builtins/task/runtime/TaskActionInput.js.map +1 -1
  280. package/bin/service/builtins/task/runtime/TaskRunChatDispatch.d.ts +1 -1
  281. package/bin/service/builtins/task/runtime/TaskRunChatDispatch.d.ts.map +1 -1
  282. package/bin/service/builtins/task/runtime/TaskRunnerRound.d.ts +1 -1
  283. package/bin/service/builtins/task/runtime/TaskRunnerRound.d.ts.map +1 -1
  284. package/bin/service/builtins/task/runtime/TaskRunnerScript.d.ts +1 -1
  285. package/bin/service/builtins/task/runtime/TaskRunnerScript.d.ts.map +1 -1
  286. package/bin/service/builtins/task/runtime/TaskRunnerSession.d.ts +3 -3
  287. package/bin/service/builtins/task/runtime/TaskRunnerSession.d.ts.map +1 -1
  288. package/bin/service/builtins/task/runtime/TaskRunnerSession.js +4 -4
  289. package/bin/service/builtins/task/runtime/TaskRunnerSession.js.map +1 -1
  290. package/bin/service/builtins/task/runtime/TaskRunnerTypes.d.ts +1 -1
  291. package/bin/service/builtins/task/runtime/TaskServiceActions.d.ts +1 -1
  292. package/bin/service/builtins/task/runtime/TaskServiceActions.d.ts.map +1 -1
  293. package/bin/service/builtins/task/runtime/TaskServiceActions.js +2 -30
  294. package/bin/service/builtins/task/runtime/TaskServiceActions.js.map +1 -1
  295. package/bin/service/core/Manager.d.ts +0 -1
  296. package/bin/service/core/Manager.d.ts.map +1 -1
  297. package/bin/service/core/Manager.js +0 -1
  298. package/bin/service/core/Manager.js.map +1 -1
  299. package/bin/service/core/ServiceActionRunner.d.ts +1 -1
  300. package/bin/service/core/ServiceActionRunner.d.ts.map +1 -1
  301. package/bin/service/core/ServiceActionRunner.js +3 -1
  302. package/bin/service/core/ServiceActionRunner.js.map +1 -1
  303. package/bin/service/core/ServiceClassRegistry.d.ts +1 -1
  304. package/bin/service/core/ServiceClassRegistry.d.ts.map +1 -1
  305. package/bin/service/core/ServiceCommandRequest.d.ts +36 -0
  306. package/bin/service/core/ServiceCommandRequest.d.ts.map +1 -0
  307. package/bin/service/core/ServiceCommandRequest.js +53 -0
  308. package/bin/service/core/ServiceCommandRequest.js.map +1 -0
  309. package/bin/service/core/ServiceManager.d.ts +1 -1
  310. package/bin/service/core/ServiceManager.d.ts.map +1 -1
  311. package/bin/service/core/ServiceStateController.d.ts +20 -7
  312. package/bin/service/core/ServiceStateController.d.ts.map +1 -1
  313. package/bin/service/core/ServiceStateController.js +23 -20
  314. package/bin/service/core/ServiceStateController.js.map +1 -1
  315. package/bin/service/core/ServiceSystemProviders.d.ts +1 -1
  316. package/bin/service/core/ServiceSystemProviders.d.ts.map +1 -1
  317. package/bin/service/core/Services.d.ts +1 -1
  318. package/bin/service/core/Services.d.ts.map +1 -1
  319. package/bin/service/core/Services.js +2 -0
  320. package/bin/service/core/Services.js.map +1 -1
  321. package/bin/service/schedule/Executor.d.ts +1 -1
  322. package/bin/service/schedule/Executor.d.ts.map +1 -1
  323. package/bin/service/types/Service.d.ts +1 -23
  324. package/bin/service/types/Service.d.ts.map +1 -1
  325. package/bin/session/{Session.d.ts → Executor.d.ts} +54 -17
  326. package/bin/session/Executor.d.ts.map +1 -0
  327. package/bin/session/{Session.js → Executor.js} +60 -23
  328. package/bin/session/Executor.js.map +1 -0
  329. package/bin/session/composer/SessionComposer.d.ts +1 -1
  330. package/bin/session/composer/SessionComposer.js +1 -1
  331. package/bin/session/composer/compaction/SessionCompactionComposer.d.ts +2 -2
  332. package/bin/session/composer/execution/LocalSessionExecutionComposer.d.ts +1 -1
  333. package/bin/session/composer/execution/LocalSessionExecutionComposer.js +1 -1
  334. package/bin/session/composer/execution/SessionExecutionComposer.d.ts +1 -1
  335. package/bin/session/composer/history/SessionHistoryComposer.d.ts +1 -1
  336. package/bin/session/composer/system/SessionSystemComposer.d.ts +1 -1
  337. package/bin/session/composer/system/SessionSystemComposer.js +1 -1
  338. package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts +1 -1
  339. package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts.map +1 -1
  340. package/bin/session/composer/system/default/SystemDomain.d.ts +1 -1
  341. package/bin/session/composer/system/default/SystemDomain.d.ts.map +1 -1
  342. package/bin/session/executors/local/{LocalSessionCore.d.ts → Runner.d.ts} +10 -10
  343. package/bin/session/executors/local/Runner.d.ts.map +1 -0
  344. package/bin/session/executors/local/{LocalSessionCore.js → Runner.js} +11 -11
  345. package/bin/session/executors/local/Runner.js.map +1 -0
  346. package/bin/session/executors/local/SessionExecutionError.d.ts +1 -1
  347. package/bin/session/executors/local/SessionExecutionError.js +1 -1
  348. package/bin/session/executors/local/SessionLoopDecision.d.ts +3 -3
  349. package/bin/session/executors/local/SessionLoopDecision.js +3 -3
  350. package/bin/session/executors/local/SessionModelMessageState.d.ts +2 -2
  351. package/bin/session/executors/local/SessionModelMessageState.js +2 -2
  352. package/bin/session/executors/local/SessionSignals.d.ts +3 -3
  353. package/bin/session/executors/local/SessionSignals.js +3 -3
  354. package/bin/session/executors/local/SessionToolLoopRunner.d.ts +1 -1
  355. package/bin/session/executors/local/SessionToolLoopRunner.js +2 -2
  356. package/bin/session/executors/local/SessionToolLoopRunner.js.map +1 -1
  357. package/bin/session/tools/shell/ShellToolBridge.d.ts +1 -1
  358. package/bin/session/tools/shell/ShellToolBridge.d.ts.map +1 -1
  359. package/bin/session/types/SessionLoop.d.ts +1 -1
  360. package/bin/session/types/SessionLoop.js +1 -1
  361. package/bin/session/types/SessionRun.d.ts +2 -2
  362. package/bin/session/types/SessionRun.js +1 -1
  363. package/package.json +1 -1
  364. package/src/{runtime → core}/AgentContextTypes.ts +6 -7
  365. package/src/core/AgentCore.ts +527 -0
  366. package/src/{runtime/AgentRuntimeTypes.ts → core/AgentCoreTypes.ts} +9 -9
  367. package/src/host/runtime/PluginRuntime.ts +1 -1
  368. package/src/index.ts +26 -23
  369. package/src/plugin/builtins/asr/InboundAugment.ts +1 -1
  370. package/src/plugin/builtins/auth/runtime/AuthorizationConfig.ts +1 -1
  371. package/src/plugin/builtins/auth/runtime/AuthorizationStore.ts +1 -1
  372. package/src/plugin/builtins/voice/InboundAugment.ts +1 -1
  373. package/src/plugin/builtins/workboard/runtime/Collector.ts +2 -2
  374. package/src/plugin/builtins/workboard/runtime/Normalizer.ts +1 -1
  375. package/src/plugin/builtins/workboard/runtime/Store.ts +1 -1
  376. package/src/plugin/core/Activation.ts +2 -2
  377. package/src/plugin/core/HookRegistry.ts +1 -1
  378. package/src/plugin/core/HttpRoutes.ts +1 -1
  379. package/src/plugin/core/LocalExecution.ts +21 -20
  380. package/src/plugin/core/PluginRegistry.ts +1 -1
  381. package/src/plugin/types/Plugin.ts +1 -1
  382. package/src/sandbox/SandboxConfigResolver.ts +1 -1
  383. package/src/sandbox/SandboxRunner.ts +1 -1
  384. package/src/sdk/Agent.ts +101 -395
  385. package/src/sdk/AgentSdkTypes.ts +158 -0
  386. package/src/sdk/HttpServer.ts +27 -192
  387. package/src/sdk/RpcServer.ts +24 -211
  388. package/src/sdk/Session.ts +64 -68
  389. package/src/sdk/SessionMetadata.ts +5 -5
  390. package/src/sdk/SessionPersistence.ts +13 -13
  391. package/src/sdk/SessionServicePort.ts +14 -14
  392. package/src/sdk/{SdkSessionSystemComposer.ts → SessionSystemBuilder.ts} +24 -24
  393. package/src/server/http/Server.ts +63 -18
  394. package/src/server/http/control/AuthControlService.ts +1 -1
  395. package/src/server/http/control/ControlAuthorizationRoutes.ts +1 -1
  396. package/src/server/http/control/ControlRouter.ts +27 -11
  397. package/src/server/http/control/ExecuteBySession.ts +2 -2
  398. package/src/server/http/control/OverviewRoutes.ts +6 -2
  399. package/src/server/http/control/SessionSummaryStore.ts +1 -1
  400. package/src/server/http/control/types/ControlRoutes.ts +2 -2
  401. package/src/server/http/execute/execute.ts +107 -91
  402. package/src/server/http/plugins/plugins.ts +60 -44
  403. package/src/server/http/services/services.ts +68 -64
  404. package/src/server/http/static/static.ts +95 -79
  405. package/src/server/rpc/Server.ts +26 -15
  406. package/src/service/builtins/BaseService.ts +2 -2
  407. package/src/service/builtins/chat/Action.ts +1 -1
  408. package/src/service/builtins/chat/ChatService.ts +2 -2
  409. package/src/service/builtins/chat/ChatServiceTypes.ts +1 -1
  410. package/src/service/builtins/chat/channels/BaseChatChannel.ts +1 -1
  411. package/src/service/builtins/chat/channels/BaseChatChannelQueue.ts +1 -1
  412. package/src/service/builtins/chat/channels/BaseChatChannelSupport.ts +1 -1
  413. package/src/service/builtins/chat/channels/feishu/Feishu.ts +1 -1
  414. package/src/service/builtins/chat/channels/feishu/FeishuMessageHandler.ts +1 -1
  415. package/src/service/builtins/chat/channels/feishu/FeishuPlatformClient.ts +1 -1
  416. package/src/service/builtins/chat/channels/qq/QQ.ts +1 -1
  417. package/src/service/builtins/chat/channels/qq/QQMessageHandler.ts +1 -1
  418. package/src/service/builtins/chat/channels/qq/QQSupport.ts +1 -1
  419. package/src/service/builtins/chat/channels/telegram/Bot.ts +1 -1
  420. package/src/service/builtins/chat/channels/telegram/TelegramMessageHandler.ts +1 -1
  421. package/src/service/builtins/chat/channels/telegram/TelegramPlatformClient.ts +1 -1
  422. package/src/service/builtins/chat/runtime/ChannelContextStore.ts +1 -1
  423. package/src/service/builtins/chat/runtime/ChatActionExecution.ts +1 -1
  424. package/src/service/builtins/chat/runtime/ChatActionInput.ts +2 -158
  425. package/src/service/builtins/chat/runtime/ChatChannelActions.ts +1 -1
  426. package/src/service/builtins/chat/runtime/ChatChannelConfig.ts +1 -1
  427. package/src/service/builtins/chat/runtime/ChatChannelCore.ts +1 -1
  428. package/src/service/builtins/chat/runtime/ChatChannelLifecycle.ts +1 -1
  429. package/src/service/builtins/chat/runtime/ChatHistoryStore.ts +1 -1
  430. package/src/service/builtins/chat/runtime/ChatIngressStore.ts +1 -1
  431. package/src/service/builtins/chat/runtime/ChatMetaStore.ts +1 -1
  432. package/src/service/builtins/chat/runtime/ChatQueueReplyDispatch.ts +1 -1
  433. package/src/service/builtins/chat/runtime/ChatQueueSessionBridge.ts +1 -1
  434. package/src/service/builtins/chat/runtime/ChatQueueStore.ts +1 -1
  435. package/src/service/builtins/chat/runtime/ChatQueueWorker.ts +1 -1
  436. package/src/service/builtins/chat/runtime/ChatServiceActions.ts +1 -118
  437. package/src/service/builtins/chat/runtime/ChatServiceSystem.ts +1 -1
  438. package/src/service/builtins/chat/runtime/ChatSession.ts +37 -13
  439. package/src/service/builtins/chat/runtime/ChatSessionDelete.ts +1 -1
  440. package/src/service/builtins/chat/runtime/ChatkeySend.ts +1 -1
  441. package/src/service/builtins/chat/runtime/EnqueueDispatch.ts +1 -1
  442. package/src/service/builtins/chat/runtime/InboundAugment.ts +1 -1
  443. package/src/service/builtins/chat/runtime/PluginDispatch.ts +1 -1
  444. package/src/service/builtins/chat/runtime/ReplyDispatch.ts +1 -1
  445. package/src/service/builtins/chat/runtime/SystemPrompt.ts +1 -1
  446. package/src/service/builtins/contact/Action.ts +2 -59
  447. package/src/service/builtins/contact/ContactService.ts +2 -2
  448. package/src/service/builtins/contact/runtime/ChatRuntime.ts +1 -1
  449. package/src/service/builtins/contact/runtime/ContactPayload.ts +0 -12
  450. package/src/service/builtins/contact/runtime/RemoteClient.ts +40 -19
  451. package/src/service/builtins/contact/runtime/ShareBundle.ts +1 -1
  452. package/src/service/builtins/memory/Action.ts +1 -1
  453. package/src/service/builtins/memory/MemoryService.ts +1 -28
  454. package/src/service/builtins/memory/runtime/Flush.ts +1 -1
  455. package/src/service/builtins/memory/runtime/Search.ts +1 -1
  456. package/src/service/builtins/memory/runtime/Store.ts +1 -1
  457. package/src/service/builtins/memory/runtime/SystemProvider.ts +1 -1
  458. package/src/service/builtins/memory/runtime/Writer.ts +1 -1
  459. package/src/service/builtins/schedule/ScheduleService.ts +131 -0
  460. package/src/service/builtins/shell/ShellRuntimeTypes.ts +1 -1
  461. package/src/service/builtins/shell/ShellService.ts +2 -2
  462. package/src/service/builtins/shell/runtime/ShellActionResponse.ts +1 -1
  463. package/src/service/builtins/shell/runtime/ShellActionRuntime.ts +1 -1
  464. package/src/service/builtins/shell/runtime/ShellActionRuntimeSupport.ts +1 -1
  465. package/src/service/builtins/shell/runtime/ShellRuntimeEnvironment.ts +1 -1
  466. package/src/service/builtins/task/Action.ts +1 -1
  467. package/src/service/builtins/task/Scheduler.ts +1 -1
  468. package/src/service/builtins/task/TaskService.ts +2 -2
  469. package/src/service/builtins/task/runtime/CronRuntime.ts +1 -1
  470. package/src/service/builtins/task/runtime/Runner.ts +2 -2
  471. package/src/service/builtins/task/runtime/TaskActionExecution.ts +1 -1
  472. package/src/service/builtins/task/runtime/TaskActionInput.ts +3 -185
  473. package/src/service/builtins/task/runtime/TaskRunChatDispatch.ts +1 -1
  474. package/src/service/builtins/task/runtime/TaskRunnerRound.ts +1 -1
  475. package/src/service/builtins/task/runtime/TaskRunnerScript.ts +1 -1
  476. package/src/service/builtins/task/runtime/TaskRunnerSession.ts +5 -5
  477. package/src/service/builtins/task/runtime/TaskRunnerTypes.ts +1 -1
  478. package/src/service/builtins/task/runtime/TaskServiceActions.ts +1 -35
  479. package/src/service/core/Manager.ts +0 -1
  480. package/src/service/core/ServiceActionRunner.ts +4 -2
  481. package/src/service/core/ServiceClassRegistry.ts +1 -1
  482. package/src/service/core/ServiceCommandRequest.ts +93 -0
  483. package/src/service/core/ServiceManager.ts +0 -1
  484. package/src/service/core/ServiceStateController.ts +45 -20
  485. package/src/service/core/ServiceSystemProviders.ts +1 -1
  486. package/src/service/core/Services.ts +3 -1
  487. package/src/service/schedule/Executor.ts +1 -1
  488. package/src/service/types/Service.ts +1 -24
  489. package/src/session/{Session.ts → Executor.ts} +96 -26
  490. package/src/session/composer/SessionComposer.ts +1 -1
  491. package/src/session/composer/compaction/SessionCompactionComposer.ts +2 -2
  492. package/src/session/composer/execution/LocalSessionExecutionComposer.ts +1 -1
  493. package/src/session/composer/execution/SessionExecutionComposer.ts +1 -1
  494. package/src/session/composer/history/SessionHistoryComposer.ts +1 -1
  495. package/src/session/composer/system/SessionSystemComposer.ts +1 -1
  496. package/src/session/composer/system/default/DefaultSessionSystemComposer.ts +1 -1
  497. package/src/session/composer/system/default/SystemDomain.ts +1 -1
  498. package/src/session/executors/local/{LocalSessionCore.ts → Runner.ts} +13 -13
  499. package/src/session/executors/local/SessionExecutionError.ts +1 -1
  500. package/src/session/executors/local/SessionLoopDecision.ts +3 -3
  501. package/src/session/executors/local/SessionModelMessageState.ts +2 -2
  502. package/src/session/executors/local/SessionSignals.ts +3 -3
  503. package/src/session/executors/local/SessionToolLoopRunner.ts +2 -2
  504. package/src/session/tools/shell/ShellToolBridge.ts +1 -1
  505. package/src/session/types/SessionLoop.ts +1 -1
  506. package/src/session/types/SessionRun.ts +2 -2
  507. package/tsconfig.tsbuildinfo +1 -1
  508. package/bin/runtime/AgentContext.d.ts +0 -23
  509. package/bin/runtime/AgentContext.d.ts.map +0 -1
  510. package/bin/runtime/AgentContext.js +0 -149
  511. package/bin/runtime/AgentContext.js.map +0 -1
  512. package/bin/runtime/AgentContextTypes.d.ts.map +0 -1
  513. package/bin/runtime/AgentContextTypes.js.map +0 -1
  514. package/bin/runtime/AgentRuntime.d.ts +0 -37
  515. package/bin/runtime/AgentRuntime.d.ts.map +0 -1
  516. package/bin/runtime/AgentRuntime.js +0 -296
  517. package/bin/runtime/AgentRuntime.js.map +0 -1
  518. package/bin/runtime/AgentRuntimeState.d.ts +0 -42
  519. package/bin/runtime/AgentRuntimeState.d.ts.map +0 -1
  520. package/bin/runtime/AgentRuntimeState.js +0 -172
  521. package/bin/runtime/AgentRuntimeState.js.map +0 -1
  522. package/bin/runtime/AgentRuntimeTypes.d.ts.map +0 -1
  523. package/bin/runtime/AgentRuntimeTypes.js +0 -10
  524. package/bin/runtime/AgentRuntimeTypes.js.map +0 -1
  525. package/bin/sdk/SdkSessionSystemComposer.d.ts.map +0 -1
  526. package/bin/sdk/SdkSessionSystemComposer.js.map +0 -1
  527. package/bin/service/core/ServiceActionApi.d.ts +0 -15
  528. package/bin/service/core/ServiceActionApi.d.ts.map +0 -1
  529. package/bin/service/core/ServiceActionApi.js +0 -234
  530. package/bin/service/core/ServiceActionApi.js.map +0 -1
  531. package/bin/service/schedule/Runtime.d.ts +0 -17
  532. package/bin/service/schedule/Runtime.d.ts.map +0 -1
  533. package/bin/service/schedule/Runtime.js +0 -64
  534. package/bin/service/schedule/Runtime.js.map +0 -1
  535. package/bin/session/Session.d.ts.map +0 -1
  536. package/bin/session/Session.js.map +0 -1
  537. package/bin/session/executors/local/LocalSessionCore.d.ts.map +0 -1
  538. package/bin/session/executors/local/LocalSessionCore.js.map +0 -1
  539. package/bin/session/executors/local/LocalSessionExecutor.d.ts +0 -61
  540. package/bin/session/executors/local/LocalSessionExecutor.d.ts.map +0 -1
  541. package/bin/session/executors/local/LocalSessionExecutor.js +0 -36
  542. package/bin/session/executors/local/LocalSessionExecutor.js.map +0 -1
  543. package/src/runtime/AgentContext.ts +0 -182
  544. package/src/runtime/AgentRuntime.ts +0 -376
  545. package/src/runtime/AgentRuntimeState.ts +0 -213
  546. package/src/service/core/ServiceActionApi.ts +0 -304
  547. package/src/service/schedule/Runtime.ts +0 -78
  548. package/src/session/executors/local/LocalSessionExecutor.ts +0 -89
@@ -3,16 +3,14 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 面向 `new Agent(...)` 的本地会话使用场景。
6
- * - 统一收口消息落盘、默认模型配置、run/stream/fork 等高层 API。
7
- * - 内部继续复用现有 `Session` / `JsonlSessionHistoryComposer` / `LocalSessionExecutor`。
6
+ * - 统一收口消息落盘、session 级模型配置、run/stream/fork 等高层 API。
7
+ * - 内部继续复用 `Executor` / `JsonlSessionHistoryComposer` / `Runner`。
8
8
  */
9
9
 
10
10
  import { nanoid } from "nanoid";
11
11
  import type { LanguageModel, Tool } from "ai";
12
- import { Session as CoreSession } from "@session/Session.js";
12
+ import { Executor } from "@session/Executor.js";
13
13
  import { JsonlSessionHistoryComposer } from "@session/composer/history/jsonl/JsonlSessionHistoryComposer.js";
14
- import { JsonlSessionCompactionComposer } from "@session/composer/compaction/jsonl/JsonlSessionCompactionComposer.js";
15
- import { LocalSessionExecutor } from "@session/executors/local/LocalSessionExecutor.js";
16
14
  import { extractTextFromUiMessage } from "@/service/builtins/chat/runtime/UIMessageTransformer.js";
17
15
  import type {
18
16
  AgentSessionConfigSnapshot,
@@ -27,30 +25,30 @@ import type {
27
25
  } from "@/sdk/AgentSdkTypes.js";
28
26
  import type { SessionMessageV1 } from "@/session/types/SessionMessages.js";
29
27
  import {
30
- resolveSdkSessionSystemBlocks,
31
- SdkSessionSystemComposer,
32
- } from "@/sdk/SdkSessionSystemComposer.js";
28
+ buildSessionSystemBlocks,
29
+ SessionSystemBuilder,
30
+ } from "@/sdk/SessionSystemBuilder.js";
33
31
  import {
34
32
  inferModelLabel,
35
- patchSdkSessionModelLabel,
36
- readSdkSessionMetadata,
33
+ patchSessionModelLabel,
34
+ readSessionMetadata,
37
35
  resolveSystemTimezone,
38
- writeSdkSessionMetadata,
36
+ writeSessionMetadata,
39
37
  } from "@/sdk/SessionMetadata.js";
40
38
  import {
41
39
  getSdkAgentSessionArchiveDirPath,
42
40
  getSdkAgentSessionDirPath,
43
41
  } from "@/sdk/Paths.js";
44
42
  import { AsyncQueue } from "@/sdk/AsyncQueue.js";
45
- import type { SessionPort } from "@/runtime/AgentContextTypes.js";
43
+ import type { SessionPort } from "@/core/AgentContextTypes.js";
46
44
  import { pushUiMessageChunkAsSdkEvent } from "@/sdk/StreamEvents.js";
47
45
  import {
48
46
  persistSdkAssistantResult,
49
- touchSdkSessionMetadata,
47
+ touchSessionMetadata,
50
48
  } from "@/sdk/SessionPersistence.js";
51
- import { createSdkSessionServicePort } from "@/sdk/SessionServicePort.js";
49
+ import { createSessionServicePort } from "@/sdk/SessionServicePort.js";
52
50
 
53
- type SdkSessionOptions = {
51
+ type SessionOptions = {
54
52
  /**
55
53
  * 当前 agent 稳定标识。
56
54
  */
@@ -98,25 +96,25 @@ type SdkSessionOptions = {
98
96
  /**
99
97
  * SDK 本地 Session。
100
98
  */
101
- export class SdkSession {
99
+ export class Session {
102
100
  readonly id: string;
103
101
  readonly agentId: string;
104
102
 
105
103
  private readonly projectRoot: string;
106
104
  private readonly tools: Record<string, Tool>;
107
- private readonly logger: SdkSessionOptions["logger"];
108
- private readonly getInstructionSystemBlocks: SdkSessionOptions["getInstructionSystemBlocks"];
109
- private readonly getServiceSystemBlocks: SdkSessionOptions["getServiceSystemBlocks"];
110
- private readonly getPluginSystemBlocks: SdkSessionOptions["getPluginSystemBlocks"];
105
+ private readonly logger: SessionOptions["logger"];
106
+ private readonly getInstructionSystemBlocks: SessionOptions["getInstructionSystemBlocks"];
107
+ private readonly getServiceSystemBlocks: SessionOptions["getServiceSystemBlocks"];
108
+ private readonly getPluginSystemBlocks: SessionOptions["getPluginSystemBlocks"];
111
109
  private readonly historyComposer: JsonlSessionHistoryComposer;
112
- private readonly coreSession: CoreSession;
110
+ private readonly executor: Executor;
113
111
  private sessionConfig: AgentSessionConfigSnapshot = {};
114
112
  private createdAt = Date.now();
115
113
  private timezone = resolveSystemTimezone();
116
114
  private initializePromise: Promise<this> | null = null;
117
115
  private servicePort: SessionPort | null = null;
118
116
 
119
- constructor(options: SdkSessionOptions) {
117
+ constructor(options: SessionOptions) {
120
118
  this.id = String(options.sessionId || "").trim();
121
119
  this.agentId = String(options.agentId || "").trim();
122
120
  this.projectRoot = String(options.projectRoot || "").trim();
@@ -126,13 +124,13 @@ export class SdkSession {
126
124
  this.getServiceSystemBlocks = options.getServiceSystemBlocks;
127
125
  this.getPluginSystemBlocks = options.getPluginSystemBlocks;
128
126
  if (!this.id) {
129
- throw new Error("SdkSession requires a non-empty sessionId");
127
+ throw new Error("Session requires a non-empty sessionId");
130
128
  }
131
129
  if (!this.agentId) {
132
- throw new Error("SdkSession requires a non-empty agentId");
130
+ throw new Error("Session requires a non-empty agentId");
133
131
  }
134
132
  if (!this.projectRoot) {
135
- throw new Error("SdkSession requires a non-empty projectRoot");
133
+ throw new Error("Session requires a non-empty projectRoot");
136
134
  }
137
135
 
138
136
  const sessionDirPath = getSdkAgentSessionDirPath(
@@ -157,33 +155,21 @@ export class SdkSession {
157
155
  },
158
156
  });
159
157
 
160
- this.coreSession = new CoreSession({
158
+ this.executor = new Executor({
161
159
  sessionId: this.id,
162
160
  historyComposer: this.historyComposer,
163
- createExecutor: (historyComposer) => {
164
- const model = this.sessionConfig.model;
165
- if (!model) {
166
- throw new Error(
167
- `Session "${this.id}" has no model configured. Call session.set({ model }) first.`,
168
- );
169
- }
170
- return new LocalSessionExecutor({
171
- model,
172
- logger: this.logger as never,
173
- historyComposer,
174
- compactionComposer: new JsonlSessionCompactionComposer(),
175
- systemComposer: new SdkSessionSystemComposer({
176
- agentId: this.agentId,
177
- projectRoot: this.projectRoot,
178
- getSessionCreatedAt: () => this.createdAt,
179
- getSessionTimezone: () => this.timezone,
180
- getInstructionSystemBlocks: this.getInstructionSystemBlocks,
181
- getServiceSystemBlocks: this.getServiceSystemBlocks,
182
- getPluginSystemBlocks: this.getPluginSystemBlocks,
183
- }),
184
- getTools: () => this.tools,
185
- });
186
- },
161
+ getModel: () => this.sessionConfig.model,
162
+ logger: this.logger as never,
163
+ systemComposer: new SessionSystemBuilder({
164
+ agentId: this.agentId,
165
+ projectRoot: this.projectRoot,
166
+ getSessionCreatedAt: () => this.createdAt,
167
+ getSessionTimezone: () => this.timezone,
168
+ getInstructionSystemBlocks: this.getInstructionSystemBlocks,
169
+ getServiceSystemBlocks: this.getServiceSystemBlocks,
170
+ getPluginSystemBlocks: this.getPluginSystemBlocks,
171
+ }),
172
+ getTools: () => this.tools,
187
173
  });
188
174
  }
189
175
 
@@ -195,7 +181,7 @@ export class SdkSession {
195
181
  return await this.initializePromise;
196
182
  }
197
183
  this.initializePromise = (async () => {
198
- const metadata = await readSdkSessionMetadata({
184
+ const metadata = await readSessionMetadata({
199
185
  projectRoot: this.projectRoot,
200
186
  agentId: this.agentId,
201
187
  sessionId: this.id,
@@ -206,7 +192,7 @@ export class SdkSession {
206
192
  typeof metadata.timezone === "string" && metadata.timezone.trim()
207
193
  ? metadata.timezone.trim()
208
194
  : resolveSystemTimezone();
209
- await writeSdkSessionMetadata({
195
+ await writeSessionMetadata({
210
196
  projectRoot: this.projectRoot,
211
197
  agentId: this.agentId,
212
198
  sessionId: this.id,
@@ -245,9 +231,9 @@ export class SdkSession {
245
231
  if (input.model) {
246
232
  this.sessionConfig.model = input.model;
247
233
  this.sessionConfig.modelLabel = inferModelLabel(input.model);
248
- this.coreSession.clearExecutor();
234
+ this.executor.clearExecutor();
249
235
  }
250
- await patchSdkSessionModelLabel({
236
+ await patchSessionModelLabel({
251
237
  projectRoot: this.projectRoot,
252
238
  agentId: this.agentId,
253
239
  sessionId: this.id,
@@ -264,7 +250,7 @@ export class SdkSession {
264
250
  */
265
251
  text: string;
266
252
  }): Promise<void> {
267
- await this.coreSession.appendUserMessage({
253
+ await this.executor.appendUserMessage({
268
254
  text: String(input.text || "").trim(),
269
255
  });
270
256
  await this.touchMetadata();
@@ -279,7 +265,7 @@ export class SdkSession {
279
265
  */
280
266
  text: string;
281
267
  }): Promise<void> {
282
- await this.coreSession.appendAssistantMessage({
268
+ await this.executor.appendAssistantMessage({
283
269
  fallbackText: String(input.text || "").trim(),
284
270
  });
285
271
  await this.touchMetadata();
@@ -301,7 +287,7 @@ export class SdkSession {
301
287
  * - 返回结构化快照,不把 system prompt 写入会话历史。
302
288
  */
303
289
  async system(): Promise<AgentSessionSystemSnapshot> {
304
- const blocks = await resolveSdkSessionSystemBlocks({
290
+ const blocks = await buildSessionSystemBlocks({
305
291
  agentId: this.agentId,
306
292
  projectRoot: this.projectRoot,
307
293
  sessionId: this.id,
@@ -328,14 +314,14 @@ export class SdkSession {
328
314
  * 返回当前 session 是否正在执行。
329
315
  */
330
316
  isExecuting(): boolean {
331
- return this.coreSession.isExecuting();
317
+ return this.executor.isExecuting();
332
318
  }
333
319
 
334
320
  /**
335
321
  * 清理当前 session 的执行器缓存。
336
322
  */
337
323
  clearExecutor(): void {
338
- this.coreSession.clearExecutor();
324
+ this.executor.clearExecutor();
339
325
  }
340
326
 
341
327
  /**
@@ -346,8 +332,13 @@ export class SdkSession {
346
332
  if (!query) {
347
333
  throw new Error("session.run requires a non-empty query");
348
334
  }
335
+ if (!this.sessionConfig.model) {
336
+ throw new Error(
337
+ `Session "${this.id}" requires a configured model. Call session.set({ model }) first or let the host configure the session during creation.`,
338
+ );
339
+ }
349
340
  await this.appendUserMessage({ text: query });
350
- const result = await this.coreSession.run({
341
+ const result = await this.executor.run({
351
342
  query,
352
343
  });
353
344
  await this.persistAssistantResult(result.assistantMessage);
@@ -369,13 +360,18 @@ export class SdkSession {
369
360
  if (!query) {
370
361
  throw new Error("session.stream requires a non-empty query");
371
362
  }
363
+ if (!this.sessionConfig.model) {
364
+ throw new Error(
365
+ `Session "${this.id}" requires a configured model. Call session.set({ model }) first or let the host configure the session during creation.`,
366
+ );
367
+ }
372
368
  const queue = new AsyncQueue<AgentSessionStreamEvent>();
373
369
  const toolNameByCallId = new Map<string, string>();
374
370
  await this.appendUserMessage({ text: query });
375
371
 
376
372
  const runPromise = (async () => {
377
373
  try {
378
- const result = await this.coreSession.run({
374
+ const result = await this.executor.run({
379
375
  query,
380
376
  onUiMessageChunkCallback: async (chunk) => {
381
377
  pushUiMessageChunkAsSdkEvent({
@@ -406,7 +402,7 @@ export class SdkSession {
406
402
  /**
407
403
  * 从当前 session 创建一个分叉会话。
408
404
  */
409
- async fork(input?: AgentSessionForkInput["messageId"]): Promise<SdkSession> {
405
+ async fork(input?: AgentSessionForkInput["messageId"]): Promise<Session> {
410
406
  const messageId = String(input || "").trim() || undefined;
411
407
  const messages = await this.historyComposer.list();
412
408
  const forkMessages =
@@ -424,7 +420,7 @@ export class SdkSession {
424
420
  return messages.slice(0, targetIndex + 1);
425
421
  })();
426
422
 
427
- const forked = new SdkSession({
423
+ const forked = new Session({
428
424
  agentId: this.agentId,
429
425
  projectRoot: this.projectRoot,
430
426
  sessionId: `fork-${Date.now()}-${nanoid(8)}`,
@@ -451,7 +447,7 @@ export class SdkSession {
451
447
  * 生成当前 session 的元数据快照。
452
448
  */
453
449
  async toMetadata(): Promise<AgentSessionMetadata> {
454
- const meta = await readSdkSessionMetadata({
450
+ const meta = await readSessionMetadata({
455
451
  projectRoot: this.projectRoot,
456
452
  agentId: this.agentId,
457
453
  sessionId: this.id,
@@ -472,9 +468,9 @@ export class SdkSession {
472
468
  */
473
469
  getServicePort(): SessionPort {
474
470
  if (this.servicePort) return this.servicePort;
475
- this.servicePort = createSdkSessionServicePort({
471
+ this.servicePort = createSessionServicePort({
476
472
  sessionId: this.id,
477
- coreSession: this.coreSession,
473
+ executor: this.executor,
478
474
  historyComposer: this.historyComposer,
479
475
  touchMetadata: async () => {
480
476
  await this.touchMetadata();
@@ -484,7 +480,7 @@ export class SdkSession {
484
480
  }
485
481
 
486
482
  private async touchMetadata(): Promise<void> {
487
- await touchSdkSessionMetadata({
483
+ await touchSessionMetadata({
488
484
  projectRoot: this.projectRoot,
489
485
  agentId: this.agentId,
490
486
  sessionId: this.id,
@@ -500,7 +496,7 @@ export class SdkSession {
500
496
  agentId: this.agentId,
501
497
  sessionId: this.id,
502
498
  sessionConfig: this.sessionConfig,
503
- coreSession: this.coreSession,
499
+ executor: this.executor,
504
500
  assistantMessage,
505
501
  });
506
502
  }
@@ -80,7 +80,7 @@ export function inferModelLabel(
80
80
  /**
81
81
  * 读取当前 session 的 meta.json。
82
82
  */
83
- export async function readSdkSessionMetadata(
83
+ export async function readSessionMetadata(
84
84
  input: ReadSessionMetadataInput,
85
85
  ): Promise<SessionHistoryMetaV1> {
86
86
  const filePath = getSdkAgentSessionMetaPath(
@@ -142,7 +142,7 @@ export async function readSdkSessionMetadata(
142
142
  /**
143
143
  * 写回当前 session 的 meta.json。
144
144
  */
145
- export async function writeSdkSessionMetadata(
145
+ export async function writeSessionMetadata(
146
146
  input: ReadSessionMetadataInput & {
147
147
  /**
148
148
  * 下一份 meta 数据。
@@ -162,7 +162,7 @@ export async function writeSdkSessionMetadata(
162
162
  /**
163
163
  * 更新当前 session 的 SDK 配置摘要。
164
164
  */
165
- export async function patchSdkSessionModelLabel(
165
+ export async function patchSessionModelLabel(
166
166
  input: ReadSessionMetadataInput & {
167
167
  /**
168
168
  * 当前模型实例。
@@ -170,7 +170,7 @@ export async function patchSdkSessionModelLabel(
170
170
  model?: LanguageModel;
171
171
  },
172
172
  ): Promise<SessionHistoryMetaV1> {
173
- const current = await readSdkSessionMetadata(input);
173
+ const current = await readSessionMetadata(input);
174
174
  const modelLabel = inferModelLabel(input.model);
175
175
  const next: SessionHistoryMetaV1 = {
176
176
  ...current,
@@ -188,7 +188,7 @@ export async function patchSdkSessionModelLabel(
188
188
  }
189
189
  : {}),
190
190
  };
191
- await writeSdkSessionMetadata({
191
+ await writeSessionMetadata({
192
192
  ...input,
193
193
  meta: next,
194
194
  });
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 集中处理 session meta 更新时间、模型展示标签与 assistant 消息落盘。
6
- * - `SdkSession` 只负责调用这些能力,不直接拼装 meta 结构。
6
+ * - `Session` 只负责调用这些能力,不直接拼装 meta 结构。
7
7
  */
8
8
 
9
9
  import { resolveAssistantMessageForPersistence } from "@/service/builtins/chat/runtime/UserVisibleText.js";
@@ -12,14 +12,14 @@ import type { SessionHistoryMetaV1 } from "@/session/types/SessionHistoryMeta.js
12
12
  import type { SessionMessageV1 } from "@/session/types/SessionMessages.js";
13
13
  import type { AgentSessionConfigSnapshot } from "@/sdk/AgentSdkTypes.js";
14
14
  import {
15
- readSdkSessionMetadata,
16
- writeSdkSessionMetadata,
15
+ readSessionMetadata,
16
+ writeSessionMetadata,
17
17
  } from "@/sdk/SessionMetadata.js";
18
18
 
19
19
  /**
20
20
  * SDK Session 元数据写入参数。
21
21
  */
22
- export interface TouchSdkSessionMetadataParams {
22
+ export interface TouchSessionMetadataParams {
23
23
  /**
24
24
  * 当前项目根目录。
25
25
  */
@@ -42,11 +42,11 @@ export interface TouchSdkSessionMetadataParams {
42
42
  * Assistant 结果落盘参数。
43
43
  */
44
44
  export interface PersistSdkAssistantResultParams
45
- extends TouchSdkSessionMetadataParams {
45
+ extends TouchSessionMetadataParams {
46
46
  /**
47
- * 追加 assistant 消息的底层 session 端口。
47
+ * 追加 assistant 消息的底层执行编排器。
48
48
  */
49
- coreSession: {
49
+ executor: {
50
50
  appendAssistantMessage(params: {
51
51
  /**
52
52
  * 已构造好的完整消息。
@@ -67,10 +67,10 @@ export interface PersistSdkAssistantResultParams
67
67
  /**
68
68
  * 刷新 SDK session 元数据。
69
69
  */
70
- export async function touchSdkSessionMetadata(
71
- params: TouchSdkSessionMetadataParams,
70
+ export async function touchSessionMetadata(
71
+ params: TouchSessionMetadataParams,
72
72
  ): Promise<void> {
73
- const current = await readSdkSessionMetadata({
73
+ const current = await readSessionMetadata({
74
74
  projectRoot: params.projectRoot,
75
75
  agentId: params.agentId,
76
76
  sessionId: params.sessionId,
@@ -90,7 +90,7 @@ export async function touchSdkSessionMetadata(
90
90
  }
91
91
  : {}),
92
92
  };
93
- await writeSdkSessionMetadata({
93
+ await writeSessionMetadata({
94
94
  projectRoot: params.projectRoot,
95
95
  agentId: params.agentId,
96
96
  sessionId: params.sessionId,
@@ -105,9 +105,9 @@ export async function persistSdkAssistantResult(
105
105
  params: PersistSdkAssistantResultParams,
106
106
  ): Promise<void> {
107
107
  const persisted = resolveAssistantMessageForPersistence(params.assistantMessage);
108
- await params.coreSession.appendAssistantMessage({
108
+ await params.executor.appendAssistantMessage({
109
109
  ...(persisted ? { message: persisted } : {}),
110
110
  fallbackText: extractTextFromUiMessage(params.assistantMessage),
111
111
  });
112
- await touchSdkSessionMetadata(params);
112
+ await touchSessionMetadata(params);
113
113
  }
@@ -3,23 +3,23 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 把 SDK 本地 session 适配成 chat service 依赖的 `SessionPort`。
6
- * - service 侧直接复用底层 `CoreSession` 协议,避免 SDK `run()` 包装层重复补写消息。
6
+ * - service 侧直接复用底层 `Executor` 协议,避免 SDK `run()` 包装层重复补写消息。
7
7
  */
8
8
 
9
- import type { SessionPort } from "@/runtime/AgentContextTypes.js";
9
+ import type { SessionPort } from "@/core/AgentContextTypes.js";
10
10
 
11
11
  /**
12
12
  * 构造 SDK SessionPort 的参数。
13
13
  */
14
- export interface CreateSdkSessionServicePortParams {
14
+ export interface CreateSessionServicePortParams {
15
15
  /**
16
16
  * 当前 sessionId。
17
17
  */
18
18
  sessionId: string;
19
19
  /**
20
- * 底层 session 实例。
20
+ * 底层执行编排器。
21
21
  */
22
- coreSession: Omit<SessionPort, "sessionId" | "getHistoryComposer">;
22
+ executor: Omit<SessionPort, "sessionId" | "getHistoryComposer">;
23
23
  /**
24
24
  * 当前 session 历史持久化端口。
25
25
  */
@@ -33,30 +33,30 @@ export interface CreateSdkSessionServicePortParams {
33
33
  /**
34
34
  * 创建供 service 使用的 session 端口。
35
35
  */
36
- export function createSdkSessionServicePort(
37
- params: CreateSdkSessionServicePortParams,
36
+ export function createSessionServicePort(
37
+ params: CreateSessionServicePortParams,
38
38
  ): SessionPort {
39
39
  return {
40
40
  sessionId: params.sessionId,
41
- getExecutor: () => params.coreSession.getExecutor(),
41
+ getExecutor: () => params.executor.getExecutor(),
42
42
  getHistoryComposer: () => params.historyComposer,
43
43
  run: async (runParams) => {
44
- return await params.coreSession.run(runParams);
44
+ return await params.executor.run(runParams);
45
45
  },
46
46
  clearExecutor: () => {
47
- params.coreSession.clearExecutor();
47
+ params.executor.clearExecutor();
48
48
  },
49
49
  afterSessionUpdatedAsync: async () => {
50
- await params.coreSession.afterSessionUpdatedAsync();
50
+ await params.executor.afterSessionUpdatedAsync();
51
51
  },
52
52
  appendUserMessage: async (messageParams) => {
53
- await params.coreSession.appendUserMessage(messageParams);
53
+ await params.executor.appendUserMessage(messageParams);
54
54
  await params.touchMetadata();
55
55
  },
56
56
  appendAssistantMessage: async (messageParams) => {
57
- await params.coreSession.appendAssistantMessage(messageParams);
57
+ await params.executor.appendAssistantMessage(messageParams);
58
58
  await params.touchMetadata();
59
59
  },
60
- isExecuting: () => params.coreSession.isExecuting(),
60
+ isExecuting: () => params.executor.isExecuting(),
61
61
  };
62
62
  }
@@ -18,7 +18,7 @@ import type {
18
18
  /**
19
19
  * 解析 SDK session system blocks 的输入。
20
20
  */
21
- export interface ResolveSdkSessionSystemBlocksParams {
21
+ export interface BuildSessionSystemBlocksParams {
22
22
  /**
23
23
  * 当前 agent 的稳定标识。
24
24
  */
@@ -60,7 +60,7 @@ export interface ResolveSdkSessionSystemBlocksParams {
60
60
  getPluginSystemBlocks: () => Promise<AgentSessionSystemBlock[]>;
61
61
  }
62
62
 
63
- type SdkSessionSystemComposerOptions = {
63
+ type SessionSystemBuilderOptions = {
64
64
  /**
65
65
  * 当前 agent 的稳定标识。
66
66
  */
@@ -126,7 +126,7 @@ function normalizeSystemBlocks(
126
126
 
127
127
  function createSessionInfo(
128
128
  params: Pick<
129
- ResolveSdkSessionSystemBlocksParams,
129
+ BuildSessionSystemBlocksParams,
130
130
  "agentId" | "sessionId" | "projectRoot" | "createdAt" | "timezone"
131
131
  >,
132
132
  ): AgentSessionSystemSessionInfo {
@@ -161,8 +161,8 @@ function createSessionSystemBlock(
161
161
  /**
162
162
  * 解析 SDK session 当前生效的 system blocks。
163
163
  */
164
- export async function resolveSdkSessionSystemBlocks(
165
- params: ResolveSdkSessionSystemBlocksParams,
164
+ export async function buildSessionSystemBlocks(
165
+ params: BuildSessionSystemBlocksParams,
166
166
  ): Promise<AgentSessionSystemBlock[]> {
167
167
  const agentId = String(params.agentId || "").trim();
168
168
  const projectRoot = String(params.projectRoot || "").trim();
@@ -170,19 +170,19 @@ export async function resolveSdkSessionSystemBlocks(
170
170
  const createdAt = Number(params.createdAt || 0);
171
171
  const timezone = String(params.timezone || "").trim();
172
172
  if (!agentId) {
173
- throw new Error("resolveSdkSessionSystemBlocks requires a non-empty agentId");
173
+ throw new Error("buildSessionSystemBlocks requires a non-empty agentId");
174
174
  }
175
175
  if (!projectRoot) {
176
- throw new Error("resolveSdkSessionSystemBlocks requires a non-empty projectRoot");
176
+ throw new Error("buildSessionSystemBlocks requires a non-empty projectRoot");
177
177
  }
178
178
  if (!sessionId) {
179
- throw new Error("resolveSdkSessionSystemBlocks requires a non-empty sessionId");
179
+ throw new Error("buildSessionSystemBlocks requires a non-empty sessionId");
180
180
  }
181
181
  if (!Number.isFinite(createdAt) || createdAt <= 0) {
182
- throw new Error("resolveSdkSessionSystemBlocks requires a valid createdAt");
182
+ throw new Error("buildSessionSystemBlocks requires a valid createdAt");
183
183
  }
184
184
  if (!timezone) {
185
- throw new Error("resolveSdkSessionSystemBlocks requires a non-empty timezone");
185
+ throw new Error("buildSessionSystemBlocks requires a non-empty timezone");
186
186
  }
187
187
  return [
188
188
  ...normalizeSystemBlocks(params.getInstructionSystemBlocks()),
@@ -198,10 +198,10 @@ export async function resolveSdkSessionSystemBlocks(
198
198
  /**
199
199
  * 解析 SDK session 当前生效的 system messages。
200
200
  */
201
- export async function resolveSdkSessionSystemMessages(
202
- params: ResolveSdkSessionSystemBlocksParams,
201
+ export async function buildSessionSystemMessages(
202
+ params: BuildSessionSystemBlocksParams,
203
203
  ): Promise<SessionSystemMessage[]> {
204
- const blocks = await resolveSdkSessionSystemBlocks(params);
204
+ const blocks = await buildSessionSystemBlocks(params);
205
205
  return blocks.map((block) => ({
206
206
  role: "system" as const,
207
207
  content: block.content,
@@ -211,18 +211,18 @@ export async function resolveSdkSessionSystemMessages(
211
211
  /**
212
212
  * SDK Session system composer 实现。
213
213
  */
214
- export class SdkSessionSystemComposer extends SessionSystemComposer {
214
+ export class SessionSystemBuilder extends SessionSystemComposer {
215
215
  readonly name = "sdk_prompt_system";
216
216
 
217
217
  private readonly agentId: string;
218
218
  private readonly projectRoot: string;
219
- private readonly getSessionCreatedAt: SdkSessionSystemComposerOptions["getSessionCreatedAt"];
220
- private readonly getSessionTimezone: SdkSessionSystemComposerOptions["getSessionTimezone"];
221
- private readonly getInstructionSystemBlocks: SdkSessionSystemComposerOptions["getInstructionSystemBlocks"];
222
- private readonly getServiceSystemBlocks: SdkSessionSystemComposerOptions["getServiceSystemBlocks"];
223
- private readonly getPluginSystemBlocks: SdkSessionSystemComposerOptions["getPluginSystemBlocks"];
219
+ private readonly getSessionCreatedAt: SessionSystemBuilderOptions["getSessionCreatedAt"];
220
+ private readonly getSessionTimezone: SessionSystemBuilderOptions["getSessionTimezone"];
221
+ private readonly getInstructionSystemBlocks: SessionSystemBuilderOptions["getInstructionSystemBlocks"];
222
+ private readonly getServiceSystemBlocks: SessionSystemBuilderOptions["getServiceSystemBlocks"];
223
+ private readonly getPluginSystemBlocks: SessionSystemBuilderOptions["getPluginSystemBlocks"];
224
224
 
225
- constructor(options: SdkSessionSystemComposerOptions) {
225
+ constructor(options: SessionSystemBuilderOptions) {
226
226
  super();
227
227
  this.agentId = String(options.agentId || "").trim();
228
228
  this.projectRoot = String(options.projectRoot || "").trim();
@@ -232,10 +232,10 @@ export class SdkSessionSystemComposer extends SessionSystemComposer {
232
232
  this.getServiceSystemBlocks = options.getServiceSystemBlocks;
233
233
  this.getPluginSystemBlocks = options.getPluginSystemBlocks;
234
234
  if (!this.agentId) {
235
- throw new Error("SdkSessionSystemComposer requires a non-empty agentId");
235
+ throw new Error("SessionSystemBuilder requires a non-empty agentId");
236
236
  }
237
237
  if (!this.projectRoot) {
238
- throw new Error("SdkSessionSystemComposer requires a non-empty projectRoot");
238
+ throw new Error("SessionSystemBuilder requires a non-empty projectRoot");
239
239
  }
240
240
  }
241
241
 
@@ -245,9 +245,9 @@ export class SdkSessionSystemComposer extends SessionSystemComposer {
245
245
  async resolve() {
246
246
  const sessionId = String(getSessionRunScope()?.sessionId || "").trim();
247
247
  if (!sessionId) {
248
- throw new Error("SdkSessionSystemComposer.resolve requires a non-empty sessionId");
248
+ throw new Error("SessionSystemBuilder.resolve requires a non-empty sessionId");
249
249
  }
250
- return await resolveSdkSessionSystemMessages({
250
+ return await buildSessionSystemMessages({
251
251
  agentId: this.agentId,
252
252
  projectRoot: this.projectRoot,
253
253
  sessionId,