@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.
Files changed (230) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +23 -14
  3. package/SECURITY.md +3 -3
  4. package/dist/buildInfo.json +3 -3
  5. package/dist/cli/chat/chatMetrics.d.ts +2 -2
  6. package/dist/cli/chat/chatMetrics.js +1 -1
  7. package/dist/cli/chat/fileMentionSuggestions.js +1 -1
  8. package/dist/cli/chat/inputSuggestions.d.ts +8 -16
  9. package/dist/cli/chat/inputSuggestions.js +9 -41
  10. package/dist/cli/chat/messages.d.ts +0 -2
  11. package/dist/cli/chat/messages.js +2 -2
  12. package/dist/cli/chat/sessionLifecycle.d.ts +2 -1
  13. package/dist/cli/chat/turnState.d.ts +1 -1
  14. package/dist/cli/chat/wizardDispatch.d.ts +90 -28
  15. package/dist/cli/chat/wizardDispatch.js +250 -133
  16. package/dist/cli/commands/chat.js +14 -72
  17. package/dist/cli/commands/chatModes.d.ts +8 -1
  18. package/dist/cli/commands/chatModes.js +9 -44
  19. package/dist/cli/commands/doctor.js +1 -1
  20. package/dist/cli/commands/formatters.d.ts +3 -3
  21. package/dist/cli/commands/formatters.js +6 -25
  22. package/dist/cli/commands/providerWizard.js +2 -3
  23. package/dist/cli/commands/runCommand.js +1 -1
  24. package/dist/cli/commands/serverWizard.d.ts +34 -0
  25. package/dist/cli/commands/{mcpWizard.js → serverWizard.js} +44 -2
  26. package/dist/cli/commands/skillsWizard.d.ts +41 -0
  27. package/dist/cli/commands/{skillWizard.js → skillsWizard.js} +33 -11
  28. package/dist/cli/commands/streaming/abortCause.d.ts +2 -1
  29. package/dist/cli/commands/streaming/agentAttempt.d.ts +43 -0
  30. package/dist/cli/commands/streaming/agentAttempt.js +79 -0
  31. package/dist/cli/commands/streaming/attemptLifecycle.d.ts +56 -0
  32. package/dist/cli/commands/streaming/attemptLifecycle.js +110 -0
  33. package/dist/cli/commands/streaming/attemptOutcome.d.ts +96 -0
  34. package/dist/cli/commands/streaming/attemptOutcome.js +206 -0
  35. package/dist/cli/commands/streaming/attemptSetup.d.ts +78 -0
  36. package/dist/cli/commands/streaming/attemptSetup.js +167 -0
  37. package/dist/cli/commands/streaming/goalCheckpoint.d.ts +1 -1
  38. package/dist/cli/commands/streaming/goalCheckpoint.js +2 -2
  39. package/dist/cli/commands/streaming/goalSupervisor.js +9 -6
  40. package/dist/cli/commands/streaming/stallRecovery.d.ts +94 -0
  41. package/dist/cli/commands/streaming/stallRecovery.js +105 -0
  42. package/dist/cli/commands/streaming/streamLoop.d.ts +72 -0
  43. package/dist/cli/commands/streaming/streamLoop.js +448 -0
  44. package/dist/cli/commands/streaming/toolCallRecovery.d.ts +14 -0
  45. package/dist/cli/commands/streaming/toolCallRecovery.js +56 -0
  46. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +2 -1
  47. package/dist/cli/commands/streaming/turnRuntime.d.ts +4 -0
  48. package/dist/cli/commands/streaming/turnRuntime.js +6 -0
  49. package/dist/cli/commands/streaming.d.ts +14 -25
  50. package/dist/cli/commands/streaming.js +43 -754
  51. package/dist/cli/commands/wizardFlow.d.ts +334 -0
  52. package/dist/cli/commands/wizardFlow.js +377 -0
  53. package/dist/cli/contextReport.js +3 -0
  54. package/dist/cli/index.js +1 -1
  55. package/dist/config/contextFiles.js +9 -3
  56. package/dist/config/inputHistory.d.ts +0 -1
  57. package/dist/config/inputHistory.js +1 -1
  58. package/dist/config/modelDiscovery.d.ts +0 -15
  59. package/dist/config/modelDiscovery.js +1 -1
  60. package/dist/config/settings.d.ts +7 -0
  61. package/dist/config/settings.js +3 -0
  62. package/dist/config/skillSettings.js +4 -4
  63. package/dist/config/updateCheck.d.ts +0 -1
  64. package/dist/config/updateCheck.js +1 -1
  65. package/dist/core/agent/budgets.d.ts +63 -1
  66. package/dist/core/agent/budgets.js +84 -1
  67. package/dist/core/agent/compaction.js +1 -1
  68. package/dist/core/agent/completionController.d.ts +7 -13
  69. package/dist/core/agent/completionController.js +17 -8
  70. package/dist/core/agent/contextBudget.d.ts +0 -4
  71. package/dist/core/agent/contextBudget.js +3 -3
  72. package/dist/core/agent/errors.d.ts +0 -1
  73. package/dist/core/agent/errors.js +1 -1
  74. package/dist/core/agent/events.d.ts +5 -1
  75. package/dist/core/{goal/completionPolicy.d.ts → agent/goalPolicy.d.ts} +18 -0
  76. package/dist/core/agent/goalPolicy.js +106 -0
  77. package/dist/core/agent/requestAssembly.d.ts +2 -2
  78. package/dist/core/agent/requestAssembly.js +16 -4
  79. package/dist/core/agent/toolCapabilities.d.ts +2 -2
  80. package/dist/core/agent/toolCapabilities.js +5 -5
  81. package/dist/core/agent/toolOutputStore.js +1 -1
  82. package/dist/core/agent/toolResults.js +1 -1
  83. package/dist/core/agent/workState.d.ts +6 -3
  84. package/dist/core/agent/workState.js +62 -7
  85. package/dist/core/attachments/imageAttachments.js +90 -42
  86. package/dist/core/deadline.d.ts +0 -6
  87. package/dist/core/deadline.js +1 -1
  88. package/dist/core/io/boundedRead.js +1 -1
  89. package/dist/core/limits.d.ts +51 -0
  90. package/dist/core/limits.js +51 -0
  91. package/dist/core/log/llmLog.js +1 -1
  92. package/dist/core/process/backgroundRegistry.d.ts +2 -3
  93. package/dist/core/process/backgroundRegistry.js +10 -6
  94. package/dist/core/process/userShell.d.ts +16 -0
  95. package/dist/core/process/userShell.js +59 -0
  96. package/dist/core/safety/shellClassifier.d.ts +11 -0
  97. package/dist/core/safety/{bashClassifier.js → shellClassifier.js} +5 -3
  98. package/dist/core/safety/urlGuard.d.ts +1 -1
  99. package/dist/core/session/sessionSlimming.d.ts +0 -3
  100. package/dist/core/session/sessionSlimming.js +2 -3
  101. package/dist/core/session/sessionStore.d.ts +1 -0
  102. package/dist/core/session/sessionStore.js +39 -20
  103. package/dist/core/{bashOutput → shellOutput}/lineFilter.js +8 -2
  104. package/dist/core/{bashOutput → shellOutput}/reducers/search.d.ts +0 -1
  105. package/dist/core/{bashOutput → shellOutput}/reducers/search.js +1 -1
  106. package/dist/core/shellOutput/registry.d.ts +2 -0
  107. package/dist/core/{bashOutput → shellOutput}/registry.js +3 -3
  108. package/dist/core/{bashOutput → shellOutput}/types.d.ts +6 -5
  109. package/dist/core/subagent/contracts.d.ts +2 -14
  110. package/dist/core/subagent/contracts.js +3 -3
  111. package/dist/core/subagent/executionProfiles.js +2 -2
  112. package/dist/core/subagent/subagentRunner.js +3 -4
  113. package/dist/core/toolOutput/reduction.d.ts +0 -12
  114. package/dist/core/toolOutput/reduction.js +1 -1
  115. package/dist/core/validation/outputParser.d.ts +2 -2
  116. package/dist/llm/client.js +5 -1
  117. package/dist/llm/hazeTools.d.ts +139 -124
  118. package/dist/llm/hazeTools.js +14 -11
  119. package/dist/llm/initPrompt.js +1 -1
  120. package/dist/llm/lsp/client.d.ts +45 -0
  121. package/dist/llm/lsp/client.js +195 -0
  122. package/dist/llm/lsp/pool.d.ts +23 -0
  123. package/dist/llm/lsp/pool.js +86 -0
  124. package/dist/llm/lsp/protocol.d.ts +64 -0
  125. package/dist/llm/lsp/protocol.js +128 -0
  126. package/dist/llm/lsp/requests.d.ts +94 -0
  127. package/dist/llm/lsp/requests.js +119 -0
  128. package/dist/llm/lspTools.d.ts +3824 -570
  129. package/dist/llm/lspTools.js +65 -1
  130. package/dist/llm/openaiCodex.d.ts +0 -2
  131. package/dist/llm/openaiCodex.js +0 -4
  132. package/dist/llm/openaiCodexOAuth.d.ts +0 -3
  133. package/dist/llm/openaiCodexOAuth.js +6 -3
  134. package/dist/llm/requestContext.d.ts +5 -1
  135. package/dist/llm/requestContext.js +25 -2
  136. package/dist/llm/systemPrompt.d.ts +1 -0
  137. package/dist/llm/systemPrompt.js +13 -6
  138. package/dist/llm/toolResultTypes.d.ts +0 -14
  139. package/dist/llm/toolResultTypes.js +1 -4
  140. package/dist/llm/tools/editMatch.d.ts +0 -9
  141. package/dist/llm/tools/editMatch.js +1 -1
  142. package/dist/llm/tools/fetchTool.js +1 -1
  143. package/dist/llm/tools/fileToolShared.d.ts +4 -2
  144. package/dist/llm/tools/fileToolShared.js +9 -5
  145. package/dist/llm/tools/gitIgnore.d.ts +25 -32
  146. package/dist/llm/tools/gitIgnore.js +216 -98
  147. package/dist/llm/tools/grepParse.d.ts +2 -1
  148. package/dist/llm/tools/grepRunner.d.ts +1 -1
  149. package/dist/llm/tools/grepRunner.js +2 -2
  150. package/dist/llm/tools/outputCap.d.ts +2 -7
  151. package/dist/llm/tools/outputCap.js +3 -3
  152. package/dist/llm/tools/processTool.d.ts +16 -16
  153. package/dist/llm/tools/processTool.js +1 -1
  154. package/dist/llm/tools/readRecovery.d.ts +0 -2
  155. package/dist/llm/tools/readRecovery.js +2 -2
  156. package/dist/llm/tools/{bashTool.d.ts → shellTool.d.ts} +123 -107
  157. package/dist/llm/tools/{bashTool.js → shellTool.js} +15 -14
  158. package/dist/llm/tools/toolContext.js +5 -5
  159. package/dist/llm/tools/workspaceFile.d.ts +0 -1
  160. package/dist/llm/tools/workspaceFile.js +1 -6
  161. package/dist/llm/webFetch.d.ts +1 -1
  162. package/dist/skills/SkillLoader.d.ts +1 -11
  163. package/dist/skills/SkillLoader.js +1 -2
  164. package/dist/skills/types.d.ts +2 -1
  165. package/dist/utils/buildInfo.d.ts +6 -13
  166. package/dist/utils/buildInfo.js +6 -15
  167. package/dist/utils/fs.d.ts +7 -5
  168. package/dist/utils/fs.js +5 -2
  169. package/dist/utils/path.d.ts +0 -1
  170. package/dist/utils/path.js +1 -1
  171. package/package.json +6 -4
  172. package/dist/cli/commands/lspWizard.d.ts +0 -14
  173. package/dist/cli/commands/lspWizard.js +0 -44
  174. package/dist/cli/commands/mcpWizard.d.ts +0 -15
  175. package/dist/cli/commands/skillConfirmRemove.d.ts +0 -11
  176. package/dist/cli/commands/skillConfirmRemove.js +0 -20
  177. package/dist/cli/commands/skillCreation.d.ts +0 -12
  178. package/dist/cli/commands/skillCreation.js +0 -14
  179. package/dist/cli/commands/skillWizard.d.ts +0 -17
  180. package/dist/cli/commands/streaming/idleTimer.d.ts +0 -26
  181. package/dist/cli/commands/streaming/idleTimer.js +0 -24
  182. package/dist/cli/commands/streaming/turnOutcome.d.ts +0 -27
  183. package/dist/cli/commands/streaming/turnOutcome.js +0 -29
  184. package/dist/cli/commands/wizardActions.d.ts +0 -47
  185. package/dist/cli/commands/wizardActions.js +0 -47
  186. package/dist/cli/commands/wizardInput.d.ts +0 -4
  187. package/dist/cli/commands/wizardInput.js +0 -19
  188. package/dist/cli/commands/wizardPrompts.d.ts +0 -22
  189. package/dist/cli/commands/wizardPrompts.js +0 -58
  190. package/dist/cli/commands/wizardSuggestions.d.ts +0 -31
  191. package/dist/cli/commands/wizardSuggestions.js +0 -190
  192. package/dist/cli/commands/wizardTransition.d.ts +0 -37
  193. package/dist/cli/commands/wizardTransition.js +0 -43
  194. package/dist/core/agent/toolExecutionBudget.d.ts +0 -35
  195. package/dist/core/agent/toolExecutionBudget.js +0 -49
  196. package/dist/core/agent/turnBudget.d.ts +0 -35
  197. package/dist/core/agent/turnBudget.js +0 -27
  198. package/dist/core/bashOutput/ansi.d.ts +0 -1
  199. package/dist/core/bashOutput/ansi.js +0 -7
  200. package/dist/core/bashOutput/registry.d.ts +0 -4
  201. package/dist/core/goal/completionPolicy.js +0 -43
  202. package/dist/core/goal/requestClassifier.d.ts +0 -3
  203. package/dist/core/goal/requestClassifier.js +0 -18
  204. package/dist/core/goal/sessionGoal.d.ts +0 -8
  205. package/dist/core/goal/sessionGoal.js +0 -30
  206. package/dist/core/limits/byteBudgets.d.ts +0 -20
  207. package/dist/core/limits/byteBudgets.js +0 -20
  208. package/dist/core/limits/textBudgets.d.ts +0 -25
  209. package/dist/core/limits/textBudgets.js +0 -25
  210. package/dist/core/safety/bashClassifier.d.ts +0 -10
  211. package/dist/llm/lsp.d.ts +0 -149
  212. package/dist/llm/lsp.js +0 -368
  213. package/dist/ui/components/ErrorView.d.ts +0 -4
  214. package/dist/ui/components/ErrorView.js +0 -7
  215. package/dist/utils/yaml.d.ts +0 -2
  216. package/dist/utils/yaml.js +0 -8
  217. package/examples/skills/files/SKILL.md +0 -16
  218. package/examples/skills/files/examples/file-editing.md +0 -3
  219. /package/dist/core/{bashOutput → shellOutput}/command.d.ts +0 -0
  220. /package/dist/core/{bashOutput → shellOutput}/command.js +0 -0
  221. /package/dist/core/{bashOutput → shellOutput}/lineFilter.d.ts +0 -0
  222. /package/dist/core/{bashOutput → shellOutput}/reducers/content.d.ts +0 -0
  223. /package/dist/core/{bashOutput → shellOutput}/reducers/content.js +0 -0
  224. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.d.ts +0 -0
  225. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.js +0 -0
  226. /package/dist/core/{bashOutput → shellOutput}/reducers/git.d.ts +0 -0
  227. /package/dist/core/{bashOutput → shellOutput}/reducers/git.js +0 -0
  228. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.d.ts +0 -0
  229. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.js +0 -0
  230. /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.11.0
