@opensumi/ide-ai-native 3.7.1-next-1739781685.0 → 3.7.1
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.contextkeys.d.ts +0 -1
- package/lib/browser/ai-core.contextkeys.d.ts.map +1 -1
- package/lib/browser/ai-core.contextkeys.js +0 -1
- package/lib/browser/ai-core.contextkeys.js.map +1 -1
- package/lib/browser/ai-core.contribution.d.ts +1 -2
- package/lib/browser/ai-core.contribution.d.ts.map +1 -1
- package/lib/browser/ai-core.contribution.js +15 -60
- package/lib/browser/ai-core.contribution.js.map +1 -1
- package/lib/browser/components/ChatMarkdown.d.ts.map +1 -1
- package/lib/browser/components/ChatMarkdown.js.map +1 -1
- package/lib/browser/components/WelcomeMsg.js.map +1 -1
- package/lib/browser/components/utils.d.ts +2 -2
- package/lib/browser/contrib/intelligent-completions/index.d.ts +9 -14
- package/lib/browser/contrib/intelligent-completions/index.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/index.js +1 -6
- package/lib/browser/contrib/intelligent-completions/index.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.d.ts +0 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.js +4 -26
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.d.ts +4 -5
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.js +42 -50
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/base.d.ts +3 -9
- package/lib/browser/contrib/intelligent-completions/source/base.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/base.js +3 -21
- package/lib/browser/contrib/intelligent-completions/source/base.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.d.ts +3 -10
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.js +22 -95
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.d.ts +3 -1
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.js +20 -13
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.js.map +1 -1
- package/lib/browser/contrib/terminal/component/terminal-command-suggest-controller.js +2 -2
- package/lib/browser/contrib/terminal/component/terminal-command-suggest-controller.js.map +1 -1
- package/lib/browser/index.js +1 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/languages/tree-sitter/wasm-manager.d.ts.map +1 -1
- package/lib/browser/languages/tree-sitter/wasm-manager.js +2 -14
- package/lib/browser/languages/tree-sitter/wasm-manager.js.map +1 -1
- package/lib/browser/layout/ai-layout.d.ts.map +1 -1
- package/lib/browser/layout/ai-layout.js +2 -2
- package/lib/browser/layout/ai-layout.js.map +1 -1
- package/lib/browser/layout/layout.module.less +9 -9
- package/lib/browser/layout/tabbar.view.d.ts.map +1 -1
- package/lib/browser/layout/tabbar.view.js +6 -5
- package/lib/browser/layout/tabbar.view.js.map +1 -1
- package/lib/browser/model/enhanceDecorationsCollection.d.ts +10 -14
- package/lib/browser/model/enhanceDecorationsCollection.d.ts.map +1 -1
- package/lib/browser/model/enhanceDecorationsCollection.js +53 -42
- package/lib/browser/model/enhanceDecorationsCollection.js.map +1 -1
- package/lib/browser/model/styles.module.less +7 -0
- package/lib/browser/preferences/schema.d.ts.map +1 -1
- package/lib/browser/preferences/schema.js +0 -4
- package/lib/browser/preferences/schema.js.map +1 -1
- package/lib/browser/types.d.ts +2 -7
- package/lib/browser/types.d.ts.map +1 -1
- package/lib/browser/types.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.d.ts +1 -2
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.js +48 -20
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.d.ts +13 -3
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.js +72 -24
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.service.d.ts +6 -1
- package/lib/browser/widget/inline-chat/inline-chat.service.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.service.js +17 -5
- package/lib/browser/widget/inline-chat/inline-chat.service.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-content-widget.d.ts +5 -2
- package/lib/browser/widget/inline-chat/inline-content-widget.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-content-widget.js +42 -17
- package/lib/browser/widget/inline-chat/inline-content-widget.js.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff-previewer.d.ts +5 -22
- package/lib/browser/widget/inline-diff/inline-diff-previewer.d.ts.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff-previewer.js +30 -61
- package/lib/browser/widget/inline-diff/inline-diff-previewer.js.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff.controller.d.ts +12 -8
- package/lib/browser/widget/inline-diff/inline-diff.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff.controller.js +96 -68
- package/lib/browser/widget/inline-diff/inline-diff.controller.js.map +1 -1
- package/lib/browser/widget/inline-hint/inline-hint.controller.d.ts +1 -0
- package/lib/browser/widget/inline-hint/inline-hint.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-hint/inline-hint.controller.js +5 -0
- package/lib/browser/widget/inline-hint/inline-hint.controller.js.map +1 -1
- package/lib/browser/widget/inline-input/inline-input-widget.d.ts +2 -12
- package/lib/browser/widget/inline-input/inline-input-widget.d.ts.map +1 -1
- package/lib/browser/widget/inline-input/inline-input-widget.js +18 -26
- package/lib/browser/widget/inline-input/inline-input-widget.js.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.controller.d.ts +5 -14
- package/lib/browser/widget/inline-input/inline-input.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.controller.js +165 -321
- package/lib/browser/widget/inline-input/inline-input.controller.js.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.module.less +0 -4
- package/lib/browser/widget/inline-input/inline-input.service.d.ts +7 -19
- package/lib/browser/widget/inline-input/inline-input.service.d.ts.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.service.js +12 -72
- package/lib/browser/widget/inline-input/inline-input.service.js.map +1 -1
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.d.ts +19 -8
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.d.ts.map +1 -1
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.js +39 -44
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.js.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.component.d.ts +4 -17
- 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 +5 -37
- package/lib/browser/widget/inline-stream-diff/live-preview.component.js.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.d.ts +11 -7
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.d.ts.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.js +77 -33
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.js.map +1 -1
- package/lib/common/utils.js +2 -2
- package/lib/common/utils.js.map +1 -1
- package/package.json +21 -21
- package/src/browser/ai-core.contextkeys.ts +0 -3
- package/src/browser/ai-core.contribution.ts +17 -68
- package/src/browser/components/ChatMarkdown.tsx +1 -1
- package/src/browser/components/WelcomeMsg.tsx +1 -1
- package/src/browser/contrib/intelligent-completions/index.ts +4 -16
- package/src/browser/contrib/intelligent-completions/intelligent-completions.contribution.ts +8 -29
- package/src/browser/contrib/intelligent-completions/intelligent-completions.controller.ts +55 -86
- package/src/browser/contrib/intelligent-completions/source/base.ts +7 -28
- package/src/browser/contrib/intelligent-completions/source/line-change.source.ts +22 -129
- package/src/browser/contrib/intelligent-completions/source/lint-error.source.ts +31 -19
- package/src/browser/contrib/terminal/component/terminal-command-suggest-controller.tsx +1 -1
- package/src/browser/index.ts +2 -2
- package/src/browser/languages/tree-sitter/wasm-manager.ts +2 -12
- package/src/browser/layout/ai-layout.tsx +2 -5
- package/src/browser/layout/layout.module.less +9 -9
- package/src/browser/layout/tabbar.view.tsx +8 -10
- package/src/browser/model/enhanceDecorationsCollection.ts +77 -62
- package/src/browser/model/styles.module.less +7 -0
- package/src/browser/preferences/schema.ts +0 -4
- package/src/browser/types.ts +3 -5
- package/src/browser/widget/inline-chat/inline-chat-editor.controller.ts +64 -29
- package/src/browser/widget/inline-chat/inline-chat.feature.registry.ts +90 -23
- package/src/browser/widget/inline-chat/inline-chat.service.ts +17 -2
- package/src/browser/widget/inline-chat/inline-content-widget.tsx +69 -14
- package/src/browser/widget/inline-diff/inline-diff-previewer.ts +32 -87
- package/src/browser/widget/inline-diff/inline-diff.controller.ts +114 -90
- package/src/browser/widget/inline-hint/inline-hint.controller.ts +7 -1
- package/src/browser/widget/inline-input/inline-input-widget.tsx +12 -34
- package/src/browser/widget/inline-input/inline-input.controller.ts +242 -454
- package/src/browser/widget/inline-input/inline-input.module.less +0 -4
- package/src/browser/widget/inline-input/inline-input.service.ts +13 -92
- package/src/browser/widget/inline-stream-diff/inline-stream-diff.handler.tsx +67 -54
- package/src/browser/widget/inline-stream-diff/live-preview.component.tsx +6 -45
- package/src/browser/widget/inline-stream-diff/live-preview.decoration.tsx +112 -40
- package/src/common/utils.ts +2 -2
- package/lib/browser/contrib/intelligent-completions/source/typing.source.d.ts +0 -9
- package/lib/browser/contrib/intelligent-completions/source/typing.source.d.ts.map +0 -1
- package/lib/browser/contrib/intelligent-completions/source/typing.source.js +0 -36
- package/lib/browser/contrib/intelligent-completions/source/typing.source.js.map +0 -1
- package/lib/browser/widget/inline-input/model.d.ts +0 -34
- package/lib/browser/widget/inline-input/model.d.ts.map +0 -1
- package/lib/browser/widget/inline-input/model.js +0 -63
- package/lib/browser/widget/inline-input/model.js.map +0 -1
- package/src/browser/contrib/intelligent-completions/source/typing.source.ts +0 -34
- package/src/browser/widget/inline-input/model.ts +0 -74
package/src/browser/types.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
MaybePromise,
|
|
14
14
|
MergeConflictEditorMode,
|
|
15
15
|
} from '@opensumi/ide-core-common';
|
|
16
|
-
import { ICodeEditor, IRange,
|
|
16
|
+
import { ICodeEditor, IRange, ITextModel, NewSymbolNamesProvider, Position } from '@opensumi/ide-monaco';
|
|
17
17
|
import { SumiReadableStream } from '@opensumi/ide-utils/lib/stream';
|
|
18
18
|
import { IMarker } from '@opensumi/monaco-editor-core/esm/vs/platform/markers/common/markers';
|
|
19
19
|
|
|
@@ -42,11 +42,9 @@ interface IBaseInlineChatHandler<T extends any[]> {
|
|
|
42
42
|
providerDiffPreviewStrategy?: (...args: T) => MaybePromise<ChatResponse | InlineChatController>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export type IEditorInlineChatHandler = IBaseInlineChatHandler<
|
|
46
|
-
[editor: ICodeEditor, selection: ISelection, token: CancellationToken]
|
|
47
|
-
>;
|
|
45
|
+
export type IEditorInlineChatHandler = IBaseInlineChatHandler<[editor: ICodeEditor, token: CancellationToken]>;
|
|
48
46
|
export type IInteractiveInputHandler = IBaseInlineChatHandler<
|
|
49
|
-
[editor: ICodeEditor,
|
|
47
|
+
[editor: ICodeEditor, value: string, token: CancellationToken]
|
|
50
48
|
>;
|
|
51
49
|
|
|
52
50
|
export enum ERunStrategy {
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
Disposable,
|
|
16
16
|
ErrorResponse,
|
|
17
17
|
Event,
|
|
18
|
-
FRAME_THREE,
|
|
19
18
|
IAIReporter,
|
|
20
19
|
IDisposable,
|
|
21
20
|
ILogServiceClient,
|
|
@@ -31,14 +30,14 @@ import * as monaco from '@opensumi/ide-monaco';
|
|
|
31
30
|
import { ICodeEditor } from '@opensumi/ide-monaco';
|
|
32
31
|
import { monacoApi } from '@opensumi/ide-monaco/lib/browser/monaco-api';
|
|
33
32
|
|
|
34
|
-
import { AINativeContextKey } from '../../ai-core.contextkeys';
|
|
35
33
|
import { BaseAIMonacoEditorController } from '../../contrib/base';
|
|
36
34
|
import { CodeActionService } from '../../contrib/code-action/code-action.service';
|
|
35
|
+
import { ERunStrategy } from '../../types';
|
|
37
36
|
import { InlineDiffController } from '../inline-diff/inline-diff.controller';
|
|
38
37
|
|
|
39
38
|
import { InlineChatController } from './inline-chat-controller';
|
|
40
39
|
import { InlineChatFeatureRegistry } from './inline-chat.feature.registry';
|
|
41
|
-
import { EInlineChatStatus, EResultKind
|
|
40
|
+
import { AIInlineChatService, EInlineChatStatus, EResultKind } from './inline-chat.service';
|
|
42
41
|
import { AIInlineContentWidget } from './inline-content-widget';
|
|
43
42
|
|
|
44
43
|
export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
@@ -52,7 +51,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
52
51
|
return this.injector.get(AINativeConfigService);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
private get aiInlineChatService():
|
|
54
|
+
private get aiInlineChatService(): AIInlineChatService {
|
|
56
55
|
return this.injector.get(IAIInlineChatService);
|
|
57
56
|
}
|
|
58
57
|
|
|
@@ -87,13 +86,11 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
87
86
|
private aiInlineContentWidget: AIInlineContentWidget;
|
|
88
87
|
private aiInlineChatDisposable: Disposable = new Disposable();
|
|
89
88
|
private aiInlineChatOperationDisposable: Disposable = new Disposable();
|
|
90
|
-
private aiNativeContextKey: AINativeContextKey;
|
|
91
89
|
private inlineChatInUsing = false;
|
|
92
90
|
|
|
93
91
|
private inlineDiffController: InlineDiffController;
|
|
94
92
|
|
|
95
93
|
mount(): IDisposable {
|
|
96
|
-
this.aiNativeContextKey = this.injector.get(AINativeContextKey, [this.monacoEditor.contextKeyService]);
|
|
97
94
|
this.inlineDiffController = InlineDiffController.get(this.monacoEditor)!;
|
|
98
95
|
|
|
99
96
|
if (!this.monacoEditor) {
|
|
@@ -181,7 +178,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
181
178
|
Event.debounce(
|
|
182
179
|
Event.any<any>(this.monacoEditor.onDidChangeCursorSelection, this.monacoEditor.onMouseUp),
|
|
183
180
|
(_, e) => e,
|
|
184
|
-
|
|
181
|
+
100,
|
|
185
182
|
)(() => {
|
|
186
183
|
if (!prefInlineChatAutoVisible || !needShowInlineChat) {
|
|
187
184
|
return;
|
|
@@ -200,7 +197,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
200
197
|
return this.featureDisposable;
|
|
201
198
|
}
|
|
202
199
|
|
|
203
|
-
|
|
200
|
+
private disposeAllWidget() {
|
|
204
201
|
[this.aiInlineContentWidget, this.aiInlineChatDisposable, this.aiInlineChatOperationDisposable].forEach(
|
|
205
202
|
(widget) => {
|
|
206
203
|
widget?.dispose();
|
|
@@ -227,21 +224,9 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
227
224
|
return;
|
|
228
225
|
}
|
|
229
226
|
|
|
230
|
-
// 如果 inline input 正在展示,则不展示 inline chat
|
|
231
|
-
const isInlineInputVisible = this.aiNativeContextKey.inlineInputWidgetIsVisible.get();
|
|
232
|
-
if (isInlineInputVisible) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const isInlineStreaming = this.aiNativeContextKey.inlineInputWidgetIsStreaming.get();
|
|
237
|
-
if (isInlineStreaming) {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
227
|
if (!this.aiNativeConfigService.capabilities.supportsInlineChat) {
|
|
242
228
|
return;
|
|
243
229
|
}
|
|
244
|
-
|
|
245
230
|
if (this.inlineChatInUsing) {
|
|
246
231
|
return;
|
|
247
232
|
}
|
|
@@ -258,6 +243,12 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
258
243
|
|
|
259
244
|
this.showInlineContentWidget(monacoEditor, selection);
|
|
260
245
|
|
|
246
|
+
this.aiInlineChatDisposable.addDispose(
|
|
247
|
+
this.inlineChatFeatureRegistry.onChatClick(() => {
|
|
248
|
+
this.aiInlineChatService.launchInputVisible(true);
|
|
249
|
+
}),
|
|
250
|
+
);
|
|
251
|
+
|
|
261
252
|
this.aiInlineChatDisposable.addDispose(
|
|
262
253
|
this.aiInlineContentWidget.onActionClick(({ actionId, source }) => {
|
|
263
254
|
const handler = this.inlineChatFeatureRegistry.getEditorHandler(actionId);
|
|
@@ -280,7 +271,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
280
271
|
return undefined;
|
|
281
272
|
}
|
|
282
273
|
|
|
283
|
-
return strategy.bind(this, monacoEditor,
|
|
274
|
+
return strategy.bind(this, monacoEditor, this.token);
|
|
284
275
|
};
|
|
285
276
|
|
|
286
277
|
this.runAction({
|
|
@@ -297,7 +288,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
297
288
|
});
|
|
298
289
|
return relationId;
|
|
299
290
|
},
|
|
300
|
-
execute: handler.execute ? handler.execute!.bind(this, monacoEditor,
|
|
291
|
+
execute: handler.execute ? handler.execute!.bind(this, monacoEditor, this.token) : undefined,
|
|
301
292
|
providerPreview: previewer(),
|
|
302
293
|
extraData: {
|
|
303
294
|
actionSource: source === 'codeAction' ? ActionSourceEnum.CodeAction : ActionSourceEnum.InlineChat,
|
|
@@ -306,6 +297,49 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
306
297
|
});
|
|
307
298
|
}),
|
|
308
299
|
);
|
|
300
|
+
|
|
301
|
+
this.aiInlineChatDisposable.addDispose(
|
|
302
|
+
this.aiInlineContentWidget.onInteractiveInputValue(async (value) => {
|
|
303
|
+
const handler = this.inlineChatFeatureRegistry.getInteractiveInputHandler();
|
|
304
|
+
|
|
305
|
+
if (!handler) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const strategy = await this.inlineChatFeatureRegistry.getInteractiveInputStrategyHandler()(monacoEditor, value);
|
|
310
|
+
|
|
311
|
+
const crossSelection = this.getCrossSelection(monacoEditor);
|
|
312
|
+
if (!crossSelection) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
this.runAction({
|
|
317
|
+
monacoEditor,
|
|
318
|
+
crossSelection,
|
|
319
|
+
reporterFn: () => {
|
|
320
|
+
const relationId = this.aiReporter.start(AIServiceType.InlineChatInput, {
|
|
321
|
+
message: value,
|
|
322
|
+
type: AIServiceType.InlineChatInput,
|
|
323
|
+
source: 'input',
|
|
324
|
+
actionSource: ActionSourceEnum.InlineChatInput,
|
|
325
|
+
});
|
|
326
|
+
return relationId;
|
|
327
|
+
},
|
|
328
|
+
execute:
|
|
329
|
+
handler.execute && strategy === ERunStrategy.EXECUTE
|
|
330
|
+
? handler.execute!.bind(this, monacoEditor, value, this.token)
|
|
331
|
+
: undefined,
|
|
332
|
+
providerPreview:
|
|
333
|
+
handler.providePreviewStrategy && strategy === ERunStrategy.PREVIEW
|
|
334
|
+
? handler.providePreviewStrategy.bind(this, monacoEditor, value, this.token)
|
|
335
|
+
: undefined,
|
|
336
|
+
extraData: {
|
|
337
|
+
actionSource: ActionSourceEnum.InlineChatInput,
|
|
338
|
+
actionType: strategy,
|
|
339
|
+
},
|
|
340
|
+
});
|
|
341
|
+
}),
|
|
342
|
+
);
|
|
309
343
|
}
|
|
310
344
|
|
|
311
345
|
private getCrossSelection(monacoEditor: monaco.ICodeEditor) {
|
|
@@ -446,7 +480,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
446
480
|
}
|
|
447
481
|
|
|
448
482
|
const diffPreviewer = this.inlineDiffController.showPreviewerByStream(monacoEditor, options);
|
|
449
|
-
diffPreviewer.
|
|
483
|
+
diffPreviewer.mount(this.aiInlineContentWidget);
|
|
450
484
|
}
|
|
451
485
|
|
|
452
486
|
private ensureInlineChatVisible(monacoEditor: monaco.ICodeEditor, crossSelection: monaco.Selection) {
|
|
@@ -472,6 +506,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
472
506
|
const { monacoEditor, strategy, crossSelection, relationId, isRetry, actionType, actionSource } = params;
|
|
473
507
|
const model = monacoEditor.getModel();
|
|
474
508
|
|
|
509
|
+
this.inlineDiffController.destroyPreviewer(model!.uri.toString());
|
|
475
510
|
this.aiInlineChatOperationDisposable.dispose();
|
|
476
511
|
|
|
477
512
|
this.ensureInlineChatVisible(monacoEditor, crossSelection);
|
|
@@ -508,6 +543,12 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
508
543
|
return;
|
|
509
544
|
}
|
|
510
545
|
|
|
546
|
+
this.visibleDiffWidget({
|
|
547
|
+
monacoEditor,
|
|
548
|
+
options: { crossSelection, chatResponse: response },
|
|
549
|
+
reportInfo: { relationId, startTime, isRetry, actionType, actionSource },
|
|
550
|
+
});
|
|
551
|
+
|
|
511
552
|
this.aiInlineChatOperationDisposable.addDispose([
|
|
512
553
|
this.aiInlineContentWidget.onResultClick((kind: EResultKind) => {
|
|
513
554
|
const modifyContent = this.inlineDiffController.getModifyContent();
|
|
@@ -573,12 +614,6 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
|
|
|
573
614
|
});
|
|
574
615
|
}),
|
|
575
616
|
]);
|
|
576
|
-
|
|
577
|
-
this.visibleDiffWidget({
|
|
578
|
-
monacoEditor,
|
|
579
|
-
options: { crossSelection, chatResponse: response },
|
|
580
|
-
reportInfo: { relationId, startTime, isRetry, actionType, actionSource },
|
|
581
|
-
});
|
|
582
617
|
}
|
|
583
618
|
|
|
584
619
|
public async runAction(params: {
|
|
@@ -2,18 +2,48 @@ import { Autowired, Injectable } from '@opensumi/di';
|
|
|
2
2
|
import { KeybindingRegistry, Logger } from '@opensumi/ide-core-browser';
|
|
3
3
|
import { AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE } from '@opensumi/ide-core-browser/lib/ai-native/command';
|
|
4
4
|
import { AIActionItem } from '@opensumi/ide-core-browser/lib/components/ai-native';
|
|
5
|
-
import {
|
|
5
|
+
import { InteractiveInput } from '@opensumi/ide-core-browser/lib/components/ai-native/interactive-input/index';
|
|
6
|
+
import { Disposable, Emitter, Event, IDisposable, MaybePromise, isUndefined, uuid } from '@opensumi/ide-core-common';
|
|
7
|
+
import { ICodeEditor } from '@opensumi/ide-monaco';
|
|
6
8
|
|
|
7
9
|
import { CodeActionService } from '../../contrib/code-action/code-action.service';
|
|
8
10
|
import {
|
|
11
|
+
ERunStrategy,
|
|
9
12
|
IEditorInlineChatHandler,
|
|
10
13
|
IInlineChatFeatureRegistry,
|
|
11
14
|
IInteractiveInputHandler,
|
|
12
15
|
IInteractiveInputRunStrategy,
|
|
13
16
|
ITerminalInlineChatHandler,
|
|
14
17
|
} from '../../types';
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
|
|
19
|
+
type TRunStrategyFn = (editor: ICodeEditor, value: string) => MaybePromise<ERunStrategy>;
|
|
20
|
+
|
|
21
|
+
class InteractiveInputModel {
|
|
22
|
+
static ID: string = `${InteractiveInput.displayName}:${uuid(4)}`;
|
|
23
|
+
|
|
24
|
+
private _handler: IInteractiveInputHandler | undefined;
|
|
25
|
+
private _strategyHandler: TRunStrategyFn;
|
|
26
|
+
|
|
27
|
+
public setHandler(h: IInteractiveInputHandler): void {
|
|
28
|
+
this._handler = h;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public handler(): IInteractiveInputHandler | undefined {
|
|
32
|
+
return this._handler;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public setStrategyHandler(fn: TRunStrategyFn): void {
|
|
36
|
+
this._strategyHandler = fn;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public strategyHandler(): TRunStrategyFn {
|
|
40
|
+
return this._strategyHandler;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public dispose(): void {
|
|
44
|
+
this._handler = undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
17
47
|
|
|
18
48
|
@Injectable()
|
|
19
49
|
export class InlineChatFeatureRegistry extends Disposable implements IInlineChatFeatureRegistry {
|
|
@@ -23,9 +53,6 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
|
|
|
23
53
|
@Autowired(CodeActionService)
|
|
24
54
|
private readonly codeActionService: CodeActionService;
|
|
25
55
|
|
|
26
|
-
@Autowired(InlineInputService)
|
|
27
|
-
private readonly inlineInputService: InlineInputService;
|
|
28
|
-
|
|
29
56
|
@Autowired(KeybindingRegistry)
|
|
30
57
|
private readonly keybindingRegistry: KeybindingRegistry;
|
|
31
58
|
|
|
@@ -33,6 +60,11 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
|
|
|
33
60
|
private editorHandlerMap: Map<string, IEditorInlineChatHandler> = new Map();
|
|
34
61
|
private terminalHandlerMap: Map<string, ITerminalInlineChatHandler> = new Map();
|
|
35
62
|
|
|
63
|
+
private interactiveInputModel: InteractiveInputModel = new InteractiveInputModel();
|
|
64
|
+
|
|
65
|
+
public readonly _onChatClick = new Emitter<void>();
|
|
66
|
+
public readonly onChatClick: Event<void> = this._onChatClick.event;
|
|
67
|
+
|
|
36
68
|
override dispose() {
|
|
37
69
|
super.dispose();
|
|
38
70
|
this.actionsMap.clear();
|
|
@@ -40,6 +72,10 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
|
|
|
40
72
|
this.terminalHandlerMap.clear();
|
|
41
73
|
}
|
|
42
74
|
|
|
75
|
+
private updateActions(id: string, operational: AIActionItem): void {
|
|
76
|
+
this.actionsMap.set(id, operational);
|
|
77
|
+
}
|
|
78
|
+
|
|
43
79
|
private collectActions(operational: AIActionItem): boolean {
|
|
44
80
|
const { id } = operational;
|
|
45
81
|
|
|
@@ -66,6 +102,10 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
|
|
|
66
102
|
this.codeActionService.deleteCodeActionById(operational.id);
|
|
67
103
|
}
|
|
68
104
|
|
|
105
|
+
public getInteractiveInputId(): string {
|
|
106
|
+
return InteractiveInputModel.ID;
|
|
107
|
+
}
|
|
108
|
+
|
|
69
109
|
public registerEditorInlineChat(operational: AIActionItem, handler: IEditorInlineChatHandler): IDisposable {
|
|
70
110
|
const isCollect = this.collectActions(operational);
|
|
71
111
|
|
|
@@ -111,23 +151,29 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
|
|
|
111
151
|
runStrategy: IInteractiveInputRunStrategy,
|
|
112
152
|
handler: IInteractiveInputHandler,
|
|
113
153
|
): IDisposable {
|
|
114
|
-
|
|
115
|
-
const keybindingStr = String(this.inlineInputService.getSequenceKeyString());
|
|
116
|
-
if (!keybindingStr) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
154
|
+
this.interactiveInputModel.setHandler(handler);
|
|
119
155
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
156
|
+
if (runStrategy.handleStrategy) {
|
|
157
|
+
this.interactiveInputModel.setStrategyHandler(runStrategy.handleStrategy);
|
|
158
|
+
} else {
|
|
159
|
+
this.interactiveInputModel.setStrategyHandler(() => runStrategy.strategy || ERunStrategy.EXECUTE);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const doCollect = () => {
|
|
163
|
+
const keybindingStr = String(this.getSequenceKeyString());
|
|
164
|
+
if (keybindingStr) {
|
|
165
|
+
const operational: AIActionItem = {
|
|
166
|
+
id: InteractiveInputModel.ID,
|
|
167
|
+
name: `Chat(${keybindingStr.toLocaleUpperCase()})`,
|
|
168
|
+
renderType: 'button',
|
|
169
|
+
order: Number.MAX_SAFE_INTEGER,
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
if (this.actionsMap.has(operational.id)) {
|
|
173
|
+
this.updateActions(operational.id, operational);
|
|
174
|
+
} else {
|
|
175
|
+
this.collectActions(operational);
|
|
176
|
+
}
|
|
131
177
|
}
|
|
132
178
|
};
|
|
133
179
|
|
|
@@ -139,7 +185,28 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
|
|
|
139
185
|
|
|
140
186
|
doCollect();
|
|
141
187
|
|
|
142
|
-
return
|
|
188
|
+
return {
|
|
189
|
+
dispose: () => {
|
|
190
|
+
this.interactiveInputModel.dispose();
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
private getSequenceKeyString() {
|
|
196
|
+
const keybindings = this.keybindingRegistry.getKeybindingsForCommand(AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id);
|
|
197
|
+
const resolved = keybindings[0]?.resolved;
|
|
198
|
+
if (!resolved) {
|
|
199
|
+
return '';
|
|
200
|
+
}
|
|
201
|
+
return this.keybindingRegistry.acceleratorForSequence(resolved, '+');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
public getInteractiveInputHandler(): IInteractiveInputHandler | undefined {
|
|
205
|
+
return this.interactiveInputModel.handler();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
public getInteractiveInputStrategyHandler(): TRunStrategyFn {
|
|
209
|
+
return this.interactiveInputModel.strategyHandler();
|
|
143
210
|
}
|
|
144
211
|
|
|
145
212
|
public getEditorActionButtons(): AIActionItem[] {
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { Injectable } from '@opensumi/di';
|
|
2
2
|
import { IAIInlineChatService } from '@opensumi/ide-core-browser';
|
|
3
|
-
import { Emitter, Event } from '@opensumi/ide-core-common';
|
|
3
|
+
import { Emitter, Event, runWhenIdle } from '@opensumi/ide-core-common';
|
|
4
4
|
|
|
5
5
|
export { EInlineChatStatus, EResultKind } from '../../../common';
|
|
6
6
|
|
|
7
7
|
@Injectable({ multiple: false })
|
|
8
|
-
export class
|
|
8
|
+
export class AIInlineChatService implements IAIInlineChatService {
|
|
9
|
+
private _interactiveInputVisible: boolean = false;
|
|
10
|
+
public get interactiveInputVisible(): boolean {
|
|
11
|
+
return this._interactiveInputVisible;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public readonly _onInteractiveInputVisible = new Emitter<boolean>();
|
|
15
|
+
public readonly onInteractiveInputVisible: Event<boolean> = this._onInteractiveInputVisible.event;
|
|
16
|
+
|
|
9
17
|
public readonly _onInlineChatVisible = new Emitter<boolean>();
|
|
10
18
|
public readonly onInlineChatVisible: Event<boolean> = this._onInlineChatVisible.event;
|
|
11
19
|
|
|
@@ -15,4 +23,11 @@ export class InlineChatService implements IAIInlineChatService {
|
|
|
15
23
|
public fireThumbsEvent(isThumbsUp: boolean) {
|
|
16
24
|
this._onThumbs.fire(isThumbsUp);
|
|
17
25
|
}
|
|
26
|
+
|
|
27
|
+
public launchInputVisible(v: boolean) {
|
|
28
|
+
return runWhenIdle(() => {
|
|
29
|
+
this._interactiveInputVisible = v;
|
|
30
|
+
this._onInteractiveInputVisible.fire(v);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
18
33
|
}
|
|
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import { Autowired, INJECTOR_TOKEN, Injectable, Injector } from '@opensumi/di';
|
|
4
4
|
import { IAIInlineChatService, StackingLevel, useInjectable } from '@opensumi/ide-core-browser';
|
|
5
5
|
import { AIAction } from '@opensumi/ide-core-browser/lib/components/ai-native';
|
|
6
|
+
import { InteractiveInput } from '@opensumi/ide-core-browser/lib/components/ai-native/interactive-input/index';
|
|
6
7
|
import { MenuNode } from '@opensumi/ide-core-browser/lib/menu/next/base';
|
|
7
8
|
import {
|
|
8
9
|
AIInlineChatContentWidgetId,
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
Emitter,
|
|
11
12
|
Event,
|
|
12
13
|
InlineChatFeatureRegistryToken,
|
|
14
|
+
localize,
|
|
13
15
|
runWhenIdle,
|
|
14
16
|
} from '@opensumi/ide-core-common';
|
|
15
17
|
import * as monaco from '@opensumi/ide-monaco';
|
|
@@ -21,32 +23,38 @@ import {
|
|
|
21
23
|
|
|
22
24
|
import { AINativeContextKey } from '../../ai-core.contextkeys';
|
|
23
25
|
import { InlineResultAction } from '../inline-actions/result-items/index';
|
|
24
|
-
import { InlineInputService } from '../inline-input/inline-input.service';
|
|
25
|
-
import { InteractiveInputModel } from '../inline-input/model';
|
|
26
26
|
|
|
27
27
|
import { InlineChatFeatureRegistry } from './inline-chat.feature.registry';
|
|
28
28
|
import styles from './inline-chat.module.less';
|
|
29
|
-
import { EInlineChatStatus, EResultKind
|
|
29
|
+
import { AIInlineChatService, EInlineChatStatus, EResultKind } from './inline-chat.service';
|
|
30
30
|
|
|
31
31
|
import type { ICodeEditor as IMonacoCodeEditor } from '@opensumi/ide-monaco/lib/browser/monaco-api/types';
|
|
32
32
|
|
|
33
33
|
interface IAIInlineChatControllerProps {
|
|
34
34
|
onClickActions: (id: string) => void;
|
|
35
|
+
onLayoutChange: (height: number) => void;
|
|
35
36
|
onClose?: () => void;
|
|
37
|
+
onInteractiveInputSend?: (value: string) => void;
|
|
36
38
|
onChatStatus: Event<EInlineChatStatus>;
|
|
37
39
|
onResultClick: (k: EResultKind) => void;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
|
|
41
|
-
const { onClickActions, onClose, onChatStatus, onResultClick } = props;
|
|
42
|
-
const aiInlineChatService:
|
|
43
|
+
const { onClickActions, onClose, onInteractiveInputSend, onLayoutChange, onChatStatus, onResultClick } = props;
|
|
44
|
+
const aiInlineChatService: AIInlineChatService = useInjectable(IAIInlineChatService);
|
|
43
45
|
const inlineChatFeatureRegistry: InlineChatFeatureRegistry = useInjectable(InlineChatFeatureRegistryToken);
|
|
44
|
-
|
|
45
46
|
const [status, setStatus] = useState<EInlineChatStatus>(EInlineChatStatus.READY);
|
|
47
|
+
const [interactiveInputVisible, setInteractiveInputVisible] = useState<boolean>(false);
|
|
46
48
|
useEffect(() => {
|
|
47
49
|
const dis = new Disposable();
|
|
48
50
|
dis.addDispose(onChatStatus((s) => setStatus(s)));
|
|
49
51
|
|
|
52
|
+
dis.addDispose(
|
|
53
|
+
aiInlineChatService.onInteractiveInputVisible((v) => {
|
|
54
|
+
setInteractiveInputVisible(v);
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
|
|
50
58
|
return () => {
|
|
51
59
|
dis.dispose();
|
|
52
60
|
};
|
|
@@ -74,6 +82,13 @@ const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
|
|
|
74
82
|
onClose?.();
|
|
75
83
|
}, [onClose]);
|
|
76
84
|
|
|
85
|
+
const handleInteractiveInputSend = useCallback(
|
|
86
|
+
(value: string) => {
|
|
87
|
+
onInteractiveInputSend?.(value);
|
|
88
|
+
},
|
|
89
|
+
[onInteractiveInputSend],
|
|
90
|
+
);
|
|
91
|
+
|
|
77
92
|
const moreOperation = useMemo(
|
|
78
93
|
() =>
|
|
79
94
|
inlineChatFeatureRegistry.getEditorActionMenus().map(
|
|
@@ -90,6 +105,24 @@ const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
|
|
|
90
105
|
[inlineChatFeatureRegistry],
|
|
91
106
|
);
|
|
92
107
|
|
|
108
|
+
const customOperationRender = useMemo(() => {
|
|
109
|
+
if (!interactiveInputVisible) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<InteractiveInput
|
|
115
|
+
autoFocus
|
|
116
|
+
onHeightChange={(height) => onLayoutChange(height)}
|
|
117
|
+
size='small'
|
|
118
|
+
placeholder={localize('aiNative.inline.chat.input.placeholder.default')}
|
|
119
|
+
width={320}
|
|
120
|
+
disabled={isLoading}
|
|
121
|
+
onSend={handleInteractiveInputSend}
|
|
122
|
+
/>
|
|
123
|
+
);
|
|
124
|
+
}, [isLoading, interactiveInputVisible]);
|
|
125
|
+
|
|
93
126
|
const renderContent = useCallback(() => {
|
|
94
127
|
if (operationList.length === 0 && moreOperation.length === 0) {
|
|
95
128
|
return null;
|
|
@@ -110,9 +143,11 @@ const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
|
|
|
110
143
|
onClickItem={handleClickActions}
|
|
111
144
|
onClose={handleClose}
|
|
112
145
|
loading={isLoading}
|
|
146
|
+
loadingShowOperation={interactiveInputVisible}
|
|
147
|
+
customOperationRender={customOperationRender}
|
|
113
148
|
/>
|
|
114
149
|
);
|
|
115
|
-
}, [operationList, moreOperation, onResultClick, status]);
|
|
150
|
+
}, [operationList, moreOperation, customOperationRender, onResultClick, status, interactiveInputVisible]);
|
|
116
151
|
|
|
117
152
|
return <div className={styles.inline_chat_controller_box}>{renderContent()}</div>;
|
|
118
153
|
};
|
|
@@ -124,20 +159,28 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
|
|
|
124
159
|
@Autowired(INJECTOR_TOKEN)
|
|
125
160
|
private readonly injector: Injector;
|
|
126
161
|
|
|
127
|
-
@Autowired(
|
|
128
|
-
|
|
162
|
+
@Autowired(InlineChatFeatureRegistryToken)
|
|
163
|
+
private readonly inlineChatFeatureRegistry: InlineChatFeatureRegistry;
|
|
129
164
|
|
|
130
165
|
private readonly aiNativeContextKey: AINativeContextKey;
|
|
131
166
|
|
|
132
167
|
private readonly _onActionClickEmitter = new Emitter<{ actionId: string; source: string }>();
|
|
133
168
|
public readonly onActionClick = this._onActionClickEmitter.event;
|
|
134
169
|
|
|
170
|
+
protected readonly _onInteractiveInputValue = new Emitter<string>();
|
|
171
|
+
public readonly onInteractiveInputValue = this._onInteractiveInputValue.event;
|
|
172
|
+
|
|
135
173
|
protected readonly _onStatusChange = new Emitter<EInlineChatStatus>();
|
|
136
174
|
public readonly onStatusChange: Event<EInlineChatStatus> = this._onStatusChange.event;
|
|
137
175
|
|
|
138
176
|
protected readonly _onResultClick = new Emitter<EResultKind>();
|
|
139
177
|
public readonly onResultClick: Event<EResultKind> = this._onResultClick.event;
|
|
140
178
|
|
|
179
|
+
protected _interactiveInputValue: string;
|
|
180
|
+
public get interactiveInputValue(): string {
|
|
181
|
+
return this._interactiveInputValue;
|
|
182
|
+
}
|
|
183
|
+
|
|
141
184
|
protected _status: EInlineChatStatus = EInlineChatStatus.READY;
|
|
142
185
|
public get status(): EInlineChatStatus {
|
|
143
186
|
return this._status;
|
|
@@ -151,6 +194,13 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
|
|
|
151
194
|
super(editor);
|
|
152
195
|
|
|
153
196
|
this.aiNativeContextKey = this.injector.get(AINativeContextKey, [this.editor.contextKeyService]);
|
|
197
|
+
this.addDispose(
|
|
198
|
+
this.editor.onDidLayoutChange(() => {
|
|
199
|
+
if (this.isOutOfArea()) {
|
|
200
|
+
this.dispose();
|
|
201
|
+
}
|
|
202
|
+
}),
|
|
203
|
+
);
|
|
154
204
|
}
|
|
155
205
|
|
|
156
206
|
public launchChatStatus(status: EInlineChatStatus) {
|
|
@@ -166,11 +216,8 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
|
|
|
166
216
|
}
|
|
167
217
|
|
|
168
218
|
public clickActionId(actionId: string, source: string): void {
|
|
169
|
-
if (actionId ===
|
|
170
|
-
|
|
171
|
-
this.hide();
|
|
172
|
-
// 显示 inline input widget
|
|
173
|
-
this.inlineInputService.visibleBySelection(this.options.selection);
|
|
219
|
+
if (actionId === this.inlineChatFeatureRegistry.getInteractiveInputId()) {
|
|
220
|
+
this.inlineChatFeatureRegistry._onChatClick.fire();
|
|
174
221
|
return;
|
|
175
222
|
}
|
|
176
223
|
|
|
@@ -183,6 +230,14 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
|
|
|
183
230
|
onClickActions={(id) => this.clickActionId(id, 'widget')}
|
|
184
231
|
onClose={() => this.dispose()}
|
|
185
232
|
onChatStatus={this.onStatusChange.bind(this)}
|
|
233
|
+
onLayoutChange={() => {
|
|
234
|
+
this.editor.layoutContentWidget(this);
|
|
235
|
+
}}
|
|
236
|
+
onInteractiveInputSend={(value) => {
|
|
237
|
+
this.launchChatStatus(EInlineChatStatus.THINKING);
|
|
238
|
+
this._interactiveInputValue = value;
|
|
239
|
+
this._onInteractiveInputValue.fire(value);
|
|
240
|
+
}}
|
|
186
241
|
onResultClick={(kind: EResultKind) => {
|
|
187
242
|
this._onResultClick.fire(kind);
|
|
188
243
|
}}
|