@codingame/monaco-vscode-chat-service-override 11.1.2 → 12.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.
Files changed (110) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +64 -1
  3. package/package.json +32 -13
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +21 -0
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +73 -60
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +3 -0
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +73 -81
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +9 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +73 -112
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +12 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +253 -101
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.d.ts +1 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -1
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.d.ts +1 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +16 -14
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +23 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +30 -11
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +1 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +12 -12
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.d.ts +1 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +22 -20
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +2 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +23 -20
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +52 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +50 -47
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +124 -95
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +17 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +6 -3
  32. package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.d.ts +12 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +30 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.d.ts +69 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +203 -182
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +103 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +458 -165
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +42 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +14 -10
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +26 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/{chatParticipantContributions.js → chatParticipant.contribution.js} +101 -92
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +42 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +164 -25
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +26 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +6 -5
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +30 -0
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +10 -7
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +17 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +941 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +26 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -6
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +54 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +32 -15
  54. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +9 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +1 -0
  56. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.d.ts +1 -0
  57. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +8 -6
  58. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +26 -0
  59. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +16 -19
  60. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +15 -0
  61. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +108 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +7 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +3 -8
  64. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +31 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +70 -49
  67. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +6 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.d.ts +7 -0
  69. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/{chatViewsWelcomeContributions.js → chatViewsWelcomeHandler.js} +13 -13
  70. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +44 -0
  71. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +3 -1
  72. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +22 -0
  73. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -0
  74. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +80 -0
  75. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +152 -104
  76. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +8 -0
  77. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -1
  78. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +41 -0
  79. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -1
  80. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +31 -0
  81. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +6 -4
  82. package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.d.ts +13 -0
  83. package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -0
  84. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +24 -0
  85. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +23 -21
  86. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +1 -0
  87. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +1 -0
  88. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +39 -0
  89. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +20 -19
  90. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.service.d.ts +7 -0
  91. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -0
  92. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +30 -33
  93. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.d.ts +10 -0
  94. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +6 -4
  95. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +10 -0
  96. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +9 -7
  97. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +44 -0
  98. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +247 -83
  99. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +8 -0
  100. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +5 -4
  101. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.d.ts +29 -0
  102. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -35
  103. package/chat.js +0 -59
  104. package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +0 -8
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +0 -326
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -76
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorActions.js +0 -110
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorController.js +0 -287
  109. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +0 -130
  110. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +0 -172
