@downcity/agent 1.1.14 → 1.1.17

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 (766) hide show
  1. package/README.md +126 -635
  2. package/bin/config/Config.js +1 -1
  3. package/bin/config/Config.js.map +1 -1
  4. package/bin/config/Defaults.d.ts +13 -0
  5. package/bin/config/Defaults.d.ts.map +1 -0
  6. package/bin/config/{DowncityDefault.js → Defaults.js} +11 -1
  7. package/bin/config/Defaults.js.map +1 -0
  8. package/bin/{project/ProjectExecutionBinding.d.ts → config/ExecutionBinding.d.ts} +2 -2
  9. package/bin/config/ExecutionBinding.d.ts.map +1 -0
  10. package/bin/{project/ProjectExecutionBinding.js → config/ExecutionBinding.js} +2 -2
  11. package/bin/config/ExecutionBinding.js.map +1 -0
  12. package/bin/{project → config/project}/AgentInitializer.d.ts +2 -2
  13. package/bin/config/project/AgentInitializer.d.ts.map +1 -0
  14. package/bin/{project → config/project}/AgentInitializer.js +7 -7
  15. package/bin/config/project/AgentInitializer.js.map +1 -0
  16. package/bin/{project → config/project}/types/AgentProject.d.ts +2 -2
  17. package/bin/config/project/types/AgentProject.d.ts.map +1 -0
  18. package/bin/config/project/types/AgentProject.js.map +1 -0
  19. package/bin/core/AgentContextTypes.d.ts +9 -71
  20. package/bin/core/AgentContextTypes.d.ts.map +1 -1
  21. package/bin/core/AgentCore.d.ts.map +1 -1
  22. package/bin/core/AgentCore.js +6 -3
  23. package/bin/core/AgentCore.js.map +1 -1
  24. package/bin/core/AgentCoreTypes.d.ts +1 -6
  25. package/bin/core/AgentCoreTypes.d.ts.map +1 -1
  26. package/bin/index.d.ts +25 -25
  27. package/bin/index.d.ts.map +1 -1
  28. package/bin/index.js +12 -13
  29. package/bin/index.js.map +1 -1
  30. package/bin/plugin/builtins/asr/Config.d.ts +1 -1
  31. package/bin/plugin/builtins/asr/Config.d.ts.map +1 -1
  32. package/bin/plugin/builtins/auth/runtime/AuthorizationPolicy.d.ts +1 -1
  33. package/bin/plugin/builtins/auth/runtime/AuthorizationPolicy.d.ts.map +1 -1
  34. package/bin/plugin/builtins/voice/Config.d.ts +1 -1
  35. package/bin/plugin/builtins/voice/Config.d.ts.map +1 -1
  36. package/bin/plugin/builtins/workboard/runtime/Collector.js +1 -1
  37. package/bin/plugin/builtins/workboard/runtime/Collector.js.map +1 -1
  38. package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts +1 -1
  39. package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts.map +1 -1
  40. package/bin/plugin/core/HttpRoutes.d.ts +1 -1
  41. package/bin/plugin/core/HttpRoutes.d.ts.map +1 -1
  42. package/bin/plugin/core/LocalExecution.js +1 -1
  43. package/bin/plugin/core/PluginManager.js +1 -1
  44. package/bin/plugin/types/Plugin.d.ts +2 -2
  45. package/bin/plugin/types/Plugin.d.ts.map +1 -1
  46. package/bin/{host/runtime → runtime/host}/AgentHostRuntime.d.ts +1 -1
  47. package/bin/{host/runtime → runtime/host}/AgentHostRuntime.d.ts.map +1 -1
  48. package/bin/{host/runtime → runtime/host}/AgentHostRuntime.js.map +1 -1
  49. package/bin/{host/runtime → runtime/host}/PluginRuntime.d.ts.map +1 -1
  50. package/bin/{host/runtime → runtime/host}/PluginRuntime.js.map +1 -1
  51. package/bin/{host → runtime/host}/daemon/Api.d.ts +1 -1
  52. package/bin/runtime/host/daemon/Api.d.ts.map +1 -0
  53. package/bin/runtime/host/daemon/Api.js.map +1 -0
  54. package/bin/runtime/host/daemon/Client.d.ts.map +1 -0
  55. package/bin/{host → runtime/host}/daemon/Client.js +2 -2
  56. package/bin/runtime/host/daemon/Client.js.map +1 -0
  57. package/bin/runtime/host/daemon/Paths.d.ts.map +1 -0
  58. package/bin/{host → runtime/host}/daemon/Paths.js +2 -2
  59. package/bin/runtime/host/daemon/Paths.js.map +1 -0
  60. package/bin/{host → runtime/host}/daemon/ProjectSetup.d.ts +1 -1
  61. package/bin/runtime/host/daemon/ProjectSetup.d.ts.map +1 -0
  62. package/bin/{host → runtime/host}/daemon/ProjectSetup.js +3 -3
  63. package/bin/runtime/host/daemon/ProjectSetup.js.map +1 -0
  64. package/bin/{sandbox → runtime/sandbox}/MacOsSeatbeltSandbox.d.ts +1 -1
  65. package/bin/runtime/sandbox/MacOsSeatbeltSandbox.d.ts.map +1 -0
  66. package/bin/runtime/sandbox/MacOsSeatbeltSandbox.js.map +1 -0
  67. package/bin/{sandbox → runtime/sandbox}/SandboxConfigResolver.d.ts +2 -2
  68. package/bin/runtime/sandbox/SandboxConfigResolver.d.ts.map +1 -0
  69. package/bin/runtime/sandbox/SandboxConfigResolver.js.map +1 -0
  70. package/bin/{sandbox → runtime/sandbox}/SandboxRunner.d.ts +2 -2
  71. package/bin/runtime/sandbox/SandboxRunner.d.ts.map +1 -0
  72. package/bin/{sandbox → runtime/sandbox}/SandboxRunner.js +2 -2
  73. package/bin/runtime/sandbox/SandboxRunner.js.map +1 -0
  74. package/bin/runtime/sandbox/types/Sandbox.d.ts.map +1 -0
  75. package/bin/runtime/sandbox/types/Sandbox.js.map +1 -0
  76. package/bin/{sandbox → runtime/sandbox}/types/SandboxRuntime.d.ts +2 -2
  77. package/bin/runtime/sandbox/types/SandboxRuntime.d.ts.map +1 -0
  78. package/bin/runtime/sandbox/types/SandboxRuntime.js.map +1 -0
  79. package/bin/{server → runtime/server}/http/Server.d.ts +3 -3
  80. package/bin/runtime/server/http/Server.d.ts.map +1 -0
  81. package/bin/{server → runtime/server}/http/Server.js +8 -8
  82. package/bin/runtime/server/http/Server.js.map +1 -0
  83. package/bin/runtime/server/http/auth/AuthEnv.d.ts.map +1 -0
  84. package/bin/runtime/server/http/auth/AuthEnv.js.map +1 -0
  85. package/bin/runtime/server/http/auth/AuthError.d.ts.map +1 -0
  86. package/bin/runtime/server/http/auth/AuthError.js.map +1 -0
  87. package/bin/runtime/server/http/auth/CliAuthStateStore.d.ts.map +1 -0
  88. package/bin/runtime/server/http/auth/CliAuthStateStore.js.map +1 -0
  89. package/bin/runtime/server/http/auth/PasswordHasher.d.ts.map +1 -0
  90. package/bin/runtime/server/http/auth/PasswordHasher.js.map +1 -0
  91. package/bin/runtime/server/http/auth/TokenService.d.ts.map +1 -0
  92. package/bin/runtime/server/http/auth/TokenService.js.map +1 -0
  93. package/bin/{server → runtime/server}/http/control/AuthControlService.d.ts +3 -3
  94. package/bin/runtime/server/http/control/AuthControlService.d.ts.map +1 -0
  95. package/bin/{server → runtime/server}/http/control/AuthControlService.js +1 -1
  96. package/bin/runtime/server/http/control/AuthControlService.js.map +1 -0
  97. package/bin/runtime/server/http/control/CommonHelpers.d.ts.map +1 -0
  98. package/bin/runtime/server/http/control/CommonHelpers.js.map +1 -0
  99. package/bin/{server → runtime/server}/http/control/ControlApiRoutes.d.ts +1 -1
  100. package/bin/runtime/server/http/control/ControlApiRoutes.d.ts.map +1 -0
  101. package/bin/{server → runtime/server}/http/control/ControlApiRoutes.js +5 -5
  102. package/bin/runtime/server/http/control/ControlApiRoutes.js.map +1 -0
  103. package/bin/{server → runtime/server}/http/control/ControlAuthorizationRoutes.d.ts +1 -1
  104. package/bin/runtime/server/http/control/ControlAuthorizationRoutes.d.ts.map +1 -0
  105. package/bin/{server → runtime/server}/http/control/ControlAuthorizationRoutes.js +3 -3
  106. package/bin/runtime/server/http/control/ControlAuthorizationRoutes.js.map +1 -0
  107. package/bin/{server → runtime/server}/http/control/ControlRouter.d.ts +2 -2
  108. package/bin/runtime/server/http/control/ControlRouter.d.ts.map +1 -0
  109. package/bin/{server → runtime/server}/http/control/ControlRouter.js +1 -1
  110. package/bin/runtime/server/http/control/ControlRouter.js.map +1 -0
  111. package/bin/{server → runtime/server}/http/control/ExecuteBySession.d.ts +4 -4
  112. package/bin/runtime/server/http/control/ExecuteBySession.d.ts.map +1 -0
  113. package/bin/{server → runtime/server}/http/control/ExecuteBySession.js +6 -6
  114. package/bin/runtime/server/http/control/ExecuteBySession.js.map +1 -0
  115. package/bin/{server → runtime/server}/http/control/ExecuteInput.d.ts +1 -1
  116. package/bin/runtime/server/http/control/ExecuteInput.d.ts.map +1 -0
  117. package/bin/{server → runtime/server}/http/control/ExecuteInput.js +2 -2
  118. package/bin/runtime/server/http/control/ExecuteInput.js.map +1 -0
  119. package/bin/runtime/server/http/control/Helpers.d.ts.map +1 -0
  120. package/bin/runtime/server/http/control/Helpers.js.map +1 -0
  121. package/bin/{server → runtime/server}/http/control/MessageTimeline.d.ts +2 -2
  122. package/bin/runtime/server/http/control/MessageTimeline.d.ts.map +1 -0
  123. package/bin/{server → runtime/server}/http/control/MessageTimeline.js +2 -2
  124. package/bin/runtime/server/http/control/MessageTimeline.js.map +1 -0
  125. package/bin/{server → runtime/server}/http/control/ModelRoutes.d.ts +1 -1
  126. package/bin/runtime/server/http/control/ModelRoutes.d.ts.map +1 -0
  127. package/bin/{server → runtime/server}/http/control/ModelRoutes.js +2 -2
  128. package/bin/runtime/server/http/control/ModelRoutes.js.map +1 -0
  129. package/bin/{server → runtime/server}/http/control/OverviewRoutes.d.ts +1 -1
  130. package/bin/runtime/server/http/control/OverviewRoutes.d.ts.map +1 -0
  131. package/bin/{server → runtime/server}/http/control/OverviewRoutes.js +2 -2
  132. package/bin/runtime/server/http/control/OverviewRoutes.js.map +1 -0
  133. package/bin/{server → runtime/server}/http/control/SessionRoutes.d.ts +1 -1
  134. package/bin/runtime/server/http/control/SessionRoutes.d.ts.map +1 -0
  135. package/bin/{server → runtime/server}/http/control/SessionRoutes.js +2 -2
  136. package/bin/runtime/server/http/control/SessionRoutes.js.map +1 -0
  137. package/bin/{server → runtime/server}/http/control/SessionSummaryStore.d.ts +2 -2
  138. package/bin/runtime/server/http/control/SessionSummaryStore.d.ts.map +1 -0
  139. package/bin/{server → runtime/server}/http/control/SessionSummaryStore.js +2 -2
  140. package/bin/runtime/server/http/control/SessionSummaryStore.js.map +1 -0
  141. package/bin/{server → runtime/server}/http/control/TaskRoutes.d.ts +1 -1
  142. package/bin/runtime/server/http/control/TaskRoutes.d.ts.map +1 -0
  143. package/bin/{server → runtime/server}/http/control/TaskRoutes.js +4 -4
  144. package/bin/runtime/server/http/control/TaskRoutes.js.map +1 -0
  145. package/bin/{server → runtime/server}/http/control/TaskStore.d.ts +1 -1
  146. package/bin/runtime/server/http/control/TaskStore.d.ts.map +1 -0
  147. package/bin/{server → runtime/server}/http/control/TaskStore.js +2 -2
  148. package/bin/runtime/server/http/control/TaskStore.js.map +1 -0
  149. package/bin/{server → runtime/server}/http/control/types/AuthControl.d.ts +1 -1
  150. package/bin/runtime/server/http/control/types/AuthControl.d.ts.map +1 -0
  151. package/bin/runtime/server/http/control/types/AuthControl.js.map +1 -0
  152. package/bin/{server → runtime/server}/http/control/types/ControlRoutes.d.ts +2 -2
  153. package/bin/runtime/server/http/control/types/ControlRoutes.d.ts.map +1 -0
  154. package/bin/runtime/server/http/control/types/ControlRoutes.js.map +1 -0
  155. package/bin/runtime/server/http/control/types/ControlSessionExecute.d.ts.map +1 -0
  156. package/bin/runtime/server/http/control/types/ControlSessionExecute.js.map +1 -0
  157. package/bin/{server → runtime/server}/http/control/types/ControlViewData.d.ts +1 -1
  158. package/bin/runtime/server/http/control/types/ControlViewData.d.ts.map +1 -0
  159. package/bin/runtime/server/http/control/types/ControlViewData.js.map +1 -0
  160. package/bin/{server → runtime/server}/http/execute/execute.d.ts +1 -1
  161. package/bin/runtime/server/http/execute/execute.d.ts.map +1 -0
  162. package/bin/{server → runtime/server}/http/execute/execute.js +2 -2
  163. package/bin/runtime/server/http/execute/execute.js.map +1 -0
  164. package/bin/runtime/server/http/health/health.d.ts.map +1 -0
  165. package/bin/runtime/server/http/health/health.js.map +1 -0
  166. package/bin/{server → runtime/server}/http/plugins/plugins.d.ts +1 -1
  167. package/bin/runtime/server/http/plugins/plugins.d.ts.map +1 -0
  168. package/bin/runtime/server/http/plugins/plugins.js.map +1 -0
  169. package/bin/{server → runtime/server}/http/services/services.d.ts +1 -1
  170. package/bin/runtime/server/http/services/services.d.ts.map +1 -0
  171. package/bin/{server → runtime/server}/http/services/services.js +2 -2
  172. package/bin/runtime/server/http/services/services.js.map +1 -0
  173. package/bin/{server → runtime/server}/http/static/static.d.ts +1 -1
  174. package/bin/runtime/server/http/static/static.d.ts.map +1 -0
  175. package/bin/{server → runtime/server}/http/static/static.js +1 -1
  176. package/bin/runtime/server/http/static/static.js.map +1 -0
  177. package/bin/{server → runtime/server}/rpc/Server.d.ts +4 -4
  178. package/bin/runtime/server/rpc/Server.d.ts.map +1 -0
  179. package/bin/{server → runtime/server}/rpc/Server.js +5 -5
  180. package/bin/runtime/server/rpc/Server.js.map +1 -0
  181. package/bin/{transport → runtime/transport}/rpc/Client.d.ts +1 -1
  182. package/bin/runtime/transport/rpc/Client.d.ts.map +1 -0
  183. package/bin/runtime/transport/rpc/Client.js.map +1 -0
  184. package/bin/runtime/transport/rpc/Paths.d.ts.map +1 -0
  185. package/bin/runtime/transport/rpc/Paths.js.map +1 -0
  186. package/bin/{transport → runtime/transport}/rpc/Transport.d.ts +1 -1
  187. package/bin/runtime/transport/rpc/Transport.d.ts.map +1 -0
  188. package/bin/{transport → runtime/transport}/rpc/Transport.js +1 -1
  189. package/bin/runtime/transport/rpc/Transport.js.map +1 -0
  190. package/bin/sdk/Agent.d.ts +19 -5
  191. package/bin/sdk/Agent.d.ts.map +1 -1
  192. package/bin/sdk/Agent.js +71 -13
  193. package/bin/sdk/Agent.js.map +1 -1
  194. package/bin/sdk/AgentSdkTypes.d.ts +3 -3
  195. package/bin/sdk/AgentSdkTypes.d.ts.map +1 -1
  196. package/bin/sdk/RemoteAgent.d.ts +1 -1
  197. package/bin/sdk/RemoteAgent.js +1 -1
  198. package/bin/sdk/Session.d.ts +2 -1
  199. package/bin/sdk/Session.d.ts.map +1 -1
  200. package/bin/sdk/Session.js +17 -11
  201. package/bin/sdk/Session.js.map +1 -1
  202. package/bin/sdk/SessionSystemBuilder.d.ts +2 -2
  203. package/bin/sdk/SessionSystemBuilder.d.ts.map +1 -1
  204. package/bin/sdk/SessionSystemBuilder.js +1 -3
  205. package/bin/sdk/SessionSystemBuilder.js.map +1 -1
  206. package/bin/sdk/{SessionMetadata.d.ts → session/Metadata.d.ts} +2 -2
  207. package/bin/sdk/session/Metadata.d.ts.map +1 -0
  208. package/bin/sdk/{SessionMetadata.js → session/Metadata.js} +2 -2
  209. package/bin/sdk/session/Metadata.js.map +1 -0
  210. package/bin/sdk/{Paths.d.ts → session/Paths.d.ts} +1 -1
  211. package/bin/sdk/session/Paths.d.ts.map +1 -0
  212. package/bin/sdk/{Paths.js → session/Paths.js} +1 -1
  213. package/bin/sdk/session/Paths.js.map +1 -0
  214. package/bin/sdk/{SessionPersistence.d.ts → session/Persistence.d.ts} +3 -3
  215. package/bin/sdk/session/Persistence.d.ts.map +1 -0
  216. package/bin/sdk/{SessionPersistence.js → session/Persistence.js} +4 -4
  217. package/bin/sdk/session/Persistence.js.map +1 -0
  218. package/bin/sdk/{SessionServicePort.d.ts → session/ServicePort.d.ts} +5 -4
  219. package/bin/sdk/session/ServicePort.d.ts.map +1 -0
  220. package/bin/sdk/{SessionServicePort.js → session/ServicePort.js} +2 -2
  221. package/bin/sdk/session/ServicePort.js.map +1 -0
  222. package/bin/sdk/session/index.d.ts +12 -0
  223. package/bin/sdk/session/index.d.ts.map +1 -0
  224. package/bin/sdk/session/index.js +12 -0
  225. package/bin/sdk/session/index.js.map +1 -0
  226. package/bin/service/builtins/chat/ChatService.d.ts +1 -1
  227. package/bin/service/builtins/chat/ChatService.d.ts.map +1 -1
  228. package/bin/service/builtins/chat/ChatServiceTypes.d.ts +1 -1
  229. package/bin/service/builtins/chat/ChatServiceTypes.d.ts.map +1 -1
  230. package/bin/service/builtins/chat/accounts/ChannelAccountService.d.ts +1 -1
  231. package/bin/service/builtins/chat/accounts/ChannelAccountService.d.ts.map +1 -1
  232. package/bin/service/builtins/chat/runtime/ChatChannelConfig.d.ts +1 -1
  233. package/bin/service/builtins/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
  234. package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts +1 -1
  235. package/bin/service/builtins/chat/runtime/ChatChannelCore.d.ts.map +1 -1
  236. package/bin/service/builtins/chat/runtime/ChatSession.d.ts +10 -5
  237. package/bin/service/builtins/chat/runtime/ChatSession.d.ts.map +1 -1
  238. package/bin/service/builtins/chat/runtime/ChatSession.js +6 -5
  239. package/bin/service/builtins/chat/runtime/ChatSession.js.map +1 -1
  240. package/bin/service/builtins/chat/runtime/{ChatSessionExecutionComposer.d.ts → ChatSessionContextComposer.d.ts} +7 -7
  241. package/bin/service/builtins/chat/runtime/ChatSessionContextComposer.d.ts.map +1 -0
  242. package/bin/service/builtins/chat/runtime/{ChatSessionExecutionComposer.js → ChatSessionContextComposer.js} +5 -5
  243. package/bin/service/builtins/chat/runtime/ChatSessionContextComposer.js.map +1 -0
  244. package/bin/service/builtins/chat/types/ChannelAccount.d.ts +1 -1
  245. package/bin/service/builtins/chat/types/ChannelAccount.d.ts.map +1 -1
  246. package/bin/service/builtins/memory/runtime/Flush.js +3 -3
  247. package/bin/service/builtins/memory/runtime/Flush.js.map +1 -1
  248. package/bin/service/builtins/schedule/ScheduleService.d.ts.map +1 -1
  249. package/bin/service/builtins/schedule/ScheduleService.js +2 -2
  250. package/bin/service/builtins/schedule/ScheduleService.js.map +1 -1
  251. package/bin/service/builtins/shell/runtime/ShellActionRuntime.js +1 -1
  252. package/bin/service/builtins/shell/runtime/ShellActionRuntime.js.map +1 -1
  253. package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.js +1 -1
  254. package/bin/service/builtins/shell/runtime/ShellRuntimeEnvironment.js.map +1 -1
  255. package/bin/service/builtins/task/runtime/Runner.d.ts.map +1 -1
  256. package/bin/service/builtins/task/runtime/Runner.js +5 -0
  257. package/bin/service/builtins/task/runtime/Runner.js.map +1 -1
  258. package/bin/service/builtins/task/runtime/TaskRunnerRound.js +2 -2
  259. package/bin/service/builtins/task/runtime/TaskRunnerRound.js.map +1 -1
  260. package/bin/service/builtins/task/runtime/TaskRunnerSession.d.ts +7 -4
  261. package/bin/service/builtins/task/runtime/TaskRunnerSession.d.ts.map +1 -1
  262. package/bin/service/builtins/task/runtime/TaskRunnerSession.js +39 -24
  263. package/bin/service/builtins/task/runtime/TaskRunnerSession.js.map +1 -1
  264. package/bin/service/builtins/task/runtime/TaskRunnerTypes.d.ts +4 -4
  265. package/bin/service/builtins/task/runtime/TaskRunnerTypes.d.ts.map +1 -1
  266. package/bin/service/core/ServiceActionRunner.js +2 -2
  267. package/bin/service/core/ServiceActionRunner.js.map +1 -1
  268. package/bin/service/core/ServiceCommandRequest.js +1 -1
  269. package/bin/service/core/ServiceCommandRequest.js.map +1 -1
  270. package/bin/service/{schedule → core/schedule}/Executor.d.ts +2 -2
  271. package/bin/service/core/schedule/Executor.d.ts.map +1 -0
  272. package/bin/service/{schedule → core/schedule}/Executor.js +1 -1
  273. package/bin/service/core/schedule/Executor.js.map +1 -0
  274. package/bin/service/{schedule → core/schedule}/Store.d.ts +1 -1
  275. package/bin/service/core/schedule/Store.d.ts.map +1 -0
  276. package/bin/service/{schedule → core/schedule}/Store.js +2 -2
  277. package/bin/service/core/schedule/Store.js.map +1 -0
  278. package/bin/service/core/schedule/Time.d.ts.map +1 -0
  279. package/bin/service/core/schedule/Time.js.map +1 -0
  280. package/bin/service/types/Service.d.ts +1 -1
  281. package/bin/service/types/Service.js +1 -1
  282. package/bin/session/Executor.d.ts +50 -17
  283. package/bin/session/Executor.d.ts.map +1 -1
  284. package/bin/session/Executor.js +366 -44
  285. package/bin/session/Executor.js.map +1 -1
  286. package/bin/session/composer/compaction/SessionCompactionComposer.d.ts +11 -12
  287. package/bin/session/composer/compaction/SessionCompactionComposer.d.ts.map +1 -1
  288. package/bin/session/composer/compaction/SessionCompactionComposer.js +2 -7
  289. package/bin/session/composer/compaction/SessionCompactionComposer.js.map +1 -1
  290. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts +3 -4
  291. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts.map +1 -1
  292. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.js +3 -5
  293. package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.js.map +1 -1
  294. package/bin/session/composer/{execution/LocalSessionExecutionComposer.d.ts → context/LocalSessionContextComposer.d.ts} +10 -11
  295. package/bin/session/composer/context/LocalSessionContextComposer.d.ts.map +1 -0
  296. package/bin/session/composer/{execution/LocalSessionExecutionComposer.js → context/LocalSessionContextComposer.js} +8 -10
  297. package/bin/session/composer/context/LocalSessionContextComposer.js.map +1 -0
  298. package/bin/session/composer/{execution/SessionExecutionComposer.d.ts → context/SessionContextComposer.d.ts} +14 -15
  299. package/bin/session/composer/context/SessionContextComposer.d.ts.map +1 -0
  300. package/bin/session/composer/context/SessionContextComposer.js +9 -0
  301. package/bin/session/composer/context/SessionContextComposer.js.map +1 -0
  302. package/bin/session/composer/history/SessionHistoryComposer.d.ts +9 -111
  303. package/bin/session/composer/history/SessionHistoryComposer.d.ts.map +1 -1
  304. package/bin/session/composer/history/SessionHistoryComposer.js +3 -7
  305. package/bin/session/composer/history/SessionHistoryComposer.js.map +1 -1
  306. package/bin/session/composer/history/SessionHistoryWriter.d.ts +5 -5
  307. package/bin/session/composer/history/SessionHistoryWriter.d.ts.map +1 -1
  308. package/bin/session/composer/history/SessionHistoryWriter.js +10 -10
  309. package/bin/session/composer/history/SessionHistoryWriter.js.map +1 -1
  310. package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts +21 -54
  311. package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts.map +1 -1
  312. package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.js +16 -367
  313. package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.js.map +1 -1
  314. package/bin/session/composer/system/SessionSystemComposer.d.ts +5 -6
  315. package/bin/session/composer/system/SessionSystemComposer.d.ts.map +1 -1
  316. package/bin/session/composer/system/SessionSystemComposer.js +2 -7
  317. package/bin/session/composer/system/SessionSystemComposer.js.map +1 -1
  318. package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts +2 -2
  319. package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts.map +1 -1
  320. package/bin/session/composer/system/default/DefaultSessionSystemComposer.js +1 -3
  321. package/bin/session/composer/system/default/DefaultSessionSystemComposer.js.map +1 -1
  322. package/bin/session/{executors/local/SessionExecutionError.d.ts → core-engine/CoreEngineError.d.ts} +5 -5
  323. package/bin/session/core-engine/CoreEngineError.d.ts.map +1 -0
  324. package/bin/session/{executors/local/SessionExecutionError.js → core-engine/CoreEngineError.js} +4 -4
  325. package/bin/session/core-engine/CoreEngineError.js.map +1 -0
  326. package/bin/session/{executors/local/SessionLoopDecision.d.ts → core-engine/CoreEngineLoopDecision.d.ts} +6 -6
  327. package/bin/session/core-engine/CoreEngineLoopDecision.d.ts.map +1 -0
  328. package/bin/session/{executors/local/SessionLoopDecision.js → core-engine/CoreEngineLoopDecision.js} +5 -5
  329. package/bin/session/core-engine/CoreEngineLoopDecision.js.map +1 -0
  330. package/bin/session/{executors/local/SessionModelMessageState.d.ts → core-engine/CoreEngineMessageState.d.ts} +7 -7
  331. package/bin/session/core-engine/CoreEngineMessageState.d.ts.map +1 -0
  332. package/bin/session/{executors/local/SessionModelMessageState.js → core-engine/CoreEngineMessageState.js} +7 -7
  333. package/bin/session/core-engine/CoreEngineMessageState.js.map +1 -0
  334. package/bin/session/{executors/local/SessionSignals.d.ts → core-engine/CoreEngineSignals.d.ts} +6 -6
  335. package/bin/session/core-engine/CoreEngineSignals.d.ts.map +1 -0
  336. package/bin/session/{executors/local/SessionSignals.js → core-engine/CoreEngineSignals.js} +4 -4
  337. package/bin/session/core-engine/CoreEngineSignals.js.map +1 -0
  338. package/bin/session/{executors/local/SessionUiStreamCollector.d.ts → core-engine/CoreEngineUiStreamCollector.d.ts} +3 -3
  339. package/bin/session/core-engine/CoreEngineUiStreamCollector.d.ts.map +1 -0
  340. package/bin/session/{executors/local/SessionUiStreamCollector.js → core-engine/CoreEngineUiStreamCollector.js} +3 -3
  341. package/bin/session/core-engine/CoreEngineUiStreamCollector.js.map +1 -0
  342. package/bin/session/store/history/SessionHistoryStore.d.ts +119 -0
  343. package/bin/session/store/history/SessionHistoryStore.d.ts.map +1 -0
  344. package/bin/session/store/history/SessionHistoryStore.js +10 -0
  345. package/bin/session/store/history/SessionHistoryStore.js.map +1 -0
  346. package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.d.ts +76 -0
  347. package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +1 -0
  348. package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.js +374 -0
  349. package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.js.map +1 -0
  350. package/bin/session/tools/shell/ShellToolFormatting.js +1 -1
  351. package/bin/session/tools/shell/ShellToolFormatting.js.map +1 -1
  352. package/bin/session/types/SessionHistoryPaths.d.ts +2 -2
  353. package/bin/session/types/SessionLoop.d.ts +1 -1
  354. package/bin/session/types/SessionLoop.js +1 -1
  355. package/bin/session/types/SessionMessages.d.ts +1 -1
  356. package/bin/session/types/SessionMessages.js +1 -1
  357. package/bin/session/types/SessionRun.d.ts +2 -2
  358. package/bin/session/types/SessionRun.js +1 -1
  359. package/bin/types/config/DowncityConfig.d.ts +4 -3
  360. package/bin/types/config/DowncityConfig.d.ts.map +1 -1
  361. package/bin/types/runtime/auth/AuthPermission.d.ts.map +1 -0
  362. package/bin/types/runtime/auth/AuthPermission.js.map +1 -0
  363. package/bin/types/runtime/auth/AuthRoute.d.ts.map +1 -0
  364. package/bin/types/runtime/auth/AuthRoute.js.map +1 -0
  365. package/bin/types/runtime/auth/AuthToken.d.ts.map +1 -0
  366. package/bin/types/runtime/auth/AuthToken.js.map +1 -0
  367. package/bin/types/runtime/auth/AuthTypes.d.ts.map +1 -0
  368. package/bin/types/runtime/auth/AuthTypes.js.map +1 -0
  369. package/bin/types/runtime/daemon/Daemon.d.ts.map +1 -0
  370. package/bin/types/runtime/daemon/Daemon.js.map +1 -0
  371. package/bin/types/{host → runtime/host}/AgentHost.d.ts +7 -7
  372. package/bin/types/runtime/host/AgentHost.d.ts.map +1 -0
  373. package/bin/types/runtime/host/AgentHost.js.map +1 -0
  374. package/bin/types/{host → runtime/host}/Store.d.ts +1 -1
  375. package/bin/types/runtime/host/Store.d.ts.map +1 -0
  376. package/bin/types/runtime/host/Store.js.map +1 -0
  377. package/bin/types/runtime/http/InlineInstant.d.ts.map +1 -0
  378. package/bin/types/runtime/http/InlineInstant.js.map +1 -0
  379. package/bin/types/runtime/platform/Platform.d.ts.map +1 -0
  380. package/bin/types/runtime/platform/Platform.js.map +1 -0
  381. package/bin/types/runtime/platform/PlatformGateway.d.ts.map +1 -0
  382. package/bin/types/runtime/platform/PlatformGateway.js.map +1 -0
  383. package/bin/types/{rpc → runtime/rpc}/LocalRpc.d.ts +2 -2
  384. package/bin/types/runtime/rpc/LocalRpc.d.ts.map +1 -0
  385. package/bin/types/runtime/rpc/LocalRpc.js.map +1 -0
  386. package/bin/utils/logger/FormatRequest.js +1 -1
  387. package/bin/utils/logger/FormatRequest.js.map +1 -1
  388. package/package.json +1 -1
  389. package/src/config/Config.ts +1 -1
  390. package/src/config/{DowncityDefault.ts → Defaults.ts} +11 -0
  391. package/src/{project/ProjectExecutionBinding.ts → config/ExecutionBinding.ts} +1 -1
  392. package/src/{project → config/project}/AgentInitializer.ts +4 -4
  393. package/src/core/AgentContextTypes.ts +9 -74
  394. package/src/core/AgentCore.ts +7 -4
  395. package/src/core/AgentCoreTypes.ts +1 -6
  396. package/src/index.ts +29 -26
  397. package/src/plugin/builtins/asr/Config.ts +1 -1
  398. package/src/plugin/builtins/auth/runtime/AuthorizationPolicy.ts +1 -1
  399. package/src/plugin/builtins/voice/Config.ts +1 -1
  400. package/src/plugin/builtins/workboard/runtime/Collector.ts +1 -1
  401. package/src/plugin/builtins/workboard/runtime/Normalizer.ts +1 -1
  402. package/src/plugin/core/HttpRoutes.ts +1 -1
  403. package/src/plugin/core/LocalExecution.ts +2 -2
  404. package/src/plugin/core/PluginManager.ts +1 -1
  405. package/src/plugin/types/Plugin.ts +2 -2
  406. package/src/{host/runtime → runtime/host}/AgentHostRuntime.ts +1 -1
  407. package/src/{host → runtime/host}/daemon/Client.ts +2 -2
  408. package/src/{host → runtime/host}/daemon/Paths.ts +1 -1
  409. package/src/{host → runtime/host}/daemon/ProjectSetup.ts +2 -3
  410. package/src/{sandbox → runtime/sandbox}/MacOsSeatbeltSandbox.ts +1 -1
  411. package/src/{sandbox → runtime/sandbox}/SandboxConfigResolver.ts +1 -1
  412. package/src/{sandbox → runtime/sandbox}/SandboxRunner.ts +3 -3
  413. package/src/{sandbox → runtime/sandbox}/types/SandboxRuntime.ts +2 -2
  414. package/src/{server → runtime/server}/http/Server.ts +6 -6
  415. package/src/{server → runtime/server}/http/control/AuthControlService.ts +1 -1
  416. package/src/{server → runtime/server}/http/control/ControlApiRoutes.ts +6 -6
  417. package/src/{server → runtime/server}/http/control/ControlAuthorizationRoutes.ts +2 -2
  418. package/src/{server → runtime/server}/http/control/ControlRouter.ts +1 -1
  419. package/src/{server → runtime/server}/http/control/ExecuteBySession.ts +1 -1
  420. package/src/{server → runtime/server}/http/control/ExecuteInput.ts +1 -1
  421. package/src/{server → runtime/server}/http/control/MessageTimeline.ts +1 -1
  422. package/src/{server → runtime/server}/http/control/ModelRoutes.ts +2 -2
  423. package/src/{server → runtime/server}/http/control/OverviewRoutes.ts +1 -1
  424. package/src/{server → runtime/server}/http/control/SessionRoutes.ts +2 -2
  425. package/src/{server → runtime/server}/http/control/SessionSummaryStore.ts +1 -1
  426. package/src/{server → runtime/server}/http/control/TaskRoutes.ts +1 -1
  427. package/src/{server → runtime/server}/http/control/TaskStore.ts +1 -1
  428. package/src/{server → runtime/server}/rpc/Server.ts +4 -4
  429. package/src/{transport → runtime/transport}/rpc/Client.ts +2 -2
  430. package/src/{transport → runtime/transport}/rpc/Transport.ts +2 -2
  431. package/src/sdk/Agent.ts +79 -13
  432. package/src/sdk/AgentSdkTypes.ts +3 -3
  433. package/src/sdk/RemoteAgent.ts +1 -1
  434. package/src/sdk/Session.ts +17 -11
  435. package/src/sdk/SessionSystemBuilder.ts +2 -3
  436. package/src/sdk/{SessionMetadata.ts → session/Metadata.ts} +1 -1
  437. package/src/sdk/{Paths.ts → session/Paths.ts} +1 -1
  438. package/src/sdk/{SessionPersistence.ts → session/Persistence.ts} +1 -1
  439. package/src/sdk/{SessionServicePort.ts → session/ServicePort.ts} +4 -3
  440. package/src/sdk/session/index.ts +34 -0
  441. package/src/service/builtins/chat/ChatService.ts +1 -1
  442. package/src/service/builtins/chat/ChatServiceTypes.ts +1 -1
  443. package/src/service/builtins/chat/accounts/ChannelAccountService.ts +2 -2
  444. package/src/service/builtins/chat/runtime/ChatChannelConfig.ts +1 -1
  445. package/src/service/builtins/chat/runtime/ChatChannelCore.ts +1 -1
  446. package/src/service/builtins/chat/runtime/ChatSession.ts +15 -8
  447. package/src/service/builtins/chat/runtime/{ChatSessionExecutionComposer.ts → ChatSessionContextComposer.ts} +7 -7
  448. package/src/service/builtins/chat/types/ChannelAccount.ts +1 -1
  449. package/src/service/builtins/memory/runtime/Flush.ts +3 -3
  450. package/src/service/builtins/schedule/ScheduleService.ts +2 -2
  451. package/src/service/builtins/shell/runtime/ShellActionRuntime.ts +1 -1
  452. package/src/service/builtins/shell/runtime/ShellRuntimeEnvironment.ts +1 -1
  453. package/src/service/builtins/task/runtime/Runner.ts +7 -0
  454. package/src/service/builtins/task/runtime/TaskRunnerRound.ts +2 -2
  455. package/src/service/builtins/task/runtime/TaskRunnerSession.ts +48 -25
  456. package/src/service/builtins/task/runtime/TaskRunnerTypes.ts +4 -4
  457. package/src/service/core/ServiceActionRunner.ts +2 -2
  458. package/src/service/core/ServiceCommandRequest.ts +1 -1
  459. package/src/service/{schedule → core/schedule}/Executor.ts +1 -1
  460. package/src/service/{schedule → core/schedule}/Store.ts +4 -2
  461. package/src/service/types/Service.ts +1 -1
  462. package/src/session/Executor.ts +473 -52
  463. package/src/session/README.md +107 -0
  464. package/src/session/composer/compaction/SessionCompactionComposer.ts +11 -17
  465. package/src/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.ts +7 -6
  466. package/src/session/composer/{execution/LocalSessionExecutionComposer.ts → context/LocalSessionContextComposer.ts} +14 -15
  467. package/src/session/composer/{execution/SessionExecutionComposer.ts → context/SessionContextComposer.ts} +13 -14
  468. package/src/session/composer/history/SessionHistoryComposer.ts +9 -141
  469. package/src/session/composer/history/SessionHistoryWriter.ts +14 -14
  470. package/src/session/composer/history/jsonl/JsonlSessionHistoryComposer.ts +28 -443
  471. package/src/session/composer/system/SessionSystemComposer.ts +5 -6
  472. package/src/session/composer/system/default/DefaultSessionSystemComposer.ts +2 -3
  473. package/src/session/{executors/local/SessionExecutionError.ts → core-engine/CoreEngineError.ts} +3 -3
  474. package/src/session/{executors/local/SessionLoopDecision.ts → core-engine/CoreEngineLoopDecision.ts} +4 -4
  475. package/src/session/{executors/local/SessionModelMessageState.ts → core-engine/CoreEngineMessageState.ts} +6 -6
  476. package/src/session/{executors/local/SessionSignals.ts → core-engine/CoreEngineSignals.ts} +3 -3
  477. package/src/session/{executors/local/SessionUiStreamCollector.ts → core-engine/CoreEngineUiStreamCollector.ts} +1 -1
  478. package/src/session/store/history/SessionHistoryStore.ts +145 -0
  479. package/src/session/store/history/jsonl/JsonlSessionHistoryStore.ts +465 -0
  480. package/src/session/tools/shell/ShellToolFormatting.ts +1 -1
  481. package/src/session/types/SessionHistoryPaths.ts +2 -2
  482. package/src/session/types/SessionLoop.ts +1 -1
  483. package/src/session/types/SessionMessages.ts +1 -1
  484. package/src/session/types/SessionRun.ts +2 -2
  485. package/src/types/config/DowncityConfig.ts +4 -3
  486. package/src/types/{host → runtime/host}/AgentHost.ts +3 -3
  487. package/src/types/{rpc → runtime/rpc}/LocalRpc.ts +1 -1
  488. package/src/utils/logger/FormatRequest.ts +1 -1
  489. package/tsconfig.tsbuildinfo +1 -1
  490. package/bin/config/DowncityDefault.d.ts +0 -3
  491. package/bin/config/DowncityDefault.d.ts.map +0 -1
  492. package/bin/config/DowncityDefault.js.map +0 -1
  493. package/bin/host/daemon/Api.d.ts.map +0 -1
  494. package/bin/host/daemon/Api.js.map +0 -1
  495. package/bin/host/daemon/Client.d.ts.map +0 -1
  496. package/bin/host/daemon/Client.js.map +0 -1
  497. package/bin/host/daemon/Paths.d.ts.map +0 -1
  498. package/bin/host/daemon/Paths.js.map +0 -1
  499. package/bin/host/daemon/ProjectSetup.d.ts.map +0 -1
  500. package/bin/host/daemon/ProjectSetup.js.map +0 -1
  501. package/bin/model/CreateModel.d.ts +0 -30
  502. package/bin/model/CreateModel.d.ts.map +0 -1
  503. package/bin/model/CreateModel.js +0 -311
  504. package/bin/model/CreateModel.js.map +0 -1
  505. package/bin/model/ModelManager.d.ts +0 -71
  506. package/bin/model/ModelManager.d.ts.map +0 -1
  507. package/bin/model/ModelManager.js +0 -187
  508. package/bin/model/ModelManager.js.map +0 -1
  509. package/bin/project/AgentInitializer.d.ts.map +0 -1
  510. package/bin/project/AgentInitializer.js.map +0 -1
  511. package/bin/project/ProjectExecutionBinding.d.ts.map +0 -1
  512. package/bin/project/ProjectExecutionBinding.js.map +0 -1
  513. package/bin/project/types/AgentProject.d.ts.map +0 -1
  514. package/bin/project/types/AgentProject.js.map +0 -1
  515. package/bin/sandbox/MacOsSeatbeltSandbox.d.ts.map +0 -1
  516. package/bin/sandbox/MacOsSeatbeltSandbox.js.map +0 -1
  517. package/bin/sandbox/SandboxConfigResolver.d.ts.map +0 -1
  518. package/bin/sandbox/SandboxConfigResolver.js.map +0 -1
  519. package/bin/sandbox/SandboxRunner.d.ts.map +0 -1
  520. package/bin/sandbox/SandboxRunner.js.map +0 -1
  521. package/bin/sandbox/types/Sandbox.d.ts.map +0 -1
  522. package/bin/sandbox/types/Sandbox.js.map +0 -1
  523. package/bin/sandbox/types/SandboxRuntime.d.ts.map +0 -1
  524. package/bin/sandbox/types/SandboxRuntime.js.map +0 -1
  525. package/bin/sdk/HttpServer.d.ts +0 -30
  526. package/bin/sdk/HttpServer.d.ts.map +0 -1
  527. package/bin/sdk/HttpServer.js +0 -59
  528. package/bin/sdk/HttpServer.js.map +0 -1
  529. package/bin/sdk/Paths.d.ts.map +0 -1
  530. package/bin/sdk/Paths.js.map +0 -1
  531. package/bin/sdk/RpcServer.d.ts +0 -30
  532. package/bin/sdk/RpcServer.d.ts.map +0 -1
  533. package/bin/sdk/RpcServer.js +0 -51
  534. package/bin/sdk/RpcServer.js.map +0 -1
  535. package/bin/sdk/SessionMetadata.d.ts.map +0 -1
  536. package/bin/sdk/SessionMetadata.js.map +0 -1
  537. package/bin/sdk/SessionPersistence.d.ts.map +0 -1
  538. package/bin/sdk/SessionPersistence.js.map +0 -1
  539. package/bin/sdk/SessionServicePort.d.ts.map +0 -1
  540. package/bin/sdk/SessionServicePort.js.map +0 -1
  541. package/bin/server/http/Server.d.ts.map +0 -1
  542. package/bin/server/http/Server.js.map +0 -1
  543. package/bin/server/http/auth/AuthEnv.d.ts.map +0 -1
  544. package/bin/server/http/auth/AuthEnv.js.map +0 -1
  545. package/bin/server/http/auth/AuthError.d.ts.map +0 -1
  546. package/bin/server/http/auth/AuthError.js.map +0 -1
  547. package/bin/server/http/auth/CliAuthStateStore.d.ts.map +0 -1
  548. package/bin/server/http/auth/CliAuthStateStore.js.map +0 -1
  549. package/bin/server/http/auth/PasswordHasher.d.ts.map +0 -1
  550. package/bin/server/http/auth/PasswordHasher.js.map +0 -1
  551. package/bin/server/http/auth/TokenService.d.ts.map +0 -1
  552. package/bin/server/http/auth/TokenService.js.map +0 -1
  553. package/bin/server/http/control/AuthControlService.d.ts.map +0 -1
  554. package/bin/server/http/control/AuthControlService.js.map +0 -1
  555. package/bin/server/http/control/CommonHelpers.d.ts.map +0 -1
  556. package/bin/server/http/control/CommonHelpers.js.map +0 -1
  557. package/bin/server/http/control/ControlApiRoutes.d.ts.map +0 -1
  558. package/bin/server/http/control/ControlApiRoutes.js.map +0 -1
  559. package/bin/server/http/control/ControlAuthorizationRoutes.d.ts.map +0 -1
  560. package/bin/server/http/control/ControlAuthorizationRoutes.js.map +0 -1
  561. package/bin/server/http/control/ControlRouter.d.ts.map +0 -1
  562. package/bin/server/http/control/ControlRouter.js.map +0 -1
  563. package/bin/server/http/control/ExecuteBySession.d.ts.map +0 -1
  564. package/bin/server/http/control/ExecuteBySession.js.map +0 -1
  565. package/bin/server/http/control/ExecuteInput.d.ts.map +0 -1
  566. package/bin/server/http/control/ExecuteInput.js.map +0 -1
  567. package/bin/server/http/control/Helpers.d.ts.map +0 -1
  568. package/bin/server/http/control/Helpers.js.map +0 -1
  569. package/bin/server/http/control/MessageTimeline.d.ts.map +0 -1
  570. package/bin/server/http/control/MessageTimeline.js.map +0 -1
  571. package/bin/server/http/control/ModelRoutes.d.ts.map +0 -1
  572. package/bin/server/http/control/ModelRoutes.js.map +0 -1
  573. package/bin/server/http/control/OverviewRoutes.d.ts.map +0 -1
  574. package/bin/server/http/control/OverviewRoutes.js.map +0 -1
  575. package/bin/server/http/control/SessionRoutes.d.ts.map +0 -1
  576. package/bin/server/http/control/SessionRoutes.js.map +0 -1
  577. package/bin/server/http/control/SessionSummaryStore.d.ts.map +0 -1
  578. package/bin/server/http/control/SessionSummaryStore.js.map +0 -1
  579. package/bin/server/http/control/TaskRoutes.d.ts.map +0 -1
  580. package/bin/server/http/control/TaskRoutes.js.map +0 -1
  581. package/bin/server/http/control/TaskStore.d.ts.map +0 -1
  582. package/bin/server/http/control/TaskStore.js.map +0 -1
  583. package/bin/server/http/control/types/AuthControl.d.ts.map +0 -1
  584. package/bin/server/http/control/types/AuthControl.js.map +0 -1
  585. package/bin/server/http/control/types/ControlRoutes.d.ts.map +0 -1
  586. package/bin/server/http/control/types/ControlRoutes.js.map +0 -1
  587. package/bin/server/http/control/types/ControlSessionExecute.d.ts.map +0 -1
  588. package/bin/server/http/control/types/ControlSessionExecute.js.map +0 -1
  589. package/bin/server/http/control/types/ControlViewData.d.ts.map +0 -1
  590. package/bin/server/http/control/types/ControlViewData.js.map +0 -1
  591. package/bin/server/http/execute/execute.d.ts.map +0 -1
  592. package/bin/server/http/execute/execute.js.map +0 -1
  593. package/bin/server/http/health/health.d.ts.map +0 -1
  594. package/bin/server/http/health/health.js.map +0 -1
  595. package/bin/server/http/plugins/plugins.d.ts.map +0 -1
  596. package/bin/server/http/plugins/plugins.js.map +0 -1
  597. package/bin/server/http/services/services.d.ts.map +0 -1
  598. package/bin/server/http/services/services.js.map +0 -1
  599. package/bin/server/http/static/static.d.ts.map +0 -1
  600. package/bin/server/http/static/static.js.map +0 -1
  601. package/bin/server/rpc/Server.d.ts.map +0 -1
  602. package/bin/server/rpc/Server.js.map +0 -1
  603. package/bin/service/builtins/chat/runtime/ChatSessionExecutionComposer.d.ts.map +0 -1
  604. package/bin/service/builtins/chat/runtime/ChatSessionExecutionComposer.js.map +0 -1
  605. package/bin/service/core/ServiceManager.d.ts +0 -9
  606. package/bin/service/core/ServiceManager.d.ts.map +0 -1
  607. package/bin/service/core/ServiceManager.js +0 -9
  608. package/bin/service/core/ServiceManager.js.map +0 -1
  609. package/bin/service/schedule/Executor.d.ts.map +0 -1
  610. package/bin/service/schedule/Executor.js.map +0 -1
  611. package/bin/service/schedule/Store.d.ts.map +0 -1
  612. package/bin/service/schedule/Store.js.map +0 -1
  613. package/bin/service/schedule/Time.d.ts.map +0 -1
  614. package/bin/service/schedule/Time.js.map +0 -1
  615. package/bin/session/composer/SessionComposer.d.ts +0 -29
  616. package/bin/session/composer/SessionComposer.d.ts.map +0 -1
  617. package/bin/session/composer/SessionComposer.js +0 -29
  618. package/bin/session/composer/SessionComposer.js.map +0 -1
  619. package/bin/session/composer/execution/LocalSessionExecutionComposer.d.ts.map +0 -1
  620. package/bin/session/composer/execution/LocalSessionExecutionComposer.js.map +0 -1
  621. package/bin/session/composer/execution/SessionExecutionComposer.d.ts.map +0 -1
  622. package/bin/session/composer/execution/SessionExecutionComposer.js +0 -14
  623. package/bin/session/composer/execution/SessionExecutionComposer.js.map +0 -1
  624. package/bin/session/executors/local/Runner.d.ts +0 -108
  625. package/bin/session/executors/local/Runner.d.ts.map +0 -1
  626. package/bin/session/executors/local/Runner.js +0 -219
  627. package/bin/session/executors/local/Runner.js.map +0 -1
  628. package/bin/session/executors/local/SessionExecutionError.d.ts.map +0 -1
  629. package/bin/session/executors/local/SessionExecutionError.js.map +0 -1
  630. package/bin/session/executors/local/SessionLoopDecision.d.ts.map +0 -1
  631. package/bin/session/executors/local/SessionLoopDecision.js.map +0 -1
  632. package/bin/session/executors/local/SessionModelMessageState.d.ts.map +0 -1
  633. package/bin/session/executors/local/SessionModelMessageState.js.map +0 -1
  634. package/bin/session/executors/local/SessionSignals.d.ts.map +0 -1
  635. package/bin/session/executors/local/SessionSignals.js.map +0 -1
  636. package/bin/session/executors/local/SessionToolLoopRunner.d.ts +0 -44
  637. package/bin/session/executors/local/SessionToolLoopRunner.d.ts.map +0 -1
  638. package/bin/session/executors/local/SessionToolLoopRunner.js +0 -261
  639. package/bin/session/executors/local/SessionToolLoopRunner.js.map +0 -1
  640. package/bin/session/executors/local/SessionUiStreamCollector.d.ts.map +0 -1
  641. package/bin/session/executors/local/SessionUiStreamCollector.js.map +0 -1
  642. package/bin/transport/rpc/Client.d.ts.map +0 -1
  643. package/bin/transport/rpc/Client.js.map +0 -1
  644. package/bin/transport/rpc/Paths.d.ts.map +0 -1
  645. package/bin/transport/rpc/Paths.js.map +0 -1
  646. package/bin/transport/rpc/Transport.d.ts.map +0 -1
  647. package/bin/transport/rpc/Transport.js.map +0 -1
  648. package/bin/types/auth/AuthPermission.d.ts.map +0 -1
  649. package/bin/types/auth/AuthPermission.js.map +0 -1
  650. package/bin/types/auth/AuthRoute.d.ts.map +0 -1
  651. package/bin/types/auth/AuthRoute.js.map +0 -1
  652. package/bin/types/auth/AuthToken.d.ts.map +0 -1
  653. package/bin/types/auth/AuthToken.js.map +0 -1
  654. package/bin/types/auth/AuthTypes.d.ts.map +0 -1
  655. package/bin/types/auth/AuthTypes.js.map +0 -1
  656. package/bin/types/daemon/Daemon.d.ts.map +0 -1
  657. package/bin/types/daemon/Daemon.js.map +0 -1
  658. package/bin/types/host/AgentHost.d.ts.map +0 -1
  659. package/bin/types/host/AgentHost.js.map +0 -1
  660. package/bin/types/host/Store.d.ts.map +0 -1
  661. package/bin/types/host/Store.js.map +0 -1
  662. package/bin/types/http/InlineInstant.d.ts.map +0 -1
  663. package/bin/types/http/InlineInstant.js.map +0 -1
  664. package/bin/types/platform/Platform.d.ts.map +0 -1
  665. package/bin/types/platform/Platform.js.map +0 -1
  666. package/bin/types/platform/PlatformGateway.d.ts.map +0 -1
  667. package/bin/types/platform/PlatformGateway.js.map +0 -1
  668. package/bin/types/rpc/LocalRpc.d.ts.map +0 -1
  669. package/bin/types/rpc/LocalRpc.js.map +0 -1
  670. package/src/model/CreateModel.ts +0 -350
  671. package/src/model/ModelManager.ts +0 -242
  672. package/src/sdk/HttpServer.ts +0 -66
  673. package/src/sdk/RpcServer.ts +0 -57
  674. package/src/service/core/ServiceManager.ts +0 -19
  675. package/src/session/composer/SessionComposer.ts +0 -34
  676. package/src/session/executors/local/Runner.ts +0 -297
  677. package/src/session/executors/local/SessionToolLoopRunner.ts +0 -350
  678. /package/bin/{project → config/project}/types/AgentProject.js +0 -0
  679. /package/bin/{host/runtime → runtime/host}/AgentHostRuntime.js +0 -0
  680. /package/bin/{host/runtime → runtime/host}/PluginRuntime.d.ts +0 -0
  681. /package/bin/{host/runtime → runtime/host}/PluginRuntime.js +0 -0
  682. /package/bin/{host → runtime/host}/daemon/Api.js +0 -0
  683. /package/bin/{host → runtime/host}/daemon/Client.d.ts +0 -0
  684. /package/bin/{host → runtime/host}/daemon/Paths.d.ts +0 -0
  685. /package/bin/{sandbox → runtime/sandbox}/MacOsSeatbeltSandbox.js +0 -0
  686. /package/bin/{sandbox → runtime/sandbox}/SandboxConfigResolver.js +0 -0
  687. /package/bin/{sandbox → runtime/sandbox}/types/Sandbox.d.ts +0 -0
  688. /package/bin/{sandbox → runtime/sandbox}/types/Sandbox.js +0 -0
  689. /package/bin/{sandbox → runtime/sandbox}/types/SandboxRuntime.js +0 -0
  690. /package/bin/{server → runtime/server}/http/auth/AuthEnv.d.ts +0 -0
  691. /package/bin/{server → runtime/server}/http/auth/AuthEnv.js +0 -0
  692. /package/bin/{server → runtime/server}/http/auth/AuthError.d.ts +0 -0
  693. /package/bin/{server → runtime/server}/http/auth/AuthError.js +0 -0
  694. /package/bin/{server → runtime/server}/http/auth/CliAuthStateStore.d.ts +0 -0
  695. /package/bin/{server → runtime/server}/http/auth/CliAuthStateStore.js +0 -0
  696. /package/bin/{server → runtime/server}/http/auth/PasswordHasher.d.ts +0 -0
  697. /package/bin/{server → runtime/server}/http/auth/PasswordHasher.js +0 -0
  698. /package/bin/{server → runtime/server}/http/auth/TokenService.d.ts +0 -0
  699. /package/bin/{server → runtime/server}/http/auth/TokenService.js +0 -0
  700. /package/bin/{server → runtime/server}/http/control/CommonHelpers.d.ts +0 -0
  701. /package/bin/{server → runtime/server}/http/control/CommonHelpers.js +0 -0
  702. /package/bin/{server → runtime/server}/http/control/Helpers.d.ts +0 -0
  703. /package/bin/{server → runtime/server}/http/control/Helpers.js +0 -0
  704. /package/bin/{server → runtime/server}/http/control/types/AuthControl.js +0 -0
  705. /package/bin/{server → runtime/server}/http/control/types/ControlRoutes.js +0 -0
  706. /package/bin/{server → runtime/server}/http/control/types/ControlSessionExecute.d.ts +0 -0
  707. /package/bin/{server → runtime/server}/http/control/types/ControlSessionExecute.js +0 -0
  708. /package/bin/{server → runtime/server}/http/control/types/ControlViewData.js +0 -0
  709. /package/bin/{server → runtime/server}/http/health/health.d.ts +0 -0
  710. /package/bin/{server → runtime/server}/http/health/health.js +0 -0
  711. /package/bin/{server → runtime/server}/http/plugins/plugins.js +0 -0
  712. /package/bin/{transport → runtime/transport}/rpc/Client.js +0 -0
  713. /package/bin/{transport → runtime/transport}/rpc/Paths.d.ts +0 -0
  714. /package/bin/{transport → runtime/transport}/rpc/Paths.js +0 -0
  715. /package/bin/service/{schedule → core/schedule}/Time.d.ts +0 -0
  716. /package/bin/service/{schedule → core/schedule}/Time.js +0 -0
  717. /package/bin/types/{auth → runtime/auth}/AuthPermission.d.ts +0 -0
  718. /package/bin/types/{auth → runtime/auth}/AuthPermission.js +0 -0
  719. /package/bin/types/{auth → runtime/auth}/AuthRoute.d.ts +0 -0
  720. /package/bin/types/{auth → runtime/auth}/AuthRoute.js +0 -0
  721. /package/bin/types/{auth → runtime/auth}/AuthToken.d.ts +0 -0
  722. /package/bin/types/{auth → runtime/auth}/AuthToken.js +0 -0
  723. /package/bin/types/{auth → runtime/auth}/AuthTypes.d.ts +0 -0
  724. /package/bin/types/{auth → runtime/auth}/AuthTypes.js +0 -0
  725. /package/bin/types/{daemon → runtime/daemon}/Daemon.d.ts +0 -0
  726. /package/bin/types/{daemon → runtime/daemon}/Daemon.js +0 -0
  727. /package/bin/types/{host → runtime/host}/AgentHost.js +0 -0
  728. /package/bin/types/{host → runtime/host}/Store.js +0 -0
  729. /package/bin/types/{http → runtime/http}/InlineInstant.d.ts +0 -0
  730. /package/bin/types/{http → runtime/http}/InlineInstant.js +0 -0
  731. /package/bin/types/{platform → runtime/platform}/Platform.d.ts +0 -0
  732. /package/bin/types/{platform → runtime/platform}/Platform.js +0 -0
  733. /package/bin/types/{platform → runtime/platform}/PlatformGateway.d.ts +0 -0
  734. /package/bin/types/{platform → runtime/platform}/PlatformGateway.js +0 -0
  735. /package/bin/types/{rpc → runtime/rpc}/LocalRpc.js +0 -0
  736. /package/src/{project → config/project}/types/AgentProject.ts +0 -0
  737. /package/src/{host/runtime → runtime/host}/PluginRuntime.ts +0 -0
  738. /package/src/{host → runtime/host}/daemon/Api.ts +0 -0
  739. /package/src/{sandbox → runtime/sandbox}/types/Sandbox.ts +0 -0
  740. /package/src/{server → runtime/server}/http/auth/AuthEnv.ts +0 -0
  741. /package/src/{server → runtime/server}/http/auth/AuthError.ts +0 -0
  742. /package/src/{server → runtime/server}/http/auth/CliAuthStateStore.ts +0 -0
  743. /package/src/{server → runtime/server}/http/auth/PasswordHasher.ts +0 -0
  744. /package/src/{server → runtime/server}/http/auth/TokenService.ts +0 -0
  745. /package/src/{server → runtime/server}/http/control/CommonHelpers.ts +0 -0
  746. /package/src/{server → runtime/server}/http/control/Helpers.ts +0 -0
  747. /package/src/{server → runtime/server}/http/control/types/AuthControl.ts +0 -0
  748. /package/src/{server → runtime/server}/http/control/types/ControlRoutes.ts +0 -0
  749. /package/src/{server → runtime/server}/http/control/types/ControlSessionExecute.ts +0 -0
  750. /package/src/{server → runtime/server}/http/control/types/ControlViewData.ts +0 -0
  751. /package/src/{server → runtime/server}/http/execute/execute.ts +0 -0
  752. /package/src/{server → runtime/server}/http/health/health.ts +0 -0
  753. /package/src/{server → runtime/server}/http/plugins/plugins.ts +0 -0
  754. /package/src/{server → runtime/server}/http/services/services.ts +0 -0
  755. /package/src/{server → runtime/server}/http/static/static.ts +0 -0
  756. /package/src/{transport → runtime/transport}/rpc/Paths.ts +0 -0
  757. /package/src/service/{schedule → core/schedule}/Time.ts +0 -0
  758. /package/src/types/{auth → runtime/auth}/AuthPermission.ts +0 -0
  759. /package/src/types/{auth → runtime/auth}/AuthRoute.ts +0 -0
  760. /package/src/types/{auth → runtime/auth}/AuthToken.ts +0 -0
  761. /package/src/types/{auth → runtime/auth}/AuthTypes.ts +0 -0
  762. /package/src/types/{daemon → runtime/daemon}/Daemon.ts +0 -0
  763. /package/src/types/{host → runtime/host}/Store.ts +0 -0
  764. /package/src/types/{http → runtime/http}/InlineInstant.ts +0 -0
  765. /package/src/types/{platform → runtime/platform}/Platform.ts +0 -0
  766. /package/src/types/{platform → runtime/platform}/PlatformGateway.ts +0 -0
