@denizokcu/haze 0.8.0 → 0.10.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 (182) hide show
  1. package/CHANGELOG.md +67 -17
  2. package/README.md +121 -64
  3. package/dist/cli/chat/chatMetrics.d.ts +17 -1
  4. package/dist/cli/chat/chatMetrics.js +22 -5
  5. package/dist/cli/chat/contextReport.d.ts +11 -0
  6. package/dist/cli/chat/contextReport.js +44 -0
  7. package/dist/cli/chat/fileMentionSuggestions.d.ts +29 -0
  8. package/dist/cli/chat/fileMentionSuggestions.js +91 -0
  9. package/dist/cli/chat/inputSuggestions.d.ts +5 -0
  10. package/dist/cli/chat/inputSuggestions.js +17 -3
  11. package/dist/cli/chat/sessionLifecycle.d.ts +58 -0
  12. package/dist/cli/chat/sessionLifecycle.js +155 -0
  13. package/dist/cli/chat/sessionRecorder.d.ts +3 -0
  14. package/dist/cli/chat/sessionRecorder.js +21 -8
  15. package/dist/cli/chat/startupInfo.d.ts +1 -0
  16. package/dist/cli/chat/startupInfo.js +11 -0
  17. package/dist/cli/chat/tips.d.ts +21 -0
  18. package/dist/cli/chat/tips.js +43 -0
  19. package/dist/cli/chat/wizardDispatch.d.ts +64 -0
  20. package/dist/cli/chat/wizardDispatch.js +645 -0
  21. package/dist/cli/commands/chat.d.ts +1 -0
  22. package/dist/cli/commands/chat.js +246 -779
  23. package/dist/cli/commands/chatModes.d.ts +1 -1
  24. package/dist/cli/commands/chatModes.js +7 -2
  25. package/dist/cli/commands/commandHelp.js +5 -3
  26. package/dist/cli/commands/commands.d.ts +4 -3
  27. package/dist/cli/commands/commands.js +12 -13
  28. package/dist/cli/commands/fleetCommand.d.ts +14 -0
  29. package/dist/cli/commands/fleetCommand.js +46 -0
  30. package/dist/cli/commands/formatters.d.ts +5 -0
  31. package/dist/cli/commands/formatters.js +36 -9
  32. package/dist/cli/commands/logsCommand.js +8 -28
  33. package/dist/cli/commands/mcpWizard.js +24 -2
  34. package/dist/cli/commands/modelCommand.js +1 -1
  35. package/dist/cli/commands/providerWizard.d.ts +1 -0
  36. package/dist/cli/commands/providerWizard.js +31 -5
  37. package/dist/cli/commands/runCommand.d.ts +1 -0
  38. package/dist/cli/commands/runCommand.js +32 -20
  39. package/dist/cli/commands/sessionPicker.d.ts +9 -0
  40. package/dist/cli/commands/sessionPicker.js +29 -0
  41. package/dist/cli/commands/settingsSummary.js +8 -4
  42. package/dist/cli/commands/skillConfirmRemove.js +4 -3
  43. package/dist/cli/commands/skillWizard.d.ts +2 -0
  44. package/dist/cli/commands/skillWizard.js +16 -6
  45. package/dist/cli/commands/streaming/idleTimer.d.ts +26 -0
  46. package/dist/cli/commands/streaming/idleTimer.js +24 -0
  47. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +2 -0
  48. package/dist/cli/commands/streaming/toolGroupRenderer.js +4 -2
  49. package/dist/cli/commands/streaming/turnOutcome.d.ts +10 -0
  50. package/dist/cli/commands/streaming/turnOutcome.js +13 -0
  51. package/dist/cli/commands/streaming/turnRuntime.js +6 -4
  52. package/dist/cli/commands/streaming.d.ts +13 -1
  53. package/dist/cli/commands/streaming.js +104 -44
  54. package/dist/cli/commands/wizardActions.d.ts +6 -0
  55. package/dist/cli/commands/wizardActions.js +6 -0
  56. package/dist/cli/commands/wizardPrompts.js +1 -1
  57. package/dist/cli/commands/wizardSuggestions.d.ts +8 -0
  58. package/dist/cli/commands/wizardSuggestions.js +62 -13
  59. package/dist/cli/commands/wizardTransition.d.ts +37 -0
  60. package/dist/cli/commands/wizardTransition.js +43 -0
  61. package/dist/cli/index.js +17 -3
  62. package/dist/cli/terminalTitle.d.ts +6 -0
  63. package/dist/cli/terminalTitle.js +36 -0
  64. package/dist/config/contextFiles.js +6 -3
  65. package/dist/config/endpointSecurity.d.ts +2 -0
  66. package/dist/config/endpointSecurity.js +28 -0
  67. package/dist/config/inputHistory.d.ts +3 -3
  68. package/dist/config/inputHistory.js +13 -17
  69. package/dist/config/modelDiscovery.d.ts +20 -0
  70. package/dist/config/modelDiscovery.js +51 -0
  71. package/dist/config/privateStorage.d.ts +6 -0
  72. package/dist/config/privateStorage.js +61 -0
  73. package/dist/config/providerPresets.d.ts +16 -4
  74. package/dist/config/providerPresets.js +263 -34
  75. package/dist/config/providers.d.ts +2 -0
  76. package/dist/config/providers.js +7 -0
  77. package/dist/config/settings.d.ts +22 -0
  78. package/dist/config/settings.js +33 -5
  79. package/dist/config/skillSettings.d.ts +6 -13
  80. package/dist/config/skillSettings.js +20 -19
  81. package/dist/config/updateCheck.js +4 -2
  82. package/dist/core/agent/budgets.d.ts +26 -0
  83. package/dist/core/agent/budgets.js +34 -0
  84. package/dist/core/agent/compaction.js +17 -3
  85. package/dist/core/agent/contextBudget.d.ts +8 -0
  86. package/dist/core/agent/contextBudget.js +29 -0
  87. package/dist/core/agent/errors.js +6 -2
  88. package/dist/core/agent/events.d.ts +12 -0
  89. package/dist/core/agent/toolOutputStore.d.ts +8 -0
  90. package/dist/core/agent/toolOutputStore.js +49 -11
  91. package/dist/core/agent/workState.d.ts +1 -1
  92. package/dist/core/agent/workState.js +0 -4
  93. package/dist/core/attachments/imageAttachments.d.ts +90 -0
  94. package/dist/core/attachments/imageAttachments.js +245 -0
  95. package/dist/core/attachments/readBlessings.d.ts +37 -0
  96. package/dist/core/attachments/readBlessings.js +79 -0
  97. package/dist/core/goal/completionPolicy.d.ts +0 -28
  98. package/dist/core/goal/completionPolicy.js +0 -88
  99. package/dist/core/goal/requestClassifier.d.ts +0 -3
  100. package/dist/core/goal/requestClassifier.js +0 -13
  101. package/dist/core/io/boundedRead.d.ts +15 -0
  102. package/dist/core/io/boundedRead.js +144 -0
  103. package/dist/core/limits/byteBudgets.d.ts +18 -0
  104. package/dist/core/limits/byteBudgets.js +18 -0
  105. package/dist/core/limits/textBudgets.d.ts +23 -0
  106. package/dist/core/limits/textBudgets.js +23 -0
  107. package/dist/core/log/llmLog.d.ts +10 -0
  108. package/dist/core/log/llmLog.js +59 -13
  109. package/dist/core/persistence/orderedFileWriter.d.ts +11 -0
  110. package/dist/core/persistence/orderedFileWriter.js +29 -0
  111. package/dist/core/process/backgroundRegistry.d.ts +35 -0
  112. package/dist/core/process/backgroundRegistry.js +194 -0
  113. package/dist/core/process/runBoundedProcess.d.ts +30 -0
  114. package/dist/core/process/runBoundedProcess.js +116 -0
  115. package/dist/core/safety/urlGuard.d.ts +2 -1
  116. package/dist/core/safety/urlGuard.js +3 -2
  117. package/dist/core/session/sessionSlimming.js +47 -4
  118. package/dist/core/session/sessionStore.d.ts +37 -0
  119. package/dist/core/session/sessionStore.js +136 -27
  120. package/dist/core/subagent/contracts.d.ts +116 -0
  121. package/dist/core/subagent/contracts.js +54 -0
  122. package/dist/core/subagent/executionProfiles.d.ts +28 -0
  123. package/dist/core/subagent/executionProfiles.js +45 -0
  124. package/dist/core/subagent/subagentCoordinator.d.ts +74 -0
  125. package/dist/core/subagent/subagentCoordinator.js +134 -0
  126. package/dist/core/subagent/subagentRunner.d.ts +211 -145
  127. package/dist/core/subagent/subagentRunner.js +228 -98
  128. package/dist/core/subagent/workspaceMutationPolicy.d.ts +11 -0
  129. package/dist/core/subagent/workspaceMutationPolicy.js +52 -0
  130. package/dist/core/tasks/taskStorage.js +12 -1
  131. package/dist/llm/client.d.ts +20 -29
  132. package/dist/llm/client.js +33 -29
  133. package/dist/llm/hazeTools.d.ts +2396 -67
  134. package/dist/llm/hazeTools.js +50 -37
  135. package/dist/llm/lsp.d.ts +23 -3
  136. package/dist/llm/lsp.js +73 -16
  137. package/dist/llm/lspTools.d.ts +96 -48
  138. package/dist/llm/mcp.d.ts +1 -1
  139. package/dist/llm/mcp.js +65 -16
  140. package/dist/llm/requestContext.d.ts +23 -1
  141. package/dist/llm/requestContext.js +50 -7
  142. package/dist/llm/systemPrompt.d.ts +4 -1
  143. package/dist/llm/systemPrompt.js +14 -4
  144. package/dist/llm/toolResultTypes.d.ts +1 -1
  145. package/dist/llm/tools/bashTool.d.ts +1210 -16
  146. package/dist/llm/tools/bashTool.js +43 -60
  147. package/dist/llm/tools/fetchTool.d.ts +26 -26
  148. package/dist/llm/tools/fetchTool.js +1 -1
  149. package/dist/llm/tools/fileToolShared.d.ts +2 -1
  150. package/dist/llm/tools/fileToolShared.js +5 -5
  151. package/dist/llm/tools/grepRunner.d.ts +20 -0
  152. package/dist/llm/tools/grepRunner.js +66 -0
  153. package/dist/llm/tools/outputCap.d.ts +2 -6
  154. package/dist/llm/tools/outputCap.js +2 -6
  155. package/dist/llm/tools/processTool.d.ts +1077 -0
  156. package/dist/llm/tools/processTool.js +41 -0
  157. package/dist/llm/tools/toolContext.d.ts +8 -0
  158. package/dist/llm/tools/toolContext.js +22 -11
  159. package/dist/llm/tools/workspaceFile.d.ts +9 -1
  160. package/dist/llm/tools/workspaceFile.js +33 -4
  161. package/dist/llm/webFetch.js +24 -11
  162. package/dist/llm/workerContext.d.ts +18 -0
  163. package/dist/llm/workerContext.js +55 -0
  164. package/dist/skills/SkillLoader.d.ts +2 -2
  165. package/dist/skills/SkillLoader.js +17 -5
  166. package/dist/skills/SkillRegistry.d.ts +3 -2
  167. package/dist/skills/SkillRegistry.js +53 -10
  168. package/dist/skills/builder/SkillBuilder.d.ts +3 -0
  169. package/dist/skills/builder/SkillBuilder.js +23 -5
  170. package/dist/skills/skillTools.js +11 -4
  171. package/dist/skills/types.d.ts +11 -1
  172. package/dist/ui/components/TextInput.d.ts +5 -2
  173. package/dist/ui/components/TextInput.js +76 -8
  174. package/dist/utils/format.d.ts +2 -0
  175. package/dist/utils/format.js +8 -0
  176. package/dist/utils/fs.d.ts +0 -1
  177. package/dist/utils/fs.js +0 -4
  178. package/dist/utils/openPath.d.ts +2 -0
  179. package/dist/utils/openPath.js +9 -0
  180. package/dist/utils/path.d.ts +2 -0
  181. package/dist/utils/path.js +9 -4
  182. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,15 +2,65 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.10.0 - 2026-08-03
