centaurus-cli 2.5.2 → 2.5.3
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/AUTH_FLOW.md +138 -0
- package/CONFIG_GUIDE.md +249 -0
- package/dist/config/models.d.ts +1 -1
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +2 -0
- package/dist/config/models.js.map +1 -1
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +104 -62
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/FontRecommendation.d.ts +1 -0
- package/dist/ui/components/FontRecommendation.d.ts.map +1 -0
- package/dist/ui/components/FontRecommendation.js +1 -0
- package/dist/ui/components/FontRecommendation.js.map +1 -0
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +3 -2
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -1
- package/dist/ui/components/MarkdownRenderer.js +34 -9
- package/dist/ui/components/MarkdownRenderer.js.map +1 -1
- package/dist/ui/components/MessageDisplay.js +2 -2
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.js +3 -3
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
- package/dist/ui/components/ThinkingDisplay.d.ts +13 -0
- package/dist/ui/components/ThinkingDisplay.d.ts.map +1 -0
- package/dist/ui/components/ThinkingDisplay.js +41 -0
- package/dist/ui/components/ThinkingDisplay.js.map +1 -0
- package/dist/utils/version-checker.d.ts.map +1 -1
- package/dist/utils/version-checker.js +3 -31
- package/dist/utils/version-checker.js.map +1 -1
- package/package.json +5 -5
- package/dist/ai/provider-factory.d.ts +0 -6
- package/dist/ai/provider-factory.d.ts.map +0 -1
- package/dist/ai/provider-factory.js +0 -27
- package/dist/ai/provider-factory.js.map +0 -1
- package/dist/ai/providers/base.d.ts +0 -25
- package/dist/ai/providers/base.d.ts.map +0 -1
- package/dist/ai/providers/base.js +0 -9
- package/dist/ai/providers/base.js.map +0 -1
- package/dist/ai/providers/gemini.d.ts +0 -34
- package/dist/ai/providers/gemini.d.ts.map +0 -1
- package/dist/ai/providers/gemini.js +0 -146
- package/dist/ai/providers/gemini.js.map +0 -1
- package/dist/commands/view-duplication-logs.d.ts +0 -5
- package/dist/commands/view-duplication-logs.d.ts.map +0 -1
- package/dist/commands/view-duplication-logs.js +0 -14
- package/dist/commands/view-duplication-logs.js.map +0 -1
- package/dist/context/__tests__/command-detector.test.d.ts +0 -14
- package/dist/context/__tests__/command-detector.test.d.ts.map +0 -1
- package/dist/context/__tests__/command-detector.test.js +0 -318
- package/dist/context/__tests__/command-detector.test.js.map +0 -1
- package/dist/context/__tests__/context-manager.test.d.ts +0 -16
- package/dist/context/__tests__/context-manager.test.d.ts.map +0 -1
- package/dist/context/__tests__/context-manager.test.js +0 -375
- package/dist/context/__tests__/context-manager.test.js.map +0 -1
- package/dist/context/__tests__/error-handling.test.d.ts +0 -15
- package/dist/context/__tests__/error-handling.test.d.ts.map +0 -1
- package/dist/context/__tests__/error-handling.test.js +0 -447
- package/dist/context/__tests__/error-handling.test.js.map +0 -1
- package/dist/context/handlers/__tests__/docker-handler.test.d.ts +0 -13
- package/dist/context/handlers/__tests__/docker-handler.test.d.ts.map +0 -1
- package/dist/context/handlers/__tests__/docker-handler.test.js +0 -285
- package/dist/context/handlers/__tests__/docker-handler.test.js.map +0 -1
- package/dist/context/handlers/__tests__/ssh-handler.test.d.ts +0 -13
- package/dist/context/handlers/__tests__/ssh-handler.test.d.ts.map +0 -1
- package/dist/context/handlers/__tests__/ssh-handler.test.js +0 -251
- package/dist/context/handlers/__tests__/ssh-handler.test.js.map +0 -1
- package/dist/context/handlers/__tests__/wsl-handler.test.d.ts +0 -7
- package/dist/context/handlers/__tests__/wsl-handler.test.d.ts.map +0 -1
- package/dist/context/handlers/__tests__/wsl-handler.test.js +0 -331
- package/dist/context/handlers/__tests__/wsl-handler.test.js.map +0 -1
- package/dist/index-custom.d.ts +0 -3
- package/dist/index-custom.d.ts.map +0 -1
- package/dist/index-custom.js +0 -65
- package/dist/index-custom.js.map +0 -1
- package/dist/prompts/system-prompt.d.ts +0 -47
- package/dist/prompts/system-prompt.d.ts.map +0 -1
- package/dist/prompts/system-prompt.js +0 -377
- package/dist/prompts/system-prompt.js.map +0 -1
- package/dist/providers/GoogleProvider.d.ts +0 -26
- package/dist/providers/GoogleProvider.d.ts.map +0 -1
- package/dist/providers/GoogleProvider.js +0 -313
- package/dist/providers/GoogleProvider.js.map +0 -1
- package/dist/providers/Provider.d.ts +0 -114
- package/dist/providers/Provider.d.ts.map +0 -1
- package/dist/providers/Provider.js +0 -44
- package/dist/providers/Provider.js.map +0 -1
- package/dist/services/__tests__/ai-context-injector.test.d.ts +0 -15
- package/dist/services/__tests__/ai-context-injector.test.d.ts.map +0 -1
- package/dist/services/__tests__/ai-context-injector.test.js +0 -326
- package/dist/services/__tests__/ai-context-injector.test.js.map +0 -1
- package/dist/src/context/types.js +0 -27
- package/dist/src/services/ai-context-injector.js +0 -96
- package/dist/src/services/ai-service-client.js +0 -270
- package/dist/src/services/api-client.js +0 -349
- package/dist/src/tools/types.js +0 -1
- package/dist/src/types/index.js +0 -1
- package/dist/test/context/types.js +0 -27
- package/dist/test/services/__tests__/ai-context-injector.test.js +0 -325
- package/dist/test/services/ai-context-injector.js +0 -96
- package/dist/test/services/ai-service-client.js +0 -270
- package/dist/test/services/api-client.js +0 -349
- package/dist/test/tools/types.js +0 -1
- package/dist/test/types/index.js +0 -1
- package/dist/test-ai-context-injector.js +0 -97
- package/dist/tests/automated-verification.d.ts +0 -27
- package/dist/tests/automated-verification.d.ts.map +0 -1
- package/dist/tests/automated-verification.js +0 -359
- package/dist/tests/automated-verification.js.map +0 -1
- package/dist/tests/integration-tests.d.ts +0 -50
- package/dist/tests/integration-tests.d.ts.map +0 -1
- package/dist/tests/integration-tests.js +0 -648
- package/dist/tests/integration-tests.js.map +0 -1
- package/dist/tools/file-ops-test.d.ts +0 -6
- package/dist/tools/file-ops-test.d.ts.map +0 -1
- package/dist/tools/file-ops-test.js +0 -197
- package/dist/tools/file-ops-test.js.map +0 -1
- package/dist/ui/DisplayHistory.d.ts +0 -53
- package/dist/ui/DisplayHistory.d.ts.map +0 -1
- package/dist/ui/DisplayHistory.js +0 -82
- package/dist/ui/DisplayHistory.js.map +0 -1
- package/dist/ui/clack-ui.d.ts +0 -83
- package/dist/ui/clack-ui.d.ts.map +0 -1
- package/dist/ui/clack-ui.js +0 -304
- package/dist/ui/clack-ui.js.map +0 -1
- package/dist/ui/components/DisplayItemRenderer.d.ts +0 -18
- package/dist/ui/components/DisplayItemRenderer.d.ts.map +0 -1
- package/dist/ui/components/DisplayItemRenderer.js +0 -53
- package/dist/ui/components/DisplayItemRenderer.js.map +0 -1
- package/dist/ui/components/DynamicMessage.d.ts +0 -13
- package/dist/ui/components/DynamicMessage.d.ts.map +0 -1
- package/dist/ui/components/DynamicMessage.js +0 -27
- package/dist/ui/components/DynamicMessage.js.map +0 -1
- package/dist/ui/components/FileViewerScreen.d.ts +0 -14
- package/dist/ui/components/FileViewerScreen.d.ts.map +0 -1
- package/dist/ui/components/FileViewerScreen.js +0 -74
- package/dist/ui/components/FileViewerScreen.js.map +0 -1
- package/dist/ui/components/ScrollableContent.d.ts +0 -7
- package/dist/ui/components/ScrollableContent.d.ts.map +0 -1
- package/dist/ui/components/ScrollableContent.js +0 -6
- package/dist/ui/components/ScrollableContent.js.map +0 -1
- package/dist/ui/components/ScrollableMessageList.d.ts +0 -10
- package/dist/ui/components/ScrollableMessageList.d.ts.map +0 -1
- package/dist/ui/components/ScrollableMessageList.js +0 -133
- package/dist/ui/components/ScrollableMessageList.js.map +0 -1
- package/dist/ui/components/ScrollableScreen.d.ts +0 -9
- package/dist/ui/components/ScrollableScreen.d.ts.map +0 -1
- package/dist/ui/components/ScrollableScreen.js +0 -22
- package/dist/ui/components/ScrollableScreen.js.map +0 -1
- package/dist/ui/components/StaticMessageHistory.d.ts +0 -14
- package/dist/ui/components/StaticMessageHistory.d.ts.map +0 -1
- package/dist/ui/components/StaticMessageHistory.js +0 -19
- package/dist/ui/components/StaticMessageHistory.js.map +0 -1
- package/dist/ui/components/code-block.d.ts +0 -10
- package/dist/ui/components/code-block.d.ts.map +0 -1
- package/dist/ui/components/code-block.js +0 -74
- package/dist/ui/components/code-block.js.map +0 -1
- package/dist/ui/components/confirm-prompt.d.ts +0 -12
- package/dist/ui/components/confirm-prompt.d.ts.map +0 -1
- package/dist/ui/components/confirm-prompt.js +0 -104
- package/dist/ui/components/confirm-prompt.js.map +0 -1
- package/dist/ui/components/diff-viewer.d.ts +0 -9
- package/dist/ui/components/diff-viewer.d.ts.map +0 -1
- package/dist/ui/components/diff-viewer.js +0 -57
- package/dist/ui/components/diff-viewer.js.map +0 -1
- package/dist/ui/components/input-box.d.ts +0 -18
- package/dist/ui/components/input-box.d.ts.map +0 -1
- package/dist/ui/components/input-box.js +0 -157
- package/dist/ui/components/input-box.js.map +0 -1
- package/dist/ui/components/keyboard-help.d.ts +0 -7
- package/dist/ui/components/keyboard-help.d.ts.map +0 -1
- package/dist/ui/components/keyboard-help.js +0 -43
- package/dist/ui/components/keyboard-help.js.map +0 -1
- package/dist/ui/components/loading-indicator.d.ts +0 -3
- package/dist/ui/components/loading-indicator.d.ts.map +0 -1
- package/dist/ui/components/loading-indicator.js +0 -42
- package/dist/ui/components/loading-indicator.js.map +0 -1
- package/dist/ui/components/message-display.d.ts +0 -7
- package/dist/ui/components/message-display.d.ts.map +0 -1
- package/dist/ui/components/message-display.js +0 -104
- package/dist/ui/components/message-display.js.map +0 -1
- package/dist/ui/components/misc.d.ts +0 -28
- package/dist/ui/components/misc.d.ts.map +0 -1
- package/dist/ui/components/misc.js +0 -128
- package/dist/ui/components/misc.js.map +0 -1
- package/dist/ui/components/select-prompt.d.ts +0 -13
- package/dist/ui/components/select-prompt.d.ts.map +0 -1
- package/dist/ui/components/select-prompt.js +0 -42
- package/dist/ui/components/select-prompt.js.map +0 -1
- package/dist/ui/components/status-bar.d.ts +0 -11
- package/dist/ui/components/status-bar.d.ts.map +0 -1
- package/dist/ui/components/status-bar.js +0 -47
- package/dist/ui/components/status-bar.js.map +0 -1
- package/dist/ui/components/tool-execution.d.ts +0 -3
- package/dist/ui/components/tool-execution.d.ts.map +0 -1
- package/dist/ui/components/tool-execution.js +0 -374
- package/dist/ui/components/tool-execution.js.map +0 -1
- package/dist/ui/components/tool-result.d.ts +0 -11
- package/dist/ui/components/tool-result.d.ts.map +0 -1
- package/dist/ui/components/tool-result.js +0 -58
- package/dist/ui/components/tool-result.js.map +0 -1
- package/dist/ui/components/welcome-banner.d.ts +0 -3
- package/dist/ui/components/welcome-banner.d.ts.map +0 -1
- package/dist/ui/components/welcome-banner.js +0 -46
- package/dist/ui/components/welcome-banner.js.map +0 -1
- package/dist/ui/hooks/useDisplayHistory.d.ts +0 -13
- package/dist/ui/hooks/useDisplayHistory.d.ts.map +0 -1
- package/dist/ui/hooks/useDisplayHistory.js +0 -45
- package/dist/ui/hooks/useDisplayHistory.js.map +0 -1
- package/dist/ui/render-engine.d.ts +0 -69
- package/dist/ui/render-engine.d.ts.map +0 -1
- package/dist/ui/render-engine.js +0 -197
- package/dist/ui/render-engine.js.map +0 -1
- package/dist/ui/terminal/TerminalRenderer.d.ts +0 -84
- package/dist/ui/terminal/TerminalRenderer.d.ts.map +0 -1
- package/dist/ui/terminal/TerminalRenderer.js +0 -154
- package/dist/ui/terminal/TerminalRenderer.js.map +0 -1
- package/dist/ui/terminal/TerminalUI.d.ts +0 -139
- package/dist/ui/terminal/TerminalUI.d.ts.map +0 -1
- package/dist/ui/terminal/TerminalUI.js +0 -430
- package/dist/ui/terminal/TerminalUI.js.map +0 -1
- package/dist/ui/terminal/VirtualChatBuffer.d.ts +0 -32
- package/dist/ui/terminal/VirtualChatBuffer.d.ts.map +0 -1
- package/dist/ui/terminal/VirtualChatBuffer.js +0 -37
- package/dist/ui/terminal/VirtualChatBuffer.js.map +0 -1
- package/dist/ui/terminal-kit-base.d.ts +0 -117
- package/dist/ui/terminal-kit-base.d.ts.map +0 -1
- package/dist/ui/terminal-kit-base.js +0 -188
- package/dist/ui/terminal-kit-base.js.map +0 -1
- package/dist/ui/utils/duplication-detector.d.ts +0 -32
- package/dist/ui/utils/duplication-detector.d.ts.map +0 -1
- package/dist/ui/utils/duplication-detector.js +0 -227
- package/dist/ui/utils/duplication-detector.js.map +0 -1
- package/dist/ui/utils/duplication-logger.d.ts +0 -21
- package/dist/ui/utils/duplication-logger.d.ts.map +0 -1
- package/dist/ui/utils/duplication-logger.js +0 -85
- package/dist/ui/utils/duplication-logger.js.map +0 -1
- package/dist/ui/utils/terminal-scanner.d.ts +0 -19
- package/dist/ui/utils/terminal-scanner.d.ts.map +0 -1
- package/dist/ui/utils/terminal-scanner.js +0 -217
- package/dist/ui/utils/terminal-scanner.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -3
- package/dist/version.js.map +0 -1
- package/scripts/generate-version.js +0 -25
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
export declare const term: any;
|
|
2
|
-
export declare let screenBuffer: any;
|
|
3
|
-
export declare function ensureScreenBuffer(): any;
|
|
4
|
-
export declare const colors: {
|
|
5
|
-
primary: {
|
|
6
|
-
r: number;
|
|
7
|
-
g: number;
|
|
8
|
-
b: number;
|
|
9
|
-
};
|
|
10
|
-
success: {
|
|
11
|
-
r: number;
|
|
12
|
-
g: number;
|
|
13
|
-
b: number;
|
|
14
|
-
};
|
|
15
|
-
error: {
|
|
16
|
-
r: number;
|
|
17
|
-
g: number;
|
|
18
|
-
b: number;
|
|
19
|
-
};
|
|
20
|
-
warning: {
|
|
21
|
-
r: number;
|
|
22
|
-
g: number;
|
|
23
|
-
b: number;
|
|
24
|
-
};
|
|
25
|
-
border: {
|
|
26
|
-
r: number;
|
|
27
|
-
g: number;
|
|
28
|
-
b: number;
|
|
29
|
-
};
|
|
30
|
-
dimmed: {
|
|
31
|
-
r: number;
|
|
32
|
-
g: number;
|
|
33
|
-
b: number;
|
|
34
|
-
};
|
|
35
|
-
text: {
|
|
36
|
-
r: number;
|
|
37
|
-
g: number;
|
|
38
|
-
b: number;
|
|
39
|
-
};
|
|
40
|
-
lightGreen: {
|
|
41
|
-
r: number;
|
|
42
|
-
g: number;
|
|
43
|
-
b: number;
|
|
44
|
-
};
|
|
45
|
-
lightRed: {
|
|
46
|
-
r: number;
|
|
47
|
-
g: number;
|
|
48
|
-
b: number;
|
|
49
|
-
};
|
|
50
|
-
lightGray: {
|
|
51
|
-
r: number;
|
|
52
|
-
g: number;
|
|
53
|
-
b: number;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export declare const borders: {
|
|
57
|
-
rounded: {
|
|
58
|
-
topLeft: string;
|
|
59
|
-
topRight: string;
|
|
60
|
-
bottomLeft: string;
|
|
61
|
-
bottomRight: string;
|
|
62
|
-
horizontal: string;
|
|
63
|
-
vertical: string;
|
|
64
|
-
};
|
|
65
|
-
single: {
|
|
66
|
-
topLeft: string;
|
|
67
|
-
topRight: string;
|
|
68
|
-
bottomLeft: string;
|
|
69
|
-
bottomRight: string;
|
|
70
|
-
horizontal: string;
|
|
71
|
-
vertical: string;
|
|
72
|
-
};
|
|
73
|
-
double: {
|
|
74
|
-
topLeft: string;
|
|
75
|
-
topRight: string;
|
|
76
|
-
bottomLeft: string;
|
|
77
|
-
bottomRight: string;
|
|
78
|
-
horizontal: string;
|
|
79
|
-
vertical: string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
export declare function createColorAttr(color: {
|
|
83
|
-
r: number;
|
|
84
|
-
g: number;
|
|
85
|
-
b: number;
|
|
86
|
-
}, bold?: boolean, dim?: boolean): {
|
|
87
|
-
color: [number, number, number];
|
|
88
|
-
bgColor: "default";
|
|
89
|
-
bold: boolean;
|
|
90
|
-
dim: boolean;
|
|
91
|
-
};
|
|
92
|
-
export interface BoxOptions {
|
|
93
|
-
x: number;
|
|
94
|
-
y: number;
|
|
95
|
-
width: number;
|
|
96
|
-
height: number;
|
|
97
|
-
borderStyle?: 'rounded' | 'single' | 'double';
|
|
98
|
-
borderColor?: {
|
|
99
|
-
r: number;
|
|
100
|
-
g: number;
|
|
101
|
-
b: number;
|
|
102
|
-
};
|
|
103
|
-
title?: string;
|
|
104
|
-
titleColor?: {
|
|
105
|
-
r: number;
|
|
106
|
-
g: number;
|
|
107
|
-
b: number;
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
export declare function drawBox(options: BoxOptions): void;
|
|
111
|
-
export declare function clearRegion(x: number, y: number, width: number, height: number): void;
|
|
112
|
-
export declare function wrapText(text: string, maxWidth: number): string[];
|
|
113
|
-
export declare function truncate(text: string, maxLength: number): string;
|
|
114
|
-
export declare function pad(text: string, length: number, char?: string, align?: 'left' | 'right' | 'center'): string;
|
|
115
|
-
export declare function initializeTerminal(): () => void;
|
|
116
|
-
export declare function render(): void;
|
|
117
|
-
//# sourceMappingURL=terminal-kit-base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-kit-base.d.ts","sourceRoot":"","sources":["../../src/ui/terminal-kit-base.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,KAAoB,CAAC;AAGtC,eAAO,IAAI,YAAY,EAAE,GAAU,CAAC;AAGpC,wBAAgB,kBAAkB,QAajC;AAGD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAclB,CAAC;AAGF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;CA8BnB,CAAC;AAGF,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,UAAQ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al
|
|
3
|
-
export const term = terminal.terminal;
|
|
4
|
-
// Initialize ScreenBuffer - we'll create it on demand
|
|
5
|
-
export let screenBuffer = null;
|
|
6
|
-
// Function to ensure screenBuffer is initialized
|
|
7
|
-
export function ensureScreenBuffer() {
|
|
8
|
-
if (!screenBuffer) {
|
|
9
|
-
// Ensure we have valid dimensions
|
|
10
|
-
const width = Math.min(term.width || 120, 500);
|
|
11
|
-
const height = Math.min(term.height || 40, 200);
|
|
12
|
-
screenBuffer = new terminal.ScreenBuffer({
|
|
13
|
-
dst: term,
|
|
14
|
-
width: width,
|
|
15
|
-
height: height
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return screenBuffer;
|
|
19
|
-
}
|
|
20
|
-
// Color palette mapping (from UI_ELEMENTS_REFERENCE.md)
|
|
21
|
-
export const colors = {
|
|
22
|
-
// Primary colors
|
|
23
|
-
primary: { r: 0x00, g: 0xcc, b: 0xff }, // #00ccff (Cyan)
|
|
24
|
-
success: { r: 0x00, g: 0xcc, b: 0x66 }, // #00cc66 (Green)
|
|
25
|
-
error: { r: 0xff, g: 0x33, b: 0x66 }, // #ff3366 (Red)
|
|
26
|
-
warning: { r: 0xff, g: 0xaa, b: 0x00 }, // #ffaa00 (Orange)
|
|
27
|
-
border: { r: 0x00, g: 0x3b, b: 0x59 }, // #003b59 (Dark Blue)
|
|
28
|
-
dimmed: { r: 0x66, g: 0x66, b: 0x66 }, // #666666 (Gray)
|
|
29
|
-
text: { r: 0xff, g: 0xff, b: 0xff }, // #ffffff (White)
|
|
30
|
-
// Secondary colors for diffs/edits
|
|
31
|
-
lightGreen: { r: 0x66, g: 0xff, b: 0x66 }, // #66ff66
|
|
32
|
-
lightRed: { r: 0xff, g: 0x66, b: 0x66 }, // #ff6666
|
|
33
|
-
lightGray: { r: 0xaa, g: 0xaa, b: 0xaa }, // #aaaaaa
|
|
34
|
-
};
|
|
35
|
-
// Border characters
|
|
36
|
-
export const borders = {
|
|
37
|
-
// Rounded corners (default for most components)
|
|
38
|
-
rounded: {
|
|
39
|
-
topLeft: '╭',
|
|
40
|
-
topRight: '╮',
|
|
41
|
-
bottomLeft: '╰',
|
|
42
|
-
bottomRight: '╯',
|
|
43
|
-
horizontal: '─',
|
|
44
|
-
vertical: '│',
|
|
45
|
-
},
|
|
46
|
-
// Single line (for inner boxes)
|
|
47
|
-
single: {
|
|
48
|
-
topLeft: '┌',
|
|
49
|
-
topRight: '┐',
|
|
50
|
-
bottomLeft: '└',
|
|
51
|
-
bottomRight: '┘',
|
|
52
|
-
horizontal: '─',
|
|
53
|
-
vertical: '│',
|
|
54
|
-
},
|
|
55
|
-
// Double line (for keyboard help)
|
|
56
|
-
double: {
|
|
57
|
-
topLeft: '╔',
|
|
58
|
-
topRight: '╗',
|
|
59
|
-
bottomLeft: '╚',
|
|
60
|
-
bottomRight: '╝',
|
|
61
|
-
horizontal: '═',
|
|
62
|
-
vertical: '║',
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
// Helper: Create color attributes for terminal-kit
|
|
66
|
-
export function createColorAttr(color, bold = false, dim = false) {
|
|
67
|
-
return {
|
|
68
|
-
color: [color.r, color.g, color.b],
|
|
69
|
-
bgColor: 'default',
|
|
70
|
-
bold,
|
|
71
|
-
dim,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export function drawBox(options) {
|
|
75
|
-
const { x, y, width, height, borderStyle = 'rounded', borderColor = colors.border, title, titleColor = colors.primary, } = options;
|
|
76
|
-
const border = borders[borderStyle];
|
|
77
|
-
const borderAttr = createColorAttr(borderColor);
|
|
78
|
-
const buffer = ensureScreenBuffer();
|
|
79
|
-
// Top border
|
|
80
|
-
buffer.put({
|
|
81
|
-
x,
|
|
82
|
-
y,
|
|
83
|
-
attr: borderAttr,
|
|
84
|
-
}, border.topLeft + border.horizontal.repeat(width - 2) + border.topRight);
|
|
85
|
-
// Title if provided
|
|
86
|
-
if (title) {
|
|
87
|
-
const titleAttr = createColorAttr(titleColor, true);
|
|
88
|
-
const titleX = x + 2; // 2 spaces from left
|
|
89
|
-
buffer.put({ x: titleX, y, attr: titleAttr }, ` ${title} `);
|
|
90
|
-
}
|
|
91
|
-
// Side borders
|
|
92
|
-
for (let i = 1; i < height - 1; i++) {
|
|
93
|
-
buffer.put({ x, y: y + i, attr: borderAttr }, border.vertical);
|
|
94
|
-
buffer.put({ x: x + width - 1, y: y + i, attr: borderAttr }, border.vertical);
|
|
95
|
-
}
|
|
96
|
-
// Bottom border
|
|
97
|
-
buffer.put({
|
|
98
|
-
x,
|
|
99
|
-
y: y + height - 1,
|
|
100
|
-
attr: borderAttr,
|
|
101
|
-
}, border.bottomLeft + border.horizontal.repeat(width - 2) + border.bottomRight);
|
|
102
|
-
}
|
|
103
|
-
// Helper: Clear a region
|
|
104
|
-
export function clearRegion(x, y, width, height) {
|
|
105
|
-
const buffer = ensureScreenBuffer();
|
|
106
|
-
for (let row = 0; row < height; row++) {
|
|
107
|
-
buffer.put({
|
|
108
|
-
x,
|
|
109
|
-
y: y + row,
|
|
110
|
-
attr: createColorAttr(colors.text),
|
|
111
|
-
}, ' '.repeat(width));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// Helper: Wrap text to fit width
|
|
115
|
-
export function wrapText(text, maxWidth) {
|
|
116
|
-
const lines = [];
|
|
117
|
-
const words = text.split(' ');
|
|
118
|
-
let currentLine = '';
|
|
119
|
-
for (const word of words) {
|
|
120
|
-
if (currentLine.length + word.length + 1 <= maxWidth) {
|
|
121
|
-
currentLine += (currentLine ? ' ' : '') + word;
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
if (currentLine)
|
|
125
|
-
lines.push(currentLine);
|
|
126
|
-
currentLine = word;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (currentLine)
|
|
130
|
-
lines.push(currentLine);
|
|
131
|
-
return lines;
|
|
132
|
-
}
|
|
133
|
-
// Helper: Truncate text with ellipsis
|
|
134
|
-
export function truncate(text, maxLength) {
|
|
135
|
-
if (text.length <= maxLength)
|
|
136
|
-
return text;
|
|
137
|
-
return text.slice(0, maxLength - 3) + '...';
|
|
138
|
-
}
|
|
139
|
-
// Helper: Pad string to length
|
|
140
|
-
export function pad(text, length, char = ' ', align = 'left') {
|
|
141
|
-
if (text.length >= length)
|
|
142
|
-
return text.slice(0, length);
|
|
143
|
-
const padding = length - text.length;
|
|
144
|
-
switch (align) {
|
|
145
|
-
case 'right':
|
|
146
|
-
return char.repeat(padding) + text;
|
|
147
|
-
case 'center':
|
|
148
|
-
const leftPad = Math.floor(padding / 2);
|
|
149
|
-
const rightPad = padding - leftPad;
|
|
150
|
-
return char.repeat(leftPad) + text + char.repeat(rightPad);
|
|
151
|
-
default:
|
|
152
|
-
return text + char.repeat(padding);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// Initialize terminal for application use
|
|
156
|
-
export function initializeTerminal() {
|
|
157
|
-
// Clear screen
|
|
158
|
-
term.clear();
|
|
159
|
-
// Initialize screen buffer
|
|
160
|
-
ensureScreenBuffer();
|
|
161
|
-
// Enable mouse support (for future scrolling, etc.)
|
|
162
|
-
term.grabInput({ mouse: 'button' });
|
|
163
|
-
// Handle terminal resize
|
|
164
|
-
term.on('resize', () => {
|
|
165
|
-
// Reinitialize screen buffer on resize
|
|
166
|
-
if (screenBuffer) {
|
|
167
|
-
screenBuffer.resize({
|
|
168
|
-
x: 0,
|
|
169
|
-
y: 0,
|
|
170
|
-
width: term.width,
|
|
171
|
-
height: term.height,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
// Return cleanup function
|
|
176
|
-
return () => {
|
|
177
|
-
term.grabInput(false);
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
// Render the screen buffer
|
|
181
|
-
export function render() {
|
|
182
|
-
const buffer = ensureScreenBuffer();
|
|
183
|
-
// Draw the buffer to screen
|
|
184
|
-
buffer.draw();
|
|
185
|
-
// Move cursor to bottom for input
|
|
186
|
-
term.moveTo(1, term.height);
|
|
187
|
-
}
|
|
188
|
-
//# sourceMappingURL=terminal-kit-base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-kit-base.js","sourceRoot":"","sources":["../../src/ui/terminal-kit-base.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,cAAc,CAAC;AAEpC,sBAAsB;AACtB,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAEtC,sDAAsD;AACtD,MAAM,CAAC,IAAI,YAAY,GAAQ,IAAI,CAAC;AAEpC,iDAAiD;AACjD,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,kCAAkC;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAEhD,YAAY,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC;YACvC,GAAG,EAAE,IAAI;YACT,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,wDAAwD;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,iBAAiB;IACjB,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAO,iBAAiB;IAC9D,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAO,kBAAkB;IAC/D,KAAK,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAS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E,CAAC;IACpC,4BAA4B;IAC5B,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,kCAAkC;IAClC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Duplication Detector Utility
|
|
3
|
-
*
|
|
4
|
-
* Detects when the UI has been duplicated by monitoring the terminal output
|
|
5
|
-
* for multiple instances of the InputBox component.
|
|
6
|
-
*/
|
|
7
|
-
interface DuplicationDetectorOptions {
|
|
8
|
-
onDuplicationDetected: () => void;
|
|
9
|
-
checkIntervalMs?: number;
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Detects UI duplication by scanning the terminal buffer for multiple input boxes
|
|
14
|
-
*/
|
|
15
|
-
export declare function useDuplicationDetector({ onDuplicationDetected, checkIntervalMs, enabled }: DuplicationDetectorOptions): void;
|
|
16
|
-
export declare function registerInputBoxRender(): void;
|
|
17
|
-
export declare function getInputBoxRenderCount(): number;
|
|
18
|
-
export declare function resetInputBoxRenderCount(): void;
|
|
19
|
-
export declare function setDuplicationCallback(callback: () => void): void;
|
|
20
|
-
export declare function registerBannerRender(): void;
|
|
21
|
-
export declare function getBannerRenderCount(): number;
|
|
22
|
-
export declare function resetBannerRenderCount(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Hook to detect duplication using render counting
|
|
25
|
-
* Checks both InputBox and Banner render counts
|
|
26
|
-
* Banner check is cumulative (never resets automatically), InputBox resets per cycle
|
|
27
|
-
*/
|
|
28
|
-
export declare function useRenderCountDuplicationDetector({ onDuplicationDetected, threshold, checkIntervalMs, enabled }: DuplicationDetectorOptions & {
|
|
29
|
-
threshold?: number;
|
|
30
|
-
}): void;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=duplication-detector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duplication-detector.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/duplication-detector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,UAAU,0BAA0B;IAClC,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,qBAAqB,EACrB,eAAqB,EACrB,OAAc,EACf,EAAE,0BAA0B,QAkC5B;AA0FD,wBAAgB,sBAAsB,IAAI,IAAI,CAU7C;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C;AAUD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAGjE;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAsB3C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,EAChD,qBAAqB,EACrB,SAAa,EACb,eAAqB,EACrB,OAAc,EACf,EAAE,0BAA0B,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,QA2DrD"}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Duplication Detector Utility
|
|
3
|
-
*
|
|
4
|
-
* Detects when the UI has been duplicated by monitoring the terminal output
|
|
5
|
-
* for multiple instances of the InputBox component.
|
|
6
|
-
*/
|
|
7
|
-
import { useEffect, useRef } from 'react';
|
|
8
|
-
import { logDuplication } from './duplication-logger.js';
|
|
9
|
-
/**
|
|
10
|
-
* Detects UI duplication by scanning the terminal buffer for multiple input boxes
|
|
11
|
-
*/
|
|
12
|
-
export function useDuplicationDetector({ onDuplicationDetected, checkIntervalMs = 500, enabled = true }) {
|
|
13
|
-
const lastCheckRef = useRef(0);
|
|
14
|
-
const duplicationDetectedRef = useRef(false);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (!enabled)
|
|
17
|
-
return;
|
|
18
|
-
const intervalId = setInterval(() => {
|
|
19
|
-
const now = Date.now();
|
|
20
|
-
// Throttle checks
|
|
21
|
-
if (now - lastCheckRef.current < checkIntervalMs) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
lastCheckRef.current = now;
|
|
25
|
-
// Check for duplication
|
|
26
|
-
if (detectDuplication()) {
|
|
27
|
-
if (!duplicationDetectedRef.current) {
|
|
28
|
-
duplicationDetectedRef.current = true;
|
|
29
|
-
console.error('[Duplication Detector] UI duplication detected! Triggering recovery...');
|
|
30
|
-
onDuplicationDetected();
|
|
31
|
-
// Reset flag after a delay to allow re-detection if needed
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
duplicationDetectedRef.current = false;
|
|
34
|
-
}, 2000);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}, checkIntervalMs);
|
|
38
|
-
return () => clearInterval(intervalId);
|
|
39
|
-
}, [onDuplicationDetected, checkIntervalMs, enabled]);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Detects duplication by analyzing the terminal output
|
|
43
|
-
* Returns true if duplication is detected
|
|
44
|
-
*/
|
|
45
|
-
function detectDuplication() {
|
|
46
|
-
try {
|
|
47
|
-
// Get the terminal output by reading stdout
|
|
48
|
-
// We'll look for multiple instances of the InputBox border pattern
|
|
49
|
-
const terminalOutput = getTerminalOutput();
|
|
50
|
-
if (!terminalOutput) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
// Count occurrences of the InputBox component markers
|
|
54
|
-
const inputBoxCount = countInputBoxes(terminalOutput);
|
|
55
|
-
// If we find more than 1 input box, duplication has occurred
|
|
56
|
-
if (inputBoxCount > 1) {
|
|
57
|
-
console.error(`[Duplication Detector] Found ${inputBoxCount} input boxes (expected 1)`);
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
console.error('[Duplication Detector] Error during detection:', error);
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Gets the current terminal output
|
|
69
|
-
*/
|
|
70
|
-
function getTerminalOutput() {
|
|
71
|
-
try {
|
|
72
|
-
// In Node.js, we can't directly read the terminal buffer
|
|
73
|
-
// Instead, we'll use a different approach: check if Ink is rendering multiple times
|
|
74
|
-
// by looking at the process.stdout content
|
|
75
|
-
// For now, we'll use a heuristic based on the terminal rows
|
|
76
|
-
if (process.stdout.rows && process.stdout.columns) {
|
|
77
|
-
// We can't directly read the buffer, so we'll use an alternative approach
|
|
78
|
-
// Store a marker in the component and check for duplicates
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Counts the number of InputBox components in the terminal output
|
|
89
|
-
*/
|
|
90
|
-
function countInputBoxes(output) {
|
|
91
|
-
// Look for the InputBox border pattern (round border style)
|
|
92
|
-
// The InputBox has distinctive markers:
|
|
93
|
-
// 1. "CWD:" text
|
|
94
|
-
// 2. "Model:" text
|
|
95
|
-
// 3. "AUTO-ACCEPT:" text
|
|
96
|
-
// 4. "> " prompt
|
|
97
|
-
// 5. "Ctrl+T to toggle" help text
|
|
98
|
-
const markers = [
|
|
99
|
-
/CWD:/g,
|
|
100
|
-
/Model:/g,
|
|
101
|
-
/AUTO-ACCEPT:/g,
|
|
102
|
-
/Ctrl\+T to toggle auto-accept/g
|
|
103
|
-
];
|
|
104
|
-
let maxCount = 0;
|
|
105
|
-
for (const marker of markers) {
|
|
106
|
-
const matches = output.match(marker);
|
|
107
|
-
const count = matches ? matches.length : 0;
|
|
108
|
-
maxCount = Math.max(maxCount, count);
|
|
109
|
-
}
|
|
110
|
-
return maxCount;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Alternative approach: Use a global counter to track InputBox renders
|
|
114
|
-
*/
|
|
115
|
-
let inputBoxRenderCount = 0;
|
|
116
|
-
let lastResetTime = Date.now();
|
|
117
|
-
export function registerInputBoxRender() {
|
|
118
|
-
const now = Date.now();
|
|
119
|
-
// Reset counter every 100ms (one render cycle)
|
|
120
|
-
if (now - lastResetTime > 100) {
|
|
121
|
-
inputBoxRenderCount = 0;
|
|
122
|
-
lastResetTime = now;
|
|
123
|
-
}
|
|
124
|
-
inputBoxRenderCount++;
|
|
125
|
-
}
|
|
126
|
-
export function getInputBoxRenderCount() {
|
|
127
|
-
return inputBoxRenderCount;
|
|
128
|
-
}
|
|
129
|
-
export function resetInputBoxRenderCount() {
|
|
130
|
-
inputBoxRenderCount = 0;
|
|
131
|
-
lastResetTime = Date.now();
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Track WelcomeBanner renders
|
|
135
|
-
* Banner should only render once per session, so we don't reset the counter automatically
|
|
136
|
-
*/
|
|
137
|
-
let bannerRenderCount = 0;
|
|
138
|
-
let bannerRenderTimestamps = [];
|
|
139
|
-
let duplicationCallback = null;
|
|
140
|
-
export function setDuplicationCallback(callback) {
|
|
141
|
-
logDuplication('Callback registered', 'INFO');
|
|
142
|
-
duplicationCallback = callback;
|
|
143
|
-
}
|
|
144
|
-
export function registerBannerRender() {
|
|
145
|
-
const now = Date.now();
|
|
146
|
-
bannerRenderCount++;
|
|
147
|
-
bannerRenderTimestamps.push(now);
|
|
148
|
-
logDuplication(`Banner render #${bannerRenderCount} at ${now}`, 'INFO');
|
|
149
|
-
// Keep only last 10 timestamps for analysis
|
|
150
|
-
if (bannerRenderTimestamps.length > 10) {
|
|
151
|
-
bannerRenderTimestamps.shift();
|
|
152
|
-
}
|
|
153
|
-
// Immediate check: if banner count > 1, trigger duplication callback
|
|
154
|
-
if (bannerRenderCount > 1) {
|
|
155
|
-
logDuplication(`DUPLICATION! Banner render #${bannerRenderCount} detected!`, 'ERROR');
|
|
156
|
-
if (duplicationCallback) {
|
|
157
|
-
logDuplication('Triggering immediate recovery callback...', 'ERROR');
|
|
158
|
-
duplicationCallback();
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
logDuplication('WARNING: No callback registered yet!', 'WARN');
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
export function getBannerRenderCount() {
|
|
166
|
-
return bannerRenderCount;
|
|
167
|
-
}
|
|
168
|
-
export function resetBannerRenderCount() {
|
|
169
|
-
bannerRenderCount = 0;
|
|
170
|
-
bannerRenderTimestamps = [];
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Hook to detect duplication using render counting
|
|
174
|
-
* Checks both InputBox and Banner render counts
|
|
175
|
-
* Banner check is cumulative (never resets automatically), InputBox resets per cycle
|
|
176
|
-
*/
|
|
177
|
-
export function useRenderCountDuplicationDetector({ onDuplicationDetected, threshold = 2, checkIntervalMs = 100, enabled = true }) {
|
|
178
|
-
const duplicationDetectedRef = useRef(false);
|
|
179
|
-
const lastBannerCountRef = useRef(0);
|
|
180
|
-
useEffect(() => {
|
|
181
|
-
if (!enabled)
|
|
182
|
-
return;
|
|
183
|
-
logDuplication('Periodic monitoring started', 'INFO');
|
|
184
|
-
const intervalId = setInterval(() => {
|
|
185
|
-
const inputBoxCount = getInputBoxRenderCount();
|
|
186
|
-
const bannerCount = getBannerRenderCount();
|
|
187
|
-
// Log current counts for debugging
|
|
188
|
-
if (inputBoxCount > 0 || bannerCount > 0) {
|
|
189
|
-
logDuplication(`Check: InputBox=${inputBoxCount}, Banner=${bannerCount}, LastBanner=${lastBannerCountRef.current}`, 'INFO');
|
|
190
|
-
}
|
|
191
|
-
// Check if InputBox has been rendered multiple times in current cycle
|
|
192
|
-
const inputBoxDuplicated = inputBoxCount > threshold;
|
|
193
|
-
// Check if banner count has increased (meaning a new banner was rendered)
|
|
194
|
-
// Banner should only render once, so any increase after initial render is duplication
|
|
195
|
-
const bannerDuplicated = bannerCount > 1 && bannerCount > lastBannerCountRef.current;
|
|
196
|
-
const isDuplicated = inputBoxDuplicated || bannerDuplicated;
|
|
197
|
-
if (isDuplicated) {
|
|
198
|
-
if (!duplicationDetectedRef.current) {
|
|
199
|
-
duplicationDetectedRef.current = true;
|
|
200
|
-
if (inputBoxDuplicated) {
|
|
201
|
-
logDuplication(`Multiple InputBox renders detected (${inputBoxCount})! Triggering recovery...`, 'ERROR');
|
|
202
|
-
}
|
|
203
|
-
if (bannerDuplicated) {
|
|
204
|
-
logDuplication(`Multiple Banner renders detected (${bannerCount}, was ${lastBannerCountRef.current})! Triggering recovery...`, 'ERROR');
|
|
205
|
-
}
|
|
206
|
-
onDuplicationDetected();
|
|
207
|
-
resetInputBoxRenderCount();
|
|
208
|
-
// Don't reset banner count here - let the recovery handler do it
|
|
209
|
-
// Reset flag after a delay
|
|
210
|
-
setTimeout(() => {
|
|
211
|
-
duplicationDetectedRef.current = false;
|
|
212
|
-
lastBannerCountRef.current = 1; // After recovery, we expect 1 banner
|
|
213
|
-
}, 1000);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
// Update last banner count for next check
|
|
218
|
-
lastBannerCountRef.current = bannerCount;
|
|
219
|
-
}
|
|
220
|
-
}, checkIntervalMs);
|
|
221
|
-
return () => {
|
|
222
|
-
logDuplication('Periodic monitoring stopped', 'INFO');
|
|
223
|
-
clearInterval(intervalId);
|
|
224
|
-
};
|
|
225
|
-
}, [onDuplicationDetected, threshold, checkIntervalMs, enabled]);
|
|
226
|
-
}
|
|
227
|
-
//# sourceMappingURL=duplication-detector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duplication-detector.js","sourceRoot":"","sources":["../../../src/ui/utils/duplication-detector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE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,CAAC,EAAE,eAAe,CAAC,CAAC;QAEpB,OAAO,GAAG,EAAE;YACV,cAAc,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;YACtD,aAAa,CAAC,UAAU,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,qBAAqB,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File-based logging system for duplication detection
|
|
3
|
-
* Logs to a file instead of console to avoid cluttering the terminal
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Write a log entry to the file
|
|
7
|
-
*/
|
|
8
|
-
export declare function logDuplication(message: string, level?: 'INFO' | 'WARN' | 'ERROR'): void;
|
|
9
|
-
/**
|
|
10
|
-
* Clear the log file
|
|
11
|
-
*/
|
|
12
|
-
export declare function clearDuplicationLog(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Get the log file path
|
|
15
|
-
*/
|
|
16
|
-
export declare function getLogFilePath(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Read the last N lines from the log file
|
|
19
|
-
*/
|
|
20
|
-
export declare function readLastLogLines(lines?: number): string;
|
|
21
|
-
//# sourceMappingURL=duplication-logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duplication-logger.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/duplication-logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,MAAM,GAAG,OAAgB,GAAG,IAAI,CAuB/F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAS1C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,MAAW,GAAG,MAAM,CAa3D"}
|