@denizokcu/haze 0.9.0 → 0.11.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 +133 -17
- package/README.md +164 -68
- package/SECURITY.md +22 -0
- package/bin/haze.js +102 -1
- package/dist/buildInfo.json +7 -0
- package/dist/cli/chat/TaskBar.d.ts +2 -1
- package/dist/cli/chat/TaskBar.js +7 -4
- package/dist/cli/chat/chatMetrics.d.ts +17 -1
- package/dist/cli/chat/chatMetrics.js +22 -5
- package/dist/cli/chat/contextReport.d.ts +11 -0
- package/dist/cli/chat/contextReport.js +46 -0
- package/dist/cli/chat/fileMentionSuggestions.d.ts +29 -0
- package/dist/cli/chat/fileMentionSuggestions.js +92 -0
- package/dist/cli/chat/inputSuggestions.d.ts +5 -0
- package/dist/cli/chat/inputSuggestions.js +17 -3
- package/dist/cli/chat/liveRegion.d.ts +25 -0
- package/dist/cli/chat/liveRegion.js +48 -0
- package/dist/cli/chat/messages.d.ts +33 -2
- package/dist/cli/chat/messages.js +216 -33
- package/dist/cli/chat/sessionLifecycle.d.ts +67 -0
- package/dist/cli/chat/sessionLifecycle.js +205 -0
- package/dist/cli/chat/sessionRecorder.js +80 -14
- package/dist/cli/chat/startupInfo.js +11 -4
- package/dist/cli/chat/tips.d.ts +21 -0
- package/dist/cli/chat/tips.js +43 -0
- package/dist/cli/chat/wizardDispatch.d.ts +64 -0
- package/dist/cli/chat/wizardDispatch.js +744 -0
- package/dist/cli/commands/chat.d.ts +6 -0
- package/dist/cli/commands/chat.js +373 -790
- package/dist/cli/commands/chatModes.d.ts +1 -1
- package/dist/cli/commands/chatModes.js +7 -2
- package/dist/cli/commands/commandHelp.js +5 -3
- package/dist/cli/commands/commands.d.ts +5 -2
- package/dist/cli/commands/commands.js +22 -18
- package/dist/cli/commands/doctor.d.ts +19 -0
- package/dist/cli/commands/doctor.js +76 -0
- package/dist/cli/commands/fleetCommand.d.ts +14 -0
- package/dist/cli/commands/fleetCommand.js +46 -0
- package/dist/cli/commands/formatters.d.ts +5 -0
- package/dist/cli/commands/formatters.js +35 -6
- package/dist/cli/commands/logsCommand.js +1 -7
- package/dist/cli/commands/modelCommand.js +1 -1
- package/dist/cli/commands/ndjsonSink.d.ts +23 -0
- package/dist/cli/commands/ndjsonSink.js +38 -0
- package/dist/cli/commands/providerWizard.d.ts +10 -2
- package/dist/cli/commands/providerWizard.js +50 -4
- package/dist/cli/commands/runCommand.d.ts +4 -0
- package/dist/cli/commands/runCommand.js +142 -16
- package/dist/cli/commands/sessionPicker.d.ts +9 -0
- package/dist/cli/commands/sessionPicker.js +29 -0
- package/dist/cli/commands/settingsSummary.js +6 -4
- package/dist/cli/commands/skillConfirmRemove.js +4 -3
- package/dist/cli/commands/skillWizard.d.ts +2 -0
- package/dist/cli/commands/skillWizard.js +16 -6
- package/dist/cli/commands/streaming/abortCause.d.ts +24 -0
- package/dist/cli/commands/streaming/abortCause.js +16 -0
- package/dist/cli/commands/streaming/assistantText.js +9 -2
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +65 -0
- package/dist/cli/commands/streaming/goalCheckpoint.js +23 -0
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +64 -0
- package/dist/cli/commands/streaming/goalSupervisor.js +127 -0
- package/dist/cli/commands/streaming/idleTimer.d.ts +26 -0
- package/dist/cli/commands/streaming/idleTimer.js +24 -0
- package/dist/cli/commands/streaming/toolCallRecovery.d.ts +2 -0
- package/dist/cli/commands/streaming/toolCallRecovery.js +24 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +31 -0
- package/dist/cli/commands/streaming/toolGroupRenderer.js +50 -2
- package/dist/cli/commands/streaming/toolResultState.d.ts +6 -1
- package/dist/cli/commands/streaming/toolResultState.js +29 -7
- package/dist/cli/commands/streaming/turnOutcome.d.ts +17 -0
- package/dist/cli/commands/streaming/turnOutcome.js +27 -11
- package/dist/cli/commands/streaming/turnRuntime.js +6 -4
- package/dist/cli/commands/streaming.d.ts +82 -3
- package/dist/cli/commands/streaming.js +528 -91
- package/dist/cli/commands/wizardActions.d.ts +7 -0
- package/dist/cli/commands/wizardActions.js +7 -0
- package/dist/cli/commands/wizardPrompts.js +7 -1
- package/dist/cli/commands/wizardSuggestions.d.ts +8 -0
- package/dist/cli/commands/wizardSuggestions.js +64 -14
- package/dist/cli/commands/wizardTransition.d.ts +4 -0
- package/dist/cli/commands/wizardTransition.js +1 -2
- package/dist/cli/index.js +82 -22
- package/dist/cli/terminalTitle.d.ts +6 -0
- package/dist/cli/terminalTitle.js +36 -0
- package/dist/config/inputHistory.d.ts +3 -3
- package/dist/config/inputHistory.js +12 -18
- package/dist/config/modelDiscovery.d.ts +71 -0
- package/dist/config/modelDiscovery.js +214 -0
- package/dist/config/privateStorage.js +28 -2
- package/dist/config/providerAuth.d.ts +14 -0
- package/dist/config/providerAuth.js +49 -0
- package/dist/config/providerPresets.d.ts +49 -5
- package/dist/config/providerPresets.js +573 -73
- package/dist/config/providers.d.ts +2 -0
- package/dist/config/providers.js +9 -0
- package/dist/config/settings.d.ts +58 -0
- package/dist/config/settings.js +38 -1
- package/dist/config/skillSettings.d.ts +6 -13
- package/dist/config/skillSettings.js +20 -19
- package/dist/core/agent/budgets.d.ts +36 -0
- package/dist/core/agent/budgets.js +44 -0
- package/dist/core/agent/compaction.d.ts +38 -0
- package/dist/core/agent/compaction.js +108 -19
- package/dist/core/agent/completionController.d.ts +230 -0
- package/dist/core/agent/completionController.js +287 -0
- package/dist/core/agent/contextBudget.d.ts +46 -0
- package/dist/core/agent/contextBudget.js +89 -7
- package/dist/core/agent/errors.js +6 -2
- package/dist/core/agent/events.d.ts +86 -0
- package/dist/core/agent/reasoningPolicy.d.ts +31 -0
- package/dist/core/agent/reasoningPolicy.js +27 -0
- package/dist/core/agent/toolCapabilities.d.ts +27 -0
- package/dist/core/agent/toolCapabilities.js +58 -0
- package/dist/core/agent/toolExecutionBudget.d.ts +35 -0
- package/dist/core/agent/toolExecutionBudget.js +49 -0
- package/dist/core/agent/toolOutputStore.d.ts +13 -0
- package/dist/core/agent/toolOutputStore.js +27 -10
- package/dist/core/agent/toolResults.d.ts +12 -0
- package/dist/core/agent/toolResults.js +38 -0
- package/dist/core/agent/turnBudget.d.ts +35 -0
- package/dist/core/agent/turnBudget.js +27 -0
- package/dist/core/agent/turnPolicy.d.ts +11 -0
- package/dist/core/agent/turnPolicy.js +19 -0
- package/dist/core/agent/workState.d.ts +76 -1
- package/dist/core/agent/workState.js +120 -13
- package/dist/core/attachments/imageAttachments.d.ts +90 -0
- package/dist/core/attachments/imageAttachments.js +245 -0
- package/dist/core/attachments/readBlessings.d.ts +37 -0
- package/dist/core/attachments/readBlessings.js +79 -0
- package/dist/core/deadline.d.ts +33 -0
- package/dist/core/deadline.js +74 -0
- package/dist/core/goal/completionPolicy.d.ts +27 -0
- package/dist/core/goal/completionPolicy.js +37 -1
- package/dist/core/goal/requestClassifier.d.ts +0 -3
- package/dist/core/goal/requestClassifier.js +0 -13
- package/dist/core/io/boundedRead.js +76 -29
- package/dist/core/limits/byteBudgets.d.ts +7 -0
- package/dist/core/limits/byteBudgets.js +7 -0
- package/dist/core/limits/textBudgets.d.ts +25 -0
- package/dist/core/limits/textBudgets.js +25 -0
- package/dist/core/log/llmLog.js +7 -0
- package/dist/core/persistence/orderedFileWriter.d.ts +10 -0
- package/dist/core/persistence/orderedFileWriter.js +16 -2
- package/dist/core/process/backgroundRegistry.d.ts +35 -0
- package/dist/core/process/backgroundRegistry.js +195 -0
- package/dist/core/process/runBoundedProcess.d.ts +9 -0
- package/dist/core/process/runBoundedProcess.js +74 -29
- package/dist/core/safety/missingExecutable.d.ts +42 -0
- package/dist/core/safety/missingExecutable.js +77 -0
- package/dist/core/safety/urlGuard.d.ts +2 -1
- package/dist/core/safety/urlGuard.js +3 -2
- package/dist/core/session/sessionSlimming.js +47 -4
- package/dist/core/session/sessionStore.d.ts +74 -0
- package/dist/core/session/sessionStore.js +268 -18
- package/dist/core/subagent/contracts.d.ts +120 -0
- package/dist/core/subagent/contracts.js +55 -0
- package/dist/core/subagent/executionProfiles.d.ts +28 -0
- package/dist/core/subagent/executionProfiles.js +45 -0
- package/dist/core/subagent/subagentCoordinator.d.ts +78 -0
- package/dist/core/subagent/subagentCoordinator.js +164 -0
- package/dist/core/subagent/subagentRunner.d.ts +211 -145
- package/dist/core/subagent/subagentRunner.js +208 -98
- package/dist/core/subagent/workspaceMutationPolicy.d.ts +11 -0
- package/dist/core/subagent/workspaceMutationPolicy.js +52 -0
- package/dist/core/tasks/taskStorage.js +12 -1
- package/dist/llm/client.d.ts +36 -29
- package/dist/llm/client.js +102 -33
- package/dist/llm/hazeTools.d.ts +2559 -150
- package/dist/llm/hazeTools.js +119 -31
- package/dist/llm/lsp.d.ts +26 -4
- package/dist/llm/lsp.js +90 -14
- package/dist/llm/lspTools.d.ts +2366 -0
- package/dist/llm/lspTools.js +87 -79
- package/dist/llm/openaiCodex.d.ts +3 -0
- package/dist/llm/openaiCodex.js +47 -0
- package/dist/llm/openaiCodexOAuth.d.ts +54 -0
- package/dist/llm/openaiCodexOAuth.js +214 -0
- package/dist/llm/requestContext.d.ts +25 -1
- package/dist/llm/requestContext.js +51 -8
- package/dist/llm/systemPrompt.d.ts +15 -1
- package/dist/llm/systemPrompt.js +24 -8
- package/dist/llm/toolResultTypes.d.ts +8 -1
- package/dist/llm/tools/bashTool.d.ts +906 -32
- package/dist/llm/tools/bashTool.js +30 -4
- package/dist/llm/tools/editMatch.d.ts +14 -0
- package/dist/llm/tools/editMatch.js +72 -0
- package/dist/llm/tools/failures.d.ts +2 -0
- package/dist/llm/tools/failures.js +1 -0
- package/dist/llm/tools/fetchTool.d.ts +42 -26
- package/dist/llm/tools/fetchTool.js +1 -1
- package/dist/llm/tools/fileToolShared.d.ts +6 -4
- package/dist/llm/tools/fileToolShared.js +18 -23
- package/dist/llm/tools/gitIgnore.d.ts +49 -0
- package/dist/llm/tools/gitIgnore.js +129 -0
- package/dist/llm/tools/grepRunner.d.ts +5 -0
- package/dist/llm/tools/grepRunner.js +52 -71
- package/dist/llm/tools/outputCap.d.ts +2 -6
- package/dist/llm/tools/outputCap.js +2 -6
- package/dist/llm/tools/processTool.d.ts +1077 -0
- package/dist/llm/tools/processTool.js +41 -0
- package/dist/llm/tools/readRecovery.d.ts +10 -0
- package/dist/llm/tools/readRecovery.js +135 -0
- package/dist/llm/tools/toolContext.d.ts +9 -1
- package/dist/llm/tools/toolContext.js +83 -43
- package/dist/llm/tools/workspaceFile.d.ts +9 -1
- package/dist/llm/tools/workspaceFile.js +33 -4
- package/dist/llm/webFetch.d.ts +17 -0
- package/dist/llm/webFetch.js +66 -86
- package/dist/llm/workerContext.d.ts +18 -0
- package/dist/llm/workerContext.js +55 -0
- package/dist/skills/SkillLoader.d.ts +2 -2
- package/dist/skills/SkillRegistry.d.ts +3 -2
- package/dist/skills/SkillRegistry.js +43 -13
- package/dist/skills/builder/SkillBuilder.d.ts +3 -0
- package/dist/skills/builder/SkillBuilder.js +23 -5
- package/dist/skills/skillTools.js +11 -4
- package/dist/skills/types.d.ts +6 -1
- package/dist/ui/codeHighlight.d.ts +4 -0
- package/dist/ui/codeHighlight.js +31 -0
- package/dist/ui/components/Header.d.ts +1 -1
- package/dist/ui/components/MarkdownText.d.ts +16 -2
- package/dist/ui/components/MarkdownText.js +244 -34
- package/dist/ui/components/TextInput.d.ts +12 -2
- package/dist/ui/components/TextInput.js +80 -8
- package/dist/ui/theme.d.ts +4 -3
- package/dist/ui/theme.js +5 -4
- package/dist/utils/buildInfo.d.ts +104 -0
- package/dist/utils/buildInfo.js +253 -0
- package/dist/utils/format.d.ts +2 -0
- package/dist/utils/format.js +8 -0
- package/dist/utils/fs.d.ts +9 -1
- package/dist/utils/fs.js +87 -29
- package/dist/utils/openPath.d.ts +2 -0
- package/dist/utils/openPath.js +22 -0
- package/dist/utils/path.d.ts +2 -0
- package/dist/utils/path.js +5 -1
- package/dist/utils/utf8.d.ts +22 -0
- package/dist/utils/utf8.js +54 -0
- package/dist/utils/version.d.ts +9 -3
- package/dist/utils/version.js +28 -2
- package/package.json +24 -19
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { type ModelMessage } from 'ai';
|
|
1
|
+
import { type ModelMessage, type ToolSet } from 'ai';
|
|
2
2
|
import type { LlmLog } from '../../core/log/llmLog.js';
|
|
3
|
+
import { type SubagentOverrides, type TurnExecutionScope } from '../../llm/requestContext.js';
|
|
3
4
|
import { type PromptSession } from '../../llm/systemPrompt.js';
|
|
4
5
|
import type { ContextFile } from '../../config/contextFiles.js';
|
|
5
6
|
import { type AgentEventSink } from '../../core/agent/events.js';
|
|
6
|
-
|
|
7
|
+
import { type ImageAttachment } from '../../core/attachments/imageAttachments.js';
|
|
8
|
+
import { type BlessedPath } from '../../core/attachments/readBlessings.js';
|
|
9
|
+
export { latestRepeatedToolNames, uniqueRepeatedToolNames, toolOnlyStepCount } from '../../core/agent/turnPolicy.js';
|
|
10
|
+
import { type TurnCompletionEvidence } from '../../core/agent/completionController.js';
|
|
11
|
+
export type { TurnCompletionEvidence } from '../../core/agent/completionController.js';
|
|
12
|
+
import { type ValidationOutcome, type WorkTaskProgress } from '../../core/agent/workState.js';
|
|
7
13
|
import type { WorkState } from '../../core/agent/workState.js';
|
|
14
|
+
import { type IncompleteGoalResume } from './streaming/goalCheckpoint.js';
|
|
15
|
+
import { type ToolDisplayDiff } from './streaming/toolGroupRenderer.js';
|
|
8
16
|
import { type TokenUsage } from './streaming/turnRuntime.js';
|
|
9
17
|
export type { TokenUsage } from './streaming/turnRuntime.js';
|
|
10
18
|
export type Message = {
|
|
@@ -17,12 +25,83 @@ export type Message = {
|
|
|
17
25
|
finishedAt?: number;
|
|
18
26
|
tokensPerSecond?: number;
|
|
19
27
|
displayOrder?: number;
|
|
28
|
+
toolCount?: number;
|
|
29
|
+
toolDiffs?: ToolDisplayDiff[];
|
|
20
30
|
};
|
|
21
31
|
export type TurnStatus = 'complete' | 'aborted' | 'failed';
|
|
22
32
|
/** Authoritative outcome of a turn, so callers (esp. headless/CI) need not sniff message text. */
|
|
23
33
|
export interface TurnResult {
|
|
24
34
|
status: TurnStatus;
|
|
35
|
+
/** Bounded, safe completion evidence (no raw commands/output). Additive. */
|
|
36
|
+
evidence?: TurnCompletionEvidence;
|
|
37
|
+
/**
|
|
38
|
+
* The turn paused with recoverable work unfinished; this carries what a
|
|
39
|
+
* one-key/automatic resume needs instead of forcing the user to restate the
|
|
40
|
+
* task. Safe metadata only (reasons, counts, enums) — never commands,
|
|
41
|
+
* content, or credentials.
|
|
42
|
+
*
|
|
43
|
+
* - `model-stream-idle`: the model stream stalled past the idle window and
|
|
44
|
+
* bounded retries could not continue. The conversation keeps completed
|
|
45
|
+
* steps; resume continues the same logical turn's retry pool.
|
|
46
|
+
* - `incomplete-goal`: the attempt ended `recoverable-incomplete` (declared
|
|
47
|
+
* tasks or post-edit validation outstanding) with no same-turn recovery
|
|
48
|
+
* available — including step/tool budget boundaries that finish as
|
|
49
|
+
* `tool-calls`. A goal supervisor (or the interactive R key) continues the
|
|
50
|
+
* logical goal in a fresh physical turn against the preserved
|
|
51
|
+
* conversation; completed mutations are never replayed.
|
|
52
|
+
*/
|
|
53
|
+
resume?: {
|
|
54
|
+
kind: 'model-stream-idle';
|
|
55
|
+
request: string;
|
|
56
|
+
retryAttempt: number;
|
|
57
|
+
} | IncompleteGoalResume;
|
|
25
58
|
}
|
|
59
|
+
/** Supervisor-provided logical-goal context: tags checkpoints and seeds cumulative evidence. */
|
|
60
|
+
export interface TurnGoalContext {
|
|
61
|
+
goalId: string;
|
|
62
|
+
/** 1-based physical-turn counter for the logical goal. */
|
|
63
|
+
cycle: number;
|
|
64
|
+
/** Cumulative evidence carried from earlier physical turns. */
|
|
65
|
+
carried: {
|
|
66
|
+
mutationCount: number;
|
|
67
|
+
validationOutcome: ValidationOutcome;
|
|
68
|
+
taskProgress?: WorkTaskProgress;
|
|
69
|
+
};
|
|
70
|
+
/** Consecutive no-progress physical turns at goal level (diagnostics). */
|
|
71
|
+
noProgressCount: number;
|
|
72
|
+
}
|
|
73
|
+
export interface TurnExecutionOptions {
|
|
74
|
+
ephemeralControl?: string;
|
|
75
|
+
subagentOverrides?: SubagentOverrides;
|
|
76
|
+
/** User-attached images for this turn (F03); only the first attempt carries them. */
|
|
77
|
+
attachments?: readonly ImageAttachment[];
|
|
78
|
+
/** User-mentioned paths whose reads may escape workspace confinement this turn. */
|
|
79
|
+
blessedPaths?: readonly BlessedPath[];
|
|
80
|
+
/** When set, this attempt is a bounded recovery slice (length-continuation, rescue, or goal continuation). */
|
|
81
|
+
recoverySlice?: {
|
|
82
|
+
kind: 'length' | 'rescue' | 'goal';
|
|
83
|
+
maxSteps: number;
|
|
84
|
+
maxToolCalls: number;
|
|
85
|
+
};
|
|
86
|
+
/** Absolute turn deadline in milliseconds (headless `--timeout`); defaults to DEFAULT_TURN_DEADLINE_MS. */
|
|
87
|
+
turnDeadlineMs?: number;
|
|
88
|
+
/** Logical-goal context from the goal supervisor; hydrates cumulative evidence so a fresh physical turn cannot complete while carried work remains. */
|
|
89
|
+
goalContext?: TurnGoalContext;
|
|
90
|
+
/** Shared turn scope (coordinator admission + workspace mutation lease) reused across a logical goal's physical turns. */
|
|
91
|
+
sharedTurnScope?: {
|
|
92
|
+
executionScope?: TurnExecutionScope;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Restrict a tool set to the capabilities permitted in a completion-rescue
|
|
97
|
+
* slice: mutation (edit/write/replace) and validation-capable (bash) built-in
|
|
98
|
+
* tools only. Discovery, read, coordinate, and all third-party (MCP) tools are
|
|
99
|
+
* dropped so the rescue cannot reopen exploration. May return an empty set
|
|
100
|
+
* when no built-in mutation/validation tools exist (only possible if builtins
|
|
101
|
+
* were removed); the caller then forces a tool-free synthesis slice instead
|
|
102
|
+
* of silently keeping the unfiltered tool set (F-08).
|
|
103
|
+
*/
|
|
104
|
+
export declare function restrictToRescueTools(tools: ToolSet): ToolSet;
|
|
26
105
|
export interface StreamCallbacks {
|
|
27
106
|
addMessage: (msg: Message) => void;
|
|
28
107
|
updateMessage: (id: string, update: Partial<Message>) => void;
|
|
@@ -43,4 +122,4 @@ export interface StreamCallbacks {
|
|
|
43
122
|
log?: LlmLog;
|
|
44
123
|
contextFileSignatures?: Map<string, string>;
|
|
45
124
|
}
|
|
46
|
-
export declare function runAgentTurn(value: string, displayValue: string | undefined, contextFiles: ContextFile[], callbacks: StreamCallbacks, retryAttempt?: number, retryingExistingRequest?: boolean, contextOverflowRecovered?: boolean, session?: PromptSession, modelOverride?: string): Promise<TurnResult>;
|
|
125
|
+
export declare function runAgentTurn(value: string, displayValue: string | undefined, contextFiles: ContextFile[], callbacks: StreamCallbacks, retryAttempt?: number, retryingExistingRequest?: boolean, contextOverflowRecovered?: boolean, session?: PromptSession, modelOverride?: string, turnOptions?: TurnExecutionOptions): Promise<TurnResult>;
|