6
+
7
+ ### Added
8
+
9
+ - Added image input for png/jpeg/gif/webp files mentioned with `@path` or a slash-containing bare path. Providers must be explicitly marked image-capable; each message is limited to four images and 5 MB per image, and resumed sessions store placeholders instead of bytes.
10
+ - Added turn-scoped read blessings for user-typed file and directory paths, including host paths outside the workspace. `@` autocomplete browses gitignore-aware workspace paths. Mutating tools never honor the read exception.
11
+ - Added context-isolated subagents with explicit modes, profiles, models, deadlines, concurrency, tool budgets, cancellation quarantine, and shared mutation coordination. `/fleet` exposes parallel-only decomposition with temporary `--review`, `--profile`, `--workers`, and `--concurrency` options.
12
+ - Added managed background processes for up to five dev servers or watchers. Rolling output stays byte-bounded and retrievable by handle; the `process` tool lists, reads, and kills registrations, and haze tears down all process trees on session reset or exit.
13
+ - Added a workspace session browser to `/resume`, including resume-in-place and fork-from-snapshot actions. Session headers record fork provenance.
14
+ - Added live model discovery from OpenAI-compatible `/models` endpoints to `/model` and provider setup, with curated models pinned when served and manual entry retained as fallback. Expanded the provider preset catalog.
15
+ - Added project-local Markdown skills under `.haze/skills`. Project skills are labeled as untrusted repository content, override same-named global skills, remain real-path-confined, and can be managed independently by scope.
16
+ - Added rotating busy-state tips, toggled with `/tips`, cursor-aware `@` completion, and a TTY-only `haze - <cwd>` terminal title.
17
+ - Added the spec-kit workspace and project constitution.
18
+
19
+ ### Changed
20
+
21
+ - Bash tool results carry byte statistics instead of duplicating retained stream text into model context; raw retrieval by handle is unchanged.
22
+ - `/compact` now builds a bounded recent-first excerpt and reports omitted entries rather than embedding unbounded collapsed text.
23
+ - `readToolOutput` eviction is true LRU: reading an entry refreshes its recency.
24
+ - Session IDs include a random suffix to avoid same-millisecond collisions. Session restore reads conversation and work state in one scan.
25
+ - Headless `--debug` progress uses stderr; the undocumented `HAZE_DEBUG` environment variable was removed.
26
+ - Branch display refreshes every 15 seconds and after each turn. Chat session and wizard orchestration were split into focused helpers without changing public flows.
27
+
28
+ ### Security
29
+
30
+ - Project skills and their references remain real-path-confined to the workspace and are framed as untrusted repository content before entering model context.
31
+ - User-typed host paths grant read access only for the current turn. Mutating tools never honor the blessing set.
32
+ - Grep now shares bash's bounded process-group teardown, including `SIGTERM` to `SIGKILL` escalation and a close fallback for retained output pipes.
33
+ - Managed background processes keep byte-bounded rolling output and are terminated as process trees on session reset or haze exit.
34
+
35
+ ### Fixed
36
+
37
+ - Subagent synthesis retains the task and gathered tool results, and long active worker waves no longer trip the idle timer. Flat required tool input avoids empty union-schema calls from local providers.
38
+ - Bash results no longer duplicate retained stream text into model context. Raw output remains available by handle.
39
+ - `/clear` prints once. Malformed `.haze/tasks.json` loads as an empty list. Retry classification matches status codes as whole words.
40
+ - `readFile` outline paging no longer skips entries after output truncation. Session files slim large mutation inputs to path and byte counts.
41
+ - Fetch derives its user agent from `package.json`, and session restore reads conversation and work state in one pass.
42
+
43
+ ## 0.9.0 - 2026-07-10
44
+
45
+ ### Security
46
+
47
+ - Private haze state now uses `0700` directories and `0600` files on POSIX. Bash/process output, raw-output handles, file reads, edits, LSP documents/frames, grep, and JSONL readers enforce collection-time byte limits; bash timeout/abort terminates process trees.
48
+ - Grep rejects explicitly ignored roots unless requested, skills and LSP enforce real workspace/root boundaries, MCP discovery and cleanup are bounded and abort-aware, and credentials are rejected on remote plaintext HTTP endpoints.
49
+
50
+ ### Fixed
51
+
52
+ - Turn/tool status is authoritative across UI, events, logs, sessions, and headless output; retries expose one turn lifecycle and structured `{ok:false}` results remain failures.
53
+ - Session/debug persistence is ordered and flushable, invalid skills are isolated, malformed settings remain visible, active provider/model removal clears selection, and stdio MCP setup no longer asks for HTTP headers.
54
+
5
55
  ## 0.8.0 - 2026-07-09
