@nghyane/arcane 0.1.13 → 0.1.15

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 (303) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/package.json +21 -70
  3. package/scripts/format-prompts.ts +1 -3
  4. package/src/cli/args.ts +2 -7
  5. package/src/cli/config-cli.ts +1 -1
  6. package/src/cli/plugin-cli.ts +1 -1
  7. package/src/cli/setup-cli.ts +1 -1
  8. package/src/cli/update-cli.ts +1 -1
  9. package/src/cli/web-search-cli.ts +1 -1
  10. package/src/cli.ts +0 -1
  11. package/src/commands/config.ts +1 -1
  12. package/src/commands/grep.ts +1 -1
  13. package/src/commands/jupyter.ts +1 -1
  14. package/src/commands/plugin.ts +1 -1
  15. package/src/commands/setup.ts +1 -1
  16. package/src/commands/shell.ts +1 -1
  17. package/src/commands/ssh.ts +1 -1
  18. package/src/commands/stats.ts +1 -1
  19. package/src/commands/update.ts +1 -1
  20. package/src/config/model-registry.ts +3 -4
  21. package/src/config/model-resolver.ts +36 -9
  22. package/src/config/prompt-templates.ts +1 -9
  23. package/src/config/settings-schema.ts +32 -88
  24. package/src/config/settings.ts +3 -4
  25. package/src/debug/index.ts +1 -1
  26. package/src/debug/log-formatting.ts +1 -1
  27. package/src/debug/log-viewer.ts +2 -2
  28. package/src/discovery/helpers.ts +13 -3
  29. package/src/exa/index.ts +1 -35
  30. package/src/exa/render.ts +30 -190
  31. package/src/export/html/index.ts +1 -1
  32. package/src/extensibility/custom-tools/loader.ts +1 -1
  33. package/src/extensibility/custom-tools/types.ts +5 -1
  34. package/src/extensibility/custom-tools/wrapper.ts +1 -1
  35. package/src/extensibility/extensions/runner.ts +1 -1
  36. package/src/extensibility/extensions/types.ts +1 -1
  37. package/src/extensibility/extensions/wrapper.ts +7 -15
  38. package/src/extensibility/hooks/runner.ts +1 -1
  39. package/src/extensibility/hooks/types.ts +1 -1
  40. package/src/extensibility/plugins/doctor.ts +1 -1
  41. package/src/index.ts +13 -13
  42. package/src/lsp/index.ts +77 -24
  43. package/src/lsp/render.ts +34 -583
  44. package/src/lsp/types.ts +3 -3
  45. package/src/lsp/utils.ts +1 -1
  46. package/src/main.ts +1 -1
  47. package/src/mcp/tool-bridge.ts +1 -24
  48. package/src/modes/components/assistant-message.ts +7 -7
  49. package/src/modes/components/bash-execution.ts +50 -112
  50. package/src/modes/components/bordered-loader.ts +1 -1
  51. package/src/modes/components/branch-summary-message.ts +16 -10
  52. package/src/modes/components/compaction-summary-message.ts +20 -12
  53. package/src/modes/components/context-group.ts +106 -0
  54. package/src/modes/components/custom-message.ts +4 -5
  55. package/src/modes/components/diff.ts +2 -2
  56. package/src/modes/components/dynamic-border.ts +1 -1
  57. package/src/modes/components/extensions/extension-dashboard.ts +1 -1
  58. package/src/modes/components/extensions/extension-list.ts +1 -1
  59. package/src/modes/components/extensions/inspector-panel.ts +1 -1
  60. package/src/modes/components/footer.ts +2 -2
  61. package/src/modes/components/history-search.ts +1 -1
  62. package/src/modes/components/hook-editor.ts +1 -1
  63. package/src/modes/components/hook-input.ts +1 -1
  64. package/src/modes/components/hook-message.ts +4 -5
  65. package/src/modes/components/hook-selector.ts +1 -1
  66. package/src/modes/components/index.ts +0 -2
  67. package/src/modes/components/keybinding-hints.ts +1 -1
  68. package/src/modes/components/login-dialog.ts +1 -1
  69. package/src/modes/components/mcp-add-wizard.ts +1 -1
  70. package/src/modes/components/model-selector.ts +1 -1
  71. package/src/modes/components/oauth-selector.ts +1 -1
  72. package/src/modes/components/plugin-settings.ts +1 -1
  73. package/src/modes/components/python-execution.ts +51 -91
  74. package/src/modes/components/queue-mode-selector.ts +1 -1
  75. package/src/modes/components/session-selector.ts +1 -1
  76. package/src/modes/components/settings-defs.ts +5 -10
  77. package/src/modes/components/settings-selector.ts +1 -1
  78. package/src/modes/components/show-images-selector.ts +1 -1
  79. package/src/modes/components/skill-message.ts +4 -4
  80. package/src/modes/components/status-line/segments.ts +2 -2
  81. package/src/modes/components/status-line/separators.ts +1 -1
  82. package/src/modes/components/status-line-segment-editor.ts +1 -1
  83. package/src/modes/components/status-line.ts +1 -1
  84. package/src/modes/components/theme-selector.ts +1 -1
  85. package/src/modes/components/thinking-selector.ts +1 -1
  86. package/src/modes/components/todo-display.ts +2 -4
  87. package/src/modes/components/todo-reminder.ts +4 -4
  88. package/src/modes/components/tool-execution.ts +118 -440
  89. package/src/modes/components/tool-image-display.ts +107 -0
  90. package/src/modes/components/tree-selector.ts +2 -2
  91. package/src/modes/components/ttsr-notification.ts +4 -17
  92. package/src/modes/components/user-message-selector.ts +1 -1
  93. package/src/modes/components/user-message.ts +9 -10
  94. package/src/modes/components/welcome.ts +1 -1
  95. package/src/modes/controllers/command-controller.ts +1 -1
  96. package/src/modes/controllers/event-controller.ts +58 -187
  97. package/src/modes/controllers/extension-ui-controller.ts +1 -1
  98. package/src/modes/controllers/input-controller.ts +3 -1
  99. package/src/modes/controllers/mcp-command-controller.ts +1 -1
  100. package/src/modes/controllers/selector-controller.ts +3 -26
  101. package/src/modes/controllers/ssh-command-controller.ts +1 -1
  102. package/src/modes/interactive-mode.ts +3 -7
  103. package/src/modes/print-mode.ts +5 -5
  104. package/src/modes/rpc/rpc-mode.ts +1 -1
  105. package/src/modes/types.ts +1 -2
  106. package/src/modes/utils/ui-helpers.ts +34 -32
  107. package/src/patch/edit-tool.ts +742 -0
  108. package/src/patch/index.ts +32 -898
  109. package/src/patch/schemas.ts +208 -0
  110. package/src/patch/shared.ts +83 -151
  111. package/src/prompts/agents/explore.md +22 -37
  112. package/src/prompts/agents/init.md +1 -1
  113. package/src/prompts/agents/librarian.md +29 -20
  114. package/src/prompts/agents/oracle.md +9 -2
  115. package/src/prompts/agents/reviewer.md +14 -48
  116. package/src/prompts/agents/task.md +16 -8
  117. package/src/prompts/compaction/branch-summary.md +4 -1
  118. package/src/prompts/compaction/compaction-summary.md +4 -1
  119. package/src/prompts/system/subagent-system-prompt.md +1 -1
  120. package/src/prompts/system/system-prompt.md +162 -178
  121. package/src/prompts/system/verification-reminder.md +6 -0
  122. package/src/sdk.ts +0 -9
  123. package/src/session/agent-session.ts +244 -1459
  124. package/src/session/model-controller.ts +406 -0
  125. package/src/session/retry-utils.ts +71 -0
  126. package/src/session/session-manager.ts +22 -186
  127. package/src/session/session-types.ts +312 -0
  128. package/src/session/stats.ts +387 -0
  129. package/src/session/streaming-edit.ts +258 -0
  130. package/src/session/ttsr.ts +213 -0
  131. package/src/slash-commands/builtin-registry.ts +0 -8
  132. package/src/stt/recorder.ts +2 -2
  133. package/src/system-prompt.ts +1 -14
  134. package/src/task/agents.ts +7 -33
  135. package/src/task/executor.ts +50 -438
  136. package/src/task/index.ts +104 -71
  137. package/src/task/progress-tracker.ts +390 -0
  138. package/src/task/render.ts +371 -187
  139. package/src/task/subprocess-tool-registry.ts +1 -1
  140. package/src/task/types.ts +14 -47
  141. package/src/tools/ask.ts +31 -42
  142. package/src/tools/bash-interactive.ts +2 -2
  143. package/src/tools/bash-interceptor.ts +2 -2
  144. package/src/tools/bash-normalize.ts +1 -1
  145. package/src/tools/bash-skill-urls.ts +2 -2
  146. package/src/tools/bash.ts +87 -136
  147. package/src/tools/browser.ts +54 -84
  148. package/src/tools/create-tools.ts +186 -0
  149. package/src/tools/default-renderer.ts +104 -0
  150. package/src/tools/explore.ts +11 -10
  151. package/src/tools/fetch.ts +24 -114
  152. package/src/tools/find.ts +48 -132
  153. package/src/tools/gemini-image.ts +5 -15
  154. package/src/tools/github.ts +450 -0
  155. package/src/tools/grep.ts +43 -179
  156. package/src/tools/index.ts +35 -198
  157. package/src/tools/json-tree.ts +3 -3
  158. package/src/tools/librarian.ts +18 -18
  159. package/src/tools/list-limit.ts +2 -2
  160. package/src/tools/notebook.ts +35 -87
  161. package/src/tools/oracle.ts +25 -25
  162. package/src/tools/output-meta.ts +89 -4
  163. package/src/tools/output-utils.ts +2 -2
  164. package/src/tools/python.ts +86 -637
  165. package/src/tools/read.ts +36 -119
  166. package/src/tools/reviewer-tool.ts +19 -21
  167. package/src/tools/search-code.ts +128 -0
  168. package/src/tools/ssh.ts +67 -126
  169. package/src/tools/subagent-tool.ts +197 -123
  170. package/src/tools/todo-write.ts +15 -31
  171. package/src/tools/tool-errors.ts +0 -30
  172. package/src/tools/undo-edit.ts +30 -67
  173. package/src/tools/write.ts +78 -127
  174. package/src/tui/code-cell.ts +4 -4
  175. package/src/tui/file-list.ts +2 -2
  176. package/src/tui/output-block.ts +1 -1
  177. package/src/tui/status-line.ts +1 -1
  178. package/src/tui/tree-list.ts +2 -2
  179. package/src/tui/types.ts +1 -1
  180. package/src/tui/utils.ts +1 -1
  181. package/src/{tools → ui}/render-utils.ts +87 -126
  182. package/src/utils/external-editor.ts +4 -4
  183. package/src/utils/file-mentions.ts +1 -1
  184. package/src/utils/index.ts +30 -0
  185. package/src/utils/tools-manager.ts +9 -19
  186. package/src/web/github-client.ts +290 -0
  187. package/src/web/scrapers/github.ts +11 -62
  188. package/src/web/search/auth.ts +1 -3
  189. package/src/web/search/index.ts +82 -46
  190. package/src/web/search/provider.ts +11 -16
  191. package/src/web/search/providers/grep.ts +160 -0
  192. package/src/web/search/render.ts +48 -235
  193. package/src/web/search/types.ts +1 -1
  194. package/src/commands/commit.ts +0 -36
  195. package/src/commit/agentic/agent.ts +0 -311
  196. package/src/commit/agentic/fallback.ts +0 -96
  197. package/src/commit/agentic/index.ts +0 -359
  198. package/src/commit/agentic/prompts/analyze-file.md +0 -22
  199. package/src/commit/agentic/prompts/session-user.md +0 -25
  200. package/src/commit/agentic/prompts/split-confirm.md +0 -1
  201. package/src/commit/agentic/prompts/system.md +0 -38
  202. package/src/commit/agentic/state.ts +0 -69
  203. package/src/commit/agentic/tools/analyze-file.ts +0 -118
  204. package/src/commit/agentic/tools/git-file-diff.ts +0 -194
  205. package/src/commit/agentic/tools/git-hunk.ts +0 -50
  206. package/src/commit/agentic/tools/git-overview.ts +0 -84
  207. package/src/commit/agentic/tools/index.ts +0 -56
  208. package/src/commit/agentic/tools/propose-changelog.ts +0 -128
  209. package/src/commit/agentic/tools/propose-commit.ts +0 -154
  210. package/src/commit/agentic/tools/recent-commits.ts +0 -81
  211. package/src/commit/agentic/tools/split-commit.ts +0 -280
  212. package/src/commit/agentic/topo-sort.ts +0 -44
  213. package/src/commit/agentic/trivial.ts +0 -51
  214. package/src/commit/agentic/validation.ts +0 -200
  215. package/src/commit/analysis/conventional.ts +0 -165
  216. package/src/commit/analysis/index.ts +0 -4
  217. package/src/commit/analysis/scope.ts +0 -242
  218. package/src/commit/analysis/summary.ts +0 -112
  219. package/src/commit/analysis/validation.ts +0 -66
  220. package/src/commit/changelog/detect.ts +0 -37
  221. package/src/commit/changelog/generate.ts +0 -110
  222. package/src/commit/changelog/index.ts +0 -234
  223. package/src/commit/changelog/parse.ts +0 -44
  224. package/src/commit/cli.ts +0 -93
  225. package/src/commit/git/diff.ts +0 -148
  226. package/src/commit/git/errors.ts +0 -9
  227. package/src/commit/git/index.ts +0 -211
  228. package/src/commit/git/operations.ts +0 -54
  229. package/src/commit/index.ts +0 -5
  230. package/src/commit/map-reduce/index.ts +0 -64
  231. package/src/commit/map-reduce/map-phase.ts +0 -178
  232. package/src/commit/map-reduce/reduce-phase.ts +0 -145
  233. package/src/commit/map-reduce/utils.ts +0 -9
  234. package/src/commit/message.ts +0 -11
  235. package/src/commit/model-selection.ts +0 -69
  236. package/src/commit/pipeline.ts +0 -243
  237. package/src/commit/prompts/analysis-system.md +0 -148
  238. package/src/commit/prompts/analysis-user.md +0 -38
  239. package/src/commit/prompts/changelog-system.md +0 -50
  240. package/src/commit/prompts/changelog-user.md +0 -18
  241. package/src/commit/prompts/file-observer-system.md +0 -24
  242. package/src/commit/prompts/file-observer-user.md +0 -8
  243. package/src/commit/prompts/reduce-system.md +0 -50
  244. package/src/commit/prompts/reduce-user.md +0 -17
  245. package/src/commit/prompts/summary-retry.md +0 -3
  246. package/src/commit/prompts/summary-system.md +0 -38
  247. package/src/commit/prompts/summary-user.md +0 -13
  248. package/src/commit/prompts/types-description.md +0 -2
  249. package/src/commit/types.ts +0 -109
  250. package/src/commit/utils/exclusions.ts +0 -42
  251. package/src/mcp/render.ts +0 -123
  252. package/src/modes/components/agent-dashboard.ts +0 -1130
  253. package/src/modes/components/codemode-group.ts +0 -369
  254. package/src/modes/components/read-tool-group.ts +0 -119
  255. package/src/modes/components/visual-truncate.ts +0 -63
  256. package/src/prompts/system/subagent-user-prompt.md +0 -8
  257. package/src/prompts/tools/ask.md +0 -44
  258. package/src/prompts/tools/bash.md +0 -24
  259. package/src/prompts/tools/browser.md +0 -33
  260. package/src/prompts/tools/calculator.md +0 -12
  261. package/src/prompts/tools/explore.md +0 -29
  262. package/src/prompts/tools/fetch.md +0 -16
  263. package/src/prompts/tools/find.md +0 -18
  264. package/src/prompts/tools/gemini-image.md +0 -23
  265. package/src/prompts/tools/grep.md +0 -28
  266. package/src/prompts/tools/hashline.md +0 -232
  267. package/src/prompts/tools/librarian.md +0 -24
  268. package/src/prompts/tools/lsp.md +0 -28
  269. package/src/prompts/tools/oracle.md +0 -26
  270. package/src/prompts/tools/patch.md +0 -74
  271. package/src/prompts/tools/python.md +0 -66
  272. package/src/prompts/tools/read.md +0 -36
  273. package/src/prompts/tools/replace.md +0 -38
  274. package/src/prompts/tools/reviewer.md +0 -41
  275. package/src/prompts/tools/ssh.md +0 -51
  276. package/src/prompts/tools/task-summary.md +0 -28
  277. package/src/prompts/tools/task.md +0 -146
  278. package/src/prompts/tools/todo-write.md +0 -65
  279. package/src/prompts/tools/undo-edit.md +0 -7
  280. package/src/prompts/tools/web-search.md +0 -19
  281. package/src/prompts/tools/write.md +0 -18
  282. package/src/task/batch.ts +0 -102
  283. package/src/task/discovery.ts +0 -126
  284. package/src/task/parallel.ts +0 -84
  285. package/src/task/template.ts +0 -32
  286. package/src/tools/calculator.ts +0 -537
  287. package/src/tools/jtd-to-typescript.ts +0 -198
  288. package/src/tools/renderers.ts +0 -60
  289. package/src/tools/tool-result.ts +0 -86
  290. /package/src/{modes/theme → theme}/dark.json +0 -0
  291. /package/src/{modes/theme → theme}/defaults/dark-catppuccin.json +0 -0
  292. /package/src/{modes/theme → theme}/defaults/dark-dracula.json +0 -0
  293. /package/src/{modes/theme → theme}/defaults/dark-gruvbox.json +0 -0
  294. /package/src/{modes/theme → theme}/defaults/dark-solarized.json +0 -0
  295. /package/src/{modes/theme → theme}/defaults/dark-tokyo-night.json +0 -0
  296. /package/src/{modes/theme → theme}/defaults/index.ts +0 -0
  297. /package/src/{modes/theme → theme}/defaults/light-catppuccin.json +0 -0
  298. /package/src/{modes/theme → theme}/defaults/light-github.json +0 -0
  299. /package/src/{modes/theme → theme}/defaults/light-solarized.json +0 -0
  300. /package/src/{modes/theme → theme}/light.json +0 -0
  301. /package/src/{modes/theme → theme}/mermaid-cache.ts +0 -0
  302. /package/src/{modes/theme → theme}/theme-schema.json +0 -0
  303. /package/src/{modes/theme → theme}/theme.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.14] - 2026-03-02
