@codingame/monaco-vscode-chat-service-override 37.0.0 → 37.1.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 (324) hide show
  1. package/index.js +11 -0
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +1 -1
  4. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.d.ts +74 -0
  5. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +90 -0
  6. package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.d.ts +8 -0
  7. package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.js +16 -0
  8. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +53 -53
  9. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.d.ts +16 -0
  10. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.js +14 -0
  11. package/vscode/src/vs/platform/agentHost/common/agentMerge.js +7 -7
  12. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.d.ts +24 -0
  13. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.js +13 -0
  14. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +22 -0
  15. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +21 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.d.ts +114 -0
  17. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +56 -0
  18. package/vscode/src/vs/platform/agentHost/common/changesetUri.js +15 -1
  19. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.d.ts +73 -0
  20. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +141 -0
  21. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +42 -1
  22. package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.d.ts +27 -0
  23. package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.js +14 -0
  24. package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.d.ts +14 -0
  25. package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.js +11 -0
  26. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +13 -13
  27. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +1 -1
  28. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +4 -1
  29. package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.d.ts +4 -0
  30. package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.js +6 -0
  31. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
  32. package/vscode/src/vs/workbench/browser/chatChangesPill.js +2 -2
  33. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +28 -28
  34. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
  35. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +18 -18
  36. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +3 -3
  37. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  38. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  39. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +11 -11
  40. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  41. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  42. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  43. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +13 -13
  45. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  46. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +28 -28
  47. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
  48. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +18 -18
  49. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  50. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +93 -93
  51. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  53. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  54. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
  55. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +7 -7
  56. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +7 -7
  58. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  59. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  60. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  61. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +12 -12
  62. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  63. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +14 -14
  64. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  65. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -15
  66. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  67. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  68. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +32 -32
  69. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +9 -9
  70. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +5 -5
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
  72. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
  73. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  74. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -12
  75. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +15 -15
  76. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.d.ts +34 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +229 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +57 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +460 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.d.ts +1 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +92 -0
  82. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.d.ts +23 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.js +46 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.d.ts +142 -0
  85. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +746 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.d.ts +77 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +474 -0
  88. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.d.ts +169 -0
  89. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.js +261 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.d.ts +20 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +90 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.d.ts +35 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.js +73 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.d.ts +20 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.js +61 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +112 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +192 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
  99. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.d.ts +21 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +137 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +301 -12
  102. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +84 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.js +96 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.d.ts +884 -0
  105. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +5868 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +19 -19
  107. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.d.ts +27 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +129 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.d.ts +42 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +221 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +125 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +345 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +1 -1
  114. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.d.ts +1 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +68 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.d.ts +62 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +163 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.d.ts +54 -0
  119. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +219 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.d.ts +10 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.js +50 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.d.ts +42 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +132 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.d.ts +1 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +85 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +79 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +161 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.d.ts +18 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +13 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.d.ts +28 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.js +71 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.d.ts +35 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +205 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +1 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +50 -50
  136. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +3 -3
  137. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  139. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  140. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  141. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +22 -22
  142. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  143. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  144. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +6 -6
  145. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +7 -7
  146. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +3 -3
  147. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -15
  148. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +126 -126
  149. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +44 -44
  150. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +137 -137
  151. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +3 -3
  152. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +6 -6
  153. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +37 -37
  154. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +1 -1
  155. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +1 -1
  156. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +6 -6
  157. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +145 -145
  158. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +29 -29
  159. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +9 -9
  160. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +40 -40
  161. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +7 -7
  162. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +8 -8
  163. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +5 -5
  164. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +75 -75
  165. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +115 -115
  166. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +4 -4
  167. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +50 -50
  168. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +344 -344
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +37 -37
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +5 -5
  172. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  173. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +124 -124
  174. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  175. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  176. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +3 -3
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  179. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  180. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  181. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  182. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  183. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
  184. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  185. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  186. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  187. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  188. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +35 -35
  189. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  190. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +40 -40
  191. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  192. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  193. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  194. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  195. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  196. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  197. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  198. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  199. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
  200. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
  201. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  202. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +2 -2
  203. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +3 -3
  204. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  205. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  206. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +63 -63
  207. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  209. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +12 -12
  210. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +1 -1
  211. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +35 -35
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +1 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +25 -25
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  216. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +19 -19
  217. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  218. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  219. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +26 -26
  220. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -16
  221. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +20 -20
  222. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +62 -62
  223. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +10 -10
  224. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
  225. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +1 -1
  226. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +7 -7
  227. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  228. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  229. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  230. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  231. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  232. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +6 -6
  233. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +6 -6
  234. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +27 -27
  235. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
  236. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  237. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +2 -2
  238. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
  239. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  240. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  241. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  242. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  243. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  244. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  245. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  246. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  247. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +5 -5
  248. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
  249. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +4 -4
  250. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +3 -3
  251. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +1 -1
  252. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +3 -3
  253. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  254. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +18 -18
  255. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +2 -2
  256. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +10 -10
  257. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  258. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +25 -25
  259. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +8 -8
  260. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
  261. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  262. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  263. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +1 -1
  264. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +17 -17
  265. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
  266. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +11 -11
  267. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +10 -10
  269. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
  270. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +3 -3
  271. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  272. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
  273. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +11 -11
  274. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  275. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +8 -8
  276. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
  277. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +12 -12
  278. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  279. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
  280. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  281. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  282. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +154 -154
  283. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +9 -9
  284. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  285. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  286. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  287. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  288. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  289. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  290. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +1 -1
  291. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  292. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  297. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  298. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +10 -10
  299. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  300. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  301. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  302. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
  303. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
  304. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  305. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  311. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  312. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  313. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +73 -73
  314. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  315. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  316. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  317. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  318. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  319. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +4 -4
  320. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +3 -3
  321. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.d.ts +0 -30
  322. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.js +0 -87
  323. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +0 -205
  324. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +0 -1580
