actoviq-agent-sdk 0.4.6 → 0.4.7

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 (637) hide show
  1. package/CHANGELOG.md +203 -0
  2. package/README-zh.md +54 -19
  3. package/README.md +53 -19
  4. package/SECURITY.md +26 -0
  5. package/assets/actoviq-icon.ico +0 -0
  6. package/bin/actoviq-gui.js +28 -3
  7. package/dist/src/buddy/actoviqBuddy.d.ts.map +1 -1
  8. package/dist/src/buddy/actoviqBuddy.js +3 -4
  9. package/dist/src/buddy/actoviqBuddy.js.map +1 -1
  10. package/dist/src/cli/actoviq-react.js +495 -60
  11. package/dist/src/cli/actoviq-react.js.map +1 -1
  12. package/dist/src/compat/diagnostics.d.ts +18 -0
  13. package/dist/src/compat/diagnostics.d.ts.map +1 -0
  14. package/dist/src/compat/diagnostics.js +47 -0
  15. package/dist/src/compat/diagnostics.js.map +1 -0
  16. package/dist/src/compat/index.d.ts +8 -0
  17. package/dist/src/compat/index.d.ts.map +1 -0
  18. package/dist/src/compat/index.js +6 -0
  19. package/dist/src/compat/index.js.map +1 -0
  20. package/dist/src/config/actoviqHome.d.ts +32 -0
  21. package/dist/src/config/actoviqHome.d.ts.map +1 -0
  22. package/dist/src/config/actoviqHome.js +228 -0
  23. package/dist/src/config/actoviqHome.js.map +1 -0
  24. package/dist/src/config/actoviqSettingsStore.d.ts.map +1 -1
  25. package/dist/src/config/actoviqSettingsStore.js +6 -6
  26. package/dist/src/config/actoviqSettingsStore.js.map +1 -1
  27. package/dist/src/config/agentProfiles.d.ts +77 -0
  28. package/dist/src/config/agentProfiles.d.ts.map +1 -0
  29. package/dist/src/config/agentProfiles.js +319 -0
  30. package/dist/src/config/agentProfiles.js.map +1 -0
  31. package/dist/src/config/loadDefaultActoviqSettings.d.ts.map +1 -1
  32. package/dist/src/config/loadDefaultActoviqSettings.js +2 -3
  33. package/dist/src/config/loadDefaultActoviqSettings.js.map +1 -1
  34. package/dist/src/config/projectSessionDirectory.d.ts.map +1 -1
  35. package/dist/src/config/projectSessionDirectory.js +3 -2
  36. package/dist/src/config/projectSessionDirectory.js.map +1 -1
  37. package/dist/src/config/resolveRuntimeConfig.d.ts.map +1 -1
  38. package/dist/src/config/resolveRuntimeConfig.js +13 -2
  39. package/dist/src/config/resolveRuntimeConfig.js.map +1 -1
  40. package/dist/src/core/agent-spec.d.ts +74 -0
  41. package/dist/src/core/agent-spec.d.ts.map +1 -0
  42. package/dist/src/core/agent-spec.js +2 -0
  43. package/dist/src/core/agent-spec.js.map +1 -0
  44. package/dist/src/core/errors.d.ts +42 -0
  45. package/dist/src/core/errors.d.ts.map +1 -0
  46. package/dist/src/core/errors.js +53 -0
  47. package/dist/src/core/errors.js.map +1 -0
  48. package/dist/src/core/index.d.ts +11 -0
  49. package/dist/src/core/index.d.ts.map +1 -0
  50. package/dist/src/core/index.js +4 -0
  51. package/dist/src/core/index.js.map +1 -0
  52. package/dist/src/core/items.d.ts +161 -0
  53. package/dist/src/core/items.d.ts.map +1 -0
  54. package/dist/src/core/items.js +2 -0
  55. package/dist/src/core/items.js.map +1 -0
  56. package/dist/src/core/json.d.ts +20 -0
  57. package/dist/src/core/json.d.ts.map +1 -0
  58. package/dist/src/core/json.js +80 -0
  59. package/dist/src/core/json.js.map +1 -0
  60. package/dist/src/core/model-ref.d.ts +6 -0
  61. package/dist/src/core/model-ref.d.ts.map +1 -0
  62. package/dist/src/core/model-ref.js +2 -0
  63. package/dist/src/core/model-ref.js.map +1 -0
  64. package/dist/src/core/run.d.ts +35 -0
  65. package/dist/src/core/run.d.ts.map +1 -0
  66. package/dist/src/core/run.js +2 -0
  67. package/dist/src/core/run.js.map +1 -0
  68. package/dist/src/core/usage.d.ts +32 -0
  69. package/dist/src/core/usage.d.ts.map +1 -0
  70. package/dist/src/core/usage.js +111 -0
  71. package/dist/src/core/usage.js.map +1 -0
  72. package/dist/src/errors.d.ts +19 -0
  73. package/dist/src/errors.d.ts.map +1 -1
  74. package/dist/src/errors.js +27 -0
  75. package/dist/src/errors.js.map +1 -1
  76. package/dist/src/events/index.d.ts +4 -0
  77. package/dist/src/events/index.d.ts.map +1 -0
  78. package/dist/src/events/index.js +4 -0
  79. package/dist/src/events/index.js.map +1 -0
  80. package/dist/src/events/openTelemetry.d.ts +51 -0
  81. package/dist/src/events/openTelemetry.d.ts.map +1 -0
  82. package/dist/src/events/openTelemetry.js +116 -0
  83. package/dist/src/events/openTelemetry.js.map +1 -0
  84. package/dist/src/events/processors.d.ts +14 -0
  85. package/dist/src/events/processors.d.ts.map +1 -0
  86. package/dist/src/events/processors.js +60 -0
  87. package/dist/src/events/processors.js.map +1 -0
  88. package/dist/src/events/runEvents.d.ts +66 -0
  89. package/dist/src/events/runEvents.d.ts.map +1 -0
  90. package/dist/src/events/runEvents.js +143 -0
  91. package/dist/src/events/runEvents.js.map +1 -0
  92. package/dist/src/gui/actoviqGui.d.ts +15 -0
  93. package/dist/src/gui/actoviqGui.d.ts.map +1 -1
  94. package/dist/src/gui/actoviqGui.js +18034 -1919
  95. package/dist/src/gui/actoviqGui.js.map +1 -1
  96. package/dist/src/gui/contextRailStore.d.ts +47 -0
  97. package/dist/src/gui/contextRailStore.d.ts.map +1 -0
  98. package/dist/src/gui/contextRailStore.js +163 -0
  99. package/dist/src/gui/contextRailStore.js.map +1 -0
  100. package/dist/src/gui/electronMain.js +32 -16
  101. package/dist/src/gui/electronMain.js.map +1 -1
  102. package/dist/src/gui/guiAssets.d.ts +6 -0
  103. package/dist/src/gui/guiAssets.d.ts.map +1 -0
  104. package/dist/src/gui/guiAssets.js +48 -0
  105. package/dist/src/gui/guiAssets.js.map +1 -0
  106. package/dist/src/gui/guiSyntaxHighlight.d.ts +11 -0
  107. package/dist/src/gui/guiSyntaxHighlight.d.ts.map +1 -0
  108. package/dist/src/gui/guiSyntaxHighlight.js +348 -0
  109. package/dist/src/gui/guiSyntaxHighlight.js.map +1 -0
  110. package/dist/src/gui/projectMeta.d.ts +15 -0
  111. package/dist/src/gui/projectMeta.d.ts.map +1 -0
  112. package/dist/src/gui/projectMeta.js +61 -0
  113. package/dist/src/gui/projectMeta.js.map +1 -0
  114. package/dist/src/gui/projectWorkbench.d.ts +73 -0
  115. package/dist/src/gui/projectWorkbench.d.ts.map +1 -0
  116. package/dist/src/gui/projectWorkbench.js +307 -0
  117. package/dist/src/gui/projectWorkbench.js.map +1 -0
  118. package/dist/src/gui/terminalManager.d.ts +33 -0
  119. package/dist/src/gui/terminalManager.d.ts.map +1 -0
  120. package/dist/src/gui/terminalManager.js +206 -0
  121. package/dist/src/gui/terminalManager.js.map +1 -0
  122. package/dist/src/gui/transcript/clientBundle.d.ts +6 -0
  123. package/dist/src/gui/transcript/clientBundle.d.ts.map +1 -0
  124. package/dist/src/gui/transcript/clientBundle.js +978 -0
  125. package/dist/src/gui/transcript/clientBundle.js.map +1 -0
  126. package/dist/src/gui/transcript/index.d.ts +9 -0
  127. package/dist/src/gui/transcript/index.d.ts.map +1 -0
  128. package/dist/src/gui/transcript/index.js +6 -0
  129. package/dist/src/gui/transcript/index.js.map +1 -0
  130. package/dist/src/gui/transcript/parts.d.ts +81 -0
  131. package/dist/src/gui/transcript/parts.d.ts.map +1 -0
  132. package/dist/src/gui/transcript/parts.js +476 -0
  133. package/dist/src/gui/transcript/parts.js.map +1 -0
  134. package/dist/src/gui/transcript/registry.d.ts +8 -0
  135. package/dist/src/gui/transcript/registry.d.ts.map +1 -0
  136. package/dist/src/gui/transcript/registry.js +32 -0
  137. package/dist/src/gui/transcript/registry.js.map +1 -0
  138. package/dist/src/gui/transcript/scroll.d.ts +9 -0
  139. package/dist/src/gui/transcript/scroll.d.ts.map +1 -0
  140. package/dist/src/gui/transcript/scroll.js +13 -0
  141. package/dist/src/gui/transcript/scroll.js.map +1 -0
  142. package/dist/src/gui/transcript/styles.d.ts +3 -0
  143. package/dist/src/gui/transcript/styles.d.ts.map +1 -0
  144. package/dist/src/gui/transcript/styles.js +172 -0
  145. package/dist/src/gui/transcript/styles.js.map +1 -0
  146. package/dist/src/gui/workspaceNote.d.ts +4 -0
  147. package/dist/src/gui/workspaceNote.d.ts.map +1 -0
  148. package/dist/src/gui/workspaceNote.js +21 -0
  149. package/dist/src/gui/workspaceNote.js.map +1 -0
  150. package/dist/src/gui/workspaceRegistry.d.ts +11 -0
  151. package/dist/src/gui/workspaceRegistry.d.ts.map +1 -0
  152. package/dist/src/gui/workspaceRegistry.js +114 -0
  153. package/dist/src/gui/workspaceRegistry.js.map +1 -0
  154. package/dist/src/hooks/userHooks.d.ts +29 -8
  155. package/dist/src/hooks/userHooks.d.ts.map +1 -1
  156. package/dist/src/hooks/userHooks.js +106 -34
  157. package/dist/src/hooks/userHooks.js.map +1 -1
  158. package/dist/src/index.d.ts +24 -6
  159. package/dist/src/index.d.ts.map +1 -1
  160. package/dist/src/index.js +18 -6
  161. package/dist/src/index.js.map +1 -1
  162. package/dist/src/issues/durableIssueCoordinator.d.ts +57 -0
  163. package/dist/src/issues/durableIssueCoordinator.d.ts.map +1 -0
  164. package/dist/src/issues/durableIssueCoordinator.js +128 -0
  165. package/dist/src/issues/durableIssueCoordinator.js.map +1 -0
  166. package/dist/src/issues/issueExecution.d.ts +34 -0
  167. package/dist/src/issues/issueExecution.d.ts.map +1 -0
  168. package/dist/src/issues/issueExecution.js +190 -0
  169. package/dist/src/issues/issueExecution.js.map +1 -0
  170. package/dist/src/issues/issueStore.d.ts +95 -0
  171. package/dist/src/issues/issueStore.d.ts.map +1 -0
  172. package/dist/src/issues/issueStore.js +373 -0
  173. package/dist/src/issues/issueStore.js.map +1 -0
  174. package/dist/src/manager/projectManager.d.ts +103 -0
  175. package/dist/src/manager/projectManager.d.ts.map +1 -0
  176. package/dist/src/manager/projectManager.js +547 -0
  177. package/dist/src/manager/projectManager.js.map +1 -0
  178. package/dist/src/mcp/connectionManager.d.ts +22 -2
  179. package/dist/src/mcp/connectionManager.d.ts.map +1 -1
  180. package/dist/src/mcp/connectionManager.js +153 -41
  181. package/dist/src/mcp/connectionManager.js.map +1 -1
  182. package/dist/src/mcp/mcpServerConfig.d.ts.map +1 -1
  183. package/dist/src/mcp/mcpServerConfig.js +7 -7
  184. package/dist/src/mcp/mcpServerConfig.js.map +1 -1
  185. package/dist/src/memory/actoviqMemory.js +6 -6
  186. package/dist/src/memory/actoviqMemory.js.map +1 -1
  187. package/dist/src/memory/sessionHistory.js +2 -2
  188. package/dist/src/memory/sessionHistory.js.map +1 -1
  189. package/dist/src/node/index.d.ts +5 -0
  190. package/dist/src/node/index.d.ts.map +1 -0
  191. package/dist/src/node/index.js +5 -0
  192. package/dist/src/node/index.js.map +1 -0
  193. package/dist/src/node/sqliteCheckpointAdapter.d.ts +20 -0
  194. package/dist/src/node/sqliteCheckpointAdapter.d.ts.map +1 -0
  195. package/dist/src/node/sqliteCheckpointAdapter.js +163 -0
  196. package/dist/src/node/sqliteCheckpointAdapter.js.map +1 -0
  197. package/dist/src/node/sqliteDurableChildStore.d.ts +21 -0
  198. package/dist/src/node/sqliteDurableChildStore.d.ts.map +1 -0
  199. package/dist/src/node/sqliteDurableChildStore.js +124 -0
  200. package/dist/src/node/sqliteDurableChildStore.js.map +1 -0
  201. package/dist/src/node/sqliteSessionAdapter.d.ts +28 -0
  202. package/dist/src/node/sqliteSessionAdapter.d.ts.map +1 -0
  203. package/dist/src/node/sqliteSessionAdapter.js +99 -0
  204. package/dist/src/node/sqliteSessionAdapter.js.map +1 -0
  205. package/dist/src/orchestration/agentTool.d.ts +50 -0
  206. package/dist/src/orchestration/agentTool.d.ts.map +1 -0
  207. package/dist/src/orchestration/agentTool.js +132 -0
  208. package/dist/src/orchestration/agentTool.js.map +1 -0
  209. package/dist/src/orchestration/background.d.ts +102 -0
  210. package/dist/src/orchestration/background.d.ts.map +1 -0
  211. package/dist/src/orchestration/background.js +310 -0
  212. package/dist/src/orchestration/background.js.map +1 -0
  213. package/dist/src/orchestration/childRunner.d.ts +12 -0
  214. package/dist/src/orchestration/childRunner.d.ts.map +1 -0
  215. package/dist/src/orchestration/childRunner.js +179 -0
  216. package/dist/src/orchestration/childRunner.js.map +1 -0
  217. package/dist/src/orchestration/contracts.d.ts +169 -0
  218. package/dist/src/orchestration/contracts.d.ts.map +1 -0
  219. package/dist/src/orchestration/contracts.js +11 -0
  220. package/dist/src/orchestration/contracts.js.map +1 -0
  221. package/dist/src/orchestration/handoff.d.ts +32 -0
  222. package/dist/src/orchestration/handoff.d.ts.map +1 -0
  223. package/dist/src/orchestration/handoff.js +60 -0
  224. package/dist/src/orchestration/handoff.js.map +1 -0
  225. package/dist/src/orchestration/index.d.ts +9 -0
  226. package/dist/src/orchestration/index.d.ts.map +1 -0
  227. package/dist/src/orchestration/index.js +9 -0
  228. package/dist/src/orchestration/index.js.map +1 -0
  229. package/dist/src/orchestration/presets.d.ts +51 -0
  230. package/dist/src/orchestration/presets.d.ts.map +1 -0
  231. package/dist/src/orchestration/presets.js +78 -0
  232. package/dist/src/orchestration/presets.js.map +1 -0
  233. package/dist/src/orchestration/scope.d.ts +69 -0
  234. package/dist/src/orchestration/scope.d.ts.map +1 -0
  235. package/dist/src/orchestration/scope.js +371 -0
  236. package/dist/src/orchestration/scope.js.map +1 -0
  237. package/dist/src/orchestration/workflowGraph.d.ts +73 -0
  238. package/dist/src/orchestration/workflowGraph.d.ts.map +1 -0
  239. package/dist/src/orchestration/workflowGraph.js +255 -0
  240. package/dist/src/orchestration/workflowGraph.js.map +1 -0
  241. package/dist/src/parity/actoviqCleanBridgeCompatSdk.d.ts.map +1 -1
  242. package/dist/src/parity/actoviqCleanBridgeCompatSdk.js +101 -48
  243. package/dist/src/parity/actoviqCleanBridgeCompatSdk.js.map +1 -1
  244. package/dist/src/parity/bridgeConfigs.d.ts +2 -2
  245. package/dist/src/parity/bridgeConfigs.d.ts.map +1 -1
  246. package/dist/src/parity/bridgeConfigs.js +78 -39
  247. package/dist/src/parity/bridgeConfigs.js.map +1 -1
  248. package/dist/src/parity/bridgeProviders.d.ts +9 -6
  249. package/dist/src/parity/bridgeProviders.d.ts.map +1 -1
  250. package/dist/src/parity/bridgeProviders.js +140 -26
  251. package/dist/src/parity/bridgeProviders.js.map +1 -1
  252. package/dist/src/parity/portableSessions.js +2 -2
  253. package/dist/src/parity/portableSessions.js.map +1 -1
  254. package/dist/src/profiles/index.d.ts +15 -0
  255. package/dist/src/profiles/index.d.ts.map +1 -0
  256. package/dist/src/profiles/index.js +618 -0
  257. package/dist/src/profiles/index.js.map +1 -0
  258. package/dist/src/profiles/types.d.ts +102 -0
  259. package/dist/src/profiles/types.d.ts.map +1 -0
  260. package/dist/src/profiles/types.js +9 -0
  261. package/dist/src/profiles/types.js.map +1 -0
  262. package/dist/src/provider/client.d.ts +1 -1
  263. package/dist/src/provider/client.d.ts.map +1 -1
  264. package/dist/src/provider/openai-model-api.js +1 -1
  265. package/dist/src/provider/openai-model-api.js.map +1 -1
  266. package/dist/src/providers-v2/adapter-base.d.ts +35 -0
  267. package/dist/src/providers-v2/adapter-base.d.ts.map +1 -0
  268. package/dist/src/providers-v2/adapter-base.js +115 -0
  269. package/dist/src/providers-v2/adapter-base.js.map +1 -0
  270. package/dist/src/providers-v2/anthropic.d.ts +15 -0
  271. package/dist/src/providers-v2/anthropic.d.ts.map +1 -0
  272. package/dist/src/providers-v2/anthropic.js +414 -0
  273. package/dist/src/providers-v2/anthropic.js.map +1 -0
  274. package/dist/src/providers-v2/capabilities.d.ts +33 -0
  275. package/dist/src/providers-v2/capabilities.d.ts.map +1 -0
  276. package/dist/src/providers-v2/capabilities.js +218 -0
  277. package/dist/src/providers-v2/capabilities.js.map +1 -0
  278. package/dist/src/providers-v2/index.d.ts +12 -0
  279. package/dist/src/providers-v2/index.d.ts.map +1 -0
  280. package/dist/src/providers-v2/index.js +8 -0
  281. package/dist/src/providers-v2/index.js.map +1 -0
  282. package/dist/src/providers-v2/legacy.d.ts +26 -0
  283. package/dist/src/providers-v2/legacy.d.ts.map +1 -0
  284. package/dist/src/providers-v2/legacy.js +543 -0
  285. package/dist/src/providers-v2/legacy.js.map +1 -0
  286. package/dist/src/providers-v2/mapping.d.ts +34 -0
  287. package/dist/src/providers-v2/mapping.d.ts.map +1 -0
  288. package/dist/src/providers-v2/mapping.js +194 -0
  289. package/dist/src/providers-v2/mapping.js.map +1 -0
  290. package/dist/src/providers-v2/openai-chat.d.ts +16 -0
  291. package/dist/src/providers-v2/openai-chat.d.ts.map +1 -0
  292. package/dist/src/providers-v2/openai-chat.js +318 -0
  293. package/dist/src/providers-v2/openai-chat.js.map +1 -0
  294. package/dist/src/providers-v2/openai-responses.d.ts +15 -0
  295. package/dist/src/providers-v2/openai-responses.d.ts.map +1 -0
  296. package/dist/src/providers-v2/openai-responses.js +356 -0
  297. package/dist/src/providers-v2/openai-responses.js.map +1 -0
  298. package/dist/src/providers-v2/registry.d.ts +39 -0
  299. package/dist/src/providers-v2/registry.d.ts.map +1 -0
  300. package/dist/src/providers-v2/registry.js +101 -0
  301. package/dist/src/providers-v2/registry.js.map +1 -0
  302. package/dist/src/providers-v2/stream.d.ts +14 -0
  303. package/dist/src/providers-v2/stream.d.ts.map +1 -0
  304. package/dist/src/providers-v2/stream.js +115 -0
  305. package/dist/src/providers-v2/stream.js.map +1 -0
  306. package/dist/src/providers-v2/transport.d.ts +36 -0
  307. package/dist/src/providers-v2/transport.d.ts.map +1 -0
  308. package/dist/src/providers-v2/transport.js +337 -0
  309. package/dist/src/providers-v2/transport.js.map +1 -0
  310. package/dist/src/providers-v2/types.d.ts +162 -0
  311. package/dist/src/providers-v2/types.d.ts.map +1 -0
  312. package/dist/src/providers-v2/types.js +8 -0
  313. package/dist/src/providers-v2/types.js.map +1 -0
  314. package/dist/src/router/modelRouter.d.ts.map +1 -1
  315. package/dist/src/router/modelRouter.js +2 -3
  316. package/dist/src/router/modelRouter.js.map +1 -1
  317. package/dist/src/runtime/actoviqAgents.d.ts +5 -0
  318. package/dist/src/runtime/actoviqAgents.d.ts.map +1 -1
  319. package/dist/src/runtime/actoviqAgents.js +22 -4
  320. package/dist/src/runtime/actoviqAgents.js.map +1 -1
  321. package/dist/src/runtime/actoviqBackgroundTasks.d.ts +2 -1
  322. package/dist/src/runtime/actoviqBackgroundTasks.d.ts.map +1 -1
  323. package/dist/src/runtime/actoviqBackgroundTasks.js +4 -2
  324. package/dist/src/runtime/actoviqBackgroundTasks.js.map +1 -1
  325. package/dist/src/runtime/actoviqCompact.d.ts +15 -0
  326. package/dist/src/runtime/actoviqCompact.d.ts.map +1 -1
  327. package/dist/src/runtime/actoviqCompact.js +36 -10
  328. package/dist/src/runtime/actoviqCompact.js.map +1 -1
  329. package/dist/src/runtime/actoviqModelApi.d.ts.map +1 -1
  330. package/dist/src/runtime/actoviqModelApi.js +16 -2
  331. package/dist/src/runtime/actoviqModelApi.js.map +1 -1
  332. package/dist/src/runtime/actoviqPermissions.js +5 -1
  333. package/dist/src/runtime/actoviqPermissions.js.map +1 -1
  334. package/dist/src/runtime/agentClient.d.ts +3 -0
  335. package/dist/src/runtime/agentClient.d.ts.map +1 -1
  336. package/dist/src/runtime/agentClient.js +127 -45
  337. package/dist/src/runtime/agentClient.js.map +1 -1
  338. package/dist/src/runtime/agentRuntimeDiscovery.d.ts +75 -0
  339. package/dist/src/runtime/agentRuntimeDiscovery.d.ts.map +1 -0
  340. package/dist/src/runtime/agentRuntimeDiscovery.js +311 -0
  341. package/dist/src/runtime/agentRuntimeDiscovery.js.map +1 -0
  342. package/dist/src/runtime/agentSession.d.ts +18 -0
  343. package/dist/src/runtime/agentSession.d.ts.map +1 -1
  344. package/dist/src/runtime/agentSession.js +36 -0
  345. package/dist/src/runtime/agentSession.js.map +1 -1
  346. package/dist/src/runtime/asyncQueue.d.ts +99 -8
  347. package/dist/src/runtime/asyncQueue.d.ts.map +1 -1
  348. package/dist/src/runtime/asyncQueue.js +437 -37
  349. package/dist/src/runtime/asyncQueue.js.map +1 -1
  350. package/dist/src/runtime/conversationEngine.d.ts +7 -0
  351. package/dist/src/runtime/conversationEngine.d.ts.map +1 -1
  352. package/dist/src/runtime/conversationEngine.js +278 -18
  353. package/dist/src/runtime/conversationEngine.js.map +1 -1
  354. package/dist/src/runtime/deadline.d.ts +13 -0
  355. package/dist/src/runtime/deadline.d.ts.map +1 -0
  356. package/dist/src/runtime/deadline.js +67 -0
  357. package/dist/src/runtime/deadline.js.map +1 -0
  358. package/dist/src/runtime/messageUtils.d.ts +5 -0
  359. package/dist/src/runtime/messageUtils.d.ts.map +1 -1
  360. package/dist/src/runtime/messageUtils.js +17 -0
  361. package/dist/src/runtime/messageUtils.js.map +1 -1
  362. package/dist/src/runtime/sessionTurnCoordinator.d.ts +12 -0
  363. package/dist/src/runtime/sessionTurnCoordinator.d.ts.map +1 -0
  364. package/dist/src/runtime/sessionTurnCoordinator.js +23 -0
  365. package/dist/src/runtime/sessionTurnCoordinator.js.map +1 -0
  366. package/dist/src/runtime/tools.d.ts.map +1 -1
  367. package/dist/src/runtime/tools.js +1 -0
  368. package/dist/src/runtime/tools.js.map +1 -1
  369. package/dist/src/runtime-v2/agentRuntime.d.ts +136 -0
  370. package/dist/src/runtime-v2/agentRuntime.d.ts.map +1 -0
  371. package/dist/src/runtime-v2/agentRuntime.js +1341 -0
  372. package/dist/src/runtime-v2/agentRuntime.js.map +1 -0
  373. package/dist/src/runtime-v2/index.d.ts +6 -0
  374. package/dist/src/runtime-v2/index.d.ts.map +1 -0
  375. package/dist/src/runtime-v2/index.js +6 -0
  376. package/dist/src/runtime-v2/index.js.map +1 -0
  377. package/dist/src/runtime-v2/middleware/index.d.ts +5 -0
  378. package/dist/src/runtime-v2/middleware/index.d.ts.map +1 -0
  379. package/dist/src/runtime-v2/middleware/index.js +4 -0
  380. package/dist/src/runtime-v2/middleware/index.js.map +1 -0
  381. package/dist/src/runtime-v2/middleware/pipeline.d.ts +56 -0
  382. package/dist/src/runtime-v2/middleware/pipeline.d.ts.map +1 -0
  383. package/dist/src/runtime-v2/middleware/pipeline.js +242 -0
  384. package/dist/src/runtime-v2/middleware/pipeline.js.map +1 -0
  385. package/dist/src/runtime-v2/middleware/registry.d.ts +17 -0
  386. package/dist/src/runtime-v2/middleware/registry.d.ts.map +1 -0
  387. package/dist/src/runtime-v2/middleware/registry.js +46 -0
  388. package/dist/src/runtime-v2/middleware/registry.js.map +1 -0
  389. package/dist/src/runtime-v2/middleware/stages.d.ts +25 -0
  390. package/dist/src/runtime-v2/middleware/stages.d.ts.map +1 -0
  391. package/dist/src/runtime-v2/middleware/stages.js +48 -0
  392. package/dist/src/runtime-v2/middleware/stages.js.map +1 -0
  393. package/dist/src/runtime-v2/middleware/types.d.ts +51 -0
  394. package/dist/src/runtime-v2/middleware/types.d.ts.map +1 -0
  395. package/dist/src/runtime-v2/middleware/types.js +2 -0
  396. package/dist/src/runtime-v2/middleware/types.js.map +1 -0
  397. package/dist/src/runtime-v2/services.d.ts +33 -0
  398. package/dist/src/runtime-v2/services.d.ts.map +1 -0
  399. package/dist/src/runtime-v2/services.js +92 -0
  400. package/dist/src/runtime-v2/services.js.map +1 -0
  401. package/dist/src/runtime-v2/state.d.ts +71 -0
  402. package/dist/src/runtime-v2/state.d.ts.map +1 -0
  403. package/dist/src/runtime-v2/state.js +2 -0
  404. package/dist/src/runtime-v2/state.js.map +1 -0
  405. package/dist/src/runtime-v2/tools.d.ts +124 -0
  406. package/dist/src/runtime-v2/tools.d.ts.map +1 -0
  407. package/dist/src/runtime-v2/tools.js +185 -0
  408. package/dist/src/runtime-v2/tools.js.map +1 -0
  409. package/dist/src/scheduling/durableAgentScheduler.d.ts +46 -0
  410. package/dist/src/scheduling/durableAgentScheduler.d.ts.map +1 -0
  411. package/dist/src/scheduling/durableAgentScheduler.js +97 -0
  412. package/dist/src/scheduling/durableAgentScheduler.js.map +1 -0
  413. package/dist/src/scheduling/index.d.ts +3 -0
  414. package/dist/src/scheduling/index.d.ts.map +1 -1
  415. package/dist/src/scheduling/index.js +2 -0
  416. package/dist/src/scheduling/index.js.map +1 -1
  417. package/dist/src/scheduling/taskPersistence.d.ts +9 -0
  418. package/dist/src/scheduling/taskPersistence.d.ts.map +1 -0
  419. package/dist/src/scheduling/taskPersistence.js +238 -0
  420. package/dist/src/scheduling/taskPersistence.js.map +1 -0
  421. package/dist/src/storage/atomicJsonWrite.d.ts +13 -0
  422. package/dist/src/storage/atomicJsonWrite.d.ts.map +1 -0
  423. package/dist/src/storage/atomicJsonWrite.js +40 -0
  424. package/dist/src/storage/atomicJsonWrite.js.map +1 -0
  425. package/dist/src/storage/backgroundTaskStore.d.ts.map +1 -1
  426. package/dist/src/storage/backgroundTaskStore.js +2 -6
  427. package/dist/src/storage/backgroundTaskStore.js.map +1 -1
  428. package/dist/src/storage/mailboxStore.d.ts.map +1 -1
  429. package/dist/src/storage/mailboxStore.js +2 -6
  430. package/dist/src/storage/mailboxStore.js.map +1 -1
  431. package/dist/src/storage/sessionStore.d.ts +3 -0
  432. package/dist/src/storage/sessionStore.d.ts.map +1 -1
  433. package/dist/src/storage/sessionStore.js +169 -10
  434. package/dist/src/storage/sessionStore.js.map +1 -1
  435. package/dist/src/storage/teammateStore.d.ts.map +1 -1
  436. package/dist/src/storage/teammateStore.js +2 -6
  437. package/dist/src/storage/teammateStore.js.map +1 -1
  438. package/dist/src/storage-v2/contracts.d.ts +36 -0
  439. package/dist/src/storage-v2/contracts.d.ts.map +1 -0
  440. package/dist/src/storage-v2/contracts.js +2 -0
  441. package/dist/src/storage-v2/contracts.js.map +1 -0
  442. package/dist/src/storage-v2/errors.d.ts +21 -0
  443. package/dist/src/storage-v2/errors.d.ts.map +1 -0
  444. package/dist/src/storage-v2/errors.js +44 -0
  445. package/dist/src/storage-v2/errors.js.map +1 -0
  446. package/dist/src/storage-v2/index.d.ts +8 -0
  447. package/dist/src/storage-v2/index.d.ts.map +1 -0
  448. package/dist/src/storage-v2/index.js +8 -0
  449. package/dist/src/storage-v2/index.js.map +1 -0
  450. package/dist/src/storage-v2/legacyJsonV1Items.d.ts +10 -0
  451. package/dist/src/storage-v2/legacyJsonV1Items.d.ts.map +1 -0
  452. package/dist/src/storage-v2/legacyJsonV1Items.js +153 -0
  453. package/dist/src/storage-v2/legacyJsonV1Items.js.map +1 -0
  454. package/dist/src/storage-v2/migration.d.ts +32 -0
  455. package/dist/src/storage-v2/migration.d.ts.map +1 -0
  456. package/dist/src/storage-v2/migration.js +242 -0
  457. package/dist/src/storage-v2/migration.js.map +1 -0
  458. package/dist/src/storage-v2/sqliteDriver.d.ts +24 -0
  459. package/dist/src/storage-v2/sqliteDriver.d.ts.map +1 -0
  460. package/dist/src/storage-v2/sqliteDriver.js +90 -0
  461. package/dist/src/storage-v2/sqliteDriver.js.map +1 -0
  462. package/dist/src/storage-v2/sqliteStorage.d.ts +55 -0
  463. package/dist/src/storage-v2/sqliteStorage.d.ts.map +1 -0
  464. package/dist/src/storage-v2/sqliteStorage.js +905 -0
  465. package/dist/src/storage-v2/sqliteStorage.js.map +1 -0
  466. package/dist/src/storage-v2/types.d.ts +198 -0
  467. package/dist/src/storage-v2/types.d.ts.map +1 -0
  468. package/dist/src/storage-v2/types.js +2 -0
  469. package/dist/src/storage-v2/types.js.map +1 -0
  470. package/dist/src/surfaces/index.d.ts +8 -0
  471. package/dist/src/surfaces/index.d.ts.map +1 -0
  472. package/dist/src/surfaces/index.js +8 -0
  473. package/dist/src/surfaces/index.js.map +1 -0
  474. package/dist/src/surfaces/internal.d.ts +17 -0
  475. package/dist/src/surfaces/internal.d.ts.map +1 -0
  476. package/dist/src/surfaces/internal.js +116 -0
  477. package/dist/src/surfaces/internal.js.map +1 -0
  478. package/dist/src/surfaces/legacyEventAdapter.d.ts +38 -0
  479. package/dist/src/surfaces/legacyEventAdapter.d.ts.map +1 -0
  480. package/dist/src/surfaces/legacyEventAdapter.js +373 -0
  481. package/dist/src/surfaces/legacyEventAdapter.js.map +1 -0
  482. package/dist/src/surfaces/legacySurfacePipeline.d.ts +18 -0
  483. package/dist/src/surfaces/legacySurfacePipeline.d.ts.map +1 -0
  484. package/dist/src/surfaces/legacySurfacePipeline.js +25 -0
  485. package/dist/src/surfaces/legacySurfacePipeline.js.map +1 -0
  486. package/dist/src/surfaces/redaction.d.ts +12 -0
  487. package/dist/src/surfaces/redaction.d.ts.map +1 -0
  488. package/dist/src/surfaces/redaction.js +111 -0
  489. package/dist/src/surfaces/redaction.js.map +1 -0
  490. package/dist/src/surfaces/runEventLegacyCompat.d.ts +26 -0
  491. package/dist/src/surfaces/runEventLegacyCompat.d.ts.map +1 -0
  492. package/dist/src/surfaces/runEventLegacyCompat.js +339 -0
  493. package/dist/src/surfaces/runEventLegacyCompat.js.map +1 -0
  494. package/dist/src/surfaces/runEventProjector.d.ts +44 -0
  495. package/dist/src/surfaces/runEventProjector.d.ts.map +1 -0
  496. package/dist/src/surfaces/runEventProjector.js +404 -0
  497. package/dist/src/surfaces/runEventProjector.js.map +1 -0
  498. package/dist/src/surfaces/runtimeBridgeAdapter.d.ts +30 -0
  499. package/dist/src/surfaces/runtimeBridgeAdapter.d.ts.map +1 -0
  500. package/dist/src/surfaces/runtimeBridgeAdapter.js +38 -0
  501. package/dist/src/surfaces/runtimeBridgeAdapter.js.map +1 -0
  502. package/dist/src/surfaces/types.d.ts +38 -0
  503. package/dist/src/surfaces/types.d.ts.map +1 -0
  504. package/dist/src/surfaces/types.js +2 -0
  505. package/dist/src/surfaces/types.js.map +1 -0
  506. package/dist/src/team/agentPool.d.ts +2 -0
  507. package/dist/src/team/agentPool.d.ts.map +1 -1
  508. package/dist/src/team/agentPool.js +3 -1
  509. package/dist/src/team/agentPool.js.map +1 -1
  510. package/dist/src/team/modelTeam.d.ts +25 -19
  511. package/dist/src/team/modelTeam.d.ts.map +1 -1
  512. package/dist/src/team/modelTeam.js +293 -294
  513. package/dist/src/team/modelTeam.js.map +1 -1
  514. package/dist/src/team/pricing.d.ts.map +1 -1
  515. package/dist/src/team/pricing.js +2 -1
  516. package/dist/src/team/pricing.js.map +1 -1
  517. package/dist/src/team/teamDefinitions.d.ts +28 -1
  518. package/dist/src/team/teamDefinitions.d.ts.map +1 -1
  519. package/dist/src/team/teamDefinitions.js +204 -8
  520. package/dist/src/team/teamDefinitions.js.map +1 -1
  521. package/dist/src/team/teamGraph.d.ts +191 -0
  522. package/dist/src/team/teamGraph.d.ts.map +1 -0
  523. package/dist/src/team/teamGraph.js +616 -0
  524. package/dist/src/team/teamGraph.js.map +1 -0
  525. package/dist/src/team/teamGraphLayout.d.ts +44 -0
  526. package/dist/src/team/teamGraphLayout.d.ts.map +1 -0
  527. package/dist/src/team/teamGraphLayout.js +120 -0
  528. package/dist/src/team/teamGraphLayout.js.map +1 -0
  529. package/dist/src/team/teamGraphScaffold.d.ts +76 -0
  530. package/dist/src/team/teamGraphScaffold.d.ts.map +1 -0
  531. package/dist/src/team/teamGraphScaffold.js +409 -0
  532. package/dist/src/team/teamGraphScaffold.js.map +1 -0
  533. package/dist/src/team/teamGraphV3.d.ts +28 -0
  534. package/dist/src/team/teamGraphV3.d.ts.map +1 -0
  535. package/dist/src/team/teamGraphV3.js +640 -0
  536. package/dist/src/team/teamGraphV3.js.map +1 -0
  537. package/dist/src/team/teamPreferences.d.ts +11 -0
  538. package/dist/src/team/teamPreferences.d.ts.map +1 -0
  539. package/dist/src/team/teamPreferences.js +48 -0
  540. package/dist/src/team/teamPreferences.js.map +1 -0
  541. package/dist/src/team/teamPrompts.d.ts +16 -0
  542. package/dist/src/team/teamPrompts.d.ts.map +1 -0
  543. package/dist/src/team/teamPrompts.js +44 -0
  544. package/dist/src/team/teamPrompts.js.map +1 -0
  545. package/dist/src/team/teamRunView.d.ts +78 -0
  546. package/dist/src/team/teamRunView.d.ts.map +1 -0
  547. package/dist/src/team/teamRunView.js +205 -0
  548. package/dist/src/team/teamRunView.js.map +1 -0
  549. package/dist/src/team/teamRuntime.d.ts +19 -2
  550. package/dist/src/team/teamRuntime.d.ts.map +1 -1
  551. package/dist/src/team/teamRuntime.js +13 -7
  552. package/dist/src/team/teamRuntime.js.map +1 -1
  553. package/dist/src/tools/actoviqCoreTools.d.ts +2 -1
  554. package/dist/src/tools/actoviqCoreTools.d.ts.map +1 -1
  555. package/dist/src/tools/actoviqCoreTools.js +4 -1
  556. package/dist/src/tools/actoviqCoreTools.js.map +1 -1
  557. package/dist/src/tools/actoviqShellTools.d.ts.map +1 -1
  558. package/dist/src/tools/actoviqShellTools.js +10 -0
  559. package/dist/src/tools/actoviqShellTools.js.map +1 -1
  560. package/dist/src/tools/askUserQuestion/AskUserQuestionTool.d.ts.map +1 -1
  561. package/dist/src/tools/askUserQuestion/AskUserQuestionTool.js +2 -0
  562. package/dist/src/tools/askUserQuestion/AskUserQuestionTool.js.map +1 -1
  563. package/dist/src/tools/bash/BashTool.d.ts +33 -2
  564. package/dist/src/tools/bash/BashTool.d.ts.map +1 -1
  565. package/dist/src/tools/bash/BashTool.js +140 -2
  566. package/dist/src/tools/bash/BashTool.js.map +1 -1
  567. package/dist/src/tools/bash/prompt.d.ts +1 -1
  568. package/dist/src/tools/bash/prompt.d.ts.map +1 -1
  569. package/dist/src/tools/bash/prompt.js +1 -0
  570. package/dist/src/tools/bash/prompt.js.map +1 -1
  571. package/dist/src/tools/planMode/PlanModeTools.js +2 -2
  572. package/dist/src/tools/planMode/PlanModeTools.js.map +1 -1
  573. package/dist/src/tools/todo/TodoWriteTool.d.ts +1 -1
  574. package/dist/src/tui/actoviqTui.d.ts.map +1 -1
  575. package/dist/src/tui/actoviqTui.js +522 -97
  576. package/dist/src/tui/actoviqTui.js.map +1 -1
  577. package/dist/src/tui/pluginCatalog.d.ts.map +1 -1
  578. package/dist/src/tui/pluginCatalog.js +3 -1
  579. package/dist/src/tui/pluginCatalog.js.map +1 -1
  580. package/dist/src/types.d.ts +355 -23
  581. package/dist/src/types.d.ts.map +1 -1
  582. package/dist/src/types.js.map +1 -1
  583. package/dist/src/ui/commandSurface.d.ts.map +1 -1
  584. package/dist/src/ui/commandSurface.js +23 -3
  585. package/dist/src/ui/commandSurface.js.map +1 -1
  586. package/dist/src/workflow/workflowPersistence.d.ts.map +1 -1
  587. package/dist/src/workflow/workflowPersistence.js +2 -1
  588. package/dist/src/workflow/workflowPersistence.js.map +1 -1
  589. package/dist/src/workflow/workflowScriptRuntime.d.ts +4 -0
  590. package/dist/src/workflow/workflowScriptRuntime.d.ts.map +1 -1
  591. package/dist/src/workflow/workflowScriptRuntime.js +69 -18
  592. package/dist/src/workflow/workflowScriptRuntime.js.map +1 -1
  593. package/dist/src/workflow-v2/boundary.d.ts +2 -0
  594. package/dist/src/workflow-v2/boundary.d.ts.map +1 -0
  595. package/dist/src/workflow-v2/boundary.js +45 -0
  596. package/dist/src/workflow-v2/boundary.js.map +1 -0
  597. package/dist/src/workflow-v2/capabilities.d.ts +5 -0
  598. package/dist/src/workflow-v2/capabilities.d.ts.map +1 -0
  599. package/dist/src/workflow-v2/capabilities.js +32 -0
  600. package/dist/src/workflow-v2/capabilities.js.map +1 -0
  601. package/dist/src/workflow-v2/errors.d.ts +43 -0
  602. package/dist/src/workflow-v2/errors.d.ts.map +1 -0
  603. package/dist/src/workflow-v2/errors.js +84 -0
  604. package/dist/src/workflow-v2/errors.js.map +1 -0
  605. package/dist/src/workflow-v2/index.d.ts +9 -0
  606. package/dist/src/workflow-v2/index.d.ts.map +1 -0
  607. package/dist/src/workflow-v2/index.js +6 -0
  608. package/dist/src/workflow-v2/index.js.map +1 -0
  609. package/dist/src/workflow-v2/json.d.ts +5 -0
  610. package/dist/src/workflow-v2/json.d.ts.map +1 -0
  611. package/dist/src/workflow-v2/json.js +40 -0
  612. package/dist/src/workflow-v2/json.js.map +1 -0
  613. package/dist/src/workflow-v2/limits.d.ts +15 -0
  614. package/dist/src/workflow-v2/limits.d.ts.map +1 -0
  615. package/dist/src/workflow-v2/limits.js +37 -0
  616. package/dist/src/workflow-v2/limits.js.map +1 -0
  617. package/dist/src/workflow-v2/localIsolatedProcessExecutor.d.ts +25 -0
  618. package/dist/src/workflow-v2/localIsolatedProcessExecutor.d.ts.map +1 -0
  619. package/dist/src/workflow-v2/localIsolatedProcessExecutor.js +423 -0
  620. package/dist/src/workflow-v2/localIsolatedProcessExecutor.js.map +1 -0
  621. package/dist/src/workflow-v2/localProcessChild.d.ts +2 -0
  622. package/dist/src/workflow-v2/localProcessChild.d.ts.map +1 -0
  623. package/dist/src/workflow-v2/localProcessChild.js +305 -0
  624. package/dist/src/workflow-v2/localProcessChild.js.map +1 -0
  625. package/dist/src/workflow-v2/router.d.ts +10 -0
  626. package/dist/src/workflow-v2/router.d.ts.map +1 -0
  627. package/dist/src/workflow-v2/router.js +28 -0
  628. package/dist/src/workflow-v2/router.js.map +1 -0
  629. package/dist/src/workflow-v2/trustedCompatibilityExecutor.d.ts +17 -0
  630. package/dist/src/workflow-v2/trustedCompatibilityExecutor.d.ts.map +1 -0
  631. package/dist/src/workflow-v2/trustedCompatibilityExecutor.js +159 -0
  632. package/dist/src/workflow-v2/trustedCompatibilityExecutor.js.map +1 -0
  633. package/dist/src/workflow-v2/types.d.ts +67 -0
  634. package/dist/src/workflow-v2/types.d.ts.map +1 -0
  635. package/dist/src/workflow-v2/types.js +2 -0
  636. package/dist/src/workflow-v2/types.js.map +1 -0
  637. package/package.json +96 -10
