@codingame/monaco-vscode-chat-service-override 36.2.7 → 37.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 (725) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +92 -10
  3. package/package.json +5 -5
  4. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +10 -3
  5. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +54 -17
  6. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.d.ts +14 -0
  7. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.js +46 -0
  8. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +7 -2
  9. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +34 -2
  10. package/vscode/src/vs/platform/agentHost/browser/{remoteAgentHostProtocolClient.d.ts → agentHostProtocolClient.d.ts} +240 -60
  11. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +1911 -0
  12. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +30 -33
  13. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +381 -315
  14. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +3 -1
  15. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +2 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.d.ts +9 -0
  17. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.js +20 -0
  18. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.d.ts +144 -0
  19. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.js +20 -0
  20. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +14 -6
  21. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +14 -10
  22. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +1 -1
  23. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.d.ts +47 -0
  24. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.js +75 -0
  25. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.d.ts +68 -0
  26. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.js +161 -0
  27. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +288 -45
  28. package/vscode/src/vs/platform/agentHost/common/agentMerge.d.ts +261 -0
  29. package/vscode/src/vs/platform/agentHost/common/agentMerge.js +67 -0
  30. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.d.ts +53 -0
  31. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.js +45 -0
  32. package/vscode/src/vs/platform/agentHost/common/changesetUri.d.ts +130 -0
  33. package/vscode/src/vs/platform/agentHost/common/changesetUri.js +27 -0
  34. package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +8 -2
  35. package/vscode/src/vs/platform/agentHost/common/customAgents.js +7 -0
  36. package/vscode/src/vs/platform/agentHost/common/meta/agentChatSurfaceMeta.d.ts +39 -0
  37. package/vscode/src/vs/platform/agentHost/common/meta/agentChatSurfaceMeta.js +25 -0
  38. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.d.ts +110 -0
  39. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +38 -0
  40. package/vscode/src/vs/platform/agentHost/common/meta/agentHostArtifactRemovalMeta.d.ts +4 -0
  41. package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.d.ts +7 -0
  42. package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.js +14 -0
  43. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +3 -3
  44. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +16 -24
  45. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.d.ts +8 -0
  46. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.js +8 -0
  47. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.d.ts +75 -0
  48. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.js +84 -0
  49. package/vscode/src/vs/platform/agentHost/common/shellInitScript.d.ts +24 -0
  50. package/vscode/src/vs/platform/agentHost/common/shellInitScript.js +63 -0
  51. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +71 -20
  52. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +187 -26
  53. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.d.ts +30 -0
  54. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.js +87 -0
  55. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +2 -2
  56. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.d.ts +4 -0
  57. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.js +37 -0
  58. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.d.ts +4 -0
  59. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.js +45 -0
  60. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +5 -4
  61. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +100 -35
  62. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +193 -49
  63. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +161 -40
  64. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +1 -1
  65. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +5 -1
  66. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +2 -2
  67. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.d.ts +1 -0
  68. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.js +7 -0
  69. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
  70. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +114 -3
  71. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +28 -5
  72. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +4 -2
  73. package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.d.ts +34 -0
  74. package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.js +28 -0
  75. package/vscode/src/vs/platform/agentHost/common/worktreePaths.d.ts +24 -0
  76. package/vscode/src/vs/platform/agentHost/common/worktreePaths.js +15 -0
  77. package/vscode/src/vs/platform/browserView/common/browserChatToolReferenceNames.d.ts +1 -1
  78. package/vscode/src/vs/platform/chat/common/aiAgentEnv.d.ts +18 -0
  79. package/vscode/src/vs/platform/chat/common/aiAgentEnv.js +6 -0
  80. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +5 -1
  81. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +77 -5
  82. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +1 -1
  83. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +9 -5
  84. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +1 -5
  85. package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -4
  86. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +19 -7
  87. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +49 -37
  88. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.d.ts +2 -1
  89. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +12 -0
  90. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +1 -2
  91. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +1 -0
  92. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveParseSafety.d.ts +5 -0
  93. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveParseSafety.js +7 -0
  94. package/vscode/src/vs/platform/terminal/common/autoApprove/cmdDelayedExpansion.d.ts +5 -0
  95. package/vscode/src/vs/platform/terminal/common/autoApprove/cmdDelayedExpansion.js +8 -0
  96. package/vscode/src/vs/{workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers → platform/terminal/common/autoApprove}/sedFileWriteParser.d.ts +1 -2
  97. package/vscode/src/vs/workbench/browser/chatChangesPill.d.ts +29 -0
  98. package/vscode/src/vs/workbench/browser/chatChangesPill.js +84 -0
  99. package/vscode/src/vs/workbench/common/chatPullRequest.d.ts +19 -0
  100. package/vscode/src/vs/workbench/common/chatPullRequest.js +53 -0
  101. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +342 -155
  102. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
  103. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +25 -2
  104. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +150 -67
  105. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +5 -3
  106. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +5 -1
  107. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +39 -9
  108. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +1 -1
  109. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  110. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  111. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +4 -2
  112. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +54 -17
  113. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  114. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +1 -1
  115. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  116. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +1 -1
  117. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  118. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +6 -0
  119. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +5 -1
  120. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +1 -1
  121. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +1 -1
  122. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  123. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/media/voiceModeOnboarding.css +252 -0
  124. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +13 -13
  125. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  126. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +146 -0
  127. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +889 -0
  128. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +2 -2
  129. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +2 -7
  130. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +3 -54
  131. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +32 -3
  132. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +214 -161
  133. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +10 -9
  134. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +2 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +256 -72
  136. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  137. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.d.ts +2 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +11 -12
  139. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +19 -15
  140. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +30 -14
  141. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +19 -10
  142. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +9 -9
  143. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  144. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.d.ts +6 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +237 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +7 -6
  147. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  148. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +10 -10
  149. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.d.ts +6 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +68 -61
  151. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +17 -21
  152. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +17 -21
  153. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  154. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +5 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +68 -14
  156. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
  157. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +21 -19
  158. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +7 -2
  159. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +222 -72
  160. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +64 -17
  161. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +530 -305
  162. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.d.ts +25 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +63 -0
  164. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.d.ts +30 -0
  165. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.js +37 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.d.ts +6 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +95 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +10 -6
  169. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  170. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +2 -1
  171. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +18 -1
  172. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +86 -47
  173. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +61 -47
  174. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +43 -24
  175. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +326 -76
  176. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +112 -5
  177. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +33 -7
  178. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.d.ts +20 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.js +26 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +28 -10
  181. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +110 -126
  182. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +131 -0
  183. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +638 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.d.ts +41 -0
  185. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.js +202 -0
  186. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.d.ts +24 -1
  187. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +26 -5
  188. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +10 -7
  189. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.d.ts +20 -0
  190. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.js +55 -0
  191. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +62 -0
  192. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +40 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +59 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +624 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.d.ts +90 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +207 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.d.ts +31 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.js +140 -0
  199. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +4 -0
  200. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +5 -1
  201. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +5 -4
  202. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +74 -5
  203. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +511 -171
  204. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.d.ts +32 -0
  205. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +48 -0
  206. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +55 -6
  207. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +210 -20
  208. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +43 -24
  209. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +46 -10
  210. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +216 -110
  211. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +9 -4
  212. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +26 -17
  213. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  215. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  216. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  217. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +30 -26
  218. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +5 -2
  219. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/unifiedQuickAccess.css +6 -6
  220. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  221. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  222. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.d.ts +3 -0
  223. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +62 -0
  224. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/sessionSummaryHover.css +104 -0
  225. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.d.ts +115 -0
  226. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +168 -0
  227. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.d.ts +24 -0
  228. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.js +32 -0
  229. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +56 -0
  230. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +0 -4
  231. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +16 -17
  232. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +7 -3
  233. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +1 -0
  234. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +2 -0
  235. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +10 -1
  236. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +48 -1
  237. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +913 -220
  238. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.d.ts +1 -1
  239. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +148 -84
  240. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +161 -17
  241. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +2367 -247
  242. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +5 -2
  243. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +21 -13
  244. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.d.ts +26 -0
  245. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.js +34 -0
  246. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +2 -0
  247. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +23 -0
  248. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +15 -0
  249. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +3 -0
  250. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +10 -2
  251. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +143 -68
  252. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +1 -0
  253. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +10 -5
  254. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.d.ts +40 -0
  255. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +302 -0
  256. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +1 -2
  257. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +49 -8
  258. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +3 -3
  259. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +38 -0
  260. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.js +240 -0
  261. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.d.ts +1 -0
  262. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +53 -0
  263. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.d.ts +82 -0
  264. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +762 -0
  265. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.d.ts +80 -0
  266. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +279 -0
  267. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +44 -0
  268. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +437 -0
  269. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +85 -6
  270. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +697 -15
  271. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +7 -7
  272. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +40 -10
  273. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +164 -42
  274. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +6 -9
  275. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +260 -31
  276. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +2097 -589
  277. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +32 -0
  278. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +860 -0
  279. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +2229 -1338
  280. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +79 -26
  281. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/customizationMigrationDashboard.css +354 -0
  282. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +85 -9
  283. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +1550 -357
  284. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +2 -4
  285. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +13 -27
  286. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +38 -26
  287. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +637 -319
  288. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +28 -10
  289. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService.d.ts +10 -0
  290. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService.js +22 -0
  291. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.d.ts +15 -0
  292. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.js +38 -0
  293. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.d.ts +8 -0
  294. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.js +38 -0
  295. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +4 -1
  296. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +1675 -633
  297. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +93 -6
  298. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +823 -52
  299. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.d.ts +132 -0
  300. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +446 -0
  301. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.d.ts +183 -0
  302. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.js +218 -0
  303. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +45 -42
  304. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +11 -0
  305. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +163 -136
  306. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  307. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +7 -7
  308. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +22 -2
  309. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +105 -14
  310. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  311. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.d.ts +32 -0
  312. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +49 -0
  313. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  314. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  315. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  316. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  317. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +27 -22
  318. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +6 -0
  319. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +22 -23
  320. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  321. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +25 -25
  322. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  323. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  324. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +7 -2
  325. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +76 -43
  326. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  327. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
  328. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
  329. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.d.ts +145 -0
  330. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +839 -0
  331. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +277 -3
  332. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  333. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +6 -6
  334. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  335. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
  336. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  337. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +16 -16
  338. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -4
  339. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  340. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +8 -4
  341. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  342. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +6 -3
  343. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +35 -19
  344. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +16 -9
  345. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +4 -3
  346. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +4 -4
  347. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +4 -0
  348. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +7 -2
  349. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  350. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.d.ts +5 -5
  351. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +3 -3
  352. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.d.ts +86 -0
  353. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +282 -0
  354. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +14 -10
  355. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  356. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +5 -0
  357. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +37 -25
  358. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +7 -5
  359. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +135 -82
  360. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +22 -3
  361. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutlineCreator.d.ts +17 -0
  362. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutlineCreator.js +28 -0
  363. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +5 -5
  364. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +32 -32
  365. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.d.ts +7 -0
  366. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.js +114 -0
  367. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.d.ts +45 -0
  368. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +326 -0
  369. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.d.ts +33 -0
  370. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +99 -0
  371. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.d.ts +17 -0
  372. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +46 -0
  373. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.d.ts +27 -0
  374. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +301 -0
  375. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.d.ts +22 -0
  376. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +103 -0
  377. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +9 -36
  378. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +103 -196
  379. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  380. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +36 -30
  381. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +2 -0
  382. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +51 -12
  383. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  384. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +31 -27
  385. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +65 -20
  386. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +291 -138
  387. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/chatSetup.css +9 -0
  388. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-dark.svg +1 -0
  389. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-light.svg +1 -0
  390. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChat.d.ts +9 -0
  391. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChat.js +24 -0
  392. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +2 -1
  393. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +59 -35
  394. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +7 -2
  395. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +221 -145
  396. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +15 -29
  397. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +21 -3
  398. package/vscode/src/vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.d.ts +22 -0
  399. package/vscode/src/vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.js +27 -0
  400. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +9 -0
  401. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +23 -21
  402. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +6 -1
  403. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +62 -6
  404. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +15 -1
  405. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +97 -8
  406. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  407. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +6 -6
  408. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.d.ts +11 -2
  409. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +24 -16
  410. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  411. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  412. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.d.ts +44 -0
  413. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +232 -0
  414. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.d.ts +36 -0
  415. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +127 -0
  416. package/vscode/src/vs/workbench/contrib/chat/browser/exploreAgentDefaultModel.js +1 -1
  417. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyPromptContribution.d.ts +18 -0
  418. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyPromptContribution.js +55 -0
  419. package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.js +4 -3
  420. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  421. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatPetAchievements.css +236 -0
  422. package/vscode/src/vs/workbench/contrib/chat/browser/planAgentDefaultModel.js +1 -1
  423. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.d.ts +9 -0
  424. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +260 -0
  425. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +39 -5
  426. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +155 -56
  427. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +10 -14
  428. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +29 -14
  429. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +2 -0
  430. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +76 -24
  431. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +1 -1
  432. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +53 -32
  433. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +1 -1
  434. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +17 -17
  435. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +8 -7
  436. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +1 -1
  437. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +29 -71
  438. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +3 -0
  439. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +36 -40
  440. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +3 -0
  441. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
  442. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  443. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  444. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  445. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  446. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +9 -16
  447. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  448. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +5 -13
  449. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/media/promptTimeline.css +820 -0
  450. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.d.ts +38 -0
  451. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.js +100 -0
  452. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.d.ts +1 -0
  453. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +51 -0
  454. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.d.ts +30 -0
  455. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +113 -0
  456. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.d.ts +146 -0
  457. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +440 -0
  458. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineLayout.d.ts +16 -0
  459. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineLayout.js +5 -0
  460. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.d.ts +194 -0
  461. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +525 -0
  462. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRail.d.ts +33 -0
  463. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.d.ts +128 -0
  464. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +460 -0
  465. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.d.ts +38 -0
  466. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +120 -0
  467. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.d.ts +53 -0
  468. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.js +160 -0
  469. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +25 -22
  470. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.d.ts +13 -0
  471. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +52 -0
  472. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.d.ts +22 -0
  473. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +58 -0
  474. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.d.ts +63 -0
  475. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.js +361 -0
  476. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.d.ts +35 -0
  477. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.js +90 -0
  478. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +25 -18
  479. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -1
  480. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +77 -41
  481. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +60 -43
  482. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +4 -1
  483. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +60 -16
  484. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +10 -8
  485. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +13 -4
  486. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -1
  487. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +44 -24
  488. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +4 -4
  489. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  490. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +52 -6
  491. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +446 -79
  492. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.d.ts +11 -0
  493. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.js +13 -0
  494. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.d.ts +66 -0
  495. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +297 -0
  496. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.d.ts +137 -0
  497. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +714 -0
  498. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentOpenChat.css +379 -0
  499. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.d.ts +10 -0
  500. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +78 -0
  501. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.d.ts +36 -0
  502. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.js +172 -0
  503. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +5 -1
  504. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +8 -1
  505. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.d.ts +15 -0
  506. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.js +30 -0
  507. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +11 -1
  508. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +41 -13
  509. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +5 -2
  510. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +133 -3
  511. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +3 -2
  512. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +11 -2
  513. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatEditorInputContentProvider.js +4 -4
  514. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.d.ts +1 -0
  515. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +96 -0
  516. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +12 -0
  517. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +36 -1
  518. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +67 -17
  519. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +23 -37
  520. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.d.ts +18 -0
  521. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +72 -3
  522. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.d.ts +11 -0
  523. package/vscode/src/vs/workbench/contrib/{agentsVoice/common/agentsVoiceColors.js → chat/browser/widget/input/editor/chatInputPlaceholderDecoration.js} +17 -15
  524. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.d.ts +3 -0
  525. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +16 -0
  526. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +2 -2
  527. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +6 -4
  528. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +21 -13
  529. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +48 -8
  530. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +457 -142
  531. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.d.ts +1 -1
  532. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +22 -14
  533. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +6 -22
  534. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.d.ts +22 -0
  535. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.js +163 -0
  536. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +27 -5
  537. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +79 -32
  538. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.d.ts +6 -0
  539. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.js +12 -0
  540. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +44 -11
  541. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +404 -51
  542. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +64 -4
  543. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +33 -2
  544. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.d.ts +68 -0
  545. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.js +70 -0
  546. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +5 -2
  547. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +18 -5
  548. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +43 -14
  549. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +4 -0
  550. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +4 -9
  551. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +164 -71
  552. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +1 -1
  553. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +1 -1
  554. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  555. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
  556. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  557. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  558. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.d.ts +3 -1
  559. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +19 -10
  560. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +3 -1
  561. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +172 -159
  562. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.d.ts +115 -0
  563. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.js +69 -0
  564. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.d.ts +60 -0
  565. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +139 -0
  566. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  567. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +5 -0
  568. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +21 -1
  569. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +25 -2
  570. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +55 -18
  571. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  572. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  573. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  574. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +1 -0
  575. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  576. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  577. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.d.ts +59 -0
  578. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +323 -0
  579. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.d.ts +30 -0
  580. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.js +79 -0
  581. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +6 -2
  582. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +118 -13
  583. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  584. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  585. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  586. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  587. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  588. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +8 -8
  589. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +1 -0
  590. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +81 -0
  591. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +85 -0
  592. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +17 -17
  593. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
  594. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +23 -23
  595. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
  596. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +17 -3
  597. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +81 -7
  598. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.d.ts +30 -0
  599. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.js +86 -0
  600. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +10 -2
  601. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +97 -18
  602. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +2 -22
  603. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +10 -8
  604. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.js +2 -1
  605. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +2 -0
  606. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +42 -36
  607. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +8 -0
  608. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +10 -0
  609. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -4
  610. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +2 -1
  611. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  612. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +25 -16
  613. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +4 -3
  614. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.d.ts +70 -0
  615. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.js +4316 -0
  616. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  617. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  618. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  619. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  620. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +4 -4
  621. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  622. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  623. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +6 -1
  624. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +188 -148
  625. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  626. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  627. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  628. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  629. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  630. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +7 -0
  631. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -3
  632. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +5 -6
  633. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +5 -42
  634. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalOutput.d.ts +2 -0
  635. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalOutput.js +8 -0
  636. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -0
  637. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +27 -8
  638. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +205 -0
  639. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +1580 -0
  640. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.d.ts +30 -0
  641. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +175 -0
  642. package/vscode/src/vs/workbench/services/agentEditorComments/browser/media/agentEditorCommentsOverlayWidget.css +65 -0
  643. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.d.ts +47 -0
  644. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.js +129 -0
  645. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +26 -8
  646. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +89 -27
  647. package/vscode/src/vs/workbench/services/agentHost/browser/webAgentHostEnablementService.d.ts +8 -0
  648. package/vscode/src/vs/workbench/services/agentHost/browser/webAgentHostEnablementService.js +28 -0
  649. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +5 -1
  650. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.d.ts +18 -18
  651. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.js +159 -60
  652. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.d.ts +47 -0
  653. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.js +362 -0
  654. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.d.ts +0 -1
  655. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.js +0 -40
  656. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +0 -1110
  657. package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +0 -76
  658. package/vscode/src/vs/platform/agentHost/common/agentHostResourceService.d.ts +0 -63
  659. package/vscode/src/vs/platform/agentHost/common/agentHostResourceService.js +0 -25
  660. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +0 -254
  661. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +0 -451
  662. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +0 -1294
  663. package/vscode/src/vs/platform/agentHost/common/agentService.js +0 -92
  664. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/errors.d.ts +0 -186
  665. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/errors.js +0 -10
  666. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +0 -42
  667. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.js +0 -7
  668. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.d.ts +0 -15
  669. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.js +0 -15
  670. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.d.ts +0 -2
  671. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +0 -19
  672. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +0 -243
  673. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.d.ts +0 -24
  674. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +0 -77
  675. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +0 -92
  676. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +0 -224
  677. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.d.ts +0 -23
  678. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.js +0 -52
  679. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.d.ts +0 -16
  680. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +0 -96
  681. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.d.ts +0 -27
  682. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.js +0 -152
  683. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.d.ts +0 -87
  684. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.js +0 -772
  685. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.d.ts +0 -30
  686. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.js +0 -29
  687. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.d.ts +0 -20
  688. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +0 -40
  689. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +0 -160
  690. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +0 -9
  691. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +0 -123
  692. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +0 -37
  693. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +0 -572
  694. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.d.ts +0 -125
  695. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.js +0 -399
  696. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.d.ts +0 -321
  697. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.js +0 -2117
  698. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.d.ts +0 -57
  699. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.js +0 -367
  700. package/vscode/src/vs/workbench/contrib/chat/common/automations/automation.d.ts +0 -78
  701. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.d.ts +0 -13
  702. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.d.ts +0 -11
  703. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.js +0 -6
  704. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.d.ts +0 -16
  705. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.js +0 -6
  706. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.d.ts +0 -46
  707. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.d.ts +0 -36
  708. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.js +0 -6
  709. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.d.ts +0 -12
  710. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.js +0 -6
  711. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +0 -9
  712. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +0 -6
  713. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -15
  714. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -177
  715. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
  716. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
  717. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -65
  718. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -264
  719. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -190
  720. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -865
  721. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
  722. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
  723. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
  724. /package/vscode/src/vs/{workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers → platform/terminal/common/autoApprove}/sedFileWriteParser.js +0 -0
  725. /package/vscode/src/vs/{platform/agentHost/common/agentHost.config.contribution.d.ts → workbench/contrib/chat/browser/agentSessionsConfiguration.d.ts} +0 -0
