@codingame/monaco-vscode-chat-service-override 15.0.2 → 16.0.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/index.js +11 -8
- package/package.json +29 -20
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +22 -0
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +80 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.js +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/{askToSelectPrompt.d.ts → askToSelectPrompt/askToSelectPrompt.d.ts} +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.js +79 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.js +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.js +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +163 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +22 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +242 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.js +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +688 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +355 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +395 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +98 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +97 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +831 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +32 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +985 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +284 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +578 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +320 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.js +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +22 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +166 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +6 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +704 -732
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +10 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +329 -236
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +14 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +217 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +90 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +65 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js +14 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +16 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +175 -57
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +313 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +18 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptPathAutocompletion.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +157 -65
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +39 -21
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +47 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.d.ts +5 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt.js +0 -142
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -331
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.js +0 -85
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.js +0 -22
|
@@ -24,7 +24,6 @@ import '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vsc
|
|
|
24
24
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
25
25
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
26
26
|
import { InlineCompletionsController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController';
|
|
27
|
-
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
28
27
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
29
28
|
import { IMarkerDecorationsService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/markerDecorations.service';
|
|
30
29
|
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
@@ -36,20 +35,21 @@ import { createStyleSheet2 } from '@codingame/monaco-vscode-api/vscode/vs/base/b
|
|
|
36
35
|
import { stringValue } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/cssValue';
|
|
37
36
|
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
38
37
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
38
|
+
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
39
39
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
|
|
40
40
|
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
41
41
|
import { derivedWithStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
42
42
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
43
43
|
|
|
44
44
|
var InlineChatHintsController_1;
|
|
45
|
-
const CTX_INLINE_CHAT_SHOWING_HINT = ( new RawContextKey('inlineChatShowingHint', false, ( localize(
|
|
45
|
+
const CTX_INLINE_CHAT_SHOWING_HINT = ( new RawContextKey('inlineChatShowingHint', false, ( localize(7180, "Whether inline chat shows a contextual hint"))));
|
|
46
46
|
const _inlineChatActionId = 'inlineChat.startWithCurrentLine';
|
|
47
47
|
class InlineChatExpandLineAction extends EditorAction2 {
|
|
48
48
|
constructor() {
|
|
49
49
|
super({
|
|
50
50
|
id: _inlineChatActionId,
|
|
51
51
|
category: AbstractInline1ChatAction.category,
|
|
52
|
-
title: ( localize2(
|
|
52
|
+
title: ( localize2(7181, "Start in Editor with Current Line")),
|
|
53
53
|
f1: true,
|
|
54
54
|
precondition: ( ContextKeyExpr.and(( CTX_INLINE_CHAT_VISIBLE.negate()), CTX_INLINE_CHAT_HAS_AGENT, EditorContextKeys.writable)),
|
|
55
55
|
keybinding: [{
|
|
@@ -92,7 +92,7 @@ class ShowInlineChatHintAction extends EditorAction2 {
|
|
|
92
92
|
super({
|
|
93
93
|
id: 'inlineChat.showHint',
|
|
94
94
|
category: AbstractInline1ChatAction.category,
|
|
95
|
-
title: ( localize2(
|
|
95
|
+
title: ( localize2(7182, "Show Inline Chat Hint")),
|
|
96
96
|
f1: false,
|
|
97
97
|
precondition: ( ContextKeyExpr.and(( CTX_INLINE_CHAT_VISIBLE.negate()), CTX_INLINE_CHAT_HAS_AGENT, EditorContextKeys.writable)),
|
|
98
98
|
});
|
|
@@ -187,7 +187,7 @@ let InlineChatHintsController = class InlineChatHintsController extends Disposab
|
|
|
187
187
|
const showDataObs = derivedWithStore((r, store) => {
|
|
188
188
|
const ghostState = ghostCtrl?.model.read(r)?.state.read(r);
|
|
189
189
|
const textFocus = editorObs.isTextFocused.read(r);
|
|
190
|
-
|
|
190
|
+
let position = editorObs.cursorPosition.read(r);
|
|
191
191
|
const model = editorObs.model.read(r);
|
|
192
192
|
const kb = keyObs.read(r);
|
|
193
193
|
if (ghostState !== undefined || !kb || !position || !model || !textFocus) {
|
|
@@ -199,6 +199,7 @@ let InlineChatHintsController = class InlineChatHintsController extends Disposab
|
|
|
199
199
|
const emitter = store.add(( new Emitter()));
|
|
200
200
|
store.add(model.onDidChangeContent(() => emitter.fire()));
|
|
201
201
|
observableFromEvent(emitter.event, () => model.getVersionId()).read(r);
|
|
202
|
+
position = model.validatePosition(position);
|
|
202
203
|
const visible = this._visibilityObs.read(r);
|
|
203
204
|
const isEol = model.getLineMaxColumn(position.lineNumber) === position.column;
|
|
204
205
|
const isWhitespace = model.getLineLastNonWhitespaceColumn(position.lineNumber) === 0 && model.getValueLength() > 0 && position.column > 1;
|
|
@@ -222,15 +223,15 @@ let InlineChatHintsController = class InlineChatHintsController extends Disposab
|
|
|
222
223
|
this._ctxShowingHint.reset();
|
|
223
224
|
return;
|
|
224
225
|
}
|
|
225
|
-
const agentName = chatAgentService.getDefaultAgent(ChatAgentLocation.Editor)?.name ?? ( localize(
|
|
226
|
+
const agentName = chatAgentService.getDefaultAgent(ChatAgentLocation.Editor)?.name ?? ( localize(7183, "Chat"));
|
|
226
227
|
const { position, isEol, isWhitespace, kb, model } = showData;
|
|
227
228
|
const inlineClassName = ['a' , 'inline-chat-hint', 'inline-chat-hint-text'];
|
|
228
229
|
let content;
|
|
229
230
|
if (isWhitespace) {
|
|
230
|
-
content = '\u00a0' + ( localize(
|
|
231
|
+
content = '\u00a0' + ( localize(7184, "{0} to edit with {1}", kb, agentName));
|
|
231
232
|
}
|
|
232
233
|
else if (isEol) {
|
|
233
|
-
content = '\u00a0' + ( localize(
|
|
234
|
+
content = '\u00a0' + ( localize(7185, "{0} to continue with {1}", kb, agentName));
|
|
234
235
|
}
|
|
235
236
|
else {
|
|
236
237
|
content = '\u200a' + kb + '\u200a';
|
|
@@ -259,7 +260,7 @@ let InlineChatHintsController = class InlineChatHintsController extends Disposab
|
|
|
259
260
|
getActions: () => [
|
|
260
261
|
toAction({
|
|
261
262
|
id: 'inlineChat.disableHint',
|
|
262
|
-
label: ( localize(
|
|
263
|
+
label: ( localize(7186, "Disable Inline Chat Hint")),
|
|
263
264
|
run: async () => {
|
|
264
265
|
await this._configurationService.updateValue(setting, false);
|
|
265
266
|
}
|
|
@@ -287,7 +288,7 @@ class HideInlineChatHintAction extends EditorAction2 {
|
|
|
287
288
|
constructor() {
|
|
288
289
|
super({
|
|
289
290
|
id: 'inlineChat.hideHint',
|
|
290
|
-
title: ( localize2(
|
|
291
|
+
title: ( localize2(7187, "Hide Inline Chat Hint")),
|
|
291
292
|
precondition: CTX_INLINE_CHAT_SHOWING_HINT,
|
|
292
293
|
keybinding: {
|
|
293
294
|
weight: KeybindingWeight.EditorContrib - 10,
|
|
@@ -10,7 +10,7 @@ import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/w
|
|
|
10
10
|
import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
11
11
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
12
12
|
import { NotebookTextDiffEditor } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor';
|
|
13
|
-
import { NotebookMultiTextDiffEditor } from '@codingame/monaco-vscode-
|
|
13
|
+
import { NotebookMultiTextDiffEditor } from '@codingame/monaco-vscode-bba55be6-41a2-50cd-a3cc-8bafa35bfa89-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor';
|
|
14
14
|
|
|
15
15
|
let InlineChatNotebookContribution = class InlineChatNotebookContribution {
|
|
16
16
|
constructor(sessionService, editorService, notebookEditorService) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { CellDiffInfo } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel";
|
|
3
|
+
import { INotebookEditor } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
4
|
+
export declare class NotebookModifiedCellDecorator extends Disposable {
|
|
5
|
+
private readonly notebookEditor;
|
|
6
|
+
private readonly decorators;
|
|
7
|
+
constructor(notebookEditor: INotebookEditor);
|
|
8
|
+
apply(diffInfo: CellDiffInfo[]): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import { Disposable, DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { NotebookOverviewRulerLane } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
4
|
+
import { overviewRulerModifiedForeground } from '@codingame/monaco-vscode-ae8a8ca1-f243-508b-9c37-c88ebbd295fa-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
|
|
5
|
+
|
|
6
|
+
class NotebookModifiedCellDecorator extends Disposable {
|
|
7
|
+
constructor(notebookEditor) {
|
|
8
|
+
super();
|
|
9
|
+
this.notebookEditor = notebookEditor;
|
|
10
|
+
this.decorators = this._register(( new DisposableStore()));
|
|
11
|
+
}
|
|
12
|
+
apply(diffInfo) {
|
|
13
|
+
const model = this.notebookEditor.textModel;
|
|
14
|
+
if (!model) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const modifiedCells = [];
|
|
18
|
+
for (const diff of diffInfo) {
|
|
19
|
+
if (diff.type === 'modified') {
|
|
20
|
+
const cell = model.cells[diff.modifiedCellIndex];
|
|
21
|
+
modifiedCells.push(cell);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const ids = this.notebookEditor.deltaCellDecorations([], ( modifiedCells.map(cell => ({
|
|
25
|
+
handle: cell.handle,
|
|
26
|
+
options: {
|
|
27
|
+
overviewRuler: {
|
|
28
|
+
color: overviewRulerModifiedForeground,
|
|
29
|
+
modelRanges: [],
|
|
30
|
+
includeOutput: true,
|
|
31
|
+
position: NotebookOverviewRulerLane.Full
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}))));
|
|
35
|
+
this.clear();
|
|
36
|
+
this.decorators.add(toDisposable(() => {
|
|
37
|
+
if (!this.notebookEditor.isDisposed) {
|
|
38
|
+
this.notebookEditor.deltaCellDecorations(ids, []);
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
clear() {
|
|
43
|
+
this.decorators.clear();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { NotebookModifiedCellDecorator };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IWorkspace } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace";
|
|
2
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
3
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
4
|
+
export declare function isChatTransferredWorkspace(workspace: IWorkspace, storageService: IStorageService): boolean;
|
|
5
|
+
export declare function areWorkspaceFoldersEmpty(workspace: IWorkspace, fileService: IFileService): Promise<boolean>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
3
|
+
import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
4
|
+
|
|
5
|
+
function isChatTransferredWorkspace(workspace, storageService) {
|
|
6
|
+
const workspaceUri = workspace.folders[0]?.uri;
|
|
7
|
+
if (!workspaceUri) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const chatWorkspaceTransfer = storageService.getObject('chat.workspaceTransfer', StorageScope.PROFILE, []);
|
|
11
|
+
const toWorkspace = ( chatWorkspaceTransfer.map((item) => {
|
|
12
|
+
return { toWorkspace: ( URI.from(item.toWorkspace)) };
|
|
13
|
+
}));
|
|
14
|
+
return ( toWorkspace.some(item => ( item.toWorkspace.toString()) === ( workspaceUri.toString())));
|
|
15
|
+
}
|
|
16
|
+
async function areWorkspaceFoldersEmpty(workspace, fileService) {
|
|
17
|
+
for (const folder of workspace.folders) {
|
|
18
|
+
const folderStat = await fileService.resolve(folder.uri);
|
|
19
|
+
if (folderStat.children && folderStat.children.length > 0) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { areWorkspaceFoldersEmpty, isChatTransferredWorkspace };
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
|
-
import { assert } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
5
|
-
import { showEditsView, showChatView } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
6
|
-
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import { extUri, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
8
|
-
import { DOCUMENTATION_URL } from '../../../../common/promptSyntax/constants.js';
|
|
9
|
-
import { isWindows, isLinux } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
10
|
-
import { assertDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
11
|
-
import { getCleanPromptName } from '@codingame/monaco-vscode-52bb4d5b-ba1a-57fd-9bee-b28824214eac-common/vscode/vs/platform/prompts/common/constants';
|
|
12
|
-
|
|
13
|
-
const DOCS_OPTION = {
|
|
14
|
-
type: 'item',
|
|
15
|
-
label: ( localize(4300, 'Learn how to create reusable prompts')),
|
|
16
|
-
description: DOCUMENTATION_URL,
|
|
17
|
-
tooltip: DOCUMENTATION_URL,
|
|
18
|
-
value: ( URI.parse(DOCUMENTATION_URL)),
|
|
19
|
-
};
|
|
20
|
-
const askToSelectPrompt = async (options) => {
|
|
21
|
-
const { promptFiles, resource, quickInputService, labelService } = options;
|
|
22
|
-
const fileOptions = ( promptFiles.map((promptFile) => {
|
|
23
|
-
return createPickItem(promptFile, labelService);
|
|
24
|
-
}));
|
|
25
|
-
fileOptions.push(DOCS_OPTION);
|
|
26
|
-
let activeItem;
|
|
27
|
-
if (resource) {
|
|
28
|
-
activeItem = fileOptions.find((file) => {
|
|
29
|
-
return extUri.isEqual(file.value, resource);
|
|
30
|
-
});
|
|
31
|
-
if (!activeItem) {
|
|
32
|
-
activeItem = createPickItem({
|
|
33
|
-
uri: resource,
|
|
34
|
-
type: 'local',
|
|
35
|
-
}, labelService);
|
|
36
|
-
fileOptions.push(activeItem);
|
|
37
|
-
}
|
|
38
|
-
fileOptions.sort((file1, file2) => {
|
|
39
|
-
if (extUri.isEqual(file1.value, resource)) {
|
|
40
|
-
return -1;
|
|
41
|
-
}
|
|
42
|
-
if (extUri.isEqual(file2.value, resource)) {
|
|
43
|
-
return 1;
|
|
44
|
-
}
|
|
45
|
-
return 0;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (!activeItem) {
|
|
49
|
-
activeItem = fileOptions[0];
|
|
50
|
-
}
|
|
51
|
-
const { openerService } = options;
|
|
52
|
-
const quickPick = quickInputService.createQuickPick();
|
|
53
|
-
quickPick.activeItems = activeItem ? [activeItem] : [];
|
|
54
|
-
quickPick.placeholder = createPlaceholderText(options);
|
|
55
|
-
quickPick.canAcceptInBackground = true;
|
|
56
|
-
quickPick.matchOnDescription = true;
|
|
57
|
-
quickPick.items = fileOptions;
|
|
58
|
-
return await ( new Promise(resolve => {
|
|
59
|
-
const disposables = ( new DisposableStore());
|
|
60
|
-
let lastActiveWidget = options.widget;
|
|
61
|
-
disposables.add({
|
|
62
|
-
dispose() {
|
|
63
|
-
quickPick.dispose();
|
|
64
|
-
resolve();
|
|
65
|
-
lastActiveWidget?.focusInput();
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
disposables.add(quickPick.onDidAccept(async (event) => {
|
|
69
|
-
const { selectedItems } = quickPick;
|
|
70
|
-
const { alt, ctrlCmd } = quickPick.keyMods;
|
|
71
|
-
assert(selectedItems.length === 1, `Only one item can be accepted, got '${selectedItems.length}'.`);
|
|
72
|
-
const docsSelected = (selectedItems[0] === DOCS_OPTION);
|
|
73
|
-
if (ctrlCmd || docsSelected) {
|
|
74
|
-
return await openFiles(selectedItems, openerService);
|
|
75
|
-
}
|
|
76
|
-
lastActiveWidget = await attachFiles(selectedItems, options, alt);
|
|
77
|
-
if (!event.inBackground) {
|
|
78
|
-
disposables.dispose();
|
|
79
|
-
}
|
|
80
|
-
}));
|
|
81
|
-
disposables.add(quickPick.onDidHide(disposables.dispose.bind(disposables)));
|
|
82
|
-
quickPick.show();
|
|
83
|
-
}));
|
|
84
|
-
};
|
|
85
|
-
const createPickItem = (promptFile, labelService) => {
|
|
86
|
-
const { uri, type } = promptFile;
|
|
87
|
-
const fileWithoutExtension = getCleanPromptName(uri);
|
|
88
|
-
const description = (type === 'user')
|
|
89
|
-
? ( localize(4301, 'User prompt'))
|
|
90
|
-
: labelService.getUriLabel(dirname(uri), { relative: true });
|
|
91
|
-
const tooltip = (type === 'user')
|
|
92
|
-
? description
|
|
93
|
-
: uri.fsPath;
|
|
94
|
-
return {
|
|
95
|
-
type: 'item',
|
|
96
|
-
label: fileWithoutExtension,
|
|
97
|
-
description,
|
|
98
|
-
tooltip,
|
|
99
|
-
value: uri,
|
|
100
|
-
id: ( uri.toString()),
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
const createPlaceholderText = (options) => {
|
|
104
|
-
const { widget } = options;
|
|
105
|
-
let text = ( localize(4302, 'Select a prompt to use'));
|
|
106
|
-
if (!widget) {
|
|
107
|
-
const altOptionkey = (isWindows || isLinux) ? 'Alt' : 'Option';
|
|
108
|
-
const altOptionModifierNote = ( localize(4303, '{0}-key to use in Edits', altOptionkey));
|
|
109
|
-
const cmdCtrlkey = (isWindows || isLinux) ? 'Ctrl' : 'Cmd';
|
|
110
|
-
const superModifierNote = ( localize(4304, '{0}-key to open in editor', cmdCtrlkey));
|
|
111
|
-
text += ( localize(4305, ' (hold {0} or {1})', altOptionModifierNote, superModifierNote));
|
|
112
|
-
}
|
|
113
|
-
return text;
|
|
114
|
-
};
|
|
115
|
-
const openFiles = async (files, openerService) => {
|
|
116
|
-
for (const file of files) {
|
|
117
|
-
await openerService.open(file.value);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
const attachFiles = async (files, options, altOption) => {
|
|
121
|
-
const widget = await getChatWidgetObject(options, altOption);
|
|
122
|
-
for (const file of files) {
|
|
123
|
-
widget
|
|
124
|
-
.attachmentModel
|
|
125
|
-
.promptInstructions
|
|
126
|
-
.add(file.value);
|
|
127
|
-
}
|
|
128
|
-
return widget;
|
|
129
|
-
};
|
|
130
|
-
const getChatWidgetObject = async (options, altOption) => {
|
|
131
|
-
const { widget, viewsService } = options;
|
|
132
|
-
if (!widget) {
|
|
133
|
-
const widget = (altOption)
|
|
134
|
-
? await showEditsView(viewsService)
|
|
135
|
-
: await showChatView(viewsService);
|
|
136
|
-
assertDefined(widget, 'Revealed chat widget must be defined.');
|
|
137
|
-
return widget;
|
|
138
|
-
}
|
|
139
|
-
return widget;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export { askToSelectPrompt };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
-
import { IReadonlyVSDataTransfer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/dataTransfer";
|
|
3
|
-
import { HierarchicalKind } from "@codingame/monaco-vscode-api/vscode/vs/base/common/hierarchicalKind";
|
|
4
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
5
|
-
import { IRange } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
|
|
6
|
-
import { DocumentPasteContext, DocumentPasteEditProvider, DocumentPasteEditsSession } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
|
|
7
|
-
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
8
|
-
import { ILanguageFeaturesService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service";
|
|
9
|
-
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
10
|
-
import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service";
|
|
11
|
-
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
12
|
-
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
13
|
-
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
14
|
-
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
15
|
-
export declare class PasteImageProvider implements DocumentPasteEditProvider {
|
|
16
|
-
private readonly chatWidgetService;
|
|
17
|
-
private readonly extensionService;
|
|
18
|
-
private readonly fileService;
|
|
19
|
-
private readonly environmentService;
|
|
20
|
-
private readonly logService;
|
|
21
|
-
private readonly imagesFolder;
|
|
22
|
-
readonly kind: HierarchicalKind;
|
|
23
|
-
readonly providedPasteEditKinds: HierarchicalKind[];
|
|
24
|
-
readonly copyMimeTypes: never[];
|
|
25
|
-
readonly pasteMimeTypes: string[];
|
|
26
|
-
constructor(chatWidgetService: IChatWidgetService, extensionService: IExtensionService, fileService: IFileService, environmentService: IEnvironmentService, logService: ILogService);
|
|
27
|
-
provideDocumentPasteEdits(model: ITextModel, ranges: readonly IRange[], dataTransfer: IReadonlyVSDataTransfer, context: DocumentPasteContext, token: CancellationToken): Promise<DocumentPasteEditsSession | undefined>;
|
|
28
|
-
private createFileForMedia;
|
|
29
|
-
private cleanupOldImages;
|
|
30
|
-
private getTimestampFromFilename;
|
|
31
|
-
}
|
|
32
|
-
export declare function imageToHash(data: Uint8Array): Promise<string>;
|
|
33
|
-
export declare function isImage(array: Uint8Array): boolean;
|
|
34
|
-
export declare class CopyTextProvider implements DocumentPasteEditProvider {
|
|
35
|
-
readonly providedPasteEditKinds: never[];
|
|
36
|
-
readonly copyMimeTypes: string[];
|
|
37
|
-
readonly pasteMimeTypes: never[];
|
|
38
|
-
prepareDocumentPaste(model: ITextModel, ranges: readonly IRange[], dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): Promise<undefined | IReadonlyVSDataTransfer>;
|
|
39
|
-
}
|
|
40
|
-
export declare class PasteTextProvider implements DocumentPasteEditProvider {
|
|
41
|
-
private readonly chatWidgetService;
|
|
42
|
-
private readonly modelService;
|
|
43
|
-
readonly kind: HierarchicalKind;
|
|
44
|
-
readonly providedPasteEditKinds: HierarchicalKind[];
|
|
45
|
-
readonly copyMimeTypes: never[];
|
|
46
|
-
readonly pasteMimeTypes: string[];
|
|
47
|
-
constructor(chatWidgetService: IChatWidgetService, modelService: IModelService);
|
|
48
|
-
provideDocumentPasteEdits(model: ITextModel, ranges: readonly IRange[], dataTransfer: IReadonlyVSDataTransfer, context: DocumentPasteContext, token: CancellationToken): Promise<DocumentPasteEditsSession | undefined>;
|
|
49
|
-
}
|
|
50
|
-
export declare class ChatPasteProvidersFeature extends Disposable {
|
|
51
|
-
constructor(languageFeaturesService: ILanguageFeaturesService, chatWidgetService: IChatWidgetService, extensionService: IExtensionService, fileService: IFileService, modelService: IModelService, environmentService: IEnvironmentService, logService: ILogService);
|
|
52
|
-
}
|