@denizokcu/haze 0.7.0 → 0.8.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 +24 -8
- package/README.md +31 -31
- package/dist/cli/chat/inputSuggestions.js +2 -2
- package/dist/cli/commands/chat.js +46 -20
- package/dist/cli/commands/chatModes.js +1 -1
- package/dist/cli/commands/commandHelp.js +2 -2
- package/dist/cli/commands/formatters.d.ts +6 -0
- package/dist/cli/commands/formatters.js +38 -0
- package/dist/cli/commands/streaming.js +34 -23
- package/dist/cli/commands/wizardSuggestions.js +1 -1
- package/dist/config/providers.js +5 -9
- package/dist/config/settings.d.ts +1 -0
- package/dist/config/settings.js +54 -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/bashOutput/registry.js +11 -9
- package/dist/core/goal/completionPolicy.js +1 -1
- package/dist/core/subagent/subagentRunner.d.ts +252 -9
- package/dist/core/subagent/subagentRunner.js +13 -18
- 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 +15 -2
- package/dist/llm/hazeTools.d.ts +7709 -364
- package/dist/llm/hazeTools.js +7 -1
- package/dist/llm/initPrompt.js +1 -1
- package/dist/llm/lsp.js +10 -1
- package/dist/llm/lspTools.d.ts +2310 -101
- package/dist/llm/systemPrompt.js +2 -2
- package/dist/llm/tools/bashTool.d.ts +251 -5
- package/dist/llm/tools/bashTool.js +4 -3
- package/dist/llm/tools/fetchTool.d.ts +1201 -65
- package/dist/llm/tools/fetchTool.js +2 -1
- 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/builder/SkillBuilder.js +7 -7
- 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/examples/skills/files/SKILL.md +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.8.0 - 2026-07-09
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
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.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fixed multiline input shortcut handling in the chat input.
|
|
18
|
+
- Kept model thinking labels concise without hiding useful slash-model suffixes such as reasoning variants.
|
|
19
|
+
- Compacted long file paths in live tool labels so the busy line stays readable.
|
|
20
|
+
|
|
5
21
|
## 0.7.0 - 2026-06-29
|
|
6
22
|
|
|
7
23
|
### Added
|
|
8
24
|
|
|
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
|
|
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.
|
|
10
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.
|
|
11
27
|
|
|
12
28
|
### Changed
|
|
@@ -23,7 +39,7 @@
|
|
|
23
39
|
|
|
24
40
|
### Added
|
|
25
41
|
|
|
26
|
-
- **MCP server support.**
|
|
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.
|
|
27
43
|
- Added optional configurable stdio LSP support through `/lsp`, with TypeScript, Rust, Python, Go, and PHP presets.
|
|
28
44
|
- 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
45
|
- Added `/context`, a token breakdown of the current request (system prompt, project context, tools including MCP, and chat messages).
|
|
@@ -34,7 +50,7 @@
|
|
|
34
50
|
|
|
35
51
|
- Switched the main agent turn to the AI SDK v6 `ToolLoopAgent` abstraction while preserving compact terminal tool/text rendering and key loop guardrails.
|
|
36
52
|
- 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
|
|
53
|
+
- Added LSP-aware prompt guidance only when LSP tools are actually available; otherwise haze naturally falls back to `grep`, `listFiles`, and `readFile`.
|
|
38
54
|
- 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
55
|
- 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
56
|
- Updated README, docs site, and project agent guidance for LSP setup and the 0.6.0 release.
|
|
@@ -44,16 +60,16 @@
|
|
|
44
60
|
### Changed
|
|
45
61
|
|
|
46
62
|
- 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
|
|
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.
|
|
48
64
|
- 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
65
|
- `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
66
|
- 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
67
|
- 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
68
|
- Consecutive assistant messages in one turn now share a single visible `haze` header for a less noisy transcript.
|
|
53
69
|
- 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
|
|
70
|
+
- Context loading now includes global `~/.claude/CLAUDE.md` while keeping `~/.haze/AGENTS.md` higher priority for haze-specific global guidance.
|
|
55
71
|
- 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
|
|
72
|
+
- 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
73
|
- `/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
74
|
|
|
59
75
|
### Added
|
|
@@ -95,7 +111,7 @@
|
|
|
95
111
|
- Added request-level context accounting, cache/no-cache usage metrics, a debug token breakdown, and an offline `context:report` command.
|
|
96
112
|
- Bounded `readFile`, structured and globally capped `grep`, and compacted large bash output behind paginated `readToolOutput` handles.
|
|
97
113
|
- 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
|
|
114
|
+
- Made haze control nudges ephemeral, omitted tool schemas from text-only follow-ups, and replaced duplicated subagent prompting with a concise dedicated prompt.
|
|
99
115
|
- Consolidated installed workflows into one progressive `skill` catalog tool and added provider capability-gated cache keys, sticky session hints, and low-verbosity options.
|
|
100
116
|
- Shortened the model operating contract and final-response guidance while preserving edit recovery, validation evidence, and blocked/partial reporting.
|
|
101
117
|
|
|
@@ -114,7 +130,7 @@
|
|
|
114
130
|
- 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
131
|
- Reworked the system prompt, subagent prompt, compaction prompt, and generated-skill guidance around autonomous expert developer workflows with concise final status reporting.
|
|
116
132
|
- 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;
|
|
133
|
+
- 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
134
|
- Improved chat input editing with wrapped multi-line display, vertical cursor movement across wrapped lines, and better cursor mapping for compacted paste blocks.
|
|
119
135
|
- Added and updated tests for bash classification, bash execution behavior, validation parsing, edit recovery, system-prompt guidance, and skill generation.
|
|
120
136
|
|
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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.8.0
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
haze 0.8.0 focuses on runtime reliability and clearer terminal feedback while staying compact and low-friction.
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **Startup context visibility.** The opening system message now lists which context files were sent with the system prompt, making global/project instruction loading easier to verify.
|
|
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`.
|
|
14
13
|
|
|
15
14
|
Previous releases:
|
|
16
15
|
|
|
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
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
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
19
|
- **0.4.0** — 3-step skill wizard, language-agnostic skill intent extraction, model-managed tasks, leaner command surface, docs site additions.
|
|
@@ -24,7 +24,7 @@ Previous releases:
|
|
|
24
24
|
- **0.0.2** — Markdown skills, autocomplete, listFiles pagination.
|
|
25
25
|
- **0.0.1** — Initial release.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
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
28
|
|
|
29
29
|
```txt
|
|
30
30
|
_
|
|
@@ -35,17 +35,17 @@ Haze works with OpenAI-compatible providers, including OpenRouter and local endp
|
|
|
35
35
|
|_| |_|\__,_/___\___|
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
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.
|
|
39
39
|
|
|
40
40
|
## Getting started
|
|
41
41
|
|
|
42
|
-
Install
|
|
42
|
+
Install haze:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
npm install -g @denizokcu/haze
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
Open
|
|
48
|
+
Open haze from your project:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
51
|
$ haze
|
|
@@ -58,9 +58,9 @@ On first run, create or choose a provider, then choose your first model:
|
|
|
58
58
|
/model
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
`/provider` opens provider setup for any OpenAI-compatible endpoint — e.g. OpenRouter, OpenAI, LM Studio, Ollama, or a proxy.
|
|
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.
|
|
62
62
|
|
|
63
|
-
`/model` selects the model
|
|
63
|
+
`/model` selects the model haze should use. You can also set one directly:
|
|
64
64
|
|
|
65
65
|
```txt
|
|
66
66
|
/model anthropic/claude-sonnet-4.6
|
|
@@ -80,9 +80,9 @@ Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io)
|
|
|
80
80
|
|
|
81
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.
|
|
82
82
|
|
|
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
|
|
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.
|
|
84
84
|
|
|
85
|
-
|
|
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.
|
|
86
86
|
|
|
87
87
|
## Get productive immediately
|
|
88
88
|
|
|
@@ -92,7 +92,7 @@ Open a project and ask for work:
|
|
|
92
92
|
create a calculator in calc-app in ruby with add subtract multiply divide
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
|
|
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`.
|
|
96
96
|
|
|
97
97
|
Use `/` to discover commands and skills. `Tab` completes the top suggestion.
|
|
98
98
|
|
|
@@ -110,7 +110,7 @@ Useful starters:
|
|
|
110
110
|
|
|
111
111
|
## Skills: your workflows, grown while working
|
|
112
112
|
|
|
113
|
-
Skills are Markdown workflows that
|
|
113
|
+
Skills are Markdown workflows that haze creates with `/skills` and stores in `~/.haze/skills` so you can inspect or refine them later.
|
|
114
114
|
|
|
115
115
|
If you do something for the second time, build a skill for it:
|
|
116
116
|
|
|
@@ -121,7 +121,7 @@ If you do something for the second time, build a skill for it:
|
|
|
121
121
|
# Description: review the diff between my current branch and main, focusing on bugs, tests, DRY and KISS
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
haze uses the model to create the skill file for you:
|
|
125
125
|
|
|
126
126
|
```txt
|
|
127
127
|
~/.haze/skills/<skill-name>/SKILL.md
|
|
@@ -165,7 +165,7 @@ Installed skills appear as slash commands like:
|
|
|
165
165
|
/code-review-diff-main
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
They are also available through one `skill` catalog tool.
|
|
168
|
+
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
169
|
|
|
170
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.
|
|
171
171
|
|
|
@@ -248,13 +248,13 @@ The `status` field is authoritative (driven by the agent's terminal state, not b
|
|
|
248
248
|
{"type":"result","status":"complete","result":"Here are the findings…","usage":{"inputTokens":0,"outputTokens":0,"cacheReadTokens":0,"cacheWriteTokens":0,"reasoningTokens":0}}
|
|
249
249
|
```
|
|
250
250
|
|
|
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
|
|
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.
|
|
252
252
|
|
|
253
|
-
By default,
|
|
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.
|
|
254
254
|
|
|
255
255
|
## Agent tools
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
haze exposes a deliberately small toolset:
|
|
258
258
|
|
|
259
259
|
- `listFiles` — structured discovery, recursive with cursor pagination when needed.
|
|
260
260
|
- `readFile` — read numbered UTF-8 lines in bounded pages, with `nextOffset` when more remain.
|
|
@@ -273,7 +273,7 @@ Tool calls are grouped in the transcript so you can see what happened without re
|
|
|
273
273
|
|
|
274
274
|
### Optional LSP navigation
|
|
275
275
|
|
|
276
|
-
|
|
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.
|
|
277
277
|
|
|
278
278
|
Example TypeScript setup:
|
|
279
279
|
|
|
@@ -288,25 +288,25 @@ npm install -g typescript typescript-language-server
|
|
|
288
288
|
|
|
289
289
|
## Subagents
|
|
290
290
|
|
|
291
|
-
Subagents are a delegation feature, not another file operation. When a request clearly splits into independent parallel work,
|
|
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.
|
|
292
292
|
|
|
293
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.
|
|
294
294
|
|
|
295
295
|
## Context files
|
|
296
296
|
|
|
297
|
-
|
|
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.
|
|
298
298
|
|
|
299
299
|
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
300
|
|
|
301
|
-
Long turns use bounded tool slices. Older successful tool results are compacted while failures and recent evidence remain verbatim, synthetic
|
|
301
|
+
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
302
|
|
|
303
|
-
|
|
303
|
+
haze loads project instructions from:
|
|
304
304
|
|
|
305
305
|
- `~/.claude/CLAUDE.md`
|
|
306
306
|
- `~/.haze/AGENTS.md`
|
|
307
307
|
- `CLAUDE.md` / `AGENTS.md` files from filesystem root to the current workspace
|
|
308
308
|
|
|
309
|
-
At the same scope, `AGENTS.md` overrides `CLAUDE.md`; global
|
|
309
|
+
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
310
|
|
|
311
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.
|
|
312
312
|
|
|
@@ -315,10 +315,10 @@ Use `AGENTS.md` for project conventions, commands, architecture notes, and thing
|
|
|
315
315
|
- File tools are restricted to the current workspace.
|
|
316
316
|
- File tools follow `.gitignore` by default.
|
|
317
317
|
- Ignored files require an explicit override.
|
|
318
|
-
- Bash commands are classified and shown with working-directory metadata, but
|
|
318
|
+
- Bash commands are classified and shown with working-directory metadata, but haze does not use command confirmation gates.
|
|
319
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.
|
|
320
320
|
- Mutating and destructive commands can run when they are relevant to the user's request; this is intentional for expert users.
|
|
321
|
-
-
|
|
321
|
+
- haze is powerful enough to help and dumb enough to deserve supervision. Ideal software, basically.
|
|
322
322
|
|
|
323
323
|
## Local development
|
|
324
324
|
|
|
@@ -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;
|
|
@@ -19,7 +19,7 @@ import { TextInput } from '../../ui/components/TextInput.js';
|
|
|
19
19
|
import { theme } from '../../ui/theme.js';
|
|
20
20
|
import { handleSlashCommand } from './commands.js';
|
|
21
21
|
import { runAgentTurn } from './streaming.js';
|
|
22
|
-
import { formatContextReport } from './formatters.js';
|
|
22
|
+
import { formatContextReport, formatElapsedTimeWhole } from './formatters.js';
|
|
23
23
|
import { createLog as createLlmLog, endLog as endLlmLog } from '../../core/log/llmLog.js';
|
|
24
24
|
import { loadSkillRegistry } from '../../skills/SkillRegistry.js';
|
|
25
25
|
import { createSkill, toSkillDirName } from '../../skills/builder/SkillBuilder.js';
|
|
@@ -40,6 +40,7 @@ import { compactHomePath, displayMessagesFromConversation, estimateConversationT
|
|
|
40
40
|
import { accumulateTokenUsage, EMPTY_TOKEN_USAGE, shouldClearCompletedTasks } from '../chat/turnState.js';
|
|
41
41
|
import { MASKED_MODES, PICKER_MODES, SUBMIT_EMPTY_MODES, placeholderForMode } from './chatModes.js';
|
|
42
42
|
import { inputSuggestionsForState } from '../chat/inputSuggestions.js';
|
|
43
|
+
import { modelThinkingLabel } from '../../utils/modelName.js';
|
|
43
44
|
import { PROVIDER_ACTIONS, PROVIDER_CHOICES, SERVER_CHOICES } from './wizardActions.js';
|
|
44
45
|
import { captureLspName, captureMcpCommand, captureMcpName, captureMcpTransport, captureMcpUrl, captureProviderName, captureProviderUrl } from './wizardPrompts.js';
|
|
45
46
|
import { finishLspCustomResult, selectLspActionResult, selectLspPresetResult, selectLspServerResult } from './lspWizard.js';
|
|
@@ -59,6 +60,16 @@ async function currentBranchName() {
|
|
|
59
60
|
return undefined;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
63
|
+
/** Elapsed-time label for the busy indicator heartbeat, or '' when no turn is active. */
|
|
64
|
+
function busyElapsedLabel(startedAt) {
|
|
65
|
+
if (startedAt == null)
|
|
66
|
+
return '';
|
|
67
|
+
const elapsed = Date.now() - startedAt;
|
|
68
|
+
return elapsed > 0 ? formatElapsedTimeWhole(elapsed) : '';
|
|
69
|
+
}
|
|
70
|
+
function thinkingLabelForSettings(settings) {
|
|
71
|
+
return modelThinkingLabel(activeModel(settings)?.model);
|
|
72
|
+
}
|
|
62
73
|
function ChatScreen({ debug = false, version, continueSession = false, noSession = false }) {
|
|
63
74
|
const { exit } = useApp();
|
|
64
75
|
const { stdout } = useStdout();
|
|
@@ -71,7 +82,7 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
71
82
|
};
|
|
72
83
|
const withDisplayOrders = (next) => next.map(withDisplayOrder);
|
|
73
84
|
const [messages, setMessagesRaw] = useState([
|
|
74
|
-
{ role: 'system', text: 'Welcome to
|
|
85
|
+
{ role: 'system', text: 'Welcome to haze. Use /help for commands.', displayOrder: 0 }
|
|
75
86
|
]);
|
|
76
87
|
const setMessages = (updater) => {
|
|
77
88
|
setMessagesRaw(previous => withDisplayOrders(typeof updater === 'function' ? updater(previous) : updater));
|
|
@@ -100,12 +111,15 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
100
111
|
const [contextFiles, setContextFiles] = useState([]);
|
|
101
112
|
const [mode, setMode] = useState('chat');
|
|
102
113
|
const [busy, setBusy] = useState(false);
|
|
103
|
-
const [busyLabel, setBusyLabel] = useState(
|
|
104
|
-
|
|
114
|
+
const [busyLabel, setBusyLabel] = useState(() => thinkingLabelForSettings(settings));
|
|
115
|
+
// Heartbeat for the busy indicator: ticks every second while haze is working
|
|
116
|
+
// so the developer always sees rolling activity (elapsed turn time) even when
|
|
117
|
+
// the model is thinking with no streamed output and no tool is running.
|
|
118
|
+
const turnStartedAtRef = useRef(undefined);
|
|
119
|
+
const [, setBusyTick] = useState(0);
|
|
105
120
|
const [visibleTasks, setVisibleTasks] = useState([]);
|
|
106
121
|
const [tasksExpanded, setTasksExpanded] = useState(false);
|
|
107
122
|
const [taskBarPadding, setTaskBarPadding] = useState(0);
|
|
108
|
-
const [, setSessionLabel] = useState();
|
|
109
123
|
const [tokenUsage, setTokenUsage] = useState({ ...EMPTY_TOKEN_USAGE });
|
|
110
124
|
const [queuedFollowUps, setQueuedFollowUps] = useState([]);
|
|
111
125
|
const [skills, setSkills] = useState([]);
|
|
@@ -119,6 +133,23 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
119
133
|
const [lspDraft, setLspDraft] = useState({});
|
|
120
134
|
const [selectedMcpName, setSelectedMcpName] = useState();
|
|
121
135
|
const [mcpDraft, setMcpDraft] = useState({});
|
|
136
|
+
// Wrap setBusy so the busy indicator knows when the turn started, and tick a
|
|
137
|
+
// heartbeat every second while busy so elapsed time keeps rolling. This keeps
|
|
138
|
+
// the UI visibly alive during long model thinking / blocked tool runs where
|
|
139
|
+
// otherwise no streamed output is produced (the "looks stuck" problem).
|
|
140
|
+
const setBusyWithHeartbeat = (nextBusy) => {
|
|
141
|
+
if (nextBusy && !busy)
|
|
142
|
+
turnStartedAtRef.current = Date.now();
|
|
143
|
+
if (!nextBusy)
|
|
144
|
+
turnStartedAtRef.current = undefined;
|
|
145
|
+
setBusy(nextBusy);
|
|
146
|
+
};
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (!busy)
|
|
149
|
+
return;
|
|
150
|
+
const heartbeat = setInterval(() => setBusyTick(tick => tick + 1), 1000);
|
|
151
|
+
return () => clearInterval(heartbeat);
|
|
152
|
+
}, [busy]);
|
|
122
153
|
useEffect(() => {
|
|
123
154
|
Promise.all([
|
|
124
155
|
readSettings().catch(() => ({})),
|
|
@@ -142,7 +173,7 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
142
173
|
checkForUpdate({ currentVersion: version, packageName: '@denizokcu/haze' })
|
|
143
174
|
.then(result => {
|
|
144
175
|
if (result?.isOutdated) {
|
|
145
|
-
setMessages(m => [...m, { role: 'system', text: `A new version of
|
|
176
|
+
setMessages(m => [...m, { role: 'system', text: `A new version of haze is available: ${result.latestVersion} (you have ${version}). Update with: npm i -g @denizokcu/haze` }]);
|
|
146
177
|
}
|
|
147
178
|
})
|
|
148
179
|
.catch(() => undefined);
|
|
@@ -194,19 +225,16 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
194
225
|
sessionStartRef.current = new Date();
|
|
195
226
|
if (noSession) {
|
|
196
227
|
sessionRef.current = undefined;
|
|
197
|
-
setSessionLabel('session off');
|
|
198
228
|
return;
|
|
199
229
|
}
|
|
200
230
|
const session = await createSession({ hazeVersion: version });
|
|
201
231
|
sessionRef.current = session;
|
|
202
232
|
setTokenUsage({ ...EMPTY_TOKEN_USAGE });
|
|
203
233
|
await startNewLog();
|
|
204
|
-
setSessionLabel(session.id);
|
|
205
234
|
setMessages(m => [...m, { role: 'system', text: `${message}\nSession saved: ${session.file}` }]);
|
|
206
235
|
}
|
|
207
236
|
async function initializeSession() {
|
|
208
237
|
if (noSession) {
|
|
209
|
-
setSessionLabel('session off');
|
|
210
238
|
return;
|
|
211
239
|
}
|
|
212
240
|
if (continueSession) {
|
|
@@ -216,7 +244,6 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
216
244
|
sessionRef.current = session;
|
|
217
245
|
sessionStartRef.current = new Date();
|
|
218
246
|
conversationRef.current = conversation;
|
|
219
|
-
setSessionLabel(session.id);
|
|
220
247
|
setLiveMessagesState(() => []);
|
|
221
248
|
const restoredMessages = displayMessagesFromConversation(conversation);
|
|
222
249
|
setTokenUsage({ ...EMPTY_TOKEN_USAGE, messages: estimateConversationTokens(restoredMessages).input, outputEstimate: estimateConversationTokens(restoredMessages).output });
|
|
@@ -275,7 +302,6 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
275
302
|
sessionRef.current = session;
|
|
276
303
|
conversationRef.current = conversation;
|
|
277
304
|
workStateRef.current = workState;
|
|
278
|
-
setSessionLabel(session.id);
|
|
279
305
|
setTokenUsage({ ...EMPTY_TOKEN_USAGE });
|
|
280
306
|
setLiveMessagesState(() => []);
|
|
281
307
|
setMessages([{ role: 'system', text: `Resumed session: ${formatSession(session)}` }, ...displayMessagesFromConversation(conversation)]);
|
|
@@ -323,7 +349,7 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
323
349
|
setQueuedFollowUps([]);
|
|
324
350
|
setMessages(m => [...m, { role: 'system', text: 'Cleared queued follow-ups after interrupt.' }]);
|
|
325
351
|
}
|
|
326
|
-
|
|
352
|
+
setBusyWithHeartbeat(false);
|
|
327
353
|
}
|
|
328
354
|
function queueFollowUp(value) {
|
|
329
355
|
const trimmed = value.trim();
|
|
@@ -647,7 +673,7 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
647
673
|
const name = result.draftName;
|
|
648
674
|
const description = result.description;
|
|
649
675
|
setBusyLabel(result.busyLabel ?? 'Creating skill');
|
|
650
|
-
|
|
676
|
+
setBusyWithHeartbeat(true);
|
|
651
677
|
try {
|
|
652
678
|
const created = await createSkill({ name, description });
|
|
653
679
|
setMessages(m => [...m, { role: 'system', text: skillCreationMessage(created.name, created.file) }]);
|
|
@@ -657,8 +683,8 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
657
683
|
setMessages(m => [...m, { role: 'system', text: skillCreationFailure(error) }]);
|
|
658
684
|
}
|
|
659
685
|
finally {
|
|
660
|
-
|
|
661
|
-
setBusyLabel(
|
|
686
|
+
setBusyWithHeartbeat(false);
|
|
687
|
+
setBusyLabel(thinkingLabelForSettings(settings));
|
|
662
688
|
}
|
|
663
689
|
}
|
|
664
690
|
}
|
|
@@ -1063,14 +1089,13 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
1063
1089
|
conversationRef.current = msgs;
|
|
1064
1090
|
sessionRecorder.recordConversation(msgs);
|
|
1065
1091
|
},
|
|
1066
|
-
setBusy,
|
|
1092
|
+
setBusy: setBusyWithHeartbeat,
|
|
1067
1093
|
setBusyLabel,
|
|
1068
1094
|
debugLog,
|
|
1069
1095
|
getConversation: () => conversationRef.current,
|
|
1070
1096
|
getLastAssistantText: () => lastAssistantTextRef.current,
|
|
1071
1097
|
setLastAssistantText: text => { lastAssistantTextRef.current = text; },
|
|
1072
1098
|
setAbortController: controller => { abortControllerRef.current = controller; },
|
|
1073
|
-
setGoalStatus: setActiveGoalStatus,
|
|
1074
1099
|
setWorkState: state => {
|
|
1075
1100
|
workStateRef.current = state;
|
|
1076
1101
|
sessionRecorder.recordWorkState(state);
|
|
@@ -1098,12 +1123,12 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
1098
1123
|
const headerSubtitle = [
|
|
1099
1124
|
'A minimal LLM harness for growing your own workflows while you work.',
|
|
1100
1125
|
'',
|
|
1101
|
-
'Start with simple chat, then teach
|
|
1126
|
+
'Start with simple chat, then teach haze your habits with skills:',
|
|
1102
1127
|
'/skills — add, enable/disable, validate, or remove Markdown skills.',
|
|
1103
1128
|
'',
|
|
1104
1129
|
'The most adaptive workflow is the one you shape as you go.',
|
|
1105
1130
|
'',
|
|
1106
|
-
'Guardrails are light:
|
|
1131
|
+
'Guardrails are light: haze lets the LLM work from the terminal almost like you,',
|
|
1107
1132
|
'while trying to stay scoped to this project.',
|
|
1108
1133
|
].join('\n');
|
|
1109
1134
|
const workspaceLabel = `${compactHomePath(process.cwd())}${branchName ? ` (${branchName})` : ''}`;
|
|
@@ -1125,9 +1150,10 @@ function ChatScreen({ debug = false, version, continueSession = false, noSession
|
|
|
1125
1150
|
{ kind: 'header', key: `header-${activeModelName}`, subtitle: headerSubtitle },
|
|
1126
1151
|
...transcriptItems.map(item => ({ kind: 'message', ...item })),
|
|
1127
1152
|
];
|
|
1153
|
+
const busyElapsed = busyElapsedLabel(turnStartedAtRef.current);
|
|
1128
1154
|
return _jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: staticItems, children: item => item.kind === 'header'
|
|
1129
1155
|
? _jsx(Header, { subtitle: item.subtitle, version: version }, item.key)
|
|
1130
|
-
: _jsx(MessageView, { message: item.message, width: width }, item.key) }), streamingItems.length > 0 && _jsx(Box, { flexDirection: "column", flexShrink: 0, children: streamingItems.map((message, index) => _jsx(MessageView, { message: message, width: width }, messageKey(message, index))) }), debug && debugLogs.length > 0 && _jsxs(Box, { flexDirection: "column", flexShrink: 0, marginBottom: 1, borderStyle: "round", borderColor: theme.muted, paddingX: 1, children: [_jsx(Text, { color: theme.muted, bold: true, children: "Debug" }), debugLogs.map((line, index) => _jsxs(Text, { color: theme.muted, children: ["\u2022 ", line] }, index))] }), queuedFollowUps.length > 0 && _jsxs(Box, { flexDirection: "column", flexShrink: 0, marginBottom: 1, children: [_jsx(Text, { color: theme.muted, children: "Queued follow-ups:" }), queuedFollowUps.map((item, index) => _jsxs(Text, { color: theme.muted, dimColor: true, children: [" ", index + 1, ". ", item] }, `${index}-${item}`))] }), visibleTasks.length > 0 && _jsx(Box, { flexDirection: "column", flexShrink: 0, marginBottom: 1, children: _jsx(TaskBar, { tasks: visibleTasks, width: width, expanded: tasksExpanded, padding: taskBarPadding }) }), busy && _jsx(Box, { flexShrink: 0, children: _jsxs(Text, { children: [_jsxs(Text, { color: theme.orange, bold: true, children: [_jsx(Spinner, { type: "dots" }), " ", busyLabel] }), _jsx(Text, { color: theme.muted, dimColor: true, children: " \u00B7 type to queue follow-up \u00B7 esc to interrupt" })] }) }), _jsx(Box, { borderStyle: "round", borderColor: theme.deepPurple, paddingX: 1, flexShrink: 0, children: _jsx(Box, { flexGrow: 1, minWidth: 0, children: _jsx(TextInput, { placeholder: placeholder, disabled: busy && mode !== 'chat', mask: MASKED_MODES.has(mode), historyItems: inputHistory, recordHistory: mode === 'chat', suggestions: inputSuggestions, suggestionMode: PICKER_MODES.has(mode) ? 'always' : 'slash', submitOnEmpty: SUBMIT_EMPTY_MODES.has(mode), width: Math.max(20, width - 4), onHistoryAdd: persistInputHistory, onToggleTasks: () => {
|
|
1156
|
+
: _jsx(MessageView, { message: item.message, width: width }, item.key) }), streamingItems.length > 0 && _jsx(Box, { flexDirection: "column", flexShrink: 0, children: streamingItems.map((message, index) => _jsx(MessageView, { message: message, width: width }, messageKey(message, index))) }), debug && debugLogs.length > 0 && _jsxs(Box, { flexDirection: "column", flexShrink: 0, marginBottom: 1, borderStyle: "round", borderColor: theme.muted, paddingX: 1, children: [_jsx(Text, { color: theme.muted, bold: true, children: "Debug" }), debugLogs.map((line, index) => _jsxs(Text, { color: theme.muted, children: ["\u2022 ", line] }, index))] }), queuedFollowUps.length > 0 && _jsxs(Box, { flexDirection: "column", flexShrink: 0, marginBottom: 1, children: [_jsx(Text, { color: theme.muted, children: "Queued follow-ups:" }), queuedFollowUps.map((item, index) => _jsxs(Text, { color: theme.muted, dimColor: true, children: [" ", index + 1, ". ", item] }, `${index}-${item}`))] }), visibleTasks.length > 0 && _jsx(Box, { flexDirection: "column", flexShrink: 0, marginBottom: 1, children: _jsx(TaskBar, { tasks: visibleTasks, width: width, expanded: tasksExpanded, padding: taskBarPadding }) }), busy && _jsx(Box, { flexShrink: 0, children: _jsxs(Text, { children: [_jsxs(Text, { color: theme.orange, bold: true, children: [_jsx(Spinner, { type: "dots" }), " ", busyLabel, busyElapsed ? _jsxs(Text, { color: theme.muted, dimColor: true, children: [" \u00B7 ", busyElapsed] }) : null] }), _jsx(Text, { color: theme.muted, dimColor: true, children: " \u00B7 type to queue follow-up \u00B7 esc to interrupt" })] }) }), _jsx(Box, { borderStyle: "round", borderColor: theme.deepPurple, paddingX: 1, flexShrink: 0, children: _jsx(Box, { flexGrow: 1, minWidth: 0, children: _jsx(TextInput, { placeholder: placeholder, disabled: busy && mode !== 'chat', mask: MASKED_MODES.has(mode), historyItems: inputHistory, recordHistory: mode === 'chat', suggestions: inputSuggestions, suggestionMode: PICKER_MODES.has(mode) ? 'always' : 'slash', submitOnEmpty: SUBMIT_EMPTY_MODES.has(mode), width: Math.max(20, width - 4), onHistoryAdd: persistInputHistory, onToggleTasks: () => {
|
|
1131
1157
|
if (!tasksExpanded) {
|
|
1132
1158
|
setTaskBarPadding(0);
|
|
1133
1159
|
setTasksExpanded(true);
|
|
@@ -40,5 +40,5 @@ const PLACEHOLDERS = {
|
|
|
40
40
|
mcpConfirmRemove: 'Type "yes" to confirm',
|
|
41
41
|
};
|
|
42
42
|
export function placeholderForMode(mode, busy) {
|
|
43
|
-
return PLACEHOLDERS[mode] ?? (busy ? 'Queue a follow-up, or Esc to interrupt' : 'Ask
|
|
43
|
+
return PLACEHOLDERS[mode] ?? (busy ? 'Queue a follow-up, or Esc to interrupt' : 'Ask haze to help build your app');
|
|
44
44
|
}
|
|
@@ -17,8 +17,8 @@ export const COMMAND_HELP_ENTRIES = [
|
|
|
17
17
|
{ usage: '/logs <id>', description: 'Show summary of a specific log: entry counts by type, total tokens, tool calls.' },
|
|
18
18
|
{ usage: '/compact [instructions]', description: 'Summarize older model context and keep recent messages.' },
|
|
19
19
|
{ usage: '/clear', description: 'Clear the current chat conversation history.' },
|
|
20
|
-
{ usage: '/exit', description: 'Exit
|
|
21
|
-
{ usage: '/quit', description: 'Exit
|
|
20
|
+
{ usage: '/exit', description: 'Exit haze.' },
|
|
21
|
+
{ usage: '/quit', description: 'Exit haze.' },
|
|
22
22
|
];
|
|
23
23
|
export function formatCommandHelp(entries = COMMAND_HELP_ENTRIES) {
|
|
24
24
|
return ['Commands:', ...entries.flatMap(entry => [entry.usage, ` ${entry.description}`])].join('\n');
|
|
@@ -5,6 +5,12 @@ export declare function toolResultSummary(event: {
|
|
|
5
5
|
output?: unknown;
|
|
6
6
|
error?: unknown;
|
|
7
7
|
}): string;
|
|
8
|
+
/**
|
|
9
|
+
* A short, human label for the live busy indicator while a tool is running,
|
|
10
|
+
* e.g. "Running command", "Reading src/foo.ts", "Searching".
|
|
11
|
+
* Lets the developer see *what* is happening, not just that something is.
|
|
12
|
+
*/
|
|
13
|
+
export declare function busyToolLabel(toolName: string, input: unknown): string;
|
|
8
14
|
export declare function formatSeconds(milliseconds: number): string;
|
|
9
15
|
export declare function formatElapsedTime(milliseconds: number): string;
|
|
10
16
|
export declare function formatElapsedTimeWhole(milliseconds: number): string;
|
|
@@ -113,6 +113,44 @@ export function toolResultSummary(event) {
|
|
|
113
113
|
}
|
|
114
114
|
return 'completed';
|
|
115
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* A short, human label for the live busy indicator while a tool is running,
|
|
118
|
+
* e.g. "Running command", "Reading src/foo.ts", "Searching".
|
|
119
|
+
* Lets the developer see *what* is happening, not just that something is.
|
|
120
|
+
*/
|
|
121
|
+
export function busyToolLabel(toolName, input) {
|
|
122
|
+
const data = input;
|
|
123
|
+
const pathLabel = typeof data?.path === 'string' ? compact(data.path, 80) : undefined;
|
|
124
|
+
switch (toolName) {
|
|
125
|
+
case 'bash':
|
|
126
|
+
return 'Running command';
|
|
127
|
+
case 'grep':
|
|
128
|
+
return 'Searching';
|
|
129
|
+
case 'listFiles':
|
|
130
|
+
return 'Listing files';
|
|
131
|
+
case 'readFile':
|
|
132
|
+
return pathLabel ? `Reading ${pathLabel}` : 'Reading file';
|
|
133
|
+
case 'writeFile':
|
|
134
|
+
return pathLabel ? `Writing ${pathLabel}` : 'Writing file';
|
|
135
|
+
case 'editFile':
|
|
136
|
+
case 'replaceLines':
|
|
137
|
+
return pathLabel ? `Editing ${pathLabel}` : 'Editing file';
|
|
138
|
+
case 'fetch':
|
|
139
|
+
return 'Fetching URL';
|
|
140
|
+
case 'subagent':
|
|
141
|
+
return 'Running subagent';
|
|
142
|
+
case 'writeTasks':
|
|
143
|
+
return 'Updating tasks';
|
|
144
|
+
case 'skill':
|
|
145
|
+
return 'Loading skill';
|
|
146
|
+
default:
|
|
147
|
+
if (toolName.startsWith('lsp'))
|
|
148
|
+
return 'Querying LSP';
|
|
149
|
+
if (toolName.startsWith('mcp'))
|
|
150
|
+
return 'Running MCP tool';
|
|
151
|
+
return `Running ${toolName}`;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
116
154
|
export function formatSeconds(milliseconds) {
|
|
117
155
|
return `${(milliseconds / 1000).toFixed(1)}s`;
|
|
118
156
|
}
|