@denizokcu/haze 0.8.0 → 0.10.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 (182) hide show
  1. package/CHANGELOG.md +67 -17
  2. package/README.md +121 -64
  3. package/dist/cli/chat/chatMetrics.d.ts +17 -1
  4. package/dist/cli/chat/chatMetrics.js +22 -5
  5. package/dist/cli/chat/contextReport.d.ts +11 -0
  6. package/dist/cli/chat/contextReport.js +44 -0
  7. package/dist/cli/chat/fileMentionSuggestions.d.ts +29 -0
  8. package/dist/cli/chat/fileMentionSuggestions.js +91 -0
  9. package/dist/cli/chat/inputSuggestions.d.ts +5 -0
  10. package/dist/cli/chat/inputSuggestions.js +17 -3
  11. package/dist/cli/chat/sessionLifecycle.d.ts +58 -0
  12. package/dist/cli/chat/sessionLifecycle.js +155 -0
  13. package/dist/cli/chat/sessionRecorder.d.ts +3 -0
  14. package/dist/cli/chat/sessionRecorder.js +21 -8
  15. package/dist/cli/chat/startupInfo.d.ts +1 -0
  16. package/dist/cli/chat/startupInfo.js +11 -0
  17. package/dist/cli/chat/tips.d.ts +21 -0
  18. package/dist/cli/chat/tips.js +43 -0
  19. package/dist/cli/chat/wizardDispatch.d.ts +64 -0
  20. package/dist/cli/chat/wizardDispatch.js +645 -0
  21. package/dist/cli/commands/chat.d.ts +1 -0
  22. package/dist/cli/commands/chat.js +246 -779
  23. package/dist/cli/commands/chatModes.d.ts +1 -1
  24. package/dist/cli/commands/chatModes.js +7 -2
  25. package/dist/cli/commands/commandHelp.js +5 -3
  26. package/dist/cli/commands/commands.d.ts +4 -3
  27. package/dist/cli/commands/commands.js +12 -13
  28. package/dist/cli/commands/fleetCommand.d.ts +14 -0
  29. package/dist/cli/commands/fleetCommand.js +46 -0
  30. package/dist/cli/commands/formatters.d.ts +5 -0
  31. package/dist/cli/commands/formatters.js +36 -9
  32. package/dist/cli/commands/logsCommand.js +8 -28
  33. package/dist/cli/commands/mcpWizard.js +24 -2
  34. package/dist/cli/commands/modelCommand.js +1 -1
  35. package/dist/cli/commands/providerWizard.d.ts +1 -0
  36. package/dist/cli/commands/providerWizard.js +31 -5
  37. package/dist/cli/commands/runCommand.d.ts +1 -0
  38. package/dist/cli/commands/runCommand.js +32 -20
  39. package/dist/cli/commands/sessionPicker.d.ts +9 -0
  40. package/dist/cli/commands/sessionPicker.js +29 -0
  41. package/dist/cli/commands/settingsSummary.js +8 -4
  42. package/dist/cli/commands/skillConfirmRemove.js +4 -3
  43. package/dist/cli/commands/skillWizard.d.ts +2 -0
  44. package/dist/cli/commands/skillWizard.js +16 -6
  45. package/dist/cli/commands/streaming/idleTimer.d.ts +26 -0
  46. package/dist/cli/commands/streaming/idleTimer.js +24 -0
  47. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +2 -0
  48. package/dist/cli/commands/streaming/toolGroupRenderer.js +4 -2
  49. package/dist/cli/commands/streaming/turnOutcome.d.ts +10 -0
  50. package/dist/cli/commands/streaming/turnOutcome.js +13 -0
  51. package/dist/cli/commands/streaming/turnRuntime.js +6 -4
  52. package/dist/cli/commands/streaming.d.ts +13 -1
  53. package/dist/cli/commands/streaming.js +104 -44
  54. package/dist/cli/commands/wizardActions.d.ts +6 -0
  55. package/dist/cli/commands/wizardActions.js +6 -0
  56. package/dist/cli/commands/wizardPrompts.js +1 -1
  57. package/dist/cli/commands/wizardSuggestions.d.ts +8 -0
  58. package/dist/cli/commands/wizardSuggestions.js +62 -13
  59. package/dist/cli/commands/wizardTransition.d.ts +37 -0
  60. package/dist/cli/commands/wizardTransition.js +43 -0
  61. package/dist/cli/index.js +17 -3
  62. package/dist/cli/terminalTitle.d.ts +6 -0
  63. package/dist/cli/terminalTitle.js +36 -0
  64. package/dist/config/contextFiles.js +6 -3
  65. package/dist/config/endpointSecurity.d.ts +2 -0
  66. package/dist/config/endpointSecurity.js +28 -0
  67. package/dist/config/inputHistory.d.ts +3 -3
  68. package/dist/config/inputHistory.js +13 -17
  69. package/dist/config/modelDiscovery.d.ts +20 -0
  70. package/dist/config/modelDiscovery.js +51 -0
  71. package/dist/config/privateStorage.d.ts +6 -0
  72. package/dist/config/privateStorage.js +61 -0
  73. package/dist/config/providerPresets.d.ts +16 -4
  74. package/dist/config/providerPresets.js +263 -34
  75. package/dist/config/providers.d.ts +2 -0
  76. package/dist/config/providers.js +7 -0
  77. package/dist/config/settings.d.ts +22 -0
  78. package/dist/config/settings.js +33 -5
  79. package/dist/config/skillSettings.d.ts +6 -13
  80. package/dist/config/skillSettings.js +20 -19
  81. package/dist/config/updateCheck.js +4 -2
  82. package/dist/core/agent/budgets.d.ts +26 -0
  83. package/dist/core/agent/budgets.js +34 -0
  84. package/dist/core/agent/compaction.js +17 -3
  85. package/dist/core/agent/contextBudget.d.ts +8 -0
  86. package/dist/core/agent/contextBudget.js +29 -0
  87. package/dist/core/agent/errors.js +6 -2
  88. package/dist/core/agent/events.d.ts +12 -0
  89. package/dist/core/agent/toolOutputStore.d.ts +8 -0
  90. package/dist/core/agent/toolOutputStore.js +49 -11
  91. package/dist/core/agent/workState.d.ts +1 -1
  92. package/dist/core/agent/workState.js +0 -4
  93. package/dist/core/attachments/imageAttachments.d.ts +90 -0
  94. package/dist/core/attachments/imageAttachments.js +245 -0
  95. package/dist/core/attachments/readBlessings.d.ts +37 -0
  96. package/dist/core/attachments/readBlessings.js +79 -0
  97. package/dist/core/goal/completionPolicy.d.ts +0 -28
  98. package/dist/core/goal/completionPolicy.js +0 -88
  99. package/dist/core/goal/requestClassifier.d.ts +0 -3
  100. package/dist/core/goal/requestClassifier.js +0 -13
  101. package/dist/core/io/boundedRead.d.ts +15 -0
  102. package/dist/core/io/boundedRead.js +144 -0
  103. package/dist/core/limits/byteBudgets.d.ts +18 -0
  104. package/dist/core/limits/byteBudgets.js +18 -0
  105. package/dist/core/limits/textBudgets.d.ts +23 -0
  106. package/dist/core/limits/textBudgets.js +23 -0
  107. package/dist/core/log/llmLog.d.ts +10 -0
  108. package/dist/core/log/llmLog.js +59 -13
  109. package/dist/core/persistence/orderedFileWriter.d.ts +11 -0
  110. package/dist/core/persistence/orderedFileWriter.js +29 -0
  111. package/dist/core/process/backgroundRegistry.d.ts +35 -0
  112. package/dist/core/process/backgroundRegistry.js +194 -0
  113. package/dist/core/process/runBoundedProcess.d.ts +30 -0
  114. package/dist/core/process/runBoundedProcess.js +116 -0
  115. package/dist/core/safety/urlGuard.d.ts +2 -1
  116. package/dist/core/safety/urlGuard.js +3 -2
  117. package/dist/core/session/sessionSlimming.js +47 -4
  118. package/dist/core/session/sessionStore.d.ts +37 -0
  119. package/dist/core/session/sessionStore.js +136 -27
  120. package/dist/core/subagent/contracts.d.ts +116 -0
  121. package/dist/core/subagent/contracts.js +54 -0
  122. package/dist/core/subagent/executionProfiles.d.ts +28 -0
  123. package/dist/core/subagent/executionProfiles.js +45 -0
  124. package/dist/core/subagent/subagentCoordinator.d.ts +74 -0
  125. package/dist/core/subagent/subagentCoordinator.js +134 -0
  126. package/dist/core/subagent/subagentRunner.d.ts +211 -145
  127. package/dist/core/subagent/subagentRunner.js +228 -98
  128. package/dist/core/subagent/workspaceMutationPolicy.d.ts +11 -0
  129. package/dist/core/subagent/workspaceMutationPolicy.js +52 -0
  130. package/dist/core/tasks/taskStorage.js +12 -1
  131. package/dist/llm/client.d.ts +20 -29
  132. package/dist/llm/client.js +33 -29
  133. package/dist/llm/hazeTools.d.ts +2396 -67
  134. package/dist/llm/hazeTools.js +50 -37
  135. package/dist/llm/lsp.d.ts +23 -3
  136. package/dist/llm/lsp.js +73 -16
  137. package/dist/llm/lspTools.d.ts +96 -48
  138. package/dist/llm/mcp.d.ts +1 -1
  139. package/dist/llm/mcp.js +65 -16
  140. package/dist/llm/requestContext.d.ts +23 -1
  141. package/dist/llm/requestContext.js +50 -7
  142. package/dist/llm/systemPrompt.d.ts +4 -1
  143. package/dist/llm/systemPrompt.js +14 -4
  144. package/dist/llm/toolResultTypes.d.ts +1 -1
  145. package/dist/llm/tools/bashTool.d.ts +1210 -16
  146. package/dist/llm/tools/bashTool.js +43 -60
  147. package/dist/llm/tools/fetchTool.d.ts +26 -26
  148. package/dist/llm/tools/fetchTool.js +1 -1
  149. package/dist/llm/tools/fileToolShared.d.ts +2 -1
  150. package/dist/llm/tools/fileToolShared.js +5 -5
  151. package/dist/llm/tools/grepRunner.d.ts +20 -0
  152. package/dist/llm/tools/grepRunner.js +66 -0
  153. package/dist/llm/tools/outputCap.d.ts +2 -6
  154. package/dist/llm/tools/outputCap.js +2 -6
  155. package/dist/llm/tools/processTool.d.ts +1077 -0
  156. package/dist/llm/tools/processTool.js +41 -0
  157. package/dist/llm/tools/toolContext.d.ts +8 -0
  158. package/dist/llm/tools/toolContext.js +22 -11
  159. package/dist/llm/tools/workspaceFile.d.ts +9 -1
  160. package/dist/llm/tools/workspaceFile.js +33 -4
  161. package/dist/llm/webFetch.js +24 -11
  162. package/dist/llm/workerContext.d.ts +18 -0
  163. package/dist/llm/workerContext.js +55 -0
  164. package/dist/skills/SkillLoader.d.ts +2 -2
  165. package/dist/skills/SkillLoader.js +17 -5
  166. package/dist/skills/SkillRegistry.d.ts +3 -2
  167. package/dist/skills/SkillRegistry.js +53 -10
  168. package/dist/skills/builder/SkillBuilder.d.ts +3 -0
  169. package/dist/skills/builder/SkillBuilder.js +23 -5
  170. package/dist/skills/skillTools.js +11 -4
  171. package/dist/skills/types.d.ts +11 -1
  172. package/dist/ui/components/TextInput.d.ts +5 -2
  173. package/dist/ui/components/TextInput.js +76 -8
  174. package/dist/utils/format.d.ts +2 -0
  175. package/dist/utils/format.js +8 -0
  176. package/dist/utils/fs.d.ts +0 -1
  177. package/dist/utils/fs.js +0 -4
  178. package/dist/utils/openPath.d.ts +2 -0
  179. package/dist/utils/openPath.js +9 -0
  180. package/dist/utils/path.d.ts +2 -0
  181. package/dist/utils/path.js +9 -4
  182. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Rotating tips shown under the busy label while the model is thinking.
