erosolar-cli 2.1.172 → 2.1.174
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/README.md +1 -1
- package/agents/erosolar-code.rules.json +2 -2
- package/agents/general.rules.json +21 -3
- package/dist/capabilities/statusCapability.js +2 -2
- package/dist/capabilities/statusCapability.js.map +1 -1
- package/dist/contracts/agent-schemas.json +5 -5
- package/dist/core/agent.d.ts +83 -24
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +499 -248
- package/dist/core/agent.js.map +1 -1
- package/dist/core/preferences.d.ts +1 -0
- package/dist/core/preferences.d.ts.map +1 -1
- package/dist/core/preferences.js +8 -1
- package/dist/core/preferences.js.map +1 -1
- package/dist/core/reliabilityPrompt.d.ts +9 -0
- package/dist/core/reliabilityPrompt.d.ts.map +1 -0
- package/dist/core/reliabilityPrompt.js +31 -0
- package/dist/core/reliabilityPrompt.js.map +1 -0
- package/dist/core/schemaValidator.js +3 -3
- package/dist/core/schemaValidator.js.map +1 -1
- package/dist/core/toolPreconditions.d.ts +0 -11
- package/dist/core/toolPreconditions.d.ts.map +1 -1
- package/dist/core/toolPreconditions.js +33 -164
- package/dist/core/toolPreconditions.js.map +1 -1
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +9 -114
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/updateChecker.d.ts +61 -1
- package/dist/core/updateChecker.d.ts.map +1 -1
- package/dist/core/updateChecker.js +147 -3
- package/dist/core/updateChecker.js.map +1 -1
- package/dist/headless/headlessApp.d.ts.map +1 -1
- package/dist/headless/headlessApp.js +0 -39
- package/dist/headless/headlessApp.js.map +1 -1
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +0 -2
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/providers/openaiResponsesProvider.d.ts.map +1 -1
- package/dist/providers/openaiResponsesProvider.js +79 -74
- package/dist/providers/openaiResponsesProvider.js.map +1 -1
- package/dist/runtime/agentController.d.ts.map +1 -1
- package/dist/runtime/agentController.js +6 -3
- package/dist/runtime/agentController.js.map +1 -1
- package/dist/runtime/agentSession.d.ts +0 -2
- package/dist/runtime/agentSession.d.ts.map +1 -1
- package/dist/runtime/agentSession.js +2 -2
- package/dist/runtime/agentSession.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +11 -18
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +273 -291
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/shellApp.d.ts.map +1 -1
- package/dist/shell/shellApp.js +7 -1
- package/dist/shell/shellApp.js.map +1 -1
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +4 -15
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/subagents/taskRunner.js +2 -1
- package/dist/subagents/taskRunner.js.map +1 -1
- package/dist/tools/bashTools.d.ts.map +1 -1
- package/dist/tools/bashTools.js +101 -8
- package/dist/tools/bashTools.js.map +1 -1
- package/dist/tools/diffUtils.d.ts +8 -2
- package/dist/tools/diffUtils.d.ts.map +1 -1
- package/dist/tools/diffUtils.js +72 -13
- package/dist/tools/diffUtils.js.map +1 -1
- package/dist/tools/grepTools.d.ts.map +1 -1
- package/dist/tools/grepTools.js +10 -2
- package/dist/tools/grepTools.js.map +1 -1
- package/dist/tools/planningTools.d.ts +0 -10
- package/dist/tools/planningTools.d.ts.map +1 -1
- package/dist/tools/planningTools.js +0 -16
- package/dist/tools/planningTools.js.map +1 -1
- package/dist/tools/searchTools.d.ts.map +1 -1
- package/dist/tools/searchTools.js +4 -2
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/ui/PromptController.d.ts +1 -4
- package/dist/ui/PromptController.d.ts.map +1 -1
- package/dist/ui/PromptController.js +1 -7
- package/dist/ui/PromptController.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts +292 -28
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +1513 -121
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/UnifiedUIController.d.ts +81 -0
- package/dist/ui/UnifiedUIController.d.ts.map +1 -0
- package/dist/ui/UnifiedUIController.js +212 -0
- package/dist/ui/UnifiedUIController.js.map +1 -0
- package/dist/ui/UnifiedUIRenderer.d.ts +133 -30
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +939 -370
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/dist/ui/animatedStatus.d.ts +128 -6
- package/dist/ui/animatedStatus.d.ts.map +1 -1
- package/dist/ui/animatedStatus.js +383 -50
- package/dist/ui/animatedStatus.js.map +1 -1
- package/dist/ui/animation/AnimationScheduler.d.ts +192 -0
- package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
- package/dist/ui/animation/AnimationScheduler.js +432 -0
- package/dist/ui/animation/AnimationScheduler.js.map +1 -0
- package/dist/ui/display.d.ts +182 -26
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +678 -97
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/inPlaceUpdater.d.ts +181 -0
- package/dist/ui/inPlaceUpdater.d.ts.map +1 -0
- package/dist/ui/inPlaceUpdater.js +515 -0
- package/dist/ui/inPlaceUpdater.js.map +1 -0
- package/dist/ui/interrupts/InterruptManager.d.ts +142 -0
- package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
- package/dist/ui/interrupts/InterruptManager.js +439 -0
- package/dist/ui/interrupts/InterruptManager.js.map +1 -0
- package/dist/ui/layout.d.ts +0 -1
- package/dist/ui/layout.d.ts.map +1 -1
- package/dist/ui/layout.js +0 -12
- package/dist/ui/layout.js.map +1 -1
- package/dist/ui/orchestration/UIUpdateCoordinator.d.ts +61 -7
- package/dist/ui/orchestration/UIUpdateCoordinator.d.ts.map +1 -1
- package/dist/ui/orchestration/UIUpdateCoordinator.js +232 -20
- package/dist/ui/orchestration/UIUpdateCoordinator.js.map +1 -1
- package/dist/ui/shortcutsHelp.d.ts.map +1 -1
- package/dist/ui/shortcutsHelp.js +0 -1
- package/dist/ui/shortcutsHelp.js.map +1 -1
- package/dist/ui/telemetry/ResponseTracker.d.ts +22 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.js +60 -0
- package/dist/ui/telemetry/ResponseTracker.js.map +1 -0
- package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
- package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
- package/dist/ui/telemetry/UITelemetry.js +446 -0
- package/dist/ui/telemetry/UITelemetry.js.map +1 -0
- package/dist/ui/unified/index.d.ts +30 -1
- package/dist/ui/unified/index.d.ts.map +1 -1
- package/dist/ui/unified/index.js +45 -2
- package/dist/ui/unified/index.js.map +1 -1
- package/dist/ui/unified/layout.d.ts +12 -0
- package/dist/ui/unified/layout.d.ts.map +1 -0
- package/dist/ui/unified/layout.js +96 -0
- package/dist/ui/unified/layout.js.map +1 -0
- package/package.json +2 -3
- package/dist/StringUtils.d.ts +0 -8
- package/dist/StringUtils.d.ts.map +0 -1
- package/dist/StringUtils.js +0 -11
- package/dist/StringUtils.js.map +0 -1
- package/dist/core/aiFlowSupervisor.d.ts +0 -44
- package/dist/core/aiFlowSupervisor.d.ts.map +0 -1
- package/dist/core/aiFlowSupervisor.js +0 -299
- package/dist/core/aiFlowSupervisor.js.map +0 -1
- package/dist/core/cliTestHarness.d.ts +0 -200
- package/dist/core/cliTestHarness.d.ts.map +0 -1
- package/dist/core/cliTestHarness.js +0 -549
- package/dist/core/cliTestHarness.js.map +0 -1
- package/dist/core/testUtils.d.ts +0 -121
- package/dist/core/testUtils.d.ts.map +0 -1
- package/dist/core/testUtils.js +0 -235
- package/dist/core/testUtils.js.map +0 -1
- package/dist/core/toolValidation.d.ts +0 -116
- package/dist/core/toolValidation.d.ts.map +0 -1
- package/dist/core/toolValidation.js +0 -282
- package/dist/core/toolValidation.js.map +0 -1
- package/dist/ui/planOverlay.d.ts +0 -28
- package/dist/ui/planOverlay.d.ts.map +0 -1
- package/dist/ui/planOverlay.js +0 -156
- package/dist/ui/planOverlay.js.map +0 -1
- package/dist/ui/streamingFormatter.d.ts +0 -30
- package/dist/ui/streamingFormatter.d.ts.map +0 -1
- package/dist/ui/streamingFormatter.js +0 -91
- package/dist/ui/streamingFormatter.js.map +0 -1
- package/dist/utils/errorUtils.d.ts +0 -16
- package/dist/utils/errorUtils.d.ts.map +0 -1
- package/dist/utils/errorUtils.js +0 -66
- package/dist/utils/errorUtils.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Unified command-line agent with a single, persistent chat box pinned to the bott
|
|
|
4
4
|
|
|
5
5
|
## Highlights
|
|
6
6
|
- One chat box, always on the bottom during the entire session (idle or streaming).
|
|
7
|
-
- Shared control bar for status,
|
|
7
|
+
- Shared control bar for status, verification/build toggles, and context gauge.
|
|
8
8
|
- Works with OpenAI, Anthropic, Google, xAI, DeepSeek, and local Ollama using the same UI contract.
|
|
9
9
|
- Multi-agent Task tool with built-in general-purpose, explore (read-only), and plan subagents; add custom agents from `.claude/agents`, `~/.claude/agents`, or `--agents` JSON.
|
|
10
10
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"description": "Lean, aggressive coding agent. Act first, ask only when blocked.",
|
|
8
8
|
"globalPrinciples": [
|
|
9
9
|
{
|
|
10
|
-
"id": "core.
|
|
11
|
-
"summary": "
|
|
10
|
+
"id": "core.act_first",
|
|
11
|
+
"summary": "Every response MUST include tool calls. Brief explanation is optional. Text-only responses are not allowed during investigation.",
|
|
12
12
|
"severity": "critical"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"globalPrinciples": [
|
|
9
9
|
{
|
|
10
10
|
"id": "guardrail.clarify_ambiguous",
|
|
11
|
-
"summary": "
|
|
12
|
-
"detail": "
|
|
13
|
-
"severity": "
|
|
11
|
+
"summary": "Only ask for clarification when the request is truly uninterpretable (single words like 'typing' with no context). For requests with reasonable interpretations (like 'find junk code'), act on the most likely interpretation first.",
|
|
12
|
+
"detail": "If a request could mean multiple things but has a reasonable default interpretation, take action. Only ask when you genuinely cannot determine what the user wants. 'Got any junk code to remove?' → search for unused code. 'Fix it' → if context exists, fix it; if not, ask what to fix.",
|
|
13
|
+
"severity": "recommended"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"id": "guardrail.concise_responses",
|
|
@@ -42,11 +42,29 @@
|
|
|
42
42
|
"detail": "Keep tool usage auditable by narrating the intent before running them and summarizing their output afterward.",
|
|
43
43
|
"severity": "required"
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"id": "guardrail.bias_to_action",
|
|
47
|
+
"summary": "CRITICAL: Act first, ask later. When the user makes a request, immediately use tools to investigate and accomplish it. NEVER ask clarifying questions when you can take reasonable action instead.",
|
|
48
|
+
"detail": "For 'find junk code' or 'cleanup': 1) search_files for 'TODO|FIXME|HACK|XXX', 2) grep for unused exports 'export.*(?!.*import)', 3) find empty/stub files, 4) look for commented-out code blocks. For 'fix bug' or 'debug': 1) search for error messages, 2) trace the code path, 3) read relevant files, 4) propose a fix. NEVER respond with just 'What would you like me to do?' when you can investigate.",
|
|
49
|
+
"severity": "critical"
|
|
50
|
+
},
|
|
45
51
|
{
|
|
46
52
|
"id": "guardrail.continuous_execution",
|
|
47
53
|
"summary": "CRITICAL: Continue using tools until the task is complete. Do NOT stop after reading files—immediately proceed to make the requested edits. Do NOT describe what you WILL do—just DO it by calling the appropriate tools. After each tool call, continue with the next step until the task is fully accomplished.",
|
|
48
54
|
"severity": "critical"
|
|
49
55
|
},
|
|
56
|
+
{
|
|
57
|
+
"id": "guardrail.smart_narration",
|
|
58
|
+
"summary": "CRITICAL: Narrate meaningfully. Share key insights and discoveries, not mechanical step descriptions. Say what you FOUND, not what you're DOING.",
|
|
59
|
+
"detail": "Good: 'Found the bug: processInput clears suggestions before Enter is handled (line 234)'. Bad: 'Let me trace processInput... Let me check the suggestions... I see it now, let me look at...'. For complex debugging, provide progress updates on discoveries, not tool invocations.",
|
|
60
|
+
"severity": "critical"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "guardrail.deep_investigation",
|
|
64
|
+
"summary": "For ANY exploratory request, perform thorough multi-step investigation using 5-10+ tool calls. Do NOT stop after 2 tools.",
|
|
65
|
+
"detail": "When exploring: 1) list_files to get overview, 2) search_files for patterns, 3) read_file on suspicious files, 4) grep for related patterns, 5) check imports/exports, 6) look for test files, 7) check for duplicates. Report findings as you discover them. A proper investigation uses MANY tools, not just 1-2.",
|
|
66
|
+
"severity": "critical"
|
|
67
|
+
},
|
|
50
68
|
{
|
|
51
69
|
"id": "guardrail.manual_loop_supervision",
|
|
52
70
|
"summary": "Humans supervise the loop manually—escalate when you lack evidence or stall.",
|
|
@@ -30,8 +30,8 @@ export function createStatusCapability(statusTracker) {
|
|
|
30
30
|
tools: [
|
|
31
31
|
{
|
|
32
32
|
name: 'set_status',
|
|
33
|
-
description: '
|
|
34
|
-
'
|
|
33
|
+
description: 'RARELY NEEDED. Only use for long-running operations. Do NOT use to narrate what you plan to do. ' +
|
|
34
|
+
'Call actual tools (list_files, read_file, search_files) instead of setting status.',
|
|
35
35
|
parameters: {
|
|
36
36
|
type: 'object',
|
|
37
37
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusCapability.js","sourceRoot":"","sources":["../../src/capabilities/statusCapability.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,sBAAsB,CAAC,aAAgC;IACrE,MAAM,UAAU,GAAG,cAAc,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;IAEjD,MAAM,UAAU,GAAG,CAAC,EAAU,EAAQ,EAAE;QACtC,MAAM,QAAQ,GAAG,MAAM,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eAAe,OAAO,EAAE,CAAC;4BAClC,CAAC;yBACF;qBACF;iBACF;gBACD,OAAO;oBACL,UAAU,CAAC,UAAU,CAAC,CAAC;oBACvB,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;gBAC1C,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -470,11 +470,6 @@
|
|
|
470
470
|
"description": "Manage local/air-gapped LLM servers (Ollama, LM Studio, etc.)",
|
|
471
471
|
"category": "configuration"
|
|
472
472
|
},
|
|
473
|
-
{
|
|
474
|
-
"command": "/autocontinue",
|
|
475
|
-
"description": "Toggle auto-continue mode (prompts model when it expresses intent but doesn't act)",
|
|
476
|
-
"category": "configuration"
|
|
477
|
-
},
|
|
478
473
|
{
|
|
479
474
|
"command": "/rewind",
|
|
480
475
|
"description": "Rewind to a previous checkpoint (restore code, conversation, or both)",
|
|
@@ -539,6 +534,11 @@
|
|
|
539
534
|
"command": "/permissions",
|
|
540
535
|
"description": "Configure tool permissions (allow/deny rules)",
|
|
541
536
|
"category": "configuration"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"command": "/update",
|
|
540
|
+
"description": "Check for updates and configure auto-update preference",
|
|
541
|
+
"category": "configuration"
|
|
542
542
|
}
|
|
543
543
|
],
|
|
544
544
|
|
package/dist/core/agent.d.ts
CHANGED
|
@@ -12,16 +12,33 @@ export interface AgentCallbacks {
|
|
|
12
12
|
onContextRecovery?(attempt: number, maxAttempts: number, message: string): void;
|
|
13
13
|
/** Called when agent continues after context recovery - useful for updating UI */
|
|
14
14
|
onContinueAfterRecovery?(): void;
|
|
15
|
-
/** Called when auto-continuing because model expressed intent but didn't act */
|
|
16
|
-
onAutoContinue?(attempt: number, maxAttempts: number, message: string): void;
|
|
17
15
|
/** Called when multi-line paste is detected - displays summary instead of full content */
|
|
18
16
|
onMultilinePaste?(summary: string, metadata: PasteSummary): void;
|
|
19
17
|
/** Called when verification should be triggered for a final response */
|
|
20
18
|
onVerificationNeeded?(response: string, context: VerificationCallbackContext): void;
|
|
21
19
|
/** Called when the operation is cancelled by the user */
|
|
22
20
|
onCancelled?(): void;
|
|
23
|
-
/** Called when
|
|
24
|
-
|
|
21
|
+
/** Called when tool execution starts - useful for updating activity status */
|
|
22
|
+
onToolExecution?(toolName: string, isStart: boolean, args?: Record<string, unknown>): void;
|
|
23
|
+
/**
|
|
24
|
+
* Called IMMEDIATELY when a user request is received, BEFORE any provider call.
|
|
25
|
+
* Useful for updating UI activity without showing filler messages.
|
|
26
|
+
*/
|
|
27
|
+
onRequestReceived?(requestPreview: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Called BEFORE the first tool call in a turn, allowing UI to update activity state.
|
|
30
|
+
* @param toolNames - Names of tools about to be called
|
|
31
|
+
* @param hasModelNarration - Whether the model provided narration/thinking before tools
|
|
32
|
+
* @returns Optional acknowledgement text to display (if model didn't provide narration)
|
|
33
|
+
*/
|
|
34
|
+
onBeforeFirstToolCall?(toolNames: string[], hasModelNarration: boolean): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Called when the agent encounters a transient error and will retry.
|
|
37
|
+
* @param attempt - Current retry attempt number
|
|
38
|
+
* @param maxAttempts - Maximum retry attempts
|
|
39
|
+
* @param error - The error that triggered the retry
|
|
40
|
+
*/
|
|
41
|
+
onRetrying?(attempt: number, maxAttempts: number, error: Error): void;
|
|
25
42
|
}
|
|
26
43
|
export interface VerificationCallbackContext {
|
|
27
44
|
/** Working directory for verification */
|
|
@@ -40,14 +57,9 @@ export interface AssistantMessageMetadata {
|
|
|
40
57
|
contextStats?: Record<string, unknown> | null;
|
|
41
58
|
/** True if content was already displayed via streaming chunks */
|
|
42
59
|
wasStreamed?: boolean;
|
|
60
|
+
/** Hint to UI to suppress rendering of internal/system filler messages */
|
|
61
|
+
suppressDisplay?: boolean;
|
|
43
62
|
}
|
|
44
|
-
export interface StreamFallbackInfo {
|
|
45
|
-
message: string;
|
|
46
|
-
error?: unknown;
|
|
47
|
-
reason?: StreamInterruptionReason;
|
|
48
|
-
partialResponse?: string;
|
|
49
|
-
}
|
|
50
|
-
export type StreamInterruptionReason = 'startup-timeout' | 'idle-timeout';
|
|
51
63
|
interface AgentOptions {
|
|
52
64
|
provider: LLMProvider;
|
|
53
65
|
toolRuntime: IToolRuntime;
|
|
@@ -60,8 +72,6 @@ interface AgentOptions {
|
|
|
60
72
|
modelId?: string;
|
|
61
73
|
/** Working directory for verification */
|
|
62
74
|
workingDirectory?: string;
|
|
63
|
-
/** Enable auto-continuation when model expresses intent but doesn't act (default: false) */
|
|
64
|
-
autoContinue?: boolean;
|
|
65
75
|
}
|
|
66
76
|
export declare class AgentRuntime {
|
|
67
77
|
private readonly messages;
|
|
@@ -75,7 +85,16 @@ export declare class AgentRuntime {
|
|
|
75
85
|
private readonly modelId;
|
|
76
86
|
private readonly workingDirectory;
|
|
77
87
|
private cancellationRequested;
|
|
78
|
-
private
|
|
88
|
+
private lastToolCallSignature;
|
|
89
|
+
private repeatedToolCallCount;
|
|
90
|
+
private static readonly MAX_REPEATED_TOOL_CALLS;
|
|
91
|
+
private recentToolCalls;
|
|
92
|
+
private static readonly TOOL_HISTORY_SIZE;
|
|
93
|
+
private static readonly BEHAVIORAL_LOOP_THRESHOLD;
|
|
94
|
+
private static readonly NON_CACHEABLE_TOOL_NAMES;
|
|
95
|
+
private static readonly LOOP_EXEMPT_TOOL_NAMES;
|
|
96
|
+
private toolResultCache;
|
|
97
|
+
private static readonly TOOL_CACHE_MAX_SIZE;
|
|
79
98
|
constructor(options: AgentOptions);
|
|
80
99
|
/**
|
|
81
100
|
* Request cancellation of the current operation.
|
|
@@ -90,14 +109,6 @@ export declare class AgentRuntime {
|
|
|
90
109
|
* Check if the agent is currently processing a request.
|
|
91
110
|
*/
|
|
92
111
|
isRunning(): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Check if auto-continuation is enabled.
|
|
95
|
-
*/
|
|
96
|
-
isAutoContinueEnabled(): boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Enable or disable auto-continuation.
|
|
99
|
-
*/
|
|
100
|
-
setAutoContinue(enabled: boolean): void;
|
|
101
112
|
send(text: string, useStreaming?: boolean): Promise<string>;
|
|
102
113
|
private processConversation;
|
|
103
114
|
private processConversationStreaming;
|
|
@@ -112,8 +123,8 @@ export declare class AgentRuntime {
|
|
|
112
123
|
private resolveToolCalls;
|
|
113
124
|
private get providerTools();
|
|
114
125
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
126
|
+
* Whether to suppress tool narration in the content field.
|
|
127
|
+
* Previously suppressed for OpenAI but now we show all thinking/narration.
|
|
117
128
|
*/
|
|
118
129
|
private shouldSuppressToolNarration;
|
|
119
130
|
private emitAssistantMessage;
|
|
@@ -122,6 +133,54 @@ export declare class AgentRuntime {
|
|
|
122
133
|
* and response contains verifiable claims (implementation, build success, etc.)
|
|
123
134
|
*/
|
|
124
135
|
private triggerVerificationIfNeeded;
|
|
136
|
+
/**
|
|
137
|
+
* Extract a "command hash" from tool arguments for behavioral loop detection.
|
|
138
|
+
* For execute_bash, this is the actual command. For other tools, key identifying args.
|
|
139
|
+
*/
|
|
140
|
+
private extractCmdHash;
|
|
141
|
+
/**
|
|
142
|
+
* Check for behavioral loops - model calling the same tool with similar args repeatedly.
|
|
143
|
+
* Returns an error message if a loop is detected, null otherwise.
|
|
144
|
+
*
|
|
145
|
+
* FUNDAMENTAL PREVENTION: Cached calls are excluded from loop detection since they
|
|
146
|
+
* don't actually execute (the cache provides the result). This means:
|
|
147
|
+
* - First call: executes and caches result
|
|
148
|
+
* - Second identical call: returns cached result, NOT counted toward loop
|
|
149
|
+
* - Only genuinely NEW (non-cached) repetitive calls trigger loop detection
|
|
150
|
+
*
|
|
151
|
+
* Direct execution tools (bash/edit) are also exempt to avoid short-circuiting
|
|
152
|
+
* legitimate repeated user commands.
|
|
153
|
+
*
|
|
154
|
+
* This catches patterns like:
|
|
155
|
+
* - "git status -sb" called 3 times with DIFFERENT outputs (cache miss each time)
|
|
156
|
+
* - Repeated file reads where file content changed
|
|
157
|
+
* - Repeated searches with same pattern but new results
|
|
158
|
+
*/
|
|
159
|
+
private checkBehavioralLoop;
|
|
160
|
+
/**
|
|
161
|
+
* Reset behavioral loop tracking (called when user provides new input or task completes)
|
|
162
|
+
*/
|
|
163
|
+
private resetBehavioralLoopTracking;
|
|
164
|
+
/**
|
|
165
|
+
* Create a stable cache key for a tool call based on name and arguments
|
|
166
|
+
*/
|
|
167
|
+
private getToolCacheKey;
|
|
168
|
+
/**
|
|
169
|
+
* Only cache tools that are safe to reuse; stateful commands must always execute.
|
|
170
|
+
*/
|
|
171
|
+
private isCacheableTool;
|
|
172
|
+
/**
|
|
173
|
+
* Direct execution tools should not trigger behavioral loop short-circuiting.
|
|
174
|
+
*/
|
|
175
|
+
private shouldSkipLoopDetection;
|
|
176
|
+
/**
|
|
177
|
+
* Get cached result for a tool call, or null if not cached
|
|
178
|
+
*/
|
|
179
|
+
private getCachedToolResult;
|
|
180
|
+
/**
|
|
181
|
+
* Cache a tool result for future identical calls
|
|
182
|
+
*/
|
|
183
|
+
private cacheToolResult;
|
|
125
184
|
getHistory(): ConversationMessage[];
|
|
126
185
|
loadHistory(history: ConversationMessage[]): void;
|
|
127
186
|
clearHistory(): void;
|
package/dist/core/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/core/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAGhB,KAAK,aAAa,EAEnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../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