@denizokcu/haze 0.2.0 → 0.4.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 (50) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +38 -22
  3. package/dist/cli/commands/chat.d.ts +1 -1
  4. package/dist/cli/commands/chat.js +411 -74
  5. package/dist/cli/commands/commands.js +122 -54
  6. package/dist/cli/commands/formatters.d.ts +2 -0
  7. package/dist/cli/commands/formatters.js +34 -0
  8. package/dist/cli/commands/streaming.d.ts +36 -1
  9. package/dist/cli/commands/streaming.js +312 -103
  10. package/dist/cli/contextReport.d.ts +1 -0
  11. package/dist/cli/contextReport.js +47 -0
  12. package/dist/config/contextFiles.d.ts +25 -0
  13. package/dist/config/contextFiles.js +53 -0
  14. package/dist/config/providerPresets.d.ts +23 -0
  15. package/dist/config/providerPresets.js +230 -0
  16. package/dist/core/agent/compaction.d.ts +3 -0
  17. package/dist/core/agent/compaction.js +23 -3
  18. package/dist/core/agent/contextBudget.d.ts +33 -0
  19. package/dist/core/agent/contextBudget.js +88 -0
  20. package/dist/core/agent/requestAssembly.d.ts +22 -0
  21. package/dist/core/agent/requestAssembly.js +146 -0
  22. package/dist/core/agent/toolOutputStore.d.ts +11 -0
  23. package/dist/core/agent/toolOutputStore.js +33 -0
  24. package/dist/core/agent/workState.d.ts +38 -0
  25. package/dist/core/agent/workState.js +89 -0
  26. package/dist/core/goal/completionPolicy.js +1 -1
  27. package/dist/core/goal/sessionGoal.d.ts +2 -0
  28. package/dist/core/goal/sessionGoal.js +8 -1
  29. package/dist/core/log/llmLog.d.ts +68 -0
  30. package/dist/core/log/llmLog.js +55 -0
  31. package/dist/core/session/sessionStore.d.ts +6 -0
  32. package/dist/core/session/sessionStore.js +5 -0
  33. package/dist/core/subagent/subagentRunner.d.ts +4 -1
  34. package/dist/core/subagent/subagentRunner.js +5 -15
  35. package/dist/core/tasks/taskStorage.d.ts +13 -0
  36. package/dist/core/tasks/taskStorage.js +29 -0
  37. package/dist/core/validation/outputParser.js +15 -2
  38. package/dist/llm/client.d.ts +39 -0
  39. package/dist/llm/client.js +46 -2
  40. package/dist/llm/hazeTools.d.ts +53 -12
  41. package/dist/llm/hazeTools.js +170 -46
  42. package/dist/llm/systemPrompt.d.ts +6 -1
  43. package/dist/llm/systemPrompt.js +42 -79
  44. package/dist/skills/builder/SkillBuilder.d.ts +16 -2
  45. package/dist/skills/builder/SkillBuilder.js +68 -65
  46. package/dist/skills/skillTools.d.ts +2 -19
  47. package/dist/skills/skillTools.js +28 -19
  48. package/dist/ui/components/TextInput.d.ts +2 -1
  49. package/dist/ui/components/TextInput.js +6 -2
  50. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.4.0 - 2026-06-15
6
+
7
+ ### Skills
8
+
9
+ - 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.
10
+ - 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.
11
+ - Added `toSkillDirName` for kebab-casing user-typed skill names without stop-word stripping (so `"create a skill"` stays `create-a-skill`, not `skill`).
12
+
13
+ ### Commands
14
+
15
+ - 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.
16
+ - Removed the `/list-skills` alias; `/skills` now shows the overview and the installed list.
17
+ - 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`.
18
+ - Removed the `/tasks rm` alias for `/tasks remove`.
19
+ - Refactored `handleSkillCommand` from stringly-typed `value` parsing to a typed `SkillSubcommand` union argument.
20
+
21
+ ### Docs site
22
+
23
+ - 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`.
24
+ - Added §07 "Commands index" — a categorized reference of all 16 slash commands plus the `/<skill-name>` dynamic invocations.
25
+ - Removed §04 "Serviceable procedures" (folded into §02).
26
+ - Renumbered sections sequentially (§01 Operation → §02 Native skill creation → §03 Field behavior → §04 Components → §05 Compatibility → §06 Install → §07 Commands index).
27
+ - Fixed §01 layout: switched from `.container-prose` (narrow, visually centered) to `.container` so it aligns with every other section.
28
+ - Updated all `/create-skill <description>` references to reflect the wizard.
29
+
30
+ ### Internal
31
+
32
+ - Added request-level context accounting, cache/no-cache usage metrics, a debug token breakdown, and an offline `context:report` command.
33
+ - Bounded `readFile`, structured and globally capped `grep`, and compacted large bash output behind paginated `readToolOutput` handles.
34
+ - Added structured `WorkState` snapshots, token-aware compaction, conservative old-tool-result pruning, bounded continuation slices, and no-progress termination for long agent workflows.
35
+ - Made Haze control nudges ephemeral, omitted tool schemas from text-only follow-ups, and replaced duplicated subagent prompting with a concise dedicated prompt.
36
+ - Consolidated installed workflows into one progressive `skill` catalog tool and added provider capability-gated cache keys, sticky session hints, and low-verbosity options.
37
+ - Shortened the model operating contract and final-response guidance while preserving edit recovery, validation evidence, and blocked/partial reporting.
38
+
39
+ ## 0.3.0 - 2026-06-10
40
+
41
+ - Redesigned docs site with cleaner layout, improved typography, better mobile responsiveness, scroll-reveal animations, skip-link accessibility, and refreshed content structure.
42
+ - Moved the task bar above the activity spinner so in-progress and pending tasks are visible during active agent turns.
43
+ - Tasks are now automatically cleared when starting or exiting a session, preventing stale task state across sessions.
44
+ - Renamed internal `TaskBar` component to `TaskBarContent` for clarity.
45
+
5
46
  ## 0.2.0 - 2026-06-07
