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,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 终端相关类型定义
|
|
3
|
-
*/
|
|
4
|
-
export interface TerminalSession {
|
|
5
|
-
sessionId: string;
|
|
6
|
-
pid?: number;
|
|
7
|
-
cwd: string;
|
|
8
|
-
shell: string;
|
|
9
|
-
user?: string;
|
|
10
|
-
hostname?: string;
|
|
11
|
-
environment: Record<string, string>;
|
|
12
|
-
startTime: Date;
|
|
13
|
-
lastActivity: Date;
|
|
14
|
-
}
|
|
15
|
-
export interface TerminalContext {
|
|
16
|
-
session: TerminalSession;
|
|
17
|
-
currentCommand?: string;
|
|
18
|
-
lastCommand?: string;
|
|
19
|
-
lastOutput?: string;
|
|
20
|
-
lastError?: string;
|
|
21
|
-
exitCode?: number;
|
|
22
|
-
isRunning: boolean;
|
|
23
|
-
runningProcess?: ProcessInfo;
|
|
24
|
-
recentCommands: string[];
|
|
25
|
-
systemInfo: SystemInfo;
|
|
26
|
-
projectInfo?: ProjectInfo;
|
|
27
|
-
}
|
|
28
|
-
export interface ProcessInfo {
|
|
29
|
-
pid: number;
|
|
30
|
-
name: string;
|
|
31
|
-
status: 'running' | 'sleeping' | 'stopped' | 'zombie';
|
|
32
|
-
cpu?: number;
|
|
33
|
-
memory?: number;
|
|
34
|
-
startTime?: Date;
|
|
35
|
-
command: string;
|
|
36
|
-
}
|
|
37
|
-
export interface SystemInfo {
|
|
38
|
-
platform: 'win32' | 'linux' | 'darwin' | 'freebsd' | 'sunos' | 'browser';
|
|
39
|
-
arch: string;
|
|
40
|
-
type: string;
|
|
41
|
-
release: string;
|
|
42
|
-
version?: string;
|
|
43
|
-
cpus: number;
|
|
44
|
-
totalMemory: number;
|
|
45
|
-
availableMemory?: number;
|
|
46
|
-
nodeVersion?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface ProjectInfo {
|
|
49
|
-
type?: 'git' | 'npm' | 'yarn' | 'maven' | 'gradle' | 'pip' | 'cargo' | 'go' | 'rust';
|
|
50
|
-
root: string;
|
|
51
|
-
name?: string;
|
|
52
|
-
version?: string;
|
|
53
|
-
dependencies?: string[];
|
|
54
|
-
scripts?: Record<string, string>;
|
|
55
|
-
description?: string;
|
|
56
|
-
language?: string;
|
|
57
|
-
framework?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface TerminalError {
|
|
60
|
-
type: 'command_not_found' | 'permission_denied' | 'file_not_found' | 'syntax_error' | 'runtime_error' | 'network_error' | 'unknown';
|
|
61
|
-
message: string;
|
|
62
|
-
command?: string;
|
|
63
|
-
exitCode?: number;
|
|
64
|
-
stack?: string;
|
|
65
|
-
suggestions?: string[];
|
|
66
|
-
timestamp: Date;
|
|
67
|
-
}
|
|
68
|
-
export interface BufferContent {
|
|
69
|
-
content: string;
|
|
70
|
-
cursorPosition: number;
|
|
71
|
-
selectionStart?: number;
|
|
72
|
-
selectionEnd?: number;
|
|
73
|
-
}
|
|
74
|
-
export interface CommandResult {
|
|
75
|
-
command: string;
|
|
76
|
-
exitCode: number;
|
|
77
|
-
stdout: string;
|
|
78
|
-
stderr: string;
|
|
79
|
-
duration: number;
|
|
80
|
-
timestamp: Date;
|
|
81
|
-
success: boolean;
|
|
82
|
-
}
|
|
83
|
-
export interface HistoryEntry {
|
|
84
|
-
command: string;
|
|
85
|
-
timestamp: Date;
|
|
86
|
-
exitCode?: number;
|
|
87
|
-
duration?: number;
|
|
88
|
-
cwd?: string;
|
|
89
|
-
}
|
|
90
|
-
export interface EnvironmentChange {
|
|
91
|
-
key: string;
|
|
92
|
-
oldValue?: string;
|
|
93
|
-
newValue: string;
|
|
94
|
-
timestamp: Date;
|
|
95
|
-
}
|
|
96
|
-
export interface TerminalTheme {
|
|
97
|
-
name: string;
|
|
98
|
-
foreground: string;
|
|
99
|
-
background: string;
|
|
100
|
-
colors: string[];
|
|
101
|
-
cursor: string;
|
|
102
|
-
}
|
|
103
|
-
export interface FileSystemState {
|
|
104
|
-
currentPath: string;
|
|
105
|
-
files: FileInfo[];
|
|
106
|
-
permissions: Record<string, string>;
|
|
107
|
-
}
|
|
108
|
-
export interface FileInfo {
|
|
109
|
-
name: string;
|
|
110
|
-
path: string;
|
|
111
|
-
type: 'file' | 'directory' | 'symlink' | 'device' | 'pipe' | 'socket';
|
|
112
|
-
size: number;
|
|
113
|
-
modified: Date;
|
|
114
|
-
permissions: string;
|
|
115
|
-
owner?: string;
|
|
116
|
-
group?: string;
|
|
117
|
-
}
|
|
118
|
-
export interface Hotkey {
|
|
119
|
-
key: string;
|
|
120
|
-
description: string;
|
|
121
|
-
action: string;
|
|
122
|
-
scope?: 'global' | 'terminal' | 'chat';
|
|
123
|
-
}
|
|
124
|
-
export interface TerminalCapability {
|
|
125
|
-
name: string;
|
|
126
|
-
supported: boolean;
|
|
127
|
-
version?: string;
|
|
128
|
-
}
|
|
129
|
-
export interface ClipboardContent {
|
|
130
|
-
text: string;
|
|
131
|
-
type: 'plain' | 'rich' | 'image' | 'file';
|
|
132
|
-
timestamp: Date;
|
|
133
|
-
}
|
|
134
|
-
export interface AutoCompleteCandidate {
|
|
135
|
-
value: string;
|
|
136
|
-
description?: string;
|
|
137
|
-
type: 'command' | 'file' | 'directory' | 'variable' | 'function';
|
|
138
|
-
icon?: string;
|
|
139
|
-
}
|
|
140
|
-
export interface TerminalNotification {
|
|
141
|
-
type: 'warning' | 'info' | 'error' | 'success';
|
|
142
|
-
title: string;
|
|
143
|
-
message: string;
|
|
144
|
-
timestamp: Date;
|
|
145
|
-
persistent?: boolean;
|
|
146
|
-
actions?: {
|
|
147
|
-
label: string;
|
|
148
|
-
action: () => void;
|
|
149
|
-
}[];
|
|
150
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 生成随机密钥
|
|
3
|
-
*/
|
|
4
|
-
export declare function generateKey(): string;
|
|
5
|
-
/**
|
|
6
|
-
* 生成随机初始化向量
|
|
7
|
-
*/
|
|
8
|
-
export declare function generateIV(): string;
|
|
9
|
-
/**
|
|
10
|
-
* 使用AES加密字符串
|
|
11
|
-
*/
|
|
12
|
-
export declare function encrypt(text: string, key: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* 使用AES解密字符串
|
|
15
|
-
*/
|
|
16
|
-
export declare function decrypt(encryptedText: string, key: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* 使用PBKDF2派生密钥
|
|
19
|
-
*/
|
|
20
|
-
export declare function deriveKey(password: string, salt: string, iterations?: number): string;
|
|
21
|
-
/**
|
|
22
|
-
* 生成加密盐值
|
|
23
|
-
*/
|
|
24
|
-
export declare function generateSalt(): string;
|
|
25
|
-
/**
|
|
26
|
-
* 安全的哈希函数
|
|
27
|
-
*/
|
|
28
|
-
export declare function hash(text: string, salt?: string): string;
|
|
29
|
-
/**
|
|
30
|
-
* 验证哈希值
|
|
31
|
-
*/
|
|
32
|
-
export declare function verifyHash(text: string, hashValue: string, salt?: string): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* 加密对象
|
|
35
|
-
*/
|
|
36
|
-
export declare function encryptObject(obj: any, key: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* 解密对象
|
|
39
|
-
*/
|
|
40
|
-
export declare function decryptObject<T>(encryptedText: string, key: string): T;
|
|
41
|
-
/**
|
|
42
|
-
* 生成令牌
|
|
43
|
-
*/
|
|
44
|
-
export declare function generateToken(length?: number): string;
|
|
45
|
-
/**
|
|
46
|
-
* Base64编码
|
|
47
|
-
*/
|
|
48
|
-
export declare function base64Encode(text: string): string;
|
|
49
|
-
/**
|
|
50
|
-
* Base64解码
|
|
51
|
-
*/
|
|
52
|
-
export declare function base64Decode(encodedText: string): string;
|
|
53
|
-
/**
|
|
54
|
-
* 安全地比较两个字符串(防止时序攻击)
|
|
55
|
-
*/
|
|
56
|
-
export declare function secureCompare(a: any, b: any): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* 清除敏感数据
|
|
59
|
-
*/
|
|
60
|
-
export declare function clearSensitiveData(obj: any): void;
|
|
61
|
-
/**
|
|
62
|
-
* 生成加密的配置对象
|
|
63
|
-
*/
|
|
64
|
-
export declare function createSecureConfig(data: any, masterPassword: string): {
|
|
65
|
-
encrypted: string;
|
|
66
|
-
salt: string;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* 解密配置对象
|
|
70
|
-
*/
|
|
71
|
-
export declare function parseSecureConfig(encryptedData: string, salt: string, masterPassword: string): any;
|
|
72
|
-
/**
|
|
73
|
-
* 检查密码强度并生成哈希
|
|
74
|
-
*/
|
|
75
|
-
export declare function hashPassword(password: string, salt?: string): {
|
|
76
|
-
hash: string;
|
|
77
|
-
salt: string;
|
|
78
|
-
valid: boolean;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* 验证密码
|
|
82
|
-
*/
|
|
83
|
-
export declare function verifyPassword(password: string, hash: string, salt: string): boolean;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 格式化工具类
|
|
3
|
-
* 提供各种数据格式化功能
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 格式化文件大小
|
|
7
|
-
*/
|
|
8
|
-
export declare function formatFileSize(bytes: number, decimals?: number): string;
|
|
9
|
-
/**
|
|
10
|
-
* 格式化持续时间
|
|
11
|
-
*/
|
|
12
|
-
export declare function formatDuration(milliseconds: number): string;
|
|
13
|
-
/**
|
|
14
|
-
* 格式化日期
|
|
15
|
-
*/
|
|
16
|
-
export declare function formatDate(date: Date, format?: 'short' | 'long' | 'relative'): string;
|
|
17
|
-
/**
|
|
18
|
-
* 格式化数字
|
|
19
|
-
*/
|
|
20
|
-
export declare function formatNumber(num: number, decimals?: number): string;
|
|
21
|
-
/**
|
|
22
|
-
* 格式化百分比
|
|
23
|
-
*/
|
|
24
|
-
export declare function formatPercentage(value: number, total: number, decimals?: number): string;
|
|
25
|
-
/**
|
|
26
|
-
* 格式化令牌数量
|
|
27
|
-
*/
|
|
28
|
-
export declare function formatTokens(tokens: number): string;
|
|
29
|
-
/**
|
|
30
|
-
* 格式化价格
|
|
31
|
-
*/
|
|
32
|
-
export declare function formatPrice(amount: number, currency?: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* 格式化命令输出(添加语法高亮)
|
|
35
|
-
*/
|
|
36
|
-
export declare function formatCommandOutput(output: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* 格式化风险级别
|
|
39
|
-
*/
|
|
40
|
-
export declare function formatRiskLevel(level: string): {
|
|
41
|
-
text: string;
|
|
42
|
-
class: string;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* 格式化置信度
|
|
46
|
-
*/
|
|
47
|
-
export declare function formatConfidence(confidence: number): {
|
|
48
|
-
text: string;
|
|
49
|
-
class: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* 截断文本
|
|
53
|
-
*/
|
|
54
|
-
export declare function truncateText(text: string, maxLength: number, suffix?: string): string;
|
|
55
|
-
/**
|
|
56
|
-
* 格式化错误信息
|
|
57
|
-
*/
|
|
58
|
-
export declare function formatError(error: Error | string): string;
|
|
59
|
-
/**
|
|
60
|
-
* 格式化字节数组
|
|
61
|
-
*/
|
|
62
|
-
export declare function formatBytes(bytes: number[], separator?: string): string;
|
|
63
|
-
/**
|
|
64
|
-
* 格式化JSON(美化输出)
|
|
65
|
-
*/
|
|
66
|
-
export declare function formatJson(json: string | object, indent?: number): string;
|
|
67
|
-
/**
|
|
68
|
-
* 格式化速度(bytes per second)
|
|
69
|
-
*/
|
|
70
|
-
export declare function formatSpeed(bytesPerSecond: number): string;
|
|
71
|
-
/**
|
|
72
|
-
* 格式化进度条
|
|
73
|
-
*/
|
|
74
|
-
export declare function formatProgressBar(current: number, total: number, width?: number): string;
|
|
75
|
-
/**
|
|
76
|
-
* 格式化文件路径(显示简化版本)
|
|
77
|
-
*/
|
|
78
|
-
export declare function formatFilePath(path: string, maxLength?: number): string;
|
|
79
|
-
/**
|
|
80
|
-
* 格式化列表为文本
|
|
81
|
-
*/
|
|
82
|
-
export declare function formatList(items: string[], delimiter?: string): string;
|
|
83
|
-
/**
|
|
84
|
-
* 格式化代码块
|
|
85
|
-
*/
|
|
86
|
-
export declare function formatCodeBlock(code: string, language?: string): string;
|
|
87
|
-
/**
|
|
88
|
-
* 转义HTML
|
|
89
|
-
*/
|
|
90
|
-
export declare function escapeHtml(text: string): string;
|
|
91
|
-
/**
|
|
92
|
-
* 清理文本(移除多余空白)
|
|
93
|
-
*/
|
|
94
|
-
export declare function cleanText(text: string): string;
|
|
95
|
-
/**
|
|
96
|
-
* 驼峰命名格式化
|
|
97
|
-
*/
|
|
98
|
-
export declare function toCamelCase(str: string): string;
|
|
99
|
-
/**
|
|
100
|
-
* 短横线命名格式化
|
|
101
|
-
*/
|
|
102
|
-
export declare function toKebabCase(str: string): string;
|
|
103
|
-
/**
|
|
104
|
-
* 下划线命名格式化
|
|
105
|
-
*/
|
|
106
|
-
export declare function toSnakeCase(str: string): string;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 验证工具类
|
|
3
|
-
* 提供各种数据验证和格式检查功能
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 验证API密钥格式
|
|
7
|
-
*/
|
|
8
|
-
export declare function validateApiKey(apiKey: string, provider: string): {
|
|
9
|
-
valid: boolean;
|
|
10
|
-
error?: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* 验证URL格式
|
|
14
|
-
*/
|
|
15
|
-
export declare function validateUrl(url: string): {
|
|
16
|
-
valid: boolean;
|
|
17
|
-
error?: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* 验证模型名称
|
|
21
|
-
*/
|
|
22
|
-
export declare function validateModel(model: string, _provider: string): {
|
|
23
|
-
valid: boolean;
|
|
24
|
-
error?: string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* 验证温度参数
|
|
28
|
-
*/
|
|
29
|
-
export declare function validateTemperature(temperature: number): {
|
|
30
|
-
valid: boolean;
|
|
31
|
-
error?: string;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* 验证最大令牌数
|
|
35
|
-
*/
|
|
36
|
-
export declare function validateMaxTokens(maxTokens: number): {
|
|
37
|
-
valid: boolean;
|
|
38
|
-
error?: string;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* 验证命令字符串
|
|
42
|
-
*/
|
|
43
|
-
export declare function validateCommand(command: string): {
|
|
44
|
-
valid: boolean;
|
|
45
|
-
error?: string;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* 验证邮箱格式
|
|
49
|
-
*/
|
|
50
|
-
export declare function validateEmail(email: string): {
|
|
51
|
-
valid: boolean;
|
|
52
|
-
error?: string;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* 验证密码强度
|
|
56
|
-
*/
|
|
57
|
-
export declare function validatePassword(password: string): {
|
|
58
|
-
valid: boolean;
|
|
59
|
-
error?: string;
|
|
60
|
-
score: number;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* 验证端口号
|
|
64
|
-
*/
|
|
65
|
-
export declare function validatePort(port: number): {
|
|
66
|
-
valid: boolean;
|
|
67
|
-
error?: string;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* 验证JSON格式
|
|
71
|
-
*/
|
|
72
|
-
export declare function validateJson(jsonString: string): {
|
|
73
|
-
valid: boolean;
|
|
74
|
-
error?: string;
|
|
75
|
-
data?: any;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* 验证文件路径
|
|
79
|
-
*/
|
|
80
|
-
export declare function validateFilePath(path: string): {
|
|
81
|
-
valid: boolean;
|
|
82
|
-
error?: string;
|
|
83
|
-
};
|
package/jest.config.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
preset: 'jest-preset-angular',
|
|
3
|
-
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
|
|
4
|
-
testMatch: [
|
|
5
|
-
'**/?(*.)+(spec|test).ts'
|
|
6
|
-
],
|
|
7
|
-
moduleFileExtensions: [
|
|
8
|
-
'ts',
|
|
9
|
-
'html',
|
|
10
|
-
'js',
|
|
11
|
-
'json'
|
|
12
|
-
],
|
|
13
|
-
moduleNameMapper: {
|
|
14
|
-
'^@/(.*)$': '<rootDir>/src/$1',
|
|
15
|
-
'\\.(css|less|scss|sass)$': 'identity-obj-proxy'
|
|
16
|
-
},
|
|
17
|
-
transform: {
|
|
18
|
-
'^.+\\.ts$': 'ts-jest',
|
|
19
|
-
'\\.(html|css|scss)$': 'jest-preset-angular'
|
|
20
|
-
},
|
|
21
|
-
transformIgnorePatterns: [
|
|
22
|
-
'node_modules/(?!.*\\.mjs$)'
|
|
23
|
-
],
|
|
24
|
-
collectCoverageFrom: [
|
|
25
|
-
'src/**/*.ts',
|
|
26
|
-
'!src/**/*.spec.ts',
|
|
27
|
-
'!src/**/*.d.ts',
|
|
28
|
-
'!src/main.ts',
|
|
29
|
-
'!src/index.ts'
|
|
30
|
-
],
|
|
31
|
-
coverageDirectory: 'coverage',
|
|
32
|
-
coverageReporters: [
|
|
33
|
-
'text',
|
|
34
|
-
'lcov',
|
|
35
|
-
'html'
|
|
36
|
-
],
|
|
37
|
-
coverageThreshold: {
|
|
38
|
-
global: {
|
|
39
|
-
branches: 70,
|
|
40
|
-
functions: 70,
|
|
41
|
-
lines: 70,
|
|
42
|
-
statements: 70
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
testEnvironment: 'jsdom',
|
|
46
|
-
verbose: true
|
|
47
|
-
};
|
package/webpack-docker.config.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
target: 'node',
|
|
5
|
-
entry: 'src/index.ts',
|
|
6
|
-
devtool: 'source-map',
|
|
7
|
-
context: __dirname,
|
|
8
|
-
mode: 'production',
|
|
9
|
-
output: {
|
|
10
|
-
path: path.resolve(__dirname, 'dist'),
|
|
11
|
-
filename: 'index.js',
|
|
12
|
-
pathinfo: true,
|
|
13
|
-
libraryTarget: 'umd',
|
|
14
|
-
devtoolModuleFilenameTemplate: 'webpack-tabby-ai-assistant:///[resource-path]',
|
|
15
|
-
},
|
|
16
|
-
resolve: {
|
|
17
|
-
modules: ['.', 'src', 'node_modules'].map(x => path.join(__dirname, x)),
|
|
18
|
-
extensions: ['.ts', '.js'],
|
|
19
|
-
},
|
|
20
|
-
module: {
|
|
21
|
-
rules: [
|
|
22
|
-
{
|
|
23
|
-
test: /\.ts$/,
|
|
24
|
-
loader: 'ts-loader',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
test: /\.scss/,
|
|
28
|
-
use: ['raw-loader', 'css-loader', 'sass-loader'],
|
|
29
|
-
},
|
|
30
|
-
{ test: /\.pug$/, use: ['pug-plain-loader'] },
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
externals: [
|
|
34
|
-
'fs',
|
|
35
|
-
'ngx-toastr',
|
|
36
|
-
'util',
|
|
37
|
-
/^rxjs/,
|
|
38
|
-
/^@angular/,
|
|
39
|
-
/^@ng-bootstrap/,
|
|
40
|
-
/^tabby-/,
|
|
41
|
-
]
|
|
42
|
-
}
|
package/webpack.config.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
target: 'node',
|
|
6
|
-
mode: 'development',
|
|
7
|
-
devtool: 'eval-source-map',
|
|
8
|
-
entry: './src/index.ts',
|
|
9
|
-
output: {
|
|
10
|
-
path: path.resolve(__dirname, 'dist'),
|
|
11
|
-
filename: 'index.js',
|
|
12
|
-
libraryTarget: 'commonjs2',
|
|
13
|
-
devtoolModuleFilenameTemplate: 'webpack-tabby-ai-assistant:///[resource-path]',
|
|
14
|
-
},
|
|
15
|
-
resolve: {
|
|
16
|
-
extensions: ['.ts', '.js'],
|
|
17
|
-
alias: {
|
|
18
|
-
'@': path.resolve(__dirname, 'src')
|
|
19
|
-
},
|
|
20
|
-
fallback: {
|
|
21
|
-
'os': false,
|
|
22
|
-
'path': false,
|
|
23
|
-
'crypto': false,
|
|
24
|
-
'stream': false,
|
|
25
|
-
'util': false
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
module: {
|
|
29
|
-
rules: [
|
|
30
|
-
{
|
|
31
|
-
test: /\.ts$/,
|
|
32
|
-
use: [
|
|
33
|
-
{ loader: 'ts-loader' },
|
|
34
|
-
{ loader: 'angular2-template-loader' }
|
|
35
|
-
],
|
|
36
|
-
exclude: /node_modules/
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
test: /\.html$/,
|
|
40
|
-
use: {
|
|
41
|
-
loader: 'raw-loader',
|
|
42
|
-
options: {
|
|
43
|
-
esModule: false
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
test: /\.scss$/,
|
|
49
|
-
use: [
|
|
50
|
-
'to-string-loader',
|
|
51
|
-
'css-loader',
|
|
52
|
-
'sass-loader',
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
test: /\.css$/,
|
|
57
|
-
use: {
|
|
58
|
-
loader: 'raw-loader',
|
|
59
|
-
options: {
|
|
60
|
-
esModule: false
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
externals: [
|
|
67
|
-
'tabby-core',
|
|
68
|
-
'tabby-terminal',
|
|
69
|
-
'tabby-settings',
|
|
70
|
-
'@angular/core',
|
|
71
|
-
'@angular/common',
|
|
72
|
-
'@angular/forms',
|
|
73
|
-
'@ng-bootstrap/ng-bootstrap',
|
|
74
|
-
'rxjs'
|
|
75
|
-
],
|
|
76
|
-
plugins: [
|
|
77
|
-
new webpack.DefinePlugin({
|
|
78
|
-
'process.env.NODE_ENV': JSON.stringify('development')
|
|
79
|
-
})
|
|
80
|
-
]
|
|
81
|
-
};
|