@@ -1,19 +1,50 @@
1
1
 
2
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
3
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
2
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
3
+ import { LRUCache } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
4
4
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
5
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
6
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
7
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/charCode';
8
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/marshallingIds';
9
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
10
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
11
- import '../../../../../../platform/agentHost/common/changesetUri.js';
5
+ import { isEqual, getComparisonKey, isEqualOrParent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
6
+ import { isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
7
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
8
+ import { ChangesetKind, buildTurnChangesetUri, buildBranchChangesetUri } from '../../../../../../platform/agentHost/common/changesetUri.js';
12
9
  import { normalizeFileEdit } from '@codingame/monaco-vscode-katex-common/vscode/vs/platform/agentHost/common/fileEditDiff';
13
10
  import { toAgentHostUri, toAgentHostContentUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
14
- import { FileEditKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
15
- import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
11
+ import { FileEditKind, StateComponents, readSessionEhcliLastMigratedTurn, buildDefaultChatUri, isHostNoticeTurn } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
12
+ import { AUTHORITATIVE_EMPTY_CHAT_RESPONSE_FILE_CHANGES } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/chatResponseFileChangesService';
13
+ import { derived, derivedOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
14
+ import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
15
+ import { derivedObservableWithCache, mapObservableArrayCached } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/utils';
16
+ import { ChangesetStatus } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/state';
17
+ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
18
+ import { ToolCallStatus, ToolResultContentType, ResponsePartKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
16
19
 
20
+ const SUBSCRIPTION_OWNER = "AgentHostResponseFileChangesProvider";
21
+ const REQUEST_CACHE_CAPACITY = 1000;
22
+ const EMPTY_RESPONSE_FILE_EDITS = {
23
+ diffs: [],
24
+ hasValidEdits: false,
25
+ isHostNotice: false
26
+ };
27
+ const HOST_NOTICE_RESPONSE_FILE_EDITS = {
28
+ diffs: [],
29
+ hasValidEdits: false,
30
+ isHostNotice: true
31
+ };
32
+ function uriArrayEquals(a, b) {
33
+ return a.length === b.length && a.every((uri, index) => isEqual(uri, b[index]));
34
+ }
35
+ function getToolCallFileEdits(toolCall) {
36
+ const edits = [];
37
+ if (toolCall.status === ToolCallStatus.Running || toolCall.status === ToolCallStatus.Completed || toolCall.status === ToolCallStatus.PendingResultConfirmation) {
38
+ for (const content of toolCall.content ?? []) {
39
+ if (content.type === ToolResultContentType.FileEdit) {
40
+ edits.push(content);
41
+ }
42
+ }
43
+ } else if (toolCall.status === ToolCallStatus.PendingConfirmation) {
44
+ edits.push(...(toolCall.edits?.items ?? []));
45
+ }
46
+ return edits;
47
+ }
17
48
  function agentHostChangesetFileToEntryDiff(file, connectionAuthority) {
18
49
  const normalized = normalizeFileEdit(file.edit);
19
50
  if (!normalized) {
@@ -36,5 +67,263 @@ function agentHostChangesetFileToEntryDiff(file, connectionAuthority) {
36
67
  isBusy: false
37
68
  };
38
69
  }
70
+ class AgentHostResponseFileChangesProvider extends Disposable {
71
+ constructor(
72
+ _connection,
73
+ _connectionAuthority,
74
+ _resolveBackendSession,
75
+ _resolveBackendChat,
76
+ _logService
77
+ ) {
78
+ super();
79
+ this._connection = _connection;
80
+ this._connectionAuthority = _connectionAuthority;
81
+ this._resolveBackendSession = _resolveBackendSession;
82
+ this._resolveBackendChat = _resolveBackendChat;
83
+ this._logService = _logService;
84
+ this._perRequest = ( new LRUCache(REQUEST_CACHE_CAPACITY));
85
+ this._perRequestFileEdits = ( new LRUCache(REQUEST_CACHE_CAPACITY));
86
+ }
87
+ getChangesForRequest(sessionResource, requestId) {
88
+ const backendSession = this._resolveBackendSession(sessionResource);
89
+ if (!backendSession || !requestId) {
90
+ return undefined;
91
+ }
92
+ const backendChat = this._resolveBackendChat?.(sessionResource);
93
+ const key = `${( backendSession.toString())}\0${backendChat?.toString() ?? ""}\0${requestId}`;
94
+ let obs = this._perRequest.get(key);
95
+ if (!obs) {
96
+ obs = this._createDiffsObservable(backendSession, backendChat, requestId);
97
+ this._perRequest.set(key, obs);
98
+ }
99
+ return obs;
100
+ }
101
+ getFileEditsForRequest(sessionResource, requestId) {
102
+ const backendSession = this._resolveBackendSession(sessionResource);
103
+ if (!backendSession || !requestId) {
104
+ return undefined;
105
+ }
106
+ const backendChat = this._resolveBackendChat?.(sessionResource);
107
+ const key = `${( backendSession.toString())}\0${backendChat?.toString() ?? ""}\0${requestId}`;
108
+ let obs = this._perRequestFileEdits.get(key);
109
+ if (!obs) {
110
+ const fileEdits = this._createFileEditDiffsObservable(backendSession, backendChat, requestId);
111
+ obs = derived(reader => fileEdits.read(reader).diffs);
112
+ this._perRequestFileEdits.set(key, obs);
113
+ }
114
+ return obs;
115
+ }
116
+ _createDiffsObservable(backendSession, backendChat, requestId) {
117
+ const sessionStateObs = this._subscribe(StateComponents.Session, constObservable(backendSession));
118
+ const turnChangesetUriObs = derivedOpts({
119
+ equalsFn: isEqual
120
+ }, reader => {
121
+ const sessionState = sessionStateObs.read(reader).read(reader);
122
+ if (!sessionState || sessionState instanceof Error) {
123
+ return undefined;
124
+ }
125
+ const supportsTurnChangeset = sessionState.changesets?.some(c => c.changeKind === ChangesetKind.Turn);
126
+ if (!supportsTurnChangeset) {
127
+ return undefined;
128
+ }
129
+ return ( URI.parse(buildTurnChangesetUri(( backendSession.toString()), requestId)));
130
+ });
131
+ const changesetStateObs = this._subscribe(StateComponents.Changeset, turnChangesetUriObs);
132
+ const responseFileEditsObs = this._createFileEditDiffsObservable(backendSession, backendChat, requestId);
133
+ const branchFallbackObs = this._createBranchFallbackDiffsObservable(backendSession, requestId);
134
+ let lastSource;
135
+ const select = (source, diffs, status) => {
136
+ if (source !== lastSource) {
137
+ lastSource = source;
138
+ this._logService.trace(`[AgentHostResponseFileChanges] ${( backendSession.toString())} turn ${requestId}: diffs from '${source}' (files=${diffs.length}, changesetStatus=${status ?? "none"})`);
139
+ }
140
+ return diffs;
141
+ };
142
+ return derivedObservableWithCache(this, (reader, lastValue) => {
143
+ const retained = lastValue ?? [];
144
+ const responseFileEdits = responseFileEditsObs.read(reader);
145
+ if (responseFileEdits.isHostNotice) {
146
+ return select("hostNotice", AUTHORITATIVE_EMPTY_CHAT_RESPONSE_FILE_CHANGES);
147
+ }
148
+ const turnUri = turnChangesetUriObs.read(reader);
149
+ const changesetState = turnUri ? changesetStateObs.read(reader).read(reader) : undefined;
150
+ const changeset = changesetState instanceof Error ? undefined : changesetState;
151
+ const changesetDiffs = changeset?.files.map(file => agentHostChangesetFileToEntryDiff(file, this._connectionAuthority)).filter(isDefined);
152
+ if (changesetDiffs?.length) {
153
+ return select("changeset", changesetDiffs, changeset?.status);
154
+ }
155
+ const branchDiffs = branchFallbackObs.read(reader);
156
+ if (branchDiffs.length) {
157
+ return select("branchFallback", branchDiffs, changeset?.status);
158
+ }
159
+ if (!turnUri) {
160
+ return select("unsupported", retained);
161
+ }
162
+ if (changeset?.status === ChangesetStatus.Ready && retained.length === 0) {
163
+ return select(
164
+ "authoritativeEmpty",
165
+ AUTHORITATIVE_EMPTY_CHAT_RESPONSE_FILE_CHANGES,
166
+ changeset.status
167
+ );
168
+ }
169
+ return responseFileEdits.hasValidEdits ? select(
170
+ "response",
171
+ responseFileEdits.diffs.length > 0 ? responseFileEdits.diffs : AUTHORITATIVE_EMPTY_CHAT_RESPONSE_FILE_CHANGES,
172
+ changeset?.status
173
+ ) : select("retained", retained, changeset?.status);
174
+ });
175
+ }
176
+ _createBranchFallbackDiffsObservable(backendSession, requestId) {
177
+ const sessionStateObs = this._subscribe(StateComponents.Session, constObservable(backendSession));
178
+ const branchChangesetUriObs = derivedOpts({
179
+ equalsFn: isEqual
180
+ }, reader => {
181
+ const sessionState = sessionStateObs.read(reader).read(reader);
182
+ if (!sessionState || sessionState instanceof Error) {
183
+ return undefined;
184
+ }
185
+ if (readSessionEhcliLastMigratedTurn(sessionState._meta) !== requestId) {
186
+ return undefined;
187
+ }
188
+ return ( URI.parse(buildBranchChangesetUri(( backendSession.toString()))));
189
+ });
190
+ const branchChangesetStateObs = this._subscribe(StateComponents.Changeset, branchChangesetUriObs);
191
+ return derived(reader => {
192
+ if (!branchChangesetUriObs.read(reader)) {
193
+ return [];
194
+ }
195
+ const state = branchChangesetStateObs.read(reader).read(reader);
196
+ const changeset = state instanceof Error ? undefined : state;
197
+ return changeset?.files.map(file => agentHostChangesetFileToEntryDiff(file, this._connectionAuthority)).filter(isDefined) ?? [];
198
+ });
199
+ }
200
+ _createFileEditDiffsObservable(backendSession, backendChat, requestId) {
201
+ const sessionStateObs = this._subscribe(StateComponents.Session, constObservable(backendSession));
202
+ const defaultChatUri = ( URI.parse(buildDefaultChatUri(( backendSession.toString()))));
203
+ const chatUrisObs = derivedOpts({
204
+ equalsFn: uriArrayEquals
205
+ }, reader => {
206
+ if (backendChat) {
207
+ return [backendChat];
208
+ }
209
+ const sessionState = sessionStateObs.read(reader).read(reader);
210
+ if (!sessionState || sessionState instanceof Error) {
211
+ return [defaultChatUri];
212
+ }
213
+ const uris = ( new Map());
214
+ uris.set(( defaultChatUri.toString()), defaultChatUri);
215
+ for (const chat of sessionState.chats ?? []) {
216
+ const uri = ( URI.parse(chat.resource));
217
+ uris.set(( uri.toString()), uri);
218
+ }
219
+ return [...( uris.values())];
220
+ });
221
+ const chatStateObs = mapObservableArrayCached(this, chatUrisObs, chatUri => {
222
+ const obs = this._subscribe(StateComponents.Chat, constObservable(chatUri));
223
+ return derived(reader => obs.read(reader).read(reader));
224
+ }, chatUri => ( chatUri.toString()));
225
+ return derived(reader => {
226
+ const sessionState = sessionStateObs.read(reader).read(reader);
227
+ const workspaceRoots = [];
228
+ if (sessionState && !(sessionState instanceof Error)) {
229
+ const roots = ( new Map());
230
+ for (const root of [sessionState.project?.uri, ...(sessionState.workingDirectories ?? [])]) {
231
+ if (root) {
232
+ const uri = ( URI.parse(root));
233
+ roots.set(( uri.toString()), uri);
234
+ }
235
+ }
236
+ workspaceRoots.push(...( roots.values()));
237
+ }
238
+ for (const obs of chatStateObs.read(reader)) {
239
+ const chatState = obs.read(reader);
240
+ if (!chatState || chatState instanceof Error) {
241
+ continue;
242
+ }
243
+ const turn = chatState.activeTurn?.id === requestId ? chatState.activeTurn : chatState.turns.find(turn => turn.id === requestId);
244
+ if (turn) {
245
+ if (turn.message?.origin && isHostNoticeTurn(turn)) {
246
+ return HOST_NOTICE_RESPONSE_FILE_EDITS;
247
+ }
248
+ return this._responsePartsToEntryDiffs(turn.responseParts, workspaceRoots);
249
+ }
250
+ }
251
+ return EMPTY_RESPONSE_FILE_EDITS;
252
+ });
253
+ }
254
+ _subscribe(component, resourceObs) {
255
+ return derived(reader => {
256
+ const resource = resourceObs.read(reader);
257
+ if (!resource) {
258
+ return constObservable(undefined);
259
+ }
260
+ const subscriptionRef = reader.store.add(this._connection.getSubscription(component, resource, SUBSCRIPTION_OWNER));
261
+ return observableFromEvent(
262
+ this,
263
+ subscriptionRef.object.onDidChange,
264
+ () => subscriptionRef.object.value
265
+ );
266
+ });
267
+ }
268
+ _responsePartsToEntryDiffs(responseParts, workspaceRoots) {
269
+ const byUri = ( new Map());
270
+ let hasValidEdits = false;
271
+ for (const responsePart of responseParts) {
272
+ if (responsePart.kind !== ResponsePartKind.ToolCall) {
273
+ continue;
274
+ }
275
+ for (const fileEdit of getToolCallFileEdits(responsePart.toolCall)) {
276
+ const diff = this._fileEditToEntryDiff(fileEdit, workspaceRoots);
277
+ if (!diff) {
278
+ continue;
279
+ }
280
+ hasValidEdits = true;
281
+ const key = getComparisonKey(diff.modifiedURI);
282
+ const existing = byUri.get(key);
283
+ if (existing) {
284
+ existing.added += diff.added;
285
+ existing.removed += diff.removed;
286
+ existing.modifiedURI = diff.modifiedURI;
287
+ existing.modifiedSnapshotURI = diff.modifiedSnapshotURI;
288
+ existing.isDeleted = diff.isDeleted;
289
+ if (existing.isCreated && existing.isDeleted) {
290
+ byUri.delete(key);
291
+ }
292
+ } else {
293
+ byUri.set(key, diff);
294
+ }
295
+ }
296
+ }
297
+ return {
298
+ diffs: [...( byUri.values())],
299
+ hasValidEdits,
300
+ isHostNotice: false
301
+ };
302
+ }
303
+ _fileEditToEntryDiff(fileEdit, workspaceRoots) {
304
+ const normalized = normalizeFileEdit(fileEdit);
305
+ if (!normalized) {
306
+ return undefined;
307
+ }
308
+ const resource = normalized.resource;
309
+ const modifiedURI = toAgentHostUri(resource, this._connectionAuthority);
310
+ const originalURI = normalized.kind === FileEditKind.Create || !normalized.beforeContentUri ? modifiedURI : toAgentHostContentUri(normalized.beforeContentUri, this._connectionAuthority);
311
+ const modifiedSnapshotURI = normalized.afterContentUri ? toAgentHostContentUri(normalized.afterContentUri, this._connectionAuthority) : undefined;
312
+ return {
313
+ originalURI,
314
+ modifiedURI,
315
+ modifiedSnapshotURI,
316
+ isCreated: normalized.kind === FileEditKind.Create,
317
+ isDeleted: normalized.kind === FileEditKind.Delete,
318
+ added: fileEdit.diff?.added ?? 0,
319
+ removed: fileEdit.diff?.removed ?? 0,
320
+ quitEarly: false,
321
+ identical: false,
322
+ isFinal: true,
323
+ isBusy: false,
324
+ isOutsideWorkspace: !( workspaceRoots.some(root => isEqualOrParent(resource, root)))
325
+ };
326
+ }
327
+ }
39
328
 
40
- export { agentHostChangesetFileToEntryDiff };
329
+ export { AgentHostResponseFileChangesProvider, agentHostChangesetFileToEntryDiff };
@@ -0,0 +1,84 @@
1
+ import { Disposable, DisposableStore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService.service";
3
+ import { AgentHostConfigKey } from "../../../../../../platform/agentHost/common/agentHostCustomizationConfig.js";
4
+ import { CopilotCliConfigKey } from "@codingame/monaco-vscode-katex-common/vscode/vs/platform/agentHost/common/copilotCliConfig";
5
+ /**
6
+ * A single root-config key managed by an {@link AgentHostRootConfigForwarder}:
7
+ * says only *what* its value is and *when* to recompute it. The forwarder owns
8
+ * the schema gate, value-equality guard, dispatch, and hydration retry.
9
+ */
10
+ export interface IForwardedRootConfigKey {
11
+ /** The root-config key this descriptor owns. */
12
+ readonly key: AgentHostConfigKey | CopilotCliConfigKey;
13
+ /** Compute the desired value; return `undefined` to skip the push. May be async. */
14
+ computeValue(): unknown | Promise<unknown>;
15
+ /** Wire up the triggers that should re-push this key; add disposables to `store`, call `push`. */
16
+ registerTriggers(store: DisposableStore, push: () => void): void;
17
+ }
18
+ /**
19
+ * Shared engine that forwards VS Code-derived values into the **local** agent
20
+ * host's root config so the host (and the CLI session launcher) can read them
21
+ * via `getRootValue`. Not a contribution itself: a workbench contribution
22
+ * constructs one with its own {@link IForwardedRootConfigKey} table and drives
23
+ * {@link start} / {@link stop} from its own enablement gate. Shared by
24
+ * `AgentHostTerminalContribution` and `AgentHostCopilotCliSettingsContribution`
25
+ * so the three correctness constraints below live in exactly one place.
26
+ *
27
+ * The three constraints forwarding into the shared root config requires:
28
+ * 1. **Schema gate.** A key is dispatched only once the host advertises it in
29
+ * its root-config schema - protects older / third-party agent hosts (and an
30
+ * older host that advertises only a subset of the keys) from receiving keys
31
+ * they don't understand.
32
+ * 2. **Hydration retry.** The host's `rootState` may hydrate *after* the
33
+ * forwarder starts, so a key whose schema isn't present yet is retried when
34
+ * the schema first appears (see {@link _onRootStateChanged}).
35
+ * 3. **Cross-window loop guard.** The local agent host's root config is shared
36
+ * across windows, so a key is dispatched only when its value actually
37
+ * changes (compared structurally - see {@link _push}). Reacting to a
38
+ * value-only change pushed by another window would otherwise start an
39
+ * infinite update war, each window forcing its own value back over the
40
+ * other's (#314385).
41
+ *
42
+ * Local agent host only. Remote agent hosts (via
43
+ * `IRemoteAgentHostService.connections`) are intentionally not fanned out to:
44
+ * e.g. a resolved shell path is local-machine-shaped and not necessarily valid
45
+ * on the remote. Remote operators should configure such values server-side via
46
+ * the remote's `agent-host-config.json`. See
47
+ * https://github.com/microsoft/vscode/issues/313160 follow-ups.
48
+ */
49
+ export declare class AgentHostRootConfigForwarder extends Disposable {
50
+ private readonly _keys;
51
+ private readonly _agentHostService;
52
+ private readonly _listeners;
53
+ /**
54
+ * Managed keys whose schema the host has already advertised, so a key is
55
+ * re-pushed only when its schema *first* appears (see {@link _onRootStateChanged}).
56
+ */
57
+ private readonly _schemaSeen;
58
+ constructor(_keys: readonly IForwardedRootConfigKey[], _agentHostService: IAgentHostService);
59
+ /**
60
+ * Begin listening for triggers / agent-host (re)starts / schema hydration and
61
+ * do the initial push. Idempotent.
62
+ */
63
+ start(): void;
64
+ /** Stop listening and forget advertised-schema state. Idempotent. */
65
+ stop(): void;
66
+ /** Push every managed key (e.g. on start and after an agent-host restart). */
67
+ reconcile(): void;
68
+ /**
69
+ * Push managed values only for keys whose schema has just transitioned from
70
+ * absent to present (host root-config hydration). Value-only changes — e.g.
71
+ * another window writing a different value — are ignored so windows don't
72
+ * fight in an infinite loop.
73
+ */
74
+ private _onRootStateChanged;
75
+ private _schemaHasKey;
76
+ /**
77
+ * Push pipeline for a managed key: no-op if the schema doesn't advertise it
78
+ * (retried on hydration); compute the value (`undefined` skips); dispatch only
79
+ * if the host doesn't already hold a structurally-equal value — which breaks
80
+ * cross-window loops (#314385) and, being structural not `===`, never
81
+ * re-dispatches an unchanged object value.
82
+ */
83
+ private _push;
84
+ }
@@ -0,0 +1,96 @@
1
+
2
+ import { structuralEquals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/equals';
3
+ import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { ActionType } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/actions';
5
+ import { ROOT_STATE_URI } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
6
+
7
+ class AgentHostRootConfigForwarder extends Disposable {
8
+ constructor(_keys, _agentHostService) {
9
+ super();
10
+ this._keys = _keys;
11
+ this._agentHostService = _agentHostService;
12
+ this._listeners = this._register(( new MutableDisposable()));
13
+ this._schemaSeen = ( new Set());
14
+ }
15
+ start() {
16
+ if (this._listeners.value) {
17
+ return;
18
+ }
19
+ const store = ( new DisposableStore());
20
+ store.add(this._agentHostService.onAgentHostStart(() => this.reconcile()));
21
+ for (const entry of this._keys) {
22
+ entry.registerTriggers(store, () => this._push(entry));
23
+ }
24
+ store.add(
25
+ this._agentHostService.rootState.onDidChange(() => this._onRootStateChanged())
26
+ );
27
+ this._schemaSeen.clear();
28
+ for (const entry of this._keys) {
29
+ if (this._schemaHasKey(entry.key)) {
30
+ this._schemaSeen.add(entry.key);
31
+ }
32
+ }
33
+ this._listeners.value = store;
34
+ this.reconcile();
35
+ }
36
+ stop() {
37
+ this._schemaSeen.clear();
38
+ this._listeners.value = undefined;
39
+ }
40
+ reconcile() {
41
+ for (const entry of this._keys) {
42
+ this._push(entry);
43
+ }
44
+ }
45
+ _onRootStateChanged() {
46
+ for (const entry of this._keys) {
47
+ if (this._schemaHasKey(entry.key)) {
48
+ if (!( this._schemaSeen.has(entry.key))) {
49
+ this._schemaSeen.add(entry.key);
50
+ this._push(entry);
51
+ }
52
+ } else {
53
+ this._schemaSeen.delete(entry.key);
54
+ }
55
+ }
56
+ }
57
+ _schemaHasKey(key) {
58
+ const rootState = this._agentHostService.rootState.value;
59
+ if (!rootState || rootState instanceof Error) {
60
+ return false;
61
+ }
62
+ return !!rootState.config?.schema.properties[key];
63
+ }
64
+ async _push(entry) {
65
+ if (!this._schemaHasKey(entry.key)) {
66
+ return;
67
+ }
68
+ let value;
69
+ try {
70
+ value = await entry.computeValue();
71
+ } catch {
72
+ return;
73
+ }
74
+ if (value === undefined) {
75
+ return;
76
+ }
77
+ if (!this._schemaHasKey(entry.key)) {
78
+ return;
79
+ }
80
+ const rootState = this._agentHostService.rootState.value;
81
+ if (!rootState || rootState instanceof Error || !rootState.config) {
82
+ return;
83
+ }
84
+ if (structuralEquals(rootState.config.values[entry.key], value)) {
85
+ return;
86
+ }
87
+ this._agentHostService.dispatch(ROOT_STATE_URI, {
88
+ type: ActionType.RootConfigChanged,
89
+ config: {
90
+ [entry.key]: value
91
+ }
92
+ });
93
+ }
94
+ }
95
+
96
+ export { AgentHostRootConfigForwarder };