@denizokcu/haze 0.5.0 → 0.7.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 (162) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/README.md +101 -24
  3. package/dist/cli/chat/TaskBar.d.ts +9 -0
  4. package/dist/cli/chat/TaskBar.js +40 -0
  5. package/dist/cli/chat/chatMetrics.d.ts +11 -0
  6. package/dist/cli/chat/chatMetrics.js +50 -0
  7. package/dist/cli/chat/inputSuggestions.d.ts +16 -0
  8. package/dist/cli/chat/inputSuggestions.js +55 -0
  9. package/dist/cli/chat/messages.d.ts +9 -0
  10. package/dist/cli/chat/messages.js +76 -0
  11. package/dist/cli/chat/sessionRecorder.d.ts +12 -0
  12. package/dist/cli/chat/sessionRecorder.js +21 -0
  13. package/dist/cli/chat/startupInfo.d.ts +4 -0
  14. package/dist/cli/chat/startupInfo.js +53 -0
  15. package/dist/cli/chat/turnState.d.ts +5 -0
  16. package/dist/cli/chat/turnState.js +20 -0
  17. package/dist/cli/commands/chat.d.ts +0 -1
  18. package/dist/cli/commands/chat.js +519 -495
  19. package/dist/cli/commands/chatModes.d.ts +8 -0
  20. package/dist/cli/commands/chatModes.js +44 -0
  21. package/dist/cli/commands/commandHelp.d.ts +6 -0
  22. package/dist/cli/commands/commandHelp.js +25 -0
  23. package/dist/cli/commands/commands.d.ts +3 -2
  24. package/dist/cli/commands/commands.js +55 -320
  25. package/dist/cli/commands/formatters.d.ts +27 -0
  26. package/dist/cli/commands/formatters.js +149 -4
  27. package/dist/cli/commands/initCommand.d.ts +2 -0
  28. package/dist/cli/commands/initCommand.js +19 -0
  29. package/dist/cli/commands/logsCommand.d.ts +2 -0
  30. package/dist/cli/commands/logsCommand.js +63 -0
  31. package/dist/cli/commands/lspWizard.d.ts +14 -0
  32. package/dist/cli/commands/lspWizard.js +44 -0
  33. package/dist/cli/commands/mcpWizard.d.ts +15 -0
  34. package/dist/cli/commands/mcpWizard.js +69 -0
  35. package/dist/cli/commands/modelCommand.d.ts +2 -0
  36. package/dist/cli/commands/modelCommand.js +36 -0
  37. package/dist/cli/commands/providerWizard.d.ts +30 -0
  38. package/dist/cli/commands/providerWizard.js +114 -0
  39. package/dist/cli/commands/runCommand.d.ts +16 -0
  40. package/dist/cli/commands/runCommand.js +170 -0
  41. package/dist/cli/commands/settingsSummary.d.ts +3 -0
  42. package/dist/cli/commands/settingsSummary.js +40 -0
  43. package/dist/cli/commands/skillConfirmRemove.d.ts +11 -0
  44. package/dist/cli/commands/skillConfirmRemove.js +19 -0
  45. package/dist/cli/commands/skillCreation.d.ts +12 -0
  46. package/dist/cli/commands/skillCreation.js +14 -0
  47. package/dist/cli/commands/skillWizard.d.ts +15 -0
  48. package/dist/cli/commands/skillWizard.js +38 -0
  49. package/dist/cli/commands/streaming/assistantText.d.ts +17 -0
  50. package/dist/cli/commands/streaming/assistantText.js +115 -0
  51. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +55 -0
  52. package/dist/cli/commands/streaming/toolGroupRenderer.js +102 -0
  53. package/dist/cli/commands/streaming/toolResultState.d.ts +13 -0
  54. package/dist/cli/commands/streaming/toolResultState.js +25 -0
  55. package/dist/cli/commands/streaming/turnRuntime.d.ts +78 -0
  56. package/dist/cli/commands/streaming/turnRuntime.js +86 -0
  57. package/dist/cli/commands/streaming.d.ts +10 -29
  58. package/dist/cli/commands/streaming.js +249 -911
  59. package/dist/cli/commands/wizardActions.d.ts +40 -0
  60. package/dist/cli/commands/wizardActions.js +40 -0
  61. package/dist/cli/commands/wizardInput.d.ts +4 -0
  62. package/dist/cli/commands/wizardInput.js +19 -0
  63. package/dist/cli/commands/wizardPrompts.d.ts +22 -0
  64. package/dist/cli/commands/wizardPrompts.js +52 -0
  65. package/dist/cli/commands/wizardSuggestions.d.ts +23 -0
  66. package/dist/cli/commands/wizardSuggestions.js +139 -0
  67. package/dist/cli/index.js +62 -4
  68. package/dist/config/contextFiles.d.ts +8 -1
  69. package/dist/config/contextFiles.js +25 -12
  70. package/dist/config/lspSettings.d.ts +16 -0
  71. package/dist/config/lspSettings.js +95 -0
  72. package/dist/config/mcpSettings.d.ts +24 -0
  73. package/dist/config/mcpSettings.js +100 -0
  74. package/dist/config/providers.js +4 -4
  75. package/dist/config/settings.d.ts +34 -0
  76. package/dist/config/skillSettings.d.ts +15 -0
  77. package/dist/config/skillSettings.js +32 -0
  78. package/dist/config/updateCheck.d.ts +44 -0
  79. package/dist/config/updateCheck.js +83 -0
  80. package/dist/core/agent/budgets.d.ts +6 -0
  81. package/dist/core/agent/budgets.js +6 -0
  82. package/dist/core/agent/compaction.js +1 -1
  83. package/dist/core/agent/requestAssembly.d.ts +0 -7
  84. package/dist/core/agent/requestAssembly.js +27 -5
  85. package/dist/core/agent/toolOutputStore.js +5 -4
  86. package/dist/core/agent/toolResults.d.ts +31 -0
  87. package/dist/core/agent/toolResults.js +42 -0
  88. package/dist/core/agent/turnPolicy.d.ts +8 -0
  89. package/dist/core/agent/turnPolicy.js +23 -0
  90. package/dist/core/agent/workState.d.ts +18 -5
  91. package/dist/core/agent/workState.js +39 -20
  92. package/dist/core/bashOutput/reducers/content.d.ts +1 -0
  93. package/dist/core/bashOutput/reducers/content.js +1 -1
  94. package/dist/core/bashOutput/reducers/gh.d.ts +1 -0
  95. package/dist/core/bashOutput/reducers/gh.js +77 -0
  96. package/dist/core/bashOutput/registry.js +8 -0
  97. package/dist/core/goal/sessionGoal.d.ts +6 -30
  98. package/dist/core/goal/sessionGoal.js +3 -68
  99. package/dist/core/safety/bashClassifier.js +30 -0
  100. package/dist/core/safety/urlGuard.d.ts +1 -0
  101. package/dist/core/safety/urlGuard.js +6 -1
  102. package/dist/core/session/sessionSlimming.d.ts +5 -0
  103. package/dist/core/session/sessionSlimming.js +78 -0
  104. package/dist/core/session/sessionStore.d.ts +23 -3
  105. package/dist/core/session/sessionStore.js +30 -10
  106. package/dist/core/subagent/subagentRunner.d.ts +11 -1
  107. package/dist/core/subagent/subagentRunner.js +1 -0
  108. package/dist/llm/capabilities.d.ts +12 -0
  109. package/dist/llm/capabilities.js +10 -0
  110. package/dist/llm/client.d.ts +1 -0
  111. package/dist/llm/client.js +11 -2
  112. package/dist/llm/hazeTools.d.ts +31 -32
  113. package/dist/llm/hazeTools.js +40 -567
  114. package/dist/llm/lsp.d.ts +109 -0
  115. package/dist/llm/lsp.js +241 -0
  116. package/dist/llm/lspTools.d.ts +104 -0
  117. package/dist/llm/lspTools.js +115 -0
  118. package/dist/llm/mcp.d.ts +19 -0
  119. package/dist/llm/mcp.js +73 -0
  120. package/dist/llm/requestContext.d.ts +28 -0
  121. package/dist/llm/requestContext.js +41 -0
  122. package/dist/llm/systemPrompt.d.ts +5 -1
  123. package/dist/llm/systemPrompt.js +9 -3
  124. package/dist/llm/tools/bashTool.d.ts +5 -0
  125. package/dist/llm/tools/bashTool.js +81 -0
  126. package/dist/llm/tools/editMatch.d.ts +55 -0
  127. package/dist/llm/tools/editMatch.js +99 -0
  128. package/dist/llm/tools/failures.d.ts +36 -0
  129. package/dist/llm/tools/failures.js +38 -0
  130. package/dist/llm/tools/fetchTool.d.ts +65 -0
  131. package/dist/llm/tools/fetchTool.js +45 -0
  132. package/dist/llm/tools/fileToolShared.d.ts +10 -0
  133. package/dist/llm/tools/fileToolShared.js +43 -0
  134. package/dist/llm/tools/grepParse.d.ts +13 -0
  135. package/dist/llm/tools/grepParse.js +67 -0
  136. package/dist/llm/tools/outputCap.d.ts +53 -0
  137. package/dist/llm/tools/outputCap.js +67 -0
  138. package/dist/llm/tools/storedOutputTool.d.ts +10 -0
  139. package/dist/llm/tools/storedOutputTool.js +17 -0
  140. package/dist/llm/tools/taskTool.d.ts +28 -0
  141. package/dist/llm/tools/taskTool.js +41 -0
  142. package/dist/llm/tools/toolContext.d.ts +69 -0
  143. package/dist/llm/tools/toolContext.js +187 -0
  144. package/dist/llm/tools/workspaceFile.d.ts +33 -0
  145. package/dist/llm/tools/workspaceFile.js +27 -0
  146. package/dist/llm/webFetch.d.ts +13 -1
  147. package/dist/llm/webFetch.js +91 -7
  148. package/dist/skills/builder/SkillBuilder.d.ts +3 -0
  149. package/dist/skills/builder/SkillBuilder.js +24 -45
  150. package/dist/ui/components/TextInput.d.ts +1 -1
  151. package/dist/ui/components/TextInput.js +1 -99
  152. package/dist/ui/inputBuffer.d.ts +28 -0
  153. package/dist/ui/inputBuffer.js +99 -0
  154. package/dist/utils/collections.d.ts +6 -0
  155. package/dist/utils/collections.js +9 -0
  156. package/dist/utils/path.d.ts +2 -0
  157. package/dist/utils/path.js +40 -0
  158. package/dist/utils/version.d.ts +20 -0
  159. package/dist/utils/version.js +72 -0
  160. package/package.json +2 -2
  161. package/dist/cli/commands/skills.d.ts +0 -4
  162. package/dist/cli/commands/skills.js +0 -38