5
+ ## What's new in 1.0.0
6
6
 
7
- haze 0.11.0 turns per-turn budgets into goal-level autonomy and hardens long-running headless work. It keeps the Node.js 22 support floor and the documented CLI, settings, session, skill, and tool-result contracts.
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
- - Autonomous goal continuation across physical turns: a voluntary final that arrives while the turn's declared task list still has pending items or post-edit validation is missing/stale/failed is rejected (prose is never completion evidence), and a logical-goal supervisor wraps each request, so a turn that stops with unfinished work — at any budget boundary, including `tool-calls` finishes — automatically starts the next continuation turn against the preserved conversation. One mutation lease and cumulative task/validation/mutation evidence carry across the boundary, so completed work is never replayed and nothing resets. It continues while measurable progress occurs and stops only for structured completion, concrete external blockers, user cancellation, the goal deadline, or two consecutive no-progress cycles. Interactively, continuation is automatic with a visible cycle status; headless `--timeout` bounds the whole logical goal, `stream-json` gains `goal_start`/`goal_continue`/`goal_end` events, the JSON result envelope gains cumulative `goal` evidence, and the exit code stays non-zero unless the goal structurally completed.
10
- - Runtime provenance and stale-install protection: builds embed `dist/buildInfo.json`, the launcher refuses incomplete or stale builds with an actionable rebuild hint, `haze --version --verbose` prints executing version/commit/runtime paths, and the new `haze doctor` command verifies artifacts, capabilities, and nearby-checkout mismatches. Session headers record the executing build so saved failures tie to the code that actually ran.
11
- - Model-aware context budgeting: the message allowance is the model's real context window (curated per-preset limits, live provider discovery, or a configurable fallback of 128K) minus system prompt, tool schemas, output reserve, and safety margin. Long turns compact accumulated tool history before each provider request, and provider context overflows self-heal in interactive and headless runs by compacting and retrying once.
12
- - Long-running hardening: headless `--timeout <duration>` bounds total elapsed time with `timeout` stream events, per-tool execution deadlines (10m; 20m for subagents) quarantine abort-ignoring tools, main tool-call budgets are enforced atomically at the execution boundary, and `--output stream-json` emits linear `message_update` deltas through a backpressure-aware ordered sink. Model-stream idle stalls are distinguished from user cancels: they retry through the bounded model-retry pool (salvaging work to the last completed step) and, when exhausted, pause the turn with a one-key `R` resume instead of discarding it.
13
- - Performance: `listFiles` batches Git ignore checks and prunes ignored directories, LSP navigation reuses one initialized server per turn, session snapshots are coalesced and vacuumed (no more quadratic session-file growth), per-step request estimates are memoized, the transcript caches settled Markdown chunks, streaming renders incrementally (no flicker), and the live region is clamped to the viewport so a long live tail never wipes terminal scrollback.
14
- - Manual `/compact` asks the active model for a continuity summary (goal, decisions, files, validation results, next action) and keeps the recent tail verbatim; set `manualCompaction: "heuristic"` for the previous bounded excerpt. Mutation tools fail closed when Git ignore checks cannot run, and the completion-rescue slice covers `test`-intent requests.
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**: bash runs unsupervised (its classification is informational only), and only the file tools are confined to the workspace. Claude Code gates tools behind permissions, plan mode, and hooks; Codex CLI runs in an OS sandbox with approval modes; haze, like pi, replaces those mechanisms with your supervision. That trade-off is deliberate and keeps the agent fast and transparent, but it also means haze is **not an unattended automation runtime** — run it where you would run a shell session yourself. If a CI job runs haze headless, treat the job the way you would treat any script with shell access. SECURITY.md documents the attended-use threat model in full.
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. Bash output is capped while the command runs, then filtered according to the command type. Validation failures keep the useful diagnostics. Raw output handles have per-entry and total memory limits, and tell you how many bytes were dropped. Sessions are saved after their first resumable message, so you can pick up the latest workspace conversation with `haze --continue` or `/resume` without accumulating empty session files.
107
+ 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
- - `bash` runs tests, builds, git and gh commands, scripts, installs, and other shell work. It trims output according to the command type while keeping useful failure details. A timeout or abort kills the process tree, escalates if necessary, and returns even when an escaped child keeps stdout or stderr open.
300
+ - `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 bash, search, and fetch results stay behind an in-memory handle. Later model calls see a compact summary tailored to validation, git, search, diffs, JSON, logs, or the head and tail of the output.
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 bash), and `validate` (reads and coordinated bash). Read-only modes cannot change files. Workers that can make changes are serialized with each other and with changes from the main turn. This coordination is not a shell sandbox.
330
+ 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
- Bash classification is informational. haze does not ask for confirmation before running commands, including commands that can mutate or delete data. This is an intentional trade-off for attended expert use, not a sandbox or permission boundary.
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.11.x`) | Yes — security fixes |
8
- | Previous minors (`0.x`) | No — upgrade required |
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. Bash classification is informational, and relevant commands may mutate or delete data. Workspace confinement, bounded input and output, URL validation, private local storage, prompt-injection framing, and user supervision reduce risk, but haze is not a sandbox.
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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@denizokcu/haze",
3
- "version": "0.11.0",
4
- "commit": "8b5a89c1496ac0e81191de39e6d9fdb1cec9490c",
5
- "builtAt": "2026-08-15T14:50:56.229Z",
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, TokenUsage } from '../commands/streaming.js';
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
- export function estimateTokens(text) {
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: relativePaths => classifier.classify(relativePaths),
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
- interface InputSuggestionState {
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 { providerSuggestions, providerActionSuggestions, presetSuggestions, modelSuggestions, modelAddProviderSuggestions, modelPickSuggestions, lspSuggestions, lspActionSuggestions, lspPresetSuggestions, mcpSuggestions, mcpActionSuggestions, mcpPresetSuggestions, mcpTransportSuggestions, skillsSuggestions, skillsActionSuggestions, skillScopeSuggestions } from '../commands/wizardSuggestions.js';
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
- const { mode, settings, skills } = state;
25
- if (mode === 'sessions')
26
- return sessionSuggestions(state.sessions ?? []);
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
- export function messageKey(message, index) {
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
- export function orderedDisplayMessages(messages) {
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, TokenUsage } from '../commands/streaming.js';
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 dispatch (CR-006): one table-driven entry point for every
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, so `chat.tsx` stays
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
- export interface WizardDispatchDeps {
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
- skills: LoadedSkill[];
15
- modelProviderFilter: string | undefined;
16
- selectedProviderName: string | undefined;
17
- selectedSkillName: string | undefined;
18
- selectedLspName: string | undefined;
19
- selectedMcpName: string | undefined;
20
- sessions?: SessionSummary[];
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
- skillDraft: {
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
- setSelectedProviderName: (name: string | undefined) => void;
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 {};