@codingame/monaco-vscode-chat-service-override 38.1.3 → 39.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 (662) hide show
  1. package/common.js +46 -10
  2. package/index.js +5 -1
  3. package/package.json +6 -5
  4. package/session.js +9 -2
  5. package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +6 -0
  6. package/vscode/src/vs/platform/agentHost/browser/agentHostClientProxy.d.ts +37 -0
  7. package/vscode/src/vs/platform/agentHost/browser/agentHostClientProxy.js +120 -0
  8. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +7 -0
  9. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +52 -22
  10. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +1 -1
  11. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +2 -1
  12. package/vscode/src/vs/platform/agentHost/browser/nullWslRemoteAgentHostService.d.ts +1 -0
  13. package/vscode/src/vs/platform/agentHost/browser/nullWslRemoteAgentHostService.js +3 -0
  14. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +6 -6
  15. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +78 -41
  16. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +2 -1
  17. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +5 -1
  18. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.d.ts +1 -8
  19. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +11 -19
  20. package/vscode/src/vs/platform/agentHost/common/agentHostMcpOAuthMetadataService.d.ts +16 -0
  21. package/vscode/src/vs/platform/agentHost/common/agentHostMcpOAuthMetadataService.js +85 -0
  22. package/vscode/src/vs/platform/agentHost/common/agentHostOperatingSystem.js +9 -0
  23. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +169 -106
  24. package/vscode/src/vs/platform/agentHost/common/agentModelCatalogStatus.d.ts +4 -0
  25. package/vscode/src/vs/platform/agentHost/common/agentModelCatalogStatus.js +15 -0
  26. package/vscode/src/vs/platform/agentHost/common/agentSessionMessage.d.ts +22 -0
  27. package/vscode/src/vs/platform/agentHost/common/agentSessionMessage.js +17 -0
  28. package/vscode/src/vs/platform/agentHost/common/artifactToolsConfiguration.d.ts +23 -0
  29. package/vscode/src/vs/platform/agentHost/common/artifactToolsConfiguration.js +33 -2
  30. package/vscode/src/vs/platform/agentHost/common/chatMoveConfiguration.d.ts +14 -0
  31. package/vscode/src/vs/platform/agentHost/common/chatMoveConfiguration.js +23 -0
  32. package/vscode/src/vs/platform/agentHost/common/codexAccountPlan.js +1 -0
  33. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.d.ts +3 -3
  34. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +8 -8
  35. package/vscode/src/vs/platform/agentHost/common/dynamicAutoTiersConfiguration.d.ts +12 -0
  36. package/vscode/src/vs/platform/agentHost/common/dynamicAutoTiersConfiguration.js +22 -0
  37. package/vscode/src/vs/platform/agentHost/common/imageGenerationConfiguration.d.ts +52 -0
  38. package/vscode/src/vs/platform/agentHost/common/imageGenerationConfiguration.js +67 -0
  39. package/vscode/src/vs/platform/agentHost/common/logRedaction.d.ts +45 -0
  40. package/vscode/src/vs/platform/agentHost/common/logRedaction.js +82 -0
  41. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.d.ts +2 -0
  42. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentCompletionAttachmentMeta.d.ts +121 -0
  43. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentCompletionAttachmentMeta.js +88 -0
  44. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentPermissionResponseMeta.d.ts +1 -0
  45. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentPermissionResponseMeta.js +8 -2
  46. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentSandboxDiagnostics.d.ts +5 -0
  47. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentSandboxDiagnostics.js +5 -1
  48. package/vscode/src/vs/platform/agentHost/common/meta/vscode/customizationDiscoveryMeta.d.ts +12 -0
  49. package/vscode/src/vs/platform/agentHost/common/meta/vscode/customizationDiscoveryMeta.js +24 -0
  50. package/vscode/src/vs/platform/agentHost/common/permissionRules.d.ts +58 -0
  51. package/vscode/src/vs/platform/agentHost/common/permissionRules.js +109 -0
  52. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +4 -1
  53. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +41 -26
  54. package/vscode/src/vs/platform/agentHost/common/sessionDataService.d.ts +114 -8
  55. package/vscode/src/vs/platform/agentHost/common/sessionDataService.service.d.ts +7 -0
  56. package/vscode/src/vs/platform/agentHost/common/terminalPermissionRules.d.ts +21 -0
  57. package/vscode/src/vs/platform/agentHost/common/terminalPermissionRules.js +57 -0
  58. package/vscode/src/vs/platform/agentHost/common/titleGenerationConfiguration.js +3 -3
  59. package/vscode/src/vs/platform/agentHost/common/vscodeSandboxPaths.d.ts +2 -1
  60. package/vscode/src/vs/platform/agentHost/common/vscodeSandboxPaths.js +1 -1
  61. package/vscode/src/vs/platform/agentHost/common/workspacelessScratchDir.d.ts +8 -0
  62. package/vscode/src/vs/platform/agentHost/common/workspacelessScratchDir.js +11 -0
  63. package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.d.ts +1 -1
  64. package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.js +1 -1
  65. package/vscode/src/vs/platform/artifactIntegrations/common/artifactIntegrationRegistry.d.ts +28 -0
  66. package/vscode/src/vs/platform/artifactIntegrations/common/artifactIntegrationRegistry.js +170 -0
  67. package/vscode/src/vs/platform/github/common/content/content.d.ts +136 -0
  68. package/vscode/src/vs/platform/github/common/content/content.js +12 -0
  69. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
  70. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveEntryToRegex.d.ts +4 -0
  71. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveEntryToRegex.js +41 -0
  72. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveRuleKeyForm.d.ts +10 -0
  73. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveRuleKeyForm.js +16 -0
  74. package/vscode/src/vs/platform/terminal/common/autoApprove/suggestAutoApproveRules.d.ts +5 -0
  75. package/vscode/src/vs/platform/terminal/common/autoApprove/suggestAutoApproveRules.js +64 -0
  76. package/vscode/src/vs/platform/url/common/urlApprovalPatterns.d.ts +36 -0
  77. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.js +7 -7
  78. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.js +8 -8
  79. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +19 -7
  80. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +83 -46
  81. package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.js +2 -2
  82. package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.js +312 -127
  83. package/vscode/src/vs/sessions/contrib/chat/browser/chatBackgroundTint.js +2 -2
  84. package/vscode/src/vs/sessions/contrib/chat/browser/getThemeColorsTool.d.ts +21 -0
  85. package/vscode/src/vs/sessions/contrib/chat/browser/getThemeColorsTool.js +138 -0
  86. package/vscode/src/vs/sessions/contrib/chat/browser/modelPicker.d.ts +68 -0
  87. package/vscode/src/vs/sessions/contrib/chat/browser/modelPicker.js +302 -0
  88. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionAction.d.ts +3 -6
  89. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionAction.js +42 -9
  90. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.js +4 -4
  91. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionPickerTryout.js +1 -1
  92. package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.d.ts +3 -2
  93. package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.js +29 -18
  94. package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.d.ts +2 -0
  95. package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.js +11 -1
  96. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.js +91 -98
  97. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.js +21 -21
  98. package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.js +5 -5
  99. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.d.ts +2 -0
  100. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.js +511 -211
  101. package/vscode/src/vs/sessions/contrib/chat/browser/sharedChatInputComposer.contribution.d.ts +9 -0
  102. package/vscode/src/vs/sessions/contrib/chat/browser/sharedChatInputComposer.contribution.js +146 -0
  103. package/vscode/src/vs/sessions/contrib/chat/browser/sideChatOrchestration.d.ts +13 -0
  104. package/vscode/src/vs/sessions/contrib/chat/browser/sideChatOrchestration.js +14 -0
  105. package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.d.ts +3 -8
  106. package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.js +10 -8
  107. package/vscode/src/vs/sessions/contrib/extensions/browser/agentsWindowExtensionAutoEnablementTelemetry.d.ts +30 -0
  108. package/vscode/src/vs/sessions/contrib/extensions/browser/agentsWindowExtensionAutoEnablementTelemetry.js +178 -0
  109. package/vscode/src/vs/sessions/contrib/extensions/browser/agentsWindowExtensionsAccessibilityHelp.d.ts +10 -0
  110. package/vscode/src/vs/sessions/contrib/extensions/browser/agentsWindowExtensionsAccessibilityHelp.js +61 -0
  111. package/vscode/src/vs/sessions/contrib/extensions/browser/agentsWindowExtensionsWidget.d.ts +100 -0
  112. package/vscode/src/vs/sessions/contrib/extensions/browser/agentsWindowExtensionsWidget.js +687 -0
  113. package/vscode/src/vs/sessions/contrib/extensions/browser/extensions.contribution.d.ts +1 -0
  114. package/vscode/src/vs/sessions/contrib/extensions/browser/extensions.contribution.js +88 -0
  115. package/vscode/src/vs/sessions/contrib/extensions/browser/media/agentsWindowExtensions.css +182 -0
  116. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.d.ts +57 -6
  117. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.js +94 -108
  118. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPolicyContinuationPresenter.d.ts +12 -0
  119. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPolicyContinuationPresenter.js +48 -0
  120. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.js +4 -4
  121. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.js +4 -4
  122. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsShared.js +3 -1
  123. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.js +2 -2
  124. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.js +7 -7
  125. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/localAgentHostSessionsProvider.d.ts +107 -0
  126. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/localAgentHostSessionsProvider.js +447 -0
  127. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputPresenter.js +15 -10
  128. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.js +1 -1
  129. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openSubagentChat.d.ts +2 -1
  130. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openSubagentChat.js +92 -34
  131. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.js +12 -5
  132. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.d.ts +1 -0
  133. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.js +1 -0
  134. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.js +1 -1
  135. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.js +15 -15
  136. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.js +9 -9
  137. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.js +5 -0
  138. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.d.ts +1 -0
  139. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.js +39 -25
  140. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.js +13 -13
  141. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.js +13 -13
  142. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +110 -145
  143. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.js +2 -4
  144. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.js +6 -2
  145. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/media/sessionWorktreeCleanupEditor.css +118 -90
  146. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.d.ts +1 -1
  147. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.js +48 -13
  148. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.d.ts +89 -10
  149. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.js +1375 -182
  150. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditorInput.js +1 -1
  151. package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.js +3 -3
  152. package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.d.ts +3 -1
  153. package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.js +30 -3
  154. package/vscode/src/vs/sessions/skills/all_/SKILL.md.js +4 -3
  155. package/vscode/src/vs/sessions/skills/generate-chat-background/SKILL.md +34 -0
  156. package/vscode/src/vs/sessions/skills/troubleshoot/SKILL.md +1 -1
  157. package/vscode/src/vs/workbench/api/browser/mainThreadChatArtifactIntegrations.d.ts +30 -0
  158. package/vscode/src/vs/workbench/api/browser/mainThreadChatArtifactIntegrations.js +484 -0
  159. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +1 -0
  160. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +7 -5
  161. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +1 -19
  162. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +4 -80
  163. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +6 -6
  164. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatPetJumpGameAccessibleView.d.ts +11 -0
  165. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatPetJumpGameAccessibleView.js +31 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +4 -4
  167. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +30 -23
  168. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.d.ts +2 -1
  169. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +23 -12
  170. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +6 -1
  171. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +513 -171
  172. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  173. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
  174. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +133 -124
  175. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +9 -9
  176. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +6 -0
  177. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +83 -14
  178. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.d.ts +18 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +110 -9
  180. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +3 -3
  181. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +7 -7
  182. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  183. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  184. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  185. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +13 -13
  186. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  187. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  188. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -15
  189. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  190. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  191. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +32 -32
  192. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +6 -6
  193. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.d.ts +26 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.js +73 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
  196. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +3 -1
  197. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +11 -5
  198. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  199. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -12
  200. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +7 -2
  201. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +49 -36
  202. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +8 -0
  203. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +10 -4
  204. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +235 -76
  205. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +4 -3
  206. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.d.ts +4 -0
  207. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +71 -26
  208. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputState.js +8 -8
  209. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatMoveEditors.d.ts +20 -0
  210. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatMoveEditors.js +46 -0
  211. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.d.ts +9 -8
  212. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +125 -53
  213. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationMarketplaceInstallProvider.d.ts +26 -10
  214. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationMarketplaceInstallProvider.js +493 -162
  215. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostEditReview.d.ts +187 -0
  216. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostEditReview.js +1000 -0
  217. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.d.ts +3 -7
  218. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalModelSupport.d.ts +97 -0
  219. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalModelSupport.js +407 -0
  220. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpAppToolsService.d.ts +52 -0
  221. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpAppToolsService.js +361 -0
  222. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerMigrationProvider.d.ts +3 -1
  223. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerMigrationProvider.js +72 -21
  224. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +1 -2
  225. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionMirror.d.ts +3 -0
  226. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionMirror.js +51 -0
  227. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
  228. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPolicyContinuation.d.ts +45 -0
  229. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPolicyContinuation.js +377 -0
  230. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPolicyContinuationEditor.d.ts +10 -0
  231. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPolicyContinuationEditor.js +34 -0
  232. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPolicyUnavailableSession.d.ts +19 -0
  233. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPolicyUnavailableSession.js +109 -0
  234. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +4 -4
  235. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRemoteByokNotification.js +3 -3
  236. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +24 -2
  237. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +87 -51
  238. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +3 -1
  239. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotification.d.ts +48 -1
  240. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotification.js +434 -36
  241. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotifications.js +18 -11
  242. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxPathGrant.d.ts +4 -0
  243. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxPathGrant.js +19 -0
  244. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.d.ts +134 -49
  245. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +1627 -491
  246. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +60 -4
  247. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +572 -133
  248. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.d.ts +5 -1
  249. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +65 -15
  250. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.d.ts +15 -2
  251. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +114 -50
  252. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +27 -10
  253. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +105 -49
  254. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +8 -1
  255. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +3 -0
  256. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +6 -4
  257. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +2 -2
  258. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +4 -4
  259. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutCompatibilityContribution.d.ts +9 -0
  260. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutCompatibilityContribution.js +54 -0
  261. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.d.ts +2 -5
  262. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +6 -17
  263. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSteeringMessageHandoff.d.ts +14 -0
  264. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSteeringMessageHandoff.js +138 -0
  265. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.d.ts +1 -1
  266. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.js +4 -2
  267. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +7 -2
  269. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +70 -26
  270. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +2 -2
  271. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +13 -4
  272. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +96 -8
  273. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +2 -2
  274. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuation.contribution.js +1 -1
  275. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuationGuide.js +9 -9
  276. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModel.contribution.d.ts +1 -0
  277. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModel.contribution.js +60 -0
  278. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModelActions.d.ts +61 -0
  279. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModelActions.js +476 -0
  280. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModelReadyNotification.d.ts +70 -0
  281. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModelReadyNotification.js +422 -0
  282. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModelSetupProgress.d.ts +108 -0
  283. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/localModelSetupProgress.js +744 -0
  284. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.d.ts +5 -1
  285. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +36 -9
  286. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +21 -4
  287. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +9 -0
  288. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +112 -61
  289. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +1 -1
  290. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  291. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  292. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  293. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.d.ts +31 -1
  294. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +15 -4
  295. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +28 -26
  296. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  297. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  298. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +40 -24
  299. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +115 -61
  300. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -2
  301. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +7 -2
  302. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/copilotExtensionsService.d.ts +15 -0
  303. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/copilotExtensionsService.js +63 -0
  304. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +10 -1
  305. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +39 -4
  306. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplace.contribution.js +28 -26
  307. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceInstallService.d.ts +4 -2
  308. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceInstallService.js +159 -86
  309. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +23 -11
  310. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +20 -3
  311. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +281 -34
  312. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationsTelemetryService.js +6 -3
  313. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +9 -9
  314. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +390 -112
  315. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerEnvironmentVariables.d.ts +56 -0
  316. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerEnvironmentVariables.js +298 -0
  317. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  318. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.d.ts +6 -3
  319. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.js +2 -2
  320. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.js +2 -1
  321. package/vscode/src/vs/workbench/contrib/chat/browser/btwSlashCommand.d.ts +11 -0
  322. package/vscode/src/vs/workbench/contrib/chat/browser/btwSlashCommand.js +84 -0
  323. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +1 -0
  324. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +648 -652
  325. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +14 -7
  326. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +74 -57
  327. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  328. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +124 -124
  329. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  330. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  331. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +3 -1
  332. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +8 -2
  333. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  334. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.d.ts +3 -6
  335. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +6 -5
  336. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  337. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  338. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  339. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  340. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  341. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
  342. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  343. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  344. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  345. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  346. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +35 -35
  347. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  348. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.d.ts +3 -3
  349. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +60 -50
  350. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +2 -0
  351. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +88 -41
  352. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js +2 -1
  353. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +43 -32
  354. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +13 -21
  355. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.d.ts +3 -1
  356. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +18 -28
  357. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  358. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +6 -0
  359. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +9 -3
  360. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +2 -2
  361. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +2 -1
  362. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  363. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +20 -7
  364. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +2 -2
  365. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +4 -3
  366. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +8 -0
  367. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +4 -0
  368. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  369. package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.d.ts +3 -1
  370. package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.js +21 -31
  371. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +15 -6
  372. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +35 -21
  373. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  374. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  375. package/vscode/src/vs/workbench/contrib/chat/browser/chatNetworkConfiguration.js +6 -4
  376. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  377. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
  378. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +15 -15
  379. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +54 -24
  380. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
  381. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +34 -34
  382. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetColorsWidget.js +13 -13
  383. package/vscode/src/vs/workbench/contrib/chat/browser/chatProgressConfiguration.d.ts +69 -2
  384. package/vscode/src/vs/workbench/contrib/chat/browser/chatProgressConfiguration.js +164 -22
  385. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +1 -1
  386. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +25 -25
  387. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  388. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionCommit.d.ts +9 -0
  389. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionCommit.js +85 -0
  390. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +2 -2
  391. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +20 -20
  392. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +11 -11
  393. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  394. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +0 -6
  395. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +25 -58
  396. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +17 -17
  397. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChatProvider.d.ts +27 -0
  398. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChatProvider.js +114 -0
  399. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +78 -24
  400. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +10 -10
  401. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusPromo.d.ts +1 -0
  402. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusPromo.js +13 -5
  403. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/codexStatusEntry.js +4 -4
  404. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +20 -20
  405. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +22 -5
  406. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +52 -2
  407. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +7 -7
  408. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  409. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  410. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  411. package/vscode/src/vs/workbench/contrib/chat/browser/editorChatUsage.contribution.js +1 -1
  412. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  413. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatHarnessSwitchFeedbackSurveyService.js +10 -10
  414. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.d.ts +5 -55
  415. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +40 -220
  416. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  417. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatPetAchievements.css +81 -9
  418. package/vscode/src/vs/workbench/contrib/chat/browser/onboarding/chatInputSpotlightTour.d.ts +38 -0
  419. package/vscode/src/vs/workbench/contrib/chat/browser/onboarding/chatInputSpotlightTour.js +248 -0
  420. package/vscode/src/vs/workbench/contrib/chat/browser/onboarding/chatOnboardingEligibility.d.ts +20 -0
  421. package/vscode/src/vs/workbench/contrib/chat/browser/onboarding/chatOnboardingEligibility.js +54 -0
  422. package/vscode/src/vs/workbench/contrib/chat/browser/onboarding/modelPickerTryout.contribution.js +7 -7
  423. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +6 -6
  424. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +6 -23
  425. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +128 -118
  426. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitHubAuthentication.d.ts +3 -0
  427. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitHubAuthentication.js +4 -4
  428. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +1 -1
  429. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +39 -43
  430. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +20 -17
  431. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +26 -42
  432. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +216 -165
  433. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +2 -1
  434. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +7 -4
  435. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  436. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.d.ts +2 -1
  437. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +12 -9
  438. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +16 -2
  439. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  440. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  441. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  442. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.d.ts +2 -1
  443. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +14 -11
  444. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  445. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.d.ts +2 -1
  446. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +7 -4
  447. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +5 -5
  448. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
  449. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +8 -5
  450. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.d.ts +4 -1
  451. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +36 -30
  452. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +5 -2
  453. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +3 -3
  454. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  455. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxRepositoryPicker.d.ts +16 -0
  456. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxRepositoryPicker.js +106 -0
  457. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.d.ts +19 -2
  458. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.js +165 -31
  459. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.d.ts +57 -6
  460. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.js +511 -36
  461. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentActions.js +16 -13
  462. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.js +137 -12
  463. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostAuthenticationResolver.d.ts +24 -0
  464. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostAuthenticationResolver.js +136 -0
  465. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.d.ts +8 -1
  466. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.js +155 -39
  467. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostCustomizationHarness.d.ts +4 -1
  468. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostCustomizationHarness.js +16 -5
  469. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +32 -13
  470. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  471. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +1 -0
  472. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +78 -48
  473. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +9 -9
  474. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  475. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  476. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
  477. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.d.ts +4 -0
  478. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.js +11 -0
  479. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +3 -1
  480. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +9 -2
  481. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -3
  482. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +11 -11
  483. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +4 -4
  484. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.d.ts +47 -1
  485. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +139 -24
  486. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +14 -0
  487. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +89 -28
  488. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +18 -11
  489. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +11 -4
  490. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.d.ts +11 -0
  491. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.js +29 -0
  492. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputSessionLinkProvider.d.ts +12 -0
  493. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputSessionLinkProvider.js +82 -0
  494. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +2 -1
  495. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +17 -1
  496. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +134 -16
  497. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/media/chatEditor.css +26 -0
  498. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +13 -2
  499. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +172 -131
  500. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  501. package/vscode/src/vs/workbench/contrib/chat/common/chatOpenDiagnosticsService.d.ts +23 -0
  502. package/vscode/src/vs/workbench/contrib/chat/common/chatOpenDiagnosticsService.js +103 -0
  503. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +59 -1
  504. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +481 -271
  505. package/vscode/src/vs/workbench/contrib/chat/common/chatService/remoteChatSessionRestorer.d.ts +148 -0
  506. package/vscode/src/vs/workbench/contrib/chat/common/chatService/remoteChatSessionRestorer.js +575 -0
  507. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.d.ts +13 -17
  508. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.js +2 -2
  509. package/vscode/src/vs/workbench/contrib/chat/common/chatThinkingTitleService.d.ts +34 -0
  510. package/vscode/src/vs/workbench/contrib/chat/common/chatThinkingTitleService.js +176 -0
  511. package/vscode/src/vs/workbench/contrib/chat/common/chatUtilityModelService.d.ts +38 -0
  512. package/vscode/src/vs/workbench/contrib/chat/common/chatUtilityModelService.js +190 -0
  513. package/vscode/src/vs/workbench/contrib/chat/common/customizationMarketplaceInstallService.d.ts +2 -0
  514. package/vscode/src/vs/workbench/contrib/chat/common/customizationMarketplaceInstallService.js +5 -1
  515. package/vscode/src/vs/workbench/contrib/chat/common/editing/chatSessionReviewPreferences.d.ts +12 -0
  516. package/vscode/src/vs/workbench/contrib/chat/common/editing/chatSessionReviewPreferences.js +25 -0
  517. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +2 -0
  518. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +7 -1
  519. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +17 -18
  520. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +27 -6
  521. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +21 -2
  522. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -1
  523. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +26 -13
  524. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.d.ts +2 -2
  525. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +80 -52
  526. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +13 -13
  527. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.d.ts +6 -1
  528. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +57 -4
  529. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +3 -1
  530. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +27 -15
  531. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.d.ts +5 -1
  532. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +27 -11
  533. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +10 -1
  534. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +383 -51
  535. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +10 -1
  536. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +211 -32
  537. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptModelResolver.d.ts +19 -0
  538. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptModelResolver.js +77 -0
  539. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptSkillResolver.d.ts +22 -0
  540. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptSkillResolver.js +87 -0
  541. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptToolResolver.d.ts +18 -0
  542. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptToolResolver.js +53 -0
  543. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +26 -6
  544. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +816 -195
  545. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationTelemetryService.d.ts +10 -11
  546. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationTelemetryService.js +135 -95
  547. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +1 -0
  548. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +10 -10
  549. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +7 -7
  550. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +1 -10
  551. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +13 -98
  552. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +3 -3
  553. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +4 -4
  554. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +8 -0
  555. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +70 -73
  556. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  557. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  558. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.d.ts +15 -19
  559. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +122 -202
  560. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  561. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselTypes.d.ts +1 -0
  562. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/media/imageCarousel.css +19 -50
  563. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  564. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  565. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.d.ts +1 -1
  566. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +3 -2
  567. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  568. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  569. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  570. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  571. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  572. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  573. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  574. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +10 -10
  575. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  576. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  577. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +1 -12
  578. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +2 -43
  579. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  580. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +6 -0
  581. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +14 -14
  582. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +2 -2
  583. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +10 -0
  584. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +15 -1
  585. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -2
  586. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +42 -96
  587. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +1 -0
  588. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +2 -1
  589. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +5 -4
  590. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  591. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +22 -13
  592. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  593. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  594. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  595. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  596. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  597. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  598. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  599. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +76 -75
  600. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  601. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  602. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  603. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  604. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  605. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +4 -4
  606. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +3 -3
  607. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +20 -3
  608. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +56 -14
  609. package/vscode/src/vs/workbench/services/agentHost/browser/localModelService.d.ts +52 -0
  610. package/vscode/src/vs/workbench/services/agentHost/browser/localModelService.js +294 -0
  611. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentCustomizationMeta.d.ts +0 -27
  612. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentCustomizationMeta.js +0 -14
  613. package/vscode/src/vs/platform/agentHost/common/meta/vscode/clientPluginCustomizationMeta.d.ts +0 -17
  614. package/vscode/src/vs/platform/agentHost/common/meta/vscode/clientPluginCustomizationMeta.js +0 -22
  615. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.d.ts +0 -8
  616. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.js +0 -8
  617. package/vscode/src/vs/platform/browserView/common/browserChatToolReferenceNames.d.ts +0 -23
  618. package/vscode/src/vs/platform/browserView/common/browserChatToolReferenceNames.js +0 -17
  619. package/vscode/src/vs/platform/customizationMarketplace/common/mcpGalleryMarketplaceProvider.d.ts +0 -22
  620. package/vscode/src/vs/platform/customizationMarketplace/common/mcpGalleryMarketplaceProvider.js +0 -158
  621. package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.d.ts +0 -15
  622. package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.js +0 -106
  623. package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.d.ts +0 -3
  624. package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.js +0 -17
  625. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.d.ts +0 -24
  626. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.js +0 -55
  627. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +0 -65
  628. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +0 -441
  629. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.d.ts +0 -23
  630. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.js +0 -46
  631. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +0 -97
  632. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +0 -241
  633. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +0 -141
  634. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +0 -731
  635. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.d.ts +0 -46
  636. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.js +0 -313
  637. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.d.ts +0 -6
  638. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +0 -16
  639. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.d.ts +0 -36
  640. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +0 -58
  641. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +0 -140
  642. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +0 -358
  643. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/copilotConnectorsService.d.ts +0 -139
  644. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/copilotConnectorsService.js +0 -944
  645. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceWorkbenchService.d.ts +0 -50
  646. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceWorkbenchService.js +0 -213
  647. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/githubMcpRegistryIcons.d.ts +0 -4
  648. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/githubMcpRegistryIcons.js +0 -605
  649. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.d.ts +0 -4
  650. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.js +0 -15
  651. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostConnectionCustomization.d.ts +0 -43
  652. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostConnectionCustomization.js +0 -26
  653. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +0 -32
  654. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +0 -261
  655. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +0 -59
  656. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +0 -72
  657. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +0 -5
  658. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +0 -12
  659. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +0 -35
  660. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +0 -36
  661. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.d.ts +0 -47
  662. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.js +0 -362
