@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,872 +0,0 @@
1
-
2
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
3
- import { URI } from '../../../../../../base/common/uri.js';
4
- import { isAbsolute } from '../../../../../../base/common/path.js';
5
- import { ResourceSet } from '../../../../../../base/common/map.js';
6
- import { localize } from '../../../../../../nls.js';
7
- import { FileOperation, FileOperationError, FileOperationResult } from '../../../../../../platform/files/common/files.js';
8
- import { IFileService } from '../../../../../../platform/files/common/files.service.js';
9
- import { PromptsConfig, getPromptFileLocationsConfigKey, isTildePath } from '../config/config.js';
10
- import { joinPath, dirname, isEqual, isEqualOrParent, basename } from '../../../../../../base/common/resources.js';
11
- import { IWorkspaceContextService } from '../../../../../../platform/workspace/common/workspace.service.js';
12
- import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.service.js';
13
- import { getPromptFileDefaultLocations, getPromptFileType, CLAUDE_CONFIG_FOLDER, GITHUB_CONFIG_FOLDER, COPILOT_CONFIG_FOLDER, getPromptFileExtension, LEGACY_MODE_FILE_EXTENSION, AGENTS_SOURCE_FOLDER, getCleanPromptName, AGENT_FILE_EXTENSION, SKILL_FILENAME } from '../config/promptFileLocations.js';
14
- import { PromptFileSource, PromptsType } from '../promptTypes.js';
15
- import { IWorkbenchEnvironmentService } from '../../../../../services/environment/common/environmentService.service.js';
16
- import { Schemas } from '../../../../../../base/common/network.js';
17
- import { getExcludes, QueryType } from '../../../../../services/search/common/search.js';
18
- import { ISearchService } from '../../../../../services/search/common/search.service.js';
19
- import { CancellationTokenSource } from '../../../../../../base/common/cancellation.js';
20
- import { isCancellationError } from '../../../../../../base/common/errors.js';
21
- import { PromptsStorage, AgentInstructionFileType } from '../service/promptsService.js';
22
- import { IUserDataProfileService } from '../../../../../services/userDataProfile/common/userDataProfile.service.js';
23
- import { Event, Emitter } from '../../../../../../base/common/event.js';
24
- import { DisposableStore, toDisposable } from '../../../../../../base/common/lifecycle.js';
25
- import { ILogService } from '../../../../../../platform/log/common/log.service.js';
26
- import { IPathService } from '../../../../../services/path/common/pathService.service.js';
27
- import { equalsIgnoreCase } from '../../../../../../base/common/strings.js';
28
- import { IWorkspaceTrustManagementService } from '../../../../../../platform/workspace/common/workspaceTrust.service.js';
29
- import { AGENT_HOST_SCHEME } from '../../../../../../platform/agentHost/common/agentHostUri.js';
30
-
31
- const MAX_INSTRUCTIONS_RECURSION_DEPTH = 5;
32
- let PromptFilesLocator = class PromptFilesLocator {
33
- constructor(
34
- fileService,
35
- configService,
36
- workspaceService,
37
- environmentService,
38
- searchService,
39
- userDataService,
40
- logService,
41
- pathService,
42
- workspaceTrustManagementService
43
- ) {
44
- this.fileService = fileService;
45
- this.configService = configService;
46
- this.workspaceService = workspaceService;
47
- this.environmentService = environmentService;
48
- this.searchService = searchService;
49
- this.userDataService = userDataService;
50
- this.logService = logService;
51
- this.pathService = pathService;
52
- this.workspaceTrustManagementService = workspaceTrustManagementService;
53
- const userDataPromptsHome = this.userDataService.currentProfile.promptsHome;
54
- this.userDataFolder = {
55
- uri: userDataPromptsHome,
56
- searchRoot: userDataPromptsHome,
57
- filePattern: undefined,
58
- source: PromptFileSource.UserData,
59
- storage: PromptsStorage.user,
60
- displayPath: ( localize(10857, "User Data")),
61
- isDefault: true
62
- };
63
- }
64
- getWorkspaceFolders() {
65
- return this.workspaceService.getWorkspace().folders.filter(f => f.uri.scheme !== AGENT_HOST_SCHEME);
66
- }
67
- getWorkspaceFolder(resource) {
68
- return this.workspaceService.getWorkspaceFolder(resource) ?? undefined;
69
- }
70
- onDidChangeWorkspaceFolders() {
71
- return ( Event.map(this.workspaceService.onDidChangeWorkspaceFolders, () => undefined));
72
- }
73
- getPromptSourceFolders(type) {
74
- return PromptsConfig.promptSourceFolders(this.configService, type);
75
- }
76
- getDefaultSourceFolders(type) {
77
- return getPromptFileDefaultLocations(type);
78
- }
79
- async getWorkspaceFolderRoots(includeParents, logger, root) {
80
- const workspaceFolders = root ? root.scheme === AGENT_HOST_SCHEME ? [] : [{
81
- uri: root
82
- }] : this.getWorkspaceFolders();
83
- if (includeParents) {
84
- const roots = ( new ResourceSet());
85
- const userHome = await this.pathService.userHome();
86
- for (const workspaceFolder of workspaceFolders) {
87
- roots.add(workspaceFolder.uri);
88
- const parents = await this.findParentRepoFolders(workspaceFolder.uri, userHome, roots, logger);
89
- for (const parent of parents) {
90
- roots.add(parent);
91
- }
92
- }
93
- return [...roots];
94
- }
95
- return ( workspaceFolders.map(f => f.uri));
96
- }
97
- async findParentRepoFolders(folderUri, userHome, seen, logger) {
98
- const candidates = [];
99
- let current = folderUri;
100
- while (true) {
101
- try {
102
- const gitStat = await this.fileService.stat(joinPath(current, ".git")).then(stat => stat, () => undefined);
103
- const isRepoRoot = gitStat?.isDirectory === true;
104
- if (isRepoRoot) {
105
- if ((await this.workspaceTrustManagementService.getUriTrustInfo(current)).trusted) {
106
- candidates.push(current);
107
- return candidates;
108
- }
109
- logger?.logInfo(`Repository root found at ${( current.toString())}, but it is not trusted. Skipping parent folder inclusion for this workspace folder.`);
110
- return [];
111
- }
112
- } catch (e) {
113
- const msg = e instanceof Error ? e.message : String(e);
114
- logger?.logInfo(`No repository root found for folder ${( folderUri.toString())}. Error accessing ${joinPath(current, ".git")}: ${msg}.`);
115
- return [];
116
- }
117
- candidates.push(current);
118
- const parent = dirname(current);
119
- if (isEqual(current, parent) || current.path === "/" || isEqual(userHome, parent) || ( seen.has(parent))) {
120
- break;
121
- }
122
- current = parent;
123
- }
124
- logger?.logInfo(`No repository root found for folder ${( folderUri.toString())}.`);
125
- return [];
126
- }
127
- async listFiles(type, storage, token, root) {
128
- const files = await this.listFilesWithSource(type, storage, token, root);
129
- return ( files.map(file => file.uri));
130
- }
131
- async listFilesWithSource(type, storage, token, root) {
132
- if (storage !== PromptsStorage.user && storage !== PromptsStorage.local) {
133
- throw ( new Error(`Unsupported prompt file storage: ${storage}`));
134
- }
135
- const configuredLocations = this.getPromptSourceFolders(type);
136
- const localRoot = storage === PromptsStorage.local ? root : undefined;
137
- const absoluteLocations = await this.toAbsoluteLocations(
138
- type,
139
- configuredLocations.filter(location => location.storage === storage),
140
- undefined,
141
- localRoot
142
- );
143
- if (storage === PromptsStorage.user && this.isUserDataPromptType(type)) {
144
- const localLocations = await this.toAbsoluteLocations(
145
- type,
146
- configuredLocations.filter(location => location.storage === PromptsStorage.local)
147
- );
148
- absoluteLocations.push(
149
- ...localLocations.filter(location => this.sourceFolderOverlapsUserData(type, location.searchRoot))
150
- );
151
- absoluteLocations.push(this.userDataFolder);
152
- }
153
- const paths = ( new ResourceSet());
154
- const result = [];
155
- for (const {
156
- searchRoot,
157
- filePattern,
158
- source,
159
- storage: sourceStorage
160
- } of absoluteLocations) {
161
- const files = (filePattern === undefined) ?
162
- await this.resolveFilesAtLocation(searchRoot, type, token, 0, localRoot) : await this.searchFilesInLocation(searchRoot, filePattern, token);
163
- for (const file of files) {
164
- if (getPromptFileType(file) !== type || ( paths.has(file))) {
165
- continue;
166
- }
167
- const isUserDataFile = this.isUserDataPromptFile(type, file);
168
- if ((isUserDataFile && storage !== PromptsStorage.user) || (!isUserDataFile && sourceStorage !== storage)) {
169
- continue;
170
- }
171
- paths.add(file);
172
- result.push({
173
- uri: file,
174
- source: isUserDataFile ? PromptFileSource.UserData : source
175
- });
176
- }
177
- if (token.isCancellationRequested) {
178
- return [];
179
- }
180
- }
181
- return result;
182
- }
183
- isUserDataPromptType(type) {
184
- return type === PromptsType.agent || type === PromptsType.instructions || type === PromptsType.prompt;
185
- }
186
- isUserDataPromptFile(type, resource) {
187
- return this.isUserDataPromptType(type) && isEqualOrParent(resource, this.userDataFolder.uri);
188
- }
189
- sourceFolderOverlapsUserData(type, searchRoot) {
190
- return this.isUserDataPromptType(type) && (isEqualOrParent(searchRoot, this.userDataFolder.uri) || isEqualOrParent(this.userDataFolder.uri, searchRoot));
191
- }
192
- createFilesUpdatedEvent(type) {
193
- const disposables = ( new DisposableStore());
194
- const eventEmitter = disposables.add(( new Emitter()));
195
- const token = disposables.add(( new CancellationTokenSource())).token;
196
- const externalFolderWatchers = disposables.add(( new DisposableStore()));
197
- const key = getPromptFileLocationsConfigKey(type);
198
- const userDataFolder = this.userDataService.currentProfile.promptsHome;
199
- let parentFolders = [];
200
- const updateExternalFolderWatchers = () => {
201
- externalFolderWatchers.clear();
202
- for (const folder of parentFolders) {
203
- if (!this.getWorkspaceFolder(folder.searchRoot)) {
204
- const recursive = folder.filePattern !== undefined || type === PromptsType.instructions;
205
- externalFolderWatchers.add(this.fileService.watch(folder.searchRoot, {
206
- recursive,
207
- excludes: []
208
- }));
209
- }
210
- }
211
- };
212
- const update = async () => {
213
- try {
214
- const configuredLocations = this.getPromptSourceFolders(type);
215
- parentFolders = await this.toAbsoluteLocations(type, configuredLocations, undefined);
216
- if (token.isCancellationRequested) {
217
- return;
218
- }
219
- updateExternalFolderWatchers();
220
- } catch (err) {
221
- this.logService.error(`Error updating prompt file watchers after config change:`, err);
222
- }
223
- };
224
- disposables.add(this.configService.onDidChangeConfiguration(e => {
225
- if (e.affectsConfiguration(key) || e.affectsConfiguration(PromptsConfig.USE_CUSTOMIZATIONS_IN_PARENT_REPOS)) {
226
- void update();
227
- eventEmitter.fire();
228
- }
229
- }));
230
- disposables.add(this.onDidChangeWorkspaceFolders()(() => {
231
- void update();
232
- eventEmitter.fire();
233
- }));
234
- disposables.add(this.workspaceTrustManagementService.onDidChangeTrustedFolders(() => {
235
- void update();
236
- eventEmitter.fire();
237
- }));
238
- disposables.add(this.fileService.onDidFilesChange(e => {
239
- if (e.affects(userDataFolder)) {
240
- eventEmitter.fire();
241
- return;
242
- }
243
- if (( parentFolders.some(folder => e.affects(folder.searchRoot)))) {
244
- eventEmitter.fire();
245
- return;
246
- }
247
- }));
248
- disposables.add(this.fileService.watch(userDataFolder));
249
- void update();
250
- return {
251
- event: eventEmitter.event,
252
- dispose: () => disposables.dispose()
253
- };
254
- }
255
- createAgentInstructionsUpdatedEvent() {
256
- const disposables = ( new DisposableStore());
257
- const eventEmitter = disposables.add(( new Emitter()));
258
- const cts = ( new CancellationTokenSource());
259
- disposables.add(toDisposable(() => cts.dispose(true)));
260
- const token = cts.token;
261
- const watchers = disposables.add(( new DisposableStore()));
262
- const watchedRoots = ( new ResourceSet());
263
- const addWatch = resource => {
264
- if (token.isCancellationRequested) {
265
- return;
266
- }
267
- if (( watchedRoots.has(resource))) {
268
- return;
269
- }
270
- watchedRoots.add(resource);
271
- watchers.add(this.fileService.watch(resource));
272
- };
273
- const updateWatchers = async () => {
274
- watchers.clear();
275
- watchedRoots.clear();
276
- const watchWorkspaceRoots = this.configService.getValue(PromptsConfig.USE_AGENT_MD) || this.configService.getValue(PromptsConfig.USE_CLAUDE_MD);
277
- const watchClaudeFolders = this.configService.getValue(PromptsConfig.USE_CLAUDE_MD);
278
- const watchCopilotFolders = this.configService.getValue(PromptsConfig.USE_COPILOT_INSTRUCTION_FILES);
279
- const includeParents = this.configService.getValue(PromptsConfig.USE_CUSTOMIZATIONS_IN_PARENT_REPOS) === true;
280
- const workspaceRoots = await this.getWorkspaceFolderRoots(includeParents);
281
- if (token.isCancellationRequested) {
282
- return;
283
- }
284
- const userHome = await this.pathService.userHome();
285
- if (token.isCancellationRequested) {
286
- return;
287
- }
288
- for (const workspaceRoot of workspaceRoots) {
289
- if (watchWorkspaceRoots) {
290
- addWatch(workspaceRoot);
291
- }
292
- if (watchClaudeFolders) {
293
- addWatch(joinPath(workspaceRoot, CLAUDE_CONFIG_FOLDER));
294
- }
295
- if (watchCopilotFolders) {
296
- addWatch(joinPath(workspaceRoot, GITHUB_CONFIG_FOLDER));
297
- }
298
- }
299
- if (watchClaudeFolders) {
300
- addWatch(joinPath(userHome, CLAUDE_CONFIG_FOLDER));
301
- }
302
- if (watchCopilotFolders) {
303
- addWatch(joinPath(userHome, COPILOT_CONFIG_FOLDER));
304
- }
305
- };
306
- const refresh = () => {
307
- void updateWatchers();
308
- eventEmitter.fire();
309
- };
310
- disposables.add(this.configService.onDidChangeConfiguration(e => {
311
- if (e.affectsConfiguration(PromptsConfig.USE_AGENT_MD) || e.affectsConfiguration(PromptsConfig.USE_CLAUDE_MD) || e.affectsConfiguration(PromptsConfig.USE_COPILOT_INSTRUCTION_FILES) || e.affectsConfiguration(PromptsConfig.USE_CUSTOMIZATIONS_IN_PARENT_REPOS)) {
312
- refresh();
313
- }
314
- }));
315
- disposables.add(this.onDidChangeWorkspaceFolders()(() => {
316
- refresh();
317
- }));
318
- disposables.add(this.workspaceTrustManagementService.onDidChangeTrustedFolders(() => {
319
- refresh();
320
- }));
321
- disposables.add(this.fileService.onDidFilesChange(e => {
322
- for (const watchedRoot of watchedRoots) {
323
- if (e.affects(watchedRoot)) {
324
- eventEmitter.fire();
325
- return;
326
- }
327
- }
328
- }));
329
- disposables.add(this.fileService.onDidRunOperation(e => {
330
- for (const watchedRoot of watchedRoots) {
331
- if (isEqualOrParent(e.resource, watchedRoot)) {
332
- eventEmitter.fire();
333
- return;
334
- }
335
- if (e.isOperation(FileOperation.CREATE) || e.isOperation(FileOperation.MOVE) || e.isOperation(FileOperation.COPY)) {
336
- if (isEqualOrParent(e.target.resource, watchedRoot)) {
337
- eventEmitter.fire();
338
- return;
339
- }
340
- }
341
- }
342
- }));
343
- void updateWatchers();
344
- return {
345
- event: eventEmitter.event,
346
- dispose: () => disposables.dispose()
347
- };
348
- }
349
- async getHookSourceFolders() {
350
- const configuredLocations = this.getPromptSourceFolders(PromptsType.hook);
351
- const allowedHookFolders = configuredLocations.filter(loc => !loc.path.startsWith(".claude/") && !loc.path.includes("/.claude/"));
352
- const absoluteLocations = await this.toAbsoluteLocations(PromptsType.hook, allowedHookFolders);
353
- const seen = ( new ResourceSet());
354
- const result = [];
355
- for (const location of absoluteLocations) {
356
- if (!( seen.has(location.searchRoot))) {
357
- seen.add(location.searchRoot);
358
- result.push({
359
- ...location,
360
- uri: location.searchRoot,
361
- filePattern: undefined
362
- });
363
- }
364
- }
365
- return result;
366
- }
367
- async getConfigBasedSourceFolders(type) {
368
- const configuredLocations = this.getPromptSourceFolders(type);
369
- const absoluteLocations = await this.toAbsoluteLocations(type, configuredLocations);
370
- if (type !== PromptsType.prompt && type !== PromptsType.instructions) {
371
- return ( absoluteLocations.map(l => l.uri));
372
- }
373
- const result = ( new ResourceSet());
374
- for (const absoluteLocation of absoluteLocations) {
375
- let location = absoluteLocation.uri;
376
- const baseName = basename(location);
377
- const filePatterns = ["*.md", `*${getPromptFileExtension(type)}`];
378
- for (const filePattern of filePatterns) {
379
- if (baseName === filePattern) {
380
- location = dirname(location);
381
- continue;
382
- }
383
- }
384
- if (baseName === "*") {
385
- location = dirname(location);
386
- }
387
- if (isValidGlob(location.path) === true) {
388
- continue;
389
- }
390
- result.add(location);
391
- }
392
- return [...result];
393
- }
394
- async getResolvedSourceFolders(type) {
395
- const absoluteLocations = await this.getLocalStorageFolders(type);
396
- const localFolders = absoluteLocations.filter(loc => loc.storage === PromptsStorage.local);
397
- const userFolders = absoluteLocations.filter(loc => loc.storage === PromptsStorage.user);
398
- return this.dedupeSourceFolders([...localFolders, ...userFolders]);
399
- }
400
- async getSourceFoldersInDiscoveryOrder(type) {
401
- const absoluteLocations = await this.getLocalStorageFolders(type);
402
- const userFolders = absoluteLocations.filter(loc => loc.storage === PromptsStorage.user);
403
- const localFolders = absoluteLocations.filter(loc => loc.storage === PromptsStorage.local);
404
- return this.dedupeSourceFolders([...userFolders, ...localFolders]);
405
- }
406
- async getLocalStorageFolders(type) {
407
- const configuredLocations = this.getPromptSourceFolders(type);
408
- const defaultFolders = this.getDefaultSourceFolders(type);
409
- const isConfigured = PromptsConfig.getLocationsValue(this.configService, type) !== undefined;
410
- const allFolders = isConfigured ? configuredLocations : defaultFolders;
411
- const absoluteLocations = await this.toAbsoluteLocations(type, allFolders, defaultFolders);
412
- if (type === PromptsType.agent || type === PromptsType.instructions || type === PromptsType.prompt) {
413
- absoluteLocations.push(this.userDataFolder);
414
- }
415
- return absoluteLocations;
416
- }
417
- dedupeSourceFolders(folders) {
418
- const seen = ( new ResourceSet());
419
- const result = [];
420
- for (const folder of folders) {
421
- if (!( seen.has(folder.uri))) {
422
- seen.add(folder.uri);
423
- result.push(folder);
424
- }
425
- }
426
- return result;
427
- }
428
- async toAbsoluteLocations(type, configuredLocations, defaultLocations, root) {
429
- const result = [];
430
- const seen = ( new ResourceSet());
431
- const userHome = await this.pathService.userHome();
432
- const rootFolders = await this.getWorkspaceFolderRoots(
433
- this.configService.getValue(PromptsConfig.USE_CUSTOMIZATIONS_IN_PARENT_REPOS) === true,
434
- undefined,
435
- root
436
- );
437
- const defaultPaths = ( new Set(defaultLocations?.map(loc => loc.path)));
438
- const validLocations = configuredLocations.filter(sourceFolder => {
439
- if (type === PromptsType.instructions || type === PromptsType.prompt) {
440
- const path = sourceFolder.path;
441
- if (hasGlobPattern(path)) {
442
- if (type === PromptsType.prompt) {
443
- this.logService.warn(
444
- `[Deprecated] Glob patterns (* and **) in prompt file locations are deprecated: "${path}". Consider using explicit paths instead.`
445
- );
446
- } else if (type === PromptsType.instructions) {
447
- this.logService.info(
448
- `Glob patterns (* and **) detected in instruction file location: "${path}". Consider using explicit paths for better performance.`
449
- );
450
- }
451
- }
452
- return true;
453
- }
454
- const configuredLocation = sourceFolder.path;
455
- if (!isValidPromptFolderPath(configuredLocation)) {
456
- this.logService.warn(
457
- `Skipping invalid path (glob patterns and absolute paths not supported): ${configuredLocation}`
458
- );
459
- return false;
460
- }
461
- return true;
462
- });
463
- for (const sourceFolder of validLocations) {
464
- const configuredLocation = sourceFolder.path;
465
- const isDefault = defaultPaths?.has(configuredLocation);
466
- try {
467
- if (isTildePath(configuredLocation)) {
468
- const uri = joinPath(userHome, configuredLocation.substring(2));
469
- if (!( seen.has(uri))) {
470
- seen.add(uri);
471
- const {
472
- searchRoot,
473
- filePattern
474
- } = resolveSearchLocation(type, uri);
475
- result.push({
476
- uri,
477
- searchRoot: searchRoot,
478
- filePattern,
479
- source: sourceFolder.source,
480
- storage: sourceFolder.storage,
481
- displayPath: configuredLocation,
482
- isDefault
483
- });
484
- }
485
- continue;
486
- }
487
- if (isAbsolute(configuredLocation)) {
488
- let uri = URI.file(configuredLocation);
489
- const remoteAuthority = this.environmentService.remoteAuthority;
490
- if (remoteAuthority) {
491
- uri = uri.with({
492
- scheme: Schemas.vscodeRemote,
493
- authority: remoteAuthority
494
- });
495
- }
496
- if (!( seen.has(uri))) {
497
- seen.add(uri);
498
- const {
499
- searchRoot,
500
- filePattern
501
- } = resolveSearchLocation(type, uri);
502
- result.push({
503
- uri,
504
- searchRoot: searchRoot,
505
- filePattern,
506
- source: sourceFolder.source,
507
- storage: sourceFolder.storage,
508
- displayPath: configuredLocation,
509
- isDefault
510
- });
511
- }
512
- } else {
513
- for (const folder of rootFolders) {
514
- const absolutePath = joinPath(folder, configuredLocation);
515
- if (!( seen.has(absolutePath))) {
516
- seen.add(absolutePath);
517
- const {
518
- searchRoot,
519
- filePattern
520
- } = resolveSearchLocation(type, absolutePath);
521
- result.push({
522
- uri: absolutePath,
523
- searchRoot: searchRoot,
524
- filePattern,
525
- source: sourceFolder.source,
526
- storage: sourceFolder.storage,
527
- displayPath: configuredLocation,
528
- isDefault
529
- });
530
- }
531
- }
532
- }
533
- } catch (error) {
534
- this.logService.error(`Failed to resolve prompt file location: ${configuredLocation}`, error);
535
- }
536
- }
537
- return result;
538
- }
539
- async resolveFilesAtLocation(location, type, token, depth = 0, root) {
540
- if (type === PromptsType.skill) {
541
- return this.findAgentSkillsInFolder(location, token);
542
- }
543
- const isWorkspaceRoot = depth === 0 && (root ? isEqual(root, location) : ( this.getWorkspaceFolders().some(f => isEqual(f.uri, location))));
544
- const recursive = type === PromptsType.instructions && !isWorkspaceRoot && !hasGlobPattern(location.path) && depth < MAX_INSTRUCTIONS_RECURSION_DEPTH;
545
- try {
546
- const info = await this.fileService.resolve(location);
547
- if (token.isCancellationRequested) {
548
- return [];
549
- }
550
- if (info.isFile) {
551
- return [info.resource];
552
- } else if (info.isDirectory && info.children) {
553
- const result = [];
554
- for (const child of info.children) {
555
- if (child.isFile) {
556
- result.push(child.resource);
557
- } else if (recursive && child.isDirectory) {
558
- const subFiles = await this.resolveFilesAtLocation(child.resource, type, token, depth + 1, root);
559
- result.push(...subFiles);
560
- }
561
- }
562
- return result;
563
- }
564
- } catch (e) {
565
- if (e instanceof FileOperationError && e.fileOperationResult === FileOperationResult.FILE_NOT_FOUND)
566
- ; else {
567
- this.logService.error(`Failed to resolve files at location: ${( location.toString())}`, e);
568
- }
569
- }
570
- return [];
571
- }
572
- async searchFilesInLocation(folder, filePattern, token) {
573
- if (!this.searchService.schemeHasFileSearchProvider(folder.scheme)) {
574
- this.logService.warn(
575
- `[PromptFilesLocator] No FileSearchProvider available for scheme '${folder.scheme}'. Cannot search for pattern '${filePattern}' in ${( folder.toString())}`
576
- );
577
- return [];
578
- }
579
- const disregardIgnoreFiles = this.configService.getValue("explorer.excludeGitIgnore");
580
- const workspaceRoot = this.getWorkspaceFolder(folder);
581
- const getExcludePattern = folder => getExcludes(this.configService.getValue({
582
- resource: folder
583
- })) || {};
584
- const searchOptions = {
585
- folderQueries: [{
586
- folder,
587
- disregardIgnoreFiles
588
- }],
589
- type: QueryType.File,
590
- shouldGlobMatchFilePattern: true,
591
- excludePattern: workspaceRoot ? getExcludePattern(workspaceRoot.uri) : undefined,
592
- ignoreGlobCase: true,
593
- sortByScore: true,
594
- filePattern
595
- };
596
- try {
597
- const searchResult = await this.searchService.fileSearch(searchOptions, token);
598
- if (token.isCancellationRequested) {
599
- return [];
600
- }
601
- return ( searchResult.results.map(r => r.resource));
602
- } catch (e) {
603
- if (!isCancellationError(e)) {
604
- throw e;
605
- }
606
- }
607
- return [];
608
- }
609
- async findAgentMDsInWorkspace(token) {
610
- const result = await Promise.all(( this.getWorkspaceFolders().map(folder => this.findAgentMDsInFolder(folder.uri, token))));
611
- return result.flat(1);
612
- }
613
- async findAgentMDsInFolder(folder, token) {
614
- if (this.searchService.schemeHasFileSearchProvider(folder.scheme)) {
615
- const disregardIgnoreFiles = this.configService.getValue("explorer.excludeGitIgnore");
616
- const getExcludePattern = folder => getExcludes(this.configService.getValue({
617
- resource: folder
618
- })) || {};
619
- const searchOptions = {
620
- folderQueries: [{
621
- folder,
622
- disregardIgnoreFiles
623
- }],
624
- type: QueryType.File,
625
- shouldGlobMatchFilePattern: true,
626
- excludePattern: getExcludePattern(folder),
627
- filePattern: "**/AGENTS.md",
628
- ignoreGlobCase: true
629
- };
630
- try {
631
- const searchResult = await this.searchService.fileSearch(searchOptions, token);
632
- if (token.isCancellationRequested) {
633
- return [];
634
- }
635
- const results = [];
636
- for (const r of searchResult.results) {
637
- const realPath = undefined;
638
- results.push({
639
- uri: r.resource,
640
- realPath,
641
- type: AgentInstructionFileType.agentsMd
642
- });
643
- }
644
- return results;
645
- } catch (e) {
646
- if (!isCancellationError(e)) {
647
- throw e;
648
- }
649
- }
650
- return [];
651
- } else {
652
- return this.findAgentMDsUsingFileService(folder, token);
653
- }
654
- }
655
- async findAgentMDsUsingFileService(folder, token) {
656
- const result = [];
657
- const agentsMdFileName = "agents.md";
658
- const traverse = async uri => {
659
- if (token.isCancellationRequested) {
660
- return;
661
- }
662
- try {
663
- const stat = await this.fileService.resolve(uri);
664
- if (stat.isFile && stat.name.toLowerCase() === agentsMdFileName) {
665
- const realPath = stat.isSymbolicLink ? await this.fileService.realpath(stat.resource) : undefined;
666
- result.push({
667
- uri: stat.resource,
668
- realPath,
669
- type: AgentInstructionFileType.agentsMd
670
- });
671
- } else if (stat.isDirectory && stat.children) {
672
- for (const child of stat.children) {
673
- await traverse(child.resource);
674
- }
675
- }
676
- } catch (error) {
677
- this.logService.trace(`[PromptFilesLocator] Error traversing ${( uri.toString())}: ${error}`);
678
- }
679
- };
680
- await traverse(folder);
681
- return result;
682
- }
683
- async findFilesInRoots(roots, folder, paths, token, result = []) {
684
- const toResolve = ( roots.map(root => ({
685
- resource: folder !== undefined ? joinPath(root, folder) : root
686
- })));
687
- const resolvedRoots = await this.fileService.resolveAll(toResolve);
688
- if (token.isCancellationRequested) {
689
- return result;
690
- }
691
- for (const root of resolvedRoots) {
692
- if (root.success && root.stat?.children) {
693
- for (const child of root.stat.children) {
694
- if (child.isFile) {
695
- const matchingPath = paths.find(p => equalsIgnoreCase(p.fileName, child.name));
696
- if (matchingPath) {
697
- const realPath = child.isSymbolicLink ? await this.fileService.realpath(child.resource) : undefined;
698
- result.push({
699
- uri: child.resource,
700
- realPath,
701
- type: matchingPath.type
702
- });
703
- }
704
- }
705
- }
706
- }
707
- }
708
- return result;
709
- }
710
- getAgentFileURIFromModeFile(oldURI) {
711
- if (oldURI.path.endsWith(LEGACY_MODE_FILE_EXTENSION)) {
712
- let newLocation;
713
- const workspaceFolder = this.getWorkspaceFolder(oldURI);
714
- if (workspaceFolder) {
715
- newLocation = joinPath(
716
- workspaceFolder.uri,
717
- AGENTS_SOURCE_FOLDER,
718
- getCleanPromptName(oldURI) + AGENT_FILE_EXTENSION
719
- );
720
- } else if (isEqualOrParent(oldURI, this.userDataService.currentProfile.promptsHome)) {
721
- newLocation = joinPath(
722
- this.userDataService.currentProfile.promptsHome,
723
- getCleanPromptName(oldURI) + AGENT_FILE_EXTENSION
724
- );
725
- }
726
- return newLocation;
727
- }
728
- return undefined;
729
- }
730
- async findAgentSkillsInFolder(uri, token) {
731
- try {
732
- const result = [];
733
- const stat = await this.fileService.resolve(uri);
734
- if (stat.isDirectory && stat.children) {
735
- for (const child of stat.children) {
736
- try {
737
- if (token.isCancellationRequested) {
738
- return [];
739
- }
740
- if (child.isDirectory) {
741
- const skillFile = joinPath(child.resource, SKILL_FILENAME);
742
- const skillStat = await this.fileService.resolve(skillFile);
743
- if (skillStat.isFile) {
744
- result.push(skillStat.resource);
745
- }
746
- }
747
- } catch (error) {}
748
- }
749
- }
750
- return result;
751
- } catch (e) {
752
- if (!isCancellationError(e)) {
753
- this.logService.trace(`[PromptFilesLocator] Error searching for skills in ${( uri.toString())}: ${e}`);
754
- }
755
- return [];
756
- }
757
- }
758
- async findAgentSkills(token) {
759
- const configuredLocations = this.getPromptSourceFolders(PromptsType.skill);
760
- const absoluteLocations = await this.toAbsoluteLocations(PromptsType.skill, configuredLocations);
761
- const allResults = [];
762
- for (const {
763
- uri,
764
- source,
765
- storage
766
- } of absoluteLocations) {
767
- if (token.isCancellationRequested) {
768
- return [];
769
- }
770
- const results = await this.findAgentSkillsInFolder(uri, token);
771
- for (const skillUri of results) {
772
- allResults.push({
773
- uri: skillUri,
774
- source,
775
- storage,
776
- type: PromptsType.skill
777
- });
778
- }
779
- }
780
- return allResults;
781
- }
782
- };
783
- PromptFilesLocator = ( __decorate([( __param(0, IFileService)), ( __param(1, IConfigurationService)), ( __param(2, IWorkspaceContextService)), ( __param(3, IWorkbenchEnvironmentService)), ( __param(4, ISearchService)), ( __param(5, IUserDataProfileService)), ( __param(6, ILogService)), ( __param(7, IPathService)), ( __param(8, IWorkspaceTrustManagementService))], PromptFilesLocator));
784
- function hasGlobPattern(path) {
785
- return path.includes("*");
786
- }
787
- function isValidGlob(pattern) {
788
- let squareBrackets = false;
789
- let squareBracketsCount = 0;
790
- let curlyBrackets = false;
791
- let curlyBracketsCount = 0;
792
- let previousCharacter;
793
- for (const char of pattern) {
794
- if (previousCharacter === "\\") {
795
- previousCharacter = char;
796
- continue;
797
- }
798
- if (char === "*") {
799
- return true;
800
- }
801
- if (char === "?") {
802
- return true;
803
- }
804
- if (char === "[") {
805
- squareBrackets = true;
806
- squareBracketsCount++;
807
- previousCharacter = char;
808
- continue;
809
- }
810
- if (char === "]") {
811
- squareBrackets = true;
812
- squareBracketsCount--;
813
- previousCharacter = char;
814
- continue;
815
- }
816
- if (char === "{") {
817
- curlyBrackets = true;
818
- curlyBracketsCount++;
819
- continue;
820
- }
821
- if (char === "}") {
822
- curlyBrackets = true;
823
- curlyBracketsCount--;
824
- previousCharacter = char;
825
- continue;
826
- }
827
- previousCharacter = char;
828
- }
829
- if (squareBrackets && (squareBracketsCount === 0)) {
830
- return true;
831
- }
832
- if (curlyBrackets && (curlyBracketsCount === 0)) {
833
- return true;
834
- }
835
- return false;
836
- }
837
- function resolveSearchLocation(type, location) {
838
- if (type !== PromptsType.instructions && type !== PromptsType.prompt) {
839
- return {
840
- searchRoot: location
841
- };
842
- }
843
- const segments = location.path.split("/");
844
- let i = 0;
845
- while (i < segments.length && isValidGlob(segments[i]) === false) {
846
- i++;
847
- }
848
- if (i === segments.length) {
849
- return {
850
- searchRoot: location
851
- };
852
- }
853
- const parent = location.with({
854
- path: segments.slice(0, i).join("/")
855
- });
856
- if (i === segments.length - 1 && segments[i] === "*" || segments[i] === ``) {
857
- return {
858
- searchRoot: parent
859
- };
860
- }
861
- return {
862
- searchRoot: parent,
863
- filePattern: segments.slice(i).join("/")
864
- };
865
- }
866
- const VALID_PROMPT_FOLDER_PATTERN = "^(?![A-Za-z]:[\\\\/])(?!/)(?!~(?!/))(?!.*\\\\)(?!.*[*?\\[\\]{}]).*\\S.*$";
867
- const VALID_PROMPT_FOLDER_REGEX = ( new RegExp(VALID_PROMPT_FOLDER_PATTERN));
868
- function isValidPromptFolderPath(path) {
869
- return VALID_PROMPT_FOLDER_REGEX.test(path);
870
- }
871
-
872
- export { PromptFilesLocator, VALID_PROMPT_FOLDER_PATTERN, hasGlobPattern, isValidGlob, isValidPromptFolderPath };