@compass-ai/nova 1.0.74 → 1.0.76

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 (973) hide show
  1. package/dist/cli.js +557 -555
  2. package/dist/index.js +10 -8
  3. package/package.json +1 -1
  4. package/dist/acp/agent.d.ts +0 -318
  5. package/dist/acp/agent.d.ts.map +0 -1
  6. package/dist/acp/agent.js +0 -795
  7. package/dist/acp/agent.js.map +0 -1
  8. package/dist/acp/backpressure-writer.d.ts +0 -49
  9. package/dist/acp/backpressure-writer.d.ts.map +0 -1
  10. package/dist/acp/backpressure-writer.js +0 -153
  11. package/dist/acp/backpressure-writer.js.map +0 -1
  12. package/dist/acp/event-adapter.d.ts +0 -242
  13. package/dist/acp/event-adapter.d.ts.map +0 -1
  14. package/dist/acp/event-adapter.js +0 -456
  15. package/dist/acp/event-adapter.js.map +0 -1
  16. package/dist/acp/index.d.ts +0 -30
  17. package/dist/acp/index.d.ts.map +0 -1
  18. package/dist/acp/index.js +0 -36
  19. package/dist/acp/index.js.map +0 -1
  20. package/dist/acp/modes.d.ts +0 -56
  21. package/dist/acp/modes.d.ts.map +0 -1
  22. package/dist/acp/modes.js +0 -135
  23. package/dist/acp/modes.js.map +0 -1
  24. package/dist/acp/session-manager.d.ts +0 -170
  25. package/dist/acp/session-manager.d.ts.map +0 -1
  26. package/dist/acp/session-manager.js +0 -381
  27. package/dist/acp/session-manager.js.map +0 -1
  28. package/dist/acp/text-coalescer.d.ts +0 -45
  29. package/dist/acp/text-coalescer.d.ts.map +0 -1
  30. package/dist/acp/text-coalescer.js +0 -110
  31. package/dist/acp/text-coalescer.js.map +0 -1
  32. package/dist/acp/tool-bridge.d.ts +0 -156
  33. package/dist/acp/tool-bridge.d.ts.map +0 -1
  34. package/dist/acp/tool-bridge.js +0 -381
  35. package/dist/acp/tool-bridge.js.map +0 -1
  36. package/dist/acp/types.d.ts +0 -314
  37. package/dist/acp/types.d.ts.map +0 -1
  38. package/dist/acp/types.js +0 -8
  39. package/dist/acp/types.js.map +0 -1
  40. package/dist/cli.d.ts +0 -9
  41. package/dist/cli.d.ts.map +0 -1
  42. package/dist/cli.js.map +0 -1
  43. package/dist/commands/acp.d.ts +0 -26
  44. package/dist/commands/acp.d.ts.map +0 -1
  45. package/dist/commands/acp.js +0 -492
  46. package/dist/commands/acp.js.map +0 -1
  47. package/dist/commands/cache.d.ts +0 -33
  48. package/dist/commands/cache.d.ts.map +0 -1
  49. package/dist/commands/cache.js +0 -537
  50. package/dist/commands/cache.js.map +0 -1
  51. package/dist/commands/config.d.ts +0 -10
  52. package/dist/commands/config.d.ts.map +0 -1
  53. package/dist/commands/config.js +0 -367
  54. package/dist/commands/config.js.map +0 -1
  55. package/dist/commands/consent.d.ts +0 -21
  56. package/dist/commands/consent.d.ts.map +0 -1
  57. package/dist/commands/consent.js +0 -334
  58. package/dist/commands/consent.js.map +0 -1
  59. package/dist/commands/data.d.ts +0 -24
  60. package/dist/commands/data.d.ts.map +0 -1
  61. package/dist/commands/data.js +0 -586
  62. package/dist/commands/data.js.map +0 -1
  63. package/dist/commands/index.d.ts +0 -145
  64. package/dist/commands/index.d.ts.map +0 -1
  65. package/dist/commands/index.js +0 -210
  66. package/dist/commands/index.js.map +0 -1
  67. package/dist/commands/init.d.ts +0 -106
  68. package/dist/commands/init.d.ts.map +0 -1
  69. package/dist/commands/init.js +0 -349
  70. package/dist/commands/init.js.map +0 -1
  71. package/dist/commands/logs.d.ts +0 -13
  72. package/dist/commands/logs.d.ts.map +0 -1
  73. package/dist/commands/logs.js +0 -359
  74. package/dist/commands/logs.js.map +0 -1
  75. package/dist/commands/mcp.d.ts +0 -20
  76. package/dist/commands/mcp.d.ts.map +0 -1
  77. package/dist/commands/mcp.js +0 -687
  78. package/dist/commands/mcp.js.map +0 -1
  79. package/dist/commands/reset.d.ts +0 -20
  80. package/dist/commands/reset.d.ts.map +0 -1
  81. package/dist/commands/reset.js +0 -372
  82. package/dist/commands/reset.js.map +0 -1
  83. package/dist/commands/setup.d.ts +0 -74
  84. package/dist/commands/setup.d.ts.map +0 -1
  85. package/dist/commands/setup.js +0 -863
  86. package/dist/commands/setup.js.map +0 -1
  87. package/dist/commands/slash/agents.d.ts +0 -40
  88. package/dist/commands/slash/agents.d.ts.map +0 -1
  89. package/dist/commands/slash/agents.js +0 -519
  90. package/dist/commands/slash/agents.js.map +0 -1
  91. package/dist/commands/slash/approve.d.ts +0 -46
  92. package/dist/commands/slash/approve.d.ts.map +0 -1
  93. package/dist/commands/slash/approve.js +0 -239
  94. package/dist/commands/slash/approve.js.map +0 -1
  95. package/dist/commands/slash/attach.d.ts +0 -70
  96. package/dist/commands/slash/attach.d.ts.map +0 -1
  97. package/dist/commands/slash/attach.js +0 -333
  98. package/dist/commands/slash/attach.js.map +0 -1
  99. package/dist/commands/slash/clear.d.ts +0 -47
  100. package/dist/commands/slash/clear.d.ts.map +0 -1
  101. package/dist/commands/slash/clear.js +0 -261
  102. package/dist/commands/slash/clear.js.map +0 -1
  103. package/dist/commands/slash/commit.d.ts +0 -40
  104. package/dist/commands/slash/commit.d.ts.map +0 -1
  105. package/dist/commands/slash/commit.js +0 -337
  106. package/dist/commands/slash/commit.js.map +0 -1
  107. package/dist/commands/slash/compact.d.ts +0 -48
  108. package/dist/commands/slash/compact.d.ts.map +0 -1
  109. package/dist/commands/slash/compact.js +0 -288
  110. package/dist/commands/slash/compact.js.map +0 -1
  111. package/dist/commands/slash/config.d.ts +0 -20
  112. package/dist/commands/slash/config.d.ts.map +0 -1
  113. package/dist/commands/slash/config.js +0 -136
  114. package/dist/commands/slash/config.js.map +0 -1
  115. package/dist/commands/slash/context.d.ts +0 -49
  116. package/dist/commands/slash/context.d.ts.map +0 -1
  117. package/dist/commands/slash/context.js +0 -430
  118. package/dist/commands/slash/context.js.map +0 -1
  119. package/dist/commands/slash/cost.d.ts +0 -34
  120. package/dist/commands/slash/cost.d.ts.map +0 -1
  121. package/dist/commands/slash/cost.js +0 -312
  122. package/dist/commands/slash/cost.js.map +0 -1
  123. package/dist/commands/slash/custom.d.ts +0 -41
  124. package/dist/commands/slash/custom.d.ts.map +0 -1
  125. package/dist/commands/slash/custom.js +0 -126
  126. package/dist/commands/slash/custom.js.map +0 -1
  127. package/dist/commands/slash/exit.d.ts +0 -25
  128. package/dist/commands/slash/exit.d.ts.map +0 -1
  129. package/dist/commands/slash/exit.js +0 -186
  130. package/dist/commands/slash/exit.js.map +0 -1
  131. package/dist/commands/slash/export.d.ts +0 -27
  132. package/dist/commands/slash/export.d.ts.map +0 -1
  133. package/dist/commands/slash/export.js +0 -318
  134. package/dist/commands/slash/export.js.map +0 -1
  135. package/dist/commands/slash/files.d.ts +0 -47
  136. package/dist/commands/slash/files.d.ts.map +0 -1
  137. package/dist/commands/slash/files.js +0 -521
  138. package/dist/commands/slash/files.js.map +0 -1
  139. package/dist/commands/slash/help.d.ts +0 -50
  140. package/dist/commands/slash/help.d.ts.map +0 -1
  141. package/dist/commands/slash/help.js +0 -282
  142. package/dist/commands/slash/help.js.map +0 -1
  143. package/dist/commands/slash/index-cmd.d.ts +0 -41
  144. package/dist/commands/slash/index-cmd.d.ts.map +0 -1
  145. package/dist/commands/slash/index-cmd.js +0 -349
  146. package/dist/commands/slash/index-cmd.js.map +0 -1
  147. package/dist/commands/slash/index.d.ts +0 -97
  148. package/dist/commands/slash/index.d.ts.map +0 -1
  149. package/dist/commands/slash/index.js +0 -251
  150. package/dist/commands/slash/index.js.map +0 -1
  151. package/dist/commands/slash/login.d.ts +0 -23
  152. package/dist/commands/slash/login.d.ts.map +0 -1
  153. package/dist/commands/slash/login.js +0 -175
  154. package/dist/commands/slash/login.js.map +0 -1
  155. package/dist/commands/slash/logout.d.ts +0 -23
  156. package/dist/commands/slash/logout.d.ts.map +0 -1
  157. package/dist/commands/slash/logout.js +0 -153
  158. package/dist/commands/slash/logout.js.map +0 -1
  159. package/dist/commands/slash/logs.d.ts +0 -29
  160. package/dist/commands/slash/logs.d.ts.map +0 -1
  161. package/dist/commands/slash/logs.js +0 -423
  162. package/dist/commands/slash/logs.js.map +0 -1
  163. package/dist/commands/slash/mcp.d.ts +0 -29
  164. package/dist/commands/slash/mcp.d.ts.map +0 -1
  165. package/dist/commands/slash/mcp.js +0 -1026
  166. package/dist/commands/slash/mcp.js.map +0 -1
  167. package/dist/commands/slash/model.d.ts +0 -60
  168. package/dist/commands/slash/model.d.ts.map +0 -1
  169. package/dist/commands/slash/model.js +0 -466
  170. package/dist/commands/slash/model.js.map +0 -1
  171. package/dist/commands/slash/personality.d.ts +0 -40
  172. package/dist/commands/slash/personality.d.ts.map +0 -1
  173. package/dist/commands/slash/personality.js +0 -272
  174. package/dist/commands/slash/personality.js.map +0 -1
  175. package/dist/commands/slash/purge.d.ts +0 -42
  176. package/dist/commands/slash/purge.d.ts.map +0 -1
  177. package/dist/commands/slash/purge.js +0 -233
  178. package/dist/commands/slash/purge.js.map +0 -1
  179. package/dist/commands/slash/reset.d.ts +0 -44
  180. package/dist/commands/slash/reset.d.ts.map +0 -1
  181. package/dist/commands/slash/reset.js +0 -326
  182. package/dist/commands/slash/reset.js.map +0 -1
  183. package/dist/commands/slash/skills.d.ts +0 -40
  184. package/dist/commands/slash/skills.d.ts.map +0 -1
  185. package/dist/commands/slash/skills.js +0 -207
  186. package/dist/commands/slash/skills.js.map +0 -1
  187. package/dist/commands/slash/tokens.d.ts +0 -34
  188. package/dist/commands/slash/tokens.d.ts.map +0 -1
  189. package/dist/commands/slash/tokens.js +0 -205
  190. package/dist/commands/slash/tokens.js.map +0 -1
  191. package/dist/commands/slash/unleash.d.ts +0 -50
  192. package/dist/commands/slash/unleash.d.ts.map +0 -1
  193. package/dist/commands/slash/unleash.js +0 -262
  194. package/dist/commands/slash/unleash.js.map +0 -1
  195. package/dist/commands/slash/update.d.ts +0 -34
  196. package/dist/commands/slash/update.d.ts.map +0 -1
  197. package/dist/commands/slash/update.js +0 -364
  198. package/dist/commands/slash/update.js.map +0 -1
  199. package/dist/commands/slash/wrap.d.ts +0 -18
  200. package/dist/commands/slash/wrap.d.ts.map +0 -1
  201. package/dist/commands/slash/wrap.js +0 -21
  202. package/dist/commands/slash/wrap.js.map +0 -1
  203. package/dist/commands/tokens.d.ts +0 -26
  204. package/dist/commands/tokens.d.ts.map +0 -1
  205. package/dist/commands/tokens.js +0 -245
  206. package/dist/commands/tokens.js.map +0 -1
  207. package/dist/constants/builtin-agents.d.ts +0 -27
  208. package/dist/constants/builtin-agents.d.ts.map +0 -1
  209. package/dist/constants/builtin-agents.js +0 -710
  210. package/dist/constants/builtin-agents.js.map +0 -1
  211. package/dist/constants/builtin-skills.d.ts +0 -32
  212. package/dist/constants/builtin-skills.d.ts.map +0 -1
  213. package/dist/constants/builtin-skills.js +0 -389
  214. package/dist/constants/builtin-skills.js.map +0 -1
  215. package/dist/constants/defaults.d.ts +0 -448
  216. package/dist/constants/defaults.d.ts.map +0 -1
  217. package/dist/constants/defaults.js +0 -829
  218. package/dist/constants/defaults.js.map +0 -1
  219. package/dist/constants/index.d.ts +0 -27
  220. package/dist/constants/index.d.ts.map +0 -1
  221. package/dist/constants/index.js +0 -85
  222. package/dist/constants/index.js.map +0 -1
  223. package/dist/constants/install-hints.d.ts +0 -7
  224. package/dist/constants/install-hints.d.ts.map +0 -1
  225. package/dist/constants/install-hints.js +0 -123
  226. package/dist/constants/install-hints.js.map +0 -1
  227. package/dist/constants/models.d.ts +0 -255
  228. package/dist/constants/models.d.ts.map +0 -1
  229. package/dist/constants/models.js +0 -596
  230. package/dist/constants/models.js.map +0 -1
  231. package/dist/constants/schedule.d.ts +0 -43
  232. package/dist/constants/schedule.d.ts.map +0 -1
  233. package/dist/constants/schedule.js +0 -110
  234. package/dist/constants/schedule.js.map +0 -1
  235. package/dist/constants/system-utilities.d.ts +0 -57
  236. package/dist/constants/system-utilities.d.ts.map +0 -1
  237. package/dist/constants/system-utilities.js +0 -421
  238. package/dist/constants/system-utilities.js.map +0 -1
  239. package/dist/constants/token-limits.d.ts +0 -102
  240. package/dist/constants/token-limits.d.ts.map +0 -1
  241. package/dist/constants/token-limits.js +0 -286
  242. package/dist/constants/token-limits.js.map +0 -1
  243. package/dist/core/autocomplete.d.ts +0 -132
  244. package/dist/core/autocomplete.d.ts.map +0 -1
  245. package/dist/core/autocomplete.js +0 -653
  246. package/dist/core/autocomplete.js.map +0 -1
  247. package/dist/core/command-parser.d.ts +0 -301
  248. package/dist/core/command-parser.d.ts.map +0 -1
  249. package/dist/core/command-parser.js +0 -526
  250. package/dist/core/command-parser.js.map +0 -1
  251. package/dist/core/context-builder.d.ts +0 -264
  252. package/dist/core/context-builder.d.ts.map +0 -1
  253. package/dist/core/context-builder.js +0 -1018
  254. package/dist/core/context-builder.js.map +0 -1
  255. package/dist/core/event-emitter.d.ts +0 -411
  256. package/dist/core/event-emitter.d.ts.map +0 -1
  257. package/dist/core/event-emitter.js +0 -138
  258. package/dist/core/event-emitter.js.map +0 -1
  259. package/dist/core/history-manager.d.ts +0 -62
  260. package/dist/core/history-manager.d.ts.map +0 -1
  261. package/dist/core/history-manager.js +0 -151
  262. package/dist/core/history-manager.js.map +0 -1
  263. package/dist/core/slash-command-handler.d.ts +0 -352
  264. package/dist/core/slash-command-handler.d.ts.map +0 -1
  265. package/dist/core/slash-command-handler.js +0 -563
  266. package/dist/core/slash-command-handler.js.map +0 -1
  267. package/dist/core/task-processor.d.ts +0 -179
  268. package/dist/core/task-processor.d.ts.map +0 -1
  269. package/dist/core/task-processor.js +0 -519
  270. package/dist/core/task-processor.js.map +0 -1
  271. package/dist/index.d.ts +0 -90
  272. package/dist/index.d.ts.map +0 -1
  273. package/dist/index.js.map +0 -1
  274. package/dist/prompts/agent-prompt-generator.d.ts +0 -26
  275. package/dist/prompts/agent-prompt-generator.d.ts.map +0 -1
  276. package/dist/prompts/agent-prompt-generator.js +0 -244
  277. package/dist/prompts/agent-prompt-generator.js.map +0 -1
  278. package/dist/prompts/commit-message.d.ts +0 -35
  279. package/dist/prompts/commit-message.d.ts.map +0 -1
  280. package/dist/prompts/commit-message.js +0 -187
  281. package/dist/prompts/commit-message.js.map +0 -1
  282. package/dist/prompts/conversation.d.ts +0 -51
  283. package/dist/prompts/conversation.d.ts.map +0 -1
  284. package/dist/prompts/conversation.js +0 -115
  285. package/dist/prompts/conversation.js.map +0 -1
  286. package/dist/prompts/index.d.ts +0 -39
  287. package/dist/prompts/index.d.ts.map +0 -1
  288. package/dist/prompts/index.js +0 -74
  289. package/dist/prompts/index.js.map +0 -1
  290. package/dist/prompts/memory.d.ts +0 -6
  291. package/dist/prompts/memory.d.ts.map +0 -1
  292. package/dist/prompts/memory.js +0 -29
  293. package/dist/prompts/memory.js.map +0 -1
  294. package/dist/prompts/personality.d.ts +0 -77
  295. package/dist/prompts/personality.d.ts.map +0 -1
  296. package/dist/prompts/personality.js +0 -393
  297. package/dist/prompts/personality.js.map +0 -1
  298. package/dist/prompts/plan-generator.d.ts +0 -144
  299. package/dist/prompts/plan-generator.d.ts.map +0 -1
  300. package/dist/prompts/plan-generator.js +0 -553
  301. package/dist/prompts/plan-generator.js.map +0 -1
  302. package/dist/prompts/system.d.ts +0 -95
  303. package/dist/prompts/system.d.ts.map +0 -1
  304. package/dist/prompts/system.js +0 -461
  305. package/dist/prompts/system.js.map +0 -1
  306. package/dist/prompts/task-processor.d.ts +0 -94
  307. package/dist/prompts/task-processor.d.ts.map +0 -1
  308. package/dist/prompts/task-processor.js +0 -554
  309. package/dist/prompts/task-processor.js.map +0 -1
  310. package/dist/prompts/unguarded.d.ts +0 -78
  311. package/dist/prompts/unguarded.d.ts.map +0 -1
  312. package/dist/prompts/unguarded.js +0 -418
  313. package/dist/prompts/unguarded.js.map +0 -1
  314. package/dist/prompts/utils.d.ts +0 -73
  315. package/dist/prompts/utils.d.ts.map +0 -1
  316. package/dist/prompts/utils.js +0 -114
  317. package/dist/prompts/utils.js.map +0 -1
  318. package/dist/prompts/workflow.d.ts +0 -241
  319. package/dist/prompts/workflow.d.ts.map +0 -1
  320. package/dist/prompts/workflow.js +0 -608
  321. package/dist/prompts/workflow.js.map +0 -1
  322. package/dist/services/action-logger.d.ts +0 -383
  323. package/dist/services/action-logger.d.ts.map +0 -1
  324. package/dist/services/action-logger.js +0 -544
  325. package/dist/services/action-logger.js.map +0 -1
  326. package/dist/services/agent-budget-allocator.d.ts +0 -111
  327. package/dist/services/agent-budget-allocator.d.ts.map +0 -1
  328. package/dist/services/agent-budget-allocator.js +0 -278
  329. package/dist/services/agent-budget-allocator.js.map +0 -1
  330. package/dist/services/agent-manager.d.ts +0 -181
  331. package/dist/services/agent-manager.d.ts.map +0 -1
  332. package/dist/services/agent-manager.js +0 -749
  333. package/dist/services/agent-manager.js.map +0 -1
  334. package/dist/services/agent-spawner.d.ts +0 -138
  335. package/dist/services/agent-spawner.d.ts.map +0 -1
  336. package/dist/services/agent-spawner.js +0 -748
  337. package/dist/services/agent-spawner.js.map +0 -1
  338. package/dist/services/agent-state-service.d.ts +0 -145
  339. package/dist/services/agent-state-service.d.ts.map +0 -1
  340. package/dist/services/agent-state-service.js +0 -247
  341. package/dist/services/agent-state-service.js.map +0 -1
  342. package/dist/services/anthropic-client.d.ts +0 -357
  343. package/dist/services/anthropic-client.d.ts.map +0 -1
  344. package/dist/services/anthropic-client.js +0 -1451
  345. package/dist/services/anthropic-client.js.map +0 -1
  346. package/dist/services/approval-manager.d.ts +0 -385
  347. package/dist/services/approval-manager.d.ts.map +0 -1
  348. package/dist/services/approval-manager.js +0 -1044
  349. package/dist/services/approval-manager.js.map +0 -1
  350. package/dist/services/audit-logger.d.ts +0 -245
  351. package/dist/services/audit-logger.d.ts.map +0 -1
  352. package/dist/services/audit-logger.js +0 -324
  353. package/dist/services/audit-logger.js.map +0 -1
  354. package/dist/services/backup-manager.d.ts +0 -136
  355. package/dist/services/backup-manager.d.ts.map +0 -1
  356. package/dist/services/backup-manager.js +0 -260
  357. package/dist/services/backup-manager.js.map +0 -1
  358. package/dist/services/cache-service.d.ts +0 -247
  359. package/dist/services/cache-service.d.ts.map +0 -1
  360. package/dist/services/cache-service.js +0 -558
  361. package/dist/services/cache-service.js.map +0 -1
  362. package/dist/services/chat-archival-service.d.ts +0 -108
  363. package/dist/services/chat-archival-service.d.ts.map +0 -1
  364. package/dist/services/chat-archival-service.js +0 -465
  365. package/dist/services/chat-archival-service.js.map +0 -1
  366. package/dist/services/codebase-indexer.d.ts +0 -272
  367. package/dist/services/codebase-indexer.d.ts.map +0 -1
  368. package/dist/services/codebase-indexer.js +0 -863
  369. package/dist/services/codebase-indexer.js.map +0 -1
  370. package/dist/services/compass-auth-service.d.ts +0 -204
  371. package/dist/services/compass-auth-service.d.ts.map +0 -1
  372. package/dist/services/compass-auth-service.js +0 -391
  373. package/dist/services/compass-auth-service.js.map +0 -1
  374. package/dist/services/complexity-classifier.d.ts +0 -208
  375. package/dist/services/complexity-classifier.d.ts.map +0 -1
  376. package/dist/services/complexity-classifier.js +0 -1410
  377. package/dist/services/complexity-classifier.js.map +0 -1
  378. package/dist/services/config-manager.d.ts +0 -278
  379. package/dist/services/config-manager.d.ts.map +0 -1
  380. package/dist/services/config-manager.js +0 -651
  381. package/dist/services/config-manager.js.map +0 -1
  382. package/dist/services/consent-manager.d.ts +0 -239
  383. package/dist/services/consent-manager.d.ts.map +0 -1
  384. package/dist/services/consent-manager.js +0 -516
  385. package/dist/services/consent-manager.js.map +0 -1
  386. package/dist/services/conversation-compactor.d.ts +0 -223
  387. package/dist/services/conversation-compactor.d.ts.map +0 -1
  388. package/dist/services/conversation-compactor.js +0 -750
  389. package/dist/services/conversation-compactor.js.map +0 -1
  390. package/dist/services/cost-tracker.d.ts +0 -167
  391. package/dist/services/cost-tracker.d.ts.map +0 -1
  392. package/dist/services/cost-tracker.js +0 -199
  393. package/dist/services/cost-tracker.js.map +0 -1
  394. package/dist/services/credential-store.d.ts +0 -273
  395. package/dist/services/credential-store.d.ts.map +0 -1
  396. package/dist/services/credential-store.js +0 -877
  397. package/dist/services/credential-store.js.map +0 -1
  398. package/dist/services/custom-command-service.d.ts +0 -112
  399. package/dist/services/custom-command-service.d.ts.map +0 -1
  400. package/dist/services/custom-command-service.js +0 -464
  401. package/dist/services/custom-command-service.js.map +0 -1
  402. package/dist/services/default-statusline-renderer.d.ts +0 -60
  403. package/dist/services/default-statusline-renderer.d.ts.map +0 -1
  404. package/dist/services/default-statusline-renderer.js +0 -110
  405. package/dist/services/default-statusline-renderer.js.map +0 -1
  406. package/dist/services/enhanced-context-gatherer.d.ts +0 -116
  407. package/dist/services/enhanced-context-gatherer.d.ts.map +0 -1
  408. package/dist/services/enhanced-context-gatherer.js +0 -605
  409. package/dist/services/enhanced-context-gatherer.js.map +0 -1
  410. package/dist/services/file-hash-tracker.d.ts +0 -95
  411. package/dist/services/file-hash-tracker.d.ts.map +0 -1
  412. package/dist/services/file-hash-tracker.js +0 -199
  413. package/dist/services/file-hash-tracker.js.map +0 -1
  414. package/dist/services/file-service.d.ts +0 -274
  415. package/dist/services/file-service.d.ts.map +0 -1
  416. package/dist/services/file-service.js +0 -876
  417. package/dist/services/file-service.js.map +0 -1
  418. package/dist/services/git-service.d.ts +0 -536
  419. package/dist/services/git-service.d.ts.map +0 -1
  420. package/dist/services/git-service.js +0 -1215
  421. package/dist/services/git-service.js.map +0 -1
  422. package/dist/services/hook-service.d.ts +0 -148
  423. package/dist/services/hook-service.d.ts.map +0 -1
  424. package/dist/services/hook-service.js +0 -705
  425. package/dist/services/hook-service.js.map +0 -1
  426. package/dist/services/ide-state-service.d.ts +0 -114
  427. package/dist/services/ide-state-service.d.ts.map +0 -1
  428. package/dist/services/ide-state-service.js +0 -204
  429. package/dist/services/ide-state-service.js.map +0 -1
  430. package/dist/services/interactive-clarifier.d.ts +0 -90
  431. package/dist/services/interactive-clarifier.d.ts.map +0 -1
  432. package/dist/services/interactive-clarifier.js +0 -446
  433. package/dist/services/interactive-clarifier.js.map +0 -1
  434. package/dist/services/iteration-scoper.d.ts +0 -225
  435. package/dist/services/iteration-scoper.d.ts.map +0 -1
  436. package/dist/services/iteration-scoper.js +0 -387
  437. package/dist/services/iteration-scoper.js.map +0 -1
  438. package/dist/services/llm-plan-generator.d.ts +0 -44
  439. package/dist/services/llm-plan-generator.d.ts.map +0 -1
  440. package/dist/services/llm-plan-generator.js +0 -863
  441. package/dist/services/llm-plan-generator.js.map +0 -1
  442. package/dist/services/llm-system-prompt-generator.d.ts +0 -85
  443. package/dist/services/llm-system-prompt-generator.d.ts.map +0 -1
  444. package/dist/services/llm-system-prompt-generator.js +0 -257
  445. package/dist/services/llm-system-prompt-generator.js.map +0 -1
  446. package/dist/services/log-interpreter.d.ts +0 -190
  447. package/dist/services/log-interpreter.d.ts.map +0 -1
  448. package/dist/services/log-interpreter.js +0 -520
  449. package/dist/services/log-interpreter.js.map +0 -1
  450. package/dist/services/mcp-config-manager.d.ts +0 -141
  451. package/dist/services/mcp-config-manager.d.ts.map +0 -1
  452. package/dist/services/mcp-config-manager.js +0 -678
  453. package/dist/services/mcp-config-manager.js.map +0 -1
  454. package/dist/services/mcp-oauth-service.d.ts +0 -170
  455. package/dist/services/mcp-oauth-service.d.ts.map +0 -1
  456. package/dist/services/mcp-oauth-service.js +0 -892
  457. package/dist/services/mcp-oauth-service.js.map +0 -1
  458. package/dist/services/mcp-plugin-support.d.ts +0 -81
  459. package/dist/services/mcp-plugin-support.d.ts.map +0 -1
  460. package/dist/services/mcp-plugin-support.js +0 -305
  461. package/dist/services/mcp-plugin-support.js.map +0 -1
  462. package/dist/services/mcp-server-manager.d.ts +0 -134
  463. package/dist/services/mcp-server-manager.d.ts.map +0 -1
  464. package/dist/services/mcp-server-manager.js +0 -613
  465. package/dist/services/mcp-server-manager.js.map +0 -1
  466. package/dist/services/mcp-tool-integration.d.ts +0 -119
  467. package/dist/services/mcp-tool-integration.d.ts.map +0 -1
  468. package/dist/services/mcp-tool-integration.js +0 -381
  469. package/dist/services/mcp-tool-integration.js.map +0 -1
  470. package/dist/services/mcp-transport.d.ts +0 -105
  471. package/dist/services/mcp-transport.d.ts.map +0 -1
  472. package/dist/services/mcp-transport.js +0 -1316
  473. package/dist/services/mcp-transport.js.map +0 -1
  474. package/dist/services/memory-service.d.ts +0 -55
  475. package/dist/services/memory-service.d.ts.map +0 -1
  476. package/dist/services/memory-service.js +0 -251
  477. package/dist/services/memory-service.js.map +0 -1
  478. package/dist/services/model-availability.d.ts +0 -64
  479. package/dist/services/model-availability.d.ts.map +0 -1
  480. package/dist/services/model-availability.js +0 -114
  481. package/dist/services/model-availability.js.map +0 -1
  482. package/dist/services/plan-generator.d.ts +0 -98
  483. package/dist/services/plan-generator.d.ts.map +0 -1
  484. package/dist/services/plan-generator.js +0 -658
  485. package/dist/services/plan-generator.js.map +0 -1
  486. package/dist/services/plan-mode-fallback.d.ts +0 -80
  487. package/dist/services/plan-mode-fallback.d.ts.map +0 -1
  488. package/dist/services/plan-mode-fallback.js +0 -307
  489. package/dist/services/plan-mode-fallback.js.map +0 -1
  490. package/dist/services/plan-mode-handler.d.ts +0 -42
  491. package/dist/services/plan-mode-handler.d.ts.map +0 -1
  492. package/dist/services/plan-mode-handler.js +0 -388
  493. package/dist/services/plan-mode-handler.js.map +0 -1
  494. package/dist/services/plan-persistence.d.ts +0 -203
  495. package/dist/services/plan-persistence.d.ts.map +0 -1
  496. package/dist/services/plan-persistence.js +0 -538
  497. package/dist/services/plan-persistence.js.map +0 -1
  498. package/dist/services/prompt-preprocessor.d.ts +0 -73
  499. package/dist/services/prompt-preprocessor.d.ts.map +0 -1
  500. package/dist/services/prompt-preprocessor.js +0 -146
  501. package/dist/services/prompt-preprocessor.js.map +0 -1
  502. package/dist/services/rating-service.d.ts +0 -84
  503. package/dist/services/rating-service.d.ts.map +0 -1
  504. package/dist/services/rating-service.js +0 -171
  505. package/dist/services/rating-service.js.map +0 -1
  506. package/dist/services/rating-state-manager.d.ts +0 -131
  507. package/dist/services/rating-state-manager.d.ts.map +0 -1
  508. package/dist/services/rating-state-manager.js +0 -270
  509. package/dist/services/rating-state-manager.js.map +0 -1
  510. package/dist/services/sdk-runner.d.ts +0 -113
  511. package/dist/services/sdk-runner.d.ts.map +0 -1
  512. package/dist/services/sdk-runner.js +0 -1424
  513. package/dist/services/sdk-runner.js.map +0 -1
  514. package/dist/services/session-manager.d.ts +0 -528
  515. package/dist/services/session-manager.d.ts.map +0 -1
  516. package/dist/services/session-manager.js +0 -1184
  517. package/dist/services/session-manager.js.map +0 -1
  518. package/dist/services/shell-executor.d.ts +0 -337
  519. package/dist/services/shell-executor.d.ts.map +0 -1
  520. package/dist/services/shell-executor.js +0 -1201
  521. package/dist/services/shell-executor.js.map +0 -1
  522. package/dist/services/skill-service.d.ts +0 -149
  523. package/dist/services/skill-service.d.ts.map +0 -1
  524. package/dist/services/skill-service.js +0 -594
  525. package/dist/services/skill-service.js.map +0 -1
  526. package/dist/services/statusline-executor.d.ts +0 -102
  527. package/dist/services/statusline-executor.d.ts.map +0 -1
  528. package/dist/services/statusline-executor.js +0 -305
  529. package/dist/services/statusline-executor.js.map +0 -1
  530. package/dist/services/step-tracker.d.ts +0 -356
  531. package/dist/services/step-tracker.d.ts.map +0 -1
  532. package/dist/services/step-tracker.js +0 -634
  533. package/dist/services/step-tracker.js.map +0 -1
  534. package/dist/services/system-event-logger.d.ts +0 -473
  535. package/dist/services/system-event-logger.d.ts.map +0 -1
  536. package/dist/services/system-event-logger.js +0 -790
  537. package/dist/services/system-event-logger.js.map +0 -1
  538. package/dist/services/system-utility-detector.d.ts +0 -91
  539. package/dist/services/system-utility-detector.d.ts.map +0 -1
  540. package/dist/services/system-utility-detector.js +0 -238
  541. package/dist/services/system-utility-detector.js.map +0 -1
  542. package/dist/services/team-context-store.d.ts +0 -100
  543. package/dist/services/team-context-store.d.ts.map +0 -1
  544. package/dist/services/team-context-store.js +0 -513
  545. package/dist/services/team-context-store.js.map +0 -1
  546. package/dist/services/temp-file-service.d.ts +0 -164
  547. package/dist/services/temp-file-service.d.ts.map +0 -1
  548. package/dist/services/temp-file-service.js +0 -303
  549. package/dist/services/temp-file-service.js.map +0 -1
  550. package/dist/services/token-limit-enforcer.d.ts +0 -53
  551. package/dist/services/token-limit-enforcer.d.ts.map +0 -1
  552. package/dist/services/token-limit-enforcer.js +0 -90
  553. package/dist/services/token-limit-enforcer.js.map +0 -1
  554. package/dist/services/token-limit-store.d.ts +0 -105
  555. package/dist/services/token-limit-store.d.ts.map +0 -1
  556. package/dist/services/token-limit-store.js +0 -288
  557. package/dist/services/token-limit-store.js.map +0 -1
  558. package/dist/services/token-tracker.d.ts +0 -290
  559. package/dist/services/token-tracker.d.ts.map +0 -1
  560. package/dist/services/token-tracker.js +0 -751
  561. package/dist/services/token-tracker.js.map +0 -1
  562. package/dist/services/tool-registry.d.ts +0 -302
  563. package/dist/services/tool-registry.d.ts.map +0 -1
  564. package/dist/services/tool-registry.js +0 -606
  565. package/dist/services/tool-registry.js.map +0 -1
  566. package/dist/services/tools-logger.d.ts +0 -152
  567. package/dist/services/tools-logger.d.ts.map +0 -1
  568. package/dist/services/tools-logger.js +0 -222
  569. package/dist/services/tools-logger.js.map +0 -1
  570. package/dist/services/update-plan-handler.d.ts +0 -56
  571. package/dist/services/update-plan-handler.d.ts.map +0 -1
  572. package/dist/services/update-plan-handler.js +0 -372
  573. package/dist/services/update-plan-handler.js.map +0 -1
  574. package/dist/services/update-service.d.ts +0 -197
  575. package/dist/services/update-service.d.ts.map +0 -1
  576. package/dist/services/update-service.js +0 -749
  577. package/dist/services/update-service.js.map +0 -1
  578. package/dist/services/verifier.d.ts +0 -113
  579. package/dist/services/verifier.d.ts.map +0 -1
  580. package/dist/services/verifier.js +0 -541
  581. package/dist/services/verifier.js.map +0 -1
  582. package/dist/services/workflow-manager.d.ts +0 -277
  583. package/dist/services/workflow-manager.d.ts.map +0 -1
  584. package/dist/services/workflow-manager.js +0 -616
  585. package/dist/services/workflow-manager.js.map +0 -1
  586. package/dist/services/workflow-orchestrator.d.ts +0 -148
  587. package/dist/services/workflow-orchestrator.d.ts.map +0 -1
  588. package/dist/services/workflow-orchestrator.js +0 -617
  589. package/dist/services/workflow-orchestrator.js.map +0 -1
  590. package/dist/services/worktree-manager.d.ts +0 -36
  591. package/dist/services/worktree-manager.d.ts.map +0 -1
  592. package/dist/services/worktree-manager.js +0 -185
  593. package/dist/services/worktree-manager.js.map +0 -1
  594. package/dist/templates/ascii-art.d.ts +0 -136
  595. package/dist/templates/ascii-art.d.ts.map +0 -1
  596. package/dist/templates/ascii-art.js +0 -286
  597. package/dist/templates/ascii-art.js.map +0 -1
  598. package/dist/templates/help.d.ts +0 -186
  599. package/dist/templates/help.d.ts.map +0 -1
  600. package/dist/templates/help.js +0 -588
  601. package/dist/templates/help.js.map +0 -1
  602. package/dist/templates/prompts/workflow-prompts.d.ts +0 -9
  603. package/dist/templates/prompts/workflow-prompts.d.ts.map +0 -1
  604. package/dist/templates/prompts/workflow-prompts.js +0 -9
  605. package/dist/templates/prompts/workflow-prompts.js.map +0 -1
  606. package/dist/tools/agent-tools.d.ts +0 -9
  607. package/dist/tools/agent-tools.d.ts.map +0 -1
  608. package/dist/tools/agent-tools.js +0 -349
  609. package/dist/tools/agent-tools.js.map +0 -1
  610. package/dist/tools/edit-replacers.d.ts +0 -90
  611. package/dist/tools/edit-replacers.d.ts.map +0 -1
  612. package/dist/tools/edit-replacers.js +0 -553
  613. package/dist/tools/edit-replacers.js.map +0 -1
  614. package/dist/tools/file-tools.d.ts +0 -13
  615. package/dist/tools/file-tools.d.ts.map +0 -1
  616. package/dist/tools/file-tools.js +0 -954
  617. package/dist/tools/file-tools.js.map +0 -1
  618. package/dist/tools/git-tools.d.ts +0 -9
  619. package/dist/tools/git-tools.d.ts.map +0 -1
  620. package/dist/tools/git-tools.js +0 -261
  621. package/dist/tools/git-tools.js.map +0 -1
  622. package/dist/tools/index.d.ts +0 -13
  623. package/dist/tools/index.d.ts.map +0 -1
  624. package/dist/tools/index.js +0 -70
  625. package/dist/tools/index.js.map +0 -1
  626. package/dist/tools/network-tools.d.ts +0 -8
  627. package/dist/tools/network-tools.d.ts.map +0 -1
  628. package/dist/tools/network-tools.js +0 -261
  629. package/dist/tools/network-tools.js.map +0 -1
  630. package/dist/tools/openai-tools.d.ts +0 -16
  631. package/dist/tools/openai-tools.d.ts.map +0 -1
  632. package/dist/tools/openai-tools.js +0 -385
  633. package/dist/tools/openai-tools.js.map +0 -1
  634. package/dist/tools/plan-tools.d.ts +0 -9
  635. package/dist/tools/plan-tools.d.ts.map +0 -1
  636. package/dist/tools/plan-tools.js +0 -223
  637. package/dist/tools/plan-tools.js.map +0 -1
  638. package/dist/tools/schedule-tools.d.ts +0 -9
  639. package/dist/tools/schedule-tools.d.ts.map +0 -1
  640. package/dist/tools/schedule-tools.js +0 -405
  641. package/dist/tools/schedule-tools.js.map +0 -1
  642. package/dist/tools/search-tools.d.ts +0 -8
  643. package/dist/tools/search-tools.d.ts.map +0 -1
  644. package/dist/tools/search-tools.js +0 -357
  645. package/dist/tools/search-tools.js.map +0 -1
  646. package/dist/tools/shared-utils.d.ts +0 -91
  647. package/dist/tools/shared-utils.d.ts.map +0 -1
  648. package/dist/tools/shared-utils.js +0 -385
  649. package/dist/tools/shared-utils.js.map +0 -1
  650. package/dist/tools/shell-tools.d.ts +0 -9
  651. package/dist/tools/shell-tools.d.ts.map +0 -1
  652. package/dist/tools/shell-tools.js +0 -409
  653. package/dist/tools/shell-tools.js.map +0 -1
  654. package/dist/tools/skill-tools.d.ts +0 -13
  655. package/dist/tools/skill-tools.d.ts.map +0 -1
  656. package/dist/tools/skill-tools.js +0 -244
  657. package/dist/tools/skill-tools.js.map +0 -1
  658. package/dist/tools/swarm-tools.d.ts +0 -9
  659. package/dist/tools/swarm-tools.d.ts.map +0 -1
  660. package/dist/tools/swarm-tools.js +0 -422
  661. package/dist/tools/swarm-tools.js.map +0 -1
  662. package/dist/tools/user-tools.d.ts +0 -13
  663. package/dist/tools/user-tools.d.ts.map +0 -1
  664. package/dist/tools/user-tools.js +0 -232
  665. package/dist/tools/user-tools.js.map +0 -1
  666. package/dist/types/agent-process.d.ts +0 -244
  667. package/dist/types/agent-process.d.ts.map +0 -1
  668. package/dist/types/agent-process.js +0 -93
  669. package/dist/types/agent-process.js.map +0 -1
  670. package/dist/types/agent.d.ts +0 -358
  671. package/dist/types/agent.d.ts.map +0 -1
  672. package/dist/types/agent.js +0 -171
  673. package/dist/types/agent.js.map +0 -1
  674. package/dist/types/anthropic.d.ts +0 -438
  675. package/dist/types/anthropic.d.ts.map +0 -1
  676. package/dist/types/anthropic.js +0 -9
  677. package/dist/types/anthropic.js.map +0 -1
  678. package/dist/types/approval.d.ts +0 -332
  679. package/dist/types/approval.d.ts.map +0 -1
  680. package/dist/types/approval.js +0 -44
  681. package/dist/types/approval.js.map +0 -1
  682. package/dist/types/autocomplete.d.ts +0 -57
  683. package/dist/types/autocomplete.d.ts.map +0 -1
  684. package/dist/types/autocomplete.js +0 -7
  685. package/dist/types/autocomplete.js.map +0 -1
  686. package/dist/types/chat-archive.d.ts +0 -161
  687. package/dist/types/chat-archive.d.ts.map +0 -1
  688. package/dist/types/chat-archive.js +0 -36
  689. package/dist/types/chat-archive.js.map +0 -1
  690. package/dist/types/config.d.ts +0 -268
  691. package/dist/types/config.d.ts.map +0 -1
  692. package/dist/types/config.js +0 -188
  693. package/dist/types/config.js.map +0 -1
  694. package/dist/types/consent.d.ts +0 -191
  695. package/dist/types/consent.d.ts.map +0 -1
  696. package/dist/types/consent.js +0 -119
  697. package/dist/types/consent.js.map +0 -1
  698. package/dist/types/custom-command.d.ts +0 -139
  699. package/dist/types/custom-command.d.ts.map +0 -1
  700. package/dist/types/custom-command.js +0 -7
  701. package/dist/types/custom-command.js.map +0 -1
  702. package/dist/types/git.d.ts +0 -20
  703. package/dist/types/git.d.ts.map +0 -1
  704. package/dist/types/git.js +0 -2
  705. package/dist/types/git.js.map +0 -1
  706. package/dist/types/hook.d.ts +0 -342
  707. package/dist/types/hook.d.ts.map +0 -1
  708. package/dist/types/hook.js +0 -84
  709. package/dist/types/hook.js.map +0 -1
  710. package/dist/types/index.d.ts +0 -86
  711. package/dist/types/index.d.ts.map +0 -1
  712. package/dist/types/index.js +0 -71
  713. package/dist/types/index.js.map +0 -1
  714. package/dist/types/mcp.d.ts +0 -456
  715. package/dist/types/mcp.d.ts.map +0 -1
  716. package/dist/types/mcp.js +0 -94
  717. package/dist/types/mcp.js.map +0 -1
  718. package/dist/types/rating.d.ts +0 -110
  719. package/dist/types/rating.d.ts.map +0 -1
  720. package/dist/types/rating.js +0 -53
  721. package/dist/types/rating.js.map +0 -1
  722. package/dist/types/schedule.d.ts +0 -91
  723. package/dist/types/schedule.d.ts.map +0 -1
  724. package/dist/types/schedule.js +0 -8
  725. package/dist/types/schedule.js.map +0 -1
  726. package/dist/types/session.d.ts +0 -361
  727. package/dist/types/session.d.ts.map +0 -1
  728. package/dist/types/session.js +0 -9
  729. package/dist/types/session.js.map +0 -1
  730. package/dist/types/skill.d.ts +0 -258
  731. package/dist/types/skill.d.ts.map +0 -1
  732. package/dist/types/skill.js +0 -79
  733. package/dist/types/skill.js.map +0 -1
  734. package/dist/types/statusline.d.ts +0 -212
  735. package/dist/types/statusline.d.ts.map +0 -1
  736. package/dist/types/statusline.js +0 -8
  737. package/dist/types/statusline.js.map +0 -1
  738. package/dist/types/stream.d.ts +0 -61
  739. package/dist/types/stream.d.ts.map +0 -1
  740. package/dist/types/stream.js +0 -17
  741. package/dist/types/stream.js.map +0 -1
  742. package/dist/types/swarm.d.ts +0 -132
  743. package/dist/types/swarm.d.ts.map +0 -1
  744. package/dist/types/swarm.js +0 -21
  745. package/dist/types/swarm.js.map +0 -1
  746. package/dist/types/token-limits.d.ts +0 -107
  747. package/dist/types/token-limits.d.ts.map +0 -1
  748. package/dist/types/token-limits.js +0 -57
  749. package/dist/types/token-limits.js.map +0 -1
  750. package/dist/types/token.d.ts +0 -329
  751. package/dist/types/token.d.ts.map +0 -1
  752. package/dist/types/token.js +0 -9
  753. package/dist/types/token.js.map +0 -1
  754. package/dist/types/update.d.ts +0 -189
  755. package/dist/types/update.d.ts.map +0 -1
  756. package/dist/types/update.js +0 -55
  757. package/dist/types/update.js.map +0 -1
  758. package/dist/types/workflow.d.ts +0 -396
  759. package/dist/types/workflow.d.ts.map +0 -1
  760. package/dist/types/workflow.js +0 -46
  761. package/dist/types/workflow.js.map +0 -1
  762. package/dist/ui/App.d.ts +0 -62
  763. package/dist/ui/App.d.ts.map +0 -1
  764. package/dist/ui/App.js +0 -511
  765. package/dist/ui/App.js.map +0 -1
  766. package/dist/ui/InteractiveSession.d.ts +0 -34
  767. package/dist/ui/InteractiveSession.d.ts.map +0 -1
  768. package/dist/ui/InteractiveSession.js +0 -3611
  769. package/dist/ui/InteractiveSession.js.map +0 -1
  770. package/dist/ui/MCPApprovalPrompt.d.ts +0 -27
  771. package/dist/ui/MCPApprovalPrompt.d.ts.map +0 -1
  772. package/dist/ui/MCPApprovalPrompt.js +0 -51
  773. package/dist/ui/MCPApprovalPrompt.js.map +0 -1
  774. package/dist/ui/SetupWizard.d.ts +0 -26
  775. package/dist/ui/SetupWizard.d.ts.map +0 -1
  776. package/dist/ui/SetupWizard.js +0 -396
  777. package/dist/ui/SetupWizard.js.map +0 -1
  778. package/dist/ui/components/AgentCreationWizard.d.ts +0 -36
  779. package/dist/ui/components/AgentCreationWizard.d.ts.map +0 -1
  780. package/dist/ui/components/AgentCreationWizard.js +0 -619
  781. package/dist/ui/components/AgentCreationWizard.js.map +0 -1
  782. package/dist/ui/components/AgentManager.d.ts +0 -41
  783. package/dist/ui/components/AgentManager.d.ts.map +0 -1
  784. package/dist/ui/components/AgentManager.js +0 -343
  785. package/dist/ui/components/AgentManager.js.map +0 -1
  786. package/dist/ui/components/ApprovalDialog.d.ts +0 -18
  787. package/dist/ui/components/ApprovalDialog.d.ts.map +0 -1
  788. package/dist/ui/components/ApprovalDialog.js +0 -439
  789. package/dist/ui/components/ApprovalDialog.js.map +0 -1
  790. package/dist/ui/components/AsciiArt.d.ts +0 -54
  791. package/dist/ui/components/AsciiArt.d.ts.map +0 -1
  792. package/dist/ui/components/AsciiArt.js +0 -89
  793. package/dist/ui/components/AsciiArt.js.map +0 -1
  794. package/dist/ui/components/ClarificationWizard.d.ts +0 -36
  795. package/dist/ui/components/ClarificationWizard.d.ts.map +0 -1
  796. package/dist/ui/components/ClarificationWizard.js +0 -407
  797. package/dist/ui/components/ClarificationWizard.js.map +0 -1
  798. package/dist/ui/components/CompassSpinner.d.ts +0 -15
  799. package/dist/ui/components/CompassSpinner.d.ts.map +0 -1
  800. package/dist/ui/components/CompassSpinner.js +0 -50
  801. package/dist/ui/components/CompassSpinner.js.map +0 -1
  802. package/dist/ui/components/ConfirmationSelector.d.ts +0 -45
  803. package/dist/ui/components/ConfirmationSelector.d.ts.map +0 -1
  804. package/dist/ui/components/ConfirmationSelector.js +0 -106
  805. package/dist/ui/components/ConfirmationSelector.js.map +0 -1
  806. package/dist/ui/components/ContextUsage.d.ts +0 -76
  807. package/dist/ui/components/ContextUsage.d.ts.map +0 -1
  808. package/dist/ui/components/ContextUsage.js +0 -188
  809. package/dist/ui/components/ContextUsage.js.map +0 -1
  810. package/dist/ui/components/DiffPreview.d.ts +0 -13
  811. package/dist/ui/components/DiffPreview.d.ts.map +0 -1
  812. package/dist/ui/components/DiffPreview.js +0 -30
  813. package/dist/ui/components/DiffPreview.js.map +0 -1
  814. package/dist/ui/components/ExecutionModeSelector.d.ts +0 -45
  815. package/dist/ui/components/ExecutionModeSelector.d.ts.map +0 -1
  816. package/dist/ui/components/ExecutionModeSelector.js +0 -120
  817. package/dist/ui/components/ExecutionModeSelector.js.map +0 -1
  818. package/dist/ui/components/FileTree.d.ts +0 -47
  819. package/dist/ui/components/FileTree.d.ts.map +0 -1
  820. package/dist/ui/components/FileTree.js +0 -258
  821. package/dist/ui/components/FileTree.js.map +0 -1
  822. package/dist/ui/components/HelpMenu.d.ts +0 -49
  823. package/dist/ui/components/HelpMenu.d.ts.map +0 -1
  824. package/dist/ui/components/HelpMenu.js +0 -91
  825. package/dist/ui/components/HelpMenu.js.map +0 -1
  826. package/dist/ui/components/InterleavedStream.d.ts +0 -42
  827. package/dist/ui/components/InterleavedStream.d.ts.map +0 -1
  828. package/dist/ui/components/InterleavedStream.js +0 -1500
  829. package/dist/ui/components/InterleavedStream.js.map +0 -1
  830. package/dist/ui/components/ModelSelector.d.ts +0 -81
  831. package/dist/ui/components/ModelSelector.d.ts.map +0 -1
  832. package/dist/ui/components/ModelSelector.js +0 -305
  833. package/dist/ui/components/ModelSelector.js.map +0 -1
  834. package/dist/ui/components/PlanApprovalDialog.d.ts +0 -21
  835. package/dist/ui/components/PlanApprovalDialog.d.ts.map +0 -1
  836. package/dist/ui/components/PlanApprovalDialog.js +0 -189
  837. package/dist/ui/components/PlanApprovalDialog.js.map +0 -1
  838. package/dist/ui/components/PlanExecutionTracker.d.ts +0 -53
  839. package/dist/ui/components/PlanExecutionTracker.d.ts.map +0 -1
  840. package/dist/ui/components/PlanExecutionTracker.js +0 -113
  841. package/dist/ui/components/PlanExecutionTracker.js.map +0 -1
  842. package/dist/ui/components/ProgressIndicator.d.ts +0 -151
  843. package/dist/ui/components/ProgressIndicator.d.ts.map +0 -1
  844. package/dist/ui/components/ProgressIndicator.js +0 -171
  845. package/dist/ui/components/ProgressIndicator.js.map +0 -1
  846. package/dist/ui/components/Prompt.d.ts +0 -47
  847. package/dist/ui/components/Prompt.d.ts.map +0 -1
  848. package/dist/ui/components/Prompt.js +0 -632
  849. package/dist/ui/components/Prompt.js.map +0 -1
  850. package/dist/ui/components/RatingPanel.d.ts +0 -45
  851. package/dist/ui/components/RatingPanel.d.ts.map +0 -1
  852. package/dist/ui/components/RatingPanel.js +0 -119
  853. package/dist/ui/components/RatingPanel.js.map +0 -1
  854. package/dist/ui/components/StatusLine.d.ts +0 -43
  855. package/dist/ui/components/StatusLine.d.ts.map +0 -1
  856. package/dist/ui/components/StatusLine.js +0 -44
  857. package/dist/ui/components/StatusLine.js.map +0 -1
  858. package/dist/ui/components/StreamingResponse.d.ts +0 -45
  859. package/dist/ui/components/StreamingResponse.d.ts.map +0 -1
  860. package/dist/ui/components/StreamingResponse.js +0 -56
  861. package/dist/ui/components/StreamingResponse.js.map +0 -1
  862. package/dist/ui/components/TokenUsage.d.ts +0 -89
  863. package/dist/ui/components/TokenUsage.d.ts.map +0 -1
  864. package/dist/ui/components/TokenUsage.js +0 -99
  865. package/dist/ui/components/TokenUsage.js.map +0 -1
  866. package/dist/ui/components/ToolSummary.d.ts +0 -77
  867. package/dist/ui/components/ToolSummary.d.ts.map +0 -1
  868. package/dist/ui/components/ToolSummary.js +0 -162
  869. package/dist/ui/components/ToolSummary.js.map +0 -1
  870. package/dist/ui/components/UpdateNotification.d.ts +0 -65
  871. package/dist/ui/components/UpdateNotification.d.ts.map +0 -1
  872. package/dist/ui/components/UpdateNotification.js +0 -166
  873. package/dist/ui/components/UpdateNotification.js.map +0 -1
  874. package/dist/ui/diff-renderer.d.ts +0 -18
  875. package/dist/ui/diff-renderer.d.ts.map +0 -1
  876. package/dist/ui/diff-renderer.js +0 -206
  877. package/dist/ui/diff-renderer.js.map +0 -1
  878. package/dist/ui/themes/markdown-theme.d.ts +0 -48
  879. package/dist/ui/themes/markdown-theme.d.ts.map +0 -1
  880. package/dist/ui/themes/markdown-theme.js +0 -79
  881. package/dist/ui/themes/markdown-theme.js.map +0 -1
  882. package/dist/ui/themes/ui-theme.d.ts +0 -301
  883. package/dist/ui/themes/ui-theme.d.ts.map +0 -1
  884. package/dist/ui/themes/ui-theme.js +0 -204
  885. package/dist/ui/themes/ui-theme.js.map +0 -1
  886. package/dist/utils/attachment-handler.d.ts +0 -129
  887. package/dist/utils/attachment-handler.d.ts.map +0 -1
  888. package/dist/utils/attachment-handler.js +0 -280
  889. package/dist/utils/attachment-handler.js.map +0 -1
  890. package/dist/utils/backup-cleanup.d.ts +0 -28
  891. package/dist/utils/backup-cleanup.d.ts.map +0 -1
  892. package/dist/utils/backup-cleanup.js +0 -99
  893. package/dist/utils/backup-cleanup.js.map +0 -1
  894. package/dist/utils/clipboard-handler.d.ts +0 -82
  895. package/dist/utils/clipboard-handler.d.ts.map +0 -1
  896. package/dist/utils/clipboard-handler.js +0 -311
  897. package/dist/utils/clipboard-handler.js.map +0 -1
  898. package/dist/utils/cloud-detection.d.ts +0 -14
  899. package/dist/utils/cloud-detection.d.ts.map +0 -1
  900. package/dist/utils/cloud-detection.js +0 -92
  901. package/dist/utils/cloud-detection.js.map +0 -1
  902. package/dist/utils/command-parser.d.ts +0 -56
  903. package/dist/utils/command-parser.d.ts.map +0 -1
  904. package/dist/utils/command-parser.js +0 -206
  905. package/dist/utils/command-parser.js.map +0 -1
  906. package/dist/utils/console-capture.d.ts +0 -30
  907. package/dist/utils/console-capture.d.ts.map +0 -1
  908. package/dist/utils/console-capture.js +0 -88
  909. package/dist/utils/console-capture.js.map +0 -1
  910. package/dist/utils/cron-parser.d.ts +0 -52
  911. package/dist/utils/cron-parser.d.ts.map +0 -1
  912. package/dist/utils/cron-parser.js +0 -455
  913. package/dist/utils/cron-parser.js.map +0 -1
  914. package/dist/utils/crypto.d.ts +0 -351
  915. package/dist/utils/crypto.d.ts.map +0 -1
  916. package/dist/utils/crypto.js +0 -615
  917. package/dist/utils/crypto.js.map +0 -1
  918. package/dist/utils/diff.d.ts +0 -311
  919. package/dist/utils/diff.d.ts.map +0 -1
  920. package/dist/utils/diff.js +0 -566
  921. package/dist/utils/diff.js.map +0 -1
  922. package/dist/utils/editor.d.ts +0 -12
  923. package/dist/utils/editor.d.ts.map +0 -1
  924. package/dist/utils/editor.js +0 -30
  925. package/dist/utils/editor.js.map +0 -1
  926. package/dist/utils/file-system.d.ts +0 -512
  927. package/dist/utils/file-system.d.ts.map +0 -1
  928. package/dist/utils/file-system.js +0 -798
  929. package/dist/utils/file-system.js.map +0 -1
  930. package/dist/utils/format.d.ts +0 -318
  931. package/dist/utils/format.d.ts.map +0 -1
  932. package/dist/utils/format.js +0 -587
  933. package/dist/utils/format.js.map +0 -1
  934. package/dist/utils/ignore-patterns.d.ts +0 -93
  935. package/dist/utils/ignore-patterns.d.ts.map +0 -1
  936. package/dist/utils/ignore-patterns.js +0 -710
  937. package/dist/utils/ignore-patterns.js.map +0 -1
  938. package/dist/utils/log-cleanup.d.ts +0 -16
  939. package/dist/utils/log-cleanup.d.ts.map +0 -1
  940. package/dist/utils/log-cleanup.js +0 -51
  941. package/dist/utils/log-cleanup.js.map +0 -1
  942. package/dist/utils/logger.d.ts +0 -305
  943. package/dist/utils/logger.d.ts.map +0 -1
  944. package/dist/utils/logger.js +0 -447
  945. package/dist/utils/logger.js.map +0 -1
  946. package/dist/utils/path.d.ts +0 -406
  947. package/dist/utils/path.d.ts.map +0 -1
  948. package/dist/utils/path.js +0 -549
  949. package/dist/utils/path.js.map +0 -1
  950. package/dist/utils/schedule-file.d.ts +0 -63
  951. package/dist/utils/schedule-file.d.ts.map +0 -1
  952. package/dist/utils/schedule-file.js +0 -244
  953. package/dist/utils/schedule-file.js.map +0 -1
  954. package/dist/utils/task-id.d.ts +0 -29
  955. package/dist/utils/task-id.d.ts.map +0 -1
  956. package/dist/utils/task-id.js +0 -53
  957. package/dist/utils/task-id.js.map +0 -1
  958. package/dist/utils/temp-cleanup.d.ts +0 -46
  959. package/dist/utils/temp-cleanup.d.ts.map +0 -1
  960. package/dist/utils/temp-cleanup.js +0 -95
  961. package/dist/utils/temp-cleanup.js.map +0 -1
  962. package/dist/utils/terminal-output.d.ts +0 -34
  963. package/dist/utils/terminal-output.d.ts.map +0 -1
  964. package/dist/utils/terminal-output.js +0 -40
  965. package/dist/utils/terminal-output.js.map +0 -1
  966. package/dist/utils/token-counter.d.ts +0 -224
  967. package/dist/utils/token-counter.d.ts.map +0 -1
  968. package/dist/utils/token-counter.js +0 -332
  969. package/dist/utils/token-counter.js.map +0 -1
  970. package/dist/utils/tool-mapper.d.ts +0 -70
  971. package/dist/utils/tool-mapper.d.ts.map +0 -1
  972. package/dist/utils/tool-mapper.js +0 -234
  973. package/dist/utils/tool-mapper.js.map +0 -1
