diff --git a/demo/package-lock.json b/demo/package-lock.json index 3e6f3568..53df308b 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -824,13 +824,6 @@ "@codingame/monaco-vscode-layout-service-override": "0.0.0-semantic-release", "@codingame/monaco-vscode-quickaccess-service-override": "0.0.0-semantic-release", "@vscode/iconv-lite-umd": "0.7.0", - "@xterm/addon-clipboard": "^0.2.0-beta.47", - "@xterm/addon-image": "^0.9.0-beta.64", - "@xterm/addon-search": "^0.16.0-beta.64", - "@xterm/addon-serialize": "^0.14.0-beta.64", - "@xterm/addon-unicode11": "^0.9.0-beta.64", - "@xterm/addon-webgl": "^0.19.0-beta.64", - "@xterm/xterm": "^5.6.0-beta.64", "jschardet": "3.1.3", "marked": "~14.0.0" } @@ -1256,6 +1249,13 @@ "version": "0.0.0-semantic-release", "license": "MIT", "dependencies": { + "@xterm/addon-clipboard": "^0.2.0-beta.47", + "@xterm/addon-image": "^0.9.0-beta.64", + "@xterm/addon-search": "^0.16.0-beta.64", + "@xterm/addon-serialize": "^0.14.0-beta.64", + "@xterm/addon-unicode11": "^0.9.0-beta.64", + "@xterm/addon-webgl": "^0.19.0-beta.64", + "@xterm/xterm": "^5.6.0-beta.64", "vscode": "npm:@codingame/monaco-vscode-api@^0.0.0-semantic-release" } }, diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 95a0a36f..0391d5b1 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -22,6 +22,8 @@ import pkg from '../package.json' assert { type: 'json' } const __dirname = nodePath.dirname(fileURLToPath(import.meta.url)) +const ALLOWED_MAIN_DEPENDENCIES = new Set(['@vscode/iconv-lite-umd', 'jschardet', 'marked']) + const PURE_ANNO = '#__PURE__' const PURE_FUNCTIONS = new Set([ '__param', @@ -470,7 +472,12 @@ export default (args: Record): rollup.RollupOptions[] => { treeshake: { annotations: true, preset: 'smallest', - moduleSideEffects: true, + moduleSideEffects(id) { + if (id.includes('terminalContribExports')) { + return false + } + return true + }, tryCatchDeoptimization: true }, external, @@ -856,8 +863,20 @@ export default (args: Record): rollup.RollupOptions[] => { }, async handle(group, moduleGroupName, otherDependencies, options, bundle) { if (group.name === 'main') { - // Generate package.json const dependencies = new Set([...group.directDependencies, ...otherDependencies]) + const externalMainDependencies = Object.fromEntries( + Object.entries(pkg.dependencies).filter(([key]) => dependencies.has(key)) + ) + const notAllowedDependencies = Object.keys(externalMainDependencies).filter( + (d) => !ALLOWED_MAIN_DEPENDENCIES.has(d) + ) + if (notAllowedDependencies.length > 0) { + this.error( + `Not allowed dependencies detected in main package: ${notAllowedDependencies.join(', ')}` + ) + } + + // Generate package.json const packageJson: PackageJson = { ...Object.fromEntries( Object.entries(pkg).filter(([key]) => @@ -941,9 +960,7 @@ export default (args: Record): rollup.RollupOptions[] => { } }, dependencies: { - ...Object.fromEntries( - Object.entries(pkg.dependencies).filter(([key]) => dependencies.has(key)) - ), + ...externalMainDependencies, ...Object.fromEntries( Array.from(dependencies) .filter((dep) => dep.startsWith('@codingame/monaco-vscode-')) diff --git a/vscode-paches/0056-fix-store-activeChatController-in-another-module.patch b/vscode-paches/0056-fix-store-activeChatController-in-another-module.patch new file mode 100644 index 00000000..1b7da08d --- /dev/null +++ b/vscode-paches/0056-fix-store-activeChatController-in-another-module.patch @@ -0,0 +1,280 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= +Date: Tue, 22 Oct 2024 13:04:08 +0200 +Subject: [PATCH] fix: store activeChatController in another module + +so xterm and all the terminal stuff is not always pulled +--- + .../contrib/chat/browser/chatWidget.ts | 4 +-- + .../actions/voiceChatActions.ts | 6 ++-- + .../terminal/terminalContribExports.ts | 1 + + .../chat/browser/terminalChatActions.ts | 29 ++++++++++--------- + .../chat/browser/terminalChatController.ts | 10 ++----- + .../browser/terminalChatControllerHolder.ts | 15 ++++++++++ + 6 files changed, 39 insertions(+), 26 deletions(-) + create mode 100644 src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts + +diff --git a/src/vs/workbench/contrib/chat/browser/chatWidget.ts b/src/vs/workbench/contrib/chat/browser/chatWidget.ts +index 612ae173d99..03ee869804c 100644 +--- a/src/vs/workbench/contrib/chat/browser/chatWidget.ts ++++ b/src/vs/workbench/contrib/chat/browser/chatWidget.ts +@@ -29,7 +29,7 @@ import { WorkbenchObjectTree } from '../../../../platform/list/browser/listServi + import { ILogService } from '../../../../platform/log/common/log.js'; + import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; + import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +-import { TerminalChatController } from '../../terminal/terminalContribExports.js'; ++import { activeChatController } from '../../terminal/terminalContribExports.js'; + import { ChatAgentLocation, IChatAgentCommand, IChatAgentData, IChatAgentService, IChatWelcomeMessageContent, isChatWelcomeMessageContent } from '../common/chatAgents.js'; + import { CONTEXT_CHAT_INPUT_HAS_AGENT, CONTEXT_CHAT_LOCATION, CONTEXT_CHAT_REQUEST_IN_PROGRESS, CONTEXT_IN_CHAT_SESSION, CONTEXT_IN_QUICK_CHAT, CONTEXT_LAST_ITEM_ID, CONTEXT_PARTICIPANT_SUPPORTS_MODEL_PICKER, CONTEXT_RESPONSE_FILTERED } from '../common/chatContextKeys.js'; + import { IChatEditingService, IChatEditingSession } from '../common/chatEditingService.js'; +@@ -1107,7 +1107,7 @@ export class ChatWidgetService implements IChatWidgetService { + private _lastFocusedWidget: ChatWidget | undefined = undefined; + + get lastFocusedWidget(): IChatWidget | undefined { +- return TerminalChatController.activeChatController?.chatWidget ?? this._lastFocusedWidget; ++ return activeChatController?.chatWidget ?? this._lastFocusedWidget; + } + + constructor() { } +diff --git a/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts b/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts +index b64c4c90309..de87fbf79ab 100644 +--- a/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts ++++ b/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts +@@ -47,7 +47,7 @@ import { CTX_INLINE_CHAT_FOCUSED, MENU_INLINE_CHAT_WIDGET_SECONDARY } from '../. + import { NOTEBOOK_EDITOR_FOCUSED } from '../../../notebook/common/notebookContextKeys.js'; + import { HasSpeechProvider, ISpeechService, KeywordRecognitionStatus, SpeechToTextInProgress, SpeechToTextStatus, TextToSpeechStatus, TextToSpeechInProgress as GlobalTextToSpeechInProgress } from '../../../speech/common/speechService.js'; + import { ITerminalService } from '../../../terminal/browser/terminal.js'; +-import { TerminalChatContextKeys, TerminalChatController } from '../../../terminal/terminalContribExports.js'; ++import { TerminalChatContextKeys, TerminalChatController, activeChatController } from '../../../terminal/terminalContribExports.js'; + import { IEditorService } from '../../../../services/editor/common/editorService.js'; + import { IHostService } from '../../../../services/host/browser/host.js'; + import { IWorkbenchLayoutService, Parts } from '../../../../services/layout/browser/layoutService.js'; +@@ -148,7 +148,7 @@ class VoiceChatSessionControllerFactory { + // 1.) probe terminal chat which is not part of chat widget service + const activeInstance = terminalService.activeInstance; + if (activeInstance) { +- const terminalChat = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const terminalChat = activeChatController || TerminalChatController.get(activeInstance); + if (terminalChat?.hasFocus()) { + return VoiceChatSessionControllerFactory.doCreateForTerminalChat(terminalChat); + } +@@ -747,7 +747,7 @@ class ChatSynthesizerSessionController { + // 1.) probe terminal chat which is not part of chat widget service + const activeInstance = terminalService.activeInstance; + if (activeInstance) { +- const terminalChat = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const terminalChat = activeChatController || TerminalChatController.get(activeInstance); + if (terminalChat?.hasFocus()) { + return { + onDidHideChat: terminalChat.onDidHide, +diff --git a/src/vs/workbench/contrib/terminal/terminalContribExports.ts b/src/vs/workbench/contrib/terminal/terminalContribExports.ts +index 165a8a6b817..7a66748847a 100644 +--- a/src/vs/workbench/contrib/terminal/terminalContribExports.ts ++++ b/src/vs/workbench/contrib/terminal/terminalContribExports.ts +@@ -4,6 +4,7 @@ + *--------------------------------------------------------------------------------------------*/ + + import { TerminalAccessibilityCommandId } from '../terminalContrib/accessibility/common/terminal.accessibility.js'; ++export { activeChatController } from '../terminalContrib/chat/browser/terminalChatControllerHolder.js'; + import { TerminalDeveloperCommandId } from '../terminalContrib/developer/common/terminal.developer.js'; + import { TerminalStickyScrollSettingId } from '../terminalContrib/stickyScroll/common/terminalStickyScrollConfiguration.js'; + import { TerminalSuggestSettingId } from '../terminalContrib/suggest/common/terminalSuggestConfiguration.js'; +diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +index 82809d421e6..69664dc2b4b 100644 +--- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts ++++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +@@ -15,6 +15,7 @@ import { registerActiveXtermAction } from '../../../terminal/browser/terminalAct + import { TerminalContextKeys } from '../../../terminal/common/terminalContextKey.js'; + import { MENU_TERMINAL_CHAT_INPUT, MENU_TERMINAL_CHAT_WIDGET, MENU_TERMINAL_CHAT_WIDGET_STATUS, TerminalChatCommandId, TerminalChatContextKeys } from './terminalChat.js'; + import { TerminalChatController } from './terminalChatController.js'; ++import { activeChatController } from './terminalChatControllerHolder.js'; + + registerActiveXtermAction({ + id: TerminalChatCommandId.Start, +@@ -36,7 +37,7 @@ registerActiveXtermAction({ + return; + } + +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + + if (opts) { + opts = typeof opts === 'string' ? { query: opts } : opts; +@@ -76,7 +77,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.clear(); + } + }); +@@ -98,7 +99,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.chatWidget?.focusLastMessage(); + } + }); +@@ -121,7 +122,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.terminalChatWidget?.focus(); + } + }); +@@ -150,7 +151,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.clear(); + } + }); +@@ -182,7 +183,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(true); + } + }); +@@ -212,7 +213,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(true); + } + }); +@@ -243,7 +244,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(false); + } + }); +@@ -273,7 +274,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(false); + } + }); +@@ -302,7 +303,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.viewInChat(); + } + }); +@@ -331,7 +332,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptInput(); + } + }); +@@ -352,7 +353,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.cancel(); + } + }); +@@ -371,7 +372,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.populateHistory(true); + } + }); +@@ -390,7 +391,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.populateHistory(false); + } + }); +diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts +index 6ed1f888c50..32bf5b8542f 100644 +--- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts ++++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts +@@ -25,6 +25,7 @@ import { IStorageService, StorageScope, StorageTarget } from '../../../../../pla + import { assertType } from '../../../../../base/common/types.js'; + import { CancelablePromise, createCancelablePromise, DeferredPromise } from '../../../../../base/common/async.js'; + import { ChatAgentLocation } from '../../../chat/common/chatAgents.js'; ++import { setActiveChatController } from './terminalChatControllerHolder.js'; + + const enum Message { + NONE = 0, +@@ -43,11 +44,6 @@ export class TerminalChatController extends Disposable implements ITerminalContr + static get(instance: ITerminalInstance): TerminalChatController | null { + return instance.getContribution(TerminalChatController.ID); + } +- /** +- * The controller for the currently focused chat widget. This is used to track action context since 'active terminals' +- * are only tracked for non-detached terminal instanecs. +- */ +- static activeChatController?: TerminalChatController; + + private static _storageKey = 'terminal-inline-chat-history'; + private static _promptHistory: string[] = []; +@@ -149,13 +145,13 @@ export class TerminalChatController extends Disposable implements ITerminalContr + this._terminalChatWidget = new Lazy(() => { + const chatWidget = this._register(this._instantiationService.createInstance(TerminalChatWidget, this._instance.domElement!, this._instance, xterm)); + this._register(chatWidget.focusTracker.onDidFocus(() => { +- TerminalChatController.activeChatController = this; ++ setActiveChatController(this); + if (!isDetachedTerminalInstance(this._instance)) { + this._terminalService.setActiveInstance(this._instance); + } + })); + this._register(chatWidget.focusTracker.onDidBlur(() => { +- TerminalChatController.activeChatController = undefined; ++ setActiveChatController(undefined); + this._instance.resetScrollbarVisibility(); + })); + if (!this._instance.domElement) { +diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts +new file mode 100644 +index 00000000000..bb67971614b +--- /dev/null ++++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts +@@ -0,0 +1,15 @@ ++/*--------------------------------------------------------------------------------------------- ++ * Copyright (c) Microsoft Corporation. All rights reserved. ++ * Licensed under the MIT License. See License.txt in the project root for license information. ++ *--------------------------------------------------------------------------------------------*/ ++import { TerminalChatController } from './terminalChatController.js'; ++ ++/** ++ * The controller for the currently focused chat widget. This is used to track action context since 'active terminals' ++ * are only tracked for non-detached terminal instanecs. ++ */ ++export let activeChatController: TerminalChatController | undefined; ++ ++export function setActiveChatController(_activeChatController: TerminalChatController | undefined) { ++ activeChatController = _activeChatController; ++} diff --git a/vscode-paches/0057-fix-extract-constants-into-separate-module.patch b/vscode-paches/0057-fix-extract-constants-into-separate-module.patch new file mode 100644 index 00000000..92c5d5a4 --- /dev/null +++ b/vscode-paches/0057-fix-extract-constants-into-separate-module.patch @@ -0,0 +1,148 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= +Date: Tue, 22 Oct 2024 13:04:46 +0200 +Subject: [PATCH] fix: extract constants into separate module + +so that only the constant is pulled from the root instead of the whole module graph +--- + src/vs/workbench/api/browser/mainThreadChatAgents2.ts | 5 +++-- + .../contrib/chat/browser/actions/chatActions.ts | 5 ++--- + .../contrib/chat/browser/actions/chatConstants.ts | 10 ++++++++++ + .../chat/browser/actions/chatQuickInputActions.ts | 3 ++- + .../chat/browser/contrib/chatDynamicVariables.ts | 3 ++- + .../browser/contrib/chatDynamicVariablesConstant.ts | 6 ++++++ + .../contrib/quickaccess/browser/commandsQuickAccess.ts | 3 +-- + 7 files changed, 26 insertions(+), 9 deletions(-) + create mode 100644 src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts + create mode 100644 src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts + +diff --git a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts +index a61d91c78e1..f5c72bcb0ee 100644 +--- a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts ++++ b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts +@@ -24,13 +24,14 @@ import { ILogService } from '../../../platform/log/common/log.js'; + import { ExtHostChatAgentsShape2, ExtHostContext, IChatParticipantMetadata, IChatProgressDto, IDynamicChatAgentProps, IExtensionChatAgentMetadata, MainContext, MainThreadChatAgentsShape2 } from '../common/extHost.protocol.js'; + import { IChatWidgetService } from '../../contrib/chat/browser/chat.js'; + import { ChatInputPart } from '../../contrib/chat/browser/chatInputPart.js'; +-import { AddDynamicVariableAction, IAddDynamicVariableContext } from '../../contrib/chat/browser/contrib/chatDynamicVariables.js'; ++import { IAddDynamicVariableContext } from '../../contrib/chat/browser/contrib/chatDynamicVariables.js'; + import { ChatAgentLocation, IChatAgentHistoryEntry, IChatAgentImplementation, IChatAgentRequest, IChatAgentService } from '../../contrib/chat/common/chatAgents.js'; + import { ChatRequestAgentPart } from '../../contrib/chat/common/chatParserTypes.js'; + import { ChatRequestParser } from '../../contrib/chat/common/chatRequestParser.js'; + import { IChatContentReference, IChatFollowup, IChatProgress, IChatService, IChatTask, IChatWarningMessage } from '../../contrib/chat/common/chatService.js'; + import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js'; + import { IExtensionService } from '../../services/extensions/common/extensions.js'; ++import { addDynamicVariableActionId } from '../../contrib/chat/browser/contrib/chatDynamicVariablesConstant.js'; + + interface AgentData { + dispose: () => void; +@@ -289,7 +290,7 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA + kind: CompletionItemKind.Text, + detail: v.detail, + documentation: v.documentation, +- command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ id: v.id, widget, range: rangeAfterInsert, variableData: revive(v.value) as any, command: v.command } satisfies IAddDynamicVariableContext] } ++ command: { id: addDynamicVariableActionId, title: '', arguments: [{ id: v.id, widget, range: rangeAfterInsert, variableData: revive(v.value) as any, command: v.command } satisfies IAddDynamicVariableContext] } + } satisfies CompletionItem; + }); + +diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts +index 5ed8892df37..8d84695b3a4 100644 +--- a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts ++++ b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts +@@ -38,6 +38,8 @@ import { toAction } from '../../../../../base/common/actions.js'; + import { extractAgentAndCommand } from '../../common/chatParserTypes.js'; + import { Position } from '../../../../../editor/common/core/position.js'; + import { SuggestController } from '../../../../../editor/contrib/suggest/browser/suggestController.js'; ++import { CHAT_CATEGORY, CHAT_OPEN_ACTION_ID } from './chatConstants.js'; ++export { CHAT_CATEGORY, CHAT_OPEN_ACTION_ID } from './chatConstants.js'; + + export interface IChatViewTitleActionContext { + chatView: ChatViewPane; +@@ -47,9 +49,6 @@ export function isChatViewTitleActionContext(obj: unknown): obj is IChatViewTitl + return obj instanceof Object && 'chatView' in obj; + } + +-export const CHAT_CATEGORY = localize2('chat.category', 'Chat'); +-export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open'; +- + export interface IChatViewOpenOptions { + /** + * The query for quick chat. +diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts b/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts +new file mode 100644 +index 00000000000..6ce67486a58 +--- /dev/null ++++ b/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts +@@ -0,0 +1,10 @@ ++/*--------------------------------------------------------------------------------------------- ++ * Copyright (c) Microsoft Corporation. All rights reserved. ++ * Licensed under the MIT License. See License.txt in the project root for license information. ++ *--------------------------------------------------------------------------------------------*/ ++import { localize2 } from '../../../../../nls.js'; ++ ++export const CHAT_CATEGORY = localize2('chat.category', 'Chat'); ++export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open'; ++export const ASK_QUICK_QUESTION_ACTION_ID = 'workbench.action.quickchat.toggle'; ++ +diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts +index 05652beb196..1ced9c6afd4 100644 +--- a/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts ++++ b/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts +@@ -15,8 +15,9 @@ import { CHAT_CATEGORY } from './chatActions.js'; + import { IQuickChatOpenOptions, IQuickChatService } from '../chat.js'; + import { CONTEXT_CHAT_ENABLED } from '../../common/chatContextKeys.js'; + import { InlineChatController } from '../../../inlineChat/browser/inlineChatController.js'; ++import { ASK_QUICK_QUESTION_ACTION_ID } from './chatConstants.js'; ++export { ASK_QUICK_QUESTION_ACTION_ID } from './chatConstants.js'; + +-export const ASK_QUICK_QUESTION_ACTION_ID = 'workbench.action.quickchat.toggle'; + export function registerQuickChatActions() { + registerAction2(QuickChatGlobalAction); + registerAction2(AskQuickChatAction); +diff --git a/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts +index bd240abb61c..48db2999341 100644 +--- a/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts ++++ b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts +@@ -23,6 +23,7 @@ import { IQuickInputService } from '../../../../../platform/quickinput/common/qu + import { IChatWidget } from '../chat.js'; + import { ChatWidget, IChatWidgetContrib } from '../chatWidget.js'; + import { IChatRequestVariableValue, IChatVariablesService, IDynamicVariable } from '../../common/chatVariables.js'; ++import { addDynamicVariableActionId } from './chatDynamicVariablesConstant.js'; + + export const dynamicVariableDecorationType = 'chat-dynamic-variable'; + +@@ -230,7 +231,7 @@ function isAddDynamicVariableContext(context: any): context is IAddDynamicVariab + } + + export class AddDynamicVariableAction extends Action2 { +- static readonly ID = 'workbench.action.chat.addDynamicVariable'; ++ static readonly ID = addDynamicVariableActionId; + + constructor() { + super({ +diff --git a/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts +new file mode 100644 +index 00000000000..df0794493a8 +--- /dev/null ++++ b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts +@@ -0,0 +1,6 @@ ++/*--------------------------------------------------------------------------------------------- ++ * Copyright (c) Microsoft Corporation. All rights reserved. ++ * Licensed under the MIT License. See License.txt in the project root for license information. ++ *--------------------------------------------------------------------------------------------*/ ++ ++export const addDynamicVariableActionId = 'workbench.action.chat.addDynamicVariable'; +diff --git a/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts b/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts +index 3ab1684b9ac..a91549c6daf 100644 +--- a/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts ++++ b/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts +@@ -30,8 +30,7 @@ import { IQuickInputService, IQuickPickSeparator } from '../../../../platform/qu + import { IStorageService } from '../../../../platform/storage/common/storage.js'; + import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; + import { IWorkbenchQuickAccessConfiguration } from '../../../browser/quickaccess.js'; +-import { CHAT_OPEN_ACTION_ID } from '../../chat/browser/actions/chatActions.js'; +-import { ASK_QUICK_QUESTION_ACTION_ID } from '../../chat/browser/actions/chatQuickInputActions.js'; ++import { CHAT_OPEN_ACTION_ID, ASK_QUICK_QUESTION_ACTION_ID } from '../../chat/browser/actions/chatConstants.js'; + import { ChatAgentLocation, IChatAgentService } from '../../chat/common/chatAgents.js'; + import { CommandInformationResult, IAiRelatedInformationService, RelatedInformationType } from '../../../services/aiRelatedInformation/common/aiRelatedInformation.js'; + import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js';