@denizokcu/haze 1.1.0 → 1.2.0

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 (149) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +17 -10
  3. package/SECURITY.md +1 -1
  4. package/dist/buildInfo.json +3 -3
  5. package/dist/cli/chat/busyIndicator.d.ts +11 -0
  6. package/dist/cli/chat/busyIndicator.js +34 -0
  7. package/dist/cli/chat/chatMetrics.d.ts +0 -1
  8. package/dist/cli/chat/chatMetrics.js +1 -7
  9. package/dist/cli/chat/followUpQueue.d.ts +11 -0
  10. package/dist/cli/chat/followUpQueue.js +38 -0
  11. package/dist/cli/chat/messages.d.ts +0 -22
  12. package/dist/cli/chat/messages.js +40 -85
  13. package/dist/cli/chat/sessionLifecycle.d.ts +3 -1
  14. package/dist/cli/chat/sessionLifecycle.js +8 -1
  15. package/dist/cli/chat/sessionRecorder.d.ts +9 -0
  16. package/dist/cli/chat/sessionRecorder.js +12 -0
  17. package/dist/cli/chat/startupSequence.d.ts +29 -0
  18. package/dist/cli/chat/startupSequence.js +59 -0
  19. package/dist/cli/chat/transcriptPartition.d.ts +23 -0
  20. package/dist/cli/chat/transcriptPartition.js +78 -0
  21. package/dist/cli/chat/wizard/fieldTransitions.d.ts +38 -0
  22. package/dist/cli/chat/wizard/fieldTransitions.js +43 -0
  23. package/dist/cli/chat/wizard/lspHandlers.d.ts +4 -0
  24. package/dist/cli/chat/wizard/lspHandlers.js +85 -0
  25. package/dist/cli/chat/wizard/mcpHandlers.d.ts +8 -0
  26. package/dist/cli/chat/wizard/mcpHandlers.js +82 -0
  27. package/dist/cli/chat/wizard/providerHandlers.d.ts +12 -0
  28. package/dist/cli/chat/wizard/providerHandlers.js +420 -0
  29. package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +4 -0
  30. package/dist/cli/chat/wizard/sessionThemeHandlers.js +48 -0
  31. package/dist/cli/chat/wizard/skillsHandlers.d.ts +4 -0
  32. package/dist/cli/chat/wizard/skillsHandlers.js +125 -0
  33. package/dist/cli/chat/wizard/types.d.ts +63 -0
  34. package/dist/cli/chat/wizard/types.js +24 -0
  35. package/dist/cli/chat/wizard/uiState.d.ts +56 -0
  36. package/dist/cli/chat/wizard/uiState.js +15 -0
  37. package/dist/cli/chat/wizardDispatch.d.ts +11 -113
  38. package/dist/cli/chat/wizardDispatch.js +41 -815
  39. package/dist/cli/commands/chat.js +69 -110
  40. package/dist/cli/commands/formatters.d.ts +0 -3
  41. package/dist/cli/commands/formatters.js +0 -29
  42. package/dist/cli/commands/runCommand.d.ts +2 -0
  43. package/dist/cli/commands/runCommand.js +73 -4
  44. package/dist/cli/commands/streaming/agentAttempt.d.ts +11 -1
  45. package/dist/cli/commands/streaming/agentAttempt.js +9 -5
  46. package/dist/cli/commands/streaming/assistantSegments.d.ts +19 -0
  47. package/dist/cli/commands/streaming/assistantSegments.js +48 -0
  48. package/dist/cli/commands/streaming/attemptOutcome.d.ts +25 -5
  49. package/dist/cli/commands/streaming/attemptOutcome.js +69 -16
  50. package/dist/cli/commands/streaming/attemptSetup.d.ts +10 -3
  51. package/dist/cli/commands/streaming/attemptSetup.js +30 -13
  52. package/dist/cli/commands/streaming/goalCheckpoint.d.ts +69 -8
  53. package/dist/cli/commands/streaming/goalCheckpoint.js +36 -1
  54. package/dist/cli/commands/streaming/goalSupervisor.d.ts +18 -3
  55. package/dist/cli/commands/streaming/goalSupervisor.js +71 -12
  56. package/dist/cli/commands/streaming/prepareStep.d.ts +40 -0
  57. package/dist/cli/commands/streaming/prepareStep.js +116 -0
  58. package/dist/cli/commands/streaming/recoverySlices.d.ts +15 -0
  59. package/dist/cli/commands/streaming/recoverySlices.js +29 -0
  60. package/dist/cli/commands/streaming/stallRecovery.d.ts +0 -1
  61. package/dist/cli/commands/streaming/stallRecovery.js +2 -6
  62. package/dist/cli/commands/streaming/streamLoop.d.ts +31 -4
  63. package/dist/cli/commands/streaming/streamLoop.js +283 -268
  64. package/dist/cli/commands/streaming/toolGroupRenderer.js +2 -1
  65. package/dist/cli/commands/streaming/toolPartHandlers.d.ts +19 -0
  66. package/dist/cli/commands/streaming/toolPartHandlers.js +108 -0
  67. package/dist/cli/commands/streaming/turnRuntime.d.ts +1 -1
  68. package/dist/cli/commands/streaming/turnRuntime.js +3 -2
  69. package/dist/cli/commands/streaming.d.ts +12 -1
  70. package/dist/cli/commands/streaming.js +20 -25
  71. package/dist/cli/index.js +6 -3
  72. package/dist/config/modelCatalog.d.ts +32 -0
  73. package/dist/config/modelCatalog.js +84 -0
  74. package/dist/config/providerPresets.d.ts +7 -0
  75. package/dist/config/providerPresets.js +195 -391
  76. package/dist/config/settings.d.ts +10 -2
  77. package/dist/config/settings.js +3 -0
  78. package/dist/core/agent/budgets.d.ts +10 -0
  79. package/dist/core/agent/budgets.js +10 -0
  80. package/dist/core/agent/compaction.d.ts +42 -3
  81. package/dist/core/agent/compaction.js +53 -5
  82. package/dist/core/agent/completionController.d.ts +16 -7
  83. package/dist/core/agent/completionController.js +13 -6
  84. package/dist/core/agent/contextBudget.d.ts +56 -0
  85. package/dist/core/agent/contextBudget.js +53 -0
  86. package/dist/core/agent/errors.js +2 -2
  87. package/dist/core/agent/events.d.ts +36 -1
  88. package/dist/core/agent/goalPolicy.d.ts +4 -3
  89. package/dist/core/agent/goalPolicy.js +9 -4
  90. package/dist/core/agent/overflow.d.ts +45 -0
  91. package/dist/core/agent/overflow.js +91 -0
  92. package/dist/core/agent/requestAssembly.d.ts +7 -0
  93. package/dist/core/agent/requestAssembly.js +15 -7
  94. package/dist/core/agent/workState.d.ts +25 -15
  95. package/dist/core/agent/workState.js +84 -44
  96. package/dist/core/safety/shellClassifier.d.ts +16 -0
  97. package/dist/core/safety/shellClassifier.js +31 -0
  98. package/dist/core/session/sessionSlimming.js +8 -0
  99. package/dist/core/session/sessionStore.d.ts +71 -1
  100. package/dist/core/session/sessionStore.js +121 -6
  101. package/dist/core/validation/outputParser.d.ts +1 -1
  102. package/dist/core/validation/outputParser.js +6 -1
  103. package/dist/llm/client.d.ts +2 -2
  104. package/dist/llm/client.js +14 -6
  105. package/dist/llm/hazeTools.d.ts +64 -208
  106. package/dist/llm/tools/shellTool.js +27 -8
  107. package/dist/llm/tools/taskTool.d.ts +64 -208
  108. package/dist/llm/tools/taskTool.js +22 -10
  109. package/dist/ui/components/TextInput.d.ts +18 -1
  110. package/dist/ui/components/TextInput.js +50 -73
  111. package/dist/ui/components/useInputSuggestions.d.ts +27 -0
  112. package/dist/ui/components/useInputSuggestions.js +98 -0
  113. package/dist/ui/theme.d.ts +8 -8
  114. package/dist/ui/theme.js +11 -12
  115. package/dist/ui/themes/registry.d.ts +5 -0
  116. package/dist/ui/themes/registry.js +436 -0
  117. package/dist/utils/format.d.ts +10 -0
  118. package/dist/utils/format.js +45 -0
  119. package/package.json +16 -15
  120. package/dist/ui/themes/af-magic.d.ts +0 -7
  121. package/dist/ui/themes/af-magic.js +0 -25
  122. package/dist/ui/themes/agnoster.d.ts +0 -10
  123. package/dist/ui/themes/agnoster.js +0 -40
  124. package/dist/ui/themes/bira.d.ts +0 -10
  125. package/dist/ui/themes/bira.js +0 -28
  126. package/dist/ui/themes/bureau.d.ts +0 -10
  127. package/dist/ui/themes/bureau.js +0 -28
  128. package/dist/ui/themes/clean.d.ts +0 -9
  129. package/dist/ui/themes/clean.js +0 -27
  130. package/dist/ui/themes/cloud.d.ts +0 -6
  131. package/dist/ui/themes/cloud.js +0 -24
  132. package/dist/ui/themes/dst.d.ts +0 -10
  133. package/dist/ui/themes/dst.js +0 -28
  134. package/dist/ui/themes/fishy.d.ts +0 -7
  135. package/dist/ui/themes/fishy.js +0 -25
  136. package/dist/ui/themes/index.d.ts +0 -8
  137. package/dist/ui/themes/index.js +0 -36
  138. package/dist/ui/themes/light.d.ts +0 -3
  139. package/dist/ui/themes/light.js +0 -21
  140. package/dist/ui/themes/purple.d.ts +0 -7
  141. package/dist/ui/themes/purple.js +0 -26
  142. package/dist/ui/themes/robbyrussell.d.ts +0 -8
  143. package/dist/ui/themes/robbyrussell.js +0 -26
  144. package/dist/ui/themes/solarized-dark.d.ts +0 -16
  145. package/dist/ui/themes/solarized-dark.js +0 -44
  146. package/dist/ui/themes/solarized-light.d.ts +0 -12
  147. package/dist/ui/themes/solarized-light.js +0 -40
  148. package/dist/ui/themes/steeef.d.ts +0 -11
  149. package/dist/ui/themes/steeef.js +0 -29
