erosolar-cli 1.0.2 → 1.0.5

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 (437) hide show
  1. package/README.md +80 -44
  2. package/agents/erosolar-code.rules.json +167 -0
  3. package/agents/general.rules.json +188 -0
  4. package/dist/adapters/browser/index.d.ts +12 -0
  5. package/dist/adapters/browser/index.d.ts.map +1 -0
  6. package/dist/adapters/browser/index.js +1 -0
  7. package/dist/adapters/browser/index.js.map +1 -0
  8. package/dist/adapters/node/index.d.ts +17 -0
  9. package/dist/adapters/node/index.d.ts.map +1 -0
  10. package/dist/adapters/node/index.js +1 -0
  11. package/dist/adapters/node/index.js.map +1 -0
  12. package/dist/adapters/remote/index.d.ts +13 -0
  13. package/dist/adapters/remote/index.d.ts.map +1 -0
  14. package/dist/adapters/remote/index.js +1 -0
  15. package/dist/adapters/remote/index.js.map +1 -0
  16. package/dist/adapters/types.d.ts +14 -0
  17. package/dist/adapters/types.d.ts.map +1 -0
  18. package/dist/adapters/types.js +1 -0
  19. package/dist/adapters/types.js.map +1 -0
  20. package/dist/bin/erosolar.d.ts +3 -0
  21. package/dist/bin/erosolar.d.ts.map +1 -0
  22. package/dist/bin/erosolar.js +1 -0
  23. package/dist/bin/erosolar.js.map +1 -0
  24. package/dist/capabilities/bashCapability.d.ts +13 -0
  25. package/dist/capabilities/bashCapability.d.ts.map +1 -0
  26. package/dist/capabilities/bashCapability.js +1 -0
  27. package/dist/capabilities/bashCapability.js.map +1 -0
  28. package/dist/capabilities/codeAnalysisCapability.d.ts +13 -0
  29. package/dist/capabilities/codeAnalysisCapability.d.ts.map +1 -0
  30. package/dist/capabilities/codeAnalysisCapability.js +24 -0
  31. package/dist/capabilities/codeAnalysisCapability.js.map +1 -0
  32. package/dist/capabilities/codeGenerationCapability.d.ts +13 -0
  33. package/dist/capabilities/codeGenerationCapability.d.ts.map +1 -0
  34. package/dist/capabilities/codeGenerationCapability.js +25 -0
  35. package/dist/capabilities/codeGenerationCapability.js.map +1 -0
  36. package/dist/capabilities/codeQualityCapability.d.ts +13 -0
  37. package/dist/capabilities/codeQualityCapability.d.ts.map +1 -0
  38. package/dist/capabilities/codeQualityCapability.js +25 -0
  39. package/dist/capabilities/codeQualityCapability.js.map +1 -0
  40. package/dist/capabilities/dependencySecurityCapability.d.ts +13 -0
  41. package/dist/capabilities/dependencySecurityCapability.d.ts.map +1 -0
  42. package/dist/capabilities/dependencySecurityCapability.js +24 -0
  43. package/dist/capabilities/dependencySecurityCapability.js.map +1 -0
  44. package/dist/capabilities/devCapability.d.ts +13 -0
  45. package/dist/capabilities/devCapability.d.ts.map +1 -0
  46. package/dist/capabilities/devCapability.js +24 -0
  47. package/dist/capabilities/devCapability.js.map +1 -0
  48. package/dist/capabilities/filesystemCapability.d.ts +13 -0
  49. package/dist/capabilities/filesystemCapability.d.ts.map +1 -0
  50. package/dist/capabilities/filesystemCapability.js +1 -0
  51. package/dist/capabilities/filesystemCapability.js.map +1 -0
  52. package/dist/capabilities/index.d.ts +10 -0
  53. package/dist/capabilities/index.d.ts.map +1 -0
  54. package/dist/capabilities/index.js +7 -0
  55. package/dist/capabilities/index.js.map +1 -0
  56. package/dist/capabilities/refactoringCapability.d.ts +13 -0
  57. package/dist/capabilities/refactoringCapability.d.ts.map +1 -0
  58. package/dist/capabilities/refactoringCapability.js +25 -0
  59. package/dist/capabilities/refactoringCapability.js.map +1 -0
  60. package/dist/capabilities/repoChecksCapability.d.ts +10 -0
  61. package/dist/capabilities/repoChecksCapability.d.ts.map +1 -0
  62. package/dist/capabilities/repoChecksCapability.js +24 -0
  63. package/dist/capabilities/repoChecksCapability.js.map +1 -0
  64. package/dist/capabilities/searchCapability.d.ts +13 -0
  65. package/dist/capabilities/searchCapability.d.ts.map +1 -0
  66. package/dist/capabilities/searchCapability.js +1 -0
  67. package/dist/capabilities/searchCapability.js.map +1 -0
  68. package/dist/capabilities/testingCapability.d.ts +13 -0
  69. package/dist/capabilities/testingCapability.d.ts.map +1 -0
  70. package/dist/capabilities/testingCapability.js +25 -0
  71. package/dist/capabilities/testingCapability.js.map +1 -0
  72. package/dist/capabilities/toolManifest.d.ts +3 -0
  73. package/dist/capabilities/toolManifest.d.ts.map +1 -0
  74. package/dist/capabilities/toolManifest.js +160 -0
  75. package/dist/capabilities/toolManifest.js.map +1 -0
  76. package/dist/capabilities/toolRegistry.d.ts +22 -0
  77. package/dist/capabilities/toolRegistry.d.ts.map +1 -0
  78. package/dist/capabilities/toolRegistry.js +49 -32
  79. package/dist/capabilities/toolRegistry.js.map +1 -0
  80. package/dist/config.d.ts +25 -0
  81. package/dist/config.d.ts.map +1 -0
  82. package/dist/config.js +103 -23
  83. package/dist/config.js.map +1 -0
  84. package/dist/contracts/agent-profiles.schema.json +43 -0
  85. package/dist/contracts/agent-schemas.json +293 -0
  86. package/dist/contracts/schemas/agent-profile.schema.json +157 -0
  87. package/dist/contracts/schemas/agent-rules.schema.json +238 -0
  88. package/dist/contracts/schemas/agent-schemas.schema.json +528 -0
  89. package/dist/contracts/schemas/agent.schema.json +89 -0
  90. package/dist/contracts/schemas/tool-selection.schema.json +174 -0
  91. package/dist/contracts/tools.schema.json +100 -0
  92. package/dist/contracts/v1/agent.d.ts +147 -0
  93. package/dist/contracts/v1/agent.d.ts.map +1 -0
  94. package/dist/contracts/v1/agent.js +1 -0
  95. package/dist/contracts/v1/agent.js.map +1 -0
  96. package/dist/contracts/v1/agentProfileManifest.d.ts +60 -0
  97. package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
  98. package/dist/contracts/v1/agentProfileManifest.js +9 -0
  99. package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
  100. package/dist/contracts/v1/agentRules.d.ts +60 -0
  101. package/dist/contracts/v1/agentRules.d.ts.map +1 -0
  102. package/dist/contracts/v1/agentRules.js +10 -0
  103. package/dist/contracts/v1/agentRules.js.map +1 -0
  104. package/dist/contracts/v1/provider.d.ts +149 -0
  105. package/dist/contracts/v1/provider.d.ts.map +1 -0
  106. package/dist/contracts/v1/provider.js +1 -0
  107. package/dist/contracts/v1/provider.js.map +1 -0
  108. package/dist/contracts/v1/tool.d.ts +136 -0
  109. package/dist/contracts/v1/tool.d.ts.map +1 -0
  110. package/dist/contracts/v1/tool.js +1 -0
  111. package/dist/contracts/v1/tool.js.map +1 -0
  112. package/dist/contracts/v1/toolAccess.d.ts +43 -0
  113. package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
  114. package/dist/contracts/v1/toolAccess.js +9 -0
  115. package/dist/contracts/v1/toolAccess.js.map +1 -0
  116. package/dist/core/agent.d.ts +35 -0
  117. package/dist/core/agent.d.ts.map +1 -0
  118. package/dist/core/agent.js +17 -9
  119. package/dist/core/agent.js.map +1 -0
  120. package/dist/core/agentProfileManifest.d.ts +3 -0
  121. package/dist/core/agentProfileManifest.d.ts.map +1 -0
  122. package/dist/core/agentProfileManifest.js +188 -0
  123. package/dist/core/agentProfileManifest.js.map +1 -0
  124. package/dist/core/agentProfiles.d.ts +22 -0
  125. package/dist/core/agentProfiles.d.ts.map +1 -0
  126. package/dist/core/agentProfiles.js +1 -0
  127. package/dist/core/agentProfiles.js.map +1 -0
  128. package/dist/core/agentRulebook.d.ts +11 -0
  129. package/dist/core/agentRulebook.d.ts.map +1 -0
  130. package/dist/core/agentRulebook.js +136 -0
  131. package/dist/core/agentRulebook.js.map +1 -0
  132. package/dist/core/agentSchemaLoader.d.ts +131 -0
  133. package/dist/core/agentSchemaLoader.d.ts.map +1 -0
  134. package/dist/core/agentSchemaLoader.js +221 -0
  135. package/dist/core/agentSchemaLoader.js.map +1 -0
  136. package/dist/core/contextWindow.d.ts +6 -0
  137. package/dist/core/contextWindow.d.ts.map +1 -0
  138. package/dist/core/contextWindow.js +1 -0
  139. package/dist/core/contextWindow.js.map +1 -0
  140. package/dist/core/errors/apiKeyErrors.d.ts +11 -0
  141. package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
  142. package/dist/core/errors/apiKeyErrors.js +1 -0
  143. package/dist/core/errors/apiKeyErrors.js.map +1 -0
  144. package/dist/core/errors.d.ts +4 -0
  145. package/dist/core/errors.d.ts.map +1 -0
  146. package/dist/core/errors.js +33 -0
  147. package/dist/core/errors.js.map +1 -0
  148. package/dist/core/preferences.d.ts +21 -0
  149. package/dist/core/preferences.d.ts.map +1 -0
  150. package/dist/core/preferences.js +13 -7
  151. package/dist/core/preferences.js.map +1 -0
  152. package/dist/core/schemaValidator.d.ts +6 -0
  153. package/dist/core/schemaValidator.d.ts.map +1 -0
  154. package/dist/core/schemaValidator.js +93 -0
  155. package/dist/core/schemaValidator.js.map +1 -0
  156. package/dist/core/secretStore.d.ts +20 -0
  157. package/dist/core/secretStore.d.ts.map +1 -0
  158. package/dist/core/secretStore.js +3 -8
  159. package/dist/core/secretStore.js.map +1 -0
  160. package/dist/core/toolRuntime.d.ts +42 -0
  161. package/dist/core/toolRuntime.d.ts.map +1 -0
  162. package/dist/core/toolRuntime.js +25 -10
  163. package/dist/core/toolRuntime.js.map +1 -0
  164. package/dist/core/types.d.ts +86 -0
  165. package/dist/core/types.d.ts.map +1 -0
  166. package/dist/core/types.js +1 -0
  167. package/dist/core/types.js.map +1 -0
  168. package/dist/plugins/providers/anthropic/index.d.ts +2 -0
  169. package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
  170. package/dist/plugins/providers/anthropic/index.js +6 -4
  171. package/dist/plugins/providers/anthropic/index.js.map +1 -0
  172. package/dist/plugins/providers/deepseek/index.d.ts +2 -0
  173. package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
  174. package/dist/plugins/providers/deepseek/index.js +1 -0
  175. package/dist/plugins/providers/deepseek/index.js.map +1 -0
  176. package/dist/plugins/providers/google/index.d.ts +2 -0
  177. package/dist/plugins/providers/google/index.d.ts.map +1 -0
  178. package/dist/plugins/providers/google/index.js +6 -4
  179. package/dist/plugins/providers/google/index.js.map +1 -0
  180. package/dist/plugins/providers/index.d.ts +2 -0
  181. package/dist/plugins/providers/index.d.ts.map +1 -0
  182. package/dist/plugins/providers/index.js +1 -0
  183. package/dist/plugins/providers/index.js.map +1 -0
  184. package/dist/plugins/providers/openai/index.d.ts +3 -0
  185. package/dist/plugins/providers/openai/index.d.ts.map +1 -0
  186. package/dist/plugins/providers/openai/index.js +6 -4
  187. package/dist/plugins/providers/openai/index.js.map +1 -0
  188. package/dist/plugins/providers/xai/index.d.ts +2 -0
  189. package/dist/plugins/providers/xai/index.d.ts.map +1 -0
  190. package/dist/plugins/providers/xai/index.js +1 -0
  191. package/dist/plugins/providers/xai/index.js.map +1 -0
  192. package/dist/plugins/tools/bash/localBashPlugin.d.ts +3 -0
  193. package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +1 -0
  194. package/dist/plugins/tools/bash/localBashPlugin.js +1 -0
  195. package/dist/plugins/tools/bash/localBashPlugin.js.map +1 -0
  196. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +3 -0
  197. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +1 -0
  198. package/dist/plugins/tools/checks/localRepoChecksPlugin.js +14 -0
  199. package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +1 -0
  200. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +3 -0
  201. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +1 -0
  202. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +14 -0
  203. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +1 -0
  204. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +3 -0
  205. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +1 -0
  206. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +14 -0
  207. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +1 -0
  208. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +3 -0
  209. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +1 -0
  210. package/dist/plugins/tools/dependency/dependencyPlugin.js +12 -0
  211. package/dist/plugins/tools/dependency/dependencyPlugin.js.map +1 -0
  212. package/dist/plugins/tools/development/devPlugin.d.ts +3 -0
  213. package/dist/plugins/tools/development/devPlugin.d.ts.map +1 -0
  214. package/dist/plugins/tools/development/devPlugin.js +14 -0
  215. package/dist/plugins/tools/development/devPlugin.js.map +1 -0
  216. package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
  217. package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
  218. package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +1 -0
  219. package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
  220. package/dist/plugins/tools/index.d.ts +3 -0
  221. package/dist/plugins/tools/index.d.ts.map +1 -0
  222. package/dist/plugins/tools/index.js +1 -0
  223. package/dist/plugins/tools/index.js.map +1 -0
  224. package/dist/plugins/tools/nodeDefaults.d.ts +2 -0
  225. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
  226. package/dist/plugins/tools/nodeDefaults.js +15 -2
  227. package/dist/plugins/tools/nodeDefaults.js.map +1 -0
  228. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +3 -0
  229. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +1 -0
  230. package/dist/plugins/tools/refactoring/refactoringPlugin.js +12 -0
  231. package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +1 -0
  232. package/dist/plugins/tools/registry.d.ts +22 -0
  233. package/dist/plugins/tools/registry.d.ts.map +1 -0
  234. package/dist/plugins/tools/registry.js +1 -0
  235. package/dist/plugins/tools/registry.js.map +1 -0
  236. package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
  237. package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
  238. package/dist/plugins/tools/search/localSearchPlugin.js +1 -0
  239. package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
  240. package/dist/plugins/tools/testing/testingPlugin.d.ts +3 -0
  241. package/dist/plugins/tools/testing/testingPlugin.d.ts.map +1 -0
  242. package/dist/plugins/tools/testing/testingPlugin.js +12 -0
  243. package/dist/plugins/tools/testing/testingPlugin.js.map +1 -0
  244. package/dist/providers/anthropicProvider.d.ts +23 -0
  245. package/dist/providers/anthropicProvider.d.ts.map +1 -0
  246. package/dist/providers/anthropicProvider.js +3 -2
  247. package/dist/providers/anthropicProvider.js.map +1 -0
  248. package/dist/providers/googleProvider.d.ts +19 -0
  249. package/dist/providers/googleProvider.d.ts.map +1 -0
  250. package/dist/providers/googleProvider.js +1 -1
  251. package/dist/providers/googleProvider.js.map +1 -0
  252. package/dist/providers/openaiChatCompletionsProvider.d.ts +16 -0
  253. package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
  254. package/dist/providers/openaiChatCompletionsProvider.js +1 -0
  255. package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
  256. package/dist/providers/openaiResponsesProvider.d.ts +20 -0
  257. package/dist/providers/openaiResponsesProvider.d.ts.map +1 -0
  258. package/dist/providers/openaiResponsesProvider.js +1 -0
  259. package/dist/providers/openaiResponsesProvider.js.map +1 -0
  260. package/dist/providers/providerFactory.d.ts +18 -0
  261. package/dist/providers/providerFactory.d.ts.map +1 -0
  262. package/dist/providers/providerFactory.js +5 -1
  263. package/dist/providers/providerFactory.js.map +1 -0
  264. package/dist/runtime/agentHost.d.ts +61 -0
  265. package/dist/runtime/agentHost.d.ts.map +1 -0
  266. package/dist/runtime/agentHost.js +5 -1
  267. package/dist/runtime/agentHost.js.map +1 -0
  268. package/dist/runtime/agentSession.d.ts +32 -0
  269. package/dist/runtime/agentSession.d.ts.map +1 -0
  270. package/dist/runtime/agentSession.js +17 -1
  271. package/dist/runtime/agentSession.js.map +1 -0
  272. package/dist/runtime/browser.d.ts +7 -0
  273. package/dist/runtime/browser.d.ts.map +1 -0
  274. package/dist/runtime/browser.js +1 -0
  275. package/dist/runtime/browser.js.map +1 -0
  276. package/dist/runtime/cloud.d.ts +7 -0
  277. package/dist/runtime/cloud.d.ts.map +1 -0
  278. package/dist/runtime/cloud.js +1 -0
  279. package/dist/runtime/cloud.js.map +1 -0
  280. package/dist/runtime/node.d.ts +8 -0
  281. package/dist/runtime/node.d.ts.map +1 -0
  282. package/dist/runtime/node.js +1 -0
  283. package/dist/runtime/node.js.map +1 -0
  284. package/dist/runtime/universal.d.ts +21 -0
  285. package/dist/runtime/universal.d.ts.map +1 -0
  286. package/dist/runtime/universal.js +1 -0
  287. package/dist/runtime/universal.js.map +1 -0
  288. package/dist/shell/bracketedPasteManager.d.ts +23 -0
  289. package/dist/shell/bracketedPasteManager.d.ts.map +1 -0
  290. package/dist/shell/bracketedPasteManager.js +1 -0
  291. package/dist/shell/bracketedPasteManager.js.map +1 -0
  292. package/dist/shell/interactiveShell.d.ts +131 -0
  293. package/dist/shell/interactiveShell.d.ts.map +1 -0
  294. package/dist/shell/interactiveShell.js +325 -262
  295. package/dist/shell/interactiveShell.js.map +1 -0
  296. package/dist/shell/liveStatus.d.ts +29 -0
  297. package/dist/shell/liveStatus.d.ts.map +1 -0
  298. package/dist/shell/liveStatus.js +77 -0
  299. package/dist/shell/liveStatus.js.map +1 -0
  300. package/dist/shell/promptSkin.d.ts +43 -0
  301. package/dist/shell/promptSkin.d.ts.map +1 -0
  302. package/dist/shell/promptSkin.js +330 -0
  303. package/dist/shell/promptSkin.js.map +1 -0
  304. package/dist/shell/shellApp.d.ts +10 -0
  305. package/dist/shell/shellApp.d.ts.map +1 -0
  306. package/dist/shell/shellApp.js +149 -78
  307. package/dist/shell/shellApp.js.map +1 -0
  308. package/dist/shell/systemPrompt.d.ts +3 -0
  309. package/dist/shell/systemPrompt.d.ts.map +1 -0
  310. package/dist/shell/systemPrompt.js +64 -0
  311. package/dist/shell/systemPrompt.js.map +1 -0
  312. package/dist/shell/updateManager.d.ts +2 -0
  313. package/dist/shell/updateManager.d.ts.map +1 -0
  314. package/dist/shell/updateManager.js +109 -0
  315. package/dist/shell/updateManager.js.map +1 -0
  316. package/dist/tools/bashTools.d.ts +8 -0
  317. package/dist/tools/bashTools.d.ts.map +1 -0
  318. package/dist/tools/bashTools.js +18 -15
  319. package/dist/tools/bashTools.js.map +1 -0
  320. package/dist/tools/codeAnalysisTools.d.ts +74 -0
  321. package/dist/tools/codeAnalysisTools.d.ts.map +1 -0
  322. package/dist/tools/codeAnalysisTools.js +642 -0
  323. package/dist/tools/codeAnalysisTools.js.map +1 -0
  324. package/dist/tools/codeGenerationTools.d.ts +3 -0
  325. package/dist/tools/codeGenerationTools.d.ts.map +1 -0
  326. package/dist/tools/codeGenerationTools.js +369 -0
  327. package/dist/tools/codeGenerationTools.js.map +1 -0
  328. package/dist/tools/codeQualityTools.d.ts +3 -0
  329. package/dist/tools/codeQualityTools.d.ts.map +1 -0
  330. package/dist/tools/codeQualityTools.js +295 -0
  331. package/dist/tools/codeQualityTools.js.map +1 -0
  332. package/dist/tools/dependencyTools.d.ts +3 -0
  333. package/dist/tools/dependencyTools.d.ts.map +1 -0
  334. package/dist/tools/dependencyTools.js +283 -0
  335. package/dist/tools/dependencyTools.js.map +1 -0
  336. package/dist/tools/devTools.d.ts +10 -0
  337. package/dist/tools/devTools.d.ts.map +1 -0
  338. package/dist/tools/devTools.js +239 -0
  339. package/dist/tools/devTools.js.map +1 -0
  340. package/dist/tools/diffUtils.d.ts +8 -0
  341. package/dist/tools/diffUtils.d.ts.map +1 -0
  342. package/dist/tools/diffUtils.js +2 -1
  343. package/dist/tools/diffUtils.js.map +1 -0
  344. package/dist/tools/fileTools.d.ts +3 -0
  345. package/dist/tools/fileTools.d.ts.map +1 -0
  346. package/dist/tools/fileTools.js +72 -21
  347. package/dist/tools/fileTools.js.map +1 -0
  348. package/dist/tools/refactoringTools.d.ts +3 -0
  349. package/dist/tools/refactoringTools.d.ts.map +1 -0
  350. package/dist/tools/refactoringTools.js +294 -0
  351. package/dist/tools/refactoringTools.js.map +1 -0
  352. package/dist/tools/repoChecksTools.d.ts +3 -0
  353. package/dist/tools/repoChecksTools.d.ts.map +1 -0
  354. package/dist/tools/repoChecksTools.js +161 -0
  355. package/dist/tools/repoChecksTools.js.map +1 -0
  356. package/dist/tools/searchTools.d.ts +3 -0
  357. package/dist/tools/searchTools.d.ts.map +1 -0
  358. package/dist/tools/searchTools.js +50 -22
  359. package/dist/tools/searchTools.js.map +1 -0
  360. package/dist/tools/testingTools.d.ts +3 -0
  361. package/dist/tools/testingTools.d.ts.map +1 -0
  362. package/dist/tools/testingTools.js +233 -0
  363. package/dist/tools/testingTools.js.map +1 -0
  364. package/dist/ui/ShellUIAdapter.d.ts +96 -0
  365. package/dist/ui/ShellUIAdapter.d.ts.map +1 -0
  366. package/dist/ui/ShellUIAdapter.js +442 -0
  367. package/dist/ui/ShellUIAdapter.js.map +1 -0
  368. package/dist/ui/UnifiedUIController.d.ts +196 -0
  369. package/dist/ui/UnifiedUIController.d.ts.map +1 -0
  370. package/dist/ui/UnifiedUIController.js +640 -0
  371. package/dist/ui/UnifiedUIController.js.map +1 -0
  372. package/dist/ui/animation/AnimationScheduler.d.ts +192 -0
  373. package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
  374. package/dist/ui/animation/AnimationScheduler.js +432 -0
  375. package/dist/ui/animation/AnimationScheduler.js.map +1 -0
  376. package/dist/ui/codeHighlighter.d.ts +6 -0
  377. package/dist/ui/codeHighlighter.d.ts.map +1 -0
  378. package/dist/ui/codeHighlighter.js +41 -29
  379. package/dist/ui/codeHighlighter.js.map +1 -0
  380. package/dist/ui/designSystem.d.ts +26 -0
  381. package/dist/ui/designSystem.d.ts.map +1 -0
  382. package/dist/ui/designSystem.js +17 -1
  383. package/dist/ui/designSystem.js.map +1 -0
  384. package/dist/ui/display.d.ts +160 -0
  385. package/dist/ui/display.d.ts.map +1 -0
  386. package/dist/ui/display.js +492 -231
  387. package/dist/ui/display.js.map +1 -0
  388. package/dist/ui/interrupts/InterruptManager.d.ts +142 -0
  389. package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
  390. package/dist/ui/interrupts/InterruptManager.js +439 -0
  391. package/dist/ui/interrupts/InterruptManager.js.map +1 -0
  392. package/dist/ui/layout.d.ts +17 -0
  393. package/dist/ui/layout.d.ts.map +1 -0
  394. package/dist/ui/layout.js +12 -7
  395. package/dist/ui/layout.js.map +1 -0
  396. package/dist/ui/orchestration/StatusOrchestrator.d.ts +156 -0
  397. package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -0
  398. package/dist/ui/orchestration/StatusOrchestrator.js +405 -0
  399. package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -0
  400. package/dist/ui/overlay/OverlayManager.d.ts +105 -0
  401. package/dist/ui/overlay/OverlayManager.d.ts.map +1 -0
  402. package/dist/ui/overlay/OverlayManager.js +291 -0
  403. package/dist/ui/overlay/OverlayManager.js.map +1 -0
  404. package/dist/ui/richText.d.ts +6 -0
  405. package/dist/ui/richText.d.ts.map +1 -0
  406. package/dist/ui/richText.js +13 -4
  407. package/dist/ui/richText.js.map +1 -0
  408. package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
  409. package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
  410. package/dist/ui/telemetry/UITelemetry.js +446 -0
  411. package/dist/ui/telemetry/UITelemetry.js.map +1 -0
  412. package/dist/ui/theme.d.ts +77 -0
  413. package/dist/ui/theme.d.ts.map +1 -0
  414. package/dist/ui/theme.js +19 -6
  415. package/dist/ui/theme.js.map +1 -0
  416. package/dist/utils/errorUtils.d.ts +16 -0
  417. package/dist/utils/errorUtils.d.ts.map +1 -0
  418. package/dist/utils/errorUtils.js +66 -0
  419. package/dist/utils/errorUtils.js.map +1 -0
  420. package/dist/utils/nodeVersion.d.ts +3 -0
  421. package/dist/utils/nodeVersion.d.ts.map +1 -0
  422. package/dist/utils/nodeVersion.js +51 -0
  423. package/dist/utils/nodeVersion.js.map +1 -0
  424. package/dist/workspace.d.ts +8 -0
  425. package/dist/workspace.d.ts.map +1 -0
  426. package/dist/workspace.js +72 -11
  427. package/dist/workspace.js.map +1 -0
  428. package/package.json +35 -16
  429. package/scripts/health-check.mjs +176 -0
  430. package/ARCHITECTURE.json +0 -157
  431. package/Agents.md +0 -207
  432. package/SOURCE_OF_TRUTH.json +0 -103
  433. package/dist/capabilities/tavilyCapability.js +0 -26
  434. package/dist/plugins/tools/tavily/tavilyPlugin.js +0 -16
  435. package/dist/shell/__tests__/bracketedPasteManager.test.js +0 -35
  436. package/dist/tools/tavilyTools.js +0 -176
  437. package/dist/ui/__tests__/richText.test.js +0 -36
