erosolar-cli 2.1.167 → 2.1.168
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/agents/erosolar-code.rules.json +2 -2
- package/agents/general.rules.json +3 -21
- package/dist/StringUtils.d.ts +8 -0
- package/dist/StringUtils.d.ts.map +1 -0
- package/dist/StringUtils.js +11 -0
- package/dist/StringUtils.js.map +1 -0
- package/dist/capabilities/statusCapability.js +2 -2
- package/dist/capabilities/statusCapability.js.map +1 -1
- package/dist/contracts/agent-schemas.json +0 -5
- package/dist/core/agent.d.ts +11 -72
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +182 -869
- package/dist/core/agent.js.map +1 -1
- package/dist/core/aiFlowSupervisor.d.ts +44 -0
- package/dist/core/aiFlowSupervisor.d.ts.map +1 -0
- package/dist/core/aiFlowSupervisor.js +299 -0
- package/dist/core/aiFlowSupervisor.js.map +1 -0
- package/dist/core/cliTestHarness.d.ts +200 -0
- package/dist/core/cliTestHarness.d.ts.map +1 -0
- package/dist/core/cliTestHarness.js +549 -0
- package/dist/core/cliTestHarness.js.map +1 -0
- package/dist/core/preferences.d.ts +0 -1
- package/dist/core/preferences.d.ts.map +1 -1
- package/dist/core/preferences.js +2 -9
- package/dist/core/preferences.js.map +1 -1
- package/dist/core/schemaValidator.js +3 -3
- package/dist/core/schemaValidator.js.map +1 -1
- package/dist/core/testUtils.d.ts +121 -0
- package/dist/core/testUtils.d.ts.map +1 -0
- package/dist/core/testUtils.js +235 -0
- package/dist/core/testUtils.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts +11 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -1
- package/dist/core/toolPreconditions.js +164 -33
- package/dist/core/toolPreconditions.js.map +1 -1
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +114 -9
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/toolValidation.d.ts +116 -0
- package/dist/core/toolValidation.d.ts.map +1 -0
- package/dist/core/toolValidation.js +282 -0
- package/dist/core/toolValidation.js.map +1 -0
- package/dist/core/updateChecker.d.ts +1 -61
- package/dist/core/updateChecker.d.ts.map +1 -1
- package/dist/core/updateChecker.js +3 -147
- package/dist/core/updateChecker.js.map +1 -1
- package/dist/headless/headlessApp.d.ts.map +1 -1
- package/dist/headless/headlessApp.js +39 -0
- package/dist/headless/headlessApp.js.map +1 -1
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +2 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/providers/openaiResponsesProvider.d.ts.map +1 -1
- package/dist/providers/openaiResponsesProvider.js +74 -79
- package/dist/providers/openaiResponsesProvider.js.map +1 -1
- package/dist/runtime/agentController.d.ts.map +1 -1
- package/dist/runtime/agentController.js +0 -6
- package/dist/runtime/agentController.js.map +1 -1
- package/dist/runtime/agentSession.d.ts.map +1 -1
- package/dist/runtime/agentSession.js +2 -3
- package/dist/runtime/agentSession.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +8 -16
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +159 -388
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +15 -4
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/subagents/taskRunner.js +1 -2
- package/dist/subagents/taskRunner.js.map +1 -1
- package/dist/tools/bashTools.d.ts.map +1 -1
- package/dist/tools/bashTools.js +8 -101
- package/dist/tools/bashTools.js.map +1 -1
- package/dist/tools/diffUtils.d.ts +2 -8
- package/dist/tools/diffUtils.d.ts.map +1 -1
- package/dist/tools/diffUtils.js +13 -72
- package/dist/tools/diffUtils.js.map +1 -1
- package/dist/tools/grepTools.d.ts.map +1 -1
- package/dist/tools/grepTools.js +2 -10
- package/dist/tools/grepTools.js.map +1 -1
- package/dist/tools/searchTools.d.ts.map +1 -1
- package/dist/tools/searchTools.js +2 -4
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/ui/PromptController.d.ts +0 -2
- package/dist/ui/PromptController.d.ts.map +1 -1
- package/dist/ui/PromptController.js +0 -2
- package/dist/ui/PromptController.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts +18 -71
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +139 -237
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/UnifiedUIController.d.ts +1 -0
- package/dist/ui/UnifiedUIController.d.ts.map +1 -1
- package/dist/ui/UnifiedUIController.js +1 -0
- package/dist/ui/UnifiedUIController.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +5 -122
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +125 -830
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/dist/ui/compactRenderer.d.ts +139 -0
- package/dist/ui/compactRenderer.d.ts.map +1 -0
- package/dist/ui/compactRenderer.js +398 -0
- package/dist/ui/compactRenderer.js.map +1 -0
- package/dist/ui/display.d.ts +48 -13
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +105 -22
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/streamingFormatter.d.ts +30 -0
- package/dist/ui/streamingFormatter.d.ts.map +1 -0
- package/dist/ui/streamingFormatter.js +91 -0
- package/dist/ui/streamingFormatter.js.map +1 -0
- package/dist/ui/unified/index.d.ts +1 -1
- package/dist/ui/unified/index.d.ts.map +1 -1
- package/dist/ui/unified/index.js +2 -0
- package/dist/ui/unified/index.js.map +1 -1
- package/dist/utils/errorUtils.d.ts +16 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +66 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/package.json +2 -1
- package/dist/core/reliabilityPrompt.d.ts +0 -9
- package/dist/core/reliabilityPrompt.d.ts.map +0 -1
- package/dist/core/reliabilityPrompt.js +0 -31
- package/dist/core/reliabilityPrompt.js.map +0 -1
- package/dist/ui/animatedStatus.d.ts +0 -129
- package/dist/ui/animatedStatus.d.ts.map +0 -1
- package/dist/ui/animatedStatus.js +0 -384
- package/dist/ui/animatedStatus.js.map +0 -1
|
@@ -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",
|
|
11
|
+
"summary": "ACT by default. Execute tools immediately. Only ask if genuinely blocked or request is unsafe.",
|
|
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": "CRITICAL: If user request is vague, single-word, or ambiguous (e.g., 'typing', 'fix it', 'help'), ASK for clarification FIRST. Do NOT explore or guess.",
|
|
12
|
+
"detail": "Respond with: 'Could you clarify what you mean by [X]? For example: [option A], [option B], or [option C]?' Only proceed after clarification.",
|
|
13
|
+
"severity": "critical"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"id": "guardrail.concise_responses",
|
|
@@ -42,29 +42,11 @@
|
|
|
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
|
-
},
|
|
51
45
|
{
|
|
52
46
|
"id": "guardrail.continuous_execution",
|
|
53
47
|
"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.",
|
|
54
48
|
"severity": "critical"
|
|
55
49
|
},
|
|
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
|
-
},
|
|
68
50
|
{
|
|
69
51
|
"id": "guardrail.manual_loop_supervision",
|
|
70
52
|
"summary": "Humans supervise the loop manually—escalate when you lack evidence or stall.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringUtils.d.ts","sourceRoot":"","sources":["../src/StringUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,GAAI,OAAO,GAAG,KAAG,GAGxC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringUtils.js","sourceRoot":"","sources":["../src/StringUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAU,EAAO,EAAE;IAC7C,qBAAqB;IACrB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -30,8 +30,8 @@ export function createStatusCapability(statusTracker) {
|
|
|
30
30
|
tools: [
|
|
31
31
|
{
|
|
32
32
|
name: 'set_status',
|
|
33
|
-
description: '
|
|
34
|
-
'
|
|
33
|
+
description: 'Update the live status bar with a short, present-tense note about what you are doing. ' +
|
|
34
|
+
'Use an empty message to clear it.',
|
|
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,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,QAAQ,EAAE,CAAC;YACb,YAAY,CAAC,QAAQ,CAAC,CAAC;YACvB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,KAAc,EAA8B,EAAE;QACnE,IAAI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
|
|
539
539
|
"command": "/permissions",
|
|
540
540
|
"description": "Configure tool permissions (allow/deny rules)",
|
|
541
541
|
"category": "configuration"
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
"command": "/update",
|
|
545
|
-
"description": "Check for updates and configure auto-update preference",
|
|
546
|
-
"category": "configuration"
|
|
547
542
|
}
|
|
548
543
|
],
|
|
549
544
|
|
package/dist/core/agent.d.ts
CHANGED
|
@@ -20,28 +20,8 @@ export interface AgentCallbacks {
|
|
|
20
20
|
onVerificationNeeded?(response: string, context: VerificationCallbackContext): void;
|
|
21
21
|
/** Called when the operation is cancelled by the user */
|
|
22
22
|
onCancelled?(): void;
|
|
23
|
-
/** Called when
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Called IMMEDIATELY when a user request is received, BEFORE any provider call.
|
|
27
|
-
* This is the FIRST callback fired and guarantees immediate user feedback.
|
|
28
|
-
* @param requestPreview - A short preview of the user's request
|
|
29
|
-
*/
|
|
30
|
-
onRequestReceived?(requestPreview: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* Called BEFORE the first tool call in a turn, allowing UI to inject acknowledgement.
|
|
33
|
-
* @param toolNames - Names of tools about to be called
|
|
34
|
-
* @param hasModelNarration - Whether the model provided narration/thinking before tools
|
|
35
|
-
* @returns Optional acknowledgement text to display (if model didn't provide narration)
|
|
36
|
-
*/
|
|
37
|
-
onBeforeFirstToolCall?(toolNames: string[], hasModelNarration: boolean): string | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Called when the agent encounters a transient error and will retry.
|
|
40
|
-
* @param attempt - Current retry attempt number
|
|
41
|
-
* @param maxAttempts - Maximum retry attempts
|
|
42
|
-
* @param error - The error that triggered the retry
|
|
43
|
-
*/
|
|
44
|
-
onRetrying?(attempt: number, maxAttempts: number, error: Error): void;
|
|
23
|
+
/** Called when streaming fails and we fall back to non-streaming generation */
|
|
24
|
+
onStreamFallback?(info: StreamFallbackInfo): void;
|
|
45
25
|
}
|
|
46
26
|
export interface VerificationCallbackContext {
|
|
47
27
|
/** Working directory for verification */
|
|
@@ -60,9 +40,14 @@ export interface AssistantMessageMetadata {
|
|
|
60
40
|
contextStats?: Record<string, unknown> | null;
|
|
61
41
|
/** True if content was already displayed via streaming chunks */
|
|
62
42
|
wasStreamed?: boolean;
|
|
63
|
-
/** Hint to UI to suppress rendering of this assistant message (e.g., auto-continue filler) */
|
|
64
|
-
suppressDisplay?: boolean;
|
|
65
43
|
}
|
|
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';
|
|
66
51
|
interface AgentOptions {
|
|
67
52
|
provider: LLMProvider;
|
|
68
53
|
toolRuntime: IToolRuntime;
|
|
@@ -91,15 +76,6 @@ export declare class AgentRuntime {
|
|
|
91
76
|
private readonly workingDirectory;
|
|
92
77
|
private cancellationRequested;
|
|
93
78
|
private _autoContinueEnabled;
|
|
94
|
-
private lastToolCallSignature;
|
|
95
|
-
private repeatedToolCallCount;
|
|
96
|
-
private static readonly MAX_REPEATED_TOOL_CALLS;
|
|
97
|
-
private recentToolCalls;
|
|
98
|
-
private static readonly TOOL_HISTORY_SIZE;
|
|
99
|
-
private static readonly BEHAVIORAL_LOOP_THRESHOLD;
|
|
100
|
-
private toolResultCache;
|
|
101
|
-
private static readonly TOOL_CACHE_MAX_SIZE;
|
|
102
|
-
private firstToolCallFired;
|
|
103
79
|
constructor(options: AgentOptions);
|
|
104
80
|
/**
|
|
105
81
|
* Request cancellation of the current operation.
|
|
@@ -136,8 +112,8 @@ export declare class AgentRuntime {
|
|
|
136
112
|
private resolveToolCalls;
|
|
137
113
|
private get providerTools();
|
|
138
114
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
115
|
+
* OpenAI models frequently add speculative tool narration in the content field.
|
|
116
|
+
* Suppress that text to avoid surfacing hallucinated tool usage in the UI.
|
|
141
117
|
*/
|
|
142
118
|
private shouldSuppressToolNarration;
|
|
143
119
|
private emitAssistantMessage;
|
|
@@ -146,43 +122,6 @@ export declare class AgentRuntime {
|
|
|
146
122
|
* and response contains verifiable claims (implementation, build success, etc.)
|
|
147
123
|
*/
|
|
148
124
|
private triggerVerificationIfNeeded;
|
|
149
|
-
/**
|
|
150
|
-
* Extract a "command hash" from tool arguments for behavioral loop detection.
|
|
151
|
-
* For execute_bash, this is the actual command. For other tools, key identifying args.
|
|
152
|
-
*/
|
|
153
|
-
private extractCmdHash;
|
|
154
|
-
/**
|
|
155
|
-
* Check for behavioral loops - model calling the same tool with similar args repeatedly.
|
|
156
|
-
* Returns an error message if a loop is detected, null otherwise.
|
|
157
|
-
*
|
|
158
|
-
* FUNDAMENTAL PREVENTION: Cached calls are excluded from loop detection since they
|
|
159
|
-
* don't actually execute (the cache provides the result). This means:
|
|
160
|
-
* - First call: executes and caches result
|
|
161
|
-
* - Second identical call: returns cached result, NOT counted toward loop
|
|
162
|
-
* - Only genuinely NEW (non-cached) repetitive calls trigger loop detection
|
|
163
|
-
*
|
|
164
|
-
* This catches patterns like:
|
|
165
|
-
* - "git status -sb" called 3 times with DIFFERENT outputs (cache miss each time)
|
|
166
|
-
* - Repeated file reads where file content changed
|
|
167
|
-
* - Repeated searches with same pattern but new results
|
|
168
|
-
*/
|
|
169
|
-
private checkBehavioralLoop;
|
|
170
|
-
/**
|
|
171
|
-
* Reset behavioral loop tracking (called when user provides new input or task completes)
|
|
172
|
-
*/
|
|
173
|
-
private resetBehavioralLoopTracking;
|
|
174
|
-
/**
|
|
175
|
-
* Create a stable cache key for a tool call based on name and arguments
|
|
176
|
-
*/
|
|
177
|
-
private getToolCacheKey;
|
|
178
|
-
/**
|
|
179
|
-
* Get cached result for a tool call, or null if not cached
|
|
180
|
-
*/
|
|
181
|
-
private getCachedToolResult;
|
|
182
|
-
/**
|
|
183
|
-
* Cache a tool result for future identical calls
|
|
184
|
-
*/
|
|
185
|
-
private cacheToolResult;
|
|
186
125
|
getHistory(): ConversationMessage[];
|
|
187
126
|
loadHistory(history: ConversationMessage[]): void;
|
|
188
127
|
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":["../../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;AA2F/F,MAAM,WAAW,cAAc;IAC7B,kBAAkB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC/E,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,IAAI,CAAC;IACpE,eAAe,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7E,8DAA8D;IAC9D,kBA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