@@ -0,0 +1,436 @@
1
+ /**
2
+ * Every built-in theme, keyed by its settings name, in one registry — the
3
+ * single place a theme is declared (see AGENTS.md in this folder for how to
4
+ * add/convert themes). Mirrors how oh-my-zsh discovers `themes/<name>.zsh-theme`
5
+ * by `ZSH_THEME=<name>`; `tests/ui/theme.test.ts` enforces the expected names.
6
+ */
7
+ /**
8
+ * haze's own brand palette and the default theme: the purple-fog look that
9
+ * shipped as haze 1.0's hard-coded colors. Selected when `theme` is unset in
10
+ * settings, and the fallback base for roles another theme omits.
11
+ */
12
+ const purple = {
13
+ roles: {
14
+ // Terminal background: the docs site's darkest haze tone (--terminal-quote),
15
+ // one step under surfaceBg so the user-message block stays visible on it.
16
+ background: '#171127',
17
+ accent: '#a78bfa',
18
+ accentDim: '#6d28d9',
19
+ border: '#6d28d9',
20
+ info: '#60a5fa',
21
+ muted: '#9ca3af',
22
+ foreground: '#f0eef6',
23
+ command: '#ffb86c',
24
+ success: '#39ff14',
25
+ successBg: '#14331f',
26
+ danger: '#fb7185',
27
+ dangerBg: '#3a1720',
28
+ warning: '#fbbf24',
29
+ surfaceBg: '#1f1633',
30
+ codeBg: '#202124',
31
+ },
32
+ };
33
+ /** Light-terminal variant of the haze `purple` palette: every fg/bg pair re-tuned together. */
34
+ const light = {
35
+ roles: {
36
+ // Pure white terminal background; layered surfaces stay slightly off-white.
37
+ background: '#ffffff',
38
+ accent: '#a78bfa',
39
+ accentDim: '#c4b5fd',
40
+ border: '#6b7280',
41
+ info: '#3b82f6',
42
+ muted: '#6b7280',
43
+ foreground: '#1e293b',
44
+ command: '#f59e0b',
45
+ success: '#10b981',
46
+ successBg: '#f0fdf4',
47
+ danger: '#ef4444',
48
+ dangerBg: '#fef2f2',
49
+ warning: '#f59e0b',
50
+ surfaceBg: '#f8fafc',
51
+ codeBg: '#f1f5f9',
52
+ },
53
+ };
54
+ /**
55
+ * Port of robbyrussell.zsh-theme (the oh-my-zsh default):
56
+ * $fg_bold[green]➜ → accent 'green' $fg[cyan]%c → command 'cyan'
57
+ * $fg_bold[blue]git:→ info 'blue' $fg[red]branch → danger 'red'
58
+ * $fg[yellow]✗ → warning 'yellow'
59
+ */
60
+ const robbyrussell = {
61
+ roles: {
62
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
63
+ background: '#121212',
64
+ accent: 'green',
65
+ accentDim: 'green',
66
+ border: 'black',
67
+ info: 'blue',
68
+ muted: '245',
69
+ foreground: 'default',
70
+ command: 'cyan',
71
+ success: 'green',
72
+ successBg: '22',
73
+ danger: 'red',
74
+ dangerBg: '52',
75
+ warning: 'yellow',
76
+ surfaceBg: '234',
77
+ codeBg: '234',
78
+ },
79
+ };
80
+ /**
81
+ * Port of af-magic.zsh-theme, which uses xterm-256 slots — kept numeric so
82
+ * the port stays a transliteration of ${FG[105]}», ${FG[032]}%~, ${FG[075]}(,
83
+ * ${FG[078]}branch, ${FG[214]}*, ${FG[237]}dashes, $fg[red]%? ↵.
84
+ */
85
+ const afMagic = {
86
+ roles: {
87
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
88
+ background: '#121212',
89
+ accent: '105',
90
+ accentDim: '61',
91
+ border: '237',
92
+ info: '75',
93
+ muted: '237',
94
+ foreground: '251',
95
+ command: '32',
96
+ success: '78',
97
+ successBg: '22',
98
+ danger: 'red',
99
+ dangerBg: '52',
100
+ warning: '214',
101
+ surfaceBg: '234',
102
+ codeBg: '234',
103
+ },
104
+ };
105
+ /**
106
+ * Port of agnoster.zsh-theme (Powerline segments): AGNOSTER_GIT_CLEAN_BG=green,
107
+ * AGNOSTER_DIR_BG=blue, AGNOSTER_GIT_DIRTY_BG=yellow, AGNOSTER_STATUS_RETVAL_FG=red,
108
+ * AGNOSTER_STATUS_JOB_FG=cyan. The theme's README recommends Solarized, so the
109
+ * port pins a Solarized-dark palette instead of the default Tango approximation.
110
+ * haze has no background segments, so the segment colors become the foreground
111
+ * identity.
112
+ */
113
+ const agnoster = {
114
+ palette: {
115
+ black: '#073642',
116
+ red: '#dc322f',
117
+ green: '#859900',
118
+ yellow: '#b58900',
119
+ blue: '#268bd2',
120
+ magenta: '#d33682',
121
+ cyan: '#2aa198',
122
+ white: '#93a1a1',
123
+ default: '#eee8d5',
124
+ },
125
+ roles: {
126
+ // The theme's README recommends Solarized Dark, so the canvas is base03 and
127
+ // the surfaces move to base02 to stay inside that palette.
128
+ background: '#002b36',
129
+ accent: 'green',
130
+ accentDim: '236',
131
+ border: '236',
132
+ info: 'cyan',
133
+ muted: '245',
134
+ foreground: 'default',
135
+ command: 'blue',
136
+ success: 'green',
137
+ successBg: '22',
138
+ danger: 'red',
139
+ dangerBg: '52',
140
+ warning: 'yellow',
141
+ surfaceBg: '#073642', // base02
142
+ codeBg: '#073642', // base02
143
+ },
144
+ };
145
+ /**
146
+ * Port of bira.zsh-theme (the ╭─/╰─ two-line prompt):
147
+ * $fg[green]%n@%m (user, non-root) → accent 'green'
148
+ * %B$fg[blue]%~ (cwd, bold) → command 'blue'
149
+ * $fg[yellow]‹branch› → info 'yellow'
150
+ * $fg[red]● (dirty), %? ↵ → danger 'red'
151
+ * $fg[green]‹venv› → success 'green'
152
+ */
153
+ const bira = {
154
+ roles: {
155
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
156
+ background: '#121212',
157
+ accent: 'green',
158
+ accentDim: 'green',
159
+ border: '236',
160
+ info: 'yellow',
161
+ muted: '245',
162
+ foreground: 'default',
163
+ command: 'blue',
164
+ success: 'green',
165
+ successBg: '22',
166
+ danger: 'red',
167
+ dangerBg: '52',
168
+ warning: 'yellow',
169
+ surfaceBg: '234',
170
+ codeBg: '234',
171
+ },
172
+ };
173
+ /**
174
+ * Port of bureau.zsh-theme [±master ▾●]:
175
+ * $fg_bold[green]± ✓ $ (prompt) → accent 'green'
176
+ * $fg_bold[white]%n %~ (user/path) → command 'white' (cwd), foreground
177
+ * $fg[cyan]▴ (ahead) → info 'cyan'
178
+ * $fg_bold[yellow]● (unstaged) → warning 'yellow'
179
+ * $fg_bold[red]● (untracked) → danger 'red'
180
+ */
181
+ const bureau = {
182
+ roles: {
183
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
184
+ background: '#121212',
185
+ accent: 'green',
186
+ accentDim: '236',
187
+ border: '236',
188
+ info: 'cyan',
189
+ muted: '245',
190
+ foreground: 'default',
191
+ command: 'white',
192
+ success: 'green',
193
+ successBg: '22',
194
+ danger: 'red',
195
+ dangerBg: '52',
196
+ warning: 'yellow',
197
+ surfaceBg: '234',
198
+ codeBg: '235',
199
+ },
200
+ };
201
+ /**
202
+ * Port of clean.zsh-theme:
203
+ * $fg_bold[white]%n (user) → accent 'white'
204
+ * $fg_bold[blue]%c/ (cwd) → command 'blue'
205
+ * $fg_bold[blue]( git branch → info 'blue', branch $fg[yellow] → warning
206
+ * $fg_bold[red]✗ (dirty) → danger 'red'
207
+ */
208
+ const clean = {
209
+ roles: {
210
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
211
+ background: '#121212',
212
+ accent: 'white',
213
+ accentDim: '236',
214
+ border: '236',
215
+ info: 'blue',
216
+ muted: '245',
217
+ foreground: 'default',
218
+ command: 'blue',
219
+ success: 'green',
220
+ successBg: '22',
221
+ danger: 'red',
222
+ dangerBg: '52',
223
+ warning: 'yellow',
224
+ surfaceBg: '234',
225
+ codeBg: '234',
226
+ },
227
+ };
228
+ /**
229
+ * Port of cloud.zsh-theme: $fg_bold[cyan]☁, $fg[green]%c,
230
+ * $fg[green][$fg[cyan]branch, $fg[yellow]⚡ dirty.
231
+ */
232
+ const cloud = {
233
+ roles: {
234
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
235
+ background: '#121212',
236
+ accent: 'cyan',
237
+ accentDim: '236',
238
+ border: '236',
239
+ info: 'blue',
240
+ muted: '245',
241
+ foreground: 'default',
242
+ command: 'green',
243
+ success: 'green',
244
+ successBg: '22',
245
+ danger: 'red',
246
+ dangerBg: '52',
247
+ warning: 'yellow',
248
+ surfaceBg: '234',
249
+ codeBg: '234',
250
+ },
251
+ };
252
+ /**
253
+ * Port of dst.zsh-theme:
254
+ * $fg[magenta]%n (user) → accent 'magenta'
255
+ * $fg[yellow]%m (host) → warning 'yellow'
256
+ * $fg_bold[blue]%~ (cwd) → command 'blue'
257
+ * $fg[green]branch prefix → info 'green' $fg[red]! (dirty) → danger 'red'
258
+ * $fg[green][%*] (clock) → success 'green'
259
+ */
260
+ const dst = {
261
+ roles: {
262
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
263
+ background: '#121212',
264
+ accent: 'magenta',
265
+ accentDim: 'magenta',
266
+ border: '236',
267
+ info: 'green',
268
+ muted: '245',
269
+ foreground: 'default',
270
+ command: 'blue',
271
+ success: 'green',
272
+ successBg: '22',
273
+ danger: 'red',
274
+ dangerBg: '52',
275
+ warning: 'yellow',
276
+ surfaceBg: '234',
277
+ codeBg: '234',
278
+ },
279
+ };
280
+ /**
281
+ * Port of fishy.zsh-theme: $fg[green]%n and cwd (user_color='green'),
282
+ * $fg_bold[red] exit status, and its git-status markers (+ green, ! blue,
283
+ * - red, > magenta, # yellow, ? cyan).
284
+ */
285
+ const fishy = {
286
+ roles: {
287
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
288
+ background: '#121212',
289
+ accent: 'green',
290
+ accentDim: 'green',
291
+ border: '236',
292
+ info: 'cyan',
293
+ muted: '245',
294
+ foreground: 'default',
295
+ command: 'green',
296
+ success: 'green',
297
+ successBg: '22',
298
+ danger: 'red',
299
+ dangerBg: '52',
300
+ warning: 'yellow',
301
+ surfaceBg: '234',
302
+ codeBg: '235',
303
+ },
304
+ };
305
+ /**
306
+ * Port of steeef.zsh-theme (Steve Losh's Prose style), using its 256-color
307
+ * branch — kept numeric so the port stays a transliteration:
308
+ * %F{135}%n (user, purple) → accent '135'
309
+ * %F{166}%m (host, orange), unstaged ● → warning '166'
310
+ * %F{118}%~ (cwd, limegreen) → command/success '118'
311
+ * %F{81}branch (turquoise) → info '81'
312
+ * %F{161}● (untracked, hotpink) → danger '161'
313
+ */
314
+ const steeef = {
315
+ roles: {
316
+ // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
317
+ background: '#121212',
318
+ accent: '135',
319
+ accentDim: '61',
320
+ border: '236',
321
+ info: '81',
322
+ muted: '245',
323
+ foreground: 'default',
324
+ command: '118',
325
+ success: '118',
326
+ successBg: '22',
327
+ danger: '161',
328
+ dangerBg: '52',
329
+ warning: '166',
330
+ surfaceBg: '234',
331
+ codeBg: '235',
332
+ },
333
+ };
334
+ /**
335
+ * Port of Solarized Dark (Ethan Schoonover, ethanschoonover.com/solarized).
336
+ * Solarized is a terminal *palette*, not a prompt theme, so the port pins the
337
+ * canonical 16-color mapping as `palette` and writes roles as zsh names.
338
+ *
339
+ * Base tones (dark mode): bg base03, emphasis bg base02, body base0,
340
+ * comments base01. Accent colors are identical in both modes by design —
341
+ * each Solarized accent maps to exactly one haze role:
342
+ * blue #268bd2 → accent violet #6c71c4 → accentDim yellow #b58900 → command
343
+ * cyan #2aa198 → info green #859900 → success orange #cb4b16 → warning
344
+ * red #dc322f → danger
345
+ * All backgrounds use base02 ("bg highlight"), Solarized's own surface tone
346
+ * for selection/diff regions: the accent foreground carries the meaning.
347
+ */
348
+ const solarizedDark = {
349
+ palette: {
350
+ black: '#002b36', // base03 (ANSI slot 0)
351
+ red: '#dc322f',
352
+ green: '#859900',
353
+ yellow: '#b58900',
354
+ blue: '#268bd2',
355
+ magenta: '#d33682',
356
+ cyan: '#2aa198',
357
+ white: '#eee8d5', // base2 (ANSI slot 7)
358
+ default: '#839496', // base0 — dark-mode body text
359
+ },
360
+ roles: {
361
+ background: '#002b36', // base03 — the dark-mode canvas
362
+ accent: 'blue',
363
+ accentDim: '#6c71c4', // violet
364
+ border: '#586e75', // base01 — chrome structure
365
+ info: 'cyan',
366
+ muted: '#586e75', // base01 — dark-mode comments
367
+ foreground: 'default',
368
+ command: 'yellow',
369
+ success: 'green',
370
+ successBg: '#073642', // base02
371
+ danger: 'red',
372
+ dangerBg: '#073642', // base02
373
+ warning: '#cb4b16', // orange
374
+ surfaceBg: '#073642', // base02
375
+ codeBg: '#073642', // base02
376
+ },
377
+ };
378
+ /**
379
+ * Port of Solarized Light (Ethan Schoonover, ethanschoonover.com/solarized).
380
+ * Same accent palette as `solarized-dark` — Solarized's two modes swap only
381
+ * the base tones, never the accent colors:
382
+ * dark: bg base03, surfaces base02, body base0, comments base01
383
+ * light: bg base3, surfaces base2, body base00, comments base1
384
+ * Role → accent mapping is identical to solarized-dark (see its comment);
385
+ * orange/red gain contrast on light while yellow softens, exactly as in the
386
+ * source palette.
387
+ */
388
+ const solarizedLight = {
389
+ palette: {
390
+ black: '#002b36', // base03 (ANSI slot 0)
391
+ red: '#dc322f',
392
+ green: '#859900',
393
+ yellow: '#b58900',
394
+ blue: '#268bd2',
395
+ magenta: '#d33682',
396
+ cyan: '#2aa198',
397
+ white: '#eee8d5', // base2 (ANSI slot 7)
398
+ default: '#657b83', // base00 — light-mode body text
399
+ },
400
+ roles: {
401
+ background: '#fdf6e3', // base3 — the light-mode canvas (full Solarized Light)
402
+ accent: 'blue',
403
+ accentDim: '#6c71c4', // violet
404
+ border: '#93a1a1', // base1 — chrome structure on light
405
+ info: 'cyan',
406
+ muted: '#93a1a1', // base1 — light-mode comments
407
+ foreground: 'default',
408
+ command: 'yellow',
409
+ success: 'green',
410
+ successBg: '#eee8d5', // base2
411
+ danger: 'red',
412
+ dangerBg: '#eee8d5', // base2
413
+ warning: '#cb4b16', // orange
414
+ surfaceBg: '#eee8d5', // base2
415
+ codeBg: '#eee8d5', // base2
416
+ },
417
+ };
418
+ /** Every built-in theme, keyed by its settings name. Key order drives the `/themes` picker listing. */
419
+ export const THEMES = {
420
+ purple,
421
+ light,
422
+ 'af-magic': afMagic,
423
+ agnoster,
424
+ bira,
425
+ bureau,
426
+ clean,
427
+ cloud,
428
+ dst,
429
+ fishy,
430
+ robbyrussell,
431
+ 'solarized-dark': solarizedDark,
432
+ 'solarized-light': solarizedLight,
433
+ steeef,
434
+ };
435
+ /** The base theme other themes inherit omitted roles from (also the default). */
436
+ export const BASE_THEME_SPEC = purple;
@@ -1,2 +1,12 @@
1
1
  /** Human-readable byte sizes for display text (CLI rows, session placeholders). */
