@codingame/monaco-vscode-api 37.1.0 → 37.2.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 (313) hide show
  1. package/missing-services.js +6 -26
  2. package/package.json +8 -8
  3. package/services.d.ts +1 -1
  4. package/services.js +3 -3
  5. package/tools.d.ts +4 -0
  6. package/tools.js +24 -1
  7. package/vscode/src/vs/platform/product/common/product.js +1 -1
  8. package/vscode/src/vs/platform/webWorker/browser/webWorkerServiceImpl.js +2 -2
  9. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +63 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +305 -0
  11. package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +2 -2
  12. package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +1 -2
  13. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  14. package/vscode/src/vs/workbench/browser/media/code-icon.svg +1 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.d.ts +1 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +2 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +2 -2
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service.d.ts +1 -1
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.d.ts +30 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.js +39 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service.d.ts +1 -1
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service.d.ts +1 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +1 -1
  24. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service.d.ts +1 -1
  25. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +1 -1
  26. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.service.d.ts +1 -1
  27. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.d.ts +1 -1
  28. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.js +29 -0
  30. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +2 -2
  31. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.service.d.ts +1 -1
  32. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.d.ts +1 -1
  33. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +2 -2
  34. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.d.ts +1 -1
  35. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.d.ts +1 -1
  36. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginSource.d.ts +1 -1
  39. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatParserTypes.d.ts +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.d.ts +3 -0
  41. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.js +7 -0
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.d.ts +3 -3
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +1 -1
  44. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +1 -1
  45. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.d.ts +1 -1
  46. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
  47. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
  48. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
  49. package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +1 -1
  50. package/vscode/src/vs/workbench/contrib/search/browser/AISearch/aiSearchModel.d.ts +1 -1
  51. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModel.d.ts +1 -1
  52. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModelBase.d.ts +1 -1
  53. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/folderMatch.d.ts +1 -1
  54. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon.d.ts +1 -1
  55. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +4 -3
  56. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.d.ts +34 -0
  57. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.js +72 -0
  58. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.d.ts +44 -0
  59. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +96 -0
  60. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css +1148 -0
  61. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.d.ts +81 -0
  62. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +97 -0
  63. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +32 -0
  64. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +45 -0
  65. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.d.ts +0 -7
  66. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.js +0 -92
  67. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.d.ts +0 -12
  68. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +0 -64
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +0 -262
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +0 -865
  71. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -57
  72. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -311
  73. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -15
  74. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -80
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +0 -2
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +0 -57
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -231
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1850
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -109
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -85
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +0 -140
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +0 -186
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.d.ts +0 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.js +0 -5
  85. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.d.ts +0 -46
  86. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.js +0 -17
  87. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -253
  88. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -20
  89. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +0 -34
  90. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +0 -194
  91. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -87
  92. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -69
  93. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +0 -300
  94. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +0 -272
  95. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -25
  96. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -178
  97. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -78
  98. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -51
  99. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
  100. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
  101. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -67
  102. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -294
  103. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -212
  104. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -955
  105. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
  106. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
  107. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +0 -65
  108. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +0 -697
  109. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.d.ts +0 -150
  110. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.js +0 -142
  111. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
  112. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -77
  113. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
  114. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
  115. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
  116. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
  117. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +0 -92
  118. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +0 -335
  119. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -235
  120. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1673
  121. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -202
  122. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -872
  123. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +0 -35
  124. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +0 -289
  125. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.d.ts +0 -72
  126. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +0 -600
  127. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +0 -36
  128. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +0 -239
  129. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +0 -22
  130. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +0 -143
  131. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +0 -24
  132. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +0 -298
  133. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +0 -25
  134. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +0 -177
  135. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +0 -73
  136. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +0 -577
  137. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +0 -11
  138. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +0 -90
  139. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +0 -16
  140. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +0 -130
  141. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +0 -12
  142. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +0 -53
  143. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +0 -5
  144. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +0 -12
  145. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +0 -10
  146. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +0 -92
  147. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -38
  148. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -518
  149. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +0 -6
  150. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +0 -231
  151. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.d.ts +0 -20
  152. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.js +0 -17
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.d.ts +0 -6
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +0 -283
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.d.ts +0 -91
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +0 -340
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.d.ts +0 -17
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +0 -272
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css +0 -686
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css +0 -348
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css +0 -8
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css +0 -92
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css +0 -119
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css +0 -79
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css +0 -61
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditController.css +0 -55
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditorOverlay.css +0 -63
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css +0 -79
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css +0 -63
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css +0 -92
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css +0 -79
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css +0 -24
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css +0 -61
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css +0 -102
  175. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.d.ts +0 -27
  176. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +0 -131
  177. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.d.ts +0 -18
  178. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.js +0 -92
  179. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.d.ts +0 -105
  180. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +0 -673
  181. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.d.ts +0 -9
  182. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +0 -37
  183. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.d.ts +0 -354
  184. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2926
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.d.ts +0 -29
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +0 -36
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.d.ts +0 -1
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +0 -19
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.d.ts +0 -200
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +0 -591
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.d.ts +0 -56
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +0 -30
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.d.ts +0 -99
  194. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +0 -131
  195. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.d.ts +0 -30
  196. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +0 -115
  197. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.d.ts +0 -28
  198. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +0 -158
  199. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.d.ts +0 -40
  200. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +0 -183
  201. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.d.ts +0 -10
  202. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +0 -66
  203. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.d.ts +0 -52
  204. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +0 -429
  205. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.d.ts +0 -6
  206. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +0 -108
  207. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.d.ts +0 -36
  208. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +0 -221
  209. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.d.ts +0 -17
  210. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +0 -142
  211. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.d.ts +0 -5
  212. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +0 -23
  213. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.d.ts +0 -18
  214. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +0 -104
  215. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.d.ts +0 -92
  216. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +0 -762
  217. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.d.ts +0 -15
  218. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +0 -58
  219. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.d.ts +0 -36
  220. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +0 -357
  221. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.d.ts +0 -6
  222. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +0 -32
  223. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.d.ts +0 -47
  224. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +0 -260
  225. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.d.ts +0 -9
  226. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.js +0 -10
  227. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.d.ts +0 -10
  228. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +0 -24
  229. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.d.ts +0 -182
  230. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +0 -796
  231. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.d.ts +0 -13
  232. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +0 -79
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.d.ts +0 -30
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +0 -126
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.d.ts +0 -6
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +0 -32
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.d.ts +0 -8
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +0 -50
  239. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.d.ts +0 -18
  240. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +0 -119
  241. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.d.ts +0 -57
  242. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +0 -443
  243. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.d.ts +0 -20
  244. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +0 -56
  245. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.d.ts +0 -24
  246. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.js +0 -121
  247. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.d.ts +0 -152
  248. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +0 -1288
  249. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.d.ts +0 -59
  250. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +0 -287
  251. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.d.ts +0 -117
  252. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.js +0 -6
  253. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.d.ts +0 -222
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +0 -1840
  255. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.d.ts +0 -63
  256. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +0 -449
  257. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.d.ts +0 -432
  258. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.d.ts +0 -18
  259. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +0 -2546
  260. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.d.ts +0 -8
  261. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +0 -105
  262. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.d.ts +0 -137
  263. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +0 -646
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.d.ts +0 -21
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +0 -101
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.d.ts +0 -13
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.js +0 -111
  268. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.d.ts +0 -30
  269. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +0 -65
  270. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.d.ts +0 -13
  271. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +0 -49
  272. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.d.ts +0 -89
  273. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +0 -472
  274. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.d.ts +0 -11
  275. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +0 -34
  276. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.d.ts +0 -33
  277. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +0 -275
  278. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.d.ts +0 -69
  279. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +0 -269
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.d.ts +0 -125
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +0 -958
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.d.ts +0 -9
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +0 -11
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.d.ts +0 -20
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.js +0 -101
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.d.ts +0 -65
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +0 -458
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.d.ts +0 -80
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +0 -708
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.d.ts +0 -37
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +0 -193
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.d.ts +0 -7
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.js +0 -62
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.d.ts +0 -108
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +0 -717
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.d.ts +0 -23
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +0 -183
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.d.ts +0 -11
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +0 -134
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.d.ts +0 -20
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +0 -135
  302. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.d.ts +0 -27
  303. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +0 -213
  304. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.d.ts +0 -27
  305. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +0 -104
  306. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.d.ts +0 -115
  307. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +0 -480
  308. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.d.ts +0 -87
  309. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -352
  310. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.d.ts +0 -81
  311. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.js +0 -9
  312. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.d.ts +0 -10
  313. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +0 -19