3
+ *
4
+ * The registry is data, not code, so rewording or pruning is trivial. Tips
5
+ * must describe things the user can do from their keyboard (slash commands,
6
+ * `@`-mentions, key presses, flags) — never internal model-tool mechanics
7
+ * like how `readFile` pages or `grep` caps results. Keep one idea per entry,
8
+ * lead with the action, and stay terminal-width-friendly.
9
+ */
10
+ export const TIPS = [
11
+ 'Attach an image with @path/to/img.png — or any path with / — png/jpg/jpeg/gif/webp.',
12
+ 'Type @ to browse workspace files; Tab completes the path.',
13
+ 'Mention any file or directory by @path (or paste a /-containing path) to let the model read it this turn, even outside the workspace.',
14
+ 'Backslash-escape spaces in paths: @screen\\ 2026.png works for macOS screenshots.',
15
+ 'Mark a provider image-capable in /provider so attached images actually get sent.',
16
+ '/mcp add context7 loads external tools for up-to-date library docs.',
17
+ '/lsp presets then /lsp add typescript enables jump-to-definition, references, and rename.',
18
+ '/skills browses packaged workflows — skills inject instructions, never code.',
19
+ '/init scaffolds an AGENTS.md so future sessions start with project context.',
20
+ 'Conversations persist under ~/.haze/sessions; resume the latest with /resume.',
21
+ 'Long threads compact automatically; /compact does it on demand.',
22
+ '/fleet runs genuinely independent tasks through disposable contexts in parallel.',
23
+ 'Press esc to interrupt a running turn and reclaim control.',
24
+ '/context shows a token breakdown — system, project context, tools, and messages.',
25
+ '/model <name> sets a model directly (e.g. /model sonnet); selecting one also sets its provider.',
26
+ '/tips toggles this hint line off if you find it distracting.',
27
+ ];
28
+ /**
29
+ * Pick a random tip index, avoiding the previous one when possible so the
30
+ * rotation never shows the same tip twice in a row.
31
+ */
32
+ export function randomTipIndex(exclude) {
33
+ if (TIPS.length <= 1)
34
+ return 0;
35
+ let next = Math.floor(Math.random() * TIPS.length);
36
+ while (next === exclude)
37
+ next = Math.floor(Math.random() * TIPS.length);
38
+ return next;
39
+ }
40
+ /** Whether the tips rotation is enabled in user settings (default true). */
41
+ export function tipsEnabled(settings) {
42
+ return settings.tips?.enabled !== false;
43
+ }
@@ -0,0 +1,64 @@
1
+ import type { HazeMcpServer, HazeProviderSettings, HazeSettings } from '../../config/settings.js';
2
+ import type { HazeLspServer } from '../../config/lspSettings.js';
3
+ import type { LoadedSkill, SkillSource } from '../../skills/types.js';
4
+ import type { SessionSummary } from '../../core/session/sessionStore.js';
5
+ import type { Mode } from '../commands/chatModes.js';
6
+ /**
7
+ * Wizard submit dispatch (CR-006): one table-driven entry point for every
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
10
+ * orchestration glue instead of a 150-line if-chain.
11
+ */
12
+ export interface WizardDispatchDeps {
13
+ 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[];
21
+ selectedSessionId?: string;
22
+ providerDraft: Partial<HazeProviderSettings>;
23
+ lspDraft: Partial<HazeLspServer>;
24
+ mcpDraft: Partial<HazeMcpServer>;
25
+ skillDraft: {
26
+ name?: string;
27
+ scope?: SkillSource;
28
+ };
29
+ setMode: (mode: Mode) => void;
30
+ 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;
36
+ resumeSessionById?: (id: string) => Promise<boolean>;
37
+ 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
+ refreshSkills: () => Promise<unknown>;
51
+ setBusyLabel: (label: string) => void;
52
+ setBusy: (busy: boolean) => void;
53
+ /** Busy label to restore when a skill creation finishes. */
54
+ idleBusyLabel: string;
55
+ }
56
+ export interface WizardDispatch {
57
+ /** Handle the value for wizard/picker modes; returns false for non-wizard modes. */
58
+ dispatch: (mode: Mode, value: string) => Promise<boolean>;
59
+ /** Exposed for the MCP field-transition path in submit(). */
60
+ finishMcpCustom: (keyValue?: string, draft?: Partial<HazeMcpServer>) => Promise<void>;
61
+ /** Exposed for the provider field-transition path: discover models for a provider draft after its key step. */
62
+ discoverProviderModelsForDraft: (draft: Partial<HazeProviderSettings>) => Promise<void>;
63
+ }
64
+ export declare function createWizardDispatch(deps: WizardDispatchDeps): WizardDispatch;