6
56
 
7
57
  ### Changed
8
58
 
9
- - **Migrated the agent runtime to AI SDK v7.** The main `ToolLoopAgent` turn and subagent runner now use AI SDK v7 APIs while preserving haze's compact terminal rendering, turn-scoped tool state, loop guardrails, and scoped-context injection behavior.
10
- - **Improved live busy feedback.** The interactive busy line now shows the active model name, a one-second elapsed-time heartbeat, and current tool activity labels such as reading, editing, searching, running commands, loading skills, querying LSP, or running MCP tools. Long model/tool gaps now visibly progress instead of looking frozen.
11
- - **Bounded bash output processing.** Bash reducer paths now bound large output processing more aggressively before output enters the transcript/model context, keeping validation/search/log-heavy commands safer for long-running agent work.
12
- - **Hardened core agent maintenance paths.** Tool context wiring, maintenance prompts, and related agent guidance were tightened for AI SDK v7 and current haze runtime behavior.
13
- - **Standardized lowercase `haze` naming.** README, docs, prompts, skills, command help, tests, and agent guidance now consistently use lowercase `haze` for the product name.
59
+ - Migrated the main `ToolLoopAgent` turn and subagent runner to AI SDK v7 while preserving compact terminal output, turn-scoped tool state, loop guardrails, and scoped context injection.
60
+ - Added the active model, a one-second elapsed timer, and current tool activity to the busy line. Activity labels cover reading, editing, searching, commands, skills, LSP, and MCP tools. Long waits during model and tool calls now show visible progress.
61
+ - Applied stricter bounds to large bash output before it enters the transcript or model context, especially for validation, search, and log-heavy commands.
62
+ - Updated tool context wiring, maintenance prompts, and agent guidance for AI SDK v7 and the current runtime.
63
+ - Standardized the lowercase `haze` name across the README, docs, prompts, skills, command help, tests, and agent guidance.
14
64
 
15
65
  ### Fixed
16
66
 
@@ -22,24 +72,24 @@
22
72
 
23
73
  ### Added
24
74
 
25
- - **`--output stream-json` for print mode.** `haze -p "…" --output stream-json` streams the run as newline-delimited JSON: public progress events (`turn_start`, `message_start`/`message_update`/`message_end`, `tool_start`/`tool_end`, `retry`, `context_overflow`, `turn_end`, each with an ISO-8601 `at` timestamp) are written to stdout as they happen, and the final line is the same `{type,status,result,usage}` envelope as `--output json`. Tool events omit raw inputs/outputs so captured stdout stays suitable for harness and CI logs. Previously print mode stayed silent until the end and emitted only that single envelope, so harnesses driving haze headlessly had no live progress and could not run stdout-based stagnation/loop detection on a silent-but-alive run. Every line is standalone valid JSON (pipeable through `jq -c .`). `text` and `json` outputs are unchanged.
26
- - **Startup context visibility.** The interactive startup message now lists the context files sent with the system prompt, making it easier to verify whether global `CLAUDE.md`/`AGENTS.md` and workspace instructions were loaded.
75
+ - Added `--output stream-json` to print mode. `haze -p "…" --output stream-json` writes public progress events to stdout as newline-delimited JSON, followed by the same `{type,status,result,usage}` envelope as `--output json`. Each event has an ISO-8601 `at` timestamp. Tool events omit raw inputs and outputs so CI and harness logs do not capture them. Before this option, print mode stayed silent until it returned the final envelope; harnesses could not show live progress or detect stagnant and looping runs from stdout. Every line is valid JSON and can be piped through `jq -c .`. The `text` and `json` formats are unchanged.
76
+ - The startup message now lists the context files sent with the system prompt. This makes it possible to check whether haze loaded global `CLAUDE.md` or `AGENTS.md` files and workspace instructions.
27
77
 
28
78
  ### Changed
29
79
 
