@denizokcu/haze 0.7.0 → 0.9.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.
- package/CHANGELOG.md +35 -9
- package/README.md +37 -35
- package/dist/cli/chat/inputSuggestions.js +2 -2
- package/dist/cli/chat/sessionRecorder.d.ts +3 -0
- package/dist/cli/chat/sessionRecorder.js +23 -8
- package/dist/cli/commands/chat.js +136 -124
- package/dist/cli/commands/chatModes.js +1 -1
- package/dist/cli/commands/commandHelp.js +2 -2
- package/dist/cli/commands/commands.d.ts +1 -1
- package/dist/cli/commands/commands.js +1 -1
- package/dist/cli/commands/formatters.d.ts +6 -0
- package/dist/cli/commands/formatters.js +41 -3
- package/dist/cli/commands/logsCommand.js +7 -21
- package/dist/cli/commands/mcpWizard.js +24 -2
- package/dist/cli/commands/providerWizard.js +18 -5
- package/dist/cli/commands/runCommand.js +7 -15
- package/dist/cli/commands/settingsSummary.js +3 -1
- package/dist/cli/commands/streaming/turnOutcome.d.ts +10 -0
- package/dist/cli/commands/streaming/turnOutcome.js +13 -0
- package/dist/cli/commands/streaming.js +99 -51
- package/dist/cli/commands/wizardPrompts.js +1 -1
- package/dist/cli/commands/wizardSuggestions.js +3 -2
- package/dist/cli/commands/wizardTransition.d.ts +33 -0
- package/dist/cli/commands/wizardTransition.js +44 -0
- package/dist/config/contextFiles.js +6 -3
- package/dist/config/endpointSecurity.d.ts +2 -0
- package/dist/config/endpointSecurity.js +28 -0
- package/dist/config/inputHistory.js +4 -2
- package/dist/config/privateStorage.d.ts +6 -0
- package/dist/config/privateStorage.js +61 -0
- package/dist/config/providers.js +5 -9
- package/dist/config/settings.d.ts +1 -0
- package/dist/config/settings.js +55 -3
- package/dist/config/updateCheck.js +4 -2
- package/dist/core/agent/compaction.js +2 -2
- package/dist/core/agent/errors.js +1 -1
- package/dist/core/agent/requestAssembly.d.ts +1 -0
- package/dist/core/agent/requestAssembly.js +13 -0
- package/dist/core/agent/toolOutputStore.d.ts +3 -0
- package/dist/core/agent/toolOutputStore.js +32 -11
- package/dist/core/bashOutput/registry.js +11 -9
- package/dist/core/goal/completionPolicy.d.ts +0 -28
- package/dist/core/goal/completionPolicy.js +1 -89
- package/dist/core/io/boundedRead.d.ts +15 -0
- package/dist/core/io/boundedRead.js +97 -0
- package/dist/core/limits/byteBudgets.d.ts +13 -0
- package/dist/core/limits/byteBudgets.js +13 -0
- package/dist/core/log/llmLog.d.ts +10 -0
- package/dist/core/log/llmLog.js +59 -13
- package/dist/core/persistence/orderedFileWriter.d.ts +11 -0
- package/dist/core/persistence/orderedFileWriter.js +29 -0
- package/dist/core/process/runBoundedProcess.d.ts +27 -0
- package/dist/core/process/runBoundedProcess.js +80 -0
- package/dist/core/session/sessionStore.js +48 -25
- package/dist/core/subagent/subagentRunner.d.ts +252 -9
- package/dist/core/subagent/subagentRunner.js +14 -19
- package/dist/core/toolOutput/reduction.d.ts +2 -0
- package/dist/core/toolOutput/reduction.js +12 -0
- package/dist/core/validation/outputParser.js +5 -3
- package/dist/llm/client.d.ts +2 -2
- package/dist/llm/client.js +19 -3
- package/dist/llm/hazeTools.d.ts +8103 -364
- package/dist/llm/hazeTools.js +43 -33
- package/dist/llm/initPrompt.js +1 -1
- package/dist/llm/lsp.d.ts +21 -3
- package/dist/llm/lsp.js +65 -14
- package/dist/llm/lspTools.d.ts +2358 -101
- package/dist/llm/mcp.d.ts +1 -1
- package/dist/llm/mcp.js +65 -16
- package/dist/llm/requestContext.d.ts +1 -0
- package/dist/llm/requestContext.js +6 -3
- package/dist/llm/systemPrompt.js +2 -2
- package/dist/llm/toolResultTypes.d.ts +1 -1
- package/dist/llm/tools/bashTool.d.ts +603 -5
- package/dist/llm/tools/bashTool.js +23 -60
- package/dist/llm/tools/fetchTool.d.ts +1201 -65
- package/dist/llm/tools/fetchTool.js +2 -1
- package/dist/llm/tools/grepRunner.d.ts +15 -0
- package/dist/llm/tools/grepRunner.js +85 -0
- package/dist/llm/tools/storedOutputTool.d.ts +351 -10
- package/dist/llm/tools/taskTool.d.ts +629 -28
- package/dist/llm/tools/toolContext.d.ts +7 -2
- package/dist/llm/tools/toolContext.js +11 -2
- package/dist/llm/webFetch.js +31 -21
- package/dist/skills/SkillLoader.js +17 -5
- package/dist/skills/SkillRegistry.js +19 -6
- package/dist/skills/builder/SkillBuilder.js +7 -7
- package/dist/skills/types.d.ts +5 -0
- package/dist/ui/components/TextInput.d.ts +7 -0
- package/dist/ui/components/TextInput.js +10 -0
- package/dist/utils/modelName.d.ts +2 -0
- package/dist/utils/modelName.js +15 -0
- package/dist/utils/path.d.ts +2 -0
- package/dist/utils/path.js +9 -4
- package/examples/skills/files/SKILL.md +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.9.0 - 2026-07-10
|
|
4
|
+
|
|
5
|
+
### Security
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- 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.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- 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.
|
|
13
|
+
- 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.
|
|
14
|
+
|
|
15
|
+
## 0.8.0 - 2026-07-09
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **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.
|
|
20
|
+
- **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.
|
|
21
|
+
- **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.
|
|
22
|
+
- **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.
|
|
23
|
+
- **Standardized lowercase `haze` naming.** README, docs, prompts, skills, command help, tests, and agent guidance now consistently use lowercase `haze` for the product name.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- Fixed multiline input shortcut handling in the chat input.
|
|
28
|
+
- Kept model thinking labels concise without hiding useful slash-model suffixes such as reasoning variants.
|
|
29
|
+
- Compacted long file paths in live tool labels so the busy line stays readable.
|
|
4
30
|
|
|
5
31
|
## 0.7.0 - 2026-06-29
|
|
6
32
|
|
|
7
33
|
### Added
|
|
8
34
|
|
|
9
|
-
- **`--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
|
|
35
|
+
- **`--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.
|
|
10
36
|
- **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.
|
|
11
37
|
|
|
12
38
|
### Changed
|
|
@@ -23,7 +49,7 @@
|
|
|
23
49
|
|
|
24
50
|
### Added
|
|
25
51
|
|
|
26
|
-
- **MCP server support.**
|
|
52
|
+
- **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.
|
|
27
53
|
- Added optional configurable stdio LSP support through `/lsp`, with TypeScript, Rust, Python, Go, and PHP presets.
|
|
28
54
|
- 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`.
|
|
29
55
|
- Added `/context`, a token breakdown of the current request (system prompt, project context, tools including MCP, and chat messages).
|
|
@@ -34,7 +60,7 @@
|
|
|
34
60
|
|
|
35
61
|
- Switched the main agent turn to the AI SDK v6 `ToolLoopAgent` abstraction while preserving compact terminal tool/text rendering and key loop guardrails.
|
|
36
62
|
- Improved transcript segmentation so assistant text and tool blocks alternate cleanly during multi-step turns.
|
|
37
|
-
- Added LSP-aware prompt guidance only when LSP tools are actually available; otherwise
|
|
63
|
+
- Added LSP-aware prompt guidance only when LSP tools are actually available; otherwise haze naturally falls back to `grep`, `listFiles`, and `readFile`.
|
|
38
64
|
- 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.
|
|
39
65
|
- Unified skill management into a single `/skills` interactive picker that mirrors `/provider`, `/lsp`, and `/mcp`; removed the legacy `/create-skill`, `/skill-info`, `/validate-skill`, and `/remove-skill` commands.
|
|
40
66
|
- Updated README, docs site, and project agent guidance for LSP setup and the 0.6.0 release.
|
|
@@ -44,16 +70,16 @@
|
|
|
44
70
|
### Changed
|
|
45
71
|
|
|
46
72
|
- 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.
|
|
47
|
-
- File LLM logging is now **off by default**. Previously
|
|
73
|
+
- 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.
|
|
48
74
|
- 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.
|
|
49
75
|
- `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.
|
|
50
76
|
- 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.
|
|
51
77
|
- Assistant Markdown rendering in the CLI now supports styled headings, inline code/strong/emphasis/links, blockquotes, syntax-highlighted code fences, horizontal rules, and width-aware tables.
|
|
52
78
|
- Consecutive assistant messages in one turn now share a single visible `haze` header for a less noisy transcript.
|
|
53
79
|
- Completed task lists now clear automatically at the start of a new user turn so old successful todos do not linger in the task bar.
|
|
54
|
-
- Context loading now includes global `~/.claude/CLAUDE.md` while keeping `~/.haze/AGENTS.md` higher priority for
|
|
80
|
+
- Context loading now includes global `~/.claude/CLAUDE.md` while keeping `~/.haze/AGENTS.md` higher priority for haze-specific global guidance.
|
|
55
81
|
- Nested `CLAUDE.md`/`AGENTS.md` files below the workspace are now scoped and loaded lazily when file tools operate inside their directory tree; mutating file tools stop before the first edit when newly scoped instructions are discovered.
|
|
56
|
-
- Repeated identical tool calls are now steered back to the model with an explicit correction instead of aborting the turn immediately, so
|
|
82
|
+
- Repeated identical tool calls are now steered back to the model with an explicit correction instead of aborting the turn immediately, so haze can reuse existing results or finish cleanly.
|
|
57
83
|
- `/init` now explicitly keeps `AGENTS.md` compact, reminds the model that context files are injected into every request, and references the current context-file truncation budget.
|
|
58
84
|
|
|
59
85
|
### Added
|
|
@@ -95,7 +121,7 @@
|
|
|
95
121
|
- Added request-level context accounting, cache/no-cache usage metrics, a debug token breakdown, and an offline `context:report` command.
|
|
96
122
|
- Bounded `readFile`, structured and globally capped `grep`, and compacted large bash output behind paginated `readToolOutput` handles.
|
|
97
123
|
- Added structured `WorkState` snapshots, token-aware compaction, conservative old-tool-result pruning, bounded continuation slices, and no-progress termination for long agent workflows.
|
|
98
|
-
- Made
|
|
124
|
+
- Made haze control nudges ephemeral, omitted tool schemas from text-only follow-ups, and replaced duplicated subagent prompting with a concise dedicated prompt.
|
|
99
125
|
- Consolidated installed workflows into one progressive `skill` catalog tool and added provider capability-gated cache keys, sticky session hints, and low-verbosity options.
|
|
100
126
|
- Shortened the model operating contract and final-response guidance while preserving edit recovery, validation evidence, and blocked/partial reporting.
|
|
101
127
|
|
|
@@ -114,7 +140,7 @@
|
|
|
114
140
|
- Added shared structured tool result types and more specific file-edit failure reason codes so edit recovery can reread the affected file and retry with better guidance.
|
|
115
141
|
- Reworked the system prompt, subagent prompt, compaction prompt, and generated-skill guidance around autonomous expert developer workflows with concise final status reporting.
|
|
116
142
|
- Removed hard-coded `temperature: 0` from model calls so providers/models that reject temperature options can run without warning workarounds.
|
|
117
|
-
- Removed bash confirmation gates, including for destructive classifications;
|
|
143
|
+
- Removed bash confirmation gates, including for destructive classifications; haze now assumes expert users know what they asked for and relies on transparent tool output rather than permission prompts.
|
|
118
144
|
- Improved chat input editing with wrapped multi-line display, vertical cursor movement across wrapped lines, and better cursor mapping for compacted paste blocks.
|
|
119
145
|
- Added and updated tests for bash classification, bash execution behavior, validation parsing, edit recovery, system-prompt guidance, and skill generation.
|
|
120
146
|
|
package/README.md
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# haze
|
|
2
2
|
|
|
3
3
|
A minimal LLM harness for your terminal.
|
|
4
4
|
|
|
5
|
-
## What's new in 0.
|
|
5
|
+
## What's new in 0.9.0
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
haze 0.9.0 closes the security and correctness findings from the 0.8.0 code review: private state, truthful status, bounded work, and robust boundaries.
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
9
|
+
- **Private home-state storage.** Settings, sessions, logs, and history now use `0700` directories and `0600` files on POSIX, with opportunistic tightening of pre-existing overly-broad modes.
|
|
10
|
+
- **Truthful turn and tool status.** Turn and tool status is now authoritative across the UI, events, logs, sessions, and headless exit codes — a turn that ends without a substantive answer, after an unresolved tool failure, or at a hard step/tool budget reports `failed` even when the provider returned normally.
|
|
11
|
+
- **Bounded work, not just bounded output.** Bash, grep, and LSP output, file reads, edits, and stored handles enforce collection-time byte limits; bash timeout and abort terminate the whole process tree, not just the shell.
|
|
12
|
+
- **Stronger filesystem and integration boundaries.** `grep` rejects directly named ignored files, skills and LSP confine to real workspace/root paths (symlink-safe), MCP discovery is bounded and abort-aware, and credentialed remote plaintext HTTP is rejected while loopback HTTP stays supported.
|
|
13
|
+
- **Ordered, flushable persistence.** Sessions and debug logs preserve write order and flush at turn end and shutdown, surfacing persistence failures instead of swallowing them.
|
|
14
14
|
|
|
15
15
|
Previous releases:
|
|
16
16
|
|
|
17
|
+
- **0.8.0** — AI SDK v7 runtime, live busy status with model/elapsed/tool labels, bounded bash output processing, and standardized lowercase `haze` naming.
|
|
18
|
+
- **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
19
|
- **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
20
|
- **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
21
|
- **0.4.0** — 3-step skill wizard, language-agnostic skill intent extraction, model-managed tasks, leaner command surface, docs site additions.
|
|
@@ -24,7 +26,7 @@ Previous releases:
|
|
|
24
26
|
- **0.0.2** — Markdown skills, autocomplete, listFiles pagination.
|
|
25
27
|
- **0.0.1** — Initial release.
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
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
30
|
|
|
29
31
|
```txt
|
|
30
32
|
_
|
|
@@ -35,17 +37,17 @@ Haze works with OpenAI-compatible providers, including OpenRouter and local endp
|
|
|
35
37
|
|_| |_|\__,_/___\___|
|
|
36
38
|
```
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
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.
|
|
39
41
|
|
|
40
42
|
## Getting started
|
|
41
43
|
|
|
42
|
-
Install
|
|
44
|
+
Install haze:
|
|
43
45
|
|
|
44
46
|
```bash
|
|
45
47
|
npm install -g @denizokcu/haze
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
Open
|
|
50
|
+
Open haze from your project:
|
|
49
51
|
|
|
50
52
|
```bash
|
|
51
53
|
$ haze
|
|
@@ -58,9 +60,9 @@ On first run, create or choose a provider, then choose your first model:
|
|
|
58
60
|
/model
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
`/provider` opens provider setup for any OpenAI-compatible endpoint — e.g. OpenRouter, OpenAI, LM Studio, Ollama, or a proxy.
|
|
63
|
+
`/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.
|
|
62
64
|
|
|
63
|
-
`/model` selects the model
|
|
65
|
+
`/model` selects the model haze should use. You can also set one directly:
|
|
64
66
|
|
|
65
67
|
```txt
|
|
66
68
|
/model anthropic/claude-sonnet-4.6
|
|
@@ -78,11 +80,11 @@ Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io)
|
|
|
78
80
|
# add server -> custom -> name -> stdio -> cmd (custom local)
|
|
79
81
|
```
|
|
80
82
|
|
|
81
|
-
API keys are entered in a masked prompt and sent as `Authorization: Bearer <value>`.
|
|
83
|
+
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
84
|
|
|
83
|
-
Saved settings live in `~/.haze/settings.json`.
|
|
85
|
+
Saved settings live in `~/.haze/settings.json`. Provider keys and MCP headers require HTTPS unless the endpoint is loopback HTTP (`localhost`, `*.localhost`, `127/8`, or `::1`); keyless HTTP remains available. Local OpenAI-compatible providers can be configured without a key. Malformed settings are shown as an actionable startup error rather than treated as empty. Use `/provider`, `/model`, and `/settings` to configure everything from inside haze — there are no environment variables to set.
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
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.
|
|
86
88
|
|
|
87
89
|
## Get productive immediately
|
|
88
90
|
|
|
@@ -92,7 +94,7 @@ Open a project and ask for work:
|
|
|
92
94
|
create a calculator in calc-app in ruby with add subtract multiply divide
|
|
93
95
|
```
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
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 bounded while the process runs, then reduced by command-aware filters for validation, git, search, JSON, diffs, and noisy logs; failures point at relevant diagnostics. Handles retain raw output only within explicit per-entry and aggregate memory budgets, and report omitted bytes when collection overflow is dropped. Sessions are saved by default so you can resume the latest workspace conversation with `haze --continue` or `/resume`.
|
|
96
98
|
|
|
97
99
|
Use `/` to discover commands and skills. `Tab` completes the top suggestion.
|
|
98
100
|
|
|
@@ -110,7 +112,7 @@ Useful starters:
|
|
|
110
112
|
|
|
111
113
|
## Skills: your workflows, grown while working
|
|
112
114
|
|
|
113
|
-
Skills are Markdown workflows that
|
|
115
|
+
Skills are Markdown workflows that haze creates with `/skills` and stores in `~/.haze/skills` so you can inspect or refine them later.
|
|
114
116
|
|
|
115
117
|
If you do something for the second time, build a skill for it:
|
|
116
118
|
|
|
@@ -121,7 +123,7 @@ If you do something for the second time, build a skill for it:
|
|
|
121
123
|
# Description: review the diff between my current branch and main, focusing on bugs, tests, DRY and KISS
|
|
122
124
|
```
|
|
123
125
|
|
|
124
|
-
|
|
126
|
+
haze uses the model to create the skill file for you:
|
|
125
127
|
|
|
126
128
|
```txt
|
|
127
129
|
~/.haze/skills/<skill-name>/SKILL.md
|
|
@@ -165,7 +167,7 @@ Installed skills appear as slash commands like:
|
|
|
165
167
|
/code-review-diff-main
|
|
166
168
|
```
|
|
167
169
|
|
|
168
|
-
They are also available through one `skill` catalog tool.
|
|
170
|
+
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
171
|
|
|
170
172
|
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.
|
|
171
173
|
|
|
@@ -233,7 +235,7 @@ echo "what does this project do?" | haze
|
|
|
233
235
|
}
|
|
234
236
|
```
|
|
235
237
|
|
|
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
|
|
238
|
+
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
239
|
|
|
238
240
|
`--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:
|
|
239
241
|
|
|
@@ -248,22 +250,22 @@ The `status` field is authoritative (driven by the agent's terminal state, not b
|
|
|
248
250
|
{"type":"result","status":"complete","result":"Here are the findings…","usage":{"inputTokens":0,"outputTokens":0,"cacheReadTokens":0,"cacheWriteTokens":0,"reasoningTokens":0}}
|
|
249
251
|
```
|
|
250
252
|
|
|
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
|
|
253
|
+
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.
|
|
252
254
|
|
|
253
|
-
By default,
|
|
255
|
+
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.
|
|
254
256
|
|
|
255
257
|
## Agent tools
|
|
256
258
|
|
|
257
|
-
|
|
259
|
+
haze exposes a deliberately small toolset:
|
|
258
260
|
|
|
259
261
|
- `listFiles` — structured discovery, recursive with cursor pagination when needed.
|
|
260
262
|
- `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.
|
|
263
|
+
- `grep` — structured ripgrep search with a true global result cap and compacted long lines/results; directly named ignored roots are rejected unless `includeIgnored` is explicitly set.
|
|
262
264
|
- `editFile` — unique text replacements, with line-number-prefix tolerance for common model mistakes.
|
|
263
265
|
- `replaceLines` — line-range edits when exact replacements are awkward; slightly-too-large EOF ranges are clamped.
|
|
264
266
|
- `writeFile` — create files and parent directories.
|
|
265
267
|
- `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
|
|
268
|
+
- `readToolOutput` — page through retained raw output omitted from an oversized or reduced tool result (subject to bounded in-memory budgets).
|
|
267
269
|
- `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
270
|
- `writeTasks` — replace the task list at meaningful phase changes; completed lists auto-clear on the next user turn.
|
|
269
271
|
- `skill` — load one installed Markdown workflow or one of its references.
|
|
@@ -273,7 +275,7 @@ Tool calls are grouped in the transcript so you can see what happened without re
|
|
|
273
275
|
|
|
274
276
|
### Optional LSP navigation
|
|
275
277
|
|
|
276
|
-
|
|
278
|
+
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.
|
|
277
279
|
|
|
278
280
|
Example TypeScript setup:
|
|
279
281
|
|
|
@@ -288,25 +290,25 @@ npm install -g typescript typescript-language-server
|
|
|
288
290
|
|
|
289
291
|
## Subagents
|
|
290
292
|
|
|
291
|
-
Subagents are a delegation feature, not another file operation. When a request clearly splits into independent parallel work,
|
|
293
|
+
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.
|
|
292
294
|
|
|
293
295
|
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.
|
|
294
296
|
|
|
295
297
|
## Context files
|
|
296
298
|
|
|
297
|
-
|
|
299
|
+
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, `/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.
|
|
298
300
|
|
|
299
301
|
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
302
|
|
|
301
|
-
Long turns use bounded tool slices. Older successful tool results are compacted while failures and recent evidence remain verbatim, synthetic
|
|
303
|
+
Long turns use bounded tool slices. Older successful tool results are compacted while failures and recent evidence remain verbatim, synthetic haze control nudges are not persisted as user requests, and token-pressure compaction preserves the structured work state.
|
|
302
304
|
|
|
303
|
-
|
|
305
|
+
haze loads project instructions from:
|
|
304
306
|
|
|
305
307
|
- `~/.claude/CLAUDE.md`
|
|
306
308
|
- `~/.haze/AGENTS.md`
|
|
307
309
|
- `CLAUDE.md` / `AGENTS.md` files from filesystem root to the current workspace
|
|
308
310
|
|
|
309
|
-
At the same scope, `AGENTS.md` overrides `CLAUDE.md`; global
|
|
311
|
+
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
312
|
|
|
311
313
|
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.
|
|
312
314
|
|
|
@@ -315,10 +317,10 @@ Use `AGENTS.md` for project conventions, commands, architecture notes, and thing
|
|
|
315
317
|
- File tools are restricted to the current workspace.
|
|
316
318
|
- File tools follow `.gitignore` by default.
|
|
317
319
|
- Ignored files require an explicit override.
|
|
318
|
-
- Bash commands are classified and shown with working-directory metadata, but
|
|
320
|
+
- Bash commands are classified and shown with working-directory metadata, but haze does not use command confirmation gates.
|
|
319
321
|
- 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.
|
|
320
322
|
- Mutating and destructive commands can run when they are relevant to the user's request; this is intentional for expert users.
|
|
321
|
-
-
|
|
323
|
+
- haze is powerful enough to help and dumb enough to deserve supervision. Ideal software, basically.
|
|
322
324
|
|
|
323
325
|
## Local development
|
|
324
326
|
|
|
@@ -15,8 +15,8 @@ const CHAT_COMMAND_SUGGESTIONS = [
|
|
|
15
15
|
{ value: '/new', description: 'Start a new session', kind: 'command' },
|
|
16
16
|
{ value: '/compact ', description: 'Summarize older context and keep recent messages', kind: 'command' },
|
|
17
17
|
{ value: '/clear', description: 'Clear conversation history', kind: 'command' },
|
|
18
|
-
{ value: '/exit', description: 'Exit
|
|
19
|
-
{ value: '/quit', description: 'Exit
|
|
18
|
+
{ value: '/exit', description: 'Exit haze', kind: 'command' },
|
|
19
|
+
{ value: '/quit', description: 'Exit haze', kind: 'command' },
|
|
20
20
|
];
|
|
21
21
|
export function inputSuggestionsForState(state) {
|
|
22
22
|
const { mode, settings, skills } = state;
|
|
@@ -8,5 +8,8 @@ export declare function createSessionRecorder(getSession: () => HazeSession | un
|
|
|
8
8
|
recordConversation(messages: ModelMessage[]): void;
|
|
9
9
|
recordWorkState(state: WorkState): void;
|
|
10
10
|
recordEvent(event: AgentEvent): void;
|
|
11
|
+
recordNamedEvent(name: string, text: string): void;
|
|
12
|
+
flush(): Promise<void>;
|
|
13
|
+
error(): Error | undefined;
|
|
11
14
|
};
|
|
12
15
|
export type SessionRecorder = ReturnType<typeof createSessionRecorder>;
|
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
import { appendSessionEntry } from '../../core/session/sessionStore.js';
|
|
2
|
-
function appendFireAndForget(session, entry) {
|
|
3
|
-
if (session)
|
|
4
|
-
void appendSessionEntry(session, entry).catch(() => undefined);
|
|
5
|
-
}
|
|
6
2
|
export function createSessionRecorder(getSession) {
|
|
3
|
+
let tail = Promise.resolve();
|
|
4
|
+
let firstError;
|
|
5
|
+
const append = (entry) => {
|
|
6
|
+
const session = getSession();
|
|
7
|
+
if (!session)
|
|
8
|
+
return;
|
|
9
|
+
tail = tail.then(() => appendSessionEntry(session, entry)).catch(error => {
|
|
10
|
+
firstError ??= error instanceof Error ? error : new Error(String(error));
|
|
11
|
+
});
|
|
12
|
+
};
|
|
7
13
|
return {
|
|
8
14
|
recordUiMessage(message) {
|
|
9
|
-
|
|
15
|
+
append({ type: 'ui_message', at: new Date().toISOString(), role: message.role, text: message.text });
|
|
10
16
|
},
|
|
11
17
|
recordConversation(messages) {
|
|
12
|
-
|
|
18
|
+
append({ type: 'conversation_snapshot', at: new Date().toISOString(), messages });
|
|
13
19
|
},
|
|
14
20
|
recordWorkState(state) {
|
|
15
|
-
|
|
21
|
+
append({ type: 'work_state_snapshot', at: new Date().toISOString(), state });
|
|
16
22
|
},
|
|
17
23
|
recordEvent(event) {
|
|
18
|
-
|
|
24
|
+
append({ type: 'event', at: event.at, name: event.type, text: JSON.stringify(event) });
|
|
25
|
+
},
|
|
26
|
+
recordNamedEvent(name, text) {
|
|
27
|
+
append({ type: 'event', at: new Date().toISOString(), name, text });
|
|
28
|
+
},
|
|
29
|
+
async flush() {
|
|
30
|
+
await tail;
|
|
31
|
+
if (firstError)
|
|
32
|
+
throw firstError;
|
|
19
33
|
},
|
|
34
|
+
error() { return firstError; },
|
|
20
35
|
};
|
|
21
36
|
}
|