@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.
- package/CHANGELOG.md +36 -1
- package/README.md +101 -24
- package/dist/cli/chat/TaskBar.d.ts +9 -0
- package/dist/cli/chat/TaskBar.js +40 -0
- package/dist/cli/chat/chatMetrics.d.ts +11 -0
- package/dist/cli/chat/chatMetrics.js +50 -0
- package/dist/cli/chat/inputSuggestions.d.ts +16 -0
- package/dist/cli/chat/inputSuggestions.js +55 -0
- package/dist/cli/chat/messages.d.ts +9 -0
- package/dist/cli/chat/messages.js +76 -0
- package/dist/cli/chat/sessionRecorder.d.ts +12 -0
- package/dist/cli/chat/sessionRecorder.js +21 -0
- package/dist/cli/chat/startupInfo.d.ts +4 -0
- package/dist/cli/chat/startupInfo.js +53 -0
- package/dist/cli/chat/turnState.d.ts +5 -0
- package/dist/cli/chat/turnState.js +20 -0
- package/dist/cli/commands/chat.d.ts +0 -1
- package/dist/cli/commands/chat.js +519 -495
- package/dist/cli/commands/chatModes.d.ts +8 -0
- package/dist/cli/commands/chatModes.js +44 -0
- package/dist/cli/commands/commandHelp.d.ts +6 -0
- package/dist/cli/commands/commandHelp.js +25 -0
- package/dist/cli/commands/commands.d.ts +3 -2
- package/dist/cli/commands/commands.js +55 -320
- package/dist/cli/commands/formatters.d.ts +27 -0
- package/dist/cli/commands/formatters.js +149 -4
- package/dist/cli/commands/initCommand.d.ts +2 -0
- package/dist/cli/commands/initCommand.js +19 -0
- package/dist/cli/commands/logsCommand.d.ts +2 -0
- package/dist/cli/commands/logsCommand.js +63 -0
- package/dist/cli/commands/lspWizard.d.ts +14 -0
- package/dist/cli/commands/lspWizard.js +44 -0
- package/dist/cli/commands/mcpWizard.d.ts +15 -0
- package/dist/cli/commands/mcpWizard.js +69 -0
- package/dist/cli/commands/modelCommand.d.ts +2 -0
- package/dist/cli/commands/modelCommand.js +36 -0
- package/dist/cli/commands/providerWizard.d.ts +30 -0
- package/dist/cli/commands/providerWizard.js +114 -0
- package/dist/cli/commands/runCommand.d.ts +16 -0
- package/dist/cli/commands/runCommand.js +170 -0
- package/dist/cli/commands/settingsSummary.d.ts +3 -0
- package/dist/cli/commands/settingsSummary.js +40 -0
- package/dist/cli/commands/skillConfirmRemove.d.ts +11 -0
- package/dist/cli/commands/skillConfirmRemove.js +19 -0
- package/dist/cli/commands/skillCreation.d.ts +12 -0
- package/dist/cli/commands/skillCreation.js +14 -0
- package/dist/cli/commands/skillWizard.d.ts +15 -0
- package/dist/cli/commands/skillWizard.js +38 -0
- package/dist/cli/commands/streaming/assistantText.d.ts +17 -0
- package/dist/cli/commands/streaming/assistantText.js +115 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +55 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.js +102 -0
- package/dist/cli/commands/streaming/toolResultState.d.ts +13 -0
- package/dist/cli/commands/streaming/toolResultState.js +25 -0
- package/dist/cli/commands/streaming/turnRuntime.d.ts +78 -0
- package/dist/cli/commands/streaming/turnRuntime.js +86 -0
- package/dist/cli/commands/streaming.d.ts +10 -29
- package/dist/cli/commands/streaming.js +249 -911
- package/dist/cli/commands/wizardActions.d.ts +40 -0
- package/dist/cli/commands/wizardActions.js +40 -0
- package/dist/cli/commands/wizardInput.d.ts +4 -0
- package/dist/cli/commands/wizardInput.js +19 -0
- package/dist/cli/commands/wizardPrompts.d.ts +22 -0
- package/dist/cli/commands/wizardPrompts.js +52 -0
- package/dist/cli/commands/wizardSuggestions.d.ts +23 -0
- package/dist/cli/commands/wizardSuggestions.js +139 -0
- package/dist/cli/index.js +62 -4
- package/dist/config/contextFiles.d.ts +8 -1
- package/dist/config/contextFiles.js +25 -12
- package/dist/config/lspSettings.d.ts +16 -0
- package/dist/config/lspSettings.js +95 -0
- package/dist/config/mcpSettings.d.ts +24 -0
- package/dist/config/mcpSettings.js +100 -0
- package/dist/config/providers.js +4 -4
- package/dist/config/settings.d.ts +34 -0
- package/dist/config/skillSettings.d.ts +15 -0
- package/dist/config/skillSettings.js +32 -0
- package/dist/config/updateCheck.d.ts +44 -0
- package/dist/config/updateCheck.js +83 -0
- package/dist/core/agent/budgets.d.ts +6 -0
- package/dist/core/agent/budgets.js +6 -0
- package/dist/core/agent/compaction.js +1 -1
- package/dist/core/agent/requestAssembly.d.ts +0 -7
- package/dist/core/agent/requestAssembly.js +27 -5
- package/dist/core/agent/toolOutputStore.js +5 -4
- package/dist/core/agent/toolResults.d.ts +31 -0
- package/dist/core/agent/toolResults.js +42 -0
- package/dist/core/agent/turnPolicy.d.ts +8 -0
- package/dist/core/agent/turnPolicy.js +23 -0
- package/dist/core/agent/workState.d.ts +18 -5
- package/dist/core/agent/workState.js +39 -20
- package/dist/core/bashOutput/reducers/content.d.ts +1 -0
- package/dist/core/bashOutput/reducers/content.js +1 -1
- package/dist/core/bashOutput/reducers/gh.d.ts +1 -0
- package/dist/core/bashOutput/reducers/gh.js +77 -0
- package/dist/core/bashOutput/registry.js +8 -0
- package/dist/core/goal/sessionGoal.d.ts +6 -30
- package/dist/core/goal/sessionGoal.js +3 -68
- package/dist/core/safety/bashClassifier.js +30 -0
- package/dist/core/safety/urlGuard.d.ts +1 -0
- package/dist/core/safety/urlGuard.js +6 -1
- package/dist/core/session/sessionSlimming.d.ts +5 -0
- package/dist/core/session/sessionSlimming.js +78 -0
- package/dist/core/session/sessionStore.d.ts +23 -3
- package/dist/core/session/sessionStore.js +30 -10
- package/dist/core/subagent/subagentRunner.d.ts +11 -1
- package/dist/core/subagent/subagentRunner.js +1 -0
- package/dist/llm/capabilities.d.ts +12 -0
- package/dist/llm/capabilities.js +10 -0
- package/dist/llm/client.d.ts +1 -0
- package/dist/llm/client.js +11 -2
- package/dist/llm/hazeTools.d.ts +31 -32
- package/dist/llm/hazeTools.js +40 -567
- package/dist/llm/lsp.d.ts +109 -0
- package/dist/llm/lsp.js +241 -0
- package/dist/llm/lspTools.d.ts +104 -0
- package/dist/llm/lspTools.js +115 -0
- package/dist/llm/mcp.d.ts +19 -0
- package/dist/llm/mcp.js +73 -0
- package/dist/llm/requestContext.d.ts +28 -0
- package/dist/llm/requestContext.js +41 -0
- package/dist/llm/systemPrompt.d.ts +5 -1
- package/dist/llm/systemPrompt.js +9 -3
- package/dist/llm/tools/bashTool.d.ts +5 -0
- package/dist/llm/tools/bashTool.js +81 -0
- package/dist/llm/tools/editMatch.d.ts +55 -0
- package/dist/llm/tools/editMatch.js +99 -0
- package/dist/llm/tools/failures.d.ts +36 -0
- package/dist/llm/tools/failures.js +38 -0
- package/dist/llm/tools/fetchTool.d.ts +65 -0
- package/dist/llm/tools/fetchTool.js +45 -0
- package/dist/llm/tools/fileToolShared.d.ts +10 -0
- package/dist/llm/tools/fileToolShared.js +43 -0
- package/dist/llm/tools/grepParse.d.ts +13 -0
- package/dist/llm/tools/grepParse.js +67 -0
- package/dist/llm/tools/outputCap.d.ts +53 -0
- package/dist/llm/tools/outputCap.js +67 -0
- package/dist/llm/tools/storedOutputTool.d.ts +10 -0
- package/dist/llm/tools/storedOutputTool.js +17 -0
- package/dist/llm/tools/taskTool.d.ts +28 -0
- package/dist/llm/tools/taskTool.js +41 -0
- package/dist/llm/tools/toolContext.d.ts +69 -0
- package/dist/llm/tools/toolContext.js +187 -0
- package/dist/llm/tools/workspaceFile.d.ts +33 -0
- package/dist/llm/tools/workspaceFile.js +27 -0
- package/dist/llm/webFetch.d.ts +13 -1
- package/dist/llm/webFetch.js +91 -7
- package/dist/skills/builder/SkillBuilder.d.ts +3 -0
- package/dist/skills/builder/SkillBuilder.js +24 -45
- package/dist/ui/components/TextInput.d.ts +1 -1
- package/dist/ui/components/TextInput.js +1 -99
- package/dist/ui/inputBuffer.d.ts +28 -0
- package/dist/ui/inputBuffer.js +99 -0
- package/dist/utils/collections.d.ts +6 -0
- package/dist/utils/collections.js +9 -0
- package/dist/utils/path.d.ts +2 -0
- package/dist/utils/path.js +40 -0
- package/dist/utils/version.d.ts +20 -0
- package/dist/utils/version.js +72 -0
- package/package.json +2 -2
- package/dist/cli/commands/skills.d.ts +0 -4
- 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
|
+
}
|
package/dist/llm/client.d.ts
CHANGED
package/dist/llm/client.js
CHANGED
|
@@ -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
|
|
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;
|
package/dist/llm/hazeTools.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ToolDiffLine
|
|
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: "
|
|
151
|
+
reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
|
|
153
152
|
recoverable: boolean;
|
|
154
153
|
suggestedNextStep: string;
|
|
155
|
-
|
|
154
|
+
recoveryTool: string | undefined;
|
|
155
|
+
recoveryInput: unknown;
|
|
156
156
|
} | {
|
|
157
157
|
ok: boolean;
|
|
158
158
|
toolName: string;
|
|
159
|
-
path: string
|
|
159
|
+
path: string;
|
|
160
160
|
error: string;
|
|
161
|
-
reasonCode:
|
|
161
|
+
reasonCode: "scoped_instructions_discovered";
|
|
162
162
|
recoverable: boolean;
|
|
163
163
|
suggestedNextStep: string;
|
|
164
|
-
|
|
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: "
|
|
194
|
+
reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
|
|
196
195
|
recoverable: boolean;
|
|
197
196
|
suggestedNextStep: string;
|
|
198
|
-
|
|
197
|
+
recoveryTool: string | undefined;
|
|
198
|
+
recoveryInput: unknown;
|
|
199
199
|
} | {
|
|
200
200
|
ok: boolean;
|
|
201
201
|
toolName: string;
|
|
202
|
-
path: string
|
|
202
|
+
path: string;
|
|
203
203
|
error: string;
|
|
204
|
-
reasonCode:
|
|
204
|
+
reasonCode: "scoped_instructions_discovered";
|
|
205
205
|
recoverable: boolean;
|
|
206
206
|
suggestedNextStep: string;
|
|
207
|
-
|
|
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: "
|
|
231
|
+
reasonCode: import("./toolResultTypes.js").ToolFailureReasonCode | undefined;
|
|
233
232
|
recoverable: boolean;
|
|
234
233
|
suggestedNextStep: string;
|
|
235
|
-
|
|
234
|
+
recoveryTool: string | undefined;
|
|
235
|
+
recoveryInput: unknown;
|
|
236
236
|
} | {
|
|
237
237
|
ok: boolean;
|
|
238
238
|
toolName: string;
|
|
239
|
-
path: string
|
|
239
|
+
path: string;
|
|
240
240
|
error: string;
|
|
241
|
-
reasonCode:
|
|
241
|
+
reasonCode: "scoped_instructions_discovered";
|
|
242
242
|
recoverable: boolean;
|
|
243
243
|
suggestedNextStep: string;
|
|
244
|
-
|
|
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: "
|
|
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;
|