@codingame/monaco-vscode-chat-service-override 30.0.0 → 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
@@ -0,0 +1,453 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
+ import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { raceTimeout, DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
6
+ import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
7
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
8
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
9
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
10
+ import { RemoteAgentHostsSettingId, RemoteAgentHostsEnabledSettingId, RemoteAgentHostEntryType, getEntryAddress, RemoteAgentHostConnectionStatus, rawEntryToEntry, entryToRawEntry } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService';
11
+ import { RemoteAgentHostProtocolClient } from './remoteAgentHostProtocolClient.js';
12
+ import { WebSocketClientTransport } from './webSocketClientTransport.js';
13
+ import { normalizeRemoteAgentHostAddress } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
14
+ import { isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
15
+
16
+ var RemoteAgentHostService_1;
17
+ let RemoteAgentHostService = class RemoteAgentHostService extends Disposable {
18
+ static {
19
+ RemoteAgentHostService_1 = this;
20
+ }
21
+ static {
22
+ this.ConnectionWaitTimeout = 10000;
23
+ }
24
+ static {
25
+ this.ReconnectInitialDelay = 1000;
26
+ }
27
+ static {
28
+ this.ReconnectMaxDelay = 30000;
29
+ }
30
+ constructor(_configurationService, _instantiationService, _logService) {
31
+ super();
32
+ this._configurationService = _configurationService;
33
+ this._instantiationService = _instantiationService;
34
+ this._logService = _logService;
35
+ this._onDidChangeConnections = this._register(( new Emitter()));
36
+ this.onDidChangeConnections = this._onDidChangeConnections.event;
37
+ this._entries = ( new Map());
38
+ this._names = ( new Map());
39
+ this._tokens = ( new Map());
40
+ this._registeredEntries = ( new Map());
41
+ this._pendingConnectionWaits = ( new Map());
42
+ this._reconnectTimeouts = ( new Map());
43
+ this._reconnectAttempts = ( new Map());
44
+ this._register(this._configurationService.onDidChangeConfiguration(e => {
45
+ if (e.affectsConfiguration(RemoteAgentHostsSettingId) || e.affectsConfiguration(RemoteAgentHostsEnabledSettingId)) {
46
+ this._reconcileConnections();
47
+ }
48
+ }));
49
+ this._reconcileConnections();
50
+ }
51
+ get connections() {
52
+ const result = [];
53
+ for (const [address, entry] of this._entries) {
54
+ result.push({
55
+ address,
56
+ name: this._names.get(address) ?? address,
57
+ clientId: entry.client.clientId,
58
+ defaultDirectory: entry.client.defaultDirectory,
59
+ status: entry.status
60
+ });
61
+ }
62
+ return result;
63
+ }
64
+ get configuredEntries() {
65
+ return ( this._getConfiguredEntries().map(e => {
66
+ if (e.connection.type === RemoteAgentHostEntryType.Tunnel) {
67
+ return e;
68
+ }
69
+ return {
70
+ ...e,
71
+ connection: {
72
+ ...e.connection,
73
+ address: normalizeRemoteAgentHostAddress(e.connection.address)
74
+ }
75
+ };
76
+ }));
77
+ }
78
+ getConnection(address) {
79
+ const normalized = normalizeRemoteAgentHostAddress(address);
80
+ const entry = this._entries.get(normalized);
81
+ return entry?.connected ? entry.client : undefined;
82
+ }
83
+ getEntryByAddress(address) {
84
+ const normalized = normalizeRemoteAgentHostAddress(address);
85
+ const registered = this._registeredEntries.get(normalized);
86
+ if (registered) {
87
+ return registered;
88
+ }
89
+ return this.configuredEntries.find(e => normalizeRemoteAgentHostAddress(getEntryAddress(e)) === normalized);
90
+ }
91
+ reconnect(address) {
92
+ const normalized = normalizeRemoteAgentHostAddress(address);
93
+ const configuredEntry = this._getConfiguredEntries().find(e => normalizeRemoteAgentHostAddress(getEntryAddress(e)) === normalized);
94
+ if (configuredEntry && configuredEntry.connection.type !== RemoteAgentHostEntryType.WebSocket) {
95
+ return;
96
+ }
97
+ const token = this._tokens.get(normalized);
98
+ this._cancelReconnect(normalized);
99
+ this._reconnectAttempts.delete(normalized);
100
+ const entry = this._entries.get(normalized);
101
+ if (entry) {
102
+ this._entries.delete(normalized);
103
+ entry.store.dispose();
104
+ }
105
+ this._connectTo(normalized, token);
106
+ }
107
+ async addRemoteAgentHost(input) {
108
+ if (!this._configurationService.getValue(RemoteAgentHostsEnabledSettingId)) {
109
+ throw ( new Error("Remote agent host connections are not enabled."));
110
+ }
111
+ const entry = input.connection.type === RemoteAgentHostEntryType.Tunnel ? input : {
112
+ ...input,
113
+ connection: {
114
+ ...input.connection,
115
+ address: normalizeRemoteAgentHostAddress(input.connection.address)
116
+ }
117
+ };
118
+ const address = getEntryAddress(entry);
119
+ const existingConnection = this._getConnectionInfo(address);
120
+ await this._storeConfiguredEntries(this._upsertConfiguredEntry(entry));
121
+ if (existingConnection) {
122
+ return {
123
+ ...existingConnection,
124
+ name: entry.name
125
+ };
126
+ }
127
+ if (entry.connection.type === RemoteAgentHostEntryType.SSH) {
128
+ return {
129
+ address,
130
+ name: entry.name,
131
+ clientId: "",
132
+ status: RemoteAgentHostConnectionStatus.Disconnected
133
+ };
134
+ }
135
+ const connectedConnection = this._getConnectionInfo(address);
136
+ if (connectedConnection) {
137
+ return connectedConnection;
138
+ }
139
+ const wait = this._getOrCreateConnectionWait(address);
140
+ const connection = await raceTimeout(wait.p, RemoteAgentHostService_1.ConnectionWaitTimeout, () => {
141
+ this._pendingConnectionWaits.delete(address);
142
+ });
143
+ if (!connection) {
144
+ throw ( new Error(`Timed out connecting to ${address}`));
145
+ }
146
+ return connection;
147
+ }
148
+ async addSSHConnection(entry, connection) {
149
+ const address = getEntryAddress(entry);
150
+ const existingEntry = this._entries.get(address);
151
+ if (existingEntry) {
152
+ this._entries.delete(address);
153
+ existingEntry.store.dispose();
154
+ }
155
+ const store = ( new DisposableStore());
156
+ const protocolClient = connection;
157
+ store.add(protocolClient);
158
+ const connEntry = {
159
+ store,
160
+ client: protocolClient,
161
+ connected: true,
162
+ status: RemoteAgentHostConnectionStatus.Connected
163
+ };
164
+ this._entries.set(address, connEntry);
165
+ this._names.set(address, entry.name);
166
+ this._registeredEntries.set(address, entry);
167
+ if (entry.connectionToken) {
168
+ this._tokens.set(address, entry.connectionToken);
169
+ }
170
+ store.add(protocolClient.onDidClose(() => {
171
+ if (this._entries.get(address) === connEntry) {
172
+ connEntry.connected = false;
173
+ connEntry.status = RemoteAgentHostConnectionStatus.Disconnected;
174
+ this._onDidChangeConnections.fire();
175
+ }
176
+ }));
177
+ await this._storeConfiguredEntries(this._upsertConfiguredEntry(entry));
178
+ this._onDidChangeConnections.fire();
179
+ return {
180
+ address,
181
+ name: entry.name,
182
+ clientId: protocolClient.clientId,
183
+ defaultDirectory: protocolClient.defaultDirectory,
184
+ status: RemoteAgentHostConnectionStatus.Connected
185
+ };
186
+ }
187
+ async removeRemoteAgentHost(address) {
188
+ const normalized = normalizeRemoteAgentHostAddress(address);
189
+ const entries = this._getConfiguredEntries().filter(e => normalizeRemoteAgentHostAddress(getEntryAddress(e)) !== normalized);
190
+ await this._storeConfiguredEntries(entries);
191
+ this._names.delete(normalized);
192
+ this._tokens.delete(normalized);
193
+ this._registeredEntries.delete(normalized);
194
+ this._cancelReconnect(normalized);
195
+ this._reconnectAttempts.delete(normalized);
196
+ this._removeConnection(normalized);
197
+ }
198
+ _removeConnection(address) {
199
+ const entry = this._entries.get(address);
200
+ if (entry) {
201
+ this._entries.delete(address);
202
+ entry.store.dispose();
203
+ this._rejectPendingConnectionWait(address, ( new Error(`Connection closed: ${address}`)));
204
+ this._onDidChangeConnections.fire();
205
+ }
206
+ }
207
+ _reconcileConnections() {
208
+ if (!this._configurationService.getValue(RemoteAgentHostsEnabledSettingId)) {
209
+ for (const address of [...( this._entries.keys())]) {
210
+ this._cancelReconnect(address);
211
+ this._removeConnection(address);
212
+ }
213
+ this._names.clear();
214
+ this._tokens.clear();
215
+ this._reconnectAttempts.clear();
216
+ return;
217
+ }
218
+ const rawEntries = ( (this._configurationService.getValue(RemoteAgentHostsSettingId) ?? []).map(rawEntryToEntry)).filter(isDefined);
219
+ const entriesWithAddress = ( rawEntries.map(e => ({
220
+ entry: e,
221
+ address: normalizeRemoteAgentHostAddress(getEntryAddress(e))
222
+ })));
223
+ const desired = ( new Set(( entriesWithAddress.map(e => e.address))));
224
+ this._logService.info(
225
+ `[RemoteAgentHost] Reconciling: desired=[${[...desired].join(", ")}], current=[${( [...( this._entries.keys())].map(a => `${a}(${this._entries.get(a).connected ? "connected" : "pending"})`)).join(", ")}]`
226
+ );
227
+ let namesChanged = false;
228
+ const oldNames = ( new Map(this._names));
229
+ this._names.clear();
230
+ this._tokens.clear();
231
+ for (const {
232
+ entry,
233
+ address
234
+ } of entriesWithAddress) {
235
+ this._names.set(address, entry.name);
236
+ this._tokens.set(address, entry.connectionToken);
237
+ if (( this._entries.has(address)) && oldNames.get(address) !== entry.name) {
238
+ namesChanged = true;
239
+ }
240
+ }
241
+ for (const address of [...( this._entries.keys())]) {
242
+ if (!( desired.has(address))) {
243
+ this._logService.info(`[RemoteAgentHost] Disconnecting from ${address}`);
244
+ this._cancelReconnect(address);
245
+ this._reconnectAttempts.delete(address);
246
+ this._removeConnection(address);
247
+ }
248
+ }
249
+ for (const {
250
+ entry,
251
+ address
252
+ } of entriesWithAddress) {
253
+ if (!( this._entries.has(address)) && entry.connection.type === RemoteAgentHostEntryType.WebSocket) {
254
+ this._connectTo(address, entry.connectionToken);
255
+ }
256
+ }
257
+ if (namesChanged) {
258
+ this._onDidChangeConnections.fire();
259
+ }
260
+ }
261
+ _connectTo(address, connectionToken) {
262
+ const existingEntry = this._entries.get(address);
263
+ if (existingEntry) {
264
+ this._entries.delete(address);
265
+ existingEntry.store.dispose();
266
+ }
267
+ const store = ( new DisposableStore());
268
+ const transport = store.add(( new WebSocketClientTransport(address, connectionToken)));
269
+ const client = store.add(
270
+ this._instantiationService.createInstance(RemoteAgentHostProtocolClient, address, transport)
271
+ );
272
+ const entry = {
273
+ store,
274
+ client,
275
+ connected: false,
276
+ status: RemoteAgentHostConnectionStatus.Connecting
277
+ };
278
+ this._entries.set(address, entry);
279
+ const isCurrentEntry = () => this._entries.get(address) === entry;
280
+ store.add(client.onDidClose(() => {
281
+ if (!isCurrentEntry()) {
282
+ return;
283
+ }
284
+ this._logService.warn(`[RemoteAgentHost] Connection closed: ${address}`);
285
+ entry.connected = false;
286
+ entry.status = RemoteAgentHostConnectionStatus.Disconnected;
287
+ this._onDidChangeConnections.fire();
288
+ this._scheduleReconnect(address, connectionToken);
289
+ }));
290
+ this._logService.info(`[RemoteAgentHost] Connecting to ${address}`);
291
+ this._onDidChangeConnections.fire();
292
+ client.connect().then(() => {
293
+ if (store.isDisposed) {
294
+ return;
295
+ }
296
+ this._logService.info(`[RemoteAgentHost] Connected to ${address}`);
297
+ entry.connected = true;
298
+ entry.status = RemoteAgentHostConnectionStatus.Connected;
299
+ this._reconnectAttempts.delete(address);
300
+ this._resolvePendingConnectionWait(address);
301
+ this._onDidChangeConnections.fire();
302
+ }).catch(err => {
303
+ if (!isCurrentEntry()) {
304
+ return;
305
+ }
306
+ this._logService.error(
307
+ `[RemoteAgentHost] Failed to connect to ${address}. Verify address and connectionToken`,
308
+ err
309
+ );
310
+ entry.status = RemoteAgentHostConnectionStatus.Disconnected;
311
+ this._entries.delete(address);
312
+ entry.store.dispose();
313
+ this._rejectPendingConnectionWait(address, err);
314
+ this._onDidChangeConnections.fire();
315
+ this._scheduleReconnect(address, connectionToken);
316
+ });
317
+ }
318
+ _scheduleReconnect(address, connectionToken) {
319
+ if (!this._isAddressConfigured(address)) {
320
+ this._logService.info(`[RemoteAgentHost] Not reconnecting to ${address}: no longer configured`);
321
+ return;
322
+ }
323
+ const attempt = (this._reconnectAttempts.get(address) ?? 0) + 1;
324
+ this._reconnectAttempts.set(address, attempt);
325
+ const delay = Math.min(
326
+ RemoteAgentHostService_1.ReconnectInitialDelay * Math.pow(2, attempt - 1),
327
+ RemoteAgentHostService_1.ReconnectMaxDelay
328
+ );
329
+ this._logService.info(
330
+ `[RemoteAgentHost] Scheduling reconnect to ${address} in ${delay}ms (attempt ${attempt})`
331
+ );
332
+ this._cancelReconnect(address);
333
+ const timeout = setTimeout(() => {
334
+ this._reconnectTimeouts.delete(address);
335
+ if (this._isAddressConfigured(address)) {
336
+ this._connectTo(address, connectionToken ?? this._tokens.get(address));
337
+ }
338
+ }, delay);
339
+ this._reconnectTimeouts.set(address, timeout);
340
+ }
341
+ _cancelReconnect(address) {
342
+ const timeout = this._reconnectTimeouts.get(address);
343
+ if (timeout !== undefined) {
344
+ clearTimeout(timeout);
345
+ this._reconnectTimeouts.delete(address);
346
+ }
347
+ }
348
+ _isAddressConfigured(address) {
349
+ const entries = this._getConfiguredEntries();
350
+ return ( entries.some(e => normalizeRemoteAgentHostAddress(getEntryAddress(e)) === address));
351
+ }
352
+ _getConnectionInfo(address) {
353
+ return this.connections.find(
354
+ connection => connection.address === address && connection.status === RemoteAgentHostConnectionStatus.Connected
355
+ );
356
+ }
357
+ _getConfiguredEntries() {
358
+ return ( (this._configurationService.getValue(RemoteAgentHostsSettingId) ?? []).map(rawEntryToEntry)).filter(isDefined);
359
+ }
360
+ _upsertConfiguredEntry(entry) {
361
+ const target = this._getConfigurationTarget();
362
+ const inspected = this._configurationService.inspect(RemoteAgentHostsSettingId);
363
+ let configuredRaw;
364
+ switch (target) {
365
+ case ConfigurationTarget.USER_LOCAL:
366
+ configuredRaw = inspected.userLocalValue ?? [];
367
+ break;
368
+ case ConfigurationTarget.USER_REMOTE:
369
+ configuredRaw = inspected.userRemoteValue ?? [];
370
+ break;
371
+ default:
372
+ configuredRaw = inspected.userValue ?? [];
373
+ break;
374
+ }
375
+ const configuredEntries = ( configuredRaw.map(rawEntryToEntry)).filter(e => e !== undefined);
376
+ const normalizedAddress = normalizeRemoteAgentHostAddress(getEntryAddress(entry));
377
+ const existingIndex = configuredEntries.findIndex(
378
+ e => normalizeRemoteAgentHostAddress(getEntryAddress(e)) === normalizedAddress
379
+ );
380
+ if (existingIndex === -1) {
381
+ return [...configuredEntries, entry];
382
+ }
383
+ return ( configuredEntries.map((e, index) => index === existingIndex ? entry : e));
384
+ }
385
+ _getConfigurationTarget() {
386
+ const inspected = this._configurationService.inspect(RemoteAgentHostsSettingId);
387
+ if (inspected.userLocalValue !== undefined) {
388
+ return ConfigurationTarget.USER_LOCAL;
389
+ }
390
+ if (inspected.userRemoteValue !== undefined) {
391
+ return ConfigurationTarget.USER_REMOTE;
392
+ }
393
+ if (inspected.userValue !== undefined) {
394
+ return ConfigurationTarget.USER;
395
+ }
396
+ return ConfigurationTarget.USER;
397
+ }
398
+ async _storeConfiguredEntries(entries) {
399
+ const raw = ( entries.map(entryToRawEntry)).filter(isDefined);
400
+ await this._configurationService.updateValue(RemoteAgentHostsSettingId, raw, this._getConfigurationTarget());
401
+ }
402
+ _getOrCreateConnectionWait(address) {
403
+ let wait = this._pendingConnectionWaits.get(address);
404
+ if (wait) {
405
+ return wait;
406
+ }
407
+ const existingConnection = this._getConnectionInfo(address);
408
+ if (existingConnection) {
409
+ const immediateWait = ( new DeferredPromise());
410
+ immediateWait.complete(existingConnection);
411
+ return immediateWait;
412
+ }
413
+ wait = ( new DeferredPromise());
414
+ this._pendingConnectionWaits.set(address, wait);
415
+ return wait;
416
+ }
417
+ _resolvePendingConnectionWait(address) {
418
+ const wait = this._pendingConnectionWaits.get(address);
419
+ const connection = this._getConnectionInfo(address);
420
+ if (!wait || !connection) {
421
+ return;
422
+ }
423
+ this._pendingConnectionWaits.delete(address);
424
+ void wait.complete(connection);
425
+ }
426
+ _rejectPendingConnectionWait(address, err) {
427
+ const wait = this._pendingConnectionWaits.get(address);
428
+ if (!wait) {
429
+ return;
430
+ }
431
+ this._pendingConnectionWaits.delete(address);
432
+ void wait.error(err);
433
+ }
434
+ dispose() {
435
+ for (const timeout of ( this._reconnectTimeouts.values())) {
436
+ clearTimeout(timeout);
437
+ }
438
+ this._reconnectTimeouts.clear();
439
+ this._reconnectAttempts.clear();
440
+ for (const [address, wait] of this._pendingConnectionWaits) {
441
+ void wait.error(( new Error(`Remote agent host service disposed before connecting to ${address}`)));
442
+ }
443
+ this._pendingConnectionWaits.clear();
444
+ for (const entry of ( this._entries.values())) {
445
+ entry.store.dispose();
446
+ }
447
+ this._entries.clear();
448
+ super.dispose();
449
+ }
450
+ };
451
+ RemoteAgentHostService = RemoteAgentHostService_1 = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IInstantiationService)), ( __param(2, ILogService))], RemoteAgentHostService));
452
+
453
+ export { RemoteAgentHostService };
@@ -0,0 +1,28 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import type { IAhpServerNotification, IJsonRpcResponse, IProtocolMessage } from "../common/state/sessionProtocol.js";
3
+ import type { IClientTransport } from "../common/state/sessionTransport.js";
4
+ /**
5
+ * A WebSocket client transport that connects to a remote agent host server.
6
+ * Uses the native browser WebSocket API (available in Electron renderer).
7
+ * Implements {@link IClientTransport} with JSON serialization and URI revival.
8
+ */
9
+ export declare class WebSocketClientTransport extends Disposable implements IClientTransport {
10
+ private readonly _address;
11
+ private readonly _connectionToken?;
12
+ private readonly _onMessage;
13
+ readonly onMessage: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<IProtocolMessage>;
14
+ private readonly _onClose;
15
+ readonly onClose: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
16
+ private readonly _onOpen;
17
+ readonly onOpen: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
18
+ private _ws;
19
+ get isOpen(): boolean;
20
+ constructor(_address: string, _connectionToken?: string | undefined);
21
+ /**
22
+ * Initiate the WebSocket connection. Resolves when the connection
23
+ * is open, or rejects on error/timeout.
24
+ */
25
+ connect(): Promise<void>;
26
+ send(message: IProtocolMessage | IAhpServerNotification | IJsonRpcResponse): void;
27
+ dispose(): void;
28
+ }
@@ -0,0 +1,81 @@
1
+
2
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
3
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { connectionTokenQueryName } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
5
+
6
+ class WebSocketClientTransport extends Disposable {
7
+ get isOpen() {
8
+ return this._ws?.readyState === WebSocket.OPEN;
9
+ }
10
+ constructor(_address, _connectionToken) {
11
+ super();
12
+ this._address = _address;
13
+ this._connectionToken = _connectionToken;
14
+ this._onMessage = this._register(( new Emitter()));
15
+ this.onMessage = this._onMessage.event;
16
+ this._onClose = this._register(( new Emitter()));
17
+ this.onClose = this._onClose.event;
18
+ this._onOpen = this._register(( new Emitter()));
19
+ this.onOpen = this._onOpen.event;
20
+ }
21
+ connect() {
22
+ return ( new Promise((resolve, reject) => {
23
+ if (this._store.isDisposed) {
24
+ reject(( new Error("Transport is disposed")));
25
+ return;
26
+ }
27
+ let url = this._address.startsWith("ws://") || this._address.startsWith("wss://") ? this._address : `ws://${this._address}`;
28
+ if (this._connectionToken) {
29
+ const separator = url.includes("?") ? "&" : "?";
30
+ url += `${separator}${connectionTokenQueryName}=${encodeURIComponent(this._connectionToken)}`;
31
+ }
32
+ const ws = ( new WebSocket(url));
33
+ this._ws = ws;
34
+ const onOpen = () => {
35
+ cleanup();
36
+ this._onOpen.fire();
37
+ resolve();
38
+ };
39
+ const onError = () => {
40
+ cleanup();
41
+ reject(( new Error(`WebSocket connection failed: ${this._address}`)));
42
+ };
43
+ const onClose = () => {
44
+ cleanup();
45
+ reject(( new Error(`WebSocket closed before connection was established: ${this._address}`)));
46
+ };
47
+ const cleanup = () => {
48
+ ws.removeEventListener("open", onOpen);
49
+ ws.removeEventListener("error", onError);
50
+ ws.removeEventListener("close", onClose);
51
+ };
52
+ ws.addEventListener("open", onOpen);
53
+ ws.addEventListener("error", onError);
54
+ ws.addEventListener("close", onClose);
55
+ ws.addEventListener("message", event => {
56
+ try {
57
+ const text = typeof event.data === "string" ? event.data : "";
58
+ const message = JSON.parse(text);
59
+ this._onMessage.fire(message);
60
+ } catch {}
61
+ });
62
+ ws.addEventListener("close", () => {
63
+ this._onClose.fire();
64
+ });
65
+ ws.addEventListener("error", () => {
66
+ this._onClose.fire();
67
+ });
68
+ }));
69
+ }
70
+ send(message) {
71
+ if (this._ws?.readyState === WebSocket.OPEN) {
72
+ this._ws.send(JSON.stringify(message));
73
+ }
74
+ }
75
+ dispose() {
76
+ this._ws?.close();
77
+ super.dispose();
78
+ }
79
+ }
80
+
81
+ export { WebSocketClientTransport };
@@ -0,0 +1,75 @@
1
+ import { Disposable, IDisposable } 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 { FileType, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProvider, IFileWriteOptions, IStat } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files";
4
+ import { type IResourceDeleteParams, type IResourceDeleteResult, type IResourceListResult, type IResourceMoveParams, type IResourceMoveResult, type IResourceReadResult, type IResourceWriteParams, type IResourceWriteResult } from "./state/protocol/commands.js";
5
+ /**
6
+ * Interface for performing resource operations on a remote endpoint.
7
+ *
8
+ * Both {@link IAgentConnection} (client→server) and client-exposed
9
+ * filesystems (server→client) satisfy this contract.
10
+ */
11
+ export interface IRemoteFilesystemConnection {
12
+ resourceList(uri: URI): Promise<IResourceListResult>;
13
+ resourceRead(uri: URI): Promise<IResourceReadResult>;
14
+ resourceWrite(params: IResourceWriteParams): Promise<IResourceWriteResult>;
15
+ resourceDelete(params: IResourceDeleteParams): Promise<IResourceDeleteResult>;
16
+ resourceMove(params: IResourceMoveParams): Promise<IResourceMoveResult>;
17
+ }
18
+ /**
19
+ * Build a {@link AGENT_HOST_SCHEME} URI for a given connection authority
20
+ * and remote path. Assumes the remote path is a `file://` resource.
21
+ */
22
+ export declare function agentHostUri(authority: string, path: string): URI;
23
+ /**
24
+ * Extract the remote filesystem path from a {@link AGENT_HOST_SCHEME} URI.
25
+ */
26
+ export declare function agentHostRemotePath(uri: URI): string;
27
+ /**
28
+ * {@link IFileSystemProvider} that proxies filesystem operations
29
+ * through a {@link IRemoteFilesystemConnection}.
30
+ *
31
+ * URIs encode the original scheme and authority in the path so any remote
32
+ * resource can be represented. Subclasses provide the URI decode function
33
+ * and scheme-specific helpers.
34
+ *
35
+ * Individual connections are identified by the URI's authority component.
36
+ */
37
+ export declare abstract class AHPFileSystemProvider extends Disposable implements IFileSystemProvider {
38
+ readonly capabilities: number;
39
+ private readonly _onDidChangeCapabilities;
40
+ readonly onDidChangeCapabilities: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
41
+ private readonly _onDidChangeFile;
42
+ readonly onDidChangeFile: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<readonly IFileChange[]>;
43
+ private readonly _authorityToConnection;
44
+ /**
45
+ * Register a mapping from a URI authority to a connection.
46
+ * Returns a disposable that unregisters the mapping.
47
+ */
48
+ registerAuthority(authority: string, connection: IRemoteFilesystemConnection): IDisposable;
49
+ /** Decode a provider URI back to the original URI for the remote endpoint. */
50
+ protected abstract _decodeUri(resource: URI): URI;
51
+ watch(): IDisposable;
52
+ stat(resource: URI): Promise<IStat>;
53
+ readdir(resource: URI): Promise<[
54
+ string,
55
+ FileType
56
+ ][]>;
57
+ readFile(resource: URI): Promise<Uint8Array>;
58
+ writeFile(resource: URI, content: Uint8Array, _opts: IFileWriteOptions): Promise<void>;
59
+ mkdir(): Promise<void>;
60
+ delete(resource: URI, opts: IFileDeleteOptions): Promise<void>;
61
+ rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void>;
62
+ private _getConnection;
63
+ private _listDirectory;
64
+ }
65
+ /**
66
+ * Filesystem provider for accessing agent host files from the
67
+ * client side. Registered under the `vscode-agent-host` scheme.
68
+ *
69
+ * ```
70
+ * vscode-agent-host://[connectionAuthority]/[originalScheme]/[originalAuthority]/[originalPath]
71
+ * ```
72
+ */
73
+ export declare class AgentHostFileSystemProvider extends AHPFileSystemProvider {
74
+ protected _decodeUri(resource: URI): URI;
75
+ }