@opensumi/ide-ai-native 3.9.1-next-1748943529.0 → 3.9.1-next-1748944723.0
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/lib/browser/components/ChatMentionInput.d.ts.map +1 -1
- package/lib/browser/components/ChatMentionInput.js +18 -3
- package/lib/browser/components/ChatMentionInput.js.map +1 -1
- package/lib/browser/components/components.module.less +2 -7
- package/lib/browser/components/mention-input/mention-input.d.ts.map +1 -1
- package/lib/browser/components/mention-input/mention-input.js +21 -1
- package/lib/browser/components/mention-input/mention-input.js.map +1 -1
- package/lib/browser/components/mention-input/mention-input.module.less +0 -1
- package/lib/browser/components/mention-input/mention-select.d.ts +28 -0
- package/lib/browser/components/mention-input/mention-select.d.ts.map +1 -0
- package/lib/browser/components/mention-input/mention-select.js +136 -0
- package/lib/browser/components/mention-input/mention-select.js.map +1 -0
- package/lib/browser/components/mention-input/mention-select.module.less +297 -0
- package/lib/browser/components/mention-input/types.d.ts +7 -6
- package/lib/browser/components/mention-input/types.d.ts.map +1 -1
- package/lib/browser/components/mention-input/types.js.map +1 -1
- package/package.json +25 -25
- package/src/browser/components/ChatMentionInput.tsx +26 -4
- package/src/browser/components/components.module.less +2 -7
- package/src/browser/components/mention-input/mention-input.module.less +0 -1
- package/src/browser/components/mention-input/mention-input.tsx +30 -3
- package/src/browser/components/mention-input/mention-select.module.less +297 -0
- package/src/browser/components/mention-input/mention-select.tsx +256 -0
- package/src/browser/components/mention-input/types.ts +8 -7
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
.mention_select {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
|
|
5
|
+
&.size_small {
|
|
6
|
+
.select_trigger {
|
|
7
|
+
height: 20px;
|
|
8
|
+
padding: 0 6px;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.size_medium {
|
|
14
|
+
.select_trigger {
|
|
15
|
+
height: 32px;
|
|
16
|
+
padding: 0 12px;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.size_large {
|
|
22
|
+
.select_trigger {
|
|
23
|
+
height: 40px;
|
|
24
|
+
padding: 0 16px;
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.disabled {
|
|
30
|
+
opacity: 0.6;
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
|
|
33
|
+
.select_trigger {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
background-color: var(--input-background-disabled);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.select_trigger {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
background-color: var(--input-background);
|
|
44
|
+
border: 1px solid var(--input-border);
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
transition: all 0.2s;
|
|
48
|
+
opacity: 0.7;
|
|
49
|
+
|
|
50
|
+
&:hover:not(.disabled) {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.select_content {
|
|
56
|
+
flex: 1;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.selected_option {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 6px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.option_icon {
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.option_label {
|
|
72
|
+
flex: 1;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
text-overflow: ellipsis;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.option_badge {
|
|
79
|
+
display: inline-block;
|
|
80
|
+
padding: 2px 6px;
|
|
81
|
+
border-radius: 10px;
|
|
82
|
+
font-size: 10px;
|
|
83
|
+
color: white;
|
|
84
|
+
background-color: var(--badge-background);
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.placeholder {
|
|
89
|
+
color: var(--input-placeholder-foreground);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.dropdown_arrow {
|
|
93
|
+
margin-left: 8px;
|
|
94
|
+
transition: transform 0.2s;
|
|
95
|
+
color: var(--icon-foreground);
|
|
96
|
+
|
|
97
|
+
&.open {
|
|
98
|
+
transform: rotate(180deg);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dropdown {
|
|
103
|
+
position: absolute;
|
|
104
|
+
left: 0;
|
|
105
|
+
right: 0;
|
|
106
|
+
z-index: 1000;
|
|
107
|
+
background-color: var(--editor-background);
|
|
108
|
+
border: 1px solid var(--dropdown-border);
|
|
109
|
+
border-radius: 6px;
|
|
110
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.05);
|
|
111
|
+
max-height: 400px;
|
|
112
|
+
min-width: 300px;
|
|
113
|
+
overflow-y: auto;
|
|
114
|
+
padding: 4px;
|
|
115
|
+
animation: dropdownFadeIn 0.15s ease-out;
|
|
116
|
+
|
|
117
|
+
// 滚动条样式
|
|
118
|
+
&::-webkit-scrollbar {
|
|
119
|
+
width: 6px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&::-webkit-scrollbar-track {
|
|
123
|
+
background: transparent;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&::-webkit-scrollbar-thumb {
|
|
127
|
+
background: var(--scrollbar-thumb);
|
|
128
|
+
border-radius: 3px;
|
|
129
|
+
transition: background-color 0.2s;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
133
|
+
background: var(--scrollbar-thumb-hover);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@keyframes dropdownFadeIn {
|
|
138
|
+
from {
|
|
139
|
+
opacity: 0;
|
|
140
|
+
transform: translateY(-4px);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
to {
|
|
144
|
+
opacity: 1;
|
|
145
|
+
transform: translateY(0);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.thinking_section {
|
|
150
|
+
padding: 8px 12px 4px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.thinking_toggle {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: 8px;
|
|
157
|
+
padding: 6px 0;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
border-radius: 4px;
|
|
160
|
+
|
|
161
|
+
&:hover {
|
|
162
|
+
background-color: var(--list-hover-background);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.thinking_icon {
|
|
167
|
+
flex-shrink: 0;
|
|
168
|
+
color: var(--icon-foreground);
|
|
169
|
+
|
|
170
|
+
&.enabled {
|
|
171
|
+
color: var(--list-active-selection-foreground);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.thinking_label {
|
|
176
|
+
font-size: 13px;
|
|
177
|
+
color: var(--foreground);
|
|
178
|
+
font-weight: 500;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.divider {
|
|
182
|
+
height: 1px;
|
|
183
|
+
background-color: var(--separator-border);
|
|
184
|
+
margin: 8px 0 4px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 向上展开(默认)
|
|
188
|
+
&.dropdown_up .dropdown {
|
|
189
|
+
bottom: 100%;
|
|
190
|
+
margin-bottom: 4px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// 向下展开
|
|
194
|
+
&.dropdown_down .dropdown {
|
|
195
|
+
top: 100%;
|
|
196
|
+
margin-top: 4px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.option {
|
|
200
|
+
padding: 8px 12px;
|
|
201
|
+
border-radius: 4px;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
transition: all 0.2s;
|
|
204
|
+
position: relative;
|
|
205
|
+
border: 1px solid transparent;
|
|
206
|
+
box-sizing: content-box;
|
|
207
|
+
margin-bottom: 4px;
|
|
208
|
+
&:last-child {
|
|
209
|
+
margin-bottom: 0;
|
|
210
|
+
}
|
|
211
|
+
&:hover:not(.disabled) {
|
|
212
|
+
border-color: var(--dropdown-border);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&.active {
|
|
216
|
+
border-color: var(--dropdown-border);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&.selected {
|
|
220
|
+
background-color: var(--dropdown-background);
|
|
221
|
+
|
|
222
|
+
&::after {
|
|
223
|
+
content: '✓';
|
|
224
|
+
position: absolute;
|
|
225
|
+
top: 50%;
|
|
226
|
+
right: 12px;
|
|
227
|
+
transform: translateY(-50%);
|
|
228
|
+
color: var(--list-active-selection-foreground);
|
|
229
|
+
font-weight: bold;
|
|
230
|
+
font-size: 14px;
|
|
231
|
+
z-index: 1;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&.disabled {
|
|
236
|
+
opacity: 0.5;
|
|
237
|
+
cursor: not-allowed;
|
|
238
|
+
|
|
239
|
+
&:hover {
|
|
240
|
+
transform: none;
|
|
241
|
+
box-shadow: none;
|
|
242
|
+
border-color: transparent;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.option_main {
|
|
248
|
+
display: flex;
|
|
249
|
+
flex-direction: column;
|
|
250
|
+
gap: 6px;
|
|
251
|
+
padding-right: 24px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.option_header {
|
|
255
|
+
display: flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
justify-content: space-between;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.option_title {
|
|
261
|
+
display: flex;
|
|
262
|
+
align-items: center;
|
|
263
|
+
gap: 8px;
|
|
264
|
+
flex: 1;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.option_description {
|
|
268
|
+
font-size: 12px;
|
|
269
|
+
color: var(--descriptionForeground);
|
|
270
|
+
line-height: 1.4;
|
|
271
|
+
margin-top: 4px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.option_tags {
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-wrap: wrap;
|
|
277
|
+
gap: 4px;
|
|
278
|
+
margin-top: 6px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.tag {
|
|
282
|
+
display: inline-block;
|
|
283
|
+
padding: 2px 6px;
|
|
284
|
+
border-radius: 10px;
|
|
285
|
+
font-size: 10px;
|
|
286
|
+
background-color: var(--badge-background);
|
|
287
|
+
color: var(--badge-foreground);
|
|
288
|
+
white-space: nowrap;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.status_indicator {
|
|
292
|
+
width: 8px;
|
|
293
|
+
height: 8px;
|
|
294
|
+
border-radius: 50%;
|
|
295
|
+
flex-shrink: 0;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
@@ -39,19 +39,17 @@ export interface MentionState {
|
|
|
39
39
|
interface ModelOption {
|
|
40
40
|
label: string;
|
|
41
41
|
value: string;
|
|
42
|
-
}
|
|
43
|
-
export interface ExtendedModelOption {
|
|
44
|
-
label: string;
|
|
45
|
-
value: string;
|
|
46
42
|
icon?: string;
|
|
47
43
|
iconClass?: string;
|
|
48
44
|
tags?: string[];
|
|
49
|
-
features?: string[];
|
|
50
45
|
description?: string;
|
|
51
|
-
disabled?: boolean;
|
|
52
46
|
badge?: string;
|
|
53
47
|
badgeColor?: string;
|
|
54
48
|
}
|
|
49
|
+
export interface ExtendedModelOption extends ModelOption {
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
selected?: boolean;
|
|
52
|
+
}
|
|
55
53
|
export declare enum FooterButtonPosition {
|
|
56
54
|
LEFT = "left",
|
|
57
55
|
RIGHT = "right"
|
|
@@ -77,6 +75,9 @@ export interface FooterConfig {
|
|
|
77
75
|
buttons?: FooterButton[];
|
|
78
76
|
showModelSelector?: boolean;
|
|
79
77
|
disableModelSelector?: boolean;
|
|
78
|
+
showThinking?: boolean;
|
|
79
|
+
thinkingEnabled?: boolean;
|
|
80
|
+
onThinkingChange?: (enabled: boolean) => void;
|
|
80
81
|
}
|
|
81
82
|
export interface MentionInputProps {
|
|
82
83
|
mentionItems?: MentionItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/browser/components/mention-input/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,WAAW,EAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,UAAU,EAA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EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC;AAED,eAAO,MAAM,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/browser/components/mention-input/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/browser/components/mention-input/types.ts"],"names":[],"mappings":";;;AA6DA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,uCAAe,CAAA;AACjB,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B;AAED,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAsCY,QAAA,eAAe,GAAG,GAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-ai-native",
|
|
3
|
-
"version": "3.9.1-next-
|
|
3
|
+
"version": "3.9.1-next-1748944723.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"lib",
|
|
6
6
|
"src"
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
"@ai-sdk/openai": "^1.1.9",
|
|
25
25
|
"@ai-sdk/openai-compatible": "^0.1.11",
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.3.1",
|
|
27
|
-
"@opensumi/ide-addons": "3.9.1-next-
|
|
28
|
-
"@opensumi/ide-components": "3.9.1-next-
|
|
29
|
-
"@opensumi/ide-connection": "3.9.1-next-
|
|
30
|
-
"@opensumi/ide-core-common": "3.9.1-next-
|
|
31
|
-
"@opensumi/ide-core-node": "3.9.1-next-
|
|
32
|
-
"@opensumi/ide-debug": "3.9.1-next-
|
|
33
|
-
"@opensumi/ide-design": "3.9.1-next-
|
|
34
|
-
"@opensumi/ide-editor": "3.9.1-next-
|
|
35
|
-
"@opensumi/ide-file-search": "3.9.1-next-
|
|
36
|
-
"@opensumi/ide-file-service": "3.9.1-next-
|
|
37
|
-
"@opensumi/ide-main-layout": "3.9.1-next-
|
|
38
|
-
"@opensumi/ide-markers": "3.9.1-next-
|
|
39
|
-
"@opensumi/ide-monaco": "3.9.1-next-
|
|
40
|
-
"@opensumi/ide-outline": "3.9.1-next-
|
|
41
|
-
"@opensumi/ide-overlay": "3.9.1-next-
|
|
42
|
-
"@opensumi/ide-preferences": "3.9.1-next-
|
|
43
|
-
"@opensumi/ide-quick-open": "3.9.1-next-
|
|
44
|
-
"@opensumi/ide-search": "3.9.1-next-
|
|
45
|
-
"@opensumi/ide-terminal-next": "3.9.1-next-
|
|
46
|
-
"@opensumi/ide-theme": "3.9.1-next-
|
|
47
|
-
"@opensumi/ide-utils": "3.9.1-next-
|
|
48
|
-
"@opensumi/ide-workspace": "3.9.1-next-
|
|
27
|
+
"@opensumi/ide-addons": "3.9.1-next-1748944723.0",
|
|
28
|
+
"@opensumi/ide-components": "3.9.1-next-1748944723.0",
|
|
29
|
+
"@opensumi/ide-connection": "3.9.1-next-1748944723.0",
|
|
30
|
+
"@opensumi/ide-core-common": "3.9.1-next-1748944723.0",
|
|
31
|
+
"@opensumi/ide-core-node": "3.9.1-next-1748944723.0",
|
|
32
|
+
"@opensumi/ide-debug": "3.9.1-next-1748944723.0",
|
|
33
|
+
"@opensumi/ide-design": "3.9.1-next-1748944723.0",
|
|
34
|
+
"@opensumi/ide-editor": "3.9.1-next-1748944723.0",
|
|
35
|
+
"@opensumi/ide-file-search": "3.9.1-next-1748944723.0",
|
|
36
|
+
"@opensumi/ide-file-service": "3.9.1-next-1748944723.0",
|
|
37
|
+
"@opensumi/ide-main-layout": "3.9.1-next-1748944723.0",
|
|
38
|
+
"@opensumi/ide-markers": "3.9.1-next-1748944723.0",
|
|
39
|
+
"@opensumi/ide-monaco": "3.9.1-next-1748944723.0",
|
|
40
|
+
"@opensumi/ide-outline": "3.9.1-next-1748944723.0",
|
|
41
|
+
"@opensumi/ide-overlay": "3.9.1-next-1748944723.0",
|
|
42
|
+
"@opensumi/ide-preferences": "3.9.1-next-1748944723.0",
|
|
43
|
+
"@opensumi/ide-quick-open": "3.9.1-next-1748944723.0",
|
|
44
|
+
"@opensumi/ide-search": "3.9.1-next-1748944723.0",
|
|
45
|
+
"@opensumi/ide-terminal-next": "3.9.1-next-1748944723.0",
|
|
46
|
+
"@opensumi/ide-theme": "3.9.1-next-1748944723.0",
|
|
47
|
+
"@opensumi/ide-utils": "3.9.1-next-1748944723.0",
|
|
48
|
+
"@opensumi/ide-workspace": "3.9.1-next-1748944723.0",
|
|
49
49
|
"@xterm/xterm": "5.5.0",
|
|
50
50
|
"ai": "^4.1.45",
|
|
51
51
|
"ansi-regex": "^2.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"zod-to-json-schema": "^3.24.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@opensumi/ide-core-browser": "3.9.1-next-
|
|
65
|
+
"@opensumi/ide-core-browser": "3.9.1-next-1748944723.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "3ce3e54beaa3603af916d4ed2bd2981c6f15dc9e"
|
|
68
68
|
}
|
|
@@ -24,6 +24,8 @@ import { FileSearchServicePath, IFileSearchService } from '@opensumi/ide-file-se
|
|
|
24
24
|
import { OutlineCompositeTreeNode, OutlineTreeNode } from '@opensumi/ide-outline/lib/browser/outline-node.define';
|
|
25
25
|
import { OutlineTreeService } from '@opensumi/ide-outline/lib/browser/services/outline-tree.service';
|
|
26
26
|
import { IMessageService } from '@opensumi/ide-overlay';
|
|
27
|
+
import { IconType } from '@opensumi/ide-theme';
|
|
28
|
+
import { IconService } from '@opensumi/ide-theme/lib/browser';
|
|
27
29
|
import { IWorkspaceService } from '@opensumi/ide-workspace';
|
|
28
30
|
|
|
29
31
|
import { IChatInternalService } from '../../common';
|
|
@@ -80,6 +82,7 @@ export const ChatMentionInput = (props: IChatMentionInputProps) => {
|
|
|
80
82
|
const workspaceService = useInjectable<IWorkspaceService>(IWorkspaceService);
|
|
81
83
|
const editorService = useInjectable<WorkbenchEditorService>(WorkbenchEditorService);
|
|
82
84
|
const labelService = useInjectable<LabelService>(LabelService);
|
|
85
|
+
const iconService = useInjectable<IconService>(IconService);
|
|
83
86
|
const messageService = useInjectable<IMessageService>(IMessageService);
|
|
84
87
|
const chatFeatureRegistry = useInjectable<ChatFeatureRegistry>(ChatFeatureRegistryToken);
|
|
85
88
|
const outlineTreeService = useInjectable<OutlineTreeService>(OutlineTreeService);
|
|
@@ -418,12 +421,31 @@ export const ChatMentionInput = (props: IChatMentionInputProps) => {
|
|
|
418
421
|
},
|
|
419
422
|
},
|
|
420
423
|
];
|
|
421
|
-
|
|
422
424
|
const defaultMentionInputFooterOptions: FooterConfig = useMemo(
|
|
423
425
|
() => ({
|
|
424
426
|
modelOptions: [
|
|
425
|
-
{
|
|
426
|
-
|
|
427
|
+
{
|
|
428
|
+
label: 'Claude 4 Sonnet',
|
|
429
|
+
value: 'claude_sonnet4',
|
|
430
|
+
iconClass: iconService.fromIcon(
|
|
431
|
+
'',
|
|
432
|
+
'https://img.alicdn.com/imgextra/i3/O1CN01p0mziz1Nsl40lp1HO_!!6000000001626-55-tps-92-65.svg',
|
|
433
|
+
IconType.Background,
|
|
434
|
+
),
|
|
435
|
+
tags: ['多模态', '长上下文理解', '思考模式'],
|
|
436
|
+
description: '高性能模型,支持多模态输入',
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
label: 'DeepSeek R1',
|
|
440
|
+
value: 'deepseek-r1',
|
|
441
|
+
iconClass: iconService.fromIcon(
|
|
442
|
+
'',
|
|
443
|
+
'https://img.alicdn.com/imgextra/i3/O1CN01ClcK2w1JwdxcbAB3a_!!6000000001093-55-tps-30-30.svg',
|
|
444
|
+
IconType.Background,
|
|
445
|
+
),
|
|
446
|
+
tags: ['思考模式', '长上下文理解'],
|
|
447
|
+
description: '专业创作,支持多模态输入',
|
|
448
|
+
},
|
|
427
449
|
],
|
|
428
450
|
defaultModel:
|
|
429
451
|
props.sessionModelId || preferenceService.get<string>(AINativeSettingSectionsId.ModelID) || 'deepseek-r1',
|
|
@@ -464,7 +486,7 @@ export const ChatMentionInput = (props: IChatMentionInputProps) => {
|
|
|
464
486
|
showModelSelector: true,
|
|
465
487
|
disableModelSelector: props.disableModelSelector,
|
|
466
488
|
}),
|
|
467
|
-
[handleShowMCPConfig, props.disableModelSelector, props.sessionModelId],
|
|
489
|
+
[iconService, handleShowMCPConfig, handleShowRules, props.disableModelSelector, props.sessionModelId],
|
|
468
490
|
);
|
|
469
491
|
|
|
470
492
|
const handleStop = useCallback(() => {
|
|
@@ -524,7 +524,6 @@
|
|
|
524
524
|
display: flex;
|
|
525
525
|
font-size: 11px;
|
|
526
526
|
align-items: center;
|
|
527
|
-
min-width: 150px;
|
|
528
527
|
}
|
|
529
528
|
|
|
530
529
|
.mcp_desc {
|
|
@@ -597,8 +596,8 @@
|
|
|
597
596
|
align-items: center;
|
|
598
597
|
padding: 0 4px;
|
|
599
598
|
margin: 0 2px;
|
|
600
|
-
background: var(--
|
|
601
|
-
color: var(--
|
|
599
|
+
background-color: var(--chat-slashCommandBackground);
|
|
600
|
+
color: var(--chat-slashCommandForeground);
|
|
602
601
|
border-radius: 3px;
|
|
603
602
|
vertical-align: middle;
|
|
604
603
|
font-size: 12px;
|
|
@@ -609,10 +608,6 @@
|
|
|
609
608
|
margin-right: 3px;
|
|
610
609
|
}
|
|
611
610
|
}
|
|
612
|
-
&:hover {
|
|
613
|
-
background-color: var(--chat-slashCommandBackground);
|
|
614
|
-
color: var(--chat-slashCommandForeground);
|
|
615
|
-
}
|
|
616
611
|
}
|
|
617
612
|
|
|
618
613
|
.attachment_text {
|
|
@@ -2,7 +2,7 @@ import cls from 'classnames';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import { getSymbolIcon, localize } from '@opensumi/ide-core-browser';
|
|
5
|
-
import { Icon, Popover, PopoverPosition,
|
|
5
|
+
import { Icon, Popover, PopoverPosition, getIcon } from '@opensumi/ide-core-browser/lib/components';
|
|
6
6
|
import { EnhanceIcon } from '@opensumi/ide-core-browser/lib/components/ai-native';
|
|
7
7
|
import { URI } from '@opensumi/ide-utils';
|
|
8
8
|
|
|
@@ -11,6 +11,7 @@ import { ProjectRule } from '../../../common/types';
|
|
|
11
11
|
|
|
12
12
|
import styles from './mention-input.module.less';
|
|
13
13
|
import { MentionPanel } from './mention-panel';
|
|
14
|
+
import { ExtendedModelOption, MentionSelect } from './mention-select';
|
|
14
15
|
import {
|
|
15
16
|
FooterButtonPosition,
|
|
16
17
|
MENTION_KEYWORD,
|
|
@@ -1162,6 +1163,29 @@ export const MentionInput: React.FC<MentionInputProps> = ({
|
|
|
1162
1163
|
[footerConfig.disableModelSelector],
|
|
1163
1164
|
);
|
|
1164
1165
|
|
|
1166
|
+
// 转换模型选项为扩展格式
|
|
1167
|
+
const getExtendedModelOptions = React.useMemo((): ExtendedModelOption[] => {
|
|
1168
|
+
// 如果有扩展模型选项,直接使用
|
|
1169
|
+
if (footerConfig.extendedModelOptions) {
|
|
1170
|
+
return footerConfig.extendedModelOptions.map((option) => ({
|
|
1171
|
+
...option,
|
|
1172
|
+
selected: option.value === selectedModel,
|
|
1173
|
+
}));
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// 否则从基础模型选项转换
|
|
1177
|
+
return (footerConfig.modelOptions || []).map((option): ExtendedModelOption => {
|
|
1178
|
+
const extendedOption: ExtendedModelOption = {
|
|
1179
|
+
...option,
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
// 设置选中状态:如果当前模型匹配选中的模型,则标记为选中
|
|
1183
|
+
extendedOption.selected = option.value === selectedModel;
|
|
1184
|
+
|
|
1185
|
+
return extendedOption;
|
|
1186
|
+
});
|
|
1187
|
+
}, [footerConfig.modelOptions, footerConfig.extendedModelOptions, selectedModel]);
|
|
1188
|
+
|
|
1165
1189
|
const removeContext = React.useCallback(
|
|
1166
1190
|
(type: MentionType, uri: URI) => {
|
|
1167
1191
|
if (type === MentionType.FILE) {
|
|
@@ -1304,13 +1328,16 @@ export const MentionInput: React.FC<MentionInputProps> = ({
|
|
|
1304
1328
|
<div className={styles.left_control}>
|
|
1305
1329
|
{footerConfig.showModelSelector &&
|
|
1306
1330
|
renderModelSelectorTip(
|
|
1307
|
-
<
|
|
1308
|
-
options={
|
|
1331
|
+
<MentionSelect
|
|
1332
|
+
options={getExtendedModelOptions}
|
|
1309
1333
|
value={selectedModel}
|
|
1310
1334
|
onChange={handleModelChange}
|
|
1311
1335
|
className={styles.model_selector}
|
|
1312
1336
|
size='small'
|
|
1313
1337
|
disabled={footerConfig.disableModelSelector}
|
|
1338
|
+
showThinking={footerConfig.showThinking}
|
|
1339
|
+
thinkingEnabled={footerConfig.thinkingEnabled}
|
|
1340
|
+
onThinkingChange={footerConfig.onThinkingChange}
|
|
1314
1341
|
/>,
|
|
1315
1342
|
)}
|
|
1316
1343
|
{renderButtons(FooterButtonPosition.LEFT)}
|