@denizokcu/haze 1.7.11 → 1.8.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 +56 -0
- package/README.md +142 -102
- package/SECURITY.md +1 -1
- 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/bin/haze.js +47 -19
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/BusyBar.d.ts +1 -2
- package/dist/cli/chat/ChatHeader.d.ts +6 -0
- package/dist/cli/chat/ChatHeader.js +11 -0
- package/dist/cli/chat/ChatScreen.d.ts +16 -0
- package/dist/cli/chat/ChatScreen.js +399 -0
- package/dist/cli/chat/ChatScreenView.d.ts +68 -0
- package/dist/cli/chat/ChatScreenView.js +47 -0
- package/dist/cli/chat/LiveTail.d.ts +11 -0
- package/dist/cli/chat/LiveTail.js +26 -0
- package/dist/cli/chat/TaskBar.d.ts +3 -2
- package/dist/cli/chat/TaskBar.js +4 -0
- package/dist/cli/chat/agentTurnRunner.d.ts +12 -0
- package/dist/cli/chat/agentTurnRunner.js +177 -0
- package/dist/cli/chat/busyIndicator.js +9 -5
- package/dist/cli/chat/chatMetrics.d.ts +7 -0
- package/dist/cli/chat/chatMetrics.js +15 -1
- package/dist/cli/chat/chatViewModel.d.ts +85 -0
- package/dist/cli/chat/chatViewModel.js +66 -0
- package/dist/cli/chat/fileMentionSuggestions.d.ts +0 -14
- package/dist/cli/chat/fileMentionSuggestions.js +4 -21
- package/dist/cli/chat/inputSuggestions.js +1 -0
- package/dist/cli/chat/liveTheme.d.ts +11 -0
- package/dist/cli/chat/liveTheme.js +26 -0
- package/dist/cli/chat/messageFinalize.d.ts +4 -0
- package/dist/cli/chat/messageFinalize.js +8 -0
- package/dist/cli/chat/messages.js +1 -1
- package/dist/cli/chat/pickerOpeners.d.ts +23 -0
- package/dist/cli/chat/pickerOpeners.js +36 -0
- package/dist/cli/chat/promptSessionState.d.ts +11 -0
- package/dist/cli/chat/promptSessionState.js +39 -0
- package/dist/cli/chat/renderMetrics.d.ts +8 -0
- package/dist/cli/chat/renderMetrics.js +14 -0
- package/dist/cli/chat/resizeGuard.d.ts +11 -0
- package/dist/cli/chat/resizeGuard.js +25 -0
- package/dist/cli/chat/screenDeps.d.ts +116 -0
- package/dist/cli/chat/screenDeps.js +1 -0
- package/dist/cli/chat/sessionLifecycle.d.ts +2 -0
- package/dist/cli/chat/sessionLifecycle.js +6 -2
- package/dist/cli/chat/sessionRecorder.js +4 -1
- package/dist/cli/chat/settingsSelection.d.ts +33 -0
- package/dist/cli/chat/settingsSelection.js +46 -0
- package/dist/cli/chat/skillNotices.d.ts +18 -0
- package/dist/cli/chat/skillNotices.js +26 -0
- package/dist/cli/chat/startupInfo.js +1 -1
- package/dist/cli/chat/startupSequence.d.ts +2 -0
- package/dist/cli/chat/startupSequence.js +6 -0
- package/dist/cli/chat/submitPipeline.d.ts +8 -0
- package/dist/cli/chat/submitPipeline.js +141 -0
- package/dist/cli/chat/terminalControl.js +1 -1
- package/dist/cli/chat/toolSummaries.d.ts +29 -0
- package/dist/cli/chat/toolSummaries.js +268 -0
- package/dist/cli/chat/turnState.d.ts +8 -0
- package/dist/cli/chat/turnState.js +1 -0
- package/dist/cli/chat/userCommandFlow.d.ts +21 -0
- package/dist/cli/chat/userCommandFlow.js +66 -0
- package/dist/cli/chat/userCommandRunner.d.ts +14 -0
- package/dist/cli/chat/userCommandRunner.js +56 -0
- package/dist/cli/chat/wizard/providerHandlers.js +19 -2
- package/dist/cli/chat/wizardTrail.d.ts +22 -0
- package/dist/cli/chat/wizardTrail.js +55 -0
- package/dist/cli/commands/chat.d.ts +1 -13
- package/dist/cli/commands/chat.js +10 -795
- package/dist/cli/commands/commandHelp.js +11 -6
- package/dist/cli/commands/commandSuggest.d.ts +2 -0
- package/dist/cli/commands/commandSuggest.js +35 -0
- package/dist/cli/commands/commands.js +12 -3
- package/dist/cli/commands/formatters.d.ts +1 -23
- package/dist/cli/commands/formatters.js +3 -224
- 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/modelCommand.js +11 -7
- package/dist/cli/commands/reasoningCommand.js +3 -3
- package/dist/cli/commands/runCommand.js +6 -2
- 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 +8 -3
- package/dist/cli/commands/streaming/attemptSetup.d.ts +4 -0
- package/dist/cli/commands/streaming/attemptSetup.js +34 -5
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +1 -1
- package/dist/cli/commands/streaming/goalSupervisor.js +5 -3
- package/dist/cli/commands/streaming/prepareStep.js +1 -0
- package/dist/cli/commands/streaming/stepProjection.d.ts +59 -0
- package/dist/cli/commands/streaming/stepProjection.js +54 -0
- package/dist/cli/commands/streaming/streamLoop.d.ts +2 -0
- package/dist/cli/commands/streaming/streamLoop.js +34 -23
- package/dist/cli/commands/streaming/toolGroupRenderer.js +1 -1
- package/dist/cli/commands/streaming/toolPartHandlers.js +8 -2
- package/dist/cli/commands/streaming.d.ts +3 -1
- package/dist/cli/commands/streaming.js +5 -0
- package/dist/cli/commands/wizardFlow.d.ts +2 -0
- package/dist/cli/commands/wizardFlow.js +3 -0
- package/dist/cli/index.js +8 -4
- package/dist/cli/terminalTitle.js +9 -3
- package/dist/config/contextFiles.d.ts +2 -5
- package/dist/config/contextFiles.js +1 -1
- package/dist/config/inputHistory.js +2 -2
- package/dist/config/providerAuth.js +2 -2
- package/dist/config/providerModelFacts.js +5 -0
- package/dist/config/providerPresets.js +1 -1
- package/dist/config/settings.d.ts +7 -0
- package/dist/config/settings.js +9 -2
- package/dist/config/updateCheck.js +2 -2
- package/dist/core/agent/compaction.d.ts +1 -0
- package/dist/core/agent/compaction.js +3 -0
- package/dist/core/agent/completionController.d.ts +1 -1
- package/dist/core/agent/contextBudget.d.ts +1 -1
- package/dist/core/agent/goalPolicy.js +8 -2
- package/dist/core/agent/overflow.js +5 -0
- package/dist/core/agent/toolCapabilities.js +14 -0
- package/dist/core/agent/userCommands.d.ts +53 -0
- package/dist/core/agent/userCommands.js +116 -0
- package/dist/core/agent/workState.d.ts +3 -1
- package/dist/core/agent/workState.js +57 -26
- package/dist/core/contextFileTypes.d.ts +12 -0
- package/dist/core/contextFileTypes.js +1 -0
- 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 +2 -0
- package/dist/core/limits.js +2 -0
- package/dist/core/log/llmLog.js +2 -2
- package/dist/{config → core/persistence}/privateStorage.js +1 -1
- package/dist/core/process/runBoundedProcess.d.ts +7 -4
- package/dist/core/process/runBoundedProcess.js +22 -11
- package/dist/core/safety/redaction.d.ts +2 -0
- package/dist/core/safety/redaction.js +26 -5
- package/dist/core/safety/secretPaths.js +12 -3
- package/dist/core/safety/untrustedEnvelopes.d.ts +6 -0
- package/dist/core/safety/untrustedEnvelopes.js +17 -2
- package/dist/core/safety/urlGuard.js +2 -0
- package/dist/core/session/sessionStore.d.ts +8 -1
- package/dist/core/session/sessionStore.js +15 -4
- package/dist/core/shellOutput/reducers/validation.d.ts +1 -1
- package/dist/core/shellOutput/types.d.ts +1 -1
- package/dist/core/subagent/executionProfiles.js +4 -4
- package/dist/core/tasks/taskStorage.js +11 -1
- package/dist/{llm → core}/toolResultTypes.d.ts +1 -1
- package/dist/core/validation/outputParser.d.ts +1 -1
- package/dist/core/validation/outputParser.js +16 -8
- package/dist/llm/hazeTools.d.ts +2 -12426
- package/dist/llm/hazeTools.js +4 -0
- package/dist/llm/lsp/pool.js +1 -1
- package/dist/llm/lsp/workspaceEdit.d.ts +1 -1
- package/dist/llm/lspTools.d.ts +3 -12622
- package/dist/llm/requestContext.d.ts +6 -0
- package/dist/llm/requestContext.js +28 -7
- package/dist/llm/subagentRunner.d.ts +2 -308
- package/dist/llm/systemPrompt.js +17 -7
- package/dist/llm/toolGroups.d.ts +534 -0
- package/dist/llm/toolGroups.js +57 -0
- package/dist/llm/tools/editMatch.d.ts +1 -1
- package/dist/llm/tools/failures.d.ts +1 -1
- package/dist/llm/tools/fetchTool.d.ts +2 -1221
- package/dist/llm/tools/fileToolShared.d.ts +1 -1
- package/dist/llm/tools/fileToolShared.js +1 -1
- package/dist/llm/tools/fileTools.d.ts +2 -7768
- package/dist/llm/tools/fileTools.js +1 -1
- package/dist/llm/tools/gitTools.d.ts +12 -0
- package/dist/llm/tools/gitTools.js +527 -0
- 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/processTool.d.ts +2 -1081
- package/dist/llm/tools/readRecovery.d.ts +1 -1
- package/dist/llm/tools/replaceInFiles.d.ts +1 -1
- package/dist/llm/tools/replaceInFiles.js +1 -1
- 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/taskTool.js +4 -1
- package/dist/llm/tools/toolContext.js +29 -11
- package/dist/llm/tools/toolContextState.d.ts +4 -1
- package/dist/llm/tools/toolContextState.js +2 -1
- package/dist/llm/tools/workspaceFile.d.ts +2 -2
- package/dist/llm/tools/workspaceFile.js +10 -5
- package/dist/skills/SkillRegistry.js +1 -1
- package/dist/skills/builder/SkillBuilder.js +1 -1
- package/dist/skills/plugins/installer.js +1 -1
- package/dist/skills/plugins/runtime.js +1 -1
- package/dist/skills/skillTools.js +4 -1
- package/dist/ui/components/MarkdownText.d.ts +14 -0
- package/dist/ui/components/MarkdownText.js +77 -12
- package/dist/ui/components/NativeIndicators.js +5 -1
- package/dist/ui/components/StreamingMarkdownText.d.ts +3 -1
- package/dist/ui/components/StreamingMarkdownText.js +39 -11
- package/dist/ui/components/TextInput.d.ts +1 -2
- package/dist/ui/components/TextInput.js +79 -9
- package/dist/ui/components/WizardChoices.d.ts +1 -2
- package/dist/ui/components/useInputSuggestions.d.ts +1 -1
- package/dist/ui/components/useInputSuggestions.js +1 -1
- package/dist/ui/mentionDetection.d.ts +20 -0
- package/dist/ui/mentionDetection.js +24 -0
- package/dist/ui/terminalColors.d.ts +4 -4
- package/dist/ui/terminalColors.js +23 -6
- package/dist/ui/terminalSanitize.js +8 -3
- package/dist/ui/textGeometry.d.ts +2 -0
- package/dist/ui/textGeometry.js +6 -0
- package/dist/ui/themes/registry.js +33 -33
- package/dist/utils/openPath.js +7 -0
- package/package.json +22 -19
- /package/dist/{llm/tools → core/ignore}/gitIgnore.d.ts +0 -0
- /package/dist/{llm/tools → core/ignore}/gitIgnore.js +0 -0
- /package/dist/{config → core}/paths.d.ts +0 -0
- /package/dist/{config → core}/paths.js +0 -0
- /package/dist/{config → core/persistence}/privateStorage.d.ts +0 -0
- /package/dist/{llm → core}/toolResultTypes.js +0 -0
|
@@ -33,6 +33,11 @@ export function createProviderWizardHandlers(deps, ctx) {
|
|
|
33
33
|
showMessage('Choose a provider preset, or select "custom" to enter details manually.');
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
+
if (providerName === PROVIDER_CHOICES.later) {
|
|
37
|
+
setMode('chat');
|
|
38
|
+
showMessage('Provider setup skipped. Run /provider any time; a provider is needed before the first turn.');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
36
41
|
const provider = findProvider(deps.settings, providerName);
|
|
37
42
|
if (!provider) {
|
|
38
43
|
showMessage(`No provider named ${providerName}. Use /provider and choose add provider.`);
|
|
@@ -42,7 +47,6 @@ export function createProviderWizardHandlers(deps, ctx) {
|
|
|
42
47
|
setSelectedProviderName(provider.name);
|
|
43
48
|
setMode('providerAction');
|
|
44
49
|
// Surface canonical-endpoint divergence for ChatGPT sign-in providers up
|
|
45
|
-
// front: a hand-edited URL is silently ignored by the Codex fetch (F-14).
|
|
46
50
|
const divergence = chatgptCodexUrlWarning(provider);
|
|
47
51
|
showMessage(`${provider.name}: choose an action.${divergence ? `\n${divergence}` : ''}`);
|
|
48
52
|
}
|
|
@@ -415,7 +419,20 @@ export function createProviderWizardHandlers(deps, ctx) {
|
|
|
415
419
|
await ctx.applySettings(result.settingsPatch);
|
|
416
420
|
setSelectedProviderName(undefined);
|
|
417
421
|
setMode('chat');
|
|
418
|
-
|
|
422
|
+
// UX-05: probe /models with the fresh key so a bad one surfaces now, not
|
|
423
|
+
// at the first turn. The key stays saved either way — the probe is
|
|
424
|
+
// advisory, so a failure only annotates the notice.
|
|
425
|
+
let message = result.message;
|
|
426
|
+
if (result.provider && result.provider.kind !== 'chatgpt-codex') {
|
|
427
|
+
deps.setBusyLabel(`Probing ${result.provider.name} model list`);
|
|
428
|
+
deps.setBusy(true);
|
|
429
|
+
const probe = await discoverProviderModels({ url: result.provider.url, key: result.key });
|
|
430
|
+
deps.setBusy(false);
|
|
431
|
+
message += probe.status === 'ok'
|
|
432
|
+
? `\nKey works: ${probe.models.length} model${probe.models.length === 1 ? '' : 's'} listed on ${result.provider.name}.`
|
|
433
|
+
: `\nKey saved, but the model-list probe failed (${probe.error}). The key may be wrong — it is kept; fix it with /provider → set API key.`;
|
|
434
|
+
}
|
|
435
|
+
showMessage(message);
|
|
419
436
|
}
|
|
420
437
|
async function providerRemoveModelsMode(value) {
|
|
421
438
|
const result = providerRemoveModels(deps.settings, deps.wizard.selectedProviderName, value);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { Mode } from '../commands/chatModes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Wizard back navigation (UX-03). Every mode change away from a wizard step
|
|
5
|
+
* pushes that step onto a trail, so Esc pops one step (selections and drafts
|
|
6
|
+
* survive because the wizard state is not reset) and only a trail-less wizard
|
|
7
|
+
* step exits to chat. Entering `chat` clears the trail, so a finished flow
|
|
8
|
+
* never leaves a stale path behind.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createWizardTrail(): {
|
|
11
|
+
enter(next: Mode): void;
|
|
12
|
+
/** Steps the current step was reached through, oldest first. */
|
|
13
|
+
steps(): readonly Mode[];
|
|
14
|
+
current(): Mode;
|
|
15
|
+
/** Returns the step to return to, or `undefined` at a wizard root. */
|
|
16
|
+
back(): Mode | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** `setMode` wrapper that records the trail, plus the Esc handler's `goBack`. */
|
|
19
|
+
export declare function useWizardNavigation(setModeRaw: Dispatch<SetStateAction<Mode>>): {
|
|
20
|
+
setMode: (action: SetStateAction<Mode>) => void;
|
|
21
|
+
goBack: () => boolean;
|
|
22
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Wizard back navigation (UX-03). Every mode change away from a wizard step
|
|
4
|
+
* pushes that step onto a trail, so Esc pops one step (selections and drafts
|
|
5
|
+
* survive because the wizard state is not reset) and only a trail-less wizard
|
|
6
|
+
* step exits to chat. Entering `chat` clears the trail, so a finished flow
|
|
7
|
+
* never leaves a stale path behind.
|
|
8
|
+
*/
|
|
9
|
+
export function createWizardTrail() {
|
|
10
|
+
const trail = [];
|
|
11
|
+
let current = 'chat';
|
|
12
|
+
return {
|
|
13
|
+
enter(next) {
|
|
14
|
+
if (next === 'chat')
|
|
15
|
+
trail.length = 0;
|
|
16
|
+
else if (current !== 'chat' && next !== current)
|
|
17
|
+
trail.push(current);
|
|
18
|
+
current = next;
|
|
19
|
+
},
|
|
20
|
+
/** Steps the current step was reached through, oldest first. */
|
|
21
|
+
steps() {
|
|
22
|
+
return trail;
|
|
23
|
+
},
|
|
24
|
+
current() {
|
|
25
|
+
return current;
|
|
26
|
+
},
|
|
27
|
+
/** Returns the step to return to, or `undefined` at a wizard root. */
|
|
28
|
+
back() {
|
|
29
|
+
const previous = trail.pop();
|
|
30
|
+
if (previous !== undefined)
|
|
31
|
+
current = previous;
|
|
32
|
+
return previous;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** `setMode` wrapper that records the trail, plus the Esc handler's `goBack`. */
|
|
37
|
+
export function useWizardNavigation(setModeRaw) {
|
|
38
|
+
const trailRef = useRef(undefined);
|
|
39
|
+
if (!trailRef.current)
|
|
40
|
+
trailRef.current = createWizardTrail();
|
|
41
|
+
const trail = trailRef.current;
|
|
42
|
+
const setMode = useCallback((action) => {
|
|
43
|
+
const next = typeof action === 'function' ? action(trail.current()) : action;
|
|
44
|
+
trail.enter(next);
|
|
45
|
+
setModeRaw(next);
|
|
46
|
+
}, [trail, setModeRaw]);
|
|
47
|
+
const goBack = useCallback(() => {
|
|
48
|
+
const previous = trail.back();
|
|
49
|
+
if (previous === undefined)
|
|
50
|
+
return false;
|
|
51
|
+
setModeRaw(previous);
|
|
52
|
+
return true;
|
|
53
|
+
}, [trail, setModeRaw]);
|
|
54
|
+
return { setMode, goBack };
|
|
55
|
+
}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
debug?: boolean;
|
|
3
|
-
version?: string;
|
|
4
|
-
/** Safe build provenance (commit, build time) recorded into session headers. */
|
|
5
|
-
build?: {
|
|
6
|
-
commit?: string;
|
|
7
|
-
builtAt?: string;
|
|
8
|
-
};
|
|
9
|
-
continueSession?: boolean;
|
|
10
|
-
resumeSessionId?: string;
|
|
11
|
-
noSession?: boolean;
|
|
12
|
-
}
|
|
1
|
+
import { type ChatOptions } from '../chat/ChatScreen.js';
|
|
13
2
|
export declare function chatCommand(options?: ChatOptions): Promise<void>;
|
|
14
|
-
export {};
|