@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,25 @@
|
|
|
1
|
+
import { isDuplicateSkippedOutput, toolInputField } from '../../../core/agent/toolResults.js';
|
|
2
|
+
const MUTATING_TOOLS = new Set(['editFile', 'replaceLines', 'writeFile']);
|
|
3
|
+
export function initialToolResultState() {
|
|
4
|
+
return { mutatingToolSucceeded: false, editRecoveryReadSatisfied: false };
|
|
5
|
+
}
|
|
6
|
+
export function applyToolResultState(state, event) {
|
|
7
|
+
const path = toolInputField(event.input, 'path');
|
|
8
|
+
if (!event.ok && MUTATING_TOOLS.has(event.toolName)) {
|
|
9
|
+
return { ...state, editRecoveryPath: path, editRecoveryReadSatisfied: false };
|
|
10
|
+
}
|
|
11
|
+
if (event.ok && event.toolName === 'readFile' && path && path === state.editRecoveryPath && !isDuplicateSkippedOutput(event.output)) {
|
|
12
|
+
return { ...state, editRecoveryReadSatisfied: true };
|
|
13
|
+
}
|
|
14
|
+
if (event.ok && !isDuplicateSkippedOutput(event.output) && MUTATING_TOOLS.has(event.toolName)) {
|
|
15
|
+
return {
|
|
16
|
+
mutatingToolSucceeded: true,
|
|
17
|
+
editRecoveryPath: !path || path === state.editRecoveryPath ? undefined : state.editRecoveryPath,
|
|
18
|
+
editRecoveryReadSatisfied: !path || path === state.editRecoveryPath ? false : state.editRecoveryReadSatisfied,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return state;
|
|
22
|
+
}
|
|
23
|
+
export function isMutatingToolName(toolName) {
|
|
24
|
+
return MUTATING_TOOLS.has(toolName);
|
|
25
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ModelMessage } from 'ai';
|
|
2
|
+
import type { ContextFile } from '../../../config/contextFiles.js';
|
|
3
|
+
export interface TokenUsage {
|
|
4
|
+
inputTokens: number | undefined;
|
|
5
|
+
outputTokens: number | undefined;
|
|
6
|
+
systemPrompt: number;
|
|
7
|
+
messages: number;
|
|
8
|
+
toolSchemas: number;
|
|
9
|
+
outputEstimate: number;
|
|
10
|
+
cacheReadTokens: number;
|
|
11
|
+
cacheWriteTokens: number;
|
|
12
|
+
noCacheTokens: number;
|
|
13
|
+
reasoningTokens: number;
|
|
14
|
+
logicalInputEstimate: number;
|
|
15
|
+
effectiveNonCachedInput: number | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function retryDelayMs(attempt: number): number;
|
|
18
|
+
export declare function abortableDelay(milliseconds: number, signal: AbortSignal): Promise<void>;
|
|
19
|
+
export declare function estimateInputBreakdown(input: {
|
|
20
|
+
system: string;
|
|
21
|
+
contextFiles: ContextFile[];
|
|
22
|
+
messages: ModelMessage[];
|
|
23
|
+
tools?: Record<string, unknown>;
|
|
24
|
+
}): {
|
|
25
|
+
breakdown: import("../../../core/agent/contextBudget.js").ContextBreakdown;
|
|
26
|
+
systemPrompt: number;
|
|
27
|
+
messages: number;
|
|
28
|
+
toolSchemas: number;
|
|
29
|
+
logicalInputEstimate: number;
|
|
30
|
+
};
|
|
31
|
+
export declare function responseCompletionMetrics(text: string, generationStartedAt: number): {
|
|
32
|
+
finishedAt: number;
|
|
33
|
+
tokensPerSecond: number | undefined;
|
|
34
|
+
};
|
|
35
|
+
export declare function extractUsage(event: {
|
|
36
|
+
usage?: {
|
|
37
|
+
inputTokens?: number;
|
|
38
|
+
outputTokens?: number;
|
|
39
|
+
inputTokenDetails?: {
|
|
40
|
+
cacheReadTokens?: number;
|
|
41
|
+
cacheWriteTokens?: number;
|
|
42
|
+
noCacheTokens?: number;
|
|
43
|
+
};
|
|
44
|
+
outputTokenDetails?: {
|
|
45
|
+
reasoningTokens?: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}): {
|
|
49
|
+
inputTokens: number | undefined;
|
|
50
|
+
outputTokens: number | undefined;
|
|
51
|
+
cacheReadTokens: number;
|
|
52
|
+
cacheWriteTokens: number;
|
|
53
|
+
noCacheTokens: number;
|
|
54
|
+
effectiveNonCachedInput: number | undefined;
|
|
55
|
+
reasoningTokens: number;
|
|
56
|
+
};
|
|
57
|
+
export declare function stepCacheMetrics(usage: {
|
|
58
|
+
inputTokens?: number;
|
|
59
|
+
inputTokenDetails?: {
|
|
60
|
+
cacheReadTokens?: number;
|
|
61
|
+
cacheWriteTokens?: number;
|
|
62
|
+
};
|
|
63
|
+
outputTokenDetails?: {
|
|
64
|
+
reasoningTokens?: number;
|
|
65
|
+
};
|
|
66
|
+
} | undefined): {
|
|
67
|
+
inputTokens: number | undefined;
|
|
68
|
+
cacheReadTokens: number;
|
|
69
|
+
cacheWriteTokens: number;
|
|
70
|
+
reasoningTokens: number;
|
|
71
|
+
noCacheTokens: number;
|
|
72
|
+
cacheHitRatio: number | undefined;
|
|
73
|
+
};
|
|
74
|
+
export declare function subagentTokenEstimate(output: unknown): {
|
|
75
|
+
input: number;
|
|
76
|
+
output: number;
|
|
77
|
+
} | undefined;
|
|
78
|
+
export declare function rememberContextFilesFromToolOutput(activeContextFiles: ContextFile[], output: unknown): ContextFile[];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { cacheHitRatio, contextBreakdown, effectiveNonCachedInput, estimateValueTokens } from '../../../core/agent/contextBudget.js';
|
|
2
|
+
export function retryDelayMs(attempt) {
|
|
3
|
+
return Math.min(4000, 1000 * 2 ** attempt);
|
|
4
|
+
}
|
|
5
|
+
export async function abortableDelay(milliseconds, signal) {
|
|
6
|
+
if (signal.aborted)
|
|
7
|
+
return;
|
|
8
|
+
await new Promise(resolve => {
|
|
9
|
+
const timer = setTimeout(resolve, milliseconds);
|
|
10
|
+
signal.addEventListener('abort', () => {
|
|
11
|
+
clearTimeout(timer);
|
|
12
|
+
resolve();
|
|
13
|
+
}, { once: true });
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function estimateInputBreakdown(input) {
|
|
17
|
+
const breakdown = contextBreakdown(input);
|
|
18
|
+
return {
|
|
19
|
+
breakdown,
|
|
20
|
+
systemPrompt: breakdown.system,
|
|
21
|
+
messages: Object.values(breakdown.messagesByRole).reduce((sum, value) => sum + value, 0),
|
|
22
|
+
toolSchemas: breakdown.toolSchemas.reduce((sum, value) => sum + value.tokens, 0),
|
|
23
|
+
logicalInputEstimate: breakdown.logicalInputEstimate,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function responseCompletionMetrics(text, generationStartedAt) {
|
|
27
|
+
const finishedAt = Date.now();
|
|
28
|
+
const elapsedSeconds = Math.max((finishedAt - generationStartedAt) / 1000, 0.001);
|
|
29
|
+
const outputTokens = estimateValueTokens(text);
|
|
30
|
+
return {
|
|
31
|
+
finishedAt,
|
|
32
|
+
tokensPerSecond: outputTokens > 0 ? outputTokens / elapsedSeconds : undefined,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function extractUsage(event) {
|
|
36
|
+
const cacheReadTokens = event.usage?.inputTokenDetails?.cacheReadTokens ?? 0;
|
|
37
|
+
const computedNonCachedInput = effectiveNonCachedInput(event.usage?.inputTokens, cacheReadTokens);
|
|
38
|
+
return {
|
|
39
|
+
inputTokens: event.usage?.inputTokens,
|
|
40
|
+
outputTokens: event.usage?.outputTokens,
|
|
41
|
+
cacheReadTokens,
|
|
42
|
+
cacheWriteTokens: event.usage?.inputTokenDetails?.cacheWriteTokens ?? 0,
|
|
43
|
+
noCacheTokens: event.usage?.inputTokenDetails?.noCacheTokens ?? computedNonCachedInput ?? 0,
|
|
44
|
+
effectiveNonCachedInput: computedNonCachedInput,
|
|
45
|
+
reasoningTokens: event.usage?.outputTokenDetails?.reasoningTokens ?? 0,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function stepCacheMetrics(usage) {
|
|
49
|
+
const inputTokens = usage?.inputTokens;
|
|
50
|
+
const cacheReadTokens = usage?.inputTokenDetails?.cacheReadTokens ?? 0;
|
|
51
|
+
return {
|
|
52
|
+
inputTokens,
|
|
53
|
+
cacheReadTokens,
|
|
54
|
+
cacheWriteTokens: usage?.inputTokenDetails?.cacheWriteTokens ?? 0,
|
|
55
|
+
reasoningTokens: usage?.outputTokenDetails?.reasoningTokens ?? 0,
|
|
56
|
+
noCacheTokens: effectiveNonCachedInput(inputTokens, cacheReadTokens) ?? 0,
|
|
57
|
+
cacheHitRatio: cacheHitRatio(inputTokens, cacheReadTokens || undefined),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function subagentTokenEstimate(output) {
|
|
61
|
+
if (typeof output !== 'object' || output == null || !('tokens' in output))
|
|
62
|
+
return undefined;
|
|
63
|
+
const tokens = output.tokens;
|
|
64
|
+
const input = typeof tokens?.in === 'number' ? tokens.in : 0;
|
|
65
|
+
const outputTokens = typeof tokens?.out === 'number' ? tokens.out : 0;
|
|
66
|
+
return input > 0 || outputTokens > 0 ? { input, output: outputTokens } : undefined;
|
|
67
|
+
}
|
|
68
|
+
export function rememberContextFilesFromToolOutput(activeContextFiles, output) {
|
|
69
|
+
if (typeof output !== 'object' || output == null)
|
|
70
|
+
return activeContextFiles;
|
|
71
|
+
const files = output.applicableProjectInstructions;
|
|
72
|
+
if (!Array.isArray(files))
|
|
73
|
+
return activeContextFiles;
|
|
74
|
+
const seen = new Set(activeContextFiles.map(file => file.path));
|
|
75
|
+
const next = [...activeContextFiles];
|
|
76
|
+
for (const file of files) {
|
|
77
|
+
if (typeof file !== 'object' || file == null)
|
|
78
|
+
continue;
|
|
79
|
+
const candidate = file;
|
|
80
|
+
if (typeof candidate.path !== 'string' || typeof candidate.content !== 'string' || seen.has(candidate.path))
|
|
81
|
+
continue;
|
|
82
|
+
next.push({ path: candidate.path, content: candidate.content });
|
|
83
|
+
seen.add(candidate.path);
|
|
84
|
+
}
|
|
85
|
+
return next;
|
|
86
|
+
}
|
|
@@ -3,7 +3,10 @@ import type { LlmLog } from '../../core/log/llmLog.js';
|
|
|
3
3
|
import { type PromptSession } from '../../llm/systemPrompt.js';
|
|
4
4
|
import type { ContextFile } from '../../config/contextFiles.js';
|
|
5
5
|
import { type AgentEventSink } from '../../core/agent/events.js';
|
|
6
|
-
|
|
6
|
+
export { uniqueRepeatedToolNames, toolOnlyStepCount } from '../../core/agent/turnPolicy.js';
|
|
7
|
+
import type { WorkState } from '../../core/agent/workState.js';
|
|
8
|
+
import { type TokenUsage } from './streaming/turnRuntime.js';
|
|
9
|
+
export type { TokenUsage } from './streaming/turnRuntime.js';
|
|
7
10
|
export type Message = {
|
|
8
11
|
id?: string;
|
|
9
12
|
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
@@ -15,33 +18,10 @@ export type Message = {
|
|
|
15
18
|
tokensPerSecond?: number;
|
|
16
19
|
displayOrder?: number;
|
|
17
20
|
};
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
export interface
|
|
21
|
-
|
|
22
|
-
inputTokens: number | undefined;
|
|
23
|
-
/** Precise output tokens from the provider (undefined if provider doesn't report). */
|
|
24
|
-
outputTokens: number | undefined;
|
|
25
|
-
/** Estimated system prompt tokens. */
|
|
26
|
-
systemPrompt: number;
|
|
27
|
-
/** Estimated message history tokens. */
|
|
28
|
-
messages: number;
|
|
29
|
-
/** Estimated tool schema tokens. */
|
|
30
|
-
toolSchemas: number;
|
|
31
|
-
/** Estimated output tokens (from response messages). */
|
|
32
|
-
outputEstimate: number;
|
|
33
|
-
/** Cached input tokens (if provider reports). */
|
|
34
|
-
cacheReadTokens: number;
|
|
35
|
-
/** Cache write tokens (if provider reports). */
|
|
36
|
-
cacheWriteTokens: number;
|
|
37
|
-
/** Provider-reported input tokens that were not served from cache. */
|
|
38
|
-
noCacheTokens: number;
|
|
39
|
-
/** Reasoning tokens (if provider reports). */
|
|
40
|
-
reasoningTokens: number;
|
|
41
|
-
/** Estimated complete logical request size. */
|
|
42
|
-
logicalInputEstimate: number;
|
|
43
|
-
/** Provider input minus cache reads, when provider usage is available. */
|
|
44
|
-
effectiveNonCachedInput: number | undefined;
|
|
21
|
+
export type TurnStatus = 'complete' | 'aborted' | 'failed';
|
|
22
|
+
/** Authoritative outcome of a turn, so callers (esp. headless/CI) need not sniff message text. */
|
|
23
|
+
export interface TurnResult {
|
|
24
|
+
status: TurnStatus;
|
|
45
25
|
}
|
|
46
26
|
export interface StreamCallbacks {
|
|
47
27
|
addMessage: (msg: Message) => void;
|
|
@@ -61,5 +41,6 @@ export interface StreamCallbacks {
|
|
|
61
41
|
setWorkState?: (state: WorkState) => void;
|
|
62
42
|
onTasksChanged?: () => void;
|
|
63
43
|
log?: LlmLog;
|
|
44
|
+
contextFileSignatures?: Map<string, string>;
|
|
64
45
|
}
|
|
65
|
-
export declare function runAgentTurn(value: string, displayValue: string | undefined, contextFiles: ContextFile[], callbacks: StreamCallbacks, retryAttempt?: number, retryingExistingRequest?: boolean, contextOverflowRecovered?: boolean, session?: PromptSession): Promise<
|
|
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>;
|