tabby-ai-assistant 1.0.9 → 1.0.11
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/index.js +1 -1
- package/package.json +3 -3
- package/src/components/chat/ai-sidebar.component.scss +43 -0
- package/src/components/chat/ai-sidebar.component.ts +43 -1
- package/src/components/settings/ai-settings-tab.component.html +13 -5
- package/src/components/settings/ai-settings-tab.component.scss +164 -33
- package/src/components/settings/ai-settings-tab.component.ts +1 -0
- package/src/components/settings/context-settings.component.html +87 -0
- package/src/components/settings/context-settings.component.scss +133 -0
- package/src/components/settings/context-settings.component.ts +91 -0
- package/src/components/settings/provider-config.component.html +46 -12
- package/src/components/settings/provider-config.component.scss +59 -0
- package/src/components/settings/provider-config.component.ts +112 -15
- package/src/i18n/translations/en-US.ts +27 -1
- package/src/i18n/translations/ja-JP.ts +27 -1
- package/src/i18n/translations/zh-CN.ts +27 -1
- package/src/i18n/types.ts +28 -0
- package/src/index.ts +6 -0
- package/src/services/chat/chat-session.service.ts +91 -2
- package/src/services/context/manager.ts +33 -2
- package/src/services/core/ai-assistant.service.ts +35 -11
- package/src/services/core/config-provider.service.ts +66 -0
- package/src/services/core/toast.service.ts +36 -0
- package/src/services/providers/anthropic-provider.service.ts +12 -4
- package/src/services/providers/glm-provider.service.ts +12 -4
- package/src/services/providers/minimax-provider.service.ts +12 -4
- package/src/types/ai.types.ts +3 -3
- package/src/types/provider.types.ts +1 -0
- package/dist/components/chat/ai-sidebar.component.d.ts +0 -160
- package/dist/components/chat/chat-input.component.d.ts +0 -69
- package/dist/components/chat/chat-interface.component.d.ts +0 -124
- package/dist/components/chat/chat-message.component.d.ts +0 -53
- package/dist/components/chat/chat-settings.component.d.ts +0 -72
- package/dist/components/common/error-message.component.d.ts +0 -11
- package/dist/components/common/loading-spinner.component.d.ts +0 -4
- package/dist/components/security/consent-dialog.component.d.ts +0 -11
- package/dist/components/security/password-prompt.component.d.ts +0 -10
- package/dist/components/security/risk-confirm-dialog.component.d.ts +0 -36
- package/dist/components/settings/ai-settings-tab.component.d.ts +0 -82
- package/dist/components/settings/general-settings.component.d.ts +0 -94
- package/dist/components/settings/provider-config.component.d.ts +0 -273
- package/dist/components/settings/security-settings.component.d.ts +0 -33
- package/dist/components/terminal/ai-toolbar-button.component.d.ts +0 -10
- package/dist/components/terminal/command-preview.component.d.ts +0 -53
- package/dist/components/terminal/command-suggestion.component.d.ts +0 -16
- package/dist/i18n/index.d.ts +0 -48
- package/dist/i18n/translations/en-US.d.ts +0 -5
- package/dist/i18n/translations/ja-JP.d.ts +0 -5
- package/dist/i18n/translations/zh-CN.d.ts +0 -5
- package/dist/i18n/types.d.ts +0 -198
- package/dist/index-full.d.ts +0 -8
- package/dist/index-minimal.d.ts +0 -3
- package/dist/index.d.ts +0 -12
- package/dist/main.d.ts +0 -8
- package/dist/providers/tabby/ai-config.provider.d.ts +0 -70
- package/dist/providers/tabby/ai-hotkey.provider.d.ts +0 -15
- package/dist/providers/tabby/ai-settings-tab.provider.d.ts +0 -11
- package/dist/providers/tabby/ai-toolbar-button.provider.d.ts +0 -16
- package/dist/services/chat/ai-sidebar.service.d.ts +0 -111
- package/dist/services/chat/chat-history.service.d.ts +0 -145
- package/dist/services/chat/chat-session.service.d.ts +0 -113
- package/dist/services/chat/command-generator.service.d.ts +0 -49
- package/dist/services/context/compaction.d.ts +0 -90
- package/dist/services/context/manager.d.ts +0 -69
- package/dist/services/context/memory.d.ts +0 -116
- package/dist/services/context/token-budget.d.ts +0 -105
- package/dist/services/core/ai-assistant.service.d.ts +0 -127
- package/dist/services/core/ai-provider-manager.service.d.ts +0 -119
- package/dist/services/core/checkpoint.service.d.ts +0 -130
- package/dist/services/core/config-provider.service.d.ts +0 -137
- package/dist/services/core/logger.service.d.ts +0 -21
- package/dist/services/core/theme.service.d.ts +0 -53
- package/dist/services/platform/escape-sequence.service.d.ts +0 -132
- package/dist/services/platform/platform-detection.service.d.ts +0 -146
- package/dist/services/providers/anthropic-provider.service.d.ts +0 -44
- package/dist/services/providers/base-provider.service.d.ts +0 -142
- package/dist/services/providers/glm-provider.service.d.ts +0 -96
- package/dist/services/providers/minimax-provider.service.d.ts +0 -102
- package/dist/services/providers/ollama-provider.service.d.ts +0 -76
- package/dist/services/providers/openai-compatible.service.d.ts +0 -44
- package/dist/services/providers/openai-provider.service.d.ts +0 -43
- package/dist/services/providers/vllm-provider.service.d.ts +0 -82
- package/dist/services/security/consent-manager.service.d.ts +0 -65
- package/dist/services/security/password-manager.service.d.ts +0 -67
- package/dist/services/security/risk-assessment.service.d.ts +0 -65
- package/dist/services/security/security-validator.service.d.ts +0 -36
- package/dist/services/terminal/buffer-analyzer.service.d.ts +0 -128
- package/dist/services/terminal/command-analyzer.service.d.ts +0 -20
- package/dist/services/terminal/context-menu.service.d.ts +0 -24
- package/dist/services/terminal/hotkey.service.d.ts +0 -28
- package/dist/services/terminal/terminal-context.service.d.ts +0 -100
- package/dist/services/terminal/terminal-manager.service.d.ts +0 -185
- package/dist/services/terminal/terminal-tools.service.d.ts +0 -79
- package/dist/types/ai.types.d.ts +0 -199
- package/dist/types/provider.types.d.ts +0 -105
- package/dist/types/security.types.d.ts +0 -85
- package/dist/types/terminal.types.d.ts +0 -150
- package/dist/utils/encryption.utils.d.ts +0 -83
- package/dist/utils/formatting.utils.d.ts +0 -106
- package/dist/utils/validation.utils.d.ts +0 -83
- package/jest.config.js +0 -47
- package/webpack-docker.config.js +0 -42
- package/webpack.config.js +0 -81
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { OnInit, OnDestroy, ElementRef, AfterViewChecked, AfterViewInit } from '@angular/core';
|
|
2
|
-
import { ChatMessage } from '../../types/ai.types';
|
|
3
|
-
import { AiAssistantService } from '../../services/core/ai-assistant.service';
|
|
4
|
-
import { ConfigProviderService } from '../../services/core/config-provider.service';
|
|
5
|
-
import { LoggerService } from '../../services/core/logger.service';
|
|
6
|
-
import { ChatHistoryService } from '../../services/chat/chat-history.service';
|
|
7
|
-
import { AiSidebarService } from '../../services/chat/ai-sidebar.service';
|
|
8
|
-
import { ThemeService } from '../../services/core/theme.service';
|
|
9
|
-
/**
|
|
10
|
-
* AI Sidebar 组件 - 替代 ChatInterfaceComponent
|
|
11
|
-
* 使用内联模板和样式,支持 Tabby 主题
|
|
12
|
-
*/
|
|
13
|
-
export declare class AiSidebarComponent implements OnInit, OnDestroy, AfterViewChecked, AfterViewInit {
|
|
14
|
-
private aiService;
|
|
15
|
-
private config;
|
|
16
|
-
private logger;
|
|
17
|
-
private chatHistory;
|
|
18
|
-
private themeService;
|
|
19
|
-
displayStyle: string;
|
|
20
|
-
flexDirection: string;
|
|
21
|
-
heightStyle: string;
|
|
22
|
-
widthStyle: string;
|
|
23
|
-
overflowStyle: string;
|
|
24
|
-
chatContainerRef: ElementRef;
|
|
25
|
-
textInput: ElementRef<HTMLTextAreaElement>;
|
|
26
|
-
sidebarService: AiSidebarService;
|
|
27
|
-
messages: ChatMessage[];
|
|
28
|
-
isLoading: boolean;
|
|
29
|
-
currentProvider: string;
|
|
30
|
-
currentSessionId: string;
|
|
31
|
-
showScrollTop: boolean;
|
|
32
|
-
showScrollBottom: boolean;
|
|
33
|
-
inputValue: string;
|
|
34
|
-
isComposing: boolean;
|
|
35
|
-
charLimit: number;
|
|
36
|
-
private destroy$;
|
|
37
|
-
private shouldScrollToBottom;
|
|
38
|
-
constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, chatHistory: ChatHistoryService, themeService: ThemeService);
|
|
39
|
-
ngOnInit(): void;
|
|
40
|
-
ngOnDestroy(): void;
|
|
41
|
-
ngAfterViewInit(): void;
|
|
42
|
-
/**
|
|
43
|
-
* 强制设置滚动容器样式
|
|
44
|
-
* 使用 JavaScript 直接设置,优先级最高
|
|
45
|
-
*/
|
|
46
|
-
private forceScrollStyles;
|
|
47
|
-
ngAfterViewChecked(): void;
|
|
48
|
-
/**
|
|
49
|
-
* 加载当前提供商信息
|
|
50
|
-
*/
|
|
51
|
-
private loadCurrentProvider;
|
|
52
|
-
/**
|
|
53
|
-
* 加载聊天历史
|
|
54
|
-
*/
|
|
55
|
-
private loadChatHistory;
|
|
56
|
-
/**
|
|
57
|
-
* 发送欢迎消息
|
|
58
|
-
*/
|
|
59
|
-
private sendWelcomeMessage;
|
|
60
|
-
/**
|
|
61
|
-
* 处理发送消息
|
|
62
|
-
*/
|
|
63
|
-
onSendMessage(content: string): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* 清空聊天记录
|
|
66
|
-
*/
|
|
67
|
-
clearChat(): void;
|
|
68
|
-
/**
|
|
69
|
-
* 导出聊天记录
|
|
70
|
-
*/
|
|
71
|
-
exportChat(): void;
|
|
72
|
-
/**
|
|
73
|
-
* 切换提供商
|
|
74
|
-
*/
|
|
75
|
-
switchProvider(): Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
* 隐藏侧边栏
|
|
78
|
-
*/
|
|
79
|
-
hideSidebar(): void;
|
|
80
|
-
/**
|
|
81
|
-
* 滚动到底部(公开方法)
|
|
82
|
-
*/
|
|
83
|
-
scrollToBottom(): void;
|
|
84
|
-
/**
|
|
85
|
-
* 滚动到顶部
|
|
86
|
-
*/
|
|
87
|
-
scrollToTop(): void;
|
|
88
|
-
/**
|
|
89
|
-
* 实际执行滚动到底部
|
|
90
|
-
*/
|
|
91
|
-
private performScrollToBottom;
|
|
92
|
-
/**
|
|
93
|
-
* 处理滚动事件
|
|
94
|
-
*/
|
|
95
|
-
onScroll(event: Event): void;
|
|
96
|
-
/**
|
|
97
|
-
* 检查滚动状态(初始化时调用)
|
|
98
|
-
*/
|
|
99
|
-
private checkScrollState;
|
|
100
|
-
/**
|
|
101
|
-
* 更新滚动按钮显示状态
|
|
102
|
-
*/
|
|
103
|
-
private updateScrollButtons;
|
|
104
|
-
/**
|
|
105
|
-
* 保存聊天历史
|
|
106
|
-
*/
|
|
107
|
-
private saveChatHistory;
|
|
108
|
-
/**
|
|
109
|
-
* 生成会话 ID
|
|
110
|
-
*/
|
|
111
|
-
private generateSessionId;
|
|
112
|
-
/**
|
|
113
|
-
* 生成唯一ID
|
|
114
|
-
*/
|
|
115
|
-
private generateId;
|
|
116
|
-
/**
|
|
117
|
-
* 获取消息时间格式
|
|
118
|
-
*/
|
|
119
|
-
formatTimestamp(timestamp: Date): string;
|
|
120
|
-
/**
|
|
121
|
-
* 格式化消息内容(支持换行和基本格式化)
|
|
122
|
-
*/
|
|
123
|
-
formatMessage(content: string): string;
|
|
124
|
-
/**
|
|
125
|
-
* 检查是否为今天的消息
|
|
126
|
-
*/
|
|
127
|
-
isToday(date: Date): boolean;
|
|
128
|
-
/**
|
|
129
|
-
* 检查是否为同一天的消息
|
|
130
|
-
*/
|
|
131
|
-
isSameDay(date1: Date, date2: Date): boolean;
|
|
132
|
-
/**
|
|
133
|
-
* 处理键盘事件
|
|
134
|
-
*/
|
|
135
|
-
onKeydown(event: KeyboardEvent): void;
|
|
136
|
-
/**
|
|
137
|
-
* 处理输入事件
|
|
138
|
-
*/
|
|
139
|
-
onInput(event: Event): void;
|
|
140
|
-
/**
|
|
141
|
-
* 提交消息
|
|
142
|
-
*/
|
|
143
|
-
submit(): void;
|
|
144
|
-
/**
|
|
145
|
-
* 自动调整输入框高度
|
|
146
|
-
*/
|
|
147
|
-
private autoResize;
|
|
148
|
-
/**
|
|
149
|
-
* 获取字符计数
|
|
150
|
-
*/
|
|
151
|
-
getCharCount(): number;
|
|
152
|
-
/**
|
|
153
|
-
* 检查是否接近限制
|
|
154
|
-
*/
|
|
155
|
-
isNearLimit(): boolean;
|
|
156
|
-
/**
|
|
157
|
-
* 检查是否超过限制
|
|
158
|
-
*/
|
|
159
|
-
isOverLimit(): boolean;
|
|
160
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, ElementRef, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
-
import { ConfigProviderService } from '../../services/core/config-provider.service';
|
|
3
|
-
export declare class ChatInputComponent implements OnInit, OnDestroy {
|
|
4
|
-
private config;
|
|
5
|
-
disabled: boolean;
|
|
6
|
-
placeholder: string;
|
|
7
|
-
send: EventEmitter<string>;
|
|
8
|
-
textInput: ElementRef<HTMLTextAreaElement>;
|
|
9
|
-
inputValue: string;
|
|
10
|
-
private inputSubject;
|
|
11
|
-
private destroy$;
|
|
12
|
-
isComposing: boolean;
|
|
13
|
-
enterToSend: boolean;
|
|
14
|
-
constructor(config: ConfigProviderService);
|
|
15
|
-
ngOnInit(): void;
|
|
16
|
-
ngOnDestroy(): void;
|
|
17
|
-
/**
|
|
18
|
-
* 处理输入变化
|
|
19
|
-
*/
|
|
20
|
-
onInputChange(value: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* 处理键盘事件
|
|
23
|
-
*/
|
|
24
|
-
onKeydown(event: KeyboardEvent): void;
|
|
25
|
-
/**
|
|
26
|
-
* 处理输入事件
|
|
27
|
-
*/
|
|
28
|
-
onInput(event: Event): void;
|
|
29
|
-
/**
|
|
30
|
-
* 处理composition开始(输入法)
|
|
31
|
-
*/
|
|
32
|
-
onCompositionStart(): void;
|
|
33
|
-
/**
|
|
34
|
-
* 处理composition结束(输入法)
|
|
35
|
-
*/
|
|
36
|
-
onCompositionEnd(): void;
|
|
37
|
-
/**
|
|
38
|
-
* 提交消息
|
|
39
|
-
*/
|
|
40
|
-
submit(): void;
|
|
41
|
-
/**
|
|
42
|
-
* 清空输入
|
|
43
|
-
*/
|
|
44
|
-
clear(): void;
|
|
45
|
-
/**
|
|
46
|
-
* 自动调整高度
|
|
47
|
-
*/
|
|
48
|
-
private autoResize;
|
|
49
|
-
/**
|
|
50
|
-
* 获取字符计数
|
|
51
|
-
*/
|
|
52
|
-
getCharCount(): number;
|
|
53
|
-
/**
|
|
54
|
-
* 获取字符限制
|
|
55
|
-
*/
|
|
56
|
-
getCharLimit(): number;
|
|
57
|
-
/**
|
|
58
|
-
* 检查是否接近限制
|
|
59
|
-
*/
|
|
60
|
-
isNearLimit(): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* 检查是否超过限制
|
|
63
|
-
*/
|
|
64
|
-
isOverLimit(): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* 聚焦输入框
|
|
67
|
-
*/
|
|
68
|
-
focus(): void;
|
|
69
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { OnInit, OnDestroy, ElementRef, AfterViewChecked } from '@angular/core';
|
|
2
|
-
import { ChatMessage } from '../../types/ai.types';
|
|
3
|
-
import { AiAssistantService } from '../../services/core/ai-assistant.service';
|
|
4
|
-
import { ConfigProviderService } from '../../services/core/config-provider.service';
|
|
5
|
-
import { LoggerService } from '../../services/core/logger.service';
|
|
6
|
-
import { ChatHistoryService } from '../../services/chat/chat-history.service';
|
|
7
|
-
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
8
|
-
import { TranslateService } from '../../i18n';
|
|
9
|
-
export declare class ChatInterfaceComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|
10
|
-
private aiService;
|
|
11
|
-
private config;
|
|
12
|
-
private logger;
|
|
13
|
-
private modal;
|
|
14
|
-
private chatHistory;
|
|
15
|
-
private translate;
|
|
16
|
-
chatContainerRef: ElementRef;
|
|
17
|
-
messages: ChatMessage[];
|
|
18
|
-
isLoading: boolean;
|
|
19
|
-
currentProvider: string;
|
|
20
|
-
currentSessionId: string;
|
|
21
|
-
showScrollTop: boolean;
|
|
22
|
-
showScrollBottom: boolean;
|
|
23
|
-
showTimestamps: boolean;
|
|
24
|
-
showAvatars: boolean;
|
|
25
|
-
soundEnabled: boolean;
|
|
26
|
-
compactMode: boolean;
|
|
27
|
-
fontSize: number;
|
|
28
|
-
t: any;
|
|
29
|
-
private destroy$;
|
|
30
|
-
private shouldScrollToBottom;
|
|
31
|
-
private notificationSound;
|
|
32
|
-
constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, modal: NgbModal, chatHistory: ChatHistoryService, translate: TranslateService);
|
|
33
|
-
ngOnInit(): void;
|
|
34
|
-
/**
|
|
35
|
-
* 加载 UI 设置
|
|
36
|
-
*/
|
|
37
|
-
private loadUISettings;
|
|
38
|
-
/**
|
|
39
|
-
* 应用存储的 UI 设置
|
|
40
|
-
*/
|
|
41
|
-
private applyStoredSettings;
|
|
42
|
-
ngOnDestroy(): void;
|
|
43
|
-
ngAfterViewChecked(): void;
|
|
44
|
-
/**
|
|
45
|
-
* 加载当前提供商信息
|
|
46
|
-
*/
|
|
47
|
-
private loadCurrentProvider;
|
|
48
|
-
/**
|
|
49
|
-
* 加载聊天历史
|
|
50
|
-
*/
|
|
51
|
-
private loadChatHistory;
|
|
52
|
-
/**
|
|
53
|
-
* 发送欢迎消息
|
|
54
|
-
*/
|
|
55
|
-
private sendWelcomeMessage;
|
|
56
|
-
/**
|
|
57
|
-
* 处理发送消息
|
|
58
|
-
*/
|
|
59
|
-
onSendMessage(content: string): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* 清空聊天记录
|
|
62
|
-
*/
|
|
63
|
-
clearChat(): void;
|
|
64
|
-
/**
|
|
65
|
-
* 导出聊天记录
|
|
66
|
-
*/
|
|
67
|
-
exportChat(): void;
|
|
68
|
-
/**
|
|
69
|
-
* 切换提供商
|
|
70
|
-
*/
|
|
71
|
-
switchProvider(): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* 滚动到底部(公开方法)
|
|
74
|
-
*/
|
|
75
|
-
scrollToBottom(): void;
|
|
76
|
-
/**
|
|
77
|
-
* 滚动到顶部
|
|
78
|
-
*/
|
|
79
|
-
scrollToTop(): void;
|
|
80
|
-
/**
|
|
81
|
-
* 实际执行滚动到底部
|
|
82
|
-
*/
|
|
83
|
-
private performScrollToBottom;
|
|
84
|
-
/**
|
|
85
|
-
* 处理滚动事件
|
|
86
|
-
*/
|
|
87
|
-
onScroll(event: Event): void;
|
|
88
|
-
/**
|
|
89
|
-
* 检查滚动状态(初始化时调用)
|
|
90
|
-
*/
|
|
91
|
-
private checkScrollState;
|
|
92
|
-
/**
|
|
93
|
-
* 更新滚动按钮显示状态
|
|
94
|
-
*/
|
|
95
|
-
private updateScrollButtons;
|
|
96
|
-
/**
|
|
97
|
-
* 保存聊天历史
|
|
98
|
-
*/
|
|
99
|
-
private saveChatHistory;
|
|
100
|
-
/**
|
|
101
|
-
* 生成会话 ID
|
|
102
|
-
*/
|
|
103
|
-
private generateSessionId;
|
|
104
|
-
/**
|
|
105
|
-
* 生成唯一ID
|
|
106
|
-
*/
|
|
107
|
-
private generateId;
|
|
108
|
-
/**
|
|
109
|
-
* 获取消息时间格式
|
|
110
|
-
*/
|
|
111
|
-
formatTimestamp(timestamp: Date): string;
|
|
112
|
-
/**
|
|
113
|
-
* 播放提示音
|
|
114
|
-
*/
|
|
115
|
-
private playNotificationSound;
|
|
116
|
-
/**
|
|
117
|
-
* 检查是否为今天的消息
|
|
118
|
-
*/
|
|
119
|
-
isToday(date: Date): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* 检查是否为同一天的消息
|
|
122
|
-
*/
|
|
123
|
-
isSameDay(date1: Date, date2: Date): boolean;
|
|
124
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { ChatMessage } from '../../types/ai.types';
|
|
3
|
-
export declare class ChatMessageComponent {
|
|
4
|
-
message: ChatMessage;
|
|
5
|
-
showAvatar: boolean;
|
|
6
|
-
showTimestamp: boolean;
|
|
7
|
-
isGrouped: boolean;
|
|
8
|
-
messageClick: EventEmitter<ChatMessage>;
|
|
9
|
-
messageAction: EventEmitter<{
|
|
10
|
-
action: string;
|
|
11
|
-
message: ChatMessage;
|
|
12
|
-
}>;
|
|
13
|
-
/**
|
|
14
|
-
* 处理消息点击
|
|
15
|
-
*/
|
|
16
|
-
onMessageClick(): void;
|
|
17
|
-
/**
|
|
18
|
-
* 处理消息操作
|
|
19
|
-
*/
|
|
20
|
-
onAction(action: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* 复制消息内容
|
|
23
|
-
*/
|
|
24
|
-
copyMessage(): void;
|
|
25
|
-
/**
|
|
26
|
-
* 重新生成响应
|
|
27
|
-
*/
|
|
28
|
-
regenerateResponse(): void;
|
|
29
|
-
/**
|
|
30
|
-
* 标记为有用
|
|
31
|
-
*/
|
|
32
|
-
markAsHelpful(): void;
|
|
33
|
-
/**
|
|
34
|
-
* 标记为无用
|
|
35
|
-
*/
|
|
36
|
-
markAsNotHelpful(): void;
|
|
37
|
-
/**
|
|
38
|
-
* 格式化时间
|
|
39
|
-
*/
|
|
40
|
-
formatTime(timestamp: Date): string;
|
|
41
|
-
/**
|
|
42
|
-
* 检查是否为用户消息
|
|
43
|
-
*/
|
|
44
|
-
isUserMessage(): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* 检查是否为AI消息
|
|
47
|
-
*/
|
|
48
|
-
isAssistantMessage(): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* 检查是否为系统消息
|
|
51
|
-
*/
|
|
52
|
-
isSystemMessage(): boolean;
|
|
53
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
-
import { ConfigProviderService } from '../../services/core/config-provider.service';
|
|
3
|
-
import { LoggerService } from '../../services/core/logger.service';
|
|
4
|
-
import { ThemeService } from '../../services/core/theme.service';
|
|
5
|
-
import { TranslateService } from '../../i18n';
|
|
6
|
-
export declare class ChatSettingsComponent implements OnInit, OnDestroy {
|
|
7
|
-
private config;
|
|
8
|
-
private logger;
|
|
9
|
-
private translate;
|
|
10
|
-
private themeService;
|
|
11
|
-
settings: {
|
|
12
|
-
chatHistoryEnabled: boolean;
|
|
13
|
-
maxChatHistory: number;
|
|
14
|
-
autoSaveChat: boolean;
|
|
15
|
-
theme: string;
|
|
16
|
-
fontSize: number;
|
|
17
|
-
compactMode: boolean;
|
|
18
|
-
showTimestamps: boolean;
|
|
19
|
-
showAvatars: boolean;
|
|
20
|
-
enterToSend: boolean;
|
|
21
|
-
soundEnabled: boolean;
|
|
22
|
-
};
|
|
23
|
-
t: any;
|
|
24
|
-
fontSizes: number[];
|
|
25
|
-
private destroy$;
|
|
26
|
-
constructor(config: ConfigProviderService, logger: LoggerService, translate: TranslateService, themeService: ThemeService);
|
|
27
|
-
ngOnInit(): void;
|
|
28
|
-
ngOnDestroy(): void;
|
|
29
|
-
/**
|
|
30
|
-
* 更新主题标签翻译
|
|
31
|
-
*/
|
|
32
|
-
private updateThemeLabels;
|
|
33
|
-
/**
|
|
34
|
-
* 获取主题选项
|
|
35
|
-
*/
|
|
36
|
-
get themes(): {
|
|
37
|
-
value: string;
|
|
38
|
-
label: any;
|
|
39
|
-
}[];
|
|
40
|
-
/**
|
|
41
|
-
* 加载设置
|
|
42
|
-
*/
|
|
43
|
-
private loadSettings;
|
|
44
|
-
/**
|
|
45
|
-
* 保存设置
|
|
46
|
-
*/
|
|
47
|
-
saveSetting(key: string, value: any): void;
|
|
48
|
-
/**
|
|
49
|
-
* 更新主题
|
|
50
|
-
*/
|
|
51
|
-
updateTheme(theme: string): void;
|
|
52
|
-
/**
|
|
53
|
-
* 更新字体大小
|
|
54
|
-
*/
|
|
55
|
-
updateFontSize(size: number): void;
|
|
56
|
-
/**
|
|
57
|
-
* 切换紧凑模式
|
|
58
|
-
*/
|
|
59
|
-
toggleCompactMode(): void;
|
|
60
|
-
/**
|
|
61
|
-
* 清空聊天历史
|
|
62
|
-
*/
|
|
63
|
-
clearChatHistory(): void;
|
|
64
|
-
/**
|
|
65
|
-
* 导出聊天设置
|
|
66
|
-
*/
|
|
67
|
-
exportSettings(): void;
|
|
68
|
-
/**
|
|
69
|
-
* 重置为默认设置
|
|
70
|
-
*/
|
|
71
|
-
resetToDefaults(): void;
|
|
72
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
export declare class ErrorMessageComponent {
|
|
3
|
-
type: 'error' | 'warning' | 'info' | 'success';
|
|
4
|
-
title: string;
|
|
5
|
-
message: string;
|
|
6
|
-
details: string;
|
|
7
|
-
dismissible: boolean;
|
|
8
|
-
dismissed: EventEmitter<void>;
|
|
9
|
-
getIconClass(): string;
|
|
10
|
-
onDismiss(): void;
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
2
|
-
import { RiskLevel } from '../../types/security.types';
|
|
3
|
-
export declare class ConsentDialogComponent {
|
|
4
|
-
activeModal: NgbActiveModal;
|
|
5
|
-
command: string;
|
|
6
|
-
riskLevel: RiskLevel;
|
|
7
|
-
rememberChoice: boolean;
|
|
8
|
-
constructor(activeModal: NgbActiveModal);
|
|
9
|
-
confirm(): void;
|
|
10
|
-
cancel(): void;
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
2
|
-
export declare class PasswordPromptComponent {
|
|
3
|
-
activeModal: NgbActiveModal;
|
|
4
|
-
title: string;
|
|
5
|
-
password: string;
|
|
6
|
-
errorMessage: string;
|
|
7
|
-
constructor(activeModal: NgbActiveModal);
|
|
8
|
-
submit(): void;
|
|
9
|
-
cancel(): void;
|
|
10
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
3
|
-
import { RiskLevel } from '../../types/security.types';
|
|
4
|
-
export declare class RiskConfirmDialogComponent {
|
|
5
|
-
activeModal: NgbActiveModal;
|
|
6
|
-
command: string;
|
|
7
|
-
explanation: string;
|
|
8
|
-
riskLevel: RiskLevel;
|
|
9
|
-
suggestions: string[];
|
|
10
|
-
confirmed: EventEmitter<boolean>;
|
|
11
|
-
constructor(activeModal: NgbActiveModal);
|
|
12
|
-
/**
|
|
13
|
-
* 确认执行
|
|
14
|
-
*/
|
|
15
|
-
confirm(): void;
|
|
16
|
-
/**
|
|
17
|
-
* 取消执行
|
|
18
|
-
*/
|
|
19
|
-
cancel(): void;
|
|
20
|
-
/**
|
|
21
|
-
* 获取风险级别文本
|
|
22
|
-
*/
|
|
23
|
-
getRiskLevelText(): string;
|
|
24
|
-
/**
|
|
25
|
-
* 获取风险级别颜色
|
|
26
|
-
*/
|
|
27
|
-
getRiskLevelColor(): string;
|
|
28
|
-
/**
|
|
29
|
-
* 获取风险级别图标
|
|
30
|
-
*/
|
|
31
|
-
getRiskLevelIcon(): string;
|
|
32
|
-
/**
|
|
33
|
-
* 是否为高风险
|
|
34
|
-
*/
|
|
35
|
-
isHighRisk(): boolean;
|
|
36
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
-
import { AiAssistantService } from '../../services/core/ai-assistant.service';
|
|
3
|
-
import { ConfigProviderService } from '../../services/core/config-provider.service';
|
|
4
|
-
import { LoggerService } from '../../services/core/logger.service';
|
|
5
|
-
import { TranslateService } from '../../i18n';
|
|
6
|
-
export declare class AiSettingsTabComponent implements OnInit, OnDestroy {
|
|
7
|
-
private aiService;
|
|
8
|
-
private config;
|
|
9
|
-
private logger;
|
|
10
|
-
private translate;
|
|
11
|
-
activeTab: string;
|
|
12
|
-
isEnabled: boolean;
|
|
13
|
-
currentProvider: string;
|
|
14
|
-
providerStatus: any;
|
|
15
|
-
pluginVersion: string;
|
|
16
|
-
t: any;
|
|
17
|
-
tabs: {
|
|
18
|
-
id: string;
|
|
19
|
-
labelKey: string;
|
|
20
|
-
icon: string;
|
|
21
|
-
}[];
|
|
22
|
-
private destroy$;
|
|
23
|
-
constructor(aiService: AiAssistantService, config: ConfigProviderService, logger: LoggerService, translate: TranslateService);
|
|
24
|
-
ngOnInit(): void;
|
|
25
|
-
ngOnDestroy(): void;
|
|
26
|
-
/**
|
|
27
|
-
* 更新 Tab 标签
|
|
28
|
-
*/
|
|
29
|
-
private updateTabLabels;
|
|
30
|
-
/**
|
|
31
|
-
* 加载设置
|
|
32
|
-
*/
|
|
33
|
-
private loadSettings;
|
|
34
|
-
/**
|
|
35
|
-
* 加载提供商状态
|
|
36
|
-
*/
|
|
37
|
-
private loadProviderStatus;
|
|
38
|
-
/**
|
|
39
|
-
* 切换标签页
|
|
40
|
-
*/
|
|
41
|
-
switchTab(tabId: string): void;
|
|
42
|
-
/**
|
|
43
|
-
* 切换启用状态
|
|
44
|
-
*/
|
|
45
|
-
toggleEnabled(): void;
|
|
46
|
-
/**
|
|
47
|
-
* 切换提供商
|
|
48
|
-
*/
|
|
49
|
-
switchProvider(providerName: string): void;
|
|
50
|
-
/**
|
|
51
|
-
* 刷新提供商状态
|
|
52
|
-
*/
|
|
53
|
-
refreshProviderStatus(): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* 获取提供商图标类名
|
|
56
|
-
*/
|
|
57
|
-
getProviderIcon(providerName: string): string;
|
|
58
|
-
/**
|
|
59
|
-
* 获取提供商状态颜色
|
|
60
|
-
*/
|
|
61
|
-
getProviderStatusColor(healthy: boolean): string;
|
|
62
|
-
/**
|
|
63
|
-
* 获取提供商状态文本
|
|
64
|
-
*/
|
|
65
|
-
getProviderStatusText(healthy: boolean): string;
|
|
66
|
-
/**
|
|
67
|
-
* 验证配置
|
|
68
|
-
*/
|
|
69
|
-
validateConfig(): Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* 导出配置
|
|
72
|
-
*/
|
|
73
|
-
exportConfig(): void;
|
|
74
|
-
/**
|
|
75
|
-
* 导入配置
|
|
76
|
-
*/
|
|
77
|
-
importConfig(): void;
|
|
78
|
-
/**
|
|
79
|
-
* 重置为默认配置
|
|
80
|
-
*/
|
|
81
|
-
resetToDefaults(): void;
|
|
82
|
-
}
|