@vybestack/llxprt-code 0.1.19-alpha → 0.1.19-beta
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/dist/package.json +3 -3
- package/dist/src/config/auth.js +5 -0
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.js +32 -24
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +64 -0
- package/dist/src/config/keyBindings.js +137 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/settings.d.ts +1 -0
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +9 -2
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/providers/logging/git-stats-service-impl.d.ts +19 -0
- package/dist/src/providers/logging/git-stats-service-impl.js +25 -0
- package/dist/src/providers/logging/git-stats-service-impl.js.map +1 -0
- package/dist/src/providers/logging/git-stats.d.ts +43 -0
- package/dist/src/providers/logging/git-stats.js +137 -0
- package/dist/src/providers/logging/git-stats.js.map +1 -0
- package/dist/src/providers/providerManagerInstance.js +4 -0
- package/dist/src/providers/providerManagerInstance.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +2 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/todo-continuation/todoContinuationService.d.ts +172 -0
- package/dist/src/services/todo-continuation/todoContinuationService.js +387 -0
- package/dist/src/services/todo-continuation/todoContinuationService.js.map +1 -0
- package/dist/src/services/todo-continuation/todoContinuationService.spec.d.ts +6 -0
- package/dist/src/services/todo-continuation/todoContinuationService.spec.js +385 -0
- package/dist/src/services/todo-continuation/todoContinuationService.spec.js.map +1 -0
- package/dist/src/ui/App.js +61 -25
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/colors.d.ts +5 -0
- package/dist/src/ui/colors.js +51 -0
- package/dist/src/ui/colors.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.js +16 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.js +67 -31
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/loggingCommand.d.ts +15 -0
- package/dist/src/ui/commands/loggingCommand.js +421 -0
- package/dist/src/ui/commands/loggingCommand.js.map +1 -0
- package/dist/src/ui/commands/privacyCommand.d.ts +3 -0
- package/dist/src/ui/commands/privacyCommand.js +6 -3
- package/dist/src/ui/commands/privacyCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +14 -2
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.js +14 -2
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +16 -0
- package/dist/src/ui/components/FolderTrustDialog.js +38 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +0 -1
- package/dist/src/ui/components/Footer.js +136 -16
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +32 -28
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoggingDialog.d.ts +37 -0
- package/dist/src/ui/components/LoggingDialog.js +155 -0
- package/dist/src/ui/components/LoggingDialog.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +6 -4
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ProviderDialog.js +100 -26
- package/dist/src/ui/components/ProviderDialog.js.map +1 -1
- package/dist/src/ui/components/ProviderModelDialog.js +99 -27
- package/dist/src/ui/components/ProviderModelDialog.js.map +1 -1
- package/dist/src/ui/components/TodoPanel.js +93 -18
- package/dist/src/ui/components/TodoPanel.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +85 -7
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +21 -0
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +5 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +137 -112
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.js +7 -0
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +11 -0
- package/dist/src/ui/hooks/useFolderTrust.js +22 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +14 -3
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useResponsive.d.ts +14 -0
- package/dist/src/ui/hooks/useResponsive.js +19 -0
- package/dist/src/ui/hooks/useResponsive.js.map +1 -0
- package/dist/src/ui/hooks/useTodoContinuation.d.ts +31 -0
- package/dist/src/ui/hooks/useTodoContinuation.js +148 -0
- package/dist/src/ui/hooks/useTodoContinuation.js.map +1 -0
- package/dist/src/ui/hooks/useTodoContinuation.spec.d.ts +6 -0
- package/dist/src/ui/hooks/useTodoContinuation.spec.js +378 -0
- package/dist/src/ui/hooks/useTodoContinuation.spec.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +26 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/privacy/PrivacyNotice.js +10 -4
- package/dist/src/ui/privacy/PrivacyNotice.js.map +1 -1
- package/dist/src/ui/themes/semantic-resolver.d.ts +12 -0
- package/dist/src/ui/themes/semantic-resolver.js +32 -0
- package/dist/src/ui/themes/semantic-resolver.js.map +1 -0
- package/dist/src/ui/themes/semantic-tokens.d.ts +52 -0
- package/dist/src/ui/themes/semantic-tokens.js +7 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/theme-compat.d.ts +34 -0
- package/dist/src/ui/themes/theme-compat.js +65 -0
- package/dist/src/ui/themes/theme-compat.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +8 -0
- package/dist/src/ui/themes/theme-manager.js +18 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +2 -1
- package/dist/src/ui/utils/CodeColorizer.js +4 -3
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +4 -2
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/responsive.d.ts +16 -0
- package/dist/src/ui/utils/responsive.js +111 -0
- package/dist/src/ui/utils/responsive.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -2
- package/dist/src/utils/cleanup.js +2 -2
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/privacy/ConversationDataRedactor.d.ts +75 -0
- package/dist/src/utils/privacy/ConversationDataRedactor.js +412 -0
- package/dist/src/utils/privacy/ConversationDataRedactor.js.map +1 -0
- package/dist/src/utils/privacy/PrivacyManager.d.ts +58 -0
- package/dist/src/utils/privacy/PrivacyManager.js +133 -0
- package/dist/src/utils/privacy/PrivacyManager.js.map +1 -0
- package/dist/src/utils/sandbox.js +10 -0
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js +0 -30
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"semantic-tokens.js","sourceRoot":"","sources":["../../../../src/ui/themes/semantic-tokens.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2025 Google LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/
|
6
|
+
/**
|
7
|
+
* Backward compatibility layer for existing Colors API
|
8
|
+
*
|
9
|
+
* This module re-exports the existing Colors API to maintain
|
10
|
+
* backward compatibility while the codebase transitions to
|
11
|
+
* semantic colors.
|
12
|
+
*/
|
13
|
+
export { Colors, ansi } from '../colors.js';
|
14
|
+
export { themeManager } from './theme-manager.js';
|
15
|
+
export { SemanticColors } from './semantic-tokens.js';
|
16
|
+
export { resolveSemanticColors } from './semantic-resolver.js';
|
17
|
+
/**
|
18
|
+
* Helper function to migrate from Colors to semantic colors
|
19
|
+
* This can be used during the transition period to understand
|
20
|
+
* how existing color usage maps to semantic tokens.
|
21
|
+
*/
|
22
|
+
export interface ColorMigrationMapping {
|
23
|
+
/** Maps Colors.* properties to semantic color paths */
|
24
|
+
readonly colorToSemanticMapping: Record<string, string>;
|
25
|
+
/** Maps semantic color paths to their current values */
|
26
|
+
readonly semanticToValueMapping: Record<string, string>;
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Gets a mapping between the existing Colors API and semantic colors
|
30
|
+
* for the currently active theme. This is useful for migration analysis.
|
31
|
+
*
|
32
|
+
* @returns Migration mapping information
|
33
|
+
*/
|
34
|
+
export declare function getColorMigrationMapping(): ColorMigrationMapping;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2025 Google LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/
|
6
|
+
/**
|
7
|
+
* Backward compatibility layer for existing Colors API
|
8
|
+
*
|
9
|
+
* This module re-exports the existing Colors API to maintain
|
10
|
+
* backward compatibility while the codebase transitions to
|
11
|
+
* semantic colors.
|
12
|
+
*/
|
13
|
+
// Re-export existing Colors API for backward compatibility
|
14
|
+
export { Colors, ansi } from '../colors.js';
|
15
|
+
// Export theme manager for direct access
|
16
|
+
export { themeManager } from './theme-manager.js';
|
17
|
+
export { resolveSemanticColors } from './semantic-resolver.js';
|
18
|
+
// Import for internal use
|
19
|
+
import { themeManager } from './theme-manager.js';
|
20
|
+
// Import Colors for dynamic access to current theme colors
|
21
|
+
import { Colors } from '../colors.js';
|
22
|
+
/**
|
23
|
+
* Gets a mapping between the existing Colors API and semantic colors
|
24
|
+
* for the currently active theme. This is useful for migration analysis.
|
25
|
+
*
|
26
|
+
* @returns Migration mapping information
|
27
|
+
*/
|
28
|
+
export function getColorMigrationMapping() {
|
29
|
+
const semanticColors = themeManager.getSemanticColors();
|
30
|
+
const colorToSemanticMapping = {
|
31
|
+
'Colors.Foreground': 'text.primary',
|
32
|
+
'Colors.Gray': 'text.secondary',
|
33
|
+
'Colors.AccentBlue': 'text.accent',
|
34
|
+
'Colors.AccentGreen': 'status.success',
|
35
|
+
'Colors.AccentYellow': 'status.warning',
|
36
|
+
'Colors.AccentRed': 'status.error',
|
37
|
+
'Colors.Background': 'background.primary',
|
38
|
+
'Colors.DiffAdded': 'background.secondary',
|
39
|
+
};
|
40
|
+
const semanticToValueMapping = {
|
41
|
+
'text.primary': semanticColors.text.primary,
|
42
|
+
'text.secondary': semanticColors.text.secondary,
|
43
|
+
'text.accent': semanticColors.text.accent,
|
44
|
+
'status.success': semanticColors.status.success,
|
45
|
+
'status.warning': semanticColors.status.warning,
|
46
|
+
'status.error': semanticColors.status.error,
|
47
|
+
'background.primary': semanticColors.background.primary,
|
48
|
+
'background.secondary': semanticColors.background.secondary,
|
49
|
+
'border.default': semanticColors.border.default,
|
50
|
+
'border.focused': semanticColors.border.focused,
|
51
|
+
// Also include current Colors API values for comparison
|
52
|
+
'Colors.Foreground': Colors.Foreground,
|
53
|
+
'Colors.Background': Colors.Background,
|
54
|
+
'Colors.AccentBlue': Colors.AccentBlue,
|
55
|
+
'Colors.AccentGreen': Colors.AccentGreen,
|
56
|
+
'Colors.AccentYellow': Colors.AccentYellow,
|
57
|
+
'Colors.AccentRed': Colors.AccentRed,
|
58
|
+
'Colors.Gray': Colors.Gray,
|
59
|
+
};
|
60
|
+
return {
|
61
|
+
colorToSemanticMapping,
|
62
|
+
semanticToValueMapping,
|
63
|
+
};
|
64
|
+
}
|
65
|
+
//# sourceMappingURL=theme-compat.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"theme-compat.js","sourceRoot":"","sources":["../../../../src/ui/themes/theme-compat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AAEH,2DAA2D;AAC3D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE5C,yCAAyC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,0BAA0B;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,2DAA2D;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAetC;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,cAAc,GAAG,YAAY,CAAC,iBAAiB,EAAE,CAAC;IAExD,MAAM,sBAAsB,GAAG;QAC7B,mBAAmB,EAAE,cAAc;QACnC,aAAa,EAAE,gBAAgB;QAC/B,mBAAmB,EAAE,aAAa;QAClC,oBAAoB,EAAE,gBAAgB;QACtC,qBAAqB,EAAE,gBAAgB;QACvC,kBAAkB,EAAE,cAAc;QAClC,mBAAmB,EAAE,oBAAoB;QACzC,kBAAkB,EAAE,sBAAsB;KAClC,CAAC;IAEX,MAAM,sBAAsB,GAAG;QAC7B,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO;QAC3C,gBAAgB,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS;QAC/C,aAAa,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM;QACzC,gBAAgB,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO;QAC/C,gBAAgB,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO;QAC/C,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK;QAC3C,oBAAoB,EAAE,cAAc,CAAC,UAAU,CAAC,OAAO;QACvD,sBAAsB,EAAE,cAAc,CAAC,UAAU,CAAC,SAAS;QAC3D,gBAAgB,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO;QAC/C,gBAAgB,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO;QAC/C,wDAAwD;QACxD,mBAAmB,EAAE,MAAM,CAAC,UAAU;QACtC,mBAAmB,EAAE,MAAM,CAAC,UAAU;QACtC,mBAAmB,EAAE,MAAM,CAAC,UAAU;QACtC,oBAAoB,EAAE,MAAM,CAAC,WAAW;QACxC,qBAAqB,EAAE,MAAM,CAAC,YAAY;QAC1C,kBAAkB,EAAE,MAAM,CAAC,SAAS;QACpC,aAAa,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC;IAEX,OAAO;QACL,sBAAsB;QACtB,sBAAsB;KACvB,CAAC;AACJ,CAAC"}
|
@@ -4,6 +4,7 @@
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
5
5
|
*/
|
6
6
|
import { Theme, ThemeType, CustomTheme } from './theme.js';
|
7
|
+
import { SemanticColors } from './semantic-tokens.js';
|
7
8
|
export interface ThemeDisplay {
|
8
9
|
name: string;
|
9
10
|
type: ThemeType;
|
@@ -14,6 +15,7 @@ declare class ThemeManager {
|
|
14
15
|
private readonly availableThemes;
|
15
16
|
private activeTheme;
|
16
17
|
private customThemes;
|
18
|
+
private semanticColorsCache;
|
17
19
|
constructor();
|
18
20
|
/**
|
19
21
|
* Loads custom themes from settings.
|
@@ -31,6 +33,12 @@ declare class ThemeManager {
|
|
31
33
|
* @returns The active theme.
|
32
34
|
*/
|
33
35
|
getActiveTheme(): Theme;
|
36
|
+
/**
|
37
|
+
* Gets semantic colors for the currently active theme.
|
38
|
+
* Results are cached for performance until the theme changes.
|
39
|
+
* @returns Semantic colors for the active theme.
|
40
|
+
*/
|
41
|
+
getSemanticColors(): SemanticColors;
|
34
42
|
/**
|
35
43
|
* Gets a list of custom theme names.
|
36
44
|
* @returns Array of custom theme names.
|
@@ -19,12 +19,14 @@ import { createCustomTheme, validateCustomTheme, } from './theme.js';
|
|
19
19
|
import { ANSI } from './ansi.js';
|
20
20
|
import { ANSILight } from './ansi-light.js';
|
21
21
|
import { NoColorTheme } from './no-color.js';
|
22
|
+
import { resolveSemanticColors } from './semantic-resolver.js';
|
22
23
|
import process from 'node:process';
|
23
24
|
export const DEFAULT_THEME = GreenScreen;
|
24
25
|
class ThemeManager {
|
25
26
|
availableThemes;
|
26
27
|
activeTheme;
|
27
28
|
customThemes = new Map();
|
29
|
+
semanticColorsCache = null;
|
28
30
|
constructor() {
|
29
31
|
this.availableThemes = [
|
30
32
|
AyuDark,
|
@@ -50,6 +52,8 @@ class ThemeManager {
|
|
50
52
|
*/
|
51
53
|
loadCustomThemes(customThemesSettings) {
|
52
54
|
this.customThemes.clear();
|
55
|
+
// Invalidate semantic colors cache when custom themes change
|
56
|
+
this.semanticColorsCache = null;
|
53
57
|
if (!customThemesSettings) {
|
54
58
|
return;
|
55
59
|
}
|
@@ -95,6 +99,8 @@ class ThemeManager {
|
|
95
99
|
return false;
|
96
100
|
}
|
97
101
|
this.activeTheme = theme;
|
102
|
+
// Invalidate semantic colors cache when theme changes
|
103
|
+
this.semanticColorsCache = null;
|
98
104
|
return true;
|
99
105
|
}
|
100
106
|
/**
|
@@ -111,6 +117,18 @@ class ThemeManager {
|
|
111
117
|
}
|
112
118
|
return this.activeTheme;
|
113
119
|
}
|
120
|
+
/**
|
121
|
+
* Gets semantic colors for the currently active theme.
|
122
|
+
* Results are cached for performance until the theme changes.
|
123
|
+
* @returns Semantic colors for the active theme.
|
124
|
+
*/
|
125
|
+
getSemanticColors() {
|
126
|
+
if (this.semanticColorsCache === null) {
|
127
|
+
const activeTheme = this.getActiveTheme();
|
128
|
+
this.semanticColorsCache = resolveSemanticColors(activeTheme.colors);
|
129
|
+
}
|
130
|
+
return this.semanticColorsCache;
|
131
|
+
}
|
114
132
|
/**
|
115
133
|
* Gets a list of custom theme names.
|
116
134
|
* @returns Array of custom theme names.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"theme-manager.js","sourceRoot":"","sources":["../../../../src/ui/themes/theme-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAIL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"theme-manager.js","sourceRoot":"","sources":["../../../../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K,QAAQ;wBACX,OAAO,CAAC,CAAC,CAAC,2BAA2B;oBACvC;wBACE,OAAO,CAAC,CAAC;gBACb,CAAC;YACH,CAAC,CAAC;YAEF,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC7D,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,cAAc,CAAC;YACxB,CAAC;YACD,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,SAAiB;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,eAAe,CAAC,SAA6B;QAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,8BAA8B;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CACpC,CAAC;QACF,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,2BAA2B;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;CACF;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
|
@@ -5,6 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
import React from 'react';
|
7
7
|
import { Theme } from '../themes/theme.js';
|
8
|
+
import { LoadedSettings } from '../../config/settings.js';
|
8
9
|
export declare function colorizeLine(line: string, language: string | null, theme?: Theme, overrideColor?: string): React.ReactNode;
|
9
10
|
/**
|
10
11
|
* Renders syntax-highlighted code for Ink applications using a selected theme.
|
@@ -15,4 +16,4 @@ export declare function colorizeLine(line: string, language: string | null, them
|
|
15
16
|
* @param overrideColor Optional color to use instead of syntax highlighting
|
16
17
|
* @returns A React.ReactNode containing Ink <Text> elements for the highlighted code.
|
17
18
|
*/
|
18
|
-
export declare function colorizeCode(code: string, language: string | null, availableHeight?: number, maxWidth?: number, theme?: Theme): React.ReactNode;
|
19
|
+
export declare function colorizeCode(code: string, language: string | null, availableHeight?: number, maxWidth?: number, theme?: Theme, settings?: LoadedSettings): React.ReactNode;
|
@@ -81,9 +81,10 @@ export function colorizeLine(line, language, theme, overrideColor) {
|
|
81
81
|
* @param overrideColor Optional color to use instead of syntax highlighting
|
82
82
|
* @returns A React.ReactNode containing Ink <Text> elements for the highlighted code.
|
83
83
|
*/
|
84
|
-
export function colorizeCode(code, language, availableHeight, maxWidth, theme) {
|
84
|
+
export function colorizeCode(code, language, availableHeight, maxWidth, theme, settings) {
|
85
85
|
const codeToHighlight = code.replace(/\n$/, '');
|
86
86
|
const activeTheme = theme || themeManager.getActiveTheme();
|
87
|
+
const showLineNumbers = settings?.merged.showLineNumbers ?? true;
|
87
88
|
try {
|
88
89
|
// Render the HAST tree using the adapted theme
|
89
90
|
// Apply the theme's default foreground color to the top-level Text element
|
@@ -101,7 +102,7 @@ export function colorizeCode(code, language, availableHeight, maxWidth, theme) {
|
|
101
102
|
}
|
102
103
|
return (_jsx(MaxSizedBox, { maxHeight: availableHeight, maxWidth: maxWidth, additionalHiddenLinesCount: hiddenLinesCount, overflowDirection: "top", children: lines.map((line, index) => {
|
103
104
|
const contentToRender = highlightAndRenderLine(line, language, activeTheme);
|
104
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: activeTheme.colors.Gray, children: `${String(index + 1 + hiddenLinesCount).padStart(padWidth, ' ')} ` }), _jsx(Text, { color: activeTheme.defaultColor, wrap: "wrap", children: contentToRender })] }, index));
|
105
|
+
return (_jsxs(Box, { children: [showLineNumbers && (_jsx(Text, { color: activeTheme.colors.Gray, children: `${String(index + 1 + hiddenLinesCount).padStart(padWidth, ' ')} ` })), _jsx(Text, { color: activeTheme.defaultColor, wrap: "wrap", children: contentToRender })] }, index));
|
105
106
|
}) }));
|
106
107
|
}
|
107
108
|
catch (error) {
|
@@ -110,7 +111,7 @@ export function colorizeCode(code, language, availableHeight, maxWidth, theme) {
|
|
110
111
|
// Also display line numbers in fallback
|
111
112
|
const lines = codeToHighlight.split('\n');
|
112
113
|
const padWidth = String(lines.length).length; // Calculate padding width based on number of lines
|
113
|
-
return (_jsx(MaxSizedBox, { maxHeight: availableHeight, maxWidth: maxWidth, overflowDirection: "top", children: lines.map((line, index) => (_jsxs(Box, { children: [_jsx(Text, { color: activeTheme.defaultColor, children: `${String(index + 1).padStart(padWidth, ' ')} ` }), _jsx(Text, { color: activeTheme.colors.Gray, children: line })] }, index))) }));
|
114
|
+
return (_jsx(MaxSizedBox, { maxHeight: availableHeight, maxWidth: maxWidth, overflowDirection: "top", children: lines.map((line, index) => (_jsxs(Box, { children: [showLineNumbers && (_jsx(Text, { color: activeTheme.defaultColor, children: `${String(index + 1).padStart(padWidth, ' ')} ` })), _jsx(Text, { color: activeTheme.colors.Gray, children: line })] }, index))) }));
|
114
115
|
}
|
115
116
|
}
|
116
117
|
//# sourceMappingURL=CodeColorizer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeColorizer.js","sourceRoot":"","sources":["../../../../src/ui/utils/CodeColorizer.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQlD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EACL,WAAW,EACX,kBAAkB,GACnB,MAAM,qCAAqC,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,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,mDAAmD;QACjG,OAAO,CACL,KAAC,WAAW,IACV,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAC,KAAK,YAEtB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,MAAC,GAAG,eACD,eAAe,IAAI,CAClB,KAAC,IAAI,IAAC,KAAK,EAAE,WAAW,CAAC,YAAY,YAClC,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,GAC3C,CACR,EACD,KAAC,IAAI,IAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,YAAG,IAAI,GAAQ,KAN3C,KAAK,CAOT,CACP,CAAC,GACU,CACf,CAAC;IACJ,CAAC;AACH,CAAC"}
|
@@ -10,6 +10,7 @@ import { Colors } from '../colors.js';
|
|
10
10
|
import { colorizeCode } from './CodeColorizer.js';
|
11
11
|
import { TableRenderer } from './TableRenderer.js';
|
12
12
|
import { RenderInline } from './InlineMarkdownRenderer.js';
|
13
|
+
import { useSettings } from '../contexts/SettingsContext.js';
|
13
14
|
// Constants for Markdown parsing and rendering
|
14
15
|
const EMPTY_LINE_HEIGHT = 1;
|
15
16
|
const CODE_BLOCK_PREFIX_PADDING = 1;
|
@@ -177,6 +178,7 @@ const MarkdownDisplayInternal = ({ text, isPending, availableTerminalHeight, ter
|
|
177
178
|
return _jsx(_Fragment, { children: contentBlocks });
|
178
179
|
};
|
179
180
|
const RenderCodeBlockInternal = ({ content, lang, isPending, availableTerminalHeight, terminalWidth, }) => {
|
181
|
+
const settings = useSettings();
|
180
182
|
const MIN_LINES_FOR_MESSAGE = 1; // Minimum lines to show before the "generating more" message
|
181
183
|
const RESERVED_LINES = 2; // Lines reserved for the message itself and potential padding
|
182
184
|
if (isPending && availableTerminalHeight !== undefined) {
|
@@ -187,12 +189,12 @@ const RenderCodeBlockInternal = ({ content, lang, isPending, availableTerminalHe
|
|
187
189
|
return (_jsx(Box, { paddingLeft: CODE_BLOCK_PREFIX_PADDING, children: _jsx(Text, { color: Colors.Gray, children: "... code is being written ..." }) }));
|
188
190
|
}
|
189
191
|
const truncatedContent = content.slice(0, MAX_CODE_LINES_WHEN_PENDING);
|
190
|
-
const colorizedTruncatedCode = colorizeCode(truncatedContent.join('\n'), lang, availableTerminalHeight, terminalWidth - CODE_BLOCK_PREFIX_PADDING);
|
192
|
+
const colorizedTruncatedCode = colorizeCode(truncatedContent.join('\n'), lang, availableTerminalHeight, terminalWidth - CODE_BLOCK_PREFIX_PADDING, undefined, settings);
|
191
193
|
return (_jsxs(Box, { paddingLeft: CODE_BLOCK_PREFIX_PADDING, flexDirection: "column", children: [colorizedTruncatedCode, _jsx(Text, { color: Colors.Gray, children: "... generating more ..." })] }));
|
192
194
|
}
|
193
195
|
}
|
194
196
|
const fullContent = content.join('\n');
|
195
|
-
const colorizedCode = colorizeCode(fullContent, lang, availableTerminalHeight, terminalWidth - CODE_BLOCK_PREFIX_PADDING);
|
197
|
+
const colorizedCode = colorizeCode(fullContent, lang, availableTerminalHeight, terminalWidth - CODE_BLOCK_PREFIX_PADDING, undefined, settings);
|
196
198
|
return (_jsx(Box, { paddingLeft: CODE_BLOCK_PREFIX_PADDING, flexDirection: "column", width: terminalWidth, flexShrink: 0, children: colorizedCode }));
|
197
199
|
};
|
198
200
|
const RenderCodeBlock = React.memo(RenderCodeBlockInternal);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MarkdownDisplay.js","sourceRoot":"","sources":["../../../../src/ui/utils/MarkdownDisplay.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,K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EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,GAAI,CAC9E,CAAC;AAEF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2025 Google LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/
|
6
|
+
export declare const BREAKPOINTS: {
|
7
|
+
readonly NARROW: 80;
|
8
|
+
readonly STANDARD: 120;
|
9
|
+
readonly WIDE: 160;
|
10
|
+
};
|
11
|
+
export type Breakpoint = keyof typeof BREAKPOINTS;
|
12
|
+
export declare function getBreakpoint(width: number): Breakpoint;
|
13
|
+
export declare function isNarrowWidth(width: number): boolean;
|
14
|
+
export declare function truncateMiddle(text: string, maxLength: number): string;
|
15
|
+
export declare function truncateStart(text: string, maxLength: number): string;
|
16
|
+
export declare function truncateEnd(text: string, maxLength: number): string;
|
@@ -0,0 +1,111 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2025 Google LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/
|
6
|
+
export const BREAKPOINTS = {
|
7
|
+
NARROW: 80,
|
8
|
+
STANDARD: 120,
|
9
|
+
WIDE: 160,
|
10
|
+
};
|
11
|
+
export function getBreakpoint(width) {
|
12
|
+
if (width < BREAKPOINTS.NARROW) {
|
13
|
+
return 'NARROW';
|
14
|
+
}
|
15
|
+
if (width <= BREAKPOINTS.STANDARD) {
|
16
|
+
return 'STANDARD';
|
17
|
+
}
|
18
|
+
return 'WIDE';
|
19
|
+
}
|
20
|
+
export function isNarrowWidth(width) {
|
21
|
+
return width < BREAKPOINTS.NARROW;
|
22
|
+
}
|
23
|
+
export function truncateMiddle(text, maxLength) {
|
24
|
+
if (text.length <= maxLength) {
|
25
|
+
return text;
|
26
|
+
}
|
27
|
+
if (maxLength <= 1) {
|
28
|
+
return '.';
|
29
|
+
}
|
30
|
+
if (maxLength <= 3) {
|
31
|
+
return '..';
|
32
|
+
}
|
33
|
+
const ellipsis = '...';
|
34
|
+
// For path-like strings, use smart path truncation
|
35
|
+
if (text.includes('/')) {
|
36
|
+
const segments = text.split('/');
|
37
|
+
if (segments.length < 2) {
|
38
|
+
// Not really a path, fall back to standard truncation
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
const firstDir = segments[0];
|
42
|
+
const filename = segments[segments.length - 1];
|
43
|
+
const parentDir = segments.length > 2 ? segments[segments.length - 2] : '';
|
44
|
+
// Try: firstDir + ... + parentDir + filename
|
45
|
+
if (parentDir && segments.length >= 3) {
|
46
|
+
const candidate = firstDir + ellipsis + '/' + parentDir + '/' + filename;
|
47
|
+
if (candidate.length <= maxLength) {
|
48
|
+
return candidate;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
// Try: firstDir + ... + filename
|
52
|
+
const candidate2 = firstDir + ellipsis + '/' + filename;
|
53
|
+
if (candidate2.length <= maxLength) {
|
54
|
+
return candidate2;
|
55
|
+
}
|
56
|
+
// Try: /firstChar + ... + endOfFilename (for very constrained cases)
|
57
|
+
if (maxLength <= 10) {
|
58
|
+
const firstChar = firstDir.length > 0 ? firstDir.charAt(0) : '/';
|
59
|
+
const availableForEnd = maxLength - firstChar.length - ellipsis.length - 1; // -1 for '/'
|
60
|
+
if (availableForEnd > 0) {
|
61
|
+
const endPart = filename.length <= availableForEnd
|
62
|
+
? filename
|
63
|
+
: filename.substring(filename.length - availableForEnd);
|
64
|
+
return firstChar + ellipsis + '/' + endPart;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
// Character-based fallback
|
68
|
+
const availableForStart = maxLength - ellipsis.length - filename.length - 1; // -1 for '/'
|
69
|
+
if (availableForStart > 0) {
|
70
|
+
const startPart = text.substring(0, availableForStart);
|
71
|
+
return startPart + ellipsis + '/' + filename;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
// Standard middle truncation for non-path strings
|
76
|
+
const availableSpace = maxLength - ellipsis.length;
|
77
|
+
const startChars = Math.ceil(availableSpace / 2);
|
78
|
+
const endChars = Math.floor(availableSpace / 2);
|
79
|
+
const start = text.substring(0, startChars);
|
80
|
+
const end = text.substring(text.length - endChars);
|
81
|
+
return start + ellipsis + end;
|
82
|
+
}
|
83
|
+
export function truncateStart(text, maxLength) {
|
84
|
+
if (text.length <= maxLength) {
|
85
|
+
return text;
|
86
|
+
}
|
87
|
+
if (maxLength <= 1) {
|
88
|
+
return '.';
|
89
|
+
}
|
90
|
+
if (maxLength <= 3) {
|
91
|
+
return '.'.repeat(maxLength);
|
92
|
+
}
|
93
|
+
const ellipsis = '...';
|
94
|
+
const endChars = maxLength - ellipsis.length;
|
95
|
+
return ellipsis + text.slice(-endChars);
|
96
|
+
}
|
97
|
+
export function truncateEnd(text, maxLength) {
|
98
|
+
if (text.length <= maxLength) {
|
99
|
+
return text;
|
100
|
+
}
|
101
|
+
if (maxLength <= 1) {
|
102
|
+
return '.';
|
103
|
+
}
|
104
|
+
if (maxLength <= 3) {
|
105
|
+
return '.'.repeat(maxLength);
|
106
|
+
}
|
107
|
+
const ellipsis = '...';
|
108
|
+
const keepChars = maxLength - ellipsis.length;
|
109
|
+
return text.substring(0, keepChars) + ellipsis;
|
110
|
+
}
|
111
|
+
//# sourceMappingURL=responsive.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"responsive.js","sourceRoot":"","sources":["../../../../src/ui/utils/responsive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,GAAG;IACb,IAAI,EAAE,GAAG;CACD,CAAC;AAIX,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,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AC,EAAE,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QACnB,OAAO,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC;IACvB,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;IAE9C,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC;AACjD,CAAC"}
|
@@ -3,6 +3,6 @@
|
|
3
3
|
* Copyright 2025 Google LLC
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
5
5
|
*/
|
6
|
-
export declare function registerCleanup(fn: () => void): void;
|
7
|
-
export declare function runExitCleanup(): void
|
6
|
+
export declare function registerCleanup(fn: (() => void) | (() => Promise<void>)): void;
|
7
|
+
export declare function runExitCleanup(): Promise<void>;
|
8
8
|
export declare function cleanupCheckpoints(): Promise<void>;
|
@@ -10,10 +10,10 @@ const cleanupFunctions = [];
|
|
10
10
|
export function registerCleanup(fn) {
|
11
11
|
cleanupFunctions.push(fn);
|
12
12
|
}
|
13
|
-
export function runExitCleanup() {
|
13
|
+
export async function runExitCleanup() {
|
14
14
|
for (const fn of cleanupFunctions) {
|
15
15
|
try {
|
16
|
-
fn();
|
16
|
+
await fn();
|
17
17
|
}
|
18
18
|
catch (_) {
|
19
19
|
// Ignore errors during cleanup.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../src/utils/cleanup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,gBAAgB,
|
1
|
+
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../src/utils/cleanup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,gBAAgB,GAAgD,EAAE,CAAC;AAEzE,MAAM,UAAU,eAAe,CAAC,EAAwC;IACtE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,KAAK,MAAM,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,EAAE,EAAE,CAAC;QACb,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,gCAAgC;QAClC,CAAC;IACH,CAAC;IACD,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,kBAAkB;AACjD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACjD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACpD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;IACrE,CAAC;AACH,CAAC"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2025 Vybestack LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/
|
6
|
+
import { IMessage, ITool } from '@vybestack/llxprt-code-core';
|
7
|
+
export interface RedactionPattern {
|
8
|
+
name: string;
|
9
|
+
pattern: RegExp;
|
10
|
+
replacement: string;
|
11
|
+
enabled: boolean;
|
12
|
+
}
|
13
|
+
export interface RedactionConfig {
|
14
|
+
redactApiKeys: boolean;
|
15
|
+
redactCredentials: boolean;
|
16
|
+
redactFilePaths: boolean;
|
17
|
+
redactUrls: boolean;
|
18
|
+
redactEmails: boolean;
|
19
|
+
redactPersonalInfo: boolean;
|
20
|
+
customPatterns?: RedactionPattern[];
|
21
|
+
}
|
22
|
+
export declare class ConversationDataRedactor {
|
23
|
+
private redactionConfig;
|
24
|
+
private redactionPatterns;
|
25
|
+
constructor(config?: Partial<RedactionConfig>);
|
26
|
+
/**
|
27
|
+
* Redact sensitive data from a conversation message
|
28
|
+
*/
|
29
|
+
redactMessage(message: IMessage, providerName: string): IMessage;
|
30
|
+
/**
|
31
|
+
* Redact sensitive data from tool definitions
|
32
|
+
*/
|
33
|
+
redactToolCall(tool: ITool): ITool;
|
34
|
+
/**
|
35
|
+
* Redact sensitive data from response content
|
36
|
+
*/
|
37
|
+
redactResponseContent(content: string, providerName: string): string;
|
38
|
+
/**
|
39
|
+
* Redact entire conversation consistently
|
40
|
+
*/
|
41
|
+
redactConversation(messages: IMessage[], providerName: string): IMessage[];
|
42
|
+
/**
|
43
|
+
* Redact API keys from content based on provider
|
44
|
+
*/
|
45
|
+
redactApiKeys(content: string, providerName: string): string;
|
46
|
+
/**
|
47
|
+
* Redact sensitive file paths
|
48
|
+
*/
|
49
|
+
redactSensitivePaths(content: string): string;
|
50
|
+
/**
|
51
|
+
* Redact personal identifiable information
|
52
|
+
*/
|
53
|
+
redactPersonalInfo(content: string): string;
|
54
|
+
private shouldRedact;
|
55
|
+
private redactContent;
|
56
|
+
private redactContentPart;
|
57
|
+
private redactToolParameters;
|
58
|
+
private redactFilePath;
|
59
|
+
private redactShellCommand;
|
60
|
+
private redactUrl;
|
61
|
+
private initializeRedactionPatterns;
|
62
|
+
private isPatternEnabled;
|
63
|
+
/**
|
64
|
+
* Update redaction configuration
|
65
|
+
*/
|
66
|
+
updateConfig(config: Partial<RedactionConfig>): void;
|
67
|
+
/**
|
68
|
+
* Get current redaction statistics
|
69
|
+
*/
|
70
|
+
getRedactionStats(content: string, providerName: string): RedactionStats;
|
71
|
+
}
|
72
|
+
export interface RedactionStats {
|
73
|
+
totalRedactions: number;
|
74
|
+
redactionsByType: Record<string, number>;
|
75
|
+
}
|