@denizokcu/haze 0.3.0 → 0.5.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 +62 -0
- package/README.md +50 -36
- package/dist/cli/commands/chat.d.ts +1 -1
- package/dist/cli/commands/chat.js +244 -94
- package/dist/cli/commands/commands.js +119 -114
- package/dist/cli/commands/streaming.d.ts +37 -5
- package/dist/cli/commands/streaming.js +455 -192
- package/dist/cli/contextReport.d.ts +1 -0
- package/dist/cli/contextReport.js +47 -0
- package/dist/config/contextFiles.d.ts +31 -0
- package/dist/config/contextFiles.js +97 -13
- package/dist/config/providers.d.ts +2 -5
- package/dist/config/providers.js +16 -12
- package/dist/core/agent/compaction.d.ts +3 -0
- package/dist/core/agent/compaction.js +23 -3
- package/dist/core/agent/contextBudget.d.ts +33 -0
- package/dist/core/agent/contextBudget.js +88 -0
- package/dist/core/agent/requestAssembly.d.ts +22 -0
- package/dist/core/agent/requestAssembly.js +157 -0
- package/dist/core/agent/toolOutputStore.d.ts +16 -0
- package/dist/core/agent/toolOutputStore.js +65 -0
- package/dist/core/agent/workState.d.ts +38 -0
- package/dist/core/agent/workState.js +89 -0
- package/dist/core/bashOutput/ansi.d.ts +1 -0
- package/dist/core/bashOutput/ansi.js +7 -0
- package/dist/core/bashOutput/command.d.ts +2 -0
- package/dist/core/bashOutput/command.js +62 -0
- package/dist/core/bashOutput/lineFilter.d.ts +25 -0
- package/dist/core/bashOutput/lineFilter.js +62 -0
- package/dist/core/bashOutput/reducers/content.d.ts +3 -0
- package/dist/core/bashOutput/reducers/content.js +134 -0
- package/dist/core/bashOutput/reducers/git.d.ts +1 -0
- package/dist/core/bashOutput/reducers/git.js +147 -0
- package/dist/core/bashOutput/reducers/search.d.ts +7 -0
- package/dist/core/bashOutput/reducers/search.js +76 -0
- package/dist/core/bashOutput/reducers/validation.d.ts +2 -0
- package/dist/core/bashOutput/reducers/validation.js +41 -0
- package/dist/core/bashOutput/registry.d.ts +4 -0
- package/dist/core/bashOutput/registry.js +126 -0
- package/dist/core/bashOutput/types.d.ts +46 -0
- package/dist/core/bashOutput/types.js +1 -0
- package/dist/core/goal/completionPolicy.d.ts +1 -0
- package/dist/core/goal/completionPolicy.js +5 -1
- package/dist/core/goal/sessionGoal.d.ts +2 -0
- package/dist/core/goal/sessionGoal.js +8 -1
- package/dist/core/log/llmLog.d.ts +68 -0
- package/dist/core/log/llmLog.js +55 -0
- package/dist/core/safety/urlGuard.d.ts +37 -0
- package/dist/core/safety/urlGuard.js +206 -0
- package/dist/core/session/sessionStore.d.ts +6 -0
- package/dist/core/session/sessionStore.js +5 -0
- package/dist/core/subagent/subagentRunner.d.ts +4 -1
- package/dist/core/subagent/subagentRunner.js +5 -15
- package/dist/core/toolOutput/reduction.d.ts +25 -0
- package/dist/core/toolOutput/reduction.js +23 -0
- package/dist/core/validation/outputParser.js +15 -2
- package/dist/llm/client.d.ts +40 -1
- package/dist/llm/client.js +51 -5
- package/dist/llm/hazeTools.d.ts +165 -23
- package/dist/llm/hazeTools.js +317 -65
- package/dist/llm/initPrompt.js +2 -1
- package/dist/llm/systemPrompt.d.ts +6 -1
- package/dist/llm/systemPrompt.js +44 -81
- package/dist/llm/toolResultTypes.d.ts +1 -1
- package/dist/llm/webFetch.d.ts +57 -0
- package/dist/llm/webFetch.js +270 -0
- package/dist/skills/builder/SkillBuilder.d.ts +16 -2
- package/dist/skills/builder/SkillBuilder.js +68 -65
- package/dist/skills/skillTools.d.ts +2 -19
- package/dist/skills/skillTools.js +28 -19
- package/dist/ui/components/MarkdownText.d.ts +2 -0
- package/dist/ui/components/MarkdownText.js +116 -3
- package/package.json +18 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Nothing yet.
|
|
6
|
+
|
|
7
|
+
## 0.5.0 - 2026-06-19
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- 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.
|
|
12
|
+
- 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.
|
|
13
|
+
- 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.
|
|
14
|
+
- `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.
|
|
15
|
+
- 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.
|
|
16
|
+
- 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.
|
|
17
|
+
- Consecutive assistant messages in one turn now share a single visible `haze` header for a less noisy transcript.
|
|
18
|
+
- 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.
|
|
19
|
+
- Context loading now includes global `~/.claude/CLAUDE.md` while keeping `~/.haze/AGENTS.md` higher priority for Haze-specific global guidance.
|
|
20
|
+
- 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.
|
|
21
|
+
- 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.
|
|
22
|
+
- `/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.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- `fetch` tool: read public URLs as readable content (Markdown for HTML, pretty JSON for JSON, passthrough text), with SSRF protection (scheme allowlist + private/loopback/link-local/metadata blocking, re-validated per redirect and after DNS resolution), a 2 MB raw-download cap, and a 30 s timeout. Oversize output stays retrievable via `readToolOutput`. HTML→Markdown extraction uses `defuddle` (readability-grade, pure-JS DOM).
|
|
27
|
+
- Shared tool-output reduction metadata (`reducerName`, `contentKind`, `lossy`, `parseTier`, token/character savings, handles, omitted counts) for reduced tool results.
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- Removed obsolete token-efficiency planning documents and the unused alternate docs-site HTML file from `docs/`.
|
|
32
|
+
|
|
33
|
+
## 0.4.0 - 2026-06-15
|
|
34
|
+
|
|
35
|
+
### Skills
|
|
36
|
+
|
|
37
|
+
- 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.
|
|
38
|
+
- 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.
|
|
39
|
+
- Added `toSkillDirName` for kebab-casing user-typed skill names without stop-word stripping (so `"create a skill"` stays `create-a-skill`, not `skill`).
|
|
40
|
+
|
|
41
|
+
### Commands
|
|
42
|
+
|
|
43
|
+
- 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.
|
|
44
|
+
- Removed the `/list-skills` alias; `/skills` now shows the overview and the installed list.
|
|
45
|
+
- 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`.
|
|
46
|
+
- Removed the `/tasks rm` alias for `/tasks remove`.
|
|
47
|
+
- Refactored `handleSkillCommand` from stringly-typed `value` parsing to a typed `SkillSubcommand` union argument.
|
|
48
|
+
|
|
49
|
+
### Docs site
|
|
50
|
+
|
|
51
|
+
- 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`.
|
|
52
|
+
- Added §07 "Commands index" — a categorized reference of all 16 slash commands plus the `/<skill-name>` dynamic invocations.
|
|
53
|
+
- Removed §04 "Serviceable procedures" (folded into §02).
|
|
54
|
+
- Renumbered sections sequentially (§01 Operation → §02 Native skill creation → §03 Field behavior → §04 Components → §05 Compatibility → §06 Install → §07 Commands index).
|
|
55
|
+
- Fixed §01 layout: switched from `.container-prose` (narrow, visually centered) to `.container` so it aligns with every other section.
|
|
56
|
+
- Updated all `/create-skill <description>` references to reflect the wizard.
|
|
57
|
+
|
|
58
|
+
### Internal
|
|
59
|
+
|
|
60
|
+
- Added request-level context accounting, cache/no-cache usage metrics, a debug token breakdown, and an offline `context:report` command.
|
|
61
|
+
- Bounded `readFile`, structured and globally capped `grep`, and compacted large bash output behind paginated `readToolOutput` handles.
|
|
62
|
+
- Added structured `WorkState` snapshots, token-aware compaction, conservative old-tool-result pruning, bounded continuation slices, and no-progress termination for long agent workflows.
|
|
63
|
+
- Made Haze control nudges ephemeral, omitted tool schemas from text-only follow-ups, and replaced duplicated subagent prompting with a concise dedicated prompt.
|
|
64
|
+
- Consolidated installed workflows into one progressive `skill` catalog tool and added provider capability-gated cache keys, sticky session hints, and low-verbosity options.
|
|
65
|
+
- Shortened the model operating contract and final-response guidance while preserving edit recovery, validation evidence, and blocked/partial reporting.
|
|
66
|
+
|
|
5
67
|
## 0.3.0 - 2026-06-10
|
|
6
68
|
|
|
7
69
|
- Redesigned docs site with cleaner layout, improved typography, better mobile responsiveness, scroll-reveal animations, skip-link accessibility, and refreshed content structure.
|
package/README.md
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
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.5.0
|
|
6
6
|
|
|
7
|
-
Haze 0.
|
|
7
|
+
Haze 0.5.0 adds web fetching, scoped project instructions, debug-only detailed logs, and quieter long-running transcripts.
|
|
8
8
|
|
|
9
|
-
- The
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- **Fetch public URLs.** The new `fetch` tool reads public HTTP(S) pages as Markdown, JSON, or text, with SSRF protections, redirects re-checked, bounded downloads, and oversize output retrievable via `readToolOutput`.
|
|
10
|
+
- **No provider env vars.** `OPENAI_API_KEY`, `OPENAI_BASE_URL`, `HAZE_MODEL`, and `HAZE_CONTEXT_BUDGET_SHARE` are no longer read. Configure providers, models, keys, and base URLs through `/provider`, `/model`, `/settings`, and `~/.haze/settings.json`.
|
|
11
|
+
- **Debug-only LLM logs.** Detailed JSONL LLM logging is now off by default and only starts with `haze --debug`. `/logs` can still review historical logs.
|
|
12
|
+
- **Quieter tool output.** Bash, git, search, JSON, diff, and log output are reduced before they enter model context, with raw output available through `readToolOutput` when needed.
|
|
13
|
+
- **Cleaner terminal rendering.** Assistant Markdown now renders headings, lists, code fences with syntax highlighting, blockquotes, links, emphasis, and wrapped tables in the CLI.
|
|
14
|
+
- **Cleaner transcripts.** Consecutive assistant messages in one turn share one visible `haze` header, live tool groups use compact elapsed-time summaries, and repeated identical tool calls are steered back to the model instead of aborting immediately.
|
|
15
|
+
- **Scoped instructions.** Haze reads global `~/.claude/CLAUDE.md` plus Haze/project `AGENTS.md` files, and discovers nested `CLAUDE.md`/`AGENTS.md` files only when tools enter their subtree.
|
|
16
|
+
- **Less stale state.** Completed task lists clear automatically on the next user turn, and `/init` now guides `AGENTS.md` toward the context-file budget.
|
|
12
17
|
|
|
13
18
|
Previous releases:
|
|
14
19
|
|
|
20
|
+
- **0.4.0** — 3-step skill wizard, language-agnostic skill intent extraction, model-managed tasks, leaner command surface, docs site additions.
|
|
21
|
+
- **0.3.0** — Docs site redesign, task bar moves above the activity spinner, tasks auto-clear between sessions.
|
|
15
22
|
- **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.
|
|
16
23
|
- **0.1.0** — Bundled ripgrep, subagent delegation, inline diff display.
|
|
17
24
|
- **0.0.3** — Durable sessions, context compaction, provider management.
|
|
@@ -61,18 +68,9 @@ On first run, create or choose a provider, then choose your first model:
|
|
|
61
68
|
/model local:llama3.1
|
|
62
69
|
```
|
|
63
70
|
|
|
64
|
-
|
|
71
|
+
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.
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
# e.g. OpenRouter, OpenAI, LM Studio, Ollama, or an OpenAI-compatible proxy
|
|
68
|
-
export OPENAI_API_KEY=... # provider API key, if needed; local providers may not need one
|
|
69
|
-
export OPENAI_BASE_URL=https://openrouter.ai/api/v1 # or http://localhost:1234/v1, http://localhost:11434/v1, ...
|
|
70
|
-
export HAZE_MODEL=anthropic/claude-sonnet-4.6 # or gpt-4.1, llama3.1, qwen2.5-coder, ...
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
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.
|
|
74
|
-
|
|
75
|
-
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 `/create-skill <description>`. 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.
|
|
73
|
+
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 `/create-skill` (a 3-step wizard: name, role, description). 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.
|
|
76
74
|
|
|
77
75
|
## Get productive immediately
|
|
78
76
|
|
|
@@ -82,7 +80,7 @@ Open a project and ask for work:
|
|
|
82
80
|
create a calculator in calc-app in ruby with add subtract multiply divide
|
|
83
81
|
```
|
|
84
82
|
|
|
85
|
-
Haze will inspect, search, write files, 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
|
|
83
|
+
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`.
|
|
86
84
|
|
|
87
85
|
Use `/` to discover commands and skills. `Tab` completes the top suggestion.
|
|
88
86
|
|
|
@@ -90,9 +88,10 @@ Useful starters:
|
|
|
90
88
|
|
|
91
89
|
```txt
|
|
92
90
|
/init
|
|
93
|
-
/create-skill
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
/create-skill # then the wizard asks for name, role, and a description like:
|
|
92
|
+
# "review my current branch against main like a senior engineer"
|
|
93
|
+
# "prepare clean git commits from my uncommitted changes"
|
|
94
|
+
# "implement small features with tests and a concise summary"
|
|
96
95
|
```
|
|
97
96
|
|
|
98
97
|
`/init` creates or updates `AGENTS.md` so future sessions understand the project.
|
|
@@ -104,7 +103,9 @@ Skills are Markdown workflows that Haze creates with `/create-skill` and stores
|
|
|
104
103
|
If you do something for the second time, build a skill for it:
|
|
105
104
|
|
|
106
105
|
```txt
|
|
107
|
-
/create-skill
|
|
106
|
+
/create-skill
|
|
107
|
+
# Wizard: name=branch-diff-review, role="Senior engineer reviewing diffs",
|
|
108
|
+
# description="review the diff between my current branch and main, focusing on bugs, tests, DRY and KISS"
|
|
108
109
|
```
|
|
109
110
|
|
|
110
111
|
Haze uses the model to create the skill file for you:
|
|
@@ -151,7 +152,7 @@ Installed skills appear as slash commands like:
|
|
|
151
152
|
/code-review-diff-main
|
|
152
153
|
```
|
|
153
154
|
|
|
154
|
-
They are also
|
|
155
|
+
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.
|
|
155
156
|
|
|
156
157
|
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.
|
|
157
158
|
|
|
@@ -164,6 +165,7 @@ This is the trick: do normal work, notice friction, create a skill, keep going.
|
|
|
164
165
|
/model <name-or-provider:name>
|
|
165
166
|
/model list
|
|
166
167
|
/settings
|
|
168
|
+
/logs [id]
|
|
167
169
|
/init
|
|
168
170
|
/session
|
|
169
171
|
/resume
|
|
@@ -172,37 +174,42 @@ This is the trick: do normal work, notice friction, create a skill, keep going.
|
|
|
172
174
|
/clear
|
|
173
175
|
/exit
|
|
174
176
|
|
|
175
|
-
/
|
|
176
|
-
/
|
|
177
|
+
/skills
|
|
178
|
+
/create-skill
|
|
177
179
|
/skill-info <name>
|
|
178
180
|
/validate-skill <name-or-dir>
|
|
179
181
|
/remove-skill <name> --yes
|
|
180
182
|
```
|
|
181
183
|
|
|
182
|
-
|
|
184
|
+
Older `/skill <subcommand>` and `/skills <subcommand>` routing forms were removed; use the direct skill commands above.
|
|
183
185
|
|
|
184
186
|
CLI flags:
|
|
185
187
|
|
|
186
188
|
```bash
|
|
187
|
-
haze --debug # show model/tool debug logs
|
|
189
|
+
haze --debug # show model/tool debug logs and write detailed JSONL logs to ~/.haze/logs
|
|
188
190
|
haze --continue # resume the latest saved session for this workspace
|
|
189
191
|
haze --no-session # run without durable session storage
|
|
190
192
|
```
|
|
191
193
|
|
|
194
|
+
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.
|
|
195
|
+
|
|
192
196
|
## Agent tools
|
|
193
197
|
|
|
194
198
|
Haze exposes a deliberately small toolset:
|
|
195
199
|
|
|
196
200
|
- `listFiles` — structured discovery, recursive with cursor pagination when needed.
|
|
197
|
-
- `readFile` — read UTF-8
|
|
198
|
-
- `grep` — ripgrep
|
|
201
|
+
- `readFile` — read numbered UTF-8 lines in bounded pages, with `nextOffset` when more remain.
|
|
202
|
+
- `grep` — structured ripgrep search with a true global result cap and compacted long lines/results.
|
|
199
203
|
- `editFile` — unique text replacements, with line-number-prefix tolerance for common model mistakes.
|
|
200
204
|
- `replaceLines` — line-range edits when exact replacements are awkward; slightly-too-large EOF ranges are clamped.
|
|
201
205
|
- `writeFile` — create files and parent directories.
|
|
202
|
-
- `bash` — run tests, builds, git commands, inspections, scripts, installs, and other shell workflows with command
|
|
203
|
-
- `
|
|
206
|
+
- `bash` — run tests, builds, git commands, inspections, scripts, installs, and other shell workflows with command-aware output reduction and compact validation output.
|
|
207
|
+
- `readToolOutput` — page through full/raw output omitted from an oversized or reduced tool result.
|
|
208
|
+
- `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`.
|
|
209
|
+
- `writeTasks` — replace the task list at meaningful phase changes; completed lists auto-clear on the next user turn.
|
|
210
|
+
- `skill` — load one installed Markdown workflow or one of its references.
|
|
204
211
|
|
|
205
|
-
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
|
|
212
|
+
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.
|
|
206
213
|
|
|
207
214
|
## Subagents
|
|
208
215
|
|
|
@@ -212,16 +219,19 @@ Use them for parallel investigation across separate areas of a codebase. Do not
|
|
|
212
219
|
|
|
213
220
|
## Context files
|
|
214
221
|
|
|
215
|
-
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
|
|
222
|
+
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.
|
|
223
|
+
|
|
224
|
+
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.
|
|
216
225
|
|
|
217
226
|
Haze loads project instructions from:
|
|
218
227
|
|
|
228
|
+
- `~/.claude/CLAUDE.md`
|
|
219
229
|
- `~/.haze/AGENTS.md`
|
|
220
|
-
-
|
|
221
|
-
- `AGENTS.md` files from filesystem root to the current workspace
|
|
222
|
-
- `CLAUDE.md` files from filesystem root to the current workspace
|
|
230
|
+
- `CLAUDE.md` / `AGENTS.md` files from filesystem root to the current workspace
|
|
223
231
|
|
|
224
|
-
|
|
232
|
+
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, and mutating tools stop once so the model can review newly discovered scoped instructions before editing.
|
|
233
|
+
|
|
234
|
+
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.
|
|
225
235
|
|
|
226
236
|
## Safety model
|
|
227
237
|
|
|
@@ -229,6 +239,7 @@ Use `AGENTS.md` for project conventions, commands, architecture notes, and thing
|
|
|
229
239
|
- File tools follow `.gitignore` by default.
|
|
230
240
|
- Ignored files require an explicit override.
|
|
231
241
|
- Bash commands are classified and shown with working-directory metadata, but Haze does not use command confirmation gates.
|
|
242
|
+
- The `fetch` tool reads public `http(s)` URLs only; private, loopback, link-local, and cloud-metadata hosts and non-`http(s)` schemes are blocked, re-checked on every redirect and after DNS resolution.
|
|
232
243
|
- Mutating and destructive commands can run when they are relevant to the user's request; this is intentional for expert users.
|
|
233
244
|
- Haze is powerful enough to help and dumb enough to deserve supervision. Ideal software, basically.
|
|
234
245
|
|
|
@@ -241,8 +252,11 @@ npm run typecheck
|
|
|
241
252
|
npm test
|
|
242
253
|
npm run lint
|
|
243
254
|
npm run build
|
|
255
|
+
npm run context:report
|
|
244
256
|
```
|
|
245
257
|
|
|
258
|
+
`npm run context:report` prints estimated system, project-context, and tool-schema tokens without reading `~/.haze`. Pass explicit context-file paths, or use `npm run context:report -- --trace tests/fixtures/agent-traces/long-workflow.json` for offline trace accounting.
|
|
259
|
+
|
|
246
260
|
Package check:
|
|
247
261
|
|
|
248
262
|
```bash
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Mode = 'chat' | 'provider' | 'providerAction' | 'model' | 'providerAddPreset' | 'providerAddName' | 'providerAddUrl' | 'providerAddKey' | 'providerAddModels' | 'providerAppendModels' | 'providerSetKey' | 'providerRemoveModels' | 'providerConfirmRemove';
|
|
1
|
+
export type Mode = 'chat' | 'provider' | 'providerAction' | 'model' | 'providerAddPreset' | 'providerAddName' | 'providerAddUrl' | 'providerAddKey' | 'providerAddModels' | 'providerAppendModels' | 'providerSetKey' | 'providerRemoveModels' | 'providerConfirmRemove' | 'skillCreateName' | 'skillCreateRole' | 'skillCreateDescription';
|
|
2
2
|
interface ChatOptions {
|
|
3
3
|
debug?: boolean;
|
|
4
4
|
version?: string;
|