@@ -7,6 +7,7 @@ import { createActoviqBuddyApi } from '../buddy/actoviqBuddy.js';
7
7
  import { createActoviqComputerUseMcpServer, createActoviqComputerUseTools, } from '../computer/actoviqComputerUse.js';
8
8
  import { resolveRuntimeConfig } from '../config/resolveRuntimeConfig.js';
9
9
  import { resolveActoviqModelReference } from '../config/modelTiers.js';
10
+ import { recordCompatUsage } from '../compat/diagnostics.js';
10
11
  import { mergeActoviqHooks, normalizeActoviqHookMessages, resolveActoviqPostRunHooks, resolveActoviqSessionStartHooks, } from '../hooks/actoviqHooks.js';
11
12
  import { createActoviqMemoryApi } from '../memory/actoviqMemory.js';
12
13
  import { appendMessagesToTranscript } from '../memory/actoviqTranscriptLogger.js';
@@ -19,8 +20,9 @@ import { SessionStore } from '../storage/sessionStore.js';
19
20
  import { TeammateStore } from '../storage/teammateStore.js';
20
21
  import { ActoviqSwarmApi } from '../swarm/actoviqSwarm.js';
21
22
  import { createActoviqFileTools } from '../tools/actoviqFileTools.js';
23
+ import { BASH_TOOL_NAME, createBashTool } from '../tools/bash/BashTool.js';
22
24
  import { createGitWorktreeWorkspace, } from '../workspace/actoviqWorkspace.js';