30
- - **CLI print mode.** `haze -p "prompt"` runs a single non-interactive turn and prints the result, with optional `--model provider:name` override (per-run, no settings write) and `--output json` structured output. Reads the prompt from stdin when piped. The exit code and JSON `status` are driven by the agent's authoritative terminal state (`complete`/`aborted`/`failed`) rather than by parsing the reply, so CI gating on the exit code is reliable. A bad or ambiguous `--model` selector reports a precise error and exits non-zero, `--debug` writes a JSONL log under `~/.haze/logs/`, and the `--output json` `usage` object is pinned to a documented set of fields.
31
- - **Scoped context refresh during turns.** Nested `CLAUDE.md`/`AGENTS.md` files discovered by file tools are injected into the next model step, tracked by signature, and reread when they change. Concurrent scoped-context discovery is serialized so unchanged instruction files are read once while still surfacing newly changed guidance.
32
- - **Smaller durable session files.** Session persistence now drops streaming `message_update` events and slims large tool outputs/errors in persisted `tool_end` events and `conversation_snapshot` tool results to previews plus byte counts. Sessions remain resumable while avoiding runaway JSONL growth from repeated streamed text or large file reads.
80
+ - `haze -p "prompt"` runs one non-interactive turn and prints the result. It supports a per-run `--model provider:name` override without changing settings, plus structured `--output json` output. It reads piped prompts from stdin. Exit codes and JSON status come from the agent's terminal state (`complete`, `aborted`, or `failed`) rather than parsed reply text. Invalid or ambiguous model selectors print a specific error and exit nonzero. `--debug` writes a JSONL log under `~/.haze/logs/`, and the JSON `usage` object has a documented, fixed set of fields.
81
+ - Nested `CLAUDE.md` and `AGENTS.md` files discovered during a turn are added to the next model step and reread when their signature changes. haze serializes concurrent discovery so it reads unchanged files once without missing updated instructions.
82
+ - Session persistence no longer stores streaming `message_update` events. Large outputs and errors in saved `tool_end` events and `conversation_snapshot` tool results are reduced to previews and byte counts. Sessions remain resumable without unchecked JSONL growth from repeated text streams or large file reads.
33
83
 
34
84
  ### Security
35
85
 
36
- - **Closed a DNS-rebinding TOCTOU in the `fetch` tool.** `urlGuard.validateUrl` resolved a hostname and confirmed every address was public, but the subsequent global `fetch` re-resolved the hostname at connect time, so an attacker-controlled DNS server could answer validation with a public IP and connect with an internal/cloud-metadata IP — fully bypassing the SSRF guard that exists precisely to stop that. `fetchUrlContent` now pins each connection (and each redirect hop) to the already-validated IP via a small stdlib transport that preserves the original `Host` header and TLS `servername`/cert verification, with no second DNS lookup between validation and connect. The post-fetch re-validation was removed as it re-resolved DNS against an already-pinned connection and only reopened the race. Literal-IP URLs keep using the global `fetch` (no rebinding surface).
86
+ - Closed a DNS-rebinding TOCTOU issue in `fetch`. `urlGuard.validateUrl` checked that a hostname resolved only to public addresses, but the global `fetch` resolved it again when connecting. An attacker-controlled DNS server could therefore return a public IP during validation and an internal or cloud-metadata IP during connection. `fetchUrlContent` now pins each connection and redirect hop to the validated IP with a small standard-library transport. It preserves the original `Host` header, TLS `servername`, and certificate verification without another DNS lookup. The redundant post-fetch validation was removed. Literal IP URLs still use the global `fetch` because they have no DNS-rebinding surface.
37
87
 
38
88
  ## 0.6.0 - 2026-06-21
39
89
 
40
90
  ### Added
41
91
 