@@ -4,13 +4,14 @@
4
4
  * 关键点(中文)
5
5
  * - 面向 `new Agent(...)` 的本地会话使用场景。
6
6
  * - 统一收口消息落盘、session 级模型配置、run/stream/fork 等高层 API。
7
- * - 内部继续复用 `Executor` / `JsonlSessionHistoryComposer` / `Runner`。
7
+ * - 内部继续复用 `Executor` / `JsonlSessionHistoryStore` / Composer 体系。
8
8
  */
9
9
 
10
10
  import { nanoid } from "nanoid";
11
11
  import type { LanguageModel, Tool } from "ai";
12
12
  import { Executor } from "@session/Executor.js";
13
13
  import { JsonlSessionHistoryComposer } from "@session/composer/history/jsonl/JsonlSessionHistoryComposer.js";
14
+ import { JsonlSessionHistoryStore } from "@/session/store/history/jsonl/JsonlSessionHistoryStore.js";
14
15
  import { extractTextFromUiMessage } from "@/service/builtins/chat/runtime/UIMessageTransformer.js";
15
16
  import type {
16
17
  AgentSessionConfigSnapshot,
@@ -34,19 +35,19 @@ import {
34
35
  readSessionMetadata,
35
36
  resolveSystemTimezone,
36
37
  writeSessionMetadata,
37
- } from "@/sdk/SessionMetadata.js";
38
+ } from "@/sdk/session/index.js";
38
39
  import {
39
40
  getSdkAgentSessionArchiveDirPath,
40
41
  getSdkAgentSessionDirPath,
41
- } from "@/sdk/Paths.js";
42
+ } from "@/sdk/session/index.js";
42
43
  import { AsyncQueue } from "@/sdk/AsyncQueue.js";