23
- import { ActoviqAgentsApi, createActoviqTaskTool, summarizeActoviqAgentDefinition, } from './actoviqAgents.js';
25
+ import { ACTOVIQ_RUN_STATE_KEY, ActoviqAgentsApi, createActoviqRunToolState, createActoviqTaskTool, summarizeActoviqAgentDefinition, } from './actoviqAgents.js';
24
26
  import { getDefaultActoviqAgents } from './defaultActoviqAgents.js';
25
27
  import { loadActoviqAgentDefinitions } from './actoviqAgentDefinitions.js';
26
28
  import { ActoviqSkillsApi, loadActoviqSkillDefinitions, resolveActoviqSkillPrompt, skillPathsMatch, summarizeActoviqSkillDefinition, } from './actoviqSkills.js';
@@ -37,6 +39,8 @@ import { getActoviqCompactBoundarySummary } from '../memory/actoviqMemory.js';
37
39
  import { createActoviqModelApi } from './actoviqModelApi.js';
38
40
  import { createOpenaiModelApi } from '../provider/openai-model-api.js';
39
41
  import { AgentRunStream } from './asyncQueue.js';
42
+ import { SessionTurnCoordinator } from './sessionTurnCoordinator.js';
43
+ import { withDeadline } from './deadline.js';
40
44
  import { executeConversation } from './conversationEngine.js';
