@denizokcu/haze 1.1.1 → 1.4.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 +78 -0
- package/README.md +26 -15
- package/SECURITY.md +1 -1
- package/bin/haze.js +27 -7
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/inputSuggestions.js +3 -0
- package/dist/cli/chat/liveMessages.d.ts +36 -0
- package/dist/cli/chat/liveMessages.js +64 -0
- package/dist/cli/chat/sessionLifecycle.d.ts +2 -1
- package/dist/cli/chat/sessionLifecycle.js +25 -2
- package/dist/cli/chat/sessionRecorder.d.ts +7 -0
- package/dist/cli/chat/sessionRecorder.js +6 -0
- package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +1 -1
- package/dist/cli/chat/wizard/sessionThemeHandlers.js +16 -1
- package/dist/cli/commands/chat.js +63 -36
- package/dist/cli/commands/commandHelp.js +2 -0
- package/dist/cli/commands/commands.js +2 -0
- package/dist/cli/commands/formatters.js +5 -1
- package/dist/cli/commands/ndjsonSink.d.ts +12 -0
- package/dist/cli/commands/ndjsonSink.js +29 -0
- package/dist/cli/commands/reasoningCommand.d.ts +35 -0
- package/dist/cli/commands/reasoningCommand.js +46 -0
- package/dist/cli/commands/runCommand.d.ts +14 -0
- package/dist/cli/commands/runCommand.js +43 -11
- package/dist/cli/commands/settingsSummary.js +2 -0
- package/dist/cli/commands/streaming/agentAttempt.d.ts +14 -1
- package/dist/cli/commands/streaming/agentAttempt.js +9 -5
- 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 +23 -3
- package/dist/cli/commands/streaming/attemptOutcome.js +64 -11
- package/dist/cli/commands/streaming/attemptSetup.d.ts +13 -3
- package/dist/cli/commands/streaming/attemptSetup.js +40 -15
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +6 -0
- package/dist/cli/commands/streaming/goalCheckpoint.js +1 -0
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +6 -1
- package/dist/cli/commands/streaming/goalSupervisor.js +18 -4
- package/dist/cli/commands/streaming/prepareStep.d.ts +6 -4
- package/dist/cli/commands/streaming/prepareStep.js +43 -22
- package/dist/cli/commands/streaming/stallRecovery.js +2 -2
- package/dist/cli/commands/streaming/streamLoop.d.ts +31 -4
- package/dist/cli/commands/streaming/streamLoop.js +280 -44
- package/dist/cli/commands/streaming/toolPartHandlers.js +13 -0
- package/dist/cli/commands/streaming/turnRuntime.d.ts +1 -1
- package/dist/cli/commands/streaming/turnRuntime.js +3 -2
- package/dist/cli/commands/streaming.d.ts +15 -2
- package/dist/cli/commands/streaming.js +37 -8
- package/dist/cli/commands/wizardFlow.d.ts +7 -0
- package/dist/cli/commands/wizardFlow.js +22 -0
- package/dist/cli/index.js +8 -3
- package/dist/config/modelCatalog.d.ts +32 -0
- package/dist/config/modelCatalog.js +84 -0
- package/dist/config/modelDiscovery.js +68 -5
- package/dist/config/settings.d.ts +18 -6
- package/dist/config/settings.js +11 -1
- package/dist/core/agent/budgets.d.ts +10 -2
- package/dist/core/agent/budgets.js +10 -2
- package/dist/core/agent/compaction.d.ts +42 -3
- package/dist/core/agent/compaction.js +53 -5
- package/dist/core/agent/completionController.d.ts +11 -1
- package/dist/core/agent/completionController.js +33 -0
- package/dist/core/agent/contextBudget.d.ts +56 -0
- package/dist/core/agent/contextBudget.js +53 -0
- package/dist/core/agent/errors.js +2 -2
- package/dist/core/agent/events.d.ts +26 -2
- package/dist/core/agent/goalPolicy.d.ts +7 -0
- package/dist/core/agent/goalPolicy.js +9 -0
- package/dist/core/agent/overflow.d.ts +45 -0
- package/dist/core/agent/overflow.js +91 -0
- package/dist/core/agent/reasoningPolicy.d.ts +45 -9
- package/dist/core/agent/reasoningPolicy.js +49 -9
- package/dist/core/agent/requestAssembly.d.ts +7 -0
- package/dist/core/agent/requestAssembly.js +15 -7
- package/dist/core/agent/toolCapabilities.d.ts +3 -3
- package/dist/core/agent/toolCapabilities.js +31 -7
- package/dist/core/agent/workState.d.ts +6 -4
- package/dist/core/agent/workState.js +53 -29
- package/dist/core/deadline.js +22 -24
- package/dist/core/safety/secretPaths.js +10 -7
- package/dist/core/safety/shellClassifier.d.ts +18 -0
- package/dist/core/safety/shellClassifier.js +39 -0
- package/dist/core/session/sessionSlimming.d.ts +2 -0
- package/dist/core/session/sessionSlimming.js +50 -1
- package/dist/core/session/sessionStore.d.ts +14 -8
- package/dist/core/session/sessionStore.js +59 -32
- 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 +8 -1
- package/dist/core/subagent/subagentRunner.d.ts +4 -0
- package/dist/core/subagent/subagentRunner.js +33 -25
- package/dist/core/tasks/taskStorage.js +8 -1
- package/dist/core/validation/outputParser.d.ts +1 -1
- package/dist/core/validation/outputParser.js +30 -1
- package/dist/llm/client.d.ts +4 -3
- package/dist/llm/client.js +34 -16
- package/dist/llm/hazeTools.d.ts +2039 -16
- package/dist/llm/hazeTools.js +43 -2
- 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/requestContext.d.ts +3 -2
- package/dist/llm/requestContext.js +8 -4
- package/dist/llm/systemPrompt.js +2 -2
- package/dist/llm/tools/fetchTool.d.ts +4 -0
- package/dist/llm/tools/processTool.d.ts +4 -0
- package/dist/llm/tools/replaceInFiles.d.ts +105 -0
- package/dist/llm/tools/replaceInFiles.js +131 -0
- package/dist/llm/tools/shellTool.d.ts +4 -0
- package/dist/llm/tools/shellTool.js +27 -8
- 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 -0
- package/dist/llm/tools/toolContext.js +26 -4
- package/dist/skills/SkillLoader.js +27 -1
- package/dist/ui/components/TextInput.d.ts +18 -1
- package/dist/ui/components/TextInput.js +44 -6
- package/dist/ui/components/useInputSuggestions.js +18 -6
- package/dist/utils/buildInfo.js +29 -8
- package/dist/utils/fs.js +5 -1
- package/package.json +20 -19
package/dist/utils/buildInfo.js
CHANGED
|
@@ -109,24 +109,45 @@ export function resolvePackageRoot(start = MODULE_DIR) {
|
|
|
109
109
|
*/
|
|
110
110
|
export function gitHeadCommit(root) {
|
|
111
111
|
const sha = (value) => (/^[0-9a-f]{7,40}$/i.test((value ?? '').trim()) ? value.trim() : undefined);
|
|
112
|
+
const readFile = (file) => {
|
|
113
|
+
try {
|
|
114
|
+
return readFileSync(file, 'utf8');
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
112
120
|
try {
|
|
113
121
|
const dotGitPath = join(root, '.git');
|
|
114
122
|
const stat = statSync(dotGitPath);
|
|
123
|
+
// `gitdir: <path>` may be relative (resolve against the checkout root) and
|
|
124
|
+
// may contain spaces, so capture to end-of-line rather than \S+ (MR-05).
|
|
115
125
|
const gitDir = stat.isDirectory()
|
|
116
126
|
? dotGitPath
|
|
117
|
-
: /gitdir:\s*(\
|
|
127
|
+
: resolve(root, (/gitdir:\s*(.+?)\s*$/.exec(readFile(dotGitPath) ?? '') ?? [])[1] ?? '');
|
|
118
128
|
if (!gitDir)
|
|
119
129
|
return undefined;
|
|
120
|
-
|
|
130
|
+
// Linked worktrees keep refs in the common Git directory; per-worktree dirs
|
|
131
|
+
// carry only HEAD and private refs. Resolve via `commondir` when present.
|
|
132
|
+
const commonDirRaw = /\s*(.+?)\s*$/.exec(readFile(join(gitDir, 'commondir')) ?? '')?.[1];
|
|
133
|
+
const refDirs = commonDirRaw ? [resolve(gitDir, commonDirRaw)] : [];
|
|
134
|
+
const head = (readFile(join(gitDir, 'HEAD')) ?? '').trim();
|
|
121
135
|
if (!head.startsWith('ref:'))
|
|
122
136
|
return sha(head);
|
|
123
137
|
const ref = head.slice(4).trim();
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
138
|
+
for (const dir of [gitDir, ...refDirs]) {
|
|
139
|
+
const loose = sha(readFile(join(dir, ref)));
|
|
140
|
+
if (loose)
|
|
141
|
+
return loose;
|
|
142
|
+
const packed = readFile(join(dir, 'packed-refs'));
|
|
143
|
+
if (packed) {
|
|
144
|
+
const escaped = ref.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
145
|
+
const packedSha = sha(new RegExp(`^([0-9a-f]{40}) ${escaped}$`, 'm').exec(packed)?.[1]);
|
|
146
|
+
if (packedSha)
|
|
147
|
+
return packedSha;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
130
151
|
}
|
|
131
152
|
catch {
|
|
132
153
|
return undefined;
|
package/dist/utils/fs.js
CHANGED
|
@@ -5,11 +5,15 @@ import path from 'node:path';
|
|
|
5
5
|
// and prevents dependency contents from crowding out workspace source files.
|
|
6
6
|
const SKIP_ENTRIES = new Set(['.git', 'node_modules']);
|
|
7
7
|
export async function walkDir(root, options = {}) {
|
|
8
|
-
const { recursive = false, maxEntries = Infinity,
|
|
8
|
+
const { recursive = false, maxEntries = Infinity, filter, ignoreBatch } = options;
|
|
9
9
|
const result = [];
|
|
10
10
|
// Cursor semantics: the cursor is the last entry a previous page returned.
|
|
11
11
|
// This walk resumes strictly *after* that entry in depth-first traversal
|
|
12
12
|
// order, without re-checking or even descending into earlier subtrees.
|
|
13
|
+
// An empty/whitespace cursor normalizes to absent: callers whose optional
|
|
14
|
+
// pagination field materializes as "" (JSON round-trips, default-filled
|
|
15
|
+
// schemas) must not silently receive an empty first page (RT-01).
|
|
16
|
+
const cursor = typeof options.cursor === 'string' && options.cursor.trim() !== '' ? options.cursor : undefined;
|
|
13
17
|
const cursorSegments = cursor ? cursor.split(/[\\/]/).filter(Boolean) : [];
|
|
14
18
|
let collecting = cursor == null;
|
|
15
19
|
if (!(await fs.pathExists(root)))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@denizokcu/haze",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A minimal LLM harness for your terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,43 +42,44 @@
|
|
|
42
42
|
"lint:knip": "knip",
|
|
43
43
|
"typecheck": "tsc --noEmit",
|
|
44
44
|
"context:report": "node --import tsx src/cli/contextReport.ts",
|
|
45
|
+
"eval": "node scripts/run-evals.mjs",
|
|
45
46
|
"release:verify": "node scripts/verify-release-metadata.mjs",
|
|
46
47
|
"haze": "tsx src/cli/index.ts",
|
|
47
48
|
"prepublishOnly": "npm run typecheck && npm test && npm run lint && npm run build && npm audit --audit-level=high && npm run release:verify"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
|
-
"@ai-sdk/mcp": "^2.0.
|
|
51
|
-
"@ai-sdk/openai": "4.0.
|
|
51
|
+
"@ai-sdk/mcp": "^2.0.56",
|
|
52
|
+
"@ai-sdk/openai": "4.0.73",
|
|
52
53
|
"@vscode/ripgrep": "1.18.0",
|
|
53
|
-
"ai": "7.0.
|
|
54
|
+
"ai": "7.0.112",
|
|
54
55
|
"cli-highlight": "2.1.11",
|
|
55
56
|
"commander": "15.0.0",
|
|
56
|
-
"defuddle": "^0.19.
|
|
57
|
-
"fs-extra": "11.4.
|
|
58
|
-
"ignore": "^7.0.
|
|
57
|
+
"defuddle": "^0.19.4",
|
|
58
|
+
"fs-extra": "11.4.1",
|
|
59
|
+
"ignore": "^7.0.10",
|
|
59
60
|
"ink": "7.1.1",
|
|
60
61
|
"ink-spinner": "5.0.0",
|
|
61
62
|
"linkedom": "^0.18.13",
|
|
62
|
-
"marked": "18.0.
|
|
63
|
-
"react": "19.
|
|
63
|
+
"marked": "18.0.14",
|
|
64
|
+
"react": "19.3.0",
|
|
64
65
|
"strip-ansi": "7.2.0",
|
|
65
66
|
"turndown": "^7.2.4",
|
|
66
|
-
"wrap-ansi": "10.0.
|
|
67
|
-
"yaml": "2.9.
|
|
68
|
-
"zod": "4.
|
|
67
|
+
"wrap-ansi": "10.0.2",
|
|
68
|
+
"yaml": "2.9.1",
|
|
69
|
+
"zod": "4.6.5"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
72
|
"@eslint/js": "^10.0.1",
|
|
72
73
|
"@types/fs-extra": "11.0.4",
|
|
73
|
-
"@types/node": "26.2
|
|
74
|
-
"@types/react": "19.
|
|
75
|
-
"eslint": "^10.
|
|
74
|
+
"@types/node": "26.6.2",
|
|
75
|
+
"@types/react": "19.3.0",
|
|
76
|
+
"eslint": "^10.11.0",
|
|
76
77
|
"ink-testing-library": "^4.0.0",
|
|
77
|
-
"knip": "
|
|
78
|
-
"tsx": "4.23.
|
|
78
|
+
"knip": "6.38.0",
|
|
79
|
+
"tsx": "4.23.15",
|
|
79
80
|
"typescript": "6.0.3",
|
|
80
|
-
"typescript-eslint": "^8.
|
|
81
|
-
"vitest": "^
|
|
81
|
+
"typescript-eslint": "^8.70.1",
|
|
82
|
+
"vitest": "^5.0.1"
|
|
82
83
|
},
|
|
83
84
|
"allowScripts": {
|
|
84
85
|
"fsevents@2.3.3": true,
|