@denizokcu/haze 1.7.10 → 1.7.11
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 +7 -0
- package/README.md +18 -8
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/BusyBar.d.ts +2 -1
- package/dist/cli/chat/BusyBar.js +2 -2
- package/dist/cli/chat/chatMetrics.d.ts +25 -0
- package/dist/cli/chat/chatMetrics.js +36 -0
- package/dist/cli/chat/sessionLifecycle.d.ts +2 -0
- package/dist/cli/chat/sessionLifecycle.js +27 -18
- package/dist/cli/chat/sessionRecorder.d.ts +2 -1
- package/dist/cli/chat/sessionRecorder.js +25 -8
- package/dist/cli/chat/transcriptPartition.js +10 -4
- package/dist/cli/chat/wizard/providerHandlers.js +57 -9
- package/dist/cli/chat/wizard/sessionThemeHandlers.js +5 -1
- package/dist/cli/commands/chat.js +39 -7
- package/dist/cli/commands/commandHelp.js +2 -2
- package/dist/cli/commands/providerWizard.js +9 -17
- package/dist/cli/commands/reasoningCommand.d.ts +1 -0
- package/dist/cli/commands/reasoningCommand.js +32 -4
- package/dist/cli/commands/runCommand.js +7 -1
- package/dist/cli/commands/streaming/attemptLifecycle.js +1 -0
- package/dist/cli/commands/streaming/attemptOutcome.js +5 -1
- package/dist/cli/commands/streaming/attemptSetup.js +5 -3
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +1 -1
- package/dist/cli/commands/streaming/goalSupervisor.js +20 -1
- package/dist/cli/commands/streaming/streamLoop.js +11 -10
- package/dist/cli/commands/streaming.d.ts +2 -0
- package/dist/cli/commands/wizardFlow.d.ts +1 -0
- package/dist/cli/commands/wizardFlow.js +10 -4
- package/dist/cli/index.js +5 -3
- package/dist/config/hazeBuild.d.ts +2 -2
- package/dist/config/hazeBuild.js +2 -2
- package/dist/config/modelDiscovery.d.ts +1 -1
- package/dist/config/modelDiscovery.js +8 -8
- package/dist/config/{modelCatalog.d.ts → providerModelFacts.d.ts} +13 -2
- package/dist/config/{modelCatalog.js → providerModelFacts.js} +145 -21
- package/dist/config/providerPresets.d.ts +8 -19
- package/dist/config/providerPresets.js +86 -555
- package/dist/config/providerReasoning.d.ts +16 -0
- package/dist/config/providerReasoning.js +56 -0
- package/dist/config/providers.d.ts +4 -0
- package/dist/config/providers.js +19 -2
- package/dist/config/settings.d.ts +14 -0
- package/dist/config/settings.js +5 -0
- package/dist/core/agent/events.d.ts +1 -1
- package/dist/core/agent/providerTransition.d.ts +8 -0
- package/dist/core/agent/providerTransition.js +47 -0
- package/dist/core/agent/reasoningPolicy.d.ts +1 -1
- package/dist/core/agent/reasoningPolicy.js +4 -2
- package/dist/core/limits.d.ts +0 -2
- package/dist/core/limits.js +0 -2
- package/dist/core/providerContracts.d.ts +9 -8
- package/dist/core/providerContracts.js +21 -1
- package/dist/core/safety/redaction.js +12 -2
- package/dist/core/session/sessionSlimming.js +5 -59
- package/dist/core/session/sessionStore.d.ts +4 -0
- package/dist/core/session/sessionStore.js +149 -9
- package/dist/core/session/snapshotCodec.d.ts +5 -0
- package/dist/core/session/snapshotCodec.js +47 -0
- package/dist/core/shellOutput/registry.js +2 -46
- package/dist/core/subagent/executionProfiles.js +4 -1
- package/dist/core/toolOutput/reduction.d.ts +55 -2
- package/dist/core/toolOutput/reduction.js +77 -2
- package/dist/llm/client.d.ts +4 -2
- package/dist/llm/client.js +104 -55
- package/dist/llm/hazeTools.d.ts +16 -16
- package/dist/llm/mistralReasoning.d.ts +2 -0
- package/dist/llm/mistralReasoning.js +17 -0
- package/dist/llm/mistralVibeAuth.d.ts +5 -0
- package/dist/llm/mistralVibeAuth.js +63 -0
- package/dist/llm/requestContext.js +8 -7
- package/dist/llm/subagentRunner.js +15 -7
- package/dist/llm/toolResultTypes.js +7 -1
- package/dist/llm/tools/fetchTool.d.ts +16 -16
- package/dist/llm/tools/outputCap.d.ts +2 -7
- package/dist/llm/tools/outputCap.js +3 -11
- package/dist/llm/tools/replaceInFiles.js +5 -0
- package/package.json +14 -8
|
@@ -47,7 +47,7 @@ export declare const fetchTool: ({
|
|
|
47
47
|
} | {
|
|
48
48
|
handle: string;
|
|
49
49
|
rawHandle: string;
|
|
50
|
-
omittedChars: number;
|
|
50
|
+
omittedChars: number | undefined;
|
|
51
51
|
rawChars: number;
|
|
52
52
|
returnedChars: number;
|
|
53
53
|
rawTokensEstimate: number;
|
|
@@ -112,7 +112,7 @@ export declare const fetchTool: ({
|
|
|
112
112
|
} | {
|
|
113
113
|
handle: string;
|
|
114
114
|
rawHandle: string;
|
|
115
|
-
omittedChars: number;
|
|
115
|
+
omittedChars: number | undefined;
|
|
116
116
|
rawChars: number;
|
|
117
117
|
returnedChars: number;
|
|
118
118
|
rawTokensEstimate: number;
|
|
@@ -178,7 +178,7 @@ export declare const fetchTool: ({
|
|
|
178
178
|
} | {
|
|
179
179
|
handle: string;
|
|
180
180
|
rawHandle: string;
|
|
181
|
-
omittedChars: number;
|
|
181
|
+
omittedChars: number | undefined;
|
|
182
182
|
rawChars: number;
|
|
183
183
|
returnedChars: number;
|
|
184
184
|
rawTokensEstimate: number;
|
|
@@ -263,7 +263,7 @@ export declare const fetchTool: ({
|
|
|
263
263
|
} | {
|
|
264
264
|
handle: string;
|
|
265
265
|
rawHandle: string;
|
|
266
|
-
omittedChars: number;
|
|
266
|
+
omittedChars: number | undefined;
|
|
267
267
|
rawChars: number;
|
|
268
268
|
returnedChars: number;
|
|
269
269
|
rawTokensEstimate: number;
|
|
@@ -356,7 +356,7 @@ export declare const fetchTool: ({
|
|
|
356
356
|
} | {
|
|
357
357
|
handle: string;
|
|
358
358
|
rawHandle: string;
|
|
359
|
-
omittedChars: number;
|
|
359
|
+
omittedChars: number | undefined;
|
|
360
360
|
rawChars: number;
|
|
361
361
|
returnedChars: number;
|
|
362
362
|
rawTokensEstimate: number;
|
|
@@ -421,7 +421,7 @@ export declare const fetchTool: ({
|
|
|
421
421
|
} | {
|
|
422
422
|
handle: string;
|
|
423
423
|
rawHandle: string;
|
|
424
|
-
omittedChars: number;
|
|
424
|
+
omittedChars: number | undefined;
|
|
425
425
|
rawChars: number;
|
|
426
426
|
returnedChars: number;
|
|
427
427
|
rawTokensEstimate: number;
|
|
@@ -487,7 +487,7 @@ export declare const fetchTool: ({
|
|
|
487
487
|
} | {
|
|
488
488
|
handle: string;
|
|
489
489
|
rawHandle: string;
|
|
490
|
-
omittedChars: number;
|
|
490
|
+
omittedChars: number | undefined;
|
|
491
491
|
rawChars: number;
|
|
492
492
|
returnedChars: number;
|
|
493
493
|
rawTokensEstimate: number;
|
|
@@ -572,7 +572,7 @@ export declare const fetchTool: ({
|
|
|
572
572
|
} | {
|
|
573
573
|
handle: string;
|
|
574
574
|
rawHandle: string;
|
|
575
|
-
omittedChars: number;
|
|
575
|
+
omittedChars: number | undefined;
|
|
576
576
|
rawChars: number;
|
|
577
577
|
returnedChars: number;
|
|
578
578
|
rawTokensEstimate: number;
|
|
@@ -665,7 +665,7 @@ export declare const fetchTool: ({
|
|
|
665
665
|
} | {
|
|
666
666
|
handle: string;
|
|
667
667
|
rawHandle: string;
|
|
668
|
-
omittedChars: number;
|
|
668
|
+
omittedChars: number | undefined;
|
|
669
669
|
rawChars: number;
|
|
670
670
|
returnedChars: number;
|
|
671
671
|
rawTokensEstimate: number;
|
|
@@ -730,7 +730,7 @@ export declare const fetchTool: ({
|
|
|
730
730
|
} | {
|
|
731
731
|
handle: string;
|
|
732
732
|
rawHandle: string;
|
|
733
|
-
omittedChars: number;
|
|
733
|
+
omittedChars: number | undefined;
|
|
734
734
|
rawChars: number;
|
|
735
735
|
returnedChars: number;
|
|
736
736
|
rawTokensEstimate: number;
|
|
@@ -796,7 +796,7 @@ export declare const fetchTool: ({
|
|
|
796
796
|
} | {
|
|
797
797
|
handle: string;
|
|
798
798
|
rawHandle: string;
|
|
799
|
-
omittedChars: number;
|
|
799
|
+
omittedChars: number | undefined;
|
|
800
800
|
rawChars: number;
|
|
801
801
|
returnedChars: number;
|
|
802
802
|
rawTokensEstimate: number;
|
|
@@ -873,7 +873,7 @@ export declare const fetchTool: ({
|
|
|
873
873
|
} | {
|
|
874
874
|
handle: string;
|
|
875
875
|
rawHandle: string;
|
|
876
|
-
omittedChars: number;
|
|
876
|
+
omittedChars: number | undefined;
|
|
877
877
|
rawChars: number;
|
|
878
878
|
returnedChars: number;
|
|
879
879
|
rawTokensEstimate: number;
|
|
@@ -966,7 +966,7 @@ export declare const fetchTool: ({
|
|
|
966
966
|
} | {
|
|
967
967
|
handle: string;
|
|
968
968
|
rawHandle: string;
|
|
969
|
-
omittedChars: number;
|
|
969
|
+
omittedChars: number | undefined;
|
|
970
970
|
rawChars: number;
|
|
971
971
|
returnedChars: number;
|
|
972
972
|
rawTokensEstimate: number;
|
|
@@ -1031,7 +1031,7 @@ export declare const fetchTool: ({
|
|
|
1031
1031
|
} | {
|
|
1032
1032
|
handle: string;
|
|
1033
1033
|
rawHandle: string;
|
|
1034
|
-
omittedChars: number;
|
|
1034
|
+
omittedChars: number | undefined;
|
|
1035
1035
|
rawChars: number;
|
|
1036
1036
|
returnedChars: number;
|
|
1037
1037
|
rawTokensEstimate: number;
|
|
@@ -1097,7 +1097,7 @@ export declare const fetchTool: ({
|
|
|
1097
1097
|
} | {
|
|
1098
1098
|
handle: string;
|
|
1099
1099
|
rawHandle: string;
|
|
1100
|
-
omittedChars: number;
|
|
1100
|
+
omittedChars: number | undefined;
|
|
1101
1101
|
rawChars: number;
|
|
1102
1102
|
returnedChars: number;
|
|
1103
1103
|
rawTokensEstimate: number;
|
|
@@ -1174,7 +1174,7 @@ export declare const fetchTool: ({
|
|
|
1174
1174
|
} | {
|
|
1175
1175
|
handle: string;
|
|
1176
1176
|
rawHandle: string;
|
|
1177
|
-
omittedChars: number;
|
|
1177
|
+
omittedChars: number | undefined;
|
|
1178
1178
|
rawChars: number;
|
|
1179
1179
|
returnedChars: number;
|
|
1180
1180
|
rawTokensEstimate: number;
|
|
@@ -10,13 +10,8 @@ export { COMPACT_COMMAND_CHARS };
|
|
|
10
10
|
export declare function compactStoredOutput(text: string, maxChars?: number, origin?: StoredOutputOrigin): {
|
|
11
11
|
text: string;
|
|
12
12
|
truncated: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} | {
|
|
16
|
-
text: string;
|
|
17
|
-
truncated: boolean;
|
|
18
|
-
omittedChars: number;
|
|
19
|
-
handle: string;
|
|
13
|
+
handle?: string;
|
|
14
|
+
omittedChars?: number;
|
|
20
15
|
};
|
|
21
16
|
/** Render structured grep matches as `file:line:content` lines (context flagged with `-`). */
|
|
22
17
|
export declare function renderGrepMatches(matches: Array<{
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { compactOutput } from '../../core/toolOutput/reduction.js';
|
|
1
2
|
import { storeToolOutput } from '../../core/agent/toolOutputStore.js';
|
|
2
3
|
import { COMPACT_COMMAND_CHARS, GREP_MAX_LINE_CHARS, GREP_MAX_OUTPUT_CHARS } from '../../core/limits.js';
|
|
3
4
|
export { COMPACT_COMMAND_CHARS };
|
|
@@ -8,17 +9,8 @@ export { COMPACT_COMMAND_CHARS };
|
|
|
8
9
|
* envelope on every read.
|
|
9
10
|
*/
|
|
10
11
|
export function compactStoredOutput(text, maxChars = COMPACT_COMMAND_CHARS, origin) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const handle = storeToolOutput(text, origin);
|
|
14
|
-
const headChars = Math.floor(maxChars * 0.4);
|
|
15
|
-
const tailChars = maxChars - headChars;
|
|
16
|
-
return {
|
|
17
|
-
text: `${text.slice(0, headChars)}\n\n[... ${text.length - maxChars} characters omitted; use readToolOutput with handle ${handle} ...]\n\n${text.slice(-tailChars)}`,
|
|
18
|
-
truncated: true,
|
|
19
|
-
omittedChars: text.length - maxChars,
|
|
20
|
-
handle,
|
|
21
|
-
};
|
|
12
|
+
const result = compactOutput(text, maxChars, origin ? (text) => storeToolOutput(text, origin) : storeToolOutput);
|
|
13
|
+
return result;
|
|
22
14
|
}
|
|
23
15
|
/** Truncate a single over-long line in place. */
|
|
24
16
|
function compactLine(text, maxChars = GREP_MAX_LINE_CHARS) {
|
|
@@ -50,6 +50,11 @@ function applyOccurrences(content, occurrences) {
|
|
|
50
50
|
export async function replaceInFiles(input, context) {
|
|
51
51
|
if (!input.needle)
|
|
52
52
|
throw new Error('needle must not be empty');
|
|
53
|
+
// A regex needle this long is almost always catastrophic-backtracking input
|
|
54
|
+
// rather than a real search pattern; reject it before scanning any file.
|
|
55
|
+
if (input.mode === 'regex' && input.needle.length > 512) {
|
|
56
|
+
throw new Error('regex needle exceeds 512 characters; shorten it or switch to literal mode.');
|
|
57
|
+
}
|
|
53
58
|
const base = await prepareWorkspaceRead(input.path, false, context);
|
|
54
59
|
const stat = await fs.stat(base);
|
|
55
60
|
const ignore = createIgnoreClassifier(workspaceRoot());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@denizokcu/haze",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.11",
|
|
4
4
|
"description": "A minimal LLM harness for your terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=22"
|
|
19
|
+
"node": ">=22.13.0"
|
|
20
20
|
},
|
|
21
21
|
"bin": {
|
|
22
22
|
"haze": "bin/haze.js"
|
|
@@ -50,18 +50,19 @@
|
|
|
50
50
|
"eval:native": "node scripts/run-native-evals.mjs"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@ai-sdk/mcp": "^2.0.
|
|
54
|
-
"@ai-sdk/openai": "4.0.
|
|
55
|
-
"@ai-sdk/openai-compatible": "3.0.
|
|
53
|
+
"@ai-sdk/mcp": "^2.0.92",
|
|
54
|
+
"@ai-sdk/openai": "4.0.110",
|
|
55
|
+
"@ai-sdk/openai-compatible": "3.0.86",
|
|
56
56
|
"@inkjs/ui": "2.0.0",
|
|
57
|
+
"@openrouter/ai-sdk-provider": "^3.1.0",
|
|
57
58
|
"@vscode/ripgrep": "1.18.0",
|
|
58
|
-
"ai": "7.0.
|
|
59
|
+
"ai": "7.0.164",
|
|
59
60
|
"commander": "15.0.0",
|
|
60
61
|
"defuddle": "^0.19.6",
|
|
61
62
|
"highlight.js": "^11.12.0",
|
|
62
63
|
"ignore": "^7.0.14",
|
|
63
64
|
"ink": "8.0.0",
|
|
64
|
-
"marked": "18.1.
|
|
65
|
+
"marked": "18.1.3",
|
|
65
66
|
"react": "19.3.1",
|
|
66
67
|
"string-width": "8.3.0",
|
|
67
68
|
"wrap-ansi": "10.0.2",
|
|
@@ -74,11 +75,16 @@
|
|
|
74
75
|
"@types/react": "19.3.0",
|
|
75
76
|
"eslint": "^10.14.0",
|
|
76
77
|
"ink-testing-library": "^4.0.0",
|
|
78
|
+
"jscpd": "^5.4.2",
|
|
77
79
|
"knip": "6.44.1",
|
|
80
|
+
"lefthook": "^2.2.2",
|
|
78
81
|
"strip-ansi": "7.2.0",
|
|
79
82
|
"tsx": "4.23.15",
|
|
80
83
|
"typescript": "6.0.3",
|
|
81
84
|
"typescript-eslint": "^8.72.1",
|
|
82
|
-
"vitest": "^5.0
|
|
85
|
+
"vitest": "^5.1.0"
|
|
86
|
+
},
|
|
87
|
+
"overrides": {
|
|
88
|
+
"minimatch": "11.0.1"
|
|
83
89
|
}
|
|
84
90
|
}
|