@codingame/monaco-vscode-chat-service-override 30.0.1 → 31.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 (377) hide show
  1. package/index.js +21 -3
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +125 -0
  4. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +393 -0
  5. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +65 -0
  6. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +453 -0
  7. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +28 -0
  8. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +81 -0
  9. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +75 -0
  10. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +180 -0
  11. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +202 -51
  12. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +182 -0
  13. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +282 -0
  14. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +303 -32
  15. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +14 -0
  16. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +1 -1
  17. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.js +9 -0
  18. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +30 -0
  19. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +662 -0
  20. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +12 -5
  21. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +9 -0
  22. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +17 -0
  23. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +5 -0
  24. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +5 -5
  25. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +14 -0
  26. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +42 -0
  27. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.js +7 -0
  28. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +118 -0
  29. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +551 -0
  30. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +22 -0
  31. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +83 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  33. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
  34. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  35. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
  36. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  38. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +2 -1
  39. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +17 -15
  40. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +8 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +113 -9
  42. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +81 -4
  43. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +47 -26
  45. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +15 -10
  46. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  47. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  48. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +14 -14
  49. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -14
  50. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +15 -14
  51. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  52. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +5 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +58 -23
  54. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  55. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  56. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +2 -1
  57. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +24 -22
  58. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
  59. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
  60. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  61. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -1
  62. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +29 -20
  63. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +16 -16
  64. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +9 -0
  65. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +23 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
  67. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +2 -2
  68. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +65 -55
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  72. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  73. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  74. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -5
  75. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +28 -28
  76. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  77. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  78. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +10 -3
  79. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +80 -15
  80. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +20 -14
  81. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +30 -15
  82. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +131 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +363 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +31 -76
  85. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +374 -764
  86. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +8 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +11 -1
  88. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +222 -44
  89. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +20 -11
  90. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +269 -123
  91. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
  92. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +40 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +40 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +26 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +249 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +3 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +3 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +4 -3
  99. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +5 -17
  100. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +14 -1
  101. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +113 -58
  102. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +202 -68
  103. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +246 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +15 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +162 -50
  106. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +24 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +306 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +581 -257
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +15 -1
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +245 -26
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +25 -7
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +1 -1
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +3 -5
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +6 -6
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +103 -28
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +3 -2
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +11 -1
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +80 -29
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +20 -3
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +128 -65
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +28 -28
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +18 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -0
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +11 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +6 -5
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +10 -27
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +4 -41
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +4 -310
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +0 -12
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +3 -30
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -0
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +61 -53
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +0 -110
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
  153. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  154. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +46 -34
  155. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +4 -4
  156. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +17 -18
  157. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  158. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +1 -0
  159. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +96 -82
  160. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -1
  161. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +21 -14
  162. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +18 -18
  163. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +1 -1
  164. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +15 -8
  165. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +315 -263
  166. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +14 -14
  167. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +196 -24
  168. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +56 -17
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +2 -2
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +8 -4
  172. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  173. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  174. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  175. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  176. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  177. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +18 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +31 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +26 -25
  180. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +3 -1
  181. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +48 -57
  182. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  183. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  184. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
  185. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +2 -2
  186. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  187. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  188. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  189. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  190. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  191. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  192. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  193. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.d.ts +11 -6
  194. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +226 -36
  195. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.d.ts +23 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.js +82 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -1
  198. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +108 -56
  199. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +24 -24
  200. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +6 -6
  201. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
  202. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  203. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
  204. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +3 -4
  205. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +9 -16
  206. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +21 -80
  207. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +26 -59
  208. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  209. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +4 -3
  210. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +9 -1
  211. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +2 -1
  212. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +46 -14
  213. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  214. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +40 -0
  215. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.js +60 -0
  216. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +32 -5
  217. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +152 -26
  218. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +5 -9
  219. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +265 -261
  220. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +28 -2
  221. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +75 -7
  222. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +9 -1
  223. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -5
  224. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +18 -0
  225. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +32 -4
  226. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +10 -25
  227. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +7 -52
  228. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +58 -466
  229. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +3 -1
  230. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +36 -18
  231. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  232. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  233. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  234. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +0 -1
  235. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +168 -182
  236. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +49 -29
  237. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +491 -462
  238. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +16 -6
  239. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +18 -12
  240. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +24 -4
  241. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +145 -68
  242. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  243. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +2 -2
  244. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
  245. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +25 -25
  246. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  247. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +2 -4
  248. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +19 -17
  249. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -1
  250. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
  251. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +5 -17
  252. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +77 -157
  253. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  255. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  256. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  257. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  258. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  259. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +17 -17
  260. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
  261. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
  262. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
  263. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +4 -1
  264. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +29 -7
  265. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
  266. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
  267. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -3
  268. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +12 -14
  269. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
  270. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +5 -1
  271. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +49 -12
  272. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -4
  273. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +9 -8
  274. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +2 -2
  275. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +13 -8
  276. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +53 -0
  277. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +319 -0
  278. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
  279. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +8 -8
  280. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +15 -15
  281. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.d.ts +1 -1
  282. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +2 -2
  283. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +21 -0
  284. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +35 -0
  285. package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +0 -94
  286. package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +0 -16
  287. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +0 -578
  288. package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +0 -206
  289. package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +0 -114
  290. package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +0 -860
  291. package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +0 -27
  292. package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +0 -58
  293. package/vscode/src/vs/platform/browserElements/common/browserElements.js +0 -16
  294. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +0 -18
  295. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -13
  296. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/media/simpleBrowserOverlay.css +0 -85
  297. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.d.ts +0 -9
  298. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +0 -443
  299. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +0 -17
  300. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +0 -132
  301. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +0 -69
  302. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -65
  303. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -66
  304. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +0 -8
  305. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +0 -158
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +0 -2
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +0 -41
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +0 -26
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +0 -142
  311. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +0 -45
  312. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +0 -164
  313. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -50
  314. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +0 -163
  315. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +0 -27
  316. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +0 -142
  317. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +0 -29
  318. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +0 -137
  319. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +0 -40
  320. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +0 -174
  321. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +0 -3
  322. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +0 -39
  323. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -32
  324. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +0 -249
  325. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +0 -41
  326. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +0 -92
  327. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +0 -40
  328. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +0 -209
  329. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.d.ts +0 -12
  330. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +0 -106
  331. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +0 -31
  332. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +0 -392
  333. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +0 -45
  334. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +0 -243
  335. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +0 -52
  336. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +0 -10
  337. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +0 -20
  338. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +0 -310
  339. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +0 -19
  340. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +0 -168
  341. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +0 -8
  342. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +0 -25
  343. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +0 -41
  344. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +0 -19
  345. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +0 -37
  346. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +0 -19
  347. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +0 -37
  348. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +0 -19
  349. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +0 -44
  350. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +0 -13
  351. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +0 -21
  352. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +0 -5
  353. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +0 -27
  354. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +0 -14
  355. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +0 -29
  356. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +0 -8
  357. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +0 -33
  358. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +0 -20
  359. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +0 -8
  360. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +0 -28
  361. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +0 -118
  362. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +0 -1019
  363. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +0 -49
  364. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +0 -23
  365. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +0 -9
  366. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -150
  367. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +0 -1619
  368. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +0 -22
  369. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +0 -41
  370. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +0 -17
  371. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +0 -118
  372. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +0 -12
  373. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.js +0 -17
  374. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +0 -25
  375. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +0 -130
  376. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +0 -122
  377. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +0 -482
