@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.
Files changed (162) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/README.md +101 -24
  3. package/dist/cli/chat/TaskBar.d.ts +9 -0
  4. package/dist/cli/chat/TaskBar.js +40 -0
  5. package/dist/cli/chat/chatMetrics.d.ts +11 -0
  6. package/dist/cli/chat/chatMetrics.js +50 -0
  7. package/dist/cli/chat/inputSuggestions.d.ts +16 -0
  8. package/dist/cli/chat/inputSuggestions.js +55 -0
  9. package/dist/cli/chat/messages.d.ts +9 -0
  10. package/dist/cli/chat/messages.js +76 -0
  11. package/dist/cli/chat/sessionRecorder.d.ts +12 -0
  12. package/dist/cli/chat/sessionRecorder.js +21 -0
  13. package/dist/cli/chat/startupInfo.d.ts +4 -0
  14. package/dist/cli/chat/startupInfo.js +53 -0
  15. package/dist/cli/chat/turnState.d.ts +5 -0
  16. package/dist/cli/chat/turnState.js +20 -0
  17. package/dist/cli/commands/chat.d.ts +0 -1
  18. package/dist/cli/commands/chat.js +519 -495
  19. package/dist/cli/commands/chatModes.d.ts +8 -0
  20. package/dist/cli/commands/chatModes.js +44 -0
  21. package/dist/cli/commands/commandHelp.d.ts +6 -0
  22. package/dist/cli/commands/commandHelp.js +25 -0
  23. package/dist/cli/commands/commands.d.ts +3 -2
  24. package/dist/cli/commands/commands.js +55 -320
  25. package/dist/cli/commands/formatters.d.ts +27 -0
  26. package/dist/cli/commands/formatters.js +149 -4
  27. package/dist/cli/commands/initCommand.d.ts +2 -0
  28. package/dist/cli/commands/initCommand.js +19 -0
  29. package/dist/cli/commands/logsCommand.d.ts +2 -0
  30. package/dist/cli/commands/logsCommand.js +63 -0
  31. package/dist/cli/commands/lspWizard.d.ts +14 -0
  32. package/dist/cli/commands/lspWizard.js +44 -0
  33. package/dist/cli/commands/mcpWizard.d.ts +15 -0
  34. package/dist/cli/commands/mcpWizard.js +69 -0
  35. package/dist/cli/commands/modelCommand.d.ts +2 -0
  36. package/dist/cli/commands/modelCommand.js +36 -0
  37. package/dist/cli/commands/providerWizard.d.ts +30 -0
  38. package/dist/cli/commands/providerWizard.js +114 -0
  39. package/dist/cli/commands/runCommand.d.ts +16 -0
  40. package/dist/cli/commands/runCommand.js +170 -0
  41. package/dist/cli/commands/settingsSummary.d.ts +3 -0
  42. package/dist/cli/commands/settingsSummary.js +40 -0
  43. package/dist/cli/commands/skillConfirmRemove.d.ts +11 -0
  44. package/dist/cli/commands/skillConfirmRemove.js +19 -0
  45. package/dist/cli/commands/skillCreation.d.ts +12 -0
  46. package/dist/cli/commands/skillCreation.js +14 -0
  47. package/dist/cli/commands/skillWizard.d.ts +15 -0
  48. package/dist/cli/commands/skillWizard.js +38 -0
  49. package/dist/cli/commands/streaming/assistantText.d.ts +17 -0
  50. package/dist/cli/commands/streaming/assistantText.js +115 -0
  51. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +55 -0
  52. package/dist/cli/commands/streaming/toolGroupRenderer.js +102 -0
  53. package/dist/cli/commands/streaming/toolResultState.d.ts +13 -0
  54. package/dist/cli/commands/streaming/toolResultState.js +25 -0
  55. package/dist/cli/commands/streaming/turnRuntime.d.ts +78 -0
  56. package/dist/cli/commands/streaming/turnRuntime.js +86 -0
  57. package/dist/cli/commands/streaming.d.ts +10 -29
  58. package/dist/cli/commands/streaming.js +249 -911
  59. package/dist/cli/commands/wizardActions.d.ts +40 -0
  60. package/dist/cli/commands/wizardActions.js +40 -0
  61. package/dist/cli/commands/wizardInput.d.ts +4 -0
  62. package/dist/cli/commands/wizardInput.js +19 -0
  63. package/dist/cli/commands/wizardPrompts.d.ts +22 -0
  64. package/dist/cli/commands/wizardPrompts.js +52 -0
  65. package/dist/cli/commands/wizardSuggestions.d.ts +23 -0
  66. package/dist/cli/commands/wizardSuggestions.js +139 -0
  67. package/dist/cli/index.js +62 -4
  68. package/dist/config/contextFiles.d.ts +8 -1
  69. package/dist/config/contextFiles.js +25 -12
  70. package/dist/config/lspSettings.d.ts +16 -0
  71. package/dist/config/lspSettings.js +95 -0
  72. package/dist/config/mcpSettings.d.ts +24 -0
  73. package/dist/config/mcpSettings.js +100 -0
  74. package/dist/config/providers.js +4 -4
  75. package/dist/config/settings.d.ts +34 -0
  76. package/dist/config/skillSettings.d.ts +15 -0
  77. package/dist/config/skillSettings.js +32 -0
  78. package/dist/config/updateCheck.d.ts +44 -0
  79. package/dist/config/updateCheck.js +83 -0
  80. package/dist/core/agent/budgets.d.ts +6 -0
  81. package/dist/core/agent/budgets.js +6 -0
  82. package/dist/core/agent/compaction.js +1 -1
  83. package/dist/core/agent/requestAssembly.d.ts +0 -7
  84. package/dist/core/agent/requestAssembly.js +27 -5
  85. package/dist/core/agent/toolOutputStore.js +5 -4
  86. package/dist/core/agent/toolResults.d.ts +31 -0
  87. package/dist/core/agent/toolResults.js +42 -0
  88. package/dist/core/agent/turnPolicy.d.ts +8 -0
  89. package/dist/core/agent/turnPolicy.js +23 -0
  90. package/dist/core/agent/workState.d.ts +18 -5
  91. package/dist/core/agent/workState.js +39 -20
  92. package/dist/core/bashOutput/reducers/content.d.ts +1 -0
  93. package/dist/core/bashOutput/reducers/content.js +1 -1
  94. package/dist/core/bashOutput/reducers/gh.d.ts +1 -0
  95. package/dist/core/bashOutput/reducers/gh.js +77 -0
  96. package/dist/core/bashOutput/registry.js +8 -0
  97. package/dist/core/goal/sessionGoal.d.ts +6 -30
  98. package/dist/core/goal/sessionGoal.js +3 -68
  99. package/dist/core/safety/bashClassifier.js +30 -0
  100. package/dist/core/safety/urlGuard.d.ts +1 -0
  101. package/dist/core/safety/urlGuard.js +6 -1
  102. package/dist/core/session/sessionSlimming.d.ts +5 -0
  103. package/dist/core/session/sessionSlimming.js +78 -0
  104. package/dist/core/session/sessionStore.d.ts +23 -3
  105. package/dist/core/session/sessionStore.js +30 -10
  106. package/dist/core/subagent/subagentRunner.d.ts +11 -1
  107. package/dist/core/subagent/subagentRunner.js +1 -0
  108. package/dist/llm/capabilities.d.ts +12 -0
  109. package/dist/llm/capabilities.js +10 -0
  110. package/dist/llm/client.d.ts +1 -0
  111. package/dist/llm/client.js +11 -2
  112. package/dist/llm/hazeTools.d.ts +31 -32
  113. package/dist/llm/hazeTools.js +40 -567
  114. package/dist/llm/lsp.d.ts +109 -0
  115. package/dist/llm/lsp.js +241 -0
  116. package/dist/llm/lspTools.d.ts +104 -0
  117. package/dist/llm/lspTools.js +115 -0
  118. package/dist/llm/mcp.d.ts +19 -0
  119. package/dist/llm/mcp.js +73 -0
  120. package/dist/llm/requestContext.d.ts +28 -0
  121. package/dist/llm/requestContext.js +41 -0
  122. package/dist/llm/systemPrompt.d.ts +5 -1
  123. package/dist/llm/systemPrompt.js +9 -3
  124. package/dist/llm/tools/bashTool.d.ts +5 -0
  125. package/dist/llm/tools/bashTool.js +81 -0
  126. package/dist/llm/tools/editMatch.d.ts +55 -0
  127. package/dist/llm/tools/editMatch.js +99 -0
  128. package/dist/llm/tools/failures.d.ts +36 -0
  129. package/dist/llm/tools/failures.js +38 -0
  130. package/dist/llm/tools/fetchTool.d.ts +65 -0
  131. package/dist/llm/tools/fetchTool.js +45 -0
  132. package/dist/llm/tools/fileToolShared.d.ts +10 -0
  133. package/dist/llm/tools/fileToolShared.js +43 -0
  134. package/dist/llm/tools/grepParse.d.ts +13 -0
  135. package/dist/llm/tools/grepParse.js +67 -0
  136. package/dist/llm/tools/outputCap.d.ts +53 -0
  137. package/dist/llm/tools/outputCap.js +67 -0
  138. package/dist/llm/tools/storedOutputTool.d.ts +10 -0
  139. package/dist/llm/tools/storedOutputTool.js +17 -0
  140. package/dist/llm/tools/taskTool.d.ts +28 -0
  141. package/dist/llm/tools/taskTool.js +41 -0
  142. package/dist/llm/tools/toolContext.d.ts +69 -0
  143. package/dist/llm/tools/toolContext.js +187 -0
  144. package/dist/llm/tools/workspaceFile.d.ts +33 -0
  145. package/dist/llm/tools/workspaceFile.js +27 -0
  146. package/dist/llm/webFetch.d.ts +13 -1
  147. package/dist/llm/webFetch.js +91 -7
  148. package/dist/skills/builder/SkillBuilder.d.ts +3 -0
  149. package/dist/skills/builder/SkillBuilder.js +24 -45
  150. package/dist/ui/components/TextInput.d.ts +1 -1
  151. package/dist/ui/components/TextInput.js +1 -99
  152. package/dist/ui/inputBuffer.d.ts +28 -0
  153. package/dist/ui/inputBuffer.js +99 -0
  154. package/dist/utils/collections.d.ts +6 -0
  155. package/dist/utils/collections.js +9 -0
  156. package/dist/utils/path.d.ts +2 -0
  157. package/dist/utils/path.js +40 -0
  158. package/dist/utils/version.d.ts +20 -0
  159. package/dist/utils/version.js +72 -0
  160. package/package.json +2 -2
  161. package/dist/cli/commands/skills.d.ts +0 -4
  162. 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.5.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,4 +0,0 @@
1
- export declare function listSkills(): Promise<void>;
2
- export declare function infoSkill(name: string): Promise<void>;
3
- export declare function removeSkill(name: string): Promise<void>;
4
- export declare function validateSkill(target: string): Promise<void>;
@@ -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
- }