@codingame/monaco-vscode-chat-service-override 31.0.0 → 32.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 (341) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +21 -5
  3. package/package.json +5 -5
  4. package/vscode/src/vs/base/common/defaultAccount.d.ts +69 -0
  5. package/vscode/src/vs/base/common/defaultAccount.js +12 -0
  6. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +91 -22
  7. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +301 -68
  8. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +24 -5
  9. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +89 -16
  10. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +17 -5
  11. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +73 -10
  12. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +32 -6
  13. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +32 -20
  14. package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.d.ts +37 -0
  15. package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.js +15 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +242 -201
  17. package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
  18. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +35 -0
  19. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +106 -0
  20. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +38 -30
  21. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +2 -1
  22. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +114 -4
  23. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +10 -10
  24. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +52 -19
  25. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +42 -0
  26. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +7 -0
  27. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +42 -41
  28. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +6 -6
  29. package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +15 -0
  30. package/vscode/src/vs/platform/agentHost/common/transportConstants.js +6 -0
  31. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +4 -3
  32. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +4 -3
  33. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +4 -2
  34. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +15 -7
  35. package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.d.ts +19 -0
  36. package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.js +17 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
  40. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +14 -10
  41. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +64 -59
  42. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +31 -16
  44. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +18 -9
  45. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +16 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
  47. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +30 -5
  48. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  49. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +8 -7
  50. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  51. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  52. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  53. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +12 -12
  54. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  55. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +27 -18
  56. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
  58. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  59. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +21 -20
  60. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +22 -22
  61. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.d.ts +12 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +171 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +1 -1
  64. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
  65. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +4 -4
  66. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  67. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +1 -1
  68. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -2
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -10
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +28 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +99 -0
  72. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +2 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +11 -4
  74. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +9 -3
  75. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +63 -53
  76. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +2 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +10 -7
  78. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +3 -3
  79. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  80. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  81. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -4
  83. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -48
  84. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  85. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  86. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +5 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +8 -4
  88. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +99 -39
  89. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +2 -2
  90. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -30
  91. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +78 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +38 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +35 -37
  94. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +347 -326
  95. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +6 -2
  96. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +1 -11
  97. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +113 -109
  98. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +37 -15
  99. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +436 -134
  100. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
  101. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +2 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +52 -26
  103. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +7 -1
  104. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +13 -5
  106. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +23 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +60 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +25 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +93 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -2
  111. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +73 -104
  112. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +272 -41
  113. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +12 -2
  114. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +30 -1
  115. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +430 -185
  116. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +5 -2
  117. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +44 -3
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +480 -279
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.d.ts +138 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +221 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +84 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +1216 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +2 -1
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +32 -4
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +26 -19
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +28 -25
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +25 -24
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +2 -1
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +68 -33
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +650 -6
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +2 -2
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +29 -0
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +390 -0
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  153. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +18 -3
  154. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  155. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +11 -11
  156. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -2
  157. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
  159. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  160. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
  161. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -7
  162. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  163. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +1 -7
  164. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +6 -87
  165. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -1
  166. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +116 -182
  167. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +12 -39
  168. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +61 -41
  172. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  173. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  174. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +27 -27
  175. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -0
  176. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -13
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +20 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +106 -36
  179. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +25 -7
  180. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +629 -425
  181. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +9 -1
  182. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +105 -29
  183. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.d.ts +1 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +175 -148
  185. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +20 -33
  186. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +9 -2
  187. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  188. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  189. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  190. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  191. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  192. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.d.ts +58 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +339 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +160 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +9 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +123 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +37 -0
  199. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +572 -0
  200. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +36 -0
  201. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +167 -0
  202. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +49 -7
  203. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +315 -19
  204. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +45 -24
  205. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
  206. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  207. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  208. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +44 -40
  209. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
  210. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  211. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +4 -1
  212. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  213. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  214. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  215. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  216. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  217. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  218. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  219. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +9 -1
  220. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +111 -52
  221. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +3 -7
  222. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +13 -47
  223. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +3 -2
  224. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +4 -8
  225. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.d.ts +18 -0
  226. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +56 -0
  227. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -7
  228. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +14 -52
  229. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  230. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +3 -1
  231. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +17 -2
  232. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
  233. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +23 -12
  234. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +39 -0
  235. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +136 -0
  236. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +72 -0
  237. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +56 -0
  238. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +7 -0
  239. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +14 -1
  240. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +41 -26
  241. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +30 -12
  242. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  243. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  244. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +2 -5
  245. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +25 -6
  246. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  247. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -2
  248. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +5 -4
  249. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -0
  250. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +108 -45
  251. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +7 -3
  252. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +3 -1
  253. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +20 -1
  254. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +65 -26
  255. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +5 -3
  256. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +38 -11
  257. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +17 -1
  258. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +165 -16
  259. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +1 -0
  260. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +62 -1
  261. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  262. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -1
  263. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  264. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -3
  265. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +15 -21
  266. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +1 -3
  267. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +18 -24
  268. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +4 -2
  269. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +203 -180
  270. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  271. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +30 -0
  272. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +35 -0
  273. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +2 -1
  274. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +27 -2
  275. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -1
  276. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +14 -49
  277. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +0 -16
  278. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +35 -177
  279. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -8
  280. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -2
  281. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +2 -3
  282. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +4 -4
  283. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -11
  284. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +13 -13
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  289. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  290. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  291. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  292. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +29 -3
  293. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +129 -3
  294. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -2
  295. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +2 -1
  296. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -6
  297. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  298. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +1 -4
  299. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +12 -38
  300. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  301. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +4 -4
  302. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
  303. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +12 -7
  304. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +77 -70
  305. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.d.ts +32 -0
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +232 -0
  311. package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +83 -0
  312. package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.js +243 -0
  313. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +0 -749
  314. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +0 -14
  315. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +0 -17
  316. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +0 -5
  317. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +0 -40
  318. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +0 -14
  319. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +0 -61
  320. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +0 -638
  321. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -131
  322. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -363
  323. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -24
  324. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -306
  325. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +0 -23
  326. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +0 -97
  327. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatStatusWidget.css +0 -57
  328. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -50
  329. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -29
  330. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
  331. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -78
  332. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
  333. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
  334. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
  335. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
  336. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -242
  337. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1701
  338. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -191
  339. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -728
  340. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +0 -14
  341. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +0 -69
