orquesta-cli 0.1.12 → 0.1.14

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 (540) hide show
  1. package/README.md +30 -4
  2. package/dist/cli.js +65 -4
  3. package/dist/constants.js +1 -1
  4. package/dist/core/config/config-manager.d.ts +13 -1
  5. package/dist/core/config/config-manager.js +83 -0
  6. package/dist/core/slash-command-handler.d.ts +1 -0
  7. package/dist/core/slash-command-handler.js +129 -0
  8. package/dist/orquesta/config-sync.d.ts +73 -0
  9. package/dist/orquesta/config-sync.js +230 -0
  10. package/dist/orquesta/prompt-reporter.d.ts +16 -0
  11. package/dist/orquesta/prompt-reporter.js +85 -0
  12. package/dist/setup/first-run-setup.d.ts +15 -0
  13. package/dist/setup/first-run-setup.js +238 -0
  14. package/dist/types/index.d.ts +11 -2
  15. package/dist/ui/TodoPanel.d.ts +1 -0
  16. package/dist/ui/TodoPanel.js +6 -1
  17. package/dist/ui/components/LLMSetupWizard.js +373 -7
  18. package/dist/ui/components/Logo.d.ts +2 -0
  19. package/dist/ui/components/Logo.js +10 -3
  20. package/dist/ui/components/OpenRouterModelBrowser.d.ts +13 -0
  21. package/dist/ui/components/OpenRouterModelBrowser.js +221 -0
  22. package/dist/ui/components/PlanExecuteApp.js +30 -4
  23. package/dist/ui/components/ProjectSelector.d.ts +8 -0
  24. package/dist/ui/components/ProjectSelector.js +119 -0
  25. package/dist/ui/components/StatusBar.d.ts +2 -0
  26. package/dist/ui/components/StatusBar.js +6 -1
  27. package/dist/ui/hooks/slashCommandProcessor.js +8 -4
  28. package/package.json +11 -5
  29. package/.eslintrc.json +0 -26
  30. package/.prettierrc.json +0 -10
  31. package/CLAUDE.md +0 -199
  32. package/SECURITY.md +0 -290
  33. package/TEST_LOCAL.md +0 -245
  34. package/dist/agents/base/base-agent.d.ts.map +0 -1
  35. package/dist/agents/base/base-agent.js.map +0 -1
  36. package/dist/agents/docs-search/index.d.ts.map +0 -1
  37. package/dist/agents/docs-search/index.js.map +0 -1
  38. package/dist/agents/index.d.ts.map +0 -1
  39. package/dist/agents/index.js.map +0 -1
  40. package/dist/agents/planner/index.d.ts.map +0 -1
  41. package/dist/agents/planner/index.js.map +0 -1
  42. package/dist/cli.d.ts.map +0 -1
  43. package/dist/cli.js.map +0 -1
  44. package/dist/constants.d.ts.map +0 -1
  45. package/dist/constants.js.map +0 -1
  46. package/dist/core/compact/compact-manager.d.ts.map +0 -1
  47. package/dist/core/compact/compact-manager.js.map +0 -1
  48. package/dist/core/compact/compact-prompts.d.ts.map +0 -1
  49. package/dist/core/compact/compact-prompts.js.map +0 -1
  50. package/dist/core/compact/context-tracker.d.ts.map +0 -1
  51. package/dist/core/compact/context-tracker.js.map +0 -1
  52. package/dist/core/compact/index.d.ts.map +0 -1
  53. package/dist/core/compact/index.js.map +0 -1
  54. package/dist/core/config/config-manager.d.ts.map +0 -1
  55. package/dist/core/config/config-manager.js.map +0 -1
  56. package/dist/core/config/index.d.ts.map +0 -1
  57. package/dist/core/config/index.js.map +0 -1
  58. package/dist/core/docs-manager.d.ts.map +0 -1
  59. package/dist/core/docs-manager.js.map +0 -1
  60. package/dist/core/git-auto-updater.d.ts.map +0 -1
  61. package/dist/core/git-auto-updater.js.map +0 -1
  62. package/dist/core/llm/index.d.ts.map +0 -1
  63. package/dist/core/llm/index.js.map +0 -1
  64. package/dist/core/llm/llm-client.d.ts.map +0 -1
  65. package/dist/core/llm/llm-client.js.map +0 -1
  66. package/dist/core/session/index.d.ts.map +0 -1
  67. package/dist/core/session/index.js.map +0 -1
  68. package/dist/core/session/session-manager.d.ts.map +0 -1
  69. package/dist/core/session/session-manager.js.map +0 -1
  70. package/dist/core/slash-command-handler.d.ts.map +0 -1
  71. package/dist/core/slash-command-handler.js.map +0 -1
  72. package/dist/core/usage-tracker.d.ts.map +0 -1
  73. package/dist/core/usage-tracker.js.map +0 -1
  74. package/dist/errors/base.d.ts.map +0 -1
  75. package/dist/errors/base.js.map +0 -1
  76. package/dist/errors/file.d.ts.map +0 -1
  77. package/dist/errors/file.js.map +0 -1
  78. package/dist/errors/index.d.ts.map +0 -1
  79. package/dist/errors/index.js.map +0 -1
  80. package/dist/errors/llm.d.ts.map +0 -1
  81. package/dist/errors/llm.js.map +0 -1
  82. package/dist/errors/network.d.ts.map +0 -1
  83. package/dist/errors/network.js.map +0 -1
  84. package/dist/errors/validation.d.ts.map +0 -1
  85. package/dist/errors/validation.js.map +0 -1
  86. package/dist/eval/eval-runner.d.ts.map +0 -1
  87. package/dist/eval/eval-runner.js.map +0 -1
  88. package/dist/eval/index.d.ts.map +0 -1
  89. package/dist/eval/index.js.map +0 -1
  90. package/dist/eval/types.d.ts.map +0 -1
  91. package/dist/eval/types.js.map +0 -1
  92. package/dist/index.d.ts.map +0 -1
  93. package/dist/index.js.map +0 -1
  94. package/dist/orchestration/index.d.ts.map +0 -1
  95. package/dist/orchestration/index.js.map +0 -1
  96. package/dist/orchestration/plan-executor.d.ts.map +0 -1
  97. package/dist/orchestration/plan-executor.js.map +0 -1
  98. package/dist/orchestration/types.d.ts.map +0 -1
  99. package/dist/orchestration/types.js.map +0 -1
  100. package/dist/orchestration/utils.d.ts.map +0 -1
  101. package/dist/orchestration/utils.js.map +0 -1
  102. package/dist/orquesta/connection.d.ts.map +0 -1
  103. package/dist/orquesta/connection.js.map +0 -1
  104. package/dist/prompts/agents/docs-search-decision.d.ts.map +0 -1
  105. package/dist/prompts/agents/docs-search-decision.js.map +0 -1
  106. package/dist/prompts/agents/docs-search.d.ts.map +0 -1
  107. package/dist/prompts/agents/docs-search.js.map +0 -1
  108. package/dist/prompts/agents/planning.d.ts.map +0 -1
  109. package/dist/prompts/agents/planning.js.map +0 -1
  110. package/dist/prompts/index.d.ts.map +0 -1
  111. package/dist/prompts/index.js.map +0 -1
  112. package/dist/prompts/shared/codebase-rules.d.ts.map +0 -1
  113. package/dist/prompts/shared/codebase-rules.js.map +0 -1
  114. package/dist/prompts/shared/git-rules.d.ts.map +0 -1
  115. package/dist/prompts/shared/git-rules.js.map +0 -1
  116. package/dist/prompts/shared/language-rules.d.ts.map +0 -1
  117. package/dist/prompts/shared/language-rules.js.map +0 -1
  118. package/dist/prompts/shared/tool-usage.d.ts.map +0 -1
  119. package/dist/prompts/shared/tool-usage.js.map +0 -1
  120. package/dist/prompts/system/compact.d.ts.map +0 -1
  121. package/dist/prompts/system/compact.js.map +0 -1
  122. package/dist/prompts/system/plan-execute.d.ts.map +0 -1
  123. package/dist/prompts/system/plan-execute.js.map +0 -1
  124. package/dist/tools/browser/browser-client.d.ts.map +0 -1
  125. package/dist/tools/browser/browser-client.js.map +0 -1
  126. package/dist/tools/browser/browser-tools.d.ts.map +0 -1
  127. package/dist/tools/browser/browser-tools.js.map +0 -1
  128. package/dist/tools/browser/index.d.ts.map +0 -1
  129. package/dist/tools/browser/index.js.map +0 -1
  130. package/dist/tools/index.d.ts.map +0 -1
  131. package/dist/tools/index.js.map +0 -1
  132. package/dist/tools/llm/agents/docs-search-tools.d.ts.map +0 -1
  133. package/dist/tools/llm/agents/docs-search-tools.js.map +0 -1
  134. package/dist/tools/llm/agents/index.d.ts.map +0 -1
  135. package/dist/tools/llm/agents/index.js.map +0 -1
  136. package/dist/tools/llm/index.d.ts.map +0 -1
  137. package/dist/tools/llm/index.js.map +0 -1
  138. package/dist/tools/llm/simple/ask-user-tool.d.ts.map +0 -1
  139. package/dist/tools/llm/simple/ask-user-tool.js.map +0 -1
  140. package/dist/tools/llm/simple/background-bash-tool.d.ts.map +0 -1
  141. package/dist/tools/llm/simple/background-bash-tool.js.map +0 -1
  142. package/dist/tools/llm/simple/background-powershell-tool.d.ts.map +0 -1
  143. package/dist/tools/llm/simple/background-powershell-tool.js.map +0 -1
  144. package/dist/tools/llm/simple/bash-tool.d.ts.map +0 -1
  145. package/dist/tools/llm/simple/bash-tool.js.map +0 -1
  146. package/dist/tools/llm/simple/docs-search-agent-tool.d.ts.map +0 -1
  147. package/dist/tools/llm/simple/docs-search-agent-tool.js.map +0 -1
  148. package/dist/tools/llm/simple/file-tools.d.ts.map +0 -1
  149. package/dist/tools/llm/simple/file-tools.js.map +0 -1
  150. package/dist/tools/llm/simple/final-response-tool.d.ts.map +0 -1
  151. package/dist/tools/llm/simple/final-response-tool.js.map +0 -1
  152. package/dist/tools/llm/simple/index.d.ts.map +0 -1
  153. package/dist/tools/llm/simple/index.js.map +0 -1
  154. package/dist/tools/llm/simple/planning-tools.d.ts.map +0 -1
  155. package/dist/tools/llm/simple/planning-tools.js.map +0 -1
  156. package/dist/tools/llm/simple/powershell-tool.d.ts.map +0 -1
  157. package/dist/tools/llm/simple/powershell-tool.js.map +0 -1
  158. package/dist/tools/llm/simple/simple-tool-executor.d.ts.map +0 -1
  159. package/dist/tools/llm/simple/simple-tool-executor.js.map +0 -1
  160. package/dist/tools/llm/simple/todo-tools.d.ts.map +0 -1
  161. package/dist/tools/llm/simple/todo-tools.js.map +0 -1
  162. package/dist/tools/llm/simple/user-interaction-tools.d.ts.map +0 -1
  163. package/dist/tools/llm/simple/user-interaction-tools.js.map +0 -1
  164. package/dist/tools/office/common/constants.d.ts.map +0 -1
  165. package/dist/tools/office/common/constants.js.map +0 -1
  166. package/dist/tools/office/common/index.d.ts.map +0 -1
  167. package/dist/tools/office/common/index.js.map +0 -1
  168. package/dist/tools/office/common/types.d.ts.map +0 -1
  169. package/dist/tools/office/common/types.js.map +0 -1
  170. package/dist/tools/office/common/utils.d.ts.map +0 -1
  171. package/dist/tools/office/common/utils.js.map +0 -1
  172. package/dist/tools/office/excel-client.d.ts.map +0 -1
  173. package/dist/tools/office/excel-client.js.map +0 -1
  174. package/dist/tools/office/excel-tools/cells.d.ts.map +0 -1
  175. package/dist/tools/office/excel-tools/cells.js.map +0 -1
  176. package/dist/tools/office/excel-tools/charts.d.ts.map +0 -1
  177. package/dist/tools/office/excel-tools/charts.js.map +0 -1
  178. package/dist/tools/office/excel-tools/comments.d.ts.map +0 -1
  179. package/dist/tools/office/excel-tools/comments.js.map +0 -1
  180. package/dist/tools/office/excel-tools/data-ops.d.ts.map +0 -1
  181. package/dist/tools/office/excel-tools/data-ops.js.map +0 -1
  182. package/dist/tools/office/excel-tools/export.d.ts.map +0 -1
  183. package/dist/tools/office/excel-tools/export.js.map +0 -1
  184. package/dist/tools/office/excel-tools/formatting.d.ts.map +0 -1
  185. package/dist/tools/office/excel-tools/formatting.js.map +0 -1
  186. package/dist/tools/office/excel-tools/index.d.ts.map +0 -1
  187. package/dist/tools/office/excel-tools/index.js.map +0 -1
  188. package/dist/tools/office/excel-tools/launch.d.ts.map +0 -1
  189. package/dist/tools/office/excel-tools/launch.js.map +0 -1
  190. package/dist/tools/office/excel-tools/media.d.ts.map +0 -1
  191. package/dist/tools/office/excel-tools/media.js.map +0 -1
  192. package/dist/tools/office/excel-tools/named-ranges.d.ts.map +0 -1
  193. package/dist/tools/office/excel-tools/named-ranges.js.map +0 -1
  194. package/dist/tools/office/excel-tools/protection.d.ts.map +0 -1
  195. package/dist/tools/office/excel-tools/protection.js.map +0 -1
  196. package/dist/tools/office/excel-tools/rows-columns.d.ts.map +0 -1
  197. package/dist/tools/office/excel-tools/rows-columns.js.map +0 -1
  198. package/dist/tools/office/excel-tools/sheets.d.ts.map +0 -1
  199. package/dist/tools/office/excel-tools/sheets.js.map +0 -1
  200. package/dist/tools/office/excel-tools/validation.d.ts.map +0 -1
  201. package/dist/tools/office/excel-tools/validation.js.map +0 -1
  202. package/dist/tools/office/excel-tools.d.ts.map +0 -1
  203. package/dist/tools/office/excel-tools.js.map +0 -1
  204. package/dist/tools/office/index.d.ts.map +0 -1
  205. package/dist/tools/office/index.js.map +0 -1
  206. package/dist/tools/office/office-client-base.d.ts.map +0 -1
  207. package/dist/tools/office/office-client-base.js.map +0 -1
  208. package/dist/tools/office/office-client.d.ts.map +0 -1
  209. package/dist/tools/office/office-client.js.map +0 -1
  210. package/dist/tools/office/powerpoint-client.d.ts.map +0 -1
  211. package/dist/tools/office/powerpoint-client.js.map +0 -1
  212. package/dist/tools/office/powerpoint-tools/effects.d.ts.map +0 -1
  213. package/dist/tools/office/powerpoint-tools/effects.js.map +0 -1
  214. package/dist/tools/office/powerpoint-tools/export.d.ts.map +0 -1
  215. package/dist/tools/office/powerpoint-tools/export.js.map +0 -1
  216. package/dist/tools/office/powerpoint-tools/index.d.ts.map +0 -1
  217. package/dist/tools/office/powerpoint-tools/index.js.map +0 -1
  218. package/dist/tools/office/powerpoint-tools/launch.d.ts.map +0 -1
  219. package/dist/tools/office/powerpoint-tools/launch.js.map +0 -1
  220. package/dist/tools/office/powerpoint-tools/media.d.ts.map +0 -1
  221. package/dist/tools/office/powerpoint-tools/media.js.map +0 -1
  222. package/dist/tools/office/powerpoint-tools/notes.d.ts.map +0 -1
  223. package/dist/tools/office/powerpoint-tools/notes.js.map +0 -1
  224. package/dist/tools/office/powerpoint-tools/sections.d.ts.map +0 -1
  225. package/dist/tools/office/powerpoint-tools/sections.js.map +0 -1
  226. package/dist/tools/office/powerpoint-tools/shapes.d.ts.map +0 -1
  227. package/dist/tools/office/powerpoint-tools/shapes.js.map +0 -1
  228. package/dist/tools/office/powerpoint-tools/slides.d.ts.map +0 -1
  229. package/dist/tools/office/powerpoint-tools/slides.js.map +0 -1
  230. package/dist/tools/office/powerpoint-tools/tables.d.ts.map +0 -1
  231. package/dist/tools/office/powerpoint-tools/tables.js.map +0 -1
  232. package/dist/tools/office/powerpoint-tools/text.d.ts.map +0 -1
  233. package/dist/tools/office/powerpoint-tools/text.js.map +0 -1
  234. package/dist/tools/office/powerpoint-tools.d.ts.map +0 -1
  235. package/dist/tools/office/powerpoint-tools.js.map +0 -1
  236. package/dist/tools/office/word-client.d.ts.map +0 -1
  237. package/dist/tools/office/word-client.js.map +0 -1
  238. package/dist/tools/office/word-tools/bookmarks.d.ts.map +0 -1
  239. package/dist/tools/office/word-tools/bookmarks.js.map +0 -1
  240. package/dist/tools/office/word-tools/comments.d.ts.map +0 -1
  241. package/dist/tools/office/word-tools/comments.js.map +0 -1
  242. package/dist/tools/office/word-tools/content.d.ts.map +0 -1
  243. package/dist/tools/office/word-tools/content.js.map +0 -1
  244. package/dist/tools/office/word-tools/export.d.ts.map +0 -1
  245. package/dist/tools/office/word-tools/export.js.map +0 -1
  246. package/dist/tools/office/word-tools/formatting.d.ts.map +0 -1
  247. package/dist/tools/office/word-tools/formatting.js.map +0 -1
  248. package/dist/tools/office/word-tools/headers-footers.d.ts.map +0 -1
  249. package/dist/tools/office/word-tools/headers-footers.js.map +0 -1
  250. package/dist/tools/office/word-tools/index.d.ts.map +0 -1
  251. package/dist/tools/office/word-tools/index.js.map +0 -1
  252. package/dist/tools/office/word-tools/launch.d.ts.map +0 -1
  253. package/dist/tools/office/word-tools/launch.js.map +0 -1
  254. package/dist/tools/office/word-tools/lists.d.ts.map +0 -1
  255. package/dist/tools/office/word-tools/lists.js.map +0 -1
  256. package/dist/tools/office/word-tools/navigation.d.ts.map +0 -1
  257. package/dist/tools/office/word-tools/navigation.js.map +0 -1
  258. package/dist/tools/office/word-tools/page-setup.d.ts.map +0 -1
  259. package/dist/tools/office/word-tools/page-setup.js.map +0 -1
  260. package/dist/tools/office/word-tools/tables.d.ts.map +0 -1
  261. package/dist/tools/office/word-tools/tables.js.map +0 -1
  262. package/dist/tools/office/word-tools/text.d.ts.map +0 -1
  263. package/dist/tools/office/word-tools/text.js.map +0 -1
  264. package/dist/tools/office/word-tools/undo-redo.d.ts.map +0 -1
  265. package/dist/tools/office/word-tools/undo-redo.js.map +0 -1
  266. package/dist/tools/office/word-tools/watermarks.d.ts.map +0 -1
  267. package/dist/tools/office/word-tools/watermarks.js.map +0 -1
  268. package/dist/tools/office/word-tools.d.ts.map +0 -1
  269. package/dist/tools/office/word-tools.js.map +0 -1
  270. package/dist/tools/registry.d.ts.map +0 -1
  271. package/dist/tools/registry.js.map +0 -1
  272. package/dist/tools/types.d.ts.map +0 -1
  273. package/dist/tools/types.js.map +0 -1
  274. package/dist/types/index.d.ts.map +0 -1
  275. package/dist/types/index.js.map +0 -1
  276. package/dist/ui/PlanExecuteView.d.ts.map +0 -1
  277. package/dist/ui/PlanExecuteView.js.map +0 -1
  278. package/dist/ui/TodoPanel.d.ts.map +0 -1
  279. package/dist/ui/TodoPanel.js.map +0 -1
  280. package/dist/ui/UpdateNotification.d.ts.map +0 -1
  281. package/dist/ui/UpdateNotification.js.map +0 -1
  282. package/dist/ui/components/ActivityIndicator.d.ts.map +0 -1
  283. package/dist/ui/components/ActivityIndicator.js.map +0 -1
  284. package/dist/ui/components/CommandBrowser.d.ts.map +0 -1
  285. package/dist/ui/components/CommandBrowser.js.map +0 -1
  286. package/dist/ui/components/CustomTextInput.d.ts.map +0 -1
  287. package/dist/ui/components/CustomTextInput.js.map +0 -1
  288. package/dist/ui/components/DocsSearchProgress.d.ts.map +0 -1
  289. package/dist/ui/components/DocsSearchProgress.js.map +0 -1
  290. package/dist/ui/components/FileBrowser.d.ts.map +0 -1
  291. package/dist/ui/components/FileBrowser.js.map +0 -1
  292. package/dist/ui/components/LLMSetupWizard.d.ts.map +0 -1
  293. package/dist/ui/components/LLMSetupWizard.js.map +0 -1
  294. package/dist/ui/components/Logo.d.ts.map +0 -1
  295. package/dist/ui/components/Logo.js.map +0 -1
  296. package/dist/ui/components/MarkdownRenderer.d.ts.map +0 -1
  297. package/dist/ui/components/MarkdownRenderer.js.map +0 -1
  298. package/dist/ui/components/ModelSelector.d.ts.map +0 -1
  299. package/dist/ui/components/ModelSelector.js.map +0 -1
  300. package/dist/ui/components/PlanExecuteApp.d.ts.map +0 -1
  301. package/dist/ui/components/PlanExecuteApp.js.map +0 -1
  302. package/dist/ui/components/ProgressBar.d.ts.map +0 -1
  303. package/dist/ui/components/ProgressBar.js.map +0 -1
  304. package/dist/ui/components/StatusBar.d.ts.map +0 -1
  305. package/dist/ui/components/StatusBar.js.map +0 -1
  306. package/dist/ui/components/ThinkingIndicator.d.ts.map +0 -1
  307. package/dist/ui/components/ThinkingIndicator.js.map +0 -1
  308. package/dist/ui/components/TodoListView.d.ts.map +0 -1
  309. package/dist/ui/components/TodoListView.js.map +0 -1
  310. package/dist/ui/components/ToolSelector.d.ts.map +0 -1
  311. package/dist/ui/components/ToolSelector.js.map +0 -1
  312. package/dist/ui/components/dialogs/ApprovalDialog.d.ts.map +0 -1
  313. package/dist/ui/components/dialogs/ApprovalDialog.js.map +0 -1
  314. package/dist/ui/components/dialogs/AskUserDialog.d.ts.map +0 -1
  315. package/dist/ui/components/dialogs/AskUserDialog.js.map +0 -1
  316. package/dist/ui/components/dialogs/DocsBrowser.d.ts.map +0 -1
  317. package/dist/ui/components/dialogs/DocsBrowser.js.map +0 -1
  318. package/dist/ui/components/dialogs/SettingsDialog.d.ts.map +0 -1
  319. package/dist/ui/components/dialogs/SettingsDialog.js.map +0 -1
  320. package/dist/ui/components/dialogs/index.d.ts.map +0 -1
  321. package/dist/ui/components/dialogs/index.js.map +0 -1
  322. package/dist/ui/components/index.d.ts.map +0 -1
  323. package/dist/ui/components/index.js.map +0 -1
  324. package/dist/ui/components/panels/LogPanel.d.ts.map +0 -1
  325. package/dist/ui/components/panels/LogPanel.js.map +0 -1
  326. package/dist/ui/components/panels/SessionPanel.d.ts.map +0 -1
  327. package/dist/ui/components/panels/SessionPanel.js.map +0 -1
  328. package/dist/ui/components/panels/index.d.ts.map +0 -1
  329. package/dist/ui/components/panels/index.js.map +0 -1
  330. package/dist/ui/components/views/ChatView.d.ts.map +0 -1
  331. package/dist/ui/components/views/ChatView.js.map +0 -1
  332. package/dist/ui/components/views/index.d.ts.map +0 -1
  333. package/dist/ui/components/views/index.js.map +0 -1
  334. package/dist/ui/contexts/TokenContext.d.ts.map +0 -1
  335. package/dist/ui/contexts/TokenContext.js.map +0 -1
  336. package/dist/ui/hooks/atFileProcessor.d.ts.map +0 -1
  337. package/dist/ui/hooks/atFileProcessor.js.map +0 -1
  338. package/dist/ui/hooks/index.d.ts.map +0 -1
  339. package/dist/ui/hooks/index.js.map +0 -1
  340. package/dist/ui/hooks/slashCommandProcessor.d.ts.map +0 -1
  341. package/dist/ui/hooks/slashCommandProcessor.js.map +0 -1
  342. package/dist/ui/hooks/useCommandBrowserState.d.ts.map +0 -1
  343. package/dist/ui/hooks/useCommandBrowserState.js.map +0 -1
  344. package/dist/ui/hooks/useFileBrowserState.d.ts.map +0 -1
  345. package/dist/ui/hooks/useFileBrowserState.js.map +0 -1
  346. package/dist/ui/hooks/useFileList.d.ts.map +0 -1
  347. package/dist/ui/hooks/useFileList.js.map +0 -1
  348. package/dist/ui/hooks/useInputHistory.d.ts.map +0 -1
  349. package/dist/ui/hooks/useInputHistory.js.map +0 -1
  350. package/dist/ui/hooks/usePlanExecution.d.ts.map +0 -1
  351. package/dist/ui/hooks/usePlanExecution.js.map +0 -1
  352. package/dist/ui/index.d.ts.map +0 -1
  353. package/dist/ui/index.js.map +0 -1
  354. package/dist/ui/ink-entry.d.ts.map +0 -1
  355. package/dist/ui/ink-entry.js.map +0 -1
  356. package/dist/utils/env-filter.d.ts.map +0 -1
  357. package/dist/utils/env-filter.js.map +0 -1
  358. package/dist/utils/file-system.d.ts.map +0 -1
  359. package/dist/utils/file-system.js.map +0 -1
  360. package/dist/utils/git-utils.d.ts.map +0 -1
  361. package/dist/utils/git-utils.js.map +0 -1
  362. package/dist/utils/json-stream-logger.d.ts.map +0 -1
  363. package/dist/utils/json-stream-logger.js.map +0 -1
  364. package/dist/utils/logger.d.ts.map +0 -1
  365. package/dist/utils/logger.js.map +0 -1
  366. package/dist/utils/platform-utils.d.ts.map +0 -1
  367. package/dist/utils/platform-utils.js.map +0 -1
  368. package/dist/utils/wsl-utils.d.ts.map +0 -1
  369. package/dist/utils/wsl-utils.js.map +0 -1
  370. package/electron.vite.config.ts +0 -63
  371. package/google374b9eba0c52b043.html +0 -1
  372. package/src/agents/base/base-agent.ts +0 -159
  373. package/src/agents/docs-search/index.ts +0 -365
  374. package/src/agents/index.ts +0 -34
  375. package/src/agents/planner/index.ts +0 -544
  376. package/src/cli.ts +0 -201
  377. package/src/constants.ts +0 -47
  378. package/src/core/compact/compact-manager.ts +0 -160
  379. package/src/core/compact/compact-prompts.ts +0 -150
  380. package/src/core/compact/context-tracker.ts +0 -164
  381. package/src/core/compact/index.ts +0 -25
  382. package/src/core/config/config-manager.ts +0 -460
  383. package/src/core/config/index.ts +0 -5
  384. package/src/core/docs-manager.ts +0 -678
  385. package/src/core/llm/index.ts +0 -7
  386. package/src/core/llm/llm-client.ts +0 -1550
  387. package/src/core/session/index.ts +0 -5
  388. package/src/core/session/session-manager.ts +0 -464
  389. package/src/core/slash-command-handler.ts +0 -410
  390. package/src/core/usage-tracker.ts +0 -438
  391. package/src/errors/base.ts +0 -81
  392. package/src/errors/file.ts +0 -183
  393. package/src/errors/index.ts +0 -95
  394. package/src/errors/llm.ts +0 -151
  395. package/src/errors/network.ts +0 -124
  396. package/src/errors/validation.ts +0 -111
  397. package/src/eval/eval-runner.ts +0 -456
  398. package/src/eval/index.ts +0 -8
  399. package/src/eval/types.ts +0 -139
  400. package/src/index.ts +0 -22
  401. package/src/orchestration/index.ts +0 -30
  402. package/src/orchestration/plan-executor.ts +0 -652
  403. package/src/orchestration/types.ts +0 -127
  404. package/src/orchestration/utils.ts +0 -119
  405. package/src/orquesta/connection.ts +0 -291
  406. package/src/prompts/agents/docs-search-decision.ts +0 -74
  407. package/src/prompts/agents/docs-search.ts +0 -84
  408. package/src/prompts/agents/planning.ts +0 -143
  409. package/src/prompts/index.ts +0 -31
  410. package/src/prompts/shared/codebase-rules.ts +0 -29
  411. package/src/prompts/shared/git-rules.ts +0 -94
  412. package/src/prompts/shared/language-rules.ts +0 -36
  413. package/src/prompts/shared/tool-usage.ts +0 -72
  414. package/src/prompts/system/compact.ts +0 -80
  415. package/src/prompts/system/plan-execute.ts +0 -89
  416. package/src/tools/browser/browser-client.ts +0 -1363
  417. package/src/tools/browser/browser-tools.ts +0 -1139
  418. package/src/tools/browser/index.ts +0 -65
  419. package/src/tools/index.ts +0 -23
  420. package/src/tools/llm/agents/docs-search-tools.ts +0 -368
  421. package/src/tools/llm/agents/index.ts +0 -22
  422. package/src/tools/llm/index.ts +0 -11
  423. package/src/tools/llm/simple/ask-user-tool.ts +0 -25
  424. package/src/tools/llm/simple/background-bash-tool.ts +0 -443
  425. package/src/tools/llm/simple/background-powershell-tool.ts +0 -421
  426. package/src/tools/llm/simple/bash-tool.ts +0 -238
  427. package/src/tools/llm/simple/docs-search-agent-tool.ts +0 -146
  428. package/src/tools/llm/simple/file-tools.ts +0 -1051
  429. package/src/tools/llm/simple/final-response-tool.ts +0 -180
  430. package/src/tools/llm/simple/index.ts +0 -42
  431. package/src/tools/llm/simple/planning-tools.ts +0 -143
  432. package/src/tools/llm/simple/powershell-tool.ts +0 -241
  433. package/src/tools/llm/simple/simple-tool-executor.ts +0 -279
  434. package/src/tools/llm/simple/todo-tools.ts +0 -207
  435. package/src/tools/llm/simple/user-interaction-tools.ts +0 -277
  436. package/src/tools/office/common/constants.ts +0 -335
  437. package/src/tools/office/common/index.ts +0 -133
  438. package/src/tools/office/common/types.ts +0 -286
  439. package/src/tools/office/common/utils.ts +0 -116
  440. package/src/tools/office/excel-client.ts +0 -1336
  441. package/src/tools/office/excel-tools/cells.ts +0 -359
  442. package/src/tools/office/excel-tools/charts.ts +0 -166
  443. package/src/tools/office/excel-tools/comments.ts +0 -155
  444. package/src/tools/office/excel-tools/data-ops.ts +0 -349
  445. package/src/tools/office/excel-tools/export.ts +0 -105
  446. package/src/tools/office/excel-tools/formatting.ts +0 -357
  447. package/src/tools/office/excel-tools/index.ts +0 -55
  448. package/src/tools/office/excel-tools/launch.ts +0 -303
  449. package/src/tools/office/excel-tools/media.ts +0 -117
  450. package/src/tools/office/excel-tools/named-ranges.ts +0 -148
  451. package/src/tools/office/excel-tools/protection.ts +0 -105
  452. package/src/tools/office/excel-tools/rows-columns.ts +0 -386
  453. package/src/tools/office/excel-tools/sheets.ts +0 -228
  454. package/src/tools/office/excel-tools/validation.ts +0 -226
  455. package/src/tools/office/excel-tools.ts +0 -9
  456. package/src/tools/office/index.ts +0 -259
  457. package/src/tools/office/office-client-base.ts +0 -242
  458. package/src/tools/office/office-client.ts +0 -377
  459. package/src/tools/office/powerpoint-client.ts +0 -1498
  460. package/src/tools/office/powerpoint-tools/effects.ts +0 -315
  461. package/src/tools/office/powerpoint-tools/export.ts +0 -138
  462. package/src/tools/office/powerpoint-tools/index.ts +0 -45
  463. package/src/tools/office/powerpoint-tools/launch.ts +0 -263
  464. package/src/tools/office/powerpoint-tools/media.ts +0 -291
  465. package/src/tools/office/powerpoint-tools/notes.ts +0 -220
  466. package/src/tools/office/powerpoint-tools/sections.ts +0 -140
  467. package/src/tools/office/powerpoint-tools/shapes.ts +0 -870
  468. package/src/tools/office/powerpoint-tools/slides.ts +0 -350
  469. package/src/tools/office/powerpoint-tools/tables.ts +0 -182
  470. package/src/tools/office/powerpoint-tools/text.ts +0 -473
  471. package/src/tools/office/powerpoint-tools.ts +0 -9
  472. package/src/tools/office/word-client.ts +0 -1697
  473. package/src/tools/office/word-tools/bookmarks.ts +0 -186
  474. package/src/tools/office/word-tools/comments.ts +0 -185
  475. package/src/tools/office/word-tools/content.ts +0 -229
  476. package/src/tools/office/word-tools/export.ts +0 -97
  477. package/src/tools/office/word-tools/formatting.ts +0 -161
  478. package/src/tools/office/word-tools/headers-footers.ts +0 -155
  479. package/src/tools/office/word-tools/index.ts +0 -57
  480. package/src/tools/office/word-tools/launch.ts +0 -312
  481. package/src/tools/office/word-tools/lists.ts +0 -97
  482. package/src/tools/office/word-tools/navigation.ts +0 -114
  483. package/src/tools/office/word-tools/page-setup.ts +0 -195
  484. package/src/tools/office/word-tools/tables.ts +0 -262
  485. package/src/tools/office/word-tools/text.ts +0 -294
  486. package/src/tools/office/word-tools/undo-redo.ts +0 -97
  487. package/src/tools/office/word-tools/watermarks.ts +0 -105
  488. package/src/tools/office/word-tools.ts +0 -9
  489. package/src/tools/registry.ts +0 -527
  490. package/src/tools/types.ts +0 -231
  491. package/src/types/index.ts +0 -181
  492. package/src/ui/PlanExecuteView.tsx +0 -119
  493. package/src/ui/TodoPanel.tsx +0 -240
  494. package/src/ui/UpdateNotification.tsx +0 -105
  495. package/src/ui/components/ActivityIndicator.tsx +0 -234
  496. package/src/ui/components/CommandBrowser.tsx +0 -114
  497. package/src/ui/components/CustomTextInput.tsx +0 -389
  498. package/src/ui/components/DocsSearchProgress.tsx +0 -85
  499. package/src/ui/components/FileBrowser.tsx +0 -93
  500. package/src/ui/components/LLMSetupWizard.tsx +0 -333
  501. package/src/ui/components/Logo.tsx +0 -125
  502. package/src/ui/components/MarkdownRenderer.tsx +0 -358
  503. package/src/ui/components/ModelSelector.tsx +0 -203
  504. package/src/ui/components/PlanExecuteApp.tsx +0 -2007
  505. package/src/ui/components/ProgressBar.tsx +0 -51
  506. package/src/ui/components/StatusBar.tsx +0 -302
  507. package/src/ui/components/ThinkingIndicator.tsx +0 -120
  508. package/src/ui/components/TodoListView.tsx +0 -140
  509. package/src/ui/components/ToolSelector.tsx +0 -215
  510. package/src/ui/components/dialogs/ApprovalDialog.tsx +0 -259
  511. package/src/ui/components/dialogs/AskUserDialog.tsx +0 -159
  512. package/src/ui/components/dialogs/DocsBrowser.tsx +0 -222
  513. package/src/ui/components/dialogs/SettingsDialog.tsx +0 -939
  514. package/src/ui/components/dialogs/index.ts +0 -13
  515. package/src/ui/components/index.ts +0 -27
  516. package/src/ui/components/panels/LogPanel.tsx +0 -385
  517. package/src/ui/components/panels/SessionPanel.tsx +0 -146
  518. package/src/ui/components/panels/index.ts +0 -13
  519. package/src/ui/components/views/ChatView.tsx +0 -447
  520. package/src/ui/components/views/index.ts +0 -5
  521. package/src/ui/contexts/TokenContext.tsx +0 -139
  522. package/src/ui/hooks/atFileProcessor.ts +0 -167
  523. package/src/ui/hooks/index.ts +0 -11
  524. package/src/ui/hooks/slashCommandProcessor.ts +0 -174
  525. package/src/ui/hooks/useCommandBrowserState.ts +0 -97
  526. package/src/ui/hooks/useFileBrowserState.ts +0 -116
  527. package/src/ui/hooks/useFileList.ts +0 -132
  528. package/src/ui/hooks/useInputHistory.ts +0 -89
  529. package/src/ui/hooks/usePlanExecution.ts +0 -339
  530. package/src/ui/index.ts +0 -10
  531. package/src/ui/ink-entry.tsx +0 -36
  532. package/src/utils/env-filter.ts +0 -164
  533. package/src/utils/file-system.ts +0 -133
  534. package/src/utils/git-utils.ts +0 -30
  535. package/src/utils/json-stream-logger.ts +0 -1259
  536. package/src/utils/logger.ts +0 -2767
  537. package/src/utils/platform-utils.ts +0 -256
  538. package/src/utils/wsl-utils.ts +0 -113
  539. package/tsconfig.electron.json +0 -39
  540. package/tsconfig.json +0 -64