2
2
  export declare function formatBytes(bytes: number): string;
3
+ /** Compact token counts for status rows: 999, 1.5k, 13k, 1.5m. */
4
+ export declare function formatTokenCount(tokens: number): string;
5
+ /** Milliseconds as fractional seconds, e.g. "1.2s". */
6
+ export declare function formatSeconds(milliseconds: number): string;
7
+ /** Minutes for timeout/deadline copy, e.g. "5 minutes". */
8
+ export declare function formatIdleMinutes(milliseconds: number): string;
9
+ /** Elapsed time with fractional seconds: "1.5s", "2m 03.4s", "1h 02m 03.4s". */
10
+ export declare function formatElapsedTime(milliseconds: number): string;
11
+ /** Elapsed time in whole seconds: "1s", "2m 03s", "1h 02m 03s". */
12
+ export declare function formatElapsedTimeWhole(milliseconds: number): string;
@@ -6,3 +6,48 @@ export function formatBytes(bytes) {
6
6
  return `${(bytes / 1024).toFixed(1)} KB`;
7
7
  return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
8
8
  }
9
+ /** Compact token counts for status rows: 999, 1.5k, 13k, 1.5m. */
10
+ export function formatTokenCount(tokens) {
11
+ if (tokens >= 1_000_000)
12
+ return `${(tokens / 1_000_000).toFixed(tokens >= 10_000_000 ? 0 : 1).replace(/\.0$/, '')}m`;
13
+ if (tokens >= 1_000)
14
+ return `${(tokens / 1_000).toFixed(tokens >= 10_000 ? 0 : 1).replace(/\.0$/, '')}k`;
15
+ return String(tokens);
16
+ }
17
+ /** Milliseconds as fractional seconds, e.g. "1.2s". */
18
+ export function formatSeconds(milliseconds) {
19
+ return `${(milliseconds / 1000).toFixed(1)}s`;
20
+ }
21
+ /** Minutes for timeout/deadline copy, e.g. "5 minutes". */
22
+ export function formatIdleMinutes(milliseconds) {
23
+ const minutes = Math.round(milliseconds / 60_000);
24
+ return `${minutes} minute${minutes === 1 ? '' : 's'}`;
25
+ }
26
+ /** Elapsed time with fractional seconds: "1.5s", "2m 03.4s", "1h 02m 03.4s". */
27
+ export function formatElapsedTime(milliseconds) {
28
+ const totalSeconds = Math.max(0, milliseconds / 1000);
29
+ const wholeSeconds = Math.floor(totalSeconds);
30
+ const seconds = totalSeconds - Math.floor(wholeSeconds / 60) * 60;
31
+ const totalMinutes = Math.floor(wholeSeconds / 60);
32
+ const minutes = totalMinutes % 60;
33
+ const hours = Math.floor(totalMinutes / 60);
34
+ const secondsLabel = `${seconds.toFixed(1)}s`;
35
+ if (hours > 0)
36
+ return `${hours}h ${minutes}m ${secondsLabel}`;
37
+ if (minutes > 0)
38
+ return `${minutes}m ${secondsLabel}`;
39
+ return secondsLabel;
40
+ }
41
+ /** Elapsed time in whole seconds: "1s", "2m 03s", "1h 02m 03s". */
42
+ export function formatElapsedTimeWhole(milliseconds) {
43
+ const totalSeconds = Math.max(0, Math.floor(milliseconds / 1000));
44
+ const seconds = totalSeconds % 60;
45
+ const totalMinutes = Math.floor(totalSeconds / 60);
46
+ const minutes = totalMinutes % 60;
47
+ const hours = Math.floor(totalMinutes / 60);
48
+ if (hours > 0)
49
+ return `${hours}h ${minutes}m ${seconds}s`;
50
+ if (minutes > 0)
51
+ return `${minutes}m ${seconds}s`;
52
+ return `${seconds}s`;
53
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@denizokcu/haze",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A minimal LLM harness for your terminal.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,43 +42,44 @@
42
42
  "lint:knip": "knip",
43
43
  "typecheck": "tsc --noEmit",
44
44
  "context:report": "node --import tsx src/cli/contextReport.ts",
45
+ "eval": "node scripts/run-evals.mjs",
45
46
  "release:verify": "node scripts/verify-release-metadata.mjs",
46
47
  "haze": "tsx src/cli/index.ts",
47
48
  "prepublishOnly": "npm run typecheck && npm test && npm run lint && npm run build && npm audit --audit-level=high && npm run release:verify"
48
49
  },