@@ -11,26 +11,53 @@ import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objec
11
11
  import { isEqual, getComparisonKey, dirname, basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
12
12
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
13
13
  import { normalizeMcpServerConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentPlugins/common/pluginParsers';
14
- import { hasConfigurationVariable, parseConfigurationVariable } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationVariables';
14
+ import { hasConfigurationVariable } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationVariables';
15
15
  import { toFileOperationResult, FileOperationResult, FileOperationError } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
16
- import { MAX_ENV_VAR_RESOLVE_LENGTH } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/envVarResolution';
16
+ import { hasEnvVarReferences, MAX_ENV_VAR_RESOLVE_LENGTH } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/envVarResolution';
17
17
  import { toCopilotMcpServerConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpCopilotConfiguration';
18
18
  import { parseCopilotGlobalMcpConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpCopilotGlobalConfiguration';
19
19
  import { McpServerType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes';
20
+ import { mcpOAuthClientSecretStorageKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
20
21
  import { ConfigurationResolverExpression } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolverExpression';
21
22
  import { McpServerCustomizationMigrationFailureReason, CustomizationMigrationType, mcpServerCustomizationMigrationRemovableProperties } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService';
22
23
  import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
23
- import { AgentHostMcpServerApplicability, AgentHostMcpServerDelivery, AgentHostMcpServerSourceKind, AgentHostMcpSupportReason } from '../agentSessions/agentHost/agentHostMcpServerSupport.js';
24
+ import { AgentHostMcpServerApplicability, AgentHostMcpServerSourceKind, AgentHostMcpSupportReason, AgentHostMcpServerDelivery } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport';
25
+ import { isJsonObject, getMcpSourceFile, removeUnreferencedInputs, parseJsonContent, getMigratedVariables, getMigratedSettingNames, getConfigurationVariables, replaceConfigurationVariables, environmentVariableNamePattern, isDefaultReferenceIntact } from './mcpServerEnvironmentVariables.js';
24
26
 
25
27
  const LOG_PREFIX = "[MCP Customization Migration]";
26
28
  function isMcpServerMigrationDeliverable(server) {
27
- return server.applicability === AgentHostMcpServerApplicability.Applicable && (server.delivery === AgentHostMcpServerDelivery.ClientForwarded || (server.delivery === AgentHostMcpServerDelivery.NotDelivered && server.shadowedBy !== undefined && server.source.kind === AgentHostMcpServerSourceKind.VscodeWorkspaceFolder)) && (server.compatibility.kind === "supported" || server.compatibility.kind === "partiallySupported" || (server.compatibility.kind === "unsupported" && (server.source.kind === AgentHostMcpServerSourceKind.UserProfile || server.source.kind === AgentHostMcpServerSourceKind.RemoteUser) && server.compatibility.reasons.every(reason => reason === AgentHostMcpSupportReason.UnresolvedConfiguration))) && server.projectedConfiguration !== undefined;
29
+ if (server.applicability !== AgentHostMcpServerApplicability.Applicable || server.projectedConfiguration === undefined) {
30
+ return false;
31
+ }
32
+ const isSupported = server.compatibility.kind === "supported" || server.compatibility.kind === "partiallySupported";
33
+ const isUserSource = server.source.kind === AgentHostMcpServerSourceKind.UserProfile || server.source.kind === AgentHostMcpServerSourceKind.RemoteUser;
34
+ const onlyHasUnresolvedVariables = server.compatibility.kind === "unsupported" && server.compatibility.reasons.length > 0 && server.compatibility.reasons.every(
35
+ reason => reason === AgentHostMcpSupportReason.UnresolvedConfiguration || reason === AgentHostMcpSupportReason.RequiresUserInteraction
36
+ );
37
+ switch (server.delivery) {
38
+ case AgentHostMcpServerDelivery.ClientForwarded:
39
+ return isSupported || (onlyHasUnresolvedVariables && isUserSource);
40
+ case AgentHostMcpServerDelivery.NotDelivered:
41
+ return (onlyHasUnresolvedVariables && isUserSource) || (server.source.kind === AgentHostMcpServerSourceKind.VscodeWorkspaceFolder && ((isSupported && server.shadowedBy !== undefined) || onlyHasUnresolvedVariables));
42
+ default:
43
+ return false;
44
+ }
28
45
  }
29
46
  class McpServerCustomizationMigrator {
30
- constructor(fileService, logService, configurationResolverService) {
47
+ constructor(
48
+ fileService,
49
+ logService,
50
+ configurationResolverService,
51
+ configurationService,
52
+ secretStorageService
53
+ ) {
31
54
  this.fileService = fileService;
32
55
  this.logService = logService;
33
- this.configurationResolverService = configurationResolverService;
56
+ this.secretStorageService = secretStorageService;
57
+ this.services = {
58
+ configurationResolverService,
59
+ configurationService
60
+ };
34
61
  }
35
62
  async createPlan(snapshot, roots, token = CancellationToken.None, userTarget) {
36
63
  if (token.isCancellationRequested) {
@@ -38,7 +65,7 @@ class McpServerCustomizationMigrator {
38
65
  }
39
66
  const candidates = [];
40
67
  const exclusions = [];
41
- const sourceServers = ( new ResourceMap());
68
+ const sourceFiles = ( new ResourceMap());
42
69
  this.logService.trace(
43
70
  `${LOG_PREFIX} Planning: servers=${snapshot.servers.length}, roots=${roots.length}, discoveryComplete=${snapshot.discoveryComplete}`
44
71
  );
@@ -69,14 +96,14 @@ class McpServerCustomizationMigrator {
69
96
  excluded(McpServerCustomizationMigrationFailureReason.NoLongerEligible);
70
97
  continue;
71
98
  }
72
- let sourceServersPromise = sourceServers.get(sourceUri);
73
- if (!sourceServersPromise) {
74
- sourceServersPromise = this.readMcpServers(sourceUri, token);
75
- sourceServers.set(sourceUri, sourceServersPromise);
99
+ let sourceFilePromise = sourceFiles.get(sourceUri);
100
+ if (!sourceFilePromise) {
101
+ sourceFilePromise = this.readMcpSourceFile(sourceUri, token);
102
+ sourceFiles.set(sourceUri, sourceFilePromise);
76
103
  }
77
- let servers;
104
+ let sourceFile;
78
105
  try {
79
- servers = await sourceServersPromise;
106
+ sourceFile = await sourceFilePromise;
80
107
  } catch (error) {
81
108
  if (token.isCancellationRequested) {
82
109
  throw ( new CancellationError());
@@ -91,23 +118,23 @@ class McpServerCustomizationMigrator {
91
118
  if (token.isCancellationRequested) {
92
119
  throw ( new CancellationError());
93
120
  }
94
- if (!servers) {
121
+ if (!sourceFile) {
95
122
  excluded(McpServerCustomizationMigrationFailureReason.SourceUnavailable);
96
123
  continue;
97
124
  }
98
- if (!Object.hasOwn(servers, server.name)) {
125
+ if (!Object.hasOwn(sourceFile.servers, server.name)) {
99
126
  excluded(McpServerCustomizationMigrationFailureReason.NoLongerEligible);
100
127
  continue;
101
128
  }
102
- const rawConfiguration = servers[server.name];
103
- const analysis = await analyzeSourceConfiguration(rawConfiguration, root, storage, this.configurationResolverService);
129
+ const rawConfiguration = sourceFile.servers[server.name];
130
+ const analysis = await analyzeSourceConfiguration(rawConfiguration, sourceFile, root, storage, this.services);
104
131
  if (typeof analysis === "string") {
105
132
  excluded(analysis);
106
133
  continue;
107
134
  }
108
135
  if (!isConfigurationRepresentable(server.projectedConfiguration) || !isConfigurationRepresentable(analysis.migration) || ( Iterable.some(
109
136
  ConfigurationResolverExpression.parse(server.projectedConfiguration).unresolved(),
110
- replacement => !isForwardedUnresolved(replacement, storage)
137
+ replacement => !isForwardedUnresolved(replacement, storage, !!analysis.projectedAsWritten) && !analysis.settingValueVariables?.has(replacement.id)
111
138
  )) || !equals(
112
139
  analysis.projection,
113
140
  canonicalizeConfiguration(server.projectedConfiguration)
@@ -115,6 +142,28 @@ class McpServerCustomizationMigrator {
115
142
  excluded(McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration);
116
143
  continue;
117
144
  }
145
+ const oauth = analysis.oauthClientId !== undefined ? {
146
+ clientId: analysis.oauthClientId
147
+ } : undefined;
148
+ if (oauth) {
149
+ let hasSecret;
150
+ try {
151
+ hasSecret = await hasOAuthClientSecret(oauth, rawConfiguration, this.secretStorageService);
152
+ } catch (error) {
153
+ excluded(
154
+ McpServerCustomizationMigrationFailureReason.SourceUnavailable,
155
+ toError(error)
156
+ );
157
+ continue;
158
+ }
159
+ if (token.isCancellationRequested) {
160
+ throw ( new CancellationError());
161
+ }
162
+ if (hasSecret) {
163
+ excluded(McpServerCustomizationMigrationFailureReason.OAuthClientSecret);
164
+ continue;
165
+ }
166
+ }
118
167
  const removedProperties = getRemovedProperties(rawConfiguration);
119
168
  candidates.push({
120
169
  type: CustomizationMigrationType.McpServers,
@@ -127,8 +176,17 @@ class McpServerCustomizationMigrator {
127
176
  ...(analysis.migration !== analysis.projection ? {
128
177
  migratedConfiguration: analysis.migration
129
178
  } : {}),
179
+ ...(analysis.environmentVariables ? {
180
+ environmentVariables: analysis.environmentVariables
181
+ } : {}),
182
+ ...(analysis.settingVariables ? {
183
+ settingVariables: analysis.settingVariables
184
+ } : {}),
130
185
  ...(removedProperties ? {
131
186
  removedProperties
187
+ } : {}),
188
+ ...(oauth ? {
189
+ oauth
132
190
  } : {})
133
191
  });
134
192
  }
@@ -145,11 +203,12 @@ class McpServerCustomizationMigrator {
145
203
  candidates,
146
204
  this.fileService,
147
205
  this.logService,
148
- this.configurationResolverService,
206
+ this.services,
207
+ this.secretStorageService,
149
208
  options
150
209
  );
151
210
  }
152
- async readMcpServers(resource, token) {
211
+ async readMcpSourceFile(resource, token) {
153
212
  let content;
154
213
  try {
155
214
  content = ( (await this.fileService.readFile(resource, undefined, token)).value.toString());
@@ -164,14 +223,21 @@ class McpServerCustomizationMigrator {
164
223
  allowTrailingComma: true,
165
224
  allowEmptyContent: false
166
225
  });
167
- const servers = errors.length === 0 && isJsonObject(value) ? getObjectProperty(value, "servers") : undefined;
168
- if (!servers) {
226
+ const sourceFile = errors.length === 0 && isJsonObject(value) ? getMcpSourceFile(value) : undefined;
227
+ if (!sourceFile) {
169
228
  throw ( new McpServerMigrationError(McpServerCustomizationMigrationFailureReason.InvalidSource, ( new Error(`MCP configuration ${( resource.toString())} does not contain a valid servers object.`))));
170
229
  }
171
- return servers;
230
+ return sourceFile;
172
231
  }
173
232
  }
174
- async function executeMigration(candidates, fileService, logService, configurationResolverService, options) {
233
+ async function executeMigration(
234
+ candidates,
235
+ fileService,
236
+ logService,
237
+ services,
238
+ secretStorageService,
239
+ options
240
+ ) {
175
241
  const groups = ( new Map());
176
242
  const failures = [];
177
243
  for (const candidate of candidates) {
@@ -209,7 +275,7 @@ async function executeMigration(candidates, fileService, logService, configurati
209
275
  continue;
210
276
  }
211
277
  try {
212
- const result = await migrateGroup(group, fileService, logService, configurationResolverService, options);
278
+ const result = await migrateGroup(group, fileService, logService, services, secretStorageService, options);
213
279
  migratedCount += result.migratedCount;
214
280
  failures.push(...result.failures);
215
281
  } catch (error) {
@@ -225,7 +291,7 @@ async function executeMigration(candidates, fileService, logService, configurati
225
291
  failures
226
292
  };
227
293
  }
228
- async function migrateGroup(group, fileService, logService, configurationResolverService, options) {
294
+ async function migrateGroup(group, fileService, logService, services, secretStorageService, options) {
229
295
  logService.trace(
230
296
  `${LOG_PREFIX} Migrating ${group.candidates.length} server(s) from ${( group.sourceUri.toString())} to ${( group.targetUri.toString())}.`
231
297
  );
@@ -241,10 +307,11 @@ async function migrateGroup(group, fileService, logService, configurationResolve
241
307
  toError(error)
242
308
  ));
243
309
  }
244
- const sourceServers = getObjectProperty(source.value, "servers");
245
- if (!sourceServers) {
310
+ const sourceFile = getMcpSourceFile(source.value);
311
+ if (!sourceFile) {
246
312
  throw ( new McpServerMigrationError(McpServerCustomizationMigrationFailureReason.InvalidSource, ( new Error(`MCP configuration ${( group.sourceUri.toString())} does not contain a servers object.`))));
247
313
  }
314
+ const sourceServers = sourceFile.servers;
248
315
  let target;
249
316
  try {
250
317
  target = await readTargetDocument(group.targetUri, fileService, group.storage === PromptsStorage.user);
@@ -274,12 +341,7 @@ async function migrateGroup(group, fileService, logService, configurationResolve
274
341
  continue;
275
342
  }
276
343
  const root = group.storage === PromptsStorage.local ? dirname(group.targetUri) : undefined;
277
- const analysis = await analyzeSourceConfiguration(
278
- sourceServers[candidate.name],
279
- root,
280
- group.storage,
281
- configurationResolverService
282
- );
344
+ const analysis = await analyzeSourceConfiguration(sourceServers[candidate.name], sourceFile, root, group.storage, services);
283
345
  if (typeof analysis === "string") {
284
346
  reject(candidate, analysis);
285
347
  continue;
@@ -291,6 +353,19 @@ async function migrateGroup(group, fileService, logService, configurationResolve
291
353
  reject(candidate, McpServerCustomizationMigrationFailureReason.SourceChanged);
292
354
  continue;
293
355
  }
356
+ if (candidate.oauth) {
357
+ let hasSecret;
358
+ try {
359
+ hasSecret = await hasOAuthClientSecret(candidate.oauth, sourceServers[candidate.name], secretStorageService);
360
+ } catch {
361
+ reject(candidate, McpServerCustomizationMigrationFailureReason.SourceUnavailable);
362
+ continue;
363
+ }
364
+ if (hasSecret) {
365
+ reject(candidate, McpServerCustomizationMigrationFailureReason.OAuthClientSecret);
366
+ continue;
367
+ }
368
+ }
294
369
  if (Object.hasOwn(targetServers, candidate.name) && !isEquivalentTargetConfiguration(targetServers[candidate.name], candidate)) {
295
370
  reject(candidate, McpServerCustomizationMigrationFailureReason.TargetConflict);
296
371
  continue;
@@ -329,6 +404,10 @@ async function migrateGroup(group, fileService, logService, configurationResolve
329
404
  for (const candidate of candidatesToMigrate) {
330
405
  sourceContent = setJsonValue(sourceContent, ["servers", candidate.name], undefined);
331
406
  }
407
+ sourceContent = removeUnreferencedInputs(sourceContent, ( new Set(candidatesToMigrate.flatMap(
408
+ candidate => (candidate.environmentVariables ?? []).map(variable => variable.id)
409
+ ))));
410
+ const expectedSource = parseJsonContent(sourceContent);
332
411
  let writtenTarget;
333
412
  const migrationGroup = {
334
413
  ...group,
@@ -368,7 +447,7 @@ async function migrateGroup(group, fileService, logService, configurationResolve
368
447
  targetContent,
369
448
  fileService,
370
449
  logService,
371
- configurationResolverService
450
+ services
372
451
  );
373
452
  }
374
453
  return {
@@ -386,7 +465,7 @@ async function migrateGroup(group, fileService, logService, configurationResolve
386
465
  writtenSource = await writeDocument(group.sourceUri, sourceContent, source, fileService, beforeWrite);
387
466
  } catch (error) {
388
467
  const sourceChangedBeforeWrite = error instanceof McpServerDocumentChangedError;
389
- if (sourceChangedBeforeWrite && (await isConcurrentMigrationComplete(migrationGroup, fileService))) {
468
+ if (sourceChangedBeforeWrite && (await isConcurrentMigrationComplete(migrationGroup, expectedSource, fileService))) {
390
469
  logService.info(`${LOG_PREFIX} Concurrent migration already completed for ${( group.sourceUri.toString())}; retaining ${( group.targetUri.toString())}.`);
391
470
  return {
392
471
  migratedCount: candidatesToMigrate.length,
@@ -412,7 +491,7 @@ async function migrateGroup(group, fileService, logService, configurationResolve
412
491
  targetContent,
413
492
  fileService,
414
493
  logService,
415
- configurationResolverService
494
+ services
416
495
  );
417
496
  } catch (rollbackError) {
418
497
  throw rollbackErrorWith(error, rollbackError, group.sourceUri);
@@ -427,7 +506,7 @@ async function migrateGroup(group, fileService, logService, configurationResolve
427
506
  ));
428
507
  }
429
508
  try {
430
- await verifyMigration(group, candidatesToMigrate, fileService);
509
+ await verifyMigration(group, candidatesToMigrate, expectedSource, fileService);
431
510
  } catch (verificationError) {
432
511
  logService.trace(`${LOG_PREFIX} Verification failed for ${( group.sourceUri.toString())}; rolling both files back.`);
433
512
  const rollbackErrors = [];
@@ -447,7 +526,7 @@ async function migrateGroup(group, fileService, logService, configurationResolve
447
526
  targetContent,
448
527
  fileService,
449
528
  logService,
450
- configurationResolverService
529
+ services
451
530
  );
452
531
  } catch (error) {
453
532
  rollbackErrors.push(toError(error));
@@ -478,21 +557,15 @@ async function migrateGroup(group, fileService, logService, configurationResolve
478
557
  failures
479
558
  };
480
559
  }
481
- async function isConcurrentMigrationComplete(group, fileService) {
560
+ async function isConcurrentMigrationComplete(group, expectedSource, fileService) {
482
561
  try {
483
- const sourceServers = getObjectProperty((await readSourceDocument(group.sourceUri, fileService)).value, "servers");
562
+ const source = await readSourceDocument(group.sourceUri, fileService);
484
563
  const targetServers = getTargetServers(
485
564
  await readTargetDocument(group.targetUri, fileService, group.storage === PromptsStorage.user)
486
565
  );
487
- if (!sourceServers) {
488
- return false;
489
- }
490
- for (const candidate of group.candidates) {
491
- if (Object.hasOwn(sourceServers, candidate.name) || !Object.hasOwn(targetServers, candidate.name) || !isEquivalentTargetConfiguration(targetServers[candidate.name], candidate)) {
492
- return false;
493
- }
494
- }
495
- return true;
566
+ return equals(source.value, expectedSource) && group.candidates.every(
567
+ candidate => Object.hasOwn(targetServers, candidate.name) && isEquivalentTargetConfiguration(targetServers[candidate.name], candidate)
568
+ );
496
569
  } catch {
497
570
  return false;
498
571
  }
@@ -520,13 +593,16 @@ async function restoreSourceAfterFailedWrite(resource, original, attemptedConten
520
593
  throw ( new Error(`Could not verify restored MCP configuration ${( resource.toString())}.`));
521
594
  }
522
595
  }
523
- async function verifyMigration(group, candidates, fileService) {
596
+ async function verifyMigration(group, candidates, expectedSource, fileService) {
524
597
  const source = await readSourceDocument(group.sourceUri, fileService);
525
- const sourceServers = getObjectProperty(source.value, "servers");
526
- const target = await readTargetDocument(group.targetUri, fileService, group.storage === PromptsStorage.user);
527
- const targetServers = getTargetServers(target);
598
+ if (!equals(source.value, expectedSource)) {
599
+ throw ( new Error(`MCP configuration ${( group.sourceUri.toString())} changed during migration.`));
600
+ }
601
+ const targetServers = getTargetServers(
602
+ await readTargetDocument(group.targetUri, fileService, group.storage === PromptsStorage.user)
603
+ );
528
604
  for (const candidate of candidates) {
529
- if (sourceServers?.[candidate.name] !== undefined || !isEquivalentTargetConfiguration(targetServers[candidate.name], candidate)) {
605
+ if (!isEquivalentTargetConfiguration(targetServers[candidate.name], candidate)) {
530
606
  throw ( new Error(`MCP server '${candidate.name}' changed during migration.`));
531
607
  }
532
608
  }
@@ -592,7 +668,21 @@ function getTargetServers(target) {
592
668
  return target.wrapped ? getObjectProperty(target.value, "mcpServers") ?? {} : target.value;
593
669
  }
594
670
  function getTargetConfiguration(candidate) {
595
- return toCopilotMcpServerConfiguration(getMigratedConfiguration(candidate));
671
+ const migrated = getMigratedConfiguration(candidate);
672
+ return toCopilotMcpServerConfiguration(candidate.oauth && migrated.type === McpServerType.REMOTE ? {
673
+ ...migrated,
674
+ oauth: {
675
+ clientId: candidate.oauth.clientId
676
+ }
677
+ } : migrated);
678
+ }
679
+ async function hasOAuthClientSecret(oauth, rawConfiguration, secretStorageService) {
680
+ const rawUrl = isJsonObject(rawConfiguration) ? rawConfiguration.url : undefined;
681
+ if (typeof rawUrl !== "string" || !rawUrl) {
682
+ return false;
683
+ }
684
+ const serverUrl = ( ( URI.parse(rawUrl)).toString(true));
685
+ return !!(await secretStorageService.get(mcpOAuthClientSecretStorageKey(serverUrl, oauth.clientId)));
596
686
  }
597
687
  function getMigratedConfiguration(candidate) {
598
688
  return candidate.migratedConfiguration ?? candidate.projectedConfiguration;
@@ -606,7 +696,10 @@ function isEquivalentTargetConfiguration(raw, candidate) {
606
696
  args: []
607
697
  } : {}),
608
698
  tools: ["*"],
609
- ...raw
699
+ ...raw,
700
+ ...(raw.type === "local" ? {
701
+ type: McpServerType.LOCAL
702
+ } : {})
610
703
  }, getTargetConfiguration(candidate));
611
704
  }
612
705
  async function writeDocument(resource, content, document, fileService, beforeWrite) {
@@ -644,7 +737,7 @@ async function rollbackTarget(
644
737
  writtenContent,
645
738
  fileService,
646
739
  logService,
647
- configurationResolverService
740
+ services
648
741
  ) {
649
742
  const resource = group.targetUri;
650
743
  const current = await fileService.readFile(resource);
@@ -659,19 +752,21 @@ async function rollbackTarget(
659
752
  const addedCandidates = group.candidates.filter(candidate => !Object.hasOwn(originalServers, candidate.name));
660
753
  await writeExistingDocument(resource, original.content, writtenContent, fileService, async () => {
661
754
  try {
662
- const sourceServers = getObjectProperty((await readSourceDocument(group.sourceUri, fileService)).value, "servers");
663
- if (!sourceServers) {
755
+ const sourceFile = getMcpSourceFile((await readSourceDocument(group.sourceUri, fileService)).value);
756
+ if (!sourceFile) {
664
757
  throw ( new Error(`Source ${( group.sourceUri.toString())} no longer contains all entries added to ${( resource.toString())}.`));
665
758
  }
759
+ const sourceServers = sourceFile.servers;
666
760
  for (const candidate of addedCandidates) {
667
761
  if (!Object.hasOwn(sourceServers, candidate.name)) {
668
762
  throw ( new Error(`Source ${( group.sourceUri.toString())} no longer contains all entries added to ${( resource.toString())}.`));
669
763
  }
670
764
  const analysis = await analyzeSourceConfiguration(
671
765
  sourceServers[candidate.name],
766
+ sourceFile,
672
767
  group.storage === PromptsStorage.local ? dirname(group.targetUri) : undefined,
673
768
  group.storage,
674
- configurationResolverService
769
+ services
675
770
  );
676
771
  if (typeof analysis === "string" || !isAnalysisOfCandidate(analysis, candidate)) {
677
772
  throw ( new Error(`Source ${( group.sourceUri.toString())} no longer contains all entries added to ${( resource.toString())}.`));
@@ -712,9 +807,6 @@ function getObjectProperty(value, key) {
712
807
  const property = value[key];
713
808
  return isJsonObject(property) ? property : undefined;
714
809
  }
715
- function isJsonObject(value) {
716
- return typeof value === "object" && value !== null && !Array.isArray(value);
717
- }
718
810
  function canonicalizeConfiguration(configuration) {
719
811
  if (configuration.type === McpServerType.LOCAL) {
720
812
  return {
@@ -753,7 +845,7 @@ function isConfigurationRepresentable(configuration) {
753
845
  if (configuration.type === McpServerType.LOCAL) {
754
846
  return configuration.envFile === undefined && configuration.cwd === undefined && configuration.sandboxEnabled !== true && (!configuration.env || ( Object.values(configuration.env)).every(value => value !== null));
755
847
  }
756
- return configuration.oauth === undefined && configuration.transport !== "sse";
848
+ return configuration.transport !== "sse";
757
849
  }
758
850
  function canonicalizeSourceConfiguration(rawConfiguration) {
759
851
  if (!isJsonObject(rawConfiguration)) {
@@ -774,18 +866,56 @@ function canonicalizeSourceConfiguration(rawConfiguration) {
774
866
  }
775
867
  return canonicalizeConfiguration(configuration);
776
868
  }
777
- async function analyzeSourceConfiguration(rawConfiguration, root, storage, configurationResolverService) {
869
+ async function analyzeSourceConfiguration(rawConfiguration, sourceFile, root, storage, services) {
778
870
  const configuration = canonicalizeSourceConfiguration(rawConfiguration);
779
- if (!configuration) {
871
+ if (!configuration || !isJsonObject(rawConfiguration)) {
780
872
  return normalizeMcpServerConfiguration(rawConfiguration) ? McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration : McpServerCustomizationMigrationFailureReason.InvalidSource;
781
873
  }
874
+ const oauth = getSourceOAuthClient(rawConfiguration);
875
+ if (typeof oauth === "string") {
876
+ return oauth;
877
+ }
878
+ const analysis = await analyzeSourceConnection(configuration, sourceFile, root, storage, services);
879
+ return typeof analysis === "string" || oauth.clientId === undefined ? analysis : {
880
+ ...analysis,
881
+ oauthClientId: oauth.clientId
882
+ };
883
+ }
884
+ function getSourceOAuthClient(rawConfiguration) {
885
+ const oauth = rawConfiguration.oauth;
886
+ if (oauth === undefined) {
887
+ return {};
888
+ }
889
+ if (!isJsonObject(oauth) || ( ( Object.keys(oauth)).some(key => key !== "clientId" && key !== "enterpriseManaged")) || (oauth.clientId !== undefined && typeof oauth.clientId !== "string") || (oauth.enterpriseManaged !== undefined && typeof oauth.enterpriseManaged !== "boolean")) {
890
+ return McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
891
+ }
892
+ if (oauth.enterpriseManaged === true) {
893
+ return McpServerCustomizationMigrationFailureReason.EnterpriseManagedOAuth;
894
+ }
895
+ if (typeof oauth.clientId === "string" && hasConfigurationVariable(oauth.clientId)) {
896
+ return McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
897
+ }
898
+ return oauth.clientId ? {
899
+ clientId: oauth.clientId
900
+ } : {};
901
+ }
902
+ async function analyzeSourceConnection(configuration, sourceFile, root, storage, services) {
903
+ const {
904
+ configurationResolverService
905
+ } = services;
782
906
  const isPortable = replacement => isPortableMigrationVariable(replacement.name, replacement.arg) && (!!root || replacement.name === "pathSeparator" || replacement.name === "/");
783
907
  let hasEnvironmentVariables = false;
908
+ const inputIds = ( new Set());
909
+ const settingKeys = ( new Set());
784
910
  for (const replacement of ConfigurationResolverExpression.parse(configuration).unresolved()) {
785
911
  if (replacement.name === "env") {
786
912
  hasEnvironmentVariables = true;
913
+ } else if (replacement.name === "input") {
914
+ inputIds.add(replacement.arg ?? "");
915
+ } else if (replacement.name === "config") {
916
+ settingKeys.add(replacement.arg ?? "");
787
917
  } else if (!isPortable(replacement)) {
788
- return McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
918
+ return McpServerCustomizationMigrationFailureReason.UnsupportedVariable;
789
919
  }
790
920
  }
791
921
  const folder = root ? {
@@ -793,30 +923,100 @@ async function analyzeSourceConfiguration(rawConfiguration, root, storage, confi
793
923
  name: basename(root),
794
924
  index: 0
795
925
  } : undefined;
796
- if (!hasEnvironmentVariables) {
926
+ if (!hasEnvironmentVariables && inputIds.size === 0 && settingKeys.size === 0) {
797
927
  const resolved = await resolveVariables(configuration, folder, configurationResolverService);
798
928
  return resolved ? {
799
929
  projection: resolved,
800
930
  migration: resolved
801
931
  } : McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
802
932
  }
933
+ const variables = getMigratedVariables(inputIds, sourceFile);
934
+ if (typeof variables === "string") {
935
+ return variables;
936
+ }
937
+ const settings = await getSettingVariables(settingKeys, sourceFile, folder, storage, services);
938
+ if (typeof settings === "string") {
939
+ return settings;
940
+ }
803
941
  const withEnvironmentVariables = await resolvePortableVariables(configuration, folder, isPortable, configurationResolverService);
804
942
  if (!withEnvironmentVariables) {
805
943
  return McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
806
944
  }
807
- const migration = rewriteEnvironmentVariables(withEnvironmentVariables);
945
+ const migration = rewriteEnvironmentVariables(withEnvironmentVariables, variables, settings.variables);
808
946
  if (typeof migration === "string") {
809
947
  return migration;
810
948
  }
811
- if (await hasVariablesInEnvironmentValues(configuration, folder, configurationResolverService)) {
949
+ if (hasEnvironmentVariables && (await hasVariablesInEnvironmentValues(configuration, folder, configurationResolverService))) {
812
950
  return McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
813
951
  }
952
+ const settingVariables = {
953
+ ...(settings.variables.length > 0 ? {
954
+ settingVariables: settings.variables
955
+ } : {}),
956
+ ...(settings.valueVariables.size > 0 ? {
957
+ settingValueVariables: settings.valueVariables
958
+ } : {})
959
+ };
960
+ if (variables.length > 0 || (!settings.resolvable && storage === PromptsStorage.local)) {
961
+ return {
962
+ projection: configuration,
963
+ migration,
964
+ ...(variables.length > 0 ? {
965
+ environmentVariables: variables
966
+ } : {}),
967
+ ...settingVariables,
968
+ projectedAsWritten: true
969
+ };
970
+ }
814
971
  const projection = storage === PromptsStorage.user ? withEnvironmentVariables : await resolveVariables(configuration, folder, configurationResolverService);
815
972
  return projection ? {
816
973
  projection,
817
- migration
974
+ migration,
975
+ ...settingVariables
818
976
  } : McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
819
977
  }
978
+ async function getSettingVariables(settingKeys, sourceFile, folder, storage, services) {
979
+ const names = getMigratedSettingNames(settingKeys, sourceFile);
980
+ if (typeof names === "string") {
981
+ return names;
982
+ }
983
+ const variables = [];
984
+ const valueVariables = ( new Set());
985
+ let resolvable = true;
986
+ for (const {
987
+ key,
988
+ name
989
+ } of names) {
990
+ const expression = ConfigurationResolverExpression.parse(`\${config:${key}}`);
991
+ try {
992
+ await services.configurationResolverService.resolveAsync(folder, expression);
993
+ resolvable &&= Iterable.isEmpty(expression.unresolved());
994
+ for (const variable of getConfigurationVariables(expression.toObject())) {
995
+ valueVariables.add(variable.id);
996
+ }
997
+ } catch {
998
+ resolvable = false;
999
+ }
1000
+ const inspected = key ? services.configurationService.inspect(key, folder ? {
1001
+ resource: folder.uri
1002
+ } : {}) : undefined;
1003
+ const rawValue = inspected && (storage === PromptsStorage.user || isWorkspaceSettingValue(inspected)) ? inspected.value : undefined;
1004
+ const value = typeof rawValue === "string" || typeof rawValue === "number" ? String(rawValue) : "";
1005
+ variables.push({
1006
+ key,
1007
+ name,
1008
+ value: hasConfigurationVariable(value) || hasEnvVarReferences(value) ? "" : value
1009
+ });
1010
+ }
1011
+ return {
1012
+ variables,
1013
+ resolvable,
1014
+ valueVariables
1015
+ };
1016
+ }
1017
+ function isWorkspaceSettingValue(inspected) {
1018
+ return inspected.policyValue === undefined && inspected.memoryValue === undefined && (inspected.workspaceFolderValue !== undefined || inspected.workspaceValue !== undefined);
1019
+ }
820
1020
  function isAnalysisOfCandidate(analysis, candidate) {
821
1021
  return equals(
822
1022
  analysis.projection,
@@ -824,10 +1024,13 @@ function isAnalysisOfCandidate(analysis, candidate) {
824
1024
  ) && equals(
825
1025
  analysis.migration,
826
1026
  canonicalizeConfiguration(getMigratedConfiguration(candidate))
827
- );
1027
+ ) && equals(analysis.environmentVariables, candidate.environmentVariables) && equals(analysis.settingVariables, candidate.settingVariables) && analysis.oauthClientId === candidate.oauth?.clientId;
828
1028
  }
829
- function isForwardedUnresolved(replacement, storage) {
830
- return storage === PromptsStorage.user && replacement.name === "env";
1029
+ function isForwardedUnresolved(replacement, storage, projectedAsWritten) {
1030
+ if (projectedAsWritten) {
1031
+ return replacement.name === "input" || replacement.name === "env" || replacement.name === "config" || isPortableMigrationVariable(replacement.name, replacement.arg);
1032
+ }
1033
+ return storage === PromptsStorage.user && (replacement.name === "env" || replacement.name === "config");
831
1034
  }
832
1035
  async function resolveVariables(configuration, folder, configurationResolverService) {
833
1036
  const expression = ConfigurationResolverExpression.parse(configuration);
@@ -840,6 +1043,11 @@ async function resolveVariables(configuration, folder, configurationResolverServ
840
1043
  }
841
1044
  async function hasVariablesInEnvironmentValues(configuration, folder, configurationResolverService) {
842
1045
  const expression = ConfigurationResolverExpression.parse(configuration);
1046
+ for (const replacement of expression.unresolved()) {
1047
+ if (replacement.name === "config") {
1048
+ expression.resolve(replacement, "");
1049
+ }
1050
+ }
843
1051
  try {
844
1052
  await configurationResolverService.resolveAsync(folder, expression);
845
1053
  } catch {
@@ -853,7 +1061,7 @@ async function hasVariablesInEnvironmentValues(configuration, folder, configurat
853
1061
  async function resolvePortableVariables(configuration, folder, isPortable, configurationResolverService) {
854
1062
  const expression = ConfigurationResolverExpression.parse(configuration);
855
1063
  for (const replacement of expression.unresolved()) {
856
- if (replacement.name === "env") {
1064
+ if (replacement.name === "env" || replacement.name === "input" || replacement.name === "config") {
857
1065
  continue;
858
1066
  }
859
1067
  if (!isPortable(replacement)) {
@@ -872,17 +1080,61 @@ async function resolvePortableVariables(configuration, folder, isPortable, confi
872
1080
  }
873
1081
  return expression.toObject();
874
1082
  }
875
- function rewriteEnvironmentVariables(configuration) {
1083
+ function rewriteEnvironmentVariables(configuration, variables, settingVariables) {
876
1084
  const names = ( Object.keys(
877
1085
  (configuration.type === McpServerType.LOCAL ? configuration.env : configuration.headers) ?? {}
878
1086
  ));
879
- if (( names.some(hasEnvironmentVariableReference))) {
1087
+ if (( names.some(hasMigratedVariableReference))) {
880
1088
  return McpServerCustomizationMigrationFailureReason.EnvironmentVariableInName;
881
1089
  }
1090
+ const declaresVariables = configuration.type === McpServerType.LOCAL;
1091
+ const inputs = ( new Map(variables.map(variable => [variable.id, variable])));
1092
+ const settings = ( new Map(settingVariables.map(setting => [setting.key, setting])));
882
1093
  const failures = [];
883
- const rewrite = value => {
1094
+ const referencedSettings = ( new Set());
1095
+ const rewrite = (value, isEnvironmentValue = false) => {
884
1096
  let rewritten = false;
885
- const result = replaceConfigurationVariables(value, variable => {
1097
+ const defaults = [];
1098
+ const withDefault = (offset, name, defaultValue, failure) => {
1099
+ const reference = `\${${name}:-${defaultValue}}`;
1100
+ defaults.push({
1101
+ offset,
1102
+ reference,
1103
+ name,
1104
+ defaultValue,
1105
+ failure
1106
+ });
1107
+ return reference;
1108
+ };
1109
+ const result = replaceConfigurationVariables(value, (variable, offset) => {
1110
+ if (variable.name === "input") {
1111
+ const input = variable.arg !== undefined ? inputs.get(variable.arg) : undefined;
1112
+ if (!input) {
1113
+ failures.push(McpServerCustomizationMigrationFailureReason.UnsupportedInputType);
1114
+ return variable.id;
1115
+ }
1116
+ rewritten = true;
1117
+ const defaultValue = input.declaration.default;
1118
+ return defaultValue === undefined || declaresVariables ? `\${${input.name}}` : withDefault(
1119
+ offset,
1120
+ input.name,
1121
+ defaultValue,
1122
+ McpServerCustomizationMigrationFailureReason.UnsupportedInputDefault
1123
+ );
1124
+ }
1125
+ if (variable.name === "config") {
1126
+ const setting = settings.get(variable.arg ?? "");
1127
+ if (!setting) {
1128
+ failures.push(McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration);
1129
+ return variable.id;
1130
+ }
1131
+ rewritten = true;
1132
+ if (isEnvironmentValue) {
1133
+ return setting.value;
1134
+ }
1135
+ referencedSettings.add(setting.key);
1136
+ return declaresVariables || setting.value === "" ? `\${${setting.name}}` : `\${${setting.name}:-${setting.value}}`;
1137
+ }
886
1138
  if (variable.name !== "env") {
887
1139
  failures.push(McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration);
888
1140
  } else if (variable.arg === undefined || !environmentVariableNamePattern.test(variable.arg)) {
@@ -899,24 +1151,51 @@ function rewriteEnvironmentVariables(configuration) {
899
1151
  failures.push(
900
1152
  McpServerCustomizationMigrationFailureReason.EnvironmentVariableValueTooLong
901
1153
  );
1154
+ } else {
1155
+ const broken = defaults.find((
1156
+ {
1157
+ offset,
1158
+ reference,
1159
+ name,
1160
+ defaultValue
1161
+ }
1162
+ ) => !isDefaultReferenceIntact(result, offset, reference, name, defaultValue));
1163
+ if (broken) {
1164
+ failures.push(broken.failure);
1165
+ }
902
1166
  }
903
1167
  return result;
904
1168
  };
905
1169
  let migration;
906
1170
  if (configuration.type === McpServerType.LOCAL) {
907
- if (configuration.cwd !== undefined && hasEnvironmentVariableReference(configuration.cwd)) {
1171
+ if (configuration.cwd !== undefined && hasMigratedVariableReference(configuration.cwd)) {
908
1172
  return McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration;
909
1173
  }
1174
+ const command = rewrite(configuration.command);
1175
+ const args = configuration.args?.map(arg => rewrite(arg));
1176
+ const env = configuration.env ? Object.fromEntries(Object.entries(configuration.env).map(
1177
+ ([name, value]) => [name, typeof value === "string" ? rewrite(value, true) : value]
1178
+ )) : {};
1179
+ const declared = declareEnvironmentVariables(env, [...variables.map(input => ({
1180
+ name: input.name,
1181
+ value: input.declaration.default ?? "",
1182
+ invalidValue: McpServerCustomizationMigrationFailureReason.UnsupportedInputDefault
1183
+ })), ...settingVariables.filter(setting => ( referencedSettings.has(setting.key))).map(setting => ({
1184
+ name: setting.name,
1185
+ value: setting.value,
1186
+ invalidValue: McpServerCustomizationMigrationFailureReason.UnrepresentableConfiguration
1187
+ }))]);
1188
+ if (typeof declared === "string") {
1189
+ failures.push(declared);
1190
+ }
910
1191
  migration = {
911
1192
  ...configuration,
912
- command: rewrite(configuration.command),
913
- ...(configuration.args ? {
914
- args: configuration.args.map(rewrite)
1193
+ command,
1194
+ ...(args ? {
1195
+ args
915
1196
  } : {}),
916
- ...(configuration.env ? {
917
- env: Object.fromEntries(Object.entries(configuration.env).map(
918
- ([name, value]) => [name, typeof value === "string" ? rewrite(value) : value]
919
- ))
1197
+ ...(typeof declared !== "string" && ( Object.keys(declared)).length > 0 ? {
1198
+ env: declared
920
1199
  } : {})
921
1200
  };
922
1201
  } else {
@@ -938,33 +1217,31 @@ function rewriteEnvironmentVariables(configuration) {
938
1217
  }
939
1218
  return failures[0] ?? migration;
940
1219
  }
941
- const environmentVariableNamePattern = /^[A-Za-z_][A-Za-z0-9_]*$/;
942
- function hasEnvironmentVariableReference(value) {
943
- let found = false;
944
- replaceConfigurationVariables(value, variable => {
945
- found ||= variable.name === "env";
946
- return variable.id;
947
- });
948
- return found;
949
- }
950
- function replaceConfigurationVariables(value, replace) {
951
- let result = "";
952
- let copied = 0;
953
- let position = 0;
954
- while (position < value.length) {
955
- const start = ( value.indexOf("${", position));
956
- if (start === -1) {
957
- break;
1220
+ function declareEnvironmentVariables(env, declarations) {
1221
+ const result = {
1222
+ ...env
1223
+ };
1224
+ for (const {
1225
+ name,
1226
+ value,
1227
+ invalidValue
1228
+ } of declarations) {
1229
+ if (hasEnvVarReferences(value)) {
1230
+ return invalidValue;
958
1231
  }
959
- const parsed = parseConfigurationVariable(value, start);
960
- if (!parsed) {
961
- position = start + 2;
962
- continue;
1232
+ const existing = ( Object.keys(result)).find(key => key.toUpperCase() === name.toUpperCase());
1233
+ if (existing !== undefined && (existing !== name || (result[existing] !== `\${${name}}` && result[existing] !== value))) {
1234
+ return McpServerCustomizationMigrationFailureReason.VariableNameCollision;
963
1235
  }
964
- result += value.slice(copied, start) + replace(parsed.replacement);
965
- copied = position = parsed.end + 1;
1236
+ result[name] = value;
966
1237
  }
967
- return result + value.slice(copied);
1238
+ return result;
1239
+ }
1240
+ function hasMigratedVariableReference(value) {
1241
+ return ( Iterable.some(
1242
+ getConfigurationVariables(value),
1243
+ variable => variable.name === "env" || variable.name === "input" || variable.name === "config"
1244
+ ));
968
1245
  }
969
1246
  function isPortableMigrationVariable(name, argument) {
970
1247
  if (name === "pathSeparator" || name === "/") {
@@ -985,6 +1262,7 @@ function hasOnlyRepresentableProperties(rawConfiguration, type) {
985
1262
  "transport",
986
1263
  "url",
987
1264
  "headers",
1265
+ "oauth",
988
1266
  ...mcpServerCustomizationMigrationRemovableProperties.filter(property => property !== "sandboxEnabled")
989
1267
  ]));
990
1268
  return ( Object.keys(rawConfiguration)).every(key => ( allowed.has(key)));