42
- - **MCP server support.** haze can now connect to [Model Context Protocol](https://modelcontextprotocol.io) servers and expose their tools to the agent alongside the built-in toolset. `/mcp` opens an interactive picker (like `/provider`) to add a server from a preset (Context7 ships built-in for up-to-date library docs) or custom `http`/`sse`/`stdio` details, then enable/disable/remove it or set a masked API key. Servers persist in `~/.haze/settings.json` under `mcpServers`. MCP clients open per agent turn and close when it ends; a failing server is isolated and MCP tools never shadow built-ins.
92
+ - Added [Model Context Protocol](https://modelcontextprotocol.io) server support. `/mcp` opens an interactive picker for presets or custom `http`, `sse`, and `stdio` servers. Context7 is included as a preset for current library documentation. From the picker, users can enable, disable, or remove a server and set a masked API key. Configuration is stored under `mcpServers` in `~/.haze/settings.json`. MCP clients open for each agent turn and close afterward. A failing server is isolated, and MCP tools cannot shadow built-ins.
43
93
  - Added optional configurable stdio LSP support through `/lsp`, with TypeScript, Rust, Python, Go, and PHP presets.
44
94
  - Added read-only semantic navigation tools (`lspWorkspaceSymbols`, `lspSymbols`, `lspDefinition`, `lspReferences`) that are exposed to the model only when an enabled LSP command is installed on `PATH`.
45
95
  - Added `/context`, a token breakdown of the current request (system prompt, project context, tools including MCP, and chat messages).
@@ -48,7 +98,7 @@
48
98
 
49
99
  ### Changed
50
100
 
51
- - Switched the main agent turn to the AI SDK v6 `ToolLoopAgent` abstraction while preserving compact terminal tool/text rendering and key loop guardrails.
101
+ - Switched the main agent turn to the AI SDK v6 `ToolLoopAgent` abstraction while preserving compact terminal tool and text rendering and the existing loop guardrails.
52
102
  - Improved transcript segmentation so assistant text and tool blocks alternate cleanly during multi-step turns.
53
103
  - Added LSP-aware prompt guidance only when LSP tools are actually available; otherwise haze naturally falls back to `grep`, `listFiles`, and `readFile`.
54
104
  - Made `/lsp` and `/mcp` interactive pickers matching the `/provider` flow (autocomplete lists, preset pickers, masked API-key entry), replacing the previous `/lsp`/`/mcp` subcommand syntax.
@@ -60,7 +110,7 @@
60
110
  ### Changed
61
111
 
62
112
  - Removed all user-facing environment variables. `OPENAI_API_KEY`, `OPENAI_BASE_URL`, `HAZE_MODEL`, and `HAZE_CONTEXT_BUDGET_SHARE` are no longer read; configure providers, models, API keys, and base URLs through `~/.haze/settings.json` and the `/provider`, `/model`, `/settings` slash commands instead. This also removes the `OPENAI_*` env overrides from the startup provider info and the header.
63
- - File LLM logging is now **off by default**. Previously haze wrote a detailed JSONL log (full prompts, model messages, tool inputs/outputs, token usage) to `~/.haze/logs/<timestamp>.jsonl` on every session. Logging is now enabled solely with the `--debug` flag (`haze --debug`), which also turns on the on-screen debug panel. The `/logs` command still reviews historical log files.
113
+ - File-based LLM logging is now off by default. Previously, every session wrote a detailed JSONL log containing full prompts, model messages, tool inputs and outputs, and token usage to `~/.haze/logs/<timestamp>.jsonl`. Run `haze --debug` to enable logging and the on-screen debug panel. `/logs` still opens historical log files.
64
114
  - Bash results now pass through command-aware reducers before they enter the transcript/model context. Validation failures render focused diagnostics, successful validation stays short, git/diff/search/JSON/log-like output is compacted, noisy command families get line filters, and reduced raw output remains retrievable by `readToolOutput` when stored.
65
115
  - `grep` now returns compact structured search output for long match sets/lines, with reduction metadata, omitted-result counts, and a raw-output handle when the rendered result was truncated.
66
116
  - Tool activity rendering is quieter: live tool groups show elapsed timers, subagent child calls, capped group detail, and compact success/failure summaries instead of dumping large result objects.
@@ -85,13 +135,13 @@
85
135
 
86
136
  ### Skills
87
137
 
88
- - Replaced single-shot `/create-skill <description>` with a 3-step interactive wizard: name → optional role → description. The user-supplied name and role are used verbatim — the model no longer renames them.
138
+ - Replaced single-shot `/create-skill <description>` with a three-step interactive wizard: name → optional role → description. The wizard uses the supplied name and role verbatim; the model no longer renames them.
89
139
  - Added language-agnostic intent extraction. Skill descriptions are interpreted by the model in any language, replacing the previous English-only regex strip. `"crée une compétence qui vérifie le style du code"` now produces a skill that vérifies code style, not a skill about creating something.
90
140
  - Added `toSkillDirName` for kebab-casing user-typed skill names without stop-word stripping (so `"create a skill"` stays `create-a-skill`, not `skill`).
91
141
 
92
142
  ### Commands
93
143
 
94
- - Removed the `/tasks` slash command. Tasks are now managed exclusively by the model via the `writeTasks` tool — `/clear` still wipes them as a side effect of clearing the conversation.
144
+ - Removed the `/tasks` slash command. The model now manages tasks through `writeTasks`. `/clear` still removes them when it clears the conversation.
95
145
  - Removed the `/list-skills` alias; `/skills` now shows the overview and the installed list.
96
146
  - Removed the `/skill <subcommand>` and `/skills <subcommand>` legacy routing forms. Each skill operation now has exactly one user-facing form: `/skills`, `/create-skill`, `/skill-info`, `/validate-skill`, `/remove-skill`.
97
147
  - Removed the `/tasks rm` alias for `/tasks remove`.
@@ -100,7 +150,7 @@
100
150
  ### Docs site
101
151
 
102
152
  - Added §02 "Native skill creation" segment that frames the 3-step wizard as the haze superpower, with a live transcript of the wizard prompts, superpower bullets, and copy-pasteable recipe cards for `/code-review`, `/deploy-check`, `/release-prep`, `/security-review`.
103
- - Added §07 "Commands index" — a categorized reference of all 16 slash commands plus the `/<skill-name>` dynamic invocations.
153
+ - Added §07 "Commands index," a categorized reference for all 16 slash commands and dynamic `/<skill-name>` invocations.
104
154
  - Removed §04 "Serviceable procedures" (folded into §02).
105
155
  - Renumbered sections sequentially (§01 Operation → §02 Native skill creation → §03 Field behavior → §04 Components → §05 Compatibility → §06 Install → §07 Commands index).
106
156
  - Fixed §01 layout: switched from `.container-prose` (narrow, visually centered) to `.container` so it aligns with every other section.
package/README.md CHANGED
@@ -2,27 +2,32 @@
2
2
 
3
3
  A minimal LLM harness for your terminal.
4
4
 
5
- ## What's new in 0.8.0
5
+ ## What's new in 0.10.0
6
6
 
7
- haze 0.8.0 focuses on runtime reliability and clearer terminal feedback while staying compact and low-friction.
7
+ haze 0.10.0 adds richer input, isolated parallel work, and better control over long-running sessions.
8
8
 
9
- - **AI SDK v7 runtime.** The main agent and subagent runners now use AI SDK v7 APIs with explicit per-tool context wiring, keeping built-in tool state turn-scoped and compatible with the newer runtime.
10
- - **Live busy status.** The active-turn indicator now shows the current model, elapsed time, and the tool activity underway — reading, editing, searching, running commands, loading skills, or calling MCP/LSP tools — so long turns look alive instead of stuck.
11
- - **Bounded bash output processing.** Bash output reduction paths are tightened so large command output remains controlled before it reaches transcript/model context.
12
- - **Input and maintenance polish.** Multiline input shortcuts are fixed, core agent maintenance paths are hardened, model/status labels are shorter and safer, and user-facing naming is consistently lowercase `haze`.
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.
13
16
 
14
17
  Previous releases:
15
18
 
16
- - **0.7.0** — Headless `-p`/`--output json`/`--output stream-json`, pinned-connection `fetch` safety, scoped instruction refresh during turns, smaller durable sessions, and startup context visibility.
17
- - **0.6.0** — AI SDK-native ToolLoopAgent core, optional LSP semantic navigation, MCP server support, unified config pickers, cleaner transcripts, `/context`, and startup update checks.
18
- - **0.5.0** — `fetch` tool for public URLs (Markdown/JSON/text, SSRF-protected), removed all provider env vars (config via `/provider`/`/model`/`/settings`), debug-only LLM logs, command-aware output reduction, Markdown rendering in the CLI, scoped nested context files, and auto-clearing completed tasks.
19
- - **0.4.0** — 3-step skill wizard, language-agnostic skill intent extraction, model-managed tasks, leaner command surface, docs site additions.
20
- - **0.3.0** — Docs site redesign, task bar moves above the activity spinner, tasks auto-clear between sessions.
21
- - **0.2.0** — Reliability release: stronger continuation after failed edits and validation, structured bash classification, parsed validation summaries, multi-line chat input with vertical cursor movement.
22
- - **0.1.0** — Bundled ripgrep, subagent delegation, inline diff display.
23
- - **0.0.3** — Durable sessions, context compaction, provider management.
24
- - **0.0.2** — Markdown skills, autocomplete, listFiles pagination.
25
- - **0.0.1** — Initial release.
19
+ - `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
+ - `0.8.0`: AI SDK v7 runtime, live status with model, elapsed time, and tool labels; bounded bash output processing; lowercase `haze` naming.
21
+ - `0.7.0`: headless `-p`, `--output json`, and `--output stream-json`; pinned-connection `fetch` safety; scoped instruction refresh; smaller sessions; startup context visibility.
22
+ - `0.6.0`: AI SDK-native ToolLoopAgent core, optional LSP navigation, MCP support, unified configuration pickers, cleaner transcripts, `/context`, and startup update checks.
23
+ - `0.5.0`: SSRF-protected public URL fetching, no provider environment variables, debug-only LLM logs, command-aware output reduction, CLI Markdown rendering, scoped nested context files, and automatic cleanup of completed tasks.
24
+ - `0.4.0`: three-step skill wizard, language-agnostic skill intent extraction, model-managed tasks, a smaller command surface, and docs site additions.
25
+ - `0.3.0`: redesigned docs site, a relocated task bar, and automatic task cleanup between sessions.
26
+ - `0.2.0`: more reliable recovery from failed edits and validation, structured bash classification, parsed validation summaries, and multiline input with vertical cursor movement.
27
+ - `0.1.0`: bundled ripgrep, subagent delegation, and inline diffs.
28
+ - `0.0.3`: durable sessions, context compaction, and provider management.
29
+ - `0.0.2`: Markdown skills, autocomplete, and `listFiles` pagination.
30
+ - `0.0.1`: initial release.
26
31
 
27
32
  haze works with OpenAI-compatible providers, including OpenRouter and local endpoints. Use `/provider` to choose or add one, then `/model` to select a model.
28
33
 
@@ -35,7 +40,7 @@ haze works with OpenAI-compatible providers, including OpenRouter and local endp
35
40
  |_| |_|\__,_/___\___|
36
41
  ```
37
42
 
38
- haze keeps guardrails light. The LLM can work from the terminal with freedoms close to yours, while trying to stay scoped to the current project. It is aimed at developers who want an expert-oriented tool, not a permission dialog factory. Watch the tool calls. Keep your hands near the wheel. Progress.
43
+ 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.
39
44
 
40
45
  ## Getting started
41
46
 
@@ -58,9 +63,9 @@ On first run, create or choose a provider, then choose your first model:
58
63
  /model
59
64
  ```
60
65
 
61
- `/provider` opens provider setup for any OpenAI-compatible endpoint — e.g. OpenRouter, OpenAI, LM Studio, Ollama, or a proxy. haze will ask for a provider name, base URL, optional API key, and model names.
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.
62
67
 
63
- `/model` selects the model haze should use. You can also set one directly:
68
+ `/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:
64
69
 
65
70
  ```txt
66
71
  /model anthropic/claude-sonnet-4.6
@@ -69,7 +74,7 @@ On first run, create or choose a provider, then choose your first model:
69
74
 
70
75
  ### MCP servers
71
76
 
72
- Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io) servers and give the agent extra tools. It opens an interactive picker (like `/provider`): choose a server to enable, disable, remove, or set an API key for it, or choose **add server** to add one from a preset (Context7 ships built-in for up-to-date library docs) or enter custom details.
77
+ Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io) servers and give the agent more tools. The interactive picker works like `/provider`: enable, disable, or remove a server; set its API key; or add one from a preset or custom configuration. The built-in Context7 preset provides current library documentation.
73
78
 
74
79
  ```txt
75
80
  /mcp # opens the server picker
@@ -78,13 +83,13 @@ Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io)
78
83
  # add server -> custom -> name -> stdio -> cmd (custom local)
79
84
  ```
80
85
 
81
- API keys are entered in a masked prompt and sent as `Authorization: Bearer <value>`. Servers persist in `~/.haze/settings.json` under `mcpServers` and support `http`, `sse`, and `stdio` transports. Their tools load at the start of each agent turn and the connections close when the turn ends. An unreachable server is isolated and never blocks the agent, and MCP tools never shadow built-in tools.
86
+ 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.
82
87
 
83
- Saved settings live in `~/.haze/settings.json`. Providers can include API keys, base URLs, and model lists; local OpenAI-compatible providers can be configured without a key. Use `/provider`, `/model`, and `/settings` to configure everything from inside haze — there are no environment variables to set.
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.
84
89
 
85
- haze is intentionally minimal: chat, local tools, context files, sessions, and Markdown skills. Any workflow beyond the core is meant to be grown with the LLM through `/skills` (an interactive picker: generate a custom skill from a description, then enable/disable, validate, or remove it). If you want reviews, release prep, deploy checks, debugging rituals, or your team's strange checklist, ask haze to create a skill and then refine the Markdown.
90
+ 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.
86
91
 
87
- ## Get productive immediately
92
+ ## Start using haze
88
93
 
89
94
  Open a project and ask for work:
90
95
 
@@ -92,9 +97,11 @@ Open a project and ask for work:
92
97
  create a calculator in calc-app in ruby with add subtract multiply divide
93
98
  ```
94
99
 
95
- haze will inspect, search, write files, fetch public URLs, run commands, and show compact tool activity inline. Small file edits include a colorized line diff with one context line before and after the change; large diffs stay summarized so the transcript does not become a wall of noise. Bash output is reduced by command-aware filters for validation, git, search, JSON, diffs, and noisy logs; failures point at the relevant files, tests, or diagnostics, and raw output remains available by handle when it was omitted. Sessions are saved by default so you can resume the latest workspace conversation with `haze --continue` or `/resume`.
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`.
96
101
 
97
- Use `/` to discover commands and skills. `Tab` completes the top suggestion.
102
+ 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
+
104
+ Use `/` to discover commands and skills. Type `@` to browse workspace files; `Tab` completes the top suggestion.
98
105
 
99
106
  Useful starters:
100
107
 
@@ -108,9 +115,19 @@ Useful starters:
108
115
 
109
116
  `/init` creates or updates `AGENTS.md` so future sessions understand the project.
110
117
 
111
- ## Skills: your workflows, grown while working
118
+ ## Attach images
119
+
120
+ Reference an image in your prompt to attach it, and haze sends it to the model alongside your text:
121
+
122
+ ```txt
123
+ @docs/screenshot.png the button in this shot is misaligned — fix it
124
+ ```
125
+
126
+ Image input is opt-in per provider. Mark a provider image-capable in `/provider` before attaching, and haze shows which providers accept images in `/settings`. Attachments are limited to png, jpeg, gif, and webp files, up to 5 MB and 4 per message. Explicit user-typed paths may point outside the workspace; this exception is read-only and never expands mutation access. A non-capable provider, an invalid image path, or an oversized file fails with a clear message before any model call. Resumed sessions keep a short placeholder instead of the image bytes.
112
127
 
113
- Skills are Markdown workflows that haze creates with `/skills` and stores in `~/.haze/skills` so you can inspect or refine them later.
128
+ ## Skills that grow with your workflow
129
+
130
+ Skills are Markdown workflows that haze creates with `/skills`. Choose **this project** to store a team workflow in `.haze/skills`, or **global** to store a personal workflow in `~/.haze/skills`. Project skills override same-named global skills in that workspace; `/skills` always shows each skill's provenance.
114
131
 
115
132
  If you do something for the second time, build a skill for it:
116
133
 
@@ -121,10 +138,11 @@ If you do something for the second time, build a skill for it:
121
138
  # Description: review the diff between my current branch and main, focusing on bugs, tests, DRY and KISS
122
139
  ```
123
140
 
124
- haze uses the model to create the skill file for you:
141
+ haze uses the model to create the skill file for you at the explicitly selected scope:
125
142
 
126
143
  ```txt
127
- ~/.haze/skills/<skill-name>/SKILL.md
144
+ .haze/skills/<skill-name>/SKILL.md # project
145
+ ~/.haze/skills/<skill-name>/SKILL.md # global
128
146
  ```
129
147
 
130
148
  A skill is just Markdown with frontmatter, a role, a focused prompt, and a small output template:
@@ -167,7 +185,7 @@ Installed skills appear as slash commands like:
167
185
 
168
186
  They are also available through one `skill` catalog tool. haze loads one workflow body first and fetches large references only when needed. Skills provide instructions; they do not execute code.
169
187
 
170
- This is the trick: do normal work, notice friction, create a skill, keep going. Your workflow adapts instead of asking you to adapt to the tool. Rude, but in a good way.
188
+ When you catch yourself repeating the same instructions, put them in a skill. The workflow stays in a Markdown file that you can read and edit.
171
189
 
172
190
  ## Commands
173
191
 
@@ -185,13 +203,15 @@ This is the trick: do normal work, notice friction, create a skill, keep going.
185
203
  /init
186
204
  /context
187
205
  /session
188
- /resume
206
+ /resume [id]
189
207
  /new
190
208
  /compact [instructions]
191
209
  /clear
192
210
  /exit
193
211
 
194
212
  /skills
213
+ /tips
214
+ /fleet [--review] [--profile <name>] [--workers <provider:model>] [--concurrency <n>] <prompt>
195
215
  ```
196
216
 
197
217
  Skill management is a single interactive picker, mirroring `/provider`, `/lsp`, and `/mcp`: generate a custom skill from a description, then show info, enable/disable, validate, or remove. Disabled skills drop out of the model catalog and the `/<name>` command list until re-enabled.
@@ -199,9 +219,10 @@ Skill management is a single interactive picker, mirroring `/provider`, `/lsp`,
199
219
  CLI flags:
200
220
 
201
221
  ```bash
202
- haze --debug # show model/tool debug logs and write detailed JSONL logs to ~/.haze/logs
203
- haze --continue # resume the latest saved session for this workspace
204
- haze --no-session # run without durable session storage
222
+ haze --debug # show model/tool debug logs and write detailed JSONL logs to ~/.haze/logs
223
+ haze --continue # resume the latest saved session for this workspace
224
+ haze --resume <id> # resume an exact session id for this workspace
225
+ haze --no-session # run without durable session storage
205
226
  ```
206
227
 
207
228
  Non-interactive / print mode:
@@ -209,12 +230,17 @@ Non-interactive / print mode:
209
230
  ```bash
210
231
  haze -p "refactor utils.ts to remove the unused export"
211
232
  haze -p "summarize this repo" --model openai:gpt-4o-mini
233
+ haze --resume <id> -p "continue the investigation"
212
234
  haze -p "list the top 3 bugs in src/api.ts" --output json
213
235
  haze -p "audit src/auth.ts" --output stream-json # live NDJSON events, then the result envelope
214
236
  echo "what does this project do?" | haze
215
237
  ```
216
238
 
217
- `-p` / `--prompt` runs a single agentic turn (with the full tool set and guardrails) and prints the final assistant text. `--model` overrides the active model for that one run without changing `~/.haze/settings.json` — accepts a bare model name or `provider:name`. The selected model must already be registered under a provider's `models` (add it once via `/provider`); an unknown or ambiguous selector exits non-zero with a precise error on stderr. When `-p` is omitted and stdin is piped, the prompt is read from stdin. A one-shot run never starts or resumes a durable session; `--continue` is ignored in this mode. Headless runs do **not** auto-compact on context overflow, so very large CI prompts may fail rather than recover — keep prompts within the model's window. Add `--debug` to also write a detailed JSONL log under `~/.haze/logs/`. `--output` selects how the run is reported: `text` (default), `json` (a single final envelope), or `stream-json` (a live NDJSON event stream ending in that envelope) — see below.
239
+ `-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
+
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/`.
242
+
243
+ `--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.
218
244
 
219
245
  `--output json` prints a single-line envelope instead of plain text:
220
246
 
@@ -233,9 +259,9 @@ echo "what does this project do?" | haze
233
259
  }
