@denizokcu/haze 0.10.0 → 1.0.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 (294) hide show
  1. package/CHANGELOG.md +100 -1
  2. package/README.md +77 -27
  3. package/SECURITY.md +22 -0
  4. package/bin/haze.js +102 -1
  5. package/dist/buildInfo.json +7 -0
  6. package/dist/cli/chat/TaskBar.d.ts +2 -1
  7. package/dist/cli/chat/TaskBar.js +7 -4
  8. package/dist/cli/chat/chatMetrics.d.ts +2 -2
  9. package/dist/cli/chat/chatMetrics.js +1 -1
  10. package/dist/cli/chat/contextReport.js +2 -0
  11. package/dist/cli/chat/fileMentionSuggestions.js +3 -2
  12. package/dist/cli/chat/inputSuggestions.d.ts +8 -16
  13. package/dist/cli/chat/inputSuggestions.js +9 -41
  14. package/dist/cli/chat/liveRegion.d.ts +25 -0
  15. package/dist/cli/chat/liveRegion.js +48 -0
  16. package/dist/cli/chat/messages.d.ts +33 -4
  17. package/dist/cli/chat/messages.js +218 -35
  18. package/dist/cli/chat/sessionLifecycle.d.ts +11 -1
  19. package/dist/cli/chat/sessionLifecycle.js +64 -14
  20. package/dist/cli/chat/sessionRecorder.js +75 -7
  21. package/dist/cli/chat/startupInfo.d.ts +0 -1
  22. package/dist/cli/chat/startupInfo.js +11 -15
  23. package/dist/cli/chat/turnState.d.ts +1 -1
  24. package/dist/cli/chat/wizardDispatch.d.ts +90 -28
  25. package/dist/cli/chat/wizardDispatch.js +349 -133
  26. package/dist/cli/commands/chat.d.ts +5 -0
  27. package/dist/cli/commands/chat.js +216 -172
  28. package/dist/cli/commands/chatModes.d.ts +8 -1
  29. package/dist/cli/commands/chatModes.js +9 -44
  30. package/dist/cli/commands/commands.d.ts +2 -0
  31. package/dist/cli/commands/commands.js +10 -5
  32. package/dist/cli/commands/doctor.d.ts +19 -0
  33. package/dist/cli/commands/doctor.js +76 -0
  34. package/dist/cli/commands/formatters.d.ts +3 -3
  35. package/dist/cli/commands/formatters.js +8 -25
  36. package/dist/cli/commands/ndjsonSink.d.ts +23 -0
  37. package/dist/cli/commands/ndjsonSink.js +38 -0
  38. package/dist/cli/commands/providerWizard.d.ts +9 -2
  39. package/dist/cli/commands/providerWizard.js +39 -7
  40. package/dist/cli/commands/runCommand.d.ts +3 -0
  41. package/dist/cli/commands/runCommand.js +117 -11
  42. package/dist/cli/commands/serverWizard.d.ts +34 -0
  43. package/dist/cli/commands/{mcpWizard.js → serverWizard.js} +44 -2
  44. package/dist/cli/commands/skillsWizard.d.ts +41 -0
  45. package/dist/cli/commands/{skillWizard.js → skillsWizard.js} +33 -11
  46. package/dist/cli/commands/streaming/abortCause.d.ts +25 -0
  47. package/dist/cli/commands/streaming/abortCause.js +16 -0
  48. package/dist/cli/commands/streaming/agentAttempt.d.ts +43 -0
  49. package/dist/cli/commands/streaming/agentAttempt.js +79 -0
  50. package/dist/cli/commands/streaming/assistantText.js +9 -2
  51. package/dist/cli/commands/streaming/attemptLifecycle.d.ts +56 -0
  52. package/dist/cli/commands/streaming/attemptLifecycle.js +110 -0
  53. package/dist/cli/commands/streaming/attemptOutcome.d.ts +96 -0
  54. package/dist/cli/commands/streaming/attemptOutcome.js +206 -0
  55. package/dist/cli/commands/streaming/attemptSetup.d.ts +78 -0
  56. package/dist/cli/commands/streaming/attemptSetup.js +167 -0
  57. package/dist/cli/commands/streaming/goalCheckpoint.d.ts +65 -0
  58. package/dist/cli/commands/streaming/goalCheckpoint.js +23 -0
  59. package/dist/cli/commands/streaming/goalSupervisor.d.ts +64 -0
  60. package/dist/cli/commands/streaming/goalSupervisor.js +130 -0
  61. package/dist/cli/commands/streaming/stallRecovery.d.ts +94 -0
  62. package/dist/cli/commands/streaming/stallRecovery.js +105 -0
  63. package/dist/cli/commands/streaming/streamLoop.d.ts +72 -0
  64. package/dist/cli/commands/streaming/streamLoop.js +448 -0
  65. package/dist/cli/commands/streaming/toolCallRecovery.d.ts +16 -0
  66. package/dist/cli/commands/streaming/toolCallRecovery.js +80 -0
  67. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +31 -1
  68. package/dist/cli/commands/streaming/toolGroupRenderer.js +50 -4
  69. package/dist/cli/commands/streaming/toolResultState.d.ts +6 -1
  70. package/dist/cli/commands/streaming/toolResultState.js +29 -7
  71. package/dist/cli/commands/streaming/turnRuntime.d.ts +4 -0
  72. package/dist/cli/commands/streaming/turnRuntime.js +6 -0
  73. package/dist/cli/commands/streaming.d.ts +65 -9
  74. package/dist/cli/commands/streaming.js +133 -430
  75. package/dist/cli/commands/wizardFlow.d.ts +334 -0
  76. package/dist/cli/commands/wizardFlow.js +377 -0
  77. package/dist/cli/contextReport.js +3 -0
  78. package/dist/cli/index.js +68 -22
  79. package/dist/cli/terminalTitle.js +1 -1
  80. package/dist/config/contextFiles.js +9 -3
  81. package/dist/config/inputHistory.d.ts +0 -1
  82. package/dist/config/inputHistory.js +1 -1
  83. package/dist/config/modelDiscovery.d.ts +36 -0
  84. package/dist/config/modelDiscovery.js +164 -1
  85. package/dist/config/privateStorage.js +28 -2
  86. package/dist/config/providerAuth.d.ts +14 -0
  87. package/dist/config/providerAuth.js +49 -0
  88. package/dist/config/providerPresets.d.ts +39 -7
  89. package/dist/config/providerPresets.js +371 -100
  90. package/dist/config/providers.js +2 -0
  91. package/dist/config/settings.d.ts +43 -0
  92. package/dist/config/settings.js +12 -0
  93. package/dist/config/skillSettings.js +4 -4
  94. package/dist/config/updateCheck.d.ts +0 -1
  95. package/dist/config/updateCheck.js +1 -1
  96. package/dist/core/agent/budgets.d.ts +73 -1
  97. package/dist/core/agent/budgets.js +94 -1
  98. package/dist/core/agent/compaction.d.ts +38 -0
  99. package/dist/core/agent/compaction.js +92 -17
  100. package/dist/core/agent/completionController.d.ts +224 -0
  101. package/dist/core/agent/completionController.js +296 -0
  102. package/dist/core/agent/contextBudget.d.ts +36 -2
  103. package/dist/core/agent/contextBudget.js +62 -9
  104. package/dist/core/agent/errors.d.ts +0 -1
  105. package/dist/core/agent/errors.js +1 -1
  106. package/dist/core/agent/events.d.ts +78 -0
  107. package/dist/core/agent/goalPolicy.d.ts +47 -0
  108. package/dist/core/agent/goalPolicy.js +106 -0
  109. package/dist/core/agent/reasoningPolicy.d.ts +31 -0
  110. package/dist/core/agent/reasoningPolicy.js +27 -0
  111. package/dist/core/agent/requestAssembly.d.ts +2 -2
  112. package/dist/core/agent/requestAssembly.js +16 -4
  113. package/dist/core/agent/toolCapabilities.d.ts +27 -0
  114. package/dist/core/agent/toolCapabilities.js +58 -0
  115. package/dist/core/agent/toolOutputStore.d.ts +8 -0
  116. package/dist/core/agent/toolOutputStore.js +11 -11
  117. package/dist/core/agent/toolResults.d.ts +12 -0
  118. package/dist/core/agent/toolResults.js +38 -0
  119. package/dist/core/agent/turnPolicy.d.ts +11 -0
  120. package/dist/core/agent/turnPolicy.js +19 -0
  121. package/dist/core/agent/workState.d.ts +81 -3
  122. package/dist/core/agent/workState.js +176 -10
  123. package/dist/core/attachments/imageAttachments.js +90 -42
  124. package/dist/core/deadline.d.ts +27 -0
  125. package/dist/core/deadline.js +74 -0
  126. package/dist/core/io/boundedRead.js +1 -1
  127. package/dist/core/limits.d.ts +51 -0
  128. package/dist/core/limits.js +51 -0
  129. package/dist/core/log/llmLog.js +8 -1
  130. package/dist/core/persistence/orderedFileWriter.d.ts +10 -0
  131. package/dist/core/persistence/orderedFileWriter.js +16 -2
  132. package/dist/core/process/backgroundRegistry.d.ts +2 -3
  133. package/dist/core/process/backgroundRegistry.js +15 -10
  134. package/dist/core/process/runBoundedProcess.d.ts +8 -2
  135. package/dist/core/process/runBoundedProcess.js +15 -6
  136. package/dist/core/process/userShell.d.ts +16 -0
  137. package/dist/core/process/userShell.js +59 -0
  138. package/dist/core/safety/missingExecutable.d.ts +42 -0
  139. package/dist/core/safety/missingExecutable.js +77 -0
  140. package/dist/core/safety/shellClassifier.d.ts +11 -0
  141. package/dist/core/safety/{bashClassifier.js → shellClassifier.js} +5 -3
  142. package/dist/core/safety/urlGuard.d.ts +1 -1
  143. package/dist/core/session/sessionSlimming.d.ts +0 -3
  144. package/dist/core/session/sessionSlimming.js +2 -3
  145. package/dist/core/session/sessionStore.d.ts +38 -0
  146. package/dist/core/session/sessionStore.js +242 -59
  147. package/dist/core/{bashOutput → shellOutput}/lineFilter.js +8 -2
  148. package/dist/core/{bashOutput → shellOutput}/reducers/search.d.ts +0 -1
  149. package/dist/core/{bashOutput → shellOutput}/reducers/search.js +1 -1
  150. package/dist/core/shellOutput/registry.d.ts +2 -0
  151. package/dist/core/{bashOutput → shellOutput}/registry.js +3 -3
  152. package/dist/core/{bashOutput → shellOutput}/types.d.ts +6 -5
  153. package/dist/core/subagent/contracts.d.ts +6 -14
  154. package/dist/core/subagent/contracts.js +4 -3
  155. package/dist/core/subagent/executionProfiles.js +2 -2
  156. package/dist/core/subagent/subagentCoordinator.d.ts +4 -0
  157. package/dist/core/subagent/subagentCoordinator.js +32 -2
  158. package/dist/core/subagent/subagentRunner.js +19 -40
  159. package/dist/core/toolOutput/reduction.d.ts +0 -12
  160. package/dist/core/toolOutput/reduction.js +1 -1
  161. package/dist/core/validation/outputParser.d.ts +2 -2
  162. package/dist/llm/client.d.ts +17 -1
  163. package/dist/llm/client.js +86 -14
  164. package/dist/llm/hazeTools.d.ts +693 -204
  165. package/dist/llm/hazeTools.js +110 -28
  166. package/dist/llm/initPrompt.js +1 -1
  167. package/dist/llm/lsp/client.d.ts +45 -0
  168. package/dist/llm/lsp/client.js +195 -0
  169. package/dist/llm/lsp/pool.d.ts +23 -0
  170. package/dist/llm/lsp/pool.js +86 -0
  171. package/dist/llm/lsp/protocol.d.ts +64 -0
  172. package/dist/llm/lsp/protocol.js +128 -0
  173. package/dist/llm/lsp/requests.d.ts +94 -0
  174. package/dist/llm/lsp/requests.js +119 -0
  175. package/dist/llm/lspTools.d.ts +5653 -33
  176. package/dist/llm/lspTools.js +152 -80
  177. package/dist/llm/openaiCodex.d.ts +1 -0
  178. package/dist/llm/openaiCodex.js +43 -0
  179. package/dist/llm/openaiCodexOAuth.d.ts +51 -0
  180. package/dist/llm/openaiCodexOAuth.js +217 -0
  181. package/dist/llm/requestContext.d.ts +7 -0
  182. package/dist/llm/requestContext.js +30 -4
  183. package/dist/llm/systemPrompt.d.ts +12 -0
  184. package/dist/llm/systemPrompt.js +24 -11
  185. package/dist/llm/toolResultTypes.d.ts +7 -14
  186. package/dist/llm/toolResultTypes.js +1 -4
  187. package/dist/llm/tools/editMatch.d.ts +14 -9
  188. package/dist/llm/tools/editMatch.js +73 -1
  189. package/dist/llm/tools/failures.d.ts +2 -0
  190. package/dist/llm/tools/failures.js +1 -0
  191. package/dist/llm/tools/fetchTool.d.ts +16 -0
  192. package/dist/llm/tools/fetchTool.js +1 -1
  193. package/dist/llm/tools/fileToolShared.d.ts +8 -5
  194. package/dist/llm/tools/fileToolShared.js +22 -23
  195. package/dist/llm/tools/gitIgnore.d.ts +42 -0
  196. package/dist/llm/tools/gitIgnore.js +247 -0
  197. package/dist/llm/tools/grepParse.d.ts +2 -1
  198. package/dist/llm/tools/grepRunner.d.ts +1 -1
  199. package/dist/llm/tools/grepRunner.js +2 -2
  200. package/dist/llm/tools/outputCap.d.ts +2 -7
  201. package/dist/llm/tools/outputCap.js +3 -3
  202. package/dist/llm/tools/processTool.d.ts +16 -16
  203. package/dist/llm/tools/processTool.js +1 -1
  204. package/dist/llm/tools/readRecovery.d.ts +8 -0
  205. package/dist/llm/tools/readRecovery.js +135 -0
  206. package/dist/llm/tools/{bashTool.d.ts → shellTool.d.ts} +171 -123
  207. package/dist/llm/tools/{bashTool.js → shellTool.js} +20 -14
  208. package/dist/llm/tools/toolContext.d.ts +1 -1
  209. package/dist/llm/tools/toolContext.js +66 -37
  210. package/dist/llm/tools/workspaceFile.d.ts +0 -1
  211. package/dist/llm/tools/workspaceFile.js +1 -6
  212. package/dist/llm/webFetch.d.ts +18 -1
  213. package/dist/llm/webFetch.js +64 -97
  214. package/dist/skills/SkillLoader.d.ts +1 -11
  215. package/dist/skills/SkillLoader.js +1 -2
  216. package/dist/skills/types.d.ts +2 -1
  217. package/dist/ui/codeHighlight.d.ts +4 -0
  218. package/dist/ui/codeHighlight.js +31 -0
  219. package/dist/ui/components/Header.d.ts +1 -1
  220. package/dist/ui/components/MarkdownText.d.ts +16 -2
  221. package/dist/ui/components/MarkdownText.js +244 -34
  222. package/dist/ui/components/TextInput.d.ts +8 -1
  223. package/dist/ui/components/TextInput.js +6 -2
  224. package/dist/ui/theme.d.ts +4 -3
  225. package/dist/ui/theme.js +5 -4
  226. package/dist/utils/buildInfo.d.ts +97 -0
  227. package/dist/utils/buildInfo.js +244 -0
  228. package/dist/utils/fs.d.ts +11 -0
  229. package/dist/utils/fs.js +91 -26
  230. package/dist/utils/openPath.d.ts +2 -2
  231. package/dist/utils/openPath.js +19 -6
  232. package/dist/utils/path.d.ts +2 -1
  233. package/dist/utils/path.js +6 -2
  234. package/dist/utils/utf8.d.ts +22 -0
  235. package/dist/utils/utf8.js +54 -0
  236. package/dist/utils/version.d.ts +9 -3
  237. package/dist/utils/version.js +28 -2
  238. package/package.json +28 -21
  239. package/dist/cli/commands/lspWizard.d.ts +0 -14
  240. package/dist/cli/commands/lspWizard.js +0 -44
  241. package/dist/cli/commands/mcpWizard.d.ts +0 -15
  242. package/dist/cli/commands/skillConfirmRemove.d.ts +0 -11
  243. package/dist/cli/commands/skillConfirmRemove.js +0 -20
  244. package/dist/cli/commands/skillCreation.d.ts +0 -12
  245. package/dist/cli/commands/skillCreation.js +0 -14
  246. package/dist/cli/commands/skillWizard.d.ts +0 -17
  247. package/dist/cli/commands/streaming/idleTimer.d.ts +0 -26
  248. package/dist/cli/commands/streaming/idleTimer.js +0 -24
  249. package/dist/cli/commands/streaming/turnOutcome.d.ts +0 -10
  250. package/dist/cli/commands/streaming/turnOutcome.js +0 -13
  251. package/dist/cli/commands/wizardActions.d.ts +0 -46
  252. package/dist/cli/commands/wizardActions.js +0 -46
  253. package/dist/cli/commands/wizardInput.d.ts +0 -4
  254. package/dist/cli/commands/wizardInput.js +0 -19
  255. package/dist/cli/commands/wizardPrompts.d.ts +0 -22
  256. package/dist/cli/commands/wizardPrompts.js +0 -52
  257. package/dist/cli/commands/wizardSuggestions.d.ts +0 -31
  258. package/dist/cli/commands/wizardSuggestions.js +0 -188
  259. package/dist/cli/commands/wizardTransition.d.ts +0 -37
  260. package/dist/cli/commands/wizardTransition.js +0 -43
  261. package/dist/core/bashOutput/ansi.d.ts +0 -1
  262. package/dist/core/bashOutput/ansi.js +0 -7
  263. package/dist/core/bashOutput/registry.d.ts +0 -4
  264. package/dist/core/goal/completionPolicy.d.ts +0 -2
  265. package/dist/core/goal/completionPolicy.js +0 -7
  266. package/dist/core/goal/requestClassifier.d.ts +0 -3
  267. package/dist/core/goal/requestClassifier.js +0 -18
  268. package/dist/core/goal/sessionGoal.d.ts +0 -8
  269. package/dist/core/goal/sessionGoal.js +0 -30
  270. package/dist/core/limits/byteBudgets.d.ts +0 -18
  271. package/dist/core/limits/byteBudgets.js +0 -18
  272. package/dist/core/limits/textBudgets.d.ts +0 -23
  273. package/dist/core/limits/textBudgets.js +0 -23
  274. package/dist/core/safety/bashClassifier.d.ts +0 -10
  275. package/dist/llm/lsp.d.ts +0 -129
  276. package/dist/llm/lsp.js +0 -307
  277. package/dist/ui/components/ErrorView.d.ts +0 -4
  278. package/dist/ui/components/ErrorView.js +0 -7
  279. package/dist/utils/yaml.d.ts +0 -2
  280. package/dist/utils/yaml.js +0 -8
  281. package/examples/skills/files/SKILL.md +0 -16
  282. package/examples/skills/files/examples/file-editing.md +0 -3
  283. /package/dist/core/{bashOutput → shellOutput}/command.d.ts +0 -0
  284. /package/dist/core/{bashOutput → shellOutput}/command.js +0 -0
  285. /package/dist/core/{bashOutput → shellOutput}/lineFilter.d.ts +0 -0
  286. /package/dist/core/{bashOutput → shellOutput}/reducers/content.d.ts +0 -0
  287. /package/dist/core/{bashOutput → shellOutput}/reducers/content.js +0 -0
  288. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.d.ts +0 -0
  289. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.js +0 -0
  290. /package/dist/core/{bashOutput → shellOutput}/reducers/git.d.ts +0 -0
  291. /package/dist/core/{bashOutput → shellOutput}/reducers/git.js +0 -0
  292. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.d.ts +0 -0
  293. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.js +0 -0
  294. /package/dist/core/{bashOutput → shellOutput}/types.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,105 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 1.0.0 - 2026-08-16