49
50
  "dependencies": {
50
- "@ai-sdk/mcp": "^2.0.31",
51
- "@ai-sdk/openai": "4.0.41",
51
+ "@ai-sdk/mcp": "^2.0.41",
52
+ "@ai-sdk/openai": "4.0.52",
52
53
  "@vscode/ripgrep": "1.18.0",
53
- "ai": "7.0.64",
54
+ "ai": "7.0.85",
54
55
  "cli-highlight": "2.1.11",
55
56
  "commander": "15.0.0",
56
- "defuddle": "^0.19.2",
57
+ "defuddle": "^0.19.3",
57
58
  "fs-extra": "11.4.0",
58
- "ignore": "^7.0.6",
59
+ "ignore": "^7.0.8",
59
60
  "ink": "7.1.1",
60
61
  "ink-spinner": "5.0.0",
61
62
  "linkedom": "^0.18.13",
62
- "marked": "18.0.9",
63
+ "marked": "18.0.11",
63
64
  "react": "19.2.8",
64
65
  "strip-ansi": "7.2.0",
65
66
  "turndown": "^7.2.4",
66
- "wrap-ansi": "10.0.0",
67
+ "wrap-ansi": "10.0.1",
67
68
  "yaml": "2.9.0",
68
- "zod": "4.4.3"
69
+ "zod": "4.5.4"
69
70
  },