@@ -0,0 +1,26 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
3
+ import { URI } from "vscode/vscode/vs/base/common/uri";
4
+ import { Location } from "vscode/vscode/vs/editor/common/languages";
5
+ import { IViewsService } from "vscode/vscode/vs/workbench/services/views/common/viewsService.service";
6
+ import { ChatAgentLocation } from "vscode/vscode/vs/workbench/contrib/chat/common/chatAgents";
7
+ import { IChatModel, IChatRequestVariableData, IChatRequestVariableEntry } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatModel";
8
+ import { IParsedChatRequest } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes";
9
+ import { IChatRequestVariableValue, IChatVariableData, IChatVariableResolver, IChatVariableResolverProgress, IDynamicVariable } from "vscode/vscode/vs/workbench/contrib/chat/common/chatVariables";
10
+ import { IChatVariablesService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatVariables.service";
11
+ import { IChatWidgetService } from "vscode/vscode/vs/workbench/contrib/chat/browser/chat.service";
12
+ export declare class ChatVariablesService implements IChatVariablesService {
13
+ private readonly chatWidgetService;
14
+ private readonly viewsService;
15
+ _serviceBrand: undefined;
16
+ private _resolver;
17
+ constructor(chatWidgetService: IChatWidgetService, viewsService: IViewsService);
18
+ resolveVariables(prompt: IParsedChatRequest, attachedContextVariables: IChatRequestVariableEntry[] | undefined, model: IChatModel, progress: (part: IChatVariableResolverProgress) => void, token: CancellationToken): Promise<IChatRequestVariableData>;
19
+ resolveVariable(variableName: string, promptText: string, model: IChatModel, progress: (part: IChatVariableResolverProgress) => void, token: CancellationToken): Promise<IChatRequestVariableValue | undefined>;
20
+ hasVariable(name: string): boolean;
21
+ getVariable(name: string): IChatVariableData | undefined;
22
+ getVariables(location: ChatAgentLocation): Iterable<Readonly<IChatVariableData>>;
23
+ getDynamicVariables(sessionId: string): ReadonlyArray<IDynamicVariable>;
24
+ registerVariable(data: IChatVariableData, resolver: IChatVariableResolver): IDisposable;
25
+ attachContext(name: string, value: string | URI | Location, location: ChatAgentLocation): Promise<void>;
26
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
3
4
  import { onUnexpectedExternalError } from 'vscode/vscode/vs/base/common/errors';
4
5
  import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
@@ -7,10 +8,10 @@ import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
7
8
  import { URI } from 'vscode/vscode/vs/base/common/uri';
8
9
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
9
10
  import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
10
- import { ChatRequestVariablePart, ChatRequestDynamicVariablePart, ChatRequestToolPart } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
11
- import { showChatView } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/chat';
11
+ import { ChatRequestVariablePart, ChatRequestDynamicVariablePart, ChatRequestToolPart } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
12
+ import { showEditsView, showChatView } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat';
12
13
  import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
13
- import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-chat-notebook-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
14
+ import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
14
15
 
15
16
  let ChatVariablesService = class ChatVariablesService {
16
17
  constructor(chatWidgetService, viewsService) {
@@ -120,10 +121,12 @@ let ChatVariablesService = class ChatVariablesService {
120
121
  });
121
122
  }
122
123
  async attachContext(name, value, location) {
123
- if (location !== ChatAgentLocation.Panel) {
124
+ if (location !== ChatAgentLocation.Panel && location !== ChatAgentLocation.EditingSession) {
124
125
  return;
125
126
  }
126
- const widget = this.chatWidgetService.lastFocusedWidget ?? (await showChatView(this.viewsService));
127
+ const widget = location === ChatAgentLocation.EditingSession
128
+ ? await showEditsView(this.viewsService)
129
+ : (this.chatWidgetService.lastFocusedWidget ?? (await showChatView(this.viewsService)));
127
130
  if (!widget || !widget.viewModel) {
128
131
  return;
129
132
  }
@@ -0,0 +1,54 @@
1
+ import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
2
+ import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
3
+ import { IContextMenuService } from "vscode/vscode/vs/platform/contextview/browser/contextView.service";
4
+ import { IHoverService } from "vscode/vscode/vs/platform/hover/browser/hover.service";
5
+ import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
6
+ import { IKeybindingService } from "vscode/vscode/vs/platform/keybinding/common/keybinding.service";
7
+ import { ILayoutService } from "vscode/vscode/vs/platform/layout/browser/layoutService.service";
8
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
9
+ import { IOpenerService } from "vscode/vscode/vs/platform/opener/common/opener.service";
10
+ import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
11
+ import { ITelemetryService } from "vscode/vscode/vs/platform/telemetry/common/telemetry.service";
12
+ import { IThemeService } from "vscode/vscode/vs/platform/theme/common/themeService.service";
13
+ import { IViewPaneOptions, ViewPane } from "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane";
14
+ import { IViewDescriptorService } from "vscode/vscode/vs/workbench/common/views.service";
15
+ import { IChatViewTitleActionContext } from "vscode/vscode/vs/workbench/contrib/chat/common/chatActions";
16
+ import { ChatAgentLocation } from "vscode/vscode/vs/workbench/contrib/chat/common/chatAgents";
17
+ import { IChatAgentService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
18
+ import { IChatService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatService.service";
19
+ import { ChatWidget, IChatViewState } from "@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/chatWidget";
20
+ import { IViewWelcomeDelegate } from "@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController";
21
+ export declare const CHAT_SIDEBAR_OLD_VIEW_PANEL_ID = "workbench.panel.chatSidebar";
22
+ export declare const CHAT_SIDEBAR_PANEL_ID = "workbench.panel.chat";
23
+ export declare const CHAT_EDITING_SIDEBAR_PANEL_ID = "workbench.panel.chatEditing";
24
+ export declare class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
25
+ private readonly chatOptions;
26
+ private readonly storageService;
27
+ private readonly chatService;
28
+ private readonly chatAgentService;
29
+ private readonly logService;
30
+ private readonly layoutService;
31
+ private _widget;
32
+ get widget(): ChatWidget;
33
+ private readonly modelDisposables;
34
+ private memento;
35
+ private readonly viewState;
36
+ private defaultParticipantRegistrationFailed;
37
+ private didUnregisterProvider;
38
+ constructor(chatOptions: {
39
+ location: ChatAgentLocation.Panel | ChatAgentLocation.EditingSession;
40
+ }, options: IViewPaneOptions, keybindingService: IKeybindingService, contextMenuService: IContextMenuService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, viewDescriptorService: IViewDescriptorService, instantiationService: IInstantiationService, openerService: IOpenerService, themeService: IThemeService, telemetryService: ITelemetryService, hoverService: IHoverService, storageService: IStorageService, chatService: IChatService, chatAgentService: IChatAgentService, logService: ILogService, layoutService: ILayoutService);
41
+ getActionsContext(): IChatViewTitleActionContext | undefined;
42
+ private updateModel;
43
+ shouldShowWelcome(): boolean;
44
+ private getSessionId;
45
+ protected renderBody(parent: HTMLElement): void;
46
+ acceptInput(query?: string): void;
47
+ private clear;
48
+ loadSession(sessionId: string, viewState?: IChatViewState): void;
49
+ focusInput(): void;
50
+ focus(): void;
51
+ protected layoutBody(height: number, width: number): void;
52
+ saveState(): void;
53
+ private updateViewState;
54
+ }
@@ -1,6 +1,9 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
3
+ import { getWindow, $ } from 'vscode/vscode/vs/base/browser/dom';
2
4
  import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
3
5
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
6
+ import { MarshalledId } from 'vscode/vscode/vs/base/common/marshallingIds';
4
7
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
5
8
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
6
9
  import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
@@ -8,8 +11,10 @@ import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.ser
8
11
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
9
12
  import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
10
13
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
14
+ import { ILayoutService } from 'vscode/vscode/vs/platform/layout/browser/layoutService.service';
11
15
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
12
16
  import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
17
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
13
18
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
14
19
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
15
20
  import 'vscode/vscode/vs/platform/theme/common/colorUtils';
@@ -24,29 +29,31 @@ import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
24
29
  import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
25
30
  import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
26
31
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
27
- import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
28
- import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
32
+ import { ViewPane } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane';
33
+ import { Memento } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/common/memento';
29
34
  import { SIDE_BAR_FOREGROUND } from 'vscode/vscode/vs/workbench/common/theme';
30
35
  import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
31
36
  import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
32
37
  import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
33
- import { ChatModelInitState } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatModel';
34
- import { CHAT_PROVIDER_ID } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatParticipantContribTypes';
38
+ import { ChatModelInitState } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatModel';
39
+ import { CHAT_PROVIDER_ID } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatParticipantContribTypes';
35
40
  import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
36
- import { ChatWidget } from '@codingame/monaco-vscode-chat-notebook-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
37
- import { ChatViewWelcomeController } from '@codingame/monaco-vscode-chat-notebook-common/vscode/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController';
41
+ import { SetupWelcomeViewKeys, SetupWelcomeViewCondition } from './chatSetup.js';
42
+ import { ChatWidget } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
43
+ import { ChatViewWelcomeController } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController';
38
44
 
39
45
  const CHAT_SIDEBAR_PANEL_ID = 'workbench.panel.chat';
40
46
  const CHAT_EDITING_SIDEBAR_PANEL_ID = 'workbench.panel.chatEditing';
41
47
  let ChatViewPane = class ChatViewPane extends ViewPane {
42
48
  get widget() { return this._widget; }
43
- constructor(chatOptions, options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService, storageService, chatService, chatAgentService, logService) {
49
+ constructor(chatOptions, options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService, storageService, chatService, chatAgentService, logService, layoutService) {
44
50
  super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
45
51
  this.chatOptions = chatOptions;
46
52
  this.storageService = storageService;
47
53
  this.chatService = chatService;
48
54
  this.chatAgentService = chatAgentService;
49
55
  this.logService = logService;
56
+ this.layoutService = layoutService;
50
57
  this.modelDisposables = this._register(( new DisposableStore()));
51
58
  this.defaultParticipantRegistrationFailed = false;
52
59
  this.didUnregisterProvider = false;
@@ -54,7 +61,7 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
54
61
  'interactive-session-view-' + CHAT_PROVIDER_ID + (this.chatOptions.location === ChatAgentLocation.EditingSession ? `-edits` : ''),
55
62
  this.storageService
56
63
  ));
57
- this.viewState = this.memento.getMemento(1 , 1 );
64
+ this.viewState = this.memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
58
65
  this._register(this.chatAgentService.onDidChangeAgents(() => {
59
66
  if (this.chatAgentService.getDefaultAgent(this.chatOptions?.location)) {
60
67
  if (!this._widget?.viewModel) {
@@ -78,11 +85,16 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
78
85
  }
79
86
  this._onDidChangeViewWelcomeState.fire();
80
87
  }));
88
+ this._register(this.contextKeyService.onDidChangeContext(e => {
89
+ if (e.affectsSome(SetupWelcomeViewKeys)) {
90
+ this._onDidChangeViewWelcomeState.fire();
91
+ }
92
+ }));
81
93
  }
82
94
  getActionsContext() {
83
95
  return this.widget?.viewModel ? {
84
96
  sessionId: this.widget.viewModel.sessionId,
85
- $mid: 19
97
+ $mid: MarshalledId.ChatViewContext
86
98
  } : undefined;
87
99
  }
88
100
  updateModel(model, viewState) {
@@ -101,10 +113,11 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
101
113
  this.updateActions();
102
114
  }
103
115
  shouldShowWelcome() {
116
+ const showSetup = this.contextKeyService.contextMatchesRules(SetupWelcomeViewCondition);
104
117
  const noPersistedSessions = !this.chatService.hasSessions();
105
- const shouldShow = this.didUnregisterProvider || !this._widget?.viewModel && noPersistedSessions || this.defaultParticipantRegistrationFailed;
106
- this.logService.trace(`ChatViewPane#shouldShowWelcome(${this.chatOptions.location}) = ${shouldShow}: didUnregister=${this.didUnregisterProvider} || noViewModel:${!this._widget?.viewModel} && noPersistedSessions=${noPersistedSessions} || defaultParticipantRegistrationFailed=${this.defaultParticipantRegistrationFailed}`);
107
- return shouldShow;
118
+ const shouldShow = this.didUnregisterProvider || !this._widget?.viewModel && noPersistedSessions || this.defaultParticipantRegistrationFailed || showSetup;
119
+ this.logService.trace(`ChatViewPane#shouldShowWelcome(${this.chatOptions.location}) = ${shouldShow}: didUnregister=${this.didUnregisterProvider} || noViewModel:${!this._widget?.viewModel} && noPersistedSessions=${noPersistedSessions} || defaultParticipantRegistrationFailed=${this.defaultParticipantRegistrationFailed} || showSetup=${showSetup}`);
120
+ return !!shouldShow;
108
121
  }
109
122
  getSessionId() {
110
123
  let sessionId;
@@ -123,6 +136,8 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
123
136
  this._register(this.instantiationService.createInstance(ChatViewWelcomeController, parent, this, this.chatOptions.location));
124
137
  const scopedInstantiationService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.scopedContextKeyService]))));
125
138
  const locationBasedColors = this.getLocationBasedColors();
139
+ const editorOverflowNode = this.layoutService.getContainer(getWindow(parent)).appendChild($('.chat-editor-overflow.monaco-editor'));
140
+ this._register({ dispose: () => editorOverflowNode.remove() });
126
141
  this._widget = this._register(scopedInstantiationService.createInstance(ChatWidget, this.chatOptions.location, { viewId: this.id }, {
127
142
  autoScroll: this.chatOptions.location === ChatAgentLocation.EditingSession,
128
143
  renderFollowups: this.chatOptions.location === ChatAgentLocation.Panel,
@@ -134,7 +149,8 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
134
149
  return this.chatOptions.location === ChatAgentLocation.EditingSession;
135
150
  },
136
151
  },
137
- enableImplicitContext: this.chatOptions.location === ChatAgentLocation.Panel
152
+ enableImplicitContext: this.chatOptions.location === ChatAgentLocation.Panel,
153
+ editorOverflowWidgetsDomNode: editorOverflowNode,
138
154
  }, {
139
155
  listForeground: SIDE_BAR_FOREGROUND,
140
156
  listBackground: locationBasedColors.background,
@@ -221,7 +237,8 @@ ChatViewPane = ( __decorate([
221
237
  ( __param(12, IStorageService)),
222
238
  ( __param(13, IChatService)),
223
239
  ( __param(14, IChatAgentService)),
224
- ( __param(15, ILogService))
240
+ ( __param(15, ILogService)),
241
+ ( __param(16, ILayoutService))
225
242
  ], ChatViewPane));
226
243
 
227
244
  export { CHAT_EDITING_SIDEBAR_PANEL_ID, CHAT_SIDEBAR_PANEL_ID, ChatViewPane };
@@ -0,0 +1,9 @@
1
+ import { IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { ICodeBlockActionContextProvider } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat";
3
+ import { IChatCodeBlockContextProviderService } from "vscode/vscode/vs/workbench/contrib/chat/browser/chat.service";
4
+ export declare class ChatCodeBlockContextProviderService implements IChatCodeBlockContextProviderService {
5
+ _serviceBrand: undefined;
6
+ private readonly _providers;
7
+ get providers(): ICodeBlockActionContextProvider[];
8
+ registerProvider(provider: ICodeBlockActionContextProvider, id: string): IDisposable;
9
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
2
3
 
3
4
  class ChatCodeBlockContextProviderService {
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
3
4
  import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
5
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
@@ -16,12 +17,12 @@ import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
16
17
  import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
17
18
  import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
18
19
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
19
- import { ChatWidget } from '@codingame/monaco-vscode-chat-notebook-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
20
- import { dynamicVariableDecorationType } from '@codingame/monaco-vscode-chat-notebook-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
20
+ import { ChatWidget } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
21
+ import { dynamicVariableDecorationType } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
21
22
  import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
22
- import { chatSlashCommandForeground, chatSlashCommandBackground } from '@codingame/monaco-vscode-chat-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatColors';
23
- import { ChatRequestAgentPart, ChatRequestAgentSubcommandPart, ChatRequestSlashCommandPart, ChatRequestTextPart, ChatRequestVariablePart, ChatRequestToolPart, chatAgentLeader, chatSubcommandLeader } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
24
- import { ChatRequestParser } from '@codingame/monaco-vscode-chat-extensions-notebook-common/vscode/vs/workbench/contrib/chat/common/chatRequestParser';
23
+ import { chatSlashCommandForeground, chatSlashCommandBackground } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/common/chatColors';
24
+ import { ChatRequestAgentPart, ChatRequestAgentSubcommandPart, ChatRequestSlashCommandPart, ChatRequestTextPart, ChatRequestVariablePart, ChatRequestToolPart, chatAgentLeader, chatSubcommandLeader } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
25
+ import { ChatRequestParser } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatRequestParser';
25
26
 
26
27
  const decorationDescription = 'chat';
27
28
  const placeholderDecorationType = 'chat-session-detail';
@@ -277,6 +278,7 @@ let ChatTokenDeleter = class ChatTokenDeleter extends Disposable {
277
278
  range: rangeToDelete,
278
279
  text: '',
279
280
  }]);
281
+ this.widget.refreshParsedInput();
280
282
  }
281
283
  });
282
284
  }
