@denizokcu/haze 1.2.0 → 1.5.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 +86 -1
- package/README.md +23 -10
- package/SECURITY.md +1 -1
- package/bin/haze.js +27 -7
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/BusyBar.d.ts +7 -0
- package/dist/cli/chat/BusyBar.js +8 -0
- package/dist/cli/chat/DynamicFrame.d.ts +37 -0
- package/dist/cli/chat/DynamicFrame.js +43 -0
- package/dist/cli/chat/busyIndicator.d.ts +3 -1
- package/dist/cli/chat/busyIndicator.js +11 -9
- package/dist/cli/chat/chatMetrics.d.ts +1 -1
- package/dist/cli/chat/chatMetrics.js +3 -3
- package/dist/cli/chat/inputSuggestions.js +4 -0
- package/dist/cli/chat/liveMessages.d.ts +36 -0
- package/dist/cli/chat/liveMessages.js +64 -0
- package/dist/cli/chat/liveRegion.js +1 -1
- package/dist/cli/chat/messages.js +27 -16
- package/dist/cli/chat/sessionLifecycle.d.ts +5 -2
- package/dist/cli/chat/sessionLifecycle.js +36 -4
- package/dist/cli/chat/sessionRecorder.d.ts +2 -1
- package/dist/cli/chat/sessionRecorder.js +8 -0
- package/dist/cli/chat/shutdown.d.ts +27 -0
- package/dist/cli/chat/shutdown.js +79 -0
- package/dist/cli/chat/terminalControl.d.ts +45 -0
- package/dist/cli/chat/terminalControl.js +107 -0
- package/dist/cli/chat/tips.js +1 -0
- package/dist/cli/chat/userInput.d.ts +43 -0
- package/dist/cli/chat/userInput.js +63 -0
- package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +1 -1
- package/dist/cli/chat/wizard/sessionThemeHandlers.js +24 -1
- package/dist/cli/chat/wizard/types.d.ts +8 -1
- package/dist/cli/chat/wizardDispatch.js +1 -1
- package/dist/cli/commands/chat.js +277 -193
- package/dist/cli/commands/commandHelp.js +6 -0
- package/dist/cli/commands/commands.d.ts +8 -0
- package/dist/cli/commands/commands.js +13 -0
- package/dist/cli/commands/formatters.d.ts +1 -1
- package/dist/cli/commands/formatters.js +25 -3
- package/dist/cli/commands/logsCommand.js +21 -2
- package/dist/cli/commands/ndjsonSink.d.ts +12 -0
- package/dist/cli/commands/ndjsonSink.js +29 -0
- package/dist/cli/commands/reasoningCommand.d.ts +44 -0
- package/dist/cli/commands/reasoningCommand.js +79 -0
- package/dist/cli/commands/runCommand.d.ts +14 -0
- package/dist/cli/commands/runCommand.js +56 -22
- 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.d.ts +2 -0
- package/dist/cli/commands/streaming/attemptOutcome.js +24 -9
- package/dist/cli/commands/streaming/attemptSetup.d.ts +4 -0
- package/dist/cli/commands/streaming/attemptSetup.js +21 -7
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +14 -1
- package/dist/cli/commands/streaming/goalCheckpoint.js +4 -2
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +9 -0
- package/dist/cli/commands/streaming/goalSupervisor.js +51 -10
- package/dist/cli/commands/streaming/prepareStep.d.ts +0 -3
- package/dist/cli/commands/streaming/prepareStep.js +14 -5
- package/dist/cli/commands/streaming/streamLoop.d.ts +5 -0
- package/dist/cli/commands/streaming/streamLoop.js +3 -0
- package/dist/cli/commands/streaming/toolPartHandlers.js +6 -0
- package/dist/cli/commands/streaming.d.ts +8 -3
- package/dist/cli/commands/streaming.js +46 -21
- package/dist/cli/commands/wizardFlow.d.ts +10 -0
- package/dist/cli/commands/wizardFlow.js +34 -5
- package/dist/cli/index.js +22 -2
- package/dist/config/contextFiles.d.ts +9 -0
- package/dist/config/contextFiles.js +21 -1
- package/dist/config/modelCatalog.d.ts +3 -0
- package/dist/config/modelCatalog.js +29 -0
- package/dist/config/modelDiscovery.js +68 -5
- package/dist/config/providerPresets.d.ts +1 -1
- package/dist/config/providerPresets.js +42 -3
- package/dist/config/settings.d.ts +14 -6
- package/dist/config/settings.js +16 -1
- package/dist/core/agent/budgets.d.ts +13 -17
- package/dist/core/agent/budgets.js +15 -19
- package/dist/core/agent/completionController.d.ts +14 -2
- package/dist/core/agent/completionController.js +48 -3
- package/dist/core/agent/events.d.ts +2 -1
- package/dist/core/agent/goalPolicy.d.ts +17 -0
- package/dist/core/agent/goalPolicy.js +53 -6
- package/dist/core/agent/projectPreflight.d.ts +2 -0
- package/dist/core/agent/projectPreflight.js +56 -0
- package/dist/core/agent/reasoningPolicy.d.ts +76 -10
- package/dist/core/agent/reasoningPolicy.js +72 -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 +14 -4
- package/dist/core/agent/workState.js +229 -34
- package/dist/core/deadline.js +22 -24
- package/dist/core/providerContracts.d.ts +29 -0
- package/dist/core/providerContracts.js +1 -0
- 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/sessionReport.d.ts +33 -0
- package/dist/core/session/sessionReport.js +121 -0
- package/dist/core/session/sessionSlimming.d.ts +2 -0
- package/dist/core/session/sessionSlimming.js +59 -4
- package/dist/core/session/sessionStore.d.ts +16 -8
- package/dist/core/session/sessionStore.js +71 -34
- 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 +3 -18
- package/dist/core/subagent/executionProfiles.js +4 -4
- package/dist/core/tasks/taskStorage.js +8 -1
- package/dist/core/validation/outputParser.d.ts +6 -1
- package/dist/core/validation/outputParser.js +30 -2
- package/dist/llm/client.d.ts +6 -3
- package/dist/llm/client.js +28 -11
- package/dist/llm/hazeTools.d.ts +9161 -7135
- package/dist/llm/hazeTools.js +6 -462
- 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/mcp.js +3 -0
- package/dist/llm/requestContext.d.ts +4 -3
- package/dist/llm/requestContext.js +9 -5
- package/dist/{core/subagent → llm}/subagentRunner.d.ts +13 -9
- package/dist/{core/subagent → llm}/subagentRunner.js +54 -49
- package/dist/llm/systemPrompt.d.ts +11 -1
- package/dist/llm/systemPrompt.js +4 -13
- package/dist/llm/tools/fetchTool.d.ts +34 -30
- package/dist/llm/tools/fileTools.d.ts +7768 -0
- package/dist/llm/tools/fileTools.js +510 -0
- package/dist/llm/tools/processTool.d.ts +34 -30
- package/dist/llm/tools/replaceInFiles.d.ts +105 -0
- package/dist/llm/tools/replaceInFiles.js +131 -0
- package/dist/llm/tools/shellTool.d.ts +34 -30
- package/dist/llm/tools/shellTool.js +8 -4
- 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 -29
- package/dist/llm/tools/toolContext.js +56 -53
- package/dist/llm/tools/toolContextState.d.ts +40 -0
- package/dist/llm/tools/toolContextState.js +34 -0
- package/dist/llm/workerContext.d.ts +7 -0
- package/dist/llm/workerContext.js +18 -1
- package/dist/skills/SkillLoader.js +30 -4
- package/dist/skills/SkillRegistry.js +3 -3
- package/dist/skills/builder/SkillBuilder.js +3 -3
- package/dist/skills/confinement.d.ts +7 -0
- package/dist/skills/confinement.js +15 -0
- package/dist/ui/codeHighlight.js +4 -4
- package/dist/ui/components/MarkdownText.js +7 -8
- package/dist/ui/components/NativeIndicators.d.ts +15 -0
- package/dist/ui/components/NativeIndicators.js +32 -0
- package/dist/ui/components/StreamingMarkdownText.d.ts +9 -0
- package/dist/ui/components/StreamingMarkdownText.js +38 -0
- package/dist/ui/components/TextInput.d.ts +7 -2
- package/dist/ui/components/TextInput.js +103 -46
- package/dist/ui/components/WizardChoices.d.ts +18 -0
- package/dist/ui/components/WizardChoices.js +32 -0
- package/dist/ui/components/useInputSuggestions.js +18 -6
- package/dist/ui/inputBuffer.js +12 -6
- package/dist/ui/textGeometry.d.ts +14 -0
- package/dist/ui/textGeometry.js +31 -0
- package/dist/utils/buildInfo.js +29 -8
- package/dist/utils/fs.js +5 -1
- package/package.json +23 -22
- /package/dist/cli/{contextReport.d.ts → contextReportCli.d.ts} +0 -0
- /package/dist/cli/{contextReport.js → contextReportCli.js} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { isStoredReasoning, resolveReasoningChoice } from '../../../core/agent/reasoningPolicy.js';
|
|
2
|
+
import { resolveReasoningCommand } from '../../commands/reasoningCommand.js';
|
|
1
3
|
import { selectThemeResult } from '../../commands/themesCommand.js';
|
|
2
4
|
import { SESSION_ACTIONS } from '../../commands/sessionPicker.js';
|
|
3
|
-
/** Session picker and
|
|
5
|
+
/** Session picker, theme picker, and reasoning picker handlers (tiny single-purpose flows). */
|
|
4
6
|
export function createSessionThemeHandlers(deps, ctx) {
|
|
5
7
|
const { setMode, showMessage } = ctx;
|
|
6
8
|
const setSelectedSessionId = ctx.setSelectedSessionId;
|
|
@@ -40,9 +42,30 @@ export function createSessionThemeHandlers(deps, ctx) {
|
|
|
40
42
|
}
|
|
41
43
|
showMessage(result.message);
|
|
42
44
|
}
|
|
45
|
+
async function selectReasoning(value) {
|
|
46
|
+
const hook = deps.sessionReasoning;
|
|
47
|
+
const modelSelector = hook?.modelSelector();
|
|
48
|
+
if (!hook || !modelSelector) {
|
|
49
|
+
showMessage('No provider/model configured. /reasoning sets a per-model level; run /provider and /model first.');
|
|
50
|
+
setMode('chat');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const stored = isStoredReasoning(deps.settings.reasoning) ? deps.settings.reasoning : undefined;
|
|
54
|
+
const result = resolveReasoningCommand(value, { current: resolveReasoningChoice(hook.get(modelSelector), stored), stored, modelSelector });
|
|
55
|
+
if (result.action === 'set')
|
|
56
|
+
hook.set(modelSelector, result.setting);
|
|
57
|
+
else if (result.action === 'reset')
|
|
58
|
+
hook.set(modelSelector, undefined);
|
|
59
|
+
setMode('chat');
|
|
60
|
+
// Unreachable from the picker (its values always set or reset) but narrows
|
|
61
|
+
// the open-picker variant away for the type checker.
|
|
62
|
+
if (result.action !== 'open-picker')
|
|
63
|
+
showMessage(result.message);
|
|
64
|
+
}
|
|
43
65
|
return {
|
|
44
66
|
sessions: selectSession,
|
|
45
67
|
sessionAction: selectSessionAction,
|
|
46
68
|
themes: selectTheme,
|
|
69
|
+
reasoning: selectReasoning,
|
|
47
70
|
};
|
|
48
71
|
}
|
|
@@ -2,6 +2,7 @@ import type { HazeMcpServer, HazeProviderSettings, HazeSettings } from '../../..
|
|
|
2
2
|
import type { HazeLspServer } from '../../../config/lspSettings.js';
|
|
3
3
|
import type { LoadedSkill, SkillSource } from '../../../skills/types.js';
|
|
4
4
|
import type { SessionSummary } from '../../../core/session/sessionStore.js';
|
|
5
|
+
import type { StoredReasoningSetting } from '../../../core/agent/reasoningPolicy.js';
|
|
5
6
|
import type { Mode } from '../../commands/chatModes.js';
|
|
6
7
|
import type { WizardUiAction, WizardUiState } from './uiState.js';
|
|
7
8
|
/**
|
|
@@ -16,7 +17,7 @@ export interface WizardDispatchDeps {
|
|
|
16
17
|
wizard: WizardUiState;
|
|
17
18
|
updateWizard: (action: WizardUiAction) => void;
|
|
18
19
|
setMode: (mode: Mode) => void;
|
|
19
|
-
setSettings: (next: HazeSettings) => void;
|
|
20
|
+
setSettings: (next: HazeSettings, patch?: HazeSettings) => void;
|
|
20
21
|
showMessage: (message: string | undefined) => void;
|
|
21
22
|
resumeSessionById?: (id: string) => Promise<boolean>;
|
|
22
23
|
forkSessionById?: (id: string) => Promise<boolean>;
|
|
@@ -25,6 +26,12 @@ export interface WizardDispatchDeps {
|
|
|
25
26
|
setBusy: (busy: boolean) => void;
|
|
26
27
|
/** Busy label to restore when a skill creation finishes. */
|
|
27
28
|
idleBusyLabel: string;
|
|
29
|
+
/** Session-scoped per-model reasoning overrides (`/reasoning`); interactive screen only. */
|
|
30
|
+
sessionReasoning?: {
|
|
31
|
+
modelSelector: () => string | undefined;
|
|
32
|
+
get: (modelSelector: string) => StoredReasoningSetting | undefined;
|
|
33
|
+
set: (modelSelector: string, setting: StoredReasoningSetting | undefined) => void;
|
|
34
|
+
};
|
|
28
35
|
}
|
|
29
36
|
/** Setter shims over the single wizard-state reducer, shared by every handler family. */
|
|
30
37
|
export interface WizardSetterContext {
|
|
@@ -17,7 +17,7 @@ export function createWizardDispatch(deps) {
|
|
|
17
17
|
showMessage,
|
|
18
18
|
applySettings: async (patch) => {
|
|
19
19
|
const next = await updateSettings(patch);
|
|
20
|
-
setSettings(next);
|
|
20
|
+
setSettings(next, patch);
|
|
21
21
|
return next;
|
|
22
22
|
},
|
|
23
23
|
setSelectedSessionId: id => deps.updateWizard({ type: 'set', key: 'selectedSessionId', value: id }),
|