@@ -0,0 +1,12 @@
1
+ import type { ToolSet } from 'ai';
2
+ import type { ToolCategory } from './requestContext.js';
3
+ export interface LoadedCapability {
4
+ category: ToolCategory;
5
+ tools: ToolSet;
6
+ }
7
+ export declare function addCapabilityTools(input: {
8
+ availableTools: ToolSet;
9
+ toolCategories: Map<string, ToolCategory>;
10
+ loaded: LoadedCapability;
11
+ skipCollisions?: boolean;
12
+ }): void;
@@ -0,0 +1,10 @@
1
+ export function addCapabilityTools(input) {
2
+ const existing = new Set(Object.keys(input.availableTools));
3
+ for (const [name, value] of Object.entries(input.loaded.tools)) {
4
+ if (input.skipCollisions && existing.has(name))
5
+ continue;
6
+ input.toolCategories.set(name, input.loaded.category);
7
+ input.availableTools[name] = value;
8
+ existing.add(name);
9
+ }
10
+ }
@@ -15,6 +15,7 @@ export interface ModelRuntimeConfig {
15
15
  }
16
16
  export declare function modelWithConfig(session?: {
17
17
  cwd?: string;
18
+ modelSelector?: string;
18
19
  }): Promise<{
19
20
  model: import("@ai-sdk/provider").LanguageModelV3;
20
21
  config: {
@@ -1,7 +1,7 @@
1
1
  import { createOpenAI } from '@ai-sdk/openai';
2
2
  import crypto from 'node:crypto';
3
3
  import { readSettings } from '../config/settings.js';
4
- import { activeModel } from '../config/providers.js';
4
+ import { activeModel, resolveModelSelector } from '../config/providers.js';
5
5
  function capabilities(providerName, baseURL) {
6
6
  const directOpenAI = providerName === 'openai' || /api\.openai\.com/i.test(baseURL);
7
7
  const openRouter = providerName === 'openrouter' || /openrouter\.ai/i.test(baseURL);
@@ -16,7 +16,16 @@ function capabilities(providerName, baseURL) {
16
16
  }
17
17
  export async function modelWithConfig(session) {
18
18
  const settings = await readSettings();
19
- const selection = activeModel(settings);
19
+ const override = session?.modelSelector?.trim();
20
+ let selection;
21
+ if (override) {
22
+ const resolved = resolveModelSelector(settings, override);
23
+ if (resolved.status === 'found')
24
+ selection = { provider: resolved.provider, model: resolved.model };
25
+ }
26
+ else {
27
+ selection = activeModel(settings);
28
+ }
20
29
  if (!selection)
21
30
  return undefined;
22
31
  const baseURL = selection.provider.url;
@@ -1,5 +1,4 @@
1
- import type { ToolDiffLine, ToolFailureReasonCode } from './toolResultTypes.js';
2
- import { type ContextFile } from '../config/contextFiles.js';
1
+ import type { ToolDiffLine } from './toolResultTypes.js';
3
2
  export declare const hazeTools: {
4
3
  listFiles: import("ai").Tool<{
5
4
  path: string;
@@ -13,7 +12,7 @@ export declare const hazeTools: {
13
12
  toolName: string;
14
13
  path: string | undefined;
15
14
  error: string;
16
- reasonCode: ToolFailureReasonCode | undefined;
15
+ reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
17
16
  recoverable: boolean;
18
17
  suggestedNextStep: string;
19
18
  recoveryTool: string | undefined;
@@ -35,7 +34,7 @@ export declare const hazeTools: {
35
34
  entries: string[];
36
35
  truncated: boolean;
37
36
  } & {
38
- applicableProjectInstructions?: ContextFile[];
37
+ applicableProjectInstructions?: import("../config/contextFiles.js").ContextFile[];
39
38
  })>;
40
39
  readFile: import("ai").Tool<{
41
40
  path: string;
@@ -48,7 +47,7 @@ export declare const hazeTools: {
48
47
  toolName: string;
49
48
  path: string | undefined;
50
49
  error: string;
51
- reasonCode: ToolFailureReasonCode | undefined;
50
+ reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
52
51
  recoverable: boolean;
53
52
  suggestedNextStep: string;
54
53
  recoveryTool: string | undefined;
@@ -72,7 +71,7 @@ export declare const hazeTools: {
72
71
  truncated: boolean;
73
72
  lineTruncated: boolean;
74
73
  } & {
75
- applicableProjectInstructions?: ContextFile[];
74
+ applicableProjectInstructions?: import("../config/contextFiles.js").ContextFile[];
76
75
  })>;
77
76
  grep: import("ai").Tool<{
78
77
  pattern: string;
@@ -86,7 +85,7 @@ export declare const hazeTools: {
86
85
  toolName: string;
87
86
  path: string | undefined;
88
87
  error: string;
89
- reasonCode: ToolFailureReasonCode | undefined;
88
+ reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
90
89
  recoverable: boolean;
91
90
  suggestedNextStep: string;
92
91
  recoveryTool: string | undefined;
@@ -105,7 +104,7 @@ export declare const hazeTools: {
105
104
  totalMatches: number;
106
105
  truncated: boolean;
107
106
  } & {
108
- applicableProjectInstructions?: ContextFile[];
107
+ applicableProjectInstructions?: import("../config/contextFiles.js").ContextFile[];
109
108
  }) | ({
110
109
  suggestion: string | undefined;
111
110
  omittedChars: number;
@@ -136,7 +135,7 @@ export declare const hazeTools: {
136
135
  lossy: boolean;
137
136
  parseTier: string;
138
137
  } & {
139
- applicableProjectInstructions?: ContextFile[];
138
+ applicableProjectInstructions?: import("../config/contextFiles.js").ContextFile[];
140
139
  })>;
141
140
  replaceLines: import("ai").Tool<{
142
141
  path: string;
@@ -147,22 +146,22 @@ export declare const hazeTools: {
147
146
  }, {
148
147
  ok: boolean;
149
148
  toolName: string;
150
- path: string;
149
+ path: string | undefined;
151
150
  error: string;
152
- reasonCode: "scoped_instructions_discovered";
151
+ reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
153
152
  recoverable: boolean;
154
153
  suggestedNextStep: string;
155
- applicableProjectInstructions: ContextFile[];
154
+ recoveryTool: string | undefined;
155
+ recoveryInput: unknown;
156
156
  } | {
157
157
  ok: boolean;
158
158
  toolName: string;
159
- path: string | undefined;
159
+ path: string;
160
160
  error: string;
161
- reasonCode: ToolFailureReasonCode | undefined;
161
+ reasonCode: "scoped_instructions_discovered";
162
162
  recoverable: boolean;
163
163
  suggestedNextStep: string;
164
- recoveryTool: string | undefined;
165
- recoveryInput: unknown;
164
+ applicableProjectInstructions: import("../config/contextFiles.js").ContextFile[];
166
165
  } | {
167
166
  ok: true;
168
167
  duplicateSkipped: true;
@@ -190,22 +189,22 @@ export declare const hazeTools: {
190
189
  }, {
191
190
  ok: boolean;
192
191
  toolName: string;
193
- path: string;
192
+ path: string | undefined;
194
193
  error: string;
195
- reasonCode: "scoped_instructions_discovered";
194
+ reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
196
195
  recoverable: boolean;
197
196
  suggestedNextStep: string;
198
- applicableProjectInstructions: ContextFile[];
197
+ recoveryTool: string | undefined;
198
+ recoveryInput: unknown;
199
199
  } | {
200
200
  ok: boolean;
201
201
  toolName: string;
202
- path: string | undefined;
202
+ path: string;
203
203
  error: string;
204
- reasonCode: ToolFailureReasonCode | undefined;
204
+ reasonCode: "scoped_instructions_discovered";
205
205
  recoverable: boolean;
206
206
  suggestedNextStep: string;
207
- recoveryTool: string | undefined;
208
- recoveryInput: unknown;
207
+ applicableProjectInstructions: import("../config/contextFiles.js").ContextFile[];
209
208
  } | {
210
209
  ok: true;
211
210
  duplicateSkipped: true;
@@ -227,22 +226,22 @@ export declare const hazeTools: {
227
226
  }, {
228
227
  ok: boolean;
229
228
  toolName: string;
230
- path: string;
229
+ path: string | undefined;
231
230
  error: string;
232
- reasonCode: "scoped_instructions_discovered";
231
+ reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
233
232
  recoverable: boolean;
234
233
  suggestedNextStep: string;
235
- applicableProjectInstructions: ContextFile[];
234
+ recoveryTool: string | undefined;
235
+ recoveryInput: unknown;
236
236
  } | {
237
237
  ok: boolean;
238
238
  toolName: string;
239
- path: string | undefined;
239
+ path: string;
240
240
  error: string;
241
- reasonCode: ToolFailureReasonCode | undefined;
241
+ reasonCode: "scoped_instructions_discovered";
242
242
  recoverable: boolean;
243
243
  suggestedNextStep: string;
244
- recoveryTool: string | undefined;
245
- recoveryInput: unknown;
244
+ applicableProjectInstructions: import("../config/contextFiles.js").ContextFile[];
246
245
  } | {
247
246
  ok: true;
248
247
  duplicateSkipped: true;
@@ -298,13 +297,13 @@ export declare const hazeTools: {
298
297
  }>;
299
298
  fetch: import("ai").Tool<{
300
299
  url: string;
301
- format: "text" | "auto";
300
+ format: "auto" | "text";
302
301
  }, {
303
302
  ok: boolean;
304
303
  toolName: string;
305
304
  path: string | undefined;
306
305
  error: string;
307
- reasonCode: ToolFailureReasonCode | undefined;
306
+ reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
308
307
  recoverable: boolean;
309
308
  suggestedNextStep: string;
310
309
  recoveryTool: string | undefined;