indusagi-coding-agent 0.1.40 → 0.1.42

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 (951) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +2 -2
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/command-line/args.d.ts +56 -0
  6. package/dist/command-line/args.d.ts.map +1 -0
  7. package/dist/command-line/args.js.map +1 -0
  8. package/dist/command-line/config-selector.d.ts +17 -0
  9. package/dist/command-line/config-selector.d.ts.map +1 -0
  10. package/dist/command-line/config-selector.js.map +1 -0
  11. package/dist/command-line/file-processor.d.ts.map +1 -0
  12. package/dist/command-line/file-processor.js.map +1 -0
  13. package/dist/command-line/list-models.d.ts +9 -0
  14. package/dist/command-line/list-models.d.ts.map +1 -0
  15. package/dist/command-line/list-models.js.map +1 -0
  16. package/dist/command-line/login-handler.d.ts.map +1 -0
  17. package/dist/command-line/login-handler.js +746 -0
  18. package/dist/command-line/login-handler.js.map +1 -0
  19. package/dist/command-line/session-picker.d.ts.map +1 -0
  20. package/dist/command-line/session-picker.js.map +1 -0
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/config.js +9 -5
  23. package/dist/config.js.map +1 -1
  24. package/dist/helpers/array.d.ts.map +1 -0
  25. package/dist/helpers/array.js.map +1 -0
  26. package/dist/helpers/changelog.d.ts.map +1 -0
  27. package/dist/helpers/changelog.js.map +1 -0
  28. package/dist/helpers/clipboard-image.d.ts.map +1 -0
  29. package/dist/helpers/clipboard-image.js.map +1 -0
  30. package/dist/helpers/clipboard.d.ts.map +1 -0
  31. package/dist/helpers/clipboard.js.map +1 -0
  32. package/dist/helpers/color-formatter.d.ts.map +1 -0
  33. package/dist/helpers/color-formatter.js.map +1 -0
  34. package/dist/helpers/data-transformer.d.ts.map +1 -0
  35. package/dist/helpers/data-transformer.js.map +1 -0
  36. package/dist/helpers/date-formatter.d.ts.map +1 -0
  37. package/dist/helpers/date-formatter.js.map +1 -0
  38. package/dist/helpers/error-handler.d.ts.map +1 -0
  39. package/dist/helpers/error-handler.js.map +1 -0
  40. package/dist/helpers/file-operations.d.ts.map +1 -0
  41. package/dist/helpers/file-operations.js.map +1 -0
  42. package/dist/helpers/frontmatter.d.ts.map +1 -0
  43. package/dist/helpers/frontmatter.js.map +1 -0
  44. package/dist/helpers/git.d.ts.map +1 -0
  45. package/dist/helpers/git.js.map +1 -0
  46. package/dist/helpers/image-convert.d.ts.map +1 -0
  47. package/dist/helpers/image-convert.js.map +1 -0
  48. package/dist/helpers/image-resize.d.ts.map +1 -0
  49. package/dist/helpers/image-resize.js.map +1 -0
  50. package/dist/helpers/json-formatter.d.ts.map +1 -0
  51. package/dist/helpers/json-formatter.js.map +1 -0
  52. package/dist/helpers/logger.d.ts.map +1 -0
  53. package/dist/helpers/logger.js.map +1 -0
  54. package/dist/helpers/markdown-formatter.d.ts.map +1 -0
  55. package/dist/helpers/markdown-formatter.js.map +1 -0
  56. package/dist/helpers/mime.d.ts.map +1 -0
  57. package/dist/helpers/mime.js.map +1 -0
  58. package/dist/helpers/path-validator.d.ts.map +1 -0
  59. package/dist/helpers/path-validator.js.map +1 -0
  60. package/dist/helpers/photon.d.ts.map +1 -0
  61. package/dist/helpers/photon.js.map +1 -0
  62. package/dist/helpers/shell.d.ts.map +1 -0
  63. package/dist/helpers/shell.js +142 -0
  64. package/dist/helpers/shell.js.map +1 -0
  65. package/dist/helpers/sleep.d.ts.map +1 -0
  66. package/dist/helpers/sleep.js.map +1 -0
  67. package/dist/helpers/string-formatter.d.ts.map +1 -0
  68. package/dist/helpers/string-formatter.js.map +1 -0
  69. package/dist/helpers/tools-manager.d.ts.map +1 -0
  70. package/dist/helpers/tools-manager.js.map +1 -0
  71. package/dist/helpers/type-guards.d.ts.map +1 -0
  72. package/dist/helpers/type-guards.js.map +1 -0
  73. package/dist/index.d.ts +34 -34
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +34 -34
  76. package/dist/index.js.map +1 -1
  77. package/dist/interfaces/index.d.ts +16 -0
  78. package/dist/interfaces/index.d.ts.map +1 -0
  79. package/dist/interfaces/index.js +14 -0
  80. package/dist/interfaces/index.js.map +1 -0
  81. package/dist/interfaces/print-mode.d.ts +561 -0
  82. package/dist/interfaces/print-mode.d.ts.map +1 -0
  83. package/dist/interfaces/print-mode.js.map +1 -0
  84. package/dist/interfaces/service-api/rpc-client.d.ts +1129 -0
  85. package/dist/interfaces/service-api/rpc-client.d.ts.map +1 -0
  86. package/dist/interfaces/service-api/rpc-client.js.map +1 -0
  87. package/dist/interfaces/service-api/rpc-mode.d.ts +813 -0
  88. package/dist/interfaces/service-api/rpc-mode.d.ts.map +1 -0
  89. package/dist/interfaces/service-api/rpc-mode.js +1229 -0
  90. package/dist/interfaces/service-api/rpc-mode.js.map +1 -0
  91. package/dist/interfaces/service-api/rpc-types.d.ts +392 -0
  92. package/dist/interfaces/service-api/rpc-types.d.ts.map +1 -0
  93. package/dist/interfaces/service-api/rpc-types.js.map +1 -0
  94. package/dist/interfaces/shared.d.ts.map +1 -0
  95. package/dist/interfaces/shared.js.map +1 -0
  96. package/dist/interfaces/terminal-ui/components/armin.d.ts.map +1 -0
  97. package/dist/interfaces/terminal-ui/components/armin.js.map +1 -0
  98. package/dist/interfaces/terminal-ui/components/assistant-message.d.ts.map +1 -0
  99. package/dist/interfaces/terminal-ui/components/assistant-message.js.map +1 -0
  100. package/dist/interfaces/terminal-ui/components/bash-execution.d.ts.map +1 -0
  101. package/dist/interfaces/terminal-ui/components/bash-execution.js.map +1 -0
  102. package/dist/interfaces/terminal-ui/components/bordered-loader.d.ts.map +1 -0
  103. package/dist/interfaces/terminal-ui/components/bordered-loader.js.map +1 -0
  104. package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts +16 -0
  105. package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts.map +1 -0
  106. package/dist/interfaces/terminal-ui/components/branch-summary-message.js.map +1 -0
  107. package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts +16 -0
  108. package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts.map +1 -0
  109. package/dist/interfaces/terminal-ui/components/compaction-summary-message.js.map +1 -0
  110. package/dist/interfaces/terminal-ui/components/config-selector.d.ts +71 -0
  111. package/dist/interfaces/terminal-ui/components/config-selector.d.ts.map +1 -0
  112. package/dist/interfaces/terminal-ui/components/config-selector.js.map +1 -0
  113. package/dist/interfaces/terminal-ui/components/countdown-timer.d.ts.map +1 -0
  114. package/dist/interfaces/terminal-ui/components/countdown-timer.js.map +1 -0
  115. package/dist/interfaces/terminal-ui/components/custom-editor.d.ts +17 -0
  116. package/dist/interfaces/terminal-ui/components/custom-editor.d.ts.map +1 -0
  117. package/dist/interfaces/terminal-ui/components/custom-editor.js.map +1 -0
  118. package/dist/interfaces/terminal-ui/components/custom-message.d.ts +19 -0
  119. package/dist/interfaces/terminal-ui/components/custom-message.d.ts.map +1 -0
  120. package/dist/interfaces/terminal-ui/components/custom-message.js.map +1 -0
  121. package/dist/interfaces/terminal-ui/components/diff.d.ts.map +1 -0
  122. package/dist/interfaces/terminal-ui/components/diff.js.map +1 -0
  123. package/dist/interfaces/terminal-ui/components/dynamic-border.d.ts.map +1 -0
  124. package/dist/interfaces/terminal-ui/components/dynamic-border.js.map +1 -0
  125. package/dist/interfaces/terminal-ui/components/extension-editor.d.ts +13 -0
  126. package/dist/interfaces/terminal-ui/components/extension-editor.d.ts.map +1 -0
  127. package/dist/interfaces/terminal-ui/components/extension-editor.js.map +1 -0
  128. package/dist/interfaces/terminal-ui/components/extension-input.d.ts.map +1 -0
  129. package/dist/interfaces/terminal-ui/components/extension-input.js.map +1 -0
  130. package/dist/interfaces/terminal-ui/components/extension-selector.d.ts.map +1 -0
  131. package/dist/interfaces/terminal-ui/components/extension-selector.js.map +1 -0
  132. package/dist/interfaces/terminal-ui/components/footer.d.ts +17 -0
  133. package/dist/interfaces/terminal-ui/components/footer.d.ts.map +1 -0
  134. package/dist/interfaces/terminal-ui/components/footer.js.map +1 -0
  135. package/dist/interfaces/terminal-ui/components/index.d.ts.map +1 -0
  136. package/dist/interfaces/terminal-ui/components/index.js.map +1 -0
  137. package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts +23 -0
  138. package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts.map +1 -0
  139. package/dist/interfaces/terminal-ui/components/keybinding-hints.js.map +1 -0
  140. package/dist/interfaces/terminal-ui/components/login-dialog.d.ts.map +1 -0
  141. package/dist/interfaces/terminal-ui/components/login-dialog.js.map +1 -0
  142. package/dist/interfaces/terminal-ui/components/model-selector.d.ts +43 -0
  143. package/dist/interfaces/terminal-ui/components/model-selector.d.ts.map +1 -0
  144. package/dist/interfaces/terminal-ui/components/model-selector.js.map +1 -0
  145. package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts +75 -0
  146. package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts.map +1 -0
  147. package/dist/interfaces/terminal-ui/components/oauth-selector.js.map +1 -0
  148. package/dist/interfaces/terminal-ui/components/scoped-models-selector.d.ts.map +1 -0
  149. package/dist/interfaces/terminal-ui/components/scoped-models-selector.js.map +1 -0
  150. package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts +21 -0
  151. package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts.map +1 -0
  152. package/dist/interfaces/terminal-ui/components/session-selector-search.js.map +1 -0
  153. package/dist/interfaces/terminal-ui/components/session-selector.d.ts +85 -0
  154. package/dist/interfaces/terminal-ui/components/session-selector.d.ts.map +1 -0
  155. package/dist/interfaces/terminal-ui/components/session-selector.js.map +1 -0
  156. package/dist/interfaces/terminal-ui/components/settings-selector.d.ts.map +1 -0
  157. package/dist/interfaces/terminal-ui/components/settings-selector.js.map +1 -0
  158. package/dist/interfaces/terminal-ui/components/show-images-selector.d.ts.map +1 -0
  159. package/dist/interfaces/terminal-ui/components/show-images-selector.js.map +1 -0
  160. package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts +17 -0
  161. package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts.map +1 -0
  162. package/dist/interfaces/terminal-ui/components/skill-invocation-message.js.map +1 -0
  163. package/dist/interfaces/terminal-ui/components/theme-selector.d.ts.map +1 -0
  164. package/dist/interfaces/terminal-ui/components/theme-selector.js.map +1 -0
  165. package/dist/interfaces/terminal-ui/components/thinking-selector.d.ts.map +1 -0
  166. package/dist/interfaces/terminal-ui/components/thinking-selector.js.map +1 -0
  167. package/dist/interfaces/terminal-ui/components/tool-execution.d.ts +72 -0
  168. package/dist/interfaces/terminal-ui/components/tool-execution.d.ts.map +1 -0
  169. package/dist/interfaces/terminal-ui/components/tool-execution.js +1001 -0
  170. package/dist/interfaces/terminal-ui/components/tool-execution.js.map +1 -0
  171. package/dist/interfaces/terminal-ui/components/tree-selector.d.ts +62 -0
  172. package/dist/interfaces/terminal-ui/components/tree-selector.d.ts.map +1 -0
  173. package/dist/interfaces/terminal-ui/components/tree-selector.js.map +1 -0
  174. package/dist/interfaces/terminal-ui/components/user-message-selector.d.ts.map +1 -0
  175. package/dist/interfaces/terminal-ui/components/user-message-selector.js.map +1 -0
  176. package/dist/interfaces/terminal-ui/components/user-message.d.ts.map +1 -0
  177. package/dist/interfaces/terminal-ui/components/user-message.js.map +1 -0
  178. package/dist/interfaces/terminal-ui/components/visual-truncate.d.ts.map +1 -0
  179. package/dist/interfaces/terminal-ui/components/visual-truncate.js.map +1 -0
  180. package/dist/interfaces/terminal-ui/interactive-mode.d.ts +1931 -0
  181. package/dist/interfaces/terminal-ui/interactive-mode.d.ts.map +1 -0
  182. package/dist/interfaces/terminal-ui/interactive-mode.js +5733 -0
  183. package/dist/interfaces/terminal-ui/interactive-mode.js.map +1 -0
  184. package/dist/interfaces/terminal-ui/theme/dark.json +91 -0
  185. package/dist/interfaces/terminal-ui/theme/light.json +90 -0
  186. package/dist/interfaces/terminal-ui/theme/theme-schema.json +339 -0
  187. package/dist/interfaces/terminal-ui/theme/theme.d.ts.map +1 -0
  188. package/dist/interfaces/terminal-ui/theme/theme.js.map +1 -0
  189. package/dist/main.d.ts.map +1 -1
  190. package/dist/main.js +21 -21
  191. package/dist/main.js.map +1 -1
  192. package/dist/migrations.d.ts.map +1 -1
  193. package/dist/migrations.js.map +1 -1
  194. package/dist/runtime/agent-session.d.ts +936 -0
  195. package/dist/runtime/agent-session.d.ts.map +1 -0
  196. package/dist/runtime/agent-session.js +2737 -0
  197. package/dist/runtime/agent-session.js.map +1 -0
  198. package/dist/runtime/auth-storage.d.ts.map +1 -0
  199. package/dist/runtime/auth-storage.js.map +1 -0
  200. package/dist/runtime/bash-executor.d.ts.map +1 -0
  201. package/dist/runtime/bash-executor.js.map +1 -0
  202. package/dist/runtime/context-compression/branch-summarization.d.ts.map +1 -0
  203. package/dist/runtime/context-compression/branch-summarization.js.map +1 -0
  204. package/dist/runtime/context-compression/compaction.d.ts.map +1 -0
  205. package/dist/runtime/context-compression/compaction.js.map +1 -0
  206. package/dist/runtime/context-compression/index.d.ts.map +1 -0
  207. package/dist/runtime/context-compression/index.js.map +1 -0
  208. package/dist/runtime/context-compression/utils.d.ts.map +1 -0
  209. package/dist/runtime/context-compression/utils.js.map +1 -0
  210. package/dist/runtime/diagnostics.d.ts.map +1 -0
  211. package/dist/runtime/diagnostics.js.map +1 -0
  212. package/dist/runtime/discover-packages.d.ts.map +1 -0
  213. package/dist/runtime/discover-packages.js.map +1 -0
  214. package/dist/runtime/event-bus.d.ts.map +1 -0
  215. package/dist/runtime/event-bus.js.map +1 -0
  216. package/dist/runtime/exec.d.ts.map +1 -0
  217. package/dist/runtime/exec.js.map +1 -0
  218. package/dist/runtime/footer-data-provider.d.ts.map +1 -0
  219. package/dist/runtime/footer-data-provider.js.map +1 -0
  220. package/dist/runtime/html-export/ansi-to-html.d.ts.map +1 -0
  221. package/dist/runtime/html-export/ansi-to-html.js.map +1 -0
  222. package/dist/runtime/html-export/index.d.ts.map +1 -0
  223. package/dist/runtime/html-export/index.js +350 -0
  224. package/dist/runtime/html-export/index.js.map +1 -0
  225. package/dist/runtime/html-export/index.ts +433 -0
  226. package/dist/runtime/html-export/tool-renderer.d.ts +18 -0
  227. package/dist/runtime/html-export/tool-renderer.d.ts.map +1 -0
  228. package/dist/runtime/html-export/tool-renderer.js.map +1 -0
  229. package/dist/runtime/html-export/tool-renderer.ts +80 -0
  230. package/dist/runtime/index.d.ts +30 -0
  231. package/dist/runtime/index.d.ts.map +1 -0
  232. package/dist/runtime/index.js +30 -0
  233. package/dist/runtime/index.js.map +1 -0
  234. package/dist/runtime/keybindings.d.ts.map +1 -0
  235. package/dist/runtime/keybindings.js.map +1 -0
  236. package/dist/runtime/lifecycle/index.d.ts.map +1 -0
  237. package/dist/runtime/lifecycle/index.js.map +1 -0
  238. package/dist/runtime/lifecycle/loader.d.ts.map +1 -0
  239. package/dist/runtime/lifecycle/loader.js.map +1 -0
  240. package/dist/runtime/lifecycle/runner.d.ts.map +1 -0
  241. package/dist/runtime/lifecycle/runner.js.map +1 -0
  242. package/dist/runtime/lifecycle/types.d.ts.map +1 -0
  243. package/dist/runtime/lifecycle/types.js.map +1 -0
  244. package/dist/runtime/messages.d.ts.map +1 -0
  245. package/dist/runtime/messages.js.map +1 -0
  246. package/dist/runtime/model-registry.d.ts.map +1 -0
  247. package/dist/runtime/model-registry.js.map +1 -0
  248. package/dist/runtime/model-resolver.d.ts.map +1 -0
  249. package/dist/runtime/model-resolver.js +227 -0
  250. package/dist/runtime/model-resolver.js.map +1 -0
  251. package/dist/runtime/package-manager.d.ts.map +1 -0
  252. package/dist/runtime/package-manager.js.map +1 -0
  253. package/dist/runtime/plugins/index.d.ts.map +1 -0
  254. package/dist/runtime/plugins/index.js.map +1 -0
  255. package/dist/runtime/plugins/loader.d.ts.map +1 -0
  256. package/dist/runtime/plugins/loader.js.map +1 -0
  257. package/dist/runtime/plugins/runner.d.ts.map +1 -0
  258. package/dist/runtime/plugins/runner.js +468 -0
  259. package/dist/runtime/plugins/runner.js.map +1 -0
  260. package/dist/runtime/plugins/types.d.ts +859 -0
  261. package/dist/runtime/plugins/types.d.ts.map +1 -0
  262. package/dist/runtime/plugins/types.js.map +1 -0
  263. package/dist/runtime/plugins/wrapper.d.ts +29 -0
  264. package/dist/runtime/plugins/wrapper.d.ts.map +1 -0
  265. package/dist/runtime/plugins/wrapper.js.map +1 -0
  266. package/dist/runtime/prompt-templates.d.ts.map +1 -0
  267. package/dist/runtime/prompt-templates.js +203 -0
  268. package/dist/runtime/prompt-templates.js.map +1 -0
  269. package/dist/runtime/resource-loader.d.ts +180 -0
  270. package/dist/runtime/resource-loader.d.ts.map +1 -0
  271. package/dist/runtime/resource-loader.js +530 -0
  272. package/dist/runtime/resource-loader.js.map +1 -0
  273. package/dist/runtime/sdk.d.ts +49 -0
  274. package/dist/runtime/sdk.d.ts.map +1 -0
  275. package/dist/runtime/sdk.js +306 -0
  276. package/dist/runtime/sdk.js.map +1 -0
  277. package/dist/runtime/session-manager.d.ts.map +1 -0
  278. package/dist/runtime/session-manager.js.map +1 -0
  279. package/dist/runtime/settings-manager.d.ts.map +1 -0
  280. package/dist/runtime/settings-manager.js.map +1 -0
  281. package/dist/runtime/skills.d.ts.map +1 -0
  282. package/dist/runtime/skills.js +277 -0
  283. package/dist/runtime/skills.js.map +1 -0
  284. package/dist/runtime/subagents.d.ts.map +1 -0
  285. package/dist/runtime/subagents.js +163 -0
  286. package/dist/runtime/subagents.js.map +1 -0
  287. package/dist/runtime/system-prompt.d.ts.map +1 -0
  288. package/dist/runtime/system-prompt.js.map +1 -0
  289. package/dist/runtime/task-session-manager.d.ts.map +1 -0
  290. package/dist/runtime/task-session-manager.js.map +1 -0
  291. package/dist/runtime/timings.d.ts.map +1 -0
  292. package/dist/runtime/timings.js.map +1 -0
  293. package/dist/runtime/todo-store.d.ts.map +1 -0
  294. package/dist/runtime/todo-store.js.map +1 -0
  295. package/dist/runtime/tooling/bash.d.ts.map +1 -0
  296. package/dist/runtime/tooling/bash.js.map +1 -0
  297. package/dist/runtime/tooling/bg-process.d.ts.map +1 -0
  298. package/dist/runtime/tooling/bg-process.js.map +1 -0
  299. package/dist/runtime/tooling/edit-diff.d.ts.map +1 -0
  300. package/dist/runtime/tooling/edit-diff.js.map +1 -0
  301. package/dist/runtime/tooling/edit.d.ts.map +1 -0
  302. package/dist/runtime/tooling/edit.js.map +1 -0
  303. package/dist/runtime/tooling/find.d.ts.map +1 -0
  304. package/dist/runtime/tooling/find.js.map +1 -0
  305. package/dist/runtime/tooling/grep.d.ts.map +1 -0
  306. package/dist/runtime/tooling/grep.js.map +1 -0
  307. package/dist/runtime/tooling/index.d.ts +208 -0
  308. package/dist/runtime/tooling/index.d.ts.map +1 -0
  309. package/dist/runtime/tooling/index.js.map +1 -0
  310. package/dist/runtime/tooling/ls.d.ts.map +1 -0
  311. package/dist/runtime/tooling/ls.js.map +1 -0
  312. package/dist/runtime/tooling/memory.d.ts.map +1 -0
  313. package/dist/runtime/tooling/memory.js.map +1 -0
  314. package/dist/runtime/tooling/path-utils.d.ts.map +1 -0
  315. package/dist/runtime/tooling/path-utils.js.map +1 -0
  316. package/dist/runtime/tooling/read.d.ts.map +1 -0
  317. package/dist/runtime/tooling/read.js.map +1 -0
  318. package/dist/runtime/tooling/registry.d.ts.map +1 -0
  319. package/dist/runtime/tooling/registry.js.map +1 -0
  320. package/dist/runtime/tooling/task.d.ts.map +1 -0
  321. package/dist/runtime/tooling/task.js.map +1 -0
  322. package/dist/runtime/tooling/todo.d.ts.map +1 -0
  323. package/dist/runtime/tooling/todo.js.map +1 -0
  324. package/dist/runtime/tooling/truncate.d.ts.map +1 -0
  325. package/dist/runtime/tooling/truncate.js.map +1 -0
  326. package/dist/runtime/tooling/webfetch.d.ts.map +1 -0
  327. package/dist/runtime/tooling/webfetch.js.map +1 -0
  328. package/dist/runtime/tooling/websearch.d.ts.map +1 -0
  329. package/dist/runtime/tooling/websearch.js.map +1 -0
  330. package/dist/runtime/tooling/write.d.ts.map +1 -0
  331. package/dist/runtime/tooling/write.js.map +1 -0
  332. package/dist/telemetry/core/config.d.ts.map +1 -0
  333. package/dist/telemetry/core/config.js.map +1 -0
  334. package/dist/telemetry/core/event-bus.d.ts.map +1 -0
  335. package/dist/telemetry/core/event-bus.js.map +1 -0
  336. package/dist/telemetry/core/index.d.ts.map +1 -0
  337. package/dist/telemetry/core/index.js.map +1 -0
  338. package/dist/telemetry/core/observability.d.ts.map +1 -0
  339. package/dist/telemetry/core/observability.js.map +1 -0
  340. package/dist/telemetry/core/span.d.ts.map +1 -0
  341. package/dist/telemetry/core/span.js.map +1 -0
  342. package/dist/telemetry/core/tracer.d.ts.map +1 -0
  343. package/dist/telemetry/core/tracer.js.map +1 -0
  344. package/dist/telemetry/core/types.d.ts.map +1 -0
  345. package/dist/telemetry/core/types.js.map +1 -0
  346. package/dist/telemetry/exporters/base-exporter.d.ts.map +1 -0
  347. package/dist/telemetry/exporters/base-exporter.js.map +1 -0
  348. package/dist/telemetry/exporters/console-exporter.d.ts.map +1 -0
  349. package/dist/telemetry/exporters/console-exporter.js.map +1 -0
  350. package/dist/telemetry/exporters/file-exporter.d.ts.map +1 -0
  351. package/dist/telemetry/exporters/file-exporter.js.map +1 -0
  352. package/dist/telemetry/exporters/index.d.ts.map +1 -0
  353. package/dist/telemetry/exporters/index.js.map +1 -0
  354. package/dist/telemetry/exporters/langfuse-exporter.d.ts.map +1 -0
  355. package/dist/telemetry/exporters/langfuse-exporter.js.map +1 -0
  356. package/dist/telemetry/exporters/sentry-exporter.d.ts.map +1 -0
  357. package/dist/telemetry/exporters/sentry-exporter.js.map +1 -0
  358. package/dist/telemetry/index.d.ts.map +1 -0
  359. package/dist/telemetry/index.js.map +1 -0
  360. package/package.json +7 -7
  361. package/dist/cli/args.d.ts +0 -56
  362. package/dist/cli/args.d.ts.map +0 -1
  363. package/dist/cli/args.js.map +0 -1
  364. package/dist/cli/config-selector.d.ts +0 -17
  365. package/dist/cli/config-selector.d.ts.map +0 -1
  366. package/dist/cli/config-selector.js.map +0 -1
  367. package/dist/cli/file-processor.d.ts.map +0 -1
  368. package/dist/cli/file-processor.js.map +0 -1
  369. package/dist/cli/list-models.d.ts +0 -9
  370. package/dist/cli/list-models.d.ts.map +0 -1
  371. package/dist/cli/list-models.js.map +0 -1
  372. package/dist/cli/login-handler.d.ts.map +0 -1
  373. package/dist/cli/login-handler.js +0 -746
  374. package/dist/cli/login-handler.js.map +0 -1
  375. package/dist/cli/session-picker.d.ts.map +0 -1
  376. package/dist/cli/session-picker.js.map +0 -1
  377. package/dist/core/agent-session.d.ts +0 -936
  378. package/dist/core/agent-session.d.ts.map +0 -1
  379. package/dist/core/agent-session.js +0 -2737
  380. package/dist/core/agent-session.js.map +0 -1
  381. package/dist/core/auth-storage.d.ts.map +0 -1
  382. package/dist/core/auth-storage.js.map +0 -1
  383. package/dist/core/bash-executor.d.ts.map +0 -1
  384. package/dist/core/bash-executor.js.map +0 -1
  385. package/dist/core/compaction/branch-summarization.d.ts.map +0 -1
  386. package/dist/core/compaction/branch-summarization.js.map +0 -1
  387. package/dist/core/compaction/compaction.d.ts.map +0 -1
  388. package/dist/core/compaction/compaction.js.map +0 -1
  389. package/dist/core/compaction/index.d.ts.map +0 -1
  390. package/dist/core/compaction/index.js.map +0 -1
  391. package/dist/core/compaction/utils.d.ts.map +0 -1
  392. package/dist/core/compaction/utils.js.map +0 -1
  393. package/dist/core/diagnostics.d.ts.map +0 -1
  394. package/dist/core/diagnostics.js.map +0 -1
  395. package/dist/core/discover-packages.d.ts.map +0 -1
  396. package/dist/core/discover-packages.js.map +0 -1
  397. package/dist/core/event-bus.d.ts.map +0 -1
  398. package/dist/core/event-bus.js.map +0 -1
  399. package/dist/core/exec.d.ts.map +0 -1
  400. package/dist/core/exec.js.map +0 -1
  401. package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
  402. package/dist/core/export-html/ansi-to-html.js.map +0 -1
  403. package/dist/core/export-html/index.d.ts.map +0 -1
  404. package/dist/core/export-html/index.js +0 -350
  405. package/dist/core/export-html/index.js.map +0 -1
  406. package/dist/core/export-html/index.ts +0 -433
  407. package/dist/core/export-html/tool-renderer.d.ts +0 -18
  408. package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
  409. package/dist/core/export-html/tool-renderer.js.map +0 -1
  410. package/dist/core/export-html/tool-renderer.ts +0 -80
  411. package/dist/core/extensions/index.d.ts.map +0 -1
  412. package/dist/core/extensions/index.js.map +0 -1
  413. package/dist/core/extensions/loader.d.ts.map +0 -1
  414. package/dist/core/extensions/loader.js.map +0 -1
  415. package/dist/core/extensions/runner.d.ts.map +0 -1
  416. package/dist/core/extensions/runner.js +0 -468
  417. package/dist/core/extensions/runner.js.map +0 -1
  418. package/dist/core/extensions/types.d.ts +0 -859
  419. package/dist/core/extensions/types.d.ts.map +0 -1
  420. package/dist/core/extensions/types.js.map +0 -1
  421. package/dist/core/extensions/wrapper.d.ts +0 -29
  422. package/dist/core/extensions/wrapper.d.ts.map +0 -1
  423. package/dist/core/extensions/wrapper.js.map +0 -1
  424. package/dist/core/footer-data-provider.d.ts.map +0 -1
  425. package/dist/core/footer-data-provider.js.map +0 -1
  426. package/dist/core/hooks/index.d.ts.map +0 -1
  427. package/dist/core/hooks/index.js.map +0 -1
  428. package/dist/core/hooks/loader.d.ts.map +0 -1
  429. package/dist/core/hooks/loader.js.map +0 -1
  430. package/dist/core/hooks/runner.d.ts.map +0 -1
  431. package/dist/core/hooks/runner.js.map +0 -1
  432. package/dist/core/hooks/types.d.ts.map +0 -1
  433. package/dist/core/hooks/types.js.map +0 -1
  434. package/dist/core/index.d.ts +0 -30
  435. package/dist/core/index.d.ts.map +0 -1
  436. package/dist/core/index.js +0 -30
  437. package/dist/core/index.js.map +0 -1
  438. package/dist/core/keybindings.d.ts.map +0 -1
  439. package/dist/core/keybindings.js.map +0 -1
  440. package/dist/core/messages.d.ts.map +0 -1
  441. package/dist/core/messages.js.map +0 -1
  442. package/dist/core/model-registry.d.ts.map +0 -1
  443. package/dist/core/model-registry.js.map +0 -1
  444. package/dist/core/model-resolver.d.ts.map +0 -1
  445. package/dist/core/model-resolver.js +0 -227
  446. package/dist/core/model-resolver.js.map +0 -1
  447. package/dist/core/package-manager.d.ts.map +0 -1
  448. package/dist/core/package-manager.js.map +0 -1
  449. package/dist/core/prompt-templates.d.ts.map +0 -1
  450. package/dist/core/prompt-templates.js +0 -203
  451. package/dist/core/prompt-templates.js.map +0 -1
  452. package/dist/core/resource-loader.d.ts +0 -180
  453. package/dist/core/resource-loader.d.ts.map +0 -1
  454. package/dist/core/resource-loader.js +0 -530
  455. package/dist/core/resource-loader.js.map +0 -1
  456. package/dist/core/sdk.d.ts +0 -49
  457. package/dist/core/sdk.d.ts.map +0 -1
  458. package/dist/core/sdk.js +0 -306
  459. package/dist/core/sdk.js.map +0 -1
  460. package/dist/core/session-manager.d.ts.map +0 -1
  461. package/dist/core/session-manager.js.map +0 -1
  462. package/dist/core/settings-manager.d.ts.map +0 -1
  463. package/dist/core/settings-manager.js.map +0 -1
  464. package/dist/core/skills.d.ts.map +0 -1
  465. package/dist/core/skills.js +0 -277
  466. package/dist/core/skills.js.map +0 -1
  467. package/dist/core/subagents.d.ts.map +0 -1
  468. package/dist/core/subagents.js +0 -163
  469. package/dist/core/subagents.js.map +0 -1
  470. package/dist/core/system-prompt.d.ts.map +0 -1
  471. package/dist/core/system-prompt.js.map +0 -1
  472. package/dist/core/task-session-manager.d.ts.map +0 -1
  473. package/dist/core/task-session-manager.js.map +0 -1
  474. package/dist/core/timings.d.ts.map +0 -1
  475. package/dist/core/timings.js.map +0 -1
  476. package/dist/core/todo-store.d.ts.map +0 -1
  477. package/dist/core/todo-store.js.map +0 -1
  478. package/dist/core/tools/bash.d.ts.map +0 -1
  479. package/dist/core/tools/bash.js.map +0 -1
  480. package/dist/core/tools/bg-process.d.ts.map +0 -1
  481. package/dist/core/tools/bg-process.js.map +0 -1
  482. package/dist/core/tools/edit-diff.d.ts.map +0 -1
  483. package/dist/core/tools/edit-diff.js.map +0 -1
  484. package/dist/core/tools/edit.d.ts.map +0 -1
  485. package/dist/core/tools/edit.js.map +0 -1
  486. package/dist/core/tools/find.d.ts.map +0 -1
  487. package/dist/core/tools/find.js.map +0 -1
  488. package/dist/core/tools/grep.d.ts.map +0 -1
  489. package/dist/core/tools/grep.js.map +0 -1
  490. package/dist/core/tools/index.d.ts +0 -208
  491. package/dist/core/tools/index.d.ts.map +0 -1
  492. package/dist/core/tools/index.js.map +0 -1
  493. package/dist/core/tools/ls.d.ts.map +0 -1
  494. package/dist/core/tools/ls.js.map +0 -1
  495. package/dist/core/tools/memory.d.ts.map +0 -1
  496. package/dist/core/tools/memory.js.map +0 -1
  497. package/dist/core/tools/path-utils.d.ts.map +0 -1
  498. package/dist/core/tools/path-utils.js.map +0 -1
  499. package/dist/core/tools/read.d.ts.map +0 -1
  500. package/dist/core/tools/read.js.map +0 -1
  501. package/dist/core/tools/registry.d.ts.map +0 -1
  502. package/dist/core/tools/registry.js.map +0 -1
  503. package/dist/core/tools/task.d.ts.map +0 -1
  504. package/dist/core/tools/task.js.map +0 -1
  505. package/dist/core/tools/todo.d.ts.map +0 -1
  506. package/dist/core/tools/todo.js.map +0 -1
  507. package/dist/core/tools/truncate.d.ts.map +0 -1
  508. package/dist/core/tools/truncate.js.map +0 -1
  509. package/dist/core/tools/webfetch.d.ts.map +0 -1
  510. package/dist/core/tools/webfetch.js.map +0 -1
  511. package/dist/core/tools/websearch.d.ts.map +0 -1
  512. package/dist/core/tools/websearch.js.map +0 -1
  513. package/dist/core/tools/write.d.ts.map +0 -1
  514. package/dist/core/tools/write.js.map +0 -1
  515. package/dist/modes/index.d.ts +0 -16
  516. package/dist/modes/index.d.ts.map +0 -1
  517. package/dist/modes/index.js +0 -14
  518. package/dist/modes/index.js.map +0 -1
  519. package/dist/modes/interactive/components/armin.d.ts.map +0 -1
  520. package/dist/modes/interactive/components/armin.js.map +0 -1
  521. package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
  522. package/dist/modes/interactive/components/assistant-message.js.map +0 -1
  523. package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
  524. package/dist/modes/interactive/components/bash-execution.js.map +0 -1
  525. package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
  526. package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
  527. package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -16
  528. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
  529. package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
  530. package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -16
  531. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
  532. package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
  533. package/dist/modes/interactive/components/config-selector.d.ts +0 -71
  534. package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
  535. package/dist/modes/interactive/components/config-selector.js.map +0 -1
  536. package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
  537. package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
  538. package/dist/modes/interactive/components/custom-editor.d.ts +0 -17
  539. package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
  540. package/dist/modes/interactive/components/custom-editor.js.map +0 -1
  541. package/dist/modes/interactive/components/custom-message.d.ts +0 -19
  542. package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
  543. package/dist/modes/interactive/components/custom-message.js.map +0 -1
  544. package/dist/modes/interactive/components/diff.d.ts.map +0 -1
  545. package/dist/modes/interactive/components/diff.js.map +0 -1
  546. package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
  547. package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
  548. package/dist/modes/interactive/components/extension-editor.d.ts +0 -13
  549. package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
  550. package/dist/modes/interactive/components/extension-editor.js.map +0 -1
  551. package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
  552. package/dist/modes/interactive/components/extension-input.js.map +0 -1
  553. package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
  554. package/dist/modes/interactive/components/extension-selector.js.map +0 -1
  555. package/dist/modes/interactive/components/footer.d.ts +0 -17
  556. package/dist/modes/interactive/components/footer.d.ts.map +0 -1
  557. package/dist/modes/interactive/components/footer.js.map +0 -1
  558. package/dist/modes/interactive/components/index.d.ts.map +0 -1
  559. package/dist/modes/interactive/components/index.js.map +0 -1
  560. package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -23
  561. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
  562. package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
  563. package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
  564. package/dist/modes/interactive/components/login-dialog.js.map +0 -1
  565. package/dist/modes/interactive/components/model-selector.d.ts +0 -43
  566. package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
  567. package/dist/modes/interactive/components/model-selector.js.map +0 -1
  568. package/dist/modes/interactive/components/oauth-selector.d.ts +0 -75
  569. package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
  570. package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
  571. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
  572. package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
  573. package/dist/modes/interactive/components/session-selector-search.d.ts +0 -21
  574. package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
  575. package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
  576. package/dist/modes/interactive/components/session-selector.d.ts +0 -85
  577. package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
  578. package/dist/modes/interactive/components/session-selector.js.map +0 -1
  579. package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
  580. package/dist/modes/interactive/components/settings-selector.js.map +0 -1
  581. package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
  582. package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
  583. package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -17
  584. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
  585. package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
  586. package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
  587. package/dist/modes/interactive/components/theme-selector.js.map +0 -1
  588. package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
  589. package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
  590. package/dist/modes/interactive/components/tool-execution.d.ts +0 -72
  591. package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
  592. package/dist/modes/interactive/components/tool-execution.js +0 -1001
  593. package/dist/modes/interactive/components/tool-execution.js.map +0 -1
  594. package/dist/modes/interactive/components/tree-selector.d.ts +0 -62
  595. package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
  596. package/dist/modes/interactive/components/tree-selector.js.map +0 -1
  597. package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
  598. package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
  599. package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
  600. package/dist/modes/interactive/components/user-message.js.map +0 -1
  601. package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
  602. package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
  603. package/dist/modes/interactive/interactive-mode.d.ts +0 -1931
  604. package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
  605. package/dist/modes/interactive/interactive-mode.js +0 -5733
  606. package/dist/modes/interactive/interactive-mode.js.map +0 -1
  607. package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
  608. package/dist/modes/interactive/theme/theme.js.map +0 -1
  609. package/dist/modes/print-mode.d.ts +0 -561
  610. package/dist/modes/print-mode.d.ts.map +0 -1
  611. package/dist/modes/print-mode.js.map +0 -1
  612. package/dist/modes/rpc/rpc-client.d.ts +0 -1129
  613. package/dist/modes/rpc/rpc-client.d.ts.map +0 -1
  614. package/dist/modes/rpc/rpc-client.js.map +0 -1
  615. package/dist/modes/rpc/rpc-mode.d.ts +0 -813
  616. package/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
  617. package/dist/modes/rpc/rpc-mode.js +0 -1229
  618. package/dist/modes/rpc/rpc-mode.js.map +0 -1
  619. package/dist/modes/rpc/rpc-types.d.ts +0 -392
  620. package/dist/modes/rpc/rpc-types.d.ts.map +0 -1
  621. package/dist/modes/rpc/rpc-types.js.map +0 -1
  622. package/dist/modes/shared.d.ts.map +0 -1
  623. package/dist/modes/shared.js.map +0 -1
  624. package/dist/observability/core/config.d.ts.map +0 -1
  625. package/dist/observability/core/config.js.map +0 -1
  626. package/dist/observability/core/event-bus.d.ts.map +0 -1
  627. package/dist/observability/core/event-bus.js.map +0 -1
  628. package/dist/observability/core/index.d.ts.map +0 -1
  629. package/dist/observability/core/index.js.map +0 -1
  630. package/dist/observability/core/observability.d.ts.map +0 -1
  631. package/dist/observability/core/observability.js.map +0 -1
  632. package/dist/observability/core/span.d.ts.map +0 -1
  633. package/dist/observability/core/span.js.map +0 -1
  634. package/dist/observability/core/tracer.d.ts.map +0 -1
  635. package/dist/observability/core/tracer.js.map +0 -1
  636. package/dist/observability/core/types.d.ts.map +0 -1
  637. package/dist/observability/core/types.js.map +0 -1
  638. package/dist/observability/exporters/base-exporter.d.ts.map +0 -1
  639. package/dist/observability/exporters/base-exporter.js.map +0 -1
  640. package/dist/observability/exporters/console-exporter.d.ts.map +0 -1
  641. package/dist/observability/exporters/console-exporter.js.map +0 -1
  642. package/dist/observability/exporters/file-exporter.d.ts.map +0 -1
  643. package/dist/observability/exporters/file-exporter.js.map +0 -1
  644. package/dist/observability/exporters/index.d.ts.map +0 -1
  645. package/dist/observability/exporters/index.js.map +0 -1
  646. package/dist/observability/exporters/langfuse-exporter.d.ts.map +0 -1
  647. package/dist/observability/exporters/langfuse-exporter.js.map +0 -1
  648. package/dist/observability/exporters/sentry-exporter.d.ts.map +0 -1
  649. package/dist/observability/exporters/sentry-exporter.js.map +0 -1
  650. package/dist/observability/index.d.ts.map +0 -1
  651. package/dist/observability/index.js.map +0 -1
  652. package/dist/utils/array.d.ts.map +0 -1
  653. package/dist/utils/array.js.map +0 -1
  654. package/dist/utils/changelog.d.ts.map +0 -1
  655. package/dist/utils/changelog.js.map +0 -1
  656. package/dist/utils/clipboard-image.d.ts.map +0 -1
  657. package/dist/utils/clipboard-image.js.map +0 -1
  658. package/dist/utils/clipboard.d.ts.map +0 -1
  659. package/dist/utils/clipboard.js.map +0 -1
  660. package/dist/utils/color-formatter.d.ts.map +0 -1
  661. package/dist/utils/color-formatter.js.map +0 -1
  662. package/dist/utils/data-transformer.d.ts.map +0 -1
  663. package/dist/utils/data-transformer.js.map +0 -1
  664. package/dist/utils/date-formatter.d.ts.map +0 -1
  665. package/dist/utils/date-formatter.js.map +0 -1
  666. package/dist/utils/error-handler.d.ts.map +0 -1
  667. package/dist/utils/error-handler.js.map +0 -1
  668. package/dist/utils/file-operations.d.ts.map +0 -1
  669. package/dist/utils/file-operations.js.map +0 -1
  670. package/dist/utils/frontmatter.d.ts.map +0 -1
  671. package/dist/utils/frontmatter.js.map +0 -1
  672. package/dist/utils/git.d.ts.map +0 -1
  673. package/dist/utils/git.js.map +0 -1
  674. package/dist/utils/image-convert.d.ts.map +0 -1
  675. package/dist/utils/image-convert.js.map +0 -1
  676. package/dist/utils/image-resize.d.ts.map +0 -1
  677. package/dist/utils/image-resize.js.map +0 -1
  678. package/dist/utils/json-formatter.d.ts.map +0 -1
  679. package/dist/utils/json-formatter.js.map +0 -1
  680. package/dist/utils/logger.d.ts.map +0 -1
  681. package/dist/utils/logger.js.map +0 -1
  682. package/dist/utils/markdown-formatter.d.ts.map +0 -1
  683. package/dist/utils/markdown-formatter.js.map +0 -1
  684. package/dist/utils/mime.d.ts.map +0 -1
  685. package/dist/utils/mime.js.map +0 -1
  686. package/dist/utils/path-validator.d.ts.map +0 -1
  687. package/dist/utils/path-validator.js.map +0 -1
  688. package/dist/utils/photon.d.ts.map +0 -1
  689. package/dist/utils/photon.js.map +0 -1
  690. package/dist/utils/shell.d.ts.map +0 -1
  691. package/dist/utils/shell.js +0 -142
  692. package/dist/utils/shell.js.map +0 -1
  693. package/dist/utils/sleep.d.ts.map +0 -1
  694. package/dist/utils/sleep.js.map +0 -1
  695. package/dist/utils/string-formatter.d.ts.map +0 -1
  696. package/dist/utils/string-formatter.js.map +0 -1
  697. package/dist/utils/tools-manager.d.ts.map +0 -1
  698. package/dist/utils/tools-manager.js.map +0 -1
  699. package/dist/utils/type-guards.d.ts.map +0 -1
  700. package/dist/utils/type-guards.js.map +0 -1
  701. /package/{examples → demos}/README.md +0 -0
  702. /package/dist/{cli → command-line}/args.js +0 -0
  703. /package/dist/{cli → command-line}/config-selector.js +0 -0
  704. /package/dist/{cli → command-line}/file-processor.d.ts +0 -0
  705. /package/dist/{cli → command-line}/file-processor.js +0 -0
  706. /package/dist/{cli → command-line}/list-models.js +0 -0
  707. /package/dist/{cli → command-line}/login-handler.d.ts +0 -0
  708. /package/dist/{cli → command-line}/session-picker.d.ts +0 -0
  709. /package/dist/{cli → command-line}/session-picker.js +0 -0
  710. /package/dist/{utils → helpers}/array.d.ts +0 -0
  711. /package/dist/{utils → helpers}/array.js +0 -0
  712. /package/dist/{utils → helpers}/changelog.d.ts +0 -0
  713. /package/dist/{utils → helpers}/changelog.js +0 -0
  714. /package/dist/{utils → helpers}/clipboard-image.d.ts +0 -0
  715. /package/dist/{utils → helpers}/clipboard-image.js +0 -0
  716. /package/dist/{utils → helpers}/clipboard.d.ts +0 -0
  717. /package/dist/{utils → helpers}/clipboard.js +0 -0
  718. /package/dist/{utils → helpers}/color-formatter.d.ts +0 -0
  719. /package/dist/{utils → helpers}/color-formatter.js +0 -0
  720. /package/dist/{utils → helpers}/data-transformer.d.ts +0 -0
  721. /package/dist/{utils → helpers}/data-transformer.js +0 -0
  722. /package/dist/{utils → helpers}/date-formatter.d.ts +0 -0
  723. /package/dist/{utils → helpers}/date-formatter.js +0 -0
  724. /package/dist/{utils → helpers}/error-handler.d.ts +0 -0
  725. /package/dist/{utils → helpers}/error-handler.js +0 -0
  726. /package/dist/{utils → helpers}/file-operations.d.ts +0 -0
  727. /package/dist/{utils → helpers}/file-operations.js +0 -0
  728. /package/dist/{utils → helpers}/frontmatter.d.ts +0 -0
  729. /package/dist/{utils → helpers}/frontmatter.js +0 -0
  730. /package/dist/{utils → helpers}/git.d.ts +0 -0
  731. /package/dist/{utils → helpers}/git.js +0 -0
  732. /package/dist/{utils → helpers}/image-convert.d.ts +0 -0
  733. /package/dist/{utils → helpers}/image-convert.js +0 -0
  734. /package/dist/{utils → helpers}/image-resize.d.ts +0 -0
  735. /package/dist/{utils → helpers}/image-resize.js +0 -0
  736. /package/dist/{utils → helpers}/json-formatter.d.ts +0 -0
  737. /package/dist/{utils → helpers}/json-formatter.js +0 -0
  738. /package/dist/{utils → helpers}/logger.d.ts +0 -0
  739. /package/dist/{utils → helpers}/logger.js +0 -0
  740. /package/dist/{utils → helpers}/markdown-formatter.d.ts +0 -0
  741. /package/dist/{utils → helpers}/markdown-formatter.js +0 -0
  742. /package/dist/{utils → helpers}/mime.d.ts +0 -0
  743. /package/dist/{utils → helpers}/mime.js +0 -0
  744. /package/dist/{utils → helpers}/path-validator.d.ts +0 -0
  745. /package/dist/{utils → helpers}/path-validator.js +0 -0
  746. /package/dist/{utils → helpers}/photon.d.ts +0 -0
  747. /package/dist/{utils → helpers}/photon.js +0 -0
  748. /package/dist/{utils → helpers}/shell.d.ts +0 -0
  749. /package/dist/{utils → helpers}/sleep.d.ts +0 -0
  750. /package/dist/{utils → helpers}/sleep.js +0 -0
  751. /package/dist/{utils → helpers}/string-formatter.d.ts +0 -0
  752. /package/dist/{utils → helpers}/string-formatter.js +0 -0
  753. /package/dist/{utils → helpers}/tools-manager.d.ts +0 -0
  754. /package/dist/{utils → helpers}/tools-manager.js +0 -0
  755. /package/dist/{utils → helpers}/type-guards.d.ts +0 -0
  756. /package/dist/{utils → helpers}/type-guards.js +0 -0
  757. /package/dist/{modes → interfaces}/print-mode.js +0 -0
  758. /package/dist/{modes/rpc → interfaces/service-api}/rpc-client.js +0 -0
  759. /package/dist/{modes/rpc → interfaces/service-api}/rpc-types.js +0 -0
  760. /package/dist/{modes → interfaces}/shared.d.ts +0 -0
  761. /package/dist/{modes → interfaces}/shared.js +0 -0
  762. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/armin.d.ts +0 -0
  763. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/armin.js +0 -0
  764. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/assistant-message.d.ts +0 -0
  765. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/assistant-message.js +0 -0
  766. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bash-execution.d.ts +0 -0
  767. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bash-execution.js +0 -0
  768. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bordered-loader.d.ts +0 -0
  769. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bordered-loader.js +0 -0
  770. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/branch-summary-message.js +0 -0
  771. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/compaction-summary-message.js +0 -0
  772. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/config-selector.js +0 -0
  773. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/countdown-timer.d.ts +0 -0
  774. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/countdown-timer.js +0 -0
  775. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/custom-editor.js +0 -0
  776. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/custom-message.js +0 -0
  777. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/diff.d.ts +0 -0
  778. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/diff.js +0 -0
  779. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/dynamic-border.d.ts +0 -0
  780. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/dynamic-border.js +0 -0
  781. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-editor.js +0 -0
  782. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-input.d.ts +0 -0
  783. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-input.js +0 -0
  784. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-selector.d.ts +0 -0
  785. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-selector.js +0 -0
  786. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/footer.js +0 -0
  787. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/index.d.ts +0 -0
  788. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/index.js +0 -0
  789. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/keybinding-hints.js +0 -0
  790. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/login-dialog.d.ts +0 -0
  791. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/login-dialog.js +0 -0
  792. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/model-selector.js +0 -0
  793. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/oauth-selector.js +0 -0
  794. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/scoped-models-selector.d.ts +0 -0
  795. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/scoped-models-selector.js +0 -0
  796. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/session-selector-search.js +0 -0
  797. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/session-selector.js +0 -0
  798. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/settings-selector.d.ts +0 -0
  799. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/settings-selector.js +0 -0
  800. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/show-images-selector.d.ts +0 -0
  801. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/show-images-selector.js +0 -0
  802. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/skill-invocation-message.js +0 -0
  803. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/theme-selector.d.ts +0 -0
  804. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/theme-selector.js +0 -0
  805. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/thinking-selector.d.ts +0 -0
  806. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/thinking-selector.js +0 -0
  807. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/tree-selector.js +0 -0
  808. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message-selector.d.ts +0 -0
  809. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message-selector.js +0 -0
  810. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message.d.ts +0 -0
  811. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message.js +0 -0
  812. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/visual-truncate.d.ts +0 -0
  813. /package/dist/{modes/interactive → interfaces/terminal-ui}/components/visual-truncate.js +0 -0
  814. /package/dist/{modes/interactive → interfaces/terminal-ui}/theme/theme.d.ts +0 -0
  815. /package/dist/{modes/interactive → interfaces/terminal-ui}/theme/theme.js +0 -0
  816. /package/dist/{core → runtime}/auth-storage.d.ts +0 -0
  817. /package/dist/{core → runtime}/auth-storage.js +0 -0
  818. /package/dist/{core → runtime}/bash-executor.d.ts +0 -0
  819. /package/dist/{core → runtime}/bash-executor.js +0 -0
  820. /package/dist/{core/compaction → runtime/context-compression}/branch-summarization.d.ts +0 -0
  821. /package/dist/{core/compaction → runtime/context-compression}/branch-summarization.js +0 -0
  822. /package/dist/{core/compaction → runtime/context-compression}/compaction.d.ts +0 -0
  823. /package/dist/{core/compaction → runtime/context-compression}/compaction.js +0 -0
  824. /package/dist/{core/compaction → runtime/context-compression}/index.d.ts +0 -0
  825. /package/dist/{core/compaction → runtime/context-compression}/index.js +0 -0
  826. /package/dist/{core/compaction → runtime/context-compression}/utils.d.ts +0 -0
  827. /package/dist/{core/compaction → runtime/context-compression}/utils.js +0 -0
  828. /package/dist/{core → runtime}/diagnostics.d.ts +0 -0
  829. /package/dist/{core → runtime}/diagnostics.js +0 -0
  830. /package/dist/{core → runtime}/discover-packages.d.ts +0 -0
  831. /package/dist/{core → runtime}/discover-packages.js +0 -0
  832. /package/dist/{core → runtime}/event-bus.d.ts +0 -0
  833. /package/dist/{core → runtime}/event-bus.js +0 -0
  834. /package/dist/{core → runtime}/exec.d.ts +0 -0
  835. /package/dist/{core → runtime}/exec.js +0 -0
  836. /package/dist/{core → runtime}/footer-data-provider.d.ts +0 -0
  837. /package/dist/{core → runtime}/footer-data-provider.js +0 -0
  838. /package/dist/{core/export-html → runtime/html-export}/ansi-to-html.d.ts +0 -0
  839. /package/dist/{core/export-html → runtime/html-export}/ansi-to-html.js +0 -0
  840. /package/dist/{core/export-html → runtime/html-export}/ansi-to-html.ts +0 -0
  841. /package/dist/{core/export-html → runtime/html-export}/index.d.ts +0 -0
  842. /package/dist/{core/export-html → runtime/html-export}/template.css +0 -0
  843. /package/dist/{core/export-html → runtime/html-export}/template.html +0 -0
  844. /package/dist/{core/export-html → runtime/html-export}/template.js +0 -0
  845. /package/dist/{core/export-html → runtime/html-export}/tool-renderer.js +0 -0
  846. /package/dist/{core/export-html → runtime/html-export}/vendor/highlight.min.js +0 -0
  847. /package/dist/{core/export-html → runtime/html-export}/vendor/marked.min.js +0 -0
  848. /package/dist/{core → runtime}/keybindings.d.ts +0 -0
  849. /package/dist/{core → runtime}/keybindings.js +0 -0
  850. /package/dist/{core/hooks → runtime/lifecycle}/index.d.ts +0 -0
  851. /package/dist/{core/hooks → runtime/lifecycle}/index.js +0 -0
  852. /package/dist/{core/hooks → runtime/lifecycle}/loader.d.ts +0 -0
  853. /package/dist/{core/hooks → runtime/lifecycle}/loader.js +0 -0
  854. /package/dist/{core/hooks → runtime/lifecycle}/runner.d.ts +0 -0
  855. /package/dist/{core/hooks → runtime/lifecycle}/runner.js +0 -0
  856. /package/dist/{core/hooks → runtime/lifecycle}/types.d.ts +0 -0
  857. /package/dist/{core/hooks → runtime/lifecycle}/types.js +0 -0
  858. /package/dist/{core → runtime}/messages.d.ts +0 -0
  859. /package/dist/{core → runtime}/messages.js +0 -0
  860. /package/dist/{core → runtime}/model-registry.d.ts +0 -0
  861. /package/dist/{core → runtime}/model-registry.js +0 -0
  862. /package/dist/{core → runtime}/model-resolver.d.ts +0 -0
  863. /package/dist/{core → runtime}/package-manager.d.ts +0 -0
  864. /package/dist/{core → runtime}/package-manager.js +0 -0
  865. /package/dist/{core/extensions → runtime/plugins}/index.d.ts +0 -0
  866. /package/dist/{core/extensions → runtime/plugins}/index.js +0 -0
  867. /package/dist/{core/extensions → runtime/plugins}/loader.d.ts +0 -0
  868. /package/dist/{core/extensions → runtime/plugins}/loader.js +0 -0
  869. /package/dist/{core/extensions → runtime/plugins}/runner.d.ts +0 -0
  870. /package/dist/{core/extensions → runtime/plugins}/types.js +0 -0
  871. /package/dist/{core/extensions → runtime/plugins}/wrapper.js +0 -0
  872. /package/dist/{core → runtime}/prompt-templates.d.ts +0 -0
  873. /package/dist/{core → runtime}/session-manager.d.ts +0 -0
  874. /package/dist/{core → runtime}/session-manager.js +0 -0
  875. /package/dist/{core → runtime}/settings-manager.d.ts +0 -0
  876. /package/dist/{core → runtime}/settings-manager.js +0 -0
  877. /package/dist/{core → runtime}/skills.d.ts +0 -0
  878. /package/dist/{core → runtime}/subagents.d.ts +0 -0
  879. /package/dist/{core → runtime}/system-prompt.d.ts +0 -0
  880. /package/dist/{core → runtime}/system-prompt.js +0 -0
  881. /package/dist/{core → runtime}/task-session-manager.d.ts +0 -0
  882. /package/dist/{core → runtime}/task-session-manager.js +0 -0
  883. /package/dist/{core → runtime}/timings.d.ts +0 -0
  884. /package/dist/{core → runtime}/timings.js +0 -0
  885. /package/dist/{core → runtime}/todo-store.d.ts +0 -0
  886. /package/dist/{core → runtime}/todo-store.js +0 -0
  887. /package/dist/{core/tools → runtime/tooling}/bash.d.ts +0 -0
  888. /package/dist/{core/tools → runtime/tooling}/bash.js +0 -0
  889. /package/dist/{core/tools → runtime/tooling}/bg-process.d.ts +0 -0
  890. /package/dist/{core/tools → runtime/tooling}/bg-process.js +0 -0
  891. /package/dist/{core/tools → runtime/tooling}/edit-diff.d.ts +0 -0
  892. /package/dist/{core/tools → runtime/tooling}/edit-diff.js +0 -0
  893. /package/dist/{core/tools → runtime/tooling}/edit.d.ts +0 -0
  894. /package/dist/{core/tools → runtime/tooling}/edit.js +0 -0
  895. /package/dist/{core/tools → runtime/tooling}/find.d.ts +0 -0
  896. /package/dist/{core/tools → runtime/tooling}/find.js +0 -0
  897. /package/dist/{core/tools → runtime/tooling}/grep.d.ts +0 -0
  898. /package/dist/{core/tools → runtime/tooling}/grep.js +0 -0
  899. /package/dist/{core/tools → runtime/tooling}/index.js +0 -0
  900. /package/dist/{core/tools → runtime/tooling}/ls.d.ts +0 -0
  901. /package/dist/{core/tools → runtime/tooling}/ls.js +0 -0
  902. /package/dist/{core/tools → runtime/tooling}/memory.d.ts +0 -0
  903. /package/dist/{core/tools → runtime/tooling}/memory.js +0 -0
  904. /package/dist/{core/tools → runtime/tooling}/path-utils.d.ts +0 -0
  905. /package/dist/{core/tools → runtime/tooling}/path-utils.js +0 -0
  906. /package/dist/{core/tools → runtime/tooling}/read.d.ts +0 -0
  907. /package/dist/{core/tools → runtime/tooling}/read.js +0 -0
  908. /package/dist/{core/tools → runtime/tooling}/registry.d.ts +0 -0
  909. /package/dist/{core/tools → runtime/tooling}/registry.js +0 -0
  910. /package/dist/{core/tools → runtime/tooling}/task.d.ts +0 -0
  911. /package/dist/{core/tools → runtime/tooling}/task.js +0 -0
  912. /package/dist/{core/tools → runtime/tooling}/todo.d.ts +0 -0
  913. /package/dist/{core/tools → runtime/tooling}/todo.js +0 -0
  914. /package/dist/{core/tools → runtime/tooling}/truncate.d.ts +0 -0
  915. /package/dist/{core/tools → runtime/tooling}/truncate.js +0 -0
  916. /package/dist/{core/tools → runtime/tooling}/webfetch.d.ts +0 -0
  917. /package/dist/{core/tools → runtime/tooling}/webfetch.js +0 -0
  918. /package/dist/{core/tools → runtime/tooling}/websearch.d.ts +0 -0
  919. /package/dist/{core/tools → runtime/tooling}/websearch.js +0 -0
  920. /package/dist/{core/tools → runtime/tooling}/write.d.ts +0 -0
  921. /package/dist/{core/tools → runtime/tooling}/write.js +0 -0
  922. /package/dist/{observability → telemetry}/core/config.d.ts +0 -0
  923. /package/dist/{observability → telemetry}/core/config.js +0 -0
  924. /package/dist/{observability → telemetry}/core/event-bus.d.ts +0 -0
  925. /package/dist/{observability → telemetry}/core/event-bus.js +0 -0
  926. /package/dist/{observability → telemetry}/core/index.d.ts +0 -0
  927. /package/dist/{observability → telemetry}/core/index.js +0 -0
  928. /package/dist/{observability → telemetry}/core/observability.d.ts +0 -0
  929. /package/dist/{observability → telemetry}/core/observability.js +0 -0
  930. /package/dist/{observability → telemetry}/core/span.d.ts +0 -0
  931. /package/dist/{observability → telemetry}/core/span.js +0 -0
  932. /package/dist/{observability → telemetry}/core/tracer.d.ts +0 -0
  933. /package/dist/{observability → telemetry}/core/tracer.js +0 -0
  934. /package/dist/{observability → telemetry}/core/types.d.ts +0 -0
  935. /package/dist/{observability → telemetry}/core/types.js +0 -0
  936. /package/dist/{observability → telemetry}/exporters/base-exporter.d.ts +0 -0
  937. /package/dist/{observability → telemetry}/exporters/base-exporter.js +0 -0
  938. /package/dist/{observability → telemetry}/exporters/console-exporter.d.ts +0 -0
  939. /package/dist/{observability → telemetry}/exporters/console-exporter.js +0 -0
  940. /package/dist/{observability → telemetry}/exporters/file-exporter.d.ts +0 -0
  941. /package/dist/{observability → telemetry}/exporters/file-exporter.js +0 -0
  942. /package/dist/{observability → telemetry}/exporters/index.d.ts +0 -0
  943. /package/dist/{observability → telemetry}/exporters/index.js +0 -0
  944. /package/dist/{observability → telemetry}/exporters/langfuse-exporter.d.ts +0 -0
  945. /package/dist/{observability → telemetry}/exporters/langfuse-exporter.js +0 -0
  946. /package/dist/{observability → telemetry}/exporters/sentry-exporter.d.ts +0 -0
  947. /package/dist/{observability → telemetry}/exporters/sentry-exporter.js +0 -0
  948. /package/dist/{observability → telemetry}/index.d.ts +0 -0
  949. /package/dist/{observability → telemetry}/index.js +0 -0
  950. /package/{docs → guides}/PI_MONO_MIT_REMOVAL_GUIDE.md +0 -0
  951. /package/{docs → guides}/SAME_TO_SAME_PARITY_REPORT.md +0 -0