@@ -3,37 +3,15 @@ import { stdin as input, stdout as output, exit } from 'node:process';
3
3
  import { display } from '../ui/display.js';
4
4
  import { formatUserPrompt, theme } from '../ui/theme.js';
5
5
  import { getContextWindowTokens } from '../core/contextWindow.js';
6
- import { ensureSecretForProvider, getSecretValue, listSecretDefinitions, maskSecret, setSecretValue, } from '../core/secretStore.js';
6
+ import { ensureSecretForProvider, getSecretDefinitionForProvider, getSecretValue, listSecretDefinitions, maskSecret, setSecretValue, } from '../core/secretStore.js';
7
7
  import { saveActiveProfilePreference, saveModelPreference, loadToolSettings, saveToolSettings, clearToolSettings, clearActiveProfilePreference, } from '../core/preferences.js';
8
- import { buildEnabledToolSet, getToolToggleOptions, } from '../capabilities/toolRegistry.js';
8
+ import { buildEnabledToolSet, evaluateToolPermissions, getToolToggleOptions, } from '../capabilities/toolRegistry.js';
9
9
  import { BracketedPasteManager } from './bracketedPasteManager.js';
10
+ import { PromptSkin } from './promptSkin.js';
10
11
  import { detectApiKeyError } from '../core/errors/apiKeyErrors.js';
