@denizokcu/haze 1.7.10 → 1.7.12
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 +25 -0
- package/README.md +125 -99
- package/assets/graph-grammars/NOTICE.md +21 -0
- package/assets/graph-grammars/tree-sitter-javascript.wasm +0 -0
- package/assets/graph-grammars/tree-sitter-tsx.wasm +0 -0
- package/assets/graph-grammars/tree-sitter-typescript.wasm +0 -0
- package/assets/graph-grammars/web-tree-sitter.cjs +4116 -0
- package/assets/graph-grammars/web-tree-sitter.cjs.map +7 -0
- package/assets/graph-grammars/web-tree-sitter.js +4056 -0
- package/assets/graph-grammars/web-tree-sitter.js.map +7 -0
- package/assets/graph-grammars/web-tree-sitter.wasm +0 -0
- package/assets/graph-grammars/web-tree-sitter.wasm.map +55 -0
- 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/inputSuggestions.js +1 -0
- package/dist/cli/chat/sessionLifecycle.d.ts +2 -0
- package/dist/cli/chat/sessionLifecycle.js +29 -19
- package/dist/cli/chat/sessionRecorder.d.ts +2 -1
- package/dist/cli/chat/sessionRecorder.js +29 -9
- package/dist/cli/chat/startupSequence.d.ts +2 -0
- package/dist/cli/chat/startupSequence.js +6 -0
- 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 +44 -9
- package/dist/cli/commands/commandHelp.js +6 -3
- package/dist/cli/commands/commands.js +2 -0
- package/dist/cli/commands/formatters.js +28 -0
- package/dist/cli/commands/graphCommand.d.ts +2 -0
- package/dist/cli/commands/graphCommand.js +60 -0
- package/dist/cli/commands/initCommand.js +14 -0
- 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/agentAttempt.js +11 -1
- package/dist/cli/commands/streaming/attemptLifecycle.js +1 -0
- package/dist/cli/commands/streaming/attemptOutcome.js +6 -2
- package/dist/cli/commands/streaming/attemptSetup.d.ts +3 -0
- package/dist/cli/commands/streaming/attemptSetup.js +13 -6
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +1 -1
- package/dist/cli/commands/streaming/goalSupervisor.js +22 -1
- package/dist/cli/commands/streaming/prepareStep.js +1 -0
- package/dist/cli/commands/streaming/streamLoop.d.ts +2 -0
- package/dist/cli/commands/streaming/streamLoop.js +14 -10
- package/dist/cli/commands/streaming/toolPartHandlers.js +7 -1
- package/dist/cli/commands/streaming.d.ts +2 -0
- package/dist/cli/commands/streaming.js +5 -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/compaction.d.ts +1 -0
- package/dist/core/agent/compaction.js +3 -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/graph/analyze.d.ts +61 -0
- package/dist/core/graph/analyze.js +274 -0
- package/dist/core/graph/buildGraph.d.ts +44 -0
- package/dist/core/graph/buildGraph.js +290 -0
- package/dist/core/graph/digest.d.ts +2 -0
- package/dist/core/graph/digest.js +40 -0
- package/dist/core/graph/extract.d.ts +58 -0
- package/dist/core/graph/extract.js +394 -0
- package/dist/core/graph/model.d.ts +63 -0
- package/dist/core/graph/model.js +96 -0
- package/dist/core/graph/query.d.ts +69 -0
- package/dist/core/graph/query.js +391 -0
- package/dist/core/graph/store.d.ts +64 -0
- package/dist/core/graph/store.js +171 -0
- package/dist/core/limits.d.ts +0 -2
- package/dist/core/limits.js +0 -2
- package/dist/core/process/runBoundedProcess.js +12 -6
- 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/safety/untrustedEnvelopes.d.ts +6 -0
- package/dist/core/safety/untrustedEnvelopes.js +17 -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 +8 -5
- package/dist/core/tasks/taskStorage.js +11 -1
- package/dist/core/toolOutput/reduction.d.ts +55 -2
- package/dist/core/toolOutput/reduction.js +77 -2
- package/dist/core/validation/outputParser.js +16 -8
- package/dist/llm/client.d.ts +4 -2
- package/dist/llm/client.js +104 -55
- package/dist/llm/hazeTools.d.ts +2 -12426
- package/dist/llm/hazeTools.js +2 -0
- package/dist/llm/lspTools.d.ts +3 -12622
- 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.d.ts +3 -0
- package/dist/llm/requestContext.js +21 -11
- package/dist/llm/subagentRunner.d.ts +2 -308
- package/dist/llm/subagentRunner.js +15 -7
- package/dist/llm/systemPrompt.js +7 -4
- package/dist/llm/toolResultTypes.d.ts +1 -1
- package/dist/llm/toolResultTypes.js +7 -1
- package/dist/llm/tools/fetchTool.d.ts +2 -1221
- package/dist/llm/tools/fileTools.d.ts +2 -7768
- package/dist/llm/tools/graphAdvisory.d.ts +22 -0
- package/dist/llm/tools/graphAdvisory.js +68 -0
- package/dist/llm/tools/graphTools.d.ts +13 -0
- package/dist/llm/tools/graphTools.js +195 -0
- package/dist/llm/tools/outputCap.d.ts +2 -7
- package/dist/llm/tools/outputCap.js +3 -11
- package/dist/llm/tools/processTool.d.ts +2 -1081
- package/dist/llm/tools/replaceInFiles.js +5 -0
- package/dist/llm/tools/shellTool.d.ts +2 -1513
- package/dist/llm/tools/storedOutputTool.d.ts +2 -355
- package/dist/llm/tools/taskTool.d.ts +2 -489
- package/dist/llm/tools/toolContext.js +24 -9
- package/dist/llm/tools/toolContextState.d.ts +3 -0
- package/dist/llm/tools/toolContextState.js +2 -1
- package/dist/skills/skillTools.js +4 -1
- package/package.json +24 -15
|
@@ -1,24 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
const ENDPOINT_MODEL_LIMITS = {
|
|
2
|
+
'https://openrouter.ai/api/v1': {
|
|
3
|
+
'anthropic/claude-opus-5.5': [1_000_000, 128_000],
|
|
4
|
+
'anthropic/claude-sonnet-5.5': [1_000_000, 128_000],
|
|
5
|
+
'openai/gpt-6.1-sol': [922_000, 128_000],
|
|
6
|
+
'openai/gpt-6-luna': [922_000, 128_000],
|
|
7
|
+
'google/gemini-4-argon': [1_048_576, 32_768],
|
|
8
|
+
'google/gemini-3.8-flash': [1_048_576, 65_536],
|
|
9
|
+
'mistralai/mistral-large-4-0': [1_048_576, 262_144],
|
|
10
|
+
'deepseek/deepseek-v4.1-flash': [1_048_576, 393_216],
|
|
11
|
+
'moonshotai/kimi-k3.1-pro': [1_048_576, 131_072],
|
|
12
|
+
'z-ai/glm-5.3': [1_000_000, 131_072],
|
|
13
|
+
'qwen/qwen3.8-2.4t-a95b': [1_048_576, 131_072],
|
|
14
|
+
'minimax/minimax-m3.1-flash': [1_048_576, 524_288],
|
|
15
|
+
'x-ai/grok-4.7': [500_000, 450_000],
|
|
16
|
+
},
|
|
17
|
+
'https://api.openai.com/v1': {
|
|
18
|
+
'gpt-6.1-sol': [922_000, 128_000],
|
|
19
|
+
'gpt-6-astra': [922_000, 128_000],
|
|
20
|
+
'gpt-6-luna': [922_000, 128_000],
|
|
21
|
+
},
|
|
22
|
+
'https://chatgpt.com/backend-api/codex': {
|
|
23
|
+
'gpt-6.1-sol': [500_000, 128_000],
|
|
24
|
+
'gpt-6.1-terra': [500_000, 128_000],
|
|
25
|
+
'gpt-6-luna': [272_000, 128_000],
|
|
26
|
+
'gpt-5.6-sol': [272_000, 128_000],
|
|
27
|
+
'gpt-5.6-terra': [272_000, 128_000],
|
|
28
|
+
'gpt-5.6-luna': [272_000, 128_000],
|
|
29
|
+
},
|
|
30
|
+
'https://generativelanguage.googleapis.com/v1beta/openai': {
|
|
31
|
+
'gemini-4-argon': [1_048_576, 32_768],
|
|
32
|
+
'gemini-3.8-flash': [1_048_576, 65_536],
|
|
33
|
+
},
|
|
34
|
+
'https://api.mistral.ai/v1': {
|
|
35
|
+
'mistral-large-4': [1_048_576, 262_144],
|
|
36
|
+
},
|
|
37
|
+
'https://api.deepseek.com/v1': {
|
|
38
|
+
'deepseek-v4-pro': [1_048_576, 393_216],
|
|
39
|
+
'deepseek-flash': [1_048_576, 393_216],
|
|
40
|
+
},
|
|
41
|
+
'https://api.x.ai/v1': {
|
|
42
|
+
'grok-4.7': [500_000, 500_000],
|
|
43
|
+
'grok-4.6': [500_000, 500_000],
|
|
44
|
+
},
|
|
45
|
+
'https://api.z.ai/api/paas/v4': {
|
|
46
|
+
'glm-5.3': [1_000_000, 131_072],
|
|
47
|
+
'glm-5.3-flash': [1_000_000, 131_072],
|
|
48
|
+
},
|
|
49
|
+
'https://api.z.ai/api/coding/paas/v4': {
|
|
50
|
+
'glm-5.3': [1_000_000, 131_072],
|
|
51
|
+
'glm-5.2-highspeed': [1_000_000, 131_072],
|
|
52
|
+
},
|
|
53
|
+
'https://api.moonshot.ai/v1': {
|
|
54
|
+
'kimi-k3.1-pro': [1_048_576, 131_072],
|
|
55
|
+
'kimi-k3': [1_048_576, 131_072],
|
|
56
|
+
},
|
|
57
|
+
'https://api.kimi.com/coding/v1': {
|
|
58
|
+
'k3': [1_048_576, 131_072],
|
|
59
|
+
'k3.1-pro': [1_048_576, 131_072],
|
|
60
|
+
},
|
|
61
|
+
'https://api.groq.com/openai/v1': {
|
|
62
|
+
'openai/gpt-oss-120b': [131_072, 65_536],
|
|
63
|
+
'qwen/qwen3.8-27b': [131_072, 16_384],
|
|
64
|
+
},
|
|
65
|
+
'https://api.together.ai/v1': {
|
|
66
|
+
'deepseek-ai/DeepSeek-V4-Pro-0813': [1_048_576, 384_000],
|
|
67
|
+
'moonshotai/Kimi-K3.1-Pro': [1_048_576, 131_072],
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
function documentedReasoningLevels(url, model) {
|
|
71
|
+
let host;
|
|
72
|
+
try {
|
|
73
|
+
host = new URL(url).hostname.toLowerCase();
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
if (host === 'api.mistral.ai') {
|
|
79
|
+
switch (model.toLowerCase()) {
|
|
80
|
+
case 'mistral-small-2603':
|
|
81
|
+
case 'mistral-small-latest':
|
|
82
|
+
case 'mistral-medium-latest':
|
|
83
|
+
case 'mistral-medium-3-5':
|
|
84
|
+
case 'mistral-vibe-cli-latest': return ['none', 'high'];
|
|
85
|
+
case 'mistral-large-4':
|
|
86
|
+
case 'mistral-large-4-0': return ['low', 'medium', 'high'];
|
|
87
|
+
case 'zai-glm-5-3':
|
|
88
|
+
case 'zai-glm-5-3-flash': return ['low', 'high', 'max'];
|
|
89
|
+
default: return undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (host === 'api.openai.com') {
|
|
93
|
+
if (/^gpt-4(?:o|\.1)(?:-|$)/i.test(model))
|
|
94
|
+
return [];
|
|
95
|
+
if (/^gpt-5\.(?:2|4)(?:-mini)?(?:-\d{4}-\d{2}-\d{2})?$/i.test(model))
|
|
96
|
+
return ['none', 'low', 'medium', 'high', 'xhigh'];
|
|
97
|
+
if (/^gpt-5\.6(?:-(?:sol|terra|luna))?$/i.test(model))
|
|
98
|
+
return ['none', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
99
|
+
if (/^gpt-5\.5$/i.test(model))
|
|
100
|
+
return ['none', 'low', 'medium', 'high', 'xhigh'];
|
|
101
|
+
if (/^gpt-6(?:\.1)?-(?:astra|sol|terra|luna)$/i.test(model)) {
|
|
102
|
+
return /^gpt-6(?:-sol|-luna|\.1-terra)$/i.test(model) ? ['none', 'low', 'medium', 'high', 'xhigh', 'max'] : ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (host === 'generativelanguage.googleapis.com') {
|
|
106
|
+
if (/^gemini-3\.(?:7|8)-flash(?:-|$)/i.test(model))
|
|
107
|
+
return ['low', 'medium', 'high'];
|
|
108
|
+
if (/^gemini-3-pro(?:-|$)/i.test(model))
|
|
109
|
+
return ['low', 'high'];
|
|
110
|
+
if (/^gemini-3\.1-pro(?:-|$)/i.test(model))
|
|
111
|
+
return ['low', 'medium', 'high'];
|
|
112
|
+
if (/^gemini-3(?:\.1)?-(?:pro|flash)(?:-lite)?(?:-|$)/i.test(model))
|
|
113
|
+
return ['minimal', 'low', 'medium', 'high'];
|
|
114
|
+
if (/^gemini-2\.5-pro(?:-|$)/i.test(model))
|
|
115
|
+
return ['low', 'medium', 'high'];
|
|
116
|
+
if (/^gemini-2\.5-flash(?:-lite)?(?:-|$)/i.test(model))
|
|
117
|
+
return ['none', 'low', 'medium', 'high'];
|
|
118
|
+
}
|
|
119
|
+
if (host === 'api.deepseek.com' && /^(?:deepseek-flash|deepseek-v4(?:\.1)?-(?:flash|pro))$/i.test(model))
|
|
120
|
+
return ['none', 'low', 'high', 'max'];
|
|
121
|
+
if (host === 'api.groq.com') {
|
|
122
|
+
if (/^openai\/gpt-oss-(?:20b|120b)$/i.test(model))
|
|
123
|
+
return ['low', 'medium', 'high'];
|
|
124
|
+
if (model.toLowerCase() === 'qwen/qwen3.8-27b')
|
|
125
|
+
return ['none', 'low', 'medium', 'high'];
|
|
126
|
+
}
|
|
127
|
+
if ((host === 'api.x.ai' || host.endsWith('.api.x.ai')) && /^grok-4\.[67]$/i.test(model))
|
|
128
|
+
return ['low', 'medium', 'high', 'xhigh'];
|
|
129
|
+
// The coding subscription and direct API have always-thinking K3 variants;
|
|
130
|
+
// use the shared subset instead of sending unsupported none to workers.
|
|
131
|
+
if ((host === 'api.moonshot.ai' && /^kimi-k3(?:\.1-pro)?$/i.test(model))
|
|
132
|
+
|| ((host === 'api.kimi.com' || host === 'api.kimi.ai') && /^k3(?:\.1-pro)?$/i.test(model)))
|
|
133
|
+
return ['low', 'high', 'max'];
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
/** Lookup uses the actual endpoint and exact model ID; documented aliases are handled by the reasoning profiles. */
|
|
137
|
+
export function endpointModelFacts(url, model) {
|
|
138
|
+
const endpoint = url.replace(/\/+$/, '').toLowerCase();
|
|
139
|
+
const entries = ENDPOINT_MODEL_LIMITS[endpoint];
|
|
140
|
+
const key = model.toLowerCase();
|
|
141
|
+
const values = entries && Object.entries(entries).find(([id]) => id.toLowerCase() === key)?.[1];
|
|
142
|
+
const limits = values ? { contextWindowTokens: values[0], maxOutputTokens: values[1] } : undefined;
|
|
143
|
+
const reasoningLevels = documentedReasoningLevels(url, model);
|
|
144
|
+
return { ...(limits ? { limits } : {}), ...(reasoningLevels !== undefined ? { reasoningLevels } : {}) };
|
|
145
|
+
}
|
|
22
146
|
const MODEL_CATALOG = [
|
|
23
147
|
// ── OpenAI ────────────────────────────────────────────────────────────────
|
|
24
148
|
{ match: 'gpt-6.1-sol', contextWindowTokens: 1_050_000, maxOutputTokens: 128_000 },
|
|
@@ -6,19 +6,14 @@
|
|
|
6
6
|
* Hosted presets carry a pre-configured base URL so users only need to supply an API key
|
|
7
7
|
* and model names. Local/keyless providers have sensible localhost defaults.
|
|
8
8
|
*
|
|
9
|
-
* Presets
|
|
10
|
-
*
|
|
11
|
-
* `[id, contextWindowTokens, maxOutputTokens]` tuple instead of appearing twice (once in
|
|
12
|
-
* `suggestedModels`, once in `modelLimits`), and `needsApiKey` is derived from the
|
|
13
|
-
* category (cloud presets need a key unless they carry an explicit OAuth flow; local
|
|
14
|
-
* ones never do).
|
|
9
|
+
* Presets list model IDs; limits and reasoning capabilities live in the shared
|
|
10
|
+
* endpoint/model facts. `needsApiKey` is derived from category and auth flow.
|
|
15
11
|
*
|
|
16
|
-
* `modelLimits` values are curated from models.dev
|
|
17
|
-
* consume; recent releases refreshed 2026-10-04 from https://models.dev/api.json). They are keyed by the exact suggested model id for
|
|
12
|
+
* `modelLimits` values are curated from provider catalogs and models.dev. They are keyed by the exact suggested model id for
|
|
18
13
|
* THIS preset: aggregators may cap context below the origin model's capability (e.g.
|
|
19
14
|
* Together serves DeepSeek-V4-Pro at 512K vs DeepSeek's own 1M), so limits never
|
|
20
|
-
* transfer between providers.
|
|
21
|
-
*
|
|
15
|
+
* transfer between providers. These values remain in the shared facts and are resolved at
|
|
16
|
+
* runtime after explicit settings and live discovery.
|
|
22
17
|
* Local providers (Ollama/llama.cpp/MLX/LM Studio) intentionally carry no limits: their
|
|
23
18
|
* effective context depends on the local server configuration, not the model.
|
|
24
19
|
*/
|
|
@@ -38,7 +33,7 @@ export interface ProviderPreset {
|
|
|
38
33
|
/** Whether an API key is typically required. Local and OAuth providers use false. */
|
|
39
34
|
needsApiKey: boolean;
|
|
40
35
|
/** Provider-specific sign-in flow, when setup is not an API-key prompt. */
|
|
41
|
-
auth?: 'chatgpt-oauth';
|
|
36
|
+
auth?: 'chatgpt-oauth' | 'mistral-vibe';
|
|
42
37
|
/** Hint shown when prompting for the API key. */
|
|
43
38
|
apiKeyHint?: string;
|
|
44
39
|
/**
|
|
@@ -61,15 +56,9 @@ export interface ProviderPreset {
|
|
|
61
56
|
/** Category for grouping in the picker. */
|
|
62
57
|
category: 'cloud' | 'local';
|
|
63
58
|
}
|
|
64
|
-
export declare const PROVIDER_PRESETS: ProviderPreset[];
|
|
59
|
+
export declare const PROVIDER_PRESETS: readonly ProviderPreset[];
|
|
65
60
|
export declare function findPreset(id: string): ProviderPreset | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Limits for models a wizard flow is adding to a provider, matched by the
|
|
68
|
-
* provider's base URL or its name (a provider created from a preset keeps the
|
|
69
|
-
* preset's name unless the user renamed it). Returns only entries the caller
|
|
70
|
-
* should merge into the provider's settings `modelLimits`; user-configured
|
|
71
|
-
* limits always win because callers merge without overwriting existing keys.
|
|
72
|
-
*/
|
|
61
|
+
/** Only copy limits for selected models and an unambiguous provider endpoint. */
|
|
73
62
|
export declare function presetModelLimitsForModels(provider: {
|
|
74
63
|
name?: string;
|
|
75
64
|
url?: string;
|