@@ -1,1001 +0,0 @@
1
- import * as os from "node:os";
2
- import { Box, Container, getCapabilities, getImageDimensions, Image, imageFallback, Spacer, Text, truncateToWidth, } from "indusagi/tui";
3
- import stripAnsi from "strip-ansi";
4
- import { computeEditDiff } from "indusagi/agent";
5
- import { allTools } from "../../../core/tools/index.js";
6
- import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize } from "indusagi/agent";
7
- import { convertToPng } from "../../../utils/image-convert.js";
8
- import { sanitizeBinaryOutput } from "../../../utils/shell.js";
9
- import { getLanguageFromPath, highlightCode, theme } from "../theme/theme.js";
10
- import { renderDiff } from "./diff.js";
11
- import { keyHint } from "./keybinding-hints.js";
12
- import { truncateToVisualLines } from "./visual-truncate.js";
13
- // Preview line limit for bash when not expanded
14
- const BASH_PREVIEW_LINES = 5;
15
- /**
16
- * ============================================================================
17
- * TOOL EXECUTION COMPONENT - COMPREHENSIVE RENDERING MODULE
18
- * ============================================================================
19
- *
20
- * PURPOSE:
21
- * ============================================================================
22
- * Renders tool call invocations and their results in the interactive chat
23
- * interface. This component is the primary display system for all tool
24
- * execution in the agent, supporting:
25
- *
26
- * - Built-in tools (read, write, edit, bash, ls, find, grep, task, todos)
27
- * - Custom tools with extension renderers
28
- * - Real-time result streaming and updates
29
- * - Expandable/collapsible output (respects toolOutputExpanded setting)
30
- * - Syntax highlighting (code blocks, diffs, file paths)
31
- * - Image rendering (with format conversion for compatibility)
32
- * - Error states and partial results
33
- * - Truncation warnings (context limit, output limit)
34
- *
35
- * TOOL-SPECIFIC RENDERING:
36
- * Each tool has specialized rendering logic:
37
- * - read: File contents with line numbers, highlighting
38
- * - write: File creation preview, error display
39
- * - edit: Visual diff (added/removed lines), line numbers
40
- * - bash: Command + output with visual line truncation
41
- * - ls/find/grep: Formatted output with entry limits
42
- * - task: Metadata (subagent, duration, tool count)
43
- * - todos: Status icons, priority coloring, completion count
44
- *
45
- * DATA FLOW:
46
- * ============================================================================
47
- * Tool Execution Pipeline:
48
- * Assistant message with tool call content
49
- * ↓
50
- * InteractiveMode.renderSessionContext() encounters tool call
51
- * ↓
52
- * ToolExecutionComponent created with tool name + args
53
- * ↓
54
- * updateDisplay() renders pending state (no result yet)
55
- * ↓
56
- * Tool executes in background (on agent server)
57
- * ↓
58
- * AgentSession emits tool_output event
59
- * ↓
60
- * InteractiveMode.subscribeToAgent() receives tool_output
61
- * ↓
62
- * component.updateResult() called with result content
63
- * ↓
64
- * updateDisplay() re-renders with result + background color
65
- * ↓
66
- * TUI invalidate() and requestRender()
67
- * ↓
68
- * Terminal displays complete tool execution
69
- *
70
- * Streaming Tool Output:
71
- * Some tools (bash, read, find) stream output:
72
- * 1. tool_output event arrives with isPartial=true
73
- * 2. updateResult() called, still showing pending background
74
- * 3. Later, tool_output event with isPartial=false (complete)
75
- * 4. updateDisplay() shows final result + success/error background
76
- *
77
- * Async Operations:
78
- * - Edit diff computation: async computeEditDiff() with caching
79
- * - Image format conversion: async convertToPng() for Kitty protocol
80
- * - Both update display when complete via ui.requestRender()
81
- *
82
- * RENDERING PIPELINE:
83
- * ============================================================================
84
- * Component Structure (ASCII):
85
- * ┌───────────────────────────────────────────────────────────┐
86
- * │ [Spacer 1 line] │ ← Top margin
87
- * ├───────────────────────────────────────────────────────────┤
88
- * │ PENDING STATE (while tool executing) │
89
- * │ ████████████████████████████████████████████████████████ │ ← toolPendingBg
90
- * │ █ read /path/to/file.ts:10-20 █
91
- * │ █ (Executing...) █
92
- * │ ████████████████████████████████████████████████████████ │
93
- * ├───────────────────────────────────────────────────────────┤
94
- * │ COMPLETE STATE (after result arrives) │
95
- * │ ████████████████████████████████████████████████████████ │ ← toolSuccessBg or toolErrorBg
96
- * │ █ read /path/to/file.ts:10-20 │
97
- * │ █ │
98
- * │ █ 10 | import { foo } from 'bar'; │
99
- * │ █ 11 | const x = foo(); │
100
- * │ █ 12 | export { x }; │
101
- * │ █ ... (5 more lines, to expand) │
102
- * │ ████████████████████████████████████████████████████████ │
103
- * ├───────────────────────────────────────────────────────────┤
104
- * │ [Image 1: 640×480 pixels] │ ← Images (optional)
105
- * ├───────────────────────────────────────────────────────────┤
106
- * │ [Image 2: 800×600 pixels] │
107
- * └───────────────────────────────────────────────────────────┘
108
- *
109
- * Background Color State Machine:
110
- * 1. Initial: toolPendingBg (dark, neutral color)
111
- * 2. Streaming: toolPendingBg (stays same while partial=true)
112
- * 3. Success: toolSuccessBg (green tint, indicates success)
113
- * 4. Error: toolErrorBg (red tint, indicates failure)
114
- * 5. Partial: toolPendingBg (still running, don't show final color)
115
- *
116
- * Rendering Decision Tree:
117
- * Tool in allTools? (built-in)
118
- * ├─ Yes + tool=bash → Box with visual truncation
119
- * ├─ Yes + tool=edit → Text with diff rendering
120
- * ├─ Yes + tool=read → Text with syntax highlighting
121
- * ├─ Yes + others → Text with formatted output
122
- * └─ No → Check for custom renderer
123
- * Custom tool with renderCall?
124
- * ├─ Yes → Use custom renderCall component
125
- * └─ No → Show tool name
126
- * Custom tool with renderResult?
127
- * ├─ Yes → Use custom renderResult component
128
- * └─ No → Show formatted text output
129
- *
130
- * STYLING/FORMATTING:
131
- * ============================================================================
132
- * Background Colors:
133
- * - Pending: theme.bg("toolPendingBg", text) [neutral gray]
134
- * - Success: theme.bg("toolSuccessBg", text) [subtle green]
135
- * - Error: theme.bg("toolErrorBg", text) [subtle red]
136
- * - Colors apply to entire tool execution box
137
- *
138
- * Text Colors (within background):
139
- * - Tool name: theme.fg("toolTitle", theme.bold(name))
140
- * - File path: theme.fg("accent", path)
141
- * - Line numbers: theme.fg("warning", ":10-20")
142
- * - Output: theme.fg("toolOutput", output)
143
- * - Error text: theme.fg("error", message)
144
- * - Warning: theme.fg("warning", "[Truncated...]")
145
- * - Muted: theme.fg("muted", "... (5 more lines,")
146
- *
147
- * Code Highlighting:
148
- * - getLanguageFromPath(): Detect language from file extension
149
- * - highlightCode(): ANSI syntax highlighting via highlight.js
150
- * - Tabs replaced with 3 spaces for consistent rendering
151
- * - Applied to read, write, and custom tool outputs
152
- *
153
- * Diff Rendering (edit tool):
154
- * - renderDiff(): Specialized diff component
155
- * - Shows added/removed lines with colors
156
- * - Line numbers with context
157
- * - File path with first changed line number
158
- *
159
- * Layout Spacing:
160
- * - paddingY=1, paddingX=1 for Box/Text components
161
- * - Spacer(1) above tool execution
162
- * - Spacer(1) between tool and images
163
- * - Blank lines in output for readability
164
- *
165
- * EXAMPLES:
166
- * ============================================================================
167
- *
168
- * Example 1: Read Tool - File Contents
169
- * ─────────────────────────────────────
170
- * Input: read file="/src/main.ts" limit=5
171
- * Rendered:
172
- * ┌──────────────────────────────────┐
173
- * │ read ~/src/main.ts:1-5 │
174
- * │ │
175
- * │ 1 | import { foo } from 'bar'; │
176
- * │ 2 | const x = 42; │
177
- * │ 3 | export { x }; │
178
- * │ ... (27 more lines, to expand) │
179
- * └──────────────────────────────────┘
180
- *
181
- * Example 2: Edit Tool - Visual Diff
182
- * ──────────────────────────────────
183
- * Input: edit path="/src/main.ts" oldText="const x = 1;" newText="const x = 42;"
184
- * Rendered:
185
- * ┌──────────────────────────────────────┐
186
- * │ edit ~/src/main.ts:10 │
187
- * │ │
188
- * │ 10 - const x = 1; │
189
- * │ 10 + const x = 42; │
190
- * └──────────────────────────────────────┘
191
- *
192
- * Example 3: Bash Tool - Command Output
193
- * ────────────────────────────────────
194
- * Input: bash command="ls -la" timeout=5
195
- * Rendered (collapsed):
196
- * ┌──────────────────────────────────────┐
197
- * │ $ ls -la (timeout 5s) │
198
- * │ │
199
- * │ total 128 │
200
- * │ drwxr-xr-x 5 user wheel 160 │
201
- * │ -rw-r--r-- 1 user wheel 1234 │
202
- * │ ... (7 more lines, to expand) │
203
- * └──────────────────────────────────────┘
204
- *
205
- * Example 4: Error Result
206
- * ──────────────────────
207
- * Tool fails, returns error
208
- * Rendered:
209
- * ┌──────────────────────────────────────┐ ← toolErrorBg (red tint)
210
- * │ read ~/nonexistent/file.txt │
211
- * │ │
212
- * │ Error: ENOENT: no such file or dir │
213
- * └──────────────────────────────────────┘
214
- *
215
- * Example 5: Tool with Images
216
- * ───────────────────────────
217
- * Bash tool that outputs PNG image
218
- * Rendered:
219
- * ┌──────────────────────────────────────┐
220
- * │ $ generate_chart.sh │
221
- * │ │
222
- * │ Chart generated successfully │
223
- * └──────────────────────────────────────┘
224
- * [Image: 640×480 pixels, PNG]
225
- *
226
- * INTEGRATION:
227
- * ============================================================================
228
- * TUI Integration:
229
- * - Extends Container (indusagi/tui base component)
230
- * - Uses Box, Text, Image, Spacer components
231
- * - Theme system: theme.fg(), theme.bg()
232
- * - Automatic text wrapping to terminal width
233
- * - Image rendering via indusagi/tui Image component
234
- *
235
- * Session Integration:
236
- * - Created in InteractiveMode.renderSessionContext()
237
- * - Updates come from AgentSession.on('tool_output')
238
- * - Stored in chatContainer with tool calls
239
- * - pendingTools map tracks incomplete tools
240
- * - Expandable via toolOutputExpanded setting
241
- *
242
- * Extension Integration:
243
- * - Supports custom renderCall() and renderResult()
244
- * - Custom tools can provide their own renderers
245
- * - Falls back to built-in rendering if no custom renderer
246
- * - Passes theme object to custom renderers
247
- *
248
- * Image Integration:
249
- * - Terminal capability detection via getCapabilities()
250
- * - Kitty protocol requires PNG (auto-converts JPEG/GIF/WebP)
251
- * - Image fallback for terminals without image support
252
- * - Respects showImages setting
253
- * - Image dimensions cached after first render
254
- *
255
- * Diff Integration:
256
- * - computeEditDiff() runs async before tool execution
257
- * - Preview diff shown while tool running (cached)
258
- * - Final diff from tool result overrides preview (post-execution)
259
- * - Handles race conditions (file modified between preview/execution)
260
- *
261
- * Performance Considerations:
262
- * - Bash visual line truncation: Width-aware caching
263
- * - Image conversion: Lazy async (doesn't block rendering)
264
- * - Diff computation: Async with result override (non-blocking)
265
- * - Tool output formatting: Cached in formatToolExecution()
266
- * - Suitable for 50+ tools in conversation without lag
267
- */
268
- function shortenPath(path) {
269
- const home = os.homedir();
270
- if (path.startsWith(home)) {
271
- return `~${path.slice(home.length)}`;
272
- }
273
- return path;
274
- }
275
- /**
276
- * Replace tabs with spaces for consistent rendering
277
- */
278
- function replaceTabs(text) {
279
- return text.replace(/\t/g, " ");
280
- }
281
- function resolveToolBackground(result, isPartial) {
282
- if (isPartial) {
283
- return (text) => theme.bg("toolPendingBg", text);
284
- }
285
- return result?.isError
286
- ? (text) => theme.bg("toolErrorBg", text)
287
- : (text) => theme.bg("toolSuccessBg", text);
288
- }
289
- function getImageBlocks(result) {
290
- return result?.content?.filter((content) => content.type === "image") || [];
291
- }
292
- /**
293
- * Component that renders a tool call with its result (updateable)
294
- */
295
- export class ToolExecutionComponent extends Container {
296
- constructor(toolName, args, options = {}, toolDefinition, ui, cwd = process.cwd()) {
297
- super();
298
- this.imageComponents = [];
299
- this.imageSpacers = [];
300
- this.expanded = false;
301
- this.isPartial = true;
302
- // Cached converted images for Kitty protocol (which requires PNG), keyed by index
303
- this.convertedImages = new Map();
304
- this.toolName = toolName;
305
- this.args = args;
306
- this.showImages = options.showImages ?? true;
307
- this.toolDefinition = toolDefinition;
308
- this.ui = ui;
309
- this.cwd = cwd;
310
- this.addChild(new Spacer(1));
311
- // Always create both - contentBox for custom tools/bash, contentText for other built-ins
312
- this.contentBox = new Box(1, 1, (text) => theme.bg("toolPendingBg", text));
313
- this.contentText = new Text("", 1, 1, (text) => theme.bg("toolPendingBg", text));
314
- // Use contentBox for bash (visual truncation) or custom tools with custom renderers
315
- // Use contentText for built-in tools (including overrides without custom renderers)
316
- if (toolName === "bash" || (toolDefinition && !this.shouldUseBuiltInRenderer())) {
317
- this.addChild(this.contentBox);
318
- }
319
- else {
320
- this.addChild(this.contentText);
321
- }
322
- this.updateDisplay();
323
- }
324
- /**
325
- * Check if we should use built-in rendering for this tool.
326
- * Returns true if the tool name is a built-in AND either there's no toolDefinition
327
- * or the toolDefinition doesn't provide custom renderers.
328
- */
329
- shouldUseBuiltInRenderer() {
330
- const isBuiltInName = this.toolName in allTools;
331
- const hasCustomRenderers = this.toolDefinition?.renderCall || this.toolDefinition?.renderResult;
332
- return isBuiltInName && !hasCustomRenderers;
333
- }
334
- updateArgs(args) {
335
- this.args = args;
336
- this.updateDisplay();
337
- }
338
- /**
339
- * Signal that args are complete (tool is about to execute).
340
- * This triggers diff computation for edit tool.
341
- */
342
- setArgsComplete() {
343
- this.maybeComputeEditDiff();
344
- }
345
- /**
346
- * Compute edit diff preview when we have complete args.
347
- * This runs async and updates display when done.
348
- */
349
- maybeComputeEditDiff() {
350
- if (this.toolName !== "edit")
351
- return;
352
- const path = this.args?.path;
353
- const oldText = this.args?.oldText;
354
- const newText = this.args?.newText;
355
- // Need all three params to compute diff
356
- if (!path || oldText === undefined || newText === undefined)
357
- return;
358
- // Create a key to track which args this computation is for
359
- const argsKey = JSON.stringify({ path, oldText, newText });
360
- // Skip if we already computed for these exact args
361
- if (this.editDiffArgsKey === argsKey)
362
- return;
363
- this.editDiffArgsKey = argsKey;
364
- // Compute diff async
365
- computeEditDiff(path, oldText, newText, this.cwd).then((result) => {
366
- // Only update if args haven't changed since we started
367
- if (this.editDiffArgsKey === argsKey) {
368
- this.editDiffPreview = result;
369
- this.updateDisplay();
370
- this.ui.requestRender();
371
- }
372
- });
373
- }
374
- updateResult(result, isPartial = false) {
375
- this.result = result;
376
- this.isPartial = isPartial;
377
- this.updateDisplay();
378
- // Convert non-PNG images to PNG for Kitty protocol (async)
379
- this.maybeConvertImagesForKitty();
380
- }
381
- /**
382
- * Convert non-PNG images to PNG for Kitty graphics protocol.
383
- * Kitty requires PNG format (f=100), so JPEG/GIF/WebP won't display.
384
- */
385
- maybeConvertImagesForKitty() {
386
- const caps = getCapabilities();
387
- // Only needed for Kitty protocol
388
- if (caps.images !== "kitty")
389
- return;
390
- if (!this.result)
391
- return;
392
- const imageBlocks = getImageBlocks(this.result);
393
- for (let i = 0; i < imageBlocks.length; i++) {
394
- const img = imageBlocks[i];
395
- if (!img.data || !img.mimeType)
396
- continue;
397
- // Skip if already PNG or already converted
398
- if (img.mimeType === "image/png")
399
- continue;
400
- if (this.convertedImages.has(i))
401
- continue;
402
- // Convert async
403
- const index = i;
404
- convertToPng(img.data, img.mimeType).then((converted) => {
405
- if (converted) {
406
- this.convertedImages.set(index, converted);
407
- this.updateDisplay();
408
- this.ui.requestRender();
409
- }
410
- });
411
- }
412
- }
413
- setExpanded(expanded) {
414
- this.expanded = expanded;
415
- this.updateDisplay();
416
- }
417
- setShowImages(show) {
418
- this.showImages = show;
419
- this.updateDisplay();
420
- }
421
- invalidate() {
422
- super.invalidate();
423
- this.updateDisplay();
424
- }
425
- updateDisplay() {
426
- const bgFn = resolveToolBackground(this.result, this.isPartial);
427
- // Use built-in rendering for built-in tools (or overrides without custom renderers)
428
- if (this.shouldUseBuiltInRenderer()) {
429
- if (this.toolName === "bash") {
430
- // Bash uses Box with visual line truncation
431
- this.contentBox.setBgFn(bgFn);
432
- this.contentBox.clear();
433
- this.renderBashContent();
434
- }
435
- else {
436
- // Other built-in tools: use Text directly with caching
437
- this.contentText.setCustomBgFn(bgFn);
438
- this.contentText.setText(this.formatToolExecution());
439
- }
440
- }
441
- else if (this.toolDefinition) {
442
- // Custom tools use Box for flexible component rendering
443
- this.contentBox.setBgFn(bgFn);
444
- this.contentBox.clear();
445
- // Render call component
446
- if (this.toolDefinition.renderCall) {
447
- try {
448
- const callComponent = this.toolDefinition.renderCall(this.args, theme);
449
- if (callComponent) {
450
- this.contentBox.addChild(callComponent);
451
- }
452
- }
453
- catch {
454
- // Fall back to default on error
455
- this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0));
456
- }
457
- }
458
- else {
459
- // No custom renderCall, show tool name
460
- this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0));
461
- }
462
- // Render result component if we have a result
463
- if (this.result && this.toolDefinition.renderResult) {
464
- try {
465
- const resultComponent = this.toolDefinition.renderResult({ content: this.result.content, details: this.result.details }, { expanded: this.expanded, isPartial: this.isPartial }, theme);
466
- if (resultComponent) {
467
- this.contentBox.addChild(resultComponent);
468
- }
469
- }
470
- catch {
471
- // Fall back to showing raw output on error
472
- const output = this.getTextOutput();
473
- if (output) {
474
- this.contentBox.addChild(new Text(theme.fg("toolOutput", output), 0, 0));
475
- }
476
- }
477
- }
478
- else if (this.result) {
479
- // Has result but no custom renderResult
480
- const output = this.getTextOutput();
481
- if (output) {
482
- this.contentBox.addChild(new Text(theme.fg("toolOutput", output), 0, 0));
483
- }
484
- }
485
- }
486
- // Handle images (same for both custom and built-in)
487
- for (const img of this.imageComponents) {
488
- this.removeChild(img);
489
- }
490
- this.imageComponents = [];
491
- for (const spacer of this.imageSpacers) {
492
- this.removeChild(spacer);
493
- }
494
- this.imageSpacers = [];
495
- if (this.result) {
496
- const imageBlocks = getImageBlocks(this.result);
497
- const caps = getCapabilities();
498
- for (let i = 0; i < imageBlocks.length; i++) {
499
- const img = imageBlocks[i];
500
- if (caps.images && this.showImages && img.data && img.mimeType) {
501
- // Use converted PNG for Kitty protocol if available
502
- const converted = this.convertedImages.get(i);
503
- const imageData = converted?.data ?? img.data;
504
- const imageMimeType = converted?.mimeType ?? img.mimeType;
505
- // For Kitty, skip non-PNG images that haven't been converted yet
506
- if (caps.images === "kitty" && imageMimeType !== "image/png") {
507
- continue;
508
- }
509
- const spacer = new Spacer(1);
510
- this.addChild(spacer);
511
- this.imageSpacers.push(spacer);
512
- const imageComponent = new Image(imageData, imageMimeType, { fallbackColor: (s) => theme.fg("toolOutput", s) }, { maxWidthCells: 60 });
513
- this.imageComponents.push(imageComponent);
514
- this.addChild(imageComponent);
515
- }
516
- }
517
- }
518
- }
519
- /**
520
- * Render bash content using visual line truncation (like bash-execution.ts)
521
- */
522
- renderBashContent() {
523
- const command = this.args?.command || "";
524
- const timeout = this.args?.timeout;
525
- // Header
526
- const timeoutSuffix = timeout ? theme.fg("muted", ` (timeout ${timeout}s)`) : "";
527
- this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(`$ ${command || theme.fg("toolOutput", "...")}`)) + timeoutSuffix, 0, 0));
528
- if (this.result) {
529
- const output = this.getTextOutput().trim();
530
- if (output) {
531
- // Style each line for the output
532
- const styledOutput = output
533
- .split("\n")
534
- .map((line) => theme.fg("toolOutput", line))
535
- .join("\n");
536
- if (this.expanded) {
537
- // Show all lines when expanded
538
- this.contentBox.addChild(new Text(`\n${styledOutput}`, 0, 0));
539
- }
540
- else {
541
- // Use visual line truncation when collapsed with width-aware caching
542
- let cachedWidth;
543
- let cachedLines;
544
- let cachedSkipped;
545
- this.contentBox.addChild({
546
- render: (width) => {
547
- if (cachedLines === undefined || cachedWidth !== width) {
548
- const result = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);
549
- cachedLines = result.visualLines;
550
- cachedSkipped = result.skippedCount;
551
- cachedWidth = width;
552
- }
553
- if (cachedSkipped && cachedSkipped > 0) {
554
- const hint = theme.fg("muted", `... (${cachedSkipped} earlier lines,`) +
555
- ` ${keyHint("expandTools", "to expand")})`;
556
- return ["", truncateToWidth(hint, width, "..."), ...cachedLines];
557
- }
558
- // Add blank line for spacing (matches expanded case)
559
- return ["", ...cachedLines];
560
- },
561
- invalidate: () => {
562
- cachedWidth = undefined;
563
- cachedLines = undefined;
564
- cachedSkipped = undefined;
565
- },
566
- });
567
- }
568
- }
569
- // Truncation warnings
570
- const truncation = this.result.details?.truncation;
571
- const fullOutputPath = this.result.details?.fullOutputPath;
572
- if (truncation?.truncated || fullOutputPath) {
573
- const warnings = [];
574
- if (fullOutputPath) {
575
- warnings.push(`Full output: ${fullOutputPath}`);
576
- }
577
- if (truncation?.truncated) {
578
- if (truncation.truncatedBy === "lines") {
579
- warnings.push(`Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines`);
580
- }
581
- else {
582
- warnings.push(`Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)`);
583
- }
584
- }
585
- this.contentBox.addChild(new Text(`\n${theme.fg("warning", `[${warnings.join(". ")}]`)}`, 0, 0));
586
- }
587
- }
588
- }
589
- getTextOutput() {
590
- if (!this.result)
591
- return "";
592
- const textBlocks = this.result.content?.filter((c) => c.type === "text") || [];
593
- const imageBlocks = this.result.content?.filter((c) => c.type === "image") || [];
594
- let output = textBlocks
595
- .map((c) => {
596
- // Use sanitizeBinaryOutput to handle binary data that crashes string-width
597
- return sanitizeBinaryOutput(stripAnsi(c.text || "")).replace(/\r/g, "");
598
- })
599
- .join("\n");
600
- const caps = getCapabilities();
601
- if (imageBlocks.length > 0 && (!caps.images || !this.showImages)) {
602
- const imageIndicators = imageBlocks
603
- .map((img) => {
604
- const dims = img.data ? (getImageDimensions(img.data, img.mimeType) ?? undefined) : undefined;
605
- return imageFallback(img.mimeType, dims);
606
- })
607
- .join("\n");
608
- output = output ? `${output}\n${imageIndicators}` : imageIndicators;
609
- }
610
- return output;
611
- }
612
- formatToolExecution() {
613
- let text = "";
614
- if (this.toolName === "read") {
615
- const path = shortenPath(this.args?.file_path || this.args?.path || "");
616
- const offset = this.args?.offset;
617
- const limit = this.args?.limit;
618
- let pathDisplay = path ? theme.fg("accent", path) : theme.fg("toolOutput", "...");
619
- if (offset !== undefined || limit !== undefined) {
620
- const startLine = offset ?? 1;
621
- const endLine = limit !== undefined ? startLine + limit - 1 : "";
622
- pathDisplay += theme.fg("warning", `:${startLine}${endLine ? `-${endLine}` : ""}`);
623
- }
624
- text = `${theme.fg("toolTitle", theme.bold("read"))} ${pathDisplay}`;
625
- if (this.result) {
626
- const output = this.getTextOutput();
627
- const rawPath = this.args?.file_path || this.args?.path || "";
628
- const lang = getLanguageFromPath(rawPath);
629
- const lines = lang ? highlightCode(replaceTabs(output), lang) : output.split("\n");
630
- const maxLines = this.expanded ? lines.length : 10;
631
- const displayLines = lines.slice(0, maxLines);
632
- const remaining = lines.length - maxLines;
633
- text +=
634
- "\n\n" +
635
- displayLines
636
- .map((line) => (lang ? replaceTabs(line) : theme.fg("toolOutput", replaceTabs(line))))
637
- .join("\n");
638
- if (remaining > 0) {
639
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
640
- }
641
- const truncation = this.result.details?.truncation;
642
- if (truncation?.truncated) {
643
- if (truncation.firstLineExceedsLimit) {
644
- text +=
645
- "\n" +
646
- theme.fg("warning", `[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`);
647
- }
648
- else if (truncation.truncatedBy === "lines") {
649
- text +=
650
- "\n" +
651
- theme.fg("warning", `[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`);
652
- }
653
- else {
654
- text +=
655
- "\n" +
656
- theme.fg("warning", `[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`);
657
- }
658
- }
659
- }
660
- }
661
- else if (this.toolName === "write") {
662
- const rawPath = this.args?.file_path || this.args?.path || "";
663
- const path = shortenPath(rawPath);
664
- const fileContent = this.args?.content || "";
665
- const lang = getLanguageFromPath(rawPath);
666
- const lines = fileContent
667
- ? lang
668
- ? highlightCode(replaceTabs(fileContent), lang)
669
- : fileContent.split("\n")
670
- : [];
671
- const totalLines = lines.length;
672
- text =
673
- theme.fg("toolTitle", theme.bold("write")) +
674
- " " +
675
- (path ? theme.fg("accent", path) : theme.fg("toolOutput", "..."));
676
- if (fileContent) {
677
- const maxLines = this.expanded ? lines.length : 10;
678
- const displayLines = lines.slice(0, maxLines);
679
- const remaining = lines.length - maxLines;
680
- text +=
681
- "\n\n" +
682
- displayLines
683
- .map((line) => (lang ? replaceTabs(line) : theme.fg("toolOutput", replaceTabs(line))))
684
- .join("\n");
685
- if (remaining > 0) {
686
- text +=
687
- theme.fg("muted", `\n... (${remaining} more lines, ${totalLines} total,`) +
688
- ` ${keyHint("expandTools", "to expand")})`;
689
- }
690
- }
691
- // Show error if tool execution failed
692
- if (this.result?.isError) {
693
- const errorText = this.getTextOutput();
694
- if (errorText) {
695
- text += `\n\n${theme.fg("error", errorText)}`;
696
- }
697
- }
698
- }
699
- else if (this.toolName === "edit") {
700
- const rawPath = this.args?.file_path || this.args?.path || "";
701
- const path = shortenPath(rawPath);
702
- // Build path display, appending :line if we have diff info
703
- let pathDisplay = path ? theme.fg("accent", path) : theme.fg("toolOutput", "...");
704
- const firstChangedLine = (this.editDiffPreview && "firstChangedLine" in this.editDiffPreview
705
- ? this.editDiffPreview.firstChangedLine
706
- : undefined) ||
707
- (this.result && !this.result.isError ? this.result.details?.firstChangedLine : undefined);
708
- if (firstChangedLine) {
709
- pathDisplay += theme.fg("warning", `:${firstChangedLine}`);
710
- }
711
- text = `${theme.fg("toolTitle", theme.bold("edit"))} ${pathDisplay}`;
712
- if (this.result?.isError) {
713
- // Show error from result
714
- const errorText = this.getTextOutput();
715
- if (errorText) {
716
- text += `\n\n${theme.fg("error", errorText)}`;
717
- }
718
- }
719
- else if (this.result?.details?.diff) {
720
- // Tool executed successfully - use the diff from result
721
- // This takes priority over editDiffPreview which may have a stale error
722
- // due to race condition (async preview computed after file was modified)
723
- text += `\n\n${renderDiff(this.result.details.diff, { filePath: rawPath })}`;
724
- }
725
- else if (this.editDiffPreview) {
726
- // Use cached diff preview (before tool executes)
727
- if ("error" in this.editDiffPreview) {
728
- text += `\n\n${theme.fg("error", this.editDiffPreview.error)}`;
729
- }
730
- else if (this.editDiffPreview.diff) {
731
- text += `\n\n${renderDiff(this.editDiffPreview.diff, { filePath: rawPath })}`;
732
- }
733
- }
734
- }
735
- else if (this.toolName === "ls") {
736
- const path = shortenPath(this.args?.path || ".");
737
- const limit = this.args?.limit;
738
- text = `${theme.fg("toolTitle", theme.bold("ls"))} ${theme.fg("accent", path)}`;
739
- if (limit !== undefined) {
740
- text += theme.fg("toolOutput", ` (limit ${limit})`);
741
- }
742
- if (this.result) {
743
- const output = this.getTextOutput().trim();
744
- if (output) {
745
- const lines = output.split("\n");
746
- const maxLines = this.expanded ? lines.length : 20;
747
- const displayLines = lines.slice(0, maxLines);
748
- const remaining = lines.length - maxLines;
749
- text += `\n\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
750
- if (remaining > 0) {
751
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
752
- }
753
- }
754
- const entryLimit = this.result.details?.entryLimitReached;
755
- const truncation = this.result.details?.truncation;
756
- if (entryLimit || truncation?.truncated) {
757
- const warnings = [];
758
- if (entryLimit) {
759
- warnings.push(`${entryLimit} entries limit`);
760
- }
761
- if (truncation?.truncated) {
762
- warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
763
- }
764
- text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
765
- }
766
- }
767
- }
768
- else if (this.toolName === "find") {
769
- const pattern = this.args?.pattern || "";
770
- const path = shortenPath(this.args?.path || ".");
771
- const limit = this.args?.limit;
772
- text =
773
- theme.fg("toolTitle", theme.bold("find")) +
774
- " " +
775
- theme.fg("accent", pattern) +
776
- theme.fg("toolOutput", ` in ${path}`);
777
- if (limit !== undefined) {
778
- text += theme.fg("toolOutput", ` (limit ${limit})`);
779
- }
780
- if (this.result) {
781
- const output = this.getTextOutput().trim();
782
- if (output) {
783
- const lines = output.split("\n");
784
- const maxLines = this.expanded ? lines.length : 20;
785
- const displayLines = lines.slice(0, maxLines);
786
- const remaining = lines.length - maxLines;
787
- text += `\n\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
788
- if (remaining > 0) {
789
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
790
- }
791
- }
792
- const resultLimit = this.result.details?.resultLimitReached;
793
- const truncation = this.result.details?.truncation;
794
- if (resultLimit || truncation?.truncated) {
795
- const warnings = [];
796
- if (resultLimit) {
797
- warnings.push(`${resultLimit} results limit`);
798
- }
799
- if (truncation?.truncated) {
800
- warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
801
- }
802
- text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
803
- }
804
- }
805
- }
806
- else if (this.toolName === "grep") {
807
- const pattern = this.args?.pattern || "";
808
- const path = shortenPath(this.args?.path || ".");
809
- const glob = this.args?.glob;
810
- const limit = this.args?.limit;
811
- text =
812
- theme.fg("toolTitle", theme.bold("grep")) +
813
- " " +
814
- theme.fg("accent", `/${pattern}/`) +
815
- theme.fg("toolOutput", ` in ${path}`);
816
- if (glob) {
817
- text += theme.fg("toolOutput", ` (${glob})`);
818
- }
819
- if (limit !== undefined) {
820
- text += theme.fg("toolOutput", ` limit ${limit}`);
821
- }
822
- if (this.result) {
823
- const output = this.getTextOutput().trim();
824
- if (output) {
825
- const lines = output.split("\n");
826
- const maxLines = this.expanded ? lines.length : 15;
827
- const displayLines = lines.slice(0, maxLines);
828
- const remaining = lines.length - maxLines;
829
- text += `\n\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
830
- if (remaining > 0) {
831
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
832
- }
833
- }
834
- const matchLimit = this.result.details?.matchLimitReached;
835
- const truncation = this.result.details?.truncation;
836
- const linesTruncated = this.result.details?.linesTruncated;
837
- if (matchLimit || truncation?.truncated || linesTruncated) {
838
- const warnings = [];
839
- if (matchLimit) {
840
- warnings.push(`${matchLimit} matches limit`);
841
- }
842
- if (truncation?.truncated) {
843
- warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
844
- }
845
- if (linesTruncated) {
846
- warnings.push("some lines truncated");
847
- }
848
- text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
849
- }
850
- }
851
- }
852
- else if (this.toolName === "task") {
853
- const details = this.result?.details ?? {};
854
- const subagentType = details.subagentType || this.args?.subagent_type || "subagent";
855
- const description = details.description || this.args?.description;
856
- const taskId = details.taskId || details.task_id;
857
- const toolCalls = typeof details.toolCalls === "number" ? details.toolCalls : undefined;
858
- const durationMs = typeof details.durationMs === "number" ? details.durationMs : undefined;
859
- const resultText = typeof details.result === "string" ? details.result : "";
860
- text = `${theme.fg("toolTitle", theme.bold("task"))} ${theme.fg("accent", subagentType)}`;
861
- if (description) {
862
- text += theme.fg("toolOutput", ` - ${description}`);
863
- }
864
- const metaParts = [];
865
- if (taskId) {
866
- metaParts.push(`task_id: ${taskId}`);
867
- }
868
- if (typeof toolCalls === "number") {
869
- metaParts.push(`tools: ${toolCalls}`);
870
- }
871
- if (typeof durationMs === "number") {
872
- metaParts.push(`duration: ${Math.round(durationMs)}ms`);
873
- }
874
- if (metaParts.length > 0) {
875
- text += `\n${theme.fg("muted", metaParts.join(" | "))}`;
876
- }
877
- if (!this.result) {
878
- text += `\n\n${theme.fg("muted", "Delegating to subagent...")}`;
879
- return text;
880
- }
881
- const output = resultText || this.getTextOutput().trim();
882
- if (output) {
883
- const lines = output.split("\n");
884
- const maxLines = this.expanded ? lines.length : 12;
885
- const displayLines = lines.slice(0, maxLines);
886
- const remaining = lines.length - maxLines;
887
- const lineColor = this.result.isError ? "error" : "toolOutput";
888
- text += `\n\n${displayLines.map((line) => theme.fg(lineColor, line)).join("\n")}`;
889
- if (remaining > 0) {
890
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
891
- }
892
- }
893
- else {
894
- text += `\n\n${theme.fg("muted", this.result.isError ? "Task failed" : "No task result")}`;
895
- }
896
- }
897
- else if (this.toolName === "todoread" || this.toolName === "todowrite") {
898
- const detailTodos = this.result?.details?.todos;
899
- const argTodos = this.args?.todos;
900
- const todoItems = Array.isArray(detailTodos)
901
- ? detailTodos
902
- : Array.isArray(argTodos)
903
- ? argTodos
904
- : [];
905
- const normalizeStatus = (status) => {
906
- switch (status) {
907
- case "completed":
908
- case "in_progress":
909
- case "cancelled":
910
- case "pending":
911
- return status;
912
- default:
913
- return "pending";
914
- }
915
- };
916
- const normalizePriority = (priority) => {
917
- switch (priority) {
918
- case "high":
919
- case "medium":
920
- case "low":
921
- return priority;
922
- default:
923
- return "medium";
924
- }
925
- };
926
- const normalizeContent = (content) => typeof content === "string" ? content : "";
927
- const normalizedTodos = todoItems.map((todo) => ({
928
- status: normalizeStatus(todo?.status),
929
- priority: normalizePriority(todo?.priority),
930
- content: normalizeContent(todo?.content),
931
- }));
932
- const incompleteCount = typeof this.result?.details?.incompleteCount === "number"
933
- ? this.result.details.incompleteCount
934
- : normalizedTodos.filter((todo) => todo.status !== "completed").length;
935
- text = theme.fg("toolTitle", theme.bold(this.toolName));
936
- if (normalizedTodos.length === 0) {
937
- text += `\n\n${theme.fg("muted", "No todos")}`;
938
- }
939
- else {
940
- text += `\n\n${theme.fg("muted", `${incompleteCount} incomplete`)}\n`;
941
- const maxItems = this.expanded ? normalizedTodos.length : Math.min(normalizedTodos.length, 10);
942
- const displayItems = normalizedTodos.slice(0, maxItems);
943
- const statusIcon = (status) => {
944
- switch (status) {
945
- case "completed":
946
- return theme.fg("success", "✓");
947
- case "in_progress":
948
- return theme.fg("warning", "•");
949
- case "cancelled":
950
- return theme.fg("error", "✕");
951
- default:
952
- return theme.fg("dim", "○");
953
- }
954
- };
955
- const priorityText = (priority) => {
956
- switch (priority) {
957
- case "high":
958
- return theme.fg("warning", priority);
959
- case "medium":
960
- return theme.fg("accent", priority);
961
- default:
962
- return theme.fg("muted", priority);
963
- }
964
- };
965
- const formatStatus = (status) => {
966
- const textLabel = status.replace(/_/g, " ");
967
- if (status === "completed")
968
- return theme.fg("success", textLabel);
969
- if (status === "in_progress")
970
- return theme.fg("warning", textLabel);
971
- if (status === "cancelled")
972
- return theme.fg("error", textLabel);
973
- return theme.fg("dim", textLabel);
974
- };
975
- const lines = displayItems.map((todo) => {
976
- const contentText = todo.status === "completed" || todo.status === "cancelled"
977
- ? theme.fg("dim", todo.content)
978
- : theme.fg("toolOutput", todo.content);
979
- return `${statusIcon(todo.status)} ${formatStatus(todo.status)} ${priorityText(todo.priority)} ${contentText}`;
980
- });
981
- text += lines.join("\n");
982
- if (!this.expanded && normalizedTodos.length > maxItems) {
983
- const remaining = normalizedTodos.length - maxItems;
984
- text += `${theme.fg("muted", `\n... (${remaining} more items,`)} ${keyHint("expandTools", "to expand")})`;
985
- }
986
- }
987
- }
988
- else {
989
- // Generic tool (shouldn't reach here for custom tools)
990
- text = theme.fg("toolTitle", theme.bold(this.toolName));
991
- const content = JSON.stringify(this.args, null, 2);
992
- text += `\n\n${content}`;
993
- const output = this.getTextOutput();
994
- if (output) {
995
- text += `\n${output}`;
996
- }
997
- }
998
- return text;
999
- }
1000
- }
1001
- //# sourceMappingURL=tool-execution.js.map