@@ -1,167 +0,0 @@
1
- /**
2
- * @ File Processor
3
- *
4
- * Utilities for detecting @ triggers and processing file selections
5
- */
6
-
7
- import * as fs from 'fs/promises';
8
- import * as path from 'path';
9
-
10
- export interface AtTriggerInfo {
11
- detected: boolean;
12
- position: number;
13
- filter: string;
14
- }
15
-
16
- /**
17
- * Detect '@' trigger in input string
18
- * Returns position and filter text after @
19
- */
20
- export function detectAtTrigger(input: string): AtTriggerInfo {
21
- // Find '@' at start or after space
22
- const atMatch = input.match(/(^|[\s])@([^\s]*?)$/);
23
-
24
- if (!atMatch) {
25
- return { detected: false, position: -1, filter: '' };
26
- }
27
-
28
- const position = atMatch.index! + atMatch[1]!.length; // Position of '@'
29
- const filter = atMatch[2] || ''; // Text after '@'
30
-
31
- return {
32
- detected: true,
33
- position,
34
- filter,
35
- };
36
- }
37
-
38
- /**
39
- * Insert file paths into input string at cursor position
40
- * Removes the '@' trigger and filter text
41
- * Ensures cursor is positioned right after the inserted path for continued typing
42
- */
43
- export function insertFilePaths(
44
- input: string,
45
- atPosition: number,
46
- filterLength: number,
47
- filePaths: string[]
48
- ): string {
49
- // Remove '@filter' from input
50
- const before = input.slice(0, atPosition);
51
- const after = input.slice(atPosition + 1 + filterLength);
52
-
53
- // Format file paths as @path1 @path2 @path3
54
- const formattedPaths = filePaths.map((p) => `@${p}`).join(' ');
55
-
56
- // Insert paths with space after for continued typing
57
- // If there's text after the cursor, trim the result
58
- // Otherwise, keep trailing space so user can continue typing immediately
59
- if (after.trim()) {
60
- return `${before}${formattedPaths} ${after}`.trim();
61
- } else {
62
- // No text after cursor - add space for continued typing
63
- return `${before}${formattedPaths} `;
64
- }
65
- }
66
-
67
- /**
68
- * Result of processing @file references
69
- */
70
- export interface ProcessedMessage {
71
- /** The processed message with file contents included */
72
- content: string;
73
- /** List of files that were successfully read */
74
- includedFiles: string[];
75
- /** List of files that failed to read */
76
- failedFiles: string[];
77
- }
78
-
79
- /**
80
- * Extract @path references from a message
81
- * Matches patterns like @/path/to/file.ts or @relative/path.js
82
- */
83
- export function extractFileReferences(input: string): string[] {
84
- // Match @followed by a path (absolute or relative, with optional extension)
85
- // Stops at whitespace or end of string
86
- const regex = /@([^\s@]+)/g;
87
- const matches: string[] = [];
88
- let match;
89
-
90
- while ((match = regex.exec(input)) !== null) {
91
- const filePath = match[1];
92
- // Filter out obvious non-paths (single characters, etc.)
93
- if (filePath && filePath.length > 1 && (filePath.includes('/') || filePath.includes('.'))) {
94
- matches.push(filePath);
95
- }
96
- }
97
-
98
- return matches;
99
- }
100
-
101
- /**
102
- * Process a message by reading @file references and including their contents
103
- * Returns the processed message with file contents appended
104
- */
105
- export async function processFileReferences(input: string): Promise<ProcessedMessage> {
106
- const fileRefs = extractFileReferences(input);
107
-
108
- if (fileRefs.length === 0) {
109
- return {
110
- content: input,
111
- includedFiles: [],
112
- failedFiles: [],
113
- };
114
- }
115
-
116
- const includedFiles: string[] = [];
117
- const failedFiles: string[] = [];
118
- const fileContents: string[] = [];
119
-
120
- for (const filePath of fileRefs) {
121
- try {
122
- // Resolve path (relative to cwd)
123
- const resolvedPath = path.resolve(process.cwd(), filePath);
124
-
125
- // Security: Prevent path traversal attacks
126
- if (!resolvedPath.startsWith(process.cwd())) {
127
- failedFiles.push(filePath);
128
- continue;
129
- }
130
-
131
- // Check if file exists
132
- const stat = await fs.stat(resolvedPath);
133
-
134
- if (stat.isDirectory()) {
135
- // For directories, list contents instead
136
- const entries = await fs.readdir(resolvedPath);
137
- fileContents.push(`\n--- Directory: ${filePath} ---\n${entries.join('\n')}\n---`);
138
- includedFiles.push(filePath);
139
- } else {
140
- // Read file content
141
- const content = await fs.readFile(resolvedPath, 'utf-8');
142
- const ext = path.extname(filePath).slice(1) || 'txt';
143
- fileContents.push(`\n--- File: ${filePath} ---\n\`\`\`${ext}\n${content}\n\`\`\`\n---`);
144
- includedFiles.push(filePath);
145
- }
146
- } catch (error) {
147
- failedFiles.push(filePath);
148
- }
149
- }
150
-
151
- // Build final message
152
- // Remove @path references from original message and append file contents
153
- let cleanedInput = input;
154
- for (const filePath of new Set(fileRefs)) {
155
- cleanedInput = cleanedInput.replaceAll(`@${filePath}`, `[${filePath}]`);
156
- }
157
-
158
- const finalContent = fileContents.length > 0
159
- ? `${cleanedInput}\n\n<attached_files>${fileContents.join('\n')}</attached_files>`
160
- : cleanedInput;
161
-
162
- return {
163
- content: finalContent,
164
- includedFiles,
165
- failedFiles,
166
- };
167
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * Hooks barrel export
3
- */
4
-
5
- export * from './atFileProcessor.js';
6
- export * from './useFileList.js';
7
- export * from './slashCommandProcessor.js';
8
- export * from './useFileBrowserState.js';
9
- export * from './useCommandBrowserState.js';
10
- export * from './usePlanExecution.js';
11
- export * from './useInputHistory.js';
@@ -1,174 +0,0 @@
1
- /**
2
- * Slash Command Processor
3
- *
4
- * Utilities for detecting slash command triggers and processing command selections
5
- */
6
-
7
- export interface SlashCommandInfo {
8
- detected: boolean;
9
- position: number;
10
- partialCommand: string;
11
- fullCommand: string | null;
12
- args: string;
13
- }
14
-
15
- export interface CommandMetadata {
16
- name: string;
17
- description: string;
18
- argsHint?: string;
19
- aliases?: string[];
20
- handler?: (args: string) => void | Promise<void>;
21
- }
22
-
23
- /**
24
- * Available slash commands with descriptions
25
- */
26
- export const SLASH_COMMANDS: CommandMetadata[] = [
27
- {
28
- name: '/exit',
29
- description: 'Exit the application',
30
- aliases: ['/quit'],
31
- },
32
- {
33
- name: '/clear',
34
- description: 'Clear conversation and TODOs',
35
- },
36
- {
37
- name: '/compact',
38
- description: 'Compact conversation to free up context',
39
- },
40
- {
41
- name: '/settings',
42
- description: 'Open settings menu',
43
- },
44
- {
45
- name: '/model',
46
- description: 'Switch between LLM models',
47
- },
48
- {
49
- name: '/load',
50
- description: 'Load a saved session',
51
- },
52
- {
53
- name: '/docs',
54
- description: 'Download framework documentation (agno, adk)',
55
- },
56
- {
57
- name: '/tool',
58
- description: 'Enable/disable optional tools (Browser, Background)',
59
- aliases: ['/tools'],
60
- },
61
- {
62
- name: '/usage',
63
- description: 'Show token usage statistics',
64
- },
65
- {
66
- name: '/help',
67
- description: 'Show help message',
68
- },
69
- ];
70
-
71
- /**
72
- * Detect slash command trigger in input string
73
- * Returns position, partial command, and full command if complete
74
- */
75
- export function detectSlashTrigger(input: string): SlashCommandInfo {
76
- // Only match a single '/' at the start of input (no spaces before)
77
- // Explicitly reject '//' or multiple slashes
78
- if (input.startsWith('//')) {
79
- return {
80
- detected: false,
81
- position: -1,
82
- partialCommand: '',
83
- fullCommand: null,
84
- args: '',
85
- };
86
- }
87
-
88
- const slashMatch = input.match(/^\/([^\s]*)([\s](.*))?$/);
89
-
90
- if (!slashMatch) {
91
- return {
92
- detected: false,
93
- position: -1,
94
- partialCommand: '',
95
- fullCommand: null,
96
- args: '',
97
- };
98
- }
99
-
100
- const partialCommand = slashMatch[1] || '';
101
- const args = slashMatch[3] || '';
102
- const fullInput = `/${partialCommand}`;
103
-
104
- // Check if this is a complete command (including aliases)
105
- const matchedCommand = SLASH_COMMANDS.find(
106
- (cmd) => cmd.name === fullInput || cmd.aliases?.includes(fullInput)
107
- );
108
-
109
- return {
110
- detected: true,
111
- position: 0,
112
- partialCommand,
113
- fullCommand: matchedCommand ? matchedCommand.name : null,
114
- args,
115
- };
116
- }
117
-
118
- /**
119
- * Filter commands based on partial input
120
- * Returns up to maxResults commands that match the partial command
121
- * Includes both primary commands and aliases
122
- */
123
- export function filterCommands(
124
- partialCommand: string,
125
- maxResults: number = 10
126
- ): CommandMetadata[] {
127
- if (!partialCommand) {
128
- return SLASH_COMMANDS.slice(0, maxResults);
129
- }
130
-
131
- const filtered = SLASH_COMMANDS.filter((cmd) => {
132
- const searchTerm = `/${partialCommand.toLowerCase()}`;
133
- // Match primary command or any alias
134
- return (
135
- cmd.name.toLowerCase().startsWith(searchTerm) ||
136
- cmd.aliases?.some((alias) => alias.toLowerCase().startsWith(searchTerm))
137
- );
138
- });
139
-
140
- return filtered.slice(0, maxResults);
141
- }
142
-
143
- /**
144
- * Check if a command is valid and complete
145
- * Validates both primary commands and aliases
146
- */
147
- export function isValidCommand(input: string): boolean {
148
- const trimmed = input.trim();
149
- return SLASH_COMMANDS.some(
150
- (cmd) =>
151
- trimmed.startsWith(cmd.name) ||
152
- cmd.aliases?.some((alias) => trimmed.startsWith(alias))
153
- );
154
- }
155
-
156
- /**
157
- * Get argument hint for a specific command
158
- */
159
- export function getCommandArgsHint(commandName: string): string | undefined {
160
- const command = SLASH_COMMANDS.find((cmd) => cmd.name === commandName);
161
- return command?.argsHint;
162
- }
163
-
164
- /**
165
- * Insert selected command into input
166
- * Replaces the partial command with the full command
167
- */
168
- export function insertSlashCommand(
169
- _input: string,
170
- selectedCommand: string
171
- ): string {
172
- // Replace everything with the selected command and add a space
173
- return `${selectedCommand} `;
174
- }
@@ -1,97 +0,0 @@
1
- /**
2
- * useCommandBrowserState Hook
3
- *
4
- * Manages command browser state for slash commands
5
- */
6
-
7
- import { useState, useEffect, useCallback } from 'react';
8
- import { detectSlashTrigger, insertSlashCommand } from './slashCommandProcessor.js';
9
-
10
- export interface CommandBrowserState {
11
- showCommandBrowser: boolean;
12
- partialCommand: string;
13
- commandArgs: string;
14
- }
15
-
16
- export interface CommandBrowserActions {
17
- handleCommandSelect: (command: string, shouldSubmit: boolean, input: string, onSubmit: (value: string) => void) => string | null;
18
- handleCommandBrowserCancel: () => void;
19
- resetCommandBrowser: () => void;
20
- }
21
-
22
- export function useCommandBrowserState(
23
- input: string,
24
- isProcessing: boolean
25
- ): CommandBrowserState & CommandBrowserActions {
26
- const [showCommandBrowser, setShowCommandBrowser] = useState(false);
27
- const [partialCommand, setPartialCommand] = useState('');
28
- const [commandArgs, setCommandArgs] = useState('');
29
-
30
- // Monitor input for '/' slash command trigger
31
- useEffect(() => {
32
- if (isProcessing) {
33
- return;
34
- }
35
-
36
- if (!input) {
37
- if (showCommandBrowser) {
38
- setShowCommandBrowser(false);
39
- setPartialCommand('');
40
- setCommandArgs('');
41
- }
42
- return;
43
- }
44
-
45
- const slashInfo = detectSlashTrigger(input);
46
-
47
- if (slashInfo.detected && !showCommandBrowser) {
48
- setShowCommandBrowser(true);
49
- setPartialCommand(slashInfo.partialCommand);
50
- setCommandArgs(slashInfo.args);
51
- } else if (slashInfo.detected && showCommandBrowser) {
52
- setPartialCommand(slashInfo.partialCommand);
53
- setCommandArgs(slashInfo.args);
54
- } else if (!slashInfo.detected && showCommandBrowser) {
55
- setShowCommandBrowser(false);
56
- setPartialCommand('');
57
- setCommandArgs('');
58
- }
59
- }, [input, isProcessing, showCommandBrowser]);
60
-
61
- const handleCommandSelect = useCallback(
62
- (command: string, shouldSubmit: boolean, currentInput: string, onSubmit: (value: string) => void): string | null => {
63
- setShowCommandBrowser(false);
64
- setPartialCommand('');
65
- setCommandArgs('');
66
-
67
- if (shouldSubmit) {
68
- onSubmit(command);
69
- return null;
70
- } else {
71
- return insertSlashCommand(currentInput, command);
72
- }
73
- },
74
- []
75
- );
76
-
77
- const handleCommandBrowserCancel = useCallback(() => {
78
- setShowCommandBrowser(false);
79
- setPartialCommand('');
80
- setCommandArgs('');
81
- }, []);
82
-
83
- const resetCommandBrowser = useCallback(() => {
84
- setShowCommandBrowser(false);
85
- setPartialCommand('');
86
- setCommandArgs('');
87
- }, []);
88
-
89
- return {
90
- showCommandBrowser,
91
- partialCommand,
92
- commandArgs,
93
- handleCommandSelect,
94
- handleCommandBrowserCancel,
95
- resetCommandBrowser,
96
- };
97
- }
@@ -1,116 +0,0 @@
1
- /**
2
- * useFileBrowserState Hook
3
- *
4
- * Manages file browser state and file list caching
5
- */
6
-
7
- import { useState, useEffect, useCallback } from 'react';
8
- import { loadFileList, FileItem } from './useFileList.js';
9
- import { detectAtTrigger, insertFilePaths } from './atFileProcessor.js';
10
- import { logger } from '../../utils/logger.js';
11
-
12
- export interface FileBrowserState {
13
- showFileBrowser: boolean;
14
- atPosition: number;
15
- filterText: string;
16
- cachedFileList: FileItem[];
17
- isLoadingFiles: boolean;
18
- }
19
-
20
- export interface FileBrowserActions {
21
- handleFileSelect: (filePaths: string[], input: string) => string;
22
- handleFileBrowserCancel: () => void;
23
- resetFileBrowser: () => void;
24
- }
25
-
26
- export function useFileBrowserState(
27
- input: string,
28
- isProcessing: boolean
29
- ): FileBrowserState & FileBrowserActions {
30
- const [showFileBrowser, setShowFileBrowser] = useState(false);
31
- const [atPosition, setAtPosition] = useState(-1);
32
- const [filterText, setFilterText] = useState('');
33
- const [cachedFileList, setCachedFileList] = useState<FileItem[]>([]);
34
- const [isLoadingFiles, setIsLoadingFiles] = useState(true);
35
-
36
- // Load file list once on mount (background loading)
37
- useEffect(() => {
38
- let mounted = true;
39
-
40
- const preloadFiles = async () => {
41
- try {
42
- const files = await loadFileList();
43
- if (mounted) {
44
- setCachedFileList(files);
45
- setIsLoadingFiles(false);
46
- }
47
- } catch (error) {
48
- if (mounted) {
49
- logger.error('Failed to preload file list', error);
50
- setIsLoadingFiles(false);
51
- }
52
- }
53
- };
54
-
55
- preloadFiles();
56
-
57
- return () => {
58
- mounted = false;
59
- };
60
- }, []);
61
-
62
- // Monitor input for '@' trigger
63
- useEffect(() => {
64
- if (isProcessing) {
65
- return;
66
- }
67
-
68
- const triggerInfo = detectAtTrigger(input);
69
-
70
- if (triggerInfo.detected && !showFileBrowser) {
71
- setShowFileBrowser(true);
72
- setAtPosition(triggerInfo.position);
73
- setFilterText(triggerInfo.filter);
74
- } else if (triggerInfo.detected && showFileBrowser) {
75
- setFilterText(triggerInfo.filter);
76
- } else if (!triggerInfo.detected && showFileBrowser) {
77
- setShowFileBrowser(false);
78
- setAtPosition(-1);
79
- setFilterText('');
80
- }
81
- }, [input, isProcessing, showFileBrowser]);
82
-
83
- const handleFileSelect = useCallback(
84
- (filePaths: string[], currentInput: string): string => {
85
- const newInput = insertFilePaths(currentInput, atPosition, filterText.length, filePaths);
86
- setShowFileBrowser(false);
87
- setAtPosition(-1);
88
- setFilterText('');
89
- return newInput;
90
- },
91
- [atPosition, filterText.length]
92
- );
93
-
94
- const handleFileBrowserCancel = useCallback(() => {
95
- setShowFileBrowser(false);
96
- setAtPosition(-1);
97
- setFilterText('');
98
- }, []);
99
-
100
- const resetFileBrowser = useCallback(() => {
101
- setShowFileBrowser(false);
102
- setAtPosition(-1);
103
- setFilterText('');
104
- }, []);
105
-
106
- return {
107
- showFileBrowser,
108
- atPosition,
109
- filterText,
110
- cachedFileList,
111
- isLoadingFiles,
112
- handleFileSelect,
113
- handleFileBrowserCancel,
114
- resetFileBrowser,
115
- };
116
- }
@@ -1,132 +0,0 @@
1
- /**
2
- * useFileList Hook
3
- *
4
- * Load and filter file list for file browser
5
- */
6
-
7
- import { useMemo } from 'react';
8
- import { listFilesTool } from '../../tools/llm/simple/file-tools.js';
9
- import { logger } from '../../utils/logger.js';
10
-
11
- export interface FileItem {
12
- name: string;
13
- type: 'file' | 'directory';
14
- path: string;
15
- }
16
-
17
- interface UseFileListOptions {
18
- filter?: string;
19
- maxResults?: number;
20
- cachedFiles?: FileItem[]; // Use pre-loaded file list for instant display
21
- }
22
-
23
- interface UseFileListResult {
24
- files: FileItem[];
25
- loading: boolean;
26
- error: string | null;
27
- totalCount: number;
28
- }
29
-
30
- /**
31
- * Load and process file list from file system
32
- * This should be called once at app startup and cached
33
- */
34
- export async function loadFileList(): Promise<FileItem[]> {
35
- try {
36
- // Get recursive file list from current directory
37
- const result = await listFilesTool.execute({ directory_path: '.', recursive: true });
38
-
39
- if (!result.success) {
40
- logger.error('Failed to load files', new Error(result.error || 'Unknown error'));
41
- return [];
42
- }
43
-
44
- // Parse JSON result
45
- const files = JSON.parse(result.result || '[]') as FileItem[];
46
-
47
- // Filter out node_modules and hidden files/directories
48
- const filteredFiles = files.filter((file) => {
49
- const pathParts = file.path.split('/');
50
- // Exclude node_modules, .git, and other common exclusions
51
- return !pathParts.some((part) =>
52
- part.startsWith('.') ||
53
- part === 'node_modules' ||
54
- part === 'dist' ||
55
- part === 'build' ||
56
- part === 'coverage'
57
- );
58
- });
59
-
60
- // ============================================================
61
- // TODO: Directory Navigation Feature
62
- // ============================================================
63
- // Currently, directories are excluded from the file browser
64
- // because there's no directory processing logic implemented yet.
65
- //
66
- // To enable directory navigation in the future:
67
- // 1. Remove or comment out the filter below
68
- // 2. Implement directory selection handler in FileBrowser.tsx
69
- // 3. Add logic to navigate into selected directory
70
- // 4. Update atFileProcessor.ts to handle directory paths
71
- //
72
- // For now, only show files to prevent errors when directories
73
- // are selected.
74
- // ============================================================
75
- const filesOnly = filteredFiles.filter((file) => file.type === 'file');
76
-
77
- // Sort files by depth first (root files first), then alphabetically
78
- filesOnly.sort((a, b) => {
79
- // Count path depth (number of slashes)
80
- const depthA = a.path.split('/').length - 1;
81
- const depthB = b.path.split('/').length - 1;
82
-
83
- // Sort by depth first (shallower paths come first)
84
- if (depthA !== depthB) {
85
- return depthA - depthB;
86
- }
87
-
88
- // Same depth - sort alphabetically
89
- return a.path.localeCompare(b.path);
90
- });
91
-
92
- return filesOnly;
93
- } catch (err) {
94
- logger.error('Error loading file list', err);
95
- return [];
96
- }
97
- }
98
-
99
- /**
100
- * Custom hook to filter pre-loaded file list
101
- * This hook expects cachedFiles to be provided for instant filtering
102
- */
103
- export function useFileList(options: UseFileListOptions = {}): UseFileListResult {
104
- const { filter = '', maxResults = 10, cachedFiles = [] } = options;
105
-
106
- // Use cached files if provided, otherwise empty (no loading in this hook)
107
- const allFiles = cachedFiles;
108
- const loading = false; // Loading is handled externally
109
- const error = null;
110
-
111
- // Filter files based on search pattern (memoized for performance)
112
- const filteredFiles = useMemo(() => {
113
- if (!filter) return allFiles;
114
-
115
- const lowerFilter = filter.toLowerCase();
116
- return allFiles.filter((file) =>
117
- file.path.toLowerCase().includes(lowerFilter)
118
- );
119
- }, [allFiles, filter]);
120
-
121
- // Limit results (memoized)
122
- const limitedFiles = useMemo(() => {
123
- return filteredFiles.slice(0, maxResults);
124
- }, [filteredFiles, maxResults]);
125
-
126
- return {
127
- files: limitedFiles,
128
- loading,
129
- error,
130
- totalCount: filteredFiles.length,
131
- };
132
- }