@@ -0,0 +1,26 @@
1
+ import { ICodeEditor } from "vscode/vscode/vs/editor/browser/editorBrowser";
2
+ import { Range } from "vscode/vscode/vs/editor/common/core/range";
3
+ import { IModelDecoration } from "vscode/vscode/vs/editor/common/model";
4
+ import { HoverAnchor, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts } from "vscode/vscode/vs/editor/contrib/hover/browser/hoverTypes";
5
+ import { ICommandService } from "vscode/vscode/vs/platform/commands/common/commands.service";
6
+ import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
7
+ import { IChatWidgetService } from "vscode/vscode/vs/workbench/contrib/chat/browser/chat.service";
8
+ import { IChatAgentData } from "vscode/vscode/vs/workbench/contrib/chat/common/chatAgents";
9
+ export declare class ChatAgentHoverParticipant implements IEditorHoverParticipant<ChatAgentHoverPart> {
10
+ private readonly editor;
11
+ private readonly instantiationService;
12
+ private readonly chatWidgetService;
13
+ private readonly commandService;
14
+ readonly hoverOrdinal: number;
15
+ constructor(editor: ICodeEditor, instantiationService: IInstantiationService, chatWidgetService: IChatWidgetService, commandService: ICommandService);
16
+ computeSync(anchor: HoverAnchor, _lineDecorations: IModelDecoration[]): ChatAgentHoverPart[];
17
+ renderHoverParts(context: IEditorHoverRenderContext, hoverParts: ChatAgentHoverPart[]): IRenderedHoverParts<ChatAgentHoverPart>;
18
+ getAccessibleContent(hoverPart: ChatAgentHoverPart): string;
19
+ }
20
+ export declare class ChatAgentHoverPart implements IHoverPart {
21
+ readonly owner: IEditorHoverParticipant<ChatAgentHoverPart>;
22
+ readonly range: Range;
23
+ readonly agent: IChatAgentData;
24
+ constructor(owner: IEditorHoverParticipant<ChatAgentHoverPart>, range: Range, agent: IChatAgentData);
25
+ isValidForHoverAnchor(anchor: HoverAnchor): boolean;
26
+ }
@@ -1,13 +1,14 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
3
4
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
4
- import { RenderedHoverParts, HoverParticipantRegistry } from 'vscode/vscode/vs/editor/contrib/hover/browser/hoverTypes';
5
+ import { RenderedHoverParts, HoverAnchorType, HoverParticipantRegistry } from 'vscode/vscode/vs/editor/contrib/hover/browser/hoverTypes';
5
6
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
6
7
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
7
8
  import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
