@denizokcu/haze 1.7.11 → 1.8.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 +56 -0
- package/README.md +142 -102
- package/SECURITY.md +1 -1
- package/assets/graph-grammars/NOTICE.md +21 -0
- package/assets/graph-grammars/tree-sitter-javascript.wasm +0 -0
- package/assets/graph-grammars/tree-sitter-tsx.wasm +0 -0
- package/assets/graph-grammars/tree-sitter-typescript.wasm +0 -0
- package/assets/graph-grammars/web-tree-sitter.cjs +4116 -0
- package/assets/graph-grammars/web-tree-sitter.cjs.map +7 -0
- package/assets/graph-grammars/web-tree-sitter.js +4056 -0
- package/assets/graph-grammars/web-tree-sitter.js.map +7 -0
- package/assets/graph-grammars/web-tree-sitter.wasm +0 -0
- package/assets/graph-grammars/web-tree-sitter.wasm.map +55 -0
- package/bin/haze.js +47 -19
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/BusyBar.d.ts +1 -2
- package/dist/cli/chat/ChatHeader.d.ts +6 -0
- package/dist/cli/chat/ChatHeader.js +11 -0
- package/dist/cli/chat/ChatScreen.d.ts +16 -0
- package/dist/cli/chat/ChatScreen.js +399 -0
- package/dist/cli/chat/ChatScreenView.d.ts +68 -0
- package/dist/cli/chat/ChatScreenView.js +47 -0
- package/dist/cli/chat/LiveTail.d.ts +11 -0
- package/dist/cli/chat/LiveTail.js +26 -0
- package/dist/cli/chat/TaskBar.d.ts +3 -2
- package/dist/cli/chat/TaskBar.js +4 -0
- package/dist/cli/chat/agentTurnRunner.d.ts +12 -0
- package/dist/cli/chat/agentTurnRunner.js +177 -0
- package/dist/cli/chat/busyIndicator.js +9 -5
- package/dist/cli/chat/chatMetrics.d.ts +7 -0
- package/dist/cli/chat/chatMetrics.js +15 -1
- package/dist/cli/chat/chatViewModel.d.ts +85 -0
- package/dist/cli/chat/chatViewModel.js +66 -0
- package/dist/cli/chat/fileMentionSuggestions.d.ts +0 -14
- package/dist/cli/chat/fileMentionSuggestions.js +4 -21
- package/dist/cli/chat/inputSuggestions.js +1 -0
- package/dist/cli/chat/liveTheme.d.ts +11 -0
- package/dist/cli/chat/liveTheme.js +26 -0
- package/dist/cli/chat/messageFinalize.d.ts +4 -0
- package/dist/cli/chat/messageFinalize.js +8 -0
- package/dist/cli/chat/messages.js +1 -1
- package/dist/cli/chat/pickerOpeners.d.ts +23 -0
- package/dist/cli/chat/pickerOpeners.js +36 -0
- package/dist/cli/chat/promptSessionState.d.ts +11 -0
- package/dist/cli/chat/promptSessionState.js +39 -0
- package/dist/cli/chat/renderMetrics.d.ts +8 -0
- package/dist/cli/chat/renderMetrics.js +14 -0
- package/dist/cli/chat/resizeGuard.d.ts +11 -0
- package/dist/cli/chat/resizeGuard.js +25 -0
- package/dist/cli/chat/screenDeps.d.ts +116 -0
- package/dist/cli/chat/screenDeps.js +1 -0
- package/dist/cli/chat/sessionLifecycle.d.ts +2 -0
- package/dist/cli/chat/sessionLifecycle.js +6 -2
- package/dist/cli/chat/sessionRecorder.js +4 -1
- package/dist/cli/chat/settingsSelection.d.ts +33 -0
- package/dist/cli/chat/settingsSelection.js +46 -0
- package/dist/cli/chat/skillNotices.d.ts +18 -0
- package/dist/cli/chat/skillNotices.js +26 -0
- package/dist/cli/chat/startupInfo.js +1 -1
- package/dist/cli/chat/startupSequence.d.ts +2 -0
- package/dist/cli/chat/startupSequence.js +6 -0
- package/dist/cli/chat/submitPipeline.d.ts +8 -0
- package/dist/cli/chat/submitPipeline.js +141 -0
- package/dist/cli/chat/terminalControl.js +1 -1
- package/dist/cli/chat/toolSummaries.d.ts +29 -0
- package/dist/cli/chat/toolSummaries.js +268 -0
- package/dist/cli/chat/turnState.d.ts +8 -0
- package/dist/cli/chat/turnState.js +1 -0
- package/dist/cli/chat/userCommandFlow.d.ts +21 -0
- package/dist/cli/chat/userCommandFlow.js +66 -0
- package/dist/cli/chat/userCommandRunner.d.ts +14 -0
- package/dist/cli/chat/userCommandRunner.js +56 -0
- package/dist/cli/chat/wizard/providerHandlers.js +19 -2
- package/dist/cli/chat/wizardTrail.d.ts +22 -0
- package/dist/cli/chat/wizardTrail.js +55 -0
- package/dist/cli/commands/chat.d.ts +1 -13
- package/dist/cli/commands/chat.js +10 -795
- package/dist/cli/commands/commandHelp.js +11 -6
- package/dist/cli/commands/commandSuggest.d.ts +2 -0
- package/dist/cli/commands/commandSuggest.js +35 -0
- package/dist/cli/commands/commands.js +12 -3
- package/dist/cli/commands/formatters.d.ts +1 -23
- package/dist/cli/commands/formatters.js +3 -224
- package/dist/cli/commands/graphCommand.d.ts +2 -0
- package/dist/cli/commands/graphCommand.js +60 -0
- package/dist/cli/commands/initCommand.js +14 -0
- package/dist/cli/commands/modelCommand.js +11 -7
- package/dist/cli/commands/reasoningCommand.js +3 -3
- package/dist/cli/commands/runCommand.js +6 -2
- package/dist/cli/commands/streaming/agentAttempt.js +11 -1
- package/dist/cli/commands/streaming/attemptLifecycle.js +1 -0
- package/dist/cli/commands/streaming/attemptOutcome.js +8 -3
- package/dist/cli/commands/streaming/attemptSetup.d.ts +4 -0
- package/dist/cli/commands/streaming/attemptSetup.js +34 -5
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +1 -1
- package/dist/cli/commands/streaming/goalSupervisor.js +5 -3
- package/dist/cli/commands/streaming/prepareStep.js +1 -0
- package/dist/cli/commands/streaming/stepProjection.d.ts +59 -0
- package/dist/cli/commands/streaming/stepProjection.js +54 -0
- package/dist/cli/commands/streaming/streamLoop.d.ts +2 -0
- package/dist/cli/commands/streaming/streamLoop.js +34 -23
- package/dist/cli/commands/streaming/toolGroupRenderer.js +1 -1
- package/dist/cli/commands/streaming/toolPartHandlers.js +8 -2
- package/dist/cli/commands/streaming.d.ts +3 -1
- package/dist/cli/commands/streaming.js +5 -0
- package/dist/cli/commands/wizardFlow.d.ts +2 -0
- package/dist/cli/commands/wizardFlow.js +3 -0
- package/dist/cli/index.js +8 -4
- package/dist/cli/terminalTitle.js +9 -3
- package/dist/config/contextFiles.d.ts +2 -5
- package/dist/config/contextFiles.js +1 -1
- package/dist/config/inputHistory.js +2 -2
- package/dist/config/providerAuth.js +2 -2
- package/dist/config/providerModelFacts.js +5 -0
- package/dist/config/providerPresets.js +1 -1
- package/dist/config/settings.d.ts +7 -0
- package/dist/config/settings.js +9 -2
- package/dist/config/updateCheck.js +2 -2
- package/dist/core/agent/compaction.d.ts +1 -0
- package/dist/core/agent/compaction.js +3 -0
- package/dist/core/agent/completionController.d.ts +1 -1
- package/dist/core/agent/contextBudget.d.ts +1 -1
- package/dist/core/agent/goalPolicy.js +8 -2
- package/dist/core/agent/overflow.js +5 -0
- package/dist/core/agent/toolCapabilities.js +14 -0
- package/dist/core/agent/userCommands.d.ts +53 -0
- package/dist/core/agent/userCommands.js +116 -0
- package/dist/core/agent/workState.d.ts +3 -1
- package/dist/core/agent/workState.js +57 -26
- package/dist/core/contextFileTypes.d.ts +12 -0
- package/dist/core/contextFileTypes.js +1 -0
- package/dist/core/graph/analyze.d.ts +61 -0
- package/dist/core/graph/analyze.js +274 -0
- package/dist/core/graph/buildGraph.d.ts +44 -0
- package/dist/core/graph/buildGraph.js +290 -0
- package/dist/core/graph/digest.d.ts +2 -0
- package/dist/core/graph/digest.js +40 -0
- package/dist/core/graph/extract.d.ts +58 -0
- package/dist/core/graph/extract.js +394 -0
- package/dist/core/graph/model.d.ts +63 -0
- package/dist/core/graph/model.js +96 -0
- package/dist/core/graph/query.d.ts +69 -0
- package/dist/core/graph/query.js +391 -0
- package/dist/core/graph/store.d.ts +64 -0
- package/dist/core/graph/store.js +171 -0
- package/dist/core/limits.d.ts +2 -0
- package/dist/core/limits.js +2 -0
- package/dist/core/log/llmLog.js +2 -2
- package/dist/{config → core/persistence}/privateStorage.js +1 -1
- package/dist/core/process/runBoundedProcess.d.ts +7 -4
- package/dist/core/process/runBoundedProcess.js +22 -11
- package/dist/core/safety/redaction.d.ts +2 -0
- package/dist/core/safety/redaction.js +26 -5
- package/dist/core/safety/secretPaths.js +12 -3
- package/dist/core/safety/untrustedEnvelopes.d.ts +6 -0
- package/dist/core/safety/untrustedEnvelopes.js +17 -2
- package/dist/core/safety/urlGuard.js +2 -0
- package/dist/core/session/sessionStore.d.ts +8 -1
- package/dist/core/session/sessionStore.js +15 -4
- package/dist/core/shellOutput/reducers/validation.d.ts +1 -1
- package/dist/core/shellOutput/types.d.ts +1 -1
- package/dist/core/subagent/executionProfiles.js +4 -4
- package/dist/core/tasks/taskStorage.js +11 -1
- package/dist/{llm → core}/toolResultTypes.d.ts +1 -1
- package/dist/core/validation/outputParser.d.ts +1 -1
- package/dist/core/validation/outputParser.js +16 -8
- package/dist/llm/hazeTools.d.ts +2 -12426
- package/dist/llm/hazeTools.js +4 -0
- package/dist/llm/lsp/pool.js +1 -1
- package/dist/llm/lsp/workspaceEdit.d.ts +1 -1
- package/dist/llm/lspTools.d.ts +3 -12622
- package/dist/llm/requestContext.d.ts +6 -0
- package/dist/llm/requestContext.js +28 -7
- package/dist/llm/subagentRunner.d.ts +2 -308
- package/dist/llm/systemPrompt.js +17 -7
- package/dist/llm/toolGroups.d.ts +534 -0
- package/dist/llm/toolGroups.js +57 -0
- package/dist/llm/tools/editMatch.d.ts +1 -1
- package/dist/llm/tools/failures.d.ts +1 -1
- package/dist/llm/tools/fetchTool.d.ts +2 -1221
- package/dist/llm/tools/fileToolShared.d.ts +1 -1
- package/dist/llm/tools/fileToolShared.js +1 -1
- package/dist/llm/tools/fileTools.d.ts +2 -7768
- package/dist/llm/tools/fileTools.js +1 -1
- package/dist/llm/tools/gitTools.d.ts +12 -0
- package/dist/llm/tools/gitTools.js +527 -0
- package/dist/llm/tools/graphAdvisory.d.ts +22 -0
- package/dist/llm/tools/graphAdvisory.js +68 -0
- package/dist/llm/tools/graphTools.d.ts +13 -0
- package/dist/llm/tools/graphTools.js +195 -0
- package/dist/llm/tools/processTool.d.ts +2 -1081
- package/dist/llm/tools/readRecovery.d.ts +1 -1
- package/dist/llm/tools/replaceInFiles.d.ts +1 -1
- package/dist/llm/tools/replaceInFiles.js +1 -1
- package/dist/llm/tools/shellTool.d.ts +2 -1513
- package/dist/llm/tools/storedOutputTool.d.ts +2 -355
- package/dist/llm/tools/taskTool.d.ts +2 -489
- package/dist/llm/tools/taskTool.js +4 -1
- package/dist/llm/tools/toolContext.js +29 -11
- package/dist/llm/tools/toolContextState.d.ts +4 -1
- package/dist/llm/tools/toolContextState.js +2 -1
- package/dist/llm/tools/workspaceFile.d.ts +2 -2
- package/dist/llm/tools/workspaceFile.js +10 -5
- package/dist/skills/SkillRegistry.js +1 -1
- package/dist/skills/builder/SkillBuilder.js +1 -1
- package/dist/skills/plugins/installer.js +1 -1
- package/dist/skills/plugins/runtime.js +1 -1
- package/dist/skills/skillTools.js +4 -1
- package/dist/ui/components/MarkdownText.d.ts +14 -0
- package/dist/ui/components/MarkdownText.js +77 -12
- package/dist/ui/components/NativeIndicators.js +5 -1
- package/dist/ui/components/StreamingMarkdownText.d.ts +3 -1
- package/dist/ui/components/StreamingMarkdownText.js +39 -11
- package/dist/ui/components/TextInput.d.ts +1 -2
- package/dist/ui/components/TextInput.js +79 -9
- package/dist/ui/components/WizardChoices.d.ts +1 -2
- package/dist/ui/components/useInputSuggestions.d.ts +1 -1
- package/dist/ui/components/useInputSuggestions.js +1 -1
- package/dist/ui/mentionDetection.d.ts +20 -0
- package/dist/ui/mentionDetection.js +24 -0
- package/dist/ui/terminalColors.d.ts +4 -4
- package/dist/ui/terminalColors.js +23 -6
- package/dist/ui/terminalSanitize.js +8 -3
- package/dist/ui/textGeometry.d.ts +2 -0
- package/dist/ui/textGeometry.js +6 -0
- package/dist/ui/themes/registry.js +33 -33
- package/dist/utils/openPath.js +7 -0
- package/package.json +22 -19
- /package/dist/{llm/tools → core/ignore}/gitIgnore.d.ts +0 -0
- /package/dist/{llm/tools → core/ignore}/gitIgnore.js +0 -0
- /package/dist/{config → core}/paths.d.ts +0 -0
- /package/dist/{config → core}/paths.js +0 -0
- /package/dist/{config → core/persistence}/privateStorage.d.ts +0 -0
- /package/dist/{llm → core}/toolResultTypes.js +0 -0
|
@@ -1,489 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
title?: string;
|
|
4
|
-
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
5
|
-
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
6
|
-
inputSchema: import("ai").FlexibleSchema<{
|
|
7
|
-
tasks: {
|
|
8
|
-
title: string;
|
|
9
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
10
|
-
}[];
|
|
11
|
-
}>;
|
|
12
|
-
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
13
|
-
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
14
|
-
tasks: {
|
|
15
|
-
title: string;
|
|
16
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
17
|
-
}[];
|
|
18
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
19
|
-
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
20
|
-
onInputDelta?: ((options: {
|
|
21
|
-
inputTextDelta: string;
|
|
22
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
23
|
-
onInputAvailable?: ((options: {
|
|
24
|
-
input: {
|
|
25
|
-
tasks: {
|
|
26
|
-
title: string;
|
|
27
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
28
|
-
}[];
|
|
29
|
-
};
|
|
30
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
31
|
-
toModelOutput?: ((options: {
|
|
32
|
-
toolCallId: string;
|
|
33
|
-
input: {
|
|
34
|
-
tasks: {
|
|
35
|
-
title: string;
|
|
36
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
37
|
-
}[];
|
|
38
|
-
};
|
|
39
|
-
output: NoInfer<{
|
|
40
|
-
ok: boolean;
|
|
41
|
-
error: string;
|
|
42
|
-
} | {
|
|
43
|
-
summary: string;
|
|
44
|
-
counts?: {
|
|
45
|
-
pending: number;
|
|
46
|
-
in_progress: number;
|
|
47
|
-
completed: number;
|
|
48
|
-
} | undefined;
|
|
49
|
-
ok: boolean;
|
|
50
|
-
taskCount: number;
|
|
51
|
-
error?: undefined;
|
|
52
|
-
}>;
|
|
53
|
-
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
54
|
-
} & {
|
|
55
|
-
outputSchema?: import("ai").FlexibleSchema<{
|
|
56
|
-
ok: boolean;
|
|
57
|
-
error: string;
|
|
58
|
-
} | {
|
|
59
|
-
summary: string;
|
|
60
|
-
counts?: {
|
|
61
|
-
pending: number;
|
|
62
|
-
in_progress: number;
|
|
63
|
-
completed: number;
|
|
64
|
-
} | undefined;
|
|
65
|
-
ok: boolean;
|
|
66
|
-
taskCount: number;
|
|
67
|
-
error?: undefined;
|
|
68
|
-
}> | undefined;
|
|
69
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
70
|
-
tasks: {
|
|
71
|
-
title: string;
|
|
72
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
73
|
-
}[];
|
|
74
|
-
}, {
|
|
75
|
-
ok: boolean;
|
|
76
|
-
error: string;
|
|
77
|
-
} | {
|
|
78
|
-
summary: string;
|
|
79
|
-
counts?: {
|
|
80
|
-
pending: number;
|
|
81
|
-
in_progress: number;
|
|
82
|
-
completed: number;
|
|
83
|
-
} | undefined;
|
|
84
|
-
ok: boolean;
|
|
85
|
-
taskCount: number;
|
|
86
|
-
error?: undefined;
|
|
87
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
88
|
-
} & {
|
|
89
|
-
description?: string | ((options: {
|
|
90
|
-
context: NoInfer<import("@ai-sdk/provider-utils").Context>;
|
|
91
|
-
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
92
|
-
}) => string) | undefined;
|
|
93
|
-
strict?: boolean;
|
|
94
|
-
inputExamples?: {
|
|
95
|
-
input: NoInfer<{
|
|
96
|
-
tasks: {
|
|
97
|
-
title: string;
|
|
98
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
99
|
-
}[];
|
|
100
|
-
}>;
|
|
101
|
-
}[] | undefined;
|
|
102
|
-
id?: never;
|
|
103
|
-
isProviderExecuted?: never;
|
|
104
|
-
args?: never;
|
|
105
|
-
supportsDeferredResults?: never;
|
|
106
|
-
} & {
|
|
107
|
-
type?: undefined | "function";
|
|
108
|
-
} & {
|
|
109
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
110
|
-
tasks: {
|
|
111
|
-
title: string;
|
|
112
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
113
|
-
}[];
|
|
114
|
-
}, {
|
|
115
|
-
ok: boolean;
|
|
116
|
-
error: string;
|
|
117
|
-
} | {
|
|
118
|
-
summary: string;
|
|
119
|
-
counts?: {
|
|
120
|
-
pending: number;
|
|
121
|
-
in_progress: number;
|
|
122
|
-
completed: number;
|
|
123
|
-
} | undefined;
|
|
124
|
-
ok: boolean;
|
|
125
|
-
taskCount: number;
|
|
126
|
-
error?: undefined;
|
|
127
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
128
|
-
}) | ({
|
|
129
|
-
deferLoading?: boolean;
|
|
130
|
-
title?: string;
|
|
131
|
-
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
132
|
-
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
133
|
-
inputSchema: import("ai").FlexibleSchema<{
|
|
134
|
-
tasks: {
|
|
135
|
-
title: string;
|
|
136
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
137
|
-
}[];
|
|
138
|
-
}>;
|
|
139
|
-
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
140
|
-
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
141
|
-
tasks: {
|
|
142
|
-
title: string;
|
|
143
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
144
|
-
}[];
|
|
145
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
146
|
-
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
147
|
-
onInputDelta?: ((options: {
|
|
148
|
-
inputTextDelta: string;
|
|
149
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
150
|
-
onInputAvailable?: ((options: {
|
|
151
|
-
input: {
|
|
152
|
-
tasks: {
|
|
153
|
-
title: string;
|
|
154
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
155
|
-
}[];
|
|
156
|
-
};
|
|
157
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
158
|
-
toModelOutput?: ((options: {
|
|
159
|
-
toolCallId: string;
|
|
160
|
-
input: {
|
|
161
|
-
tasks: {
|
|
162
|
-
title: string;
|
|
163
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
164
|
-
}[];
|
|
165
|
-
};
|
|
166
|
-
output: NoInfer<{
|
|
167
|
-
ok: boolean;
|
|
168
|
-
error: string;
|
|
169
|
-
} | {
|
|
170
|
-
summary: string;
|
|
171
|
-
counts?: {
|
|
172
|
-
pending: number;
|
|
173
|
-
in_progress: number;
|
|
174
|
-
completed: number;
|
|
175
|
-
} | undefined;
|
|
176
|
-
ok: boolean;
|
|
177
|
-
taskCount: number;
|
|
178
|
-
error?: undefined;
|
|
179
|
-
}>;
|
|
180
|
-
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
181
|
-
} & {
|
|
182
|
-
outputSchema?: import("ai").FlexibleSchema<{
|
|
183
|
-
ok: boolean;
|
|
184
|
-
error: string;
|
|
185
|
-
} | {
|
|
186
|
-
summary: string;
|
|
187
|
-
counts?: {
|
|
188
|
-
pending: number;
|
|
189
|
-
in_progress: number;
|
|
190
|
-
completed: number;
|
|
191
|
-
} | undefined;
|
|
192
|
-
ok: boolean;
|
|
193
|
-
taskCount: number;
|
|
194
|
-
error?: undefined;
|
|
195
|
-
}> | undefined;
|
|
196
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
197
|
-
tasks: {
|
|
198
|
-
title: string;
|
|
199
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
200
|
-
}[];
|
|
201
|
-
}, {
|
|
202
|
-
ok: boolean;
|
|
203
|
-
error: string;
|
|
204
|
-
} | {
|
|
205
|
-
summary: string;
|
|
206
|
-
counts?: {
|
|
207
|
-
pending: number;
|
|
208
|
-
in_progress: number;
|
|
209
|
-
completed: number;
|
|
210
|
-
} | undefined;
|
|
211
|
-
ok: boolean;
|
|
212
|
-
taskCount: number;
|
|
213
|
-
error?: undefined;
|
|
214
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
215
|
-
} & {
|
|
216
|
-
description?: string | ((options: {
|
|
217
|
-
context: NoInfer<import("@ai-sdk/provider-utils").Context>;
|
|
218
|
-
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
219
|
-
}) => string) | undefined;
|
|
220
|
-
strict?: boolean;
|
|
221
|
-
inputExamples?: {
|
|
222
|
-
input: NoInfer<{
|
|
223
|
-
tasks: {
|
|
224
|
-
title: string;
|
|
225
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
226
|
-
}[];
|
|
227
|
-
}>;
|
|
228
|
-
}[] | undefined;
|
|
229
|
-
id?: never;
|
|
230
|
-
isProviderExecuted?: never;
|
|
231
|
-
args?: never;
|
|
232
|
-
supportsDeferredResults?: never;
|
|
233
|
-
} & {
|
|
234
|
-
type: "dynamic";
|
|
235
|
-
} & {
|
|
236
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
237
|
-
tasks: {
|
|
238
|
-
title: string;
|
|
239
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
240
|
-
}[];
|
|
241
|
-
}, {
|
|
242
|
-
ok: boolean;
|
|
243
|
-
error: string;
|
|
244
|
-
} | {
|
|
245
|
-
summary: string;
|
|
246
|
-
counts?: {
|
|
247
|
-
pending: number;
|
|
248
|
-
in_progress: number;
|
|
249
|
-
completed: number;
|
|
250
|
-
} | undefined;
|
|
251
|
-
ok: boolean;
|
|
252
|
-
taskCount: number;
|
|
253
|
-
error?: undefined;
|
|
254
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
255
|
-
}) | ({
|
|
256
|
-
deferLoading?: boolean;
|
|
257
|
-
title?: string;
|
|
258
|
-
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
259
|
-
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
260
|
-
inputSchema: import("ai").FlexibleSchema<{
|
|
261
|
-
tasks: {
|
|
262
|
-
title: string;
|
|
263
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
264
|
-
}[];
|
|
265
|
-
}>;
|
|
266
|
-
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
267
|
-
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
268
|
-
tasks: {
|
|
269
|
-
title: string;
|
|
270
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
271
|
-
}[];
|
|
272
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
273
|
-
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
274
|
-
onInputDelta?: ((options: {
|
|
275
|
-
inputTextDelta: string;
|
|
276
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
277
|
-
onInputAvailable?: ((options: {
|
|
278
|
-
input: {
|
|
279
|
-
tasks: {
|
|
280
|
-
title: string;
|
|
281
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
282
|
-
}[];
|
|
283
|
-
};
|
|
284
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
285
|
-
toModelOutput?: ((options: {
|
|
286
|
-
toolCallId: string;
|
|
287
|
-
input: {
|
|
288
|
-
tasks: {
|
|
289
|
-
title: string;
|
|
290
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
291
|
-
}[];
|
|
292
|
-
};
|
|
293
|
-
output: NoInfer<{
|
|
294
|
-
ok: boolean;
|
|
295
|
-
error: string;
|
|
296
|
-
} | {
|
|
297
|
-
summary: string;
|
|
298
|
-
counts?: {
|
|
299
|
-
pending: number;
|
|
300
|
-
in_progress: number;
|
|
301
|
-
completed: number;
|
|
302
|
-
} | undefined;
|
|
303
|
-
ok: boolean;
|
|
304
|
-
taskCount: number;
|
|
305
|
-
error?: undefined;
|
|
306
|
-
}>;
|
|
307
|
-
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
308
|
-
} & {
|
|
309
|
-
outputSchema?: import("ai").FlexibleSchema<{
|
|
310
|
-
ok: boolean;
|
|
311
|
-
error: string;
|
|
312
|
-
} | {
|
|
313
|
-
summary: string;
|
|
314
|
-
counts?: {
|
|
315
|
-
pending: number;
|
|
316
|
-
in_progress: number;
|
|
317
|
-
completed: number;
|
|
318
|
-
} | undefined;
|
|
319
|
-
ok: boolean;
|
|
320
|
-
taskCount: number;
|
|
321
|
-
error?: undefined;
|
|
322
|
-
}> | undefined;
|
|
323
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
324
|
-
tasks: {
|
|
325
|
-
title: string;
|
|
326
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
327
|
-
}[];
|
|
328
|
-
}, {
|
|
329
|
-
ok: boolean;
|
|
330
|
-
error: string;
|
|
331
|
-
} | {
|
|
332
|
-
summary: string;
|
|
333
|
-
counts?: {
|
|
334
|
-
pending: number;
|
|
335
|
-
in_progress: number;
|
|
336
|
-
completed: number;
|
|
337
|
-
} | undefined;
|
|
338
|
-
ok: boolean;
|
|
339
|
-
taskCount: number;
|
|
340
|
-
error?: undefined;
|
|
341
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
342
|
-
} & {
|
|
343
|
-
type: "provider";
|
|
344
|
-
id: `${string}.${string}`;
|
|
345
|
-
args: Record<string, unknown>;
|
|
346
|
-
description?: never;
|
|
347
|
-
strict?: never;
|
|
348
|
-
inputExamples?: never;
|
|
349
|
-
} & {
|
|
350
|
-
isProviderExecuted: false;
|
|
351
|
-
supportsDeferredResults?: never;
|
|
352
|
-
} & {
|
|
353
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
354
|
-
tasks: {
|
|
355
|
-
title: string;
|
|
356
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
357
|
-
}[];
|
|
358
|
-
}, {
|
|
359
|
-
ok: boolean;
|
|
360
|
-
error: string;
|
|
361
|
-
} | {
|
|
362
|
-
summary: string;
|
|
363
|
-
counts?: {
|
|
364
|
-
pending: number;
|
|
365
|
-
in_progress: number;
|
|
366
|
-
completed: number;
|
|
367
|
-
} | undefined;
|
|
368
|
-
ok: boolean;
|
|
369
|
-
taskCount: number;
|
|
370
|
-
error?: undefined;
|
|
371
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
372
|
-
}) | ({
|
|
373
|
-
deferLoading?: boolean;
|
|
374
|
-
title?: string;
|
|
375
|
-
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
376
|
-
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
377
|
-
inputSchema: import("ai").FlexibleSchema<{
|
|
378
|
-
tasks: {
|
|
379
|
-
title: string;
|
|
380
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
381
|
-
}[];
|
|
382
|
-
}>;
|
|
383
|
-
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
384
|
-
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
385
|
-
tasks: {
|
|
386
|
-
title: string;
|
|
387
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
388
|
-
}[];
|
|
389
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
390
|
-
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
391
|
-
onInputDelta?: ((options: {
|
|
392
|
-
inputTextDelta: string;
|
|
393
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
394
|
-
onInputAvailable?: ((options: {
|
|
395
|
-
input: {
|
|
396
|
-
tasks: {
|
|
397
|
-
title: string;
|
|
398
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
399
|
-
}[];
|
|
400
|
-
};
|
|
401
|
-
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
402
|
-
toModelOutput?: ((options: {
|
|
403
|
-
toolCallId: string;
|
|
404
|
-
input: {
|
|
405
|
-
tasks: {
|
|
406
|
-
title: string;
|
|
407
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
408
|
-
}[];
|
|
409
|
-
};
|
|
410
|
-
output: NoInfer<{
|
|
411
|
-
ok: boolean;
|
|
412
|
-
error: string;
|
|
413
|
-
} | {
|
|
414
|
-
summary: string;
|
|
415
|
-
counts?: {
|
|
416
|
-
pending: number;
|
|
417
|
-
in_progress: number;
|
|
418
|
-
completed: number;
|
|
419
|
-
} | undefined;
|
|
420
|
-
ok: boolean;
|
|
421
|
-
taskCount: number;
|
|
422
|
-
error?: undefined;
|
|
423
|
-
}>;
|
|
424
|
-
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
425
|
-
} & {
|
|
426
|
-
outputSchema?: import("ai").FlexibleSchema<{
|
|
427
|
-
ok: boolean;
|
|
428
|
-
error: string;
|
|
429
|
-
} | {
|
|
430
|
-
summary: string;
|
|
431
|
-
counts?: {
|
|
432
|
-
pending: number;
|
|
433
|
-
in_progress: number;
|
|
434
|
-
completed: number;
|
|
435
|
-
} | undefined;
|
|
436
|
-
ok: boolean;
|
|
437
|
-
taskCount: number;
|
|
438
|
-
error?: undefined;
|
|
439
|
-
}> | undefined;
|
|
440
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
441
|
-
tasks: {
|
|
442
|
-
title: string;
|
|
443
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
444
|
-
}[];
|
|
445
|
-
}, {
|
|
446
|
-
ok: boolean;
|
|
447
|
-
error: string;
|
|
448
|
-
} | {
|
|
449
|
-
summary: string;
|
|
450
|
-
counts?: {
|
|
451
|
-
pending: number;
|
|
452
|
-
in_progress: number;
|
|
453
|
-
completed: number;
|
|
454
|
-
} | undefined;
|
|
455
|
-
ok: boolean;
|
|
456
|
-
taskCount: number;
|
|
457
|
-
error?: undefined;
|
|
458
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
459
|
-
} & {
|
|
460
|
-
type: "provider";
|
|
461
|
-
id: `${string}.${string}`;
|
|
462
|
-
args: Record<string, unknown>;
|
|
463
|
-
description?: never;
|
|
464
|
-
strict?: never;
|
|
465
|
-
inputExamples?: never;
|
|
466
|
-
} & {
|
|
467
|
-
isProviderExecuted: true;
|
|
468
|
-
supportsDeferredResults?: boolean;
|
|
469
|
-
} & {
|
|
470
|
-
execute: import("ai").ToolExecuteFunction<{
|
|
471
|
-
tasks: {
|
|
472
|
-
title: string;
|
|
473
|
-
status?: "pending" | "in_progress" | "completed" | undefined;
|
|
474
|
-
}[];
|
|
475
|
-
}, {
|
|
476
|
-
ok: boolean;
|
|
477
|
-
error: string;
|
|
478
|
-
} | {
|
|
479
|
-
summary: string;
|
|
480
|
-
counts?: {
|
|
481
|
-
pending: number;
|
|
482
|
-
in_progress: number;
|
|
483
|
-
completed: number;
|
|
484
|
-
} | undefined;
|
|
485
|
-
ok: boolean;
|
|
486
|
-
taskCount: number;
|
|
487
|
-
error?: undefined;
|
|
488
|
-
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
489
|
-
});
|
|
1
|
+
import { type Tool } from 'ai';
|
|
2
|
+
export declare const writeTasksTool: Tool;
|
|
@@ -41,13 +41,16 @@ export const writeTasksTool = tool({
|
|
|
41
41
|
in_progress: tasks.filter(t => t.status === 'in_progress').length,
|
|
42
42
|
completed: tasks.filter(t => t.status === 'completed').length,
|
|
43
43
|
};
|
|
44
|
+
// Open titles let a continuation see which item blocks completion: a bare
|
|
45
|
+
// "1 in progress" count was re-asserted for cycles (observed 2026-11-23).
|
|
46
|
+
const openTitles = tasks.filter(t => t.status !== 'completed').slice(0, 3).map(t => `"${t.title.slice(0, 80)}"`);
|
|
44
47
|
return {
|
|
45
48
|
ok: true,
|
|
46
49
|
taskCount: tasks.length,
|
|
47
50
|
...(tasks.length > 0 ? { counts } : {}),
|
|
48
51
|
summary: tasks.length === 0
|
|
49
52
|
? 'Task list cleared.'
|
|
50
|
-
: `Tasks: ${counts.pending} pending, ${counts.in_progress} in progress, ${counts.completed} completed
|
|
53
|
+
: `Tasks: ${counts.pending} pending, ${counts.in_progress} in progress, ${counts.completed} completed.${openTitles.length ? ` Open: ${openTitles.join(', ')}.` : ''}`,
|
|
51
54
|
};
|
|
52
55
|
},
|
|
53
56
|
});
|
|
@@ -17,7 +17,7 @@ export { hazeContext } from './toolContextState.js';
|
|
|
17
17
|
*/
|
|
18
18
|
export const hazeToolContextSchema = z.custom(isHazeToolContext, 'Invalid haze tool context');
|
|
19
19
|
export function toolsContextFor(tools, context) {
|
|
20
|
-
const hazeToolNames = new Set(['listFiles', 'readFile', 'grep', 'replaceInFiles', 'replaceLines', 'writeFile', 'editFile', 'shell', 'process', 'fetch', 'lspRenameSymbol', 'lspSafeDeleteSymbol']);
|
|
20
|
+
const hazeToolNames = new Set(['listFiles', 'readFile', 'grep', 'replaceInFiles', 'replaceLines', 'writeFile', 'editFile', 'shell', 'process', 'fetch', 'lspRenameSymbol', 'lspSafeDeleteSymbol', 'gitStatus', 'gitLog', 'gitDiff', 'gitBranch', 'gitFetch', 'gitPull', 'gitClone', 'gitStage', 'gitCommit', 'gitBranchManage', 'gitRebase', 'gitReset']);
|
|
21
21
|
return Object.fromEntries(Object.keys(tools).filter(name => hazeToolNames.has(name)).map(name => [name, context]));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -85,20 +85,35 @@ function isMutatingTool(toolName) {
|
|
|
85
85
|
function changedPathsForDiagnostics(toolName, input, result) {
|
|
86
86
|
return changedPathsFromTool(toolName, input, result);
|
|
87
87
|
}
|
|
88
|
-
async function attachPostMutationDiagnostics(toolName, input, result, diagnostics) {
|
|
89
|
-
if (!diagnostics)
|
|
88
|
+
async function attachPostMutationDiagnostics(toolName, input, result, diagnostics, graphAdvisory) {
|
|
89
|
+
if (!diagnostics && !graphAdvisory)
|
|
90
90
|
return result;
|
|
91
91
|
const paths = changedPathsForDiagnostics(toolName, input, result);
|
|
92
92
|
if (paths.length === 0 || !isRecordValue(result))
|
|
93
93
|
return result;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
let enriched = result;
|
|
95
|
+
if (diagnostics) {
|
|
96
|
+
try {
|
|
97
|
+
const lspDiagnostics = await diagnostics(paths);
|
|
98
|
+
if (lspDiagnostics !== undefined)
|
|
99
|
+
enriched = { ...enriched, lspDiagnostics };
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
103
|
+
enriched = { ...enriched, lspDiagnostics: { ok: false, error: `Automatic LSP diagnostics failed: ${message.split('\n')[0]}` } };
|
|
104
|
+
}
|
|
97
105
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
if (graphAdvisory) {
|
|
107
|
+
try {
|
|
108
|
+
const advisory = await graphAdvisory(paths);
|
|
109
|
+
if (advisory !== undefined)
|
|
110
|
+
enriched = { ...enriched, graphAffected: advisory };
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Graph advisories are best-effort orientation; failures stay invisible.
|
|
114
|
+
}
|
|
101
115
|
}
|
|
116
|
+
return enriched;
|
|
102
117
|
}
|
|
103
118
|
function isRecordValue(value) {
|
|
104
119
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -110,7 +125,7 @@ function isReadOnlyFileTool(toolName) {
|
|
|
110
125
|
// turn (no side effects). Shell is deliberately excluded: commands can observe
|
|
111
126
|
// external state changes between identical calls (CR-007).
|
|
112
127
|
function isDeduplicableReadOnlyTool(toolName) {
|
|
113
|
-
return isReadOnlyFileTool(toolName) || toolName === 'fetch';
|
|
128
|
+
return isReadOnlyFileTool(toolName) || toolName === 'fetch' || toolName === 'gitStatus' || toolName === 'gitLog' || toolName === 'gitDiff' || toolName === 'gitBranch';
|
|
114
129
|
}
|
|
115
130
|
function stableJsonStringify(value, seen = new WeakSet()) {
|
|
116
131
|
if (Array.isArray(value))
|
|
@@ -200,6 +215,9 @@ export async function runDedupedTool(toolName, input, context, execute) {
|
|
|
200
215
|
try {
|
|
201
216
|
const result = await promise;
|
|
202
217
|
if (isFailedToolOutput(result)) {
|
|
218
|
+
// Network Git may update refs or files before failing (e.g. conflicts).
|
|
219
|
+
if (['gitFetch', 'gitPull', 'gitClone'].includes(toolName))
|
|
220
|
+
ctx.mutationEpoch += 1;
|
|
203
221
|
if (isMutatingTool(toolName) && mutationPathKey && requiresReadFileRecovery(result)) {
|
|
204
222
|
ctx.failedMutationPaths.add(mutationPathKey);
|
|
205
223
|
const reasonCode = typeof result === 'object' && result != null && 'reasonCode' in result ? result.reasonCode : undefined;
|
|
@@ -219,7 +237,7 @@ export async function runDedupedTool(toolName, input, context, execute) {
|
|
|
219
237
|
}
|
|
220
238
|
}
|
|
221
239
|
ctx.completedToolCalls.set(key, ctx.mutationEpoch);
|
|
222
|
-
return await attachPostMutationDiagnostics(toolName, input, result, ctx.postMutationDiagnostics);
|
|
240
|
+
return await attachPostMutationDiagnostics(toolName, input, result, ctx.postMutationDiagnostics, ctx.postMutationGraph);
|
|
223
241
|
}
|
|
224
242
|
catch (error) {
|
|
225
243
|
if (isMutatingTool(toolName) && mutationPathKey && requiresReadFileRecovery(error)) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ContextFile } from '../../config/contextFiles.js';
|
|
2
|
-
import type { ToolFailureReasonCode } from '
|
|
2
|
+
import type { ToolFailureReasonCode } from '../../core/toolResultTypes.js';
|
|
3
3
|
import type { BlessedPath } from '../../core/attachments/readBlessings.js';
|
|
4
4
|
import type { WorkspaceMutationOwner, WorkspaceMutationPolicy } from '../../core/subagent/workspaceMutationPolicy.js';
|
|
5
|
+
import type { PostMutationGraphAdvisory } from './graphAdvisory.js';
|
|
5
6
|
/**
|
|
6
7
|
* The turn-scoped tool execution state schema and guards, split from
|
|
7
8
|
* `toolContext.ts` so the widely-imported context type stops dragging the
|
|
@@ -34,6 +35,8 @@ export type HazeToolContext = {
|
|
|
34
35
|
blessedPaths?: readonly BlessedPath[];
|
|
35
36
|
/** Runs LSP diagnostics after successful file mutations and embeds them in that tool result. */
|
|
36
37
|
postMutationDiagnostics?: PostMutationDiagnostics;
|
|
38
|
+
/** Attaches reverse-dependency graph advisories (and a staleness note) after successful file mutations. */
|
|
39
|
+
postMutationGraph?: PostMutationGraphAdvisory;
|
|
37
40
|
};
|
|
38
41
|
export declare function isHazeToolContext(value: unknown): value is HazeToolContext;
|
|
39
42
|
export declare function hazeContext(context: ToolExecutionContext): HazeToolContext | undefined;
|
|
@@ -24,7 +24,8 @@ export function isHazeToolContext(value) {
|
|
|
24
24
|
&& validOptional('mutationOwner', field => typeof field === 'symbol')
|
|
25
25
|
&& validOptional('isSubagent', field => typeof field === 'boolean')
|
|
26
26
|
&& validOptional('blessedPaths', field => Array.isArray(field) && field.every(item => isRecord(item) && typeof item.realPath === 'string' && typeof item.isDirectory === 'boolean'))
|
|
27
|
-
&& validOptional('postMutationDiagnostics', field => typeof field === 'function')
|
|
27
|
+
&& validOptional('postMutationDiagnostics', field => typeof field === 'function')
|
|
28
|
+
&& validOptional('postMutationGraph', field => typeof field === 'function');
|
|
28
29
|
}
|
|
29
30
|
export function hazeContext(context) {
|
|
30
31
|
return isHazeToolContext(context.context) ? context.context : undefined;
|
|
@@ -12,7 +12,7 @@ import { type ToolExecutionContext } from './toolContext.js';
|
|
|
12
12
|
export declare function prepareWorkspaceRead(filePath: string, allowIgnored: boolean | undefined, context?: ToolExecutionContext): Promise<string>;
|
|
13
13
|
export declare function prepareWorkspaceMutation(toolName: string, filePath: string, allowIgnored: boolean | undefined, context: ToolExecutionContext): Promise<{
|
|
14
14
|
absolutePath: string;
|
|
15
|
-
scopedContext: import("../../
|
|
15
|
+
scopedContext: import("../../core/contextFileTypes.js").ContextFile[];
|
|
16
16
|
scopedStop: {
|
|
17
17
|
ok: boolean;
|
|
18
18
|
toolName: string;
|
|
@@ -26,7 +26,7 @@ export declare function prepareWorkspaceMutation(toolName: string, filePath: str
|
|
|
26
26
|
}>;
|
|
27
27
|
export declare function prepareWorkspaceWritePath(toolName: string, filePath: string, allowIgnored: boolean | undefined, context: ToolExecutionContext): Promise<{
|
|
28
28
|
absolutePath: string;
|
|
29
|
-
scopedContext: import("../../
|
|
29
|
+
scopedContext: import("../../core/contextFileTypes.js").ContextFile[];
|
|
30
30
|
scopedStop: {
|
|
31
31
|
ok: boolean;
|
|
32
32
|
toolName: string;
|
|
@@ -5,7 +5,7 @@ import { assertRealPathInsideWorkspace, assertWritablePathInsideWorkspace, resol
|
|
|
5
5
|
import { isPathBlessed } from '../../core/attachments/readBlessings.js';
|
|
6
6
|
import { isProtectedSecretPath } from '../../core/safety/secretPaths.js';
|
|
7
7
|
import { assertNotIgnored } from './fileToolShared.js';
|
|
8
|
-
import { resolveGitDirs } from '
|
|
8
|
+
import { resolveGitDirs } from '../../core/ignore/gitIgnore.js';
|
|
9
9
|
import { HazeToolError } from './failures.js';
|
|
10
10
|
import { discoverScopedContext, hazeContext, scopedContextMutationStop } from './toolContext.js';
|
|
11
11
|
/**
|
|
@@ -23,8 +23,12 @@ async function assertNotSecretPath(absolutePath, realPath, inputPath, operation)
|
|
|
23
23
|
const GIT_DIR_NAME = '.git';
|
|
24
24
|
/** Bare-repo directory names (`backup.git/`, `repo.git/`) hold hook-bearing git internals too. */
|
|
25
25
|
const BARE_GIT_DIR_NAME = /\.git$/;
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Basenames inside a git directory that stay refused for reads too; hook
|
|
28
|
+
* execution makes all of `hooks/**` sensitive. `config.lock` holds the config
|
|
29
|
+
* content while git holds the lock, `config.worktree` the per-worktree config (SEC-03).
|
|
30
|
+
*/
|
|
31
|
+
const PROTECTED_GIT_READ_BASENAMES = new Set(['config', 'config.lock', 'config.worktree', 'credentials']);
|
|
28
32
|
function isInsideDirectory(candidate, directory) {
|
|
29
33
|
if (candidate === directory)
|
|
30
34
|
return true;
|
|
@@ -129,9 +133,10 @@ async function assertNotGitInternals(absolutePath, realPath, inputPath, operatio
|
|
|
129
133
|
// Reads: only the credential-bearing and hook entries are refused; other
|
|
130
134
|
// `.git` object reads (e.g. `.git/HEAD`) stay allowed. Submodule gitdirs
|
|
131
135
|
// live under `modules/**`, where config/credentials carry remote URLs at
|
|
132
|
-
// any depth.
|
|
136
|
+
// any depth. Bare repos (`backup.git/`) count as git roots for reads too:
|
|
137
|
+
// their config is reachable through the bless set and carries the same credentials.
|
|
133
138
|
for (const candidate of [absolutePath, realPath]) {
|
|
134
|
-
const root = gitInternalsRoot(candidate, gitDirs);
|
|
139
|
+
const root = gitInternalsRoot(candidate, gitDirs, true);
|
|
135
140
|
if (!root)
|
|
136
141
|
continue;
|
|
137
142
|
const entry = path.relative(root, candidate);
|