@denizokcu/haze 0.9.0 → 0.11.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 +133 -17
- package/README.md +164 -68
- package/SECURITY.md +22 -0
- package/bin/haze.js +102 -1
- package/dist/buildInfo.json +7 -0
- package/dist/cli/chat/TaskBar.d.ts +2 -1
- package/dist/cli/chat/TaskBar.js +7 -4
- package/dist/cli/chat/chatMetrics.d.ts +17 -1
- package/dist/cli/chat/chatMetrics.js +22 -5
- package/dist/cli/chat/contextReport.d.ts +11 -0
- package/dist/cli/chat/contextReport.js +46 -0
- package/dist/cli/chat/fileMentionSuggestions.d.ts +29 -0
- package/dist/cli/chat/fileMentionSuggestions.js +92 -0
- package/dist/cli/chat/inputSuggestions.d.ts +5 -0
- package/dist/cli/chat/inputSuggestions.js +17 -3
- package/dist/cli/chat/liveRegion.d.ts +25 -0
- package/dist/cli/chat/liveRegion.js +48 -0
- package/dist/cli/chat/messages.d.ts +33 -2
- package/dist/cli/chat/messages.js +216 -33
- package/dist/cli/chat/sessionLifecycle.d.ts +67 -0
- package/dist/cli/chat/sessionLifecycle.js +205 -0
- package/dist/cli/chat/sessionRecorder.js +80 -14
- package/dist/cli/chat/startupInfo.js +11 -4
- package/dist/cli/chat/tips.d.ts +21 -0
- package/dist/cli/chat/tips.js +43 -0
- package/dist/cli/chat/wizardDispatch.d.ts +64 -0
- package/dist/cli/chat/wizardDispatch.js +744 -0
- package/dist/cli/commands/chat.d.ts +6 -0
- package/dist/cli/commands/chat.js +373 -790
- package/dist/cli/commands/chatModes.d.ts +1 -1
- package/dist/cli/commands/chatModes.js +7 -2
- package/dist/cli/commands/commandHelp.js +5 -3
- package/dist/cli/commands/commands.d.ts +5 -2
- package/dist/cli/commands/commands.js +22 -18
- package/dist/cli/commands/doctor.d.ts +19 -0
- package/dist/cli/commands/doctor.js +76 -0
- package/dist/cli/commands/fleetCommand.d.ts +14 -0
- package/dist/cli/commands/fleetCommand.js +46 -0
- package/dist/cli/commands/formatters.d.ts +5 -0
- package/dist/cli/commands/formatters.js +35 -6
- package/dist/cli/commands/logsCommand.js +1 -7
- package/dist/cli/commands/modelCommand.js +1 -1
- package/dist/cli/commands/ndjsonSink.d.ts +23 -0
- package/dist/cli/commands/ndjsonSink.js +38 -0
- package/dist/cli/commands/providerWizard.d.ts +10 -2
- package/dist/cli/commands/providerWizard.js +50 -4
- package/dist/cli/commands/runCommand.d.ts +4 -0
- package/dist/cli/commands/runCommand.js +142 -16
- package/dist/cli/commands/sessionPicker.d.ts +9 -0
- package/dist/cli/commands/sessionPicker.js +29 -0
- package/dist/cli/commands/settingsSummary.js +6 -4
- package/dist/cli/commands/skillConfirmRemove.js +4 -3
- package/dist/cli/commands/skillWizard.d.ts +2 -0
- package/dist/cli/commands/skillWizard.js +16 -6
- package/dist/cli/commands/streaming/abortCause.d.ts +24 -0
- package/dist/cli/commands/streaming/abortCause.js +16 -0
- package/dist/cli/commands/streaming/assistantText.js +9 -2
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +65 -0
- package/dist/cli/commands/streaming/goalCheckpoint.js +23 -0
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +64 -0
- package/dist/cli/commands/streaming/goalSupervisor.js +127 -0
- package/dist/cli/commands/streaming/idleTimer.d.ts +26 -0
- package/dist/cli/commands/streaming/idleTimer.js +24 -0
- package/dist/cli/commands/streaming/toolCallRecovery.d.ts +2 -0
- package/dist/cli/commands/streaming/toolCallRecovery.js +24 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +31 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.js +50 -2
- package/dist/cli/commands/streaming/toolResultState.d.ts +6 -1
- package/dist/cli/commands/streaming/toolResultState.js +29 -7
- package/dist/cli/commands/streaming/turnOutcome.d.ts +17 -0
- package/dist/cli/commands/streaming/turnOutcome.js +27 -11
- package/dist/cli/commands/streaming/turnRuntime.js +6 -4
- package/dist/cli/commands/streaming.d.ts +82 -3
- package/dist/cli/commands/streaming.js +528 -91
- package/dist/cli/commands/wizardActions.d.ts +7 -0
- package/dist/cli/commands/wizardActions.js +7 -0
- package/dist/cli/commands/wizardPrompts.js +7 -1
- package/dist/cli/commands/wizardSuggestions.d.ts +8 -0
- package/dist/cli/commands/wizardSuggestions.js +64 -14
- package/dist/cli/commands/wizardTransition.d.ts +4 -0
- package/dist/cli/commands/wizardTransition.js +1 -2
- package/dist/cli/index.js +82 -22
- package/dist/cli/terminalTitle.d.ts +6 -0
- package/dist/cli/terminalTitle.js +36 -0
- package/dist/config/inputHistory.d.ts +3 -3
- package/dist/config/inputHistory.js +12 -18
- package/dist/config/modelDiscovery.d.ts +71 -0
- package/dist/config/modelDiscovery.js +214 -0
- package/dist/config/privateStorage.js +28 -2
- package/dist/config/providerAuth.d.ts +14 -0
- package/dist/config/providerAuth.js +49 -0
- package/dist/config/providerPresets.d.ts +49 -5
- package/dist/config/providerPresets.js +573 -73
- package/dist/config/providers.d.ts +2 -0
- package/dist/config/providers.js +9 -0
- package/dist/config/settings.d.ts +58 -0
- package/dist/config/settings.js +38 -1
- package/dist/config/skillSettings.d.ts +6 -13
- package/dist/config/skillSettings.js +20 -19
- package/dist/core/agent/budgets.d.ts +36 -0
- package/dist/core/agent/budgets.js +44 -0
- package/dist/core/agent/compaction.d.ts +38 -0
- package/dist/core/agent/compaction.js +108 -19
- package/dist/core/agent/completionController.d.ts +230 -0
- package/dist/core/agent/completionController.js +287 -0
- package/dist/core/agent/contextBudget.d.ts +46 -0
- package/dist/core/agent/contextBudget.js +89 -7
- package/dist/core/agent/errors.js +6 -2
- package/dist/core/agent/events.d.ts +86 -0
- package/dist/core/agent/reasoningPolicy.d.ts +31 -0
- package/dist/core/agent/reasoningPolicy.js +27 -0
- package/dist/core/agent/toolCapabilities.d.ts +27 -0
- package/dist/core/agent/toolCapabilities.js +58 -0
- package/dist/core/agent/toolExecutionBudget.d.ts +35 -0
- package/dist/core/agent/toolExecutionBudget.js +49 -0
- package/dist/core/agent/toolOutputStore.d.ts +13 -0
- package/dist/core/agent/toolOutputStore.js +27 -10
- package/dist/core/agent/toolResults.d.ts +12 -0
- package/dist/core/agent/toolResults.js +38 -0
- package/dist/core/agent/turnBudget.d.ts +35 -0
- package/dist/core/agent/turnBudget.js +27 -0
- package/dist/core/agent/turnPolicy.d.ts +11 -0
- package/dist/core/agent/turnPolicy.js +19 -0
- package/dist/core/agent/workState.d.ts +76 -1
- package/dist/core/agent/workState.js +120 -13
- package/dist/core/attachments/imageAttachments.d.ts +90 -0
- package/dist/core/attachments/imageAttachments.js +245 -0
- package/dist/core/attachments/readBlessings.d.ts +37 -0
- package/dist/core/attachments/readBlessings.js +79 -0
- package/dist/core/deadline.d.ts +33 -0
- package/dist/core/deadline.js +74 -0
- package/dist/core/goal/completionPolicy.d.ts +27 -0
- package/dist/core/goal/completionPolicy.js +37 -1
- package/dist/core/goal/requestClassifier.d.ts +0 -3
- package/dist/core/goal/requestClassifier.js +0 -13
- package/dist/core/io/boundedRead.js +76 -29
- package/dist/core/limits/byteBudgets.d.ts +7 -0
- package/dist/core/limits/byteBudgets.js +7 -0
- package/dist/core/limits/textBudgets.d.ts +25 -0
- package/dist/core/limits/textBudgets.js +25 -0
- package/dist/core/log/llmLog.js +7 -0
- package/dist/core/persistence/orderedFileWriter.d.ts +10 -0
- package/dist/core/persistence/orderedFileWriter.js +16 -2
- package/dist/core/process/backgroundRegistry.d.ts +35 -0
- package/dist/core/process/backgroundRegistry.js +195 -0
- package/dist/core/process/runBoundedProcess.d.ts +9 -0
- package/dist/core/process/runBoundedProcess.js +74 -29
- package/dist/core/safety/missingExecutable.d.ts +42 -0
- package/dist/core/safety/missingExecutable.js +77 -0
- package/dist/core/safety/urlGuard.d.ts +2 -1
- package/dist/core/safety/urlGuard.js +3 -2
- package/dist/core/session/sessionSlimming.js +47 -4
- package/dist/core/session/sessionStore.d.ts +74 -0
- package/dist/core/session/sessionStore.js +268 -18
- package/dist/core/subagent/contracts.d.ts +120 -0
- package/dist/core/subagent/contracts.js +55 -0
- package/dist/core/subagent/executionProfiles.d.ts +28 -0
- package/dist/core/subagent/executionProfiles.js +45 -0
- package/dist/core/subagent/subagentCoordinator.d.ts +78 -0
- package/dist/core/subagent/subagentCoordinator.js +164 -0
- package/dist/core/subagent/subagentRunner.d.ts +211 -145
- package/dist/core/subagent/subagentRunner.js +208 -98
- package/dist/core/subagent/workspaceMutationPolicy.d.ts +11 -0
- package/dist/core/subagent/workspaceMutationPolicy.js +52 -0
- package/dist/core/tasks/taskStorage.js +12 -1
- package/dist/llm/client.d.ts +36 -29
- package/dist/llm/client.js +102 -33
- package/dist/llm/hazeTools.d.ts +2559 -150
- package/dist/llm/hazeTools.js +119 -31
- package/dist/llm/lsp.d.ts +26 -4
- package/dist/llm/lsp.js +90 -14
- package/dist/llm/lspTools.d.ts +2366 -0
- package/dist/llm/lspTools.js +87 -79
- package/dist/llm/openaiCodex.d.ts +3 -0
- package/dist/llm/openaiCodex.js +47 -0
- package/dist/llm/openaiCodexOAuth.d.ts +54 -0
- package/dist/llm/openaiCodexOAuth.js +214 -0
- package/dist/llm/requestContext.d.ts +25 -1
- package/dist/llm/requestContext.js +51 -8
- package/dist/llm/systemPrompt.d.ts +15 -1
- package/dist/llm/systemPrompt.js +24 -8
- package/dist/llm/toolResultTypes.d.ts +8 -1
- package/dist/llm/tools/bashTool.d.ts +906 -32
- package/dist/llm/tools/bashTool.js +30 -4
- package/dist/llm/tools/editMatch.d.ts +14 -0
- package/dist/llm/tools/editMatch.js +72 -0
- package/dist/llm/tools/failures.d.ts +2 -0
- package/dist/llm/tools/failures.js +1 -0
- package/dist/llm/tools/fetchTool.d.ts +42 -26
- package/dist/llm/tools/fetchTool.js +1 -1
- package/dist/llm/tools/fileToolShared.d.ts +6 -4
- package/dist/llm/tools/fileToolShared.js +18 -23
- package/dist/llm/tools/gitIgnore.d.ts +49 -0
- package/dist/llm/tools/gitIgnore.js +129 -0
- package/dist/llm/tools/grepRunner.d.ts +5 -0
- package/dist/llm/tools/grepRunner.js +52 -71
- package/dist/llm/tools/outputCap.d.ts +2 -6
- package/dist/llm/tools/outputCap.js +2 -6
- package/dist/llm/tools/processTool.d.ts +1077 -0
- package/dist/llm/tools/processTool.js +41 -0
- package/dist/llm/tools/readRecovery.d.ts +10 -0
- package/dist/llm/tools/readRecovery.js +135 -0
- package/dist/llm/tools/toolContext.d.ts +9 -1
- package/dist/llm/tools/toolContext.js +83 -43
- package/dist/llm/tools/workspaceFile.d.ts +9 -1
- package/dist/llm/tools/workspaceFile.js +33 -4
- package/dist/llm/webFetch.d.ts +17 -0
- package/dist/llm/webFetch.js +66 -86
- package/dist/llm/workerContext.d.ts +18 -0
- package/dist/llm/workerContext.js +55 -0
- package/dist/skills/SkillLoader.d.ts +2 -2
- package/dist/skills/SkillRegistry.d.ts +3 -2
- package/dist/skills/SkillRegistry.js +43 -13
- package/dist/skills/builder/SkillBuilder.d.ts +3 -0
- package/dist/skills/builder/SkillBuilder.js +23 -5
- package/dist/skills/skillTools.js +11 -4
- package/dist/skills/types.d.ts +6 -1
- package/dist/ui/codeHighlight.d.ts +4 -0
- package/dist/ui/codeHighlight.js +31 -0
- package/dist/ui/components/Header.d.ts +1 -1
- package/dist/ui/components/MarkdownText.d.ts +16 -2
- package/dist/ui/components/MarkdownText.js +244 -34
- package/dist/ui/components/TextInput.d.ts +12 -2
- package/dist/ui/components/TextInput.js +80 -8
- package/dist/ui/theme.d.ts +4 -3
- package/dist/ui/theme.js +5 -4
- package/dist/utils/buildInfo.d.ts +104 -0
- package/dist/utils/buildInfo.js +253 -0
- package/dist/utils/format.d.ts +2 -0
- package/dist/utils/format.js +8 -0
- package/dist/utils/fs.d.ts +9 -1
- package/dist/utils/fs.js +87 -29
- package/dist/utils/openPath.d.ts +2 -0
- package/dist/utils/openPath.js +22 -0
- package/dist/utils/path.d.ts +2 -0
- package/dist/utils/path.js +5 -1
- package/dist/utils/utf8.d.ts +22 -0
- package/dist/utils/utf8.js +54 -0
- package/dist/utils/version.d.ts +9 -3
- package/dist/utils/version.js +28 -2
- package/package.json +24 -19
package/README.md
CHANGED
|
@@ -2,29 +2,34 @@
|
|
|
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.11.0
|
|
6
6
|
|
|
7
|
-
haze 0.
|
|
7
|
+
haze 0.11.0 turns per-turn budgets into goal-level autonomy and hardens long-running headless work. It keeps the Node.js 22 support floor and the documented CLI, settings, session, skill, and tool-result contracts.
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
9
|
+
- Autonomous goal continuation across physical turns: a voluntary final that arrives while the turn's declared task list still has pending items or post-edit validation is missing/stale/failed is rejected (prose is never completion evidence), and a logical-goal supervisor wraps each request, so a turn that stops with unfinished work — at any budget boundary, including `tool-calls` finishes — automatically starts the next continuation turn against the preserved conversation. One mutation lease and cumulative task/validation/mutation evidence carry across the boundary, so completed work is never replayed and nothing resets. It continues while measurable progress occurs and stops only for structured completion, concrete external blockers, user cancellation, the goal deadline, or two consecutive no-progress cycles. Interactively, continuation is automatic with a visible cycle status; headless `--timeout` bounds the whole logical goal, `stream-json` gains `goal_start`/`goal_continue`/`goal_end` events, the JSON result envelope gains cumulative `goal` evidence, and the exit code stays non-zero unless the goal structurally completed.
|
|
10
|
+
- Runtime provenance and stale-install protection: builds embed `dist/buildInfo.json`, the launcher refuses incomplete or stale builds with an actionable rebuild hint, `haze --version --verbose` prints executing version/commit/runtime paths, and the new `haze doctor` command verifies artifacts, capabilities, and nearby-checkout mismatches. Session headers record the executing build so saved failures tie to the code that actually ran.
|
|
11
|
+
- Model-aware context budgeting: the message allowance is the model's real context window (curated per-preset limits, live provider discovery, or a configurable fallback of 128K) minus system prompt, tool schemas, output reserve, and safety margin. Long turns compact accumulated tool history before each provider request, and provider context overflows self-heal in interactive and headless runs by compacting and retrying once.
|
|
12
|
+
- Long-running hardening: headless `--timeout <duration>` bounds total elapsed time with `timeout` stream events, per-tool execution deadlines (10m; 20m for subagents) quarantine abort-ignoring tools, main tool-call budgets are enforced atomically at the execution boundary, and `--output stream-json` emits linear `message_update` deltas through a backpressure-aware ordered sink. Model-stream idle stalls are distinguished from user cancels: they retry through the bounded model-retry pool (salvaging work to the last completed step) and, when exhausted, pause the turn with a one-key `R` resume instead of discarding it.
|
|
13
|
+
- Performance: `listFiles` batches Git ignore checks and prunes ignored directories, LSP navigation reuses one initialized server per turn, session snapshots are coalesced and vacuumed (no more quadratic session-file growth), per-step request estimates are memoized, the transcript caches settled Markdown chunks, streaming renders incrementally (no flicker), and the live region is clamped to the viewport so a long live tail never wipes terminal scrollback.
|
|
14
|
+
- Manual `/compact` asks the active model for a continuity summary (goal, decisions, files, validation results, next action) and keeps the recent tail verbatim; set `manualCompaction: "heuristic"` for the previous bounded excerpt. Mutation tools fail closed when Git ignore checks cannot run, and the completion-rescue slice covers `test`-intent requests.
|
|
14
15
|
|
|
15
16
|
Previous releases:
|
|
16
17
|
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
18
|
+
- `0.10.1`: OpenAI Subscription OAuth preset, SECURITY.md and the attended-use threat model, bounded completion recovery, compact colorized diffs, prompt-injection framing, hardened fetch/stdin/sessions, and a multi-page docs site.
|
|
19
|
+
|
|
20
|
+
- `0.10.0`: image input, read-only path blessings, isolated fleet workers, managed background processes, session browsing and forking, model discovery, project skills, and rotating tips.
|
|
21
|
+
- `0.9.0`: private home-state storage, authoritative turn status, collection-time byte bounds, hardened process teardown, stronger real-path and network boundaries, and ordered persistence.
|
|
22
|
+
- `0.8.0`: AI SDK v7 runtime, live status with model, elapsed time, and tool labels; bounded bash output processing; lowercase `haze` naming.
|
|
23
|
+
- `0.7.0`: headless `-p`, `--output json`, and `--output stream-json`; pinned-connection `fetch` safety; scoped instruction refresh; smaller sessions; startup context visibility.
|
|
24
|
+
- `0.6.0`: AI SDK-native ToolLoopAgent core, optional LSP navigation, MCP support, unified configuration pickers, cleaner transcripts, `/context`, and startup update checks.
|
|
25
|
+
- `0.5.0`: SSRF-protected public URL fetching, no provider environment variables, debug-only LLM logs, command-aware output reduction, CLI Markdown rendering, scoped nested context files, and automatic cleanup of completed tasks.
|
|
26
|
+
- `0.4.0`: three-step skill wizard, language-agnostic skill intent extraction, model-managed tasks, a smaller command surface, and docs site additions.
|
|
27
|
+
- `0.3.0`: redesigned docs site, a relocated task bar, and automatic task cleanup between sessions.
|
|
28
|
+
- `0.2.0`: more reliable recovery from failed edits and validation, structured bash classification, parsed validation summaries, and multiline input with vertical cursor movement.
|
|
29
|
+
- `0.1.0`: bundled ripgrep, subagent delegation, and inline diffs.
|
|
30
|
+
- `0.0.3`: durable sessions, context compaction, and provider management.
|
|
31
|
+
- `0.0.2`: Markdown skills, autocomplete, and `listFiles` pagination.
|
|
32
|
+
- `0.0.1`: initial release.
|
|
28
33
|
|
|
29
34
|
haze works with OpenAI-compatible providers, including OpenRouter and local endpoints. Use `/provider` to choose or add one, then `/model` to select a model.
|
|
30
35
|
|
|
@@ -37,7 +42,11 @@ haze works with OpenAI-compatible providers, including OpenRouter and local endp
|
|
|
37
42
|
|_| |_|\__,_/___\___|
|
|
38
43
|
```
|
|
39
44
|
|
|
40
|
-
haze keeps guardrails light. The LLM can work from the terminal with
|
|
45
|
+
haze keeps guardrails light. The LLM can work from the terminal with access close to yours while staying scoped to the current project where possible. It is for developers who would rather supervise tool calls than work through a stack of permission dialogs. Keep an eye on what it does.
|
|
46
|
+
|
|
47
|
+
### Supervision model
|
|
48
|
+
|
|
49
|
+
There is **no sandbox and no permission layer**: bash runs unsupervised (its classification is informational only), and only the file tools are confined to the workspace. Claude Code gates tools behind permissions, plan mode, and hooks; Codex CLI runs in an OS sandbox with approval modes; haze, like pi, replaces those mechanisms with your supervision. That trade-off is deliberate and keeps the agent fast and transparent, but it also means haze is **not an unattended automation runtime** — run it where you would run a shell session yourself. If a CI job runs haze headless, treat the job the way you would treat any script with shell access. SECURITY.md documents the attended-use threat model in full.
|
|
41
50
|
|
|
42
51
|
## Getting started
|
|
43
52
|
|
|
@@ -60,9 +69,9 @@ On first run, create or choose a provider, then choose your first model:
|
|
|
60
69
|
/model
|
|
61
70
|
```
|
|
62
71
|
|
|
63
|
-
`/provider`
|
|
72
|
+
`/provider` sets up any OpenAI-compatible endpoint, such as OpenRouter, OpenAI, LM Studio, Ollama, or a proxy. haze asks for a provider name, base URL, optional API key, and model names. The **OpenAI API Key** preset uses platform API billing. The **OpenAI Subscription** preset instead opens a ChatGPT browser login and uses the Codex Responses endpoint; no pasted session token is required. Its sign-in callback listens on a fixed localhost port (1455) required by the registered client, so a lingering process holding that port blocks sign-in until it exits; retry after freeing the port.
|
|
64
73
|
|
|
65
|
-
`/model` selects the model haze should use. You can also set one directly:
|
|
74
|
+
`/model` selects the model haze should use. The picker also offers `add models`, which fetches a provider's model list from its OpenAI-compatible `/models` endpoint so you can pick instead of typing; if the endpoint is unavailable you can still type model names. You can also set one directly:
|
|
66
75
|
|
|
67
76
|
```txt
|
|
68
77
|
/model anthropic/claude-sonnet-4.6
|
|
@@ -71,7 +80,7 @@ On first run, create or choose a provider, then choose your first model:
|
|
|
71
80
|
|
|
72
81
|
### MCP servers
|
|
73
82
|
|
|
74
|
-
Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io) servers and give the agent
|
|
83
|
+
Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io) servers and give the agent more tools. The interactive picker works like `/provider`: enable, disable, or remove a server; set its API key; or add one from a preset or custom configuration. The built-in Context7 preset provides current library documentation.
|
|
75
84
|
|
|
76
85
|
```txt
|
|
77
86
|
/mcp # opens the server picker
|
|
@@ -82,11 +91,11 @@ Use `/mcp` to connect [Model Context Protocol](https://modelcontextprotocol.io)
|
|
|
82
91
|
|
|
83
92
|
API keys for HTTP/SSE servers are entered in a masked prompt and sent as `Authorization: Bearer <value>`. Stdio authentication belongs in the command or wrapper; haze does not attach HTTP headers to stdio. Servers persist in `~/.haze/settings.json` under `mcpServers`. Discovery and cleanup have bounded deadlines, failures are isolated, and MCP tools never shadow built-ins.
|
|
84
93
|
|
|
85
|
-
Saved settings live in `~/.haze/settings.json`. Provider keys and MCP headers require HTTPS unless the endpoint
|
|
94
|
+
Saved settings live in `~/.haze/settings.json`. ChatGPT OAuth credentials live separately in `~/.haze/auth.json`; both files use private permissions. Provider keys and MCP headers require HTTPS unless the endpoint uses loopback HTTP (`localhost`, `*.localhost`, `127/8`, or `::1`). Keyless HTTP remains available, and local OpenAI-compatible providers do not need a key. If a settings or authentication file is malformed, haze shows an actionable error instead of treating it as empty. Configure everything inside haze with `/provider`, `/model`, and `/settings`; there are no environment variables to set. Provider presets carry curated per-model metadata (context window and output cap from the models.dev catalog) which the wizard writes into `modelLimits`.
|
|
86
95
|
|
|
87
|
-
haze
|
|
96
|
+
haze focuses on chat, local tools, context files, sessions, and Markdown skills. Use `/skills` for workflows outside that core. Its interactive picker can generate a skill from a description, then enable, disable, validate, or remove it. For reviews, release prep, deploy checks, debugging routines, or a team-specific checklist, ask haze to create a skill and edit the resulting Markdown as needed.
|
|
88
97
|
|
|
89
|
-
##
|
|
98
|
+
## Start using haze
|
|
90
99
|
|
|
91
100
|
Open a project and ask for work:
|
|
92
101
|
|
|
@@ -94,9 +103,11 @@ Open a project and ask for work:
|
|
|
94
103
|
create a calculator in calc-app in ruby with add subtract multiply divide
|
|
95
104
|
```
|
|
96
105
|
|
|
97
|
-
haze
|
|
106
|
+
haze can inspect and edit files, fetch public URLs, and run commands. Tool activity stays compact in the transcript. Completed transcript entries render once as static terminal output, which keeps live model and spinner updates from repainting the full history. During a streamed answer, completed root-level Markdown blocks move into that static history while the unfinished block stays plain and live. Small edits show a colorized diff with one line of context on either side; large diffs get a short summary instead. Bash output is capped while the command runs, then filtered according to the command type. Validation failures keep the useful diagnostics. Raw output handles have per-entry and total memory limits, and tell you how many bytes were dropped. Sessions are saved after their first resumable message, so you can pick up the latest workspace conversation with `haze --continue` or `/resume` without accumulating empty session files.
|
|
107
|
+
|
|
108
|
+
The agent can start up to five dev servers or watchers as registered background processes. Their rolling output is capped at 256 KB and remains available through `readToolOutput`; the `process` tool lists, reads, and kills them. The status bar shows the live count. Starting a new session or exiting haze terminates every registered process tree, while aborting an individual turn leaves background work running. Background processes are unavailable inside fleet workers and never survive haze itself.
|
|
98
109
|
|
|
99
|
-
Use `/` to discover commands and skills. `Tab` completes the top suggestion.
|
|
110
|
+
Use `/` to discover commands and skills. Type `@` to browse workspace files; `Tab` completes the top suggestion.
|
|
100
111
|
|
|
101
112
|
Useful starters:
|
|
102
113
|
|
|
@@ -110,9 +121,19 @@ Useful starters:
|
|
|
110
121
|
|
|
111
122
|
`/init` creates or updates `AGENTS.md` so future sessions understand the project.
|
|
112
123
|
|
|
113
|
-
##
|
|
124
|
+
## Attach images
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
Reference an image in your prompt to attach it, and haze sends it to the model alongside your text:
|
|
127
|
+
|
|
128
|
+
```txt
|
|
129
|
+
@docs/screenshot.png the button in this shot is misaligned — fix it
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Image input is opt-in per provider. Mark a provider image-capable in `/provider` before attaching, and haze shows which providers accept images in `/settings`. Attachments are limited to png, jpeg, gif, and webp files, up to 5 MB and 4 per message. Explicit user-typed paths may point outside the workspace; this exception is read-only and never expands mutation access. A non-capable provider, an invalid image path, or an oversized file fails with a clear message before any model call. Resumed sessions keep a short placeholder instead of the image bytes.
|
|
133
|
+
|
|
134
|
+
## Skills that grow with your workflow
|
|
135
|
+
|
|
136
|
+
Skills are Markdown workflows that haze creates with `/skills`. Choose **this project** to store a team workflow in `.haze/skills`, or **global** to store a personal workflow in `~/.haze/skills`. Project skills override same-named global skills in that workspace; `/skills` always shows each skill's provenance.
|
|
116
137
|
|
|
117
138
|
If you do something for the second time, build a skill for it:
|
|
118
139
|
|
|
@@ -123,10 +144,11 @@ If you do something for the second time, build a skill for it:
|
|
|
123
144
|
# Description: review the diff between my current branch and main, focusing on bugs, tests, DRY and KISS
|
|
124
145
|
```
|
|
125
146
|
|
|
126
|
-
haze uses the model to create the skill file for you:
|
|
147
|
+
haze uses the model to create the skill file for you at the explicitly selected scope:
|
|
127
148
|
|
|
128
149
|
```txt
|
|
129
|
-
|
|
150
|
+
.haze/skills/<skill-name>/SKILL.md # project
|
|
151
|
+
~/.haze/skills/<skill-name>/SKILL.md # global
|
|
130
152
|
```
|
|
131
153
|
|
|
132
154
|
A skill is just Markdown with frontmatter, a role, a focused prompt, and a small output template:
|
|
@@ -169,7 +191,7 @@ Installed skills appear as slash commands like:
|
|
|
169
191
|
|
|
170
192
|
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.
|
|
171
193
|
|
|
172
|
-
|
|
194
|
+
When you catch yourself repeating the same instructions, put them in a skill. The workflow stays in a Markdown file that you can read and edit.
|
|
173
195
|
|
|
174
196
|
## Commands
|
|
175
197
|
|
|
@@ -187,13 +209,15 @@ This is the trick: do normal work, notice friction, create a skill, keep going.
|
|
|
187
209
|
/init
|
|
188
210
|
/context
|
|
189
211
|
/session
|
|
190
|
-
/resume
|
|
212
|
+
/resume [id]
|
|
191
213
|
/new
|
|
192
214
|
/compact [instructions]
|
|
193
215
|
/clear
|
|
194
216
|
/exit
|
|
195
217
|
|
|
196
218
|
/skills
|
|
219
|
+
/tips
|
|
220
|
+
/fleet [--review] [--profile <name>] [--workers <provider:model>] [--concurrency <n>] <prompt>
|
|
197
221
|
```
|
|
198
222
|
|
|
199
223
|
Skill management is a single interactive picker, mirroring `/provider`, `/lsp`, and `/mcp`: generate a custom skill from a description, then show info, enable/disable, validate, or remove. Disabled skills drop out of the model catalog and the `/<name>` command list until re-enabled.
|
|
@@ -201,9 +225,10 @@ Skill management is a single interactive picker, mirroring `/provider`, `/lsp`,
|
|
|
201
225
|
CLI flags:
|
|
202
226
|
|
|
203
227
|
```bash
|
|
204
|
-
haze --debug
|
|
205
|
-
haze --continue
|
|
206
|
-
haze --
|
|
228
|
+
haze --debug # show model/tool debug logs and write detailed JSONL logs to ~/.haze/logs
|
|
229
|
+
haze --continue # resume the latest saved session for this workspace
|
|
230
|
+
haze --resume <id> # resume an exact session id for this workspace
|
|
231
|
+
haze --no-session # run without durable session storage
|
|
207
232
|
```
|
|
208
233
|
|
|
209
234
|
Non-interactive / print mode:
|
|
@@ -211,12 +236,17 @@ Non-interactive / print mode:
|
|
|
211
236
|
```bash
|
|
212
237
|
haze -p "refactor utils.ts to remove the unused export"
|
|
213
238
|
haze -p "summarize this repo" --model openai:gpt-4o-mini
|
|
239
|
+
haze --resume <id> -p "continue the investigation"
|
|
214
240
|
haze -p "list the top 3 bugs in src/api.ts" --output json
|
|
215
241
|
haze -p "audit src/auth.ts" --output stream-json # live NDJSON events, then the result envelope
|
|
216
242
|
echo "what does this project do?" | haze
|
|
217
243
|
```
|
|
218
244
|
|
|
219
|
-
`-p`
|
|
245
|
+
`-p` and `--prompt` run one agentic turn with the full tool set and print the final assistant text. `--model` accepts a bare model name or `provider:name` and overrides the active model for that run without changing `~/.haze/settings.json`. The model must already be registered under a provider's `models`; add it once with `/provider`. Unknown or ambiguous selectors print a specific error to stderr and exit nonzero.
|
|
246
|
+
|
|
247
|
+
If you pipe stdin without `-p`, haze reads the prompt from stdin. Piped prompts are limited to 256 KiB; for larger input, pass a file path and ask haze to read it. One-shot runs do not create or update durable sessions, and they ignore `--continue`; `--resume <id>` can load an exact saved context for the turn without changing the original session. On a provider context overflow they compact the loaded conversation once, like the interactive path, and retry the same request; if there is too little history to compact, the run fails with a specific message. Add `--debug` to write a detailed JSONL log under `~/.haze/logs/`.
|
|
248
|
+
|
|
249
|
+
`--output` controls the result format: `text` is the default, `json` prints one final envelope, and `stream-json` writes live NDJSON events followed by the same envelope.
|
|
220
250
|
|
|
221
251
|
`--output json` prints a single-line envelope instead of plain text:
|
|
222
252
|
|
|
@@ -235,9 +265,9 @@ echo "what does this project do?" | haze
|
|
|
235
265
|
}
|
|
236
266
|
```
|
|
237
267
|
|
|
238
|
-
The `status` field is authoritative (driven by the agent's terminal state, not by parsing `result`), and the exit code mirrors it: `0` only for `complete`. A
|
|
268
|
+
The `status` field is authoritative (driven by the agent's terminal state, not by parsing `result`), and the exit code mirrors it: `0` only for `complete`. A run that ends without a substantive final answer, after an unresolved final tool failure, with declared tasks or required validation still unfinished (even if the model wrote a final message) is `failed` even if the provider returned normally; the evidence envelope carries the task counts and validation outcome that gated it. Per-turn step/tool budgets are safety boundaries, not completion: haze automatically continues the logical goal in fresh turns while measurable progress remains, so a budget boundary alone never fails a run. `--timeout` bounds the entire logical goal (not each internal turn). The result envelope additionally carries a `goal` object (physical turns used, stop reason, total mutations, final validation outcome and task counts) when goal-level continuation was involved.
|
|
239
269
|
|
|
240
|
-
`--output stream-json`
|
|
270
|
+
`--output stream-json` writes progress as the run happens. Each public event is one newline-delimited JSON object on stdout. The last line uses the same `{ type: "result", status, result, usage }` envelope as `--output json`, so consumers can display progress and parse the final result in the same way:
|
|
241
271
|
|
|
242
272
|
```jsonc
|
|
243
273
|
{"type":"turn_start","request":"audit src/auth.ts","at":"2026-06-27T22:00:00.000Z"}
|
|
@@ -250,32 +280,34 @@ The `status` field is authoritative (driven by the agent's terminal state, not b
|
|
|
250
280
|
{"type":"result","status":"complete","result":"Here are the findings…","usage":{"inputTokens":0,"outputTokens":0,"cacheReadTokens":0,"cacheWriteTokens":0,"reasoningTokens":0}}
|
|
251
281
|
```
|
|
252
282
|
|
|
253
|
-
|
|
283
|
+
Each line is valid JSON and can be piped through `jq -c .`. Event types include `turn_start`, `message_start` / `message_update` / `message_end`, `tool_start` / `tool_end`, `retry`, `context_overflow`, and `turn_end`. Every event has an ISO-8601 `at` timestamp. Tool events omit raw inputs and outputs because CI and harness logs often capture stdout; use `--debug` for detailed local JSONL logs.
|
|
254
284
|
|
|
255
|
-
|
|
285
|
+
This mode is intended for harnesses that run haze without a person at the terminal. A supervisor can watch stdout for progress, stalls, or loops. The final `result` envelope contains the authoritative status, text, and usage. The `text` and `json` formats are unchanged.
|
|
286
|
+
|
|
287
|
+
By default, haze does not write detailed LLM logs under `~/.haze/logs/`; those files contain full prompts, messages, and tool I/O. Run `haze --debug` to enable file logging and the on-screen debug panel. Use `/logs` to review saved logs.
|
|
256
288
|
|
|
257
289
|
## Agent tools
|
|
258
290
|
|
|
259
|
-
haze
|
|
291
|
+
haze has a small built-in toolset:
|
|
260
292
|
|
|
261
|
-
- `listFiles`
|
|
262
|
-
- `readFile`
|
|
263
|
-
- `grep`
|
|
264
|
-
- `editFile`
|
|
265
|
-
- `replaceLines`
|
|
266
|
-
- `writeFile`
|
|
267
|
-
- `bash`
|
|
268
|
-
- `readToolOutput`
|
|
269
|
-
- `fetch`
|
|
270
|
-
- `writeTasks`
|
|
271
|
-
- `skill`
|
|
272
|
-
- `lspWorkspaceSymbols`, `lspSymbols`, `lspDefinition`, `lspReferences`
|
|
293
|
+
- `listFiles` handles structured discovery and recursive listings, with cursor pagination when needed.
|
|
294
|
+
- `readFile` returns numbered UTF-8 lines in bounded pages, with `nextOffset` when more remain. It keeps a small, signature-checked index of line offsets so later pages do not start from the top of the file. File contents are not cached.
|
|
295
|
+
- `grep` runs structured ripgrep searches with a global result cap and compacts long lines and result sets. It rejects directly named ignored roots unless `includeIgnored` is set.
|
|
296
|
+
- `editFile` makes unique text replacements, tolerates accidental line-number prefixes, and returns a structured diff.
|
|
297
|
+
- `replaceLines` edits line ranges when exact replacements are awkward, clamps ranges that extend slightly past EOF, and returns a structured diff.
|
|
298
|
+
- `writeFile` creates, overwrites, or appends files and parent directories, returning a diff for each successful content change.
|
|
299
|
+
- `bash` runs tests, builds, git and gh commands, scripts, installs, and other shell work. It trims output according to the command type while keeping useful failure details. A timeout or abort kills the process tree, escalates if necessary, and returns even when an escaped child keeps stdout or stderr open.
|
|
300
|
+
- `readToolOutput` pages through retained raw output omitted from oversized or reduced results, subject to in-memory budgets.
|
|
301
|
+
- `fetch` reads public `http(s)` URLs as Markdown, formatted JSON, or text. It rejects non-HTTP schemes, private and loopback addresses, metadata hosts, and malformed IPv6-like hosts. Bounded output remains available through `readToolOutput`.
|
|
302
|
+
- `writeTasks` replaces the task list at meaningful phase changes. Completed lists clear on the next user turn.
|
|
303
|
+
- `skill` loads an installed Markdown workflow or one of its references.
|
|
304
|
+
- `lspWorkspaceSymbols`, `lspSymbols`, `lspDefinition`, and `lspReferences` provide optional read-only navigation through configured language servers. They appear only when an enabled server command is installed.
|
|
273
305
|
|
|
274
|
-
Tool calls are grouped in the transcript so you can see what happened without reading a novella.
|
|
306
|
+
Tool calls are grouped in the transcript so you can see what happened without reading a novella. Every successful `editFile`, `replaceLines`, and `writeFile` content change shows colored additions and removals with line numbers and context. Large diffs keep an eight-row preview—the first four and last four rows, separated by an omission marker—and expose the complete retained diff through `readToolOutput`; no-op mutations are labeled explicitly. File-tool failures include a reason code and a recovery hint. Large bash, search, and fetch results stay behind an in-memory handle. Later model calls see a compact summary tailored to validation, git, search, diffs, JSON, logs, or the head and tail of the output.
|
|
275
307
|
|
|
276
308
|
### Optional LSP navigation
|
|
277
309
|
|
|
278
|
-
haze can use
|
|
310
|
+
haze can use stdio Language Server Protocol servers for semantic code navigation. Open `/lsp` to add a preset or custom command, then enable, disable, or remove it. The presets cover TypeScript, Rust, Python, Go, and PHP. You install the server yourself. haze only exposes LSP tools when an enabled server command is on `PATH`; otherwise it uses `grep`, `listFiles`, and `readFile`. When haze closes a server or rejects malformed protocol output, it terminates the server's process tree and forces it to exit if necessary.
|
|
279
311
|
|
|
280
312
|
Example TypeScript setup:
|
|
281
313
|
|
|
@@ -290,13 +322,43 @@ npm install -g typescript typescript-language-server
|
|
|
290
322
|
|
|
291
323
|
## Subagents
|
|
292
324
|
|
|
293
|
-
|
|
325
|
+
A subagent is a disposable worker with its own context. It is useful for a repository survey, log diagnosis, documentation search, or noisy validation run that would swamp the main conversation. The point is to isolate context, not merely to run things in parallel.
|
|
326
|
+
|
|
327
|
+
The worker receives a bounded description of its objective, deliverable, mode, and scope. It does not see the main conversation or sibling conversations, and it loads the relevant `AGENTS.md` or `CLAUDE.md` files itself. Only its compact result returns to the parent model. Tool logs, timings, usage, and estimated context savings stay out of that context.
|
|
328
|
+
|
|
329
|
+
The available modes are `inspect` (read-only), `research` (read-only with public fetch), `implement` (file changes and coordinated bash), and `validate` (reads and coordinated bash). Read-only modes cannot change files. Workers that can make changes are serialized with each other and with changes from the main turn. This coordination is not a shell sandbox.
|
|
330
|
+
|
|
331
|
+
Tool-call budgets apply to each execution, including calls submitted together. At the deadline, haze returns a terminal result and aborts the worker. If the underlying code ignores the abort, haze quarantines it and keeps its actual concurrency and mutation slot occupied until it settles. Retries stay within the same turn scope. Result handles exist only in the current process and are not durable, so each compact deliverable must stand on its own.
|
|
332
|
+
|
|
333
|
+
`/fleet` remains parallel-only model decomposition over the same worker primitive. Its control guidance is ephemeral and sessions retain only the original invocation, task/result capsules, and final answer. Supported one-run flags are:
|
|
334
|
+
|
|
335
|
+
```text
|
|
336
|
+
/fleet --review <prompt>
|
|
337
|
+
/fleet --profile local-safe <prompt>
|
|
338
|
+
/fleet --workers provider:model <prompt>
|
|
339
|
+
/fleet --concurrency 2 <prompt>
|
|
340
|
+
/fleet -- --prompt-that-starts-with-a-flag
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Built-in profiles are `local-safe`, `local-throughput`, `cloud-balanced`, and `cloud-fast`. haze never infers a profile from a provider name or endpoint URL. If no profile is selected, it uses a provider-neutral compatibility baseline. If no worker model is set, it reuses the explicitly selected active model. An invalid worker model or profile blocks execution instead of falling back. Settings can select or customize profiles:
|
|
344
|
+
|
|
345
|
+
```json
|
|
346
|
+
{
|
|
347
|
+
"subagents": {
|
|
348
|
+
"workerModel": "local:qwen3-coder",
|
|
349
|
+
"defaultProfile": "local-safe",
|
|
350
|
+
"profiles": {"local-safe": {"maxConcurrency": 1, "deadlineMs": 300000}}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
```
|
|
294
354
|
|
|
295
|
-
|
|
355
|
+
Keep trivial, conversation-coupled, sequential, user-interactive, or uncertain shared-mutation work in the main thread.
|
|
296
356
|
|
|
297
357
|
## Context files
|
|
298
358
|
|
|
299
|
-
haze saves durable workspace sessions in `~/.haze/sessions`. Settings, history, sessions, and debug logs use private POSIX directory/file permissions (`0700`/`0600`) and ordered, flushable writes. Use `/session` to see the current file, `/new` to start fresh, `/resume` to
|
|
359
|
+
haze saves durable workspace sessions in `~/.haze/sessions`. It writes a session after the first resumable message, so empty sessions do not create files or appear under `/resume`. Settings, history, sessions, and debug logs use private POSIX directory/file permissions (`0700`/`0600`) and ordered, flushable writes. Use `/session` to see the current file, `/new` to start fresh, and `/resume` to browse workspace sessions, resume one, or fork its latest snapshot into a new session. `/resume <id>` and `haze --resume <id>` select an exact session. Use `/compact` to condense older model context: by default the active model writes a continuity summary of the older history (set `manualCompaction: "heuristic"` in settings to keep the model-free bounded excerpt instead); automatic mid-turn compaction always uses the heuristic excerpt. Sessions also persist compact structured work state: the active goal, touched files, validation evidence, blockers, and next action.
|
|
360
|
+
|
|
361
|
+
Snapshots are written at turn boundaries, not per tool call. If haze crashes or is killed mid-turn, the session resumes from the last completed turn: work already on disk (file edits, command side effects) is not reflected in the session record, so after a crash verify the working tree (`git status`, `git diff`) before continuing. To keep long sessions from growing quadratically — every turn appends the full history again — session files are automatically compacted once superseded snapshots dominate the file: only the newest conversation and work-state snapshots are kept and the file is rewritten atomically.
|
|
300
362
|
|
|
301
363
|
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.
|
|
302
364
|
|
|
@@ -310,17 +372,25 @@ haze loads project instructions from:
|
|
|
310
372
|
|
|
311
373
|
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.
|
|
312
374
|
|
|
313
|
-
Use `AGENTS.md` for project conventions, commands, architecture notes, and
|
|
375
|
+
Use `AGENTS.md` for project conventions, commands, architecture notes, and anything you do not want to explain again. Because context files are added to every request, `/init` keeps its discovery pass small, preserves useful existing guidance, and asks for a compact file.
|
|
314
376
|
|
|
315
377
|
## Safety model
|
|
316
378
|
|
|
317
|
-
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
-
|
|
379
|
+
haze is designed for attended use by an experienced developer on a single-user machine. It trusts the user and their global `~/.haze` configuration. Repository contents, project skills and instructions, fetched pages, MCP and LSP output, and model output are untrusted. A local attacker who already has access as the same operating-system user is outside this threat model.
|
|
380
|
+
|
|
381
|
+
Ordinary file and tool output is data, not instructions. The system prompt says that fetched content, MCP/LSP output, and files outside the workspace cannot override its rules. Project context files and project skills are the exceptions: haze loads them as designated instruction sources, labels them as repository-provided content, and keeps them below system and user instructions in priority. Prompt injection cannot be eliminated by labeling alone, so user supervision remains part of the security boundary.
|
|
382
|
+
|
|
383
|
+
Bash classification is informational. haze does not ask for confirmation before running commands, including commands that can mutate or delete data. This is an intentional trade-off for attended expert use, not a sandbox or permission boundary.
|
|
384
|
+
|
|
385
|
+
- Model-selected file tools are restricted to the current workspace and follow `.gitignore` by default.
|
|
386
|
+
- A path explicitly typed by the user with `@path` or as a slash-containing bare path may grant read-only access for that turn, including outside the workspace. It never grants mutation access.
|
|
387
|
+
- Ignored workspace files require an explicit override unless covered by that user-granted read exception. If Git cannot run at all, mutation tools refuse with `ignore_check_unavailable` (the safe direction for writes) — reads still proceed.
|
|
388
|
+
- The `fetch` tool only reads public `http(s)` URLs. It rejects other schemes along with private, loopback, link-local, cloud-metadata, and malformed IPv6-like hosts. On every redirect, haze connects to the public IP it already validated, which closes the DNS-rebinding gap.
|
|
389
|
+
- Project skills under `.haze/skills` are real-path-confined to the workspace and visibly labeled as untrusted repository content. Review them before using an unfamiliar repository.
|
|
390
|
+
|
|
391
|
+
With `--debug`, haze writes full request and message payloads to `~/.haze/logs/`. The files use private `0600` permissions on POSIX, but they can contain secrets and file contents. Do not share debug logs without reviewing and redacting them.
|
|
392
|
+
|
|
393
|
+
See [SECURITY.md](SECURITY.md) for supported versions and private vulnerability reporting.
|
|
324
394
|
|
|
325
395
|
## Local development
|
|
326
396
|
|
|
@@ -336,6 +406,28 @@ npm run context:report
|
|
|
336
406
|
|
|
337
407
|
`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.
|
|
338
408
|
|
|
409
|
+
### Running the checkout instead of a global install
|
|
410
|
+
|
|
411
|
+
A globally installed haze keeps serving its own code even while you work in a checkout — the exact failure mode where a fix lands locally but sessions keep running the old runtime. Two supported ways to run the checkout:
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
npm run haze -- <arguments> # run the source checkout directly, no global install touched
|
|
415
|
+
npm run dev:link # build, link globally, and verify `haze` on PATH resolves to this checkout
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
`npm run dev:link` builds the checkout, runs `npm link`, resolves `command -v haze`, and fails loudly unless the linked binary reports this checkout's version and commit. Restart any running haze process afterward — a live process never hot-swaps its code.
|
|
419
|
+
|
|
420
|
+
### Runtime provenance and diagnostics
|
|
421
|
+
|
|
422
|
+
Every build embeds a manifest (`dist/buildInfo.json`: version, commit, build time). The launcher verifies it before starting and refuses incomplete or stale builds with a rebuild hint instead of running partially outdated code.
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
haze --version --verbose # version, commit, runtime/executable paths, goal-supervisor state
|
|
426
|
+
haze doctor # provenance, artifact/manifest checks, capability registry, checkout-mismatch warning
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Session headers record the executing build (version + commit + build time), so a saved failure can be tied to the code that actually ran. When haze starts inside or below a checkout whose version/commit diverges from the running binary, it prints a startup warning naming both — it never switches runtimes silently.
|
|
430
|
+
|
|
339
431
|
Package check:
|
|
340
432
|
|
|
341
433
|
```bash
|
|
@@ -346,15 +438,19 @@ The npm package ships `bin`, `dist`, README, license, changelog, and examples.
|
|
|
346
438
|
|
|
347
439
|
## Release
|
|
348
440
|
|
|
441
|
+
The documentation site is committed as static HTML under `docs/`; there is no in-repository generator. Before a release, update the version stamps in every `docs/*.html` page and manually reconcile `index.html`, `quickstart.html`, `commands.html`, and `tools.html` with the README and changelog.
|
|
442
|
+
|
|
349
443
|
```bash
|
|
444
|
+
npm ci
|
|
350
445
|
npm run typecheck
|
|
351
446
|
npm test
|
|
352
447
|
npm run lint
|
|
353
448
|
npm run build
|
|
449
|
+
npm audit
|
|
354
450
|
npm pack --dry-run
|
|
355
451
|
git tag vX.Y.Z
|
|
356
452
|
git push origin main --tags
|
|
357
|
-
npm publish --access public
|
|
453
|
+
npm publish --access public --provenance
|
|
358
454
|
```
|
|
359
455
|
|
|
360
456
|
## License
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
|---------|-----------|
|
|
7
|
+
| Latest minor (`0.11.x`) | Yes — security fixes |
|
|
8
|
+
| Previous minors (`0.x`) | No — upgrade required |
|
|
9
|
+
|
|
10
|
+
Security fixes are provided for the latest published minor release. Upgrade to the newest release before reporting an issue that may already have been fixed.
|
|
11
|
+
|
|
12
|
+
## Reporting a vulnerability
|
|
13
|
+
|
|
14
|
+
Use GitHub's private vulnerability reporting for this repository. Do not open a public issue for a suspected vulnerability and do not include credentials, private source code, or unredacted haze debug logs in a public report.
|
|
15
|
+
|
|
16
|
+
Include the affected version, operating system, reproduction steps, impact, and any suggested mitigation. Reports are handled on a best-effort basis by the project maintainer. There is no guaranteed response or remediation SLA.
|
|
17
|
+
|
|
18
|
+
## Threat model
|
|
19
|
+
|
|
20
|
+
haze is intended for attended use by an experienced developer on a single-user machine. It trusts the user and their global `~/.haze` configuration. Repository contents, project instructions and skills, fetched web content, MCP and LSP servers, and model output are untrusted inputs. A local attacker who already has access as the same operating-system user is outside the supported threat model.
|
|
21
|
+
|
|
22
|
+
haze does not use command confirmation gates. Bash classification is informational, and relevant commands may mutate or delete data. Workspace confinement, bounded input and output, URL validation, private local storage, prompt-injection framing, and user supervision reduce risk, but haze is not a sandbox.
|
package/bin/haze.js
CHANGED
|
@@ -1,2 +1,103 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
// Verifying launcher for the compiled haze CLI.
|
|
3
|
+
//
|
|
4
|
+
// Before importing dist/, this shim proves the build is complete and current:
|
|
5
|
+
// 1. required compiled modules exist (index, goal supervisor, build manifest);
|
|
6
|
+
// 2. dist/buildInfo.json version matches package.json;
|
|
7
|
+
// 3. when the package root is a git checkout, the build commit matches HEAD.
|
|
8
|
+
// A stale or partial build fails with an actionable message instead of running
|
|
9
|
+
// partially outdated code. `--version` (optionally `--verbose`) is answered
|
|
10
|
+
// here directly so provenance works even while dist is being repaired.
|
|
11
|
+
//
|
|
12
|
+
// Deliberately dependency-free: only Node builtins, synchronous checks before
|
|
13
|
+
// any dynamic import, mirroring src/utils/buildInfo.ts (which serves doctor
|
|
14
|
+
// and the interactive UI with the same facts).
|
|
15
|
+
import {existsSync, readFileSync, realpathSync, statSync} from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import {fileURLToPath} from 'node:url';
|
|
18
|
+
|
|
19
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
20
|
+
const REQUIRED_ARTIFACTS = [
|
|
21
|
+
'dist/cli/index.js',
|
|
22
|
+
'dist/cli/commands/streaming/goalSupervisor.js',
|
|
23
|
+
'dist/buildInfo.json',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
function readJson(file) {
|
|
27
|
+
return JSON.parse(readFileSync(path.join(root, file), 'utf8'));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function readGitHead() {
|
|
31
|
+
const sha = (value) => (/^[0-9a-f]{7,40}$/i.test((value ?? '').trim()) ? value.trim() : undefined);
|
|
32
|
+
try {
|
|
33
|
+
const dotGit = path.join(root, '.git');
|
|
34
|
+
const stat = statSync(dotGit);
|
|
35
|
+
const gitDir = stat.isDirectory() ? dotGit : /gitdir:\s*(\S+)/.exec(readFileSync(dotGit, 'utf8'))?.[1];
|
|
36
|
+
if (!gitDir) return undefined;
|
|
37
|
+
const head = readFileSync(path.join(gitDir, 'HEAD'), 'utf8').trim();
|
|
38
|
+
if (!head.startsWith('ref:')) return sha(head);
|
|
39
|
+
const ref = head.slice(4).trim();
|
|
40
|
+
const refPath = path.join(gitDir, ref);
|
|
41
|
+
if (existsSync(refPath)) return sha(readFileSync(refPath, 'utf8'));
|
|
42
|
+
const packed = readFileSync(path.join(gitDir, 'packed-refs'), 'utf8');
|
|
43
|
+
const escaped = ref.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
44
|
+
return sha(new RegExp(`^([0-9a-f]{40}) ${escaped}$`, 'm').exec(packed)?.[1]);
|
|
45
|
+
} catch {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const problems = [];
|
|
51
|
+
let pkg;
|
|
52
|
+
let build;
|
|
53
|
+
try {
|
|
54
|
+
pkg = readJson('package.json');
|
|
55
|
+
} catch {
|
|
56
|
+
pkg = undefined;
|
|
57
|
+
problems.push('package.json is missing or unreadable at the installation root.');
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
build = readJson('dist/buildInfo.json');
|
|
61
|
+
} catch {
|
|
62
|
+
build = undefined;
|
|
63
|
+
}
|
|
64
|
+
for (const artifact of REQUIRED_ARTIFACTS) {
|
|
65
|
+
if (!existsSync(path.join(root, artifact))) {
|
|
66
|
+
problems.push(`${artifact} is missing — the compiled build is incomplete.`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (pkg?.version && build?.version && build.version !== pkg.version) {
|
|
70
|
+
problems.push(`dist/buildInfo.json says ${build.version}, but package.json is ${pkg.version} — the build output is stale.`);
|
|
71
|
+
}
|
|
72
|
+
const headCommit = readGitHead();
|
|
73
|
+
if (headCommit && build?.commit && build.commit !== headCommit) {
|
|
74
|
+
problems.push(`dist was built from commit ${String(build.commit).slice(0, 7)}, but the checkout is at ${headCommit.slice(0, 7)} — the build output is stale.`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (problems.length > 0) {
|
|
78
|
+
process.stderr.write('haze: refusing to start an incomplete or stale build.\n');
|
|
79
|
+
for (const problem of problems) process.stderr.write(` - ${problem}\n`);
|
|
80
|
+
process.stderr.write('Repair it with `npm run build` inside the haze checkout, then reinstall or `npm link`.\n');
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const argv = process.argv.slice(2);
|
|
85
|
+
if (argv.includes('--version') || argv.includes('-V')) {
|
|
86
|
+
const version = pkg?.version ?? build?.version ?? '0.0.0';
|
|
87
|
+
if (argv.includes('--verbose')) {
|
|
88
|
+
const lines = [
|
|
89
|
+
`Haze ${version}`,
|
|
90
|
+
`commit: ${build?.commit ?? 'unknown'}`,
|
|
91
|
+
...(build?.builtAt ? [`builtAt: ${build.builtAt}`] : []),
|
|
92
|
+
`runtime: ${path.join(root, 'dist')}`,
|
|
93
|
+
`executable: ${realpathSync(process.argv[1])}`,
|
|
94
|
+
`goal supervisor: ${existsSync(path.join(root, 'dist/cli/commands/streaming/goalSupervisor.js')) ? 'enabled' : 'disabled'}`,
|
|
95
|
+
];
|
|
96
|
+
process.stdout.write(`${lines.join('\n')}\n`);
|
|
97
|
+
} else {
|
|
98
|
+
process.stdout.write(`${version}\n`);
|
|
99
|
+
}
|
|
100
|
+
process.exit(0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
import('../dist/cli/index.js');
|