8
- import { ChatAgentHover, getChatAgentHoverOptions } from '@codingame/monaco-vscode-chat-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/chatAgentHover';
9
+ import { ChatAgentHover, getChatAgentHoverOptions } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/chatAgentHover';
9
10
  import { ChatEditorHoverWrapper } from './editorHoverWrapper.js';
10
- import { extractAgentAndCommand } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
11
+ import { extractAgentAndCommand } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
11
12
  import { localize } from 'vscode/vscode/vs/nls';
12
13
 
13
14
  let ChatAgentHoverParticipant = class ChatAgentHoverParticipant {
@@ -31,17 +32,15 @@ let ChatAgentHoverParticipant = class ChatAgentHoverParticipant {
31
32
  return [];
32
33
  }
33
34
  if (Range.containsPosition(agentPart.editorRange, anchor.range.getStartPosition())) {
34
- return [( (new ChatAgentHoverPart(this, Range.lift(agentPart.editorRange), agentPart.agent)))];
35
+ return [( new ChatAgentHoverPart(this, Range.lift(agentPart.editorRange), agentPart.agent))];
35
36
  }
36
37
  return [];
37
38
  }
38
39
  renderHoverParts(context, hoverParts) {
39
40
  if (!hoverParts.length) {
40
- return (
41
- (new RenderedHoverParts([]))
42
- );
41
+ return ( new RenderedHoverParts([]));
43
42
  }
44
- const disposables = ( (new DisposableStore()));
43
+ const disposables = ( new DisposableStore());
45
44
  const hover = disposables.add(this.instantiationService.createInstance(ChatAgentHover));
46
45
  disposables.add(hover.onDidChangeContents(() => context.onContentsChanged()));
47
46
  const hoverPart = hoverParts[0];
@@ -56,19 +55,17 @@ let ChatAgentHoverParticipant = class ChatAgentHoverParticipant {
56
55
  hoverElement: wrapperNode,
57
56
  dispose() { disposables.dispose(); }
58
57
  };
59
- return (
60
- (new RenderedHoverParts([renderedHoverPart]))
61
- );
58
+ return ( new RenderedHoverParts([renderedHoverPart]));
62
59
  }
