tabby-ai-assistant 1.0.8 → 1.0.10
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/components/chat/ai-sidebar.component.d.ts +16 -3
- package/dist/components/chat/chat-input.component.d.ts +4 -0
- package/dist/components/chat/chat-interface.component.d.ts +22 -1
- package/dist/components/chat/chat-settings.component.d.ts +21 -11
- package/dist/components/settings/ai-settings-tab.component.d.ts +14 -4
- package/dist/components/settings/general-settings.component.d.ts +43 -12
- package/dist/components/settings/provider-config.component.d.ts +110 -5
- package/dist/components/settings/security-settings.component.d.ts +14 -4
- package/dist/i18n/index.d.ts +48 -0
- package/dist/i18n/translations/en-US.d.ts +5 -0
- package/dist/i18n/translations/ja-JP.d.ts +5 -0
- package/dist/i18n/translations/zh-CN.d.ts +5 -0
- package/dist/i18n/types.d.ts +198 -0
- package/dist/index.js +1 -1
- package/dist/services/chat/ai-sidebar.service.d.ts +23 -1
- package/dist/services/core/theme.service.d.ts +53 -0
- package/dist/services/core/toast.service.d.ts +15 -0
- package/package.json +1 -1
- package/src/components/chat/ai-sidebar.component.scss +468 -0
- package/src/components/chat/ai-sidebar.component.ts +47 -344
- package/src/components/chat/chat-input.component.scss +2 -2
- package/src/components/chat/chat-input.component.ts +16 -5
- package/src/components/chat/chat-interface.component.html +11 -11
- package/src/components/chat/chat-interface.component.scss +410 -4
- package/src/components/chat/chat-interface.component.ts +105 -14
- package/src/components/chat/chat-message.component.scss +3 -3
- package/src/components/chat/chat-message.component.ts +3 -2
- package/src/components/chat/chat-settings.component.html +95 -61
- package/src/components/chat/chat-settings.component.scss +224 -50
- package/src/components/chat/chat-settings.component.ts +56 -30
- package/src/components/security/risk-confirm-dialog.component.scss +7 -7
- package/src/components/settings/ai-settings-tab.component.html +27 -27
- package/src/components/settings/ai-settings-tab.component.scss +34 -20
- package/src/components/settings/ai-settings-tab.component.ts +59 -20
- package/src/components/settings/general-settings.component.html +69 -40
- package/src/components/settings/general-settings.component.scss +151 -58
- package/src/components/settings/general-settings.component.ts +168 -55
- package/src/components/settings/provider-config.component.html +183 -60
- package/src/components/settings/provider-config.component.scss +332 -153
- package/src/components/settings/provider-config.component.ts +268 -19
- package/src/components/settings/security-settings.component.html +70 -39
- package/src/components/settings/security-settings.component.scss +104 -8
- package/src/components/settings/security-settings.component.ts +48 -10
- package/src/i18n/index.ts +129 -0
- package/src/i18n/translations/en-US.ts +193 -0
- package/src/i18n/translations/ja-JP.ts +193 -0
- package/src/i18n/translations/zh-CN.ts +193 -0
- package/src/i18n/types.ts +224 -0
- package/src/index.ts +6 -0
- package/src/services/chat/ai-sidebar.service.ts +157 -5
- package/src/services/core/theme.service.ts +480 -0
- package/src/services/core/toast.service.ts +36 -0
- package/src/styles/ai-assistant.scss +8 -88
- package/src/styles/themes.scss +161 -0
|
@@ -1,203 +1,382 @@
|
|
|
1
1
|
/* Provider Configuration Styles */
|
|
2
2
|
.provider-config {
|
|
3
|
-
max-width:
|
|
3
|
+
max-width: 1100px;
|
|
4
4
|
|
|
5
5
|
h3 {
|
|
6
6
|
margin: 0 0 1.5rem 0;
|
|
7
7
|
font-size: 1.25rem;
|
|
8
8
|
font-weight: 600;
|
|
9
|
-
color: var(--ai-
|
|
9
|
+
color: var(--ai-text-primary);
|
|
10
10
|
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* 分组样式 */
|
|
14
|
+
.provider-section {
|
|
15
|
+
margin-bottom: 32px;
|
|
11
16
|
|
|
12
|
-
.
|
|
17
|
+
.section-header {
|
|
13
18
|
display: flex;
|
|
14
|
-
|
|
15
|
-
gap:
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 12px;
|
|
21
|
+
margin-bottom: 16px;
|
|
22
|
+
|
|
23
|
+
i {
|
|
24
|
+
font-size: 20px;
|
|
25
|
+
color: var(--ai-primary);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
h4 {
|
|
29
|
+
margin: 0;
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
color: var(--ai-text-primary);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.section-desc {
|
|
36
|
+
color: var(--ai-text-secondary);
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
opacity: 0.8;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.local .section-header i {
|
|
43
|
+
color: #00bcd4;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* 卡片网格 */
|
|
48
|
+
.providers-grid {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
|
51
|
+
gap: 16px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* 卡片样式 */
|
|
55
|
+
.provider-card {
|
|
56
|
+
background: var(--ai-bg-secondary);
|
|
57
|
+
border: 1px solid var(--ai-border);
|
|
58
|
+
border-radius: 12px;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
transition: all 0.3s ease;
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
border-color: rgba(255, 255, 255, 0.2);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.configured {
|
|
67
|
+
border-color: var(--ai-primary);
|
|
68
|
+
border-width: 2px;
|
|
16
69
|
}
|
|
17
70
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
background-color: var(--ai-bg-secondary);
|
|
21
|
-
border-radius: 0.5rem;
|
|
22
|
-
border: 1px solid var(--ai-border);
|
|
71
|
+
&.expanded {
|
|
72
|
+
grid-column: 1 / -1;
|
|
23
73
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
border-width: 2px;
|
|
74
|
+
.card-body {
|
|
75
|
+
display: block;
|
|
27
76
|
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
28
79
|
|
|
29
|
-
|
|
30
|
-
|
|
80
|
+
/* 卡片头部 */
|
|
81
|
+
.card-header {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
padding: 16px;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
gap: 12px;
|
|
87
|
+
transition: background-color 0.2s;
|
|
88
|
+
|
|
89
|
+
&:hover {
|
|
90
|
+
background-color: rgba(255, 255, 255, 0.05);
|
|
91
|
+
}
|
|
31
92
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
93
|
+
.provider-icon {
|
|
94
|
+
width: 44px;
|
|
95
|
+
height: 44px;
|
|
96
|
+
border-radius: 10px;
|
|
97
|
+
background: rgba(0, 123, 255, 0.15);
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
flex-shrink: 0;
|
|
38
102
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
color: var(--ai-secondary);
|
|
43
|
-
}
|
|
103
|
+
i {
|
|
104
|
+
font-size: 20px;
|
|
105
|
+
color: var(--ai-primary);
|
|
44
106
|
}
|
|
45
107
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.btn {
|
|
52
|
-
padding: 0.5rem 1rem;
|
|
53
|
-
border: none;
|
|
54
|
-
border-radius: 0.375rem;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
transition: all 0.2s;
|
|
57
|
-
display: inline-flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
gap: 0.375rem;
|
|
60
|
-
font-size: 0.875rem;
|
|
61
|
-
font-weight: 500;
|
|
62
|
-
|
|
63
|
-
&.btn-primary {
|
|
64
|
-
background-color: var(--ai-primary);
|
|
65
|
-
color: white;
|
|
66
|
-
|
|
67
|
-
&:hover {
|
|
68
|
-
background-color: #0056b3;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&.btn-secondary {
|
|
73
|
-
background-color: var(--ai-secondary);
|
|
74
|
-
color: white;
|
|
75
|
-
|
|
76
|
-
&:hover {
|
|
77
|
-
background-color: #5a6268;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&.btn-danger {
|
|
82
|
-
background-color: var(--ai-danger);
|
|
83
|
-
color: white;
|
|
84
|
-
|
|
85
|
-
&:hover {
|
|
86
|
-
background-color: #c82333;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
108
|
+
&.local {
|
|
109
|
+
background: rgba(0, 188, 212, 0.15);
|
|
110
|
+
|
|
111
|
+
i {
|
|
112
|
+
color: #00bcd4;
|
|
89
113
|
}
|
|
90
114
|
}
|
|
91
115
|
}
|
|
92
116
|
|
|
93
|
-
.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
border-top: 1px solid var(--ai-border);
|
|
117
|
+
.provider-info {
|
|
118
|
+
flex: 1;
|
|
119
|
+
min-width: 0;
|
|
97
120
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
121
|
+
h5 {
|
|
122
|
+
margin: 0 0 4px 0;
|
|
123
|
+
font-size: 16px;
|
|
124
|
+
font-weight: 600;
|
|
125
|
+
color: var(--ai-text-primary);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.status-row {
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: 12px;
|
|
103
132
|
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.expand-icon {
|
|
136
|
+
color: var(--ai-text-secondary);
|
|
137
|
+
font-size: 14px;
|
|
138
|
+
padding: 8px;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 状态徽章 */
|
|
143
|
+
.status-badge {
|
|
144
|
+
display: inline-block;
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
padding: 2px 8px;
|
|
147
|
+
border-radius: 4px;
|
|
148
|
+
background: rgba(255, 255, 255, 0.1);
|
|
149
|
+
color: var(--ai-text-secondary);
|
|
150
|
+
|
|
151
|
+
&.active {
|
|
152
|
+
background: rgba(76, 175, 80, 0.2);
|
|
153
|
+
color: #4caf50;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* 在线状态 */
|
|
158
|
+
.online-status {
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
gap: 4px;
|
|
162
|
+
font-size: 12px;
|
|
163
|
+
|
|
164
|
+
i {
|
|
165
|
+
font-size: 8px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* 卡片内容 */
|
|
170
|
+
.card-body {
|
|
171
|
+
padding: 0 16px 16px;
|
|
172
|
+
border-top: 1px solid var(--ai-border);
|
|
173
|
+
animation: slideDown 0.3s ease;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@keyframes slideDown {
|
|
177
|
+
from {
|
|
178
|
+
opacity: 0;
|
|
179
|
+
transform: translateY(-10px);
|
|
180
|
+
}
|
|
181
|
+
to {
|
|
182
|
+
opacity: 1;
|
|
183
|
+
transform: translateY(0);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* 配置表单 */
|
|
188
|
+
.config-form {
|
|
189
|
+
padding-top: 16px;
|
|
190
|
+
|
|
191
|
+
.form-row {
|
|
192
|
+
display: grid;
|
|
193
|
+
grid-template-columns: 1fr 1fr;
|
|
194
|
+
gap: 16px;
|
|
195
|
+
margin-bottom: 16px;
|
|
196
|
+
}
|
|
104
197
|
|
|
105
|
-
|
|
106
|
-
|
|
198
|
+
.form-group {
|
|
199
|
+
margin-bottom: 16px;
|
|
107
200
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
201
|
+
label {
|
|
202
|
+
display: block;
|
|
203
|
+
font-weight: 500;
|
|
204
|
+
margin-bottom: 6px;
|
|
205
|
+
color: var(--ai-text-primary);
|
|
206
|
+
font-size: 0.875rem;
|
|
114
207
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
208
|
+
.required {
|
|
209
|
+
color: var(--ai-danger);
|
|
210
|
+
margin-left: 4px;
|
|
119
211
|
}
|
|
212
|
+
}
|
|
120
213
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&::placeholder {
|
|
138
|
-
color: var(--ai-secondary);
|
|
139
|
-
opacity: 0.6;
|
|
140
|
-
}
|
|
214
|
+
.form-control {
|
|
215
|
+
width: 100%;
|
|
216
|
+
padding: 10px 12px;
|
|
217
|
+
border: 1px solid var(--ai-border);
|
|
218
|
+
border-radius: 8px;
|
|
219
|
+
background-color: var(--ai-bg-primary);
|
|
220
|
+
color: var(--ai-text-primary);
|
|
221
|
+
font-size: 0.875rem;
|
|
222
|
+
transition: border-color 0.2s, box-shadow 0.2s;
|
|
223
|
+
|
|
224
|
+
&:focus {
|
|
225
|
+
outline: none;
|
|
226
|
+
border-color: var(--ai-primary);
|
|
227
|
+
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
|
|
141
228
|
}
|
|
142
229
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
230
|
+
&::placeholder {
|
|
231
|
+
color: var(--ai-text-secondary);
|
|
232
|
+
opacity: 0.6;
|
|
146
233
|
}
|
|
147
234
|
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.toggle-switch {
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 8px;
|
|
241
|
+
|
|
242
|
+
input[type="checkbox"] {
|
|
243
|
+
width: 18px;
|
|
244
|
+
height: 18px;
|
|
245
|
+
accent-color: var(--ai-primary);
|
|
246
|
+
}
|
|
148
247
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
248
|
+
label {
|
|
249
|
+
margin: 0;
|
|
250
|
+
font-weight: normal;
|
|
251
|
+
font-size: 14px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
153
255
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
256
|
+
/* 操作按钮 */
|
|
257
|
+
.form-actions {
|
|
258
|
+
display: flex;
|
|
259
|
+
gap: 12px;
|
|
260
|
+
margin-top: 20px;
|
|
261
|
+
padding-top: 16px;
|
|
262
|
+
border-top: 1px solid var(--ai-border);
|
|
263
|
+
|
|
264
|
+
.btn {
|
|
265
|
+
padding: 10px 20px;
|
|
266
|
+
border: none;
|
|
267
|
+
border-radius: 8px;
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
transition: all 0.2s;
|
|
270
|
+
display: inline-flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 8px;
|
|
273
|
+
font-size: 14px;
|
|
274
|
+
font-weight: 500;
|
|
275
|
+
|
|
276
|
+
&.btn-primary {
|
|
277
|
+
background-color: var(--ai-primary);
|
|
278
|
+
color: white;
|
|
279
|
+
|
|
280
|
+
&:hover {
|
|
281
|
+
background-color: #0056b3;
|
|
158
282
|
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&.btn-secondary {
|
|
286
|
+
background-color: var(--ai-text-secondary);
|
|
287
|
+
color: white;
|
|
159
288
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
font-weight: normal;
|
|
289
|
+
&:hover {
|
|
290
|
+
background-color: #5a6268;
|
|
163
291
|
}
|
|
164
292
|
}
|
|
165
293
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
padding: 0.625rem 1.25rem;
|
|
173
|
-
border: none;
|
|
174
|
-
border-radius: 0.375rem;
|
|
175
|
-
cursor: pointer;
|
|
176
|
-
transition: all 0.2s;
|
|
177
|
-
display: inline-flex;
|
|
178
|
-
align-items: center;
|
|
179
|
-
gap: 0.5rem;
|
|
180
|
-
font-size: 0.875rem;
|
|
181
|
-
font-weight: 500;
|
|
182
|
-
|
|
183
|
-
&.btn-primary {
|
|
184
|
-
background-color: var(--ai-primary);
|
|
185
|
-
color: white;
|
|
186
|
-
|
|
187
|
-
&:hover {
|
|
188
|
-
background-color: #0056b3;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
294
|
+
&.btn-info {
|
|
295
|
+
background-color: #00bcd4;
|
|
296
|
+
color: white;
|
|
297
|
+
|
|
298
|
+
&:hover {
|
|
299
|
+
background-color: #00acc1;
|
|
191
300
|
}
|
|
192
301
|
}
|
|
193
302
|
}
|
|
194
303
|
}
|
|
195
304
|
|
|
305
|
+
/* 输入框密码显示切换 */
|
|
306
|
+
.input-with-toggle {
|
|
307
|
+
position: relative;
|
|
308
|
+
display: flex;
|
|
309
|
+
align-items: center;
|
|
310
|
+
|
|
311
|
+
.form-control {
|
|
312
|
+
padding-right: 40px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.btn-toggle-visibility {
|
|
316
|
+
position: absolute;
|
|
317
|
+
right: 8px;
|
|
318
|
+
background: transparent;
|
|
319
|
+
border: none;
|
|
320
|
+
color: var(--ai-text-secondary);
|
|
321
|
+
cursor: pointer;
|
|
322
|
+
padding: 4px 8px;
|
|
323
|
+
display: flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
justify-content: center;
|
|
326
|
+
|
|
327
|
+
&:hover {
|
|
328
|
+
color: var(--ai-text-primary);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* 表单验证状态 */
|
|
334
|
+
.form-control {
|
|
335
|
+
&.is-valid {
|
|
336
|
+
border-color: var(--ai-success, #4caf50);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
&.is-invalid {
|
|
340
|
+
border-color: var(--ai-warning, #ff9800);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.validation-feedback {
|
|
345
|
+
font-size: 0.85em;
|
|
346
|
+
margin-top: 4px;
|
|
347
|
+
display: flex;
|
|
348
|
+
align-items: center;
|
|
349
|
+
gap: 4px;
|
|
350
|
+
|
|
351
|
+
&.valid {
|
|
352
|
+
color: var(--ai-success, #4caf50);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
&.invalid {
|
|
356
|
+
color: var(--ai-warning, #ff9800);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
i {
|
|
360
|
+
font-size: 0.9em;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
196
364
|
/* 响应式设计 */
|
|
197
365
|
@media (max-width: 768px) {
|
|
198
|
-
.
|
|
199
|
-
|
|
200
|
-
|
|
366
|
+
.providers-grid {
|
|
367
|
+
grid-template-columns: 1fr;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.config-form .form-row {
|
|
371
|
+
grid-template-columns: 1fr;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.form-actions {
|
|
375
|
+
flex-direction: column;
|
|
376
|
+
|
|
377
|
+
.btn {
|
|
378
|
+
width: 100%;
|
|
379
|
+
justify-content: center;
|
|
201
380
|
}
|
|
202
381
|
}
|
|
203
|
-
}
|
|
382
|
+
}
|