@denizokcu/haze 1.1.0 → 1.1.1
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 +24 -1
- package/README.md +9 -5
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/busyIndicator.d.ts +11 -0
- package/dist/cli/chat/busyIndicator.js +34 -0
- package/dist/cli/chat/chatMetrics.d.ts +0 -1
- package/dist/cli/chat/chatMetrics.js +1 -7
- package/dist/cli/chat/followUpQueue.d.ts +11 -0
- package/dist/cli/chat/followUpQueue.js +38 -0
- package/dist/cli/chat/messages.d.ts +0 -22
- package/dist/cli/chat/messages.js +40 -85
- package/dist/cli/chat/sessionLifecycle.d.ts +3 -1
- package/dist/cli/chat/sessionLifecycle.js +6 -1
- package/dist/cli/chat/sessionRecorder.d.ts +2 -0
- package/dist/cli/chat/sessionRecorder.js +6 -0
- package/dist/cli/chat/startupSequence.d.ts +29 -0
- package/dist/cli/chat/startupSequence.js +59 -0
- package/dist/cli/chat/transcriptPartition.d.ts +23 -0
- package/dist/cli/chat/transcriptPartition.js +78 -0
- package/dist/cli/chat/wizard/fieldTransitions.d.ts +38 -0
- package/dist/cli/chat/wizard/fieldTransitions.js +43 -0
- package/dist/cli/chat/wizard/lspHandlers.d.ts +4 -0
- package/dist/cli/chat/wizard/lspHandlers.js +85 -0
- package/dist/cli/chat/wizard/mcpHandlers.d.ts +8 -0
- package/dist/cli/chat/wizard/mcpHandlers.js +82 -0
- package/dist/cli/chat/wizard/providerHandlers.d.ts +12 -0
- package/dist/cli/chat/wizard/providerHandlers.js +420 -0
- package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +4 -0
- package/dist/cli/chat/wizard/sessionThemeHandlers.js +48 -0
- package/dist/cli/chat/wizard/skillsHandlers.d.ts +4 -0
- package/dist/cli/chat/wizard/skillsHandlers.js +125 -0
- package/dist/cli/chat/wizard/types.d.ts +63 -0
- package/dist/cli/chat/wizard/types.js +24 -0
- package/dist/cli/chat/wizard/uiState.d.ts +56 -0
- package/dist/cli/chat/wizard/uiState.js +15 -0
- package/dist/cli/chat/wizardDispatch.d.ts +11 -113
- package/dist/cli/chat/wizardDispatch.js +41 -815
- package/dist/cli/commands/chat.js +45 -108
- package/dist/cli/commands/formatters.d.ts +0 -3
- package/dist/cli/commands/formatters.js +0 -29
- package/dist/cli/commands/runCommand.d.ts +2 -0
- package/dist/cli/commands/runCommand.js +67 -4
- package/dist/cli/commands/streaming/assistantSegments.d.ts +19 -0
- package/dist/cli/commands/streaming/assistantSegments.js +48 -0
- package/dist/cli/commands/streaming/attemptOutcome.d.ts +2 -2
- package/dist/cli/commands/streaming/attemptOutcome.js +17 -7
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +69 -8
- package/dist/cli/commands/streaming/goalCheckpoint.js +36 -1
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +17 -2
- package/dist/cli/commands/streaming/goalSupervisor.js +62 -12
- package/dist/cli/commands/streaming/prepareStep.d.ts +35 -0
- package/dist/cli/commands/streaming/prepareStep.js +100 -0
- package/dist/cli/commands/streaming/recoverySlices.d.ts +15 -0
- package/dist/cli/commands/streaming/recoverySlices.js +29 -0
- package/dist/cli/commands/streaming/stallRecovery.d.ts +0 -1
- package/dist/cli/commands/streaming/stallRecovery.js +0 -4
- package/dist/cli/commands/streaming/streamLoop.js +9 -230
- package/dist/cli/commands/streaming/toolGroupRenderer.js +2 -1
- package/dist/cli/commands/streaming/toolPartHandlers.d.ts +19 -0
- package/dist/cli/commands/streaming/toolPartHandlers.js +95 -0
- package/dist/cli/commands/streaming.d.ts +4 -1
- package/dist/cli/commands/streaming.js +6 -21
- package/dist/cli/index.js +3 -1
- package/dist/config/providerPresets.d.ts +7 -0
- package/dist/config/providerPresets.js +195 -391
- package/dist/core/agent/completionController.d.ts +14 -7
- package/dist/core/agent/completionController.js +12 -6
- package/dist/core/agent/events.d.ts +12 -0
- package/dist/core/agent/goalPolicy.d.ts +4 -3
- package/dist/core/agent/goalPolicy.js +9 -4
- package/dist/core/agent/workState.d.ts +25 -15
- package/dist/core/agent/workState.js +71 -43
- package/dist/core/session/sessionSlimming.js +8 -0
- package/dist/core/session/sessionStore.d.ts +61 -1
- package/dist/core/session/sessionStore.js +115 -6
- package/dist/llm/hazeTools.d.ts +64 -208
- package/dist/llm/tools/taskTool.d.ts +64 -208
- package/dist/llm/tools/taskTool.js +22 -10
- package/dist/ui/components/TextInput.js +6 -67
- package/dist/ui/components/useInputSuggestions.d.ts +27 -0
- package/dist/ui/components/useInputSuggestions.js +98 -0
- package/dist/ui/theme.d.ts +8 -8
- package/dist/ui/theme.js +11 -12
- package/dist/ui/themes/registry.d.ts +5 -0
- package/dist/ui/themes/registry.js +436 -0
- package/dist/utils/format.d.ts +10 -0
- package/dist/utils/format.js +45 -0
- package/package.json +1 -1
- package/dist/ui/themes/af-magic.d.ts +0 -7
- package/dist/ui/themes/af-magic.js +0 -25
- package/dist/ui/themes/agnoster.d.ts +0 -10
- package/dist/ui/themes/agnoster.js +0 -40
- package/dist/ui/themes/bira.d.ts +0 -10
- package/dist/ui/themes/bira.js +0 -28
- package/dist/ui/themes/bureau.d.ts +0 -10
- package/dist/ui/themes/bureau.js +0 -28
- package/dist/ui/themes/clean.d.ts +0 -9
- package/dist/ui/themes/clean.js +0 -27
- package/dist/ui/themes/cloud.d.ts +0 -6
- package/dist/ui/themes/cloud.js +0 -24
- package/dist/ui/themes/dst.d.ts +0 -10
- package/dist/ui/themes/dst.js +0 -28
- package/dist/ui/themes/fishy.d.ts +0 -7
- package/dist/ui/themes/fishy.js +0 -25
- package/dist/ui/themes/index.d.ts +0 -8
- package/dist/ui/themes/index.js +0 -36
- package/dist/ui/themes/light.d.ts +0 -3
- package/dist/ui/themes/light.js +0 -21
- package/dist/ui/themes/purple.d.ts +0 -7
- package/dist/ui/themes/purple.js +0 -26
- package/dist/ui/themes/robbyrussell.d.ts +0 -8
- package/dist/ui/themes/robbyrussell.js +0 -26
- package/dist/ui/themes/solarized-dark.d.ts +0 -16
- package/dist/ui/themes/solarized-dark.js +0 -44
- package/dist/ui/themes/solarized-light.d.ts +0 -12
- package/dist/ui/themes/solarized-light.js +0 -40
- package/dist/ui/themes/steeef.d.ts +0 -11
- package/dist/ui/themes/steeef.js +0 -29
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isYesConfirmation } from '../../commands/wizardFlow.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generic typed-"yes" confirm-remove step shared by the LSP and MCP flows.
|
|
4
|
+
* Cancel and no-selection paths are identical; `remove` applies the domain
|
|
5
|
+
* settings mutation and returns the success message.
|
|
6
|
+
*/
|
|
7
|
+
export function confirmRemoveStep(ctx, input) {
|
|
8
|
+
return async (value) => {
|
|
9
|
+
const name = input.selectedName();
|
|
10
|
+
if (!name) {
|
|
11
|
+
ctx.setMode('chat');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!isYesConfirmation(value)) {
|
|
15
|
+
ctx.showMessage(input.cancelMessage);
|
|
16
|
+
input.clearSelection();
|
|
17
|
+
ctx.setMode('chat');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
ctx.showMessage(await input.remove(name));
|
|
21
|
+
input.clearSelection();
|
|
22
|
+
ctx.setMode('chat');
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { HazeMcpServer, HazeProviderSettings } from '../../../config/settings.js';
|
|
2
|
+
import type { HazeLspServer } from '../../../config/lspSettings.js';
|
|
3
|
+
import type { SkillSource } from '../../../skills/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Wizard flow UI state: one reducer for selection, drafts, and model
|
|
6
|
+
* discovery. The wizard-related React state that used to live in twelve
|
|
7
|
+
* `useState` hooks in `chat.tsx`. Flat field names match the historical deps
|
|
8
|
+
* names so the dispatch body and its tests read the same way.
|
|
9
|
+
*/
|
|
10
|
+
export interface WizardUiState {
|
|
11
|
+
selectedSessionId?: string;
|
|
12
|
+
modelProviderFilter?: string;
|
|
13
|
+
discoveredModels: string[];
|
|
14
|
+
suggestedModels: string[];
|
|
15
|
+
selectedProviderName?: string;
|
|
16
|
+
providerDraft: Partial<HazeProviderSettings>;
|
|
17
|
+
skillDraft: {
|
|
18
|
+
name?: string;
|
|
19
|
+
scope?: SkillSource;
|
|
20
|
+
};
|
|
21
|
+
selectedSkillName?: string;
|
|
22
|
+
selectedLspName?: string;
|
|
23
|
+
lspDraft: Partial<HazeLspServer>;
|
|
24
|
+
selectedMcpName?: string;
|
|
25
|
+
mcpDraft: Partial<HazeMcpServer>;
|
|
26
|
+
}
|
|
27
|
+
export type WizardUiAction = {
|
|
28
|
+
type: 'set';
|
|
29
|
+
key: 'selectedSessionId' | 'modelProviderFilter' | 'selectedProviderName' | 'selectedSkillName' | 'selectedLspName' | 'selectedMcpName';
|
|
30
|
+
value: string | undefined;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'providerDraft';
|
|
33
|
+
value: Partial<HazeProviderSettings>;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'skillDraft';
|
|
36
|
+
value: {
|
|
37
|
+
name?: string;
|
|
38
|
+
scope?: SkillSource;
|
|
39
|
+
};
|
|
40
|
+
} | {
|
|
41
|
+
type: 'lspDraft';
|
|
42
|
+
value: Partial<HazeLspServer>;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'mcpDraft';
|
|
45
|
+
value: Partial<HazeMcpServer>;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'discoveredModels';
|
|
48
|
+
value: string[];
|
|
49
|
+
} | {
|
|
50
|
+
type: 'suggestedModels';
|
|
51
|
+
value: string[];
|
|
52
|
+
} | {
|
|
53
|
+
type: 'reset';
|
|
54
|
+
};
|
|
55
|
+
export declare function initialWizardUiState(): WizardUiState;
|
|
56
|
+
export declare function wizardUiReducer(state: WizardUiState, action: WizardUiAction): WizardUiState;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function initialWizardUiState() {
|
|
2
|
+
return { discoveredModels: [], suggestedModels: [], providerDraft: {}, skillDraft: {}, lspDraft: {}, mcpDraft: {} };
|
|
3
|
+
}
|
|
4
|
+
export function wizardUiReducer(state, action) {
|
|
5
|
+
switch (action.type) {
|
|
6
|
+
case 'set': return { ...state, [action.key]: action.value };
|
|
7
|
+
case 'providerDraft': return { ...state, providerDraft: action.value };
|
|
8
|
+
case 'skillDraft': return { ...state, skillDraft: action.value };
|
|
9
|
+
case 'lspDraft': return { ...state, lspDraft: action.value };
|
|
10
|
+
case 'mcpDraft': return { ...state, mcpDraft: action.value };
|
|
11
|
+
case 'discoveredModels': return { ...state, discoveredModels: action.value };
|
|
12
|
+
case 'suggestedModels': return { ...state, suggestedModels: action.value };
|
|
13
|
+
case 'reset': return initialWizardUiState();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,119 +1,18 @@
|
|
|
1
|
-
import type { HazeMcpServer, HazeProviderSettings
|
|
2
|
-
import type { HazeLspServer } from '../../config/lspSettings.js';
|
|
3
|
-
import type { LoadedSkill, SkillSource } from '../../skills/types.js';
|
|
4
|
-
import type { SessionSummary } from '../../core/session/sessionStore.js';
|
|
1
|
+
import type { HazeMcpServer, HazeProviderSettings } from '../../config/settings.js';
|
|
5
2
|
import type { Mode } from '../commands/chatModes.js';
|
|
3
|
+
import type { WizardDispatchDeps } from './wizard/types.js';
|
|
4
|
+
export type { WizardDispatchDeps } from './wizard/types.js';
|
|
5
|
+
export { initialWizardUiState, wizardUiReducer, type WizardUiAction, type WizardUiState } from './wizard/uiState.js';
|
|
6
|
+
export { transitionMcpField, transitionProviderField, type McpWizardEffect, type ProviderWizardEffect } from './wizard/fieldTransitions.js';
|
|
6
7
|
/**
|
|
7
8
|
* Wizard submit engine (CR-006): one table-driven entry point for every
|
|
8
|
-
* picker/wizard mode.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* picker/wizard mode. The mode-specific handler families live in
|
|
10
|
+
* `wizard/` (provider/model, skills, LSP, MCP, session/theme); each calls the
|
|
11
|
+
* pure `*Wizard.ts` result functions and applies the shared
|
|
12
|
+
* settingsPatch/mode/message shape, while field-capture steps run through the
|
|
13
|
+
* pure transition functions in `wizard/fieldTransitions.ts`, so `chat.tsx`
|
|
14
|
+
* stays orchestration glue instead of a 150-line if-chain.
|
|
12
15
|
*/
|
|
13
|
-
type SharedWizardEffect = {
|
|
14
|
-
type: 'message';
|
|
15
|
-
text?: string;
|
|
16
|
-
} | {
|
|
17
|
-
type: 'mode';
|
|
18
|
-
mode: Mode;
|
|
19
|
-
};
|
|
20
|
-
export type ProviderWizardEffect = SharedWizardEffect | {
|
|
21
|
-
type: 'provider-draft';
|
|
22
|
-
patch: Partial<HazeProviderSettings>;
|
|
23
|
-
replace?: boolean;
|
|
24
|
-
} | {
|
|
25
|
-
type: 'discover-provider-models';
|
|
26
|
-
draft: Partial<HazeProviderSettings>;
|
|
27
|
-
};
|
|
28
|
-
export type McpWizardEffect = SharedWizardEffect | {
|
|
29
|
-
type: 'mcp-draft';
|
|
30
|
-
patch: Partial<HazeMcpServer>;
|
|
31
|
-
} | {
|
|
32
|
-
type: 'finish-mcp-stdio';
|
|
33
|
-
draft: Partial<HazeMcpServer>;
|
|
34
|
-
};
|
|
35
|
-
export declare function transitionProviderField(input: {
|
|
36
|
-
mode: Mode;
|
|
37
|
-
value: string;
|
|
38
|
-
settings: HazeSettings;
|
|
39
|
-
draft: Partial<HazeProviderSettings>;
|
|
40
|
-
}): ProviderWizardEffect[] | undefined;
|
|
41
|
-
export declare function transitionMcpField(input: {
|
|
42
|
-
mode: Mode;
|
|
43
|
-
value: string;
|
|
44
|
-
settings: HazeSettings;
|
|
45
|
-
draft: Partial<HazeMcpServer>;
|
|
46
|
-
}): McpWizardEffect[] | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* The wizard-related React state that used to live in twelve `useState`
|
|
49
|
-
* hooks in `chat.tsx`. Flat field names match the historical deps names so
|
|
50
|
-
* the dispatch body and its tests read the same way.
|
|
51
|
-
*/
|
|
52
|
-
export interface WizardUiState {
|
|
53
|
-
selectedSessionId?: string;
|
|
54
|
-
modelProviderFilter?: string;
|
|
55
|
-
discoveredModels: string[];
|
|
56
|
-
suggestedModels: string[];
|
|
57
|
-
selectedProviderName?: string;
|
|
58
|
-
providerDraft: Partial<HazeProviderSettings>;
|
|
59
|
-
skillDraft: {
|
|
60
|
-
name?: string;
|
|
61
|
-
scope?: SkillSource;
|
|
62
|
-
};
|
|
63
|
-
selectedSkillName?: string;
|
|
64
|
-
selectedLspName?: string;
|
|
65
|
-
lspDraft: Partial<HazeLspServer>;
|
|
66
|
-
selectedMcpName?: string;
|
|
67
|
-
mcpDraft: Partial<HazeMcpServer>;
|
|
68
|
-
}
|
|
69
|
-
export type WizardUiAction = {
|
|
70
|
-
type: 'set';
|
|
71
|
-
key: 'selectedSessionId' | 'modelProviderFilter' | 'selectedProviderName' | 'selectedSkillName' | 'selectedLspName' | 'selectedMcpName';
|
|
72
|
-
value: string | undefined;
|
|
73
|
-
} | {
|
|
74
|
-
type: 'providerDraft';
|
|
75
|
-
value: Partial<HazeProviderSettings>;
|
|
76
|
-
} | {
|
|
77
|
-
type: 'skillDraft';
|
|
78
|
-
value: {
|
|
79
|
-
name?: string;
|
|
80
|
-
scope?: SkillSource;
|
|
81
|
-
};
|
|
82
|
-
} | {
|
|
83
|
-
type: 'lspDraft';
|
|
84
|
-
value: Partial<HazeLspServer>;
|
|
85
|
-
} | {
|
|
86
|
-
type: 'mcpDraft';
|
|
87
|
-
value: Partial<HazeMcpServer>;
|
|
88
|
-
} | {
|
|
89
|
-
type: 'discoveredModels';
|
|
90
|
-
value: string[];
|
|
91
|
-
} | {
|
|
92
|
-
type: 'suggestedModels';
|
|
93
|
-
value: string[];
|
|
94
|
-
} | {
|
|
95
|
-
type: 'reset';
|
|
96
|
-
};
|
|
97
|
-
export declare function initialWizardUiState(): WizardUiState;
|
|
98
|
-
export declare function wizardUiReducer(state: WizardUiState, action: WizardUiAction): WizardUiState;
|
|
99
|
-
export interface WizardDispatchDeps {
|
|
100
|
-
settings: HazeSettings;
|
|
101
|
-
skills: LoadedSkill[];
|
|
102
|
-
sessions?: SessionSummary[];
|
|
103
|
-
/** Wizard flow UI state (selection, drafts, model discovery). */
|
|
104
|
-
wizard: WizardUiState;
|
|
105
|
-
updateWizard: (action: WizardUiAction) => void;
|
|
106
|
-
setMode: (mode: Mode) => void;
|
|
107
|
-
setSettings: (next: HazeSettings) => void;
|
|
108
|
-
showMessage: (message: string | undefined) => void;
|
|
109
|
-
resumeSessionById?: (id: string) => Promise<boolean>;
|
|
110
|
-
forkSessionById?: (id: string) => Promise<boolean>;
|
|
111
|
-
refreshSkills: () => Promise<unknown>;
|
|
112
|
-
setBusyLabel: (label: string) => void;
|
|
113
|
-
setBusy: (busy: boolean) => void;
|
|
114
|
-
/** Busy label to restore when a skill creation finishes. */
|
|
115
|
-
idleBusyLabel: string;
|
|
116
|
-
}
|
|
117
16
|
export interface WizardDispatch {
|
|
118
17
|
/** Handle the value for wizard/picker modes; returns false for non-wizard modes. */
|
|
119
18
|
dispatch: (mode: Mode, value: string) => Promise<boolean>;
|
|
@@ -123,4 +22,3 @@ export interface WizardDispatch {
|
|
|
123
22
|
discoverProviderModelsForDraft: (draft: Partial<HazeProviderSettings>) => Promise<void>;
|
|
124
23
|
}
|
|
125
24
|
export declare function createWizardDispatch(deps: WizardDispatchDeps): WizardDispatch;
|
|
126
|
-
export {};
|