@denizokcu/haze 1.7.9 → 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.
Files changed (78) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +22 -8
  3. package/dist/buildInfo.json +3 -3
  4. package/dist/cli/chat/BusyBar.d.ts +2 -1
  5. package/dist/cli/chat/BusyBar.js +2 -2
  6. package/dist/cli/chat/chatMetrics.d.ts +25 -0
  7. package/dist/cli/chat/chatMetrics.js +36 -0
  8. package/dist/cli/chat/sessionLifecycle.d.ts +2 -0
  9. package/dist/cli/chat/sessionLifecycle.js +27 -18
  10. package/dist/cli/chat/sessionRecorder.d.ts +2 -1
  11. package/dist/cli/chat/sessionRecorder.js +25 -8
  12. package/dist/cli/chat/transcriptPartition.js +10 -4
  13. package/dist/cli/chat/wizard/providerHandlers.js +57 -9
  14. package/dist/cli/chat/wizard/sessionThemeHandlers.js +5 -1
  15. package/dist/cli/commands/chat.js +39 -7
  16. package/dist/cli/commands/commandHelp.js +2 -2
  17. package/dist/cli/commands/providerWizard.js +9 -17
  18. package/dist/cli/commands/reasoningCommand.d.ts +1 -0
  19. package/dist/cli/commands/reasoningCommand.js +32 -4
  20. package/dist/cli/commands/runCommand.js +7 -1
  21. package/dist/cli/commands/streaming/attemptLifecycle.js +1 -0
  22. package/dist/cli/commands/streaming/attemptOutcome.js +5 -1
  23. package/dist/cli/commands/streaming/attemptSetup.js +5 -3
  24. package/dist/cli/commands/streaming/goalSupervisor.d.ts +1 -1
  25. package/dist/cli/commands/streaming/goalSupervisor.js +20 -1
  26. package/dist/cli/commands/streaming/streamLoop.js +11 -10
  27. package/dist/cli/commands/streaming.d.ts +2 -0
  28. package/dist/cli/commands/wizardFlow.d.ts +1 -0
  29. package/dist/cli/commands/wizardFlow.js +10 -4
  30. package/dist/cli/index.js +5 -3
  31. package/dist/config/hazeBuild.d.ts +2 -2
  32. package/dist/config/hazeBuild.js +6 -3
  33. package/dist/config/modelDiscovery.d.ts +1 -1
  34. package/dist/config/modelDiscovery.js +8 -8
  35. package/dist/config/{modelCatalog.d.ts → providerModelFacts.d.ts} +13 -2
  36. package/dist/config/{modelCatalog.js → providerModelFacts.js} +145 -21
  37. package/dist/config/providerPresets.d.ts +8 -19
  38. package/dist/config/providerPresets.js +86 -555
  39. package/dist/config/providerReasoning.d.ts +16 -0
  40. package/dist/config/providerReasoning.js +56 -0
  41. package/dist/config/providers.d.ts +4 -0
  42. package/dist/config/providers.js +19 -2
  43. package/dist/config/settings.d.ts +14 -0
  44. package/dist/config/settings.js +5 -0
  45. package/dist/core/agent/events.d.ts +1 -1
  46. package/dist/core/agent/providerTransition.d.ts +8 -0
  47. package/dist/core/agent/providerTransition.js +47 -0
  48. package/dist/core/agent/reasoningPolicy.d.ts +1 -1
  49. package/dist/core/agent/reasoningPolicy.js +4 -2
  50. package/dist/core/limits.d.ts +0 -2
  51. package/dist/core/limits.js +0 -2
  52. package/dist/core/providerContracts.d.ts +9 -8
  53. package/dist/core/providerContracts.js +21 -1
  54. package/dist/core/safety/redaction.js +12 -2
  55. package/dist/core/session/sessionSlimming.js +5 -59
  56. package/dist/core/session/sessionStore.d.ts +4 -0
  57. package/dist/core/session/sessionStore.js +149 -9
  58. package/dist/core/session/snapshotCodec.d.ts +5 -0
  59. package/dist/core/session/snapshotCodec.js +47 -0
  60. package/dist/core/shellOutput/registry.js +2 -46
  61. package/dist/core/subagent/executionProfiles.js +4 -1
  62. package/dist/core/toolOutput/reduction.d.ts +55 -2
  63. package/dist/core/toolOutput/reduction.js +77 -2
  64. package/dist/llm/client.d.ts +4 -2
  65. package/dist/llm/client.js +115 -56
  66. package/dist/llm/hazeTools.d.ts +16 -16
  67. package/dist/llm/mistralReasoning.d.ts +2 -0
  68. package/dist/llm/mistralReasoning.js +17 -0
  69. package/dist/llm/mistralVibeAuth.d.ts +5 -0
  70. package/dist/llm/mistralVibeAuth.js +63 -0
  71. package/dist/llm/requestContext.js +8 -7
  72. package/dist/llm/subagentRunner.js +15 -7
  73. package/dist/llm/toolResultTypes.js +7 -1
  74. package/dist/llm/tools/fetchTool.d.ts +16 -16
  75. package/dist/llm/tools/outputCap.d.ts +2 -7
  76. package/dist/llm/tools/outputCap.js +3 -11
  77. package/dist/llm/tools/replaceInFiles.js +5 -0
  78. 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
- omittedChars?: undefined;
14
- handle?: undefined;
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
- if (text.length <= maxChars)
12
- return { text, truncated: false };
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.9",
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.88",
54
- "@ai-sdk/openai": "4.0.106",
55
- "@ai-sdk/openai-compatible": "3.0.82",
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.159",
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.2",
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.5"
85
+ "vitest": "^5.1.0"
86
+ },
87
+ "overrides": {
88
+ "minimatch": "11.0.1"
83
89
  }
84
90
  }