11
- const COMMON_THOUGHT_LEVELS = [
12
- {
13
- id: 'direct',
14
- label: 'Direct',
15
- description: 'Fast edits with minimal narration or visible reasoning.',
16
- instruction: 'Operate in direct mode: answer concisely, skip verbose reasoning, and surface only the minimum context needed before giving the final response.',
17
- reasoningEffort: 'low',
18
- textVerbosity: 'low',
19
- },
20
- {
21
- id: 'balanced',
22
- label: 'Balanced',
23
- description: 'Blend short reasoning snippets with actionable guidance.',
24
- instruction: 'Operate in balanced mode: share a couple of focused reasoning bullets before the final answer so the operator can follow along.',
25
- reasoningEffort: 'medium',
26
- textVerbosity: 'medium',
27
- },
28
- {
29
- id: 'deep',
30
- label: 'Deep',
31
- description: 'Full investigative reasoning for gnarly bugs or planning.',
32
- instruction: 'Operate in deep thinking mode: narrate a careful, multi-step reasoning path before finalizing, especially when analyzing complex code paths.',
33
- reasoningEffort: 'high',
34
- textVerbosity: 'high',
35
- },
36
- ];
12
+ import { buildWorkspaceContext } from '../workspace.js';
13
+ import { buildInteractiveSystemPrompt } from './systemPrompt.js';
14
+ import { getModels, getSlashCommands, getProviders } from '../core/agentSchemaLoader.js';
37
15
  const DROPDOWN_COLORS = [
38
16
  theme.primary,
39
17
  theme.info,
@@ -42,124 +20,23 @@ const DROPDOWN_COLORS = [
42
20
  theme.success,
43
21
  theme.warning,
44
22
  ];
45
- const MODEL_PRESETS = [
46
- {
47
- id: 'gpt-5.1-codex',
48
- label: 'gpt-5.1-codex',
49
- provider: 'openai',
50
- description: 'Optimized for Erosolar Code with the latest coding weights from OpenAI.',
51
- thoughtLevels: COMMON_THOUGHT_LEVELS,
52
- },
53
- {
54
- id: 'gpt-5.1',
55
- label: 'gpt-5.1',
56
- provider: 'openai',
57
- description: 'Balanced reasoning model when you need equal parts code and analysis.',
58
- },
59
- {
60
- id: 'gpt-5-pro',
61
- label: 'gpt-5-pro',
62
- provider: 'openai',
63
- description: 'OpenAI\'s flagship GPT-5 Pro for maximum depth and planning.',
64
- },
65
- {
66
- id: 'gpt-5-mini',
67
- label: 'gpt-5-mini',
68
- provider: 'openai',
69
- description: 'GPT-5 Mini with faster turnarounds while staying code-aware.',
70
- },
71
- {
72
- id: 'gpt-5-nano',
73
- label: 'gpt-5-nano',
74
- provider: 'openai',
75
- description: 'Ultra-responsive GPT-5 Nano tuned for edits and quick summaries.',
76
- },
77
- {
78
- id: 'claude-sonnet-4-5-20250929',
79
- label: 'sonnet-4.5',
80
- provider: 'anthropic',
81
- description: 'Anthropic Sonnet 4.5 tuned for deeper planning across large repositories.',
82
- temperature: 0.7,
83
- maxTokens: 4096,
84
- },
85
- {
86
- id: 'claude-opus-4.1',
87
- label: 'opus-4.1',
88
- provider: 'anthropic',
89
- description: 'Anthropic Opus 4.1 for the richest Claude reasoning runs.',
90
- temperature: 0.7,
91
- maxTokens: 4096,
92
- },
93
- {
94
- id: 'claude-haiku-4.5',
95
- label: 'haiku-4.5',
96
- provider: 'anthropic',
97
- description: 'Anthropic Haiku 4.5 focused on latency-sensitive workflows.',
98
- temperature: 0.5,
99
- maxTokens: 4096,
100
- },
101
- {
102
- id: 'deepseek-reasoner',
103
- label: 'deepseek-reasoner',
104
- provider: 'deepseek',
105
- description: 'DeepSeek Reasoner for chain-of-thought exploration with tool depth.',
106
- },
107
- {
108
- id: 'deepseek-chat',
109
- label: 'deepseek-chat',
110
- provider: 'deepseek',
111
- description: 'DeepSeek Chat for faster interactive editing and summarization.',
112
- },
113
- {
114
- id: 'grok-4',
115
- label: 'grok-4',
116
- provider: 'xai',
117
- description: 'xAI Grok-4 for their highest quality coding and reasoning responses.',
118
- },
119
- {
120
- id: 'grok-4-fast-reasoning',
121
- label: 'grok-4-fast-reasoning',
122
- provider: 'xai',
123
- description: 'Grok-4 fast reasoning mode when you need lower latency with thinking enabled.',
124
- },
125
- {
126
- id: 'grok-4-fast-non-reasoning',
127
- label: 'grok-4-fast-non-reasoning',
128
- provider: 'xai',
129
- description: 'Grok-4 fast non reasoning variant for concise edits and summaries.',
130
- },
131
- {
132
- id: 'grok-code-fast-1',
133
- label: 'grok-code-fast-1',
134
- provider: 'xai',
135
- description: 'xAI Grok Code Fast 1 tuned specifically for rapid coding assistance.',
136
- },
137
- {
138
- id: 'gemini-2.5-pro',
139
- label: 'gemini-2.5-pro',
140
- provider: 'google',
141
- description: 'Google Gemini 2.5 Pro for multimodal deep reasoning with longer outputs.',
142
- },
143
- {
144
- id: 'gemini-2.5-flash',
145
- label: 'gemini-2.5-flash',
146
- provider: 'google',
147
- description: 'Google Gemini 2.5 Flash for lower-latency edits and iterative coding.',
148
- },
149
- ];
150
- const BASE_SLASH_COMMANDS = [
151
- { command: '/model', description: 'Choose what model to use' },
152
- { command: '/secrets', description: 'Configure API keys' },
153
- { command: '/tools', description: 'Enable or disable CLI tools' },
154
- ];
155
- const PROVIDER_LABELS = {
156
- openai: 'OpenAI',
157
- anthropic: 'Anthropic',
158
- deepseek: 'DeepSeek',
159
- xai: 'xAI',
160
- tavily: 'Tavily',
161
- google: 'Google Gemini',
162
- };
23
+ // Load MODEL_PRESETS from centralized schema
24
+ const MODEL_PRESETS = getModels().map((model) => ({
25
+ id: model.id,
26
+ label: model.label,
27
+ provider: model.provider,
28
+ description: model.description ?? '',
29
+ reasoningEffort: model.reasoningEffort,
30
+ temperature: model.temperature,
31
+ maxTokens: model.maxTokens,
32
+ }));
33
+ // Load BASE_SLASH_COMMANDS from centralized schema
34
+ const BASE_SLASH_COMMANDS = getSlashCommands().map((cmd) => ({
35
+ command: cmd.command,
36
+ description: cmd.description,
37
+ }));
38
+ // Load PROVIDER_LABELS from centralized schema
39
+ const PROVIDER_LABELS = Object.fromEntries(getProviders().map((provider) => [provider.id, provider.label]));
163
40
  const MULTILINE_INPUT_FLUSH_DELAY_MS = 30;
164
41
  const BRACKETED_PASTE_ENABLE = '\u001b[?2004h';
165
42
  const BRACKETED_PASTE_DISABLE = '\u001b[?2004l';
@@ -180,8 +57,8 @@ export class InteractiveShell {
180
57
  profileLabel;
181
58
  workingDir;
182
59
  runtimeSession;
183
- toolContext;
184
60
  baseSystemPrompt;
61
+ workspaceOptions;
185
62
  sessionState;
186
63
  isProcessing = false;
187
64
  pendingInteraction = null;
@@ -198,25 +75,31 @@ export class InteractiveShell {
198
75
  agentMenu;
199
76
  slashCommands;
200
77
  bannerSessionState = null;
78
+ promptSkin;
79
+ statusTracker;
80
+ uiAdapter;
81
+ statusSubscription = null;
82
+ activeContextWindowTokens = null;
83
+ promptSkinOutputDisposer = null;
201
84
  constructor(config) {
202
85
  this.profile = config.profile;
203
86
  this.profileLabel = config.profileLabel;
204
87
  this.workingDir = config.workingDir;
205
88
  this.runtimeSession = config.session;
206
- this.toolContext = this.runtimeSession.toolContext;
207
89
  this.baseSystemPrompt = config.baseSystemPrompt;
90
+ this.workspaceOptions = { ...config.workspaceOptions };
208
91
  this.sessionState = {
209
92
  provider: config.initialModel.provider,
210
93
  model: config.initialModel.model,
211
94
  temperature: config.initialModel.temperature,
212
95
  maxTokens: config.initialModel.maxTokens,
213
- thoughtLevel: this.resolveThoughtLevelOption(config.initialModel.model, config.initialModel.thoughtLevelId),
96
+ reasoningEffort: config.initialModel.reasoningEffort,
214
97
  };
98
+ this.applyPresetReasoningDefaults();
215
99
  // The welcome banner only includes model + provider on launch, so mark that as the initial state.
216
100
  this.bannerSessionState = {
217
101
  model: this.sessionState.model,
218
102
  provider: this.sessionState.provider,
219
- thoughtLabel: undefined,
220
103
  };
221
104
  this.agentMenu = config.agentSelection ?? null;
222
105
  this.slashCommands = [...BASE_SLASH_COMMANDS];
@@ -226,12 +109,22 @@ export class InteractiveShell {
226
109
  description: 'Select the default agent profile (applies on next launch)',
227
110
  });
228
111
  }
112
+ this.statusTracker = config.statusTracker;
113
+ this.uiAdapter = config.uiAdapter;
229
114
  this.rl = readline.createInterface({
230
115
  input,
231
116
  output,
232
117
  prompt: formatUserPrompt(this.profileLabel || this.profile),
233
118
  terminal: true,
234
119
  });
120
+ this.promptSkin = new PromptSkin(this.rl);
121
+ // Keep legacy components for backward compatibility during transition
122
+ this.promptSkinOutputDisposer = display.registerOutputInterceptor({
123
+ beforeWrite: () => this.promptSkin.beginOutput(),
124
+ afterWrite: () => this.promptSkin.endOutput(),
125
+ });
126
+ this.setupStatusTracking();
127
+ this.refreshContextGauge();
235
128
  this.bracketedPasteEnabled = this.enableBracketedPasteMode();
236
129
  this.bracketedPaste = new BracketedPasteManager(this.bracketedPasteEnabled);
237
130
  this.rebuildAgent();
@@ -241,7 +134,9 @@ export class InteractiveShell {
241
134
  async start(initialPrompt) {
242
135
  if (initialPrompt) {
243
136
  display.newLine();
137
+ this.promptSkin.beginOutput();
244
138
  console.log(`${formatUserPrompt(this.profileLabel || this.profile)}${initialPrompt}`);
139
+ this.promptSkin.endOutput();
245
140
  await this.processInputBlock(initialPrompt);
246
141
  return;
247
142
  }
@@ -386,8 +281,25 @@ export class InteractiveShell {
386
281
  });
387
282
  this.rl.on('close', () => {
388
283
  this.disableBracketedPasteMode();
284
+ this.teardownStatusTracking();
285
+ if (this.promptSkinOutputDisposer) {
286
+ this.promptSkinOutputDisposer();
287
+ this.promptSkinOutputDisposer = null;
288
+ }
289
+ this.promptSkin.dispose();
290
+ // Dispose unified UI adapter
291
+ this.uiAdapter.dispose();
389
292
  display.newLine();
390
- display.showInfo('Goodbye!');
293
+ const highlightedEmail = theme.info('support@ero.solar');
294
+ const infoMessage = [
295
+ 'Made available for defensive and offensive security operations.',
296
+ '',
297
+ 'Learn more:',
298
+ 'https://www.anthropic.com/news/disrupting-AI-espionage',
299
+ '',
300
+ `Email ${highlightedEmail} with any bugs or feedback`,
301
+ ].join('\n');
302
+ display.showInfo(infoMessage);
391
303
  exit(0);
392
304
  });
393
305
  this.setupSlashCommandPreviewHandler();
@@ -402,6 +314,40 @@ export class InteractiveShell {
402
314
  this.handleSlashCommandPreviewChange();
403
315
  });
404
316
  }
317
+ setupStatusTracking() {
318
+ this.statusSubscription = this.statusTracker.subscribe((state) => {
319
+ this.promptSkin.setStatus(state);
320
+ });
321
+ this.setIdleStatus();
322
+ }
323
+ teardownStatusTracking() {
324
+ if (this.statusSubscription) {
325
+ this.statusSubscription();
326
+ this.statusSubscription = null;
327
+ }
328
+ this.statusTracker.reset();
329
+ }
330
+ setIdleStatus(detail) {
331
+ this.statusTracker.setBase('Ready for prompts', {
332
+ detail: detail ?? this.describeModelDetail(),
333
+ tone: 'success',
334
+ });
335
+ }
336
+ setProcessingStatus(detail) {
337
+ this.statusTracker.setBase('Working on your request', {
338
+ detail: detail ?? this.describeModelDetail(),
339
+ tone: 'info',
340
+ });
341
+ }
342
+ describeModelDetail() {
343
+ const provider = this.providerLabel(this.sessionState.provider);
344
+ return `${provider} · ${this.sessionState.model}`;
345
+ }
346
+ refreshContextGauge() {
347
+ const tokens = getContextWindowTokens(this.sessionState.model);
348
+ this.activeContextWindowTokens =
349
+ typeof tokens === 'number' && Number.isFinite(tokens) ? tokens : null;
350
+ }
405
351
  handleSlashCommandPreviewChange() {
406
352
  if (this.pendingInteraction || this.awaitingPasteConfirmation) {
407
353
  this.slashPreviewVisible = false;
@@ -415,6 +361,7 @@ export class InteractiveShell {
415
361
  }
416
362
  if (!shouldShow && this.slashPreviewVisible) {
417
363
  this.slashPreviewVisible = false;
364
+ this.uiAdapter.hideSlashCommandPreview();
418
365
  }
419
366
  }
420
367
  shouldShowSlashCommandPreview() {
@@ -428,6 +375,9 @@ export class InteractiveShell {
428
375
  showSlashCommandPreview() {
429
376
  const preview = this.buildSlashCommandList('Slash Commands:');
430
377
  display.showSystemMessage(preview);
378
+ // Also show in the unified UI
379
+ const commands = this.slashCommands.map(cmd => cmd.command);
380
+ this.uiAdapter.showSlashCommandPreview(commands);
431
381
  this.rl.prompt(true);
432
382
  }
433
383
  enqueueUserInput(line, flushImmediately = false) {
@@ -466,6 +416,7 @@ export class InteractiveShell {
466
416
  }
467
417
  async processInputBlock(line, wasRapidMultiLine = false) {
468
418
  this.slashPreviewVisible = false;
419
+ this.uiAdapter.hideSlashCommandPreview();
469
420
  const trimmed = line.trim();
470
421
  if (await this.handlePendingInteraction(trimmed)) {
471
422
  return;
@@ -533,9 +484,6 @@ export class InteractiveShell {
533
484
  case 'model':
534
485
  await this.handleModelSelection(input);
535
486
  return true;
536
- case 'thought-level':
537
- await this.handleThoughtLevelSelection(input);
538
- return true;
539
487
  case 'secret-select':
540
488
  await this.handleSecretSelection(input);
541
489
  return true;
@@ -564,6 +512,15 @@ export class InteractiveShell {
564
512
  case '/tools':
565
513
  this.showToolsMenu();
566
514
  break;
515
+ case '/doctor':
516
+ this.runDoctor();
517
+ break;
518
+ case '/checks':
519
+ await this.runRepoChecksCommand();
520
+ break;
521
+ case '/context':
522
+ await this.refreshWorkspaceContextCommand(input);
523
+ break;
567
524
  case '/agents':
568
525
  this.showAgentsMenu();
569
526
  break;
@@ -581,6 +538,143 @@ export class InteractiveShell {
581
538
  ];
582
539
  display.showSystemMessage(info.join('\n'));
583
540
  }
541
+ runDoctor() {
542
+ const lines = [];
543
+ lines.push(theme.bold('Environment diagnostics'));
544
+ lines.push('');
545
+ lines.push(`${theme.secondary('Workspace')}: ${this.workingDir}`);
546
+ lines.push('');
547
+ lines.push(theme.bold('Provider credentials'));
548
+ const providerDefinition = getSecretDefinitionForProvider(this.sessionState.provider);
549
+ if (providerDefinition) {
550
+ const currentValue = getSecretValue(providerDefinition.id);
551
+ if (currentValue) {
552
+ lines.push(`${theme.success('✓')} ${providerDefinition.label} configured (${providerDefinition.envVar}).`);
553
+ }
554
+ else {
555
+ lines.push(`${theme.warning('⚠')} Missing ${providerDefinition.label} (${providerDefinition.envVar}). Run /secrets to configure it.`);
556
+ }
557
+ }
558
+ else {
559
+ lines.push(`${theme.secondary('•')} ${this.providerLabel(this.sessionState.provider)} does not require an API key.`);
560
+ }
561
+ lines.push('');
562
+ lines.push(theme.bold('Tool suites'));
563
+ const toolSettings = loadToolSettings();
564
+ const selection = buildEnabledToolSet(toolSettings);
565
+ const permissions = evaluateToolPermissions(selection);
566
+ const options = getToolToggleOptions();
567
+ const enabledLabels = options
568
+ .filter((option) => selection.has(option.id))
569
+ .map((option) => option.label);
570
+ lines.push(`Enabled: ${enabledLabels.length ? enabledLabels.join(', ') : 'none'}`);
571
+ if (!permissions.warnings.length) {
572
+ lines.push(theme.success('All enabled suites loaded successfully.'));
573
+ }
574
+ else {
575
+ lines.push(theme.warning('Issues detected:'));
576
+ for (const warning of permissions.warnings) {
577
+ const detail = this.describeToolWarning(warning);
578
+ lines.push(` - ${detail}`);
579
+ }
580
+ }
581
+ display.showSystemMessage(lines.join('\n'));
582
+ }
583
+ async runRepoChecksCommand() {
584
+ if (this.isProcessing) {
585
+ display.showWarning('Wait for the active response to finish before running checks.');
586
+ return;
587
+ }
588
+ const call = {
589
+ id: 'manual-run-repo-checks',
590
+ name: 'run_repo_checks',
591
+ arguments: {},
592
+ };
593
+ display.showInfo('Running repo checks (npm test/build/lint when available)...');
594
+ const output = await this.runtimeSession.toolRuntime.execute(call);
595
+ display.showSystemMessage(output);
596
+ }
597
+ async refreshWorkspaceContextCommand(input) {
598
+ if (this.isProcessing) {
599
+ display.showWarning('Wait for the active response to finish before refreshing the snapshot.');
600
+ return;
601
+ }
602
+ const { overrides, error } = this.parseContextOverrideTokens(input);
603
+ if (error) {
604
+ display.showWarning(`${error} ${this.describeContextOverrideUsage()}`);
605
+ return;
606
+ }
607
+ if (overrides) {
608
+ this.workspaceOptions = { ...this.workspaceOptions, ...overrides };
609
+ }
610
+ display.showInfo('Refreshing workspace snapshot...');
611
+ const context = buildWorkspaceContext(this.workingDir, this.workspaceOptions);
612
+ const profileConfig = this.runtimeSession.refreshWorkspaceContext(context);
613
+ const tools = this.runtimeSession.toolRuntime.listProviderTools();
614
+ this.baseSystemPrompt = buildInteractiveSystemPrompt(profileConfig.systemPrompt, profileConfig.label, tools);
615
+ if (this.rebuildAgent()) {
616
+ display.showInfo(`Workspace snapshot refreshed (${this.describeWorkspaceOptions()}).`);
617
+ }
618
+ else {
619
+ display.showWarning('Workspace snapshot refreshed, but the agent failed to rebuild. Run /doctor for details.');
620
+ }
621
+ }
622
+ parseContextOverrideTokens(input) {
623
+ const overrides = {};
624
+ let hasOverride = false;
625
+ const tokens = input
626
+ .trim()
627
+ .split(/\s+/)
628
+ .slice(1);
629
+ for (const token of tokens) {
630
+ if (!token) {
631
+ continue;
632
+ }
633
+ const [rawKey, rawValue] = token.split('=');
634
+ if (!rawKey || !rawValue) {
635
+ return { overrides: null, error: `Invalid option "${token}".` };
636
+ }
637
+ const key = rawKey.toLowerCase();
638
+ const value = Number.parseInt(rawValue, 10);
639
+ if (!Number.isFinite(value) || value <= 0) {
640
+ return { overrides: null, error: `Value for "${key}" must be a positive integer.` };
641
+ }
642
+ switch (key) {
643
+ case 'depth':
644
+ overrides.treeDepth = value;
645
+ hasOverride = true;
646
+ break;
647
+ case 'entries':
648
+ overrides.maxEntries = value;
649
+ hasOverride = true;
650
+ break;
651
+ case 'excerpt':
652
+ case 'doc':
653
+ case 'docs':
654
+ overrides.docExcerptLimit = value;
655
+ hasOverride = true;
656
+ break;
657
+ default:
658
+ return { overrides: null, error: `Unknown option "${key}".` };
659
+ }
660
+ }
661
+ return { overrides: hasOverride ? overrides : null };
662
+ }
663
+ describeWorkspaceOptions() {
664
+ const depth = this.workspaceOptions.treeDepth ?? 'default';
665
+ const entries = this.workspaceOptions.maxEntries ?? 'default';
666
+ const excerpt = this.workspaceOptions.docExcerptLimit ?? 'default';
667
+ return `depth=${depth}, entries=${entries}, excerpt=${excerpt}`;
668
+ }
669
+ describeContextOverrideUsage() {
670
+ return 'Usage: /context [depth=<n>] [entries=<n>] [excerpt=<n>]';
671
+ }
672
+ describeToolWarning(warning) {
673
+ if (warning.reason === 'missing-secret' && warning.secretId) {
674
+ return `${warning.label}: missing ${warning.secretId}. Use /secrets to configure it.`;
675
+ }
676
+ return `${warning.label}: ${warning.reason}.`;
677
+ }
584
678
  buildSlashCommandList(header) {
585
679
  const lines = [theme.gradient.primary(header), ''];
586
680
  for (const command of this.slashCommands) {
@@ -649,34 +743,6 @@ export class InteractiveShell {
649
743
  display.showSystemMessage(lines.join('\n'));
650
744
  this.pendingInteraction = { type: 'model', provider: option.provider, options: models };
651
745
  }
652
- showThoughtLevelMenu(preset) {
653
- const options = preset.thoughtLevels ?? [];
654
- if (!options.length) {
655
- return;
656
- }
657
- const lines = [
658
- theme.bold(`Select a thought level for ${preset.label}:`),
659
- ...options.map((option, index) => {
660
- const isCurrent = this.sessionState.model === preset.id && this.sessionState.thoughtLevel?.id === option.id;
661
- const label = this.colorizeDropdownLine(`${index + 1}. ${option.label}`, index);
662
- const suffix = isCurrent ? ` ${theme.primary('• current')}` : '';
663
- const description = this.colorizeDropdownLine(` ${option.description}`, index);
664
- return `${label}${suffix}\n${description}`;
665
- }),
666
- 'Type the number of the thought level to use it, type "back" to pick another model, or type "cancel".',
667
- ];
668
- display.showSystemMessage(lines.join('\n'));
669
- this.pendingInteraction = { type: 'thought-level', preset, options };
670
- }
671
- showModelsForProvider(providerId) {
672
- const providerOptions = this.buildProviderOptions();
673
- const target = providerOptions.find((entry) => entry.provider === providerId);
674
- if (target) {
675
- this.showProviderModels(target);
676
- return;
677
- }
678
- this.showModelMenu();
679
- }
680
746
  showSecretsMenu() {
681
747
  const definitions = listSecretDefinitions();
682
748
  const lines = [
@@ -836,77 +902,27 @@ export class InteractiveShell {
836
902
  return;
837
903
  }
838
904
  this.pendingInteraction = null;
839
- if (preset.thoughtLevels && preset.thoughtLevels.length > 0) {
840
- this.showThoughtLevelMenu(preset);
841
- this.rl.prompt();
842
- return;
843
- }
844
905
  await this.applyModelPreset(preset);
845
906
  this.rl.prompt();
846
907
  }
847
- async handleThoughtLevelSelection(input) {
848
- const pending = this.pendingInteraction;
849
- if (!pending || pending.type !== 'thought-level') {
850
- return;
851
- }
852
- const trimmed = input.trim();
853
- if (!trimmed) {
854
- display.showWarning('Enter a number, type "back", or type "cancel".');
855
- this.rl.prompt();
856
- return;
857
- }
858
- const normalized = trimmed.toLowerCase();
859
- if (normalized === 'back') {
860
- this.pendingInteraction = null;
861
- this.showModelsForProvider(pending.preset.provider);
862
- this.rl.prompt();
863
- return;
864
- }
865
- if (normalized === 'cancel') {
866
- this.pendingInteraction = null;
867
- display.showInfo('Thought level selection cancelled.');
868
- this.rl.prompt();
869
- return;
870
- }
871
- const choice = Number.parseInt(trimmed, 10);
872
- if (!Number.isFinite(choice)) {
873
- display.showWarning('Please enter a valid number.');
874
- this.rl.prompt();
875
- return;
876
- }
877
- const option = pending.options[choice - 1];
878
- if (!option) {
879
- display.showWarning('That option is not available.');
880
- this.rl.prompt();
881
- return;
882
- }
883
- this.pendingInteraction = null;
884
- await this.applyModelPreset(pending.preset, option);
885
- this.rl.prompt();
886
- }
887
- async applyModelPreset(preset, thoughtLevel) {
908
+ async applyModelPreset(preset) {
888
909
  try {
889
910
  ensureSecretForProvider(preset.provider);
890
911
  }
891
912
  catch (error) {
892
- this.handleAgentSetupError(error, () => this.applyModelPreset(preset, thoughtLevel), preset.provider);
913
+ this.handleAgentSetupError(error, () => this.applyModelPreset(preset), preset.provider);
893
914
  return;
894
915
  }
895
- const existingThoughtLevelId = this.sessionState.thoughtLevel?.id;
896
- const resolvedThoughtLevel = thoughtLevel ??
897
- (preset.thoughtLevels?.length && existingThoughtLevelId
898
- ? preset.thoughtLevels.find((option) => option.id === existingThoughtLevelId)
899
- : undefined);
900
916
  this.sessionState = {
901
917
  provider: preset.provider,
902
918
  model: preset.id,
903
919
  temperature: preset.temperature,
904
920
  maxTokens: preset.maxTokens,
905
- thoughtLevel: resolvedThoughtLevel,
921
+ reasoningEffort: preset.reasoningEffort,
906
922
  };
923
+ this.applyPresetReasoningDefaults();
907
924
  if (this.rebuildAgent()) {
908
- const suffix = resolvedThoughtLevel ? ` (${resolvedThoughtLevel.label} thought level)` : '';
909
- display.showInfo(`Switched to ${preset.label}${suffix}.`);
925
+ display.showInfo(`Switched to ${preset.label}.`);
910
926
  this.refreshBannerSessionInfo();
911
927
  this.persistSessionPreference();
912
928
  }
@@ -997,8 +1013,12 @@ export class InteractiveShell {
997
1013
  return;
998
1014
  }
999
1015
  this.isProcessing = true;
1016
+ this.promptSkin.setOverlayVisible(false);
1017
+ this.uiAdapter.startProcessing('Working on your request');
1018
+ this.setProcessingStatus();
1000
1019
  try {
1001
1020
  display.newLine();
1021
+ display.showThinking('Working on your request...');
1002
1022
  await agent.send(request);
1003
1023
  await this.awaitPendingCleanup();
1004
1024
  }
@@ -1009,7 +1029,11 @@ export class InteractiveShell {
1009
1029
  }
1010
1030
  }
1011
1031
  finally {
1032
+ display.stopThinking();
1012
1033
  this.isProcessing = false;
1034
+ this.promptSkin.setOverlayVisible(true);
1035
+ this.uiAdapter.endProcessing('Ready for prompts');
1036
+ this.setIdleStatus();
1013
1037
  display.newLine();
1014
1038
  }
1015
1039
  }
@@ -1037,14 +1061,24 @@ export class InteractiveShell {
1037
1061
  model: this.sessionState.model,
1038
1062
  temperature: this.sessionState.temperature,
1039
1063
  maxTokens: this.sessionState.maxTokens,
1040
- thoughtLevelId: this.sessionState.thoughtLevel?.id,
1041
- reasoningEffort: this.sessionState.thoughtLevel?.reasoningEffort,
1042
- textVerbosity: this.sessionState.thoughtLevel?.textVerbosity,
1043
1064
  systemPrompt: this.buildSystemPrompt(),
1065
+ reasoningEffort: this.sessionState.reasoningEffort,
1044
1066
  };
1045
1067
  this.agent = this.runtimeSession.createAgent(selection, {
1046
1068
  onAssistantMessage: (content, metadata) => {
1047
1069
  const enriched = this.buildDisplayMetadata(metadata);
1070
+ // Update spinner based on message type
1071
+ if (metadata.isFinal) {
1072
+ // Final response - update spinner before showing message
1073
+ display.updateThinking('Formulating response...');
1074
+ }
1075
+ else {
1076
+ // Thought/reasoning - extract key insight for spinner
1077
+ const thoughtSummary = this.extractThoughtSummary(content);
1078
+ if (thoughtSummary) {
1079
+ display.updateThinking(`💭 ${thoughtSummary}`);
1080
+ }
1081
+ }
1048
1082
  display.showAssistantMessage(content, enriched);
1049
1083
  const cleanup = this.handleContextTelemetry(metadata, enriched);
1050
1084
  if (cleanup) {
@@ -1076,20 +1110,13 @@ export class InteractiveShell {
1076
1110
  if (typeof this.sessionState.maxTokens === 'number') {
1077
1111
  lines.push(`- Max tokens: ${this.sessionState.maxTokens}`);
1078
1112
  }
1079
- if (this.sessionState.thoughtLevel) {
1080
- lines.push(`- Thought level: ${this.sessionState.thoughtLevel.label}`);
1081
- }
1082
1113
  lines.push('', 'Use these values when describing your identity or answering model/provider questions. If anything feels stale, call the `profile_details` tool before responding.');
1083
- if (this.sessionState.thoughtLevel) {
1084
- lines.push('', `THOUGHT LEVEL DIRECTIVE (${this.sessionState.thoughtLevel.label.toUpperCase()}):`, this.sessionState.thoughtLevel.instruction);
1085
- }
1086
1114
  return lines.join('\n').trim();
1087
1115
  }
1088
1116
  buildDisplayMetadata(metadata) {
1089
- const contextWindowTokens = getContextWindowTokens(this.sessionState.model);
1090
1117
  return {
1091
1118
  ...metadata,
1092
- contextWindowTokens,
1119
+ contextWindowTokens: this.activeContextWindowTokens,
1093
1120
  };
1094
1121
  }
1095
1122
  handleContextTelemetry(metadata, displayMetadata) {
@@ -1105,6 +1132,9 @@ export class InteractiveShell {
1105
1132
  return null;
1106
1133
  }
1107
1134
  const usageRatio = total / windowTokens;
1135
+ // Always update context usage in the UI
1136
+ const percentUsed = Math.round(usageRatio * 100);
1137
+ this.uiAdapter.updateContextUsage(percentUsed);
1108
1138
  if (usageRatio < CONTEXT_USAGE_THRESHOLD) {
1109
1139
  return null;
1110
1140
  }
@@ -1130,6 +1160,8 @@ export class InteractiveShell {
1130
1160
  return;
1131
1161
  }
1132
1162
  this.cleanupInProgress = true;
1163
+ const cleanupStatusId = 'context-cleanup';
1164
+ let cleanupOverlayActive = false;
1133
1165
  try {
1134
1166
  const history = this.agent.getHistory();
1135
1167
  const { system, conversation } = this.partitionHistory(history);
@@ -1142,7 +1174,14 @@ export class InteractiveShell {
1142
1174
  if (!toSummarize.length) {
1143
1175
  return;
1144
1176
  }
1177
+ cleanupOverlayActive = true;
1178
+ this.statusTracker.pushOverride(cleanupStatusId, 'Running context cleanup', {
1179
+ detail: `Summarizing ${toSummarize.length} earlier messages`,
1180
+ tone: 'warning',
1181
+ });
1145
1182
  const percentUsed = Math.round((totalTokens / windowTokens) * 100);
1183
+ // Update context usage in unified UI
1184
+ this.uiAdapter.updateContextUsage(percentUsed);
1146
1185
  display.showSystemMessage([
1147
1186
  `Context usage: ${totalTokens.toLocaleString('en-US')} of ${windowTokens.toLocaleString('en-US')} tokens`,
1148
1187
  `(${percentUsed}% full). Running automatic cleanup...`,
@@ -1156,6 +1195,9 @@ export class InteractiveShell {
1156
1195
  display.showSystemMessage(`Context cleanup complete. Summarized ${toSummarize.length} earlier messages and preserved the latest ${preserved.length}.`);
1157
1196
  }
1158
1197
  finally {
1198
+ if (cleanupOverlayActive) {
1199
+ this.statusTracker.clearOverride(cleanupStatusId);
1200
+ }
1159
1201
  this.cleanupInProgress = false;
1160
1202
  }
1161
1203
  }
@@ -1341,30 +1383,29 @@ export class InteractiveShell {
1341
1383
  findModelPreset(modelId) {
1342
1384
  return MODEL_PRESETS.find((preset) => preset.id === modelId);
1343
1385
  }
1344
- resolveThoughtLevelOption(modelId, thoughtLevelId) {
1345
- if (!thoughtLevelId) {
1346
- return undefined;
1386
+ applyPresetReasoningDefaults() {
1387
+ if (this.sessionState.reasoningEffort) {
1388
+ return;
1347
1389
  }
1348
- const preset = this.findModelPreset(modelId);
1349
- if (!preset?.thoughtLevels?.length) {
1350
- return undefined;
1390
+ const preset = this.findModelPreset(this.sessionState.model);
1391
+ if (preset?.reasoningEffort) {
1392
+ this.sessionState.reasoningEffort = preset.reasoningEffort;
1351
1393
  }
1352
- return preset.thoughtLevels.find((option) => option.id === thoughtLevelId);
1353
1394
  }
1354
1395
  refreshBannerSessionInfo() {
1355
1396
  const nextState = {
1356
1397
  model: this.sessionState.model,
1357
1398
  provider: this.sessionState.provider,
1358
- thoughtLabel: this.sessionState.thoughtLevel?.label,
1359
1399
  };
1360
1400
  const previous = this.bannerSessionState;
1361
- if (previous &&
1362
- previous.model === nextState.model &&
1363
- previous.provider === nextState.provider &&
1364
- previous.thoughtLabel === nextState.thoughtLabel) {
1401
+ if (previous && previous.model === nextState.model && previous.provider === nextState.provider) {
1365
1402
  return;
1366
1403
  }
1367
- display.updateSessionInfo(nextState.model, nextState.provider, nextState.thoughtLabel);
1404
+ this.refreshContextGauge();
1405
+ display.updateSessionInfo(nextState.model, nextState.provider);
1406
+ if (!this.isProcessing) {
1407
+ this.setIdleStatus();
1408
+ }
1368
1409
  this.bannerSessionState = nextState;
1369
1410
  }
1370
1411
  providerLabel(id) {
@@ -1377,13 +1418,34 @@ export class InteractiveShell {
1377
1418
  const entry = this.agentMenu.options.find((option) => option.name === name);
1378
1419
  return entry?.label ?? name;
1379
1420
  }
1421
+ extractThoughtSummary(thought) {
1422
+ // Extract first non-empty line
1423
+ const lines = thought?.split('\n').filter(line => line.trim()) ?? [];
1424
+ if (!lines.length) {
1425
+ return null;
1426
+ }
1427
+ // Remove common thought prefixes
1428
+ const cleaned = lines[0]
1429
+ .trim()
1430
+ .replace(/^(Thinking|Analyzing|Considering|Looking at|Let me)[:.\s]+/i, '')
1431
+ .replace(/^I (should|need to|will|am)[:.\s]+/i, '')
1432
+ .trim();
1433
+ if (!cleaned) {
1434
+ return null;
1435
+ }
1436
+ // Truncate to reasonable length
1437
+ const maxLength = 50;
1438
+ return cleaned.length > maxLength
1439
+ ? cleaned.slice(0, maxLength - 3) + '...'
1440
+ : cleaned;
1441
+ }
1380
1442
  persistSessionPreference() {
1381
1443
  saveModelPreference(this.profile, {
1382
1444
  provider: this.sessionState.provider,
1383
1445
  model: this.sessionState.model,
1384
1446
  temperature: this.sessionState.temperature,
1385
1447
  maxTokens: this.sessionState.maxTokens,
1386
- thoughtLevelId: this.sessionState.thoughtLevel?.id,
1448
+ reasoningEffort: this.sessionState.reasoningEffort,
1387
1449
  });
1388
1450
  }
1389
1451
  enableBracketedPasteMode() {
@@ -1424,3 +1486,4 @@ function setsEqual(first, second) {
1424
1486
  }
1425
1487
  return true;
1426
1488
  }
1489
+ //# sourceMappingURL=interactiveShell.js.map