234
260
  ```
235
261
 
236
- 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 `complete` run with an empty `result` means the model produced no visible text — distinct from a `failed` run.
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.
237
263
 
238
- `--output stream-json` streams the run as it happens instead of staying silent until the end. Each public progress event is written to stdout as one newline-delimited JSON object (NDJSON), and the **last** line is the exact same `{ type: "result", status, result, usage }` envelope as `--output json` — so a consumer can render live progress and still parse the final line identically:
264
+ `--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:
239
265
 
240
266
  ```jsonc
241
267
  {"type":"turn_start","request":"audit src/auth.ts","at":"2026-06-27T22:00:00.000Z"}
@@ -248,32 +274,34 @@ The `status` field is authoritative (driven by the agent's terminal state, not b
248
274
  {"type":"result","status":"complete","result":"Here are the findings…","usage":{"inputTokens":0,"outputTokens":0,"cacheReadTokens":0,"cacheWriteTokens":0,"reasoningTokens":0}}
249
275
  ```
250
276
 
251
- Every line is standalone valid JSON, so the stream pipes cleanly through `jq -c .`. The event types are `turn_start`, `message_start` / `message_update` / `message_end`, `tool_start` / `tool_end`, `retry`, `context_overflow`, and `turn_end`; each carries an ISO-8601 `at` timestamp. Tool events intentionally omit raw tool inputs and outputs because stdout is often captured by CI/harness logs; use `--debug` when detailed local JSONL logs are needed. This mode is intended for harnesses driving haze autonomously: the incremental, ever-changing output lets a supervisor show live progress and run stdout-based stagnation/loop detection, while the trailing `result` envelope remains the single source of truth for status, text, and usage. `text` and `json` outputs are unchanged.
277
+ Each line is valid JSON and can be piped through `jq -c .`. Event types include `turn_start`, `message_start` / `message_update` / `message_end`, `tool_start` / `tool_end`, `retry`, `context_overflow`, and `turn_end`. Every event has an ISO-8601 `at` timestamp. Tool events omit raw inputs and outputs because CI and harness logs often capture stdout; use `--debug` for detailed local JSONL logs.
252
278
 