@@ -0,0 +1,232 @@
1
+
2
+ import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
3
+
4
+ function parseCommandHead(command) {
5
+ if (!command) {
6
+ return undefined;
7
+ }
8
+ const firstSegment = command.split(/[|;&]/)[0].trim();
9
+ if (!firstSegment) {
10
+ return undefined;
11
+ }
12
+ const tokens = firstSegment.split(/\s+/).filter(t => !/^[A-Z_][A-Z0-9_]*=/.test(t));
13
+ const head = tokens[0];
14
+ if (!head) {
15
+ return undefined;
16
+ }
17
+ let sub;
18
+ for (let i = 1; i < tokens.length; i++) {
19
+ if (tokens[i].startsWith("--")) {
20
+ continue;
21
+ }
22
+ sub = tokens[i];
23
+ break;
24
+ }
25
+ return {
26
+ head,
27
+ sub
28
+ };
29
+ }
30
+ function isTerminalInput(input) {
31
+ if (typeof input !== "object" || input === null) {
32
+ return false;
33
+ }
34
+ const terminalInput = input;
35
+ return terminalInput.command === undefined || typeof terminalInput.command === "string";
36
+ }
37
+ const gitDiffFilter = {
38
+ id: "terminal.git-diff",
39
+ toolIds: [TerminalToolId.RunInTerminal],
40
+ matches(_toolId, input) {
41
+ if (!isTerminalInput(input)) {
42
+ return false;
43
+ }
44
+ const parsed = parseCommandHead(input.command);
45
+ return parsed?.head === "git" && (parsed.sub === "diff" || parsed.sub === "show");
46
+ },
47
+ apply(text) {
48
+ const lines = text.split("\n");
49
+ const out = [];
50
+ const KEEP_CONTEXT = 1;
51
+ let contextRun = 0;
52
+ let inBinaryOrLock = false;
53
+ let pendingHunkHeaderIndex = -1;
54
+ let pendingHunkOldStart = 0;
55
+ let pendingHunkNewStart = 0;
56
+ let pendingOldLines = 0;
57
+ let pendingNewLines = 0;
58
+ const HUNK_RE = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;
59
+ const flushHunk = () => {
60
+ if (pendingHunkHeaderIndex < 0) {
61
+ return;
62
+ }
63
+ out[pendingHunkHeaderIndex] = `@@ -${pendingHunkOldStart},${pendingOldLines} +${pendingHunkNewStart},${pendingNewLines} @@`;
64
+ pendingHunkHeaderIndex = -1;
65
+ };
66
+ const flushContextRun = () => {
67
+ const omitted = contextRun - KEEP_CONTEXT;
68
+ if (omitted > 0) {
69
+ out.push(
70
+ `... ${omitted} unchanged context line${omitted === 1 ? "" : "s"} omitted ...`
71
+ );
72
+ }
73
+ contextRun = 0;
74
+ };
75
+ for (const line of lines) {
76
+ if (line.startsWith("diff --git")) {
77
+ flushContextRun();
78
+ flushHunk();
79
+ inBinaryOrLock = /package-lock\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb|\.snap$/.test(line);
80
+ if (inBinaryOrLock) {
81
+ out.push(line);
82
+ out.push("... lockfile/snapshot diff omitted ...");
83
+ continue;
84
+ }
85
+ out.push(line);
86
+ continue;
87
+ }
88
+ if (inBinaryOrLock) {
89
+ continue;
90
+ }
91
+ if (line.startsWith("index ") || line.startsWith("similarity index ") || line.startsWith("dissimilarity index ") || line.startsWith("rename from ") || line.startsWith("rename to ")) {
92
+ continue;
93
+ }
94
+ const hunkMatch = HUNK_RE.exec(line);
95
+ if (hunkMatch) {
96
+ flushContextRun();
97
+ flushHunk();
98
+ pendingHunkOldStart = parseInt(hunkMatch[1], 10);
99
+ pendingHunkNewStart = parseInt(hunkMatch[3], 10);
100
+ pendingOldLines = 0;
101
+ pendingNewLines = 0;
102
+ pendingHunkHeaderIndex = out.length;
103
+ out.push(line);
104
+ continue;
105
+ }
106
+ if (line.startsWith("+++ ") || line.startsWith("--- ") || line.startsWith("Binary files ")) {
107
+ flushContextRun();
108
+ flushHunk();
109
+ out.push(line);
110
+ continue;
111
+ }
112
+ if (line.startsWith("+")) {
113
+ flushContextRun();
114
+ out.push(line);
115
+ pendingNewLines++;
116
+ continue;
117
+ }
118
+ if (line.startsWith("-")) {
119
+ flushContextRun();
120
+ out.push(line);
121
+ pendingOldLines++;
122
+ continue;
123
+ }
124
+ if (!line.startsWith(" ")) {
125
+ flushContextRun();
126
+ out.push(line);
127
+ continue;
128
+ }
129
+ contextRun++;
130
+ if (contextRun <= KEEP_CONTEXT) {
131
+ out.push(line);
132
+ pendingOldLines++;
133
+ pendingNewLines++;
134
+ }
135
+ }
136
+ flushContextRun();
137
+ flushHunk();
138
+ const result = out.join("\n");
139
+ return {
140
+ text: result,
141
+ compressed: result.length < text.length
142
+ };
143
+ }
144
+ };
145
+ const lsFilter = {
146
+ id: "terminal.ls",
147
+ toolIds: [TerminalToolId.RunInTerminal],
148
+ matches(_toolId, input) {
149
+ if (!isTerminalInput(input)) {
150
+ return false;
151
+ }
152
+ const parsed = parseCommandHead(input.command);
153
+ if (parsed?.head !== "ls") {
154
+ return false;
155
+ }
156
+ return /\s-\w*l/.test(input.command ?? "");
157
+ },
158
+ apply(text) {
159
+ const lines = text.split("\n");
160
+ const out = [];
161
+ const longRe = /^[-dlcbpsDLCBPS][rwx\-tTsS@+.]{9,}\s+\d+\s+\S+\s+\S+\s+\d+\s+\S+\s+\S+\s+\S+\s+(.+)$/;
162
+ for (const line of lines) {
163
+ if (!line.trim()) {
164
+ continue;
165
+ }
166
+ if (line.startsWith("total ")) {
167
+ continue;
168
+ }
169
+ const m = longRe.exec(line);
170
+ if (m) {
171
+ const isDir = line.startsWith("d");
172
+ out.push(isDir ? m[1] + "/" : m[1]);
173
+ } else {
174
+ out.push(line);
175
+ }
176
+ }
177
+ const result = out.join("\n");
178
+ return {
179
+ text: result,
180
+ compressed: result.length < text.length
181
+ };
182
+ }
183
+ };
184
+ const npmInstallFilter = {
185
+ id: "terminal.npm-install",
186
+ toolIds: [TerminalToolId.RunInTerminal],
187
+ matches(_toolId, input) {
188
+ if (!isTerminalInput(input)) {
189
+ return false;
190
+ }
191
+ const parsed = parseCommandHead(input.command);
192
+ if (!parsed) {
193
+ return false;
194
+ }
195
+ if (parsed.head === "npm" && (parsed.sub === "install" || parsed.sub === "i" || parsed.sub === "ci")) {
196
+ return true;
197
+ }
198
+ if ((parsed.head === "yarn" || parsed.head === "pnpm") && parsed.sub !== "test") {
199
+ if (/\binstall\b|\badd\b/.test(input.command ?? "")) {
200
+ return true;
201
+ }
202
+ if (parsed.sub === undefined) {
203
+ return /^\s*(?:[A-Z_][A-Z0-9_]*=\S+\s+)*(?:yarn|pnpm)\s*$/.test(input.command ?? "");
204
+ }
205
+ }
206
+ return false;
207
+ },
208
+ apply(text) {
209
+ const lines = text.split("\n");
210
+ const dropPatterns = [/^npm warn deprecated /i,
211
+ /^\s*\[#+>?\s*\] /, /^npm http /i, /^npm timing /i, /^npm sill /i, /^npm verb /i, /^\s*\d+ packages? are looking for funding/i, /run `npm fund`/i, /^Run `npm audit/i];
212
+ const out = [];
213
+ for (const line of lines) {
214
+ if (( dropPatterns.some(re => re.test(line)))) {
215
+ continue;
216
+ }
217
+ out.push(line);
218
+ }
219
+ const result = out.join("\n");
220
+ return {
221
+ text: result,
222
+ compressed: result.length < text.length
223
+ };
224
+ }
225
+ };
226
+ function registerTerminalCompressors(compressor) {
227
+ compressor.registerFilter(gitDiffFilter);
228
+ compressor.registerFilter(lsFilter);
229
+ compressor.registerFilter(npmInstallFilter);
230
+ }
231
+
232
+ export { gitDiffFilter, lsFilter, npmInstallFilter, parseCommandHead, registerTerminalCompressors };
@@ -0,0 +1,83 @@
1
+ import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
3
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
4
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
5
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
6
+ import { AgentHostPermissionMode, IPendingResourceRequest } from "../../../../platform/agentHost/common/agentHostPermissionService.js";
7
+ import { IAgentHostPermissionService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostPermissionService.service";
8
+ import { ResourceRequestParams } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/commands";
9
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
10
+ /**
11
+ * Default implementation of {@link IAgentHostPermissionService}.
12
+ *
13
+ * Permission storage shape (in user settings):
14
+ *
15
+ * ```jsonc
16
+ * "chat.agentHost.localFilePermissions": {
17
+ * "localhost:3000": {
18
+ * "file:///Users/me/.gitconfig": "r",
19
+ * "file:///Users/me/.agentConfig": "rw"
20
+ * }
21
+ * }
22
+ * ```
23
+ *
24
+ * - Keys are addresses normalized via {@link normalizeRemoteAgentHostAddress}.
25
+ * - Values are URI strings → `r` | `rw`. Descendant URIs are covered by a
26
+ * parent grant (e.g. a grant for `.config/` covers `.config/foo.json`).
27
+ */
28
+ export declare class AgentHostPermissionService extends Disposable implements IAgentHostPermissionService {
29
+ private readonly _configurationService;
30
+ private readonly _fileService;
31
+ private readonly _logService;
32
+ readonly _serviceBrand: undefined;
33
+ /**
34
+ * In-memory grants. Two kinds, both stored here so they share the
35
+ * `connectionClosed` cleanup pass:
36
+ *
37
+ * - **Implicit reads** added by `grantImplicitRead` (read-only, kept alive
38
+ * by an explicit disposable revocation handle from the caller).
39
+ * - **Session grants** from the user clicking "Allow" in the prompt
40
+ * (read or write, cleared when the connection closes or the window
41
+ * reloads). These have no caller-held disposable.
42
+ *
43
+ * Keyed by an opaque handle so callers can revoke independently.
44
+ */
45
+ private readonly _inMemoryGrants;
46
+ /** All pending requests across every connection. */
47
+ private readonly _pending;
48
+ readonly allPending: IObservable<readonly IPendingResourceRequest[]>;
49
+ constructor(_configurationService: IConfigurationService, _fileService: IFileService, _logService: ILogService);
50
+ check(address: string, uri: URI, mode: AgentHostPermissionMode): Promise<boolean>;
51
+ request(address: string, params: ResourceRequestParams): Promise<void>;
52
+ pendingFor(address: string): IObservable<readonly IPendingResourceRequest[]>;
53
+ findPending(id: string): IPendingResourceRequest | undefined;
54
+ grantImplicitRead(address: string, uri: URI): IDisposable;
55
+ connectionClosed(address: string): void;
56
+ /**
57
+ * Resolve {@link uri} against the local filesystem, collapsing `..`
58
+ * segments and following symlinks so the policy check sees the same
59
+ * path the OS will actually open. For URIs that don't exist (e.g. a
60
+ * `resourceWrite` for a new file), realpath the deepest existing
61
+ * ancestor and re-append the leaf.
62
+ */
63
+ private _canonicalize;
64
+ /**
65
+ * Policy check against in-memory + persisted grants. Asynchronous
66
+ * because in-memory grants from {@link grantImplicitRead} carry an
67
+ * unresolved realpath promise — see {@link IInMemoryGrant.realpath}.
68
+ */
69
+ private _isCovered;
70
+ private _enqueue;
71
+ private _resolve;
72
+ private _dropPending;
73
+ private _readPersistedGrants;
74
+ private _persistGrant;
75
+ /**
76
+ * Inspect the setting and pick the scope to write back to. The setting
77
+ * is registered with `ConfigurationScope.APPLICATION`, so APPLICATION is
78
+ * the canonical home; we still honour pre-existing values in the
79
+ * user-* scopes so a hand-edited entry isn't silently relocated, but
80
+ * fresh writes default to APPLICATION.
81
+ */
82
+ private _inspectScopedSetting;
83
+ }
@@ -0,0 +1,243 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
5
+ import { Disposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
7
+ import { extUri } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
8
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
9
+ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
10
+ import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
11
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
12
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
13
+ import { normalizeRemoteAgentHostAddress } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
14
+ import { AgentHostPermissionMode, AgentHostAccessMode, AgentHostLocalFilePermissionsSettingId } from '../../../../platform/agentHost/common/agentHostPermissionService.js';
15
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
16
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
17
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
18
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
19
+ import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
20
+
21
+ let AgentHostPermissionService = class AgentHostPermissionService extends Disposable {
22
+ constructor(_configurationService, _fileService, _logService) {
23
+ super();
24
+ this._configurationService = _configurationService;
25
+ this._fileService = _fileService;
26
+ this._logService = _logService;
27
+ this._inMemoryGrants = ( new Map());
28
+ this._pending = observableValue("agentHostPermissions.pending", []);
29
+ this.allPending = this._pending;
30
+ }
31
+ async check(address, uri, mode) {
32
+ const normalized = normalizeRemoteAgentHostAddress(address);
33
+ const canonical = await this._canonicalize(uri);
34
+ return this._isCovered(normalized, canonical, mode);
35
+ }
36
+ async request(address, params) {
37
+ const normalized = normalizeRemoteAgentHostAddress(address);
38
+ const canonical = await this._canonicalize(( URI.parse(params.uri)));
39
+ const wantsWrite = params.write === true;
40
+ const wantsRead = params.read === true || !wantsWrite;
41
+ if (wantsRead && !(await this._isCovered(normalized, canonical, AgentHostPermissionMode.Read))) {
42
+ await this._enqueue(normalized, canonical, AgentHostPermissionMode.Read);
43
+ }
44
+ if (wantsWrite && !(await this._isCovered(normalized, canonical, AgentHostPermissionMode.Write))) {
45
+ await this._enqueue(normalized, canonical, AgentHostPermissionMode.Write);
46
+ }
47
+ }
48
+ pendingFor(address) {
49
+ const normalized = normalizeRemoteAgentHostAddress(address);
50
+ return derived(reader => this._pending.read(reader).filter(r => r.address === normalized));
51
+ }
52
+ findPending(id) {
53
+ return this._pending.get().find(r => r.id === id);
54
+ }
55
+ grantImplicitRead(address, uri) {
56
+ const handle = generateUuid();
57
+ const lexical = extUri.normalizePath(uri);
58
+ const realpath = this._fileService.realpath(lexical).then(real => real ?? lexical, () => lexical);
59
+ this._inMemoryGrants.set(handle, {
60
+ address: normalizeRemoteAgentHostAddress(address),
61
+ realpath,
62
+ mode: AgentHostAccessMode.Read
63
+ });
64
+ return toDisposable(() => this._inMemoryGrants.delete(handle));
65
+ }
66
+ connectionClosed(address) {
67
+ const normalized = normalizeRemoteAgentHostAddress(address);
68
+ for (const [handle, grant] of this._inMemoryGrants) {
69
+ if (grant.address === normalized) {
70
+ this._inMemoryGrants.delete(handle);
71
+ }
72
+ }
73
+ const cancel = ( new CancellationError());
74
+ const remaining = [];
75
+ for (const request of this._pending.get()) {
76
+ if (request.address === normalized) {
77
+ request.deferred.error(cancel);
78
+ } else {
79
+ remaining.push(request);
80
+ }
81
+ }
82
+ if (remaining.length !== this._pending.get().length) {
83
+ this._pending.set(remaining, undefined);
84
+ }
85
+ }
86
+ async _canonicalize(uri) {
87
+ const normalized = extUri.normalizePath(uri);
88
+ const real = await this._fileService.realpath(normalized).catch(() => undefined);
89
+ if (real) {
90
+ return real;
91
+ }
92
+ const parent = extUri.dirname(normalized);
93
+ if (extUri.isEqual(parent, normalized)) {
94
+ return normalized;
95
+ }
96
+ const realParent = await this._fileService.realpath(parent).catch(() => undefined);
97
+ return realParent ? extUri.joinPath(realParent, extUri.basename(normalized)) : normalized;
98
+ }
99
+ async _isCovered(address, canonicalUri, mode) {
100
+ const requireWrite = mode === AgentHostPermissionMode.Write;
101
+ for (const grant of this._readPersistedGrants(address)) {
102
+ if (requireWrite && grant.mode !== AgentHostAccessMode.ReadWrite) {
103
+ continue;
104
+ }
105
+ if (extUri.isEqualOrParent(canonicalUri, grant.uri)) {
106
+ return true;
107
+ }
108
+ }
109
+ const candidates = [];
110
+ for (const grant of ( this._inMemoryGrants.values())) {
111
+ if (grant.address !== address) {
112
+ continue;
113
+ }
114
+ if (requireWrite && grant.mode !== AgentHostAccessMode.ReadWrite) {
115
+ continue;
116
+ }
117
+ candidates.push(grant.realpath);
118
+ }
119
+ const realpaths = await Promise.all(candidates);
120
+ return ( realpaths.some(uri => extUri.isEqualOrParent(canonicalUri, uri)));
121
+ }
122
+ _enqueue(address, canonicalUri, mode) {
123
+ const existing = this._pending.get().find(
124
+ r => r.address === address && r.mode === mode && extUri.isEqual(r.uri, canonicalUri)
125
+ );
126
+ if (existing) {
127
+ return existing.deferred.p;
128
+ }
129
+ const deferred = ( new DeferredPromise());
130
+ const request = {
131
+ id: generateUuid(),
132
+ address,
133
+ uri: canonicalUri,
134
+ mode,
135
+ deferred,
136
+ allow: () => this._resolve(request, "memory"),
137
+ allowAlways: () => this._resolve(request, "persist"),
138
+ deny: () => {
139
+ this._dropPending(request);
140
+ deferred.error(( new CancellationError()));
141
+ }
142
+ };
143
+ this._pending.set([...this._pending.get(), request], undefined);
144
+ return deferred.p;
145
+ }
146
+ _resolve(request, scope) {
147
+ const accessMode = request.mode === AgentHostPermissionMode.Write ? AgentHostAccessMode.ReadWrite : AgentHostAccessMode.Read;
148
+ this._inMemoryGrants.set(generateUuid(), {
149
+ address: request.address,
150
+ realpath: Promise.resolve(request.uri),
151
+ mode: accessMode
152
+ });
153
+ if (scope === "persist") {
154
+ void this._persistGrant(request.address, request.uri, request.mode).catch(err => {
155
+ this._logService.warn("[AgentHostPermissionService] Failed to persist grant", err);
156
+ });
157
+ }
158
+ this._dropPending(request);
159
+ request.deferred.complete();
160
+ }
161
+ _dropPending(request) {
162
+ const next = this._pending.get().filter(r => r !== request);
163
+ if (next.length !== this._pending.get().length) {
164
+ this._pending.set(next, undefined);
165
+ }
166
+ }
167
+ *_readPersistedGrants(address) {
168
+ const forAddress = this._configurationService.getValue(AgentHostLocalFilePermissionsSettingId)?.[address];
169
+ if (!forAddress) {
170
+ return;
171
+ }
172
+ for (const [uriStr, mode] of Object.entries(forAddress)) {
173
+ if (mode !== AgentHostAccessMode.Read && mode !== AgentHostAccessMode.ReadWrite) {
174
+ continue;
175
+ }
176
+ try {
177
+ yield {
178
+ uri: ( URI.parse(uriStr)),
179
+ mode
180
+ };
181
+ } catch {}
182
+ }
183
+ }
184
+ async _persistGrant(address, uri, mode) {
185
+ const requested = mode === AgentHostPermissionMode.Write ? AgentHostAccessMode.ReadWrite : AgentHostAccessMode.Read;
186
+ for (const grant of this._readPersistedGrants(address)) {
187
+ const covers = grant.mode === AgentHostAccessMode.ReadWrite || requested === AgentHostAccessMode.Read;
188
+ if (covers && extUri.isEqualOrParent(uri, grant.uri)) {
189
+ return;
190
+ }
191
+ }
192
+ const {
193
+ target,
194
+ value
195
+ } = this._inspectScopedSetting();
196
+ const forAddress = {
197
+ ...(value[address] ?? {})
198
+ };
199
+ const uriKey = ( uri.toString());
200
+ if (forAddress[uriKey] === AgentHostAccessMode.ReadWrite) {
201
+ return;
202
+ }
203
+ forAddress[uriKey] = requested;
204
+ await this._configurationService.updateValue(AgentHostLocalFilePermissionsSettingId, {
205
+ ...value,
206
+ [address]: forAddress
207
+ }, target);
208
+ }
209
+ _inspectScopedSetting() {
210
+ const inspected = this._configurationService.inspect(AgentHostLocalFilePermissionsSettingId);
211
+ if (inspected.applicationValue !== undefined) {
212
+ return {
213
+ target: ConfigurationTarget.APPLICATION,
214
+ value: inspected.applicationValue
215
+ };
216
+ }
217
+ if (inspected.userLocalValue !== undefined) {
218
+ return {
219
+ target: ConfigurationTarget.USER_LOCAL,
220
+ value: inspected.userLocalValue
221
+ };
222
+ }
223
+ if (inspected.userRemoteValue !== undefined) {
224
+ return {
225
+ target: ConfigurationTarget.USER_REMOTE,
226
+ value: inspected.userRemoteValue
227
+ };
228
+ }
229
+ if (inspected.userValue !== undefined) {
230
+ return {
231
+ target: ConfigurationTarget.USER,
232
+ value: inspected.userValue
233
+ };
234
+ }
235
+ return {
236
+ target: ConfigurationTarget.APPLICATION,
237
+ value: {}
238
+ };
239
+ }
240
+ };
241
+ AgentHostPermissionService = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IFileService)), ( __param(2, ILogService))], AgentHostPermissionService));
242
+
243
+ export { AgentHostPermissionService };