@denizokcu/haze 0.11.0 → 1.0.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 +23 -0
- package/README.md +23 -14
- package/SECURITY.md +3 -3
- package/dist/buildInfo.json +3 -3
- 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 +9 -41
- package/dist/cli/chat/messages.d.ts +0 -2
- package/dist/cli/chat/messages.js +2 -2
- 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 +250 -133
- package/dist/cli/commands/chat.js +14 -72
- package/dist/cli/commands/chatModes.d.ts +8 -1
- package/dist/cli/commands/chatModes.js +9 -44
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/formatters.d.ts +3 -3
- package/dist/cli/commands/formatters.js +6 -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/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/wizardFlow.d.ts +334 -0
- package/dist/cli/commands/wizardFlow.js +377 -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 +7 -0
- package/dist/config/settings.js +3 -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/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 +14 -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 +13 -6
- package/dist/llm/toolResultTypes.d.ts +0 -14
- 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/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 +2 -2
- package/dist/llm/tools/{bashTool.d.ts → shellTool.d.ts} +123 -107
- package/dist/llm/tools/{bashTool.js → shellTool.js} +15 -14
- package/dist/llm/tools/toolContext.js +5 -5
- package/dist/llm/tools/workspaceFile.d.ts +0 -1
- package/dist/llm/tools/workspaceFile.js +1 -6
- 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/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,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0 - 2026-08-16
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
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`.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- 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.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
All four defects below were surfaced by the csv-query differential benchmark (same model across harnesses isolates the harness) and carry regression coverage:
|
|
16
|
+
|
|
17
|
+
- `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`.
|
|
18
|
+
- 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.
|
|
19
|
+
- 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.
|
|
20
|
+
- 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`.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- `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).
|
|
25
|
+
|
|
3
26
|
## 0.11.0 - 2026-08-15
|
|
4
27
|
|
|
5
28
|
### Added
|
package/README.md
CHANGED
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
A minimal LLM harness for your terminal.
|
|
4
4
|
|
|
5
|
-
## What's new in 0.
|
|
5
|
+
## What's new in 1.0.0
|
|
6
6
|
|
|
7
|
-
haze 0.
|
|
7
|
+
haze 1.0.0 is 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. It also lands a configurable model-retry pool and the four benchmark-driven reliability fixes below.
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
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
|
+
- Configurable model-retry pool: the `modelRetries` setting (integer 0–10, default 2) sizes the shared bounded pool that retries transient model errors and idle-stream stalls. Raise it for providers that terminate long streams aggressively; `0` disables automatic retries (stalls pause with the goal preserved for a one-key resume). The effective pool size is visible in `timeout`/`retry` stream events (`maxRetries`) and stall diagnostics.
|
|
10
|
+
- Benchmark-hardened completion evidence (found by the csv-query differential benchmark — same model across four harnesses isolates the harness): `writeFile` chunking guidance can no longer be shadowed by schema validation, reads fail open in Git-less workspaces while mutations still fail closed, the shell validation classifier recognizes Python/Go/Rust/Make/Maven/Gradle/Ruby/.NET/Deno/Bun test commands plus direct runs of files changed this goal, and `shell` accepts `purpose=validation` so ad hoc assertion scripts become structured completion evidence.
|
|
11
|
+
- Validated with a differential Harbor benchmark on glm-5.3 (claude-code, nanocoder, pi, haze): haze 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. Full report under [`benchmarks/harbor/results`](https://github.com/DenizOkcu/haze/tree/main/benchmarks/harbor/results).
|
|
12
|
+
- Carried from 0.11.0: autonomous goal continuation across physical turns, runtime provenance and stale-install protection, model-aware context budgeting, headless `--timeout`, per-tool deadlines, incremental streaming, and model-written `/compact` summaries.
|
|
15
13
|
|
|
16
14
|
Previous releases:
|
|
17
15
|
|
|
16
|
+
- `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
17
|
- `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
18
|
|
|
20
19
|
- `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 +45,12 @@ haze keeps guardrails light. The LLM can work from the terminal with access clos
|
|
|
46
45
|
|
|
47
46
|
### Supervision model
|
|
48
47
|
|
|
49
|
-
There is **no sandbox and no permission layer**:
|
|
48
|
+
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
49
|
|
|
51
50
|
## Getting started
|
|
52
51
|
|
|
52
|
+
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.
|
|
53
|
+
|
|
53
54
|
Install haze:
|
|
54
55
|
|
|
55
56
|
```bash
|
|
@@ -103,7 +104,7 @@ Open a project and ask for work:
|
|
|
103
104
|
create a calculator in calc-app in ruby with add subtract multiply divide
|
|
104
105
|
```
|
|
105
106
|
|
|
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.
|
|
107
|
+
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
108
|
|
|
108
109
|
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
110
|
|
|
@@ -296,14 +297,14 @@ haze has a small built-in toolset:
|
|
|
296
297
|
- `editFile` makes unique text replacements, tolerates accidental line-number prefixes, and returns a structured diff.
|
|
297
298
|
- `replaceLines` edits line ranges when exact replacements are awkward, clamps ranges that extend slightly past EOF, and returns a structured diff.
|
|
298
299
|
- `writeFile` creates, overwrites, or appends files and parent directories, returning a diff for each successful content change.
|
|
299
|
-
- `
|
|
300
|
+
- `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
301
|
- `readToolOutput` pages through retained raw output omitted from oversized or reduced results, subject to in-memory budgets.
|
|
301
302
|
- `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
303
|
- `writeTasks` replaces the task list at meaningful phase changes. Completed lists clear on the next user turn.
|
|
303
304
|
- `skill` loads an installed Markdown workflow or one of its references.
|
|
304
305
|
- `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
306
|
|
|
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
|
|
307
|
+
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 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
308
|
|
|
308
309
|
### Optional LSP navigation
|
|
309
310
|
|
|
@@ -326,7 +327,7 @@ A subagent is a disposable worker with its own context. It is useful for a repos
|
|
|
326
327
|
|
|
327
328
|
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
|
|
|
329
|
-
The available modes are `inspect` (read-only), `research` (read-only with public fetch), `implement` (file changes and coordinated
|
|
330
|
+
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
331
|
|
|
331
332
|
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
|
|
|
@@ -374,13 +375,21 @@ At the same scope, `AGENTS.md` overrides `CLAUDE.md`; global haze guidance in `~
|
|
|
374
375
|
|
|
375
376
|
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
377
|
|
|
378
|
+
## Optional settings
|
|
379
|
+
|
|
380
|
+
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.
|
|
381
|
+
|
|
382
|
+
- `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`.
|
|
383
|
+
- `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.
|
|
384
|
+
- `manualCompaction` (`"llm-summary"` default, or `"heuristic"`): whether manual `/compact` asks the active model for a continuity summary or keeps the model-free bounded excerpt.
|
|
385
|
+
|
|
377
386
|
## Safety model
|
|
378
387
|
|
|
379
388
|
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
389
|
|
|
381
390
|
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
391
|
|
|
383
|
-
|
|
392
|
+
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
393
|
|
|
385
394
|
- Model-selected file tools are restricted to the current workspace and follow `.gitignore` by default.
|
|
386
395
|
- 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.
|
package/SECURITY.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
| Version | Supported |
|
|
6
6
|
|---------|-----------|
|
|
7
|
-
| Latest minor (`0.
|
|
8
|
-
|
|
|
7
|
+
| Latest minor (`1.0.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,4 @@ 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.
|
package/dist/buildInfo.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@denizokcu/haze",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"commit": "
|
|
5
|
-
"builtAt": "2026-08-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"commit": "85e798e5d4b65f08889f2f780c3f9b0f2fe6ac07",
|
|
5
|
+
"builtAt": "2026-08-16T22:39:49.522Z",
|
|
6
6
|
"sourceRoot": "/Users/deniz.okcu/development/haze"
|
|
7
7
|
}
|
|
@@ -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' },
|
|
@@ -20,46 +19,15 @@ const CHAT_COMMAND_SUGGESTIONS = [
|
|
|
20
19
|
{ value: '/exit', description: 'Exit haze', kind: 'command' },
|
|
21
20
|
{ value: '/quit', description: 'Exit haze', kind: 'command' },
|
|
22
21
|
];
|
|
22
|
+
/**
|
|
23
|
+
* Suggestions for the current input mode. Wizard/picker modes delegate to the
|
|
24
|
+
* step's suggestion builder from the flow table; chat mode shows slash
|
|
25
|
+
* commands plus enabled skill invocations.
|
|
26
|
+
*/
|
|
23
27
|
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 [];
|
|
28
|
+
if (state.mode !== 'chat')
|
|
29
|
+
return wizardSuggestionsFor(state.mode, state) ?? [];
|
|
30
|
+
const { settings, skills } = state;
|
|
63
31
|
const activeSkills = skills.filter((skill, index) => isSkillEnabled(settings, skill.name, skill.source)
|
|
64
32
|
&& !skills.slice(0, index).some(candidate => candidate.name === skill.name && isSkillEnabled(settings, candidate.name, candidate.source)));
|
|
65
33
|
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[];
|
|
@@ -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 {};
|