@opensumi/ide-ai-native 3.9.1-next-1749175927.0 → 3.9.1-next-1749196667.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/ai-core.contribution.d.ts.map +1 -1
- package/lib/browser/ai-core.contribution.js +4 -9
- package/lib/browser/ai-core.contribution.js.map +1 -1
- package/lib/browser/chat/apply.service.d.ts +0 -3
- package/lib/browser/chat/apply.service.d.ts.map +1 -1
- package/lib/browser/chat/apply.service.js +0 -47
- package/lib/browser/chat/apply.service.js.map +1 -1
- package/lib/browser/chat/chat-manager.service.d.ts +0 -1
- package/lib/browser/chat/chat-manager.service.d.ts.map +1 -1
- package/lib/browser/chat/chat-manager.service.js +3 -9
- package/lib/browser/chat/chat-manager.service.js.map +1 -1
- package/lib/browser/chat/chat-model.d.ts +1 -8
- package/lib/browser/chat/chat-model.d.ts.map +1 -1
- package/lib/browser/chat/chat-model.js +76 -113
- package/lib/browser/chat/chat-model.js.map +1 -1
- package/lib/browser/chat/chat-proxy.service.d.ts +2 -0
- package/lib/browser/chat/chat-proxy.service.d.ts.map +1 -1
- package/lib/browser/chat/chat-proxy.service.js +57 -50
- package/lib/browser/chat/chat-proxy.service.js.map +1 -1
- package/lib/browser/chat/chat.feature.registry.d.ts +1 -4
- package/lib/browser/chat/chat.feature.registry.d.ts.map +1 -1
- package/lib/browser/chat/chat.feature.registry.js +0 -6
- 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 +10 -51
- package/lib/browser/chat/chat.view.js.map +1 -1
- package/lib/browser/components/ChatEditor.js +2 -2
- package/lib/browser/components/ChatEditor.js.map +1 -1
- package/lib/browser/components/ChatHistory.d.ts.map +1 -1
- package/lib/browser/components/ChatHistory.js +1 -2
- package/lib/browser/components/ChatHistory.js.map +1 -1
- package/lib/browser/components/ChatMentionInput.d.ts.map +1 -1
- package/lib/browser/components/ChatMentionInput.js +28 -124
- package/lib/browser/components/ChatMentionInput.js.map +1 -1
- package/lib/browser/components/ChatToolRender.d.ts.map +1 -1
- package/lib/browser/components/ChatToolRender.js +2 -7
- package/lib/browser/components/ChatToolRender.js.map +1 -1
- package/lib/browser/components/ChatToolRender.module.less +0 -25
- package/lib/browser/components/components.module.less +0 -7
- package/lib/browser/components/mention-input/mention-input.d.ts.map +1 -1
- package/lib/browser/components/mention-input/mention-input.js +13 -155
- package/lib/browser/components/mention-input/mention-input.js.map +1 -1
- package/lib/browser/components/mention-input/mention-input.module.less +0 -165
- package/lib/browser/components/mention-input/types.d.ts +1 -15
- package/lib/browser/components/mention-input/types.d.ts.map +1 -1
- package/lib/browser/components/mention-input/types.js +0 -1
- package/lib/browser/components/mention-input/types.js.map +1 -1
- package/lib/browser/components/utils.d.ts +2 -2
- package/lib/browser/context/llm-context.service.d.ts +2 -21
- package/lib/browser/context/llm-context.service.d.ts.map +1 -1
- package/lib/browser/context/llm-context.service.js +20 -162
- package/lib/browser/context/llm-context.service.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/decoration/additions-deletions.decoration.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/decoration/additions-deletions.decoration.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/diff-computer.js +1 -1
- package/lib/browser/contrib/intelligent-completions/diff-computer.js.map +1 -1
- package/lib/browser/contrib/terminal/terminal.feature.registry.js.map +1 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +0 -7
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/layout/ai-layout.d.ts.map +1 -1
- package/lib/browser/layout/ai-layout.js +4 -6
- package/lib/browser/layout/ai-layout.js.map +1 -1
- package/lib/browser/layout/tabbar.view.d.ts +1 -1
- package/lib/browser/layout/tabbar.view.d.ts.map +1 -1
- package/lib/browser/layout/tabbar.view.js +12 -5
- package/lib/browser/layout/tabbar.view.js.map +1 -1
- package/lib/browser/mcp/base-apply.service.d.ts +4 -5
- package/lib/browser/mcp/base-apply.service.d.ts.map +1 -1
- package/lib/browser/mcp/base-apply.service.js +5 -23
- package/lib/browser/mcp/base-apply.service.js.map +1 -1
- package/lib/browser/mcp/mcp-server-proxy.service.d.ts +1 -3
- package/lib/browser/mcp/mcp-server-proxy.service.d.ts.map +1 -1
- package/lib/browser/mcp/mcp-server-proxy.service.js +0 -4
- package/lib/browser/mcp/mcp-server-proxy.service.js.map +1 -1
- package/lib/browser/mcp/tools/getDiagnosticsByPath.js.map +1 -1
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.js.map +1 -1
- package/lib/browser/mcp/tools/handlers/ListDir.js.map +1 -1
- package/lib/browser/mcp/tools/runTerminalCmd.js.map +1 -1
- package/lib/browser/model/msg-history-manager.d.ts +1 -47
- package/lib/browser/model/msg-history-manager.d.ts.map +1 -1
- package/lib/browser/model/msg-history-manager.js +2 -127
- package/lib/browser/model/msg-history-manager.js.map +1 -1
- package/lib/browser/preferences/schema.d.ts.map +1 -1
- package/lib/browser/preferences/schema.js +0 -5
- package/lib/browser/preferences/schema.js.map +1 -1
- package/lib/browser/types.d.ts +1 -12
- package/lib/browser/types.d.ts.map +1 -1
- package/lib/browser/types.js.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.component.d.ts.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.component.js.map +1 -1
- package/lib/common/index.d.ts +1 -5
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +0 -2
- package/lib/common/index.js.map +1 -1
- package/lib/common/llm-context.d.ts +0 -19
- package/lib/common/llm-context.d.ts.map +1 -1
- package/lib/common/llm-context.js.map +1 -1
- package/lib/common/prompts/context-prompt-provider.d.ts +2 -0
- package/lib/common/prompts/context-prompt-provider.d.ts.map +1 -1
- package/lib/common/prompts/context-prompt-provider.js +29 -35
- package/lib/common/prompts/context-prompt-provider.js.map +1 -1
- package/lib/common/types.d.ts +0 -21
- package/lib/common/types.d.ts.map +1 -1
- package/lib/common/types.js.map +1 -1
- package/lib/common/utils.d.ts +0 -1
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +2 -5
- package/lib/common/utils.js.map +1 -1
- package/lib/node/base-language-model.d.ts +1 -2
- package/lib/node/base-language-model.d.ts.map +1 -1
- package/lib/node/base-language-model.js +1 -10
- package/lib/node/base-language-model.js.map +1 -1
- package/lib/node/mcp/sumi-mcp-server.d.ts +1 -3
- package/lib/node/mcp/sumi-mcp-server.d.ts.map +1 -1
- package/lib/node/mcp/sumi-mcp-server.js +1 -7
- package/lib/node/mcp/sumi-mcp-server.js.map +1 -1
- package/lib/node/mcp-server-manager-impl.d.ts +1 -3
- package/lib/node/mcp-server-manager-impl.d.ts.map +1 -1
- package/lib/node/mcp-server-manager-impl.js +2 -14
- package/lib/node/mcp-server-manager-impl.js.map +1 -1
- package/package.json +24 -25
- package/src/browser/ai-core.contribution.ts +4 -14
- package/src/browser/chat/apply.service.ts +1 -62
- package/src/browser/chat/chat-manager.service.ts +7 -16
- package/src/browser/chat/chat-model.ts +73 -130
- package/src/browser/chat/chat-proxy.service.ts +81 -68
- package/src/browser/chat/chat.feature.registry.ts +1 -17
- package/src/browser/chat/chat.view.tsx +12 -74
- package/src/browser/components/ChatEditor.tsx +1 -1
- package/src/browser/components/ChatHistory.tsx +1 -2
- package/src/browser/components/ChatMentionInput.tsx +32 -144
- package/src/browser/components/ChatToolRender.module.less +0 -25
- package/src/browser/components/ChatToolRender.tsx +2 -10
- package/src/browser/components/components.module.less +0 -7
- package/src/browser/components/mention-input/mention-input.module.less +0 -165
- package/src/browser/components/mention-input/mention-input.tsx +29 -244
- package/src/browser/components/mention-input/types.ts +0 -15
- package/src/browser/context/llm-context.service.ts +21 -182
- package/src/browser/contrib/intelligent-completions/decoration/additions-deletions.decoration.ts +1 -1
- package/src/browser/contrib/intelligent-completions/diff-computer.ts +1 -1
- package/src/browser/contrib/terminal/terminal.feature.registry.ts +1 -1
- package/src/browser/index.ts +0 -8
- package/src/browser/layout/ai-layout.tsx +8 -12
- package/src/browser/layout/tabbar.view.tsx +23 -10
- package/src/browser/mcp/base-apply.service.ts +10 -30
- package/src/browser/mcp/mcp-server-proxy.service.ts +1 -6
- package/src/browser/mcp/tools/getDiagnosticsByPath.ts +1 -1
- package/src/browser/mcp/tools/getOpenEditorFileDiagnostics.ts +1 -1
- package/src/browser/mcp/tools/handlers/ListDir.ts +1 -1
- package/src/browser/mcp/tools/runTerminalCmd.ts +1 -1
- package/src/browser/model/msg-history-manager.ts +2 -181
- package/src/browser/preferences/schema.ts +0 -5
- package/src/browser/types.ts +0 -18
- package/src/browser/widget/inline-stream-diff/live-preview.component.tsx +1 -0
- package/src/common/index.ts +1 -6
- package/src/common/llm-context.ts +0 -23
- package/src/common/prompts/context-prompt-provider.ts +40 -55
- package/src/common/types.ts +0 -18
- package/src/common/utils.ts +1 -4
- package/src/node/base-language-model.ts +13 -10
- package/src/node/mcp/sumi-mcp-server.ts +2 -10
- package/src/node/mcp-server-manager-impl.ts +2 -17
- package/lib/browser/rules/rules.contribution.d.ts +0 -29
- package/lib/browser/rules/rules.contribution.d.ts.map +0 -1
- package/lib/browser/rules/rules.contribution.js +0 -94
- package/lib/browser/rules/rules.contribution.js.map +0 -1
- package/lib/browser/rules/rules.module.less +0 -174
- package/lib/browser/rules/rules.service.d.ts +0 -25
- package/lib/browser/rules/rules.service.d.ts.map +0 -1
- package/lib/browser/rules/rules.service.js +0 -180
- package/lib/browser/rules/rules.service.js.map +0 -1
- package/lib/browser/rules/rules.view.d.ts +0 -3
- package/lib/browser/rules/rules.view.d.ts.map +0 -1
- package/lib/browser/rules/rules.view.js +0 -76
- package/lib/browser/rules/rules.view.js.map +0 -1
- package/lib/common/MDC_PARSER_README.md +0 -171
- package/lib/common/image-compression.d.ts +0 -25
- package/lib/common/image-compression.d.ts.map +0 -1
- package/lib/common/image-compression.js +0 -153
- package/lib/common/image-compression.js.map +0 -1
- package/lib/common/mdc-parser.d.ts +0 -60
- package/lib/common/mdc-parser.d.ts.map +0 -1
- package/lib/common/mdc-parser.js +0 -246
- package/lib/common/mdc-parser.js.map +0 -1
- package/lib/common/prompts/system-prompt.d.ts +0 -2
- package/lib/common/prompts/system-prompt.d.ts.map +0 -1
- package/lib/common/prompts/system-prompt.js +0 -5
- package/lib/common/prompts/system-prompt.js.map +0 -1
- package/src/browser/rules/rules.contribution.ts +0 -105
- package/src/browser/rules/rules.module.less +0 -174
- package/src/browser/rules/rules.service.ts +0 -189
- package/src/browser/rules/rules.view.tsx +0 -127
- package/src/common/MDC_PARSER_README.md +0 -171
- package/src/common/image-compression.ts +0 -174
- package/src/common/mdc-parser.ts +0 -295
- package/src/common/prompts/system-prompt.ts +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { DataContent } from 'ai';
|
|
2
|
+
|
|
1
3
|
import { Autowired, Injectable } from '@opensumi/di';
|
|
2
|
-
import { PreferenceService } from '@opensumi/ide-core-browser';
|
|
3
4
|
import { AppConfig } from '@opensumi/ide-core-browser/lib/react-providers/config-provider';
|
|
4
|
-
import { AINativeSettingSectionsId, IApplicationService, RulesServiceToken } from '@opensumi/ide-core-common';
|
|
5
5
|
import { WithEventBus } from '@opensumi/ide-core-common/lib/event-bus/event-decorator';
|
|
6
6
|
import { MarkerSeverity } from '@opensumi/ide-core-common/lib/types/markers/markers';
|
|
7
|
-
import { Emitter,
|
|
7
|
+
import { Emitter, URI } from '@opensumi/ide-core-common/lib/utils';
|
|
8
8
|
import {
|
|
9
9
|
EditorDocumentModelCreationEvent,
|
|
10
10
|
EditorDocumentModelRemovalEvent,
|
|
@@ -15,12 +15,8 @@ import { EditorSelectionChangeEvent } from '@opensumi/ide-editor/lib/browser/typ
|
|
|
15
15
|
import { FileType, IFileServiceClient } from '@opensumi/ide-file-service';
|
|
16
16
|
import { IMarkerService } from '@opensumi/ide-markers/lib/common/types';
|
|
17
17
|
import { Range } from '@opensumi/ide-monaco';
|
|
18
|
-
import { ITerminalApiService } from '@opensumi/ide-terminal-next';
|
|
19
|
-
import { isString, match } from '@opensumi/ide-utils';
|
|
20
18
|
|
|
21
19
|
import { AttachFileContext, FileContext, LLMContextService, SerializedContext } from '../../common/llm-context';
|
|
22
|
-
import { ProjectRule } from '../../common/types';
|
|
23
|
-
import { RulesService } from '../rules/rules.service';
|
|
24
20
|
|
|
25
21
|
@Injectable()
|
|
26
22
|
export class LLMContextServiceImpl extends WithEventBus implements LLMContextService {
|
|
@@ -36,18 +32,6 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
36
32
|
@Autowired(IFileServiceClient)
|
|
37
33
|
protected readonly fileService: IFileServiceClient;
|
|
38
34
|
|
|
39
|
-
@Autowired(RulesServiceToken)
|
|
40
|
-
protected readonly rulesService: RulesService;
|
|
41
|
-
|
|
42
|
-
@Autowired(PreferenceService)
|
|
43
|
-
protected readonly preferenceService: PreferenceService;
|
|
44
|
-
|
|
45
|
-
@Autowired(ITerminalApiService)
|
|
46
|
-
protected readonly terminalService: ITerminalApiService;
|
|
47
|
-
|
|
48
|
-
@Autowired(IApplicationService)
|
|
49
|
-
protected readonly applicationService: IApplicationService;
|
|
50
|
-
|
|
51
35
|
private isAutoCollecting = false;
|
|
52
36
|
|
|
53
37
|
private contextVersion = 0;
|
|
@@ -57,13 +41,11 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
57
41
|
private readonly maxViewFilesLimit = 20;
|
|
58
42
|
private attachedFiles: FileContext[] = [];
|
|
59
43
|
private attachedFolders: FileContext[] = [];
|
|
60
|
-
private attachedRules: ProjectRule[] = [];
|
|
61
44
|
private readonly recentlyViewFiles: FileContext[] = [];
|
|
62
45
|
private readonly onDidContextFilesChangeEmitter = new Emitter<{
|
|
63
46
|
viewed: FileContext[];
|
|
64
47
|
attached: FileContext[];
|
|
65
48
|
attachedFolders: FileContext[];
|
|
66
|
-
attachedRules: ProjectRule[];
|
|
67
49
|
version: number;
|
|
68
50
|
}>();
|
|
69
51
|
private hasUserManualReference = false;
|
|
@@ -98,24 +80,6 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
98
80
|
}
|
|
99
81
|
}
|
|
100
82
|
|
|
101
|
-
addRuleToContext(uri: URI): void {
|
|
102
|
-
if (!uri) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (this.attachedRules.some((rule) => rule.path === uri.toString())) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const rule = this.rulesService.projectRules.find((rule) => rule.path === uri.toString());
|
|
111
|
-
if (!rule) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
this.attachedRules.push(rule);
|
|
116
|
-
this.notifyContextChange();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
83
|
addFileToContext(uri: URI, selection?: [number, number], isManual = false): void {
|
|
120
84
|
if (!uri) {
|
|
121
85
|
return;
|
|
@@ -153,7 +117,6 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
153
117
|
this.attachedFiles = [];
|
|
154
118
|
this.attachedFolders = [];
|
|
155
119
|
this.hasUserManualReference = false;
|
|
156
|
-
this.attachedRules = [];
|
|
157
120
|
this.notifyContextChange();
|
|
158
121
|
}
|
|
159
122
|
|
|
@@ -162,7 +125,6 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
162
125
|
viewed: this.recentlyViewFiles,
|
|
163
126
|
attached: this.attachedFiles,
|
|
164
127
|
attachedFolders: this.attachedFolders,
|
|
165
|
-
attachedRules: this.attachedRules,
|
|
166
128
|
version: this.contextVersion++,
|
|
167
129
|
};
|
|
168
130
|
}
|
|
@@ -181,24 +143,6 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
181
143
|
this.notifyContextChange();
|
|
182
144
|
}
|
|
183
145
|
|
|
184
|
-
removeFolderFromContext(uri: URI): void {
|
|
185
|
-
const targetList = this.attachedFolders;
|
|
186
|
-
const index = targetList.findIndex((folder) => folder.uri.toString() === uri.toString());
|
|
187
|
-
if (index > -1) {
|
|
188
|
-
targetList.splice(index, 1);
|
|
189
|
-
}
|
|
190
|
-
this.notifyContextChange();
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
removeRuleFromContext(uri: URI): void {
|
|
194
|
-
const targetList = this.attachedRules;
|
|
195
|
-
const index = targetList.findIndex((rule) => rule.path === uri.toString());
|
|
196
|
-
if (index > -1) {
|
|
197
|
-
targetList.splice(index, 1);
|
|
198
|
-
}
|
|
199
|
-
this.notifyContextChange();
|
|
200
|
-
}
|
|
201
|
-
|
|
202
146
|
startAutoCollection(): void {
|
|
203
147
|
if (this.isAutoCollecting) {
|
|
204
148
|
return;
|
|
@@ -273,35 +217,25 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
273
217
|
return {
|
|
274
218
|
recentlyViewFiles: this.serializeRecentlyViewFiles(files.viewed, workspaceRoot),
|
|
275
219
|
attachedFiles: this.serializeAttachedFiles(files.attached, workspaceRoot),
|
|
276
|
-
attachedFolders: await this.serializeAttachedFolders(files.attachedFolders),
|
|
277
|
-
attachedRules: this.serializeAttachedRules(files.attachedRules),
|
|
278
|
-
globalRules: this.serializeGlobalRules(),
|
|
220
|
+
attachedFolders: await this.serializeAttachedFolders(files.attachedFolders, workspaceRoot),
|
|
279
221
|
};
|
|
280
222
|
}
|
|
281
223
|
|
|
282
|
-
private async serializeAttachedFolders(folders: FileContext[]): Promise<string[]> {
|
|
224
|
+
private async serializeAttachedFolders(folders: FileContext[], workspaceRoot: URI): Promise<string[]> {
|
|
283
225
|
// 去重
|
|
284
226
|
const folderPath = Array.from(new Set(folders.map((folder) => folder.uri.toString())));
|
|
285
|
-
|
|
286
|
-
const folderSections = await Promise.all(
|
|
227
|
+
return Promise.all(
|
|
287
228
|
folderPath.map(async (folder) => {
|
|
288
229
|
const folderUri = new URI(folder);
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
Contents of directory:
|
|
294
|
-
|
|
295
|
-
${folderStructure}`;
|
|
230
|
+
const root = workspaceRoot.relative(folderUri)?.toString() || '/';
|
|
231
|
+
return `\`\`\`\n${root}\n${(await this.getPartiaFolderStructure(folderUri.codeUri.fsPath))
|
|
232
|
+
.map((line) => `- ${line}`)
|
|
233
|
+
.join('\n')}\n\`\`\`\n`;
|
|
296
234
|
}),
|
|
297
235
|
);
|
|
298
|
-
if (folderSections.length > 0) {
|
|
299
|
-
return [header, ...folderSections, ''];
|
|
300
|
-
}
|
|
301
|
-
return [];
|
|
302
236
|
}
|
|
303
237
|
|
|
304
|
-
private async
|
|
238
|
+
private async getPartiaFolderStructure(folder: string, level = 2): Promise<string[]> {
|
|
305
239
|
const result: string[] = [];
|
|
306
240
|
try {
|
|
307
241
|
const stat = await this.fileService.getFileStat(folder);
|
|
@@ -313,27 +247,28 @@ ${folderStructure}`;
|
|
|
313
247
|
// 处理软链接
|
|
314
248
|
const target = await this.fileService.getFileStat(child.realUri || child.uri);
|
|
315
249
|
if (target) {
|
|
316
|
-
result.push(
|
|
250
|
+
result.push(`${relativePath} -> ${target} (symbolic link)`);
|
|
317
251
|
} else {
|
|
318
|
-
result.push(
|
|
252
|
+
result.push(`${relativePath} (broken symbolic link)`);
|
|
319
253
|
}
|
|
320
254
|
continue;
|
|
321
255
|
}
|
|
322
256
|
|
|
323
257
|
if (child.type === FileType.Directory) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
258
|
+
result.push(`${relativePath}/`);
|
|
259
|
+
if (level > 1) {
|
|
260
|
+
const subDirStructure = await this.getPartiaFolderStructure(child.uri, level - 1);
|
|
261
|
+
result.push(...subDirStructure.map((subEntry) => `${relativePath}/${subEntry}`));
|
|
262
|
+
}
|
|
328
263
|
} else if (child.type === FileType.File) {
|
|
329
|
-
result.push(
|
|
264
|
+
result.push(relativePath);
|
|
330
265
|
}
|
|
331
266
|
}
|
|
332
267
|
} catch {
|
|
333
|
-
return
|
|
268
|
+
return result;
|
|
334
269
|
}
|
|
335
270
|
|
|
336
|
-
return result
|
|
271
|
+
return result;
|
|
337
272
|
}
|
|
338
273
|
|
|
339
274
|
private serializeRecentlyViewFiles(files: FileContext[], workspaceRoot: URI): string[] {
|
|
@@ -360,7 +295,6 @@ ${folderStructure}`;
|
|
|
360
295
|
lineErrors: this.getFileErrors(file.uri),
|
|
361
296
|
path: workspaceRoot.relative(file.uri)!.toString(),
|
|
362
297
|
language: ref.instance.languageId!,
|
|
363
|
-
selection: file.selection,
|
|
364
298
|
};
|
|
365
299
|
} catch (e) {
|
|
366
300
|
return null;
|
|
@@ -376,99 +310,4 @@ ${folderStructure}`;
|
|
|
376
310
|
})
|
|
377
311
|
.map((marker) => marker.message);
|
|
378
312
|
}
|
|
379
|
-
|
|
380
|
-
private serializeGlobalRules(): string[] {
|
|
381
|
-
const globalRules = this.preferenceService.get<string>(AINativeSettingSectionsId.GlobalRules);
|
|
382
|
-
if (!globalRules) {
|
|
383
|
-
return [];
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
const platform =
|
|
387
|
-
this.applicationService.backendOS === OperatingSystem.Windows
|
|
388
|
-
? 'windows'
|
|
389
|
-
: this.applicationService.backendOS === OperatingSystem.Linux
|
|
390
|
-
? 'linux'
|
|
391
|
-
: 'darwin';
|
|
392
|
-
const shell = this.preferenceService.get<string>('terminal.type', 'zsh');
|
|
393
|
-
let shellName = shell;
|
|
394
|
-
if (shell === 'default') {
|
|
395
|
-
shellName = this.applicationService.backendOS === OperatingSystem.Windows ? 'cmd' : 'zsh';
|
|
396
|
-
}
|
|
397
|
-
const userInfoSection = `<user_info>
|
|
398
|
-
The user's OS version is ${platform}. The absolute path of the user's workspace is ${this.appConfig.workspaceDir}. The user's shell is /bin/${shellName}.
|
|
399
|
-
</user_info>`;
|
|
400
|
-
|
|
401
|
-
const rulesSection = `
|
|
402
|
-
|
|
403
|
-
<rules>
|
|
404
|
-
The rules section has a number of possible rules/memories/context that you should consider. In each subsection, we provide instructions about what information the subsection contains and how you should consider/follow the contents of the subsection.
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
<user_specific_rule description="This is a rule set by the user that the agent must follow.">
|
|
408
|
-
${globalRules}
|
|
409
|
-
</user_specific_rule>
|
|
410
|
-
|
|
411
|
-
</rules>`;
|
|
412
|
-
|
|
413
|
-
return [userInfoSection, rulesSection];
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
private findApplicableRules(attachedRules: ProjectRule[]): ProjectRule[] {
|
|
417
|
-
const otherRules = this.rulesService.projectRules.filter(
|
|
418
|
-
(rule) => !attachedRules.some((attachedRule) => attachedRule.path === rule.path),
|
|
419
|
-
);
|
|
420
|
-
const requestedByAgentRules = otherRules.filter((rule) => rule.description);
|
|
421
|
-
const alwaysApplyRules = otherRules.filter((rule) => rule.alwaysApply);
|
|
422
|
-
const requestedByFileRules = this.findFileMatchingRules(otherRules);
|
|
423
|
-
|
|
424
|
-
return [...requestedByFileRules, ...requestedByAgentRules, ...alwaysApplyRules];
|
|
425
|
-
}
|
|
426
|
-
private findFileMatchingRules(otherRules: ProjectRule[]): ProjectRule[] {
|
|
427
|
-
const requestedByFileRules = otherRules.filter((rule) => rule.globs);
|
|
428
|
-
const filePaths = this.attachedFiles.map((file) => file.uri.toString());
|
|
429
|
-
const folderPaths = this.attachedFolders.map((folder) => folder.uri.toString());
|
|
430
|
-
|
|
431
|
-
return requestedByFileRules.filter((rule) => {
|
|
432
|
-
let globs = rule.globs;
|
|
433
|
-
if (isString(globs)) {
|
|
434
|
-
globs = this.normalizeGlobs(globs.split(','));
|
|
435
|
-
} else {
|
|
436
|
-
globs = this.normalizeGlobs(globs || []);
|
|
437
|
-
}
|
|
438
|
-
const patterns = globs.map((pattern) => parseGlob(pattern));
|
|
439
|
-
return patterns.some((match) => filePaths.some((path) => match(path)) || folderPaths.some((path) => match(path)));
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
private normalizeGlobs(globs: string | string[]): string[] {
|
|
443
|
-
const globArray = isString(globs) ? globs.split(',') : globs || [];
|
|
444
|
-
return globArray.map((glob) => {
|
|
445
|
-
const p = glob.trim();
|
|
446
|
-
return p.startsWith('**') ? p : `**/${p}`;
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
private serializeAttachedRules(rules: ProjectRule[] = []): string[] {
|
|
451
|
-
rules = this.findApplicableRules(rules);
|
|
452
|
-
if (rules.length === 0) {
|
|
453
|
-
return [];
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
const header =
|
|
457
|
-
'\n<rules_context>\n\nRules are extra documentation provided by the user to help the AI understand the codebase.\nUse them if they seem useful to the users most recent query, but do not use them if they seem unrelated.\n\n';
|
|
458
|
-
|
|
459
|
-
const rulesSections = rules
|
|
460
|
-
.map((rule) => {
|
|
461
|
-
const ruleName =
|
|
462
|
-
rule.path
|
|
463
|
-
.split('/')
|
|
464
|
-
.pop()
|
|
465
|
-
?.replace(/.md(c)?$/, '') || 'Unnamed Rule';
|
|
466
|
-
return `Rule Name: ${ruleName}\nDescription: \n${rule.description || rule.content}`;
|
|
467
|
-
})
|
|
468
|
-
.join('\n\n');
|
|
469
|
-
|
|
470
|
-
const footer = '\n</rules_context>\n';
|
|
471
|
-
|
|
472
|
-
return [header, rulesSections, footer];
|
|
473
|
-
}
|
|
474
313
|
}
|
package/src/browser/contrib/intelligent-completions/decoration/additions-deletions.decoration.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICodeEditor, IRange, TrackedRangeStickiness } from '@opensumi/ide-monaco';
|
|
1
|
+
import { ICodeEditor, IModelDeltaDecoration, IRange, TrackedRangeStickiness } from '@opensumi/ide-monaco';
|
|
2
2
|
|
|
3
3
|
import { EnhanceDecorationsCollection } from '../../../model/enhanceDecorationsCollection';
|
|
4
4
|
import { REWRITE_DECORATION_INLINE_ADD } from '../../../widget/rewrite/rewrite-widget';
|
|
@@ -267,7 +267,7 @@ export const computeMultiLineDiffChanges = (
|
|
|
267
267
|
lineNumber: number,
|
|
268
268
|
eol: string,
|
|
269
269
|
) => {
|
|
270
|
-
|
|
270
|
+
let rewriteDiffResult: IMultiLineDiffChangeResult[] =
|
|
271
271
|
rewriteDiffComputer.diff(originalContent, modifiedContent) || [];
|
|
272
272
|
let multiLineDiffResult: IMultiLineDiffChangeResult[] =
|
|
273
273
|
multiLineDiffComputer.diff(originalContent, modifiedContent) || [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@opensumi/di';
|
|
2
2
|
import { CancellationToken, Disposable } from '@opensumi/ide-core-common';
|
|
3
|
-
import { IReadableStream, isReadableStream, listenGroupReadable } from '@opensumi/ide-utils/lib/stream';
|
|
3
|
+
import { IReadableStream, isReadableStream, listenGroupReadable, listenReadable } from '@opensumi/ide-utils/lib/stream';
|
|
4
4
|
|
|
5
5
|
import { ITerminalCommandSuggestionDesc } from '../../../common/index';
|
|
6
6
|
import {
|
package/src/browser/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
IntelligentCompletionsRegistryToken,
|
|
18
18
|
MCPConfigServiceToken,
|
|
19
19
|
ProblemFixRegistryToken,
|
|
20
|
-
RulesServiceToken,
|
|
21
20
|
TerminalRegistryToken,
|
|
22
21
|
} from '@opensumi/ide-core-common';
|
|
23
22
|
import { FolderFilePreferenceProvider } from '@opensumi/ide-preferences/lib/browser/folder-file-preference-provider';
|
|
@@ -78,8 +77,6 @@ import { ListDirTool } from './mcp/tools/listDir';
|
|
|
78
77
|
import { ReadFileTool } from './mcp/tools/readFile';
|
|
79
78
|
import { RunTerminalCommandTool } from './mcp/tools/runTerminalCmd';
|
|
80
79
|
import { AINativePreferencesContribution } from './preferences';
|
|
81
|
-
import { RulesContribution } from './rules/rules.contribution';
|
|
82
|
-
import { RulesService } from './rules/rules.service';
|
|
83
80
|
import { AINativeCoreContribution, MCPServerContribution, TokenMCPServerRegistry } from './types';
|
|
84
81
|
import { InlineChatFeatureRegistry } from './widget/inline-chat/inline-chat.feature.registry';
|
|
85
82
|
import { InlineChatService } from './widget/inline-chat/inline-chat.service';
|
|
@@ -122,7 +119,6 @@ export class AINativeModule extends BrowserModule {
|
|
|
122
119
|
|
|
123
120
|
// Context Service
|
|
124
121
|
LlmContextContribution,
|
|
125
|
-
RulesContribution,
|
|
126
122
|
{
|
|
127
123
|
token: LLMContextServiceToken,
|
|
128
124
|
useClass: LLMContextServiceImpl,
|
|
@@ -220,10 +216,6 @@ export class AINativeModule extends BrowserModule {
|
|
|
220
216
|
token: MCPConfigServiceToken,
|
|
221
217
|
useClass: MCPConfigService,
|
|
222
218
|
},
|
|
223
|
-
{
|
|
224
|
-
token: RulesServiceToken,
|
|
225
|
-
useClass: RulesService,
|
|
226
|
-
},
|
|
227
219
|
{
|
|
228
220
|
token: FolderFilePreferenceProvider,
|
|
229
221
|
useClass: MCPFolderPreferenceProvider,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { SlotRenderer, useInjectable } from '@opensumi/ide-core-browser';
|
|
4
4
|
import { BoxPanel, SplitPanel, getStorageValue } from '@opensumi/ide-core-browser/lib/components';
|
|
5
5
|
import { DesignLayoutConfig } from '@opensumi/ide-core-browser/lib/layout/constants';
|
|
6
6
|
|
|
@@ -32,9 +32,9 @@ export const AILayout = () => {
|
|
|
32
32
|
resizeHandleClassName={'design-slot_resize_horizontal'}
|
|
33
33
|
>
|
|
34
34
|
<SlotRenderer
|
|
35
|
-
slot=
|
|
35
|
+
slot='left'
|
|
36
36
|
isTabbar={true}
|
|
37
|
-
defaultSize={layout
|
|
37
|
+
defaultSize={layout.left?.currentId ? layout.left?.size || 310 : 49}
|
|
38
38
|
minResize={280}
|
|
39
39
|
minSize={49}
|
|
40
40
|
/>
|
|
@@ -42,20 +42,16 @@ export const AILayout = () => {
|
|
|
42
42
|
<SlotRenderer flex={2} flexGrow={1} minResize={200} slot='main' />
|
|
43
43
|
<SlotRenderer
|
|
44
44
|
flex={1}
|
|
45
|
-
defaultSize={layout
|
|
45
|
+
defaultSize={layout.bottom?.currentId ? layout.bottom?.size : 24}
|
|
46
46
|
minResize={160}
|
|
47
|
-
slot=
|
|
47
|
+
slot='bottom'
|
|
48
48
|
isTabbar={true}
|
|
49
49
|
/>
|
|
50
50
|
</SplitPanel>
|
|
51
51
|
<SlotRenderer
|
|
52
|
-
slot=
|
|
52
|
+
slot='right'
|
|
53
53
|
isTabbar={true}
|
|
54
|
-
defaultSize={
|
|
55
|
-
layout[SlotLocation.extendView]?.currentId
|
|
56
|
-
? layout[SlotLocation.extendView]?.size || 360
|
|
57
|
-
: defaultRightSize
|
|
58
|
-
}
|
|
54
|
+
defaultSize={layout.right?.currentId ? layout.right?.size || 360 : defaultRightSize}
|
|
59
55
|
minResize={280}
|
|
60
56
|
minSize={defaultRightSize}
|
|
61
57
|
/>
|
|
@@ -63,7 +59,7 @@ export const AILayout = () => {
|
|
|
63
59
|
<SlotRenderer
|
|
64
60
|
slot={AI_CHAT_VIEW_ID}
|
|
65
61
|
isTabbar={true}
|
|
66
|
-
defaultSize={layout
|
|
62
|
+
defaultSize={layout.AI_Chat?.currentId ? layout.AI_Chat?.size || 360 : 0}
|
|
67
63
|
maxResize={420}
|
|
68
64
|
minResize={280}
|
|
69
65
|
minSize={0}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import cls from 'classnames';
|
|
2
|
-
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
ComponentRegistryInfo,
|
|
@@ -29,18 +29,25 @@ import {
|
|
|
29
29
|
TabbarViewBase,
|
|
30
30
|
} from '@opensumi/ide-main-layout/lib/browser/tabbar/bar.view';
|
|
31
31
|
import { BaseTabPanelView, ContainerView } from '@opensumi/ide-main-layout/lib/browser/tabbar/panel.view';
|
|
32
|
-
import { TabRendererBase } from '@opensumi/ide-main-layout/lib/browser/tabbar/renderer.view';
|
|
32
|
+
import { TabRendererBase, TabbarConfig } from '@opensumi/ide-main-layout/lib/browser/tabbar/renderer.view';
|
|
33
33
|
import { TabbarService, TabbarServiceFactory } from '@opensumi/ide-main-layout/lib/browser/tabbar/tabbar.service';
|
|
34
34
|
|
|
35
35
|
import { AI_CHAT_VIEW_ID } from '../../common';
|
|
36
36
|
|
|
37
37
|
import styles from './layout.module.less';
|
|
38
38
|
|
|
39
|
-
const ChatTabbarRenderer: React.FC = () =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
39
|
+
const ChatTabbarRenderer: React.FC = () => {
|
|
40
|
+
const { side } = React.useContext(TabbarConfig);
|
|
41
|
+
const tabbarService: TabbarService = useInjectable(TabbarServiceFactory)(side);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
tabbarService.setIsLatter(true);
|
|
44
|
+
}, [tabbarService]);
|
|
45
|
+
return (
|
|
46
|
+
<div style={{ width: 0 }}>
|
|
47
|
+
<TabbarViewBase tabSize={0} MoreTabView={IconElipses} TabView={IconTabView} barSize={0} panelBorderSize={1} />
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
44
51
|
|
|
45
52
|
export const AIChatTabRenderer = ({
|
|
46
53
|
className,
|
|
@@ -103,7 +110,7 @@ export const AILeftTabRenderer = ({
|
|
|
103
110
|
const AILeftTabbarRenderer: React.FC = () => {
|
|
104
111
|
const layoutService = useInjectable<IMainLayoutService>(IMainLayoutService);
|
|
105
112
|
|
|
106
|
-
const tabbarService: TabbarService = useInjectable(TabbarServiceFactory)(SlotLocation.
|
|
113
|
+
const tabbarService: TabbarService = useInjectable(TabbarServiceFactory)(SlotLocation.right);
|
|
107
114
|
const currentContainerId = useAutorun(tabbarService.currentContainerId);
|
|
108
115
|
|
|
109
116
|
const extraMenus = React.useMemo(() => layoutService.getExtraMenu(), [layoutService]);
|
|
@@ -147,8 +154,14 @@ const AILeftTabbarRenderer: React.FC = () => {
|
|
|
147
154
|
);
|
|
148
155
|
};
|
|
149
156
|
|
|
150
|
-
export const AIRightTabRenderer = ({
|
|
151
|
-
|
|
157
|
+
export const AIRightTabRenderer = ({
|
|
158
|
+
className,
|
|
159
|
+
components,
|
|
160
|
+
}: {
|
|
161
|
+
className: string;
|
|
162
|
+
components: ComponentRegistryInfo[];
|
|
163
|
+
}) => {
|
|
164
|
+
const tabbarService: TabbarService = useInjectable(TabbarServiceFactory)(SlotLocation.right);
|
|
152
165
|
const designLayoutConfig = useInjectable<DesignLayoutConfig>(DesignLayoutConfig);
|
|
153
166
|
|
|
154
167
|
const handleClose = useCallback(() => {
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
AppConfig,
|
|
9
9
|
IAIReporter,
|
|
10
10
|
IChatProgress,
|
|
11
|
+
IMarker,
|
|
11
12
|
MarkerSeverity,
|
|
12
13
|
OnEvent,
|
|
13
14
|
WithEventBus,
|
|
@@ -62,8 +63,6 @@ export abstract class BaseApplyService extends WithEventBus {
|
|
|
62
63
|
|
|
63
64
|
private currentSessionId?: string;
|
|
64
65
|
|
|
65
|
-
protected abstract postApplyHandler(editor: ICodeEditor): Promise<void>;
|
|
66
|
-
|
|
67
66
|
constructor() {
|
|
68
67
|
super();
|
|
69
68
|
this.addDispose(
|
|
@@ -314,26 +313,10 @@ export abstract class BaseApplyService extends WithEventBus {
|
|
|
314
313
|
);
|
|
315
314
|
codeBlock.updatedCode = res.updatedCode;
|
|
316
315
|
codeBlock.status = 'pending';
|
|
317
|
-
|
|
318
|
-
// apply 结果流式输出完成后,自动尝试修复代码中的 lint 错误
|
|
319
|
-
if (this.postApplyHandler && typeof this.postApplyHandler === 'function') {
|
|
320
|
-
try {
|
|
321
|
-
await this.postApplyHandler(result.group.codeEditor.monacoEditor);
|
|
322
|
-
} catch (error) {}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
const textModel = result.group.codeEditor.monacoEditor.getModel();
|
|
326
|
-
const diagnosticInfos = this.getDiagnosticInfos(textModel!.uri.toString(), res.result?.rangesFromDiffHunk || []);
|
|
327
|
-
|
|
328
316
|
// 用户实际接受的 apply 结果
|
|
329
|
-
|
|
330
|
-
codeBlock.applyResult = {
|
|
331
|
-
diff: res.result?.diff,
|
|
332
|
-
diagnosticInfos,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
|
|
317
|
+
codeBlock.applyResult = res.result;
|
|
336
318
|
this.updateCodeBlock(codeBlock);
|
|
319
|
+
|
|
337
320
|
return codeBlock;
|
|
338
321
|
} catch (err) {
|
|
339
322
|
codeBlock.status = 'failed';
|
|
@@ -353,8 +336,8 @@ export abstract class BaseApplyService extends WithEventBus {
|
|
|
353
336
|
codeBlock: CodeBlockData,
|
|
354
337
|
updatedContentOrStream: string | SumiReadableStream<IChatProgress>,
|
|
355
338
|
range?: Range,
|
|
356
|
-
): Promise<{ result?: { diff: string;
|
|
357
|
-
const deferred = new Deferred<{ result?: { diff: string;
|
|
339
|
+
): Promise<{ result?: { diff: string; diagnosticInfos: IMarker[] }; updatedCode: string }> {
|
|
340
|
+
const deferred = new Deferred<{ result?: { diff: string; diagnosticInfos: IMarker[] }; updatedCode: string }>();
|
|
358
341
|
const inlineDiffController = InlineDiffController.get(editor)!;
|
|
359
342
|
range = range || editor.getModel()!.getFullModelRange();
|
|
360
343
|
|
|
@@ -390,11 +373,7 @@ export abstract class BaseApplyService extends WithEventBus {
|
|
|
390
373
|
|
|
391
374
|
this.listenPartialEdit(editor.getModel()!, codeBlock).then((result) => {
|
|
392
375
|
if (result) {
|
|
393
|
-
|
|
394
|
-
codeBlock.applyResult = {
|
|
395
|
-
diff: result.diff,
|
|
396
|
-
diagnosticInfos,
|
|
397
|
-
};
|
|
376
|
+
codeBlock.applyResult = result;
|
|
398
377
|
}
|
|
399
378
|
this.updateCodeBlock(codeBlock);
|
|
400
379
|
this.editorService.save(URI.file(path.join(this.appConfig.workspaceDir, codeBlock.relativePath)));
|
|
@@ -405,10 +384,11 @@ export abstract class BaseApplyService extends WithEventBus {
|
|
|
405
384
|
updatedContent,
|
|
406
385
|
codeBlock.relativePath,
|
|
407
386
|
);
|
|
387
|
+
const diagnosticInfos = this.getDiagnosticInfos(editor.getModel()!.uri.toString(), rangesFromDiffHunk);
|
|
408
388
|
deferred.resolve({
|
|
409
389
|
result: {
|
|
410
390
|
diff,
|
|
411
|
-
|
|
391
|
+
diagnosticInfos,
|
|
412
392
|
},
|
|
413
393
|
updatedCode: updatedContent,
|
|
414
394
|
});
|
|
@@ -554,7 +534,7 @@ export abstract class BaseApplyService extends WithEventBus {
|
|
|
554
534
|
}
|
|
555
535
|
|
|
556
536
|
protected listenPartialEdit(model: ITextModel, codeBlock: CodeBlockData) {
|
|
557
|
-
const deferred = new Deferred<{ diff: string;
|
|
537
|
+
const deferred = new Deferred<{ diff: string; diagnosticInfos: IMarker[] }>();
|
|
558
538
|
const uriString = model.uri.toString();
|
|
559
539
|
const toDispose = this.inlineDiffService.onPartialEdit((event) => {
|
|
560
540
|
if (
|
|
@@ -594,7 +574,7 @@ export abstract class BaseApplyService extends WithEventBus {
|
|
|
594
574
|
});
|
|
595
575
|
deferred.resolve({
|
|
596
576
|
diff,
|
|
597
|
-
|
|
577
|
+
diagnosticInfos,
|
|
598
578
|
});
|
|
599
579
|
} else {
|
|
600
580
|
// 用户全部取消
|
|
@@ -5,8 +5,7 @@ import { ILogger } from '@opensumi/ide-core-browser';
|
|
|
5
5
|
import { Emitter, Event } from '@opensumi/ide-core-common';
|
|
6
6
|
|
|
7
7
|
import { BUILTIN_MCP_SERVER_NAME, ISumiMCPServerBackend, SumiMCPServerProxyServicePath } from '../../common';
|
|
8
|
-
import {
|
|
9
|
-
import { IMCPServerProxyService, IMCPToolResult } from '../../common/types';
|
|
8
|
+
import { IMCPServerProxyService } from '../../common/types';
|
|
10
9
|
import { IMCPServerRegistry, TokenMCPServerRegistry } from '../types';
|
|
11
10
|
|
|
12
11
|
@Injectable()
|
|
@@ -65,8 +64,4 @@ export class MCPServerProxyService implements IMCPServerProxyService {
|
|
|
65
64
|
async $stopServer(serverName: string) {
|
|
66
65
|
await this.sumiMCPServerProxyService.$stopServer(serverName);
|
|
67
66
|
}
|
|
68
|
-
|
|
69
|
-
async $compressToolResult(result: IMCPToolResult, options: ImageCompressionOptions) {
|
|
70
|
-
return compressToolResultSmart(result, options);
|
|
71
|
-
}
|
|
72
67
|
}
|
|
@@ -2,7 +2,7 @@ import * as path from 'path';
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
import { Autowired } from '@opensumi/di';
|
|
5
|
+
import { Autowired, Injectable } from '@opensumi/di';
|
|
6
6
|
import { Domain, URI } from '@opensumi/ide-core-common';
|
|
7
7
|
import { IWorkspaceService } from '@opensumi/ide-workspace';
|
|
8
8
|
import { URI as MonacoURI } from '@opensumi/monaco-editor-core/esm/vs/base/common/uri';
|
|
@@ -2,7 +2,7 @@ import * as path from 'path';
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
import { Autowired } from '@opensumi/di';
|
|
5
|
+
import { Autowired, Injectable } from '@opensumi/di';
|
|
6
6
|
import { Domain, URI } from '@opensumi/ide-core-common';
|
|
7
7
|
import { WorkbenchEditorService } from '@opensumi/ide-editor';
|
|
8
8
|
import { IWorkspaceService } from '@opensumi/ide-workspace';
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
import { Autowired } from '@opensumi/di';
|
|
4
4
|
import { AppConfig } from '@opensumi/ide-core-browser';
|
|
5
|
-
import { Domain } from '@opensumi/ide-core-common';
|
|
5
|
+
import { Deferred, Domain } from '@opensumi/ide-core-common';
|
|
6
6
|
import { ITerminalController, ITerminalGroupViewService } from '@opensumi/ide-terminal-next/lib/common/controller';
|
|
7
7
|
|
|
8
8
|
import { IMCPServerRegistry, MCPLogger, MCPServerContribution, MCPToolDefinition } from '../../types';
|