@denizokcu/haze 1.2.0 → 1.4.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 +53 -0
- package/README.md +18 -10
- package/SECURITY.md +1 -1
- package/bin/haze.js +27 -7
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/inputSuggestions.js +3 -0
- package/dist/cli/chat/liveMessages.d.ts +36 -0
- package/dist/cli/chat/liveMessages.js +64 -0
- package/dist/cli/chat/sessionLifecycle.d.ts +2 -1
- package/dist/cli/chat/sessionLifecycle.js +23 -2
- package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +1 -1
- package/dist/cli/chat/wizard/sessionThemeHandlers.js +16 -1
- package/dist/cli/commands/chat.js +39 -34
- package/dist/cli/commands/commandHelp.js +2 -0
- package/dist/cli/commands/commands.js +2 -0
- package/dist/cli/commands/formatters.js +5 -1
- package/dist/cli/commands/ndjsonSink.d.ts +12 -0
- package/dist/cli/commands/ndjsonSink.js +29 -0
- package/dist/cli/commands/reasoningCommand.d.ts +35 -0
- package/dist/cli/commands/reasoningCommand.js +46 -0
- package/dist/cli/commands/runCommand.d.ts +14 -0
- package/dist/cli/commands/runCommand.js +37 -11
- package/dist/cli/commands/settingsSummary.js +2 -0
- package/dist/cli/commands/streaming/agentAttempt.d.ts +3 -0
- package/dist/cli/commands/streaming/agentAttempt.js +2 -2
- package/dist/cli/commands/streaming/assistantSegments.d.ts +0 -7
- package/dist/cli/commands/streaming/assistantSegments.js +1 -1
- package/dist/cli/commands/streaming/attemptLifecycle.js +13 -9
- package/dist/cli/commands/streaming/attemptOutcome.js +13 -3
- package/dist/cli/commands/streaming/attemptSetup.d.ts +3 -0
- package/dist/cli/commands/streaming/attemptSetup.js +11 -3
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +6 -0
- package/dist/cli/commands/streaming/goalCheckpoint.js +1 -0
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +5 -0
- package/dist/cli/commands/streaming/goalSupervisor.js +9 -4
- package/dist/cli/commands/streaming/prepareStep.d.ts +0 -3
- package/dist/cli/commands/streaming/prepareStep.js +8 -3
- package/dist/cli/commands/streaming.d.ts +7 -2
- package/dist/cli/commands/streaming.js +24 -5
- package/dist/cli/commands/wizardFlow.d.ts +7 -0
- package/dist/cli/commands/wizardFlow.js +22 -0
- package/dist/cli/index.js +5 -1
- package/dist/config/modelDiscovery.js +68 -5
- package/dist/config/settings.d.ts +8 -4
- package/dist/config/settings.js +8 -1
- package/dist/core/agent/budgets.d.ts +0 -2
- package/dist/core/agent/budgets.js +0 -2
- package/dist/core/agent/completionController.d.ts +8 -0
- package/dist/core/agent/completionController.js +32 -0
- package/dist/core/agent/events.d.ts +2 -1
- package/dist/core/agent/goalPolicy.d.ts +7 -0
- package/dist/core/agent/goalPolicy.js +9 -0
- package/dist/core/agent/reasoningPolicy.d.ts +45 -9
- package/dist/core/agent/reasoningPolicy.js +49 -9
- package/dist/core/agent/toolCapabilities.d.ts +3 -3
- package/dist/core/agent/toolCapabilities.js +31 -7
- package/dist/core/agent/workState.d.ts +6 -4
- package/dist/core/agent/workState.js +40 -28
- package/dist/core/deadline.js +22 -24
- package/dist/core/safety/secretPaths.js +10 -7
- package/dist/core/safety/shellClassifier.d.ts +2 -0
- package/dist/core/safety/shellClassifier.js +9 -1
- package/dist/core/session/sessionSlimming.d.ts +2 -0
- package/dist/core/session/sessionSlimming.js +50 -1
- package/dist/core/session/sessionStore.d.ts +4 -8
- package/dist/core/session/sessionStore.js +53 -32
- package/dist/core/shellOutput/reducers/git.js +7 -2
- package/dist/core/shellOutput/reducers/validation.d.ts +1 -1
- package/dist/core/shellOutput/reducers/validation.js +14 -1
- package/dist/core/shellOutput/registry.js +3 -2
- package/dist/core/subagent/contracts.d.ts +8 -1
- package/dist/core/subagent/subagentRunner.d.ts +4 -0
- package/dist/core/subagent/subagentRunner.js +33 -25
- package/dist/core/tasks/taskStorage.js +8 -1
- package/dist/core/validation/outputParser.js +24 -0
- package/dist/llm/client.d.ts +2 -1
- package/dist/llm/client.js +20 -10
- package/dist/llm/hazeTools.d.ts +2039 -16
- package/dist/llm/hazeTools.js +43 -2
- package/dist/llm/lsp/client.d.ts +7 -1
- package/dist/llm/lsp/client.js +58 -9
- package/dist/llm/lsp/pool.d.ts +11 -0
- package/dist/llm/lsp/pool.js +61 -4
- package/dist/llm/lsp/protocol.d.ts +6 -23
- package/dist/llm/lsp/requests.d.ts +54 -60
- package/dist/llm/lsp/requests.js +152 -28
- package/dist/llm/lsp/symbols.d.ts +16 -0
- package/dist/llm/lsp/symbols.js +70 -0
- package/dist/llm/lsp/workspaceEdit.d.ts +43 -0
- package/dist/llm/lsp/workspaceEdit.js +117 -0
- package/dist/llm/lspTools.d.ts +7518 -2859
- package/dist/llm/lspTools.js +195 -110
- package/dist/llm/requestContext.d.ts +3 -2
- package/dist/llm/requestContext.js +8 -4
- package/dist/llm/systemPrompt.js +2 -2
- package/dist/llm/tools/fetchTool.d.ts +4 -0
- package/dist/llm/tools/processTool.d.ts +4 -0
- package/dist/llm/tools/replaceInFiles.d.ts +105 -0
- package/dist/llm/tools/replaceInFiles.js +131 -0
- package/dist/llm/tools/shellTool.d.ts +4 -0
- package/dist/llm/tools/storedOutputTool.d.ts +4 -0
- package/dist/llm/tools/taskTool.d.ts +4 -0
- package/dist/llm/tools/toolContext.d.ts +3 -0
- package/dist/llm/tools/toolContext.js +26 -4
- package/dist/skills/SkillLoader.js +27 -1
- package/dist/ui/components/useInputSuggestions.js +18 -6
- package/dist/utils/buildInfo.js +29 -8
- package/dist/utils/fs.js +5 -1
- package/package.json +19 -19
package/dist/llm/client.js
CHANGED
|
@@ -4,7 +4,7 @@ import { readSettings } from '../config/settings.js';
|
|
|
4
4
|
import { catalogLimitsFor } from '../config/modelCatalog.js';
|
|
5
5
|
import { activeModel, modelSelector, resolveModelSelector } from '../config/providers.js';
|
|
6
6
|
import { assertCredentialedEndpointSecure } from '../config/endpointSecurity.js';
|
|
7
|
-
import { resolveReasoningPolicy } from '../core/agent/reasoningPolicy.js';
|
|
7
|
+
import { effectiveRequestedReasoning, isStoredReasoning, reasoningCallSetting, resolveReasoningPolicy } from '../core/agent/reasoningPolicy.js';
|
|
8
8
|
import { FALLBACK_CONTEXT_WINDOW_TOKENS, FALLBACK_LOCAL_CONTEXT_TOKENS } from '../core/agent/contextBudget.js';
|
|
9
9
|
import { createChatGptCodexFetch } from './openaiCodex.js';
|
|
10
10
|
const HAZE_SITE_URL = 'https://denizokcu.github.io/haze/';
|
|
@@ -34,7 +34,9 @@ function capabilities(providerName, baseURL, providerKind) {
|
|
|
34
34
|
supportsStickySessionId: openRouter,
|
|
35
35
|
supportsServerCompaction: false,
|
|
36
36
|
supportsTextVerbosity: directOpenAI,
|
|
37
|
-
|
|
37
|
+
// Pass-through marker: the SDK maps the top-level `reasoning` parameter
|
|
38
|
+
// per provider and endpoints without native support ignore the field.
|
|
39
|
+
supportsReasoningEffort: true,
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
/** True for loopback/local inference servers, whose effective window is server-configured (often far below the model's). */
|
|
@@ -47,7 +49,7 @@ export function isLocalProviderUrl(url) {
|
|
|
47
49
|
return false;
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
function runtimeForSelection(settings, selection, cwd) {
|
|
52
|
+
function runtimeForSelection(settings, selection, cwd, reasoningOverride) {
|
|
51
53
|
const baseURL = selection.provider.url;
|
|
52
54
|
const providerKind = selection.provider.kind;
|
|
53
55
|
const configuredKey = providerKind === 'chatgpt-codex' ? undefined : selection.provider.key ?? settings.apiKey;
|
|
@@ -57,7 +59,13 @@ function runtimeForSelection(settings, selection, cwd) {
|
|
|
57
59
|
const cacheSeed = cwd ?? process.cwd();
|
|
58
60
|
const cacheKey = crypto.createHash('sha256').update(`${cacheSeed}\0${name}`).digest('hex').slice(0, 32);
|
|
59
61
|
const caps = capabilities(selection.provider.name, baseURL, providerKind);
|
|
60
|
-
|
|
62
|
+
// Run-scoped reasoning override (CLI `--reasoning`): an explicit level or
|
|
63
|
+
// the provider-default sentinel wins for this run; otherwise the stored
|
|
64
|
+
// settings value (default high, sentinel → no parameter) applies. The
|
|
65
|
+
// capability gate in resolveReasoningPolicy is unchanged — an override never
|
|
66
|
+
// forces the parameter onto an unsupported protocol.
|
|
67
|
+
const storedReasoning = reasoningOverride ?? (isStoredReasoning(settings.reasoning) ? settings.reasoning : undefined);
|
|
68
|
+
const requestedReasoning = effectiveRequestedReasoning(storedReasoning);
|
|
61
69
|
const reasoningPolicy = resolveReasoningPolicy({ requested: requestedReasoning, capabilities: caps });
|
|
62
70
|
const openai = providerKind === 'chatgpt-codex'
|
|
63
71
|
? createOpenAI({ apiKey: OAUTH_SDK_SENTINEL, baseURL, fetch: createChatGptCodexFetch(selection.provider.name) })
|
|
@@ -110,9 +118,6 @@ function modelLimitsFor(provider, modelName) {
|
|
|
110
118
|
out.maxOutputTokens = limits.maxOutputTokens;
|
|
111
119
|
return out;
|
|
112
120
|
}
|
|
113
|
-
function isReasoningLevel(value) {
|
|
114
|
-
return value === 'low' || value === 'medium' || value === 'high';
|
|
115
|
-
}
|
|
116
121
|
export async function modelWithConfig(session, settings) {
|
|
117
122
|
// Callers may pass pre-read settings so a turn performs a single settings
|
|
118
123
|
// read (CR-024); otherwise read fresh.
|
|
@@ -126,7 +131,7 @@ export async function modelWithConfig(session, settings) {
|
|
|
126
131
|
}
|
|
127
132
|
else
|
|
128
133
|
selection = activeModel(resolvedSettings);
|
|
129
|
-
return selection ? runtimeForSelection(resolvedSettings, selection, session?.cwd) : undefined;
|
|
134
|
+
return selection ? runtimeForSelection(resolvedSettings, selection, session?.cwd, session?.reasoningOverride) : undefined;
|
|
130
135
|
}
|
|
131
136
|
export async function resolveWorkerRuntime(input) {
|
|
132
137
|
const requested = input.selector?.trim();
|
|
@@ -140,11 +145,17 @@ export async function resolveWorkerRuntime(input) {
|
|
|
140
145
|
return { status: 'found', runtime: { model: selected.model, selector: selected.selector, providerName: selected.config.providerName, capabilities: selected.config.capabilities, requestOptions: providerRequestSettings(selected.config) } };
|
|
141
146
|
}
|
|
142
147
|
export function providerRequestSettings(config) {
|
|
148
|
+
// Top-level AI SDK `reasoning` setting; the key is omitted entirely when the
|
|
149
|
+
// policy is disabled so the parameter is never sent (and never merged with a
|
|
150
|
+
// providerOptions reasoning key — the SDK ignores the top-level value then).
|
|
151
|
+
const setting = reasoningCallSetting(config.reasoningPolicy);
|
|
152
|
+
const reasoning = setting !== undefined && setting !== 'provider-default' ? setting : undefined;
|
|
143
153
|
if (config.providerKind === 'chatgpt-codex') {
|
|
144
154
|
return {
|
|
145
155
|
omitMaxOutputTokens: true,
|
|
146
156
|
providerOptions: { openai: { store: false, include: ['reasoning.encrypted_content'] } },
|
|
147
157
|
headers: { 'session-id': config.cacheKey },
|
|
158
|
+
...(reasoning ? { reasoning } : {}),
|
|
148
159
|
};
|
|
149
160
|
}
|
|
150
161
|
const caps = config.capabilities;
|
|
@@ -153,11 +164,10 @@ export function providerRequestSettings(config) {
|
|
|
153
164
|
openaiOptions.promptCacheKey = config.cacheKey;
|
|
154
165
|
if (caps.supportsTextVerbosity)
|
|
155
166
|
openaiOptions.textVerbosity = 'low';
|
|
156
|
-
if (config.reasoningPolicy.effective !== 'disabled')
|
|
157
|
-
openaiOptions.reasoningEffort = config.reasoningPolicy.effective;
|
|
158
167
|
const providerOptions = Object.keys(openaiOptions).length > 0 ? { openai: openaiOptions } : undefined;
|
|
159
168
|
return {
|
|
160
169
|
...(providerOptions ? { providerOptions } : {}),
|
|
161
170
|
...(caps.supportsStickySessionId ? { headers: { 'x-session-id': config.cacheKey } } : {}),
|
|
171
|
+
...(reasoning ? { reasoning } : {}),
|
|
162
172
|
};
|
|
163
173
|
}
|