4
+
5
+ The first stable release. The CLI flags, settings schema, `stream-json` event contract, session format, skill layout, and structured tool-result shape are now covered by the 1.x compatibility promise: breaking changes to them require a new major version.
6
+
7
+ This release was validated with a differential Harbor benchmark (`local/csv-query`, glm-5.3, four harnesses — claude-code, nanocoder, pi, haze — same model and backend): haze 1.0.0 passed 17/17 verifier tests with the fewest input tokens of the reporting harnesses, a clean goal envelope (1 cycle, structured passing validation), and zero stalls; the four defects the benchmark surfaced earlier were all fixed on this line. Full report: `benchmarks/harbor/results/20260816-224944-glm53-differential.html`.
8
+
9
+ ### Added
10
+
11
+ - Configurable model-retry pool (`modelRetries` setting, integer 0–10, default 2): the shared bounded pool that retries transient model errors and idle-stream stalls is no longer hardcoded. Providers that terminate long streams aggressively (Z.ai's OpenAI-compatible endpoint repeatedly stalled or terminated long streams, exhausting the old fixed pool of 2 and failing a 28-minute benchmark run) can now be given more headroom, and `0` disables automatic retries entirely (stalls pause with the goal preserved for an interactive resume). The effective pool size is reported in `timeout` and `retry` stream events (`maxRetries`) and in stall diagnostics, so headless consumers can see the configured bound.
12
+
13
+ ### Fixed
14
+
15
+ All four defects below were surfaced by the csv-query differential benchmark (same model across harnesses isolates the harness) and carry regression coverage:
16
+
17
+ - `writeFile` no longer shadows its own chunking guidance with a cryptic `AI_TypeValidationError`: the input schema previously capped `content` at 16 KiB, so an oversized single-chunk write died at Zod validation before `execute` could return the actionable `write_chunk_too_large` advice (write the first chunk, then `append=true`). Size policy now lives only in `execute`.
18
+ - Reads fail open in Git-less workspaces again, restoring the documented contract: `readFile` threw `ignore_check_unavailable` when Git was absent (common in benchmark and container environments) instead of tolerating `unknown` ignore status. Mutations keep failing closed when ignore status is unverifiable.
19
+ - The shell validation classifier is no longer JS-toolchain-biased: common Python, Go, Rust, Make, Maven, Gradle, Ruby, .NET, Deno, Bun, and Node test commands now count as bounded validation evidence, and direct, unchained execution of a file changed during the active goal also counts — so a successful `node tool.js … data.csv` run satisfies completion without crediting unrelated shell commands.
20
+ - Custom checks are now visible to the completion gate: `shell` accepts `purpose=validation`, producing structured evidence from the real exit result for ad hoc assertion scripts. Missing-validation repair gets one focused slice, rejected summaries leave active model context, and mutation/revision churn no longer extends the goal. Deadline exits preserve cumulative evidence and report `goal-deadline`, not `user-aborted`.
21
+
22
+ ### Changed
23
+
24
+ - `SECURITY.md` supported-series table now tracks the `1.x` major (security fixes for the latest published release; pre-1.0 versions require an upgrade).
25
+
26
+ ## 0.11.0 - 2026-08-15
27
+
28
+ ### Added
29
+
30
+ - Runtime provenance and stale-install protection: `npm run build` now embeds `dist/buildInfo.json` (version, commit, build time), and the `bin/haze.js` launcher verifies required compiled modules (including the goal supervisor) and manifest/version/commit consistency before starting — refusing incomplete or stale builds with an actionable rebuild hint instead of running partially outdated code. `haze --version --verbose` prints the executing version, commit, runtime/executable paths, and goal-supervisor state; the new `haze doctor` command reports the same provenance plus artifact/manifest checks, the runtime capability registry (`logicalGoalSupervisor`, `crossTurnCheckpoints`, `automaticBudgetContinuation`), and a warning when a nearby source checkout is newer than the running binary (interactive startup shows the same warning; nothing is ever switched silently). Session headers now record the executing build (version + commit + build time) so saved failures tie to the code that actually ran, every goal start logs "goal supervisor enabled; automatic continuation across physical-turn budgets" in debug output, and `npm run dev:link` builds the checkout, links it globally, and verifies the `haze` on PATH resolves to this checkout's version and commit (the non-global alternative remains `npm run haze -- <args>`).
31
+ - Autonomous goal continuation across physical turns: per-turn step/tool budgets no longer end the user's goal, and a voluntary final is no longer accepted as completion while this turn's declared `writeTasks` list has pending/in-progress items or post-mutation validation is missing/stale/failed (implement/fix/test intents) — prose alone is never evidence. A logical-goal supervisor wraps each request — a turn that stops `recoverable-incomplete` at any budget boundary (including `tool-calls` finishes) automatically starts the next continuation turn against the preserved conversation, sharing one mutation lease, seeding cumulative task/validation/mutation evidence so nothing resets at the boundary and completed work is never replayed. It continues while measurable progress occurs and stops only for structured completion, concrete external blockers, user cancellation, the goal deadline, or two consecutive no-progress cycles (the first being the allowed corrective) — never silently discarding recoverable work and never reporting it complete. Interactively, continuation is automatic with a visible "Continuing unfinished goal — cycle N" status and the `R` key is reserved for genuinely paused goals; headless `--timeout` now bounds the whole logical goal, `stream-json` gains `goal_start`/`goal_continue`/`goal_end` events, the JSON result envelope gains cumulative `goal` evidence (cycles, stop reason, total mutations, final validation outcome and task counts), and the exit code stays non-zero unless the goal structurally completed.
32
+ - Model-written `/compact` summaries (F-09): manual `/compact` now asks the active model to summarize the older conversation into a continuity summary (goal, decisions, files, validation results, next action), keeping the recent tail verbatim. Set `manualCompaction: "heuristic"` in settings to keep the previous model-free bounded excerpt; automatic mid-turn compaction always uses the heuristic excerpt, and any summarization failure falls back to it.
33
+ - Headless `--timeout <duration>` (e.g. `30s`, `10m`, `2h`) sets an absolute turn deadline that bounds total elapsed time; on expiry haze emits a `timeout` stream-json event and exits non-zero. Per-tool execution deadlines (default 10m; 20m for subagents) ensure an uncooperative tool cannot defer a turn indefinitely, with late-settlement quarantine so ignored cancellation cannot mutate state.
34
+ - Optional per-provider `modelLimits` metadata (`contextWindowTokens`, `maxOutputTokens`) for request budgeting; `npm run release:verify` checks package/lockfile/README/changelog/SECURITY/docs/AGENTS version agreement in one run (wired into `prepublishOnly`).
35
+ - Provider presets now carry curated per-model context-window and output-token limits (from the models.dev catalog, the same source pi and nanocoder use; cross-checked against kilocode and opencode's models.dev exports), and the provider wizard writes them into the provider's `modelLimits` settings when a suggested model is added — so request budgeting uses the real window instead of the conservative 32K fallback without any user configuration. Limits are per-preset because aggregators may cap context below the origin model (e.g. Together serves DeepSeek-V4-Pro at 512K vs DeepSeek's own 1M); a drift-guard test keeps every suggested model on every hosted preset covered. Suggested model lists were refreshed to current releases (e.g. gpt-5.6 family, gemini-3.7-flash, claude-opus-5, grok-4.6, glm-5.3, kimi-k3, Qwen3.7-Max, Qwen3.8-2.4t, thinkingmachines/Inkling, nemotron-3.5-lightning, deepseek-v4-pro-0813) and stale/deprecated ids (o4-mini, devstral-2512, qwen3-32b) were replaced. Poe's suggested ids were corrected to its provider-prefixed form (`anthropic/claude-opus-4.8`, not `claude-opus-4.8`). New curated gateway presets: Kilo Gateway, Novita AI, Deep Infra, SiliconFlow, and Nebius AI Studio (all OpenAI-compatible endpoints with their conventional API-key env vars).
36
+
37
+ ### Changed
38
+
39
+ - Session files no longer grow quadratically over long sessions (F-03): snapshots rewrite the full conversation history each turn, so a long session cost O(turns × history) bytes on disk. Once superseded snapshots dominate the file (16 MB by default), haze atomically rewrites it keeping only the newest conversation/work-state snapshots plus all small entries; restore semantics are unchanged and browsing history (ui messages, events) is preserved.
40
+ - The completion-rescue slice now also covers `test`-intent requests (F-04): a long test-orchestration turn that exhausts the tool-only boundary without a substantive answer gets the same bounded rescue slice as implement/fix requests, gated by the shared `intentExpectsValidation` policy.
41
+ - Headless print mode now self-heals from provider context overflows (F-10): `-p` runs compact the loaded conversation once and retry, like the interactive path. When compaction is unavailable, the error message says so explicitly instead of the misleading "not enough conversation history".
42
+ - Mutation tools fail closed when Git cannot run (F-05): ignore checks for `editFile`/`writeFile`/`replaceLines` now distinguish "checked and not ignored" from "could not check". Reads still fail open, but writes into a workspace where ignore status is unverifiable (missing/broken Git) are refused with `ignore_check_unavailable` unless `allowIgnored=true` is set explicitly.
43
+ - Per-step request estimation is memoized per message object (F-07): `prepareStep` no longer re-stringifies the entire message history on every provider call, removing the O(history) CPU cost per step on very long turns.
44
+ - A rescue slice with no qualifying built-in mutation/validation tools now forces a tool-free synthesis step instead of silently keeping the full tool set (F-08), preserving the "rescue never reopens discovery" invariant when builtins have been removed.
45
+ - The provider wizard warns when a ChatGPT sign-in provider's configured URL diverges from the canonical Codex endpoint (F-14) — requests always route to the registered endpoint — and typing the canonical Codex URL during a custom add now points at the OpenAI Subscription preset.
46
+ - README and docs now state the supervision model prominently (no sandbox or permission layer; not an unattended runtime), the fixed OAuth callback port 1455 that can block ChatGPT sign-in, and the crash-recovery granularity: sessions persist at turn boundaries, so after a mid-turn crash resume replays from the last completed turn and the working tree should be verified with git (F-02/F-06/F-11).
47
+ - The conservative context-window fallback for models without metadata is now 128K (the modern floor for capable hosted models) instead of 32K, and unknown models on localhost inference servers keep the smaller 32K default because their effective window is set by server configuration (often 4–32K) and silent truncation there is undetectable. Both fallbacks are user-configurable in settings (`contextWindowFallbackTokens`, `localContextWindowFallbackTokens`); unset means the built-in defaults. The guess is observable: every turn emits a `context_budget` stream event (`contextWindowTokens`, `source: settings|user-fallback|default-fallback`), and interactively a system message — shown only when the built-in default was used, since a user-set fallback is an intentional choice — names the model and how to correct it. The warning is gated per model: it appears at the start of a session and once after a model switch, never on every turn.
48
+ - The context-fallback warning is now genuinely once-per-session per model: it previously reappeared on every turn because the per-session warned flag lived on a throwaway object. A stable in-memory session object carries the last warned `provider:model` key, so the same model stays silent for the rest of the session and a switched-to fallback model warns exactly once at its first turn.
49
+ - Provider wizard model discovery now harvests non-standard context/output fields from the OpenAI-compatible `/models` listing (OpenRouter `context_length`, Groq `context_window`, LM Studio `max_context_length`, `max_output_tokens`/`max_completion_tokens`/`max_tokens`), sanity-clamped to plausible token ranges. Harvested values are written into the provider's `modelLimits` when the model is added and win over the static preset catalog (live provider data beats the catalog; user-configured keys still win over both). Ollama reports nothing in `/v1/models`, so the wizard additionally probes its native API at save time for loopback URLs: the actually-loaded runtime context from `/api/ps` first, an explicit Modelfile `num_ctx` from `/api/show` second, and the model's declared maximum capped at the user's local fallback setting (default 32K) last (Ollama auto-sizes the effective window to available VRAM, and over-trusting the declared maximum would risk silent truncation). Unknown models stay on the fallback and its warning.
50
+ - Performance and long-running-autonomous hardening: `listFiles` discovery now uses one bounded `git check-ignore` batch per directory level instead of one Git subprocess per walked entry, and cursor pagination no longer re-checks entries that preceded the cursor. LSP navigation (symbols/definition/references/workspace symbols) reuses a single initialized language server and its opened documents per turn instead of restarting and reindexing on every call. `/fleet` subagents now let read-only work fill idle slots behind one blocked mutation (bounded so a serialized mutation is never starved). Session conversation/work-state snapshots are coalesced so a long turn does not rewrite the full history on every update. The interactive transcript caches settled Markdown root chunks so it no longer re-lexes the whole history on each render.
51
+ - Main tool-call budgets are now enforced atomically at the execution boundary, so one oversized parallel batch cannot overshoot the turn or recovery-slice limit; blocked calls have no side effect and force a final synthesis.
52
+ - Context budgeting is now model-aware: the message allowance is the configured context window minus the system prompt, tool schemas, output reserve, and a safety margin (no longer a fixed 40K). Long multi-step turns compact accumulated tool history before each provider request, and context-overflow retries shrink the target progressively.
53
+ - `--output stream-json` now emits `message_update` deltas (not cumulative text) through an ordered, backpressure-aware NDJSON sink, so total update payload stays linear in the final response size; `message_end.text` remains complete and authoritative.
54
+ - A stalled model stream no longer discards unfinished work as a generic user abort. Abort causes are typed (user cancel, turn deadline, model-stream idle) so each path gets its own message and outcome. An idle stall with no emitted step output retries through the bounded model-retry pool, salvaging the conversation to the last completed step so mutating tool work is never re-run; when retries are exhausted or the stalled step emitted partial output, the turn pauses with the active goal preserved and chat offers a one-key `R` resume instead of a restate. Stall diagnostics (provider/model, last stream event, emission state, retry eligibility) surface in the timeout event, debug log, and debug panel as metadata only.
55
+
56
+ ### Fixed
57
+
58
+ - Streaming no longer flickers or erases scrollback: the live frame now renders incrementally (only changed lines are rewritten, capped at 15 fps to match the spinner cadence), and the dynamic tail (streaming roots, live tool groups, task bar) is clamped to a viewport-derived row budget with row estimates mirroring Ink's own `wrap-ansi` wrapping — so Ink never enters its scrollback-wiping overflow path even when the live region outgrows the terminal height. `wrap-ansi` (already in the tree via Ink) becomes a direct dependency.
59
+ - Provider normalization no longer strips user-configured `modelLimits` from settings: `normalizeProvider` whitelisted name/url/key/kind/capabilities/models only, so limits configured in `settings.json` were silently dropped before model resolution ever saw them.
60
+ - Build-provenance reads work again: an inverted cache sentinel made the default-path `readBuildInfo()` return before ever reading `dist/buildInfo.json`, so `haze --version --verbose` printed `commit: unknown` and session headers never recorded the executing build (`haze doctor`, which probes explicit candidate paths, was unaffected). The default path now loads and caches correctly and has regression coverage.
61
+ - The print-mode help text no longer claims "there is no automatic context-overflow recovery"; it now describes the actual behavior (compact the conversation and retry once, with an explicit error when compaction is unavailable), matching the README and the implementation.
62
+ - Dependency refresh (nanoid 3.3.17 → 3.3.18 for GHSA-2v37-7h3g-55p8, esbuild 0.28.1 → 0.28.2, @ai-sdk/mcp 2.0.31 → 2.0.32) keeps `npm audit --audit-level=high` and CI green, and CI caps vitest workers for a deterministic suite.
63
+
64
+ ## 0.10.1 - 2026-08-13
65
+
66
+ ### Added
67
+
68
+ - Added OpenAI Subscription provider preset with browser OAuth against the ChatGPT Codex Responses endpoint. Credentials live in `~/.haze/auth.json` with private permissions and are refreshed transparently near expiry; the chatgpt-codex provider kind routes all requests to the canonical Codex URL with the account-id header attached.
69
+ - Added `SECURITY.md` with the supported-version policy, private reporting route, response expectations, and attended-use threat model.
70
+ - Added regression coverage for external prompt-injection framing, fetch deadlines and transport behavior, oversized stdin, tampered sessions, unsafe log ids, C1 terminal controls, Windows process-tree signaling, and shared UTF-8 boundaries.
71
+
72
+ ### Changed
73
+
74
+ - The interactive transcript uses Ink static output for the header, completed messages, and parser-stable root-level Markdown blocks from an active response. Only the unfinished root block and live controls rerender, reducing terminal flicker and scroll jumps without rendering incomplete Markdown as if it were finished.
75
+ - New interactive sessions stay in memory until the first non-empty UI message or conversation snapshot. Empty sessions no longer create JSONL files, and zero-message files from earlier versions are omitted from `/resume`, `--continue`, and latest-session selection.
76
+ - Added bounded completion recovery for long turns: one output-length continuation and one final mutation/validation rescue slice, both counted against turn-wide budgets. Headless results and lifecycle events now include safe completion and validation evidence.
77
+ - File mutation tools now render compact colorized diffs, with first/last previews and retained handles for large changes.
78
+ - Updated runtime and development dependencies to current releases while keeping TypeScript pinned at 6.0.3; the full dependency audit reports zero vulnerabilities.
79
+ - Replaced the single-page docs site with a multi-page redesign (landing, quickstart, commands, tools, skills, workflows) backed by shared CSS/JS.
80
+ - Documented the public contracts for CLI flags, slash commands, tool result shapes, settings and session files, Markdown skill packages, and the Node.js 22 support floor.
81
+ - CI now runs typecheck, tests, lint, build, `npm audit --audit-level=high`, and `npm pack --dry-run` on Node 22 and 24. Explicit `any` is now a lint error.
82
+ - Consolidated UTF-8-safe byte truncation, package-version loading, and platform external-opening helpers. Known tool-context fields now receive light runtime type validation.
83
+ - Refined the terminal palette, startup guidance, system-message formatting, task display, and session startup grouping.
84
+ - Session-picker summaries are cached by file size and modification time. Windows graceful and forced termination both target the complete process tree.
85
+ - `writeFile` now enforces a 16 KiB per-call cap at both the Zod schema and the runtime body. Malformed tool input triggers up to two smaller retries before the turn is reported as blocked with an unresolved-tool-input marker.
86
+
87
+ ### Security
88
+
89
+ - Main and subagent prompts now treat ordinary tool output as untrusted data rather than instructions, including fetched pages, MCP/LSP output, and file content outside the workspace.
90
+ - Documented that bash classification is informational, command confirmation gates are intentionally absent, and haze is intended for supervised use by experienced developers.
91
+ - Documented that `--debug` logs can contain secrets and file contents and must be reviewed before sharing.
92
+ - Session JSONL readers reject structurally invalid entries, log readers reject traversal-shaped ids, and terminal titles strip C0 and C1 control characters.
93
+
94
+ ### Fixed
95
+
96
+ - Fast providers can no longer outrun edit-recovery state and leave the following step restricted to `readFile`. Recovery now advances in the AI SDK's ordered step callback, and equivalent lexical paths such as `a.ts` and `./a.ts` satisfy the reread requirement.
97
+ - Read-only recovery now activates only for structured mutation failures that explicitly request `readFile`; argument-only `writeFile` failures can be retried directly with corrected input.
98
+ - Repeated identical calls suppress a tool only for the immediately following step instead of removing that tool for the remainder of the turn.
99
+ - `readFile` failures provide bounded reason codes, suggested paths, and actionable recovery guidance. Streaming diagnostics consistently expose safe built-in failure details without leaking third-party output.
100
+ - Fetch now cancels redirect bodies, enforces one total redirect deadline, rejects non-streamable bodies instead of buffering them without a cap, normalizes array response headers, and rejects request bodies, unsupported methods, and URL credentials in the pinned transport.
101
+ - Piped stdin is capped at 256 KiB and oversized prompts fail with guidance to pass a file path instead. Non-TTY pipes are detected correctly.
102
+ - Bounded process collectors continue draining discarded bytes after their retention cap so chatty children can exit without filling their pipes.
4
103
 
5
104
  ## 0.10.0 - 2026-08-03
6
105
 
package/README.md CHANGED
@@ -2,20 +2,21 @@
2
2
 
3
3
  A minimal LLM harness for your terminal.
4
4
 
5
- ## What's new in 0.10.0
5
+ ## What's new in 1.0.0
6
6
 
7
- haze 0.10.0 adds richer input, isolated parallel work, and better control over long-running sessions.
7
+ haze 1.0.0 is the first stable release: the CLI flags, settings schema, `stream-json` event contract, session format, skill layout, and structured tool-result shape are now covered by the 1.x compatibility promise. It also lands a configurable model-retry pool and the four benchmark-driven reliability fixes below.
8
8
 
9
- - Attach png, jpeg, gif, or webp files by typing `@path` or a path containing `/`. Explicitly mentioned non-image files and directories can be read for that turn, including outside the workspace; mutating tools remain workspace-confined. `@` autocomplete browses workspace files.
10
- - `/fleet` decomposes genuinely independent work across disposable, context-isolated subagents. Explicit profiles, model selection, concurrency and mutation coordination keep parallel execution bounded and predictable.
11
- - `/resume` now opens a workspace session browser and can resume or fork a saved snapshot. Session IDs are collision-resistant, persisted entries stay compact, and ordered writes flush at turn and shutdown boundaries.
12
- - The agent can register up to five dev servers or watchers as managed background processes. Their bounded rolling output is readable by handle, and haze terminates every registered process tree when the session ends.
13
- - `/model` and provider setup can discover models from OpenAI-compatible `/models` endpoints. Curated models are pinned when available, and the provider wizard includes a larger preset catalog without silently selecting a default.
14
- - Rotating busy-state tips are controlled by `/tips`; terminal tabs identify the active workspace.
15
- - Follow-up hardening removes duplicated bash stream text from model context, gives grep the same process-tree teardown as bash, slims mutation inputs in saved sessions, fixes outline paging after truncation, and makes retry classification stricter.
9
+ - Configurable model-retry pool: the `modelRetries` setting (integer 0–10, default 2) sizes the shared bounded pool that retries transient model errors and idle-stream stalls. Raise it for providers that terminate long streams aggressively; `0` disables automatic retries (stalls pause with the goal preserved for a one-key resume). The effective pool size is visible in `timeout`/`retry` stream events (`maxRetries`) and stall diagnostics.
10
+ - Benchmark-hardened completion evidence (found by the csv-query differential benchmark — same model across four harnesses isolates the harness): `writeFile` chunking guidance can no longer be shadowed by schema validation, reads fail open in Git-less workspaces while mutations still fail closed, the shell validation classifier recognizes Python/Go/Rust/Make/Maven/Gradle/Ruby/.NET/Deno/Bun test commands plus direct runs of files changed this goal, and `shell` accepts `purpose=validation` so ad hoc assertion scripts become structured completion evidence.
11
+ - Validated with a differential Harbor benchmark on glm-5.3 (claude-code, nanocoder, pi, haze): haze passed 17/17 verifier tests with the fewest input tokens of the reporting harnesses, a clean goal envelope (1 cycle, structured passing validation), and zero stalls. Full report under [`benchmarks/harbor/results`](https://github.com/DenizOkcu/haze/tree/main/benchmarks/harbor/results).
12
+ - Carried from 0.11.0: autonomous goal continuation across physical turns, runtime provenance and stale-install protection, model-aware context budgeting, headless `--timeout`, per-tool deadlines, incremental streaming, and model-written `/compact` summaries.
16
13
 
17
14
  Previous releases:
18
15
 
16
+ - `0.11.0`: goal-level autonomy across physical-turn budgets (logical-goal supervisor, evidence-gated completion, `goal_*` stream events, cumulative goal envelope), runtime provenance and `haze doctor` (embedded build info, stale-build refusal, session build headers), model-aware context budgeting (per-preset limits, live discovery, 128K fallback, self-healing context overflow), headless `--timeout` with per-tool deadlines and abort-cause typing, performance work (batched ignore checks, LSP reuse, coalesced/vacuumed sessions, memoized estimates, incremental streaming, viewport-clamped live region), and model-written `/compact` summaries with a heuristic fallback.
17
+ - `0.10.1`: OpenAI Subscription OAuth preset, SECURITY.md and the attended-use threat model, bounded completion recovery, compact colorized diffs, prompt-injection framing, hardened fetch/stdin/sessions, and a multi-page docs site.
18
+
19
+ - `0.10.0`: image input, read-only path blessings, isolated fleet workers, managed background processes, session browsing and forking, model discovery, project skills, and rotating tips.
19
20
  - `0.9.0`: private home-state storage, authoritative turn status, collection-time byte bounds, hardened process teardown, stronger real-path and network boundaries, and ordered persistence.
20
21
  - `0.8.0`: AI SDK v7 runtime, live status with model, elapsed time, and tool labels; bounded bash output processing; lowercase `haze` naming.
21
22
  - `0.7.0`: headless `-p`, `--output json`, and `--output stream-json`; pinned-connection `fetch` safety; scoped instruction refresh; smaller sessions; startup context visibility.
@@ -42,8 +43,14 @@ haze works with OpenAI-compatible providers, including OpenRouter and local endp
42
43
 
43
44
  haze keeps guardrails light. The LLM can work from the terminal with access close to yours while staying scoped to the current project where possible. It is for developers who would rather supervise tool calls than work through a stack of permission dialogs. Keep an eye on what it does.
44
45
 
46
+ ### Supervision model
47
+
48
+ There is **no sandbox and no permission layer**: the shell tool runs unsupervised in your login shell (its classification is informational only), and only the file tools are confined to the workspace. Claude Code gates tools behind permissions, plan mode, and hooks; Codex CLI runs in an OS sandbox with approval modes; haze, like pi, replaces those mechanisms with your supervision. That trade-off is deliberate and keeps the agent fast and transparent, but it also means haze is **not an unattended automation runtime** — run it where you would run a shell session yourself. If a CI job runs haze headless, treat the job the way you would treat any script with shell access. SECURITY.md documents the attended-use threat model in full.
49
+
45
50
  ## Getting started
46
51
 
52
+ haze runs on macOS and Linux with Node.js 22 or newer. Windows is not yet a supported platform (the toolchain assumes a POSIX shell); it is on the 1.x roadmap.
53
+
47
54
  Install haze:
48
55
 
49
56
  ```bash
@@ -63,7 +70,7 @@ On first run, create or choose a provider, then choose your first model:
63
70
  /model
64
71
  ```
65
72
 
66
- `/provider` sets up any OpenAI-compatible endpoint, such as OpenRouter, OpenAI, LM Studio, Ollama, or a proxy. haze asks for a provider name, base URL, optional API key, and model names.
73
+ `/provider` sets up any OpenAI-compatible endpoint, such as OpenRouter, OpenAI, LM Studio, Ollama, or a proxy. haze asks for a provider name, base URL, optional API key, and model names. The **OpenAI API Key** preset uses platform API billing. The **OpenAI Subscription** preset instead opens a ChatGPT browser login and uses the Codex Responses endpoint; no pasted session token is required. Its sign-in callback listens on a fixed localhost port (1455) required by the registered client, so a lingering process holding that port blocks sign-in until it exits; retry after freeing the port.
67
74
 
68
75
  `/model` selects the model haze should use. The picker also offers `add models`, which fetches a provider's model list from its OpenAI-compatible `/models` endpoint so you can pick instead of typing; if the endpoint is unavailable you can still type model names. You can also set one directly:
69
76
 
@@ -85,7 +92,7 @@ Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io)
85
92
 
86
93
  API keys for HTTP/SSE servers are entered in a masked prompt and sent as `Authorization: Bearer <value>`. Stdio authentication belongs in the command or wrapper; haze does not attach HTTP headers to stdio. Servers persist in `~/.haze/settings.json` under `mcpServers`. Discovery and cleanup have bounded deadlines, failures are isolated, and MCP tools never shadow built-ins.
87
94
 
88
- Saved settings live in `~/.haze/settings.json`. Provider keys and MCP headers require HTTPS unless the endpoint uses loopback HTTP (`localhost`, `*.localhost`, `127/8`, or `::1`). Keyless HTTP remains available, and local OpenAI-compatible providers do not need a key. If the settings file is malformed, haze shows an actionable startup error instead of treating it as empty. Configure everything inside haze with `/provider`, `/model`, and `/settings`; there are no environment variables to set.
95
+ Saved settings live in `~/.haze/settings.json`. ChatGPT OAuth credentials live separately in `~/.haze/auth.json`; both files use private permissions. Provider keys and MCP headers require HTTPS unless the endpoint uses loopback HTTP (`localhost`, `*.localhost`, `127/8`, or `::1`). Keyless HTTP remains available, and local OpenAI-compatible providers do not need a key. If a settings or authentication file is malformed, haze shows an actionable error instead of treating it as empty. Configure everything inside haze with `/provider`, `/model`, and `/settings`; there are no environment variables to set. Provider presets carry curated per-model metadata (context window and output cap from the models.dev catalog) which the wizard writes into `modelLimits`.
89
96
 
90
97
  haze focuses on chat, local tools, context files, sessions, and Markdown skills. Use `/skills` for workflows outside that core. Its interactive picker can generate a skill from a description, then enable, disable, validate, or remove it. For reviews, release prep, deploy checks, debugging routines, or a team-specific checklist, ask haze to create a skill and edit the resulting Markdown as needed.
91
98
 
@@ -97,7 +104,7 @@ Open a project and ask for work:
97
104
  create a calculator in calc-app in ruby with add subtract multiply divide
98
105
  ```
99
106
 
100
- haze can inspect and edit files, fetch public URLs, and run commands. Tool activity stays compact in the transcript. Small edits show a colorized diff with one line of context on either side; large diffs get a short summary instead. Bash output is capped while the command runs, then filtered according to the command type. Validation failures keep the useful diagnostics. Raw output handles have per-entry and total memory limits, and tell you how many bytes were dropped. Sessions are saved by default, so you can pick up the latest workspace conversation with `haze --continue` or `/resume`.
107
+ haze can inspect and edit files, fetch public URLs, and run commands. Tool activity stays compact in the transcript. Completed transcript entries render once as static terminal output, which keeps live model and spinner updates from repainting the full history. During a streamed answer, completed root-level Markdown blocks move into that static history while the unfinished block stays plain and live. Small edits show a colorized diff with one line of context on either side; large diffs get a short summary instead. Shell output is capped while the command runs, then filtered according to the command type. Validation failures keep the useful diagnostics. Raw output handles have per-entry and total memory limits, and tell you how many bytes were dropped. Sessions are saved after their first resumable message, so you can pick up the latest workspace conversation with `haze --continue` or `/resume` without accumulating empty session files.
101
108
 
102
109
  The agent can start up to five dev servers or watchers as registered background processes. Their rolling output is capped at 256 KB and remains available through `readToolOutput`; the `process` tool lists, reads, and kills them. The status bar shows the live count. Starting a new session or exiting haze terminates every registered process tree, while aborting an individual turn leaves background work running. Background processes are unavailable inside fleet workers and never survive haze itself.
103
110
 
@@ -238,7 +245,7 @@ echo "what does this project do?" | haze
238
245
 
239
246
  `-p` and `--prompt` run one agentic turn with the full tool set and print the final assistant text. `--model` accepts a bare model name or `provider:name` and overrides the active model for that run without changing `~/.haze/settings.json`. The model must already be registered under a provider's `models`; add it once with `/provider`. Unknown or ambiguous selectors print a specific error to stderr and exit nonzero.
240
247
 
241
- If you pipe stdin without `-p`, haze reads the prompt from stdin. One-shot runs do not create or update durable sessions, and they ignore `--continue`; `--resume <id>` can load an exact saved context for the turn without changing the original session. They also do not compact automatically after a context overflow, so keep large CI prompts within the model's context window. Add `--debug` to write a detailed JSONL log under `~/.haze/logs/`.
248
+ If you pipe stdin without `-p`, haze reads the prompt from stdin. Piped prompts are limited to 256 KiB; for larger input, pass a file path and ask haze to read it. One-shot runs do not create or update durable sessions, and they ignore `--continue`; `--resume <id>` can load an exact saved context for the turn without changing the original session. On a provider context overflow they compact the loaded conversation once, like the interactive path, and retry the same request; if there is too little history to compact, the run fails with a specific message. Add `--debug` to write a detailed JSONL log under `~/.haze/logs/`.
242
249
 
243
250
  `--output` controls the result format: `text` is the default, `json` prints one final envelope, and `stream-json` writes live NDJSON events followed by the same envelope.
244
251
 
@@ -259,7 +266,7 @@ If you pipe stdin without `-p`, haze reads the prompt from stdin. One-shot runs
259
266
  }
260
267
  ```
261
268
 
262
- The `status` field is authoritative (driven by the agent's terminal state, not by parsing `result`), and the exit code mirrors it: `0` only for `complete`. A turn that ends without a substantive final answer, after an unresolved final tool failure, or at a hard step/tool budget is `failed` even if the provider returned normally.
269
+ The `status` field is authoritative (driven by the agent's terminal state, not by parsing `result`), and the exit code mirrors it: `0` only for `complete`. A run that ends without a substantive final answer, after an unresolved final tool failure, with declared tasks or required validation still unfinished (even if the model wrote a final message) is `failed` even if the provider returned normally; the evidence envelope carries the task counts and validation outcome that gated it. Per-turn step/tool budgets are safety boundaries, not completion: haze automatically continues the logical goal in fresh turns while measurable progress remains, so a budget boundary alone never fails a run. `--timeout` bounds the entire logical goal (not each internal turn). The result envelope additionally carries a `goal` object (physical turns used, stop reason, total mutations, final validation outcome and task counts) when goal-level continuation was involved.
263
270
 
264
271
  `--output stream-json` writes progress as the run happens. Each public event is one newline-delimited JSON object on stdout. The last line uses the same `{ type: "result", status, result, usage }` envelope as `--output json`, so consumers can display progress and parse the final result in the same way:
265
272
 
@@ -287,17 +294,17 @@ haze has a small built-in toolset:
287
294
  - `listFiles` handles structured discovery and recursive listings, with cursor pagination when needed.
288
295
  - `readFile` returns numbered UTF-8 lines in bounded pages, with `nextOffset` when more remain. It keeps a small, signature-checked index of line offsets so later pages do not start from the top of the file. File contents are not cached.
289
296
  - `grep` runs structured ripgrep searches with a global result cap and compacts long lines and result sets. It rejects directly named ignored roots unless `includeIgnored` is set.
290
- - `editFile` makes unique text replacements and tolerates accidental line-number prefixes.
291
- - `replaceLines` edits line ranges when exact replacements are awkward and clamps ranges that extend slightly past EOF.
292
- - `writeFile` creates files and parent directories.
293
- - `bash` runs tests, builds, git and gh commands, scripts, installs, and other shell work. It trims output according to the command type while keeping useful failure details. A timeout or abort kills the process tree, escalates if necessary, and returns even when an escaped child keeps stdout or stderr open.
297
+ - `editFile` makes unique text replacements, tolerates accidental line-number prefixes, and returns a structured diff.
298
+ - `replaceLines` edits line ranges when exact replacements are awkward, clamps ranges that extend slightly past EOF, and returns a structured diff.
299
+ - `writeFile` creates, overwrites, or appends files and parent directories, returning a diff for each successful content change.
300
+ - `shell` runs tests, builds, git and gh commands, scripts, installs, and other command-line work in your configured login shell. Set `HAZE_SHELL` to an explicit executable for deterministic CI or service accounts. Its schema identifies the active shell dialect. Output is trimmed according to the command type while preserving useful failure details. A timeout or abort kills the process tree, escalates if necessary, and returns even when an escaped child keeps stdout or stderr open.
294
301
  - `readToolOutput` pages through retained raw output omitted from oversized or reduced results, subject to in-memory budgets.
295
302
  - `fetch` reads public `http(s)` URLs as Markdown, formatted JSON, or text. It rejects non-HTTP schemes, private and loopback addresses, metadata hosts, and malformed IPv6-like hosts. Bounded output remains available through `readToolOutput`.
296
303
  - `writeTasks` replaces the task list at meaningful phase changes. Completed lists clear on the next user turn.
297
304
  - `skill` loads an installed Markdown workflow or one of its references.
298
305
  - `lspWorkspaceSymbols`, `lspSymbols`, `lspDefinition`, and `lspReferences` provide optional read-only navigation through configured language servers. They appear only when an enabled server command is installed.
299
306
 
300
- Tool calls are grouped in the transcript so you can see what happened without reading a novella. A small file edit shows colored additions and removals with one line of context. A large one gets a summary and a pointer to `git diff`. File-tool failures include a reason code and a recovery hint. Large bash, search, and fetch results stay behind an in-memory handle. Later model calls see a compact summary tailored to validation, git, search, diffs, JSON, logs, or the head and tail of the output.
307
+ Tool calls are grouped in the transcript so you can see what happened without reading a novella. Every successful `editFile`, `replaceLines`, and `writeFile` content change shows colored additions and removals with line numbers and context. Large diffs keep an eight-row preview—the first four and last four rows, separated by an omission marker—and expose the complete retained diff through `readToolOutput`; no-op mutations are labeled explicitly. File-tool failures include a reason code and a recovery hint. Large shell, search, and fetch results stay behind an in-memory handle. Later model calls see a compact summary tailored to validation, git, search, diffs, JSON, logs, or the head and tail of the output.
301
308
 
302
309
  ### Optional LSP navigation
303
310
 
@@ -320,7 +327,7 @@ A subagent is a disposable worker with its own context. It is useful for a repos
320
327
 
321
328
  The worker receives a bounded description of its objective, deliverable, mode, and scope. It does not see the main conversation or sibling conversations, and it loads the relevant `AGENTS.md` or `CLAUDE.md` files itself. Only its compact result returns to the parent model. Tool logs, timings, usage, and estimated context savings stay out of that context.
322
329
 
323
- The available modes are `inspect` (read-only), `research` (read-only with public fetch), `implement` (file changes and coordinated bash), and `validate` (reads and coordinated bash). Read-only modes cannot change files. Workers that can make changes are serialized with each other and with changes from the main turn. This coordination is not a shell sandbox.
330
+ The available modes are `inspect` (read-only), `research` (read-only with public fetch), `implement` (file changes and coordinated shell access), and `validate` (reads and coordinated shell access). Read-only modes cannot change files. Workers that can make changes are serialized with each other and with changes from the main turn. This coordination is not a shell sandbox.
324
331
 
325
332
  Tool-call budgets apply to each execution, including calls submitted together. At the deadline, haze returns a terminal result and aborts the worker. If the underlying code ignores the abort, haze quarantines it and keeps its actual concurrency and mutation slot occupied until it settles. Retries stay within the same turn scope. Result handles exist only in the current process and are not durable, so each compact deliverable must stand on its own.
326
333
 
@@ -350,7 +357,9 @@ Keep trivial, conversation-coupled, sequential, user-interactive, or uncertain s
350
357
 
351
358
  ## Context files
352
359
 
353
- haze saves durable workspace sessions in `~/.haze/sessions`. Settings, history, sessions, and debug logs use private POSIX directory/file permissions (`0700`/`0600`) and ordered, flushable writes. Use `/session` to see the current file, `/new` to start fresh, and `/resume` to browse workspace sessions, resume one, or fork its latest snapshot into a new session. `/resume <id>` and `haze --resume <id>` select an exact session. Use `/compact` to condense older model context into a bounded excerpt. Sessions also persist compact structured work state: the active goal, touched files, validation evidence, blockers, and next action.
360
+ haze saves durable workspace sessions in `~/.haze/sessions`. It writes a session after the first resumable message, so empty sessions do not create files or appear under `/resume`. Settings, history, sessions, and debug logs use private POSIX directory/file permissions (`0700`/`0600`) and ordered, flushable writes. Use `/session` to see the current file, `/new` to start fresh, and `/resume` to browse workspace sessions, resume one, or fork its latest snapshot into a new session. `/resume <id>` and `haze --resume <id>` select an exact session. Use `/compact` to condense older model context: by default the active model writes a continuity summary of the older history (set `manualCompaction: "heuristic"` in settings to keep the model-free bounded excerpt instead); automatic mid-turn compaction always uses the heuristic excerpt. Sessions also persist compact structured work state: the active goal, touched files, validation evidence, blockers, and next action.
361
+
362
+ Snapshots are written at turn boundaries, not per tool call. If haze crashes or is killed mid-turn, the session resumes from the last completed turn: work already on disk (file edits, command side effects) is not reflected in the session record, so after a crash verify the working tree (`git status`, `git diff`) before continuing. To keep long sessions from growing quadratically — every turn appends the full history again — session files are automatically compacted once superseded snapshots dominate the file: only the newest conversation and work-state snapshots are kept and the file is rewritten atomically.
354
363
 
355
364
  Session files are optimized for resume and audit, not token-by-token playback: completed user/assistant messages, tool lifecycle events, conversation snapshots, and work-state snapshots are persisted, but streaming `message_update` events are skipped. Large persisted tool outputs are replaced with previews and byte counts so a resumed model can reread current files instead of carrying stale megabytes forward.
356
365
 
@@ -366,16 +375,31 @@ At the same scope, `AGENTS.md` overrides `CLAUDE.md`; global haze guidance in `~
366
375
 
367
376
  Use `AGENTS.md` for project conventions, commands, architecture notes, and anything you do not want to explain again. Because context files are added to every request, `/init` keeps its discovery pass small, preserves useful existing guidance, and asks for a compact file.
368
377
 
378
+ ## Optional settings
379
+
380
+ Most haze behaviour needs no configuration; a few optional keys in `~/.haze/settings.json` tune reliability and context handling. All are validated loudly — malformed values fail with a clear settings error instead of being silently ignored.
381
+
382
+ - `modelRetries` (integer 0–10, default 2): size of the shared bounded retry pool for transient model errors and idle-stream stalls. Raise it for providers that terminate long streams aggressively; `0` disables automatic retries (a stalled stream pauses with the goal preserved for a one-key resume). The effective value is reported in `timeout` and `retry` stream events as `maxRetries`.
383
+ - `contextWindowFallbackTokens` / `localContextWindowFallbackTokens` (default 128K hosted / 32K local): context-window guess for models without limits metadata. Every turn emits a `context_budget` event naming the window and its source, and the interactive warning fires once per model per session when the built-in default was used.
384
+ - `manualCompaction` (`"llm-summary"` default, or `"heuristic"`): whether manual `/compact` asks the active model for a continuity summary or keeps the model-free bounded excerpt.
385
+
369
386
  ## Safety model
370
387
 
388
+ haze is designed for attended use by an experienced developer on a single-user machine. It trusts the user and their global `~/.haze` configuration. Repository contents, project skills and instructions, fetched pages, MCP and LSP output, and model output are untrusted. A local attacker who already has access as the same operating-system user is outside this threat model.
389
+
390
+ Ordinary file and tool output is data, not instructions. The system prompt says that fetched content, MCP/LSP output, and files outside the workspace cannot override its rules. Project context files and project skills are the exceptions: haze loads them as designated instruction sources, labels them as repository-provided content, and keeps them below system and user instructions in priority. Prompt injection cannot be eliminated by labeling alone, so user supervision remains part of the security boundary.
391
+
392
+ Shell classification is informational. haze does not ask for confirmation before running commands, including commands that can mutate or delete data. This is an intentional trade-off for attended expert use, not a sandbox or permission boundary.
393
+
371
394
  - Model-selected file tools are restricted to the current workspace and follow `.gitignore` by default.
372
395
  - A path explicitly typed by the user with `@path` or as a slash-containing bare path may grant read-only access for that turn, including outside the workspace. It never grants mutation access.
373
- - Ignored workspace files require an explicit override unless covered by that user-granted read exception.
374
- - Bash commands are classified and shown with working-directory metadata, but haze does not use command confirmation gates.
396
+ - Ignored workspace files require an explicit override unless covered by that user-granted read exception. If Git cannot run at all, mutation tools refuse with `ignore_check_unavailable` (the safe direction for writes) — reads still proceed.
375
397
  - The `fetch` tool only reads public `http(s)` URLs. It rejects other schemes along with private, loopback, link-local, cloud-metadata, and malformed IPv6-like hosts. On every redirect, haze connects to the public IP it already validated, which closes the DNS-rebinding gap.
376
- - Mutating and destructive commands can run when they are relevant to the user's request; this is intentional for expert users.
377
- - Project skills under `.haze/skills` are repository-provided, untrusted instructions. haze announces them, labels their provenance, confines their real paths to the workspace, and frames their content so it cannot override higher-priority safeguards. Review project skills before using an unfamiliar repository.
378
- - haze can make substantial changes, and it still needs supervision.
398
+ - Project skills under `.haze/skills` are real-path-confined to the workspace and visibly labeled as untrusted repository content. Review them before using an unfamiliar repository.
399
+
400
+ With `--debug`, haze writes full request and message payloads to `~/.haze/logs/`. The files use private `0600` permissions on POSIX, but they can contain secrets and file contents. Do not share debug logs without reviewing and redacting them.
401
+
402
+ See [SECURITY.md](SECURITY.md) for supported versions and private vulnerability reporting.
379
403
 
380
404
  ## Local development
381
405
 
@@ -391,6 +415,28 @@ npm run context:report
391
415
 
392
416
  `npm run context:report` prints estimated system, project-context, and tool-schema tokens without reading `~/.haze`. Pass explicit context-file paths, or use `npm run context:report -- --trace tests/fixtures/agent-traces/long-workflow.json` for offline trace accounting.
393
417
 
418
+ ### Running the checkout instead of a global install
419
+
420
+ A globally installed haze keeps serving its own code even while you work in a checkout — the exact failure mode where a fix lands locally but sessions keep running the old runtime. Two supported ways to run the checkout:
421
+
422
+ ```bash
423
+ npm run haze -- <arguments> # run the source checkout directly, no global install touched
424
+ npm run dev:link # build, link globally, and verify `haze` on PATH resolves to this checkout
425
+ ```
426
+
427
+ `npm run dev:link` builds the checkout, runs `npm link`, resolves `command -v haze`, and fails loudly unless the linked binary reports this checkout's version and commit. Restart any running haze process afterward — a live process never hot-swaps its code.
428
+
429
+ ### Runtime provenance and diagnostics
430
+
431
+ Every build embeds a manifest (`dist/buildInfo.json`: version, commit, build time). The launcher verifies it before starting and refuses incomplete or stale builds with a rebuild hint instead of running partially outdated code.
432
+
433
+ ```bash
434
+ haze --version --verbose # version, commit, runtime/executable paths, goal-supervisor state
435
+ haze doctor # provenance, artifact/manifest checks, capability registry, checkout-mismatch warning
436
+ ```
437
+
438
+ Session headers record the executing build (version + commit + build time), so a saved failure can be tied to the code that actually ran. When haze starts inside or below a checkout whose version/commit diverges from the running binary, it prints a startup warning naming both — it never switches runtimes silently.
439
+
394
440
  Package check:
395
441
 
396
442
  ```bash
@@ -401,15 +447,19 @@ The npm package ships `bin`, `dist`, README, license, changelog, and examples.
401
447
 
402
448
  ## Release
403
449
 
450
+ The documentation site is committed as static HTML under `docs/`; there is no in-repository generator. Before a release, update the version stamps in every `docs/*.html` page and manually reconcile `index.html`, `quickstart.html`, `commands.html`, and `tools.html` with the README and changelog.
451
+
404
452
  ```bash
453
+ npm ci
405
454
  npm run typecheck
406
455
  npm test
407
456
  npm run lint
408
457
  npm run build
458
+ npm audit
409
459
  npm pack --dry-run
410
460
  git tag vX.Y.Z
411
461
  git push origin main --tags
412
- npm publish --access public
462
+ npm publish --access public --provenance
413
463
  ```
414
464
 
415
465
  ## License
package/SECURITY.md ADDED
@@ -0,0 +1,22 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ | Version | Supported |
6
+ |---------|-----------|
7
+ | Latest minor (`1.0.x`) | Yes — security fixes |
8
+ | Older minors and pre-1.0 (`0.x`) | No — upgrade required |
9
+
10
+ Security fixes are provided for the latest published minor release. Upgrade to the newest release before reporting an issue that may already have been fixed.
11
+
12
+ ## Reporting a vulnerability
13
+
14
+ Use GitHub's private vulnerability reporting for this repository. Do not open a public issue for a suspected vulnerability and do not include credentials, private source code, or unredacted haze debug logs in a public report.
15
+
16
+ Include the affected version, operating system, reproduction steps, impact, and any suggested mitigation. Reports are handled on a best-effort basis by the project maintainer. There is no guaranteed response or remediation SLA.
17
+
18
+ ## Threat model
19
+
20
+ haze is intended for attended use by an experienced developer on a single-user machine. It trusts the user and their global `~/.haze` configuration. Repository contents, project instructions and skills, fetched web content, MCP and LSP servers, and model output are untrusted inputs. A local attacker who already has access as the same operating-system user is outside the supported threat model.
21
+
22
+ haze does not use command confirmation gates. Shell classification is informational, and relevant commands may mutate or delete data. Workspace confinement, bounded input and output, URL validation, private local storage, prompt-injection framing, and user supervision reduce risk, but haze is not a sandbox.
package/bin/haze.js CHANGED
@@ -1,2 +1,103 @@
1
1
  #!/usr/bin/env node
2
- import '../dist/cli/index.js';
2
+ // Verifying launcher for the compiled haze CLI.
3
+ //
4
+ // Before importing dist/, this shim proves the build is complete and current:
5
+ // 1. required compiled modules exist (index, goal supervisor, build manifest);
6
+ // 2. dist/buildInfo.json version matches package.json;
7
+ // 3. when the package root is a git checkout, the build commit matches HEAD.
8
+ // A stale or partial build fails with an actionable message instead of running
9
+ // partially outdated code. `--version` (optionally `--verbose`) is answered
10
+ // here directly so provenance works even while dist is being repaired.
11
+ //
12
+ // Deliberately dependency-free: only Node builtins, synchronous checks before
13
+ // any dynamic import, mirroring src/utils/buildInfo.ts (which serves doctor
14
+ // and the interactive UI with the same facts).
15
+ import {existsSync, readFileSync, realpathSync, statSync} from 'node:fs';
16
+ import path from 'node:path';
17
+ import {fileURLToPath} from 'node:url';
18
+
19
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
20
+ const REQUIRED_ARTIFACTS = [
21
+ 'dist/cli/index.js',
22
+ 'dist/cli/commands/streaming/goalSupervisor.js',
23
+ 'dist/buildInfo.json',
24
+ ];
25
+
26
+ function readJson(file) {
27
+ return JSON.parse(readFileSync(path.join(root, file), 'utf8'));
28
+ }
29
+
30
+ function readGitHead() {
31
+ const sha = (value) => (/^[0-9a-f]{7,40}$/i.test((value ?? '').trim()) ? value.trim() : undefined);
32
+ try {
33
+ const dotGit = path.join(root, '.git');
34
+ const stat = statSync(dotGit);
35
+ const gitDir = stat.isDirectory() ? dotGit : /gitdir:\s*(\S+)/.exec(readFileSync(dotGit, 'utf8'))?.[1];
36
+ if (!gitDir) return undefined;
37
+ const head = readFileSync(path.join(gitDir, 'HEAD'), 'utf8').trim();
38
+ if (!head.startsWith('ref:')) return sha(head);
39
+ const ref = head.slice(4).trim();
40
+ const refPath = path.join(gitDir, ref);
41
+ if (existsSync(refPath)) return sha(readFileSync(refPath, 'utf8'));
42
+ const packed = readFileSync(path.join(gitDir, 'packed-refs'), 'utf8');
43
+ const escaped = ref.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
44
+ return sha(new RegExp(`^([0-9a-f]{40}) ${escaped}$`, 'm').exec(packed)?.[1]);
45
+ } catch {
46
+ return undefined;
47
+ }
48
+ }
49
+
50
+ const problems = [];
51
+ let pkg;
52
+ let build;
53
+ try {
54
+ pkg = readJson('package.json');
55
+ } catch {
56
+ pkg = undefined;
57
+ problems.push('package.json is missing or unreadable at the installation root.');
58
+ }
59
+ try {
60
+ build = readJson('dist/buildInfo.json');
61
+ } catch {
62
+ build = undefined;
63
+ }
64
+ for (const artifact of REQUIRED_ARTIFACTS) {
65
+ if (!existsSync(path.join(root, artifact))) {
66
+ problems.push(`${artifact} is missing — the compiled build is incomplete.`);
67
+ }
68
+ }
69
+ if (pkg?.version && build?.version && build.version !== pkg.version) {
70
+ problems.push(`dist/buildInfo.json says ${build.version}, but package.json is ${pkg.version} — the build output is stale.`);
71
+ }
72
+ const headCommit = readGitHead();
73
+ if (headCommit && build?.commit && build.commit !== headCommit) {
74
+ problems.push(`dist was built from commit ${String(build.commit).slice(0, 7)}, but the checkout is at ${headCommit.slice(0, 7)} — the build output is stale.`);
75
+ }
76
+
77
+ if (problems.length > 0) {
78
+ process.stderr.write('haze: refusing to start an incomplete or stale build.\n');
79
+ for (const problem of problems) process.stderr.write(` - ${problem}\n`);
80
+ process.stderr.write('Repair it with `npm run build` inside the haze checkout, then reinstall or `npm link`.\n');
81
+ process.exit(1);
82
+ }
83
+
84
+ const argv = process.argv.slice(2);
85
+ if (argv.includes('--version') || argv.includes('-V')) {
86
+ const version = pkg?.version ?? build?.version ?? '0.0.0';
87
+ if (argv.includes('--verbose')) {
88
+ const lines = [
89
+ `Haze ${version}`,
90
+ `commit: ${build?.commit ?? 'unknown'}`,
91
+ ...(build?.builtAt ? [`builtAt: ${build.builtAt}`] : []),
92
+ `runtime: ${path.join(root, 'dist')}`,
93
+ `executable: ${realpathSync(process.argv[1])}`,
94
+ `goal supervisor: ${existsSync(path.join(root, 'dist/cli/commands/streaming/goalSupervisor.js')) ? 'enabled' : 'disabled'}`,
95
+ ];
96
+ process.stdout.write(`${lines.join('\n')}\n`);
97
+ } else {
98
+ process.stdout.write(`${version}\n`);
99
+ }
100
+ process.exit(0);
101
+ }
102
+
103
+ import('../dist/cli/index.js');
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@denizokcu/haze",
3
+ "version": "1.0.0",
4
+ "commit": "85e798e5d4b65f08889f2f780c3f9b0f2fe6ac07",
5
+ "builtAt": "2026-08-16T22:39:49.522Z",
6
+ "sourceRoot": "/Users/deniz.okcu/development/haze"
7
+ }
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { Task } from '../../core/tasks/taskStorage.js';
3
3
  export declare const MAX_VISIBLE_TASKS = 5;
4
- export declare function TaskBar({ tasks, width, expanded, padding }: {
4
+ export declare function TaskBar({ tasks, width, expanded, padding, maxRows }: {
5
5
  tasks: Task[];
6
6
  width: number;
7
7
  expanded: boolean;
8
8
  padding: number;
9
+ maxRows?: number;
9
10
  }): React.JSX.Element;
@@ -14,12 +14,15 @@ function taskStatusColor(status) {
14
14
  }
15
15
  }
16
16
  export const MAX_VISIBLE_TASKS = 5;
17
- export function TaskBar({ tasks, width, expanded, padding }) {
17
+ export function TaskBar({ tasks, width, expanded, padding, maxRows }) {
18
18
  const maxTitleWidth = Math.max(10, width - 6);
19
19
  const inProgress = tasks.filter(t => t.status === 'in_progress');
20
20
  const pending = tasks.filter(t => t.status === 'pending');
21
21
  const completed = tasks.filter(t => t.status === 'completed');
22
- const limit = expanded ? tasks.length : MAX_VISIBLE_TASKS;
22
+ // Live-region budget (see chat/liveRegion.ts): expanded mode is capped too,
23
+ // otherwise a long task list alone can push the dynamic frame past one
24
+ // viewport and trigger Ink's scrollback-wiping overflow fallback.
25
+ const limit = expanded ? Math.min(tasks.length, maxRows ?? tasks.length) : MAX_VISIBLE_TASKS;
23
26
  const ordered = [];
24
27
  for (const t of inProgress) {
25
28
  if (ordered.length < limit)
@@ -35,6 +38,6 @@ export function TaskBar({ tasks, width, expanded, padding }) {
35
38
  const counts = `${inProgress.length > 0 ? `${inProgress.length} active` : ''}${pending.length > 0 ? `${inProgress.length > 0 ? ', ' : ''}${pending.length} pending` : ''}${completed.length > 0 ? `${inProgress.length + pending.length > 0 ? ', ' : ''}${completed.length} done` : ''}`;
36
39
  return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [padding > 0 && Array.from({ length: padding }, (_, i) => _jsx(Text, { children: ' ' }, `pad-${i}`)), _jsxs(Text, { children: [_jsx(Text, { color: theme.purple, bold: true, children: "Tasks" }), counts ? _jsxs(Text, { color: theme.muted, children: [" (", counts, ")"] }) : null, tasks.length > MAX_VISIBLE_TASKS ? _jsxs(Text, { color: theme.muted, dimColor: true, children: [" \u00B7 ctrl+o ", expanded ? 'collapse' : 'expand'] }) : null] }), ordered.map(task => {
37
40
  const title = task.title.length > maxTitleWidth ? task.title.slice(0, maxTitleWidth - 1) + '\u2026' : task.title;
38
- return (_jsxs(Text, { wrap: "truncate-end", children: [_jsxs(Text, { color: taskStatusColor(task.status), children: [TASK_STATUS_ICON[task.status], " "] }), _jsx(Text, { color: task.status === 'completed' ? theme.muted : 'white', children: title })] }, task.id));
39
- })] }));
41
+ return (_jsxs(Text, { wrap: "truncate-end", children: [_jsxs(Text, { color: taskStatusColor(task.status), children: [TASK_STATUS_ICON[task.status], " "] }), _jsx(Text, { color: task.status === 'completed' ? theme.muted : theme.foreground, children: title })] }, task.id));
42
+ }), expanded && ordered.length < tasks.length ? _jsxs(Text, { color: theme.muted, children: [" +", tasks.length - ordered.length, " more (ctrl+o)"] }) : null] }));
40
43
  }