6
+
7
+ ### Removed
8
+
9
+ - `arc commit` command and entire commit pipeline (agentic commit, map-reduce, changelog generation)
10
+ - `quick_task` bundled agent (only used by commit flow)
11
+ - `commit.*` settings (`mapReduceEnabled`, `mapReduceMinFiles`, `mapReduceMaxFileTokens`, `mapReduceTimeoutMs`, `mapReduceMaxConcurrency`, `changelogMaxDiffChars`)
12
+ - Codemode execution layer — LLM now calls tools natively instead of writing JavaScript ([#49](https://github.com/nghyane/arcane/issues/49))
13
+ - `code-tool.ts`, `executor.ts`, `normalize.ts`, `prompt.ts`, and all codemode prompt snippets
14
+ - `CodeGroupComponent` TUI component (step/progress rendering for code tool)
15
+
16
+ ### Added
17
+
18
+ - Context tool grouping: consecutive read/grep/find/fetch/search_code/lsp/notebook calls are batched into a collapsible summary line (Ctrl+O to expand) ([#51](https://github.com/nghyane/arcane/issues/51))
19
+ - Left-border accent style for action/subagent tool output, replacing full-background boxes ([#51](https://github.com/nghyane/arcane/issues/51))
20
+ - `LeftBorderBox` TUI component for rendering content with a colored left border
21
+ - `ContextGroupComponent` for batching context-gathering tools
22
+ - `isContextTool()` utility in render-utils
23
+ - `setMarginTop()` on `ToolExecutionComponent` for sibling-aware spacing
24
+
25
+ ### Changed
26
+
27
+ - Tools are now returned directly from `createTools()` as individual `AgentTool` instances
28
+ - System prompt updated for native tool calling guidance
29
+ - Tool output styling changed from background color to left-border color indicating status (accent=pending, green=success, red=error)
30
+ - Smart spacing: removed no-op `Text("", 0, 0)` spacers between tools; block tools use internal `Spacer(1)`, context groups render compactly
31
+ - Session rebuild (`renderSessionContext`) now groups context tools consistently with streaming path
32
+
5
33
  ## [0.1.12] - 2026-02-24
6
34
 
7
35
  ### Fixed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@nghyane/arcane",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/nghyane/arcane",
7
7
  "author": "Can Bölük",
@@ -44,12 +44,11 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@mozilla/readability": "0.6.0",
47
- "@nghyane/arcane-stats": "^0.1.8",
48
- "@nghyane/arcane-agent": "^0.1.11",
49
- "@nghyane/arcane-codemode": "^0.1.12",
50
- "@nghyane/arcane-ai": "^0.1.8",
47
+ "@nghyane/arcane-stats": "^0.1.9",
48
+ "@nghyane/arcane-agent": "^0.1.12",
49
+ "@nghyane/arcane-ai": "^0.1.9",
51
50
  "@nghyane/arcane-natives": "^0.1.7",
52
- "@nghyane/arcane-tui": "^0.1.10",
51
+ "@nghyane/arcane-tui": "^0.1.11",
53
52
  "@nghyane/arcane-utils": "^0.1.6",
54
53
  "@sinclair/typebox": "^0.34.48",
55
54
  "@xterm/headless": "^6.0.0",
@@ -107,66 +106,6 @@
107
106
  "types": "./src/commands/*.ts",
108
107
  "import": "./src/commands/*.ts"
109
108
  },
110
- "./commit": {
111
- "types": "./src/commit/index.ts",
112
- "import": "./src/commit/index.ts"
113
- },
114
- "./commit/*": {
115
- "types": "./src/commit/*.ts",
116
- "import": "./src/commit/*.ts"
117
- },
118
- "./commit/agentic": {
119
- "types": "./src/commit/agentic/index.ts",
120
- "import": "./src/commit/agentic/index.ts"
121
- },
122
- "./commit/agentic/*": {
123
- "types": "./src/commit/agentic/*.ts",
124
- "import": "./src/commit/agentic/*.ts"
125
- },
126
- "./commit/agentic/tools": {
127
- "types": "./src/commit/agentic/tools/index.ts",
128
- "import": "./src/commit/agentic/tools/index.ts"
129
- },
130
- "./commit/agentic/tools/*": {
131
- "types": "./src/commit/agentic/tools/*.ts",
132
- "import": "./src/commit/agentic/tools/*.ts"
133
- },
134
- "./commit/analysis": {
135
- "types": "./src/commit/analysis/index.ts",
136
- "import": "./src/commit/analysis/index.ts"
137
- },
138
- "./commit/analysis/*": {
139
- "types": "./src/commit/analysis/*.ts",
140
- "import": "./src/commit/analysis/*.ts"
141
- },
142
- "./commit/changelog": {
143
- "types": "./src/commit/changelog/index.ts",
144
- "import": "./src/commit/changelog/index.ts"
145
- },
146
- "./commit/changelog/*": {
147
- "types": "./src/commit/changelog/*.ts",
148
- "import": "./src/commit/changelog/*.ts"
149
- },
150
- "./commit/git": {
151
- "types": "./src/commit/git/index.ts",
152
- "import": "./src/commit/git/index.ts"
153
- },
154
- "./commit/git/*": {
155
- "types": "./src/commit/git/*.ts",
156
- "import": "./src/commit/git/*.ts"
157
- },
158
- "./commit/map-reduce": {
159
- "types": "./src/commit/map-reduce/index.ts",
160
- "import": "./src/commit/map-reduce/index.ts"
161
- },
162
- "./commit/map-reduce/*": {
163
- "types": "./src/commit/map-reduce/*.ts",
164
- "import": "./src/commit/map-reduce/*.ts"
165
- },
166
- "./commit/utils/*": {
167
- "types": "./src/commit/utils/*.ts",
168
- "import": "./src/commit/utils/*.ts"
169
- },
170
109
  "./config/*": {
171
110
  "types": "./src/config/*.ts",
172
111
  "import": "./src/config/*.ts"
@@ -352,12 +291,24 @@
352
291
  "import": "./src/modes/rpc/*.ts"
353
292
  },
354
293
  "./modes/theme/*": {
355
- "types": "./src/modes/theme/*.ts",
356
- "import": "./src/modes/theme/*.ts"
294
+ "types": "./src/theme/*.ts",
295
+ "import": "./src/theme/*.ts"
357
296
  },
358
297
  "./modes/theme/defaults": {
359
- "types": "./src/modes/theme/defaults/index.ts",
360
- "import": "./src/modes/theme/defaults/index.ts"
298
+ "types": "./src/theme/defaults/index.ts",
299
+ "import": "./src/theme/defaults/index.ts"
300
+ },
301
+ "./theme/*": {
302
+ "types": "./src/theme/*.ts",
303
+ "import": "./src/theme/*.ts"
304
+ },
305
+ "./theme/defaults": {
306
+ "types": "./src/theme/defaults/index.ts",
307
+ "import": "./src/theme/defaults/index.ts"
308
+ },
309
+ "./ui/*": {
310
+ "types": "./src/ui/*.ts",
311
+ "import": "./src/ui/*.ts"
361
312
  },
362
313
  "./modes/utils/*": {
363
314
  "types": "./src/modes/utils/*.ts",
@@ -15,10 +15,8 @@
15
15
  import { Glob } from "bun";
16
16
 
17
17
  const PROMPTS_DIR = new URL("../src/prompts/", import.meta.url).pathname;
18
- const COMMIT_PROMPTS_DIR = new URL("../src/commit/prompts/", import.meta.url).pathname;
19
- const AGENTIC_PROMPTS_DIR = new URL("../src/commit/agentic/prompts/", import.meta.url).pathname;
20
18
 
21
- const PROMPT_DIRS = [PROMPTS_DIR, COMMIT_PROMPTS_DIR, AGENTIC_PROMPTS_DIR];
19
+ const PROMPT_DIRS = [PROMPTS_DIR];
22
20
 
23
21
  // Opening XML tag (not self-closing, not closing)
24
22
  const OPENING_XML = /^<([a-z_-]+)(?:\s+[^>]*)?>$/;
package/src/cli/args.ts CHANGED
@@ -5,6 +5,7 @@ import type { ThinkingLevel } from "@nghyane/arcane-agent";
5
5
  import { logger } from "@nghyane/arcane-utils";
6
6
  import { APP_NAME, CONFIG_DIR_NAME } from "@nghyane/arcane-utils/dirs";
7
7
  import chalk from "chalk";
8
+ import { isValidThinkingLevel } from "../config/model-resolver";
8
9
  import { BUILTIN_TOOLS } from "../tools";
9
10
 
10
11
  export type Mode = "text" | "json" | "rpc";
@@ -49,12 +50,6 @@ export interface Args {
49
50
  unknownFlags: Map<string, boolean | string>;
50
51
  }
51
52
 
52
- const VALID_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;
53
-
54
- export function isValidThinkingLevel(level: string): level is ThinkingLevel {
55
- return VALID_THINKING_LEVELS.includes(level as ThinkingLevel);
56
- }
57
-
58
53
  export function parseArgs(args: string[], extensionFlags?: Map<string, { type: "boolean" | "string" }>): Args {
59
54
  const result: Args = {
60
55
  messages: [],
@@ -134,7 +129,7 @@ export function parseArgs(args: string[], extensionFlags?: Map<string, { type: "
134
129
  } else {
135
130
  logger.warn("Invalid thinking level passed to --thinking", {
136
131
  level,
137
- validThinkingLevels: [...VALID_THINKING_LEVELS],
132
+ validThinkingLevels: ["off", "minimal", "low", "medium", "high", "xhigh"],
138
133
  });
139
134
  }
140
135
  } else if (arg === "--print" || arg === "-p") {
@@ -17,7 +17,7 @@ import {
17
17
  settings,
18
18
  } from "../config/settings";
19
19
  import { getAllSettingDefs, type SettingDef } from "../modes/components/settings-defs";
20
- import { theme } from "../modes/theme/theme";
20
+ import { theme } from "../theme/theme";
21
21
 
22
22
  // =============================================================================
23
23
  // Types
@@ -7,7 +7,7 @@
7
7
  import { APP_NAME } from "@nghyane/arcane-utils/dirs";
8
8
  import chalk from "chalk";
9
9
  import { PluginManager, parseSettingValue, validateSetting } from "../extensibility/plugins";
10
- import { theme } from "../modes/theme/theme";
10
+ import { theme } from "../theme/theme";
11
11
 
12
12
  // =============================================================================
13
13
  // Types
@@ -7,7 +7,7 @@ import * as path from "node:path";
7
7
  import { APP_NAME, getPythonEnvDir } from "@nghyane/arcane-utils/dirs";
8
8
  import { $ } from "bun";
9
9
  import chalk from "chalk";
10
- import { theme } from "../modes/theme/theme";
10
+ import { theme } from "../theme/theme";
11
11
 
12
12
  export type SetupComponent = "python" | "stt";
13
13
 
@@ -10,7 +10,7 @@ import { pipeline } from "node:stream/promises";
10
10
  import { isEnoent } from "@nghyane/arcane-utils";
11
11
  import { APP_NAME } from "@nghyane/arcane-utils/dirs";
12
12
  import chalk from "chalk";
13
- import { theme } from "../modes/theme/theme";
13
+ import { theme } from "../theme/theme";
14
14
  import { VERSION } from "../version";
15
15
 
16
16
  /**
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { APP_NAME } from "@nghyane/arcane-utils/dirs";
8
8
  import chalk from "chalk";
9
- import { initTheme, theme } from "../modes/theme/theme";
9
+ import { initTheme, theme } from "../theme/theme";
10
10
  import { runSearchQuery, type SearchParams } from "../web/search/index";
11
11
  import { SEARCH_PROVIDER_ORDER } from "../web/search/provider";
12
12
  import { renderSearchResult } from "../web/search/render";
package/src/cli.ts CHANGED
@@ -17,7 +17,6 @@ process.title = APP_NAME;
17
17
 
18
18
  const commands: CommandEntry[] = [
19
19
  { name: "launch", load: () => import("./commands/launch").then(m => m.default) },
20
- { name: "commit", load: () => import("./commands/commit").then(m => m.default) },
21
20
  { name: "config", load: () => import("./commands/config").then(m => m.default) },
22
21
  { name: "grep", load: () => import("./commands/grep").then(m => m.default) },
23
22
  { name: "jupyter", load: () => import("./commands/jupyter").then(m => m.default) },
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Args, Command, Flags } from "@nghyane/arcane-utils/cli";
5
5
  import { type ConfigAction, type ConfigCommandArgs, runConfigCommand } from "../cli/config-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  const ACTIONS: ConfigAction[] = ["list", "get", "set", "reset", "path"];
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Args, Command, Flags } from "@nghyane/arcane-utils/cli";
5
5
  import { type GrepCommandArgs, runGrepCommand } from "../cli/grep-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  export default class Grep extends Command {
9
9
  static description = "Test grep tool";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Args, Command } from "@nghyane/arcane-utils/cli";
5
5
  import { type JupyterAction, type JupyterCommandArgs, runJupyterCommand } from "../cli/jupyter-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  const ACTIONS: JupyterAction[] = ["kill", "status"];
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Args, Command, Flags } from "@nghyane/arcane-utils/cli";
5
5
  import { type PluginAction, type PluginCommandArgs, runPluginCommand } from "../cli/plugin-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  const ACTIONS: PluginAction[] = [
9
9
  "install",
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Args, Command, Flags, renderCommandHelp } from "@nghyane/arcane-utils/cli";
5
5
  import { runSetupCommand, type SetupCommandArgs, type SetupComponent } from "../cli/setup-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  const COMPONENTS: SetupComponent[] = ["python", "stt"];
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Command, Flags } from "@nghyane/arcane-utils/cli";
5
5
  import { runShellCommand, type ShellCommandArgs } from "../cli/shell-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  export default class Shell extends Command {
9
9
  static description = "Interactive shell console";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Args, Command, Flags } from "@nghyane/arcane-utils/cli";
5
5
  import { runSSHCommand, type SSHAction, type SSHCommandArgs } from "../cli/ssh-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  const ACTIONS: SSHAction[] = ["add", "remove", "list"];
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Command, Flags } from "@nghyane/arcane-utils/cli";
5
5
  import { runStatsCommand, type StatsCommandArgs } from "../cli/stats-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  export default class Stats extends Command {
9
9
  static description = "View usage statistics";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Command, Flags } from "@nghyane/arcane-utils/cli";
5
5
  import { runUpdateCommand } from "../cli/update-cli";
6
- import { initTheme } from "../modes/theme/theme";
6
+ import { initTheme } from "../theme/theme";
7
7
 
8
8
  export default class Update extends Command {
9
9
  static description = "Check for and install updates";
@@ -25,8 +25,8 @@ import {
25
25
  import { logger } from "@nghyane/arcane-utils";
26
26
  import { type Static, Type } from "@sinclair/typebox";
27
27
  import { type ConfigError, ConfigFile } from "../config";
28
- import type { ThemeColor } from "../modes/theme/theme";
29
28
  import type { AuthStorage, OAuthCredential } from "../session/auth-storage";
29
+ import type { ThemeColor } from "../theme/theme";
30
30
 
31
31
  export const kNoAuth = "N/A";
32
32
 
@@ -34,7 +34,7 @@ export function isAuthenticated(apiKey: string | undefined | null): apiKey is st
34
34
  return Boolean(apiKey) && apiKey !== kNoAuth;
35
35
  }
36
36
 
37
- export type ModelRole = "default" | "fast" | "reviewer" | "oracle" | "commit";
37
+ export type ModelRole = "default" | "fast" | "reviewer" | "oracle";
38
38
 
39
39
  export interface ModelRoleInfo {
40
40
  tag?: string;
@@ -47,10 +47,9 @@ export const MODEL_ROLES: Record<ModelRole, ModelRoleInfo> = {
47
47
  fast: { tag: "FAST", name: "Fast", color: "warning" },
48
48
  reviewer: { tag: "REVIEW", name: "Reviewer", color: "accent" },
49
49
  oracle: { tag: "ORACLE", name: "Oracle", color: "accent" },
50
- commit: { tag: "COMMIT", name: "Commit", color: "dim" },
51
50
  };
52
51
 
53
- export const MODEL_ROLE_IDS: ModelRole[] = ["default", "fast", "reviewer", "oracle", "commit"];
52
+ export const MODEL_ROLE_IDS: ModelRole[] = ["default", "fast", "reviewer", "oracle"];
54
53
 
55
54
  const OpenRouterRoutingSchema = Type.Object({
56
55
  only: Type.Optional(Type.Array(Type.String())),
@@ -10,12 +10,17 @@ import {
10
10
  modelsAreEqual,
11
11
  } from "@nghyane/arcane-ai";
12
12
  import chalk from "chalk";
13
- import { isValidThinkingLevel } from "../cli/args";
14
13
  import MODEL_PRIO from "../priority.json" with { type: "json" };
15
14
  import { fuzzyMatch } from "../utils/fuzzy";
16
15
  import { MODEL_ROLE_IDS, type ModelRegistry, type ModelRole } from "./model-registry";
17
16
  import type { Settings } from "./settings";
18
17
 
18
+ const VALID_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;
19
+
20
+ export function isValidThinkingLevel(level: string): level is ThinkingLevel {
21
+ return VALID_THINKING_LEVELS.includes(level as ThinkingLevel);
22
+ }
23
+
19
24
  /** Default model IDs for each known provider */
20
25
  export const defaultModelPerProvider: Record<KnownProvider, string> = DEFAULT_MODEL_PER_PROVIDER;
21
26
 
@@ -399,14 +404,22 @@ export function resolveModelOverride(
399
404
  * The algorithm tries to match the full pattern first, then progressively
400
405
  * strips colon-suffixes to find a match.
401
406
  */
402
- export async function resolveModelScope(
407
+ export interface MatchModelPatternsResult {
408
+ scopedModels: ScopedModel[];
409
+ warnings: string[];
410
+ }
411
+
412
+ /**
413
+ * Match model patterns against available models (pure — no I/O or logging).
414
+ */
415
+ export function matchModelPatterns(
403
416
  patterns: string[],
404
- modelRegistry: ModelRegistry,
417
+ availableModels: Model<Api>[],
405
418
  preferences?: ModelMatchPreferences,
406
- ): Promise<ScopedModel[]> {
407
- const availableModels = modelRegistry.getAvailable();
419
+ ): MatchModelPatternsResult {
408
420
  const context = buildPreferenceContext(availableModels, preferences);
409
421
  const scopedModels: ScopedModel[] = [];
422
+ const warnings: string[] = [];
410
423
 
411
424
  for (const pattern of patterns) {
412
425
  // Check if pattern contains glob characters
@@ -427,7 +440,6 @@ export async function resolveModelScope(
427
440
  }
428
441
 
429
442
  // Match against "provider/modelId" format OR just model ID
430
- // This allows "*sonnet*" to match without requiring "anthropic/*sonnet*"
431
443
  const matchingModels = availableModels.filter(m => {
432
444
  const fullId = `${m.provider}/${m.id}`;
433
445
  const glob = new Bun.Glob(globPattern.toLowerCase());
@@ -435,7 +447,7 @@ export async function resolveModelScope(
435
447
  });
436
448
 
437
449
  if (matchingModels.length === 0) {
438
- console.warn(chalk.yellow(`Warning: No models match pattern "${pattern}"`));
450
+ warnings.push(`No models match pattern "${pattern}"`);
439
451
  continue;
440
452
  }
441
453
 
@@ -454,11 +466,11 @@ export async function resolveModelScope(
454
466
  );
455
467
 
456
468
  if (warning) {
457
- console.warn(chalk.yellow(`Warning: ${warning}`));
469
+ warnings.push(warning);
458
470
  }
459
471
 
460
472
  if (!model) {
461
- console.warn(chalk.yellow(`Warning: No models match pattern "${pattern}"`));
473
+ warnings.push(`No models match pattern "${pattern}"`);
462
474
  continue;
463
475
  }
464
476
 
@@ -468,6 +480,21 @@ export async function resolveModelScope(
468
480
  }
469
481
  }
470
482
 
483
+ return { scopedModels, warnings };
484
+ }
485
+
486
+ export async function resolveModelScope(
487
+ patterns: string[],
488
+ modelRegistry: ModelRegistry,
489
+ preferences?: ModelMatchPreferences,
490
+ ): Promise<ScopedModel[]> {
491
+ const availableModels = modelRegistry.getAvailable();
492
+ const { scopedModels, warnings } = matchModelPatterns(patterns, availableModels, preferences);
493
+
494
+ for (const warning of warnings) {
495
+ console.warn(chalk.yellow(`Warning: ${warning}`));
496
+ }
497
+
471
498
  return scopedModels;
472
499
  }
473
500
 
@@ -4,7 +4,6 @@ import { logger } from "@nghyane/arcane-utils";
4
4
  import { getProjectDir, getProjectPromptsDir, getPromptsDir } from "@nghyane/arcane-utils/dirs";
5
5
  import Handlebars from "handlebars";
6
6
  import { computeLineHash } from "../patch/hashline";
7
- import { jtdToTypeScript } from "../tools/jtd-to-typescript";
8
7
  import { parseFrontmatter } from "../utils/frontmatter";
9
8
 
10
9
  /**
@@ -225,8 +224,6 @@ handlebars.registerHelper("includes", (collection: unknown, item: unknown): bool
225
224
  */
226
225
  handlebars.registerHelper("not", (value: unknown): boolean => !value);
227
226
 
228
- handlebars.registerHelper("jtdToTypeScript", (schema: unknown): string => jtdToTypeScript(schema));
229
-
230
227
  handlebars.registerHelper("jsonStringify", (value: unknown): string => JSON.stringify(value));
231
228
 
232
229
  /**
@@ -415,14 +412,9 @@ async function loadTemplatesFromDir(
415
412
 
416
413
  for (const entry of entries) {
417
414
  const fullPath = path.join(dir, entry);
418
- const file = Bun.file(fullPath);
419
-
420
415
  try {
421
- const stat = await file.exists();
422
- if (!stat) continue;
423
-
424
416
  if (entry.endsWith(".md")) {
425
- const rawContent = await file.text();
417
+ const rawContent = await Bun.file(fullPath).text();
426
418
  const { frontmatter, body } = parseFrontmatter(rawContent, { source: fullPath });
427
419
 
428
420
  const name = entry.split("/").pop()!.slice(0, -3); // Remove .md extension