package/index.js CHANGED
@@ -80,8 +80,7 @@ import { LanguageModelsConfigurationService } from './vscode/src/vs/workbench/co
80
80
  import { ChatTipService } from './vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js';
81
81
  import { ChatEditingExplanationModelManager } from './vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js';
82
82
  import { ChatToolOutputStateCache } from './vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputStateCache.js';
83
- import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service';
84
- import { TerminalSandboxService } from './vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js';
83
+ import { TerminalSandboxService } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService';
85
84
  import { IAICustomizationWorkspaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service';
86
85
  import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
87
86
  import { AgentPluginService } from './vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js';
@@ -112,11 +111,24 @@ import { IInlineChatHistoryService } from '@codingame/monaco-vscode-api/vscode/v
112
111
  import { InlineChatHistoryService } from './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js';
113
112
  import { NullSandboxHelperService } from './vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js';
114
113
  import { ISandboxHelperService } from '@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/sandboxHelperService.service';
114
+ import { IPluginGitService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginGitService.service';
115
+ import { BrowserPluginGitCommandService } from './vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js';
116
+ import { IAgentNetworkFilterService } from '@codingame/monaco-vscode-api/vscode/vs/platform/networkFilter/common/networkFilterService.service';
117
+ import { AgentNetworkFilterService } from './vscode/src/vs/platform/networkFilter/common/networkFilterService.js';
118
+ import { IAgentHostFileSystemService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/agentHost/common/agentHostFileSystemService.service';
119
+ import { IAgentHostSessionWorkingDirectoryResolver } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.service';
120
+ import { IAgentHostTerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/agentHostTerminalService.service';
121
+ import { AgentHostTerminalService } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminal/browser/agentHostTerminalService';
122
+ import { IRemoteAgentHostService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service';
123
+ import { RemoteAgentHostService } from './vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js';
124
+ import { AgentHostFileSystemService } from './vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js';
125
+ import { AgentHostSessionWorkingDirectoryResolver } from './vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js';
115
126
  import './vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js';
116
127
  import './vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js';
117
128
  import './vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js';
118
129
  import './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js';
119
130
  import './vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js';
131
+ import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/terminalSandboxService.service';
120
132
 
121
133
  class DefaultAccountService {
122
134
  constructor(defaultAccount) {
@@ -193,7 +205,13 @@ function getServiceOverride({ defaultAccount } = {}) {
193
205
  [IChatArtifactsService.toString()]: new SyncDescriptor(ChatArtifactsService, [], true),
194
206
  [IWorkspacePluginSettingsService.toString()]: new SyncDescriptor(WorkspacePluginSettingsService, [], true),
195
207
  [IChatImageCarouselService.toString()]: new SyncDescriptor(ChatImageCarouselService, [], true),
196
- [IInlineChatHistoryService.toString()]: new SyncDescriptor(InlineChatHistoryService, [], true)
208
+ [IInlineChatHistoryService.toString()]: new SyncDescriptor(InlineChatHistoryService, [], true),
209
+ [IPluginGitService.toString()]: new SyncDescriptor(BrowserPluginGitCommandService, [], true),
210
+ [IAgentNetworkFilterService.toString()]: new SyncDescriptor(AgentNetworkFilterService, [], true),
211
+ [IRemoteAgentHostService.toString()]: new SyncDescriptor(RemoteAgentHostService, [], true),
212
+ [IAgentHostFileSystemService.toString()]: new SyncDescriptor(AgentHostFileSystemService, [], true),
213
+ [IAgentHostSessionWorkingDirectoryResolver.toString()]: new SyncDescriptor(AgentHostSessionWorkingDirectoryResolver, [], true),
214
+ [IAgentHostTerminalService.toString()]: new SyncDescriptor(AgentHostTerminalService, [], true)
197
215
  };
198
216
  }
199
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-chat-service-override",
3
- "version": "30.0.1",
3
+ "version": "31.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - chat service-override",
6
6
  "keywords": [],
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "30.0.1",
19
- "@codingame/monaco-vscode-katex-common": "30.0.1",
20
- "@codingame/monaco-vscode-xterm-addons-common": "30.0.1",
21
- "@codingame/monaco-vscode-xterm-common": "30.0.1"
18
+ "@codingame/monaco-vscode-api": "31.0.0",
19
+ "@codingame/monaco-vscode-katex-common": "31.0.0",
20
+ "@codingame/monaco-vscode-xterm-addons-common": "31.0.0",
21
+ "@codingame/monaco-vscode-xterm-common": "31.0.0"
22
22
  },
23
23
  "main": "index.js",
24
24
  "module": "index.js",
@@ -0,0 +1,125 @@
1
+ import { Disposable, IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
3
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
4
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
5
+ import { IAgentConnection, IAgentCreateSessionConfig, IAgentResolveSessionConfigParams, IAgentSessionConfigCompletionsParams, IAgentSessionMetadata, IAuthenticateParams, IAuthenticateResult } from "../common/agentService.js";
6
+ import { type IAgentSubscription } from "../common/state/agentSubscription.js";
7
+ import type { ICommandMap } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/messages";
8
+ import type { IActionEnvelope, ISessionAction, ITerminalAction } from "../common/state/sessionActions.js";
9
+ import { StateComponents, type IRootState } from "@codingame/monaco-vscode-xterm-common/vscode/vs/platform/agentHost/common/state/sessionState";
10
+ import { type IStateSnapshot } from "../common/state/sessionProtocol.js";
11
+ import { type IProtocolTransport } from "../common/state/sessionTransport.js";
12
+ import { type ICreateTerminalParams, type IResolveSessionConfigResult, type ISessionConfigCompletionsResult } from "../common/state/protocol/commands.js";
13
+ /**
14
+ * A protocol-level client for a single remote agent host connection.
15
+ * Manages the WebSocket transport, handshake, subscriptions, action dispatch,
16
+ * and command/response correlation.
17
+ *
18
+ * Implements {@link IAgentConnection} so consumers can program against
19
+ * a single interface regardless of whether the agent host is local or remote.
20
+ */
21
+ export declare class RemoteAgentHostProtocolClient extends Disposable implements IAgentConnection {
22
+ private readonly _logService;
23
+ private readonly _fileService;
24
+ readonly _serviceBrand: undefined;
25
+ private readonly _clientId;
26
+ private readonly _address;
27
+ private readonly _transport;
28
+ private readonly _connectionAuthority;
29
+ private _serverSeq;
30
+ private _nextClientSeq;
31
+ private _defaultDirectory;
32
+ private readonly _subscriptionManager;
33
+ private readonly _onDidAction;
34
+ readonly onDidAction: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<IActionEnvelope>;
35
+ private readonly _onDidNotification;
36
+ readonly onDidNotification: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<import("@codingame/monaco-vscode-xterm-common/vscode/vs/platform/agentHost/common/state/protocol/notifications").IProtocolNotification>;
37
+ private readonly _onDidClose;
38
+ readonly onDidClose: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
39
+ /** Pending JSON-RPC requests keyed by request id. */
40
+ private readonly _pendingRequests;
41
+ private _nextRequestId;
42
+ get clientId(): string;
43
+ get address(): string;
44
+ get defaultDirectory(): string | undefined;
45
+ constructor(address: string, transport: IProtocolTransport, _logService: ILogService, _fileService: IFileService);
46
+ /**
47
+ * Connect to the remote agent host and perform the protocol handshake.
48
+ */
49
+ connect(): Promise<void>;
50
+ get rootState(): IAgentSubscription<IRootState>;
51
+ getSubscription<T>(kind: StateComponents, resource: URI): IReference<IAgentSubscription<T>>;
52
+ getSubscriptionUnmanaged<T>(_kind: StateComponents, resource: URI): IAgentSubscription<T> | undefined;
53
+ dispatch(action: ISessionAction | ITerminalAction): void;
54
+ /**
55
+ * Subscribe to state at a URI. Returns the current state snapshot.
56
+ */
57
+ subscribe(resource: URI): Promise<IStateSnapshot>;
58
+ /**
59
+ * Unsubscribe from state at a URI.
60
+ */
61
+ unsubscribe(resource: URI): void;
62
+ /**
63
+ * Dispatch a client action to the server. Returns the clientSeq used.
64
+ */
65
+ dispatchAction(action: ISessionAction | ITerminalAction, _clientId: string, clientSeq: number): void;
66
+ /**
67
+ * Create a new session on the remote agent host.
68
+ */
69
+ createSession(config?: IAgentCreateSessionConfig): Promise<URI>;
70
+ resolveSessionConfig(params: IAgentResolveSessionConfigParams): Promise<IResolveSessionConfigResult>;
71
+ sessionConfigCompletions(params: IAgentSessionConfigCompletionsParams): Promise<ISessionConfigCompletionsResult>;
72
+ /**
73
+ * Authenticate with the remote agent host using a specific scheme.
74
+ */
75
+ authenticate(params: IAuthenticateParams): Promise<IAuthenticateResult>;
76
+ /**
77
+ * Gracefully shut down all sessions on the remote host.
78
+ */
79
+ shutdown(): Promise<void>;
80
+ /**
81
+ * Dispose a session on the remote agent host.
82
+ */
83
+ disposeSession(session: URI): Promise<void>;
84
+ /**
85
+ * Create a new terminal on the remote agent host.
86
+ */
87
+ createTerminal(params: ICreateTerminalParams): Promise<void>;
88
+ /**
89
+ * Dispose a terminal on the remote agent host.
90
+ */
91
+ disposeTerminal(terminal: URI): Promise<void>;
92
+ /**
93
+ * List all sessions from the remote agent host.
94
+ */
95
+ listSessions(): Promise<IAgentSessionMetadata[]>;
96
+ private _toLocalProjectUri;
97
+ /**
98
+ * List the contents of a directory on the remote host's filesystem.
99
+ */
100
+ resourceList(uri: URI): Promise<ICommandMap["resourceList"]["result"]>;
101
+ /**
102
+ * Read the content of a resource on the remote host.
103
+ */
104
+ resourceRead(uri: URI): Promise<ICommandMap["resourceRead"]["result"]>;
105
+ resourceWrite(params: ICommandMap["resourceWrite"]["params"]): Promise<ICommandMap["resourceWrite"]["result"]>;
106
+ resourceCopy(params: ICommandMap["resourceCopy"]["params"]): Promise<ICommandMap["resourceCopy"]["result"]>;
107
+ resourceDelete(params: ICommandMap["resourceDelete"]["params"]): Promise<ICommandMap["resourceDelete"]["result"]>;
108
+ resourceMove(params: ICommandMap["resourceMove"]["params"]): Promise<ICommandMap["resourceMove"]["result"]>;
109
+ private _handleMessage;
110
+ /**
111
+ * Handles reverse RPC requests from the server (e.g. resourceList,
112
+ * resourceRead). Reads from the local file service and sends a response.
113
+ */
114
+ private _handleReverseRequest;
115
+ /** Send a typed JSON-RPC notification for a protocol-defined method. */
116
+ private _sendNotification;
117
+ /** Send a typed JSON-RPC request for a protocol-defined method. */
118
+ private _sendRequest;
119
+ /** Send a JSON-RPC request for a VS Code extension method (not in the protocol spec). */
120
+ private _sendExtensionRequest;
121
+ /**
122
+ * Get the next client sequence number for optimistic dispatch.
123
+ */
124
+ nextClientSeq(): number;
125
+ }
@@ -0,0 +1,393 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
5
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
7
+ import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
8
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
9
+ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
10
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
11
+ import { toFileSystemProviderErrorCode, FileSystemProviderErrorCode } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
12
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
13
+ import { AgentSession } from '../common/agentService.js';
14
+ import { AgentSubscriptionManager } from '../common/state/agentSubscription.js';
15
+ import { agentHostAuthority, fromAgentHostUri, toAgentHostUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
16
+ import { ROOT_STATE_URI } from '@codingame/monaco-vscode-xterm-common/vscode/vs/platform/agentHost/common/state/sessionState';
17
+ import { PROTOCOL_VERSION } from '../common/state/sessionCapabilities.js';
18
+ import { isJsonRpcRequest, isJsonRpcResponse, isJsonRpcNotification } from '../common/state/sessionProtocol.js';
19
+ import { isClientTransport } from '../common/state/sessionTransport.js';
20
+ import { AhpErrorCodes } from '../common/state/protocol/errors.js';
21
+ import { ContentEncoding } from '../common/state/protocol/commands.js';
22
+ import { decodeBase64, VSBuffer, encodeBase64 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
23
+
24
+ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends Disposable {
25
+ get clientId() {
26
+ return this._clientId;
27
+ }
28
+ get address() {
29
+ return this._address;
30
+ }
31
+ get defaultDirectory() {
32
+ return this._defaultDirectory;
33
+ }
34
+ constructor(address, transport, _logService, _fileService) {
35
+ super();
36
+ this._logService = _logService;
37
+ this._fileService = _fileService;
38
+ this._clientId = generateUuid();
39
+ this._serverSeq = 0;
40
+ this._nextClientSeq = 1;
41
+ this._onDidAction = this._register(( new Emitter()));
42
+ this.onDidAction = this._onDidAction.event;
43
+ this._onDidNotification = this._register(( new Emitter()));
44
+ this.onDidNotification = this._onDidNotification.event;
45
+ this._onDidClose = this._register(( new Emitter()));
46
+ this.onDidClose = this._onDidClose.event;
47
+ this._pendingRequests = ( new Map());
48
+ this._nextRequestId = 1;
49
+ this._address = address;
50
+ this._connectionAuthority = agentHostAuthority(address);
51
+ this._transport = transport;
52
+ this._register(this._transport);
53
+ this._register(this._transport.onMessage(msg => this._handleMessage(msg)));
54
+ this._register(this._transport.onClose(() => this._onDidClose.fire()));
55
+ this._subscriptionManager = this._register(( new AgentSubscriptionManager(
56
+ this._clientId,
57
+ () => this.nextClientSeq(),
58
+ msg => this._logService.warn(`[RemoteAgentHostProtocolClient] ${msg}`),
59
+ resource => this.subscribe(resource),
60
+ resource => this.unsubscribe(resource)
61
+ )));
62
+ this._register(this.onDidAction(envelope => {
63
+ this._subscriptionManager.receiveEnvelope(envelope);
64
+ }));
65
+ }
66
+ async connect() {
67
+ if (isClientTransport(this._transport)) {
68
+ await this._transport.connect();
69
+ }
70
+ const result = await this._sendRequest("initialize", {
71
+ protocolVersion: PROTOCOL_VERSION,
72
+ clientId: this._clientId,
73
+ initialSubscriptions: [ROOT_STATE_URI]
74
+ });
75
+ this._serverSeq = result.serverSeq;
76
+ for (const snapshot of result.snapshots ?? []) {
77
+ if (snapshot.resource === ROOT_STATE_URI) {
78
+ this._subscriptionManager.handleRootSnapshot(snapshot.state, snapshot.fromSeq);
79
+ }
80
+ }
81
+ if (result.defaultDirectory) {
82
+ const dir = result.defaultDirectory;
83
+ if (typeof dir === "string") {
84
+ this._defaultDirectory = ( URI.parse(dir)).path;
85
+ } else {
86
+ this._defaultDirectory = URI.revive(dir).path;
87
+ }
88
+ }
89
+ }
90
+ get rootState() {
91
+ return this._subscriptionManager.rootState;
92
+ }
93
+ getSubscription(kind, resource) {
94
+ return this._subscriptionManager.getSubscription(kind, resource);
95
+ }
96
+ getSubscriptionUnmanaged(_kind, resource) {
97
+ return this._subscriptionManager.getSubscriptionUnmanaged(resource);
98
+ }
99
+ dispatch(action) {
100
+ const seq = this._subscriptionManager.dispatchOptimistic(action);
101
+ this.dispatchAction(action, this._clientId, seq);
102
+ }
103
+ async subscribe(resource) {
104
+ const result = await this._sendRequest("subscribe", {
105
+ resource: ( resource.toString())
106
+ });
107
+ return result.snapshot;
108
+ }
109
+ unsubscribe(resource) {
110
+ this._sendNotification("unsubscribe", {
111
+ resource: ( resource.toString())
112
+ });
113
+ }
114
+ dispatchAction(action, _clientId, clientSeq) {
115
+ this._sendNotification("dispatchAction", {
116
+ clientSeq,
117
+ action
118
+ });
119
+ }
120
+ async createSession(config) {
121
+ const provider = config?.provider ?? "copilot";
122
+ const session = AgentSession.uri(provider, generateUuid());
123
+ await this._sendRequest("createSession", {
124
+ session: ( session.toString()),
125
+ provider,
126
+ model: config?.model,
127
+ workingDirectory: config?.workingDirectory ? ( fromAgentHostUri(config.workingDirectory).toString()) : undefined,
128
+ config: config?.config
129
+ });
130
+ return session;
131
+ }
132
+ async resolveSessionConfig(params) {
133
+ return this._sendRequest("resolveSessionConfig", {
134
+ provider: params.provider,
135
+ workingDirectory: params.workingDirectory ? ( fromAgentHostUri(params.workingDirectory).toString()) : undefined,
136
+ config: params.config
137
+ });
138
+ }
139
+ async sessionConfigCompletions(params) {
140
+ return this._sendRequest("sessionConfigCompletions", {
141
+ provider: params.provider,
142
+ workingDirectory: params.workingDirectory ? ( fromAgentHostUri(params.workingDirectory).toString()) : undefined,
143
+ config: params.config,
144
+ property: params.property,
145
+ query: params.query
146
+ });
147
+ }
148
+ async authenticate(params) {
149
+ await this._sendRequest("authenticate", params);
150
+ return {
151
+ authenticated: true
152
+ };
153
+ }
154
+ async shutdown() {
155
+ await this._sendExtensionRequest("shutdown");
156
+ }
157
+ async disposeSession(session) {
158
+ await this._sendRequest("disposeSession", {
159
+ session: ( session.toString())
160
+ });
161
+ }
162
+ async createTerminal(params) {
163
+ await this._sendRequest("createTerminal", params);
164
+ }
165
+ async disposeTerminal(terminal) {
166
+ await this._sendRequest("disposeTerminal", {
167
+ terminal: ( terminal.toString())
168
+ });
169
+ }
170
+ async listSessions() {
171
+ const result = await this._sendRequest("listSessions", {});
172
+ return ( result.items.map(s => ({
173
+ session: ( URI.parse(s.resource)),
174
+ startTime: s.createdAt,
175
+ modifiedTime: s.modifiedAt,
176
+ ...(s.project ? {
177
+ project: {
178
+ uri: this._toLocalProjectUri(( URI.parse(s.project.uri))),
179
+ displayName: s.project.displayName
180
+ }
181
+ } : {}),
182
+ summary: s.title,
183
+ status: s.status,
184
+ workingDirectory: typeof s.workingDirectory === "string" ? toAgentHostUri(( URI.parse(s.workingDirectory)), this._connectionAuthority) : undefined,
185
+ isRead: s.isRead,
186
+ isDone: s.isDone
187
+ })));
188
+ }
189
+ _toLocalProjectUri(uri) {
190
+ return uri.scheme === Schemas.file ? toAgentHostUri(uri, this._connectionAuthority) : uri;
191
+ }
192
+ async resourceList(uri) {
193
+ return await this._sendRequest("resourceList", {
194
+ uri: ( uri.toString())
195
+ });
196
+ }
197
+ async resourceRead(uri) {
198
+ return this._sendRequest("resourceRead", {
199
+ uri: ( uri.toString())
200
+ });
201
+ }
202
+ async resourceWrite(params) {
203
+ return this._sendRequest("resourceWrite", params);
204
+ }
205
+ async resourceCopy(params) {
206
+ return this._sendRequest("resourceCopy", params);
207
+ }
208
+ async resourceDelete(params) {
209
+ return this._sendRequest("resourceDelete", params);
210
+ }
211
+ async resourceMove(params) {
212
+ return this._sendRequest("resourceMove", params);
213
+ }
214
+ _handleMessage(msg) {
215
+ if (isJsonRpcRequest(msg)) {
216
+ this._handleReverseRequest(msg.id, msg.method, msg.params);
217
+ } else if (isJsonRpcResponse(msg)) {
218
+ const pending = this._pendingRequests.get(msg.id);
219
+ if (pending) {
220
+ this._pendingRequests.delete(msg.id);
221
+ if (hasKey(msg, {
222
+ error: true
223
+ })) {
224
+ this._logService.warn(`[RemoteAgentHostProtocol] Request ${msg.id} failed:`, msg.error);
225
+ pending.error(( new Error(msg.error.message)));
226
+ } else {
227
+ pending.complete(msg.result);
228
+ }
229
+ } else {
230
+ this._logService.warn(
231
+ `[RemoteAgentHostProtocol] Received response for unknown request id ${msg.id}`
232
+ );
233
+ }
234
+ } else if (isJsonRpcNotification(msg)) {
235
+ switch (msg.method) {
236
+ case "action":
237
+ {
238
+ const envelope = msg.params;
239
+ this._serverSeq = Math.max(this._serverSeq, envelope.serverSeq);
240
+ this._onDidAction.fire(envelope);
241
+ break;
242
+ }
243
+ case "notification":
244
+ {
245
+ const notification = msg.params.notification;
246
+ this._logService.trace(`[RemoteAgentHostProtocol] Notification: ${notification.type}`);
247
+ this._onDidNotification.fire(notification);
248
+ break;
249
+ }
250
+ default:
251
+ this._logService.trace(`[RemoteAgentHostProtocol] Unhandled method: ${msg.method}`);
252
+ break;
253
+ }
254
+ } else {
255
+ this._logService.warn(`[RemoteAgentHostProtocol] Unrecognized message:`, JSON.stringify(msg));
256
+ }
257
+ }
258
+ _handleReverseRequest(id, method, params) {
259
+ const sendResult = result => {
260
+ this._transport.send({
261
+ jsonrpc: "2.0",
262
+ id,
263
+ result
264
+ });
265
+ };
266
+ const sendError = err => {
267
+ const fsCode = toFileSystemProviderErrorCode(err instanceof Error ? err : undefined);
268
+ let code = -32e3;
269
+ switch (fsCode) {
270
+ case FileSystemProviderErrorCode.FileNotFound:
271
+ code = AhpErrorCodes.NotFound;
272
+ break;
273
+ case FileSystemProviderErrorCode.NoPermissions:
274
+ code = AhpErrorCodes.PermissionDenied;
275
+ break;
276
+ case FileSystemProviderErrorCode.FileExists:
277
+ code = AhpErrorCodes.AlreadyExists;
278
+ break;
279
+ }
280
+ this._transport.send({
281
+ jsonrpc: "2.0",
282
+ id,
283
+ error: {
284
+ code,
285
+ message: err instanceof Error ? err.message : String(err)
286
+ }
287
+ });
288
+ };
289
+ const handle = fn => {
290
+ fn().then(sendResult, sendError);
291
+ };
292
+ const p = params;
293
+ switch (method) {
294
+ case "resourceList":
295
+ if (!p.uri) {
296
+ sendError(( new Error("Missing uri")));
297
+ return;
298
+ }
299
+ return handle(async () => {
300
+ const stat = await this._fileService.resolve(( URI.parse(p.uri)));
301
+ return {
302
+ entries: ( (stat.children ?? []).map(c => ({
303
+ name: c.name,
304
+ type: c.isDirectory ? "directory" : "file"
305
+ })))
306
+ };
307
+ });
308
+ case "resourceRead":
309
+ if (!p.uri) {
310
+ sendError(( new Error("Missing uri")));
311
+ return;
312
+ }
313
+ return handle(async () => {
314
+ const content = await this._fileService.readFile(( URI.parse(p.uri)));
315
+ return {
316
+ data: encodeBase64(content.value),
317
+ encoding: ContentEncoding.Base64
318
+ };
319
+ });
320
+ case "resourceWrite":
321
+ if (!p.uri || !p.data) {
322
+ sendError(( new Error("Missing uri or data")));
323
+ return;
324
+ }
325
+ return handle(async () => {
326
+ const writeUri = ( URI.parse(p.uri));
327
+ const buf = p.encoding === ContentEncoding.Base64 ? decodeBase64(p.data) : VSBuffer.fromString(p.data);
328
+ if (p.createOnly) {
329
+ await this._fileService.createFile(writeUri, buf, {
330
+ overwrite: false
331
+ });
332
+ } else {
333
+ await this._fileService.writeFile(writeUri, buf);
334
+ }
335
+ return {};
336
+ });
337
+ case "resourceDelete":
338
+ if (!p.uri) {
339
+ sendError(( new Error("Missing uri")));
340
+ return;
341
+ }
342
+ return handle(() => this._fileService.del(( URI.parse(p.uri)), {
343
+ recursive: !!p.recursive
344
+ }).then(() => ({})));
345
+ case "resourceMove":
346
+ if (!p.source || !p.destination) {
347
+ sendError(( new Error("Missing source or destination")));
348
+ return;
349
+ }
350
+ return handle(() => this._fileService.move(( URI.parse(p.source)), ( URI.parse(p.destination)), !p.failIfExists).then(() => ({})));
351
+ default:
352
+ this._logService.warn(`[RemoteAgentHostProtocol] Unhandled reverse request: ${method}`);
353
+ sendError(( new Error(`Unknown method: ${method}`)));
354
+ }
355
+ }
356
+ _sendNotification(method, params) {
357
+ this._transport.send({
358
+ jsonrpc: "2.0",
359
+ method,
360
+ params
361
+ });
362
+ }
363
+ _sendRequest(method, params) {
364
+ const id = this._nextRequestId++;
365
+ const deferred = ( new DeferredPromise());
366
+ this._pendingRequests.set(id, deferred);
367
+ this._transport.send({
368
+ jsonrpc: "2.0",
369
+ id,
370
+ method,
371
+ params
372
+ });
373
+ return deferred.p;
374
+ }
375
+ _sendExtensionRequest(method, params) {
376
+ const id = this._nextRequestId++;
377
+ const deferred = ( new DeferredPromise());
378
+ this._pendingRequests.set(id, deferred);
379
+ this._transport.send({
380
+ jsonrpc: "2.0",
381
+ id,
382
+ method,
383
+ params
384
+ });
385
+ return deferred.p;
386
+ }
387
+ nextClientSeq() {
388
+ return this._nextClientSeq++;
389
+ }
390
+ };
391
+ RemoteAgentHostProtocolClient = ( __decorate([( __param(2, ILogService)), ( __param(3, IFileService))], RemoteAgentHostProtocolClient));
392
+
393
+ export { RemoteAgentHostProtocolClient };
@@ -0,0 +1,65 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
4
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
5
+ import type { IAgentConnection } from "../common/agentService.js";
6
+ import { type IRemoteAgentHostConnectionInfo, type IRemoteAgentHostEntry } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService";
7
+ import { IRemoteAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service";
8
+ export declare class RemoteAgentHostService extends Disposable implements IRemoteAgentHostService {
9
+ private readonly _configurationService;
10
+ private readonly _instantiationService;
11
+ private readonly _logService;
12
+ private static readonly ConnectionWaitTimeout;
13
+ /** Initial reconnect delay in milliseconds. */
14
+ private static readonly ReconnectInitialDelay;
15
+ /** Maximum reconnect delay in milliseconds. */
16
+ private static readonly ReconnectMaxDelay;
17
+ readonly _serviceBrand: undefined;
18
+ private readonly _onDidChangeConnections;
19
+ readonly onDidChangeConnections: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
20
+ private readonly _entries;
21
+ private readonly _names;
22
+ private readonly _tokens;
23
+ /**
24
+ * Stores the original {@link IRemoteAgentHostEntry} for connections
25
+ * registered via {@link addSSHConnection}. This is needed because
26
+ * tunnel entries are not persisted to settings and therefore don't
27
+ * appear in {@link configuredEntries}.
28
+ */
29
+ private readonly _registeredEntries;
30
+ private readonly _pendingConnectionWaits;
31
+ /** Pending reconnect timeouts, keyed by normalized address. */
32
+ private readonly _reconnectTimeouts;
33
+ /** Current reconnect attempt count per address for exponential backoff. */
34
+ private readonly _reconnectAttempts;
35
+ constructor(_configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ILogService);
36
+ get connections(): readonly IRemoteAgentHostConnectionInfo[];
37
+ get configuredEntries(): readonly IRemoteAgentHostEntry[];
38
+ getConnection(address: string): IAgentConnection | undefined;
39
+ getEntryByAddress(address: string): IRemoteAgentHostEntry | undefined;
40
+ reconnect(address: string): void;
41
+ addRemoteAgentHost(input: IRemoteAgentHostEntry): Promise<IRemoteAgentHostConnectionInfo>;
42
+ addSSHConnection(entry: IRemoteAgentHostEntry, connection: IAgentConnection): Promise<IRemoteAgentHostConnectionInfo>;
43
+ removeRemoteAgentHost(address: string): Promise<void>;
44
+ private _removeConnection;
45
+ private _reconcileConnections;
46
+ private _connectTo;
47
+ /**
48
+ * Schedule a reconnect attempt with exponential backoff.
49
+ * Only reconnects if the address is still in the configured entries.
50
+ */
51
+ private _scheduleReconnect;
52
+ /** Cancel a pending reconnect timeout for the given address. */
53
+ private _cancelReconnect;
54
+ /** Check whether the given normalized address is still in the configured entries. */
55
+ private _isAddressConfigured;
56
+ private _getConnectionInfo;
57
+ private _getConfiguredEntries;
58
+ private _upsertConfiguredEntry;
59
+ private _getConfigurationTarget;
60
+ private _storeConfiguredEntries;
61
+ private _getOrCreateConnectionWait;
62
+ private _resolvePendingConnectionWait;
63
+ private _rejectPendingConnectionWait;
64
+ dispose(): void;
65
+ }