@@ -1,7 +1,7 @@
1
1
  import type { ModelMessage } from 'ai';
2
- import type { Message, TokenUsage } from '../commands/streaming.js';
2
+ import type { Message } from '../commands/streaming.js';
3
+ import type { TokenUsage } from '../commands/streaming/turnRuntime.js';
3
4
  export declare function toolCallCount(messages: Message[]): number;
4
- export declare function estimateTokens(text: string): number;
5
5
  export declare function compactHomePath(filePath: string, home?: string): string;
6
6
  export declare function formatTokenCount(tokens: number): string;
7
7
  export declare function displayMessagesFromConversation(conversation: ModelMessage[]): Message[];
@@ -11,7 +11,7 @@ export function toolCallCount(messages) {
11
11
  return total + message.text.split('\n').filter(line => /^\s+[✓✗…]\s/.test(line)).length;
12
12
  }, 0);
13
13
  }
14
- export function estimateTokens(text) {
14
+ function estimateTokens(text) {
15
15
  return Math.ceil(text.length / 4);
16
16
  }
17
17
  export function compactHomePath(filePath, home = os.homedir()) {
@@ -40,5 +40,7 @@ export async function buildContextReport(input) {
40
40
  finally {
41
41
  if (assembled.loadedMcp?.clients.length)
42
42
  await closeMcpClients(assembled.loadedMcp.clients);
43
+ if (assembled.lspPool)
44
+ await assembled.lspPool.close();
43
45
  }
44
46
  }