41
45
  import { asError, createId, deepClone, isRecord, nowIso, truncateText } from './helpers.js';
42
46
  import { tool } from './tools.js';
@@ -125,7 +129,8 @@ export class AgentSessionsApi {
125
129
  }
126
130
  async continueMostRecent(options = {}) {
127
131
  const sessions = await this.store.list();
128
- const mostRecent = sessions.find(session => session.status !== 'closed') ?? sessions[0];
132
+ const chatSessions = sessions.filter(session => session.kind !== 'manager');
133
+ const mostRecent = chatSessions.find(session => session.status !== 'closed') ?? chatSessions[0];
129
134
  if (!mostRecent) {
130
135
  throw new Error('No stored sessions are available to resume.');
131
136
  }
@@ -369,6 +374,7 @@ export class ActoviqAgentClient {
369
374
  slashCommands;
370
375
  workflow;
371
376
  sessionManager;
377
+ sessionTurnCoordinator = new SessionTurnCoordinator();
372
378
  agentDefinitions;
373
379
  skillDefinitions;
374
380
  /** Names of `paths:`-conditional skills activated by touching matching files. */
@@ -470,6 +476,12 @@ export class ActoviqAgentClient {
470
476
  ...new Set([...(existingDelegationTool.aliases ?? []), 'Agent']),
471
477
  ];
472
478
  }
479
+ if (this.defaultTools.some(tool => tool.name === BASH_TOOL_NAME)) {
480
+ this.replaceDefaultTool(createBashTool({
481
+ backgroundTaskManager: this.backgroundTaskManager,
482
+ onBackgroundTaskSettled: task => this.enqueueTaskNotification(task),
483
+ }));
484
+ }
473
485
  this.replaceDefaultTool(this.createSendMessageTool());
474
486
  this.replaceDefaultTool(this.createBackgroundTaskListTool());
475
487
  this.replaceDefaultTool(this.createBackgroundTaskGetTool());
@@ -530,6 +542,8 @@ export class ActoviqAgentClient {
530
542
  const mcpManager = new McpConnectionManager({
531
543
  name: config.clientName,
532
544
  version: config.clientVersion,
545
+ }, {
546
+ requestTimeoutMs: config.mcpTimeoutMs,
533
547
  });
534
548
  const loadedSkills = await loadActoviqSkillDefinitions({
535
549
  homeDir: config.homeDir,
@@ -577,10 +591,14 @@ export class ActoviqAgentClient {
577
591
  stream(input, options = {}) {
578
592
  const runId = createId();
579
593
  return new AgentRunStream(async (controller) => {
594
+ const runOptions = {
595
+ ...options,
596
+ signal: combineAbortSignals(options.signal, controller.signal),
597
+ };
580
598
  try {
581
- const augmentations = await this.prepareRunAugmentations(runId, input, options);
582
- const result = await this.executeRun(runId, input, options, undefined, true, controller.emit, augmentations);
583
- const hookOutcome = await this.applyPostRunHooks(runId, input, options, result);
599
+ const augmentations = await this.prepareRunAugmentations(runId, input, runOptions);
600
+ const result = await this.executeRun(runId, input, runOptions, undefined, true, controller.emit, augmentations);
601
+ const hookOutcome = await this.applyPostRunHooks(runId, input, runOptions, result);
584
602
  if (hookOutcome.sessionMetadata) {
585
603
  result.sessionHookMetadata = hookOutcome.sessionMetadata;
586
604
  }
@@ -610,7 +628,7 @@ export class ActoviqAgentClient {
610
628
  });
611
629
  throw error;
612
630
  }
613
- });
631
+ }, { signal: options.signal });
614
632
  }
615
633
  async parallel(tasks, options) {
616
634
  return parallel(tasks, options);
@@ -1347,9 +1365,13 @@ export class ActoviqAgentClient {
1347
1365
  return result;
1348
1366
  });
1349
1367
  }
1350
- async runOnSession(session, input, options = {}) {
1368
+ runOnSession(session, input, options = {}) {
1369
+ return this.sessionTurnCoordinator.runExclusive(session.id, () => this.runOnSessionExclusive(session, input, options));
1370
+ }
1371
+ async runOnSessionExclusive(session, input, options) {
1351
1372
  const runId = createId();
1352
- const initialSnapshot = session.snapshot();
1373
+ const initialSnapshot = await this.store.load(session.id);
1374
+ session.replace(initialSnapshot);
1353
1375
  const resolvedOptions = this.applySessionRuntimeOverrides(session.id, this.resolveSessionAgentOptions(initialSnapshot, options));
1354
1376
  const execution = await this.executeSessionRunWithReactiveCompact({
1355
1377
  runId,
@@ -1364,14 +1386,20 @@ export class ActoviqAgentClient {
1364
1386
  }
1365
1387
  await this.persistSessionAfterRun(session, execution.snapshot, input, execution.result, resolvedOptions, execution.augmentations.surfacedMemories, hookOutcome);
1366
1388
  await this.sessionManager.touch(session.id);
1389
+ session.replace(await this.store.load(session.id));
1367
1390
  return execution.result;
1368
1391
  }
1369
1392
  streamOnSession(session, input, options = {}) {
1370
1393
  const runId = createId();
1371
- const initialSnapshot = session.snapshot();
1372
- return new AgentRunStream(async (controller) => {
1394
+ return new AgentRunStream((controller) => this.sessionTurnCoordinator.runExclusive(session.id, async () => {
1395
+ const runOptions = {
1396
+ ...options,
1397
+ signal: combineAbortSignals(options.signal, controller.signal),
1398
+ };
1373
1399
  try {
1374
- const resolvedOptions = this.applySessionRuntimeOverrides(session.id, this.resolveSessionAgentOptions(initialSnapshot, options));
1400
+ const initialSnapshot = await this.store.load(session.id);
1401
+ session.replace(initialSnapshot);
1402
+ const resolvedOptions = this.applySessionRuntimeOverrides(session.id, this.resolveSessionAgentOptions(initialSnapshot, runOptions));
1375
1403
  const execution = await this.executeSessionRunWithReactiveCompact({
1376
1404
  runId,
1377
1405
  session,
@@ -1386,6 +1414,8 @@ export class ActoviqAgentClient {
1386
1414
  execution.result.sessionHookMetadata = hookOutcome.sessionMetadata;
1387
1415
  }
1388
1416
  await this.persistSessionAfterRun(session, execution.snapshot, input, execution.result, resolvedOptions, execution.augmentations.surfacedMemories, hookOutcome);
1417
+ await this.sessionManager.touch(session.id);
1418
+ session.replace(await this.store.load(session.id));
1389
1419
  controller.emit({
1390
1420
  type: 'response.completed',
1391
1421
  runId,
@@ -1408,21 +1438,17 @@ export class ActoviqAgentClient {
1408
1438
  });
1409
1439
  throw error;
1410
1440
  }
1411
- });
1441
+ }), { signal: options.signal });
1412
1442
  }
1413
- async executeRun(runId, input, options, session, streaming = false, emit, augmentations, skipRunStartedEvent = false) {
1443
+ async executeRun(runId, input, options, session, streaming = false, emit, augmentations, skipRunStartedEvent = false, liveSession) {
1414
1444
  const metadata = {
1415
1445
  ...this.config.metadata,
1416
1446
  ...(session?.metadata ?? {}),
1417
1447
  ...(augmentations?.metadata ?? {}),
1418
1448
  ...(options.metadata ?? {}),
1449
+ [ACTOVIQ_RUN_STATE_KEY]: createActoviqRunToolState(),
1419
1450
  };
1420
- // Resolve working directory: sessionWorkDir (from worktree) takes priority
1421
- // unless inheritWorktree is explicitly false.
1422
- const inheritWorktree = options.inheritWorktree !== false;
1423
- const workDir = inheritWorktree
1424
- ? (options.__actoviqWorkDir ?? options.sessionWorkDir ?? options.workDir ?? this.config.workDir)
1425
- : (options.__actoviqWorkDir ?? options.workDir ?? this.config.workDir);
1451
+ const workDir = this.resolveRunWorkDir(options);
1426
1452
  const mergedTools = filterAgentTools(mergeUniqueByName(options.__actoviqUseDefaultTools === false ? [] : this.defaultTools, options.tools ?? []), options.__actoviqAllowedTools, options.__actoviqDisallowedTools);
1427
1453
  // Collect tool prompts for system prompt assembly
1428
1454
  const toolPromptParts = await collectToolPrompts(mergedTools, {
@@ -1440,13 +1466,21 @@ export class ActoviqAgentClient {
1440
1466
  }
1441
1467
  : this.config;
1442
1468
  const notificationKey = session?.id ?? runId;
1443
- const drainQueuedInputs = notificationKey || options.drainQueuedInputs
1469
+ const drainQueuedInputs = notificationKey || options.drainQueuedInputs || liveSession
1444
1470
  ? () => [
1471
+ ...(liveSession?.drainSteeringInputs() ?? []),
1445
1472
  ...(options.drainQueuedInputs?.() ?? []),
1446
1473
  ...this.drainRuntimeNotifications(notificationKey),
1447
1474
  ]
1448
1475
  : undefined;
1449
- return executeConversation({
1476
+ const drainFollowUpInputs = options.drainFollowUpInputs || liveSession
1477
+ ? () => [
1478
+ ...(liveSession?.drainFollowUpInputs() ?? []),
1479
+ ...(options.drainFollowUpInputs?.() ?? []),
1480
+ ]
1481
+ : undefined;
1482
+ let checkpointSession = session ? deepClone(session) : undefined;
1483
+ return withDeadline(`Agent run ${runId}`, runtimeConfig.runTimeoutMs, options.signal, ({ signal }) => executeConversation({
1450
1484
  runId,
1451
1485
  input,
1452
1486
  messages: session?.messages,
@@ -1462,7 +1496,7 @@ export class ActoviqAgentClient {
1462
1496
  toolChoice: options.toolChoice,
1463
1497
  userId: options.userId ?? this.config.userId,
1464
1498
  metadata,
1465
- signal: options.signal,
1499
+ signal,
1466
1500
  permissionMode: options.permissionMode ?? this.defaultPermissionMode,
1467
1501
  permissions: options.permissions ?? this.defaultPermissions,
1468
1502
  classifier: options.classifier ?? this.defaultClassifier,
@@ -1470,19 +1504,37 @@ export class ActoviqAgentClient {
1470
1504
  canUseTool: options.canUseTool,
1471
1505
  hooks: augmentations?.hooks,
1472
1506
  drainQueuedInputs,
1507
+ drainFollowUpInputs,
1473
1508
  streaming,
1474
1509
  // Activate paths-conditional skills when the agent touches matching files.
1475
1510
  emit: (event) => {
1476
1511
  this.activateConditionalSkillsFromEvent(event);
1477
1512
  emit?.(event);
1478
1513
  },
1514
+ onConversationCheckpoint: checkpointSession
1515
+ ? async (messages) => {
1516
+ const snap = deepClone(checkpointSession);
1517
+ snap.messages = deepClone(messages);
1518
+ snap.updatedAt = nowIso();
1519
+ snap.metadata = {
1520
+ ...snap.metadata,
1521
+ __actoviqWorkDir: workDir,
1522
+ ...(options.metadata ?? {}),
1523
+ };
1524
+ await this.store.save(snap);
1525
+ checkpointSession = snap;
1526
+ // Keep the live AgentSession (if any) in sync so a subsequent
1527
+ // persistSessionAfterRun / reactive compact sees the checkpoint.
1528
+ liveSession?.replace(snap);
1529
+ }
1530
+ : undefined,
1479
1531
  skipRunStartedEvent,
1480
1532
  // Per-run model client override (the /model router uses this to route a
1481
1533
  // turn to a different model/provider); falls back to the SDK default.
1482
1534
  modelApi: options.modelApi ?? this.modelApi,
1483
1535
  config: runtimeConfig,
1484
1536
  mcpManager: this.mcpManager,
1485
- }).then(result => ({
1537
+ })).then(result => ({
1486
1538
  ...result,
1487
1539
  surfacedMemories: augmentations?.surfacedMemories.length
1488
1540
  ? deepClone(augmentations.surfacedMemories)
@@ -1499,13 +1551,13 @@ export class ActoviqAgentClient {
1499
1551
  let attempts = 0;
1500
1552
  while (true) {
1501
1553
  try {
1502
- const result = await this.executeRun(args.runId, args.input, args.options, currentSnapshot, args.streaming ?? false, args.emit, currentAugmentations, attempts > 0);
1554
+ const result = await this.executeRun(args.runId, args.input, args.options, currentSnapshot, args.streaming ?? false, args.emit, currentAugmentations, attempts > 0, args.session);
1503
1555
  if (lastReactiveCompact) {
1504
1556
  result.reactiveCompact = lastReactiveCompact;
1505
1557
  }
1506
1558
  return {
1507
1559
  result,
1508
- snapshot: currentSnapshot,
1560
+ snapshot: args.session.snapshot(),
1509
1561
  augmentations: currentAugmentations,
1510
1562
  };
1511
1563
  }
@@ -1559,7 +1611,7 @@ export class ActoviqAgentClient {
1559
1611
  const agentMemoryMessages = session
1560
1612
  ? await this.prepareAgentMemoryMessages(session, internalOptions)
1561
1613
  : [];
1562
- const preloadedSkillMessages = await this.preparePreloadedAgentSkillMessages(internalOptions.__actoviqPreloadedSkills, session?.id, internalOptions.__actoviqWorkDir ?? internalOptions.workDir ?? this.config.workDir);
1614
+ const preloadedSkillMessages = await this.preparePreloadedAgentSkillMessages(internalOptions.__actoviqPreloadedSkills, session?.id, this.resolveRunWorkDir(internalOptions));
1563
1615
  const hooks = mergeActoviqHooks(this.hooks, options.hooks);
1564
1616
  const prefixedMessages = [
1565
1617
  ...notificationMessages,
@@ -1572,15 +1624,15 @@ export class ActoviqAgentClient {
1572
1624
  const systemPromptParts = [];
1573
1625
  const metadata = {};
1574
1626
  for (const hook of resolveActoviqSessionStartHooks(hooks)) {
1575
- const result = await hook({
1627
+ const result = await withDeadline('sessionStart hook', this.config.hookTimeoutMs, options.signal, ({ signal }) => hook({
1576
1628
  runId,
1577
1629
  input,
1578
1630
  promptText,
1579
1631
  sessionId: session?.id,
1580
1632
  session: session ? deepClone(session) : undefined,
1581
- workDir: internalOptions.__actoviqWorkDir ?? internalOptions.workDir ?? this.config.workDir,
1582
- options,
1583
- });
1633
+ workDir: this.resolveRunWorkDir(internalOptions),
1634
+ options: { ...options, signal },
1635
+ }));
1584
1636
  if (!result) {
1585
1637
  continue;
1586
1638
  }
@@ -1640,7 +1692,7 @@ export class ActoviqAgentClient {
1640
1692
  typeof agentName !== 'string') {
1641
1693
  return [];
1642
1694
  }
1643
- const workDir = options.__actoviqWorkDir ?? options.workDir ?? this.config.workDir;
1695
+ const workDir = this.resolveRunWorkDir(options);
1644
1696
  const root = scope === 'user'
1645
1697
  ? path.join(this.config.homeDir, 'agent-memory', agentName)
1646
1698
  : scope === 'project'
@@ -1671,18 +1723,16 @@ export class ActoviqAgentClient {
1671
1723
  const sessionMetadata = {};
1672
1724
  const tags = new Set();
1673
1725
  for (const hook of resolveActoviqPostRunHooks(hooks)) {
1674
- const output = await hook({
1726
+ const output = await withDeadline('postRun hook', this.config.hookTimeoutMs, options.signal, ({ signal }) => hook({
1675
1727
  runId,
1676
1728
  input,
1677
1729
  promptText,
1678
1730
  sessionId: session?.id,
1679
1731
  session: session ? deepClone(session) : undefined,
1680
- workDir: options.__actoviqWorkDir ??
1681
- options.workDir ??
1682
- this.config.workDir,
1683
- options,
1732
+ workDir: this.resolveRunWorkDir(options),
1733
+ options: { ...options, signal },
1684
1734
  result,
1685
- });
1735
+ }));
1686
1736
  if (!output) {
1687
1737
  continue;
1688
1738
  }
@@ -1855,7 +1905,7 @@ export class ActoviqAgentClient {
1855
1905
  force: true,
1856
1906
  trigger: 'reactive',
1857
1907
  }, {
1858
- workDir: this.config.workDir,
1908
+ workDir: this.resolveRunWorkDir(options),
1859
1909
  systemPrompt: snapshot.systemPrompt ?? this.config.systemPrompt,
1860
1910
  model: this.resolveModel(options.model ?? snapshot.model),
1861
1911
  modelApi: this.modelApi,
@@ -2454,6 +2504,7 @@ export class ActoviqAgentClient {
2454
2504
  return extraction;
2455
2505
  }
2456
2506
  async persistSessionAfterRun(session, snapshot, input, result, options, surfacedMemories = [], hookOutcome = {}) {
2507
+ const workDir = this.resolveRunWorkDir(options);
2457
2508
  const next = deepClone(snapshot);
2458
2509
  next.model = result.model;
2459
2510
  next.systemPrompt = options.systemPrompt ?? next.systemPrompt;
@@ -2462,7 +2513,7 @@ export class ActoviqAgentClient {
2462
2513
  next.lastRunAt = result.completedAt;
2463
2514
  next.metadata = {
2464
2515
  ...next.metadata,
2465
- __actoviqWorkDir: this.config.workDir,
2516
+ __actoviqWorkDir: workDir,
2466
2517
  ...(options.metadata ?? {}),
2467
2518
  ...(hookOutcome.sessionMetadata ?? {}),
2468
2519
  };
@@ -2559,7 +2610,7 @@ export class ActoviqAgentClient {
2559
2610
  const newMessages = next.messages.slice(prevMessageCount);
2560
2611
  if (newMessages.length > 0) {
2561
2612
  const paths = await this.memory.paths();
2562
- await appendMessagesToTranscript(paths.projectStateDir, session.id, this.config.workDir, newMessages);
2613
+ await appendMessagesToTranscript(paths.projectStateDir, session.id, workDir, newMessages);
2563
2614
  }
2564
2615
  const extraction = await this.performSessionMemoryExtraction(next, {
2565
2616
  model: this.resolveModel(options.model ?? next.model),
@@ -2570,7 +2621,7 @@ export class ActoviqAgentClient {
2570
2621
  });
2571
2622
  await this.applySessionMemoryState(session, next, extraction.state);
2572
2623
  const compacted = await compactActoviqSession(next, { trigger: 'auto' }, {
2573
- workDir: this.config.workDir,
2624
+ workDir,
2574
2625
  systemPrompt: next.systemPrompt ?? this.config.systemPrompt,
2575
2626
  model: this.resolveModel(options.model ?? next.model),
2576
2627
  modelApi: this.modelApi,
@@ -2608,14 +2659,33 @@ export class ActoviqAgentClient {
2608
2659
  }
2609
2660
  return cloneSkillDefinition(definition);
2610
2661
  }
2662
+ resolveRunWorkDir(options) {
2663
+ const internal = options;
2664
+ if (options.inheritWorktree === false) {
2665
+ return internal.__actoviqWorkDir ?? options.workDir ?? this.config.workDir;
2666
+ }
2667
+ return (internal.__actoviqWorkDir ??
2668
+ options.sessionWorkDir ??
2669
+ options.workDir ??
2670
+ internal.__actoviqPersistedWorkDir ??
2671
+ this.config.workDir);
2672
+ }
2611
2673
  resolveSessionAgentOptions(session, options) {
2674
+ const persistedWorkDir = typeof session.metadata.__actoviqWorkDir === 'string' &&
2675
+ session.metadata.__actoviqWorkDir.trim().length > 0
2676
+ ? session.metadata.__actoviqWorkDir
2677
+ : undefined;
2678
+ const sessionOptions = {
2679
+ ...options,
2680
+ __actoviqPersistedWorkDir: persistedWorkDir,
2681
+ };
2612
2682
  const agentName = typeof session.metadata.__actoviqAgentDefinition === 'string'
2613
2683
  ? session.metadata.__actoviqAgentDefinition
2614
2684
  : undefined;
2615
2685
  if (!agentName) {
2616
- return options;
2686
+ return sessionOptions;
2617
2687
  }
2618
- return this.mergeAgentRunOptions(this.requireAgentDefinition(agentName), options);
2688
+ return this.mergeAgentRunOptions(this.requireAgentDefinition(agentName), sessionOptions);
2619
2689
  }
2620
2690
  mergeAgentRunOptions(definition, options) {
2621
2691
  const availableMcpServers = new Set([
@@ -2687,6 +2757,7 @@ export class ActoviqAgentClient {
2687
2757
  }
2688
2758
  }
2689
2759
  export async function createAgentSdk(options = {}) {
2760
+ recordCompatUsage('createAgentSdk');
2690
2761
  return ActoviqAgentClient.create(options);
2691
2762
  }
2692
2763
  function resolveTaskId(input) {
@@ -2725,6 +2796,14 @@ function joinPromptParts(...parts) {
2725
2796
  }
2726
2797
  return normalized.join('\n\n');
2727
2798
  }
2799
+ function combineAbortSignals(...signals) {
2800
+ const available = signals.filter((signal) => signal != null);
2801
+ if (available.length === 0)
2802
+ return undefined;
2803
+ if (available.length === 1)
2804
+ return available[0];
2805
+ return AbortSignal.any(available);
2806
+ }
2728
2807
  function mergeAgentDefinitions(...groups) {
2729
2808
  const merged = new Map();
2730
2809
  for (const group of groups) {
@@ -2749,6 +2828,9 @@ function formatTaskNotification(task) {
2749
2828
  const result = task.status === 'completed'
2750
2829
  ? task.text ?? task.partialText ?? ''
2751
2830
  : task.partialText ?? '';
2831
+ const actor = task.subagentType === 'bash'
2832
+ ? `Background command "${task.description}"`
2833
+ : `Agent "${task.agentName ?? task.subagentType}"`;
2752
2834
  return [
2753
2835
  '<task_notification>',
2754
2836
  `<task_id>${escapeXml(task.id)}</task_id>`,
@@ -2756,8 +2838,8 @@ function formatTaskNotification(task) {
2756
2838
  task.agentName ? `<agent_name>${escapeXml(task.agentName)}</agent_name>` : undefined,
2757
2839
  `<status>${task.status}</status>`,
2758
2840
  `<summary>${escapeXml(task.status === 'completed'
2759
- ? `Agent "${task.agentName ?? task.subagentType}" completed.`
2760
- : `Agent "${task.agentName ?? task.subagentType}" ${task.status}.`)}</summary>`,
2841
+ ? `${actor} completed.`
2842
+ : `${actor} ${task.status}.`)}</summary>`,
2761
2843
  result ? `<result>${escapeXml(result)}</result>` : undefined,
2762
2844
  task.error ? `<error>${escapeXml(task.error)}</error>` : undefined,
2763
2845
  `<usage><requests>${task.requestCount ?? 0}</requests><tool_uses>${task.toolCallCount ?? 0}</tool_uses><tool_errors>${task.toolErrorCount ?? 0}</tool_errors></usage>`,