@opensumi/ide-ai-native 3.9.1-next-1749008258.0 → 3.9.1-next-1749022986.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/chat/chat.feature.registry.d.ts +4 -1
- package/lib/browser/chat/chat.feature.registry.d.ts.map +1 -1
- package/lib/browser/chat/chat.feature.registry.js +6 -0
- package/lib/browser/chat/chat.feature.registry.js.map +1 -1
- package/lib/browser/chat/chat.view.d.ts.map +1 -1
- package/lib/browser/chat/chat.view.js +22 -1
- package/lib/browser/chat/chat.view.js.map +1 -1
- package/lib/browser/components/ChatMentionInput.js +1 -1
- package/lib/browser/components/ChatMentionInput.js.map +1 -1
- package/lib/browser/components/ChatReply.js +2 -2
- package/lib/browser/components/ChatReply.js.map +1 -1
- package/lib/browser/components/components.module.less +28 -0
- package/lib/browser/components/mention-input/mention-input.d.ts.map +1 -1
- package/lib/browser/components/mention-input/mention-input.js +4 -15
- package/lib/browser/components/mention-input/mention-input.js.map +1 -1
- package/lib/browser/components/mention-input/types.d.ts +12 -0
- package/lib/browser/components/mention-input/types.d.ts.map +1 -1
- package/lib/browser/components/mention-input/types.js.map +1 -1
- package/lib/browser/types.d.ts +8 -1
- package/lib/browser/types.d.ts.map +1 -1
- package/lib/browser/types.js.map +1 -1
- package/lib/common/model.d.ts +1 -0
- package/lib/common/model.d.ts.map +1 -1
- package/lib/common/model.js.map +1 -1
- package/lib/node/base-language-model.js +2 -1
- package/lib/node/base-language-model.js.map +1 -1
- package/package.json +25 -25
- package/src/browser/chat/chat.feature.registry.ts +17 -1
- package/src/browser/chat/chat.view.tsx +21 -3
- package/src/browser/components/ChatMentionInput.tsx +1 -1
- package/src/browser/components/ChatReply.tsx +4 -4
- package/src/browser/components/components.module.less +28 -0
- package/src/browser/components/mention-input/mention-input.tsx +7 -31
- package/src/browser/components/mention-input/types.ts +13 -0
- package/src/browser/types.ts +12 -0
- package/src/common/model.ts +1 -0
- package/src/node/base-language-model.ts +1 -1
|
@@ -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, getIcon } from '@opensumi/ide-core-browser/lib/components';
|
|
5
|
+
import { Icon, Popover, PopoverPosition, Select, 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
|
|
|
@@ -1211,12 +1211,7 @@ export const MentionInput: React.FC<MentionInputProps> = ({
|
|
|
1211
1211
|
{!hasContext ? localize('aiNative.chat.context.title') : ''}
|
|
1212
1212
|
</span>
|
|
1213
1213
|
{attachedFiles.files.map((file, index) => (
|
|
1214
|
-
<div
|
|
1215
|
-
key={`file-${index}`}
|
|
1216
|
-
className={styles.context_preview_item}
|
|
1217
|
-
data-type={MentionType.FILE}
|
|
1218
|
-
onClick={() => contextService?.removeFileFromContext(file.uri, true)}
|
|
1219
|
-
>
|
|
1214
|
+
<div key={`file-${index}`} className={styles.context_preview_item} data-type={MentionType.FILE}>
|
|
1220
1215
|
<Icon
|
|
1221
1216
|
iconClass={cls(
|
|
1222
1217
|
labelService?.getIcon(file.uri) || MentionType.FILE,
|
|
@@ -1233,12 +1228,7 @@ export const MentionInput: React.FC<MentionInputProps> = ({
|
|
|
1233
1228
|
))}
|
|
1234
1229
|
|
|
1235
1230
|
{attachedFiles.folders.map((folder, index) => (
|
|
1236
|
-
<div
|
|
1237
|
-
key={`folder-${index}`}
|
|
1238
|
-
className={styles.context_preview_item}
|
|
1239
|
-
data-type='folder'
|
|
1240
|
-
onClick={() => contextService?.removeFileFromContext(folder.uri, true)}
|
|
1241
|
-
>
|
|
1231
|
+
<div key={`folder-${index}`} className={styles.context_preview_item} data-type='folder'>
|
|
1242
1232
|
<Icon iconClass={cls(getIcon('folder'), styles.context_preview_item_icon, styles.icon)} />
|
|
1243
1233
|
<Icon
|
|
1244
1234
|
iconClass={cls(styles.close_icon, getIcon('close'))}
|
|
@@ -1249,29 +1239,15 @@ export const MentionInput: React.FC<MentionInputProps> = ({
|
|
|
1249
1239
|
))}
|
|
1250
1240
|
|
|
1251
1241
|
{attachedFiles.rules.map((rule, index) => (
|
|
1252
|
-
<div
|
|
1253
|
-
key={`rule-${index}`}
|
|
1254
|
-
className={styles.context_preview_item}
|
|
1255
|
-
data-type='rule'
|
|
1256
|
-
onClick={() => {
|
|
1257
|
-
// 由于没有专门的删除规则方法,我们重新构建规则列表
|
|
1258
|
-
contextService?.cleanFileContext();
|
|
1259
|
-
// 重新添加除了当前要删除的规则之外的所有上下文
|
|
1260
|
-
attachedFiles.files.forEach((file) => contextService?.addFileToContext(file.uri, file.selection, true));
|
|
1261
|
-
attachedFiles.folders.forEach((folder) => contextService?.addFolderToContext(folder.uri, true));
|
|
1262
|
-
attachedFiles.rules.forEach((r, i) => {
|
|
1263
|
-
if (i !== index) {
|
|
1264
|
-
contextService?.addRuleToContext(new URI(r.path), true);
|
|
1265
|
-
}
|
|
1266
|
-
});
|
|
1267
|
-
}}
|
|
1268
|
-
>
|
|
1242
|
+
<div key={`rule-${index}`} className={styles.context_preview_item} data-type='rule'>
|
|
1269
1243
|
<Icon iconClass={cls(getIcon('rules'), styles.context_preview_item_icon, styles.icon)} />
|
|
1270
1244
|
<Icon
|
|
1271
1245
|
iconClass={cls(styles.close_icon, getIcon('close'))}
|
|
1272
1246
|
onClick={() => removeContext(MentionType.RULE, new URI(rule.path))}
|
|
1273
1247
|
/>
|
|
1274
|
-
<span className={styles.context_preview_item_text}>
|
|
1248
|
+
<span className={styles.context_preview_item_text}>
|
|
1249
|
+
{getFileNameFromPath(rule.path).replace('.mdc', '')}
|
|
1250
|
+
</span>
|
|
1275
1251
|
</div>
|
|
1276
1252
|
))}
|
|
1277
1253
|
</div>
|
|
@@ -59,6 +59,19 @@ export interface ExtendedModelOption extends ModelOption {
|
|
|
59
59
|
selected?: boolean; // 由外部控制选中状态
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
export interface ExtendedModelOption {
|
|
63
|
+
label: string;
|
|
64
|
+
value: string;
|
|
65
|
+
icon?: string;
|
|
66
|
+
iconClass?: string;
|
|
67
|
+
tags?: string[];
|
|
68
|
+
features?: string[];
|
|
69
|
+
description?: string;
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
badge?: string;
|
|
72
|
+
badgeColor?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
export enum FooterButtonPosition {
|
|
63
76
|
LEFT = 'left',
|
|
64
77
|
RIGHT = 'right',
|
package/src/browser/types.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ZodSchema } from 'zod';
|
|
|
5
5
|
import { AIActionItem } from '@opensumi/ide-core-browser/lib/components/ai-native/index';
|
|
6
6
|
import {
|
|
7
7
|
CancellationToken,
|
|
8
|
+
ChatMessageRole,
|
|
8
9
|
ChatResponse,
|
|
9
10
|
Deferred,
|
|
10
11
|
IAICompletionOption,
|
|
@@ -134,6 +135,8 @@ export interface IChatFeatureRegistry {
|
|
|
134
135
|
registerImageUploadProvider(provider: IImageUploadProvider): void;
|
|
135
136
|
registerWelcome(content: IChatWelcomeMessageContent | React.ReactNode, sampleQuestions?: ISampleQuestions[]): void;
|
|
136
137
|
registerSlashCommand(command: IChatSlashCommandItem, handler: IChatSlashCommandHandler): void;
|
|
138
|
+
|
|
139
|
+
registerMessageSummaryProvider(provider: IMessageSummaryProvider): void;
|
|
137
140
|
}
|
|
138
141
|
|
|
139
142
|
export type ChatWelcomeRender = (props: {
|
|
@@ -298,6 +301,15 @@ export interface IImageUploadProvider {
|
|
|
298
301
|
imageUpload(file: File): Promise<DataContent | URL>;
|
|
299
302
|
}
|
|
300
303
|
|
|
304
|
+
export interface IMessageSummaryProvider {
|
|
305
|
+
getMessageSummary(
|
|
306
|
+
messages: Array<{
|
|
307
|
+
role: ChatMessageRole;
|
|
308
|
+
content: string;
|
|
309
|
+
}>,
|
|
310
|
+
): Promise<string | undefined>;
|
|
311
|
+
}
|
|
312
|
+
|
|
301
313
|
export const AINativeCoreContribution = Symbol('AINativeCoreContribution');
|
|
302
314
|
|
|
303
315
|
export interface AINativeCoreContribution {
|
package/src/common/model.ts
CHANGED
|
@@ -116,7 +116,7 @@ export abstract class BaseLanguageModel {
|
|
|
116
116
|
messages,
|
|
117
117
|
abortSignal: abortController.signal,
|
|
118
118
|
experimental_toolCallStreaming: true,
|
|
119
|
-
maxSteps:
|
|
119
|
+
maxSteps: modelInfo?.maxSteps ?? 25,
|
|
120
120
|
maxTokens,
|
|
121
121
|
system: systemPrompt,
|
|
122
122
|
providerOptions,
|