centaurus-cli 2.0.0 → 2.0.2
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/CONFIG_GUIDE.md +100 -106
- package/README.md +68 -63
- package/dist/cli-adapter.d.ts +9 -3
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +123 -164
- package/dist/cli-adapter.js.map +1 -1
- package/dist/commands/CommandParser.d.ts +1 -1
- package/dist/commands/CommandParser.d.ts.map +1 -1
- package/dist/commands/CommandParser.js +3 -18
- package/dist/commands/CommandParser.js.map +1 -1
- package/dist/commands/view-duplication-logs.d.ts +5 -0
- package/dist/commands/view-duplication-logs.d.ts.map +1 -0
- package/dist/commands/view-duplication-logs.js +14 -0
- package/dist/commands/view-duplication-logs.js.map +1 -0
- package/dist/config/ConfigManager.d.ts +10 -7
- package/dist/config/ConfigManager.d.ts.map +1 -1
- package/dist/config/ConfigManager.js +43 -142
- package/dist/config/ConfigManager.js.map +1 -1
- package/dist/config/defaultConfig.d.ts +0 -4
- package/dist/config/defaultConfig.d.ts.map +1 -1
- package/dist/config/defaultConfig.js +1 -6
- package/dist/config/defaultConfig.js.map +1 -1
- package/dist/config/manager.d.ts +15 -13
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +52 -41
- package/dist/config/manager.js.map +1 -1
- package/dist/config/models.d.ts +31 -0
- package/dist/config/models.d.ts.map +1 -0
- package/dist/config/models.js +49 -0
- package/dist/config/models.js.map +1 -0
- package/dist/config/types.d.ts +0 -3
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +0 -1
- package/dist/config/types.js.map +1 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts/system-prompt.d.ts +1 -1
- package/dist/prompts/system-prompt.d.ts.map +1 -1
- package/dist/prompts/system-prompt.js +0 -1
- package/dist/prompts/system-prompt.js.map +1 -1
- package/dist/services/ai-service-client.d.ts +82 -0
- package/dist/services/ai-service-client.d.ts.map +1 -0
- package/dist/services/ai-service-client.js +254 -0
- package/dist/services/ai-service-client.js.map +1 -0
- package/dist/services/api-client.js +3 -3
- package/dist/services/api-client.js.map +1 -1
- package/dist/tools/ToolRegistry.d.ts +14 -3
- package/dist/tools/ToolRegistry.d.ts.map +1 -1
- package/dist/tools/ToolRegistry.js +46 -34
- package/dist/tools/ToolRegistry.js.map +1 -1
- package/dist/tools/command.d.ts.map +1 -1
- package/dist/tools/command.js +17 -3
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/file-ops.js +3 -3
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/web-search.js +2 -2
- package/dist/tools/web-search.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/components/App.d.ts +3 -2
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +107 -16
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/CodeBlock.d.ts.map +1 -1
- package/dist/ui/components/CodeBlock.js +15 -3
- package/dist/ui/components/CodeBlock.js.map +1 -1
- package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -1
- package/dist/ui/components/ConfirmPrompt.js +32 -20
- package/dist/ui/components/ConfirmPrompt.js.map +1 -1
- package/dist/ui/components/DiffViewer.d.ts.map +1 -1
- package/dist/ui/components/DiffViewer.js +16 -2
- package/dist/ui/components/DiffViewer.js.map +1 -1
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +26 -9
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/LoadingIndicator.d.ts.map +1 -1
- package/dist/ui/components/LoadingIndicator.js +6 -2
- package/dist/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -1
- package/dist/ui/components/MarkdownRenderer.js +8 -12
- package/dist/ui/components/MarkdownRenderer.js.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.d.ts +6 -7
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.js +69 -12
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +44 -16
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/WelcomeBanner.d.ts.map +1 -1
- package/dist/ui/components/WelcomeBanner.js.map +1 -1
- package/dist/ui/utils/duplication-detector.d.ts +32 -0
- package/dist/ui/utils/duplication-detector.d.ts.map +1 -0
- package/dist/ui/utils/duplication-detector.js +227 -0
- package/dist/ui/utils/duplication-detector.js.map +1 -0
- package/dist/ui/utils/duplication-logger.d.ts +21 -0
- package/dist/ui/utils/duplication-logger.d.ts.map +1 -0
- package/dist/ui/utils/duplication-logger.js +85 -0
- package/dist/ui/utils/duplication-logger.js.map +1 -0
- package/dist/ui/utils/terminal-scanner.d.ts +19 -0
- package/dist/ui/utils/terminal-scanner.d.ts.map +1 -0
- package/dist/ui/utils/terminal-scanner.js +217 -0
- package/dist/ui/utils/terminal-scanner.js.map +1 -0
- package/package.json +2 -13
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
3
4
|
const LOADING_MESSAGES = [
|
|
4
5
|
'Thrusting',
|
|
5
6
|
'Propelling',
|
|
@@ -14,11 +15,14 @@ const LOADING_MESSAGES = [
|
|
|
14
15
|
];
|
|
15
16
|
const SPINNER_TYPES = ['dots', 'dots2', 'line', 'star', 'arc', 'circle', 'arrow', 'bouncingBar', 'bouncingBall', 'earth', 'moon'];
|
|
16
17
|
export const LoadingIndicator = () => {
|
|
17
|
-
// Use useMemo to pick random message only once, not on every render
|
|
18
|
+
// Use useMemo to pick random message and spinner only once, not on every render
|
|
18
19
|
const messageIndex = React.useMemo(() => Math.floor(Math.random() * LOADING_MESSAGES.length), []);
|
|
20
|
+
const spinnerType = React.useMemo(() => SPINNER_TYPES[Math.floor(Math.random() * SPINNER_TYPES.length)], []);
|
|
19
21
|
return (React.createElement(Box, { marginBottom: 1, paddingLeft: 1 },
|
|
22
|
+
React.createElement(Text, { color: "#00ccff" },
|
|
23
|
+
React.createElement(Spinner, { type: spinnerType })),
|
|
20
24
|
React.createElement(Text, { color: "#00ccff", bold: true },
|
|
21
|
-
"
|
|
25
|
+
" ",
|
|
22
26
|
LOADING_MESSAGES[messageIndex],
|
|
23
27
|
"...")));
|
|
24
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingIndicator.js","sourceRoot":"","sources":["../../../src/ui/components/LoadingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"LoadingIndicator.js","sourceRoot":"","sources":["../../../src/ui/components/LoadingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,MAAM,gBAAgB,GAAG;IACvB,WAAW;IACX,YAAY;IACZ,UAAU;IACV,WAAW;IACX,cAAc;IACd,eAAe;IACf,cAAc;IACd,UAAU;IACV,SAAS;IACT,SAAS;CACV,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAE3I,MAAM,CAAC,MAAM,gBAAgB,GAAa,GAAG,EAAE;IAC7C,gFAAgF;IAChF,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IAClG,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE7G,OAAO,CACL,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC;QAClC,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS;YACnB,oBAAC,OAAO,IAAC,IAAI,EAAE,WAAW,GAAI,CACzB;QACP,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI;;YAAG,gBAAgB,CAAC,YAAY,CAAC;kBAAW,CAClE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../src/ui/components/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../src/ui/components/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAwK5D,CAAC"}
|
|
@@ -29,19 +29,15 @@ export const MarkdownRenderer = ({ content, maxWidth = 100 }) => {
|
|
|
29
29
|
const level = element.level || 1;
|
|
30
30
|
const colors = ['#00ffff', '#00dddd', '#00bbbb', '#009999', '#007777', '#005555'];
|
|
31
31
|
const color = colors[level - 1] || '#ffffff';
|
|
32
|
-
|
|
33
|
-
const suffix = '\n';
|
|
34
|
-
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom: 1 },
|
|
32
|
+
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom: 0 },
|
|
35
33
|
React.createElement(Text, { bold: true, color: color },
|
|
36
|
-
prefix,
|
|
37
34
|
'#'.repeat(level),
|
|
38
35
|
" ",
|
|
39
|
-
element.content
|
|
40
|
-
suffix)));
|
|
36
|
+
element.content)));
|
|
41
37
|
}
|
|
42
38
|
case 'code-block': {
|
|
43
39
|
const lines = element.content.split('\n');
|
|
44
|
-
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom:
|
|
40
|
+
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom: 0, marginTop: 0 },
|
|
45
41
|
React.createElement(Box, { borderStyle: "round", borderColor: "#666666", paddingX: 1, paddingY: 0 },
|
|
46
42
|
React.createElement(Box, { flexDirection: "column" },
|
|
47
43
|
element.language && element.language !== 'text' && (React.createElement(Text, { color: "#888888", dimColor: true }, element.language)),
|
|
@@ -60,7 +56,7 @@ export const MarkdownRenderer = ({ content, maxWidth = 100 }) => {
|
|
|
60
56
|
element.children && element.children.length > 0 ? (React.createElement(Text, null, renderInlineElements(element.children))) : (React.createElement(Text, { color: "#ffffff" }, element.content)))));
|
|
61
57
|
}
|
|
62
58
|
case 'blockquote': {
|
|
63
|
-
return (React.createElement(Box, { key: index, flexDirection: "row", marginBottom:
|
|
59
|
+
return (React.createElement(Box, { key: index, flexDirection: "row", marginBottom: 0 },
|
|
64
60
|
React.createElement(Text, { color: "#666666", bold: true },
|
|
65
61
|
"\u2502",
|
|
66
62
|
' '),
|
|
@@ -69,22 +65,22 @@ export const MarkdownRenderer = ({ content, maxWidth = 100 }) => {
|
|
|
69
65
|
: element.content)));
|
|
70
66
|
}
|
|
71
67
|
case 'horizontal-rule': {
|
|
72
|
-
return (React.createElement(Box, { key: index, marginY:
|
|
68
|
+
return (React.createElement(Box, { key: index, marginY: 0 },
|
|
73
69
|
React.createElement(Text, { color: "#444444" }, '─'.repeat(Math.min(maxWidth, 80)))));
|
|
74
70
|
}
|
|
75
71
|
case 'line-break': {
|
|
76
|
-
return React.createElement(Box, { key: index, height:
|
|
72
|
+
return React.createElement(Box, { key: index, height: 0 });
|
|
77
73
|
}
|
|
78
74
|
case 'text': {
|
|
79
75
|
// If we have inline children (formatted text), render them directly
|
|
80
76
|
if (element.children && element.children.length > 0) {
|
|
81
|
-
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom:
|
|
77
|
+
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom: 0 },
|
|
82
78
|
React.createElement(Box, { paddingLeft: 2 },
|
|
83
79
|
React.createElement(Text, null, renderInlineElements(element.children)))));
|
|
84
80
|
}
|
|
85
81
|
// Otherwise, wrap plain text if needed
|
|
86
82
|
const wrappedLines = wrapText(element.content, maxWidth, 2);
|
|
87
|
-
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom:
|
|
83
|
+
return (React.createElement(Box, { key: index, flexDirection: "column", marginBottom: 0 }, wrappedLines.map((line, lineIdx) => (React.createElement(Box, { key: lineIdx, paddingLeft: 2 },
|
|
88
84
|
React.createElement(Text, { color: "#ffffff" }, line))))));
|
|
89
85
|
}
|
|
90
86
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.js","sourceRoot":"","sources":["../../../src/ui/components/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAA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,CACL,oBAAC,GAAG,IAAC,GAAG,EAAE,KAAK,EAAE,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,IACpD,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CACnC,oBAAC,GAAG,IAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;oBAC/B,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,IAAE,IAAI,CAAQ,CAC/B,CACP,CAAC,CACE,CACP,CAAC;YACJ,CAAC;YAED;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,IACxB,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAC5D,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
role: 'assistant';
|
|
5
|
-
content: string;
|
|
6
|
-
timestamp: Date;
|
|
7
|
-
}
|
|
2
|
+
import { Message } from '../../types/index.js';
|
|
8
3
|
interface StreamingMessageDisplayProps {
|
|
9
|
-
message:
|
|
4
|
+
message: Message;
|
|
10
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* StreamingMessageDisplay - Shows streaming content as it arrives
|
|
8
|
+
* Truncates from top if content exceeds max lines to prevent flickering
|
|
9
|
+
*/
|
|
11
10
|
export declare const StreamingMessageDisplay: React.FC<StreamingMessageDisplayProps>;
|
|
12
11
|
export {};
|
|
13
12
|
//# sourceMappingURL=StreamingMessageDisplay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamingMessageDisplay.d.ts","sourceRoot":"","sources":["../../../src/ui/components/StreamingMessageDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"StreamingMessageDisplay.d.ts","sourceRoot":"","sources":["../../../src/ui/components/StreamingMessageDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,UAAU,4BAA4B;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA6FzE,CAAC"}
|
|
@@ -1,26 +1,83 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
3
|
import { MarkdownRenderer } from './MarkdownRenderer.js';
|
|
4
|
+
/**
|
|
5
|
+
* StreamingMessageDisplay - Shows streaming content as it arrives
|
|
6
|
+
* Truncates from top if content exceeds max lines to prevent flickering
|
|
7
|
+
*/
|
|
4
8
|
export const StreamingMessageDisplay = React.memo(({ message }) => {
|
|
9
|
+
const [displayContent, setDisplayContent] = useState('');
|
|
10
|
+
const contentBufferRef = useRef('');
|
|
11
|
+
const updateTimerRef = useRef(null);
|
|
12
|
+
const messageIdRef = useRef(message.id);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
// If message ID changed, reset everything
|
|
15
|
+
if (messageIdRef.current !== message.id) {
|
|
16
|
+
messageIdRef.current = message.id;
|
|
17
|
+
setDisplayContent('');
|
|
18
|
+
contentBufferRef.current = '';
|
|
19
|
+
if (updateTimerRef.current) {
|
|
20
|
+
clearTimeout(updateTimerRef.current);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Buffer the new content
|
|
24
|
+
contentBufferRef.current = message.content;
|
|
25
|
+
// Clear any existing timer
|
|
26
|
+
if (updateTimerRef.current) {
|
|
27
|
+
clearTimeout(updateTimerRef.current);
|
|
28
|
+
}
|
|
29
|
+
// Throttle updates to every 100ms to reduce re-renders while keeping it responsive
|
|
30
|
+
updateTimerRef.current = setTimeout(() => {
|
|
31
|
+
const fullContent = contentBufferRef.current;
|
|
32
|
+
const lines = fullContent.split('\n');
|
|
33
|
+
// Maximum lines to show during streaming (to prevent flickering)
|
|
34
|
+
const MAX_LINES = 15;
|
|
35
|
+
if (lines.length > MAX_LINES) {
|
|
36
|
+
// Show only the last MAX_LINES lines
|
|
37
|
+
const truncatedLines = lines.slice(-MAX_LINES);
|
|
38
|
+
setDisplayContent(truncatedLines.join('\n'));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// Show all content if within limit
|
|
42
|
+
setDisplayContent(fullContent);
|
|
43
|
+
}
|
|
44
|
+
}, 100);
|
|
45
|
+
return () => {
|
|
46
|
+
if (updateTimerRef.current) {
|
|
47
|
+
clearTimeout(updateTimerRef.current);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, [message.content, message.id]);
|
|
51
|
+
const getRoleColor = (role) => {
|
|
52
|
+
switch (role) {
|
|
53
|
+
case 'user': return '#00ccff';
|
|
54
|
+
case 'assistant': return '#00cc66';
|
|
55
|
+
case 'system': return '#ffaa00';
|
|
56
|
+
case 'tool': return '#00ccff';
|
|
57
|
+
default: return '#ffffff';
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const getRoleLabel = (role) => {
|
|
61
|
+
switch (role) {
|
|
62
|
+
case 'user': return 'You';
|
|
63
|
+
case 'assistant': return 'Centaurus';
|
|
64
|
+
case 'system': return 'System';
|
|
65
|
+
case 'tool': return 'Tool';
|
|
66
|
+
default: return role;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
5
69
|
const timestamp = message.timestamp
|
|
6
70
|
? new Date(message.timestamp).toLocaleTimeString()
|
|
7
71
|
: '';
|
|
8
72
|
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
|
|
9
73
|
React.createElement(Box, { marginBottom: 1 },
|
|
10
|
-
React.createElement(Text, { color:
|
|
74
|
+
React.createElement(Text, { color: getRoleColor(message.role), bold: true },
|
|
75
|
+
getRoleLabel(message.role),
|
|
76
|
+
":"),
|
|
11
77
|
timestamp && (React.createElement(Text, { color: "#666666", dimColor: true },
|
|
12
78
|
" ",
|
|
13
79
|
timestamp))),
|
|
14
|
-
message.content && (React.createElement(MarkdownRenderer, { content: message.content, maxWidth: 100 })),
|
|
15
80
|
React.createElement(Box, { paddingLeft: 2 },
|
|
16
|
-
React.createElement(
|
|
17
|
-
}, (prevProps, nextProps) => {
|
|
18
|
-
// Return true if props are equal (skip re-render), false if different (re-render)
|
|
19
|
-
// For streaming messages, we need to re-render when content changes
|
|
20
|
-
if (prevProps.message.id !== nextProps.message.id)
|
|
21
|
-
return false;
|
|
22
|
-
if (prevProps.message.content !== nextProps.message.content)
|
|
23
|
-
return false;
|
|
24
|
-
return true;
|
|
81
|
+
React.createElement(MarkdownRenderer, { content: displayContent }))));
|
|
25
82
|
});
|
|
26
83
|
//# sourceMappingURL=StreamingMessageDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamingMessageDisplay.js","sourceRoot":"","sources":["../../../src/ui/components/StreamingMessageDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StreamingMessageDisplay.js","sourceRoot":"","sources":["../../../src/ui/components/StreamingMessageDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA2C,KAAK,CAAC,IAAI,CAAC,CAAC,EACzF,OAAO,EACR,EAAE,EAAE;IAC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C;IAEP,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;QACzC,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC;YAClB,oBAAC,IAAI,IAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI;gBAC1C,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;oBACtB;YACN,SAAS,IAAI,CACZ,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ;;gBAAG,SAAS,CAAQ,CACnD,CACG;QAGN,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;YACjB,oBAAC,gBAAgB,IAAC,OAAO,EAAE,cAAc,GAAI,CACzC,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolExecutionMessage.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ToolExecutionMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AAaD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"ToolExecutionMessage.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ToolExecutionMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AAaD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA6OnE,CAAC"}
|
|
@@ -18,7 +18,20 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
18
18
|
const toolInfo = TOOL_LABELS[toolName] || { verb: 'Executing', emoji: '🔧' };
|
|
19
19
|
// EXECUTING state
|
|
20
20
|
if (status === 'executing') {
|
|
21
|
-
|
|
21
|
+
// For execute_command, show the actual command
|
|
22
|
+
if (toolName === 'execute_command' && toolArgs) {
|
|
23
|
+
const { command } = toolArgs;
|
|
24
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1 },
|
|
25
|
+
React.createElement(Box, null,
|
|
26
|
+
React.createElement(Text, { color: "#00ccff", bold: true },
|
|
27
|
+
"\u23F3 ",
|
|
28
|
+
toolInfo.emoji,
|
|
29
|
+
" ",
|
|
30
|
+
toolInfo.verb,
|
|
31
|
+
": "),
|
|
32
|
+
React.createElement(Text, { color: "#00ccff" }, command))));
|
|
33
|
+
}
|
|
34
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginBottom: 1 },
|
|
22
35
|
React.createElement(Box, null,
|
|
23
36
|
React.createElement(Text, { color: "#00ccff", bold: true },
|
|
24
37
|
"\u23F3 ",
|
|
@@ -29,15 +42,30 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
29
42
|
}
|
|
30
43
|
// ERROR state
|
|
31
44
|
if (status === 'error') {
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
// For execute_command, show the actual command
|
|
46
|
+
if (toolName === 'execute_command' && toolArgs) {
|
|
47
|
+
const { command } = toolArgs;
|
|
48
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, paddingY: 1, marginBottom: 1 },
|
|
49
|
+
React.createElement(Box, null,
|
|
50
|
+
React.createElement(Text, { color: "#ff3366", bold: true },
|
|
51
|
+
"\u2717 ",
|
|
52
|
+
toolInfo.emoji,
|
|
53
|
+
" Did not execute: "),
|
|
54
|
+
React.createElement(Text, { color: "#ff3366" }, command)),
|
|
55
|
+
error && (React.createElement(Box, { paddingLeft: 2, marginTop: 1 },
|
|
56
|
+
React.createElement(Text, { color: "#ff3366" },
|
|
57
|
+
error.slice(0, 500),
|
|
58
|
+
error.length > 500 ? '...' : '')))));
|
|
59
|
+
}
|
|
60
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, paddingY: 1, marginBottom: 1 },
|
|
61
|
+
React.createElement(Box, null,
|
|
34
62
|
React.createElement(Text, { color: "#ff3366", bold: true },
|
|
35
63
|
"\u2717 ",
|
|
36
64
|
toolInfo.emoji,
|
|
37
65
|
" ",
|
|
38
66
|
toolInfo.verb,
|
|
39
67
|
" failed")),
|
|
40
|
-
error && (React.createElement(Box, { paddingLeft: 2 },
|
|
68
|
+
error && (React.createElement(Box, { paddingLeft: 2, marginTop: 1 },
|
|
41
69
|
React.createElement(Text, { color: "#ff3366" },
|
|
42
70
|
error.slice(0, 500),
|
|
43
71
|
error.length > 500 ? '...' : '')))));
|
|
@@ -50,7 +78,7 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
50
78
|
const lineInfo = start_line && end_line
|
|
51
79
|
? `lines ${start_line}-${end_line}`
|
|
52
80
|
: 'entire file';
|
|
53
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
81
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
54
82
|
React.createElement(Box, null,
|
|
55
83
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
56
84
|
"\u2713 ",
|
|
@@ -63,14 +91,14 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
63
91
|
// EXECUTE_COMMAND
|
|
64
92
|
if (toolName === 'execute_command' && toolArgs) {
|
|
65
93
|
const { command } = toolArgs;
|
|
66
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1,
|
|
67
|
-
React.createElement(Box,
|
|
94
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, paddingY: 1, marginBottom: 1 },
|
|
95
|
+
React.createElement(Box, null,
|
|
68
96
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
69
97
|
"\u2713 ",
|
|
70
98
|
toolInfo.emoji,
|
|
71
99
|
" "),
|
|
72
100
|
React.createElement(Text, { color: "#00ccff" }, command)),
|
|
73
|
-
result && (React.createElement(Box, { flexDirection: "column", paddingLeft: 2, paddingY: 1, borderStyle: "single", borderColor: "#666666" },
|
|
101
|
+
result && (React.createElement(Box, { flexDirection: "column", paddingLeft: 2, paddingY: 1, marginTop: 1, borderStyle: "single", borderColor: "#666666" },
|
|
74
102
|
React.createElement(Text, { color: "#aaaaaa" },
|
|
75
103
|
result.slice(0, 1000),
|
|
76
104
|
result.length > 1000 ? '\n...(truncated)' : '')))));
|
|
@@ -79,7 +107,7 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
79
107
|
if (toolName === 'write_file' && toolArgs) {
|
|
80
108
|
const { file_path, content } = toolArgs;
|
|
81
109
|
const lines = content ? content.split('\n').length : 0;
|
|
82
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
110
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
83
111
|
React.createElement(Box, { marginBottom: 1 },
|
|
84
112
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
85
113
|
"\u2713 ",
|
|
@@ -96,7 +124,7 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
96
124
|
// EDIT_FILE
|
|
97
125
|
if (toolName === 'edit_file' && toolArgs) {
|
|
98
126
|
const { file_path, search_pattern, replacement } = toolArgs;
|
|
99
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
127
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
100
128
|
React.createElement(Box, { marginBottom: 1 },
|
|
101
129
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
102
130
|
"\u2713 ",
|
|
@@ -116,7 +144,7 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
116
144
|
// LIST_DIRECTORY
|
|
117
145
|
if (toolName === 'list_directory' && toolArgs) {
|
|
118
146
|
const { directory_path } = toolArgs;
|
|
119
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
147
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
120
148
|
React.createElement(Box, null,
|
|
121
149
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
122
150
|
"\u2713 ",
|
|
@@ -129,7 +157,7 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
129
157
|
// GREP_SEARCH
|
|
130
158
|
if (toolName === 'grep_search' && toolArgs) {
|
|
131
159
|
const { pattern } = toolArgs;
|
|
132
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
160
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
133
161
|
React.createElement(Box, null,
|
|
134
162
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
135
163
|
"\u2713 ",
|
|
@@ -145,17 +173,17 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
145
173
|
// WEB_SEARCH
|
|
146
174
|
if (toolName === 'web_search' && toolArgs) {
|
|
147
175
|
const { query } = toolArgs;
|
|
148
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
176
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
149
177
|
React.createElement(Box, null,
|
|
150
178
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
151
179
|
"\u2713 ",
|
|
152
180
|
toolInfo.emoji,
|
|
153
|
-
"
|
|
181
|
+
" Searched the web"))));
|
|
154
182
|
}
|
|
155
183
|
// FETCH_URL
|
|
156
184
|
if (toolName === 'fetch_url' && toolArgs) {
|
|
157
185
|
const { url } = toolArgs;
|
|
158
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
186
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
159
187
|
React.createElement(Box, null,
|
|
160
188
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
161
189
|
"\u2713 ",
|
|
@@ -164,7 +192,7 @@ export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
|
164
192
|
React.createElement(Text, { color: "#00ccff" }, url))));
|
|
165
193
|
}
|
|
166
194
|
// DEFAULT - for any other tool
|
|
167
|
-
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1,
|
|
195
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginBottom: 1 },
|
|
168
196
|
React.createElement(Box, { marginBottom: 1 },
|
|
169
197
|
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
170
198
|
"\u2713 ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolExecutionMessage.js","sourceRoot":"","sources":["../../../src/ui/components/ToolExecutionMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAQhC,MAAM,WAAW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AI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI;;oBAAI,QAAQ,CAAC,KAAK;;oBAAG,QAAQ,CAAC,IAAI,CAAQ,CAChE;YACL,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,CAChC,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;gBACjB,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,IAAE,MAAM,CAAQ,CACjC,CACP,CACG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC1B,qDAAqD;IACrD,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC;IACjD,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC;IAEjD,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAEzC,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QACnC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ;QACvC,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QACnC,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WelcomeBanner.d.ts","sourceRoot":"","sources":["../../../src/ui/components/WelcomeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"WelcomeBanner.d.ts","sourceRoot":"","sources":["../../../src/ui/components/WelcomeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAkChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WelcomeBanner.js","sourceRoot":"","sources":["../../../src/ui/components/WelcomeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,MAAM,CAAC,MAAM,aAAa,GAAa,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"WelcomeBanner.js","sourceRoot":"","sources":["../../../src/ui/components/WelcomeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,MAAM,CAAC,MAAM,aAAa,GAAa,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;IAErD,uDAAuD;IACvD,MAAM,KAAK,GAAG;QACZ,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,EAAE;QACF,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;KAC1C,CAAC;IAEF,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;QAEzC,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,IACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,oBAAC,IAAI,IAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAC,SAAS,IAAE,IAAI,CAAQ,CAC5C,CAAC,CACE;QAGN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,QAAQ;;gBAAM,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,YAAa;gCAAoB,CACtE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|