@denizokcu/haze 0.11.0 → 1.1.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 +33 -0
- package/README.md +28 -14
- package/SECURITY.md +5 -3
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/TaskBar.js +1 -1
- package/dist/cli/chat/chatMetrics.d.ts +2 -2
- package/dist/cli/chat/chatMetrics.js +1 -1
- package/dist/cli/chat/fileMentionSuggestions.js +1 -1
- package/dist/cli/chat/inputSuggestions.d.ts +8 -16
- package/dist/cli/chat/inputSuggestions.js +10 -41
- package/dist/cli/chat/messages.d.ts +0 -2
- package/dist/cli/chat/messages.js +5 -5
- package/dist/cli/chat/sessionLifecycle.d.ts +2 -1
- package/dist/cli/chat/turnState.d.ts +1 -1
- package/dist/cli/chat/wizardDispatch.d.ts +90 -28
- package/dist/cli/chat/wizardDispatch.js +257 -130
- package/dist/cli/commands/chat.js +61 -77
- package/dist/cli/commands/chatModes.d.ts +8 -1
- package/dist/cli/commands/chatModes.js +9 -44
- package/dist/cli/commands/commandHelp.js +2 -0
- package/dist/cli/commands/commands.js +2 -0
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/formatters.d.ts +3 -3
- package/dist/cli/commands/formatters.js +12 -25
- package/dist/cli/commands/providerWizard.js +2 -3
- package/dist/cli/commands/runCommand.js +1 -1
- package/dist/cli/commands/serverWizard.d.ts +34 -0
- package/dist/cli/commands/{mcpWizard.js → serverWizard.js} +44 -2
- package/dist/cli/commands/settingsSummary.js +2 -0
- package/dist/cli/commands/skillsWizard.d.ts +41 -0
- package/dist/cli/commands/{skillWizard.js → skillsWizard.js} +33 -11
- package/dist/cli/commands/streaming/abortCause.d.ts +2 -1
- package/dist/cli/commands/streaming/agentAttempt.d.ts +43 -0
- package/dist/cli/commands/streaming/agentAttempt.js +79 -0
- package/dist/cli/commands/streaming/attemptLifecycle.d.ts +56 -0
- package/dist/cli/commands/streaming/attemptLifecycle.js +110 -0
- package/dist/cli/commands/streaming/attemptOutcome.d.ts +96 -0
- package/dist/cli/commands/streaming/attemptOutcome.js +206 -0
- package/dist/cli/commands/streaming/attemptSetup.d.ts +78 -0
- package/dist/cli/commands/streaming/attemptSetup.js +167 -0
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +1 -1
- package/dist/cli/commands/streaming/goalCheckpoint.js +2 -2
- package/dist/cli/commands/streaming/goalSupervisor.js +9 -6
- package/dist/cli/commands/streaming/stallRecovery.d.ts +94 -0
- package/dist/cli/commands/streaming/stallRecovery.js +105 -0
- package/dist/cli/commands/streaming/streamLoop.d.ts +72 -0
- package/dist/cli/commands/streaming/streamLoop.js +448 -0
- package/dist/cli/commands/streaming/toolCallRecovery.d.ts +14 -0
- package/dist/cli/commands/streaming/toolCallRecovery.js +56 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +2 -1
- package/dist/cli/commands/streaming/turnRuntime.d.ts +4 -0
- package/dist/cli/commands/streaming/turnRuntime.js +6 -0
- package/dist/cli/commands/streaming.d.ts +14 -25
- package/dist/cli/commands/streaming.js +43 -754
- package/dist/cli/commands/themesCommand.d.ts +17 -0
- package/dist/cli/commands/themesCommand.js +24 -0
- package/dist/cli/commands/wizardFlow.d.ts +341 -0
- package/dist/cli/commands/wizardFlow.js +397 -0
- package/dist/cli/contextReport.js +3 -0
- package/dist/cli/index.js +1 -1
- package/dist/config/contextFiles.js +9 -3
- package/dist/config/inputHistory.d.ts +0 -1
- package/dist/config/inputHistory.js +1 -1
- package/dist/config/modelDiscovery.d.ts +0 -15
- package/dist/config/modelDiscovery.js +1 -1
- package/dist/config/settings.d.ts +9 -0
- package/dist/config/settings.js +4 -0
- package/dist/config/skillSettings.js +4 -4
- package/dist/config/updateCheck.d.ts +0 -1
- package/dist/config/updateCheck.js +1 -1
- package/dist/core/agent/budgets.d.ts +63 -1
- package/dist/core/agent/budgets.js +84 -1
- package/dist/core/agent/compaction.js +1 -1
- package/dist/core/agent/completionController.d.ts +7 -13
- package/dist/core/agent/completionController.js +17 -8
- package/dist/core/agent/contextBudget.d.ts +0 -4
- package/dist/core/agent/contextBudget.js +3 -3
- package/dist/core/agent/errors.d.ts +0 -1
- package/dist/core/agent/errors.js +1 -1
- package/dist/core/agent/events.d.ts +5 -1
- package/dist/core/{goal/completionPolicy.d.ts → agent/goalPolicy.d.ts} +18 -0
- package/dist/core/agent/goalPolicy.js +106 -0
- package/dist/core/agent/requestAssembly.d.ts +2 -2
- package/dist/core/agent/requestAssembly.js +16 -4
- package/dist/core/agent/toolCapabilities.d.ts +2 -2
- package/dist/core/agent/toolCapabilities.js +5 -5
- package/dist/core/agent/toolOutputStore.js +1 -1
- package/dist/core/agent/toolResults.js +1 -1
- package/dist/core/agent/workState.d.ts +6 -3
- package/dist/core/agent/workState.js +62 -7
- package/dist/core/attachments/imageAttachments.js +90 -42
- package/dist/core/deadline.d.ts +0 -6
- package/dist/core/deadline.js +1 -1
- package/dist/core/io/boundedRead.js +1 -1
- package/dist/core/limits.d.ts +51 -0
- package/dist/core/limits.js +51 -0
- package/dist/core/log/llmLog.js +1 -1
- package/dist/core/process/backgroundRegistry.d.ts +2 -3
- package/dist/core/process/backgroundRegistry.js +10 -6
- package/dist/core/process/userShell.d.ts +16 -0
- package/dist/core/process/userShell.js +59 -0
- package/dist/core/safety/secretPaths.d.ts +18 -0
- package/dist/core/safety/secretPaths.js +115 -0
- package/dist/core/safety/shellClassifier.d.ts +11 -0
- package/dist/core/safety/{bashClassifier.js → shellClassifier.js} +5 -3
- package/dist/core/safety/urlGuard.d.ts +1 -1
- package/dist/core/session/sessionSlimming.d.ts +0 -3
- package/dist/core/session/sessionSlimming.js +2 -3
- package/dist/core/session/sessionStore.d.ts +1 -0
- package/dist/core/session/sessionStore.js +39 -20
- package/dist/core/{bashOutput → shellOutput}/lineFilter.js +8 -2
- package/dist/core/{bashOutput → shellOutput}/reducers/search.d.ts +0 -1
- package/dist/core/{bashOutput → shellOutput}/reducers/search.js +1 -1
- package/dist/core/shellOutput/registry.d.ts +2 -0
- package/dist/core/{bashOutput → shellOutput}/registry.js +3 -3
- package/dist/core/{bashOutput → shellOutput}/types.d.ts +6 -5
- package/dist/core/subagent/contracts.d.ts +2 -14
- package/dist/core/subagent/contracts.js +3 -3
- package/dist/core/subagent/executionProfiles.js +2 -2
- package/dist/core/subagent/subagentRunner.js +3 -4
- package/dist/core/toolOutput/reduction.d.ts +0 -12
- package/dist/core/toolOutput/reduction.js +1 -1
- package/dist/core/validation/outputParser.d.ts +2 -2
- package/dist/llm/client.js +5 -1
- package/dist/llm/hazeTools.d.ts +139 -124
- package/dist/llm/hazeTools.js +20 -11
- package/dist/llm/initPrompt.js +1 -1
- package/dist/llm/lsp/client.d.ts +45 -0
- package/dist/llm/lsp/client.js +195 -0
- package/dist/llm/lsp/pool.d.ts +23 -0
- package/dist/llm/lsp/pool.js +86 -0
- package/dist/llm/lsp/protocol.d.ts +64 -0
- package/dist/llm/lsp/protocol.js +128 -0
- package/dist/llm/lsp/requests.d.ts +94 -0
- package/dist/llm/lsp/requests.js +119 -0
- package/dist/llm/lspTools.d.ts +3824 -570
- package/dist/llm/lspTools.js +65 -1
- package/dist/llm/openaiCodex.d.ts +0 -2
- package/dist/llm/openaiCodex.js +0 -4
- package/dist/llm/openaiCodexOAuth.d.ts +0 -3
- package/dist/llm/openaiCodexOAuth.js +6 -3
- package/dist/llm/requestContext.d.ts +5 -1
- package/dist/llm/requestContext.js +25 -2
- package/dist/llm/systemPrompt.d.ts +1 -0
- package/dist/llm/systemPrompt.js +16 -7
- package/dist/llm/toolResultTypes.d.ts +1 -15
- package/dist/llm/toolResultTypes.js +1 -4
- package/dist/llm/tools/editMatch.d.ts +0 -9
- package/dist/llm/tools/editMatch.js +1 -1
- package/dist/llm/tools/failures.d.ts +6 -0
- package/dist/llm/tools/failures.js +8 -2
- package/dist/llm/tools/fetchTool.js +1 -1
- package/dist/llm/tools/fileToolShared.d.ts +4 -2
- package/dist/llm/tools/fileToolShared.js +9 -5
- package/dist/llm/tools/gitIgnore.d.ts +25 -32
- package/dist/llm/tools/gitIgnore.js +216 -98
- package/dist/llm/tools/grepParse.d.ts +2 -1
- package/dist/llm/tools/grepRunner.d.ts +1 -1
- package/dist/llm/tools/grepRunner.js +2 -2
- package/dist/llm/tools/outputCap.d.ts +2 -7
- package/dist/llm/tools/outputCap.js +3 -3
- package/dist/llm/tools/processTool.d.ts +16 -16
- package/dist/llm/tools/processTool.js +1 -1
- package/dist/llm/tools/readRecovery.d.ts +0 -2
- package/dist/llm/tools/readRecovery.js +4 -2
- package/dist/llm/tools/{bashTool.d.ts → shellTool.d.ts} +123 -107
- package/dist/llm/tools/{bashTool.js → shellTool.js} +18 -14
- package/dist/llm/tools/toolContext.js +5 -5
- package/dist/llm/tools/workspaceFile.d.ts +4 -4
- package/dist/llm/tools/workspaceFile.js +29 -17
- package/dist/llm/webFetch.d.ts +1 -1
- package/dist/skills/SkillLoader.d.ts +1 -11
- package/dist/skills/SkillLoader.js +1 -2
- package/dist/skills/types.d.ts +2 -1
- package/dist/ui/components/Header.js +1 -1
- package/dist/ui/components/MarkdownText.js +10 -10
- package/dist/ui/components/TextInput.d.ts +1 -1
- package/dist/ui/components/TextInput.js +2 -2
- package/dist/ui/terminalColors.d.ts +29 -0
- package/dist/ui/terminalColors.js +47 -0
- package/dist/ui/theme.d.ts +105 -10
- package/dist/ui/theme.js +126 -15
- package/dist/ui/themes/af-magic.d.ts +7 -0
- package/dist/ui/themes/af-magic.js +25 -0
- package/dist/ui/themes/agnoster.d.ts +10 -0
- package/dist/ui/themes/agnoster.js +40 -0
- package/dist/ui/themes/bira.d.ts +10 -0
- package/dist/ui/themes/bira.js +28 -0
- package/dist/ui/themes/bureau.d.ts +10 -0
- package/dist/ui/themes/bureau.js +28 -0
- package/dist/ui/themes/clean.d.ts +9 -0
- package/dist/ui/themes/clean.js +27 -0
- package/dist/ui/themes/cloud.d.ts +6 -0
- package/dist/ui/themes/cloud.js +24 -0
- package/dist/ui/themes/dst.d.ts +10 -0
- package/dist/ui/themes/dst.js +28 -0
- package/dist/ui/themes/fishy.d.ts +7 -0
- package/dist/ui/themes/fishy.js +25 -0
- package/dist/ui/themes/index.d.ts +8 -0
- package/dist/ui/themes/index.js +36 -0
- package/dist/ui/themes/light.d.ts +3 -0
- package/dist/ui/themes/light.js +21 -0
- package/dist/ui/themes/purple.d.ts +7 -0
- package/dist/ui/themes/purple.js +26 -0
- package/dist/ui/themes/robbyrussell.d.ts +8 -0
- package/dist/ui/themes/robbyrussell.js +26 -0
- package/dist/ui/themes/solarized-dark.d.ts +16 -0
- package/dist/ui/themes/solarized-dark.js +44 -0
- package/dist/ui/themes/solarized-light.d.ts +12 -0
- package/dist/ui/themes/solarized-light.js +40 -0
- package/dist/ui/themes/steeef.d.ts +11 -0
- package/dist/ui/themes/steeef.js +29 -0
- package/dist/utils/buildInfo.d.ts +6 -13
- package/dist/utils/buildInfo.js +6 -15
- package/dist/utils/fs.d.ts +7 -5
- package/dist/utils/fs.js +5 -2
- package/dist/utils/path.d.ts +0 -1
- package/dist/utils/path.js +1 -1
- package/package.json +6 -4
- package/dist/cli/commands/lspWizard.d.ts +0 -14
- package/dist/cli/commands/lspWizard.js +0 -44
- package/dist/cli/commands/mcpWizard.d.ts +0 -15
- package/dist/cli/commands/skillConfirmRemove.d.ts +0 -11
- package/dist/cli/commands/skillConfirmRemove.js +0 -20
- package/dist/cli/commands/skillCreation.d.ts +0 -12
- package/dist/cli/commands/skillCreation.js +0 -14
- package/dist/cli/commands/skillWizard.d.ts +0 -17
- package/dist/cli/commands/streaming/idleTimer.d.ts +0 -26
- package/dist/cli/commands/streaming/idleTimer.js +0 -24
- package/dist/cli/commands/streaming/turnOutcome.d.ts +0 -27
- package/dist/cli/commands/streaming/turnOutcome.js +0 -29
- package/dist/cli/commands/wizardActions.d.ts +0 -47
- package/dist/cli/commands/wizardActions.js +0 -47
- package/dist/cli/commands/wizardInput.d.ts +0 -4
- package/dist/cli/commands/wizardInput.js +0 -19
- package/dist/cli/commands/wizardPrompts.d.ts +0 -22
- package/dist/cli/commands/wizardPrompts.js +0 -58
- package/dist/cli/commands/wizardSuggestions.d.ts +0 -31
- package/dist/cli/commands/wizardSuggestions.js +0 -190
- package/dist/cli/commands/wizardTransition.d.ts +0 -37
- package/dist/cli/commands/wizardTransition.js +0 -43
- package/dist/core/agent/toolExecutionBudget.d.ts +0 -35
- package/dist/core/agent/toolExecutionBudget.js +0 -49
- package/dist/core/agent/turnBudget.d.ts +0 -35
- package/dist/core/agent/turnBudget.js +0 -27
- package/dist/core/bashOutput/ansi.d.ts +0 -1
- package/dist/core/bashOutput/ansi.js +0 -7
- package/dist/core/bashOutput/registry.d.ts +0 -4
- package/dist/core/goal/completionPolicy.js +0 -43
- package/dist/core/goal/requestClassifier.d.ts +0 -3
- package/dist/core/goal/requestClassifier.js +0 -18
- package/dist/core/goal/sessionGoal.d.ts +0 -8
- package/dist/core/goal/sessionGoal.js +0 -30
- package/dist/core/limits/byteBudgets.d.ts +0 -20
- package/dist/core/limits/byteBudgets.js +0 -20
- package/dist/core/limits/textBudgets.d.ts +0 -25
- package/dist/core/limits/textBudgets.js +0 -25
- package/dist/core/safety/bashClassifier.d.ts +0 -10
- package/dist/llm/lsp.d.ts +0 -149
- package/dist/llm/lsp.js +0 -368
- package/dist/ui/components/ErrorView.d.ts +0 -4
- package/dist/ui/components/ErrorView.js +0 -7
- package/dist/utils/yaml.d.ts +0 -2
- package/dist/utils/yaml.js +0 -8
- package/examples/skills/files/SKILL.md +0 -16
- package/examples/skills/files/examples/file-editing.md +0 -3
- /package/dist/core/{bashOutput → shellOutput}/command.d.ts +0 -0
- /package/dist/core/{bashOutput → shellOutput}/command.js +0 -0
- /package/dist/core/{bashOutput → shellOutput}/lineFilter.d.ts +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/content.d.ts +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/content.js +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/gh.d.ts +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/gh.js +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/git.d.ts +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/git.js +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/validation.d.ts +0 -0
- /package/dist/core/{bashOutput → shellOutput}/reducers/validation.js +0 -0
- /package/dist/core/{bashOutput → shellOutput}/types.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0 - 2026-08-19
|
|
4
|
+
|
|
5
|
+
Theming and secrets. Two user-facing layers landed in this release: a full terminal theme system (14 built-in palettes, live switching, terminal-default adoption) and hard secret-file protection across every file tool.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Terminal theming: `src/ui/theme.ts` is the shared palette singleton (semantic roles — accent, command, muted, success/danger pairs, surface backgrounds — resolved through the oh-my-zsh/zsh color vocabulary of zsh names, xterm-256 indices, or `#rrggbb` hex), and `src/ui/themes/` is a one-file-per-theme registry keyed by settings name, seeded with the default `purple` and `light` palettes plus oh-my-zsh ports (`robbyrussell`, `af-magic`, `agnoster`, `bira`, `bureau`, `clean`, `cloud`, `dst`, `fishy`, `solarized-dark`, `solarized-light`, `steeef`). Themes own both terminal defaults: haze adopts the theme's foreground and background via OSC 10/11 at startup and restores them (OSC 110/111) on exit, so light palettes never paint a light canvas under dark-default text. A `theme` key in `~/.haze/settings.json` selects the palette (validated loudly at startup with the valid names listed), and the new `/themes` command switches it: the picker labels each theme light/dark and marks the active one, `/themes <name>` sets one directly, and switching applies live without a restart — already-printed transcript text keeps its old colors (Ink `<Static>` stays as-rendered), which is accepted behavior. `docs/theming-plan.md` documents the research, the role table, and the conversion guides for porting oh-my-zsh, VS Code, and Sublime themes.
|
|
10
|
+
|
|
11
|
+
- Hard secret-file protection in every file tool: SSH keys (`~/.ssh/**`, `id_*` private keys), shell history files, `.env`/`.envrc` files (excluding `.example`/`.sample`/`.template` documentation variants), `*.pem`/`*.key`, `secrets.{json,yaml,yml,toml}`, and common home credential stores (`~/.aws`, `~/.gnupg`, `~/.netrc`, `~/.git-credentials`, and others; see `src/core/safety/secretPaths.ts`) are refused for reads *and* mutations before any filesystem access. The check covers lexical and real paths (symlink-proof in both directions), wins over user-typed `@path` read blessings and `allowIgnored`, and grep traversal excludes the protected names with negated-only globs appended after any model-supplied glob (a later ripgrep glob takes precedence, so an explicit glob cannot re-include secrets; positive re-include globs would whitelist the search, which is why documentation variants are excluded from traversal but stay readable via targeted `readFile`). Refusals are terminal structured results (`secret_file_protected`, `recoverable: false`, ask-the-user next step, no content echoed) so models do not burn steps retrying, and the transcript shows them as `blocked: protected secret file (path)`, distinct from ordinary failures. The `shell` tool is deliberately not command-filtered: secret avoidance in shell is instructed through the system prompt (`SECRET_FILE_RULE`), aligned with the file-tool refusal wording.
|
|
12
|
+
|
|
13
|
+
## 1.0.0 - 2026-08-16
|
|
14
|
+
|
|
15
|
+
The first stable release. The CLI flags, settings schema, `stream-json` event contract, session format, skill layout, and structured tool-result shape are now covered by the 1.x compatibility promise: breaking changes to them require a new major version.
|
|
16
|
+
|
|
17
|
+
This release was validated with a differential Harbor benchmark (`local/csv-query`, glm-5.3, four harnesses — claude-code, nanocoder, pi, haze — same model and backend): haze 1.0.0 passed 17/17 verifier tests with the fewest input tokens of the reporting harnesses, a clean goal envelope (1 cycle, structured passing validation), and zero stalls; the four defects the benchmark surfaced earlier were all fixed on this line. Full report: `benchmarks/harbor/results/20260816-224944-glm53-differential.html`.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Configurable model-retry pool (`modelRetries` setting, integer 0–10, default 2): the shared bounded pool that retries transient model errors and idle-stream stalls is no longer hardcoded. Providers that terminate long streams aggressively (Z.ai's OpenAI-compatible endpoint repeatedly stalled or terminated long streams, exhausting the old fixed pool of 2 and failing a 28-minute benchmark run) can now be given more headroom, and `0` disables automatic retries entirely (stalls pause with the goal preserved for an interactive resume). The effective pool size is reported in `timeout` and `retry` stream events (`maxRetries`) and in stall diagnostics, so headless consumers can see the configured bound.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
All four defects below were surfaced by the csv-query differential benchmark (same model across harnesses isolates the harness) and carry regression coverage:
|
|
26
|
+
|
|
27
|
+
- `writeFile` no longer shadows its own chunking guidance with a cryptic `AI_TypeValidationError`: the input schema previously capped `content` at 16 KiB, so an oversized single-chunk write died at Zod validation before `execute` could return the actionable `write_chunk_too_large` advice (write the first chunk, then `append=true`). Size policy now lives only in `execute`.
|
|
28
|
+
- Reads fail open in Git-less workspaces again, restoring the documented contract: `readFile` threw `ignore_check_unavailable` when Git was absent (common in benchmark and container environments) instead of tolerating `unknown` ignore status. Mutations keep failing closed when ignore status is unverifiable.
|
|
29
|
+
- The shell validation classifier is no longer JS-toolchain-biased: common Python, Go, Rust, Make, Maven, Gradle, Ruby, .NET, Deno, Bun, and Node test commands now count as bounded validation evidence, and direct, unchained execution of a file changed during the active goal also counts — so a successful `node tool.js … data.csv` run satisfies completion without crediting unrelated shell commands.
|
|
30
|
+
- Custom checks are now visible to the completion gate: `shell` accepts `purpose=validation`, producing structured evidence from the real exit result for ad hoc assertion scripts. Missing-validation repair gets one focused slice, rejected summaries leave active model context, and mutation/revision churn no longer extends the goal. Deadline exits preserve cumulative evidence and report `goal-deadline`, not `user-aborted`.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- `SECURITY.md` supported-series table now tracks the `1.x` major (security fixes for the latest published release; pre-1.0 versions require an upgrade).
|
|
35
|
+
|
|
3
36
|
## 0.11.0 - 2026-08-15
|
|
4
37
|
|
|
5
38
|
### Added
|
package/README.md
CHANGED
|
@@ -2,19 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
A minimal LLM harness for your terminal.
|
|
4
4
|
|
|
5
|
-
## What's new in
|
|
5
|
+
## What's new in 1.1.0
|
|
6
6
|
|
|
7
|
-
haze
|
|
7
|
+
haze 1.1.0 adds a terminal theme system and hard secret-file protection.
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
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.
|
|
9
|
+
- Terminal theming: 14 built-in palettes — the default `purple`, a `light` pair, and oh-my-zsh ports like `robbyrussell`, `af-magic`, `agnoster`, and `solarized-dark`/`solarized-light`. `/themes` opens a picker (each theme labeled light/dark, the active one marked); `/themes <name>` sets one directly. Switching applies live without a restart, and the selection persists as `theme` in `~/.haze/settings.json`. A theme owns both terminal defaults — haze adopts its foreground/background (OSC 10/11) on start and restores yours on exit — so already-printed transcript text keeps its old colors, which is accepted behavior. `docs/theming-plan.md` documents the role vocabulary and the conversion guides for porting more themes.
|
|
10
|
+
- Hard secret-file protection in every file tool: SSH keys, shell history files, `.env`/`.envrc` (documentation variants excepted), `*.pem`/`*.key`, and common home credential stores are refused for reads and mutations before any filesystem access — terminal `secret_file_protected` results, symlink-proof in both directions, immune to user-granted read exceptions and ignore overrides, with grep traversal skipping the protected names. The `shell` tool remains unfiltered by design; secret avoidance there is instructed through the system prompt and stays inside your supervision boundary.
|
|
15
11
|
|
|
16
12
|
Previous releases:
|
|
17
13
|
|
|
14
|
+
- `1.0.0`: first stable release — the CLI flags, settings schema, `stream-json` event contract, session format, skill layout, and structured tool-result shape under the 1.x compatibility promise; a configurable model-retry pool; and four benchmark-driven reliability fixes (validated with the Harbor differential benchmark: 17/17 verifier tests, fewest input tokens of the reporting harnesses, zero stalls).
|
|
15
|
+
- `0.11.0`: goal-level autonomy across physical-turn budgets (logical-goal supervisor, evidence-gated completion, `goal_*` stream events, cumulative goal envelope), runtime provenance and `haze doctor` (embedded build info, stale-build refusal, session build headers), model-aware context budgeting (per-preset limits, live discovery, 128K fallback, self-healing context overflow), headless `--timeout` with per-tool deadlines and abort-cause typing, performance work (batched ignore checks, LSP reuse, coalesced/vacuumed sessions, memoized estimates, incremental streaming, viewport-clamped live region), and model-written `/compact` summaries with a heuristic fallback.
|
|
18
16
|
- `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
17
|
|
|
20
18
|
- `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.
|
|
@@ -46,10 +44,12 @@ haze keeps guardrails light. The LLM can work from the terminal with access clos
|
|
|
46
44
|
|
|
47
45
|
### Supervision model
|
|
48
46
|
|
|
49
|
-
There is **no sandbox and no permission layer**:
|
|
47
|
+
There is **no sandbox and no permission layer**: the shell tool runs unsupervised in your login shell (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.
|
|
50
48
|
|
|
51
49
|
## Getting started
|
|
52
50
|
|
|
51
|
+
haze runs on macOS and Linux with Node.js 22 or newer. Windows is not yet a supported platform (the toolchain assumes a POSIX shell); it is on the 1.x roadmap.
|
|
52
|
+
|
|
53
53
|
Install haze:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
@@ -93,6 +93,8 @@ API keys for HTTP/SSE servers are entered in a masked prompt and sent as `Author
|
|
|
93
93
|
|
|
94
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`.
|
|
95
95
|
|
|
96
|
+
Switch the interface palette with `/themes`. The picker lists every built-in theme — light palettes and oh-my-zsh ports like `robbyrussell`, `af-magic`, and `solarized-dark` — and applies the choice immediately; `/themes <name>` sets one directly. The selection persists as `theme` in `~/.haze/settings.json`, and text already on screen keeps its old colors.
|
|
97
|
+
|
|
96
98
|
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.
|
|
97
99
|
|
|
98
100
|
## Start using haze
|
|
@@ -103,7 +105,7 @@ Open a project and ask for work:
|
|
|
103
105
|
create a calculator in calc-app in ruby with add subtract multiply divide
|
|
104
106
|
```
|
|
105
107
|
|
|
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.
|
|
108
|
+
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. Shell 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
109
|
|
|
108
110
|
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.
|
|
109
111
|
|
|
@@ -203,6 +205,8 @@ When you catch yourself repeating the same instructions, put them in a skill. Th
|
|
|
203
205
|
/model list
|
|
204
206
|
/settings
|
|
205
207
|
/settings open
|
|
208
|
+
/themes
|
|
209
|
+
/themes <name>
|
|
206
210
|
/logs [id]
|
|
207
211
|
/lsp
|
|
208
212
|
/mcp
|
|
@@ -296,14 +300,14 @@ haze has a small built-in toolset:
|
|
|
296
300
|
- `editFile` makes unique text replacements, tolerates accidental line-number prefixes, and returns a structured diff.
|
|
297
301
|
- `replaceLines` edits line ranges when exact replacements are awkward, clamps ranges that extend slightly past EOF, and returns a structured diff.
|
|
298
302
|
- `writeFile` creates, overwrites, or appends files and parent directories, returning a diff for each successful content change.
|
|
299
|
-
- `
|
|
303
|
+
- `shell` runs tests, builds, git and gh commands, scripts, installs, and other command-line work in your configured login shell. Set `HAZE_SHELL` to an explicit executable for deterministic CI or service accounts. Its schema identifies the active shell dialect. Output is trimmed according to the command type while preserving 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
304
|
- `readToolOutput` pages through retained raw output omitted from oversized or reduced results, subject to in-memory budgets.
|
|
301
305
|
- `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
306
|
- `writeTasks` replaces the task list at meaningful phase changes. Completed lists clear on the next user turn.
|
|
303
307
|
- `skill` loads an installed Markdown workflow or one of its references.
|
|
304
308
|
- `lspWorkspaceSymbols`, `lspSymbols`, `lspDefinition`, and `lspReferences` provide optional read-only navigation through configured language servers. They appear only when an enabled server command is installed.
|
|
305
309
|
|
|
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
|
|
310
|
+
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; protected secret files (SSH keys, shell histories, `.env` files, credentials) are refused outright with `secret_file_protected` and show as `blocked: protected secret file` in the transcript. Large shell, 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.
|
|
307
311
|
|
|
308
312
|
### Optional LSP navigation
|
|
309
313
|
|
|
@@ -326,7 +330,7 @@ A subagent is a disposable worker with its own context. It is useful for a repos
|
|
|
326
330
|
|
|
327
331
|
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
332
|
|
|
329
|
-
The available modes are `inspect` (read-only), `research` (read-only with public fetch), `implement` (file changes and coordinated
|
|
333
|
+
The available modes are `inspect` (read-only), `research` (read-only with public fetch), `implement` (file changes and coordinated shell access), and `validate` (reads and coordinated shell access). 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
334
|
|
|
331
335
|
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
336
|
|
|
@@ -374,15 +378,25 @@ At the same scope, `AGENTS.md` overrides `CLAUDE.md`; global haze guidance in `~
|
|
|
374
378
|
|
|
375
379
|
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.
|
|
376
380
|
|
|
381
|
+
## Optional settings
|
|
382
|
+
|
|
383
|
+
Most haze behaviour needs no configuration; a few optional keys in `~/.haze/settings.json` tune reliability and context handling. All are validated loudly — malformed values fail with a clear settings error instead of being silently ignored.
|
|
384
|
+
|
|
385
|
+
- `modelRetries` (integer 0–10, default 2): size of the shared bounded retry pool for transient model errors and idle-stream stalls. Raise it for providers that terminate long streams aggressively; `0` disables automatic retries (a stalled stream pauses with the goal preserved for a one-key resume). The effective value is reported in `timeout` and `retry` stream events as `maxRetries`.
|
|
386
|
+
- `contextWindowFallbackTokens` / `localContextWindowFallbackTokens` (default 128K hosted / 32K local): context-window guess for models without limits metadata. Every turn emits a `context_budget` event naming the window and its source, and the interactive warning fires once per model per session when the built-in default was used.
|
|
387
|
+
- `manualCompaction` (`"llm-summary"` default, or `"heuristic"`): whether manual `/compact` asks the active model for a continuity summary or keeps the model-free bounded excerpt.
|
|
388
|
+
- `theme` (string, default `purple`): name of a built-in palette (`/themes` lists and sets them, with `light` and oh-my-zsh ports like `robbyrussell` included). Unknown names fail loudly at startup with the valid names listed.
|
|
389
|
+
|
|
377
390
|
## Safety model
|
|
378
391
|
|
|
379
392
|
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
393
|
|
|
381
394
|
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
395
|
|
|
383
|
-
|
|
396
|
+
Shell 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
397
|
|
|
385
398
|
- Model-selected file tools are restricted to the current workspace and follow `.gitignore` by default.
|
|
399
|
+
- Secret files are hard-blocked in every file tool, always: SSH keys (`~/.ssh/**` and `id_*` private keys), shell history files, `.env`/`.envrc` files, `*.pem`/`*.key`, and common home credential stores. Reads, edits, and writes are refused before any filesystem access with a terminal `secret_file_protected` result — no user-granted read exception, ignore override, or symlink form bypasses it — and grep traversal skips those names. Documentation variants (`.env.example`, `.env.sample`, `.env.template`, `id_*.pub`) stay readable. The transcript marks these attempts as `blocked: protected secret file`. The `shell` tool is not command-filtered; secret avoidance there is instructed through the system prompt, so shell remains inside your supervision boundary, not a sandbox.
|
|
386
400
|
- 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
401
|
- 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
402
|
- 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.
|
package/SECURITY.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
| Version | Supported |
|
|
6
6
|
|---------|-----------|
|
|
7
|
-
| Latest minor (`
|
|
8
|
-
|
|
|
7
|
+
| Latest minor (`1.1.x`) | Yes — security fixes |
|
|
8
|
+
| Older minors and pre-1.0 (`0.x`) | No — upgrade required |
|
|
9
9
|
|
|
10
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
11
|
|
|
@@ -19,4 +19,6 @@ Include the affected version, operating system, reproduction steps, impact, and
|
|
|
19
19
|
|
|
20
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
21
|
|
|
22
|
-
haze does not use command confirmation gates.
|
|
22
|
+
haze does not use command confirmation gates. Shell 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.
|
|
23
|
+
|
|
24
|
+
The file tools carry one absolute exclusion: protected secret files (SSH keys, shell history files, `.env`/`.envrc` files, `*.pem`/`*.key`, and common home credential stores) are refused for reads and mutations before any filesystem access, including via symlinks, user-typed path exceptions, or ignore overrides. The `shell` tool has no command-level filtering for these paths; secret avoidance in shell is instructed through the system prompt and remains inside the attended-use supervision boundary. This layer is best-effort protection against casual and accidental access, not a defense against a deliberately malicious model — treat the operating-system account boundary as the real containment line.
|
package/dist/buildInfo.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@denizokcu/haze",
|
|
3
|
-
"version": "
|
|
4
|
-
"commit": "
|
|
5
|
-
"builtAt": "2026-08-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"commit": "7bc6e5378787d1d1b8f2bc8ea803ed8b1da86a13",
|
|
5
|
+
"builtAt": "2026-08-19T05:45:12.356Z",
|
|
6
6
|
"sourceRoot": "/Users/deniz.okcu/development/haze"
|
|
7
7
|
}
|
package/dist/cli/chat/TaskBar.js
CHANGED
|
@@ -36,7 +36,7 @@ export function TaskBar({ tasks, width, expanded, padding, maxRows }) {
|
|
|
36
36
|
ordered.push(completed[i]);
|
|
37
37
|
}
|
|
38
38
|
const counts = `${inProgress.length > 0 ? `${inProgress.length} active` : ''}${pending.length > 0 ? `${inProgress.length > 0 ? ', ' : ''}${pending.length} pending` : ''}${completed.length > 0 ? `${inProgress.length + pending.length > 0 ? ', ' : ''}${completed.length} done` : ''}`;
|
|
39
|
-
return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [padding > 0 && Array.from({ length: padding }, (_, i) => _jsx(Text, { children: ' ' }, `pad-${i}`)), _jsxs(Text, { children: [_jsx(Text, { color: theme.
|
|
39
|
+
return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [padding > 0 && Array.from({ length: padding }, (_, i) => _jsx(Text, { children: ' ' }, `pad-${i}`)), _jsxs(Text, { children: [_jsx(Text, { color: theme.accent, bold: true, children: "Tasks" }), counts ? _jsxs(Text, { color: theme.muted, children: [" (", counts, ")"] }) : null, tasks.length > MAX_VISIBLE_TASKS ? _jsxs(Text, { color: theme.muted, dimColor: true, children: [" \u00B7 ctrl+o ", expanded ? 'collapse' : 'expand'] }) : null] }), ordered.map(task => {
|
|
40
40
|
const title = task.title.length > maxTitleWidth ? task.title.slice(0, maxTitleWidth - 1) + '\u2026' : task.title;
|
|
41
41
|
return (_jsxs(Text, { wrap: "truncate-end", children: [_jsxs(Text, { color: taskStatusColor(task.status), children: [TASK_STATUS_ICON[task.status], " "] }), _jsx(Text, { color: task.status === 'completed' ? theme.muted : theme.foreground, children: title })] }, task.id));
|
|
42
42
|
}), expanded && ordered.length < tasks.length ? _jsxs(Text, { color: theme.muted, children: [" +", tasks.length - ordered.length, " more (ctrl+o)"] }) : null] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModelMessage } from 'ai';
|
|
2
|
-
import type { Message
|
|
2
|
+
import type { Message } from '../commands/streaming.js';
|
|
3
|
+
import type { TokenUsage } from '../commands/streaming/turnRuntime.js';
|
|
3
4
|
export declare function toolCallCount(messages: Message[]): number;
|
|
4
|
-
export declare function estimateTokens(text: string): number;
|
|
5
5
|
export declare function compactHomePath(filePath: string, home?: string): string;
|
|
6
6
|
export declare function formatTokenCount(tokens: number): string;
|
|
7
7
|
export declare function displayMessagesFromConversation(conversation: ModelMessage[]): Message[];
|
|
@@ -11,7 +11,7 @@ export function toolCallCount(messages) {
|
|
|
11
11
|
return total + message.text.split('\n').filter(line => /^\s+[✓✗…]\s/.test(line)).length;
|
|
12
12
|
}, 0);
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
function estimateTokens(text) {
|
|
15
15
|
return Math.ceil(text.length / 4);
|
|
16
16
|
}
|
|
17
17
|
export function compactHomePath(filePath, home = os.homedir()) {
|
|
@@ -75,7 +75,7 @@ export async function fileMentionSuggestions(token, options = {}) {
|
|
|
75
75
|
const entries = await walkDir(absoluteParent, {
|
|
76
76
|
recursive: false,
|
|
77
77
|
maxEntries: MAX_MENTION_SUGGESTIONS * 4,
|
|
78
|
-
ignoreBatch:
|
|
78
|
+
ignoreBatch: entries => classifier.classify(entries),
|
|
79
79
|
});
|
|
80
80
|
const matches = entries
|
|
81
81
|
.filter(entry => entry.name.startsWith(prefix))
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import type { HazeSettings } from '../../config/settings.js';
|
|
2
|
-
import type { LoadedSkill } from '../../skills/types.js';
|
|
3
|
-
import type { SessionSummary } from '../../core/session/sessionStore.js';
|
|
4
1
|
import type { TextInputSuggestion } from '../../ui/components/TextInput.js';
|
|
2
|
+
import { type WizardSuggestionState } from '../commands/wizardFlow.js';
|
|
5
3
|
import type { Mode } from '../commands/chatModes.js';
|
|
6
|
-
|
|
4
|
+
/** Inputs for suggestion building: the wizard picker state plus the current input mode. */
|
|
5
|
+
export interface InputSuggestionState extends WizardSuggestionState {
|
|
7
6
|
mode: Mode;
|
|
8
|
-
settings: HazeSettings;
|
|
9
|
-
skills: LoadedSkill[];
|
|
10
|
-
selectedProviderName?: string;
|
|
11
|
-
modelProviderFilter?: string;
|
|
12
|
-
providerDraftName?: string;
|
|
13
|
-
discoveredModels?: string[];
|
|
14
|
-
suggestedModels?: string[];
|
|
15
|
-
selectedSkillName?: string;
|
|
16
|
-
selectedLspName?: string;
|
|
17
|
-
selectedMcpName?: string;
|
|
18
|
-
sessions?: SessionSummary[];
|
|
19
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Suggestions for the current input mode. Wizard/picker modes delegate to the
|
|
10
|
+
* step's suggestion builder from the flow table; chat mode shows slash
|
|
11
|
+
* commands plus enabled skill invocations.
|
|
12
|
+
*/
|
|
20
13
|
export declare function inputSuggestionsForState(state: InputSuggestionState): TextInputSuggestion[];
|
|
21
|
-
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isSkillEnabled } from '../../config/skillSettings.js';
|
|
2
|
-
import {
|
|
3
|
-
import { sessionActionSuggestions, sessionSuggestions } from '../commands/sessionPicker.js';
|
|
2
|
+
import { wizardSuggestionsFor } from '../commands/wizardFlow.js';
|
|
4
3
|
const CHAT_COMMAND_SUGGESTIONS = [
|
|
5
4
|
{ value: '/help', description: 'Show commands', kind: 'command' },
|
|
6
5
|
{ value: '/provider', description: 'Choose a provider', kind: 'command' },
|
|
@@ -8,6 +7,7 @@ const CHAT_COMMAND_SUGGESTIONS = [
|
|
|
8
7
|
{ value: '/lsp', description: 'Manage LSP servers (semantic navigation)', kind: 'command' },
|
|
9
8
|
{ value: '/mcp', description: 'Manage MCP servers (Context7, etc.)', kind: 'command' },
|
|
10
9
|
{ value: '/settings', description: 'Show provider, model, API key, and context status', kind: 'command' },
|
|
10
|
+
{ value: '/themes', description: 'Choose a terminal theme (light palettes and oh-my-zsh ports included)', kind: 'command' },
|
|
11
11
|
{ value: '/context', description: 'Show token breakdown of system, tools, MCP, and messages', kind: 'command' },
|
|
12
12
|
{ value: '/skills', description: 'Manage Markdown skills (add, enable/disable, validate, remove)', kind: 'command' },
|
|
13
13
|
{ value: '/fleet ', description: 'Parallelize independent work in disposable contexts (flags: --review/--profile/--workers/--concurrency)', kind: 'command' },
|
|
@@ -20,46 +20,15 @@ const CHAT_COMMAND_SUGGESTIONS = [
|
|
|
20
20
|
{ value: '/exit', description: 'Exit haze', kind: 'command' },
|
|
21
21
|
{ value: '/quit', description: 'Exit haze', kind: 'command' },
|
|
22
22
|
];
|
|
23
|
+
/**
|
|
24
|
+
* Suggestions for the current input mode. Wizard/picker modes delegate to the
|
|
25
|
+
* step's suggestion builder from the flow table; chat mode shows slash
|
|
26
|
+
* commands plus enabled skill invocations.
|
|
27
|
+
*/
|
|
23
28
|
export function inputSuggestionsForState(state) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (mode === 'sessionAction')
|
|
28
|
-
return sessionActionSuggestions();
|
|
29
|
-
if (mode === 'provider')
|
|
30
|
-
return providerSuggestions(settings);
|
|
31
|
-
if (mode === 'providerAction')
|
|
32
|
-
return providerActionSuggestions(settings, state.selectedProviderName);
|
|
33
|
-
if (mode === 'providerAddPreset')
|
|
34
|
-
return presetSuggestions();
|
|
35
|
-
if (mode === 'model')
|
|
36
|
-
return modelSuggestions(settings, state.modelProviderFilter);
|
|
37
|
-
if (mode === 'modelAddProvider')
|
|
38
|
-
return modelAddProviderSuggestions(settings);
|
|
39
|
-
if (mode === 'modelPick')
|
|
40
|
-
return modelPickSuggestions(settings, state.selectedProviderName ?? state.providerDraftName, state.discoveredModels ?? [], state.suggestedModels ?? []);
|
|
41
|
-
if (mode === 'skills')
|
|
42
|
-
return skillsSuggestions(settings, skills);
|
|
43
|
-
if (mode === 'skillsAction')
|
|
44
|
-
return skillsActionSuggestions(settings, skills, state.selectedSkillName);
|
|
45
|
-
if (mode === 'skillsAddScope')
|
|
46
|
-
return skillScopeSuggestions();
|
|
47
|
-
if (mode === 'lsp')
|
|
48
|
-
return lspSuggestions(settings);
|
|
49
|
-
if (mode === 'lspAction')
|
|
50
|
-
return lspActionSuggestions(settings, state.selectedLspName);
|
|
51
|
-
if (mode === 'lspAddPreset')
|
|
52
|
-
return lspPresetSuggestions();
|
|
53
|
-
if (mode === 'mcp')
|
|
54
|
-
return mcpSuggestions(settings);
|
|
55
|
-
if (mode === 'mcpAction')
|
|
56
|
-
return mcpActionSuggestions(settings, state.selectedMcpName);
|
|
57
|
-
if (mode === 'mcpAddPreset')
|
|
58
|
-
return mcpPresetSuggestions();
|
|
59
|
-
if (mode === 'mcpAddTransport')
|
|
60
|
-
return mcpTransportSuggestions();
|
|
61
|
-
if (mode !== 'chat')
|
|
62
|
-
return [];
|
|
29
|
+
if (state.mode !== 'chat')
|
|
30
|
+
return wizardSuggestionsFor(state.mode, state) ?? [];
|
|
31
|
+
const { settings, skills } = state;
|
|
63
32
|
const activeSkills = skills.filter((skill, index) => isSkillEnabled(settings, skill.name, skill.source)
|
|
64
33
|
&& !skills.slice(0, index).some(candidate => candidate.name === skill.name && isSkillEnabled(settings, candidate.name, candidate.source)));
|
|
65
34
|
return [
|
|
@@ -14,7 +14,6 @@ export declare const MessageView: React.MemoExoticComponent<({ message, width, s
|
|
|
14
14
|
showHeader?: boolean;
|
|
15
15
|
maxVisibleLines?: number;
|
|
16
16
|
}) => React.JSX.Element>;
|
|
17
|
-
export declare function messageKey(message: Message, index: number): string;
|
|
18
17
|
export type TranscriptStaticItem = {
|
|
19
18
|
kind: 'message';
|
|
20
19
|
key: string;
|
|
@@ -37,4 +36,3 @@ export declare function partitionDisplayMessages(messages: Message[]): {
|
|
|
37
36
|
staticItems: TranscriptStaticItem[];
|
|
38
37
|
streamingItems: TranscriptStreamingItem[];
|
|
39
38
|
};
|
|
40
|
-
export declare function orderedDisplayMessages(messages: Message[]): Message[];
|
|
@@ -144,7 +144,7 @@ function ToolMessageText({ text, streaming, width, toolDiffs, maxVisibleLines })
|
|
|
144
144
|
const [, indent, icon, toolName, rest] = row;
|
|
145
145
|
const iconColor = icon === '✓' ? theme.success : icon === '✗' ? theme.danger : theme.muted;
|
|
146
146
|
const timer = /(.*) (\([0-9]+(?:h [0-9]+m [0-9]+(?:\.[0-9])?s|m [0-9]+(?:\.[0-9])?s|(?:\.[0-9])?s)\))$/.exec(rest);
|
|
147
|
-
return _jsxs(Text, { color: theme.muted, children: [indent, _jsx(Text, { color: iconColor, children: icon }), " ", _jsx(Text, { color: theme.
|
|
147
|
+
return _jsxs(Text, { color: theme.muted, children: [indent, _jsx(Text, { color: iconColor, children: icon }), " ", _jsx(Text, { color: theme.accent, children: toolName }), timer ? timer[1] : rest, timer ? _jsxs(Text, { color: theme.muted, bold: false, children: [" ", timer[2]] }) : null] }, `${index}-${line}`);
|
|
148
148
|
}), clamped.visibleDiffs.map(diff => _jsx(ToolDiffView, { diff: diff, width: width }, diff.id)), clamped.hiddenDiffCount > 0 ? _jsx(Text, { color: theme.muted, children: `⋯ ${clamped.hiddenDiffCount} diff preview${clamped.hiddenDiffCount === 1 ? '' : 's'} hidden` }) : null] });
|
|
149
149
|
}
|
|
150
150
|
export function messageElapsedLabel(message) {
|
|
@@ -161,7 +161,7 @@ export function messageElapsedLabel(message) {
|
|
|
161
161
|
}
|
|
162
162
|
export const AssistantMarkdownChunkView = React.memo(function AssistantMarkdownChunkView({ message, content, width, first, final }) {
|
|
163
163
|
const completion = final ? messageElapsedLabel(message) : '';
|
|
164
|
-
return _jsxs(Box, { flexDirection: "column", marginBottom: final ? 1 : 0, children: [first ? _jsx(Text, { color: theme.
|
|
164
|
+
return _jsxs(Box, { flexDirection: "column", marginBottom: final ? 1 : 0, children: [first ? _jsx(Text, { color: theme.accent, bold: true, children: "haze" }) : null, _jsx(MarkdownText, { content: content, width: width }), completion ? _jsx(Text, { color: theme.muted, children: completion }) : null] });
|
|
165
165
|
});
|
|
166
166
|
/** Streaming assistant tail clamped to the live-region budget; the full text enters the static transcript once the root settles. */
|
|
167
167
|
function StreamingClampedText({ text, width, maxVisibleLines }) {
|
|
@@ -172,7 +172,7 @@ export const MessageView = React.memo(function MessageView({ message, width, sho
|
|
|
172
172
|
if (message.role === 'user') {
|
|
173
173
|
return _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { backgroundColor: theme.surfaceBg, children: fullWidthBlankLine(width) }), _jsx(Text, { color: theme.success, bold: true, backgroundColor: theme.surfaceBg, children: ' You asked'.padEnd(width) }), fullWidthLines(message.text, width, 2).map((line, lineIndex) => _jsx(Text, { color: theme.foreground, backgroundColor: theme.surfaceBg, children: line }, lineIndex)), _jsx(Text, { backgroundColor: theme.surfaceBg, children: fullWidthBlankLine(width) })] });
|
|
174
174
|
}
|
|
175
|
-
return _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [showHeader ? _jsxs(Text, { children: [_jsx(Text, { color: message.role === 'assistant' ? theme.
|
|
175
|
+
return _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [showHeader ? _jsxs(Text, { children: [_jsx(Text, { color: message.role === 'assistant' ? theme.accent : message.role === 'tool' ? theme.info : message.role === 'system' ? theme.success : theme.muted, bold: true, children: message.role === 'assistant' ? 'haze' : message.role === 'tool' ? 'Tool' : 'Info' }), messageElapsedLabel(message) ? _jsxs(Text, { color: theme.muted, bold: false, children: [" \u00B7 ", messageElapsedLabel(message)] }) : null] }) : null, message.role === 'tool'
|
|
176
176
|
? _jsx(ToolMessageText, { text: message.text, streaming: message.streaming, width: width, toolDiffs: message.toolDiffs, maxVisibleLines: message.streaming ? maxVisibleLines : undefined })
|
|
177
177
|
: message.role === 'assistant' && !message.streaming
|
|
178
178
|
// Only settled assistant messages get Markdown rendering. Streaming
|
|
@@ -185,7 +185,7 @@ export const MessageView = React.memo(function MessageView({ message, width, sho
|
|
|
185
185
|
? _jsx(StreamingClampedText, { text: message.text, width: width, maxVisibleLines: maxVisibleLines })
|
|
186
186
|
: _jsx(Text, { children: message.text })] });
|
|
187
187
|
});
|
|
188
|
-
|
|
188
|
+
function messageKey(message, index) {
|
|
189
189
|
return message.id ?? `${index}-${message.role}-${message.text}`;
|
|
190
190
|
}
|
|
191
191
|
/** Partition display messages into append-only static Markdown roots and the active streaming tail. */
|
|
@@ -246,7 +246,7 @@ export function partitionDisplayMessages(messages) {
|
|
|
246
246
|
});
|
|
247
247
|
return { staticItems, streamingItems };
|
|
248
248
|
}
|
|
249
|
-
|
|
249
|
+
function orderedDisplayMessages(messages) {
|
|
250
250
|
return messages
|
|
251
251
|
.map((message, index) => ({ message, index }))
|
|
252
252
|
.sort((a, b) => {
|
|
@@ -3,7 +3,8 @@ import type { ContextFile } from '../../config/contextFiles.js';
|
|
|
3
3
|
import type { WorkState } from '../../core/agent/workState.js';
|
|
4
4
|
import { type HazeSession } from '../../core/session/sessionStore.js';
|
|
5
5
|
import { type LlmLog } from '../../core/log/llmLog.js';
|
|
6
|
-
import type { Message
|
|
6
|
+
import type { Message } from '../commands/streaming.js';
|
|
7
|
+
import type { TokenUsage } from '../commands/streaming/turnRuntime.js';
|
|
7
8
|
import type { SessionRecorder } from './sessionRecorder.js';
|
|
8
9
|
/**
|
|
9
10
|
* Session lifecycle controller extracted from `chat.tsx` (CR-006): session
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Task } from '../../core/tasks/taskStorage.js';
|
|
2
|
-
import type { TokenUsage } from '../commands/streaming.js';
|
|
2
|
+
import type { TokenUsage } from '../commands/streaming/turnRuntime.js';
|
|
3
3
|
export declare const EMPTY_TOKEN_USAGE: TokenUsage;
|
|
4
4
|
export declare function shouldClearCompletedTasks(tasks: Task[]): boolean;
|
|
5
5
|
export declare function accumulateTokenUsage(current: TokenUsage, usage: TokenUsage): TokenUsage;
|
|
@@ -4,49 +4,110 @@ import type { LoadedSkill, SkillSource } from '../../skills/types.js';
|
|
|
4
4
|
import type { SessionSummary } from '../../core/session/sessionStore.js';
|
|
5
5
|
import type { Mode } from '../commands/chatModes.js';
|
|
6
6
|
/**
|
|
7
|
-
* Wizard submit
|
|
7
|
+
* Wizard submit engine (CR-006): one table-driven entry point for every
|
|
8
8
|
* picker/wizard mode. Handlers call the pure `*Wizard.ts` result functions and
|
|
9
|
-
* apply the shared settingsPatch/mode/message shape
|
|
9
|
+
* apply the shared settingsPatch/mode/message shape; field-capture steps run
|
|
10
|
+
* through the pure transition functions below, so `chat.tsx` stays
|
|
10
11
|
* orchestration glue instead of a 150-line if-chain.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
type SharedWizardEffect = {
|
|
14
|
+
type: 'message';
|
|
15
|
+
text?: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'mode';
|
|
18
|
+
mode: Mode;
|
|
19
|
+
};
|
|
20
|
+
export type ProviderWizardEffect = SharedWizardEffect | {
|
|
21
|
+
type: 'provider-draft';
|
|
22
|
+
patch: Partial<HazeProviderSettings>;
|
|
23
|
+
replace?: boolean;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'discover-provider-models';
|
|
26
|
+
draft: Partial<HazeProviderSettings>;
|
|
27
|
+
};
|
|
28
|
+
export type McpWizardEffect = SharedWizardEffect | {
|
|
29
|
+
type: 'mcp-draft';
|
|
30
|
+
patch: Partial<HazeMcpServer>;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'finish-mcp-stdio';
|
|
33
|
+
draft: Partial<HazeMcpServer>;
|
|
34
|
+
};
|
|
35
|
+
export declare function transitionProviderField(input: {
|
|
36
|
+
mode: Mode;
|
|
37
|
+
value: string;
|
|
13
38
|
settings: HazeSettings;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
39
|
+
draft: Partial<HazeProviderSettings>;
|
|
40
|
+
}): ProviderWizardEffect[] | undefined;
|
|
41
|
+
export declare function transitionMcpField(input: {
|
|
42
|
+
mode: Mode;
|
|
43
|
+
value: string;
|
|
44
|
+
settings: HazeSettings;
|
|
45
|
+
draft: Partial<HazeMcpServer>;
|
|
46
|
+
}): McpWizardEffect[] | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The wizard-related React state that used to live in twelve `useState`
|
|
49
|
+
* hooks in `chat.tsx`. Flat field names match the historical deps names so
|
|
50
|
+
* the dispatch body and its tests read the same way.
|
|
51
|
+
*/
|
|
52
|
+
export interface WizardUiState {
|
|
21
53
|
selectedSessionId?: string;
|
|
54
|
+
modelProviderFilter?: string;
|
|
55
|
+
discoveredModels: string[];
|
|
56
|
+
suggestedModels: string[];
|
|
57
|
+
selectedProviderName?: string;
|
|
22
58
|
providerDraft: Partial<HazeProviderSettings>;
|
|
59
|
+
skillDraft: {
|
|
60
|
+
name?: string;
|
|
61
|
+
scope?: SkillSource;
|
|
62
|
+
};
|
|
63
|
+
selectedSkillName?: string;
|
|
64
|
+
selectedLspName?: string;
|
|
23
65
|
lspDraft: Partial<HazeLspServer>;
|
|
66
|
+
selectedMcpName?: string;
|
|
24
67
|
mcpDraft: Partial<HazeMcpServer>;
|
|
25
|
-
|
|
68
|
+
}
|
|
69
|
+
export type WizardUiAction = {
|
|
70
|
+
type: 'set';
|
|
71
|
+
key: 'selectedSessionId' | 'modelProviderFilter' | 'selectedProviderName' | 'selectedSkillName' | 'selectedLspName' | 'selectedMcpName';
|
|
72
|
+
value: string | undefined;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'providerDraft';
|
|
75
|
+
value: Partial<HazeProviderSettings>;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'skillDraft';
|
|
78
|
+
value: {
|
|
26
79
|
name?: string;
|
|
27
80
|
scope?: SkillSource;
|
|
28
81
|
};
|
|
82
|
+
} | {
|
|
83
|
+
type: 'lspDraft';
|
|
84
|
+
value: Partial<HazeLspServer>;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'mcpDraft';
|
|
87
|
+
value: Partial<HazeMcpServer>;
|
|
88
|
+
} | {
|
|
89
|
+
type: 'discoveredModels';
|
|
90
|
+
value: string[];
|
|
91
|
+
} | {
|
|
92
|
+
type: 'suggestedModels';
|
|
93
|
+
value: string[];
|
|
94
|
+
} | {
|
|
95
|
+
type: 'reset';
|
|
96
|
+
};
|
|
97
|
+
export declare function initialWizardUiState(): WizardUiState;
|
|
98
|
+
export declare function wizardUiReducer(state: WizardUiState, action: WizardUiAction): WizardUiState;
|
|
99
|
+
export interface WizardDispatchDeps {
|
|
100
|
+
settings: HazeSettings;
|
|
101
|
+
skills: LoadedSkill[];
|
|
102
|
+
sessions?: SessionSummary[];
|
|
103
|
+
/** Wizard flow UI state (selection, drafts, model discovery). */
|
|
104
|
+
wizard: WizardUiState;
|
|
105
|
+
updateWizard: (action: WizardUiAction) => void;
|
|
29
106
|
setMode: (mode: Mode) => void;
|
|
30
107
|
setSettings: (next: HazeSettings) => void;
|
|
31
|
-
|
|
32
|
-
setSelectedSkillName: (name: string | undefined) => void;
|
|
33
|
-
setSelectedLspName: (name: string | undefined) => void;
|
|
34
|
-
setSelectedMcpName: (name: string | undefined) => void;
|
|
35
|
-
setSelectedSessionId?: (id: string | undefined) => void;
|
|
108
|
+
showMessage: (message: string | undefined) => void;
|
|
36
109
|
resumeSessionById?: (id: string) => Promise<boolean>;
|
|
37
110
|
forkSessionById?: (id: string) => Promise<boolean>;
|
|
38
|
-
setModelProviderFilter: (filter: string | undefined) => void;
|
|
39
|
-
setProviderDraft: (draft: Partial<HazeProviderSettings>) => void;
|
|
40
|
-
setSkillDraft: (draft: {
|
|
41
|
-
name?: string;
|
|
42
|
-
scope?: SkillSource;
|
|
43
|
-
}) => void;
|
|
44
|
-
setLspDraft: (draft: Partial<HazeLspServer>) => void;
|
|
45
|
-
setMcpDraft: (draft: Partial<HazeMcpServer>) => void;
|
|
46
|
-
setDiscoveredModels: (models: string[]) => void;
|
|
47
|
-
/** Curated preset models pinned atop discovered ones; cleared with discovered models. */
|
|
48
|
-
setSuggestedModels: (models: string[]) => void;
|
|
49
|
-
showMessage: (message: string | undefined) => void;
|
|
50
111
|
refreshSkills: () => Promise<unknown>;
|
|
51
112
|
setBusyLabel: (label: string) => void;
|
|
52
113
|
setBusy: (busy: boolean) => void;
|
|
@@ -62,3 +123,4 @@ export interface WizardDispatch {
|
|
|
62
123
|
discoverProviderModelsForDraft: (draft: Partial<HazeProviderSettings>) => Promise<void>;
|
|
63
124
|
}
|
|
64
125
|
export declare function createWizardDispatch(deps: WizardDispatchDeps): WizardDispatch;
|
|
126
|
+
export {};
|