@@ -1,697 +0,0 @@
1
-
2
- import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
3
- import { splitGlobAware, match } from '../../../../../base/common/glob.js';
4
- import { ResourceMap, ResourceSet } from '../../../../../base/common/map.js';
5
- import { Schemas } from '../../../../../base/common/network.js';
6
- import { OperatingSystem } from '../../../../../base/common/platform.js';
7
- import { basename, dirname } from '../../../../../base/common/resources.js';
8
- import { escape } from '../../../../../base/common/strings.js';
9
- import { localize } from '../../../../../nls.js';
10
- import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
11
- import { IFileService } from '../../../../../platform/files/common/files.service.js';
12
- import { ILabelService } from '../../../../../platform/label/common/label.service.js';
13
- import { ILogService } from '../../../../../platform/log/common/log.service.js';
14
- import { IRemoteAgentService } from '../../../../services/remote/common/remoteAgentService.service.js';
15
- import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.service.js';
16
- import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.service.js';
17
- import { toPromptFileVariableEntry, PromptFileVariableKind, isPromptFileVariableEntry, IChatRequestVariableEntry, ChatRequestVariableSet, toToolVariableEntry, toPromptTextVariableEntry } from '../attachments/chatVariableEntries.js';
18
- import { VSCodeToolReference } from '../tools/languageModelToolsService.js';
19
- import { ILanguageModelToolsService } from '../tools/languageModelToolsService.service.js';
20
- import { PromptsConfig } from './config/config.js';
21
- import { isInClaudeRulesFolder, isInClaudeAgentsFolder, isPromptOrInstructionsFile } from './config/promptFileLocations.js';
22
- import { isPromptFileTildePath } from './promptFileParser.js';
23
- import { newInstructionsCollectionEvent, newInstructionsCollectionDebugInfo, matchesSessionType, AgentInstructionFileType } from './service/promptsService.js';
24
- import { IPromptsService } from './service/promptsService.service.js';
25
- import { AGENT_DEBUG_LOG_FILE_LOGGING_ENABLED_SETTING, TROUBLESHOOT_SKILL_PATH } from './promptTypes.js';
26
- import { OffsetRange } from '../../../../../editor/common/core/ranges/offsetRange.js';
27
- import { ChatModeKind } from '../constants.js';
28
- import { hash } from '../../../../../base/common/hash.js';
29
- import { IAgentPluginService } from '../plugins/agentPluginService.service.js';
30
- import { IPathService } from '../../../../services/path/common/pathService.service.js';
31
-
32
- let lastInstructionsCollectionResult;
33
- let ComputeAutomaticInstructions = class ComputeAutomaticInstructions {
34
- constructor(
35
- _modeKind,
36
- _enabledTools,
37
- _enabledSubagents,
38
- _currentSessionType,
39
- _promptsService,
40
- _logService,
41
- _labelService,
42
- _configurationService,
43
- _workspaceService,
44
- _fileService,
45
- _remoteAgentService,
46
- _telemetryService,
47
- _languageModelToolsService,
48
- _agentPluginService,
49
- _pathService
50
- ) {
51
- this._modeKind = _modeKind;
52
- this._enabledTools = _enabledTools;
53
- this._enabledSubagents = _enabledSubagents;
54
- this._currentSessionType = _currentSessionType;
55
- this._promptsService = _promptsService;
56
- this._logService = _logService;
57
- this._labelService = _labelService;
58
- this._configurationService = _configurationService;
59
- this._workspaceService = _workspaceService;
60
- this._fileService = _fileService;
61
- this._remoteAgentService = _remoteAgentService;
62
- this._telemetryService = _telemetryService;
63
- this._languageModelToolsService = _languageModelToolsService;
64
- this._agentPluginService = _agentPluginService;
65
- this._pathService = _pathService;
66
- this._parseResults = ( new ResourceMap());
67
- }
68
- async _parseInstructionsFile(uri, token) {
69
- if (( this._parseResults.has(uri))) {
70
- return this._parseResults.get(uri);
71
- }
72
- try {
73
- const result = await this._promptsService.parseNew(uri, token);
74
- this._parseResults.set(uri, result);
75
- return result;
76
- } catch (error) {
77
- this._logService.error(
78
- `[InstructionsContextComputer] Failed to parse instruction file: ${uri}`,
79
- error
80
- );
81
- return undefined;
82
- }
83
- }
84
- async collect(variables, token) {
85
- const startTime = performance.now();
86
- const instructionFiles = await this._promptsService.getInstructionFiles(token);
87
- this._logService.trace(
88
- `[InstructionsContextComputer] ${instructionFiles.length} instruction files available.`
89
- );
90
- const telemetryEvent = newInstructionsCollectionEvent();
91
- const debugInfo = newInstructionsCollectionDebugInfo();
92
- const context = this._getContext(variables);
93
- await this.addApplyingInstructions(instructionFiles, context, variables, telemetryEvent, debugInfo, token);
94
- await this._addReferencedInstructions(variables, telemetryEvent, debugInfo, token);
95
- await this._addAgentInstructions(variables, telemetryEvent, debugInfo, token);
96
- const customizationsIndexVariable = await this._getCustomizationsIndex(instructionFiles, variables, telemetryEvent, debugInfo, token);
97
- if (customizationsIndexVariable) {
98
- variables.add(customizationsIndexVariable);
99
- telemetryEvent.listedInstructionsCount++;
100
- }
101
- debugInfo.durationInMillis = performance.now() - startTime;
102
- this.sendTelemetry(telemetryEvent);
103
- lastInstructionsCollectionResult = {
104
- telemetryEvent,
105
- debugInfo
106
- };
107
- }
108
- sendTelemetry(telemetryEvent) {
109
- telemetryEvent.totalInstructionsCount = telemetryEvent.agentInstructionsCount + telemetryEvent.referencedInstructionsCount + telemetryEvent.applyingInstructionsCount + telemetryEvent.listedInstructionsCount;
110
- this._telemetryService.publicLog2("instructionsCollected", telemetryEvent);
111
- }
112
- async _logSkillLoadedTelemetry(skills) {
113
- try {
114
- const pluginByUri = ( new ResourceMap());
115
- const allPlugins = this._agentPluginService.plugins.get();
116
- for (const plugin of allPlugins) {
117
- pluginByUri.set(plugin.uri, plugin);
118
- }
119
- const hashOrEmpty = value => {
120
- return value !== undefined ? String(hash(value)) : "";
121
- };
122
- for (const skill of skills) {
123
- const skillPlugin = skill.pluginUri ? pluginByUri.get(skill.pluginUri) : undefined;
124
- this._telemetryService.publicLog2("skillLoadedIntoContext", {
125
- skillNameHash: hashOrEmpty(skill.name),
126
- skillStorage: skill.storage,
127
- extensionIdHash: hashOrEmpty(skill.extension?.identifier.value),
128
- extensionVersion: skill.extension?.version ?? "",
129
- pluginNameHash: hashOrEmpty(skillPlugin?.label),
130
- pluginVersion: skillPlugin?.fromMarketplace?.version ?? ""
131
- });
132
- }
133
- } catch (err) {
134
- this._logService.error("[InstructionsContextComputer] Failed to log skill telemetry", err);
135
- }
136
- }
137
- async addApplyingInstructions(instructionFiles, context, variables, telemetryEvent, debugInfo, token) {
138
- const includeApplyingInstructions = this._configurationService.getValue(PromptsConfig.INCLUDE_APPLYING_INSTRUCTIONS);
139
- if (!includeApplyingInstructions && this._modeKind !== ChatModeKind.Edit) {
140
- this._logService.trace(
141
- `[InstructionsContextComputer] includeApplyingInstructions is disabled and agent kind is not Edit. No applying instructions will be added.`
142
- );
143
- return;
144
- }
145
- const currentSessionType = this._currentSessionType;
146
- for (const instructionFile of instructionFiles) {
147
- if (token.isCancellationRequested) {
148
- return;
149
- }
150
- const {
151
- uri,
152
- pattern
153
- } = instructionFile;
154
- if (!matchesSessionType(instructionFile.sessionTypes, currentSessionType)) {
155
- continue;
156
- }
157
- if (!pattern) {
158
- this._logService.trace(`[InstructionsContextComputer] No pattern (applyTo / paths) found: ${uri}`);
159
- debugInfo.debugDetails.push({
160
- category: "skipped",
161
- name: ( basename(uri).toString()),
162
- uri,
163
- reason: ( localize(10532, "no applyTo pattern"))
164
- });
165
- continue;
166
- }
167
- const isClaudeRules = isInClaudeRulesFolder(uri);
168
- if (( context.instructions.has(uri))) {
169
- this._logService.trace(
170
- `[InstructionsContextComputer] Skipping already processed instruction file: ${uri}`
171
- );
172
- debugInfo.debugDetails.push({
173
- category: "skipped",
174
- name: ( basename(uri).toString()),
175
- uri,
176
- reason: ( localize(10533, "already processed"))
177
- });
178
- continue;
179
- }
180
- const match = this._matches(context.files, pattern);
181
- if (match) {
182
- this._logService.trace(
183
- `[InstructionsContextComputer] Match for ${uri} with ${match.pattern}${match.file ? ` for file ${match.file}` : ""}`
184
- );
185
- const reason = !match.file ? ( localize(10534, "automatically attached as pattern is **")) : ( localize(
186
- 10535,
187
- "automatically attached as pattern {0} matches {1}",
188
- pattern,
189
- this._labelService.getUriLabel(match.file, {
190
- relative: true
191
- })
192
- ));
193
- variables.add(
194
- toPromptFileVariableEntry(uri, PromptFileVariableKind.Instruction, reason, true)
195
- );
196
- telemetryEvent.applyingInstructionsCount++;
197
- debugInfo.debugDetails.push({
198
- category: "applying",
199
- name: ( basename(uri).toString()),
200
- uri,
201
- reason
202
- });
203
- if (isClaudeRules) {
204
- telemetryEvent.claudeRulesCount++;
205
- }
206
- } else {
207
- this._logService.trace(`[InstructionsContextComputer] No match for ${uri} with ${pattern}`);
208
- debugInfo.debugDetails.push({
209
- category: "skipped",
210
- name: ( basename(uri).toString()),
211
- uri,
212
- reason: ( localize(10536, "applyTo '{0}' did not match any attached files", pattern))
213
- });
214
- }
215
- }
216
- }
217
- _getContext(attachedContext) {
218
- const files = ( new ResourceSet());
219
- const instructions = ( new ResourceSet());
220
- for (const variable of attachedContext.asArray()) {
221
- if (isPromptFileVariableEntry(variable)) {
222
- instructions.add(variable.value);
223
- } else {
224
- const uri = IChatRequestVariableEntry.toUri(variable);
225
- if (uri) {
226
- files.add(uri);
227
- }
228
- }
229
- }
230
- return {
231
- files,
232
- instructions
233
- };
234
- }
235
- async _addAgentInstructions(variables, telemetryEvent, debugInfo, token) {
236
- const logger = {
237
- logInfo: message => this._logService.trace(`[InstructionsContextComputer] ${message}`)
238
- };
239
- const allCandidates = await this._promptsService.listAgentInstructions(token, logger);
240
- const entries = ( new ChatRequestVariableSet());
241
- const copilotEntries = ( new ChatRequestVariableSet());
242
- for (const {
243
- uri,
244
- type
245
- } of allCandidates) {
246
- const varEntry = toPromptFileVariableEntry(uri, PromptFileVariableKind.Instruction, undefined, true);
247
- entries.add(varEntry);
248
- if (type === AgentInstructionFileType.copilotInstructionsMd) {
249
- copilotEntries.add(varEntry);
250
- }
251
- telemetryEvent.agentInstructionsCount++;
252
- if (type === AgentInstructionFileType.claudeMd) {
253
- telemetryEvent.claudeMdCount++;
254
- }
255
- debugInfo.debugDetails.push({
256
- category: "applying",
257
- name: ( basename(uri).toString()),
258
- uri,
259
- reason: ( localize(10537, "always added"))
260
- });
261
- logger.logInfo(`Agent instruction file added: ${( uri.toString())}`);
262
- }
263
- if (copilotEntries.length > 0) {
264
- await this._addReferencedInstructions(copilotEntries, telemetryEvent, debugInfo, token);
265
- for (const entry of copilotEntries.asArray()) {
266
- variables.add(entry);
267
- }
268
- }
269
- for (const entry of entries.asArray()) {
270
- variables.add(entry);
271
- }
272
- }
273
- _matches(files, applyToPattern) {
274
- const patterns = splitGlobAware(applyToPattern, ",");
275
- const patterMatches = pattern => {
276
- pattern = pattern.trim();
277
- if (pattern.length === 0) {
278
- return undefined;
279
- }
280
- if (pattern === "**" || pattern === "**/*" || pattern === "*") {
281
- return {
282
- pattern
283
- };
284
- }
285
- if (!pattern.startsWith("/") && !pattern.startsWith("**/")) {
286
- pattern = "**/" + pattern;
287
- }
288
- for (const file of files) {
289
- if (match(pattern, file.path, {
290
- ignoreCase: true
291
- })) {
292
- return {
293
- pattern,
294
- file
295
- };
296
- }
297
- }
298
- return undefined;
299
- };
300
- for (const pattern of patterns) {
301
- const matchResult = patterMatches(pattern);
302
- if (matchResult) {
303
- return matchResult;
304
- }
305
- }
306
- return undefined;
307
- }
308
- _getTool(referenceName) {
309
- if (!this._enabledTools) {
310
- return undefined;
311
- }
312
- const tool = this._languageModelToolsService.getToolByName(referenceName);
313
- if (tool && this._enabledTools[tool.id]) {
314
- return {
315
- tool,
316
- variable: `#tool:${this._languageModelToolsService.getFullReferenceName(tool)}`
317
- };
318
- }
319
- return undefined;
320
- }
321
- async _getCustomizationsIndex(instructionFiles, _existingVariables, telemetryEvent, debugInfo, token) {
322
- const readTool = this._getTool("readFile");
323
- const runInTerminalTool = this._getTool("runInTerminal");
324
- const fileReadTool = readTool ?? runInTerminalTool;
325
- const runSubagentTool = this._getTool(VSCodeToolReference.runSubagent);
326
- const skillTool = this._getTool("skill");
327
- const currentSessionType = this._currentSessionType;
328
- const remoteEnv = await this._remoteAgentService.getEnvironment();
329
- const remoteOS = remoteEnv?.os;
330
- const isRemote = this._remoteAgentService.getConnection() !== null;
331
- const filePath = uri => getFilePath(uri, remoteOS, isRemote);
332
- const entries = [];
333
- if (fileReadTool) {
334
- const searchNestedAgentMd = this._configurationService.getValue(PromptsConfig.USE_NESTED_AGENT_MD);
335
- const agentsMdPromise = searchNestedAgentMd ? this._promptsService.listNestedAgentMDs(token) : Promise.resolve([]);
336
- entries.push("<instructions>");
337
- entries.push(
338
- "Here is a list of instruction files that contain rules for working with this codebase."
339
- );
340
- entries.push(
341
- "These files are important for understanding the codebase structure, conventions, and best practices."
342
- );
343
- entries.push(
344
- "When an instruction file applies to your task (based on its description or applyTo pattern), follow the rules specified in it."
345
- );
346
- entries.push(
347
- `If the file content is not already included in the context, use the ${fileReadTool.variable} tool to read it before proceeding. Use the exact value from the <file> element as-is with the tool; do not add or remove prefixes or otherwise modify it.`
348
- );
349
- entries.push(
350
- "Only load instruction files when they are relevant to the current task. Do not eagerly load all instructions upfront."
351
- );
352
- entries.push(
353
- "When modifying or creating files, check for instructions whose applyTo pattern matches the file path and follow them."
354
- );
355
- let hasContent = false;
356
- for (const instruction of instructionFiles) {
357
- if (!matchesSessionType(instruction.sessionTypes, currentSessionType)) {
358
- continue;
359
- }
360
- entries.push("<instruction>");
361
- entries.push(`<file>${filePath(instruction.uri)}</file>`);
362
- if (instruction.description) {
363
- entries.push(`<description>${escape(instruction.description)}</description>`);
364
- }
365
- if (instruction.pattern) {
366
- entries.push(`<applyTo>${escape(instruction.pattern)}</applyTo>`);
367
- }
368
- entries.push("</instruction>");
369
- hasContent = true;
370
- }
371
- const agentsMdFiles = await agentsMdPromise;
372
- for (const {
373
- uri
374
- } of agentsMdFiles) {
375
- const folderName = this._labelService.getUriLabel(dirname(uri), {
376
- relative: true
377
- });
378
- const description = folderName.trim().length === 0 ? ( localize(10538, "Instructions for the workspace")) : ( localize(10539, "Instructions for folder '{0}'", folderName));
379
- entries.push("<instruction>");
380
- entries.push(`<file>${filePath(uri)}</file>`);
381
- entries.push(`<description>${escape(description)}</description>`);
382
- entries.push("</instruction>");
383
- hasContent = true;
384
- }
385
- if (!hasContent) {
386
- entries.length = 0;
387
- } else {
388
- entries.push("</instructions>", "", "");
389
- }
390
- const agentSkills = await this._promptsService.findAgentSkills(token);
391
- const isFileLoggingEnabled = this._configurationService.getValue(AGENT_DEBUG_LOG_FILE_LOGGING_ENABLED_SETTING);
392
- const modelInvocableSkills = agentSkills?.filter(skill => {
393
- if (!skill.description) {
394
- debugInfo.debugDetails.push({
395
- category: "skipped",
396
- name: skill.name,
397
- uri: skill.uri,
398
- reason: ( localize(10540, "no description for model invocation"))
399
- });
400
- return false;
401
- }
402
- if (skill.disableModelInvocation) {
403
- debugInfo.debugDetails.push({
404
- category: "skipped",
405
- name: skill.name,
406
- uri: skill.uri,
407
- reason: ( localize(10541, "model invocation disabled"))
408
- });
409
- return false;
410
- }
411
- if (!matchesSessionType(skill.sessionTypes, currentSessionType)) {
412
- debugInfo.debugDetails.push({
413
- category: "skipped",
414
- name: skill.name,
415
- uri: skill.uri,
416
- reason: ( localize(10542, "session type not matched"))
417
- });
418
- return false;
419
- }
420
- if (!isFileLoggingEnabled && skill.uri.path.includes(TROUBLESHOOT_SKILL_PATH)) {
421
- debugInfo.debugDetails.push({
422
- category: "skipped",
423
- name: skill.name,
424
- uri: skill.uri,
425
- reason: ( localize(10543, "debug logging disabled"))
426
- });
427
- return false;
428
- }
429
- return true;
430
- });
431
- if (modelInvocableSkills && modelInvocableSkills.length > 0) {
432
- this._logSkillLoadedTelemetry(modelInvocableSkills);
433
- for (const skill of modelInvocableSkills) {
434
- debugInfo.debugDetails.push({
435
- category: "skill",
436
- name: skill.name,
437
- uri: skill.uri,
438
- reason: skill.storage
439
- });
440
- }
441
- const useSkillAdherencePrompt = this._configurationService.getValue(PromptsConfig.USE_SKILL_ADHERENCE_PROMPT);
442
- const skillLoadTool = skillTool ?? fileReadTool;
443
- entries.push("<skills>");
444
- if (useSkillAdherencePrompt) {
445
- entries.push(
446
- "Skills provide specialized capabilities, domain knowledge, and refined workflows for producing high-quality outputs. Each skill folder contains tested instructions for specific domains like testing strategies, API design, or performance optimization. Multiple skills can be combined when a task spans different domains."
447
- );
448
- if (skillTool) {
449
- entries.push(
450
- `BLOCKING REQUIREMENT: When a skill applies to the user's request, you MUST invoke it IMMEDIATELY as your first action, BEFORE generating any other response or taking action on the task. Use ${skillTool.variable} with the skill name to load the relevant skill(s).`
451
- );
452
- } else {
453
- entries.push(
454
- `BLOCKING REQUIREMENT: When a skill applies to the user's request, you MUST load and read the SKILL.md file IMMEDIATELY as your first action, BEFORE generating any other response or taking action on the task. Use ${fileReadTool.variable} to load the relevant skill(s).`
455
- );
456
- }
457
- entries.push(
458
- "NEVER just mention or reference a skill in your response without actually loading it first. If a skill is relevant, load it before proceeding."
459
- );
460
- entries.push("How to determine if a skill applies:");
461
- entries.push(
462
- "1. Review the available skills below and match their descriptions against the user's request"
463
- );
464
- entries.push(
465
- "2. If any skill's domain overlaps with the task, load that skill immediately"
466
- );
467
- entries.push(
468
- "3. When multiple skills apply (e.g., a flowchart in documentation), load all relevant skills"
469
- );
470
- entries.push("Examples:");
471
- entries.push(
472
- `- "Help me write unit tests for this module" -> Load the testing skill via ${skillLoadTool.variable} FIRST, then proceed`
473
- );
474
- entries.push(
475
- `- "Optimize this slow function" -> Load the performance-profiling skill via ${skillLoadTool.variable} FIRST, then proceed`
476
- );
477
- entries.push(
478
- `- "Add a discount code field to checkout" -> Load both the checkout-flow and form-validation skills FIRST`
479
- );
480
- entries.push("Available skills:");
481
- } else {
482
- if (skillTool) {
483
- entries.push(
484
- "Here is a list of skills that contain domain specific knowledge on a variety of topics."
485
- );
486
- entries.push(
487
- `When a user asks you to perform a task that falls within the domain of a skill, use the ${skillTool.variable} tool with the skill name to load it.`
488
- );
489
- } else {
490
- entries.push(
491
- "Here is a list of skills that contain domain specific knowledge on a variety of topics."
492
- );
493
- entries.push(
494
- "Each skill comes with a description of the topic and a file path that contains the detailed instructions."
495
- );
496
- entries.push(
497
- `When a user asks you to perform a task that falls within the domain of a skill, use the ${fileReadTool.variable} tool to acquire the full instructions from the file URI.`
498
- );
499
- }
500
- }
501
- const SKILL_DESCRIPTION_CHAR_BUDGET = 15000;
502
- const TRUNCATED_NAMES_CHAR_BUDGET = 5000;
503
- let skillCharCount = 0;
504
- let truncatedAtIndex = modelInvocableSkills.length;
505
- for (let i = 0; i < modelInvocableSkills.length; i++) {
506
- const skill = modelInvocableSkills[i];
507
- const skillEntry = [`<skill>`, `<name>${escape(skill.name)}</name>`];
508
- if (skill.description) {
509
- skillEntry.push(`<description>${escape(skill.description)}</description>`);
510
- }
511
- skillEntry.push(`<file>${filePath(skill.uri)}</file>`);
512
- skillEntry.push(`</skill>`);
513
- const entryLength = skillEntry.join("\n").length + 1;
514
- if (skillTool && skillCharCount + entryLength > SKILL_DESCRIPTION_CHAR_BUDGET) {
515
- truncatedAtIndex = i;
516
- break;
517
- }
518
- skillCharCount += entryLength;
519
- entries.push(...skillEntry);
520
- }
521
- if (truncatedAtIndex < modelInvocableSkills.length) {
522
- const truncatedSkills = modelInvocableSkills.slice(truncatedAtIndex);
523
- const names = [];
524
- let nameListLength = 0;
525
- for (const skill of truncatedSkills) {
526
- const escapedName = escape(skill.name);
527
- const addition = (names.length > 0 ? 2 : 0) + escapedName.length;
528
- if (nameListLength + addition > TRUNCATED_NAMES_CHAR_BUDGET) {
529
- break;
530
- }
531
- nameListLength += addition;
532
- names.push(escapedName);
533
- }
534
- const remaining = truncatedSkills.length - names.length;
535
- const nameList = names.join(", ");
536
- entries.push(
537
- remaining > 0 ? `Additional skills available (invoke by name): ${nameList}... and ${remaining} more` : `Additional skills available (invoke by name): ${nameList}`
538
- );
539
- }
540
- entries.push("</skills>", "", "");
541
- }
542
- }
543
- if (runSubagentTool) {
544
- const canUseAgent = (() => {
545
- if (!this._enabledSubagents || this._enabledSubagents.includes("*")) {
546
- return agent => agent.visibility.agentInvocable && matchesSessionType(agent.sessionTypes, currentSessionType);
547
- } else {
548
- const subagents = this._enabledSubagents;
549
- return agent => subagents.includes(agent.name) && matchesSessionType(agent.sessionTypes, currentSessionType);
550
- }
551
- })();
552
- const agents = (await this._promptsService.getCustomAgents(token)).filter(a => a.enabled);
553
- if (agents.length > 0) {
554
- entries.push("<agents>");
555
- entries.push("Here is a list of agents that can be used when running a subagent.");
556
- entries.push(
557
- "Each agent has optionally a description with the agent's purpose and expertise. When asked to run a subagent, choose the most appropriate agent from this list."
558
- );
559
- entries.push(
560
- `Use the ${runSubagentTool.variable} tool with the agent name to run the subagent.`
561
- );
562
- for (const agent of agents) {
563
- if (canUseAgent(agent)) {
564
- entries.push("<agent>");
565
- entries.push(`<name>${escape(agent.name)}</name>`);
566
- if (agent.description) {
567
- entries.push(`<description>${escape(agent.description)}</description>`);
568
- }
569
- if (agent.argumentHint) {
570
- entries.push(`<argumentHint>${escape(agent.argumentHint)}</argumentHint>`);
571
- }
572
- entries.push("</agent>");
573
- debugInfo.debugDetails.push({
574
- category: "custom-agent",
575
- name: agent.name,
576
- uri: agent.uri
577
- });
578
- if (isInClaudeAgentsFolder(agent.uri)) {
579
- telemetryEvent.claudeAgentsCount++;
580
- }
581
- } else {
582
- debugInfo.debugDetails.push({
583
- category: "skipped",
584
- name: agent.name,
585
- uri: agent.uri,
586
- reason: ( localize(10544, "not invocable by model"))
587
- });
588
- }
589
- }
590
- entries.push("</agents>", "", "");
591
- }
592
- }
593
- if (entries.length === 0) {
594
- return undefined;
595
- }
596
- const content = entries.join("\n");
597
- const toolReferences = [];
598
- const collectToolReference = tool => {
599
- if (tool) {
600
- let offset = content.indexOf(tool.variable);
601
- while (offset >= 0) {
602
- toolReferences.push(toToolVariableEntry(tool.tool, ( new OffsetRange(offset, offset + tool.variable.length))));
603
- offset = content.indexOf(tool.variable, offset + 1);
604
- }
605
- }
606
- };
607
- collectToolReference(fileReadTool);
608
- collectToolReference(runSubagentTool);
609
- collectToolReference(skillTool);
610
- return toPromptTextVariableEntry(content, true, toolReferences);
611
- }
612
- async _addReferencedInstructions(attachedContext, telemetryEvent, debugInfo, token) {
613
- const includeReferencedInstructions = this._configurationService.getValue(PromptsConfig.INCLUDE_REFERENCED_INSTRUCTIONS);
614
- if (!includeReferencedInstructions && this._modeKind !== ChatModeKind.Edit) {
615
- this._logService.trace(
616
- `[InstructionsContextComputer] includeReferencedInstructions is disabled and agent kind is not Edit. No referenced instructions will be added.`
617
- );
618
- return;
619
- }
620
- const seen = ( new ResourceSet());
621
- const todo = [];
622
- for (const variable of attachedContext.asArray()) {
623
- if (isPromptFileVariableEntry(variable)) {
624
- if (!( seen.has(variable.value))) {
625
- todo.push(variable.value);
626
- seen.add(variable.value);
627
- }
628
- }
629
- }
630
- let next = todo.pop();
631
- while (next) {
632
- const result = await this._parseInstructionsFile(next, token);
633
- if (result && result.body) {
634
- const refsToCheck = [];
635
- let userHome;
636
- for (const ref of result.body.fileReferences) {
637
- if (isPromptFileTildePath(ref.content)) {
638
- userHome ??= await this._pathService.userHome();
639
- }
640
- const url = result.body.resolveFilePath(ref.content, userHome);
641
- if (url && !( seen.has(url)) && (isPromptOrInstructionsFile(url) || this._workspaceService.getWorkspaceFolder(url) !== undefined)) {
642
- refsToCheck.push({
643
- resource: url
644
- });
645
- seen.add(url);
646
- }
647
- }
648
- if (refsToCheck.length > 0) {
649
- const stats = await this._fileService.resolveAll(refsToCheck);
650
- for (let i = 0; i < stats.length; i++) {
651
- const stat = stats[i];
652
- const uri = refsToCheck[i].resource;
653
- if (stat.success && stat.stat?.isFile) {
654
- if (isPromptOrInstructionsFile(uri)) {
655
- todo.push(uri);
656
- }
657
- const reason = ( localize(10545, "Referenced by {0}", basename(next)));
658
- attachedContext.add(
659
- toPromptFileVariableEntry(uri, PromptFileVariableKind.InstructionReference, reason, true)
660
- );
661
- telemetryEvent.referencedInstructionsCount++;
662
- debugInfo.debugDetails.push({
663
- category: "referenced",
664
- name: ( basename(uri).toString()),
665
- uri,
666
- reason
667
- });
668
- this._logService.trace(`[InstructionsContextComputer] ${( uri.toString())} added, referenced by ${( next.toString())}`);
669
- }
670
- }
671
- }
672
- }
673
- next = todo.pop();
674
- }
675
- }
676
- };
677
- ComputeAutomaticInstructions = ( __decorate([( __param(4, IPromptsService)), ( __param(5, ILogService)), ( __param(6, ILabelService)), ( __param(7, IConfigurationService)), ( __param(8, IWorkspaceContextService)), ( __param(9, IFileService)), ( __param(10, IRemoteAgentService)), ( __param(11, ITelemetryService)), ( __param(12, ILanguageModelToolsService)), ( __param(13, IAgentPluginService)), ( __param(14, IPathService))], ComputeAutomaticInstructions));
678
- function getFilePath(uri, remoteOS, isRemote = false) {
679
- if (isRemote && uri.scheme === Schemas.file) {
680
- return ( uri.with({
681
- scheme: "vscode-local"
682
- }).toString());
683
- }
684
- if (uri.scheme === Schemas.file || uri.scheme === Schemas.vscodeRemote) {
685
- const fsPath = uri.fsPath;
686
- if (remoteOS !== undefined) {
687
- if (remoteOS === OperatingSystem.Windows) {
688
- return fsPath.replace(/\//g, "\\");
689
- }
690
- return fsPath.replace(/\\/g, "/");
691
- }
692
- return fsPath;
693
- }
694
- return ( uri.toString());
695
- }
696
-
697
- export { ComputeAutomaticInstructions, getFilePath, lastInstructionsCollectionResult, newInstructionsCollectionDebugInfo, newInstructionsCollectionEvent };