70
71
  "devDependencies": {
71
72
  "@eslint/js": "^10.0.1",
72
73
  "@types/fs-extra": "11.0.4",
73
- "@types/node": "26.2.0",
74
+ "@types/node": "26.4.0",
74
75
  "@types/react": "19.2.18",
75
- "eslint": "^10.8.1",
76
+ "eslint": "^10.9.1",
76
77
  "ink-testing-library": "^4.0.0",
77
- "knip": "5.88.1",
78
- "tsx": "4.23.12",
78
+ "knip": "6.33.0",
79
+ "tsx": "4.23.13",
79
80
  "typescript": "6.0.3",
80
- "typescript-eslint": "^8.67.0",
81
- "vitest": "^4.1.10"
81
+ "typescript-eslint": "^8.69.0",
82
+ "vitest": "^4.1.11"
82
83
  },
83
84
  "allowScripts": {
84
85
  "fsevents@2.3.3": true,
@@ -1,7 +0,0 @@
1
- import type { HazeThemeSpec } from '../theme.js';
2
- /**
3
- * Port of af-magic.zsh-theme, which uses xterm-256 slots — kept numeric so
4
- * the port stays a transliteration of ${FG[105]}», ${FG[032]}%~, ${FG[075]}(,
5
- * ${FG[078]}branch, ${FG[214]}*, ${FG[237]}dashes, $fg[red]%? ↵.
6
- */
7
- export declare const afMagic: HazeThemeSpec;
@@ -1,25 +0,0 @@
1
- /**
2
- * Port of af-magic.zsh-theme, which uses xterm-256 slots — kept numeric so
3
- * the port stays a transliteration of ${FG[105]}», ${FG[032]}%~, ${FG[075]}(,
4
- * ${FG[078]}branch, ${FG[214]}*, ${FG[237]}dashes, $fg[red]%? ↵.
5
- */
6
- export const afMagic = {
7
- roles: {
8
- // Classic dark-terminal canvas, one step under the xterm-256 234 surfaces.
9
- background: '#121212',
10
- accent: '105',
11
- accentDim: '61',
12
- border: '237',
13
- info: '75',
14
- muted: '237',
15
- foreground: '251',
16
- command: '32',
17
- success: '78',
18
- successBg: '22',
19
- danger: 'red',
20
- dangerBg: '52',
21
- warning: '214',
22
- surfaceBg: '234',
23
- codeBg: '234',
24
- },
25
- };
@@ -1,10 +0,0 @@
1
- import type { HazeThemeSpec } from '../theme.js';
2
- /**
3
- * Port of agnoster.zsh-theme (Powerline segments): AGNOSTER_GIT_CLEAN_BG=green,
4
- * AGNOSTER_DIR_BG=blue, AGNOSTER_GIT_DIRTY_BG=yellow, AGNOSTER_STATUS_RETVAL_FG=red,
5
- * AGNOSTER_STATUS_JOB_FG=cyan. The theme's README recommends Solarized, so the
6
- * port pins a Solarized-dark palette instead of the default Tango approximation.
7
- * haze has no background segments, so the segment colors become the foreground
8
- * identity.
9
- */
10
- export declare const agnoster: HazeThemeSpec;
@@ -1,40 +0,0 @@
1
- /**
2
- * Port of agnoster.zsh-theme (Powerline segments): AGNOSTER_GIT_CLEAN_BG=green,
3
- * AGNOSTER_DIR_BG=blue, AGNOSTER_GIT_DIRTY_BG=yellow, AGNOSTER_STATUS_RETVAL_FG=red,
4
- * AGNOSTER_STATUS_JOB_FG=cyan. The theme's README recommends Solarized, so the
5
- * port pins a Solarized-dark palette instead of the default Tango approximation.
6
- * haze has no background segments, so the segment colors become the foreground
7
- * identity.
8
- */
9
- export const agnoster = {
10
- palette: {
11
- black: '#073642',
12
- red: '#dc322f',
13
- green: '#859900',
14
- yellow: '#b58900',
15
- blue: '#268bd2',
16
- magenta: '#d33682',
17
- cyan: '#2aa198',
18
- white: '#93a1a1',
19
- default: '#eee8d5',
20
- },
21
- roles: {
22
- // The theme's README recommends Solarized Dark, so the canvas is base03 and
23
- // the surfaces move to base02 to stay inside that palette.
24
- background: '#002b36',
25
- accent: 'green',
26
- accentDim: '236',
27
- border: '236',
28
- info: 'cyan',
29
- muted: '245',
30
- foreground: 'default',
31
- command: 'blue',
32
- success: 'green',
33
- successBg: '22',
34
- danger: 'red',
35
- dangerBg: '52',
36
- warning: 'yellow',
37
- surfaceBg: '#073642', // base02
38
- codeBg: '#073642', // base02
39
- },
40
- };
@@ -1,10 +0,0 @@
1
- import type { HazeThemeSpec } from '../theme.js';
2
- /**
3
- * Port of bira.zsh-theme (the ╭─/╰─ two-line prompt):
4
- * $fg[green]%n@%m (user, non-root) → accent 'green'
5
- * %B$fg[blue]%~ (cwd, bold) → command 'blue'
6
- * $fg[yellow]‹branch› → info 'yellow'
7
- * $fg[red]● (dirty), %? ↵ → danger 'red'
8
- * $fg[green]‹venv› → success 'green'
9
- */
10
- export declare const bira: HazeThemeSpec;