253
- By default, haze does **not** write the detailed LLM log files under `~/.haze/logs/` (they capture full prompts, messages, and tool I/O). File logging is only enabled with `haze --debug`, which also turns on the on-screen debug panel. Use the `/logs` command to review past log files once logging has been enabled.
279
+ This mode is intended for harnesses that run haze without a person at the terminal. A supervisor can watch stdout for progress, stalls, or loops. The final `result` envelope contains the authoritative status, text, and usage. The `text` and `json` formats are unchanged.
280
+
281
+ By default, haze does not write detailed LLM logs under `~/.haze/logs/`; those files contain full prompts, messages, and tool I/O. Run `haze --debug` to enable file logging and the on-screen debug panel. Use `/logs` to review saved logs.
254
282
 
255
283
  ## Agent tools
256
284
 
257
- haze exposes a deliberately small toolset:
285
+ haze has a small built-in toolset:
258
286
 
259
- - `listFiles` — structured discovery, recursive with cursor pagination when needed.
260
- - `readFile` — read numbered UTF-8 lines in bounded pages, with `nextOffset` when more remain.
261
- - `grep` — structured ripgrep search with a true global result cap and compacted long lines/results.
262
- - `editFile` — unique text replacements, with line-number-prefix tolerance for common model mistakes.
263
- - `replaceLines` — line-range edits when exact replacements are awkward; slightly-too-large EOF ranges are clamped.
264
- - `writeFile` — create files and parent directories.
265
- - `bash` — run tests, builds, git/gh commands, inspections, scripts, installs, and other shell workflows with command-aware output reduction (git, gh, search, JSON, diffs, logs) and compact validation output.
266
- - `readToolOutput` — page through full/raw output omitted from an oversized or reduced tool result.
267
- - `fetch` — read a public `http(s)` URL and return readable content (Markdown for docs, pretty JSON, or text). Private/loopback/metadata hosts and non-`http(s)` schemes are blocked; output is bounded and retrievable via `readToolOutput`.
268
- - `writeTasks` — replace the task list at meaningful phase changes; completed lists auto-clear on the next user turn.
269
- - `skill` — load one installed Markdown workflow or one of its references.
270
- - `lspWorkspaceSymbols`, `lspSymbols`, `lspDefinition`, `lspReferences` — optional read-only semantic navigation through user-configured language servers. These tools are exposed only when an enabled LSP command is installed.
287
+ - `listFiles` handles structured discovery and recursive listings, with cursor pagination when needed.
288
+ - `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
+ - `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.
294
+ - `readToolOutput` pages through retained raw output omitted from oversized or reduced results, subject to in-memory budgets.
295
+ - `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
+ - `writeTasks` replaces the task list at meaningful phase changes. Completed lists clear on the next user turn.
297
+ - `skill` loads an installed Markdown workflow or one of its references.
298
+ - `lspWorkspaceSymbols`, `lspSymbols`, `lspDefinition`, and `lspReferences` provide optional read-only navigation through configured language servers. They appear only when an enabled server command is installed.
271
299
 
272
- Tool calls are grouped in the transcript so you can see what happened without reading a novella. Successful targeted file edits show a compact diff with colored additions/removals and one context line around the change when the diff is small; larger diffs are summarized with a pointer to `git diff`. File-tool failures return structured reason codes and recovery hints. Large bash/search/fetch output is kept behind an in-memory handle so later model calls carry only reduced validation, git, search, diff, JSON, log, or head/tail summaries.
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.
273
301
 
274
302
  ### Optional LSP navigation
275
303
 
276
- haze can use user-configured stdio Language Server Protocol servers for semantic code navigation. Configure them with `/lsp` (an interactive picker, like `/provider` and `/mcp`): add a preset or a custom command, then enable/disable/remove servers. Presets currently include TypeScript, Rust, Python, Go, and PHP. haze does not install language servers for you, and it hides LSP tools from the model unless an enabled server command exists on `PATH`, so projects without LSP still use `grep`, `listFiles`, and `readFile` normally.
304
+ haze can use stdio Language Server Protocol servers for semantic code navigation. Open `/lsp` to add a preset or custom command, then enable, disable, or remove it. The presets cover TypeScript, Rust, Python, Go, and PHP. You install the server yourself. haze only exposes LSP tools when an enabled server command is on `PATH`; otherwise it uses `grep`, `listFiles`, and `readFile`. When haze closes a server or rejects malformed protocol output, it terminates the server's process tree and forces it to exit if necessary.
277
305
 
278
306
  Example TypeScript setup:
279
307
 
@@ -288,13 +316,41 @@ npm install -g typescript typescript-language-server
288
316
 
289
317
  ## Subagents
290
318
 
291
- Subagents are a delegation feature, not another file operation. When a request clearly splits into independent parallel work, haze can spin up focused agents with fresh context, let them inspect or act with their own capped tool loop, then fold their concise summaries back into the main conversation.
319
+ A subagent is a disposable worker with its own context. It is useful for a repository survey, log diagnosis, documentation search, or noisy validation run that would swamp the main conversation. The point is to isolate context, not merely to run things in parallel.
320
+
321
+ 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
+
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.
324
+
325
+ 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
+
327
+ `/fleet` remains parallel-only model decomposition over the same worker primitive. Its control guidance is ephemeral and sessions retain only the original invocation, task/result capsules, and final answer. Supported one-run flags are:
328
+
329
+ ```text
330
+ /fleet --review <prompt>
331
+ /fleet --profile local-safe <prompt>
332
+ /fleet --workers provider:model <prompt>
333
+ /fleet --concurrency 2 <prompt>
334
+ /fleet -- --prompt-that-starts-with-a-flag
335
+ ```
336
+
337
+ Built-in profiles are `local-safe`, `local-throughput`, `cloud-balanced`, and `cloud-fast`. haze never infers a profile from a provider name or endpoint URL. If no profile is selected, it uses a provider-neutral compatibility baseline. If no worker model is set, it reuses the explicitly selected active model. An invalid worker model or profile blocks execution instead of falling back. Settings can select or customize profiles:
338
+
339
+ ```json
340
+ {
341
+ "subagents": {
342
+ "workerModel": "local:qwen3-coder",
343
+ "defaultProfile": "local-safe",
344
+ "profiles": {"local-safe": {"maxConcurrency": 1, "deadlineMs": 300000}}
345
+ }
346
+ }
347
+ ```
292
348
 
293
- Use them for parallel investigation across separate areas of a codebase. Do not use them for single sequential tasks where the main agent already has the best context.
349
+ Keep trivial, conversation-coupled, sequential, user-interactive, or uncertain shared-mutation work in the main thread.
294
350
 
295
351
  ## Context files
296
352
 
297
- haze saves durable workspace sessions in `~/.haze/sessions`. Use `/session` to see the current file, `/new` to start fresh, `/resume` to restore the latest session, and `/compact` to summarize older model context. Sessions also persist compact structured work state: the active goal, touched files, validation evidence, blockers, and next action.
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.
298
354
 
299
355
  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.
300
356
 
@@ -308,17 +364,18 @@ haze loads project instructions from:
308
364
 
309
365
  At the same scope, `AGENTS.md` overrides `CLAUDE.md`; global haze guidance in `~/.haze/AGENTS.md` overrides global Claude guidance in `~/.claude/CLAUDE.md`. Nested `CLAUDE.md` / `AGENTS.md` files below the workspace are scoped: haze surfaces them only when file tools operate inside that directory or its subdirectories, injects newly discovered scoped guidance into the next model step, and mutating tools stop once so the model can review it before editing. Scoped context files are tracked by signature, so changed nested guidance can be read again later in the same session.
310
366
 
311
- Use `AGENTS.md` for project conventions, commands, architecture notes, and things future-you does not want to re-explain. `/init` is intentionally budget-aware: it does one small discovery pass, preserves useful existing guidance, and asks for a compact file because context files are injected into every request.
367
+ 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.
312
368
 
313
369
  ## Safety model
314
370
 
315
- - File tools are restricted to the current workspace.
316
- - File tools follow `.gitignore` by default.
317
- - Ignored files require an explicit override.
371
+ - Model-selected file tools are restricted to the current workspace and follow `.gitignore` by default.
372
+ - 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.
318
374
  - Bash commands are classified and shown with working-directory metadata, but haze does not use command confirmation gates.
319
- - The `fetch` tool reads public `http(s)` URLs only; private, loopback, link-local, and cloud-metadata hosts and non-`http(s)` schemes are blocked, and each redirect hop is connected to the already validated public IP to avoid DNS-rebinding races.
375
+ - 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.
320
376
  - Mutating and destructive commands can run when they are relevant to the user's request; this is intentional for expert users.
321
- - haze is powerful enough to help and dumb enough to deserve supervision. Ideal software, basically.
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.
322
379
 
323
380
  ## Local development
324
381
 
@@ -1,5 +1,5 @@
1
1
  import type { ModelMessage } from 'ai';
2
- import type { Message } from '../commands/streaming.js';
2
+ import type { Message, TokenUsage } from '../commands/streaming.js';
3
3
  export declare function toolCallCount(messages: Message[]): number;
4
4
  export declare function estimateTokens(text: string): number;
5
5
  export declare function compactHomePath(filePath: string, home?: string): string;
@@ -9,3 +9,19 @@ export declare function estimateConversationTokens(messages: Message[]): {
9
9
  input: number;
10
10
  output: number;
11
11
  };
12
+ /** Status-bar numbers for the transcript, extracted so render stays declarative (CR-006). */
13
+ export declare function statusBarMetrics(input: {
14
+ messages: Message[];
15
+ tokenUsage: TokenUsage;
16
+ enabledSkillCount: number;
17
+ backgroundProcessCount?: number;
18
+ }): {
19
+ hazeMessages: number;
20
+ toolsUsed: number;
21
+ effectiveInput: number;
22
+ effectiveOutput: number;
23
+ inputEstimated: boolean;
24
+ outputEstimated: boolean;
25
+ statusDetailLabel: string;
26
+ hasTokenBreakdown: boolean;
27
+ };