@hansjm10/volt-coding-agent 0.0.0-bootstrap.0 → 0.1.0

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 (1364) hide show
  1. package/BINARY-CAPABILITIES.md +28 -0
  2. package/CHANGELOG.md +4845 -0
  3. package/LICENSE +1 -1
  4. package/README.md +716 -3
  5. package/THIRD-PARTY-NOTICES.md +55 -0
  6. package/dist/LICENSES/clipboard-image-MIT.txt +9 -0
  7. package/dist/LICENSES/highlight.js-10.7.3-BSD-3-Clause.txt +29 -0
  8. package/dist/LICENSES/highlight.js-11.9.0-BSD-3-Clause.txt +29 -0
  9. package/dist/LICENSES/marked-18.0.5-LICENSE.txt +44 -0
  10. package/dist/LICENSES/run-jxa-MIT.txt +9 -0
  11. package/dist/cli/args.d.ts +60 -0
  12. package/dist/cli/args.d.ts.map +1 -0
  13. package/dist/cli/args.js +414 -0
  14. package/dist/cli/args.js.map +1 -0
  15. package/dist/cli/config-selector.d.ts +14 -0
  16. package/dist/cli/config-selector.d.ts.map +1 -0
  17. package/dist/cli/config-selector.js +31 -0
  18. package/dist/cli/config-selector.js.map +1 -0
  19. package/dist/cli/file-processor.d.ts +15 -0
  20. package/dist/cli/file-processor.d.ts.map +1 -0
  21. package/dist/cli/file-processor.js +85 -0
  22. package/dist/cli/file-processor.js.map +1 -0
  23. package/dist/cli/initial-message.d.ts +18 -0
  24. package/dist/cli/initial-message.d.ts.map +1 -0
  25. package/dist/cli/initial-message.js +22 -0
  26. package/dist/cli/initial-message.js.map +1 -0
  27. package/dist/cli/list-models.d.ts +9 -0
  28. package/dist/cli/list-models.d.ts.map +1 -0
  29. package/dist/cli/list-models.js +98 -0
  30. package/dist/cli/list-models.js.map +1 -0
  31. package/dist/cli/project-trust.d.ts +10 -0
  32. package/dist/cli/project-trust.d.ts.map +1 -0
  33. package/dist/cli/project-trust.js +48 -0
  34. package/dist/cli/project-trust.js.map +1 -0
  35. package/dist/cli/session-picker.d.ts +9 -0
  36. package/dist/cli/session-picker.d.ts.map +1 -0
  37. package/dist/cli/session-picker.js +35 -0
  38. package/dist/cli/session-picker.js.map +1 -0
  39. package/dist/cli/startup-ui.d.ts +17 -0
  40. package/dist/cli/startup-ui.d.ts.map +1 -0
  41. package/dist/cli/startup-ui.js +133 -0
  42. package/dist/cli/startup-ui.js.map +1 -0
  43. package/dist/cli.d.ts +3 -0
  44. package/dist/cli.d.ts.map +1 -0
  45. package/dist/cli.js +18 -0
  46. package/dist/cli.js.map +1 -0
  47. package/dist/config.d.ts +85 -0
  48. package/dist/config.d.ts.map +1 -0
  49. package/dist/config.js +487 -0
  50. package/dist/config.js.map +1 -0
  51. package/dist/core/agent-session-runtime.d.ts +160 -0
  52. package/dist/core/agent-session-runtime.d.ts.map +1 -0
  53. package/dist/core/agent-session-runtime.js +397 -0
  54. package/dist/core/agent-session-runtime.js.map +1 -0
  55. package/dist/core/agent-session-services.d.ts +98 -0
  56. package/dist/core/agent-session-services.d.ts.map +1 -0
  57. package/dist/core/agent-session-services.js +125 -0
  58. package/dist/core/agent-session-services.js.map +1 -0
  59. package/dist/core/agent-session.d.ts +739 -0
  60. package/dist/core/agent-session.d.ts.map +1 -0
  61. package/dist/core/agent-session.js +3158 -0
  62. package/dist/core/agent-session.js.map +1 -0
  63. package/dist/core/auth-guidance.d.ts +5 -0
  64. package/dist/core/auth-guidance.d.ts.map +1 -0
  65. package/dist/core/auth-guidance.js +21 -0
  66. package/dist/core/auth-guidance.js.map +1 -0
  67. package/dist/core/auth-storage.d.ts +159 -0
  68. package/dist/core/auth-storage.d.ts.map +1 -0
  69. package/dist/core/auth-storage.js +509 -0
  70. package/dist/core/auth-storage.js.map +1 -0
  71. package/dist/core/bash-executor.d.ts +32 -0
  72. package/dist/core/bash-executor.d.ts.map +1 -0
  73. package/dist/core/bash-executor.js +111 -0
  74. package/dist/core/bash-executor.js.map +1 -0
  75. package/dist/core/compaction/branch-summarization.d.ts +92 -0
  76. package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  77. package/dist/core/compaction/branch-summarization.js +257 -0
  78. package/dist/core/compaction/branch-summarization.js.map +1 -0
  79. package/dist/core/compaction/compaction.d.ts +121 -0
  80. package/dist/core/compaction/compaction.d.ts.map +1 -0
  81. package/dist/core/compaction/compaction.js +658 -0
  82. package/dist/core/compaction/compaction.js.map +1 -0
  83. package/dist/core/compaction/index.d.ts +7 -0
  84. package/dist/core/compaction/index.d.ts.map +1 -0
  85. package/dist/core/compaction/index.js +7 -0
  86. package/dist/core/compaction/index.js.map +1 -0
  87. package/dist/core/compaction/utils.d.ts +56 -0
  88. package/dist/core/compaction/utils.d.ts.map +1 -0
  89. package/dist/core/compaction/utils.js +271 -0
  90. package/dist/core/compaction/utils.js.map +1 -0
  91. package/dist/core/defaults.d.ts +3 -0
  92. package/dist/core/defaults.d.ts.map +1 -0
  93. package/dist/core/defaults.js +2 -0
  94. package/dist/core/defaults.js.map +1 -0
  95. package/dist/core/diagnostics.d.ts +15 -0
  96. package/dist/core/diagnostics.d.ts.map +1 -0
  97. package/dist/core/diagnostics.js +2 -0
  98. package/dist/core/diagnostics.js.map +1 -0
  99. package/dist/core/event-bus.d.ts +9 -0
  100. package/dist/core/event-bus.d.ts.map +1 -0
  101. package/dist/core/event-bus.js +25 -0
  102. package/dist/core/event-bus.js.map +1 -0
  103. package/dist/core/exec.d.ts +29 -0
  104. package/dist/core/exec.d.ts.map +1 -0
  105. package/dist/core/exec.js +75 -0
  106. package/dist/core/exec.js.map +1 -0
  107. package/dist/core/experimental.d.ts +2 -0
  108. package/dist/core/experimental.d.ts.map +1 -0
  109. package/dist/core/experimental.js +4 -0
  110. package/dist/core/experimental.js.map +1 -0
  111. package/dist/core/export-html/ansi-to-html.d.ts +22 -0
  112. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  113. package/dist/core/export-html/ansi-to-html.js +249 -0
  114. package/dist/core/export-html/ansi-to-html.js.map +1 -0
  115. package/dist/core/export-html/index.d.ts +37 -0
  116. package/dist/core/export-html/index.d.ts.map +1 -0
  117. package/dist/core/export-html/index.js +234 -0
  118. package/dist/core/export-html/index.js.map +1 -0
  119. package/dist/core/export-html/template.css +1066 -0
  120. package/dist/core/export-html/template.html +55 -0
  121. package/dist/core/export-html/template.js +1864 -0
  122. package/dist/core/export-html/tool-renderer.d.ts +34 -0
  123. package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  124. package/dist/core/export-html/tool-renderer.js +108 -0
  125. package/dist/core/export-html/tool-renderer.js.map +1 -0
  126. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  127. package/dist/core/export-html/vendor/marked.min.js +78 -0
  128. package/dist/core/extensions/index.d.ts +12 -0
  129. package/dist/core/extensions/index.d.ts.map +1 -0
  130. package/dist/core/extensions/index.js +9 -0
  131. package/dist/core/extensions/index.js.map +1 -0
  132. package/dist/core/extensions/loader.d.ts +25 -0
  133. package/dist/core/extensions/loader.d.ts.map +1 -0
  134. package/dist/core/extensions/loader.js +516 -0
  135. package/dist/core/extensions/loader.js.map +1 -0
  136. package/dist/core/extensions/runner.d.ts +180 -0
  137. package/dist/core/extensions/runner.d.ts.map +1 -0
  138. package/dist/core/extensions/runner.js +938 -0
  139. package/dist/core/extensions/runner.js.map +1 -0
  140. package/dist/core/extensions/types.d.ts +1215 -0
  141. package/dist/core/extensions/types.d.ts.map +1 -0
  142. package/dist/core/extensions/types.js +48 -0
  143. package/dist/core/extensions/types.js.map +1 -0
  144. package/dist/core/extensions/wrapper.d.ts +20 -0
  145. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  146. package/dist/core/extensions/wrapper.js +22 -0
  147. package/dist/core/extensions/wrapper.js.map +1 -0
  148. package/dist/core/footer-data-provider.d.ts +54 -0
  149. package/dist/core/footer-data-provider.d.ts.map +1 -0
  150. package/dist/core/footer-data-provider.js +338 -0
  151. package/dist/core/footer-data-provider.js.map +1 -0
  152. package/dist/core/host-actions.d.ts +107 -0
  153. package/dist/core/host-actions.d.ts.map +1 -0
  154. package/dist/core/host-actions.js +632 -0
  155. package/dist/core/host-actions.js.map +1 -0
  156. package/dist/core/host-interaction.d.ts +35 -0
  157. package/dist/core/host-interaction.d.ts.map +1 -0
  158. package/dist/core/host-interaction.js +2 -0
  159. package/dist/core/host-interaction.js.map +1 -0
  160. package/dist/core/http-dispatcher.d.ts +22 -0
  161. package/dist/core/http-dispatcher.d.ts.map +1 -0
  162. package/dist/core/http-dispatcher.js +64 -0
  163. package/dist/core/http-dispatcher.js.map +1 -0
  164. package/dist/core/index.d.ts +18 -0
  165. package/dist/core/index.d.ts.map +1 -0
  166. package/dist/core/index.js +17 -0
  167. package/dist/core/index.js.map +1 -0
  168. package/dist/core/keybindings.d.ts +373 -0
  169. package/dist/core/keybindings.d.ts.map +1 -0
  170. package/dist/core/keybindings.js +303 -0
  171. package/dist/core/keybindings.js.map +1 -0
  172. package/dist/core/lsp/client.d.ts +119 -0
  173. package/dist/core/lsp/client.d.ts.map +1 -0
  174. package/dist/core/lsp/client.js +711 -0
  175. package/dist/core/lsp/client.js.map +1 -0
  176. package/dist/core/lsp/config.d.ts +96 -0
  177. package/dist/core/lsp/config.d.ts.map +1 -0
  178. package/dist/core/lsp/config.js +206 -0
  179. package/dist/core/lsp/config.js.map +1 -0
  180. package/dist/core/lsp/index.d.ts +6 -0
  181. package/dist/core/lsp/index.d.ts.map +1 -0
  182. package/dist/core/lsp/index.js +6 -0
  183. package/dist/core/lsp/index.js.map +1 -0
  184. package/dist/core/lsp/manager.d.ts +122 -0
  185. package/dist/core/lsp/manager.d.ts.map +1 -0
  186. package/dist/core/lsp/manager.js +1136 -0
  187. package/dist/core/lsp/manager.js.map +1 -0
  188. package/dist/core/lsp/trace.d.ts +26 -0
  189. package/dist/core/lsp/trace.d.ts.map +1 -0
  190. package/dist/core/lsp/trace.js +98 -0
  191. package/dist/core/lsp/trace.js.map +1 -0
  192. package/dist/core/lsp/workspace-edit.d.ts +60 -0
  193. package/dist/core/lsp/workspace-edit.d.ts.map +1 -0
  194. package/dist/core/lsp/workspace-edit.js +71 -0
  195. package/dist/core/lsp/workspace-edit.js.map +1 -0
  196. package/dist/core/mcp/audit.d.ts +39 -0
  197. package/dist/core/mcp/audit.d.ts.map +1 -0
  198. package/dist/core/mcp/audit.js +35 -0
  199. package/dist/core/mcp/audit.js.map +1 -0
  200. package/dist/core/mcp/auth.d.ts +7 -0
  201. package/dist/core/mcp/auth.d.ts.map +1 -0
  202. package/dist/core/mcp/auth.js +56 -0
  203. package/dist/core/mcp/auth.js.map +1 -0
  204. package/dist/core/mcp/client-factory.d.ts +20 -0
  205. package/dist/core/mcp/client-factory.d.ts.map +1 -0
  206. package/dist/core/mcp/client-factory.js +200 -0
  207. package/dist/core/mcp/client-factory.js.map +1 -0
  208. package/dist/core/mcp/config-loader.d.ts +9 -0
  209. package/dist/core/mcp/config-loader.d.ts.map +1 -0
  210. package/dist/core/mcp/config-loader.js +104 -0
  211. package/dist/core/mcp/config-loader.js.map +1 -0
  212. package/dist/core/mcp/config-writer.d.ts +21 -0
  213. package/dist/core/mcp/config-writer.d.ts.map +1 -0
  214. package/dist/core/mcp/config-writer.js +124 -0
  215. package/dist/core/mcp/config-writer.js.map +1 -0
  216. package/dist/core/mcp/config.d.ts +32 -0
  217. package/dist/core/mcp/config.d.ts.map +1 -0
  218. package/dist/core/mcp/config.js +385 -0
  219. package/dist/core/mcp/config.js.map +1 -0
  220. package/dist/core/mcp/direct-tools.d.ts +11 -0
  221. package/dist/core/mcp/direct-tools.d.ts.map +1 -0
  222. package/dist/core/mcp/direct-tools.js +47 -0
  223. package/dist/core/mcp/direct-tools.js.map +1 -0
  224. package/dist/core/mcp/gateway-tool.d.ts +29 -0
  225. package/dist/core/mcp/gateway-tool.d.ts.map +1 -0
  226. package/dist/core/mcp/gateway-tool.js +108 -0
  227. package/dist/core/mcp/gateway-tool.js.map +1 -0
  228. package/dist/core/mcp/index.d.ts +19 -0
  229. package/dist/core/mcp/index.d.ts.map +1 -0
  230. package/dist/core/mcp/index.js +18 -0
  231. package/dist/core/mcp/index.js.map +1 -0
  232. package/dist/core/mcp/manager.d.ts +117 -0
  233. package/dist/core/mcp/manager.d.ts.map +1 -0
  234. package/dist/core/mcp/manager.js +819 -0
  235. package/dist/core/mcp/manager.js.map +1 -0
  236. package/dist/core/mcp/metadata-cache.d.ts +27 -0
  237. package/dist/core/mcp/metadata-cache.d.ts.map +1 -0
  238. package/dist/core/mcp/metadata-cache.js +152 -0
  239. package/dist/core/mcp/metadata-cache.js.map +1 -0
  240. package/dist/core/mcp/oauth-flow.d.ts +94 -0
  241. package/dist/core/mcp/oauth-flow.d.ts.map +1 -0
  242. package/dist/core/mcp/oauth-flow.js +473 -0
  243. package/dist/core/mcp/oauth-flow.js.map +1 -0
  244. package/dist/core/mcp/oauth-provider.d.ts +39 -0
  245. package/dist/core/mcp/oauth-provider.d.ts.map +1 -0
  246. package/dist/core/mcp/oauth-provider.js +149 -0
  247. package/dist/core/mcp/oauth-provider.js.map +1 -0
  248. package/dist/core/mcp/oauth-store.d.ts +27 -0
  249. package/dist/core/mcp/oauth-store.d.ts.map +1 -0
  250. package/dist/core/mcp/oauth-store.js +111 -0
  251. package/dist/core/mcp/oauth-store.js.map +1 -0
  252. package/dist/core/mcp/output-store.d.ts +55 -0
  253. package/dist/core/mcp/output-store.d.ts.map +1 -0
  254. package/dist/core/mcp/output-store.js +206 -0
  255. package/dist/core/mcp/output-store.js.map +1 -0
  256. package/dist/core/mcp/rpc.d.ts +13 -0
  257. package/dist/core/mcp/rpc.d.ts.map +1 -0
  258. package/dist/core/mcp/rpc.js +29 -0
  259. package/dist/core/mcp/rpc.js.map +1 -0
  260. package/dist/core/mcp/safety.d.ts +6 -0
  261. package/dist/core/mcp/safety.d.ts.map +1 -0
  262. package/dist/core/mcp/safety.js +65 -0
  263. package/dist/core/mcp/safety.js.map +1 -0
  264. package/dist/core/mcp/search.d.ts +8 -0
  265. package/dist/core/mcp/search.d.ts.map +1 -0
  266. package/dist/core/mcp/search.js +85 -0
  267. package/dist/core/mcp/search.js.map +1 -0
  268. package/dist/core/mcp/server-supervisor.d.ts +59 -0
  269. package/dist/core/mcp/server-supervisor.d.ts.map +1 -0
  270. package/dist/core/mcp/server-supervisor.js +331 -0
  271. package/dist/core/mcp/server-supervisor.js.map +1 -0
  272. package/dist/core/mcp/types.d.ts +321 -0
  273. package/dist/core/mcp/types.d.ts.map +1 -0
  274. package/dist/core/mcp/types.js +2 -0
  275. package/dist/core/mcp/types.js.map +1 -0
  276. package/dist/core/messages.d.ts +78 -0
  277. package/dist/core/messages.d.ts.map +1 -0
  278. package/dist/core/messages.js +138 -0
  279. package/dist/core/messages.js.map +1 -0
  280. package/dist/core/model-catalog-watcher.d.ts +36 -0
  281. package/dist/core/model-catalog-watcher.d.ts.map +1 -0
  282. package/dist/core/model-catalog-watcher.js +101 -0
  283. package/dist/core/model-catalog-watcher.js.map +1 -0
  284. package/dist/core/model-registry.d.ts +160 -0
  285. package/dist/core/model-registry.d.ts.map +1 -0
  286. package/dist/core/model-registry.js +754 -0
  287. package/dist/core/model-registry.js.map +1 -0
  288. package/dist/core/model-resolver.d.ts +111 -0
  289. package/dist/core/model-resolver.d.ts.map +1 -0
  290. package/dist/core/model-resolver.js +534 -0
  291. package/dist/core/model-resolver.js.map +1 -0
  292. package/dist/core/output-guard.d.ts +7 -0
  293. package/dist/core/output-guard.d.ts.map +1 -0
  294. package/dist/core/output-guard.js +89 -0
  295. package/dist/core/output-guard.js.map +1 -0
  296. package/dist/core/package-manager.d.ts +220 -0
  297. package/dist/core/package-manager.d.ts.map +1 -0
  298. package/dist/core/package-manager.js +2217 -0
  299. package/dist/core/package-manager.js.map +1 -0
  300. package/dist/core/project-trust.d.ts +15 -0
  301. package/dist/core/project-trust.d.ts.map +1 -0
  302. package/dist/core/project-trust.js +58 -0
  303. package/dist/core/project-trust.js.map +1 -0
  304. package/dist/core/prompt-templates.d.ts +53 -0
  305. package/dist/core/prompt-templates.d.ts.map +1 -0
  306. package/dist/core/prompt-templates.js +236 -0
  307. package/dist/core/prompt-templates.js.map +1 -0
  308. package/dist/core/provider-attribution.d.ts +4 -0
  309. package/dist/core/provider-attribution.d.ts.map +1 -0
  310. package/dist/core/provider-attribution.js +81 -0
  311. package/dist/core/provider-attribution.js.map +1 -0
  312. package/dist/core/provider-display-names.d.ts +2 -0
  313. package/dist/core/provider-display-names.d.ts.map +1 -0
  314. package/dist/core/provider-display-names.js +36 -0
  315. package/dist/core/provider-display-names.js.map +1 -0
  316. package/dist/core/remote/iroh/access-grant.d.ts +40 -0
  317. package/dist/core/remote/iroh/access-grant.d.ts.map +1 -0
  318. package/dist/core/remote/iroh/access-grant.js +199 -0
  319. package/dist/core/remote/iroh/access-grant.js.map +1 -0
  320. package/dist/core/remote/iroh/active-stream-registry.d.ts +39 -0
  321. package/dist/core/remote/iroh/active-stream-registry.d.ts.map +1 -0
  322. package/dist/core/remote/iroh/active-stream-registry.js +109 -0
  323. package/dist/core/remote/iroh/active-stream-registry.js.map +1 -0
  324. package/dist/core/remote/iroh/audit.d.ts +67 -0
  325. package/dist/core/remote/iroh/audit.d.ts.map +1 -0
  326. package/dist/core/remote/iroh/audit.js +274 -0
  327. package/dist/core/remote/iroh/audit.js.map +1 -0
  328. package/dist/core/remote/iroh/authorization.d.ts +46 -0
  329. package/dist/core/remote/iroh/authorization.d.ts.map +1 -0
  330. package/dist/core/remote/iroh/authorization.js +327 -0
  331. package/dist/core/remote/iroh/authorization.js.map +1 -0
  332. package/dist/core/remote/iroh/control.d.ts +64 -0
  333. package/dist/core/remote/iroh/control.d.ts.map +1 -0
  334. package/dist/core/remote/iroh/control.js +326 -0
  335. package/dist/core/remote/iroh/control.js.map +1 -0
  336. package/dist/core/remote/iroh/device-log-rpc.d.ts +22 -0
  337. package/dist/core/remote/iroh/device-log-rpc.d.ts.map +1 -0
  338. package/dist/core/remote/iroh/device-log-rpc.js +152 -0
  339. package/dist/core/remote/iroh/device-log-rpc.js.map +1 -0
  340. package/dist/core/remote/iroh/engine.d.ts +148 -0
  341. package/dist/core/remote/iroh/engine.d.ts.map +1 -0
  342. package/dist/core/remote/iroh/engine.js +499 -0
  343. package/dist/core/remote/iroh/engine.js.map +1 -0
  344. package/dist/core/remote/iroh/handshake-reader.d.ts +19 -0
  345. package/dist/core/remote/iroh/handshake-reader.d.ts.map +1 -0
  346. package/dist/core/remote/iroh/handshake-reader.js +91 -0
  347. package/dist/core/remote/iroh/handshake-reader.js.map +1 -0
  348. package/dist/core/remote/iroh/handshake.d.ts +119 -0
  349. package/dist/core/remote/iroh/handshake.d.ts.map +1 -0
  350. package/dist/core/remote/iroh/handshake.js +621 -0
  351. package/dist/core/remote/iroh/handshake.js.map +1 -0
  352. package/dist/core/remote/iroh/host-policy.d.ts +13 -0
  353. package/dist/core/remote/iroh/host-policy.d.ts.map +1 -0
  354. package/dist/core/remote/iroh/host-policy.js +15 -0
  355. package/dist/core/remote/iroh/host-policy.js.map +1 -0
  356. package/dist/core/remote/iroh/index.d.ts +25 -0
  357. package/dist/core/remote/iroh/index.d.ts.map +1 -0
  358. package/dist/core/remote/iroh/index.js +25 -0
  359. package/dist/core/remote/iroh/index.js.map +1 -0
  360. package/dist/core/remote/iroh/metadata.d.ts +28 -0
  361. package/dist/core/remote/iroh/metadata.d.ts.map +1 -0
  362. package/dist/core/remote/iroh/metadata.js +16 -0
  363. package/dist/core/remote/iroh/metadata.js.map +1 -0
  364. package/dist/core/remote/iroh/outbound-filter.d.ts +29 -0
  365. package/dist/core/remote/iroh/outbound-filter.d.ts.map +1 -0
  366. package/dist/core/remote/iroh/outbound-filter.js +692 -0
  367. package/dist/core/remote/iroh/outbound-filter.js.map +1 -0
  368. package/dist/core/remote/iroh/protocol.d.ts +60 -0
  369. package/dist/core/remote/iroh/protocol.d.ts.map +1 -0
  370. package/dist/core/remote/iroh/protocol.js +204 -0
  371. package/dist/core/remote/iroh/protocol.js.map +1 -0
  372. package/dist/core/remote/iroh/push.d.ts +179 -0
  373. package/dist/core/remote/iroh/push.d.ts.map +1 -0
  374. package/dist/core/remote/iroh/push.js +662 -0
  375. package/dist/core/remote/iroh/push.js.map +1 -0
  376. package/dist/core/remote/iroh/qr.d.ts +12 -0
  377. package/dist/core/remote/iroh/qr.d.ts.map +1 -0
  378. package/dist/core/remote/iroh/qr.js +27 -0
  379. package/dist/core/remote/iroh/qr.js.map +1 -0
  380. package/dist/core/remote/iroh/rpc-command-filter.d.ts +47 -0
  381. package/dist/core/remote/iroh/rpc-command-filter.d.ts.map +1 -0
  382. package/dist/core/remote/iroh/rpc-command-filter.js +188 -0
  383. package/dist/core/remote/iroh/rpc-command-filter.js.map +1 -0
  384. package/dist/core/remote/iroh/rpc-transport.d.ts +21 -0
  385. package/dist/core/remote/iroh/rpc-transport.d.ts.map +1 -0
  386. package/dist/core/remote/iroh/rpc-transport.js +106 -0
  387. package/dist/core/remote/iroh/rpc-transport.js.map +1 -0
  388. package/dist/core/remote/iroh/state-manager.d.ts +141 -0
  389. package/dist/core/remote/iroh/state-manager.d.ts.map +1 -0
  390. package/dist/core/remote/iroh/state-manager.js +744 -0
  391. package/dist/core/remote/iroh/state-manager.js.map +1 -0
  392. package/dist/core/remote/iroh/state.d.ts +141 -0
  393. package/dist/core/remote/iroh/state.d.ts.map +1 -0
  394. package/dist/core/remote/iroh/state.js +433 -0
  395. package/dist/core/remote/iroh/state.js.map +1 -0
  396. package/dist/core/remote/iroh/ticket.d.ts +46 -0
  397. package/dist/core/remote/iroh/ticket.d.ts.map +1 -0
  398. package/dist/core/remote/iroh/ticket.js +267 -0
  399. package/dist/core/remote/iroh/ticket.js.map +1 -0
  400. package/dist/core/remote/iroh/transcript-text.d.ts +8 -0
  401. package/dist/core/remote/iroh/transcript-text.d.ts.map +1 -0
  402. package/dist/core/remote/iroh/transcript-text.js +26 -0
  403. package/dist/core/remote/iroh/transcript-text.js.map +1 -0
  404. package/dist/core/remote/iroh/workspace-rpc.d.ts +31 -0
  405. package/dist/core/remote/iroh/workspace-rpc.d.ts.map +1 -0
  406. package/dist/core/remote/iroh/workspace-rpc.js +73 -0
  407. package/dist/core/remote/iroh/workspace-rpc.js.map +1 -0
  408. package/dist/core/remote/iroh/workspace.d.ts +16 -0
  409. package/dist/core/remote/iroh/workspace.d.ts.map +1 -0
  410. package/dist/core/remote/iroh/workspace.js +104 -0
  411. package/dist/core/remote/iroh/workspace.js.map +1 -0
  412. package/dist/core/remote/iroh/worktree-rpc.d.ts +83 -0
  413. package/dist/core/remote/iroh/worktree-rpc.d.ts.map +1 -0
  414. package/dist/core/remote/iroh/worktree-rpc.js +148 -0
  415. package/dist/core/remote/iroh/worktree-rpc.js.map +1 -0
  416. package/dist/core/resolve-config-value.d.ts +30 -0
  417. package/dist/core/resolve-config-value.d.ts.map +1 -0
  418. package/dist/core/resolve-config-value.js +245 -0
  419. package/dist/core/resolve-config-value.js.map +1 -0
  420. package/dist/core/resource-loader.d.ts +214 -0
  421. package/dist/core/resource-loader.d.ts.map +1 -0
  422. package/dist/core/resource-loader.js +824 -0
  423. package/dist/core/resource-loader.js.map +1 -0
  424. package/dist/core/review.d.ts +318 -0
  425. package/dist/core/review.d.ts.map +1 -0
  426. package/dist/core/review.js +1271 -0
  427. package/dist/core/review.js.map +1 -0
  428. package/dist/core/rpc/duplex-write-gate.d.ts +29 -0
  429. package/dist/core/rpc/duplex-write-gate.d.ts.map +1 -0
  430. package/dist/core/rpc/duplex-write-gate.js +124 -0
  431. package/dist/core/rpc/duplex-write-gate.js.map +1 -0
  432. package/dist/core/rpc/index.d.ts +6 -0
  433. package/dist/core/rpc/index.d.ts.map +1 -0
  434. package/dist/core/rpc/index.js +5 -0
  435. package/dist/core/rpc/index.js.map +1 -0
  436. package/dist/core/rpc/iroh-transport.d.ts +58 -0
  437. package/dist/core/rpc/iroh-transport.d.ts.map +1 -0
  438. package/dist/core/rpc/iroh-transport.js +278 -0
  439. package/dist/core/rpc/iroh-transport.js.map +1 -0
  440. package/dist/core/rpc/jsonl.d.ts +17 -0
  441. package/dist/core/rpc/jsonl.d.ts.map +1 -0
  442. package/dist/core/rpc/jsonl.js +49 -0
  443. package/dist/core/rpc/jsonl.js.map +1 -0
  444. package/dist/core/rpc/loopback-transport.d.ts +14 -0
  445. package/dist/core/rpc/loopback-transport.d.ts.map +1 -0
  446. package/dist/core/rpc/loopback-transport.js +120 -0
  447. package/dist/core/rpc/loopback-transport.js.map +1 -0
  448. package/dist/core/rpc/transcript.d.ts +37 -0
  449. package/dist/core/rpc/transcript.d.ts.map +1 -0
  450. package/dist/core/rpc/transcript.js +624 -0
  451. package/dist/core/rpc/transcript.js.map +1 -0
  452. package/dist/core/rpc/transport.d.ts +41 -0
  453. package/dist/core/rpc/transport.d.ts.map +1 -0
  454. package/dist/core/rpc/transport.js +155 -0
  455. package/dist/core/rpc/transport.js.map +1 -0
  456. package/dist/core/rpc/types.d.ts +1254 -0
  457. package/dist/core/rpc/types.d.ts.map +1 -0
  458. package/dist/core/rpc/types.js +8 -0
  459. package/dist/core/rpc/types.js.map +1 -0
  460. package/dist/core/rpc/ui-action-args.d.ts +3 -0
  461. package/dist/core/rpc/ui-action-args.d.ts.map +1 -0
  462. package/dist/core/rpc/ui-action-args.js +66 -0
  463. package/dist/core/rpc/ui-action-args.js.map +1 -0
  464. package/dist/core/rpc/ui-actions.d.ts +43 -0
  465. package/dist/core/rpc/ui-actions.d.ts.map +1 -0
  466. package/dist/core/rpc/ui-actions.js +362 -0
  467. package/dist/core/rpc/ui-actions.js.map +1 -0
  468. package/dist/core/sdk.d.ts +138 -0
  469. package/dist/core/sdk.d.ts.map +1 -0
  470. package/dist/core/sdk.js +324 -0
  471. package/dist/core/sdk.js.map +1 -0
  472. package/dist/core/session-cwd.d.ts +19 -0
  473. package/dist/core/session-cwd.d.ts.map +1 -0
  474. package/dist/core/session-cwd.js +38 -0
  475. package/dist/core/session-cwd.js.map +1 -0
  476. package/dist/core/session-manager.d.ts +346 -0
  477. package/dist/core/session-manager.d.ts.map +1 -0
  478. package/dist/core/session-manager.js +1280 -0
  479. package/dist/core/session-manager.js.map +1 -0
  480. package/dist/core/settings-manager.d.ts +359 -0
  481. package/dist/core/settings-manager.d.ts.map +1 -0
  482. package/dist/core/settings-manager.js +1277 -0
  483. package/dist/core/settings-manager.js.map +1 -0
  484. package/dist/core/skills.d.ts +60 -0
  485. package/dist/core/skills.d.ts.map +1 -0
  486. package/dist/core/skills.js +387 -0
  487. package/dist/core/skills.js.map +1 -0
  488. package/dist/core/slash-commands.d.ts +14 -0
  489. package/dist/core/slash-commands.d.ts.map +1 -0
  490. package/dist/core/slash-commands.js +51 -0
  491. package/dist/core/slash-commands.js.map +1 -0
  492. package/dist/core/source-info.d.ts +18 -0
  493. package/dist/core/source-info.d.ts.map +1 -0
  494. package/dist/core/source-info.js +19 -0
  495. package/dist/core/source-info.js.map +1 -0
  496. package/dist/core/subagents/delegation-scope.d.ts +47 -0
  497. package/dist/core/subagents/delegation-scope.d.ts.map +1 -0
  498. package/dist/core/subagents/delegation-scope.js +134 -0
  499. package/dist/core/subagents/delegation-scope.js.map +1 -0
  500. package/dist/core/subagents/index.d.ts +46 -0
  501. package/dist/core/subagents/index.d.ts.map +1 -0
  502. package/dist/core/subagents/index.js +369 -0
  503. package/dist/core/subagents/index.js.map +1 -0
  504. package/dist/core/subagents/manager.d.ts +183 -0
  505. package/dist/core/subagents/manager.d.ts.map +1 -0
  506. package/dist/core/subagents/manager.js +820 -0
  507. package/dist/core/subagents/manager.js.map +1 -0
  508. package/dist/core/system-prompt.d.ts +28 -0
  509. package/dist/core/system-prompt.d.ts.map +1 -0
  510. package/dist/core/system-prompt.js +180 -0
  511. package/dist/core/system-prompt.js.map +1 -0
  512. package/dist/core/telemetry.d.ts +3 -0
  513. package/dist/core/telemetry.d.ts.map +1 -0
  514. package/dist/core/telemetry.js +9 -0
  515. package/dist/core/telemetry.js.map +1 -0
  516. package/dist/core/theme/dark.json +86 -0
  517. package/dist/core/theme/discovery.d.ts +48 -0
  518. package/dist/core/theme/discovery.d.ts.map +1 -0
  519. package/dist/core/theme/discovery.js +239 -0
  520. package/dist/core/theme/discovery.js.map +1 -0
  521. package/dist/core/theme/index.d.ts +6 -0
  522. package/dist/core/theme/index.d.ts.map +1 -0
  523. package/dist/core/theme/index.js +5 -0
  524. package/dist/core/theme/index.js.map +1 -0
  525. package/dist/core/theme/light.json +85 -0
  526. package/dist/core/theme/runtime.d.ts +55 -0
  527. package/dist/core/theme/runtime.d.ts.map +1 -0
  528. package/dist/core/theme/runtime.js +555 -0
  529. package/dist/core/theme/runtime.js.map +1 -0
  530. package/dist/core/theme/theme-schema.json +335 -0
  531. package/dist/core/theme/theme-service.d.ts +37 -0
  532. package/dist/core/theme/theme-service.d.ts.map +1 -0
  533. package/dist/core/theme/theme-service.js +222 -0
  534. package/dist/core/theme/theme-service.js.map +1 -0
  535. package/dist/core/theme/theme.d.ts +100 -0
  536. package/dist/core/theme/theme.d.ts.map +1 -0
  537. package/dist/core/theme/theme.js +243 -0
  538. package/dist/core/theme/theme.js.map +1 -0
  539. package/dist/core/theme/tokens.d.ts +20 -0
  540. package/dist/core/theme/tokens.d.ts.map +1 -0
  541. package/dist/core/theme/tokens.js +178 -0
  542. package/dist/core/theme/tokens.js.map +1 -0
  543. package/dist/core/theme/types.d.ts +21 -0
  544. package/dist/core/theme/types.d.ts.map +1 -0
  545. package/dist/core/theme/types.js +2 -0
  546. package/dist/core/theme/types.js.map +1 -0
  547. package/dist/core/timings.d.ts +8 -0
  548. package/dist/core/timings.d.ts.map +1 -0
  549. package/dist/core/timings.js +31 -0
  550. package/dist/core/timings.js.map +1 -0
  551. package/dist/core/tools/bash.d.ts +68 -0
  552. package/dist/core/tools/bash.d.ts.map +1 -0
  553. package/dist/core/tools/bash.js +345 -0
  554. package/dist/core/tools/bash.js.map +1 -0
  555. package/dist/core/tools/diagnostics-provider.d.ts +12 -0
  556. package/dist/core/tools/diagnostics-provider.d.ts.map +1 -0
  557. package/dist/core/tools/diagnostics-provider.js +2 -0
  558. package/dist/core/tools/diagnostics-provider.js.map +1 -0
  559. package/dist/core/tools/edit-diff.d.ts +77 -0
  560. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  561. package/dist/core/tools/edit-diff.js +506 -0
  562. package/dist/core/tools/edit-diff.js.map +1 -0
  563. package/dist/core/tools/edit.d.ts +56 -0
  564. package/dist/core/tools/edit.d.ts.map +1 -0
  565. package/dist/core/tools/edit.js +300 -0
  566. package/dist/core/tools/edit.js.map +1 -0
  567. package/dist/core/tools/file-mutation-queue.d.ts +6 -0
  568. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  569. package/dist/core/tools/file-mutation-queue.js +52 -0
  570. package/dist/core/tools/file-mutation-queue.js.map +1 -0
  571. package/dist/core/tools/find.d.ts +35 -0
  572. package/dist/core/tools/find.d.ts.map +1 -0
  573. package/dist/core/tools/find.js +337 -0
  574. package/dist/core/tools/find.js.map +1 -0
  575. package/dist/core/tools/grep.d.ts +37 -0
  576. package/dist/core/tools/grep.d.ts.map +1 -0
  577. package/dist/core/tools/grep.js +305 -0
  578. package/dist/core/tools/grep.js.map +1 -0
  579. package/dist/core/tools/index.d.ts +56 -0
  580. package/dist/core/tools/index.d.ts.map +1 -0
  581. package/dist/core/tools/index.js +174 -0
  582. package/dist/core/tools/index.js.map +1 -0
  583. package/dist/core/tools/ls.d.ts +37 -0
  584. package/dist/core/tools/ls.d.ts.map +1 -0
  585. package/dist/core/tools/ls.js +167 -0
  586. package/dist/core/tools/ls.js.map +1 -0
  587. package/dist/core/tools/lsp.d.ts +59 -0
  588. package/dist/core/tools/lsp.d.ts.map +1 -0
  589. package/dist/core/tools/lsp.js +157 -0
  590. package/dist/core/tools/lsp.js.map +1 -0
  591. package/dist/core/tools/output-accumulator.d.ts +52 -0
  592. package/dist/core/tools/output-accumulator.d.ts.map +1 -0
  593. package/dist/core/tools/output-accumulator.js +184 -0
  594. package/dist/core/tools/output-accumulator.js.map +1 -0
  595. package/dist/core/tools/path-utils.d.ts +10 -0
  596. package/dist/core/tools/path-utils.d.ts.map +1 -0
  597. package/dist/core/tools/path-utils.js +99 -0
  598. package/dist/core/tools/path-utils.js.map +1 -0
  599. package/dist/core/tools/read.d.ts +35 -0
  600. package/dist/core/tools/read.d.ts.map +1 -0
  601. package/dist/core/tools/read.js +292 -0
  602. package/dist/core/tools/read.js.map +1 -0
  603. package/dist/core/tools/render-utils.d.ts +26 -0
  604. package/dist/core/tools/render-utils.d.ts.map +1 -0
  605. package/dist/core/tools/render-utils.js +69 -0
  606. package/dist/core/tools/render-utils.js.map +1 -0
  607. package/dist/core/tools/subagent.d.ts +219 -0
  608. package/dist/core/tools/subagent.d.ts.map +1 -0
  609. package/dist/core/tools/subagent.js +1445 -0
  610. package/dist/core/tools/subagent.js.map +1 -0
  611. package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
  612. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  613. package/dist/core/tools/tool-definition-wrapper.js +34 -0
  614. package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  615. package/dist/core/tools/truncate.d.ts +70 -0
  616. package/dist/core/tools/truncate.d.ts.map +1 -0
  617. package/dist/core/tools/truncate.js +215 -0
  618. package/dist/core/tools/truncate.js.map +1 -0
  619. package/dist/core/tools/web-search.d.ts +69 -0
  620. package/dist/core/tools/web-search.d.ts.map +1 -0
  621. package/dist/core/tools/web-search.js +634 -0
  622. package/dist/core/tools/web-search.js.map +1 -0
  623. package/dist/core/tools/write.d.ts +33 -0
  624. package/dist/core/tools/write.d.ts.map +1 -0
  625. package/dist/core/tools/write.js +210 -0
  626. package/dist/core/tools/write.js.map +1 -0
  627. package/dist/core/trust-manager.d.ts +36 -0
  628. package/dist/core/trust-manager.d.ts.map +1 -0
  629. package/dist/core/trust-manager.js +220 -0
  630. package/dist/core/trust-manager.js.map +1 -0
  631. package/dist/daemon/cli.d.ts +8 -0
  632. package/dist/daemon/cli.d.ts.map +1 -0
  633. package/dist/daemon/cli.js +468 -0
  634. package/dist/daemon/cli.js.map +1 -0
  635. package/dist/daemon/control-client.d.ts +60 -0
  636. package/dist/daemon/control-client.d.ts.map +1 -0
  637. package/dist/daemon/control-client.js +411 -0
  638. package/dist/daemon/control-client.js.map +1 -0
  639. package/dist/daemon/control-protocol.d.ts +507 -0
  640. package/dist/daemon/control-protocol.d.ts.map +1 -0
  641. package/dist/daemon/control-protocol.js +395 -0
  642. package/dist/daemon/control-protocol.js.map +1 -0
  643. package/dist/daemon/control-server.d.ts +77 -0
  644. package/dist/daemon/control-server.d.ts.map +1 -0
  645. package/dist/daemon/control-server.js +327 -0
  646. package/dist/daemon/control-server.js.map +1 -0
  647. package/dist/daemon/conversation-commands.d.ts +176 -0
  648. package/dist/daemon/conversation-commands.d.ts.map +1 -0
  649. package/dist/daemon/conversation-commands.js +1268 -0
  650. package/dist/daemon/conversation-commands.js.map +1 -0
  651. package/dist/daemon/daemon-lock.d.ts +27 -0
  652. package/dist/daemon/daemon-lock.d.ts.map +1 -0
  653. package/dist/daemon/daemon-lock.js +238 -0
  654. package/dist/daemon/daemon-lock.js.map +1 -0
  655. package/dist/daemon/handshake-responses.d.ts +47 -0
  656. package/dist/daemon/handshake-responses.d.ts.map +1 -0
  657. package/dist/daemon/handshake-responses.js +113 -0
  658. package/dist/daemon/handshake-responses.js.map +1 -0
  659. package/dist/daemon/integrated-runtimes.d.ts +137 -0
  660. package/dist/daemon/integrated-runtimes.d.ts.map +1 -0
  661. package/dist/daemon/integrated-runtimes.js +763 -0
  662. package/dist/daemon/integrated-runtimes.js.map +1 -0
  663. package/dist/daemon/iroh-native.d.ts +76 -0
  664. package/dist/daemon/iroh-native.d.ts.map +1 -0
  665. package/dist/daemon/iroh-native.js +18 -0
  666. package/dist/daemon/iroh-native.js.map +1 -0
  667. package/dist/daemon/iroh-resource-guard.d.ts +57 -0
  668. package/dist/daemon/iroh-resource-guard.d.ts.map +1 -0
  669. package/dist/daemon/iroh-resource-guard.js +134 -0
  670. package/dist/daemon/iroh-resource-guard.js.map +1 -0
  671. package/dist/daemon/iroh-service.d.ts +51 -0
  672. package/dist/daemon/iroh-service.d.ts.map +1 -0
  673. package/dist/daemon/iroh-service.js +2604 -0
  674. package/dist/daemon/iroh-service.js.map +1 -0
  675. package/dist/daemon/keep-awake.d.ts +62 -0
  676. package/dist/daemon/keep-awake.d.ts.map +1 -0
  677. package/dist/daemon/keep-awake.js +190 -0
  678. package/dist/daemon/keep-awake.js.map +1 -0
  679. package/dist/daemon/lease-broker.d.ts +139 -0
  680. package/dist/daemon/lease-broker.d.ts.map +1 -0
  681. package/dist/daemon/lease-broker.js +504 -0
  682. package/dist/daemon/lease-broker.js.map +1 -0
  683. package/dist/daemon/log.d.ts +16 -0
  684. package/dist/daemon/log.d.ts.map +1 -0
  685. package/dist/daemon/log.js +40 -0
  686. package/dist/daemon/log.js.map +1 -0
  687. package/dist/daemon/main.d.ts +70 -0
  688. package/dist/daemon/main.d.ts.map +1 -0
  689. package/dist/daemon/main.js +781 -0
  690. package/dist/daemon/main.js.map +1 -0
  691. package/dist/daemon/paths.d.ts +32 -0
  692. package/dist/daemon/paths.d.ts.map +1 -0
  693. package/dist/daemon/paths.js +208 -0
  694. package/dist/daemon/paths.js.map +1 -0
  695. package/dist/daemon/process-identity.d.ts +58 -0
  696. package/dist/daemon/process-identity.d.ts.map +1 -0
  697. package/dist/daemon/process-identity.js +185 -0
  698. package/dist/daemon/process-identity.js.map +1 -0
  699. package/dist/daemon/relay-stream.d.ts +89 -0
  700. package/dist/daemon/relay-stream.d.ts.map +1 -0
  701. package/dist/daemon/relay-stream.js +202 -0
  702. package/dist/daemon/relay-stream.js.map +1 -0
  703. package/dist/daemon/remote-cli.d.ts +7 -0
  704. package/dist/daemon/remote-cli.d.ts.map +1 -0
  705. package/dist/daemon/remote-cli.js +774 -0
  706. package/dist/daemon/remote-cli.js.map +1 -0
  707. package/dist/daemon/service-install.d.ts +43 -0
  708. package/dist/daemon/service-install.d.ts.map +1 -0
  709. package/dist/daemon/service-install.js +198 -0
  710. package/dist/daemon/service-install.js.map +1 -0
  711. package/dist/daemon/session-target.d.ts +62 -0
  712. package/dist/daemon/session-target.d.ts.map +1 -0
  713. package/dist/daemon/session-target.js +66 -0
  714. package/dist/daemon/session-target.js.map +1 -0
  715. package/dist/daemon/spawn.d.ts +53 -0
  716. package/dist/daemon/spawn.d.ts.map +1 -0
  717. package/dist/daemon/spawn.js +205 -0
  718. package/dist/daemon/spawn.js.map +1 -0
  719. package/dist/daemon/state.d.ts +145 -0
  720. package/dist/daemon/state.d.ts.map +1 -0
  721. package/dist/daemon/state.js +454 -0
  722. package/dist/daemon/state.js.map +1 -0
  723. package/dist/daemon/theme-push.d.ts +23 -0
  724. package/dist/daemon/theme-push.d.ts.map +1 -0
  725. package/dist/daemon/theme-push.js +30 -0
  726. package/dist/daemon/theme-push.js.map +1 -0
  727. package/dist/daemon/viewer-feed.d.ts +42 -0
  728. package/dist/daemon/viewer-feed.d.ts.map +1 -0
  729. package/dist/daemon/viewer-feed.js +138 -0
  730. package/dist/daemon/viewer-feed.js.map +1 -0
  731. package/dist/daemon/workspace-directory.d.ts +35 -0
  732. package/dist/daemon/workspace-directory.d.ts.map +1 -0
  733. package/dist/daemon/workspace-directory.js +105 -0
  734. package/dist/daemon/workspace-directory.js.map +1 -0
  735. package/dist/daemon/workspace-streams.d.ts +70 -0
  736. package/dist/daemon/workspace-streams.d.ts.map +1 -0
  737. package/dist/daemon/workspace-streams.js +289 -0
  738. package/dist/daemon/workspace-streams.js.map +1 -0
  739. package/dist/daemon/worktree-manager.d.ts +219 -0
  740. package/dist/daemon/worktree-manager.d.ts.map +1 -0
  741. package/dist/daemon/worktree-manager.js +1204 -0
  742. package/dist/daemon/worktree-manager.js.map +1 -0
  743. package/dist/index.d.ts +44 -0
  744. package/dist/index.d.ts.map +1 -0
  745. package/dist/index.js +57 -0
  746. package/dist/index.js.map +1 -0
  747. package/dist/main.d.ts +12 -0
  748. package/dist/main.d.ts.map +1 -0
  749. package/dist/main.js +773 -0
  750. package/dist/main.js.map +1 -0
  751. package/dist/mcp-cli.d.ts +6 -0
  752. package/dist/mcp-cli.d.ts.map +1 -0
  753. package/dist/mcp-cli.js +347 -0
  754. package/dist/mcp-cli.js.map +1 -0
  755. package/dist/migrations.d.ts +33 -0
  756. package/dist/migrations.d.ts.map +1 -0
  757. package/dist/migrations.js +281 -0
  758. package/dist/migrations.js.map +1 -0
  759. package/dist/modes/index.d.ts +13 -0
  760. package/dist/modes/index.d.ts.map +1 -0
  761. package/dist/modes/index.js +12 -0
  762. package/dist/modes/index.js.map +1 -0
  763. package/dist/modes/interactive/components/armin.d.ts +34 -0
  764. package/dist/modes/interactive/components/armin.d.ts.map +1 -0
  765. package/dist/modes/interactive/components/armin.js +333 -0
  766. package/dist/modes/interactive/components/armin.js.map +1 -0
  767. package/dist/modes/interactive/components/assistant-message.d.ts +22 -0
  768. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  769. package/dist/modes/interactive/components/assistant-message.js +129 -0
  770. package/dist/modes/interactive/components/assistant-message.js.map +1 -0
  771. package/dist/modes/interactive/components/bash-execution.d.ts +39 -0
  772. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  773. package/dist/modes/interactive/components/bash-execution.js +212 -0
  774. package/dist/modes/interactive/components/bash-execution.js.map +1 -0
  775. package/dist/modes/interactive/components/bordered-loader.d.ts +17 -0
  776. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  777. package/dist/modes/interactive/components/bordered-loader.js +57 -0
  778. package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  779. package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  780. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  781. package/dist/modes/interactive/components/branch-summary-message.js +44 -0
  782. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  783. package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  784. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  785. package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
  786. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  787. package/dist/modes/interactive/components/config-selector.d.ts +71 -0
  788. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  789. package/dist/modes/interactive/components/config-selector.js +510 -0
  790. package/dist/modes/interactive/components/config-selector.js.map +1 -0
  791. package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  792. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  793. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  794. package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  795. package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  796. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  797. package/dist/modes/interactive/components/custom-editor.js +70 -0
  798. package/dist/modes/interactive/components/custom-editor.js.map +1 -0
  799. package/dist/modes/interactive/components/custom-message.d.ts +20 -0
  800. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  801. package/dist/modes/interactive/components/custom-message.js +76 -0
  802. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  803. package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  804. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  805. package/dist/modes/interactive/components/daxnuts.js +140 -0
  806. package/dist/modes/interactive/components/daxnuts.js.map +1 -0
  807. package/dist/modes/interactive/components/diff.d.ts +12 -0
  808. package/dist/modes/interactive/components/diff.d.ts.map +1 -0
  809. package/dist/modes/interactive/components/diff.js +133 -0
  810. package/dist/modes/interactive/components/diff.js.map +1 -0
  811. package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  812. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  813. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  814. package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  815. package/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  816. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  817. package/dist/modes/interactive/components/extension-editor.js +116 -0
  818. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  819. package/dist/modes/interactive/components/extension-input.d.ts +23 -0
  820. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  821. package/dist/modes/interactive/components/extension-input.js +61 -0
  822. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  823. package/dist/modes/interactive/components/extension-selector.d.ts +27 -0
  824. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  825. package/dist/modes/interactive/components/extension-selector.js +98 -0
  826. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  827. package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
  828. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
  829. package/dist/modes/interactive/components/first-time-setup.js +103 -0
  830. package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
  831. package/dist/modes/interactive/components/footer.d.ts +27 -0
  832. package/dist/modes/interactive/components/footer.d.ts.map +1 -0
  833. package/dist/modes/interactive/components/footer.js +180 -0
  834. package/dist/modes/interactive/components/footer.js.map +1 -0
  835. package/dist/modes/interactive/components/hotkeys.d.ts +24 -0
  836. package/dist/modes/interactive/components/hotkeys.d.ts.map +1 -0
  837. package/dist/modes/interactive/components/hotkeys.js +97 -0
  838. package/dist/modes/interactive/components/hotkeys.js.map +1 -0
  839. package/dist/modes/interactive/components/index.d.ts +35 -0
  840. package/dist/modes/interactive/components/index.d.ts.map +1 -0
  841. package/dist/modes/interactive/components/index.js +36 -0
  842. package/dist/modes/interactive/components/index.js.map +1 -0
  843. package/dist/modes/interactive/components/keybinding-hints.d.ts +19 -0
  844. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  845. package/dist/modes/interactive/components/keybinding-hints.js +48 -0
  846. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  847. package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
  848. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  849. package/dist/modes/interactive/components/login-dialog.js +179 -0
  850. package/dist/modes/interactive/components/login-dialog.js.map +1 -0
  851. package/dist/modes/interactive/components/logo.d.ts +25 -0
  852. package/dist/modes/interactive/components/logo.d.ts.map +1 -0
  853. package/dist/modes/interactive/components/logo.js +89 -0
  854. package/dist/modes/interactive/components/logo.js.map +1 -0
  855. package/dist/modes/interactive/components/model-selector.d.ts +47 -0
  856. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  857. package/dist/modes/interactive/components/model-selector.js +278 -0
  858. package/dist/modes/interactive/components/model-selector.js.map +1 -0
  859. package/dist/modes/interactive/components/oauth-selector.d.ts +31 -0
  860. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  861. package/dist/modes/interactive/components/oauth-selector.js +165 -0
  862. package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  863. package/dist/modes/interactive/components/remote-control-center.d.ts +110 -0
  864. package/dist/modes/interactive/components/remote-control-center.d.ts.map +1 -0
  865. package/dist/modes/interactive/components/remote-control-center.js +1217 -0
  866. package/dist/modes/interactive/components/remote-control-center.js.map +1 -0
  867. package/dist/modes/interactive/components/review-tools-selector.d.ts +24 -0
  868. package/dist/modes/interactive/components/review-tools-selector.d.ts.map +1 -0
  869. package/dist/modes/interactive/components/review-tools-selector.js +93 -0
  870. package/dist/modes/interactive/components/review-tools-selector.js.map +1 -0
  871. package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
  872. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  873. package/dist/modes/interactive/components/scoped-models-selector.js +290 -0
  874. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  875. package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  876. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  877. package/dist/modes/interactive/components/session-selector-search.js +155 -0
  878. package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  879. package/dist/modes/interactive/components/session-selector.d.ts +95 -0
  880. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  881. package/dist/modes/interactive/components/session-selector.js +856 -0
  882. package/dist/modes/interactive/components/session-selector.js.map +1 -0
  883. package/dist/modes/interactive/components/settings-selector.d.ts +77 -0
  884. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  885. package/dist/modes/interactive/components/settings-selector.js +484 -0
  886. package/dist/modes/interactive/components/settings-selector.js.map +1 -0
  887. package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  888. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  889. package/dist/modes/interactive/components/show-images-selector.js +39 -0
  890. package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  891. package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  892. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  893. package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
  894. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  895. package/dist/modes/interactive/components/streaming-render-coalescer.d.ts +29 -0
  896. package/dist/modes/interactive/components/streaming-render-coalescer.d.ts.map +1 -0
  897. package/dist/modes/interactive/components/streaming-render-coalescer.js +98 -0
  898. package/dist/modes/interactive/components/streaming-render-coalescer.js.map +1 -0
  899. package/dist/modes/interactive/components/subagent-inspector.d.ts +32 -0
  900. package/dist/modes/interactive/components/subagent-inspector.d.ts.map +1 -0
  901. package/dist/modes/interactive/components/subagent-inspector.js +439 -0
  902. package/dist/modes/interactive/components/subagent-inspector.js.map +1 -0
  903. package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  904. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  905. package/dist/modes/interactive/components/theme-selector.js +50 -0
  906. package/dist/modes/interactive/components/theme-selector.js.map +1 -0
  907. package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  908. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  909. package/dist/modes/interactive/components/thinking-selector.js +52 -0
  910. package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  911. package/dist/modes/interactive/components/tool-execution.d.ts +83 -0
  912. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  913. package/dist/modes/interactive/components/tool-execution.js +421 -0
  914. package/dist/modes/interactive/components/tool-execution.js.map +1 -0
  915. package/dist/modes/interactive/components/tree-selector.d.ts +89 -0
  916. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  917. package/dist/modes/interactive/components/tree-selector.js +1208 -0
  918. package/dist/modes/interactive/components/tree-selector.js.map +1 -0
  919. package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  920. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  921. package/dist/modes/interactive/components/trust-selector.js +91 -0
  922. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  923. package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  924. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  925. package/dist/modes/interactive/components/user-message-selector.js +114 -0
  926. package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  927. package/dist/modes/interactive/components/user-message.d.ts +9 -0
  928. package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  929. package/dist/modes/interactive/components/user-message.js +42 -0
  930. package/dist/modes/interactive/components/user-message.js.map +1 -0
  931. package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  932. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  933. package/dist/modes/interactive/components/visual-truncate.js +33 -0
  934. package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  935. package/dist/modes/interactive/components/volt-announcement.d.ts +5 -0
  936. package/dist/modes/interactive/components/volt-announcement.d.ts.map +1 -0
  937. package/dist/modes/interactive/components/volt-announcement.js +15 -0
  938. package/dist/modes/interactive/components/volt-announcement.js.map +1 -0
  939. package/dist/modes/interactive/daemon-attach.d.ts +154 -0
  940. package/dist/modes/interactive/daemon-attach.d.ts.map +1 -0
  941. package/dist/modes/interactive/daemon-attach.js +552 -0
  942. package/dist/modes/interactive/daemon-attach.js.map +1 -0
  943. package/dist/modes/interactive/drain-viewer.d.ts +31 -0
  944. package/dist/modes/interactive/drain-viewer.d.ts.map +1 -0
  945. package/dist/modes/interactive/drain-viewer.js +166 -0
  946. package/dist/modes/interactive/drain-viewer.js.map +1 -0
  947. package/dist/modes/interactive/interactive-mode.d.ts +502 -0
  948. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  949. package/dist/modes/interactive/interactive-mode.js +7007 -0
  950. package/dist/modes/interactive/interactive-mode.js.map +1 -0
  951. package/dist/modes/interactive/prompt-image-attachments.d.ts +34 -0
  952. package/dist/modes/interactive/prompt-image-attachments.d.ts.map +1 -0
  953. package/dist/modes/interactive/prompt-image-attachments.js +120 -0
  954. package/dist/modes/interactive/prompt-image-attachments.js.map +1 -0
  955. package/dist/modes/interactive/relay-stream-adapter.d.ts +19 -0
  956. package/dist/modes/interactive/relay-stream-adapter.d.ts.map +1 -0
  957. package/dist/modes/interactive/relay-stream-adapter.js +107 -0
  958. package/dist/modes/interactive/relay-stream-adapter.js.map +1 -0
  959. package/dist/modes/print-mode.d.ts +28 -0
  960. package/dist/modes/print-mode.d.ts.map +1 -0
  961. package/dist/modes/print-mode.js +132 -0
  962. package/dist/modes/print-mode.js.map +1 -0
  963. package/dist/modes/rpc/in-process-rpc-client.d.ts +31 -0
  964. package/dist/modes/rpc/in-process-rpc-client.d.ts.map +1 -0
  965. package/dist/modes/rpc/in-process-rpc-client.js +63 -0
  966. package/dist/modes/rpc/in-process-rpc-client.js.map +1 -0
  967. package/dist/modes/rpc/iroh-remote-agent-runtime.d.ts +61 -0
  968. package/dist/modes/rpc/iroh-remote-agent-runtime.d.ts.map +1 -0
  969. package/dist/modes/rpc/iroh-remote-agent-runtime.js +155 -0
  970. package/dist/modes/rpc/iroh-remote-agent-runtime.js.map +1 -0
  971. package/dist/modes/rpc/iroh-remote-rpc-mode.d.ts +69 -0
  972. package/dist/modes/rpc/iroh-remote-rpc-mode.d.ts.map +1 -0
  973. package/dist/modes/rpc/iroh-remote-rpc-mode.js +1223 -0
  974. package/dist/modes/rpc/iroh-remote-rpc-mode.js.map +1 -0
  975. package/dist/modes/rpc/jsonl.d.ts +2 -0
  976. package/dist/modes/rpc/jsonl.d.ts.map +1 -0
  977. package/dist/modes/rpc/jsonl.js +2 -0
  978. package/dist/modes/rpc/jsonl.js.map +1 -0
  979. package/dist/modes/rpc/rpc-client-base.d.ts +209 -0
  980. package/dist/modes/rpc/rpc-client-base.d.ts.map +1 -0
  981. package/dist/modes/rpc/rpc-client-base.js +530 -0
  982. package/dist/modes/rpc/rpc-client-base.js.map +1 -0
  983. package/dist/modes/rpc/rpc-client.d.ts +50 -0
  984. package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  985. package/dist/modes/rpc/rpc-client.js +190 -0
  986. package/dist/modes/rpc/rpc-client.js.map +1 -0
  987. package/dist/modes/rpc/rpc-command-dispatcher.d.ts +43 -0
  988. package/dist/modes/rpc/rpc-command-dispatcher.d.ts.map +1 -0
  989. package/dist/modes/rpc/rpc-command-dispatcher.js +613 -0
  990. package/dist/modes/rpc/rpc-command-dispatcher.js.map +1 -0
  991. package/dist/modes/rpc/rpc-command-validation.d.ts +2 -0
  992. package/dist/modes/rpc/rpc-command-validation.d.ts.map +1 -0
  993. package/dist/modes/rpc/rpc-command-validation.js +207 -0
  994. package/dist/modes/rpc/rpc-command-validation.js.map +1 -0
  995. package/dist/modes/rpc/rpc-mode.d.ts +48 -0
  996. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  997. package/dist/modes/rpc/rpc-mode.js +1089 -0
  998. package/dist/modes/rpc/rpc-mode.js.map +1 -0
  999. package/dist/modes/rpc/rpc-transport-client.d.ts +26 -0
  1000. package/dist/modes/rpc/rpc-transport-client.d.ts.map +1 -0
  1001. package/dist/modes/rpc/rpc-transport-client.js +76 -0
  1002. package/dist/modes/rpc/rpc-transport-client.js.map +1 -0
  1003. package/dist/modes/rpc/rpc-types.d.ts +2 -0
  1004. package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  1005. package/dist/modes/rpc/rpc-types.js +2 -0
  1006. package/dist/modes/rpc/rpc-types.js.map +1 -0
  1007. package/dist/package-manager-cli.d.ts +28 -0
  1008. package/dist/package-manager-cli.d.ts.map +1 -0
  1009. package/dist/package-manager-cli.js +667 -0
  1010. package/dist/package-manager-cli.js.map +1 -0
  1011. package/dist/remote/integrated-runtime-retention.d.ts +17 -0
  1012. package/dist/remote/integrated-runtime-retention.d.ts.map +1 -0
  1013. package/dist/remote/integrated-runtime-retention.js +62 -0
  1014. package/dist/remote/integrated-runtime-retention.js.map +1 -0
  1015. package/dist/remote/iroh-native-adapter.cjs +19 -0
  1016. package/dist/sea/cli.d.ts +4 -0
  1017. package/dist/sea/cli.d.ts.map +1 -0
  1018. package/dist/sea/cli.js +4 -0
  1019. package/dist/sea/cli.js.map +1 -0
  1020. package/dist/sea/register-bedrock.d.ts +2 -0
  1021. package/dist/sea/register-bedrock.d.ts.map +1 -0
  1022. package/dist/sea/register-bedrock.js +4 -0
  1023. package/dist/sea/register-bedrock.js.map +1 -0
  1024. package/dist/store/catalog.d.ts +57 -0
  1025. package/dist/store/catalog.d.ts.map +1 -0
  1026. package/dist/store/catalog.js +331 -0
  1027. package/dist/store/catalog.js.map +1 -0
  1028. package/dist/store/inspector.d.ts +36 -0
  1029. package/dist/store/inspector.d.ts.map +1 -0
  1030. package/dist/store/inspector.js +578 -0
  1031. package/dist/store/inspector.js.map +1 -0
  1032. package/dist/store/install-plan.d.ts +26 -0
  1033. package/dist/store/install-plan.d.ts.map +1 -0
  1034. package/dist/store/install-plan.js +80 -0
  1035. package/dist/store/install-plan.js.map +1 -0
  1036. package/dist/store/render.d.ts +11 -0
  1037. package/dist/store/render.d.ts.map +1 -0
  1038. package/dist/store/render.js +153 -0
  1039. package/dist/store/render.js.map +1 -0
  1040. package/dist/store/resolver.d.ts +22 -0
  1041. package/dist/store/resolver.d.ts.map +1 -0
  1042. package/dist/store/resolver.js +207 -0
  1043. package/dist/store/resolver.js.map +1 -0
  1044. package/dist/store/store-cli.d.ts +7 -0
  1045. package/dist/store/store-cli.d.ts.map +1 -0
  1046. package/dist/store/store-cli.js +636 -0
  1047. package/dist/store/store-cli.js.map +1 -0
  1048. package/dist/store/targets.d.ts +21 -0
  1049. package/dist/store/targets.d.ts.map +1 -0
  1050. package/dist/store/targets.js +55 -0
  1051. package/dist/store/targets.js.map +1 -0
  1052. package/dist/utils/ansi.d.ts +2 -0
  1053. package/dist/utils/ansi.d.ts.map +1 -0
  1054. package/dist/utils/ansi.js +52 -0
  1055. package/dist/utils/ansi.js.map +1 -0
  1056. package/dist/utils/changelog.d.ts +22 -0
  1057. package/dist/utils/changelog.d.ts.map +1 -0
  1058. package/dist/utils/changelog.js +165 -0
  1059. package/dist/utils/changelog.js.map +1 -0
  1060. package/dist/utils/child-process.d.ts +18 -0
  1061. package/dist/utils/child-process.d.ts.map +1 -0
  1062. package/dist/utils/child-process.js +106 -0
  1063. package/dist/utils/child-process.js.map +1 -0
  1064. package/dist/utils/clipboard-image.d.ts +11 -0
  1065. package/dist/utils/clipboard-image.d.ts.map +1 -0
  1066. package/dist/utils/clipboard-image.js +245 -0
  1067. package/dist/utils/clipboard-image.js.map +1 -0
  1068. package/dist/utils/clipboard.d.ts +2 -0
  1069. package/dist/utils/clipboard.d.ts.map +1 -0
  1070. package/dist/utils/clipboard.js +94 -0
  1071. package/dist/utils/clipboard.js.map +1 -0
  1072. package/dist/utils/deprecation.d.ts +4 -0
  1073. package/dist/utils/deprecation.d.ts.map +1 -0
  1074. package/dist/utils/deprecation.js +13 -0
  1075. package/dist/utils/deprecation.js.map +1 -0
  1076. package/dist/utils/durable-atomic-write.d.ts +46 -0
  1077. package/dist/utils/durable-atomic-write.d.ts.map +1 -0
  1078. package/dist/utils/durable-atomic-write.js +104 -0
  1079. package/dist/utils/durable-atomic-write.js.map +1 -0
  1080. package/dist/utils/frontmatter.d.ts +8 -0
  1081. package/dist/utils/frontmatter.d.ts.map +1 -0
  1082. package/dist/utils/frontmatter.js +26 -0
  1083. package/dist/utils/frontmatter.js.map +1 -0
  1084. package/dist/utils/fs-watch.d.ts +5 -0
  1085. package/dist/utils/fs-watch.d.ts.map +1 -0
  1086. package/dist/utils/fs-watch.js +25 -0
  1087. package/dist/utils/fs-watch.js.map +1 -0
  1088. package/dist/utils/git.d.ts +26 -0
  1089. package/dist/utils/git.d.ts.map +1 -0
  1090. package/dist/utils/git.js +195 -0
  1091. package/dist/utils/git.js.map +1 -0
  1092. package/dist/utils/html.d.ts +7 -0
  1093. package/dist/utils/html.d.ts.map +1 -0
  1094. package/dist/utils/html.js +40 -0
  1095. package/dist/utils/html.js.map +1 -0
  1096. package/dist/utils/ignore-files.d.ts +5 -0
  1097. package/dist/utils/ignore-files.d.ts.map +1 -0
  1098. package/dist/utils/ignore-files.js +58 -0
  1099. package/dist/utils/ignore-files.js.map +1 -0
  1100. package/dist/utils/image-codec.d.ts +22 -0
  1101. package/dist/utils/image-codec.d.ts.map +1 -0
  1102. package/dist/utils/image-codec.js +35 -0
  1103. package/dist/utils/image-codec.js.map +1 -0
  1104. package/dist/utils/image-convert.d.ts +9 -0
  1105. package/dist/utils/image-convert.d.ts.map +1 -0
  1106. package/dist/utils/image-convert.js +26 -0
  1107. package/dist/utils/image-convert.js.map +1 -0
  1108. package/dist/utils/image-resize-core.d.ts +31 -0
  1109. package/dist/utils/image-resize-core.d.ts.map +1 -0
  1110. package/dist/utils/image-resize-core.js +181 -0
  1111. package/dist/utils/image-resize-core.js.map +1 -0
  1112. package/dist/utils/image-resize-worker.d.ts +2 -0
  1113. package/dist/utils/image-resize-worker.d.ts.map +1 -0
  1114. package/dist/utils/image-resize-worker.js +31 -0
  1115. package/dist/utils/image-resize-worker.js.map +1 -0
  1116. package/dist/utils/image-resize.d.ts +15 -0
  1117. package/dist/utils/image-resize.d.ts.map +1 -0
  1118. package/dist/utils/image-resize.js +92 -0
  1119. package/dist/utils/image-resize.js.map +1 -0
  1120. package/dist/utils/json.d.ts +3 -0
  1121. package/dist/utils/json.d.ts.map +1 -0
  1122. package/dist/utils/json.js +7 -0
  1123. package/dist/utils/json.js.map +1 -0
  1124. package/dist/utils/mime.d.ts +3 -0
  1125. package/dist/utils/mime.d.ts.map +1 -0
  1126. package/dist/utils/mime.js +69 -0
  1127. package/dist/utils/mime.js.map +1 -0
  1128. package/dist/utils/npm-spec.d.ts +9 -0
  1129. package/dist/utils/npm-spec.d.ts.map +1 -0
  1130. package/dist/utils/npm-spec.js +15 -0
  1131. package/dist/utils/npm-spec.js.map +1 -0
  1132. package/dist/utils/open-browser.d.ts +9 -0
  1133. package/dist/utils/open-browser.d.ts.map +1 -0
  1134. package/dist/utils/open-browser.js +22 -0
  1135. package/dist/utils/open-browser.js.map +1 -0
  1136. package/dist/utils/paths.d.ts +31 -0
  1137. package/dist/utils/paths.d.ts.map +1 -0
  1138. package/dist/utils/paths.js +92 -0
  1139. package/dist/utils/paths.js.map +1 -0
  1140. package/dist/utils/private-files.d.ts +21 -0
  1141. package/dist/utils/private-files.d.ts.map +1 -0
  1142. package/dist/utils/private-files.js +103 -0
  1143. package/dist/utils/private-files.js.map +1 -0
  1144. package/dist/utils/process-env.d.ts +2 -0
  1145. package/dist/utils/process-env.d.ts.map +1 -0
  1146. package/dist/utils/process-env.js +31 -0
  1147. package/dist/utils/process-env.js.map +1 -0
  1148. package/dist/utils/shell.d.ts +30 -0
  1149. package/dist/utils/shell.d.ts.map +1 -0
  1150. package/dist/utils/shell.js +195 -0
  1151. package/dist/utils/shell.js.map +1 -0
  1152. package/dist/utils/sleep.d.ts +5 -0
  1153. package/dist/utils/sleep.d.ts.map +1 -0
  1154. package/dist/utils/sleep.js +17 -0
  1155. package/dist/utils/sleep.js.map +1 -0
  1156. package/dist/utils/syntax-highlight.d.ts +18 -0
  1157. package/dist/utils/syntax-highlight.d.ts.map +1 -0
  1158. package/dist/utils/syntax-highlight.js +139 -0
  1159. package/dist/utils/syntax-highlight.js.map +1 -0
  1160. package/dist/utils/tools-manager.d.ts +3 -0
  1161. package/dist/utils/tools-manager.d.ts.map +1 -0
  1162. package/dist/utils/tools-manager.js +328 -0
  1163. package/dist/utils/tools-manager.js.map +1 -0
  1164. package/dist/utils/version-check.d.ts +15 -0
  1165. package/dist/utils/version-check.d.ts.map +1 -0
  1166. package/dist/utils/version-check.js +61 -0
  1167. package/dist/utils/version-check.js.map +1 -0
  1168. package/dist/utils/volt-user-agent.d.ts +2 -0
  1169. package/dist/utils/volt-user-agent.d.ts.map +1 -0
  1170. package/dist/utils/volt-user-agent.js +5 -0
  1171. package/dist/utils/volt-user-agent.js.map +1 -0
  1172. package/dist/utils/windows-self-update.d.ts +3 -0
  1173. package/dist/utils/windows-self-update.d.ts.map +1 -0
  1174. package/dist/utils/windows-self-update.js +77 -0
  1175. package/dist/utils/windows-self-update.js.map +1 -0
  1176. package/docs/compaction.md +394 -0
  1177. package/docs/containerization.md +111 -0
  1178. package/docs/custom-provider.md +737 -0
  1179. package/docs/daemon.md +190 -0
  1180. package/docs/development.md +70 -0
  1181. package/docs/docs.json +176 -0
  1182. package/docs/extensions.md +2692 -0
  1183. package/docs/images/exy.png +0 -0
  1184. package/docs/images/interactive-mode.png +0 -0
  1185. package/docs/images/tree-view.png +0 -0
  1186. package/docs/index.md +82 -0
  1187. package/docs/iroh-remote-access-design.md +340 -0
  1188. package/docs/iroh-remote-protocol.md +431 -0
  1189. package/docs/json.md +87 -0
  1190. package/docs/keybindings.md +200 -0
  1191. package/docs/live-shared-session-daemon-design.md +1090 -0
  1192. package/docs/lsp.md +143 -0
  1193. package/docs/mcp.md +1044 -0
  1194. package/docs/models.md +495 -0
  1195. package/docs/packages.md +230 -0
  1196. package/docs/prompt-templates.md +108 -0
  1197. package/docs/providers.md +274 -0
  1198. package/docs/quickstart.md +165 -0
  1199. package/docs/rpc.md +2050 -0
  1200. package/docs/sdk.md +1267 -0
  1201. package/docs/security.md +139 -0
  1202. package/docs/session-format.md +412 -0
  1203. package/docs/sessions.md +145 -0
  1204. package/docs/settings.md +371 -0
  1205. package/docs/shell-aliases.md +13 -0
  1206. package/docs/skills.md +243 -0
  1207. package/docs/subagents-design.md +419 -0
  1208. package/docs/terminal-setup.md +148 -0
  1209. package/docs/termux.md +127 -0
  1210. package/docs/themes.md +295 -0
  1211. package/docs/tla/ClientAuth.cfg +16 -0
  1212. package/docs/tla/ClientAuth.tla +205 -0
  1213. package/docs/tla/ClientConn.cfg +16 -0
  1214. package/docs/tla/ClientConn.tla +265 -0
  1215. package/docs/tla/LeaseBroker.cfg +43 -0
  1216. package/docs/tla/LeaseBroker.tla +563 -0
  1217. package/docs/tla/PLAN.md +240 -0
  1218. package/docs/tla/PushOrdering.cfg +17 -0
  1219. package/docs/tla/PushOrdering.tla +183 -0
  1220. package/docs/tla/README.md +205 -0
  1221. package/docs/tla/RelayViewer.cfg +26 -0
  1222. package/docs/tla/RelayViewer.tla +299 -0
  1223. package/docs/tla/SessionTarget.cfg +18 -0
  1224. package/docs/tla/SessionTarget.tla +192 -0
  1225. package/docs/tla/check.sh +34 -0
  1226. package/docs/tmux.md +63 -0
  1227. package/docs/tui.md +949 -0
  1228. package/docs/usage.md +482 -0
  1229. package/docs/windows.md +17 -0
  1230. package/docs/worktrees-design.md +605 -0
  1231. package/examples/README.md +28 -0
  1232. package/examples/extensions/README.md +211 -0
  1233. package/examples/extensions/auto-commit-on-exit.ts +49 -0
  1234. package/examples/extensions/bash-spawn-hook.ts +30 -0
  1235. package/examples/extensions/bookmark.ts +50 -0
  1236. package/examples/extensions/border-status-editor.ts +150 -0
  1237. package/examples/extensions/built-in-tool-renderer.ts +249 -0
  1238. package/examples/extensions/claude-rules.ts +86 -0
  1239. package/examples/extensions/commands.ts +72 -0
  1240. package/examples/extensions/confirm-destructive.ts +59 -0
  1241. package/examples/extensions/custom-compaction.ts +127 -0
  1242. package/examples/extensions/custom-footer.ts +64 -0
  1243. package/examples/extensions/custom-header.ts +72 -0
  1244. package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
  1245. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  1246. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  1247. package/examples/extensions/custom-provider-gitlab-duo/index.ts +400 -0
  1248. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  1249. package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  1250. package/examples/extensions/dirty-repo-guard.ts +56 -0
  1251. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  1252. package/examples/extensions/dynamic-resources/dynamic.json +79 -0
  1253. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  1254. package/examples/extensions/dynamic-resources/index.ts +15 -0
  1255. package/examples/extensions/dynamic-tools.ts +74 -0
  1256. package/examples/extensions/event-bus.ts +43 -0
  1257. package/examples/extensions/file-trigger.ts +41 -0
  1258. package/examples/extensions/git-checkpoint.ts +53 -0
  1259. package/examples/extensions/git-merge-and-resolve.ts +115 -0
  1260. package/examples/extensions/github-issue-autocomplete.ts +185 -0
  1261. package/examples/extensions/gondolin/index.ts +531 -0
  1262. package/examples/extensions/gondolin/package-lock.json +185 -0
  1263. package/examples/extensions/gondolin/package.json +19 -0
  1264. package/examples/extensions/handoff.ts +191 -0
  1265. package/examples/extensions/hello.ts +26 -0
  1266. package/examples/extensions/hidden-thinking-label.ts +53 -0
  1267. package/examples/extensions/inline-bash.ts +94 -0
  1268. package/examples/extensions/input-transform-streaming.ts +39 -0
  1269. package/examples/extensions/input-transform.ts +43 -0
  1270. package/examples/extensions/interactive-shell.ts +196 -0
  1271. package/examples/extensions/mac-system-theme.ts +47 -0
  1272. package/examples/extensions/message-renderer.ts +59 -0
  1273. package/examples/extensions/minimal-mode.ts +426 -0
  1274. package/examples/extensions/modal-editor.ts +85 -0
  1275. package/examples/extensions/model-status.ts +31 -0
  1276. package/examples/extensions/notify.ts +55 -0
  1277. package/examples/extensions/overlay-qa-tests.ts +1450 -0
  1278. package/examples/extensions/overlay-test.ts +153 -0
  1279. package/examples/extensions/permission-gate.ts +34 -0
  1280. package/examples/extensions/pirate.ts +47 -0
  1281. package/examples/extensions/plan-mode/README.md +65 -0
  1282. package/examples/extensions/plan-mode/index.ts +340 -0
  1283. package/examples/extensions/plan-mode/utils.ts +168 -0
  1284. package/examples/extensions/preset.ts +436 -0
  1285. package/examples/extensions/project-trust.ts +64 -0
  1286. package/examples/extensions/prompt-customizer.ts +97 -0
  1287. package/examples/extensions/protected-paths.ts +30 -0
  1288. package/examples/extensions/provider-payload.ts +18 -0
  1289. package/examples/extensions/qna.ts +122 -0
  1290. package/examples/extensions/question.ts +277 -0
  1291. package/examples/extensions/questionnaire.ts +440 -0
  1292. package/examples/extensions/rainbow-editor.ts +88 -0
  1293. package/examples/extensions/reload-runtime.ts +37 -0
  1294. package/examples/extensions/rpc-demo.ts +118 -0
  1295. package/examples/extensions/sandbox/index.ts +321 -0
  1296. package/examples/extensions/sandbox/package-lock.json +92 -0
  1297. package/examples/extensions/sandbox/package.json +19 -0
  1298. package/examples/extensions/send-user-message.ts +97 -0
  1299. package/examples/extensions/session-name.ts +27 -0
  1300. package/examples/extensions/shutdown-command.ts +63 -0
  1301. package/examples/extensions/snake.ts +343 -0
  1302. package/examples/extensions/space-invaders.ts +560 -0
  1303. package/examples/extensions/ssh.ts +220 -0
  1304. package/examples/extensions/status-line.ts +32 -0
  1305. package/examples/extensions/structured-output.ts +65 -0
  1306. package/examples/extensions/subagent/README.md +175 -0
  1307. package/examples/extensions/subagent/agents/planner.md +37 -0
  1308. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  1309. package/examples/extensions/subagent/agents/scout.md +50 -0
  1310. package/examples/extensions/subagent/agents/worker.md +24 -0
  1311. package/examples/extensions/subagent/agents.ts +126 -0
  1312. package/examples/extensions/subagent/index.ts +1009 -0
  1313. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  1314. package/examples/extensions/subagent/prompts/implement.md +10 -0
  1315. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  1316. package/examples/extensions/summarize.ts +206 -0
  1317. package/examples/extensions/system-prompt-header.ts +17 -0
  1318. package/examples/extensions/tic-tac-toe.ts +1008 -0
  1319. package/examples/extensions/timed-confirm.ts +70 -0
  1320. package/examples/extensions/titlebar-spinner.ts +58 -0
  1321. package/examples/extensions/todo.ts +297 -0
  1322. package/examples/extensions/tool-override.ts +144 -0
  1323. package/examples/extensions/tools.ts +146 -0
  1324. package/examples/extensions/trigger-compact.ts +50 -0
  1325. package/examples/extensions/truncated-tool.ts +195 -0
  1326. package/examples/extensions/widget-placement.ts +9 -0
  1327. package/examples/extensions/with-deps/index.ts +32 -0
  1328. package/examples/extensions/with-deps/package-lock.json +31 -0
  1329. package/examples/extensions/with-deps/package.json +22 -0
  1330. package/examples/extensions/working-indicator.ts +123 -0
  1331. package/examples/extensions/working-message-test.ts +25 -0
  1332. package/examples/remote/firebase-push-relay/README.md +79 -0
  1333. package/examples/remote/firebase-push-relay/firebase.json +12 -0
  1334. package/examples/remote/firebase-push-relay/firestore.indexes.json +11 -0
  1335. package/examples/remote/firebase-push-relay/firestore.rules +9 -0
  1336. package/examples/remote/firebase-push-relay/functions/core.js +511 -0
  1337. package/examples/remote/firebase-push-relay/functions/core.test.js +273 -0
  1338. package/examples/remote/firebase-push-relay/functions/index.js +413 -0
  1339. package/examples/remote/firebase-push-relay/functions/package-lock.json +2974 -0
  1340. package/examples/remote/firebase-push-relay/functions/package.json +18 -0
  1341. package/examples/remote/iroh-sidecar/README.md +211 -0
  1342. package/examples/remote/iroh-sidecar/client.mjs +554 -0
  1343. package/examples/remote/iroh-sidecar/common.mjs +195 -0
  1344. package/examples/remote/iroh-sidecar/host.mjs +4 -0
  1345. package/examples/remote/iroh-sidecar/package-lock.json +213 -0
  1346. package/examples/remote/iroh-sidecar/package.json +13 -0
  1347. package/examples/remote/iroh-sidecar/source-aware-run.mjs +41 -0
  1348. package/examples/rpc-extension-ui.ts +632 -0
  1349. package/examples/sdk/01-minimal.ts +26 -0
  1350. package/examples/sdk/02-custom-model.ts +53 -0
  1351. package/examples/sdk/03-custom-prompt.ts +70 -0
  1352. package/examples/sdk/04-skills.ts +55 -0
  1353. package/examples/sdk/05-tools.ts +48 -0
  1354. package/examples/sdk/06-extensions.ts +94 -0
  1355. package/examples/sdk/07-context-files.ts +42 -0
  1356. package/examples/sdk/08-prompt-templates.ts +51 -0
  1357. package/examples/sdk/09-api-keys-and-oauth.ts +52 -0
  1358. package/examples/sdk/10-settings.ts +53 -0
  1359. package/examples/sdk/11-sessions.ts +52 -0
  1360. package/examples/sdk/12-full-control.ts +78 -0
  1361. package/examples/sdk/13-session-runtime.ts +67 -0
  1362. package/examples/sdk/README.md +147 -0
  1363. package/npm-shrinkwrap.json +3442 -0
  1364. package/package.json +125 -19
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/core/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAoB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D,MAAM,MAAM,YAAY,GACrB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC,eAAO,MAAM,YAAY,sHAC2F,CAAC;AAErH,eAAO,MAAM,wBAAwB,yCAA0C,CAAC;AAEhF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACzD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CA4BA;AAMD,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC9B,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAyC7C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAe/E;AA0CD;;;GAGG;AACH,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAmJ7C;AAED,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;CACb;AAqCD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAWzF;AAED,iEAAiE;AACjE,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,YAAY,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAc5G;AAMD,eAAO,MAAM,oBAAoB,gwLA+Fd,CAAC;AAUpB,oDAAoD;AACpD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAsBlE;AAMD,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AA6JD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAiDxE;AAMD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACxC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,GAAG,aAAa,CAAC,EAC7D,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,GAAG,EAAE,MAAM,GACT,MAAM,CA6DR;AAMD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAexF;AAmBD,MAAM,WAAW,gBAAgB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,cAAc,CAAC;IACzB,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,cAAc,CAAC;IACtC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gFAAgF;IAChF,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACnD;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACrC,kEAAkE;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,CAAC,CAAC,GAAG,OAAO,EAC5B,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,EACvF,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAA;KAAE,GAChF,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB;AAED,UAAU,mBAAmB,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,CAAC,CAAC;CACX;AAED,MAAM,MAAM,mBAAmB,GAC5B;IACA,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;CACjB,GACD;IACA,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC;CAChC,GACD;IACA,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC5C,CAAC;AAEL,MAAM,MAAM,uBAAuB,GAChC;IACA,IAAI,EAAE,sBAAsB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,QAAQ,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B,GACD;IACA,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,QAAQ,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAChB,CAAC;AAEL,MAAM,WAAW,mBAAmB;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,uBAAuB,KAAK,IAAI,CAAC;IACzE,6EAA6E;IAC7E,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACrC,MAAM,EAAE,YAAY,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC9C,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,cAAc,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxG,cAAc,CAAC,EAAE,CAChB,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KACb,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;IACxD,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,6EAA6E;IAC7E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,uBAAuB,KAAK,IAAI,CAAC;CACzE;AAED,MAAM,MAAM,oBAAoB,GAC7B;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,UAAU,CAAC,EAAE,cAAc,CAAA;CAAE,GACpD;IACA,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,cAAc,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEL,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CAOlF;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC3C,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CAC1B,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAe3C;AA0BD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiKrG;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC,GAAG,MAAM,CASlH;AAsID;;;;;;;;;;;;;GAaG;AACH,UAAU,gBAAgB;IACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAanF;AAgFD;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAOnF","sourcesContent":["/**\n * Built-in /review support.\n *\n * Resolves a review target (uncommitted changes, branch diff, GitHub PR, or a\n * single commit) into a diff, runs an isolated in-process review session over\n * it, and parses the structured findings from the reviewer's final message.\n *\n * The review session is intentionally separate from the user's session: it has\n * its own context window and its own reviewer system prompt. It loads the\n * project's context files (AGENTS.md) and inherits the user's configured\n * extension tools, but excludes user extensions, skills, prompt templates,\n * themes, and subagents, and does not start MCP servers. After the review\n * completes the caller starts a fresh session seeded only with the findings.\n */\n\nimport { spawn } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { mkdtemp, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { ThinkingLevel } from \"@hansjm10/volt-agent-core\";\nimport type { AssistantMessage, Model } from \"@hansjm10/volt-ai\";\nimport type { AgentSessionEvent } from \"./agent-session.ts\";\nimport type { AgentSessionRuntime } from \"./agent-session-runtime.ts\";\nimport type { AuthStorage } from \"./auth-storage.ts\";\nimport { createExtensionRuntime } from \"./extensions/loader.ts\";\nimport type { ReplacedSessionContext, ToolDefinition } from \"./extensions/types.ts\";\nimport type { ModelRegistry } from \"./model-registry.ts\";\nimport { findExactModelReferenceMatch } from \"./model-resolver.ts\";\nimport { loadProjectContextFiles, type ResourceLoader } from \"./resource-loader.ts\";\nimport { createAgentSession } from \"./sdk.ts\";\nimport { SessionManager } from \"./session-manager.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\n\n// ============================================================================\n// Review targets\n// ============================================================================\n\nexport type ReviewTarget =\n\t| { kind: \"uncommitted\" }\n\t| { kind: \"branch\"; base?: string }\n\t| { kind: \"pr\"; number?: string }\n\t| { kind: \"commit\"; sha?: string };\n\nexport const REVIEW_USAGE =\n\t\"Usage: /review [tools | uncommitted | branch [base] | pr [number] | commit [sha]] (no arguments opens a selector)\";\n\nexport const REMOTE_REVIEW_TOOL_NAMES = [\"read\", \"grep\", \"find\", \"ls\"] as const;\n\n/**\n * Parse the argument text after \"/review\".\n * Returns an empty object when no arguments were given (caller shows a selector).\n */\nexport function parseReviewCommandArgs(argsText: string): {\n\ttarget?: ReviewTarget;\n\tconfigureTools?: boolean;\n\terror?: string;\n} {\n\tconst tokens = argsText.trim().split(/\\s+/).filter(Boolean);\n\tif (tokens.length === 0) {\n\t\treturn {};\n\t}\n\n\tconst keyword = tokens[0].toLowerCase();\n\t// Reject trailing tokens beyond the keyword's expected arity so mistakes like\n\t// `/review pr 42 foo` fail loudly instead of silently dropping the extra args.\n\tconst tooManyArgs = (max: number): { error: string } | undefined =>\n\t\ttokens.length > max ? { error: `Unexpected arguments after \"${tokens[0]}\". ${REVIEW_USAGE}` } : undefined;\n\tswitch (keyword) {\n\t\tcase \"tools\":\n\t\t\treturn tooManyArgs(1) ?? { configureTools: true };\n\t\tcase \"uncommitted\":\n\t\tcase \"unstaged\":\n\t\tcase \"working\":\n\t\t\treturn tooManyArgs(1) ?? { target: { kind: \"uncommitted\" } };\n\t\tcase \"branch\":\n\t\t\treturn tooManyArgs(2) ?? { target: { kind: \"branch\", base: tokens[1] } };\n\t\tcase \"pr\":\n\t\t\treturn tooManyArgs(2) ?? { target: { kind: \"pr\", number: tokens[1] } };\n\t\tcase \"commit\":\n\t\t\t// Without a SHA the caller shows a commit picker.\n\t\t\treturn tooManyArgs(2) ?? { target: { kind: \"commit\", sha: tokens[1] } };\n\t\tdefault:\n\t\t\treturn { error: `Unknown review target \"${tokens[0]}\". ${REVIEW_USAGE}` };\n\t}\n}\n\n// ============================================================================\n// Target resolution (git / gh)\n// ============================================================================\n\n/** A review target resolved to a concrete diff plus reviewer-facing metadata. */\nexport interface ResolvedReview {\n\t/** Human-readable description, e.g. `branch changes vs main`. */\n\tdescription: string;\n\t/** Command the reviewer can re-run to reproduce the diff. */\n\tdiffCommand: string;\n\t/** The diff text (possibly truncated, see `truncated`). */\n\tdiff: string;\n\t/** True when the diff exceeded the inline size limit and was truncated. */\n\ttruncated: boolean;\n\t/** Extra context: commit log, PR metadata, untracked file list. */\n\textraContext?: string;\n}\n\n/** Maximum diff characters embedded inline in the review prompt. */\nexport const MAX_REVIEW_DIFF_CHARS = 150_000;\n\ninterface CommandResult {\n\tok: boolean;\n\tstdout: string;\n\tstderr: string;\n}\n\nfunction runCommand(\n\tcommand: string,\n\targs: string[],\n\tcwd: string,\n\tenv?: Record<string, string>,\n): Promise<CommandResult> {\n\treturn new Promise((resolve) => {\n\t\tconst proc = spawn(command, args, {\n\t\t\tcwd,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t\tenv: env ? { ...process.env, ...env } : process.env,\n\t\t});\n\t\tlet stdout = \"\";\n\t\tlet stderr = \"\";\n\t\tproc.stdout.on(\"data\", (data) => {\n\t\t\tstdout += data.toString();\n\t\t});\n\t\tproc.stderr.on(\"data\", (data) => {\n\t\t\tstderr += data.toString();\n\t\t});\n\t\tproc.on(\"error\", (error) => {\n\t\t\tresolve({ ok: false, stdout, stderr: error.message });\n\t\t});\n\t\tproc.on(\"close\", (code) => {\n\t\t\tresolve({ ok: code === 0, stdout, stderr });\n\t\t});\n\t});\n}\n\nfunction isHighSurrogate(codeUnit: number): boolean {\n\treturn codeUnit >= 0xd800 && codeUnit <= 0xdbff;\n}\n\nexport function truncateDiff(diff: string): { diff: string; truncated: boolean } {\n\tif (diff.length <= MAX_REVIEW_DIFF_CHARS) {\n\t\treturn { diff, truncated: false };\n\t}\n\tlet end = MAX_REVIEW_DIFF_CHARS;\n\t// Prefer cutting on a line boundary so the preview ends with whole diff lines\n\t// rather than a partial hunk. For a single line longer than the limit there is\n\t// no boundary, so fall back to a raw cut that does not split a surrogate pair.\n\tconst lastNewline = diff.lastIndexOf(\"\\n\", end - 1);\n\tif (lastNewline >= 0) {\n\t\tend = lastNewline + 1;\n\t} else if (isHighSurrogate(diff.charCodeAt(end - 1))) {\n\t\tend -= 1;\n\t}\n\treturn { diff: diff.slice(0, end), truncated: true };\n}\n\nasync function detectBaseBranch(cwd: string): Promise<string | undefined> {\n\tconst originHead = await runCommand(\"git\", [\"symbolic-ref\", \"--short\", \"refs/remotes/origin/HEAD\"], cwd);\n\tif (originHead.ok) {\n\t\tconst ref = originHead.stdout.trim();\n\t\tif (ref) {\n\t\t\t// Keep the remote-tracking ref (e.g. \"origin/main\") rather than stripping\n\t\t\t// to \"main\": it always resolves and reflects the fetched upstream instead\n\t\t\t// of a possibly stale or missing local branch (single-branch/shallow checkouts).\n\t\t\treturn ref;\n\t\t}\n\t}\n\tfor (const candidate of [\"main\", \"master\"]) {\n\t\tconst exists = await runCommand(\"git\", [\"rev-parse\", \"--verify\", \"--quiet\", candidate], cwd);\n\t\tif (exists.ok) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolve a base ref to something that exists. Returns the ref itself when it\n * resolves, otherwise the matching remote-tracking ref (`origin/<base>`) when\n * only that exists (e.g. a checkout that has no local copy of the base branch).\n */\nasync function resolveBaseRef(base: string, cwd: string): Promise<string | undefined> {\n\tconst direct = await runCommand(\"git\", [\"rev-parse\", \"--verify\", \"--quiet\", base], cwd);\n\tif (direct.ok) {\n\t\treturn base;\n\t}\n\tif (!base.startsWith(\"origin/\")) {\n\t\tconst remote = `origin/${base}`;\n\t\tconst remoteExists = await runCommand(\"git\", [\"rev-parse\", \"--verify\", \"--quiet\", remote], cwd);\n\t\tif (remoteExists.ok) {\n\t\t\treturn remote;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolve a review target into a concrete diff.\n * Returns `{ error }` for user-facing failures (not a git repo, empty diff, gh missing, ...).\n */\nexport async function resolveReviewTarget(\n\ttarget: ReviewTarget,\n\tcwd: string,\n): Promise<ResolvedReview | { error: string }> {\n\tconst inRepo = await runCommand(\"git\", [\"rev-parse\", \"--is-inside-work-tree\"], cwd);\n\tif (!inRepo.ok) {\n\t\treturn { error: \"Not inside a git repository.\" };\n\t}\n\n\tswitch (target.kind) {\n\t\tcase \"uncommitted\": {\n\t\t\tlet diffResult = await runCommand(\"git\", [\"diff\", \"HEAD\"], cwd);\n\t\t\tlet diffCommand = \"git diff HEAD\";\n\t\t\tif (!diffResult.ok) {\n\t\t\t\t// No commits yet: combine the staged diff (index vs the empty tree)\n\t\t\t\t// with the worktree diff so staged changes are not missed.\n\t\t\t\tconst stagedResult = await runCommand(\"git\", [\"diff\", \"--cached\"], cwd);\n\t\t\t\tconst worktreeResult = await runCommand(\"git\", [\"diff\"], cwd);\n\t\t\t\tif (!stagedResult.ok || !worktreeResult.ok) {\n\t\t\t\t\tconst failed = stagedResult.ok ? worktreeResult : stagedResult;\n\t\t\t\t\treturn { error: `git diff failed: ${failed.stderr.trim()}` };\n\t\t\t\t}\n\t\t\t\tdiffResult = { ok: true, stdout: stagedResult.stdout + worktreeResult.stdout, stderr: \"\" };\n\t\t\t\tdiffCommand = \"git diff --cached; git diff\";\n\t\t\t}\n\t\t\tconst untrackedResult = await runCommand(\"git\", [\"ls-files\", \"--others\", \"--exclude-standard\"], cwd);\n\t\t\tconst untracked = untrackedResult.ok\n\t\t\t\t? untrackedResult.stdout\n\t\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t\t.map((line) => line.trim())\n\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t: [];\n\t\t\tif (!diffResult.stdout.trim() && untracked.length === 0) {\n\t\t\t\treturn { error: \"No uncommitted changes to review.\" };\n\t\t\t}\n\t\t\tconst { diff, truncated } = truncateDiff(diffResult.stdout);\n\t\t\treturn {\n\t\t\t\tdescription: \"uncommitted changes\",\n\t\t\t\tdiffCommand,\n\t\t\t\tdiff,\n\t\t\t\ttruncated,\n\t\t\t\textraContext:\n\t\t\t\t\tuntracked.length > 0\n\t\t\t\t\t\t? `Untracked files (not in the diff; read them directly):\\n${untracked.map((file) => `- ${file}`).join(\"\\n\")}`\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"branch\": {\n\t\t\tconst requestedBase = target.base ?? (await detectBaseBranch(cwd));\n\t\t\tif (!requestedBase) {\n\t\t\t\treturn { error: \"Could not detect a base branch. Use /review branch <base>.\" };\n\t\t\t}\n\t\t\tconst base = await resolveBaseRef(requestedBase, cwd);\n\t\t\tif (!base) {\n\t\t\t\treturn { error: `Base branch \"${requestedBase}\" not found.` };\n\t\t\t}\n\t\t\tconst diffResult = await runCommand(\"git\", [\"diff\", `${base}...HEAD`], cwd);\n\t\t\tif (!diffResult.ok) {\n\t\t\t\treturn { error: `git diff failed: ${diffResult.stderr.trim()}` };\n\t\t\t}\n\t\t\tif (!diffResult.stdout.trim()) {\n\t\t\t\treturn { error: `No changes between ${base} and HEAD.` };\n\t\t\t}\n\t\t\tconst logResult = await runCommand(\"git\", [\"log\", \"--oneline\", `${base}..HEAD`], cwd);\n\t\t\tconst { diff, truncated } = truncateDiff(diffResult.stdout);\n\t\t\treturn {\n\t\t\t\tdescription: `branch changes vs ${base}`,\n\t\t\t\tdiffCommand: `git diff ${base}...HEAD`,\n\t\t\t\tdiff,\n\t\t\t\ttruncated,\n\t\t\t\textraContext: logResult.ok && logResult.stdout.trim() ? `Commits:\\n${logResult.stdout.trim()}` : undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"pr\": {\n\t\t\tconst numberArgs = target.number ? [target.number] : [];\n\t\t\tconst viewResult = await runCommand(\n\t\t\t\t\"gh\",\n\t\t\t\t[\"pr\", \"view\", ...numberArgs, \"--json\", \"number,title,body,baseRefName,headRefName,url\"],\n\t\t\t\tcwd,\n\t\t\t);\n\t\t\tif (!viewResult.ok) {\n\t\t\t\tconst stderr = viewResult.stderr.trim();\n\t\t\t\tif (/ENOENT|not found|not recognized/i.test(stderr)) {\n\t\t\t\t\treturn { error: \"GitHub CLI (gh) is not installed. Install it from https://cli.github.com/\" };\n\t\t\t\t}\n\t\t\t\treturn { error: `gh pr view failed: ${stderr}` };\n\t\t\t}\n\t\t\tlet prInfo: {\n\t\t\t\tnumber: number;\n\t\t\t\ttitle: string;\n\t\t\t\tbody: string;\n\t\t\t\tbaseRefName: string;\n\t\t\t\theadRefName: string;\n\t\t\t\turl: string;\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tprInfo = JSON.parse(viewResult.stdout);\n\t\t\t} catch {\n\t\t\t\treturn { error: \"Could not parse gh pr view output.\" };\n\t\t\t}\n\t\t\tconst diffResult = await runCommand(\"gh\", [\"pr\", \"diff\", String(prInfo.number)], cwd);\n\t\t\tif (!diffResult.ok) {\n\t\t\t\treturn { error: `gh pr diff failed: ${diffResult.stderr.trim()}` };\n\t\t\t}\n\t\t\tif (!diffResult.stdout.trim()) {\n\t\t\t\treturn { error: `PR #${prInfo.number} has an empty diff.` };\n\t\t\t}\n\t\t\tconst { diff, truncated } = truncateDiff(diffResult.stdout);\n\t\t\tconst bodyText = prInfo.body?.trim();\n\t\t\treturn {\n\t\t\t\tdescription: `PR #${prInfo.number} (${prInfo.title})`,\n\t\t\t\tdiffCommand: `gh pr diff ${prInfo.number}`,\n\t\t\t\tdiff,\n\t\t\t\ttruncated,\n\t\t\t\textraContext: [\n\t\t\t\t\t`PR #${prInfo.number}: ${prInfo.title}`,\n\t\t\t\t\t`Base branch: ${prInfo.baseRefName}`,\n\t\t\t\t\t`Head branch: ${prInfo.headRefName}`,\n\t\t\t\t\t`URL: ${prInfo.url}`,\n\t\t\t\t\t`Note: the local worktree may not have the PR head checked out. Do not assume local files match the diff; inspect PR file contents against fetched refs instead (e.g. \\`git fetch origin ${prInfo.headRefName}\\` then \\`git show FETCH_HEAD:<path>\\`).`,\n\t\t\t\t\tbodyText ? `Description:\\n${bodyText}` : undefined,\n\t\t\t\t]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.join(\"\\n\"),\n\t\t\t};\n\t\t}\n\t\tcase \"commit\": {\n\t\t\tif (!target.sha) {\n\t\t\t\treturn { error: \"Missing commit SHA.\" };\n\t\t\t}\n\t\t\t// --diff-merges=first-parent: plain `git show` prints no patch hunks\n\t\t\t// for merge commits; diff against the first parent shows what the\n\t\t\t// merge brought into the branch. Non-merge commits are unaffected.\n\t\t\tconst diffResult = await runCommand(\n\t\t\t\t\"git\",\n\t\t\t\t[\"show\", \"--stat\", \"--patch\", \"--diff-merges=first-parent\", target.sha],\n\t\t\t\tcwd,\n\t\t\t);\n\t\t\tif (!diffResult.ok) {\n\t\t\t\treturn { error: `git show failed: ${diffResult.stderr.trim()}` };\n\t\t\t}\n\t\t\tconst { diff, truncated } = truncateDiff(diffResult.stdout);\n\t\t\treturn {\n\t\t\t\tdescription: `commit ${target.sha}`,\n\t\t\t\tdiffCommand: `git show --stat --patch --diff-merges=first-parent ${target.sha}`,\n\t\t\t\tdiff,\n\t\t\t\ttruncated,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/** A commit entry for the /review commit picker. */\nexport interface RecentCommit {\n\tsha: string;\n\tsubject: string;\n\t/** Relative author date, e.g. \"2 days ago\". */\n\tdate: string;\n}\n\n/**\n * Order base-branch candidates for the picker. Canonical bases come first\n * (local main/master, then their origin/ equivalents), then other local\n * branches, then other remote-tracking branches; each tier is sorted\n * alphabetically. Local vs remote is known from the source lists, so branch\n * names containing slashes (e.g. `feature/login`) are classified correctly.\n */\nfunction orderBaseBranches(local: string[], remote: string[]): string[] {\n\tconst scored: Array<{ ref: string; tier: number }> = [];\n\tconst seen = new Set<string>();\n\tconst add = (ref: string, tier: number): void => {\n\t\tif (!ref || seen.has(ref)) {\n\t\t\treturn;\n\t\t}\n\t\tseen.add(ref);\n\t\tscored.push({ ref, tier });\n\t};\n\tfor (const ref of local) {\n\t\tadd(ref, ref === \"main\" ? 0 : ref === \"master\" ? 1 : 4);\n\t}\n\tfor (const ref of remote) {\n\t\tadd(ref, ref === \"origin/main\" ? 2 : ref === \"origin/master\" ? 3 : 5);\n\t}\n\treturn scored\n\t\t.sort((a, b) => (a.tier === b.tier ? a.ref.localeCompare(b.ref) : a.tier - b.tier))\n\t\t.map((entry) => entry.ref);\n}\n\nfunction splitBranchLines(stdout: string): string[] {\n\treturn stdout\n\t\t.split(\"\\n\")\n\t\t.map((line) => line.trim())\n\t\t.filter(Boolean);\n}\n\n/**\n * List candidate base branches for the /review base-branch picker: local\n * branches plus remote-tracking branches (e.g. `origin/main`). The `origin/HEAD`\n * alias (which `%(refname:short)` renders as the bare remote name) is skipped.\n */\nexport async function listBaseBranches(cwd: string): Promise<string[] | { error: string }> {\n\tconst localResult = await runCommand(\"git\", [\"for-each-ref\", \"--format=%(refname:short)\", \"refs/heads\"], cwd);\n\tif (!localResult.ok) {\n\t\treturn { error: `git branch failed: ${localResult.stderr.trim()}` };\n\t}\n\tconst local = splitBranchLines(localResult.stdout);\n\tconst remoteResult = await runCommand(\"git\", [\"for-each-ref\", \"--format=%(refname:short)\", \"refs/remotes\"], cwd);\n\tconst remote = remoteResult.ok\n\t\t? splitBranchLines(remoteResult.stdout).filter((ref) => ref.includes(\"/\") && !ref.endsWith(\"/HEAD\"))\n\t\t: [];\n\treturn orderBaseBranches(local, remote);\n}\n\n/** List recent commits on HEAD for the /review commit picker. */\nexport async function listRecentCommits(cwd: string, limit = 30): Promise<RecentCommit[] | { error: string }> {\n\tconst result = await runCommand(\"git\", [\"log\", \"-n\", String(limit), \"--pretty=format:%h%x09%cr%x09%s\"], cwd);\n\tif (!result.ok) {\n\t\treturn { error: `git log failed: ${result.stderr.trim()}` };\n\t}\n\tconst commits: RecentCommit[] = [];\n\tfor (const line of result.stdout.split(\"\\n\")) {\n\t\tconst [sha, date, ...subjectParts] = line.split(\"\\t\");\n\t\tif (!sha?.trim()) {\n\t\t\tcontinue;\n\t\t}\n\t\tcommits.push({ sha: sha.trim(), date: date?.trim() ?? \"\", subject: subjectParts.join(\"\\t\").trim() });\n\t}\n\treturn commits;\n}\n\n// ============================================================================\n// Review prompt\n// ============================================================================\n\nexport const REVIEW_SYSTEM_PROMPT = `<reviewer_prompt>\n <role>\n You are an expert code reviewer operating inside volt, a coding agent harness.\n You review a code change comprehensively and report every substantiated finding that matters.\n </role>\n\n <goal>\n Complete the whole review, not a first-hit bug hunt. Do not stop after finding one or two issues.\n Continue until you have reviewed the full diff and the relevant surrounding code.\n </goal>\n\n <tool_use>\n <instruction>Build a map of the changed files, changed symbols, and intended behavior before judging individual hunks.</instruction>\n <instruction>Read the full files around changed hunks, or enough of each file to understand its invariants; never judge a hunk in isolation.</instruction>\n <instruction>Trace callers, callees, tests, configuration, and related code when a change could break an invariant elsewhere.</instruction>\n <instruction>If the inline diff is truncated, run the provided diff command and review the full diff before finalizing.</instruction>\n <instruction>If you suspect a behavioral bug, verify it when feasible: run the relevant tests, or write a small scratch test/script to confirm.</instruction>\n <instruction>Delete any scratch files you create and revert any temporary edits before finishing, leaving the working tree as you found it.</instruction>\n </tool_use>\n\n <review_workflow>\n <step id=\"1\" name=\"scope\">Identify all changed files, changed entry points, and the intended behavior.</step>\n <step id=\"2\" name=\"context\">Read surrounding code and project instructions relevant to each change.</step>\n <step id=\"3\" name=\"trace\">Follow call sites, data flow, configuration, and tests for changes that affect contracts or invariants.</step>\n <step id=\"4\" name=\"verify\">Run targeted commands or scratch checks for suspected behavioral bugs when feasible.</step>\n <step id=\"5\" name=\"coverage\">Apply the checklist below across the whole diff before finalizing.</step>\n <step id=\"6\" name=\"report\">Report all independent substantiated findings in the required payload.</step>\n </review_workflow>\n\n <coverage_checklist>\n <item>Runtime correctness, logic errors, regressions, and broken invariants.</item>\n <item>Missed call sites, API/contract compatibility, migrations, and configuration changes.</item>\n <item>Edge cases: empty input, partial failure, cancellation/abort, retries, large inputs, platform differences, and boundary values.</item>\n <item>Error handling, cleanup, data loss, concurrency, async ordering, and race conditions.</item>\n <item>Security and privacy issues: trust boundaries, injection, path traversal, credential exposure, unsafe file/network operations.</item>\n <item>Tests: missing or weakened coverage for changed behavior, and whether existing tests still exercise the intended behavior.</item>\n <item>Project-specific conventions and instructions from project context.</item>\n </coverage_checklist>\n\n <finding_rules>\n <flag>Bugs and logic errors that affect behavior.</flag>\n <flag>Security issues, data loss, race conditions, broken error handling.</flag>\n <flag>Changes that contradict explicit project conventions from project context.</flag>\n <flag>Regressions: removed checks, broken invariants, missed call sites.</flag>\n <flag>All independent, substantiated priority 0, 1, or 2 findings. Include priority 3 only when it meaningfully helps the author.</flag>\n <do_not_flag>Style nits, formatting, or naming preferences.</do_not_flag>\n <do_not_flag>Speculative concerns you could not substantiate from the code.</do_not_flag>\n <do_not_flag>Pre-existing issues in code the change does not touch, unless the change makes them worse.</do_not_flag>\n <grouping>If multiple hunks share one root cause, group them into one finding; otherwise do not omit independent issues.</grouping>\n <empty_findings>Use an empty findings array only after completing the workflow and checklist.</empty_findings>\n </finding_rules>\n\n <priority_scale>\n <priority value=\"0\">Must fix before landing.</priority>\n <priority value=\"1\">Should fix.</priority>\n <priority value=\"2\">Worth fixing.</priority>\n <priority value=\"3\">Optional.</priority>\n </priority_scale>\n\n <output_contract>\n <format>End your final message with one XML response envelope. Do not put anything after the closing response tag.</format>\n <summary>Before the payload, include a short summary of what you reviewed, what you verified, and any important areas you could not verify.</summary>\n <payload_rules>\n <rule>The payload content must be valid JSON. Do not wrap it in markdown fences.</rule>\n <rule>overall_correctness must be \"correct\" or \"incorrect\".</rule>\n <rule>Confidence is a number from 0.0 to 1.0 and must be grounded in code you read or executed.</rule>\n <rule>Use empty arrays in coverage when nothing applies.</rule>\n </payload_rules>\n <response_shape>\n<response>\n <summary>Short prose summary.</summary>\n <payload>\n{\n \"findings\": [\n {\n \"title\": \"Short imperative summary\",\n \"body\": \"Explanation with evidence: what is wrong, why, and the concrete impact. Reference files and lines.\",\n \"priority\": 1,\n \"confidence\": 0.9,\n \"file\": \"relative/path/to/file.ts\",\n \"line\": \"120-134\"\n }\n ],\n \"coverage\": {\n \"files_reviewed\": [\"relative/path/to/file.ts\"],\n \"commands_run\": [\"npm run check\"],\n \"unchecked_areas\": [\"Integration tests not run: reason\"]\n },\n \"overall_correctness\": \"correct\",\n \"overall_explanation\": \"One or two sentences on whether the change is safe to land.\"\n}\n </payload>\n</response>\n </response_shape>\n </output_contract>\n</reviewer_prompt>`;\n\nfunction escapeXml(value: string): string {\n\treturn value.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n}\n\nfunction wrapXmlCdata(value: string): string {\n\treturn `<![CDATA[${value.replace(/\\]\\]>/g, \"]]]]><![CDATA[>\")}]]>`;\n}\n\n/** Build the user prompt for the review session. */\nexport function buildReviewPrompt(resolved: ResolvedReview): string {\n\tconst diffNote = resolved.truncated\n\t\t? `The diff is too large to include inline. Run \\`${resolved.diffCommand}\\` yourself to read the full diff. A truncated preview is included in the diff node.`\n\t\t: `Reproduce this diff with \\`${resolved.diffCommand}\\`.`;\n\tconst parts: string[] = [\n\t\t\"<review_request>\",\n\t\t\" <target>\",\n\t\t` <description>${escapeXml(resolved.description)}</description>`,\n\t\t` <diff_command>${escapeXml(resolved.diffCommand)}</diff_command>`,\n\t\t` <diff_truncated>${resolved.truncated ? \"true\" : \"false\"}</diff_truncated>`,\n\t\t\" </target>\",\n\t];\n\tif (resolved.extraContext) {\n\t\tparts.push(` <extra_context>${wrapXmlCdata(resolved.extraContext)}</extra_context>`);\n\t}\n\tparts.push(\n\t\t` <diff_note>${escapeXml(diffNote)}</diff_note>`,\n\t\t` <diff>${wrapXmlCdata(resolved.diff)}</diff>`,\n\t\t\" <task>Investigate the surrounding code before judging any hunk. Complete the review workflow across the whole diff before finalizing; do not stop after the first finding. Verify suspected bugs when feasible. Then produce your findings in the required XML response envelope with a JSON payload.</task>\",\n\t\t\"</review_request>\",\n\t);\n\treturn parts.join(\"\\n\");\n}\n\n// ============================================================================\n// Findings parsing\n// ============================================================================\n\nexport interface ReviewFinding {\n\ttitle: string;\n\tbody: string;\n\t/** 0 = must fix, 1 = should fix, 2 = worth fixing, 3 = optional. */\n\tpriority?: number;\n\t/** 0.0 - 1.0 */\n\tconfidence?: number;\n\tfile?: string;\n\tline?: string;\n}\n\nexport interface ReviewCoverage {\n\tfilesReviewed: string[];\n\tcommandsRun: string[];\n\tuncheckedAreas: string[];\n}\n\nexport interface ParsedReview {\n\tfindings: ReviewFinding[];\n\tcoverage?: ReviewCoverage;\n\toverallCorrectness?: string;\n\toverallExplanation?: string;\n}\n\nfunction coerceFinding(raw: unknown): ReviewFinding | undefined {\n\tif (typeof raw !== \"object\" || raw === null) {\n\t\treturn undefined;\n\t}\n\tconst record = raw as Record<string, unknown>;\n\tconst title = typeof record.title === \"string\" ? record.title.trim() : \"\";\n\tconst body = typeof record.body === \"string\" ? record.body.trim() : \"\";\n\tif (!title && !body) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\ttitle: title || body.slice(0, 80),\n\t\tbody,\n\t\tpriority: typeof record.priority === \"number\" ? record.priority : undefined,\n\t\tconfidence: typeof record.confidence === \"number\" ? record.confidence : undefined,\n\t\tfile: typeof record.file === \"string\" && record.file.trim() ? record.file.trim() : undefined,\n\t\tline:\n\t\t\ttypeof record.line === \"string\" && record.line.trim()\n\t\t\t\t? record.line.trim()\n\t\t\t\t: typeof record.line === \"number\"\n\t\t\t\t\t? String(record.line)\n\t\t\t\t\t: undefined,\n\t};\n}\n\nfunction coerceStringArray(raw: unknown): string[] {\n\tif (!Array.isArray(raw)) {\n\t\treturn [];\n\t}\n\treturn raw\n\t\t.filter((value): value is string => typeof value === \"string\")\n\t\t.map((value) => value.trim())\n\t\t.filter(Boolean);\n}\n\nfunction coerceCoverage(raw: unknown): ReviewCoverage | undefined {\n\tif (typeof raw !== \"object\" || raw === null) {\n\t\treturn undefined;\n\t}\n\tconst record = raw as Record<string, unknown>;\n\tconst coverage = {\n\t\tfilesReviewed: coerceStringArray(record.files_reviewed),\n\t\tcommandsRun: coerceStringArray(record.commands_run),\n\t\tuncheckedAreas: coerceStringArray(record.unchecked_areas),\n\t};\n\tif (\n\t\tcoverage.filesReviewed.length === 0 &&\n\t\tcoverage.commandsRun.length === 0 &&\n\t\tcoverage.uncheckedAreas.length === 0\n\t) {\n\t\treturn undefined;\n\t}\n\treturn coverage;\n}\n\ninterface JsonCandidate {\n\tindex: number;\n\ttext: string;\n}\n\nconst NAMED_XML_ENTITIES: Record<string, string> = {\n\tquot: '\"',\n\tapos: \"'\",\n\tlt: \"<\",\n\tgt: \">\",\n\tamp: \"&\",\n};\n\n// Matches the five named entities plus decimal (&#38;) and hex (&#x26;/&#X26;)\n// character references. A single global pass decodes each reference exactly once\n// left-to-right, so `&amp;lt;` yields `&lt;` (no double-decode).\nconst XML_ENTITY_PATTERN = /&(?:#(\\d+)|#[xX]([0-9a-fA-F]+)|(quot|apos|lt|gt|amp));/g;\n\nfunction decodeXmlEntities(value: string): string {\n\treturn value.replace(\n\t\tXML_ENTITY_PATTERN,\n\t\t(match, dec: string | undefined, hex: string | undefined, named: string | undefined) => {\n\t\t\tif (named !== undefined) {\n\t\t\t\treturn NAMED_XML_ENTITIES[named] ?? match;\n\t\t\t}\n\t\t\tconst code = dec !== undefined ? Number.parseInt(dec, 10) : Number.parseInt(hex ?? \"\", 16);\n\t\t\t// Leave invalid, out-of-range, or surrogate code points as-is rather than\n\t\t\t// producing replacement or lone-surrogate characters that could break JSON.\n\t\t\tif (!Number.isFinite(code) || code < 0 || code > 0x10ffff || (code >= 0xd800 && code <= 0xdfff)) {\n\t\t\t\treturn match;\n\t\t\t}\n\t\t\treturn String.fromCodePoint(code);\n\t\t},\n\t);\n}\n\n/** Unwrap CDATA sections; the enclosed text is literal and needs no entity decoding. */\nfunction unwrapCdata(value: string): string {\n\treturn value.replace(/<!\\[CDATA\\[([\\s\\S]*?)\\]\\]>/g, \"$1\");\n}\n\nfunction stripJsonMarkdownFence(value: string): string {\n\tconst trimmed = value.trim();\n\tconst match = /^```(?:json)?[ \\t]*(?:\\r?\\n)?([\\s\\S]*?)\\r?\\n?```$/i.exec(trimmed);\n\treturn match?.[1]?.trim() ?? trimmed;\n}\n\nfunction collectXmlPayloadCandidates(text: string): JsonCandidate[] {\n\tconst candidates: JsonCandidate[] = [];\n\tconst payloadRegex = /<payload\\b[^>]*>([\\s\\S]*?)<\\/payload>/gi;\n\tlet match = payloadRegex.exec(text);\n\twhile (match !== null) {\n\t\tcandidates.push({ index: match.index, text: unwrapCdata(match[1] ?? \"\").trim() });\n\t\tmatch = payloadRegex.exec(text);\n\t}\n\treturn candidates;\n}\n\n/** Parse one JSON candidate into a ParsedReview, or undefined if it lacks a findings array. */\nfunction tryParseFindingsObject(candidate: string): ParsedReview | undefined {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(candidate);\n\t} catch {\n\t\treturn undefined;\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) {\n\t\treturn undefined;\n\t}\n\tconst record = parsed as Record<string, unknown>;\n\tif (!Array.isArray(record.findings)) {\n\t\treturn undefined;\n\t}\n\tconst findings = record.findings\n\t\t.map(coerceFinding)\n\t\t.filter((finding): finding is ReviewFinding => finding !== undefined);\n\treturn {\n\t\tfindings,\n\t\tcoverage: coerceCoverage(record.coverage),\n\t\toverallCorrectness: typeof record.overall_correctness === \"string\" ? record.overall_correctness : undefined,\n\t\toverallExplanation: typeof record.overall_explanation === \"string\" ? record.overall_explanation : undefined,\n\t};\n}\n\n/**\n * Parse a JSON candidate, retrying with XML entities decoded only when the raw\n * text does not parse. Trying raw first avoids corrupting payloads whose string\n * values legitimately contain entity-like text (e.g. a finding that mentions\n * `&amp;` or `&quot;`), while still recovering payloads that a model XML-escaped\n * to keep them valid inside the <payload> tag.\n */\nfunction parseFindingsCandidate(candidate: string): ParsedReview | undefined {\n\tconst parsed = tryParseFindingsObject(candidate);\n\tif (parsed) {\n\t\treturn parsed;\n\t}\n\tconst decoded = decodeXmlEntities(candidate);\n\treturn decoded === candidate ? undefined : tryParseFindingsObject(decoded);\n}\n\n/**\n * Parse the reviewer's final message. Looks for the last XML payload, fenced json block,\n * or bare JSON object containing a findings array. Returns undefined when no parseable block exists.\n */\nexport function parseReviewOutput(text: string): ParsedReview | undefined {\n\t// Extract XML payloads first so the preferred response envelope can contain prose safely.\n\tconst candidates = collectXmlPayloadCandidates(text);\n\n\t// Extract fenced blocks line by line. Any info string opens a block (so a\n\t// ```ts block in prose doesn't pair fences off-by-one), but only json or\n\t// untagged blocks become candidates. A closer must be a bare ``` line, so\n\t// fences embedded inside JSON strings don't terminate the block early.\n\tlet blockLines: string[] | undefined;\n\tlet blockIsCandidate = false;\n\tlet blockStartIndex = 0;\n\tlet lineStartIndex = 0;\n\tfor (const line of text.split(\"\\n\")) {\n\t\tconst trimmed = line.trim();\n\t\tif (blockLines === undefined) {\n\t\t\tif (trimmed.startsWith(\"```\")) {\n\t\t\t\tconst infoString = trimmed.slice(3).trim();\n\t\t\t\tblockLines = [];\n\t\t\t\tblockIsCandidate = infoString === \"\" || infoString === \"json\";\n\t\t\t\tblockStartIndex = lineStartIndex;\n\t\t\t}\n\t\t} else if (trimmed === \"```\") {\n\t\t\tif (blockIsCandidate) {\n\t\t\t\tcandidates.push({ index: blockStartIndex, text: blockLines.join(\"\\n\") });\n\t\t\t}\n\t\t\tblockLines = undefined;\n\t\t} else {\n\t\t\tblockLines.push(line);\n\t\t}\n\t\tlineStartIndex += line.length + 1;\n\t}\n\t// An unterminated trailing block is still worth trying.\n\tif (blockLines !== undefined && blockIsCandidate) {\n\t\tcandidates.push({ index: blockStartIndex, text: blockLines.join(\"\\n\") });\n\t}\n\t// Also try the whole text in case the model emitted bare JSON.\n\tcandidates.push({ index: 0, text });\n\n\tfor (const candidateEntry of candidates.sort((a, b) => b.index - a.index)) {\n\t\tconst candidate = stripJsonMarkdownFence(candidateEntry.text);\n\t\tif (!candidate.startsWith(\"{\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst parsed = parseFindingsCandidate(candidate);\n\t\tif (parsed) {\n\t\t\treturn parsed;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n// ============================================================================\n// Seeding the fresh session\n// ============================================================================\n\n/**\n * Strip the machine-readable `<response>…</response>` envelope (summary + JSON\n * payload) from reviewer assistant text so a live in-process render shows the\n * reviewer's prose and tool activity instead of raw markup. Also drops a\n * trailing unterminated `<response>` so a mid-stream partial envelope never\n * flashes. The formatted findings are surfaced separately after the handoff.\n */\nexport function stripReviewEnvelopeForDisplay(text: string): string {\n\treturn text\n\t\t.replace(/<response\\b[\\s\\S]*?<\\/response>/gi, \"\")\n\t\t.replace(/<response\\b[\\s\\S]*$/i, \"\")\n\t\t.trim();\n}\n\n/**\n * Format the review result as the seed message for the fresh post-review session.\n * This text is both displayed and sent to the LLM as context.\n */\nexport function formatReviewForNewSession(\n\tresolved: Pick<ResolvedReview, \"description\" | \"diffCommand\">,\n\tparsed: ParsedReview | undefined,\n\traw: string,\n): string {\n\tconst lines: string[] = [\n\t\t`An automated code review of ${resolved.description} was completed in a separate session.`,\n\t\t\"\",\n\t];\n\n\tif (!parsed) {\n\t\tlines.push(\"The reviewer's report (unstructured):\", \"\", raw.trim());\n\t} else {\n\t\tif (parsed.overallCorrectness || parsed.overallExplanation) {\n\t\t\tconst verdict = [parsed.overallCorrectness, parsed.overallExplanation].filter(Boolean).join(\" — \");\n\t\t\tlines.push(`Overall: ${verdict}`, \"\");\n\t\t}\n\t\tif (parsed.coverage) {\n\t\t\tconst coverageLines: string[] = [];\n\t\t\tif (parsed.coverage.filesReviewed.length > 0) {\n\t\t\t\tcoverageLines.push(`Files reviewed: ${parsed.coverage.filesReviewed.join(\", \")}`);\n\t\t\t}\n\t\t\tif (parsed.coverage.commandsRun.length > 0) {\n\t\t\t\tcoverageLines.push(`Commands run: ${parsed.coverage.commandsRun.join(\"; \")}`);\n\t\t\t}\n\t\t\tif (parsed.coverage.uncheckedAreas.length > 0) {\n\t\t\t\tcoverageLines.push(`Unchecked areas: ${parsed.coverage.uncheckedAreas.join(\"; \")}`);\n\t\t\t}\n\t\t\tif (coverageLines.length > 0) {\n\t\t\t\tlines.push(\"Coverage:\", ...coverageLines.map((line) => `- ${line}`), \"\");\n\t\t\t}\n\t\t}\n\t\tif (parsed.findings.length === 0) {\n\t\t\tlines.push(\"The review found no issues worth flagging.\");\n\t\t} else {\n\t\t\tlines.push(\"Findings:\", \"\");\n\t\t\tparsed.findings.forEach((finding, index) => {\n\t\t\t\tconst meta: string[] = [];\n\t\t\t\tif (finding.priority !== undefined) {\n\t\t\t\t\tmeta.push(`P${finding.priority}`);\n\t\t\t\t}\n\t\t\t\tif (finding.confidence !== undefined) {\n\t\t\t\t\tmeta.push(`confidence ${Math.round(finding.confidence * 100)}%`);\n\t\t\t\t}\n\t\t\t\tconst location = finding.file ? ` (${finding.file}${finding.line ? `:${finding.line}` : \"\"})` : \"\";\n\t\t\t\tconst metaText = meta.length > 0 ? ` [${meta.join(\", \")}]` : \"\";\n\t\t\t\tlines.push(`### ${index + 1}. ${finding.title}${metaText}${location}`, \"\");\n\t\t\t\tif (finding.body) {\n\t\t\t\t\tlines.push(finding.body, \"\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// Collapse any trailing blank lines (the findings loop appends one after each\n\t// entry) so the footer is always separated by exactly one blank line.\n\twhile (lines.length > 0 && lines[lines.length - 1] === \"\") {\n\t\tlines.pop();\n\t}\n\tlines.push(\n\t\t\"\",\n\t\t`Reproduce the reviewed diff with \\`${resolved.diffCommand}\\`.`,\n\t\t'The user may refer to findings by number (e.g. \"fix 1 and 3\"). When asked to fix findings, read the relevant code first and apply minimal, correct fixes.',\n\t);\n\treturn lines.join(\"\\n\");\n}\n\n// ============================================================================\n// Running the review\n// ============================================================================\n\n/**\n * Minimal resource loader for the isolated review session: it loads the\n * project's context files (AGENTS.md) but provides no user extensions, skills,\n * prompt templates, themes, or subagents. Configured extension *tools* are\n * inherited separately (see collectParentExtensionTools) and passed as\n * customTools in runReviewSession.\n */\nexport function createReviewResourceLoader(cwd: string, agentDir: string): ResourceLoader {\n\tconst extensionsResult = { extensions: [], errors: [], runtime: createExtensionRuntime() };\n\tconst agentsFiles = loadProjectContextFiles({ cwd, agentDir });\n\treturn {\n\t\tgetExtensions: () => extensionsResult,\n\t\tgetSkills: () => ({ skills: [], diagnostics: [] }),\n\t\tgetPrompts: () => ({ prompts: [], diagnostics: [] }),\n\t\tgetThemes: () => ({ themes: [], diagnostics: [] }),\n\t\tgetSubagents: () => ({ definitions: [], diagnostics: [] }),\n\t\tgetAgentsFiles: () => ({ agentsFiles }),\n\t\tgetSystemPrompt: () => REVIEW_SYSTEM_PROMPT,\n\t\tgetAppendSystemPrompt: () => [],\n\t\textendResources: () => {},\n\t\treload: async () => {},\n\t};\n}\n\nfunction collectParentExtensionTools(parentResourceLoader: ResourceLoader | undefined): ToolDefinition[] {\n\tconst parentExtensions = parentResourceLoader?.getExtensions();\n\tif (!parentExtensions) {\n\t\treturn [];\n\t}\n\n\tconst toolsByName = new Map<string, ToolDefinition>();\n\tfor (const extension of parentExtensions.extensions) {\n\t\tfor (const tool of extension.tools.values()) {\n\t\t\tif (!toolsByName.has(tool.definition.name)) {\n\t\t\t\ttoolsByName.set(tool.definition.name, tool.definition);\n\t\t\t}\n\t\t}\n\t}\n\treturn Array.from(toolsByName.values());\n}\n\nexport interface RunReviewOptions {\n\tcwd: string;\n\tagentDir: string;\n\tmodel: Model<any>;\n\tthinkingLevel?: ThinkingLevel;\n\tauthStorage: AuthStorage;\n\tmodelRegistry: ModelRegistry;\n\tsettingsManager: SettingsManager;\n\tresolved: ResolvedReview;\n\t/** Parent session resource loader used to inherit configured extension tools. */\n\tparentResourceLoader?: ResourceLoader;\n\t/** Optional review tool allowlist. Omit to use normal review defaults. */\n\ttools?: string[];\n\t/** Aborts the review session when triggered. */\n\tsignal?: AbortSignal;\n\t/** Called with short progress updates (tool activity) while the review runs. */\n\tonProgress?: (message: string) => void;\n\t/** Emits sanitized review tool lifecycle events while the review runs. */\n\tonEvent?: (event: ReviewWorkflowToolEvent) => void;\n\t/**\n\t * Full in-process review-session event stream, for rich local rendering.\n\t * In-process (TUI) only; never forwarded over RPC, where only the sanitized\n\t * `onEvent` stream is exposed.\n\t */\n\tonSessionEvent?: (event: AgentSessionEvent) => void;\n\tworkflowId?: string;\n\tworkflowAction?: string;\n}\n\nexport interface ReviewRunResult {\n\taborted: boolean;\n\t/** Full text of the reviewer's final message. */\n\traw: string;\n\tparsed?: ParsedReview;\n\terrorMessage?: string;\n}\n\nexport interface ReviewWorkflowSession {\n\t/** Falls back to isStreaming for legacy workflow integrations. */\n\tisBusy?: boolean;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tmodel?: Model<any>;\n\tthinkingLevel?: ThinkingLevel;\n\tmodelRegistry: ModelRegistry;\n\tresourceLoader: ResourceLoader;\n\tsendCustomMessage<T = unknown>(\n\t\tmessage: Pick<ReviewCustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: { triggerTurn?: boolean; deliverAs?: \"steer\" | \"followUp\" | \"nextTurn\" },\n\t): Promise<void>;\n}\n\ninterface ReviewCustomMessage<T> {\n\tcustomType: string;\n\tcontent: string;\n\tdisplay: boolean;\n\tdetails: T;\n}\n\nexport type ReviewWorkflowEvent =\n\t| {\n\t\t\ttype: \"workflow_start\";\n\t\t\tworkflowId: string;\n\t\t\tkind: \"review\";\n\t\t\taction: string;\n\t\t\ttitle: string;\n\t\t\tmessage: string;\n\t\t\tstatus: \"running\";\n\t }\n\t| {\n\t\t\ttype: \"workflow_update\";\n\t\t\tworkflowId: string;\n\t\t\tkind: \"review\";\n\t\t\taction: string;\n\t\t\ttitle: string;\n\t\t\tmessage: string;\n\t\t\tstatus: \"running\" | \"finalizing\";\n\t }\n\t| {\n\t\t\ttype: \"workflow_end\";\n\t\t\tworkflowId: string;\n\t\t\tkind: \"review\";\n\t\t\taction: string;\n\t\t\ttitle: string;\n\t\t\tmessage: string;\n\t\t\tstatus: \"completed\" | \"cancelled\" | \"failed\";\n\t };\n\nexport type ReviewWorkflowToolEvent =\n\t| {\n\t\t\ttype: \"tool_execution_start\";\n\t\t\tworkflowId: string;\n\t\t\tworkflowKind: \"review\";\n\t\t\tworkflowAction: string;\n\t\t\ttoolCallId: string;\n\t\t\ttoolName: string;\n\t\t\targs?: Record<string, unknown>;\n\t }\n\t| {\n\t\t\ttype: \"tool_execution_end\";\n\t\t\tworkflowId: string;\n\t\t\tworkflowKind: \"review\";\n\t\t\tworkflowAction: string;\n\t\t\ttoolCallId: string;\n\t\t\ttoolName: string;\n\t\t\tisError: boolean;\n\t };\n\nexport interface ReviewWorkflowHooks {\n\tsignal?: AbortSignal;\n\tonProgress?: (message: string) => void;\n\tonEvent?: (event: ReviewWorkflowEvent | ReviewWorkflowToolEvent) => void;\n\t/** Full in-process review-session event stream, for rich local rendering. */\n\tonSessionEvent?: (event: AgentSessionEvent) => void;\n\tcleanup?: () => void;\n}\n\nexport interface ReviewWorkflowOptions {\n\ttarget: ReviewTarget;\n\tcwd: string;\n\tagentDir: string;\n\tsession: ReviewWorkflowSession;\n\tnewSession: AgentSessionRuntime[\"newSession\"];\n\tauthStorage: AuthStorage;\n\tsettingsManager: SettingsManager;\n\ttools?: readonly string[];\n\trequireProjectTrust?: boolean;\n\trequireConfirmation?: boolean;\n\tconfirm?: (request: { title: string; message: string; resolution: ResolvedReview }) => Promise<boolean>;\n\tonBeforeReview?: (\n\t\tresolution: ResolvedReview,\n\t\tmodel: Model<any>,\n\t) => Promise<ReviewWorkflowHooks> | ReviewWorkflowHooks;\n\tonReviewModelWarning?: (message: string) => void;\n\t/** Emits sanitized review workflow and tool-usage events for UI surfaces. */\n\tonEvent?: (event: ReviewWorkflowEvent | ReviewWorkflowToolEvent) => void;\n}\n\nexport type ReviewWorkflowResult =\n\t| { status: \"cancelled\"; resolution?: ResolvedReview }\n\t| {\n\t\t\tstatus: \"completed\";\n\t\t\tresolution: ResolvedReview;\n\t\t\tfindingsCount?: number;\n\t\t\tsessionSwitchCancelled: boolean;\n\t };\n\nexport function createReviewConfirmationMessage(resolution: ResolvedReview): string {\n\treturn [\n\t\t`Review ${resolution.description}?`,\n\t\t\"\",\n\t\t\"Volt will inspect the selected git diff, may read related project files with host-approved read-only tools, consume model tokens, and create a fresh session seeded with the findings.\",\n\t\t`Diff command: ${resolution.diffCommand}`,\n\t].join(\"\\n\");\n}\n\nexport function resolveReviewModel(options: {\n\tsettingsManager: SettingsManager;\n\tmodelRegistry: ModelRegistry;\n\tcurrentModel?: Model<any>;\n}): { model?: Model<any>; warning?: string } {\n\tconst reference = options.settingsManager.getReviewModel();\n\tif (reference) {\n\t\toptions.modelRegistry.refresh();\n\t\tconst available = options.modelRegistry.getAvailable();\n\t\tconst match = findExactModelReferenceMatch(reference, available);\n\t\tif (match) {\n\t\t\treturn { model: match };\n\t\t}\n\t\treturn {\n\t\t\tmodel: options.currentModel,\n\t\t\twarning: `reviewModel \"${reference}\" not found or not authenticated; using the current model.`,\n\t\t};\n\t}\n\treturn { model: options.currentModel };\n}\n\nfunction reviewActionIdForTarget(target: ReviewTarget): string {\n\tswitch (target.kind) {\n\t\tcase \"uncommitted\":\n\t\t\treturn \"review.uncommitted\";\n\t\tcase \"branch\":\n\t\t\treturn \"review.branch\";\n\t\tcase \"pr\":\n\t\t\treturn \"review.pr\";\n\t\tcase \"commit\":\n\t\t\treturn \"review.commit\";\n\t}\n}\n\nfunction createReviewWorkflowId(): string {\n\treturn `review:${randomUUID()}`;\n}\n\nfunction emitReviewWorkflowEvent(\n\temit: ((event: ReviewWorkflowEvent | ReviewWorkflowToolEvent) => void) | undefined,\n\tevent: ReviewWorkflowEvent,\n): void {\n\temit?.(event);\n}\n\nexport async function runReviewWorkflow(options: ReviewWorkflowOptions): Promise<ReviewWorkflowResult> {\n\tassertReviewCanStart(options.session);\n\tif (options.requireProjectTrust && !options.settingsManager.isProjectTrusted()) {\n\t\tthrow new Error(\"Project trust is required before running a remote review.\");\n\t}\n\n\tconst resolution = await resolveReviewTarget(options.target, options.cwd);\n\tif (\"error\" in resolution) {\n\t\tthrow new Error(resolution.error);\n\t}\n\n\tif (options.requireConfirmation) {\n\t\tconst confirmed = await options.confirm?.({\n\t\t\ttitle: \"Review changes\",\n\t\t\tmessage: createReviewConfirmationMessage(resolution),\n\t\t\tresolution,\n\t\t});\n\t\tif (!confirmed) {\n\t\t\treturn { status: \"cancelled\", resolution };\n\t\t}\n\t}\n\n\tconst reviewModel = resolveReviewModel({\n\t\tsettingsManager: options.settingsManager,\n\t\tmodelRegistry: options.session.modelRegistry,\n\t\tcurrentModel: options.session.model,\n\t});\n\tif (reviewModel.warning) {\n\t\toptions.onReviewModelWarning?.(reviewModel.warning);\n\t}\n\tconst model = reviewModel.model;\n\tif (!model) {\n\t\tthrow new Error(\"No model available for review. Use /model to select one.\");\n\t}\n\n\tassertReviewCanStart(options.session);\n\tconst workflowId = createReviewWorkflowId();\n\tconst workflowAction = reviewActionIdForTarget(options.target);\n\tconst hooks = await options.onBeforeReview?.(resolution, model);\n\tconst emitEvent = (event: ReviewWorkflowEvent | ReviewWorkflowToolEvent): void => {\n\t\toptions.onEvent?.(event);\n\t\thooks?.onEvent?.(event);\n\t};\n\n\temitReviewWorkflowEvent(emitEvent, {\n\t\ttype: \"workflow_start\",\n\t\tworkflowId,\n\t\tkind: \"review\",\n\t\taction: workflowAction,\n\t\ttitle: \"Review\",\n\t\tmessage: `Reviewing ${resolution.description}.`,\n\t\tstatus: \"running\",\n\t});\n\n\tlet terminalWorkflowEmitted = false;\n\tconst emitTerminalWorkflowEvent = (event: Extract<ReviewWorkflowEvent, { type: \"workflow_end\" }>): void => {\n\t\tterminalWorkflowEmitted = true;\n\t\temitReviewWorkflowEvent(emitEvent, event);\n\t};\n\n\ttry {\n\t\tlet result: ReviewRunResult;\n\t\ttry {\n\t\t\tresult = await runReview({\n\t\t\t\tcwd: options.cwd,\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tmodel,\n\t\t\t\tthinkingLevel: options.session.thinkingLevel,\n\t\t\t\tauthStorage: options.authStorage,\n\t\t\t\tmodelRegistry: options.session.modelRegistry,\n\t\t\t\tsettingsManager: options.settingsManager,\n\t\t\t\tresolved: resolution,\n\t\t\t\tparentResourceLoader: options.session.resourceLoader,\n\t\t\t\ttools: options.tools ? [...options.tools] : undefined,\n\t\t\t\tsignal: hooks?.signal,\n\t\t\t\tonProgress: hooks?.onProgress,\n\t\t\t\tonSessionEvent: hooks?.onSessionEvent,\n\t\t\t\tonEvent: emitEvent,\n\t\t\t\tworkflowId,\n\t\t\t\tworkflowAction,\n\t\t\t});\n\t\t} finally {\n\t\t\thooks?.cleanup?.();\n\t\t}\n\n\t\tif (result.aborted || hooks?.signal?.aborted) {\n\t\t\temitTerminalWorkflowEvent({\n\t\t\t\ttype: \"workflow_end\",\n\t\t\t\tworkflowId,\n\t\t\t\tkind: \"review\",\n\t\t\t\taction: workflowAction,\n\t\t\t\ttitle: \"Review\",\n\t\t\t\tmessage: \"Review cancelled.\",\n\t\t\t\tstatus: \"cancelled\",\n\t\t\t});\n\t\t\treturn { status: \"cancelled\", resolution };\n\t\t}\n\t\tif (result.errorMessage) {\n\t\t\temitTerminalWorkflowEvent({\n\t\t\t\ttype: \"workflow_end\",\n\t\t\t\tworkflowId,\n\t\t\t\tkind: \"review\",\n\t\t\t\taction: workflowAction,\n\t\t\t\ttitle: \"Review\",\n\t\t\t\tmessage: `Review failed: ${result.errorMessage}`,\n\t\t\t\tstatus: \"failed\",\n\t\t\t});\n\t\t\tthrow new Error(`Review failed: ${result.errorMessage}`);\n\t\t}\n\n\t\temitReviewWorkflowEvent(emitEvent, {\n\t\t\ttype: \"workflow_update\",\n\t\t\tworkflowId,\n\t\t\tkind: \"review\",\n\t\t\taction: workflowAction,\n\t\t\ttitle: \"Review\",\n\t\t\tmessage: \"Finalizing findings.\",\n\t\t\tstatus: \"finalizing\",\n\t\t});\n\n\t\tconst reviewMessage = createReviewSeedMessage(resolution, result);\n\t\tconst newSessionResult = await options.newSession({\n\t\t\twithSession: async (ctx: ReplacedSessionContext) => {\n\t\t\t\tawait ctx.sendMessage(reviewMessage);\n\t\t\t},\n\t\t});\n\t\tif (newSessionResult.cancelled) {\n\t\t\tawait options.session.sendCustomMessage(reviewMessage);\n\t\t}\n\t\tconst completedResult = {\n\t\t\tstatus: \"completed\" as const,\n\t\t\tresolution,\n\t\t\tfindingsCount: result.parsed?.findings.length,\n\t\t\tsessionSwitchCancelled: newSessionResult.cancelled,\n\t\t};\n\t\temitTerminalWorkflowEvent({\n\t\t\ttype: \"workflow_end\",\n\t\t\tworkflowId,\n\t\t\tkind: \"review\",\n\t\t\taction: workflowAction,\n\t\t\ttitle: \"Review\",\n\t\t\tmessage: newSessionResult.cancelled\n\t\t\t\t? `${formatReviewWorkflowSummary(completedResult)} Findings were added to the current session.`\n\t\t\t\t: `${formatReviewWorkflowSummary(completedResult)} Opening review session.`,\n\t\t\tstatus: \"completed\",\n\t\t});\n\t\treturn completedResult;\n\t} catch (error) {\n\t\tif (!terminalWorkflowEmitted) {\n\t\t\temitTerminalWorkflowEvent({\n\t\t\t\ttype: \"workflow_end\",\n\t\t\t\tworkflowId,\n\t\t\t\tkind: \"review\",\n\t\t\t\taction: workflowAction,\n\t\t\t\ttitle: \"Review\",\n\t\t\t\tmessage: \"Review failed.\",\n\t\t\t\tstatus: \"failed\",\n\t\t\t});\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nexport function formatReviewWorkflowSummary(result: Extract<ReviewWorkflowResult, { status: \"completed\" }>): string {\n\tconst findingCount = result.findingsCount;\n\tif (findingCount === undefined) {\n\t\treturn \"Review complete.\";\n\t}\n\tif (findingCount === 0) {\n\t\treturn \"Review complete: no issues found.\";\n\t}\n\treturn `Review complete: ${findingCount} finding${findingCount === 1 ? \"\" : \"s\"}.`;\n}\n\nfunction assertReviewCanStart(session: Pick<ReviewWorkflowSession, \"isBusy\" | \"isStreaming\" | \"isCompacting\">): void {\n\tif ((session.isBusy ?? session.isStreaming) || session.isCompacting) {\n\t\tthrow new Error(\"Wait for the current response to finish before starting a review.\");\n\t}\n}\n\nfunction createReviewSeedMessage(resolution: ResolvedReview, result: Pick<ReviewRunResult, \"raw\" | \"parsed\">) {\n\treturn {\n\t\tcustomType: \"review\",\n\t\tcontent: formatReviewForNewSession(resolution, result.parsed, result.raw),\n\t\tdisplay: true,\n\t\tdetails: { target: resolution.description, findings: result.parsed?.findings ?? [] },\n\t};\n}\n\nfunction summarizeToolArgs(args: unknown): string | undefined {\n\tif (typeof args !== \"object\" || args === null) {\n\t\treturn undefined;\n\t}\n\tfor (const value of Object.values(args as Record<string, unknown>)) {\n\t\tif (typeof value === \"string\" && value.trim()) {\n\t\t\tconst oneLine = value.replace(/\\s+/g, \" \").trim();\n\t\t\treturn oneLine.length > 60 ? `${oneLine.slice(0, 57)}...` : oneLine;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nconst REVIEW_WORKFLOW_ARG_STRING_LIMIT = 240;\n\nfunction createReviewWorkflowToolCallId(workflowId: string | undefined, toolCallId: unknown): string {\n\tconst id = typeof toolCallId === \"string\" && toolCallId.trim() ? toolCallId.trim() : \"unknown\";\n\treturn workflowId ? `${workflowId}:${id}` : id;\n}\n\nfunction sanitizeReviewWorkflowToolArgs(\n\ttoolName: string | undefined,\n\targs: unknown,\n): Record<string, unknown> | undefined {\n\tif (typeof args !== \"object\" || args === null || Array.isArray(args)) {\n\t\treturn undefined;\n\t}\n\tconst record = args as Record<string, unknown>;\n\tconst normalizedToolName = toolName?.trim().toLowerCase();\n\tconst keysByTool: Record<string, string[]> = {\n\t\tread: [\"path\", \"file_path\", \"offset\", \"limit\"],\n\t\tgrep: [\"pattern\", \"path\", \"glob\", \"ignoreCase\", \"literal\", \"context\", \"limit\"],\n\t\tfind: [\"pattern\", \"query\", \"path\", \"limit\"],\n\t\tls: [\"path\", \"limit\"],\n\t\tbash: [\"command\"],\n\t\tlsp: [\"action\", \"symbol\", \"line\", \"path\"],\n\t};\n\tconst allowedKeys = keysByTool[normalizedToolName ?? \"\"] ?? [\n\t\t\"action\",\n\t\t\"command\",\n\t\t\"file_path\",\n\t\t\"glob\",\n\t\t\"line\",\n\t\t\"path\",\n\t\t\"pattern\",\n\t\t\"query\",\n\t\t\"symbol\",\n\t];\n\tconst sanitized: Record<string, unknown> = {};\n\tfor (const key of allowedKeys) {\n\t\tif (!Object.hasOwn(record, key)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst value = sanitizeReviewWorkflowArgValue(record[key]);\n\t\tif (value !== undefined) {\n\t\t\tsanitized[key] = value;\n\t\t}\n\t}\n\treturn Object.keys(sanitized).length > 0 ? sanitized : undefined;\n}\n\nfunction sanitizeReviewWorkflowArgValue(value: unknown): string | number | boolean | undefined {\n\tif (typeof value === \"string\") {\n\t\tconst trimmed = value.replace(/\\s+/g, \" \").trim();\n\t\tif (!trimmed) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn trimmed.length <= REVIEW_WORKFLOW_ARG_STRING_LIMIT\n\t\t\t? trimmed\n\t\t\t: `${trimmed.slice(0, REVIEW_WORKFLOW_ARG_STRING_LIMIT - 1)}…`;\n\t}\n\tif (typeof value === \"number\" && Number.isFinite(value)) {\n\t\treturn value;\n\t}\n\tif (typeof value === \"boolean\") {\n\t\treturn value;\n\t}\n\treturn undefined;\n}\n\nfunction emitReviewWorkflowToolEvent(\n\temit: ((event: ReviewWorkflowToolEvent) => void) | undefined,\n\toptions: Pick<RunReviewOptions, \"workflowId\" | \"workflowAction\">,\n\tevent: { type: string; toolCallId?: string; toolName?: string; args?: unknown; isError?: boolean },\n): void {\n\tif (!emit || !options.workflowId || !options.workflowAction || !event.toolName) {\n\t\treturn;\n\t}\n\tif (event.type === \"tool_execution_start\") {\n\t\temit({\n\t\t\ttype: \"tool_execution_start\",\n\t\t\tworkflowId: options.workflowId,\n\t\t\tworkflowKind: \"review\",\n\t\t\tworkflowAction: options.workflowAction,\n\t\t\ttoolCallId: createReviewWorkflowToolCallId(options.workflowId, event.toolCallId),\n\t\t\ttoolName: event.toolName,\n\t\t\targs: sanitizeReviewWorkflowToolArgs(event.toolName, event.args),\n\t\t});\n\t\treturn;\n\t}\n\tif (event.type === \"tool_execution_end\") {\n\t\temit({\n\t\t\ttype: \"tool_execution_end\",\n\t\t\tworkflowId: options.workflowId,\n\t\t\tworkflowKind: \"review\",\n\t\t\tworkflowAction: options.workflowAction,\n\t\t\ttoolCallId: createReviewWorkflowToolCallId(options.workflowId, event.toolCallId),\n\t\t\ttoolName: event.toolName,\n\t\t\tisError: event.isError === true,\n\t\t});\n\t}\n}\n\n// ============================================================================\n// Working-tree guard\n// ============================================================================\n\n/**\n * Snapshot/restore guard for the reviewer's working tree.\n *\n * The reviewer runs in the user's real cwd so it can execute the project's\n * tests and reproduce bugs with the real dependencies (node_modules, build\n * caches, ...). To keep that safe, we snapshot the full working state before\n * the review and afterward — including on error or abort — revert anything the\n * reviewer added, modified, or deleted, while preserving the uncommitted\n * changes that were under review.\n *\n * Caveats: files edited by another process during the review may also be\n * reverted, since the guard cannot distinguish those from reviewer edits;\n * git-ignored files (e.g. node_modules, build output) are never touched.\n */\ninterface WorkingTreeGuard {\n\trestore(): Promise<void>;\n}\n\nexport async function createWorkingTreeGuard(cwd: string): Promise<WorkingTreeGuard> {\n\tconst root = await gitRepoRoot(cwd);\n\tconst snapshot = root ? await captureWorkingTree(root) : undefined;\n\tlet restored = false;\n\treturn {\n\t\tasync restore() {\n\t\t\tif (restored || !root || !snapshot) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trestored = true;\n\t\t\tawait restoreWorkingTree(root, snapshot);\n\t\t},\n\t};\n}\n\nasync function gitRepoRoot(cwd: string): Promise<string | undefined> {\n\tconst result = await runCommand(\"git\", [\"rev-parse\", \"--show-toplevel\"], cwd);\n\treturn result.ok ? result.stdout.trim() || undefined : undefined;\n}\n\n/** Write a tree object capturing every non-ignored file in the working tree. */\nasync function captureWorkingTree(root: string): Promise<string | undefined> {\n\treturn withTempIndex(async (indexFile) => {\n\t\tconst env = { GIT_INDEX_FILE: indexFile };\n\t\tconst add = await runCommand(\"git\", [\"add\", \"-A\"], root, env);\n\t\tif (!add.ok) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst tree = await runCommand(\"git\", [\"write-tree\"], root, env);\n\t\treturn tree.ok ? tree.stdout.trim() || undefined : undefined;\n\t});\n}\n\n/** Revert the working tree back to the snapshot, touching only changed paths. */\nasync function restoreWorkingTree(root: string, snapshotTree: string): Promise<void> {\n\tawait withTempIndex(async (indexFile) => {\n\t\tconst env = { GIT_INDEX_FILE: indexFile };\n\t\tconst add = await runCommand(\"git\", [\"add\", \"-A\"], root, env);\n\t\tif (!add.ok) {\n\t\t\treturn;\n\t\t}\n\t\tconst endTreeResult = await runCommand(\"git\", [\"write-tree\"], root, env);\n\t\tconst endTree = endTreeResult.ok ? endTreeResult.stdout.trim() : \"\";\n\t\tif (!endTree || endTree === snapshotTree) {\n\t\t\treturn; // The reviewer left the working tree as it found it.\n\t\t}\n\t\tconst diff = await runCommand(\n\t\t\t\"git\",\n\t\t\t[\"diff-tree\", \"-r\", \"-z\", \"--no-renames\", \"--name-status\", snapshotTree, endTree],\n\t\t\troot,\n\t\t);\n\t\tif (!diff.ok) {\n\t\t\treturn;\n\t\t}\n\t\tconst { added, changed } = parseNameStatusZ(diff.stdout);\n\t\t// Restore modified/deleted paths from the snapshot, then remove additions.\n\t\tif (changed.length > 0) {\n\t\t\tawait runCommand(\"git\", [\"read-tree\", snapshotTree], root, env);\n\t\t\tawait runCommand(\"git\", [\"checkout-index\", \"-f\", \"--\", ...changed], root, env);\n\t\t}\n\t\tfor (const path of added) {\n\t\t\tawait rm(join(root, path), { force: true });\n\t\t}\n\t});\n}\n\n/** Split a `-z --name-status` diff-tree stream into added vs modified/deleted paths. */\nfunction parseNameStatusZ(stdout: string): { added: string[]; changed: string[] } {\n\tconst tokens = stdout.split(\"\\0\").filter((token) => token.length > 0);\n\tconst added: string[] = [];\n\tconst changed: string[] = [];\n\tfor (let i = 0; i + 1 < tokens.length; i += 2) {\n\t\tconst status = tokens[i];\n\t\tconst path = tokens[i + 1];\n\t\tif (status.startsWith(\"A\")) {\n\t\t\tadded.push(path);\n\t\t} else {\n\t\t\tchanged.push(path);\n\t\t}\n\t}\n\treturn { added, changed };\n}\n\nasync function withTempIndex<T>(fn: (indexFile: string) => Promise<T>): Promise<T> {\n\tconst dir = await mkdtemp(join(tmpdir(), \"volt-review-index-\"));\n\tconst indexFile = join(dir, \"index\");\n\ttry {\n\t\treturn await fn(indexFile);\n\t} finally {\n\t\tawait rm(dir, { recursive: true, force: true }).catch(() => {});\n\t}\n}\n\n/**\n * Run a review in an isolated in-process agent session.\n * The session is in-memory (not persisted) and disposed when done.\n *\n * The reviewer executes in the user's real cwd so it can run the project's\n * tests and reproduce bugs with real dependencies. A working-tree guard\n * snapshots the tree first and reverts anything the reviewer adds, modifies,\n * or deletes once the review finishes — including on error or abort.\n */\nexport async function runReview(options: RunReviewOptions): Promise<ReviewRunResult> {\n\tconst guard = await createWorkingTreeGuard(options.cwd);\n\ttry {\n\t\treturn await runReviewSession(options);\n\t} finally {\n\t\tawait guard.restore();\n\t}\n}\n\nasync function runReviewSession(options: RunReviewOptions): Promise<ReviewRunResult> {\n\tconst inheritedTools = collectParentExtensionTools(options.parentResourceLoader);\n\tconst resourceLoader = createReviewResourceLoader(options.cwd, options.agentDir);\n\tconst { session } = await createAgentSession({\n\t\tcwd: options.cwd,\n\t\tagentDir: options.agentDir,\n\t\tauthStorage: options.authStorage,\n\t\tmodelRegistry: options.modelRegistry,\n\t\tsettingsManager: options.settingsManager,\n\t\tmodel: options.model,\n\t\tthinkingLevel: options.thinkingLevel,\n\t\tsessionManager: SessionManager.inMemory(options.cwd),\n\t\tresourceLoader,\n\t\tcustomTools: inheritedTools.length > 0 ? inheritedTools : undefined,\n\t\ttools: options.tools,\n\t\t// Isolated reviewer: never spin up (or tear down) the user's MCP servers.\n\t\tdisableMcp: true,\n\t});\n\n\t// An abort during session creation fires before the listener below is\n\t// attached, and AbortSignal does not invoke listeners added after the fact.\n\tif (options.signal?.aborted) {\n\t\tsession.dispose();\n\t\treturn { aborted: true, raw: \"\" };\n\t}\n\n\tconst onAbort = () => {\n\t\tvoid session.abort();\n\t};\n\toptions.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n\tconst unsubscribe = session.subscribe((event) => {\n\t\toptions.onSessionEvent?.(event);\n\t\tif (event.type === \"tool_execution_start\") {\n\t\t\tconst summary = summarizeToolArgs(event.args);\n\t\t\toptions.onProgress?.(summary ? `${event.toolName}: ${summary}` : event.toolName);\n\t\t\temitReviewWorkflowToolEvent(options.onEvent, options, event);\n\t\t} else if (event.type === \"tool_execution_end\") {\n\t\t\temitReviewWorkflowToolEvent(options.onEvent, options, event);\n\t\t}\n\t});\n\n\ttry {\n\t\tawait session.prompt(buildReviewPrompt(options.resolved), { expandPromptTemplates: false });\n\n\t\tif (options.signal?.aborted) {\n\t\t\treturn { aborted: true, raw: \"\" };\n\t\t}\n\n\t\tconst lastAssistant = [...session.messages]\n\t\t\t.reverse()\n\t\t\t.find((message): message is AssistantMessage => message.role === \"assistant\");\n\t\tif (lastAssistant?.stopReason === \"aborted\") {\n\t\t\treturn { aborted: true, raw: \"\" };\n\t\t}\n\t\tif (lastAssistant?.stopReason === \"error\") {\n\t\t\treturn { aborted: false, raw: \"\", errorMessage: lastAssistant.errorMessage ?? \"Review failed\" };\n\t\t}\n\n\t\tconst raw = session.getLastAssistantText() ?? \"\";\n\t\tif (!raw.trim()) {\n\t\t\treturn { aborted: false, raw: \"\", errorMessage: \"Review produced no output\" };\n\t\t}\n\t\treturn { aborted: false, raw, parsed: parseReviewOutput(raw) };\n\t} catch (error) {\n\t\tif (options.signal?.aborted) {\n\t\t\treturn { aborted: true, raw: \"\" };\n\t\t}\n\t\treturn {\n\t\t\taborted: false,\n\t\t\traw: \"\",\n\t\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\t};\n\t} finally {\n\t\tunsubscribe();\n\t\toptions.signal?.removeEventListener(\"abort\", onAbort);\n\t\tsession.dispose();\n\t}\n}\n"]}