6
47
 
7
48
  - Improved coding-loop reliability with stronger continuation behavior after failed edits, failed validation, missing validation, tool-budget interruptions, and incomplete assistant responses.
package/README.md CHANGED
@@ -2,17 +2,24 @@
2
2
 
3
3
  A minimal LLM harness for your terminal.
4
4
 
5
- ## What's new in 0.2.0
5
+ ## What's new in 0.4.0
6
6
 
7
- Haze 0.2.0 is a reliability release for the everyday coding loop: inspect, edit, validate, and report what happened without getting timid or noisy.
7
+ Haze 0.4.0 reworks skill creation and simplifies the command surface.
8
8
 
9
- - The agent loop is more persistent after failed edits, failed validation, missing validation, and tool-heavy turns. Haze now pushes toward a concrete final status instead of stopping at a vague recap.
10
- - Bash execution now includes command classification, working directory, duration, timeout state, and parsed validation summaries for common test/typecheck/lint/build output.
11
- - File-tool failures carry structured reason codes and recovery hints, making exact-edit failures easier for the model to repair with a fresh read and targeted retry.
12
- - The system and subagent prompts now assume expert users: relevant commands should run directly, including mutating shell workflows, while blockers are reserved for concrete tool failures or real ambiguity.
13
- - The chat input wraps across multiple visible lines and supports vertical cursor movement, which makes longer prompts and pasted context easier to edit.
9
+ - **3-step skill wizard.** `/create-skill` is now an interactive wizard: name the skill, optionally give it a role, then describe what it does. The model writes the Markdown body. Your typed name and role are used verbatim — no LLM rename.
10
+ - **Language-agnostic intent extraction.** Skill descriptions are interpreted by the model in any language. `"crée une compétence qui vérifie le style du code"` produces a skill that vérifies code style, not a skill about creating one.
11
+ - **Tasks are model-managed.** The `/tasks` slash command is gone. The model tracks multi-step work via the `writeTasks` tool — you talk, it plans. `/clear` still wipes tasks as part of clearing the conversation.
12
+ - **Leaner command surface.** Removed `/list-skills` (folded into `/skills`), the `/skill X` legacy subcommand forms, and the `/tasks rm` alias. Each operation now has exactly one way to be invoked.
13
+ - **Docs site additions.** New §02 segment frames skill creation as the native superpower with copy-pasteable recipe cards; new §07 commands index lists all 16 commands grouped by category. §04 "Serviceable procedures" was removed and sections renumbered sequentially.
14
14
 
15
- The result is a sharper supervised coding loop while keeping the core small and inspectable. Haze gives an AI model transparent local tools — read, search, edit, write, list, and run commands — plus focused delegation when work can split safely. Tiny spell, steadier goblin.
15
+ Previous releases:
16
+
17
+ - **0.3.0** — Docs site redesign, task bar moves above the activity spinner, tasks auto-clear between sessions.
18
+ - **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.
19
+ - **0.1.0** — Bundled ripgrep, subagent delegation, inline diff display.
20
+ - **0.0.3** — Durable sessions, context compaction, provider management.
21
+ - **0.0.2** — Markdown skills, autocomplete, listFiles pagination.
22
+ - **0.0.1** — Initial release.
16
23
 
17
24
  Haze works with OpenAI-compatible providers, including OpenRouter and local endpoints. Use `/provider` to choose or add one, then `/model` to select a model.
18
25
 
