@denizokcu/haze 0.5.0 → 0.7.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 +36 -1
- package/README.md +101 -24
- package/dist/cli/chat/TaskBar.d.ts +9 -0
- package/dist/cli/chat/TaskBar.js +40 -0
- package/dist/cli/chat/chatMetrics.d.ts +11 -0
- package/dist/cli/chat/chatMetrics.js +50 -0
- package/dist/cli/chat/inputSuggestions.d.ts +16 -0
- package/dist/cli/chat/inputSuggestions.js +55 -0
- package/dist/cli/chat/messages.d.ts +9 -0
- package/dist/cli/chat/messages.js +76 -0
- package/dist/cli/chat/sessionRecorder.d.ts +12 -0
- package/dist/cli/chat/sessionRecorder.js +21 -0
- package/dist/cli/chat/startupInfo.d.ts +4 -0
- package/dist/cli/chat/startupInfo.js +53 -0
- package/dist/cli/chat/turnState.d.ts +5 -0
- package/dist/cli/chat/turnState.js +20 -0
- package/dist/cli/commands/chat.d.ts +0 -1
- package/dist/cli/commands/chat.js +519 -495
- package/dist/cli/commands/chatModes.d.ts +8 -0
- package/dist/cli/commands/chatModes.js +44 -0
- package/dist/cli/commands/commandHelp.d.ts +6 -0
- package/dist/cli/commands/commandHelp.js +25 -0
- package/dist/cli/commands/commands.d.ts +3 -2
- package/dist/cli/commands/commands.js +55 -320
- package/dist/cli/commands/formatters.d.ts +27 -0
- package/dist/cli/commands/formatters.js +149 -4
- package/dist/cli/commands/initCommand.d.ts +2 -0
- package/dist/cli/commands/initCommand.js +19 -0
- package/dist/cli/commands/logsCommand.d.ts +2 -0
- package/dist/cli/commands/logsCommand.js +63 -0
- package/dist/cli/commands/lspWizard.d.ts +14 -0
- package/dist/cli/commands/lspWizard.js +44 -0
- package/dist/cli/commands/mcpWizard.d.ts +15 -0
- package/dist/cli/commands/mcpWizard.js +69 -0
- package/dist/cli/commands/modelCommand.d.ts +2 -0
- package/dist/cli/commands/modelCommand.js +36 -0
- package/dist/cli/commands/providerWizard.d.ts +30 -0
- package/dist/cli/commands/providerWizard.js +114 -0
- package/dist/cli/commands/runCommand.d.ts +16 -0
- package/dist/cli/commands/runCommand.js +170 -0
- package/dist/cli/commands/settingsSummary.d.ts +3 -0
- package/dist/cli/commands/settingsSummary.js +40 -0
- package/dist/cli/commands/skillConfirmRemove.d.ts +11 -0
- package/dist/cli/commands/skillConfirmRemove.js +19 -0
- package/dist/cli/commands/skillCreation.d.ts +12 -0
- package/dist/cli/commands/skillCreation.js +14 -0
- package/dist/cli/commands/skillWizard.d.ts +15 -0
- package/dist/cli/commands/skillWizard.js +38 -0
- package/dist/cli/commands/streaming/assistantText.d.ts +17 -0
- package/dist/cli/commands/streaming/assistantText.js +115 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +55 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.js +102 -0
- package/dist/cli/commands/streaming/toolResultState.d.ts +13 -0
- package/dist/cli/commands/streaming/toolResultState.js +25 -0
- package/dist/cli/commands/streaming/turnRuntime.d.ts +78 -0
- package/dist/cli/commands/streaming/turnRuntime.js +86 -0
- package/dist/cli/commands/streaming.d.ts +10 -29
- package/dist/cli/commands/streaming.js +249 -911
- package/dist/cli/commands/wizardActions.d.ts +40 -0
- package/dist/cli/commands/wizardActions.js +40 -0
- package/dist/cli/commands/wizardInput.d.ts +4 -0
- package/dist/cli/commands/wizardInput.js +19 -0
- package/dist/cli/commands/wizardPrompts.d.ts +22 -0
- package/dist/cli/commands/wizardPrompts.js +52 -0
- package/dist/cli/commands/wizardSuggestions.d.ts +23 -0
- package/dist/cli/commands/wizardSuggestions.js +139 -0
- package/dist/cli/index.js +62 -4
- package/dist/config/contextFiles.d.ts +8 -1
- package/dist/config/contextFiles.js +25 -12
- package/dist/config/lspSettings.d.ts +16 -0
- package/dist/config/lspSettings.js +95 -0
- package/dist/config/mcpSettings.d.ts +24 -0
- package/dist/config/mcpSettings.js +100 -0
- package/dist/config/providers.js +4 -4
- package/dist/config/settings.d.ts +34 -0
- package/dist/config/skillSettings.d.ts +15 -0
- package/dist/config/skillSettings.js +32 -0
- package/dist/config/updateCheck.d.ts +44 -0
- package/dist/config/updateCheck.js +83 -0
- package/dist/core/agent/budgets.d.ts +6 -0
- package/dist/core/agent/budgets.js +6 -0
- package/dist/core/agent/compaction.js +1 -1
- package/dist/core/agent/requestAssembly.d.ts +0 -7
- package/dist/core/agent/requestAssembly.js +27 -5
- package/dist/core/agent/toolOutputStore.js +5 -4
- package/dist/core/agent/toolResults.d.ts +31 -0
- package/dist/core/agent/toolResults.js +42 -0
- package/dist/core/agent/turnPolicy.d.ts +8 -0
- package/dist/core/agent/turnPolicy.js +23 -0
- package/dist/core/agent/workState.d.ts +18 -5
- package/dist/core/agent/workState.js +39 -20
- package/dist/core/bashOutput/reducers/content.d.ts +1 -0
- package/dist/core/bashOutput/reducers/content.js +1 -1
- package/dist/core/bashOutput/reducers/gh.d.ts +1 -0
- package/dist/core/bashOutput/reducers/gh.js +77 -0
- package/dist/core/bashOutput/registry.js +8 -0
- package/dist/core/goal/sessionGoal.d.ts +6 -30
- package/dist/core/goal/sessionGoal.js +3 -68
- package/dist/core/safety/bashClassifier.js +30 -0
- package/dist/core/safety/urlGuard.d.ts +1 -0
- package/dist/core/safety/urlGuard.js +6 -1
- package/dist/core/session/sessionSlimming.d.ts +5 -0
- package/dist/core/session/sessionSlimming.js +78 -0
- package/dist/core/session/sessionStore.d.ts +23 -3
- package/dist/core/session/sessionStore.js +30 -10
- package/dist/core/subagent/subagentRunner.d.ts +11 -1
- package/dist/core/subagent/subagentRunner.js +1 -0
- package/dist/llm/capabilities.d.ts +12 -0
- package/dist/llm/capabilities.js +10 -0
- package/dist/llm/client.d.ts +1 -0
- package/dist/llm/client.js +11 -2
- package/dist/llm/hazeTools.d.ts +31 -32
- package/dist/llm/hazeTools.js +40 -567
- package/dist/llm/lsp.d.ts +109 -0
- package/dist/llm/lsp.js +241 -0
- package/dist/llm/lspTools.d.ts +104 -0
- package/dist/llm/lspTools.js +115 -0
- package/dist/llm/mcp.d.ts +19 -0
- package/dist/llm/mcp.js +73 -0
- package/dist/llm/requestContext.d.ts +28 -0
- package/dist/llm/requestContext.js +41 -0
- package/dist/llm/systemPrompt.d.ts +5 -1
- package/dist/llm/systemPrompt.js +9 -3
- package/dist/llm/tools/bashTool.d.ts +5 -0
- package/dist/llm/tools/bashTool.js +81 -0
- package/dist/llm/tools/editMatch.d.ts +55 -0
- package/dist/llm/tools/editMatch.js +99 -0
- package/dist/llm/tools/failures.d.ts +36 -0
- package/dist/llm/tools/failures.js +38 -0
- package/dist/llm/tools/fetchTool.d.ts +65 -0
- package/dist/llm/tools/fetchTool.js +45 -0
- package/dist/llm/tools/fileToolShared.d.ts +10 -0
- package/dist/llm/tools/fileToolShared.js +43 -0
- package/dist/llm/tools/grepParse.d.ts +13 -0
- package/dist/llm/tools/grepParse.js +67 -0
- package/dist/llm/tools/outputCap.d.ts +53 -0
- package/dist/llm/tools/outputCap.js +67 -0
- package/dist/llm/tools/storedOutputTool.d.ts +10 -0
- package/dist/llm/tools/storedOutputTool.js +17 -0
- package/dist/llm/tools/taskTool.d.ts +28 -0
- package/dist/llm/tools/taskTool.js +41 -0
- package/dist/llm/tools/toolContext.d.ts +69 -0
- package/dist/llm/tools/toolContext.js +187 -0
- package/dist/llm/tools/workspaceFile.d.ts +33 -0
- package/dist/llm/tools/workspaceFile.js +27 -0
- package/dist/llm/webFetch.d.ts +13 -1
- package/dist/llm/webFetch.js +91 -7
- package/dist/skills/builder/SkillBuilder.d.ts +3 -0
- package/dist/skills/builder/SkillBuilder.js +24 -45
- package/dist/ui/components/TextInput.d.ts +1 -1
- package/dist/ui/components/TextInput.js +1 -99
- package/dist/ui/inputBuffer.d.ts +28 -0
- package/dist/ui/inputBuffer.js +99 -0
- package/dist/utils/collections.d.ts +6 -0
- package/dist/utils/collections.js +9 -0
- package/dist/utils/path.d.ts +2 -0
- package/dist/utils/path.js +40 -0
- package/dist/utils/version.d.ts +20 -0
- package/dist/utils/version.js +72 -0
- package/package.json +2 -2
- package/dist/cli/commands/skills.d.ts +0 -4
- package/dist/cli/commands/skills.js +0 -38
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export function parseVersion(input) {
|
|
2
|
+
const cleaned = input.trim().replace(/^v/i, '');
|
|
3
|
+
// Drop build metadata: everything from the first '+' onward is ignored.
|
|
4
|
+
const withoutBuild = cleaned.split('+')[0] ?? '';
|
|
5
|
+
// Pre-release is denoted by the first '-' after the release identifier.
|
|
6
|
+
const dashIndex = withoutBuild.indexOf('-');
|
|
7
|
+
const releasePart = dashIndex >= 0 ? withoutBuild.slice(0, dashIndex) : withoutBuild;
|
|
8
|
+
// No numeric release segment => treat the whole input as 0.0.0 (no pre-release).
|
|
9
|
+
if (!/\d/.test(releasePart))
|
|
10
|
+
return { release: [0, 0, 0], prerelease: [] };
|
|
11
|
+
const segments = releasePart.split('.');
|
|
12
|
+
const nums = [0, 0, 0];
|
|
13
|
+
for (let index = 0; index < 3; index++) {
|
|
14
|
+
const parsed = Number.parseInt((segments[index] ?? '').replace(/[^0-9]/g, ''), 10);
|
|
15
|
+
nums[index] = Number.isFinite(parsed) ? parsed : 0;
|
|
16
|
+
}
|
|
17
|
+
const prereleasePart = dashIndex >= 0 ? withoutBuild.slice(dashIndex + 1) : '';
|
|
18
|
+
const prerelease = prereleasePart ? prereleasePart.split('.').map(part => part.trim()).filter(Boolean) : [];
|
|
19
|
+
return { release: nums, prerelease };
|
|
20
|
+
}
|
|
21
|
+
function comparePrerelease(a, b) {
|
|
22
|
+
// No prerelease suffix means "higher" than any prerelease; handled by caller.
|
|
23
|
+
const max = Math.max(a.length, b.length);
|
|
24
|
+
for (let index = 0; index < max; index++) {
|
|
25
|
+
if (index >= a.length)
|
|
26
|
+
return -1; // a is shorter → a is older
|
|
27
|
+
if (index >= b.length)
|
|
28
|
+
return 1;
|
|
29
|
+
const aa = a[index];
|
|
30
|
+
const bb = b[index];
|
|
31
|
+
const anum = Number(aa);
|
|
32
|
+
const bnum = Number(bb);
|
|
33
|
+
const bothNumeric = Number.isFinite(anum) && Number.isFinite(bnum);
|
|
34
|
+
if (bothNumeric) {
|
|
35
|
+
if (anum < bnum)
|
|
36
|
+
return -1;
|
|
37
|
+
if (anum > bnum)
|
|
38
|
+
return 1;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (aa < bb)
|
|
42
|
+
return -1;
|
|
43
|
+
if (aa > bb)
|
|
44
|
+
return 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
/** Returns -1 if `a` is older than `b`, 0 if equal, 1 if `a` is newer. */
|
|
50
|
+
export function compareVersions(a, b) {
|
|
51
|
+
const pa = parseVersion(a);
|
|
52
|
+
const pb = parseVersion(b);
|
|
53
|
+
for (let index = 0; index < 3; index++) {
|
|
54
|
+
if (pa.release[index] < pb.release[index])
|
|
55
|
+
return -1;
|
|
56
|
+
if (pa.release[index] > pb.release[index])
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
const aHasPre = pa.prerelease.length > 0;
|
|
60
|
+
const bHasPre = pb.prerelease.length > 0;
|
|
61
|
+
if (!aHasPre && bHasPre)
|
|
62
|
+
return 1; // release is newer than prerelease
|
|
63
|
+
if (aHasPre && !bHasPre)
|
|
64
|
+
return -1;
|
|
65
|
+
if (aHasPre && bHasPre)
|
|
66
|
+
return comparePrerelease(pa.prerelease, pb.prerelease);
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
/** True when `latest` is strictly newer than `current`. */
|
|
70
|
+
export function isNewer(latest, current) {
|
|
71
|
+
return compareVersions(latest, current) > 0;
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@denizokcu/haze",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A pragmatic agentic CLI for building apps from the terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"prepublishOnly": "npm run typecheck && npm run build"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@ai-sdk/mcp": "^1.0.52",
|
|
47
48
|
"@ai-sdk/openai": "3.0.73",
|
|
48
|
-
"@inquirer/prompts": "8.5.2",
|
|
49
49
|
"@vscode/ripgrep": "1.18.0",
|
|
50
50
|
"ai": "6.0.208",
|
|
51
51
|
"cli-highlight": "2.1.11",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { render, Box, Text } from 'ink';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { confirm } from '@inquirer/prompts';
|
|
6
|
-
import { GLOBAL_SKILLS_DIR } from '../../config/paths.js';
|
|
7
|
-
import { loadSkillRegistry } from '../../skills/SkillRegistry.js';
|
|
8
|
-
import { Header } from '../../ui/components/Header.js';
|
|
9
|
-
import { theme } from '../../ui/theme.js';
|
|
10
|
-
export async function listSkills() {
|
|
11
|
-
const registry = await loadSkillRegistry();
|
|
12
|
-
render(_jsxs(Box, { flexDirection: "column", children: [_jsx(Header, { subtitle: "Installed skills" }), [...registry.skills.values()].map(s => _jsxs(Text, { children: [_jsx(Text, { color: theme.purple, children: s.name }), " \u2014 ", s.description] }, s.name))] }));
|
|
13
|
-
}
|
|
14
|
-
export async function infoSkill(name) {
|
|
15
|
-
const registry = await loadSkillRegistry();
|
|
16
|
-
const skill = registry.skills.get(name);
|
|
17
|
-
if (!skill)
|
|
18
|
-
throw new Error(`No skill named ${name}`);
|
|
19
|
-
render(_jsxs(Box, { flexDirection: "column", children: [_jsx(Header, { subtitle: `Skill: ${name}` }), _jsx(Text, { children: skill.description }), _jsx(Text, { color: theme.violet, children: "References" }), skill.references.map(r => _jsxs(Text, { children: [" ", r.path] }, r.path)), _jsx(Text, { color: theme.violet, children: "Path" }), _jsx(Text, { children: skill.dir })] }));
|
|
20
|
-
}
|
|
21
|
-
export async function removeSkill(name) {
|
|
22
|
-
const registry = await loadSkillRegistry();
|
|
23
|
-
const skill = registry.skills.get(name);
|
|
24
|
-
if (!skill)
|
|
25
|
-
throw new Error(`No skill named ${name}`);
|
|
26
|
-
const ok = await confirm({ message: `Remove ${name} from ${skill.dir}?`, default: false });
|
|
27
|
-
if (!ok)
|
|
28
|
-
return;
|
|
29
|
-
await fs.remove(skill.dir);
|
|
30
|
-
console.log(`Removed ${name}. A rare case of subtraction as progress.`);
|
|
31
|
-
}
|
|
32
|
-
export async function validateSkill(target) {
|
|
33
|
-
const { loadSkill } = await import('../../skills/SkillLoader.js');
|
|
34
|
-
const direct = path.resolve(target);
|
|
35
|
-
const dir = await fs.pathExists(path.join(direct, 'SKILL.md')) ? direct : path.join(GLOBAL_SKILLS_DIR, target);
|
|
36
|
-
const skill = await loadSkill(dir, 'global');
|
|
37
|
-
console.log(skill ? `Valid: ${skill.name}` : 'No SKILL.md found');
|
|
38
|
-
}
|