@@ -1,1110 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { TimeoutTimer, DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
- import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
5
- import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
6
- import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
- import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
8
- import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
9
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
10
- import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
11
- import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
12
- import { toFileSystemProviderErrorCode, FileSystemProviderErrorCode } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
13
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
14
- import { AgentHostCodexAgentEnabledSettingId, AgentSession } from '../common/agentService.js';
15
- import { createRemoteWatchHandle } from '../common/agentHostFileSystemProvider.js';
16
- import { AgentSubscriptionManager } from '../common/state/agentSubscription.js';
17
- import { agentHostAuthority, fromAgentHostUri, toAgentHostUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
18
- import { AgentHostResourcePermissionError } from '../common/agentHostResourceService.js';
19
- import { IAgentHostResourceService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostResourceService.service';
20
- import { ActionType } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/actions';
21
- import '@codingame/monaco-vscode-xterm-common/vscode/vs/platform/agentHost/common/state/protocol/common/notifications';
22
- import { ROOT_STATE_URI, isAhpRootChannel } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
23
- import { PROTOCOL_VERSION } from '../common/state/protocol/version/registry.js';
24
- import { ProtocolError, isJsonRpcRequest, isJsonRpcResponse, isJsonRpcNotification } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionProtocol';
25
- import { isClientTransport } from '../common/state/sessionTransport.js';
26
- import { AhpErrorCodes } from '../common/state/protocol/common/errors.js';
27
- import { ReconnectResultType, ContentEncoding } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/commands';
28
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/commands';
29
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/commands';
30
- import { encodeBase64 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
31
- import { LoadEstimator } from '@codingame/monaco-vscode-api/vscode/vs/base/parts/ipc/common/ipc.net';
32
- import { TELEMETRY_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_CRASH_REPORTER_SETTING_ID } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry';
33
- import { getTelemetryLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
34
- import { SESSION_SYNC_ENABLED_SETTING_ID, TERMINAL_AUTO_APPROVE_ENABLED_SETTING_ID, GLOBAL_AUTO_APPROVE_SETTING_ID, AUTO_REPLY_SETTING_ID, TERMINAL_AUTO_APPROVE_SETTING_ID, TERMINAL_IGNORE_DEFAULT_AUTO_APPROVE_RULES_SETTING_ID, AgentHostTelemetryLevelConfigKey, telemetryLevelToAgentHostConfigValue, AgentHostSessionSyncEnabledConfigKey, AgentHostTerminalAutoApproveEnabledConfigKey, AgentHostGlobalAutoApproveEnabledConfigKey, AgentHostAutoReplyEnabledConfigKey, AgentHostCodexEnabledConfigKey, AgentHostTerminalAutoApproveRulesConfigKey, getAgentHostTerminalAutoApproveRulesConfig } from '../common/agentHostSchema.js';
35
- import { dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
36
- import { isFileResourceRead } from '../common/resourceReadLogging.js';
37
- import { SessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
38
-
39
- const AHP_CLIENT_CONNECTION_CLOSED = -32e3;
40
- const RECONNECT_INITIAL_DELAY_MS = 1_000;
41
- const RECONNECT_MAX_DELAY_MS = 30_000;
42
- const PING_INTERVAL_MS = 5_000;
43
- const LIVENESS_TIMEOUT_MS = 20_000;
44
- function connectionTimeoutError(address, silenceMs) {
45
- return ( new ProtocolError(
46
- AHP_CLIENT_CONNECTION_CLOSED,
47
- `Connection appears dead: ${address}; no message received for ${silenceMs}ms.`
48
- ));
49
- }
50
- function connectionClosedError(address) {
51
- return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Connection closed: ${address}`));
52
- }
53
- function connectionDisposedError(address) {
54
- return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Connection disposed: ${address}`));
55
- }
56
- function transportLostError(address) {
57
- return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Transport lost (reconnecting): ${address}`));
58
- }
59
- var AgentHostClientState;
60
- (function(AgentHostClientState) {
61
- AgentHostClientState["Connecting"] = "connecting";
62
- AgentHostClientState["Connected"] = "connected";
63
- AgentHostClientState["Reconnecting"] = "reconnecting";
64
- AgentHostClientState["Closed"] = "closed";
65
- })(AgentHostClientState || (AgentHostClientState = {}));
66
- let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends Disposable {
67
- get clientId() {
68
- return this._clientId;
69
- }
70
- get address() {
71
- return this._address;
72
- }
73
- get defaultDirectory() {
74
- return this._defaultDirectory;
75
- }
76
- get connectionState() {
77
- return this._state.kind;
78
- }
79
- get initializeResult() {
80
- return this._initializeResult;
81
- }
82
- constructor(
83
- address,
84
- transportOrFactory,
85
- loadEstimator,
86
- _logService,
87
- _resourceService,
88
- _configurationService
89
- ) {
90
- super();
91
- this._logService = _logService;
92
- this._resourceService = _resourceService;
93
- this._configurationService = _configurationService;
94
- this._clientId = generateUuid();
95
- this._transportListeners = this._register(( new MutableDisposable()));
96
- this._serverSeq = 0;
97
- this._nextClientSeq = 1;
98
- this._onDidAction = this._register(( new Emitter()));
99
- this.onDidAction = this._onDidAction.event;
100
- this._onDidNotification = this._register(( new Emitter()));
101
- this.onDidNotification = this._onDidNotification.event;
102
- this._onMcpNotification = this._register(( new Emitter()));
103
- this.onMcpNotification = this._onMcpNotification.event;
104
- this._onDidReceiveOtlpLogs = this._register(( new Emitter()));
105
- this.onDidReceiveOtlpLogs = this._onDidReceiveOtlpLogs.event;
106
- this._onDidClose = this._register(( new Emitter()));
107
- this.onDidClose = this._onDidClose.event;
108
- this._onDidChangeConnectionState = this._register(( new Emitter()));
109
- this.onDidChangeConnectionState = this._onDidChangeConnectionState.event;
110
- this._state = {
111
- kind: AgentHostClientState.Connecting
112
- };
113
- this._pendingRequests = ( new Map());
114
- this._nextRequestId = 1;
115
- this._lastReadTime = Date.now();
116
- this._pingTimer = this._register(new TimeoutTimer());
117
- this._closeTimer = this._register(new TimeoutTimer());
118
- this._grantedCustomizationUris = ( new Set());
119
- this._address = address;
120
- this._connectionAuthority = agentHostAuthority(address);
121
- this._loadEstimator = loadEstimator ?? LoadEstimator.getInstance();
122
- if (typeof transportOrFactory === "function") {
123
- this._transportFactory = transportOrFactory;
124
- this._installTransport(transportOrFactory());
125
- } else {
126
- this._transportFactory = undefined;
127
- this._installTransport(transportOrFactory);
128
- }
129
- this._subscriptionManager = this._register(( new AgentSubscriptionManager(
130
- this._clientId,
131
- () => this.nextClientSeq(),
132
- msg => this._logService.warn(`[RemoteAgentHostProtocolClient] ${msg}`),
133
- resource => this.subscribe(resource),
134
- resource => this.unsubscribe(resource)
135
- )));
136
- this._register(this.onDidAction(envelope => {
137
- this._subscriptionManager.receiveEnvelope(envelope);
138
- }));
139
- this._register(this._configurationService.onDidChangeConfiguration(e => {
140
- if (e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID) || e.affectsConfiguration(TELEMETRY_CRASH_REPORTER_SETTING_ID)) {
141
- if (this._state.kind !== AgentHostClientState.Connected) {
142
- return;
143
- }
144
- this._updateTelemetryLevel();
145
- }
146
- if (e.affectsConfiguration(SESSION_SYNC_ENABLED_SETTING_ID)) {
147
- if (this._state.kind !== AgentHostClientState.Connected) {
148
- return;
149
- }
150
- this._updateSessionSyncEnabled();
151
- }
152
- if (e.affectsConfiguration(TERMINAL_AUTO_APPROVE_ENABLED_SETTING_ID)) {
153
- if (this._state.kind !== AgentHostClientState.Connected) {
154
- return;
155
- }
156
- this._updateTerminalAutoApproveEnabled();
157
- }
158
- if (e.affectsConfiguration(GLOBAL_AUTO_APPROVE_SETTING_ID)) {
159
- if (this._state.kind !== AgentHostClientState.Connected) {
160
- return;
161
- }
162
- this._updateGlobalAutoApproveEnabled();
163
- }
164
- if (e.affectsConfiguration(AUTO_REPLY_SETTING_ID)) {
165
- if (this._state.kind !== AgentHostClientState.Connected) {
166
- return;
167
- }
168
- this._updateAutoReplyEnabled();
169
- }
170
- if (e.affectsConfiguration(TERMINAL_AUTO_APPROVE_SETTING_ID) || e.affectsConfiguration(TERMINAL_IGNORE_DEFAULT_AUTO_APPROVE_RULES_SETTING_ID)) {
171
- if (this._state.kind !== AgentHostClientState.Connected) {
172
- return;
173
- }
174
- this._updateTerminalAutoApproveRules();
175
- }
176
- if (e.affectsConfiguration(AgentHostCodexAgentEnabledSettingId)) {
177
- if (this._state.kind !== AgentHostClientState.Connected) {
178
- return;
179
- }
180
- this._updateCodexEnabled();
181
- }
182
- }));
183
- this._resetLivenessTimers();
184
- }
185
- _installTransport(transport) {
186
- const listeners = ( new DisposableStore());
187
- listeners.add(transport);
188
- listeners.add(transport.onMessage(msg => this._handleMessage(msg)));
189
- listeners.add(transport.onClose(() => this._handleTransportClose()));
190
- this._transport = transport;
191
- this._transportListeners.value = listeners;
192
- }
193
- _transitionTo(next) {
194
- if (this._state.kind === next.kind) {
195
- return;
196
- }
197
- this._state = next;
198
- this._onDidChangeConnectionState.fire(next.kind);
199
- }
200
- _newReconnectGate() {
201
- const deferred = ( new DeferredPromise());
202
- deferred.p.then(undefined, () => {});
203
- return deferred;
204
- }
205
- _newReconnectState() {
206
- return {
207
- gate: this._newReconnectGate(),
208
- outbox: [],
209
- attempt: 0,
210
- timeoutHandle: undefined
211
- };
212
- }
213
- dispose() {
214
- this._handleClose(connectionDisposedError(this._address));
215
- super.dispose();
216
- }
217
- async connect() {
218
- if (isClientTransport(this._transport)) {
219
- await this._raceClose(this._transport.connect());
220
- }
221
- const result = await this._sendRequest("initialize", {
222
- channel: ROOT_STATE_URI,
223
- protocolVersions: [PROTOCOL_VERSION],
224
- clientId: this._clientId,
225
- initialSubscriptions: [ROOT_STATE_URI]
226
- });
227
- this._serverSeq = result.serverSeq;
228
- for (const snapshot of result.snapshots ?? []) {
229
- if (isAhpRootChannel(snapshot.resource)) {
230
- this._subscriptionManager.handleRootSnapshot(snapshot.state, snapshot.fromSeq);
231
- }
232
- }
233
- if (result.defaultDirectory) {
234
- const dir = result.defaultDirectory;
235
- if (typeof dir === "string") {
236
- this._defaultDirectory = ( URI.parse(dir)).path;
237
- } else {
238
- this._defaultDirectory = URI.revive(dir).path;
239
- }
240
- }
241
- this._initializeResult = result;
242
- this._updateTelemetryLevel();
243
- this._updateSessionSyncEnabled();
244
- this._updateTerminalAutoApproveEnabled();
245
- this._updateGlobalAutoApproveEnabled();
246
- this._updateAutoReplyEnabled();
247
- this._updateTerminalAutoApproveRules();
248
- this._updateCodexEnabled();
249
- this._transitionTo({
250
- kind: AgentHostClientState.Connected
251
- });
252
- }
253
- notifyTransportClosed() {
254
- this._handleTransportClose();
255
- }
256
- _handleTransportClose() {
257
- switch (this._state.kind) {
258
- case AgentHostClientState.Closed:
259
- return;
260
- case AgentHostClientState.Connecting:
261
- this._handleClose(connectionClosedError(this._address));
262
- return;
263
- case AgentHostClientState.Connected:
264
- {
265
- if (!this._transportFactory) {
266
- this._handleClose(connectionClosedError(this._address));
267
- return;
268
- }
269
- this._logService.info(
270
- `[RemoteAgentHostProtocol] Transport lost for ${this._address}; scheduling reconnect.`
271
- );
272
- this._transitionTo({
273
- kind: AgentHostClientState.Reconnecting,
274
- reconnect: this._newReconnectState()
275
- });
276
- this._cancelLivenessTimers();
277
- this._rejectPendingRequests(transportLostError(this._address));
278
- this._scheduleReconnect();
279
- return;
280
- }
281
- case AgentHostClientState.Reconnecting:
282
- this._logService.info(
283
- `[RemoteAgentHostProtocol] Transport lost for ${this._address} mid-reconnect; aborting the current attempt.`
284
- );
285
- this._cancelLivenessTimers();
286
- this._rejectPendingRequests(transportLostError(this._address));
287
- return;
288
- }
289
- }
290
- _scheduleReconnect() {
291
- if (this._state.kind !== AgentHostClientState.Reconnecting || !this._transportFactory) {
292
- return;
293
- }
294
- const reconnect = this._state.reconnect;
295
- if (reconnect.timeoutHandle !== undefined) {
296
- return;
297
- }
298
- const attempt = reconnect.attempt + 1;
299
- const delay = Math.min(
300
- RECONNECT_INITIAL_DELAY_MS * Math.pow(2, attempt - 1),
301
- RECONNECT_MAX_DELAY_MS
302
- );
303
- this._logService.info(
304
- `[RemoteAgentHostProtocol] Reconnecting to ${this._address} in ${delay}ms (attempt ${attempt}).`
305
- );
306
- reconnect.timeoutHandle = setTimeout(() => {
307
- if (this._state.kind === AgentHostClientState.Reconnecting) {
308
- this._state.reconnect.timeoutHandle = undefined;
309
- }
310
- void this._attemptReconnect();
311
- }, delay);
312
- }
313
- async _attemptReconnect() {
314
- if (this._state.kind !== AgentHostClientState.Reconnecting || !this._transportFactory) {
315
- return;
316
- }
317
- const reconnect = this._state.reconnect;
318
- reconnect.attempt++;
319
- let transport;
320
- try {
321
- transport = this._transportFactory();
322
- this._installTransport(transport);
323
- if (isClientTransport(transport)) {
324
- await transport.connect();
325
- }
326
- if (this._state.kind !== AgentHostClientState.Reconnecting) {
327
- return;
328
- }
329
- const subscriptions = ( this._subscriptionManager.currentSubscriptionUris().map(u => ( u.toString())));
330
- if (!subscriptions.includes(ROOT_STATE_URI)) {
331
- subscriptions.unshift(ROOT_STATE_URI);
332
- }
333
- const lastSeenServerSeq = this._serverSeq;
334
- const result = await this._dispatchRequest("reconnect", {
335
- clientId: this._clientId,
336
- lastSeenServerSeq,
337
- subscriptions
338
- }, {
339
- bypassReconnectGate: true
340
- });
341
- if (this._state.kind !== AgentHostClientState.Reconnecting) {
342
- return;
343
- }
344
- this._applyReconnectResult(result);
345
- const {
346
- gate
347
- } = reconnect;
348
- this._drainAfterReconnect(reconnect.outbox);
349
- this._lastReadTime = Date.now();
350
- this._resetLivenessTimers();
351
- this._transitionTo({
352
- kind: AgentHostClientState.Connected
353
- });
354
- gate.complete();
355
- this._logService.info(`[RemoteAgentHostProtocol] Reconnected to ${this._address}.`);
356
- } catch (err) {
357
- this._logService.warn(
358
- `[RemoteAgentHostProtocol] Reconnect attempt failed for ${this._address}: ${err instanceof Error ? err.message : String(err)}`
359
- );
360
- transport?.dispose();
361
- if (this._state.kind !== AgentHostClientState.Reconnecting) {
362
- return;
363
- }
364
- const oldGate = this._state.reconnect.gate;
365
- this._state.reconnect.gate = this._newReconnectGate();
366
- oldGate.error(err);
367
- this._scheduleReconnect();
368
- }
369
- }
370
- _applyReconnectResult(result) {
371
- if (result.type === ReconnectResultType.Replay) {
372
- let maxSeq = this._serverSeq;
373
- for (const envelope of result.actions) {
374
- if (envelope.origin?.clientId === this._clientId && envelope.origin.clientSeq !== undefined && !envelope.rejectionReason) {
375
- this._subscriptionManager.dropPendingSessionAction(envelope.channel, envelope.origin.clientSeq);
376
- }
377
- if (envelope.serverSeq > maxSeq) {
378
- maxSeq = envelope.serverSeq;
379
- }
380
- this._onDidAction.fire(envelope);
381
- }
382
- this._serverSeq = maxSeq;
383
- if (result.missing.length > 0) {
384
- this._logService.info(
385
- `[RemoteAgentHostProtocol] Server cannot resume ${result.missing.length} subscription(s) after reconnect.`
386
- );
387
- this._subscriptionManager.markSubscriptionsMissing(( result.missing.map(u => ( URI.parse(u)))));
388
- }
389
- } else {
390
- let maxSeq = this._serverSeq;
391
- for (const snapshot of result.snapshots) {
392
- this._subscriptionManager.applyReconnectSnapshot(snapshot.resource, snapshot.state, snapshot.fromSeq);
393
- if (snapshot.fromSeq > maxSeq) {
394
- maxSeq = snapshot.fromSeq;
395
- }
396
- }
397
- this._serverSeq = maxSeq;
398
- }
399
- }
400
- _drainAfterReconnect(outbox) {
401
- const queuedSeqs = ( new Set());
402
- for (const msg of outbox) {
403
- if (hasKey(msg, {
404
- method: true
405
- }) && msg.method === "dispatchAction") {
406
- queuedSeqs.add(msg.params.clientSeq);
407
- }
408
- }
409
- const replays = [];
410
- for (const entry of this._subscriptionManager.getPendingSessionActions()) {
411
- if (( queuedSeqs.has(entry.clientSeq))) {
412
- continue;
413
- }
414
- this._grantImplicitReadsForOutgoingAction(entry.action);
415
- replays.push({
416
- jsonrpc: "2.0",
417
- method: "dispatchAction",
418
- params: {
419
- channel: entry.channel,
420
- clientSeq: entry.clientSeq,
421
- action: entry.action
422
- }
423
- });
424
- }
425
- if (replays.length > 0) {
426
- this._logService.info(
427
- `[RemoteAgentHostProtocol] Replaying ${replays.length} pending action(s) after reconnect to ${this._address}.`
428
- );
429
- }
430
- for (const msg of replays) {
431
- this._transport.send(msg);
432
- }
433
- for (const msg of outbox) {
434
- this._transport.send(msg);
435
- }
436
- }
437
- get rootState() {
438
- return this._subscriptionManager.rootState;
439
- }
440
- getSubscription(kind, resource, owner) {
441
- return this._subscriptionManager.getSubscription(kind, resource, owner);
442
- }
443
- getSubscriptionUnmanaged(_kind, resource) {
444
- return this._subscriptionManager.getSubscriptionUnmanaged(resource);
445
- }
446
- getInflightSessionCreate(resource) {
447
- return this._subscriptionManager.getInflightSessionCreate(resource);
448
- }
449
- getActiveSubscriptions() {
450
- return this._subscriptionManager.getActiveSubscriptions();
451
- }
452
- dispatch(channel, action) {
453
- const seq = this._subscriptionManager.dispatchOptimistic(channel, action);
454
- this.dispatchAction(channel, action, this._clientId, seq);
455
- }
456
- async subscribe(resource) {
457
- const result = await this._sendRequest("subscribe", {
458
- channel: ( resource.toString())
459
- });
460
- if (!result.snapshot) {
461
- throw ( new Error(`subscribe to ${( resource.toString())} returned no snapshot`));
462
- }
463
- return result.snapshot;
464
- }
465
- async subscribeStateless(resource) {
466
- await this._sendRequest("subscribe", {
467
- channel: ( resource.toString())
468
- });
469
- }
470
- unsubscribe(resource) {
471
- this._sendNotification("unsubscribe", {
472
- channel: ( resource.toString())
473
- });
474
- }
475
- dispatchAction(channel, action, _clientId, clientSeq) {
476
- this._grantImplicitReadsForOutgoingAction(action);
477
- this._sendNotification("dispatchAction", {
478
- channel,
479
- clientSeq,
480
- action
481
- });
482
- }
483
- createSession(config) {
484
- const provider = config?.provider;
485
- if (!provider) {
486
- throw ( new Error("Cannot create remote agent host session without a provider."));
487
- }
488
- const session = config?.session ?? AgentSession.uri(provider, generateUuid());
489
- if (config?.activeClient?.customizations) {
490
- this._grantImplicitReadsForCustomizations(config.activeClient.customizations);
491
- }
492
- const promise = this._sendRequest("createSession", {
493
- channel: ( session.toString()),
494
- provider,
495
- workingDirectory: config?.workingDirectory ? ( fromAgentHostUri(config.workingDirectory).toString()) : undefined,
496
- config: config?.config,
497
- activeClient: config?.activeClient
498
- }).then(() => session);
499
- this._subscriptionManager.trackSessionCreate(session, promise);
500
- return promise;
501
- }
502
- async resolveSessionConfig(params) {
503
- return this._sendRequest("resolveSessionConfig", {
504
- channel: ROOT_STATE_URI,
505
- provider: params.provider,
506
- workingDirectory: params.workingDirectory ? ( fromAgentHostUri(params.workingDirectory).toString()) : undefined,
507
- config: params.config
508
- });
509
- }
510
- async sessionConfigCompletions(params) {
511
- return this._sendRequest("sessionConfigCompletions", {
512
- channel: ROOT_STATE_URI,
513
- provider: params.provider,
514
- workingDirectory: params.workingDirectory ? ( fromAgentHostUri(params.workingDirectory).toString()) : undefined,
515
- config: params.config,
516
- property: params.property,
517
- query: params.query
518
- });
519
- }
520
- async completions(params) {
521
- return this._sendRequest("completions", params);
522
- }
523
- async ping() {
524
- await this._sendRequest("ping", {
525
- channel: ROOT_STATE_URI
526
- });
527
- }
528
- async getCompletionTriggerCharacters() {
529
- return this._initializeResult?.completionTriggerCharacters ?? [];
530
- }
531
- async authenticate(params) {
532
- await this._sendRequest("authenticate", {
533
- channel: ROOT_STATE_URI,
534
- ...params
535
- });
536
- return {
537
- authenticated: true
538
- };
539
- }
540
- async shutdown() {
541
- await this._sendExtensionRequest("shutdown");
542
- }
543
- async disposeSession(session) {
544
- await this._sendRequest("disposeSession", {
545
- channel: ( session.toString())
546
- });
547
- }
548
- async createChat(session, chat, options) {
549
- await this._sendRequest("createChat", {
550
- channel: ( session.toString()),
551
- chat: ( chat.toString()),
552
- ...(options?.fork ? {
553
- source: {
554
- chat: ( options.fork.source.toString()),
555
- turnId: options.fork.turnId
556
- }
557
- } : {})
558
- });
559
- }
560
- async disposeChat(chat) {
561
- await this._sendRequest("disposeChat", {
562
- channel: ( chat.toString())
563
- });
564
- }
565
- async createTerminal(params) {
566
- await this._sendRequest("createTerminal", params);
567
- }
568
- async disposeTerminal(terminal) {
569
- await this._sendRequest("disposeTerminal", {
570
- channel: ( terminal.toString())
571
- });
572
- }
573
- async invokeChangesetOperation(params) {
574
- return await this._sendRequest("invokeChangesetOperation", params);
575
- }
576
- async handleMcpRequest(channel, method, params) {
577
- return await this._dispatchRequest(method, {
578
- ...(params ?? {}),
579
- channel
580
- });
581
- }
582
- async listSessions() {
583
- const result = await this._sendRequest("listSessions", {
584
- channel: ROOT_STATE_URI
585
- });
586
- return ( result.items.map(s => ({
587
- session: ( URI.parse(s.resource)),
588
- startTime: Date.parse(s.createdAt),
589
- modifiedTime: Date.parse(s.modifiedAt),
590
- ...(s.project ? {
591
- project: {
592
- uri: this._toLocalProjectUri(( URI.parse(s.project.uri))),
593
- displayName: s.project.displayName
594
- }
595
- } : {}),
596
- summary: s.title,
597
- status: s.status,
598
- activity: s.activity,
599
- workingDirectory: typeof s.workingDirectory === "string" ? toAgentHostUri(( URI.parse(s.workingDirectory)), this._connectionAuthority) : undefined,
600
- isRead: !!(s.status & SessionStatus.IsRead),
601
- isArchived: !!(s.status & SessionStatus.IsArchived),
602
- changes: s.changes
603
- })));
604
- }
605
- _toLocalProjectUri(uri) {
606
- return uri.scheme === Schemas.file ? toAgentHostUri(uri, this._connectionAuthority) : uri;
607
- }
608
- _grantImplicitReadsForOutgoingAction(action) {
609
- if (action.type === ActionType.SessionActiveClientSet && action.activeClient.customizations) {
610
- this._grantImplicitReadsForCustomizations(action.activeClient.customizations);
611
- }
612
- }
613
- _grantImplicitReadsForCustomizations(refs) {
614
- for (const ref of refs) {
615
- let uri;
616
- try {
617
- uri = ( URI.parse(ref.uri));
618
- } catch {
619
- continue;
620
- }
621
- const grantUri = dirname(uri);
622
- const key = ( grantUri.toString());
623
- if (( this._grantedCustomizationUris.has(key))) {
624
- continue;
625
- }
626
- this._grantedCustomizationUris.add(key);
627
- this._resourceService.grantImplicitRead(this._address, grantUri);
628
- }
629
- }
630
- async resourceList(uri) {
631
- return await this._sendRequest("resourceList", {
632
- channel: ROOT_STATE_URI,
633
- uri: ( uri.toString())
634
- });
635
- }
636
- async resourceRead(uri) {
637
- return this._sendRequest("resourceRead", {
638
- channel: ROOT_STATE_URI,
639
- uri: ( uri.toString())
640
- });
641
- }
642
- async resourceWrite(params) {
643
- return this._sendRequest("resourceWrite", params);
644
- }
645
- async resourceCopy(params) {
646
- return this._sendRequest("resourceCopy", params);
647
- }
648
- async resourceDelete(params) {
649
- return this._sendRequest("resourceDelete", params);
650
- }
651
- async resourceMove(params) {
652
- return this._sendRequest("resourceMove", params);
653
- }
654
- async resourceResolve(params) {
655
- return this._sendRequest("resourceResolve", params);
656
- }
657
- async resourceMkdir(params) {
658
- return this._sendRequest("resourceMkdir", params);
659
- }
660
- async createResourceWatch(params) {
661
- return this._sendRequest("createResourceWatch", params);
662
- }
663
- watchResource(params) {
664
- return createRemoteWatchHandle({
665
- createResourceWatch: p => this.createResourceWatch(p),
666
- subscribe: uri => this.subscribe(uri),
667
- unsubscribe: uri => this.unsubscribe(uri),
668
- onDidAction: this.onDidAction
669
- }, params);
670
- }
671
- triggerVscodeUpgrade(method) {
672
- return this._dispatchRequest(method, {});
673
- }
674
- _handleMessage(msg) {
675
- if (this._state.kind === AgentHostClientState.Closed) {
676
- return;
677
- }
678
- this._lastReadTime = Date.now();
679
- this._resetLivenessTimers();
680
- if (isJsonRpcRequest(msg)) {
681
- this._handleReverseRequest(msg.id, msg.method, msg.params);
682
- } else if (isJsonRpcResponse(msg)) {
683
- const pending = this._pendingRequests.get(msg.id);
684
- if (pending) {
685
- this._pendingRequests.delete(msg.id);
686
- if (hasKey(msg, {
687
- error: true
688
- })) {
689
- if (this._shouldLogFailedRequest(pending, msg.error)) {
690
- this._logService.warn(`[RemoteAgentHostProtocol] Request ${msg.id} failed:`, msg.error);
691
- }
692
- pending.deferred.error(this._toProtocolError(msg.error));
693
- } else {
694
- pending.deferred.complete(msg.result);
695
- }
696
- } else {
697
- this._logService.warn(
698
- `[RemoteAgentHostProtocol] Received response for unknown request id ${msg.id}`
699
- );
700
- }
701
- } else if (isJsonRpcNotification(msg)) {
702
- switch (msg.method) {
703
- case "action":
704
- {
705
- const envelope = msg.params;
706
- this._serverSeq = Math.max(this._serverSeq, envelope.serverSeq);
707
- this._onDidAction.fire(envelope);
708
- break;
709
- }
710
- case "root/sessionAdded":
711
- case "root/sessionRemoved":
712
- case "root/sessionSummaryChanged":
713
- case "root/progress":
714
- case "auth/required":
715
- {
716
- this._logService.trace(`[RemoteAgentHostProtocol] Notification: ${msg.method}`);
717
- this._onDidNotification.fire({
718
- type: msg.method,
719
- ...msg.params
720
- });
721
- break;
722
- }
723
- case "otlp/exportLogs":
724
- this._onDidReceiveOtlpLogs.fire(msg.params);
725
- break;
726
- case "otlp/exportTraces":
727
- case "otlp/exportMetrics":
728
- break;
729
- default:
730
- {
731
- const rawChannel = msg.params && typeof msg.params === "object" ? msg.params.channel : undefined;
732
- if (typeof rawChannel === "string" && rawChannel.toLowerCase().startsWith("mcp:/")) {
733
- const {
734
- channel: _channel,
735
- ...rest
736
- } = msg.params;
737
- this._onMcpNotification.fire({
738
- channel: rawChannel,
739
- method: msg.method,
740
- params: rest
741
- });
742
- break;
743
- }
744
- this._logService.trace(`[RemoteAgentHostProtocol] Unhandled method: ${msg.method}`);
745
- break;
746
- }
747
- }
748
- } else {
749
- this._logService.warn(`[RemoteAgentHostProtocol] Unrecognized message:`, JSON.stringify(msg));
750
- }
751
- }
752
- _handleClose(error) {
753
- if (this._state.kind === AgentHostClientState.Closed) {
754
- return;
755
- }
756
- this._cancelLivenessTimers();
757
- if (this._state.kind === AgentHostClientState.Reconnecting) {
758
- const reconnect = this._state.reconnect;
759
- if (reconnect.timeoutHandle !== undefined) {
760
- clearTimeout(reconnect.timeoutHandle);
761
- }
762
- if (!reconnect.gate.isSettled) {
763
- reconnect.gate.error(error);
764
- }
765
- }
766
- this._rejectPendingRequests(error);
767
- this._resourceService.connectionClosed(this._address);
768
- this._grantedCustomizationUris.clear();
769
- this._transitionTo({
770
- kind: AgentHostClientState.Closed,
771
- error
772
- });
773
- this._onDidClose.fire();
774
- }
775
- async _raceClose(promise) {
776
- if (this._state.kind === AgentHostClientState.Closed) {
777
- return Promise.reject(this._state.error);
778
- }
779
- let closeListener = Disposable.None;
780
- const closePromise = ( new Promise((_resolve, reject) => {
781
- closeListener = this.onDidClose(() => reject(
782
- this._state.kind === AgentHostClientState.Closed ? this._state.error : connectionClosedError(this._address)
783
- ));
784
- }));
785
- try {
786
- return await Promise.race([promise, closePromise]);
787
- } finally {
788
- closeListener.dispose();
789
- }
790
- }
791
- _handleReverseRequest(id, method, params) {
792
- const transport = this._transport;
793
- const sendResult = result => {
794
- transport.send({
795
- jsonrpc: "2.0",
796
- id,
797
- result
798
- });
799
- };
800
- const sendError = err => {
801
- if (err instanceof AgentHostResourcePermissionError) {
802
- transport.send({
803
- jsonrpc: "2.0",
804
- id,
805
- error: {
806
- code: AhpErrorCodes.PermissionDenied,
807
- message: err.message,
808
- data: err.request ? {
809
- request: err.request
810
- } : undefined
811
- }
812
- });
813
- return;
814
- }
815
- const fsCode = toFileSystemProviderErrorCode(err instanceof Error ? err : undefined);
816
- let code = -32e3;
817
- switch (fsCode) {
818
- case FileSystemProviderErrorCode.FileNotFound:
819
- code = AhpErrorCodes.NotFound;
820
- break;
821
- case FileSystemProviderErrorCode.NoPermissions:
822
- code = AhpErrorCodes.PermissionDenied;
823
- break;
824
- case FileSystemProviderErrorCode.FileExists:
825
- code = AhpErrorCodes.AlreadyExists;
826
- break;
827
- }
828
- transport.send({
829
- jsonrpc: "2.0",
830
- id,
831
- error: {
832
- code,
833
- message: err instanceof Error ? err.message : String(err)
834
- }
835
- });
836
- };
837
- const p = (params ?? {});
838
- const addr = this._address;
839
- void (async () => {
840
- try {
841
- switch (method) {
842
- case "resourceList":
843
- {
844
- if (!p.uri) {
845
- throw ( new Error("Missing uri"));
846
- }
847
- const result = await this._resourceService.list(addr, ( URI.parse(p.uri)));
848
- sendResult({
849
- entries: result.entries
850
- });
851
- return;
852
- }
853
- case "resourceRead":
854
- {
855
- if (!p.uri) {
856
- throw ( new Error("Missing uri"));
857
- }
858
- const result = await this._resourceService.read(addr, ( URI.parse(p.uri)));
859
- sendResult({
860
- data: encodeBase64(result.bytes),
861
- encoding: ContentEncoding.Base64
862
- });
863
- return;
864
- }
865
- case "resourceWrite":
866
- {
867
- if (!p.uri || p.data === undefined) {
868
- throw ( new Error("Missing uri or data"));
869
- }
870
- await this._resourceService.write(addr, p);
871
- sendResult({});
872
- return;
873
- }
874
- case "resourceDelete":
875
- {
876
- if (!p.uri) {
877
- throw ( new Error("Missing uri"));
878
- }
879
- await this._resourceService.del(addr, p);
880
- sendResult({});
881
- return;
882
- }
883
- case "resourceMove":
884
- {
885
- if (!p.source || !p.destination) {
886
- throw ( new Error("Missing source or destination"));
887
- }
888
- await this._resourceService.move(addr, p);
889
- sendResult({});
890
- return;
891
- }
892
- case "resourceCopy":
893
- {
894
- if (!p.source || !p.destination) {
895
- throw ( new Error("Missing source or destination"));
896
- }
897
- await this._resourceService.copy(addr, p);
898
- sendResult({});
899
- return;
900
- }
901
- case "resourceResolve":
902
- {
903
- if (!p.uri) {
904
- throw ( new Error("Missing uri"));
905
- }
906
- const result = await this._resourceService.resolve(addr, p);
907
- sendResult(result);
908
- return;
909
- }
910
- case "resourceMkdir":
911
- {
912
- if (!p.uri) {
913
- throw ( new Error("Missing uri"));
914
- }
915
- await this._resourceService.mkdir(addr, p);
916
- sendResult({});
917
- return;
918
- }
919
- case "resourceRequest":
920
- {
921
- try {
922
- await this._resourceService.request(addr, p);
923
- sendResult({});
924
- } catch (err) {
925
- if (err instanceof CancellationError) {
926
- throw ( new AgentHostResourcePermissionError(undefined));
927
- }
928
- throw err;
929
- }
930
- return;
931
- }
932
- default:
933
- this._logService.warn(`[RemoteAgentHostProtocol] Unhandled reverse request: ${method}`);
934
- throw ( new Error(`Unknown method: ${method}`));
935
- }
936
- } catch (err) {
937
- sendError(err);
938
- }
939
- })();
940
- }
941
- _sendNotification(method, params) {
942
- if (this._state.kind === AgentHostClientState.Closed) {
943
- return;
944
- }
945
- const message = {
946
- jsonrpc: "2.0",
947
- method,
948
- params
949
- };
950
- if (this._state.kind === AgentHostClientState.Reconnecting) {
951
- this._state.reconnect.outbox.push(message);
952
- return;
953
- }
954
- this._transport.send(message);
955
- }
956
- _sendRequest(method, params) {
957
- return this._dispatchRequest(method, params);
958
- }
959
- _sendExtensionRequest(method, params) {
960
- return this._dispatchRequest(method, params);
961
- }
962
- _updateTelemetryLevel() {
963
- this.dispatchAction(ROOT_STATE_URI, {
964
- type: ActionType.RootConfigChanged,
965
- config: {
966
- [AgentHostTelemetryLevelConfigKey]: telemetryLevelToAgentHostConfigValue(getTelemetryLevel(this._configurationService))
967
- }
968
- }, this._clientId, 0);
969
- }
970
- _updateSessionSyncEnabled() {
971
- const enabled = !!this._configurationService.getValue(SESSION_SYNC_ENABLED_SETTING_ID);
972
- this.dispatchAction(ROOT_STATE_URI, {
973
- type: ActionType.RootConfigChanged,
974
- config: {
975
- [AgentHostSessionSyncEnabledConfigKey]: enabled
976
- }
977
- }, this._clientId, 0);
978
- }
979
- _updateTerminalAutoApproveEnabled() {
980
- const enabled = this._configurationService.getValue(TERMINAL_AUTO_APPROVE_ENABLED_SETTING_ID) !== false;
981
- this.dispatchAction(ROOT_STATE_URI, {
982
- type: ActionType.RootConfigChanged,
983
- config: {
984
- [AgentHostTerminalAutoApproveEnabledConfigKey]: enabled
985
- }
986
- }, this._clientId, 0);
987
- }
988
- _updateGlobalAutoApproveEnabled() {
989
- const enabled = this._configurationService.getValue(GLOBAL_AUTO_APPROVE_SETTING_ID) === true;
990
- this.dispatchAction(ROOT_STATE_URI, {
991
- type: ActionType.RootConfigChanged,
992
- config: {
993
- [AgentHostGlobalAutoApproveEnabledConfigKey]: enabled
994
- }
995
- }, this._clientId, 0);
996
- }
997
- _updateAutoReplyEnabled() {
998
- const enabled = this._configurationService.getValue(AUTO_REPLY_SETTING_ID) === true;
999
- this.dispatchAction(ROOT_STATE_URI, {
1000
- type: ActionType.RootConfigChanged,
1001
- config: {
1002
- [AgentHostAutoReplyEnabledConfigKey]: enabled
1003
- }
1004
- }, this._clientId, 0);
1005
- }
1006
- _updateCodexEnabled() {
1007
- const enabled = this._configurationService.getValue(AgentHostCodexAgentEnabledSettingId) === true;
1008
- this.dispatchAction(ROOT_STATE_URI, {
1009
- type: ActionType.RootConfigChanged,
1010
- config: {
1011
- [AgentHostCodexEnabledConfigKey]: enabled
1012
- }
1013
- }, this._clientId, 0);
1014
- }
1015
- _updateTerminalAutoApproveRules() {
1016
- this.dispatchAction(ROOT_STATE_URI, {
1017
- type: ActionType.RootConfigChanged,
1018
- config: {
1019
- [AgentHostTerminalAutoApproveRulesConfigKey]: getAgentHostTerminalAutoApproveRulesConfig(this._configurationService)
1020
- }
1021
- }, this._clientId, 0);
1022
- }
1023
- async _dispatchRequest(method, params, options = {}) {
1024
- while (!options.bypassReconnectGate && this._state.kind === AgentHostClientState.Reconnecting) {
1025
- const current = this._state;
1026
- if (current.kind !== AgentHostClientState.Reconnecting) {
1027
- break;
1028
- }
1029
- try {
1030
- await current.reconnect.gate.p;
1031
- } catch {}
1032
- }
1033
- if (this._state.kind === AgentHostClientState.Closed) {
1034
- throw this._state.error;
1035
- }
1036
- const id = this._nextRequestId++;
1037
- const deferred = ( new DeferredPromise());
1038
- this._pendingRequests.set(id, {
1039
- deferred,
1040
- suppressNotFoundWarning: isFileResourceRead(method, params),
1041
- sentAt: Date.now()
1042
- });
1043
- const request = {
1044
- jsonrpc: "2.0",
1045
- id,
1046
- method,
1047
- params
1048
- };
1049
- this._transport.send(request);
1050
- return deferred.p;
1051
- }
1052
- _shouldLogFailedRequest(request, error) {
1053
- if (error.code === AhpErrorCodes.NotFound && request.suppressNotFoundWarning) {
1054
- return false;
1055
- }
1056
- return true;
1057
- }
1058
- _toProtocolError(error) {
1059
- return ( new ProtocolError(error.code, error.message, error.data));
1060
- }
1061
- _rejectPendingRequests(error) {
1062
- for (const pending of ( this._pendingRequests.values())) {
1063
- pending.deferred.error(error);
1064
- }
1065
- this._pendingRequests.clear();
1066
- }
1067
- _resetLivenessTimers() {
1068
- if (this._state.kind === AgentHostClientState.Reconnecting || this._state.kind === AgentHostClientState.Closed) {
1069
- return;
1070
- }
1071
- this._pingTimer.cancelAndSet(() => this._onPingTimer(), PING_INTERVAL_MS);
1072
- this._closeTimer.cancelAndSet(() => this._onCloseTimer(), PING_INTERVAL_MS + LIVENESS_TIMEOUT_MS);
1073
- }
1074
- _cancelLivenessTimers() {
1075
- this._pingTimer.cancel();
1076
- this._closeTimer.cancel();
1077
- }
1078
- _onPingTimer() {
1079
- if (this._state.kind === AgentHostClientState.Closed || this._state.kind === AgentHostClientState.Reconnecting) {
1080
- return;
1081
- }
1082
- void this.ping().catch(() => undefined);
1083
- }
1084
- _onCloseTimer() {
1085
- if (this._state.kind === AgentHostClientState.Closed || this._state.kind === AgentHostClientState.Reconnecting) {
1086
- return;
1087
- }
1088
- if (this._loadEstimator.hasHighLoad()) {
1089
- this._closeTimer.cancelAndSet(() => this._onCloseTimer(), PING_INTERVAL_MS);
1090
- return;
1091
- }
1092
- const silence = Date.now() - this._lastReadTime;
1093
- this._logService.info(
1094
- `[RemoteAgentHostProtocol] Liveness: no message from ${this._address} for ${silence}ms; forcing close to trigger reconnect.`
1095
- );
1096
- this._transportListeners.clear();
1097
- if (this._transportFactory) {
1098
- this._rejectPendingRequests(connectionTimeoutError(this._address, silence));
1099
- this._handleTransportClose();
1100
- return;
1101
- }
1102
- this._handleClose(connectionTimeoutError(this._address, silence));
1103
- }
1104
- nextClientSeq() {
1105
- return this._nextClientSeq++;
1106
- }
1107
- };
1108
- RemoteAgentHostProtocolClient = ( __decorate([( __param(3, ILogService)), ( __param(4, IAgentHostResourceService)), ( __param(5, IConfigurationService))], RemoteAgentHostProtocolClient));
1109
-
1110
- export { AgentHostClientState, RemoteAgentHostProtocolClient };