@@ -68,7 +75,7 @@ export HAZE_MODEL=anthropic/claude-sonnet-4.6 # or gpt-4.1, llama3.1, qwen2.5-co
68
75
 
69
76
  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.
70
77
 
71
- 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.
78
+ 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.
72
79
 
73
80
  ## Get productive immediately
74
81
 
@@ -86,9 +93,10 @@ Useful starters:
86
93
 
87
94
  ```txt
88
95
  /init
89
- /create-skill review my current branch against main like a senior engineer
90
- /create-skill prepare clean git commits from my uncommitted changes
91
- /create-skill implement small features with tests and a concise summary
96
+ /create-skill # then the wizard asks for name, role, and a description like:
97
+ # "review my current branch against main like a senior engineer"
98
+ # "prepare clean git commits from my uncommitted changes"
99
+ # "implement small features with tests and a concise summary"
92
100
  ```
93
101
 
94
102
  `/init` creates or updates `AGENTS.md` so future sessions understand the project.
@@ -100,7 +108,9 @@ Skills are Markdown workflows that Haze creates with `/create-skill` and stores
100
108
  If you do something for the second time, build a skill for it:
101
109
 
102
110
  ```txt
103
- /create-skill review the diff between my current branch and main, focusing on bugs, tests, DRY and KISS
111
+ /create-skill
112
+ # Wizard: name=branch-diff-review, role="Senior engineer reviewing diffs",
113
+ # description="review the diff between my current branch and main, focusing on bugs, tests, DRY and KISS"
104
114
  ```
105
115
 
106
116
  Haze uses the model to create the skill file for you:
@@ -147,7 +157,7 @@ Installed skills appear as slash commands like:
147
157
  /code-review-diff-main
148
158
  ```
149
159
 
150
- They are also exposed to the model as `skill_*` tools. The skill does not execute code; it gives Haze a workflow to follow.
160
+ 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.
151
161
 
152
162
  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.
153
163
 
@@ -168,8 +178,7 @@ This is the trick: do normal work, notice friction, create a skill, keep going.
168
178
  /clear
169
179
  /exit
170
180
 
171
- /create-skill <description>
172
- /list-skills
181
+ /create-skill
173
182
  /skill-info <name>
174
183
  /validate-skill <name-or-dir>
175
184
  /remove-skill <name> --yes
@@ -190,15 +199,17 @@ haze --no-session # run without durable session storage
190
199
  Haze exposes a deliberately small toolset:
191
200
 
192
201
  - `listFiles` — structured discovery, recursive with cursor pagination when needed.
193
- - `readFile` — read UTF-8 files with optional line ranges.
194
- - `grep` — ripgrep-backed regex search with path, glob, context-line, case, and result-limit controls.
202
+ - `readFile` — read numbered UTF-8 lines in bounded pages, with `nextOffset` when more remain.
203
+ - `grep` — structured ripgrep search with a true global result cap.
195
204
  - `editFile` — unique text replacements, with line-number-prefix tolerance for common model mistakes.
196
205
  - `replaceLines` — line-range edits when exact replacements are awkward; slightly-too-large EOF ranges are clamped.
197
206
  - `writeFile` — create files and parent directories.
198
- - `bash` — run tests, builds, git commands, inspections, scripts, installs, and other shell workflows with command classification metadata.
199
- - `skill_*` — load Markdown skill instructions on demand.
207
+ - `bash` — run tests, builds, git commands, inspections, scripts, installs, and other shell workflows with compact validation output.
208
+ - `readToolOutput` — page through full output omitted from an oversized tool result.
209
+ - `writeTasks` — replace the task list at meaningful phase changes.
210
+ - `skill` — load one installed Markdown workflow or one of its references.
200
211
 
201
- 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 instead of mystery stack traces. Bash validation commands can return parsed summaries with failed files, failed tests, diagnostics, and suggested next steps.
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 output is kept behind an in-memory handle so later model calls carry only a bounded head/tail or validation summary.
202
213
 
203
214
  ## Subagents
204
215
 
@@ -208,7 +219,9 @@ Use them for parallel investigation across separate areas of a codebase. Do not
208
219
 
209
220
  ## Context files
210
221
 
211
- 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 while keeping recent messages.
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.
212
225
 
213
226
  Haze loads project instructions from:
214
227
 
@@ -237,8 +250,11 @@ npm run typecheck
237
250
  npm test
238
251
  npm run lint
239
252
  npm run build
253
+ npm run context:report
240
254
  ```
241
255
 
256
+ `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.
257
+
242
258
  Package check:
243
259
 
244
260
  ```bash
@@ -1,4 +1,4 @@
1
- export type Mode = 'chat' | 'provider' | 'providerAction' | 'model' | 'providerAddName' | 'providerAddUrl' | 'providerAddKey' | 'providerAddModels' | 'providerAppendModels';
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;