43
44
  import type { SessionPort } from "@/core/AgentContextTypes.js";
44
45
  import { pushUiMessageChunkAsSdkEvent } from "@/sdk/StreamEvents.js";
45
46
  import {
46
47
  persistSdkAssistantResult,
47
48
  touchSessionMetadata,
48
- } from "@/sdk/SessionPersistence.js";
49
- import { createSessionServicePort } from "@/sdk/SessionServicePort.js";
49
+ } from "@/sdk/session/index.js";
50
+ import { createSessionServicePort } from "@/sdk/session/index.js";
50
51
 
51
52
  type SessionOptions = {
52
53
  /**
@@ -106,6 +107,7 @@ export class Session {
106
107
  private readonly getInstructionSystemBlocks: SessionOptions["getInstructionSystemBlocks"];
107
108
  private readonly getServiceSystemBlocks: SessionOptions["getServiceSystemBlocks"];
108
109
  private readonly getPluginSystemBlocks: SessionOptions["getPluginSystemBlocks"];
110
+ private readonly historyStore: JsonlSessionHistoryStore;
109
111
  private readonly historyComposer: JsonlSessionHistoryComposer;
110
112
  private readonly executor: Executor;
111
113
  private sessionConfig: AgentSessionConfigSnapshot = {};
@@ -139,7 +141,7 @@ export class Session {
139
141
  this.id,
140
142
  );
141
143
  const messagesDirPath = `${sessionDirPath}/messages`;
142
- this.historyComposer = new JsonlSessionHistoryComposer({
144
+ this.historyStore = new JsonlSessionHistoryStore({
143
145
  rootPath: this.projectRoot,
144
146
  sessionId: this.id,
145
147
  paths: {
@@ -154,9 +156,13 @@ export class Session {
154
156
  ),
155
157
  },
156
158
  });
159
+ this.historyComposer = new JsonlSessionHistoryComposer({
160
+ store: this.historyStore,
161
+ });
157
162
 
158
163
  this.executor = new Executor({
159
164
  sessionId: this.id,
165
+ historyStore: this.historyStore,
160
166
  historyComposer: this.historyComposer,
161
167
  getModel: () => this.sessionConfig.model,
162
168
  logger: this.logger as never,
@@ -275,7 +281,7 @@ export class Session {
275
281
  * 读取完整消息历史。
276
282
  */
277
283
  async history(): Promise<SessionMessageV1[]> {
278
- return await this.historyComposer.list();
284
+ return await this.historyStore.list();
279
285
  }
280
286
 
281
287
  /**
@@ -404,7 +410,7 @@ export class Session {
404
410
  */
405
411
  async fork(input?: AgentSessionForkInput["messageId"]): Promise<Session> {
406
412
  const messageId = String(input || "").trim() || undefined;
407
- const messages = await this.historyComposer.list();
413
+ const messages = await this.historyStore.list();
408
414
  const forkMessages =
409
415
  !messageId
410
416
  ? messages
@@ -437,7 +443,7 @@ export class Session {
437
443
  });
438
444
  }
