@codingame/monaco-vscode-chat-service-override 1.85.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/chat.d.ts +5 -0
- package/chat.js +39 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +509 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +88 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +223 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +283 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +283 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js +179 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +88 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +271 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +165 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatHistoryVariables.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +626 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditor.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +564 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +41 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +41 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +748 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDecorations.js +250 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +62 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChatServiceImpl.js +35 -0
package/chat.d.ts
ADDED
package/chat.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
2
|
+
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
3
|
+
import { IChatContributionService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContributionService';
|
|
4
|
+
import { IChatWidgetService, IQuickChatService, IChatAccessibilityService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
5
|
+
import { ChatContributionService } from './vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js';
|
|
6
|
+
import { ChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
7
|
+
import { ChatService } from './vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js';
|
|
8
|
+
import { IChatWidgetHistoryService, ChatWidgetHistoryService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatWidgetHistoryService';
|
|
9
|
+
import { ChatAccessibilityService } from './vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js';
|
|
10
|
+
import { IChatProviderService, ChatProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatProvider';
|
|
11
|
+
import { IChatSlashCommandService, ChatSlashCommandService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatSlashCommands';
|
|
12
|
+
import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables';
|
|
13
|
+
import { ChatVariablesService } from './vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js';
|
|
14
|
+
import { QuickChatService } from './vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js';
|
|
15
|
+
import { IChatAgentService, ChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
16
|
+
import { InlineChatServiceImpl } from './vscode/src/vs/workbench/contrib/inlineChat/common/inlineChatServiceImpl.js';
|
|
17
|
+
import { IInlineChatSessionService, InlineChatSessionService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSession';
|
|
18
|
+
import { IInlineChatService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
19
|
+
import './vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js';
|
|
20
|
+
import './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js';
|
|
21
|
+
|
|
22
|
+
function getServiceOverride() {
|
|
23
|
+
return {
|
|
24
|
+
[( IChatService.toString())]: new SyncDescriptor(ChatService, [], true),
|
|
25
|
+
[( IChatContributionService.toString())]: new SyncDescriptor(ChatContributionService, [], true),
|
|
26
|
+
[( IChatWidgetService.toString())]: new SyncDescriptor(ChatWidgetService, [], true),
|
|
27
|
+
[( IQuickChatService.toString())]: new SyncDescriptor(QuickChatService, [], true),
|
|
28
|
+
[( IChatAccessibilityService.toString())]: new SyncDescriptor(ChatAccessibilityService, [], true),
|
|
29
|
+
[( IChatWidgetHistoryService.toString())]: new SyncDescriptor(ChatWidgetHistoryService, [], true),
|
|
30
|
+
[( IChatProviderService.toString())]: new SyncDescriptor(ChatProviderService, [], true),
|
|
31
|
+
[( IChatSlashCommandService.toString())]: new SyncDescriptor(ChatSlashCommandService, [], true),
|
|
32
|
+
[( IChatAgentService.toString())]: new SyncDescriptor(ChatAgentService, [], true),
|
|
33
|
+
[( IChatVariablesService.toString())]: new SyncDescriptor(ChatVariablesService, [], true),
|
|
34
|
+
[( IInlineChatService.toString())]: new SyncDescriptor(InlineChatServiceImpl, [], true),
|
|
35
|
+
[( IInlineChatSessionService.toString())]: new SyncDescriptor(InlineChatSessionService, [], true)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { getServiceOverride as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
+
|
|
3
|
+
export { n as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function __decorate(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
}
|
|
7
|
+
function __param(paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { __decorate, __param };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './chat.js';
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './chat.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ConfirmResult;
|
|
2
|
+
( (function(ConfirmResult) {
|
|
3
|
+
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
4
|
+
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
5
|
+
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
6
|
+
})(ConfirmResult || (ConfirmResult = {})));
|
|
7
|
+
|
|
8
|
+
export { ConfirmResult };
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codingame/monaco-vscode-chat-service-override",
|
|
3
|
+
"version": "1.85.1",
|
|
4
|
+
"keywords": [],
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "CodinGame",
|
|
7
|
+
"url": "http://www.codingame.com"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/CodinGame/monaco-vscode-api.git"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"private": false,
|
|
16
|
+
"description": "VSCode public API plugged on the monaco editor - chat service-override",
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"module": "index.js",
|
|
19
|
+
"types": "index.d.ts",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.1",
|
|
22
|
+
"monaco-editor": "0.45.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
2
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
3
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
4
|
+
|
|
5
|
+
async function clearChatEditor(accessor) {
|
|
6
|
+
const editorService = accessor.get(IEditorService);
|
|
7
|
+
const editorGroupsService = accessor.get(IEditorGroupsService);
|
|
8
|
+
const chatEditorInput = editorService.activeEditor;
|
|
9
|
+
if (chatEditorInput instanceof ChatEditorInput && chatEditorInput.providerId) {
|
|
10
|
+
await editorService.replaceEditors([{
|
|
11
|
+
editor: chatEditorInput,
|
|
12
|
+
replacement: { resource: ChatEditorInput.getNewEditorUri(), options: { target: { providerId: chatEditorInput.providerId, pinned: true } } }
|
|
13
|
+
}], editorGroupsService.activeGroup);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { clearChatEditor };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
2
|
+
import { localize2WithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { IAccessibleNotificationService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
4
|
+
import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
5
|
+
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
6
|
+
import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
7
|
+
import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
8
|
+
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
9
|
+
import { clearChatEditor } from './chatClear.js';
|
|
10
|
+
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
11
|
+
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
12
|
+
import { CONTEXT_PROVIDER_EXISTS, CONTEXT_IN_CHAT_SESSION } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
13
|
+
|
|
14
|
+
const ACTION_ID_CLEAR_CHAT = `workbench.action.chat.clear`;
|
|
15
|
+
function registerClearActions() {
|
|
16
|
+
registerAction2(class ClearEditorAction extends Action2 {
|
|
17
|
+
constructor() {
|
|
18
|
+
super({
|
|
19
|
+
id: 'workbench.action.chatEditor.clear',
|
|
20
|
+
title: ( localize2WithPath(
|
|
21
|
+
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
22
|
+
'chat.newSession.label',
|
|
23
|
+
"New Session"
|
|
24
|
+
)),
|
|
25
|
+
icon: Codicon.plus,
|
|
26
|
+
f1: false,
|
|
27
|
+
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
28
|
+
menu: [{
|
|
29
|
+
id: MenuId.EditorTitle,
|
|
30
|
+
group: 'navigation',
|
|
31
|
+
order: 0,
|
|
32
|
+
when: ( ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
|
|
33
|
+
}]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async run(accessor, ...args) {
|
|
37
|
+
announceChatCleared(accessor);
|
|
38
|
+
await clearChatEditor(accessor);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
registerAction2(class GlobalClearChatAction extends Action2 {
|
|
42
|
+
constructor() {
|
|
43
|
+
super({
|
|
44
|
+
id: ACTION_ID_CLEAR_CHAT,
|
|
45
|
+
title: ( localize2WithPath(
|
|
46
|
+
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
47
|
+
'chat.newSession.label',
|
|
48
|
+
"New Session"
|
|
49
|
+
)),
|
|
50
|
+
category: CHAT_CATEGORY,
|
|
51
|
+
icon: Codicon.clearAll,
|
|
52
|
+
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
53
|
+
f1: true,
|
|
54
|
+
keybinding: {
|
|
55
|
+
weight: 200 ,
|
|
56
|
+
primary: 2048 | 42 ,
|
|
57
|
+
mac: {
|
|
58
|
+
primary: 256 | 42
|
|
59
|
+
},
|
|
60
|
+
when: CONTEXT_IN_CHAT_SESSION
|
|
61
|
+
},
|
|
62
|
+
menu: {
|
|
63
|
+
id: MenuId.ChatContext,
|
|
64
|
+
group: 'z_clear'
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
run(accessor, ...args) {
|
|
69
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
70
|
+
const widget = widgetService.lastFocusedWidget;
|
|
71
|
+
if (!widget) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
announceChatCleared(accessor);
|
|
75
|
+
widget.clear();
|
|
76
|
+
widget.focusInput();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const getClearChatActionDescriptorForViewTitle = (viewId, providerId) => ({
|
|
81
|
+
viewId,
|
|
82
|
+
id: `workbench.action.chat.${providerId}.clear`,
|
|
83
|
+
title: ( localize2WithPath(
|
|
84
|
+
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
85
|
+
'chat.newSession.label',
|
|
86
|
+
"New Session"
|
|
87
|
+
)),
|
|
88
|
+
menu: {
|
|
89
|
+
id: MenuId.ViewTitle,
|
|
90
|
+
when: ( ContextKeyExpr.equals('view', viewId)),
|
|
91
|
+
group: 'navigation',
|
|
92
|
+
order: -1
|
|
93
|
+
},
|
|
94
|
+
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
95
|
+
category: CHAT_CATEGORY,
|
|
96
|
+
icon: Codicon.plus,
|
|
97
|
+
f1: false
|
|
98
|
+
});
|
|
99
|
+
function getClearAction(viewId, providerId) {
|
|
100
|
+
return class ClearAction extends ViewAction {
|
|
101
|
+
constructor() {
|
|
102
|
+
super(getClearChatActionDescriptorForViewTitle(viewId, providerId));
|
|
103
|
+
}
|
|
104
|
+
async runInView(accessor, view) {
|
|
105
|
+
announceChatCleared(accessor);
|
|
106
|
+
await view.clear();
|
|
107
|
+
view.widget.focusInput();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function announceChatCleared(accessor) {
|
|
112
|
+
accessor.get(IAccessibleNotificationService).notify("clear" );
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { ACTION_ID_CLEAR_CHAT, getClearAction, registerClearActions };
|