@@ -1,1500 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /**
3
- * React/ink component for rendering interleaved text and tool calls
4
- * in Claude Code CLI style format.
5
- *
6
- * Example output:
7
- * ```
8
- * ● I'll first look at an existing ADR to understand the format...
9
- *
10
- * ● Read(file_path: "docs/adr/adr007.md")
11
- * ⎿ Read 473 lines
12
- *
13
- * ● Search(pattern: "**\/*.ts")
14
- * ⎿ Found 8 files
15
- * ```
16
- */
17
- import React from 'react';
18
- import { Box, Text } from 'ink';
19
- import { marked } from 'marked';
20
- import cliTruncate from 'cli-truncate';
21
- import { createMarkdownRenderer } from '../themes/markdown-theme.js';
22
- import { truncate, formatCompactNumber } from '../../utils/format.js';
23
- import { getToolRegistry } from '../../services/tool-registry.js';
24
- import { getSessionManager } from '../../services/session-manager.js';
25
- import { getRelativePath, isPathWithin } from '../../utils/path.js';
26
- /**
27
- * Static activity indicator using empty circle.
28
- * No animation to prevent layout bouncing from re-renders.
29
- */
30
- const ActivityDot = ({ color = 'cyan' }) => {
31
- return _jsx(Text, { color: color, children: "\u25CB" });
32
- };
33
- /**
34
- * Word-wraps text to fit within a given width, breaking at word boundaries.
35
- * Returns an array of lines. Sentences that start after a period get their own line
36
- * when possible for improved readability.
37
- */
38
- function wordWrap(text, maxWidth) {
39
- if (maxWidth <= 0 || !text)
40
- return [text];
41
- // Split into sentences (at ". " boundaries) for intelligent breaking
42
- const sentences = text.split(/(?<=\.)\s+/);
43
- const lines = [];
44
- let currentLine = '';
45
- for (const sentence of sentences) {
46
- // If adding this sentence would exceed width, start a new line
47
- if (currentLine && (currentLine.length + 1 + sentence.length > maxWidth)) {
48
- // If the current line is non-empty, push it
49
- if (currentLine) {
50
- lines.push(currentLine);
51
- currentLine = '';
52
- }
53
- }
54
- // If the sentence itself is longer than maxWidth, do word-level wrapping
55
- if (sentence.length > maxWidth) {
56
- const words = sentence.split(' ');
57
- for (const word of words) {
58
- if (!currentLine) {
59
- currentLine = word;
60
- }
61
- else if (currentLine.length + 1 + word.length <= maxWidth) {
62
- currentLine += ' ' + word;
63
- }
64
- else {
65
- lines.push(currentLine);
66
- currentLine = word;
67
- }
68
- }
69
- }
70
- else {
71
- if (!currentLine) {
72
- currentLine = sentence;
73
- }
74
- else {
75
- currentLine += ' ' + sentence;
76
- }
77
- }
78
- }
79
- if (currentLine) {
80
- lines.push(currentLine);
81
- }
82
- return lines.length > 0 ? lines : [text];
83
- }
84
- /**
85
- * Converts an absolute file path to a relative path for display.
86
- * Returns the original path if it's not within the project root or already relative.
87
- */
88
- function makePathRelative(filePath) {
89
- // Skip if already relative
90
- if (!filePath || (!filePath.startsWith('/') && !filePath.match(/^[A-Za-z]:\\/))) {
91
- return filePath;
92
- }
93
- try {
94
- const projectRoot = getSessionManager().getProjectRoot();
95
- if (projectRoot && isPathWithin(filePath, projectRoot)) {
96
- const relativePath = getRelativePath(filePath, projectRoot);
97
- // Return relative path, or '.' if it's the root itself
98
- return relativePath || '.';
99
- }
100
- }
101
- catch {
102
- // If session manager not available, return original path
103
- }
104
- return filePath;
105
- }
106
- /**
107
- * Map of tool names to their essential display parameters.
108
- * Tools listed here will only show the specified parameters in the UI.
109
- * Tools not in this map will show all parameters.
110
- */
111
- const TOOL_DISPLAY_PARAMS = {
112
- // File tools - only show path
113
- read: ['file_path', 'path'],
114
- read_file: ['file_path', 'path'],
115
- write: ['file_path', 'path'],
116
- write_file: ['file_path', 'path'],
117
- edit: ['file_path', 'path'],
118
- edit_file: ['file_path', 'path'],
119
- delete: ['description'],
120
- delete_file: ['description'],
121
- create_directory: ['path'],
122
- get_file_info: ['path'],
123
- // Read multiple - handled specially, but define to filter params
124
- read_multiple_files: ['paths'],
125
- // Search tools - show pattern and path
126
- glob: ['pattern', 'path'],
127
- grep: ['pattern', 'path'],
128
- search: ['pattern', 'path'],
129
- // List tool - show pattern if present, otherwise path
130
- list: ['pattern', 'path'],
131
- list_directory: ['pattern', 'path'],
132
- // Shell tools - show description in header, command shown separately
133
- bash: ['description'],
134
- shell: ['description'],
135
- execute: ['description'],
136
- execute_command: ['description'],
137
- // Plan tools - only show task summary / modification request
138
- plan: ['task_summary'],
139
- update_plan: ['modification_request'],
140
- complete_plan_task: ['task_id', 'summary'],
141
- // Agent tools - only show task (agent type shown in display name)
142
- spawn_task: ['task'],
143
- task: ['prompt'],
144
- // Poll task - only show process_id
145
- poll_task: ['process_id'],
146
- };
147
- /**
148
- * Map of tool names to their expected parameters (in generation order).
149
- * Used to show progress during the 'generating' phase.
150
- */
151
- const TOOL_EXPECTED_PARAMS = {
152
- // Edit tools - typically generate path, then old content, then new content
153
- edit: ['file_path', 'old_string', 'new_string'],
154
- edit_file: ['file_path', 'old_string', 'new_string'],
155
- // Write tools - path then content
156
- write: ['file_path', 'content'],
157
- write_file: ['file_path', 'content'],
158
- // Read tools - just path
159
- read: ['file_path'],
160
- read_file: ['file_path'],
161
- // Search tools
162
- glob: ['pattern', 'path'],
163
- grep: ['pattern', 'path'],
164
- search: ['pattern', 'path'],
165
- // Shell tools
166
- bash: ['command', 'timeout'],
167
- shell: ['command'],
168
- execute: ['command'],
169
- execute_command: ['command'],
170
- // Task/Agent tools
171
- delegate_task: ['task_description', 'context'],
172
- task: ['prompt'],
173
- spawn_task: ['task', 'agent_type'],
174
- };
175
- /**
176
- * Human-readable labels for parameter names
177
- */
178
- const PARAM_LABELS = {
179
- file_path: 'file path',
180
- old_string: 'content to replace',
181
- new_string: 'new content',
182
- content: 'content',
183
- pattern: 'pattern',
184
- path: 'path',
185
- command: 'command',
186
- timeout: 'timeout',
187
- task_description: 'task',
188
- context: 'context',
189
- prompt: 'prompt',
190
- subagent_type: 'agent type',
191
- agent_type: 'agent type',
192
- task: 'task',
193
- };
194
- /**
195
- * Finds the common directory prefix from an array of file paths.
196
- * Returns './' if no common prefix is found.
197
- */
198
- function findCommonDirectory(paths) {
199
- if (!paths || paths.length === 0)
200
- return './';
201
- // First make all paths relative to project root
202
- const relativePaths = paths.map((p) => makePathRelative(p));
203
- if (relativePaths.length === 1) {
204
- const dir = relativePaths[0].replace(/\\/g, '/').split('/').slice(0, -1).join('/');
205
- return dir || './';
206
- }
207
- // Normalize paths and split into parts
208
- const normalizedPaths = relativePaths.map((p) => p.replace(/\\/g, '/'));
209
- const splitPaths = normalizedPaths.map((p) => p.split('/'));
210
- // Find common prefix
211
- const minLength = Math.min(...splitPaths.map((p) => p.length));
212
- const commonParts = [];
213
- for (let i = 0; i < minLength - 1; i++) { // -1 to exclude filename
214
- const part = splitPaths[0][i];
215
- if (splitPaths.every((p) => p[i] === part)) {
216
- commonParts.push(part);
217
- }
218
- else {
219
- break;
220
- }
221
- }
222
- if (commonParts.length === 0)
223
- return './';
224
- return commonParts.join('/');
225
- }
226
- /**
227
- * Extracts a clean display name from an MCP tool registry name.
228
- * Strips the server name prefix and shows just the tool name.
229
- * Example: mcp_fetch_fetch -> "Fetch", mcp_compass_web_search -> "Web Search"
230
- */
231
- function getMCPDisplayName(registryName) {
232
- const lowerName = registryName.toLowerCase();
233
- if (!lowerName.startsWith('mcp_')) {
234
- return null;
235
- }
236
- const parts = registryName.substring(4).split('_'); // Remove 'mcp_' prefix
237
- if (parts.length < 2) {
238
- return null;
239
- }
240
- // First part is server name, rest is tool name
241
- const serverName = parts[0];
242
- const toolParts = parts.slice(1);
243
- // Capitalize each part
244
- const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
245
- // If server name equals tool name (e.g., mcp_fetch_fetch), just show the tool name
246
- if (toolParts.length === 1 && toolParts[0].toLowerCase() === serverName.toLowerCase()) {
247
- return capitalize(serverName);
248
- }
249
- // Otherwise show just the tool name without server prefix
250
- const formattedTool = toolParts.map(capitalize).join(' ');
251
- return formattedTool;
252
- }
253
- /**
254
- * Computes the generating progress message for a tool.
255
- * Shows which parameter is currently being generated and overall progress.
256
- */
257
- function getGeneratingProgress(toolName, params) {
258
- const toolLower = toolName.toLowerCase();
259
- const expectedParams = TOOL_EXPECTED_PARAMS[toolLower];
260
- if (!expectedParams) {
261
- // Unknown tool - show generic message with count of received params
262
- const receivedCount = Object.keys(params).length;
263
- if (receivedCount === 0) {
264
- return 'Preparing parameters...';
265
- }
266
- return `Preparing parameters (${receivedCount} received)...`;
267
- }
268
- const receivedParams = Object.keys(params);
269
- const receivedCount = receivedParams.length;
270
- const totalCount = expectedParams.length;
271
- if (receivedCount === 0) {
272
- // No params yet - show first expected param
273
- const firstParam = expectedParams[0];
274
- const label = PARAM_LABELS[firstParam] || firstParam;
275
- return `Preparing ${label}...`;
276
- }
277
- // Find the next parameter being prepared (first expected param not yet received)
278
- const nextParam = expectedParams.find((p) => !(p in params));
279
- if (nextParam) {
280
- const label = PARAM_LABELS[nextParam] || nextParam;
281
- return `Preparing ${label} (${receivedCount}/${totalCount})...`;
282
- }
283
- // All expected params received, but still finalizing (maybe optional params)
284
- return `Finalizing (${receivedCount}/${totalCount})...`;
285
- }
286
- /**
287
- * Tools that should show only the value (no parameter name or quotes)
288
- * These are typically file tools where showing just the path is cleaner
289
- */
290
- const TOOLS_VALUE_ONLY = new Set([
291
- 'read', 'read_file', 'write', 'write_file', 'edit', 'edit_file', 'create_directory', 'plan',
292
- 'bash', 'shell', 'execute', 'execute_command', 'task', 'spawn_task', 'get_file_info',
293
- 'list', 'list_directory', 'update_plan', 'complete_plan_task', 'poll_task',
294
- ]);
295
- /**
296
- * Tools that should hide the result line (⎿ Done)
297
- * These are simple operations where showing "Done" adds no value
298
- */
299
- const TOOLS_HIDE_RESULT = new Set([
300
- 'create_directory',
301
- 'list_directory_with_sizes',
302
- 'git_status',
303
- 'git_diff',
304
- 'git_log',
305
- 'git_stage',
306
- 'git_commit',
307
- 'git_push',
308
- ]);
309
- /**
310
- * Tools that should collapse (hide) results by default
311
- * Results are shown only when expanded with Ctrl+O
312
- */
313
- const TOOLS_COLLAPSE_RESULT = new Set([
314
- 'read',
315
- 'read_file',
316
- 'read_multiple_files',
317
- 'grep',
318
- 'glob',
319
- 'search',
320
- 'task',
321
- 'spawn_task',
322
- 'delegate_task',
323
- ]);
324
- /**
325
- * Tools that should show only the quoted value (no parameter name, but with quotes)
326
- * Example: SomeTool("value here") instead of SomeTool(param: "value here")
327
- */
328
- const TOOLS_QUOTED_VALUE_ONLY = new Set([
329
- // Currently empty - add tools here if you want quoted values without param names
330
- ]);
331
- /**
332
- * Extracts line count from a read tool result.
333
- * Accepts optional pre-parsed data to avoid JSON.parse in the render path.
334
- */
335
- function extractLineCount(result, parsedResult) {
336
- if (!result && !parsedResult)
337
- return null;
338
- const data = parsedResult ?? (() => { try {
339
- return JSON.parse(result);
340
- }
341
- catch {
342
- return null;
343
- } })();
344
- if (typeof data === 'object' && data !== null && 'content' in data && typeof data.content === 'string') {
345
- return data.content.split('\n').length;
346
- }
347
- return null;
348
- }
349
- /**
350
- * Gets the file path from a read tool block
351
- */
352
- function getReadFilePath(tool) {
353
- const path = tool.params.file_path || tool.params.path;
354
- return typeof path === 'string' ? path : null;
355
- }
356
- /**
357
- * Checks if a tool is a read tool
358
- */
359
- function isReadTool(name) {
360
- const lower = name.toLowerCase();
361
- return lower === 'read' || lower === 'read_file';
362
- }
363
- /**
364
- * Checks if a tool is an edit tool
365
- */
366
- function isEditTool(name) {
367
- const lower = name.toLowerCase();
368
- return lower === 'edit' || lower === 'edit_file';
369
- }
370
- /**
371
- * Gets the file path from an edit tool block
372
- */
373
- function getEditFilePath(tool) {
374
- const path = tool.params.file_path || tool.params.path;
375
- return typeof path === 'string' ? path : null;
376
- }
377
- /**
378
- * Extracts additions, deletions, and changes from an edit tool result
379
- */
380
- function extractEditChanges(result, parsedResult) {
381
- if (!result && !parsedResult)
382
- return null;
383
- const data = parsedResult ?? (() => { try {
384
- return JSON.parse(result);
385
- }
386
- catch {
387
- return null;
388
- } })();
389
- if (typeof data === 'object' && data !== null && 'success' in data && data.success === true) {
390
- const obj = data;
391
- const additions = typeof obj.additions === 'number' ? obj.additions : 0;
392
- const deletions = typeof obj.deletions === 'number' ? obj.deletions : 0;
393
- const changes = Array.isArray(obj.changes) ? obj.changes : [];
394
- return { additions, deletions, changes };
395
- }
396
- return null;
397
- }
398
- /**
399
- * Consolidates consecutive read operations on the same file into a single display block.
400
- * This reduces visual clutter when the LLM reads the same file multiple times in succession.
401
- */
402
- function consolidateReadBlocks(blocks) {
403
- const result = [];
404
- let i = 0;
405
- while (i < blocks.length) {
406
- const block = blocks[i];
407
- // Check if this is a completed read tool
408
- if (block.type === 'tool' && isReadTool(block.name) &&
409
- (block.status === 'success' || block.status === 'error')) {
410
- const filePath = getReadFilePath(block);
411
- if (filePath) {
412
- // Look ahead for consecutive reads of the same file
413
- const consecutiveReads = [block];
414
- let j = i + 1;
415
- while (j < blocks.length) {
416
- const nextBlock = blocks[j];
417
- if (nextBlock.type === 'tool' && isReadTool(nextBlock.name) &&
418
- (nextBlock.status === 'success' || nextBlock.status === 'error') &&
419
- getReadFilePath(nextBlock) === filePath) {
420
- consecutiveReads.push(nextBlock);
421
- j++;
422
- }
423
- else {
424
- break;
425
- }
426
- }
427
- // If we found multiple consecutive reads, consolidate them
428
- if (consecutiveReads.length > 1) {
429
- const durations = [];
430
- const lineCounts = [];
431
- let hasError = false;
432
- let errorMsg;
433
- for (const read of consecutiveReads) {
434
- if (read.duration_ms !== undefined) {
435
- durations.push(read.duration_ms);
436
- }
437
- const lineCount = extractLineCount(read.result, read.parsedResult);
438
- if (lineCount !== null) {
439
- lineCounts.push(lineCount);
440
- }
441
- if (read.status === 'error') {
442
- hasError = true;
443
- errorMsg = read.error;
444
- }
445
- }
446
- result.push({
447
- type: 'consolidated_read',
448
- filePath,
449
- durations,
450
- lineCounts,
451
- status: hasError ? 'error' : 'success',
452
- error: errorMsg,
453
- originalBlocks: consecutiveReads,
454
- });
455
- i = j;
456
- continue;
457
- }
458
- }
459
- }
460
- // Not a read tool or single read - add as-is
461
- result.push(block);
462
- i++;
463
- }
464
- return result;
465
- }
466
- /**
467
- * Consolidates consecutive edit operations on the same file into a single display block.
468
- * This reduces visual clutter when the LLM edits the same file multiple times in succession.
469
- */
470
- function consolidateEditBlocks(blocks) {
471
- const result = [];
472
- let i = 0;
473
- while (i < blocks.length) {
474
- const block = blocks[i];
475
- // Check if this is a completed edit tool
476
- if (block.type === 'tool' && isEditTool(block.name) &&
477
- (block.status === 'success' || block.status === 'error')) {
478
- const filePath = getEditFilePath(block);
479
- if (filePath) {
480
- // Look ahead for consecutive edits of the same file
481
- const consecutiveEdits = [block];
482
- let j = i + 1;
483
- while (j < blocks.length) {
484
- const nextBlock = blocks[j];
485
- if (nextBlock.type === 'tool' && isEditTool(nextBlock.name) &&
486
- (nextBlock.status === 'success' || nextBlock.status === 'error') &&
487
- getEditFilePath(nextBlock) === filePath) {
488
- consecutiveEdits.push(nextBlock);
489
- j++;
490
- }
491
- else {
492
- break;
493
- }
494
- }
495
- // If we found multiple consecutive edits, consolidate them
496
- if (consecutiveEdits.length > 1) {
497
- const durations = [];
498
- const additions = [];
499
- const deletions = [];
500
- const allChanges = [];
501
- let hasError = false;
502
- let errorMsg;
503
- for (const edit of consecutiveEdits) {
504
- if (edit.duration_ms !== undefined) {
505
- durations.push(edit.duration_ms);
506
- }
507
- const extracted = extractEditChanges(edit.result, edit.parsedResult);
508
- if (extracted !== null) {
509
- additions.push(extracted.additions);
510
- deletions.push(extracted.deletions);
511
- allChanges.push(...extracted.changes);
512
- }
513
- if (edit.status === 'error') {
514
- hasError = true;
515
- errorMsg = edit.error;
516
- }
517
- }
518
- result.push({
519
- type: 'consolidated_edit',
520
- filePath,
521
- durations,
522
- additions,
523
- deletions,
524
- allChanges,
525
- status: hasError ? 'error' : 'success',
526
- error: errorMsg,
527
- originalBlocks: consecutiveEdits,
528
- });
529
- i = j;
530
- continue;
531
- }
532
- }
533
- }
534
- // Not an edit tool or single edit - add as-is
535
- result.push(block);
536
- i++;
537
- }
538
- return result;
539
- }
540
- /**
541
- * Extracts an AgentEntry from a ToolStreamBlock for agent/task tools.
542
- */
543
- function extractAgentEntry(block) {
544
- const params = block.params;
545
- const rawDescription = (params.task || params.prompt || params.description || '');
546
- const taskDescription = rawDescription.length > 120
547
- ? rawDescription.slice(0, 117) + '...'
548
- : rawDescription;
549
- const agentType = (params.agent_type || params.subagent_type || '');
550
- const agentTypeLabel = agentType
551
- ? agentType
552
- .split(/[-_]/)
553
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
554
- .join(' ')
555
- : 'Task';
556
- let toolCallCount;
557
- let tokensUsed;
558
- let resultSummary;
559
- let rawResult;
560
- const error = block.error;
561
- if (block.result) {
562
- rawResult = block.result;
563
- try {
564
- const resultData = block.parsedResult ?? JSON.parse(block.result);
565
- if (typeof resultData === 'object' && resultData !== null) {
566
- if (typeof resultData.toolCallCount === 'number') {
567
- toolCallCount = resultData.toolCallCount;
568
- }
569
- if (resultData.usage && typeof resultData.usage === 'object') {
570
- if (typeof resultData.usage.tokensUsed === 'number') {
571
- tokensUsed = resultData.usage.tokensUsed;
572
- }
573
- }
574
- // Extract a short result summary
575
- const content = (resultData.content || resultData.response || '');
576
- if (typeof content === 'string' && content.length > 0) {
577
- // Take the last non-empty line as summary
578
- const lines = content.split('\n').filter((l) => l.trim().length > 0);
579
- const lastLine = lines[lines.length - 1] || '';
580
- resultSummary = lastLine.length > 80 ? lastLine.slice(0, 77) + '...' : lastLine;
581
- }
582
- }
583
- }
584
- catch {
585
- // Not JSON, use raw result
586
- }
587
- }
588
- if (block.status === 'error') {
589
- resultSummary = error || 'Error';
590
- }
591
- else if (block.status === 'success' && !resultSummary) {
592
- resultSummary = 'Done';
593
- }
594
- return {
595
- taskDescription,
596
- agentTypeLabel,
597
- toolCallCount,
598
- tokensUsed,
599
- resultSummary,
600
- status: block.status,
601
- error,
602
- rawResult,
603
- };
604
- }
605
- /**
606
- * Consolidates consecutive agent/task tool calls into a single display block.
607
- * Groups 2+ consecutive agent blocks into a ConsolidatedAgentBlock.
608
- */
609
- function consolidateAgentBlocks(blocks) {
610
- const result = [];
611
- let i = 0;
612
- while (i < blocks.length) {
613
- const block = blocks[i];
614
- // Check if this is an agent tool (any status)
615
- if (block.type === 'tool' && isAgentTool(block.name)) {
616
- // Look ahead for consecutive agent blocks
617
- const consecutiveAgents = [block];
618
- let j = i + 1;
619
- while (j < blocks.length) {
620
- const nextBlock = blocks[j];
621
- if (nextBlock.type === 'tool' && isAgentTool(nextBlock.name)) {
622
- consecutiveAgents.push(nextBlock);
623
- j++;
624
- }
625
- else {
626
- break;
627
- }
628
- }
629
- // If we found multiple consecutive agents, consolidate them
630
- if (consecutiveAgents.length > 1) {
631
- const agents = consecutiveAgents.map(extractAgentEntry);
632
- // Compute combined status: generating > running > error/success
633
- let combinedStatus = 'success';
634
- for (const agent of agents) {
635
- if (agent.status === 'generating') {
636
- combinedStatus = 'generating';
637
- break;
638
- }
639
- if (agent.status === 'running' || agent.status === 'pending') {
640
- combinedStatus = 'running';
641
- }
642
- if (agent.status === 'error' && combinedStatus !== 'running') {
643
- combinedStatus = 'error';
644
- }
645
- }
646
- result.push({
647
- type: 'consolidated_agent',
648
- agents,
649
- status: combinedStatus,
650
- originalBlocks: consecutiveAgents,
651
- });
652
- i = j;
653
- continue;
654
- }
655
- }
656
- // Not an agent tool or single agent - add as-is
657
- result.push(block);
658
- i++;
659
- }
660
- return result;
661
- }
662
- /**
663
- * Formats tool parameters for display
664
- * Example for file tools: src/index.ts
665
- * Example for other tools: pattern: "*.tsx", path: "src"
666
- */
667
- function formatParams(params, maxLength = 100, toolName) {
668
- let entries = Object.entries(params);
669
- if (entries.length === 0)
670
- return '';
671
- // Filter to essential params if tool has a display config
672
- if (toolName) {
673
- const toolLower = toolName.toLowerCase();
674
- const essentialParams = TOOL_DISPLAY_PARAMS[toolLower];
675
- if (essentialParams) {
676
- entries = entries.filter(([key]) => essentialParams.includes(key));
677
- }
678
- // Special handling for read_multiple_files: show common directory
679
- if (toolLower === 'read_multiple_files' && 'paths' in params && Array.isArray(params.paths)) {
680
- const paths = params.paths;
681
- const commonDir = findCommonDirectory(paths);
682
- return commonDir;
683
- }
684
- // Special handling for List tool: show pattern if present, otherwise path
685
- if ((toolLower === 'list' || toolLower === 'list_directory') && ('pattern' in params || 'path' in params)) {
686
- const pattern = params.pattern;
687
- const path = params.path;
688
- // Prefer pattern over path for display
689
- if (pattern && pattern !== '*') {
690
- return pattern;
691
- }
692
- if (path) {
693
- return makePathRelative(path);
694
- }
695
- return '.';
696
- }
697
- // Special handling for MCP fetch-like tools: only show URL
698
- if (toolLower.startsWith('mcp_') && (toolLower.includes('fetch') || toolLower.includes('browse'))) {
699
- if ('url' in params && typeof params.url === 'string') {
700
- const url = params.url;
701
- // Show just the URL, truncated if needed
702
- return url.length > 70 ? truncate(url, 70) : url;
703
- }
704
- }
705
- // Special handling for MCP search-like tools: only show query
706
- if (toolLower.startsWith('mcp_') && toolLower.includes('search')) {
707
- entries = entries.filter(([key]) => key === 'query');
708
- }
709
- }
710
- if (entries.length === 0)
711
- return '';
712
- // For file tools (Read, Write, Edit), show just the value without key/quotes
713
- const toolLower = toolName?.toLowerCase() ?? '';
714
- const valueOnly = TOOLS_VALUE_ONLY.has(toolLower);
715
- const quotedValueOnly = TOOLS_QUOTED_VALUE_ONLY.has(toolLower);
716
- // Parameters that contain file paths and should be made relative
717
- const FILE_PATH_PARAMS = new Set(['file_path', 'path', 'paths']);
718
- const formatted = entries
719
- .map(([key, value]) => {
720
- if (typeof value === 'string') {
721
- // Convert file paths to relative paths for display
722
- let processedValue = value;
723
- if (FILE_PATH_PARAMS.has(key)) {
724
- processedValue = makePathRelative(value);
725
- }
726
- const valueMaxLen = valueOnly ? maxLength : 70;
727
- const displayValue = processedValue.length > valueMaxLen ? truncate(processedValue, valueMaxLen) : processedValue;
728
- // For value-only tools, just show the value without key or quotes
729
- if (valueOnly) {
730
- return displayValue;
731
- }
732
- // For quoted-value-only tools, show the value with quotes but no key
733
- if (quotedValueOnly) {
734
- return `"${displayValue}"`;
735
- }
736
- return `${key}: "${displayValue}"`;
737
- }
738
- if (typeof value === 'boolean' || typeof value === 'number') {
739
- return `${key}: ${value}`;
740
- }
741
- if (Array.isArray(value)) {
742
- return `${key}: [${value.length} items]`;
743
- }
744
- if (value && typeof value === 'object') {
745
- return `${key}: {...}`;
746
- }
747
- return `${key}: ${String(value)}`;
748
- })
749
- .join(', ');
750
- return formatted.length > maxLength ? truncate(formatted, maxLength) : formatted;
751
- }
752
- /**
753
- * Formats tool result for display based on tool name and result data
754
- */
755
- function formatToolResult(name, result, error, parsedResult) {
756
- if (error) {
757
- // Simplify common error messages for cleaner UI display
758
- if (error.startsWith('Text not found in file:')) {
759
- return 'Text not found';
760
- }
761
- if (error.startsWith('Text is not unique:')) {
762
- return 'Text is not unique';
763
- }
764
- if (error.startsWith('No change needed:')) {
765
- return 'No change needed';
766
- }
767
- return error.length > 100 ? truncate(error, 100) : error;
768
- }
769
- if (!result)
770
- return null;
771
- // Use pre-parsed data if available, otherwise parse
772
- let data = parsedResult;
773
- if (data === undefined) {
774
- try {
775
- data = JSON.parse(result);
776
- }
777
- catch {
778
- // Not JSON, use raw result
779
- return result.length > 100 ? truncate(result, 100) : result;
780
- }
781
- }
782
- // Format based on tool name and result structure
783
- const toolLower = name.toLowerCase();
784
- if (typeof data === 'object' && data !== null) {
785
- const obj = data;
786
- // Read tool - show line count
787
- if (toolLower === 'read' || toolLower === 'read_file') {
788
- if ('content' in obj && typeof obj.content === 'string') {
789
- const lines = obj.content.split('\n').length;
790
- return `Read ${lines} lines`;
791
- }
792
- }
793
- // Read multiple files - handled specially in ToolBlock for list output
794
- if (toolLower === 'read_multiple_files') {
795
- return null;
796
- }
797
- // File info - show human-readable size
798
- if (toolLower === 'get_file_info') {
799
- if ('size' in obj && typeof obj.size === 'number') {
800
- const size = obj.size;
801
- if (size < 1024)
802
- return `${size} bytes`;
803
- if (size < 1024 * 1024)
804
- return `${(size / 1024).toFixed(1)} KB`;
805
- return `${(size / (1024 * 1024)).toFixed(1)} MB`;
806
- }
807
- }
808
- // Glob/Find files - show file count
809
- if (toolLower === 'glob' || toolLower === 'list_files' || toolLower === 'find_files') {
810
- if ('files' in obj && Array.isArray(obj.files)) {
811
- const count = typeof obj.totalFound === 'number' ? obj.totalFound : obj.files.length;
812
- const truncatedSuffix = obj.truncated ? '+' : '';
813
- return count === 0 ? 'No files found' : `Found ${count}${truncatedSuffix} file${count === 1 ? '' : 's'}`;
814
- }
815
- }
816
- // List/list_directory - show total count
817
- if (toolLower === 'list' || toolLower === 'list_directory') {
818
- // Use 'total' field if available, otherwise count entries
819
- const total = typeof obj.total === 'number' ? obj.total : (Array.isArray(obj.entries) ? obj.entries.length : 0);
820
- return `found ${total} total`;
821
- }
822
- // Grep/Search - show match count
823
- if (toolLower === 'grep' || toolLower === 'search' || toolLower === 'search_code') {
824
- // Use matchCount for total count (before truncation), fall back to matches.length
825
- if ('matchCount' in obj && typeof obj.matchCount === 'number') {
826
- const count = obj.matchCount;
827
- const truncatedSuffix = obj.truncated ? '+' : '';
828
- return count === 0 ? 'No matches found' : `Found ${count}${truncatedSuffix} match${count === 1 ? '' : 'es'}`;
829
- }
830
- if ('matches' in obj && Array.isArray(obj.matches)) {
831
- const count = obj.matches.length;
832
- return count === 0 ? 'No matches found' : `Found ${count} match${count === 1 ? '' : 'es'}`;
833
- }
834
- if ('count' in obj && typeof obj.count === 'number') {
835
- const count = obj.count;
836
- return count === 0 ? 'No matches found' : `Found ${count} match${count === 1 ? '' : 'es'}`;
837
- }
838
- if ('files' in obj && Array.isArray(obj.files)) {
839
- const count = obj.files.length;
840
- return count === 0 ? 'No files found' : `Found ${count} file${count === 1 ? '' : 's'}`;
841
- }
842
- }
843
- // Bash/Shell - show exit code and output lines
844
- if (toolLower === 'bash' || toolLower === 'shell' || toolLower === 'execute' || toolLower === 'execute_command') {
845
- // Check for timeout first
846
- if (obj.timedOut === true || obj.timed_out === true) {
847
- return '(timeout)';
848
- }
849
- if ('exitCode' in obj || 'exit_code' in obj) {
850
- const code = obj.exitCode ?? obj.exit_code ?? 0;
851
- const stdout = obj.stdout ?? obj.output ?? '';
852
- if (typeof stdout === 'string' && stdout.length > 0) {
853
- const lines = stdout.split('\n').filter(Boolean).length;
854
- return code === 0 ? `Ran successfully (${lines} lines)` : `Exit code ${code}`;
855
- }
856
- return code === 0 ? 'Ran successfully' : `Exit code ${code}`;
857
- }
858
- }
859
- // Edit - handled specially in ToolBlock for colored output
860
- if (toolLower === 'edit' || toolLower === 'edit_file') {
861
- // Return null to let ToolBlock render the colored version
862
- return null;
863
- }
864
- // Write - show success with line count and size
865
- if (toolLower === 'write' || toolLower === 'write_file') {
866
- if ('success' in obj && obj.success === true) {
867
- const lines = typeof obj.lineCount === 'number' ? obj.lineCount : null;
868
- const size = typeof obj.byteSize === 'number' ? obj.byteSize : null;
869
- if (lines !== null && size !== null) {
870
- const sizeStr = size < 1024 ? `${size} B` : `${(size / 1024).toFixed(1)} KB`;
871
- return `Wrote ${lines} lines (${sizeStr})`;
872
- }
873
- if ('path' in obj && typeof obj.path === 'string') {
874
- const filename = obj.path.split(/[/\\]/).pop() || obj.path;
875
- return `Wrote ${filename}`;
876
- }
877
- return 'Done';
878
- }
879
- }
880
- // Delete - show path in result instead of "Done"
881
- if (toolLower === 'delete' || toolLower === 'delete_file') {
882
- if ('success' in obj && obj.success === true && 'path' in obj && typeof obj.path === 'string') {
883
- return makePathRelative(obj.path);
884
- }
885
- }
886
- // Agent/Task tools - show model, tokens, and turns (handle both flat and nested fields)
887
- if (toolLower === 'task' || toolLower === 'spawn_task' || toolLower === 'delegate_task') {
888
- // Check for failure first
889
- if (obj.success === false) {
890
- const errorMsg = typeof obj.error === 'string' ? obj.error : 'Unknown error';
891
- return `Failed: ${truncate(errorMsg, 80)}`;
892
- }
893
- // Background spawn — agent hasn't finished yet, just spawned
894
- const processStatus = typeof obj.status === 'string' ? obj.status : '';
895
- if (processStatus === 'running' || processStatus === 'pending') {
896
- return 'Spawned in background';
897
- }
898
- const usage = (typeof obj.usage === 'object' && obj.usage !== null) ? obj.usage : null;
899
- // Read agentModel with fallback to agentType
900
- const agentModel = typeof obj.agentModel === 'string' ? obj.agentModel
901
- : typeof obj.agentType === 'string' ? obj.agentType
902
- : 'unknown';
903
- // Read tokensUsed from flat fields or nested usage object
904
- const tokensUsed = typeof obj.tokensUsed === 'number' ? obj.tokensUsed
905
- : (usage && typeof usage.tokensUsed === 'number') ? usage.tokensUsed
906
- : 0;
907
- // Build concise completion message
908
- const parts = [`using ${agentModel}`];
909
- if (tokensUsed > 0) {
910
- parts.push(`${formatCompactNumber(tokensUsed)} tokens`);
911
- }
912
- return `Done (${parts.join(', ')})`;
913
- }
914
- // Check for specific error codes first (before generic success/error)
915
- if ('error' in obj && typeof obj.error === 'string') {
916
- if (obj.error === 'FILE_MODIFIED_EXTERNALLY') {
917
- return 'File was modified externally. Please re-read before editing.';
918
- }
919
- // Prefer the human-readable 'message' field if available
920
- if ('message' in obj && typeof obj.message === 'string') {
921
- return truncate(obj.message, 100);
922
- }
923
- return truncate(obj.error, 100);
924
- }
925
- // Generic success/error handling
926
- if ('success' in obj) {
927
- return obj.success ? 'Done' : 'Failed';
928
- }
929
- }
930
- // Fallback: truncate raw result
931
- if (typeof result === 'string' && result.length > 0) {
932
- return truncate(result, 100);
933
- }
934
- return 'Done';
935
- }
936
- /**
937
- * Renders markdown text with terminal formatting
938
- */
939
- const MarkdownText = ({ children, indent = 2 }) => {
940
- const rendered = React.useMemo(() => {
941
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
942
- marked.setOptions({ renderer: createMarkdownRenderer() });
943
- const raw = String(marked.parse(children)).trim();
944
- // Truncate lines that exceed terminal width (e.g. table borders)
945
- const maxWidth = Math.max(20, (process.stdout.columns || 80) - indent - 2);
946
- return raw
947
- .split('\n')
948
- .map(line => cliTruncate(line, maxWidth, { preferTruncationOnSpace: false }))
949
- .join('\n');
950
- }, [children, indent]);
951
- return _jsx(Text, { children: rendered });
952
- };
953
- /**
954
- * Renders a text block with bullet point
955
- * Uses orange bullet for task-progress variant (plan execution transitions)
956
- */
957
- const TextBlock = ({ content, variant = 'default', }) => {
958
- if (!content.trim())
959
- return null;
960
- // Green for task progress, white for default
961
- const bulletColor = variant === 'task-progress' ? 'green' : 'white';
962
- return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsxs(Box, { children: [_jsx(Text, { color: bulletColor, bold: true, children: "\u25CF " }), _jsx(Box, { flexDirection: "column", flexGrow: 1, children: _jsx(MarkdownText, { children: content }) })] }) }));
963
- };
964
- /**
965
- * Extracts file names and line counts from read_multiple_files result
966
- * Returns an array of file info (name + line count) and error info
967
- */
968
- function getReadMultipleFiles(result, parsedResult) {
969
- if (!result && !parsedResult)
970
- return null;
971
- try {
972
- const data = parsedResult ?? JSON.parse(result);
973
- if (typeof data === 'object' && data !== null && 'files' in data && Array.isArray(data.files)) {
974
- const files = [];
975
- const errors = [];
976
- for (const file of data.files) {
977
- if (typeof file === 'object' && file !== null && 'path' in file) {
978
- const path = String(file.path);
979
- // Extract just the filename from the path
980
- const fileName = path.replace(/\\/g, '/').split('/').pop() || path;
981
- if (file.error) {
982
- errors.push(`${fileName}: ${file.error}`);
983
- }
984
- else {
985
- const lineCount = typeof file.content === 'string'
986
- ? file.content.split('\n').length
987
- : 0;
988
- files.push({ name: fileName, lineCount });
989
- }
990
- }
991
- }
992
- return { files, errors };
993
- }
994
- }
995
- catch {
996
- // Not valid JSON
997
- }
998
- return null;
999
- }
1000
- /**
1001
- * Extracts edit statistics from a tool result
1002
- */
1003
- function getEditStats(result, parsedResult) {
1004
- if (!result && !parsedResult)
1005
- return null;
1006
- try {
1007
- const data = parsedResult ?? JSON.parse(result);
1008
- if (typeof data === 'object' && data !== null) {
1009
- const obj = data;
1010
- if ('success' in obj && obj.success === true) {
1011
- const additions = typeof obj.additions === 'number' ? obj.additions : null;
1012
- const deletions = typeof obj.deletions === 'number' ? obj.deletions : null;
1013
- const changes = Array.isArray(obj.changes) ? obj.changes : [];
1014
- return { additions, deletions, changes };
1015
- }
1016
- if ('error' in obj && typeof obj.error === 'string') {
1017
- const friendlyError = obj.error === 'FILE_MODIFIED_EXTERNALLY'
1018
- ? 'File was modified externally. Please re-read before editing.'
1019
- : obj.error;
1020
- return { additions: null, deletions: null, changes: [], error: friendlyError };
1021
- }
1022
- }
1023
- }
1024
- catch {
1025
- // Not JSON
1026
- }
1027
- return null;
1028
- }
1029
- /**
1030
- * Renders edit result with colored additions/deletions
1031
- */
1032
- const EditResultDisplay = ({ additions, deletions }) => {
1033
- const hasAdditions = additions !== null && additions > 0;
1034
- const hasDeletions = deletions !== null && deletions > 0;
1035
- if (!hasAdditions && !hasDeletions) {
1036
- return _jsx(Text, { dimColor: true, children: "No changes" });
1037
- }
1038
- return (_jsxs(_Fragment, { children: [hasAdditions && (_jsxs(Text, { color: "green", children: ["+", additions, " ", additions === 1 ? 'line' : 'lines'] })), hasAdditions && hasDeletions && (_jsx(Text, { dimColor: true, children: ", " })), hasDeletions && (_jsxs(Text, { color: "red", children: ["-", deletions, " ", deletions === 1 ? 'line' : 'lines'] }))] }));
1039
- };
1040
- /**
1041
- * Renders a consolidated read block that combines multiple consecutive reads of the same file.
1042
- * Shows combined timing like (43+62)ms and combined lines like Read (20+40) lines
1043
- */
1044
- const ConsolidatedReadBlockComponent = ({ block }) => {
1045
- const { filePath, durations, lineCounts, status, error } = block;
1046
- // Format the relative file path for display
1047
- const displayPath = makePathRelative(filePath);
1048
- // Format combined duration: sum all durations and display total
1049
- const formatCombinedDuration = () => {
1050
- if (durations.length === 0)
1051
- return '';
1052
- const totalMs = durations.reduce((sum, d) => sum + d, 0);
1053
- return formatDuration(totalMs);
1054
- };
1055
- // Format combined line counts: sum all lines and display total
1056
- const formatCombinedLines = () => {
1057
- if (lineCounts.length === 0)
1058
- return 'Read file';
1059
- const totalLines = lineCounts.reduce((sum, l) => sum + l, 0);
1060
- return `Read ${totalLines} lines`;
1061
- };
1062
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: status === 'error' ? 'red' : 'cyan', children: "\u25CF" }), _jsx(Text, { children: " " }), _jsx(Text, { color: status === 'error' ? 'red' : 'cyan', children: "Read" }), _jsxs(Text, { dimColor: true, children: ["(", displayPath, ")"] }), _jsxs(Text, { dimColor: true, children: [" ", formatCombinedDuration()] })] }), _jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), error ? (_jsx(Text, { color: "red", children: truncate(error, 100) })) : (_jsx(Text, { children: formatCombinedLines() }))] })] }));
1063
- };
1064
- /**
1065
- * Constants for edit diff display
1066
- */
1067
- const EDIT_DIFF_MAX_LINES = 20;
1068
- const EDIT_DIFF_LINE_MAX_CHARS = 120;
1069
- /**
1070
- * Renders a consolidated edit block that combines multiple consecutive edits of the same file.
1071
- * Shows combined timing and combined additions/deletions.
1072
- * Supports Ctrl+O to expand and show the actual diff.
1073
- */
1074
- const ConsolidatedEditBlockComponent = ({ block, expanded = false, isStatic = false }) => {
1075
- const { filePath, durations, additions, deletions, allChanges, status, error } = block;
1076
- // Format the relative file path for display
1077
- const displayPath = makePathRelative(filePath);
1078
- // Format combined duration: sum all durations and display total
1079
- const formatCombinedDuration = () => {
1080
- if (durations.length === 0)
1081
- return '';
1082
- const totalMs = durations.reduce((sum, d) => sum + d, 0);
1083
- return formatDuration(totalMs);
1084
- };
1085
- // Calculate total additions and deletions
1086
- const totalAdditions = additions.reduce((sum, a) => sum + a, 0);
1087
- const totalDeletions = deletions.reduce((sum, d) => sum + d, 0);
1088
- // Collect all diff lines for expanded view
1089
- const diffLines = [];
1090
- if (expanded && allChanges.length > 0) {
1091
- for (const change of allChanges) {
1092
- // Add line range info
1093
- diffLines.push({ type: 'info', content: `@@ Lines ${change.lineStart}-${change.lineEnd} @@` });
1094
- // Add removed lines (before)
1095
- for (const line of change.before) {
1096
- diffLines.push({ type: 'removed', content: line });
1097
- }
1098
- // Add added lines (after)
1099
- for (const line of change.after) {
1100
- diffLines.push({ type: 'added', content: line });
1101
- }
1102
- }
1103
- }
1104
- // Trim diff if too long
1105
- const isTruncated = diffLines.length > EDIT_DIFF_MAX_LINES;
1106
- const displayDiffLines = diffLines.slice(0, EDIT_DIFF_MAX_LINES);
1107
- const hiddenLinesCount = diffLines.length - EDIT_DIFF_MAX_LINES;
1108
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: status === 'error' ? 'red' : 'cyan', children: "\u25CF" }), _jsx(Text, { children: " " }), _jsx(Text, { color: status === 'error' ? 'red' : 'cyan', children: "Edit" }), _jsxs(Text, { dimColor: true, children: ["(", displayPath, ")"] }), _jsxs(Text, { dimColor: true, children: [" ", formatCombinedDuration()] })] }), _jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), error ? (_jsx(Text, { color: "red", children: truncate(error, 100) })) : (_jsx(_Fragment, { children: _jsx(EditResultDisplay, { additions: totalAdditions, deletions: totalDeletions }) }))] }), (expanded || isStatic) && displayDiffLines.length > 0 && (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [displayDiffLines.map((line, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: " " }), line.type === 'info' && (_jsx(Text, { color: "cyan", children: truncate(line.content, EDIT_DIFF_LINE_MAX_CHARS) })), line.type === 'removed' && (_jsxs(Text, { color: "red", children: ["-", truncate(line.content, EDIT_DIFF_LINE_MAX_CHARS - 1)] })), line.type === 'added' && (_jsxs(Text, { color: "green", children: ["+", truncate(line.content, EDIT_DIFF_LINE_MAX_CHARS - 1)] }))] }, i))), isTruncated && (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: " " }), _jsxs(Text, { dimColor: true, children: ["... (", hiddenLinesCount, " more lines)"] })] }))] }))] }));
1109
- };
1110
- /**
1111
- * Renders a consolidated agent block that combines multiple consecutive parallel agent tool calls.
1112
- * Displays a tree-style UI with agent descriptions, tool use counts, and token counts.
1113
- */
1114
- const ConsolidatedAgentBlockComponent = ({ block, expanded = false, isStatic = false }) => {
1115
- const { agents, status } = block;
1116
- // Determine header label: if all agents share the same type, use that; otherwise "agents"
1117
- const allSameType = agents.every(a => a.agentTypeLabel === agents[0].agentTypeLabel);
1118
- const typeLabel = allSameType ? agents[0].agentTypeLabel : '';
1119
- const isInProgress = status === 'generating' || status === 'running';
1120
- const headerText = isInProgress
1121
- ? `Running ${agents.length} ${typeLabel ? typeLabel + ' ' : ''}agent${agents.length === 1 ? '' : 's'}…`
1122
- : `Ran ${agents.length} ${typeLabel ? typeLabel + ' ' : ''}agent${agents.length === 1 ? '' : 's'}`;
1123
- // Status color
1124
- const statusColor = status === 'error' ? 'red'
1125
- : isInProgress ? 'cyan'
1126
- : 'cyan';
1127
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: statusColor, children: isInProgress ? '○' : '●' }), _jsx(Text, { children: " " }), _jsx(Text, { color: statusColor, children: headerText })] }), agents.map((agent, i) => {
1128
- const isLast = i === agents.length - 1;
1129
- const branchChar = isLast ? '└─' : '├─';
1130
- const continueChar = isLast ? ' ' : '│ ';
1131
- // Build metadata string: "· N tool uses · XK tokens"
1132
- const metaParts = [];
1133
- if (agent.toolCallCount !== undefined && agent.toolCallCount > 0) {
1134
- metaParts.push(`${agent.toolCallCount} tool use${agent.toolCallCount === 1 ? '' : 's'}`);
1135
- }
1136
- if (agent.tokensUsed !== undefined && agent.tokensUsed > 0) {
1137
- metaParts.push(`${formatCompactNumber(agent.tokensUsed)} tokens`);
1138
- }
1139
- const metaStr = metaParts.length > 0 ? ' · ' + metaParts.join(' · ') : '';
1140
- // Agent status indicator color
1141
- const agentColor = agent.status === 'error' ? 'red'
1142
- : (agent.status === 'generating' || agent.status === 'running' || agent.status === 'pending') ? 'yellow'
1143
- : undefined;
1144
- return (_jsxs(Box, { flexDirection: "column", marginLeft: 3, children: [_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: [branchChar, " "] }), _jsx(Text, { children: agent.taskDescription || agent.agentTypeLabel }), metaStr && _jsx(Text, { dimColor: true, children: metaStr })] }), agent.resultSummary && !expanded && (_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: [continueChar, " \u23BF "] }), _jsx(Text, { color: agentColor, children: agent.resultSummary })] })), expanded && agent.rawResult && (() => {
1145
- const contentLines = formatAgentResultContent(agent.rawResult, true, isStatic);
1146
- if (contentLines.length === 0) {
1147
- return (_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: [continueChar, " \u23BF "] }), _jsx(Text, { children: agent.resultSummary || 'Done' })] }));
1148
- }
1149
- return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: [continueChar, " \u23BF "] }), _jsx(Text, { children: agent.resultSummary || 'Done' })] }), contentLines.map((line, li) => (_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: [continueChar, " "] }), _jsx(Text, { children: line })] }, li)))] }));
1150
- })(), !agent.resultSummary && (agent.status === 'running' || agent.status === 'pending' || agent.status === 'generating') && (_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: [continueChar, " \u23BF "] }), _jsx(Text, { dimColor: true, children: "Running\u2026" })] }))] }, i));
1151
- })] }));
1152
- };
1153
- /**
1154
- * Renders a tool call block with bullet point and result
1155
- */
1156
- const ToolBlock = ({ tool, isStreaming = true, expandMCPResults = false, isStatic = false }) => {
1157
- const { name, params, status, result, error, duration_ms, parsedResult } = tool;
1158
- const formattedParams = formatParams(params, 100, name);
1159
- const formattedResult = formatToolResult(name, result, error, parsedResult);
1160
- // Check if this is a Plan tool - needs special display format
1161
- const isPlanTool = name.toLowerCase() === 'plan' || name.toLowerCase() === 'enter_plan_mode';
1162
- // Compute display name with special handling for certain tools
1163
- const displayName = (() => {
1164
- const lowerName = name.toLowerCase();
1165
- if (lowerName === 'read_multiple_files') {
1166
- return 'Read';
1167
- }
1168
- // Plan tool - show "Nova entered plan mode"
1169
- if (lowerName === 'plan' || lowerName === 'enter_plan_mode') {
1170
- return 'Nova entered plan mode';
1171
- }
1172
- if (lowerName === 'task' || lowerName === 'spawn_task' || lowerName === 'delegate_task') {
1173
- // Format as "Explore Agent", "Bash Agent", etc. based on agent_type/subagent_type
1174
- const agentType = (params.agent_type || params.subagent_type);
1175
- // Try to extract model from pre-parsed result (avoids JSON.parse in render path)
1176
- let model;
1177
- if (result || parsedResult) {
1178
- try {
1179
- const resultData = parsedResult ?? JSON.parse(result);
1180
- if (typeof resultData === 'object' && resultData !== null && 'agentModel' in resultData) {
1181
- model = String(resultData.agentModel);
1182
- }
1183
- }
1184
- catch {
1185
- // Ignore parse errors
1186
- }
1187
- }
1188
- if (agentType) {
1189
- // Convert kebab-case/snake_case to Title Case
1190
- const formatted = agentType
1191
- .split(/[-_]/)
1192
- .map(word => word.charAt(0).toUpperCase() + word.slice(1))
1193
- .join(' ');
1194
- const modelSuffix = model ? ` (${model})` : '';
1195
- return `${formatted} Agent${modelSuffix}`;
1196
- }
1197
- return 'Task';
1198
- }
1199
- // Execute tools - use description as the display name (no wrapper)
1200
- if (lowerName === 'execute' || lowerName === 'execute_command') {
1201
- const description = params.description;
1202
- if (description) {
1203
- return description.length > 80 ? truncate(description, 80) : description;
1204
- }
1205
- // Fallback to command if no description
1206
- const command = params.command;
1207
- if (command) {
1208
- return command.length > 80 ? truncate(command, 80) : command;
1209
- }
1210
- return getToolRegistry().getDisplayName(name);
1211
- }
1212
- // Handle MCP tools - show clean "Mcp Server Tool" format
1213
- const mcpDisplayName = getMCPDisplayName(name);
1214
- if (mcpDisplayName) {
1215
- return mcpDisplayName;
1216
- }
1217
- return getToolRegistry().getDisplayName(name);
1218
- })();
1219
- // Get plan task summary for special display format
1220
- const planTaskSummary = isPlanTool ? params.task_summary : undefined;
1221
- // Status indicator
1222
- const getStatusIndicator = () => {
1223
- switch (status) {
1224
- case 'generating':
1225
- return isStreaming ? (_jsx(ActivityDot, { color: "cyan" })) : (_jsx(Text, { color: "cyan", children: "\u25CB" }));
1226
- case 'running':
1227
- return isStreaming ? (_jsx(ActivityDot, { color: "cyan" })) : (_jsx(Text, { color: "cyan", children: "\u25CB" }));
1228
- case 'success':
1229
- return _jsx(Text, { color: "cyan", children: "\u25CF" });
1230
- case 'error':
1231
- return _jsx(Text, { color: "red", children: "\u25CF" });
1232
- case 'skipped':
1233
- return _jsx(Text, { color: "yellow", children: "\u25CF" });
1234
- default:
1235
- return _jsx(Text, { dimColor: true, children: "\u25CF" });
1236
- }
1237
- };
1238
- // Tool name color based on status
1239
- const getNameColor = () => {
1240
- switch (status) {
1241
- case 'generating':
1242
- return 'cyan';
1243
- case 'running':
1244
- return 'cyan';
1245
- case 'error':
1246
- return 'red';
1247
- case 'skipped':
1248
- return 'yellow';
1249
- default:
1250
- return 'cyan';
1251
- }
1252
- };
1253
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [getStatusIndicator(), _jsx(Text, { children: " " }), _jsx(Text, { color: getNameColor(), children: displayName }), !isPlanTool && ['spawn_task', 'task', 'delegate_task'].includes(name.toLowerCase()) && (() => {
1254
- const taskText = (params.task || params.prompt);
1255
- if (!taskText)
1256
- return null;
1257
- const singleLine = taskText.replace(/[\r\n]+/g, ' ').trim();
1258
- return _jsxs(Text, { dimColor: true, children: ["(", truncate(singleLine, 120), ")"] });
1259
- })(), !isPlanTool && formattedParams && !['execute', 'execute_command', 'spawn_task', 'task', 'delegate_task'].includes(name.toLowerCase()) && (_jsxs(Text, { dimColor: true, children: ["(", formattedParams, ")"] })), duration_ms !== undefined && status !== 'running' && status !== 'generating' && (_jsxs(Text, { dimColor: true, children: [" ", formatDuration(duration_ms)] }))] }), isPlanTool && planTaskSummary && (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { dimColor: true, children: planTaskSummary })] })), status === 'skipped' && ['bash', 'shell', 'execute', 'execute_command'].includes(name.toLowerCase()) && (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), typeof params.command === 'string' && params.command && (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: truncate(params.command, 80) }), _jsx(Text, { dimColor: true, children: " \u2192 " })] })), _jsx(Text, { color: "yellow", children: "Skipped" })] })), status !== 'running' && status !== 'pending' && status !== 'generating' && status !== 'skipped' && formattedResult && !(status === 'success' && TOOLS_HIDE_RESULT.has(name.toLowerCase())) && !(status === 'success' && TOOLS_COLLAPSE_RESULT.has(name.toLowerCase()) && !expandMCPResults) && !isMCPTool(name) && (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), ['bash', 'shell', 'execute', 'execute_command'].includes(name.toLowerCase()) && typeof params.command === 'string' && params.command ? (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: truncate(params.command, 80) }), _jsx(Text, { dimColor: true, children: " \u2192 " }), _jsx(Text, { color: status === 'error' ? 'red' : undefined, children: formattedResult })] })) : (_jsx(Text, { color: status === 'error' ? 'red' : undefined, children: formattedResult }))] })), (name.toLowerCase() === 'edit' || name.toLowerCase() === 'edit_file') && status !== 'running' && status !== 'pending' && status !== 'generating' && (() => {
1260
- const editStats = getEditStats(result, parsedResult);
1261
- if (editStats?.error) {
1262
- return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { color: "red", children: truncate(editStats.error, 100) })] }));
1263
- }
1264
- if (editStats) {
1265
- // Build diff lines for expanded view
1266
- const diffLines = [];
1267
- if (expandMCPResults && editStats.changes.length > 0) {
1268
- for (const change of editStats.changes) {
1269
- diffLines.push({ type: 'info', content: `@@ Lines ${change.lineStart}-${change.lineEnd} @@` });
1270
- for (const line of change.before) {
1271
- diffLines.push({ type: 'removed', content: line });
1272
- }
1273
- for (const line of change.after) {
1274
- diffLines.push({ type: 'added', content: line });
1275
- }
1276
- }
1277
- }
1278
- const isTruncated = diffLines.length > EDIT_DIFF_MAX_LINES;
1279
- const displayDiffLines = diffLines.slice(0, EDIT_DIFF_MAX_LINES);
1280
- const hiddenLinesCount = diffLines.length - EDIT_DIFF_MAX_LINES;
1281
- return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(EditResultDisplay, { additions: editStats.additions, deletions: editStats.deletions })] }), (expandMCPResults || isStatic) && displayDiffLines.length > 0 && (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [displayDiffLines.map((line, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: " " }), line.type === 'info' && (_jsx(Text, { color: "cyan", children: truncate(line.content, EDIT_DIFF_LINE_MAX_CHARS) })), line.type === 'removed' && (_jsxs(Text, { color: "red", children: ["-", truncate(line.content, EDIT_DIFF_LINE_MAX_CHARS - 1)] })), line.type === 'added' && (_jsxs(Text, { color: "green", children: ["+", truncate(line.content, EDIT_DIFF_LINE_MAX_CHARS - 1)] }))] }, i))), isTruncated && (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: " " }), _jsxs(Text, { dimColor: true, children: ["... (", hiddenLinesCount, " more lines)"] })] }))] }))] }));
1282
- }
1283
- return null;
1284
- })(), name.toLowerCase() === 'read_multiple_files' && status !== 'running' && status !== 'pending' && status !== 'generating' && (() => {
1285
- const fileData = getReadMultipleFiles(result, parsedResult);
1286
- if (fileData) {
1287
- // Only show file list when expanded, but always show errors
1288
- const showFileList = expandMCPResults || status !== 'success';
1289
- const maxFilesToShow = 5;
1290
- const filesToShow = fileData.files.slice(0, maxFilesToShow);
1291
- const remainingCount = fileData.files.length - maxFilesToShow;
1292
- // If collapsed and no errors, show nothing
1293
- if (!showFileList && fileData.errors.length === 0) {
1294
- return null;
1295
- }
1296
- return (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [showFileList && filesToShow.map((file, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { children: file.name }), _jsxs(Text, { dimColor: true, children: [" (", file.lineCount, " lines)"] })] }, i))), showFileList && remainingCount > 0 && (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsxs(Text, { dimColor: true, children: ["...and ", remainingCount, " more"] })] })), fileData.errors.map((err, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { color: "red", children: err })] }, `err-${i}`)))] }));
1297
- }
1298
- return null;
1299
- })(), isMCPTool(name) && status !== 'running' && status !== 'pending' && status !== 'generating' && (() => {
1300
- // Handle errors
1301
- if (error) {
1302
- return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { color: "red", children: truncate(error, MCP_RESULT_LINE_MAX_CHARS) })] }));
1303
- }
1304
- // Handle successful results with multi-line display
1305
- if (result) {
1306
- const lines = formatMCPResultLines(result, expandMCPResults);
1307
- if (lines.length === 0) {
1308
- return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { children: "Done" })] }));
1309
- }
1310
- return (_jsx(Box, { flexDirection: "column", marginLeft: 2, children: lines.map((line, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: i === 0 ? '⎿ ' : ' ' }), _jsx(Text, { color: status === 'error' ? 'red' : undefined, children: line })] }, i))) }));
1311
- }
1312
- return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { children: "Done" })] }));
1313
- })(), isAgentTool(name) && status !== 'running' && status !== 'pending' && status !== 'generating' && (() => {
1314
- // Handle errors
1315
- if (error) {
1316
- return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { color: "red", children: truncate(error, MCP_RESULT_LINE_MAX_CHARS) })] }));
1317
- }
1318
- // Handle successful results with multi-line display
1319
- if (result) {
1320
- const contentLines = formatAgentResultContent(result, expandMCPResults, isStatic, parsedResult);
1321
- if (contentLines.length === 0) {
1322
- // No content to display, show formatted result summary instead
1323
- return formattedResult ? (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { children: formattedResult })] })) : (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { children: "Done" })] }));
1324
- }
1325
- // Show content with expand hint
1326
- const shouldShowHint = false; // Ctrl+O no longer functional
1327
- return (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), formattedResult && _jsx(Text, { children: formattedResult })] }), contentLines.map((line, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: " " }), _jsx(Text, { color: status === 'error' ? 'red' : undefined, children: line })] }, i))), shouldShowHint && (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: " " }), _jsx(Text, { dimColor: true, children: "(Ctrl+O to expand)" })] }))] }));
1328
- }
1329
- return (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { children: "Done" })] }));
1330
- })(), status === 'generating' && (_jsxs(Box, { marginLeft: 2, children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { color: "cyan", children: getGeneratingProgress(name, params) })] })), status === 'running' && (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [tool.complexityReasoning && (() => {
1331
- const indent = 5; // " ⎿ " = marginLeft(2) + "⎿ "(3)
1332
- const availableWidth = Math.max(40, (process.stdout.columns || 80) - indent);
1333
- const wrappedLines = wordWrap(tool.complexityReasoning, availableWidth);
1334
- return (_jsx(Box, { flexDirection: "column", children: wrappedLines.map((line, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: i === 0 ? '⎿ ' : ' ' }), _jsx(Text, { color: "magenta", children: line })] }, i))) }));
1335
- })(), ['bash', 'shell', 'execute', 'execute_command'].includes(name.toLowerCase()) && typeof params.command === 'string' && (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "\u23BF " }), _jsx(Text, { children: truncate(params.command, 80) })] })), (tool.statusMessage || 'Executing...').split('\n').map((line, i) => (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: ' ' }), _jsx(Text, { dimColor: true, children: line })] }, i))), name.toLowerCase() === 'execute_command' && (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: ' ' }), _jsx(Text, { dimColor: true, children: "Ctrl+X to skip" })] }))] }))] }));
1336
- };
1337
- /**
1338
- * Formats duration in ms to human readable
1339
- */
1340
- function formatDuration(ms) {
1341
- if (ms < 1000)
1342
- return `${ms}ms`;
1343
- if (ms < 60000)
1344
- return `${(ms / 1000).toFixed(1)}s`;
1345
- return `${Math.floor(ms / 60000)}m ${Math.floor((ms % 60000) / 1000)}s`;
1346
- }
1347
- /**
1348
- * Tools that should be hidden from UI display (internal/progress tools)
1349
- */
1350
- const HIDDEN_TOOLS = new Set(['complete_plan_task']);
1351
- /**
1352
- * Constants for MCP result display
1353
- */
1354
- const MCP_RESULT_MAX_LINES = 5;
1355
- const MCP_RESULT_LINE_MAX_CHARS = 100;
1356
- /**
1357
- * Formats MCP tool result into multiple lines for display.
1358
- * Returns an array of lines, truncated to max lines unless expanded.
1359
- */
1360
- function formatMCPResultLines(result, expanded = false) {
1361
- if (!result)
1362
- return [];
1363
- // Clean up the result - remove excessive whitespace and normalize
1364
- const cleaned = result
1365
- .replace(/\\n/g, '\n') // Handle escaped newlines
1366
- .replace(/\r\n/g, '\n') // Normalize line endings
1367
- .trim();
1368
- // Split into lines and filter empty ones
1369
- const lines = cleaned.split('\n').filter(line => line.trim().length > 0);
1370
- if (lines.length === 0) {
1371
- return [truncate(cleaned, MCP_RESULT_LINE_MAX_CHARS)];
1372
- }
1373
- // When expanded, show all lines; otherwise limit to max
1374
- const maxLines = expanded ? lines.length : MCP_RESULT_MAX_LINES;
1375
- const displayLines = lines.slice(0, maxLines);
1376
- // Truncate each line (even when expanded, keep lines readable)
1377
- const maxChars = expanded ? 500 : MCP_RESULT_LINE_MAX_CHARS;
1378
- const truncatedLines = displayLines.map(line => truncate(line.trim(), maxChars));
1379
- // Add indicator if there are more lines (only when not expanded)
1380
- if (!expanded && lines.length > maxLines) {
1381
- truncatedLines.push(`... (${lines.length - maxLines} more lines)`);
1382
- }
1383
- return truncatedLines;
1384
- }
1385
- /**
1386
- * Checks if a tool is an MCP tool.
1387
- */
1388
- function isMCPTool(toolName) {
1389
- return toolName.toLowerCase().startsWith('mcp_');
1390
- }
1391
- /**
1392
- * Checks if a tool is an agent/task tool.
1393
- */
1394
- function isAgentTool(toolName) {
1395
- const lowerName = toolName.toLowerCase();
1396
- return lowerName === 'task' || lowerName === 'spawn_task' || lowerName === 'delegate_task';
1397
- }
1398
- /**
1399
- * Formats agent tool result content for multi-line display.
1400
- * Extracts the 'content' or 'response' field from the result JSON.
1401
- */
1402
- function formatAgentResultContent(result, expanded = false, _isStatic = false, parsedResult) {
1403
- try {
1404
- const resultData = parsedResult ?? JSON.parse(result);
1405
- if (typeof resultData === 'object' && resultData !== null) {
1406
- // Extract content from either 'content' or 'response' field
1407
- const content = (resultData.content || resultData.response || '');
1408
- if (typeof content === 'string' && content.length > 0) {
1409
- // Use same formatting as MCP tools
1410
- return formatMCPResultLines(content, expanded);
1411
- }
1412
- }
1413
- }
1414
- catch {
1415
- // If parsing fails, return empty array
1416
- }
1417
- return [];
1418
- }
1419
- /**
1420
- * InterleavedStream renders a sequence of text and tool blocks
1421
- * in Claude Code CLI style format.
1422
- * Memoized to prevent unnecessary re-renders during modal displays.
1423
- */
1424
- const InterleavedStreamComponent = ({ blocks, isStreaming, showThinkingIndicator = true, expandMCPResults = false, isStatic = false, maxVisibleBlocks, }) => {
1425
- // Memoize visible blocks filtering to avoid recalculation on every render
1426
- const visibleBlocks = React.useMemo(() => blocks.filter((block) => block.type !== 'tool' || !HIDDEN_TOOLS.has(block.name)), [blocks]);
1427
- // Consolidate consecutive read/edit/agent blocks into compact display blocks.
1428
- // Only depends on visibleBlocks — removed isStreaming dependency to avoid
1429
- // re-running O(n) consolidation passes on every throttled render tick (~10fps).
1430
- const displayBlocks = React.useMemo(() => {
1431
- const readConsolidated = consolidateReadBlocks(visibleBlocks);
1432
- const editConsolidated = consolidateEditBlocks(readConsolidated);
1433
- return consolidateAgentBlocks(editConsolidated);
1434
- }, [visibleBlocks]);
1435
- // Truncate to last N blocks while streaming to keep the dynamic area small.
1436
- // When not streaming, render everything so the full history is visible.
1437
- const hiddenCount = (isStreaming && maxVisibleBlocks !== undefined && displayBlocks.length > maxVisibleBlocks)
1438
- ? displayBlocks.length - maxVisibleBlocks
1439
- : 0;
1440
- const renderedBlocks = hiddenCount > 0
1441
- ? displayBlocks.slice(-maxVisibleBlocks)
1442
- : displayBlocks;
1443
- // Thinking indicator when no blocks yet
1444
- if (displayBlocks.length === 0 && isStreaming && showThinkingIndicator) {
1445
- return (_jsxs(Box, { children: [_jsx(ActivityDot, { color: "cyan" }), _jsx(Text, { dimColor: true, children: " Thinking..." })] }));
1446
- }
1447
- // Nothing to render
1448
- if (displayBlocks.length === 0) {
1449
- return null;
1450
- }
1451
- // Detect task transitions: text blocks that follow tool blocks
1452
- // These are typically brief progress messages during plan execution
1453
- const getTextVariant = (index, block) => {
1454
- // Explicit variant takes precedence
1455
- if (block.variant)
1456
- return block.variant;
1457
- // Heuristic: if this text block follows a tool/consolidated block and is short,
1458
- // it's likely a task transition message
1459
- if (index > 0) {
1460
- // Map renderedBlocks index back to displayBlocks index for prev-block lookup
1461
- const displayIndex = index + hiddenCount;
1462
- const prevBlock = displayBlocks[displayIndex - 1];
1463
- const isShort = block.content.length < 200 && !block.content.includes('```');
1464
- const isPrevToolSuccess = (prevBlock.type === 'tool' && prevBlock.status === 'success') ||
1465
- (prevBlock.type === 'consolidated_read' && prevBlock.status === 'success') ||
1466
- (prevBlock.type === 'consolidated_edit' && prevBlock.status === 'success') ||
1467
- (prevBlock.type === 'consolidated_agent' && prevBlock.status === 'success');
1468
- if (isPrevToolSuccess && isShort) {
1469
- return 'task-progress';
1470
- }
1471
- }
1472
- return 'default';
1473
- };
1474
- return (_jsxs(Box, { flexDirection: "column", children: [hiddenCount > 0 && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { dimColor: true, children: [" \u2191 ", hiddenCount, " block", hiddenCount === 1 ? '' : 's', " above"] }) })), renderedBlocks.map((block, index) => {
1475
- const isLast = index === renderedBlocks.length - 1;
1476
- if (block.type === 'text') {
1477
- return (_jsx(TextBlock, { content: block.content, isLast: isLast, isStreaming: isStreaming, variant: getTextVariant(index, block) }, `text-${index}`));
1478
- }
1479
- if (block.type === 'consolidated_read') {
1480
- // Use first original block's ID for stable key to prevent flicker during consolidation
1481
- const stableKey = block.originalBlocks[0]?.id || `consolidated-read-${index}`;
1482
- return _jsx(ConsolidatedReadBlockComponent, { block: block }, stableKey);
1483
- }
1484
- if (block.type === 'consolidated_edit') {
1485
- // Use first original block's ID for stable key to prevent flicker during consolidation
1486
- const stableKey = block.originalBlocks[0]?.id || `consolidated-edit-${index}`;
1487
- return _jsx(ConsolidatedEditBlockComponent, { block: block, expanded: expandMCPResults, isStatic: isStatic }, stableKey);
1488
- }
1489
- if (block.type === 'consolidated_agent') {
1490
- const stableKey = block.originalBlocks[0]?.id || `consolidated-agent-${index}`;
1491
- return _jsx(ConsolidatedAgentBlockComponent, { block: block, expanded: expandMCPResults, isStatic: isStatic }, stableKey);
1492
- }
1493
- return _jsx(ToolBlock, { tool: block, isStreaming: isStreaming, expandMCPResults: expandMCPResults, isStatic: isStatic }, block.id || `tool-${index}`);
1494
- })] }));
1495
- };
1496
- // Memoized to prevent unnecessary re-renders when props haven't changed.
1497
- // Parent triggers re-renders via forceRender counter rather than array reference changes.
1498
- export const InterleavedStream = React.memo(InterleavedStreamComponent);
1499
- export default InterleavedStream;
1500
- //# sourceMappingURL=InterleavedStream.js.map