439
445
  for (const message of forkMessages) {
440
- await forked.historyComposer.append(message);
446
+ await forked.historyStore.append(message);
441
447
  }
442
448
  await forked.touchMetadata();
443
449
  return forked;
@@ -452,7 +458,7 @@ export class Session {
452
458
  agentId: this.agentId,
453
459
  sessionId: this.id,
454
460
  });
455
- const messageCount = await this.historyComposer.size();
461
+ const messageCount = await this.historyStore.size();
456
462
  return {
457
463
  agentId: this.agentId,
458
464
  sessionId: this.id,
@@ -471,7 +477,7 @@ export class Session {
471
477
  this.servicePort = createSessionServicePort({
472
478
  sessionId: this.id,
473
479
  executor: this.executor,
474
- historyComposer: this.historyComposer,
480
+ historyStore: this.historyStore,
475
481
  touchMetadata: async () => {
476
482
  await this.touchMetadata();
477
483
  },
@@ -7,7 +7,7 @@
7
7
  * - SDK 不在 system 中注入动态变量;动态上下文应由调用方放入 user message。
8
8
  */
9
9
 
10
- import { SessionSystemComposer } from "@session/composer/system/SessionSystemComposer.js";
10
+ import type { SessionSystemComposer } from "@session/composer/system/SessionSystemComposer.js";
11
11
  import { getSessionRunScope } from "@session/SessionRunScope.js";
12
12
  import type { SessionSystemMessage } from "@/session/types/SessionPrompts.js";
13
13
  import type {
@@ -211,7 +211,7 @@ export async function buildSessionSystemMessages(
211
211
  /**
212
212
  * SDK Session system composer 实现。
213
213
  */
214
- export class SessionSystemBuilder extends SessionSystemComposer {
214
+ export class SessionSystemBuilder implements SessionSystemComposer {
215
215
  readonly name = "sdk_prompt_system";
216
216
 
217
217
  private readonly agentId: string;
@@ -223,7 +223,6 @@ export class SessionSystemBuilder extends SessionSystemComposer {
223
223
  private readonly getPluginSystemBlocks: SessionSystemBuilderOptions["getPluginSystemBlocks"];
224
224
 
225
225
  constructor(options: SessionSystemBuilderOptions) {
226
- super();
227
226
  this.agentId = String(options.agentId || "").trim();
228
227
  this.projectRoot = String(options.projectRoot || "").trim();
229
228
  this.getSessionCreatedAt = options.getSessionCreatedAt;
@@ -12,7 +12,7 @@ import type {
12
12
  SessionHistoryMetaV1,
13
13
  SessionHistorySdkConfigV1,
14
14
  } from "@/session/types/SessionHistoryMeta.js";
15
- import { getSdkAgentSessionMetaPath } from "@/sdk/Paths.js";
15
+ import { getSdkAgentSessionMetaPath } from "@/sdk/session/Paths.js";
16
16
 
17
17
  type ReadSessionMetadataInput = {
18
18
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * SDK Session 落盘路径规则。
2
+ * SDK Session 路径规则。
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 与旧 `.downcity/session/<sessionId>` 路径分开,避免不同 agent 在同一项目目录下互相污染。
@@ -14,7 +14,7 @@ import type { AgentSessionConfigSnapshot } from "@/sdk/AgentSdkTypes.js";
14
14
  import {
15
15
  readSessionMetadata,
16
16
  writeSessionMetadata,
17
- } from "@/sdk/SessionMetadata.js";
17
+ } from "@/sdk/session/Metadata.js";
18
18
 
19
19
  /**
20
20
  * SDK Session 元数据写入参数。
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { SessionPort } from "@/core/AgentContextTypes.js";
10
+ import type { SessionHistoryStore } from "@/session/store/history/SessionHistoryStore.js";
10
11
 
11
12
  /**
12
13
  * 构造 SDK SessionPort 的参数。
@@ -19,11 +20,11 @@ export interface CreateSessionServicePortParams {
19
20
  /**
20
21
  * 底层执行编排器。
21
22
  */
22
- executor: Omit<SessionPort, "sessionId" | "getHistoryComposer">;
23
+ executor: Omit<SessionPort, "sessionId" | "getHistoryStore">;
23
24
  /**
24
25
  * 当前 session 历史持久化端口。
25
26
  */
26
- historyComposer: ReturnType<SessionPort["getHistoryComposer"]>;
27
+ historyStore: SessionHistoryStore;
27
28
  /**
28
29
  * session 更新后需要同步执行的持久化回调。
29
30
  */
@@ -39,7 +40,7 @@ export function createSessionServicePort(
39
40
  return {
40
41
  sessionId: params.sessionId,
41
42
  getExecutor: () => params.executor.getExecutor(),
42
- getHistoryComposer: () => params.historyComposer,
43
+ getHistoryStore: () => params.historyStore,
43
44
  run: async (runParams) => {
44
45
  return await params.executor.run(runParams);
45
46
  },
@@ -0,0 +1,34 @@
1
+ /**
2
+ * SDK Session 辅助模块聚合入口。
3
+ *
4
+ * 关键点(中文)
5
+ * - 这里收口 `Session.ts` 依赖的路径、元数据、持久化与 service 端口适配能力。
6
+ * - 避免这些实现继续平铺在 `sdk/` 顶层,提升目录语义清晰度。
7
+ */
8
+
9
+ export {
10
+ getSdkAgentDirPath,
11
+ getSdkAgentRpcEndpointPath,
12
+ getSdkAgentSessionArchiveDirPath,
13
+ getSdkAgentSessionDirPath,
14
+ getSdkAgentSessionMessagesDirPath,
15
+ getSdkAgentSessionMessagesPath,
16
+ getSdkAgentSessionMetaPath,
17
+ getSdkAgentSessionsRootDirPath,
18
+ getSdkAgentsRootDirPath,
19
+ getSdkDowncityDirPath,
20
+ } from "./Paths.js";
21
+ export {
22
+ inferModelLabel,
23
+ patchSessionModelLabel,
24
+ readSessionMetadata,
25
+ resolveSystemTimezone,
26
+ writeSessionMetadata,
27
+ } from "./Metadata.js";
28
+ export {
29
+ persistSdkAssistantResult,
30
+ touchSessionMetadata,
31
+ } from "./Persistence.js";
32
+ export {
33
+ createSessionServicePort,
34
+ } from "./ServicePort.js";
@@ -13,7 +13,7 @@ import { BaseService } from "@/service/builtins/BaseService.js";
13
13
  import type { ServiceActions } from "@/service/types/Service.js";
14
14
  import type { AgentContext } from "@/core/AgentContextTypes.js";
15
15
  import type { ChatChannelState } from "@/service/builtins/chat/types/ChatRuntime.js";
16
- import type { StoredChannelAccount } from "@/types/host/Store.js";
16
+ import type { StoredChannelAccount } from "@/types/runtime/host/Store.js";
17
17
  import type { ChatQueueWorkerConfig } from "@/service/builtins/chat/types/ChatQueueWorker.js";
18
18
  import type {
19
19
  ChatServiceFeishuOptions,
@@ -9,7 +9,7 @@
9
9
 
10
10
  import type { AgentContext } from "@/core/AgentContextTypes.js";
11
11
  import type { ChatQueueWorkerConfig } from "@/service/builtins/chat/types/ChatQueueWorker.js";
12
- import type { StoredChannelAccount } from "@/types/host/Store.js";
12
+ import type { StoredChannelAccount } from "@/types/runtime/host/Store.js";
13
13
  import type { ChatChannelName } from "@/service/builtins/chat/types/ChannelStatus.js";
14
14
 
15
15
  /**
@@ -8,8 +8,8 @@
8
8
  */
9
9
 
10
10
  import crypto from "node:crypto";
11
- import type { AgentPlatformRuntime } from "@/types/host/AgentHost.js";
12
- import type { StoredChannelAccountChannel } from "@/types/host/Store.js";
11
+ import type { AgentPlatformRuntime } from "@/types/runtime/host/AgentHost.js";
12
+ import type { StoredChannelAccountChannel } from "@/types/runtime/host/Store.js";
13
13
  import { resolveChatChannelBotInfo } from "@/service/builtins/chat/channels/BotInfoProvider.js";
14
14
  import type {
15
15
  ChatChannelAccountCreateInput,
@@ -11,7 +11,7 @@ import fs from "node:fs/promises";
11
11
  import path from "node:path";
12
12
  import type { JsonObject, JsonValue } from "@/types/common/Json.js";
13
13
  import type { AgentContext } from "@/core/AgentContextTypes.js";
14
- import type { StoredChannelAccount } from "@/types/host/Store.js";
14
+ import type { StoredChannelAccount } from "@/types/runtime/host/Store.js";
15
15
  import type {
16
16
  ChatChannelName,
17
17
  ChatChannelStateSnapshot,
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import type { AgentContext } from "@/core/AgentContextTypes.js";
11
- import type { StoredChannelAccount } from "@/types/host/Store.js";
11
+ import type { StoredChannelAccount } from "@/types/runtime/host/Store.js";
12
12
  import type { ChatChannelName } from "@/service/builtins/chat/types/ChannelStatus.js";
13
13
  import type { ChatChannelState } from "@/service/builtins/chat/types/ChatRuntime.js";
14
14
 
@@ -2,7 +2,7 @@
2
2
  * ChatSession:chat 专用 Executor 实现。
3
3
  *
4
4
  * 关键点(中文)
5
- * - ChatSession 在实例化时持有自己的 execution composer 实例。
5
+ * - ChatSession 在实例化时持有自己的 context composer 实例。
6
6
  * - chat 当前 turn 的 step 合并/step 回发状态都绑定在 Session 自身,不再新增 `runChat` 一层入口。
7
7
  * - 外层仍只调用标准 `run(...)`;chat 语义由 ChatSession 内部收敛。
8
8
  */
@@ -10,9 +10,10 @@
10
10
  import type { LanguageModel, Tool } from "ai";
11
11
  import { Executor } from "@session/Executor.js";
12
12
  import type { SessionHistoryComposer } from "@session/composer/history/SessionHistoryComposer.js";
13
+ import type { SessionHistoryStore } from "@/session/store/history/SessionHistoryStore.js";
13
14
  import type { SessionCompactionComposer } from "@session/composer/compaction/SessionCompactionComposer.js";
14
15
  import type { SessionSystemComposer } from "@session/composer/system/SessionSystemComposer.js";
15
- import type { ChatSessionExecutionComposer } from "@/service/builtins/chat/runtime/ChatSessionExecutionComposer.js";
16
+ import type { ChatSessionContextComposer } from "@/service/builtins/chat/runtime/ChatSessionContextComposer.js";
16
17
  import type { Logger } from "@/utils/logger/Logger.js";
17
18
  import type { SessionAssistantStepCallback } from "@/session/types/SessionRun.js";
18
19
  import type { SessionRunResult } from "@/session/types/SessionRun.js";
@@ -24,6 +25,11 @@ type ChatSessionOptions = {
24
25
  */
25
26
  sessionId: string;
26
27
 
28
+ /**
29
+ * 当前 session 的 history store。
30
+ */
31
+ historyStore: SessionHistoryStore;
32
+
27
33
  /**
28
34
  * 当前 session 的 history composer。
29
35
  */
@@ -55,9 +61,9 @@ type ChatSessionOptions = {
55
61
  getTools: () => Record<string, Tool>;
56
62
 
57
63
  /**
58
- * 当前 session 绑定的 chat execution composer。
64
+ * 当前 session 绑定的 chat context composer。
59
65
  */
60
- executionComposer: ChatSessionExecutionComposer;
66
+ contextComposer: ChatSessionContextComposer;
61
67
 
62
68
  /**
63
69
  * session 更新后的异步回调。
@@ -72,26 +78,27 @@ export class ChatSession extends Executor {
72
78
  /**
73
79
  * ChatSession 持有的 composer 实例。
74
80
  */
75
- readonly executionComposer: ChatSessionExecutionComposer;
81
+ readonly contextComposer: ChatSessionContextComposer;
76
82
 
77
83
  private activeTurnState: ChatSessionTurnState | null = null;
78
84
 
79
85
  constructor(options: ChatSessionOptions) {
80
- const executionComposer = options.executionComposer;
86
+ const contextComposer = options.contextComposer;
81
87
  super({
82
88
  sessionId: options.sessionId,
89
+ historyStore: options.historyStore,
83
90
  historyComposer: options.historyComposer,
84
91
  getModel: options.getModel,
85
92
  logger: options.logger,
86
93
  compactionComposer: options.compactionComposer,
87
94
  systemComposer: options.systemComposer,
88
95
  getTools: options.getTools,
89
- executionComposer,
96
+ contextComposer,
90
97
  ...(options.runAfterSessionUpdated
91
98
  ? { runAfterSessionUpdated: options.runAfterSessionUpdated }
92
99
  : {}),
93
100
  });
94
- this.executionComposer = executionComposer;
101
+ this.contextComposer = contextComposer;
95
102
  }
96
103
 
97
104
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ChatSessionExecutionComposer:chat 专用 execution composer。
2
+ * ChatSessionContextComposer:chat 专用 context composer。
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - 由 chat 层在 Session 实例化时注入,不再依赖 run 时层层传 callback。
@@ -9,12 +9,12 @@
9
9
 
10
10
  import type { ModelMessage, Tool } from "ai";
11
11
  import { drainInjectedUserMessages } from "@session/SessionRunScope.js";
12
- import { LocalSessionExecutionComposer } from "@session/composer/execution/LocalSessionExecutionComposer.js";
12
+ import { LocalSessionContextComposer } from "@session/composer/context/LocalSessionContextComposer.js";
13
13
  import type { SessionMessageV1 } from "@/session/types/SessionMessages.js";
14
14
  import type { SessionSystemMessage } from "@/session/types/SessionPrompts.js";
15
15
  import type { ChatSessionTurnState } from "@/service/builtins/chat/runtime/ChatSessionTypes.js";
16
16
 
17
- type ChatSessionExecutionComposerOptions = {
17
+ type ChatSessionContextComposerOptions = {
18
18
  /**
19
19
  * 当前 session 标识。
20
20
  */
@@ -32,12 +32,12 @@ type ChatSessionExecutionComposerOptions = {
32
32
  };
33
33
 
34
34
  /**
35
- * ChatSession 专用 execution composer。
35
+ * ChatSession 专用 context composer。
36
36
  */
37
- export class ChatSessionExecutionComposer extends LocalSessionExecutionComposer {
38
- private readonly getTurnState: ChatSessionExecutionComposerOptions["getTurnState"];
37
+ export class ChatSessionContextComposer extends LocalSessionContextComposer {
38
+ private readonly getTurnState: ChatSessionContextComposerOptions["getTurnState"];
39
39
 
40
- constructor(options: ChatSessionExecutionComposerOptions) {
40
+ constructor(options: ChatSessionContextComposerOptions) {
41
41
  super({
42
42
  sessionId: options.sessionId,
43
43
  getTools: options.getTools,
@@ -6,7 +6,7 @@
6
6
  * - 凭据明文只允许出现在写入输入中,读取结果必须是脱敏后的安全视图。
7
7
  */
8
8
 
9
- import type { StoredChannelAccountChannel } from "@/types/host/Store.js";
9
+ import type { StoredChannelAccountChannel } from "@/types/runtime/host/Store.js";
10
10
 
11
11
  /**
12
12
  * 支持的 chat channel account 类型。
@@ -54,10 +54,10 @@ export async function flushMemory(
54
54
  const maxMessages = Number.isFinite(payload.maxMessages)
55
55
  ? Math.max(1, Math.floor(payload.maxMessages as number))
56
56
  : 30;
57
- const historyComposer = context.session.get(sessionId).getHistoryComposer();
58
- const total = await historyComposer.size();
57
+ const historyStore = context.session.get(sessionId).getHistoryStore();
58
+ const total = await historyStore.size();
59
59
  const start = Math.max(0, total - maxMessages);
60
- const messages = await historyComposer.slice(start, total);
60
+ const messages = await historyStore.slice(start, total);
61
61
  const lines = messages
62
62
  .map((msg) => extractReadableLine(msg))
63
63
  .filter((line) => line.length > 0);
@@ -10,9 +10,9 @@
10
10
  import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
11
11
  import type { AgentContext } from "@/core/AgentContextTypes.js";
12
12
  import { BaseService } from "@/service/builtins/BaseService.js";
13
+ import { runDueScheduledJobs } from "@/service/core/schedule/Executor.js";
14
+ import { ServiceScheduleStore } from "@/service/core/schedule/Store.js";
13
15
  import type { ServiceActions } from "@/service/types/Service.js";
14
- import { ServiceScheduleStore } from "@/service/schedule/Store.js";
15
- import { runDueScheduledJobs } from "@/service/schedule/Executor.js";
16
16
 
17
17
  const SCHEDULE_POLL_INTERVAL_MS = 200;
18
18
  const SCHEDULE_LOG_PREFIX = "[SCHEDULE]";
@@ -9,7 +9,7 @@
9
9
 
10
10
  import fs from "fs-extra";
11
11
  import type { AgentContext } from "@/core/AgentContextTypes.js";
12
- import { spawnShellProcess } from "@/sandbox/SandboxRunner.js";
12
+ import { spawnShellProcess } from "@/runtime/sandbox/SandboxRunner.js";
13
13
  import type {
14
14
  ShellServiceState,
15
15
  ShellSessionRuntimeState,
@@ -8,7 +8,7 @@
8
8
 
9
9
  import path from "node:path";
10
10
  import type { AgentContext } from "@/core/AgentContextTypes.js";
11
- import { stripInvocationAuthEnv } from "@/server/http/auth/AuthEnv.js";
11
+ import { stripInvocationAuthEnv } from "@/runtime/server/http/auth/AuthEnv.js";
12
12
  import { getSessionRunScope } from "@session/SessionRunScope.js";
13
13
 
14
14
  /**
@@ -148,8 +148,15 @@ export async function runTaskNow(params: {
148
148
 
149
149
  const runSessionId = createTaskRunSessionId(task.taskId, timestamp);
150
150
  const userSimulatorSessionId = `task-user-sim:${task.taskId}:${timestamp}`;
151
+ const taskModel = await context.session.resolveModel(task.frontmatter.sessionId);
152
+ if (!taskModel) {
153
+ throw new Error(
154
+ `Task "${task.taskId}" requires a configured model on session "${task.frontmatter.sessionId}"`,
155
+ );
156
+ }
151
157
  const taskSessionRuntime = createTaskSessionRuntimePort({
152
158
  context,
159
+ model: taskModel,
153
160
  runDirAbs,
154
161
  runSessionId,
155
162
  userSimulatorSessionId,
@@ -8,9 +8,9 @@
8
8
 
9
9
  import path from "node:path";
10
10
  import fs from "fs-extra";
11
- import { stripInvocationAuthEnv } from "@/server/http/auth/AuthEnv.js";
11
+ import { stripInvocationAuthEnv } from "@/runtime/server/http/auth/AuthEnv.js";
12
12
  import type { AgentContext } from "@/core/AgentContextTypes.js";
13
- import { runSandboxCommand } from "@/sandbox/SandboxRunner.js";
13
+ import { runSandboxCommand } from "@/runtime/sandbox/SandboxRunner.js";
14
14
  import type { SessionRunResult } from "@/session/types/SessionRun.js";
15
15
  import type { JsonObject } from "@/types/common/Json.js";
16
16
  import type {