63
60
  getAccessibleContent(hoverPart) {
64
- return ( localize(7674, 'There is a chat agent hover part here.'));
61
+ return localize(4572, 'There is a chat agent hover part here.');
65
62
  }
66
63
  };
67
- ChatAgentHoverParticipant = ( (__decorate([
68
- ( (__param(1, IInstantiationService))),
69
- ( (__param(2, IChatWidgetService))),
70
- ( (__param(3, ICommandService)))
71
- ], ChatAgentHoverParticipant)));
64
+ ChatAgentHoverParticipant = ( __decorate([
65
+ ( __param(1, IInstantiationService)),
66
+ ( __param(2, IChatWidgetService)),
67
+ ( __param(3, ICommandService))
68
+ ], ChatAgentHoverParticipant));
72
69
  class ChatAgentHoverPart {
73
70
  constructor(owner, range, agent) {
74
71
  this.owner = owner;
@@ -76,7 +73,7 @@ class ChatAgentHoverPart {
76
73
  this.agent = agent;
77
74
  }
78
75
  isValidForHoverAnchor(anchor) {
79
- return (anchor.type === 1
76
+ return (anchor.type === HoverAnchorType.Range
80
77
  && this.range.startColumn <= anchor.range.startColumn
81
78
  && this.range.endColumn >= anchor.range.endColumn);
82
79
  }
@@ -0,0 +1,15 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
3
+ import { IChatEditingService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService.service";
4
+ import { IChatWidgetService } from "vscode/vscode/vs/workbench/contrib/chat/browser/chat.service";
5
+ export declare class ChatRelatedFilesContribution extends Disposable implements IWorkbenchContribution {
6
+ private readonly chatEditingService;
7
+ private readonly chatWidgetService;
8
+ static readonly ID = "chat.relatedFilesWorkingSet";
9
+ private readonly chatEditingSessionDisposables;
10
+ private _currentRelatedFilesRetrievalOperation;
11
+ constructor(chatEditingService: IChatEditingService, chatWidgetService: IChatWidgetService);
12
+ private _updateRelatedFileSuggestions;
13
+ private _handleNewEditingSession;
14
+ dispose(): void;
15
+ }
@@ -0,0 +1,108 @@
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
3
+ import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
4
+ import { Event } from 'vscode/vscode/vs/base/common/event';
5
+ import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
6
+ import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
7
+ import { localize } from 'vscode/vscode/vs/nls';
8
+ import { WorkingSetEntryState, WorkingSetEntryRemovalReason, ChatEditingSessionChangeType } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService';
9
+ import { IChatEditingService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
10
+ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
11
+
12
+ let ChatRelatedFilesContribution = class ChatRelatedFilesContribution extends Disposable {
13
+ static { this.ID = 'chat.relatedFilesWorkingSet'; }
14
+ constructor(chatEditingService, chatWidgetService) {
15
+ super();
16
+ this.chatEditingService = chatEditingService;
17
+ this.chatWidgetService = chatWidgetService;
18
+ this.chatEditingSessionDisposables = ( new DisposableStore());
19
+ this._handleNewEditingSession();
20
+ this._register(this.chatEditingService.onDidCreateEditingSession(() => {
21
+ this.chatEditingSessionDisposables.clear();
22
+ this._handleNewEditingSession();
23
+ }));
24
+ }
25
+ _updateRelatedFileSuggestions() {
26
+ if (this._currentRelatedFilesRetrievalOperation) {
27
+ return;
28
+ }
29
+ const currentEditingSession = this.chatEditingService.currentEditingSessionObs.get();
30
+ if (!currentEditingSession) {
31
+ return;
32
+ }
33
+ const workingSetEntries = currentEditingSession.entries.get();
34
+ if (workingSetEntries.length > 0) {
35
+ return;
36
+ }
37
+ const widget = this.chatWidgetService.getWidgetBySessionId(currentEditingSession.chatSessionId);
38
+ if (!widget) {
39
+ return;
40
+ }
41
+ this._currentRelatedFilesRetrievalOperation = this.chatEditingService.getRelatedFiles(currentEditingSession.chatSessionId, widget.getInput(), CancellationToken.None)
42
+ .then((files) => {
43
+ if (!files?.length) {
44
+ return;
45
+ }
46
+ const currentEditingSession = this.chatEditingService.currentEditingSessionObs.get();
47
+ if (!currentEditingSession || currentEditingSession.chatSessionId !== widget.viewModel?.sessionId || currentEditingSession.entries.get().length) {
48
+ return;
49
+ }
50
+ const maximumRelatedFiles = Math.min(2, this.chatEditingService.editingSessionFileLimit - widget.input.chatEditWorkingSetFiles.length);
51
+ const newSuggestions = ( new ResourceMap());
52
+ for (const group of files) {
53
+ for (const file of group.files) {
54
+ if (newSuggestions.size >= maximumRelatedFiles) {
55
+ break;
56
+ }
57
+ newSuggestions.set(file.uri, { group: group.group, description: file.description });
58
+ }
59
+ }
60
+ const existingSuggestedEntriesToRemove = [];
61
+ for (const entry of currentEditingSession.workingSet) {
62
+ if (entry[1].state === WorkingSetEntryState.Suggested && !( newSuggestions.has(entry[0]))) {
63
+ existingSuggestedEntriesToRemove.push(entry[0]);
64
+ }
65
+ }
66
+ currentEditingSession?.remove(WorkingSetEntryRemovalReason.Programmatic, ...existingSuggestedEntriesToRemove);
67
+ for (const [uri, data] of newSuggestions) {
68
+ currentEditingSession.addFileToWorkingSet(uri, ( localize(4573, "{0} (Suggested)", data.description)), WorkingSetEntryState.Suggested);
69
+ }
70
+ })
71
+ .finally(() => {
72
+ this._currentRelatedFilesRetrievalOperation = undefined;
73
+ });
74
+ }
75
+ _handleNewEditingSession() {
76
+ const currentEditingSession = this.chatEditingService.currentEditingSessionObs.get();
77
+ if (!currentEditingSession) {
78
+ return;
79
+ }
80
+ const widget = this.chatWidgetService.getWidgetBySessionId(currentEditingSession.chatSessionId);
81
+ if (!widget || widget.viewModel?.sessionId !== currentEditingSession.chatSessionId) {
82
+ return;
83
+ }
84
+ this.chatEditingSessionDisposables.add(currentEditingSession.onDidDispose(() => {
85
+ this.chatEditingSessionDisposables.clear();
86
+ }));
87
+ this._updateRelatedFileSuggestions();
88
+ const onDebouncedType = Event.debounce(widget.inputEditor.onDidChangeModelContent, () => null, 3000);
89
+ this.chatEditingSessionDisposables.add(onDebouncedType(() => {
90
+ this._updateRelatedFileSuggestions();
91
+ }));
92
+ this.chatEditingSessionDisposables.add(currentEditingSession.onDidChange((e) => {
93
+ if (e === ChatEditingSessionChangeType.WorkingSet) {
94
+ this._updateRelatedFileSuggestions();
95
+ }
96
+ }));
97
+ }
98
+ dispose() {
99
+ this.chatEditingSessionDisposables.dispose();
100
+ super.dispose();
101
+ }
102
+ };
103
+ ChatRelatedFilesContribution = ( __decorate([
104
+ ( __param(0, IChatEditingService)),
105
+ ( __param(1, IChatWidgetService))
106
+ ], ChatRelatedFilesContribution));
107
+
108
+ export { ChatRelatedFilesContribution };
@@ -0,0 +1,7 @@
1
+ import { IHoverAction } from "vscode/vscode/vs/base/browser/ui/hover/hover";
2
+ import { IKeybindingService } from "vscode/vscode/vs/platform/keybinding/common/keybinding.service";
3
+ export declare class ChatEditorHoverWrapper {
4
+ private readonly keybindingService;
5
+ readonly domNode: HTMLElement;
6
+ constructor(hoverContentElement: HTMLElement, actions: IHoverAction[] | undefined, keybindingService: IKeybindingService);
7
+ }
@@ -1,13 +1,8 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import './media/editorHoverWrapper.css.js';
3
4
  import { $ as $$1, h as h$1 } from 'vscode/vscode/vs/base/browser/dom';
4
- import 'vscode/vscode/vs/base/browser/browser';
5
- import 'vscode/vscode/vs/base/common/keyCodes';
6
- import 'vscode/vscode/vs/base/common/platform';
7
- import 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
8
- import 'vscode/vscode/vs/base/common/lifecycle';
9
- import 'vscode/vscode/vs/base/browser/ui/hover/hoverWidget.css';
10
- import 'vscode/vscode/vs/nls';
5
+ import 'vscode/vscode/vs/base/browser/ui/hover/hoverWidget';
11
6
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
12
7
 
13
8
  const $ = $$1;
@@ -1,4 +1,4 @@
1
- import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css.js';
1
+ import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css';
2
2
 
3
3
  var css = ".chat-editor-hover-wrapper-content{padding:2px 8px}";
4
4
  n(css,{});
@@ -0,0 +1,31 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { Disposable, IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
3
+ import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
4
+ import { IDialogService } from "vscode/vscode/vs/platform/dialogs/common/dialogs.service";
5
+ import { ITelemetryService } from "vscode/vscode/vs/platform/telemetry/common/telemetry.service";
6
+ import { IExtensionService } from "vscode/vscode/vs/workbench/services/extensions/common/extensions.service";
7
+ import { IChatService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatService.service";
8
+ import { CountTokensCallback, IToolData, IToolImpl, IToolInvocation, IToolResult } from "vscode/vscode/vs/workbench/contrib/chat/common/languageModelToolsService";
9
+ import { ILanguageModelToolsService } from "vscode/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service";
10
+ export declare class LanguageModelToolsService extends Disposable implements ILanguageModelToolsService {
11
+ private readonly _extensionService;
12
+ private readonly _contextKeyService;
13
+ private readonly _chatService;
14
+ private readonly _dialogService;
15
+ private readonly _telemetryService;
16
+ _serviceBrand: undefined;
17
+ private _onDidChangeTools;
18
+ readonly onDidChangeTools: import("vscode/vscode/vs/base/common/event").Event<void>;
19
+ private _onDidChangeToolsScheduler;
20
+ private _tools;
21
+ private _toolContextKeys;
22
+ constructor(_extensionService: IExtensionService, _contextKeyService: IContextKeyService, _chatService: IChatService, _dialogService: IDialogService, _telemetryService: ITelemetryService);
23
+ registerToolData(toolData: IToolData): IDisposable;
24
+ private _refreshAllToolContextKeys;
25
+ registerToolImplementation(id: string, tool: IToolImpl): IDisposable;
26
+ getTools(): Iterable<Readonly<IToolData>>;
27
+ getTool(id: string): IToolData | undefined;
28
+ private _getToolEntry;
29
+ getToolByName(name: string): IToolData | undefined;
30
+ invokeTool(dto: IToolInvocation, countTokens: CountTokensCallback, token: CancellationToken): Promise<IToolResult>;
31
+ }