@theia/ai-chat-ui 1.63.0-next.24 → 1.63.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-chat-ui-contribution.d.ts +31 -1
- package/lib/browser/ai-chat-ui-contribution.d.ts.map +1 -1
- package/lib/browser/ai-chat-ui-contribution.js +192 -8
- package/lib/browser/ai-chat-ui-contribution.js.map +1 -1
- package/lib/browser/ai-chat-ui-frontend-module.d.ts.map +1 -1
- package/lib/browser/ai-chat-ui-frontend-module.js +8 -0
- package/lib/browser/ai-chat-ui-frontend-module.js.map +1 -1
- package/lib/browser/chat-input-widget.d.ts +24 -16
- package/lib/browser/chat-input-widget.d.ts.map +1 -1
- package/lib/browser/chat-input-widget.js +199 -37
- package/lib/browser/chat-input-widget.js.map +1 -1
- package/lib/browser/chat-node-toolbar-action-contribution.d.ts +1 -0
- package/lib/browser/chat-node-toolbar-action-contribution.d.ts.map +1 -1
- package/lib/browser/chat-node-toolbar-action-contribution.js +13 -0
- package/lib/browser/chat-node-toolbar-action-contribution.js.map +1 -1
- package/lib/browser/chat-response-renderer/delegation-response-renderer.d.ts +14 -0
- package/lib/browser/chat-response-renderer/delegation-response-renderer.d.ts.map +1 -0
- package/lib/browser/chat-response-renderer/delegation-response-renderer.js +144 -0
- package/lib/browser/chat-response-renderer/delegation-response-renderer.js.map +1 -0
- package/lib/browser/chat-response-renderer/index.d.ts +1 -0
- package/lib/browser/chat-response-renderer/index.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/index.js +1 -0
- package/lib/browser/chat-response-renderer/index.js.map +1 -1
- package/lib/browser/chat-response-renderer/tool-confirmation.d.ts +2 -2
- package/lib/browser/chat-response-renderer/tool-confirmation.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/tool-confirmation.js +23 -23
- package/lib/browser/chat-response-renderer/tool-confirmation.js.map +1 -1
- package/lib/browser/chat-response-renderer/toolcall-part-renderer.d.ts +4 -1
- package/lib/browser/chat-response-renderer/toolcall-part-renderer.d.ts.map +1 -1
- package/lib/browser/chat-response-renderer/toolcall-part-renderer.js +65 -32
- package/lib/browser/chat-response-renderer/toolcall-part-renderer.js.map +1 -1
- package/lib/browser/chat-tree-view/chat-view-tree-widget.d.ts +3 -1
- package/lib/browser/chat-tree-view/chat-view-tree-widget.d.ts.map +1 -1
- package/lib/browser/chat-tree-view/chat-view-tree-widget.js +50 -8
- package/lib/browser/chat-tree-view/chat-view-tree-widget.js.map +1 -1
- package/lib/browser/chat-tree-view/sub-chat-widget.d.ts +22 -0
- package/lib/browser/chat-tree-view/sub-chat-widget.d.ts.map +1 -0
- package/lib/browser/chat-tree-view/sub-chat-widget.js +92 -0
- package/lib/browser/chat-tree-view/sub-chat-widget.js.map +1 -0
- package/lib/browser/chat-view-commands.d.ts +1 -0
- package/lib/browser/chat-view-commands.d.ts.map +1 -1
- package/lib/browser/chat-view-commands.js +5 -0
- package/lib/browser/chat-view-commands.js.map +1 -1
- package/lib/browser/chat-view-contribution.d.ts +2 -0
- package/lib/browser/chat-view-contribution.d.ts.map +1 -1
- package/lib/browser/chat-view-contribution.js +31 -18
- package/lib/browser/chat-view-contribution.js.map +1 -1
- package/lib/browser/chat-view-widget-toolbar-contribution.d.ts +2 -0
- package/lib/browser/chat-view-widget-toolbar-contribution.d.ts.map +1 -1
- package/lib/browser/chat-view-widget-toolbar-contribution.js +13 -5
- package/lib/browser/chat-view-widget-toolbar-contribution.js.map +1 -1
- package/lib/browser/chat-view-widget.d.ts +1 -1
- package/lib/browser/chat-view-widget.d.ts.map +1 -1
- package/lib/browser/chat-view-widget.js +1 -4
- package/lib/browser/chat-view-widget.js.map +1 -1
- package/package.json +11 -11
- package/src/browser/ai-chat-ui-contribution.ts +191 -12
- package/src/browser/ai-chat-ui-frontend-module.ts +11 -0
- package/src/browser/chat-input-widget.tsx +253 -58
- package/src/browser/chat-node-toolbar-action-contribution.ts +14 -0
- package/src/browser/chat-response-renderer/delegation-response-renderer.tsx +177 -0
- package/src/browser/chat-response-renderer/index.ts +1 -0
- package/src/browser/chat-response-renderer/tool-confirmation.tsx +30 -30
- package/src/browser/chat-response-renderer/toolcall-part-renderer.tsx +95 -60
- package/src/browser/chat-tree-view/chat-view-tree-widget.tsx +58 -8
- package/src/browser/chat-tree-view/sub-chat-widget.tsx +101 -0
- package/src/browser/chat-view-commands.ts +6 -0
- package/src/browser/chat-view-contribution.ts +29 -18
- package/src/browser/chat-view-widget-toolbar-contribution.tsx +12 -5
- package/src/browser/chat-view-widget.tsx +2 -5
- package/src/browser/style/index.css +209 -5
|
@@ -3,11 +3,13 @@ import { AIChatContribution } from './ai-chat-ui-contribution';
|
|
|
3
3
|
import { Emitter, InMemoryResources } from '@theia/core';
|
|
4
4
|
import { CommandRegistry } from '@theia/core/lib/common/command';
|
|
5
5
|
import { MonacoEditorProvider } from '@theia/monaco/lib/browser/monaco-editor-provider';
|
|
6
|
+
import { AIActivationService } from '@theia/ai-core/lib/browser';
|
|
6
7
|
export declare class ChatViewWidgetToolbarContribution implements TabBarToolbarContribution {
|
|
7
8
|
protected readonly chatContribution: AIChatContribution;
|
|
8
9
|
protected readonly commandRegistry: CommandRegistry;
|
|
9
10
|
protected readonly editorProvider: MonacoEditorProvider;
|
|
10
11
|
protected readonly resources: InMemoryResources;
|
|
12
|
+
protected readonly activationService: AIActivationService;
|
|
11
13
|
protected readonly onChatWidgetStateChangedEmitter: Emitter<void>;
|
|
12
14
|
protected readonly onChatWidgetStateChanged: import("@theia/core").Event<void>;
|
|
13
15
|
private readonly sessionSettingsURI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-view-widget-toolbar-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/chat-view-widget-toolbar-contribution.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACjH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC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AI,CAAC;CAgBtD"}
|
|
@@ -25,6 +25,7 @@ const command_1 = require("@theia/core/lib/common/command");
|
|
|
25
25
|
const session_settings_dialog_1 = require("./session-settings-dialog");
|
|
26
26
|
const monaco_editor_provider_1 = require("@theia/monaco/lib/browser/monaco-editor-provider");
|
|
27
27
|
const chat_view_widget_1 = require("./chat-view-widget");
|
|
28
|
+
const browser_1 = require("@theia/ai-core/lib/browser");
|
|
28
29
|
let ChatViewWidgetToolbarContribution = class ChatViewWidgetToolbarContribution {
|
|
29
30
|
constructor() {
|
|
30
31
|
this.onChatWidgetStateChangedEmitter = new core_1.Emitter();
|
|
@@ -38,8 +39,8 @@ let ChatViewWidgetToolbarContribution = class ChatViewWidgetToolbarContribution
|
|
|
38
39
|
});
|
|
39
40
|
this.commandRegistry.registerCommand(chat_view_commands_1.ChatCommands.EDIT_SESSION_SETTINGS, {
|
|
40
41
|
execute: () => this.openJsonDataDialog(),
|
|
41
|
-
isEnabled: widget => widget instanceof chat_view_widget_1.ChatViewWidget,
|
|
42
|
-
isVisible: widget => widget instanceof chat_view_widget_1.ChatViewWidget
|
|
42
|
+
isEnabled: widget => this.activationService.isActive && widget instanceof chat_view_widget_1.ChatViewWidget,
|
|
43
|
+
isVisible: widget => this.activationService.isActive && widget instanceof chat_view_widget_1.ChatViewWidget
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
registerToolbarItems(registry) {
|
|
@@ -48,20 +49,23 @@ let ChatViewWidgetToolbarContribution = class ChatViewWidgetToolbarContribution
|
|
|
48
49
|
command: chat_view_commands_1.ChatCommands.SCROLL_LOCK_WIDGET.id,
|
|
49
50
|
tooltip: core_1.nls.localizeByDefault('Turn Auto Scrolling Off'),
|
|
50
51
|
onDidChange: this.onChatWidgetStateChanged,
|
|
51
|
-
priority: 2
|
|
52
|
+
priority: 2,
|
|
53
|
+
when: browser_1.ENABLE_AI_CONTEXT_KEY
|
|
52
54
|
});
|
|
53
55
|
registry.registerItem({
|
|
54
56
|
id: chat_view_commands_1.ChatCommands.SCROLL_UNLOCK_WIDGET.id,
|
|
55
57
|
command: chat_view_commands_1.ChatCommands.SCROLL_UNLOCK_WIDGET.id,
|
|
56
58
|
tooltip: core_1.nls.localizeByDefault('Turn Auto Scrolling On'),
|
|
57
59
|
onDidChange: this.onChatWidgetStateChanged,
|
|
58
|
-
priority: 2
|
|
60
|
+
priority: 2,
|
|
61
|
+
when: browser_1.ENABLE_AI_CONTEXT_KEY
|
|
59
62
|
});
|
|
60
63
|
registry.registerItem({
|
|
61
64
|
id: chat_view_commands_1.ChatCommands.EDIT_SESSION_SETTINGS.id,
|
|
62
65
|
command: chat_view_commands_1.ChatCommands.EDIT_SESSION_SETTINGS.id,
|
|
63
66
|
tooltip: core_1.nls.localize('theia/ai/session-settings-dialog/tooltip', 'Set Session Settings'),
|
|
64
|
-
priority: 3
|
|
67
|
+
priority: 3,
|
|
68
|
+
when: browser_1.ENABLE_AI_CONTEXT_KEY
|
|
65
69
|
});
|
|
66
70
|
}
|
|
67
71
|
async openJsonDataDialog() {
|
|
@@ -95,6 +99,10 @@ tslib_1.__decorate([
|
|
|
95
99
|
(0, inversify_1.inject)(core_1.InMemoryResources),
|
|
96
100
|
tslib_1.__metadata("design:type", core_1.InMemoryResources)
|
|
97
101
|
], ChatViewWidgetToolbarContribution.prototype, "resources", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, inversify_1.inject)(browser_1.AIActivationService),
|
|
104
|
+
tslib_1.__metadata("design:type", browser_1.AIActivationService)
|
|
105
|
+
], ChatViewWidgetToolbarContribution.prototype, "activationService", void 0);
|
|
98
106
|
tslib_1.__decorate([
|
|
99
107
|
(0, inversify_1.postConstruct)(),
|
|
100
108
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-view-widget-toolbar-contribution.js","sourceRoot":"","sources":["../../src/browser/chat-view-widget-toolbar-contribution.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAiF;AAEjF,uEAA+D;AAC/D,sCAAmE;AACnE,6DAAoD;AACpD,4DAAiE;AACjE,uEAAkE;AAClE,6FAAwF;AACxF,yDAAoD;
|
|
1
|
+
{"version":3,"file":"chat-view-widget-toolbar-contribution.js","sourceRoot":"","sources":["../../src/browser/chat-view-widget-toolbar-contribution.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAiF;AAEjF,uEAA+D;AAC/D,sCAAmE;AACnE,6DAAoD;AACpD,4DAAiE;AACjE,uEAAkE;AAClE,6FAAwF;AACxF,yDAAoD;AACpD,wDAAwF;AAGjF,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAAvC;QAgBgB,oCAA+B,GAAG,IAAI,cAAO,EAAQ,CAAC;QACtD,6BAAwB,GAAG,IAAI,CAAC,+BAA+B,CAAC,KAAK,CAAC;QAExE,uBAAkB,GAAG,IAAI,UAAG,CAAC,0BAA0B,CAAC,CAAC;IA2D9E,CAAC;IAxDa,IAAI;QACV,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QAElD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACvC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC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G,CAAC,QAAQ,CAAC,0CAA0C,EAAE,sBAAsB,CAAC;YACzF,QAAQ,EAAE,CAAC;YACX,IAAI,EAAE,+BAAqB;SAC9B,CAAC,CAAC;IACP,CAAC;IAES,KAAK,CAAC,kBAAkB;QAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO;QACX,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,+CAAqB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE;YACnG,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE;SACxC,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IAEL,CAAC;CACJ,CAAA;AA9EY,8EAAiC;AAEvB;IADlB,IAAA,kBAAM,EAAC,4CAAkB,CAAC;sCACU,4CAAkB;2EAAC;AAGrC;IADlB,IAAA,kBAAM,EAAC,yBAAe,CAAC;sCACY,yBAAe;0EAAC;AAGjC;IADlB,IAAA,kBAAM,EAAC,6CAAoB,CAAC;sCACM,6CAAoB;yEAAC;AAGrC;IADlB,IAAA,kBAAM,EAAC,wBAAiB,CAAC;sCACI,wBAAiB;oEAAC;AAG7B;IADlB,IAAA,kBAAM,EAAC,6BAAmB,CAAC;sCACU,6BAAmB;4EAAC;AAQhD;IADT,IAAA,yBAAa,GAAE;;;;6DAaf;4CAlCQ,iCAAiC;IAD7C,IAAA,sBAAU,GAAE;GACA,iCAAiC,CA8E7C"}
|
|
@@ -38,7 +38,7 @@ export declare class ChatViewWidget extends BaseWidget implements ExtractableWid
|
|
|
38
38
|
protected get state(): ChatViewWidget.State;
|
|
39
39
|
protected set state(state: ChatViewWidget.State);
|
|
40
40
|
get onStateChanged(): Event<ChatViewWidget.State>;
|
|
41
|
-
protected onQuery(query
|
|
41
|
+
protected onQuery(query?: string | ChatRequest): Promise<void>;
|
|
42
42
|
protected onUnpin(): void;
|
|
43
43
|
protected onCancel(requestModel: ChatRequestModel): void;
|
|
44
44
|
protected onDeleteChangeSet(sessionId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-view-widget.d.ts","sourceRoot":"","sources":["../../src/browser/chat-view-widget.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAa,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAiD,MAAM,gBAAgB,CAAC;AACxI,OAAO,EAAE,UAAU,EAAW,iBAAiB,EAAE,OAAO,EAAe,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG1I,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,yBAAiB,cAAc,CAAC;IAC5B,UAAiB,KAAK;QAClB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC7B;CACJ;AAED,qBACa,cAAe,SAAQ,UAAW,YAAW,iBAAiB,EAAE,cAAc;IAmCnF,QAAQ,CAAC,UAAU,EAAE,kBAAkB;IAEvC,QAAQ,CAAC,WAAW,EAAE,iBAAiB;IAnC3C,OAAc,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9 +90,6 @@ let ChatViewWidget = ChatViewWidget_1 = class ChatViewWidget extends browser_1.B
|
|
|
90
90
|
this.treeWidget.trackChatModel(this.chatSession.model);
|
|
91
91
|
this.inputWidget.chatModel = this.chatSession.model;
|
|
92
92
|
this.inputWidget.pinnedAgent = this.chatSession.pinnedAgent;
|
|
93
|
-
if (event.focus) {
|
|
94
|
-
this.show();
|
|
95
|
-
}
|
|
96
93
|
}
|
|
97
94
|
else {
|
|
98
95
|
console.warn(`Session with ${event.sessionId} not found.`);
|
|
@@ -131,7 +128,7 @@ let ChatViewWidget = ChatViewWidget_1 = class ChatViewWidget extends browser_1.B
|
|
|
131
128
|
return this.onStateChangedEmitter.event;
|
|
132
129
|
}
|
|
133
130
|
async onQuery(query) {
|
|
134
|
-
const chatRequest = typeof query === 'string' ? { text: query } : { ...query };
|
|
131
|
+
const chatRequest = !query ? { text: '' } : typeof query === 'string' ? { text: query } : { ...query };
|
|
135
132
|
if (chatRequest.text.length === 0) {
|
|
136
133
|
return;
|
|
137
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-view-widget.js","sourceRoot":"","sources":["../../src/browser/chat-view-widget.tsx"],"names":[],"mappings":";;;;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,sCAA6F;AAC7F,4CAAwI;AACxI,qDAA0I;AAC1I,oDAAiD;AACjD,4DAAiF;AACjF,2DAAwD;AACxD,kFAA4E;AAC5E,4FAAuF;AAEvF,uFAAkF;AAClF,wDAAqE;AAU9D,IAAM,cAAc,sBAApB,MAAM,cAAe,SAAQ,oBAAU;IAiC1C,YAEI,UAAuC,EAEvC,WAAuC;QAEvC,KAAK,EAAE,CAAC;QAJ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CACU,2CAAmB;yDAAC;AAGvC;IADlB,IAAA,kBAAM,EAAC,iCAAuB,CAAC;;uDAC4B;AAGzC;IADlB,IAAA,kBAAM,EAAC,yCAAkB,CAAC;;0DAC+B;AA0BhD;IADT,IAAA,yBAAa,GAAE;;;;0CAwCf;yBAzFQ,cAAc;IAD1B,IAAA,sBAAU,GAAE;IAmCJ,mBAAA,IAAA,kBAAM,EAAC,0CAAkB,CAAC,CAAA;IAE1B,mBAAA,IAAA,kBAAM,EAAC,qCAAiB,CAAC,CAAA;6CADL,0CAAkB;QAEjB,qCAAiB;GArClC,cAAc,CAgO1B"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-chat-ui",
|
|
3
|
-
"version": "1.63.0
|
|
3
|
+
"version": "1.63.0",
|
|
4
4
|
"description": "Theia - AI Chat UI Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/ai-chat": "1.63.0
|
|
7
|
-
"@theia/ai-core": "1.63.0
|
|
8
|
-
"@theia/core": "1.63.0
|
|
9
|
-
"@theia/editor": "1.63.0
|
|
10
|
-
"@theia/editor-preview": "1.63.0
|
|
11
|
-
"@theia/filesystem": "1.63.0
|
|
12
|
-
"@theia/monaco": "1.63.0
|
|
6
|
+
"@theia/ai-chat": "1.63.0",
|
|
7
|
+
"@theia/ai-core": "1.63.0",
|
|
8
|
+
"@theia/core": "1.63.0",
|
|
9
|
+
"@theia/editor": "1.63.0",
|
|
10
|
+
"@theia/editor-preview": "1.63.0",
|
|
11
|
+
"@theia/filesystem": "1.63.0",
|
|
12
|
+
"@theia/monaco": "1.63.0",
|
|
13
13
|
"@theia/monaco-editor-core": "1.96.302",
|
|
14
|
-
"@theia/workspace": "1.63.0
|
|
14
|
+
"@theia/workspace": "1.63.0",
|
|
15
15
|
"date-fns": "^4.1.0",
|
|
16
16
|
"minimatch": "^5.1.0",
|
|
17
17
|
"tslib": "^2.6.2",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"watch": "theiaext watch"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@theia/ext-scripts": "1.
|
|
54
|
+
"@theia/ext-scripts": "1.63.0"
|
|
55
55
|
},
|
|
56
56
|
"nyc": {
|
|
57
57
|
"extends": "../../configs/nyc.json"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "facf442522991134333495a0b90cf56a56990280"
|
|
60
60
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
17
|
+
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
18
18
|
import { CommandRegistry, Emitter, isOSX, MessageService, nls, QuickInputButton, QuickInputService, QuickPickItem } from '@theia/core';
|
|
19
19
|
import { Widget } from '@theia/core/lib/browser';
|
|
20
20
|
import {
|
|
@@ -22,7 +22,9 @@ import {
|
|
|
22
22
|
AI_CHAT_SHOW_CHATS_COMMAND,
|
|
23
23
|
ChatCommands
|
|
24
24
|
} from './chat-view-commands';
|
|
25
|
-
import { ChatAgentLocation, ChatService } from '@theia/ai-chat';
|
|
25
|
+
import { ChatAgent, ChatAgentLocation, ChatService, isActiveSessionChangedEvent } from '@theia/ai-chat';
|
|
26
|
+
import { ChatAgentService } from '@theia/ai-chat/lib/common/chat-agent-service';
|
|
27
|
+
import { EditorManager } from '@theia/editor/lib/browser/editor-manager';
|
|
26
28
|
import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
|
|
27
29
|
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
28
30
|
import { ChatViewWidget } from './chat-view-widget';
|
|
@@ -30,9 +32,9 @@ import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
|
30
32
|
import { SecondaryWindowHandler } from '@theia/core/lib/browser/secondary-window-handler';
|
|
31
33
|
import { formatDistance } from 'date-fns';
|
|
32
34
|
import * as locales from 'date-fns/locale';
|
|
33
|
-
import { AI_SHOW_SETTINGS_COMMAND } from '@theia/ai-core/lib/browser';
|
|
35
|
+
import { AI_SHOW_SETTINGS_COMMAND, AIActivationService, ENABLE_AI_CONTEXT_KEY } from '@theia/ai-core/lib/browser';
|
|
34
36
|
import { ChatNodeToolbarCommands } from './chat-node-toolbar-action-contribution';
|
|
35
|
-
import { isEditableRequestNode, type EditableRequestNode } from './chat-tree-view';
|
|
37
|
+
import { isEditableRequestNode, isResponseNode, type EditableRequestNode, type ResponseNode } from './chat-tree-view';
|
|
36
38
|
import { TASK_CONTEXT_VARIABLE } from '@theia/ai-chat/lib/browser/task-context-variable';
|
|
37
39
|
import { TaskContextService } from '@theia/ai-chat/lib/browser/task-context-service';
|
|
38
40
|
|
|
@@ -49,6 +51,12 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
49
51
|
protected readonly taskContextService: TaskContextService;
|
|
50
52
|
@inject(MessageService)
|
|
51
53
|
protected readonly messageService: MessageService;
|
|
54
|
+
@inject(ChatAgentService)
|
|
55
|
+
protected readonly chatAgentService: ChatAgentService;
|
|
56
|
+
@inject(EditorManager)
|
|
57
|
+
protected readonly editorManager: EditorManager;
|
|
58
|
+
@inject(AIActivationService)
|
|
59
|
+
protected readonly activationService: AIActivationService;
|
|
52
60
|
|
|
53
61
|
protected static readonly RENAME_CHAT_BUTTON: QuickInputButton = {
|
|
54
62
|
iconClass: 'codicon-edit',
|
|
@@ -75,6 +83,19 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
75
83
|
});
|
|
76
84
|
}
|
|
77
85
|
|
|
86
|
+
@postConstruct()
|
|
87
|
+
initialize(): void {
|
|
88
|
+
this.chatService.onSessionEvent(event => {
|
|
89
|
+
if (!isActiveSessionChangedEvent(event)) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (event.focus) {
|
|
93
|
+
this.openView({ activate: true });
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
78
99
|
override registerCommands(registry: CommandRegistry): void {
|
|
79
100
|
super.registerCommands(registry);
|
|
80
101
|
registry.registerCommand(ChatCommands.SCROLL_LOCK_WIDGET, {
|
|
@@ -95,7 +116,8 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
95
116
|
});
|
|
96
117
|
registry.registerCommand(AI_CHAT_NEW_CHAT_WINDOW_COMMAND, {
|
|
97
118
|
execute: () => this.openView().then(() => this.chatService.createSession(ChatAgentLocation.Panel, { focus: true })),
|
|
98
|
-
isVisible: widget => this.withWidget(widget, () => true),
|
|
119
|
+
isVisible: widget => this.activationService.isActive && this.withWidget(widget, () => true),
|
|
120
|
+
isEnabled: widget => this.activationService.isActive && this.withWidget(widget, () => true),
|
|
99
121
|
});
|
|
100
122
|
registry.registerCommand(ChatCommands.AI_CHAT_NEW_WITH_TASK_CONTEXT, {
|
|
101
123
|
execute: async () => {
|
|
@@ -111,12 +133,14 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
111
133
|
registry.registerCommand(ChatCommands.AI_CHAT_SUMMARIZE_CURRENT_SESSION, {
|
|
112
134
|
execute: async () => this.summarizeActiveSession(),
|
|
113
135
|
isVisible: widget => {
|
|
136
|
+
if (!this.activationService.isActive) { return false; }
|
|
114
137
|
if (widget && !this.withWidget(widget)) { return false; }
|
|
115
138
|
const activeSession = this.chatService.getActiveSession();
|
|
116
139
|
return activeSession?.model.location === ChatAgentLocation.Panel
|
|
117
140
|
&& !this.taskContextService.hasSummary(activeSession);
|
|
118
141
|
},
|
|
119
142
|
isEnabled: widget => {
|
|
143
|
+
if (!this.activationService.isActive) { return false; }
|
|
120
144
|
if (widget && !this.withWidget(widget)) { return false; }
|
|
121
145
|
const activeSession = this.chatService.getActiveSession();
|
|
122
146
|
return activeSession?.model.location === ChatAgentLocation.Panel
|
|
@@ -131,15 +155,32 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
131
155
|
await this.taskContextService.open(id);
|
|
132
156
|
},
|
|
133
157
|
isVisible: widget => {
|
|
158
|
+
if (!this.activationService.isActive) { return false; }
|
|
134
159
|
if (widget && !this.withWidget(widget)) { return false; }
|
|
135
160
|
const activeSession = this.chatService.getActiveSession();
|
|
136
161
|
return !!activeSession && this.taskContextService.hasSummary(activeSession);
|
|
162
|
+
},
|
|
163
|
+
isEnabled: widget => {
|
|
164
|
+
if (!this.activationService.isActive) { return false; }
|
|
165
|
+
return this.withWidget(widget, () => true);
|
|
137
166
|
}
|
|
138
167
|
});
|
|
168
|
+
registry.registerCommand(ChatCommands.AI_CHAT_INITIATE_SESSION_WITH_TASK_CONTEXT, {
|
|
169
|
+
execute: async () => {
|
|
170
|
+
const selectedContextId = await this.selectTaskContextWithMarking();
|
|
171
|
+
if (!selectedContextId) { return; }
|
|
172
|
+
const selectedAgent = await this.selectAgent('Coder');
|
|
173
|
+
if (!selectedAgent) { return; }
|
|
174
|
+
const newSession = this.chatService.createSession(ChatAgentLocation.Panel, { focus: true }, selectedAgent);
|
|
175
|
+
newSession.model.context.addVariables({ variable: TASK_CONTEXT_VARIABLE, arg: selectedContextId });
|
|
176
|
+
},
|
|
177
|
+
isVisible: () => this.activationService.isActive,
|
|
178
|
+
isEnabled: () => this.activationService.isActive
|
|
179
|
+
});
|
|
139
180
|
registry.registerCommand(AI_CHAT_SHOW_CHATS_COMMAND, {
|
|
140
181
|
execute: () => this.selectChat(),
|
|
141
|
-
isEnabled: widget => this.withWidget(widget) && this.chatService.getSessions().some(session => !!session.title),
|
|
142
|
-
isVisible: widget => this.withWidget(widget)
|
|
182
|
+
isEnabled: widget => this.activationService.isActive && this.withWidget(widget) && this.chatService.getSessions().some(session => !!session.title),
|
|
183
|
+
isVisible: widget => this.activationService.isActive && this.withWidget(widget)
|
|
143
184
|
});
|
|
144
185
|
registry.registerCommand(ChatNodeToolbarCommands.EDIT, {
|
|
145
186
|
isEnabled: node => isEditableRequestNode(node) && !node.request.isEditing,
|
|
@@ -155,6 +196,33 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
155
196
|
node.request.cancelEdit();
|
|
156
197
|
}
|
|
157
198
|
});
|
|
199
|
+
registry.registerCommand(ChatNodeToolbarCommands.RETRY, {
|
|
200
|
+
isEnabled: node => isResponseNode(node) && (node.response.isError || node.response.isCanceled),
|
|
201
|
+
isVisible: node => isResponseNode(node) && (node.response.isError || node.response.isCanceled),
|
|
202
|
+
execute: async (node: ResponseNode) => {
|
|
203
|
+
try {
|
|
204
|
+
// Get the session for this response node
|
|
205
|
+
const session = this.chatService.getActiveSession();
|
|
206
|
+
if (!session) {
|
|
207
|
+
this.messageService.error('Session not found for retry');
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Find the request associated with this response
|
|
212
|
+
const request = session.model.getRequests().find(req => req.response.id === node.response.id);
|
|
213
|
+
if (!request) {
|
|
214
|
+
this.messageService.error('Request not found for retry');
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Send the same request again using the chat service
|
|
219
|
+
await this.chatService.sendRequest(node.sessionId, request.request);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
console.error('Failed to retry chat message:', error);
|
|
222
|
+
this.messageService.error('Failed to retry message');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
158
226
|
}
|
|
159
227
|
|
|
160
228
|
registerToolbarItems(registry: TabBarToolbarRegistry): void {
|
|
@@ -162,13 +230,15 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
162
230
|
id: AI_CHAT_NEW_CHAT_WINDOW_COMMAND.id,
|
|
163
231
|
command: AI_CHAT_NEW_CHAT_WINDOW_COMMAND.id,
|
|
164
232
|
tooltip: nls.localizeByDefault('New Chat'),
|
|
165
|
-
isVisible: widget => this.withWidget(widget)
|
|
233
|
+
isVisible: widget => this.activationService.isActive && this.withWidget(widget),
|
|
234
|
+
when: ENABLE_AI_CONTEXT_KEY
|
|
166
235
|
});
|
|
167
236
|
registry.registerItem({
|
|
168
237
|
id: AI_CHAT_SHOW_CHATS_COMMAND.id,
|
|
169
238
|
command: AI_CHAT_SHOW_CHATS_COMMAND.id,
|
|
170
239
|
tooltip: nls.localizeByDefault('Show Chats...'),
|
|
171
|
-
isVisible: widget => this.withWidget(widget),
|
|
240
|
+
isVisible: widget => this.activationService.isActive && this.withWidget(widget),
|
|
241
|
+
when: ENABLE_AI_CONTEXT_KEY
|
|
172
242
|
});
|
|
173
243
|
registry.registerItem({
|
|
174
244
|
id: 'chat-view.' + AI_SHOW_SETTINGS_COMMAND.id,
|
|
@@ -176,20 +246,24 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
176
246
|
group: 'ai-settings',
|
|
177
247
|
priority: 3,
|
|
178
248
|
tooltip: nls.localize('theia/ai-chat-ui/open-settings-tooltip', 'Open AI settings...'),
|
|
179
|
-
isVisible: widget => this.withWidget(widget),
|
|
249
|
+
isVisible: widget => this.activationService.isActive && this.withWidget(widget),
|
|
250
|
+
when: ENABLE_AI_CONTEXT_KEY
|
|
180
251
|
});
|
|
181
252
|
const sessionSummarizibilityChangedEmitter = new Emitter<void>();
|
|
182
253
|
this.taskContextService.onDidChange(() => sessionSummarizibilityChangedEmitter.fire());
|
|
183
254
|
this.chatService.onSessionEvent(event => event.type === 'activeChange' && sessionSummarizibilityChangedEmitter.fire());
|
|
255
|
+
this.activationService.onDidChangeActiveStatus(() => sessionSummarizibilityChangedEmitter.fire());
|
|
184
256
|
registry.registerItem({
|
|
185
257
|
id: 'chat-view.' + ChatCommands.AI_CHAT_SUMMARIZE_CURRENT_SESSION.id,
|
|
186
258
|
command: ChatCommands.AI_CHAT_SUMMARIZE_CURRENT_SESSION.id,
|
|
187
|
-
onDidChange: sessionSummarizibilityChangedEmitter.event
|
|
259
|
+
onDidChange: sessionSummarizibilityChangedEmitter.event,
|
|
260
|
+
when: ENABLE_AI_CONTEXT_KEY
|
|
188
261
|
});
|
|
189
262
|
registry.registerItem({
|
|
190
263
|
id: 'chat-view.' + ChatCommands.AI_CHAT_OPEN_SUMMARY_FOR_CURRENT_SESSION.id,
|
|
191
264
|
command: ChatCommands.AI_CHAT_OPEN_SUMMARY_FOR_CURRENT_SESSION.id,
|
|
192
|
-
onDidChange: sessionSummarizibilityChangedEmitter.event
|
|
265
|
+
onDidChange: sessionSummarizibilityChangedEmitter.event,
|
|
266
|
+
when: ENABLE_AI_CONTEXT_KEY
|
|
193
267
|
});
|
|
194
268
|
}
|
|
195
269
|
|
|
@@ -289,6 +363,111 @@ export class AIChatContribution extends AbstractViewContribution<ChatViewWidget>
|
|
|
289
363
|
return undefined;
|
|
290
364
|
});
|
|
291
365
|
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Prompts the user to select a chat agent
|
|
369
|
+
* @returns The selected agent or undefined if cancelled
|
|
370
|
+
*/
|
|
371
|
+
/**
|
|
372
|
+
* Prompts the user to select a chat agent with an optional default (pre-selected) agent.
|
|
373
|
+
* @param defaultAgentId The id of the agent to pre-select, if present
|
|
374
|
+
* @returns The selected agent or undefined if cancelled
|
|
375
|
+
*/
|
|
376
|
+
protected async selectAgent(defaultAgentId?: string): Promise<ChatAgent | undefined> {
|
|
377
|
+
const agents = this.chatAgentService.getAgents();
|
|
378
|
+
if (agents.length === 0) {
|
|
379
|
+
this.messageService.warn('No chat agents available.');
|
|
380
|
+
return undefined;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const items: QuickPickItem[] = agents.map(agent => ({
|
|
384
|
+
label: agent.name || agent.id,
|
|
385
|
+
description: agent.description,
|
|
386
|
+
id: agent.id
|
|
387
|
+
}));
|
|
388
|
+
|
|
389
|
+
let preselected: QuickPickItem | undefined = undefined;
|
|
390
|
+
if (defaultAgentId) {
|
|
391
|
+
preselected = items.find(item => item.id === defaultAgentId);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const selected = await this.quickInputService.showQuickPick(items, {
|
|
395
|
+
placeholder: 'Select an agent for the new session',
|
|
396
|
+
activeItem: preselected
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
if (!selected) {
|
|
400
|
+
return undefined;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
return this.chatAgentService.getAgent(selected.id!);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Prompts the user to select a task context with special marking for currently opened files
|
|
408
|
+
* @returns The selected task context ID or undefined if cancelled
|
|
409
|
+
*/
|
|
410
|
+
protected async selectTaskContextWithMarking(): Promise<string | undefined> {
|
|
411
|
+
const contexts = this.taskContextService.getAll();
|
|
412
|
+
const openedFilesInfo = this.getOpenedTaskContextFiles();
|
|
413
|
+
|
|
414
|
+
// Create items with opened files marked and prioritized
|
|
415
|
+
const items: QuickPickItem[] = contexts.map(summary => {
|
|
416
|
+
const isOpened = openedFilesInfo.openedIds.includes(summary.id);
|
|
417
|
+
const isActive = openedFilesInfo.activeId === summary.id;
|
|
418
|
+
return {
|
|
419
|
+
label: isOpened ? `📄 ${summary.label} (currently open)` : summary.label,
|
|
420
|
+
description: summary.id,
|
|
421
|
+
id: summary.id,
|
|
422
|
+
// We'll sort active file first, then opened files, then others
|
|
423
|
+
sortText: isActive ? `0-${summary.label}` : isOpened ? `1-${summary.label}` : `2-${summary.label}`
|
|
424
|
+
};
|
|
425
|
+
}).sort((a, b) => a.sortText!.localeCompare(b.sortText!));
|
|
426
|
+
|
|
427
|
+
const selected = await this.quickInputService.showQuickPick(items, {
|
|
428
|
+
placeholder: 'Select a task context to attach'
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
return selected?.id;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Returns information about task context files that are currently opened
|
|
436
|
+
* @returns Object with arrays of opened context IDs and the active context ID
|
|
437
|
+
*/
|
|
438
|
+
protected getOpenedTaskContextFiles(): { openedIds: string[], activeId?: string } {
|
|
439
|
+
// Get all contexts with their URIs
|
|
440
|
+
const allContexts = this.taskContextService.getAll();
|
|
441
|
+
const contextMap = new Map<string, string>(); // Map of URI -> ID
|
|
442
|
+
// Create a map of URI string -> context ID for lookup
|
|
443
|
+
for (const context of allContexts) {
|
|
444
|
+
if (context.uri) {
|
|
445
|
+
contextMap.set(context.uri.toString(), context.id);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// Get all open editor URIs
|
|
450
|
+
const openEditorUris = this.editorManager.all.map(widget => widget.editor.uri.toString());
|
|
451
|
+
|
|
452
|
+
// Get the currently active/focused editor URI if any
|
|
453
|
+
const activeEditorUri = this.editorManager.currentEditor?.editor.uri.toString();
|
|
454
|
+
let activeContextId: string | undefined;
|
|
455
|
+
|
|
456
|
+
if (activeEditorUri) {
|
|
457
|
+
activeContextId = contextMap.get(activeEditorUri);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// Filter to only task context files that are currently opened
|
|
461
|
+
const openedContextIds: string[] = [];
|
|
462
|
+
for (const uri of openEditorUris) {
|
|
463
|
+
const contextId = contextMap.get(uri);
|
|
464
|
+
if (contextId) {
|
|
465
|
+
openedContextIds.push(contextId);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return { openedIds: openedContextIds, activeId: activeContextId };
|
|
470
|
+
}
|
|
292
471
|
}
|
|
293
472
|
|
|
294
473
|
function getDateFnsLocale(): locales.Locale {
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
ToolCallPartRenderer,
|
|
37
37
|
ThinkingPartRenderer,
|
|
38
38
|
ProgressPartRenderer,
|
|
39
|
+
DelegationResponseRenderer,
|
|
39
40
|
} from './chat-response-renderer';
|
|
40
41
|
import {
|
|
41
42
|
GitHubSelectionResolver,
|
|
@@ -53,6 +54,7 @@ import { ContextVariablePicker } from './context-variable-picker';
|
|
|
53
54
|
import { ChangeSetActionRenderer, ChangeSetActionService } from './change-set-actions/change-set-action-service';
|
|
54
55
|
import { ChangeSetAcceptAction } from './change-set-actions/change-set-accept-action';
|
|
55
56
|
import { AIChatTreeInputArgs, AIChatTreeInputConfiguration, AIChatTreeInputFactory, AIChatTreeInputWidget } from './chat-tree-view/chat-view-tree-input-widget';
|
|
57
|
+
import { SubChatWidget, SubChatWidgetFactory } from './chat-tree-view/sub-chat-widget';
|
|
56
58
|
|
|
57
59
|
export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
58
60
|
bindViewContribution(bind, AIChatContribution);
|
|
@@ -118,6 +120,7 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
|
118
120
|
bind(ChatResponsePartRenderer).to(ThinkingPartRenderer).inSingletonScope();
|
|
119
121
|
bind(ChatResponsePartRenderer).to(QuestionPartRenderer).inSingletonScope();
|
|
120
122
|
bind(ChatResponsePartRenderer).to(ProgressPartRenderer).inSingletonScope();
|
|
123
|
+
bind(ChatResponsePartRenderer).to(DelegationResponseRenderer).inSingletonScope();
|
|
121
124
|
[CommandContribution, MenuContribution].forEach(serviceIdentifier =>
|
|
122
125
|
bind(serviceIdentifier).to(ChatViewMenuContribution).inSingletonScope()
|
|
123
126
|
);
|
|
@@ -144,6 +147,14 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
|
144
147
|
bindContributionProvider(bind, ChatNodeToolbarActionContribution);
|
|
145
148
|
bind(DefaultChatNodeToolbarActionContribution).toSelf().inSingletonScope();
|
|
146
149
|
bind(ChatNodeToolbarActionContribution).toService(DefaultChatNodeToolbarActionContribution);
|
|
150
|
+
|
|
151
|
+
bind(SubChatWidgetFactory).toFactory(ctx => () => {
|
|
152
|
+
const container = ctx.container.createChild();
|
|
153
|
+
container.bind(SubChatWidget).toSelf().inSingletonScope();
|
|
154
|
+
const widget = container.get(SubChatWidget);
|
|
155
|
+
return widget;
|
|
156
|
+
});
|
|
157
|
+
|
|
147
158
|
});
|
|
148
159
|
|
|
149
160
|
function bindChatViewWidget(bind: interfaces.Bind): void {
|