@codingame/monaco-vscode-chat-service-override 27.0.0 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/index.js +5 -2
  2. package/package.json +5 -5
  3. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +54 -4
  4. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +179 -11
  5. package/vscode/src/vs/sessions/contrib/chat/browser/newSession.js +5 -1
  6. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.d.ts +6 -1
  7. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.js +25 -10
  8. package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.d.ts +67 -0
  9. package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.js +263 -0
  10. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.d.ts +6 -0
  11. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.js +25 -6
  12. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  13. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +15 -15
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +13 -5
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -4
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +5 -5
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +11 -11
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +5 -4
  28. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.d.ts +7 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +2 -2
  30. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  31. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +13 -13
  32. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  33. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +12 -12
  34. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +49 -13
  35. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  36. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +58 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +537 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.d.ts +17 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +55 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +26 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.js +9 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/media/agentPluginEditor.css +32 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +17 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +89 -11
  45. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +4 -26
  46. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +146 -53
  47. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
  48. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +56 -54
  49. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
  50. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  51. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +5 -5
  53. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  54. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  55. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -25
  56. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  57. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  58. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +4 -0
  59. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +13 -12
  60. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +7 -9
  61. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +189 -145
  62. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +42 -44
  63. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +0 -1
  64. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +3 -4
  65. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +20 -8
  66. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +210 -59
  67. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
  68. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +14 -3
  69. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +3 -3
  70. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +122 -53
  71. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +87 -9
  72. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +62 -0
  73. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +702 -0
  74. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  75. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +19 -19
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +279 -214
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +21 -21
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +12 -3
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  81. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  83. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.d.ts +12 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +63 -4
  85. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  86. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +18 -18
  87. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +6 -6
  88. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +4 -1
  89. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +62 -24
  90. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  91. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  92. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +28 -28
  93. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +9 -9
  94. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +2 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +7 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +2 -5
  97. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +32 -36
  98. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  99. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +4 -5
  100. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditorController.css +2 -2
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +13 -13
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +49 -49
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +11 -11
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.d.ts +9 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +14 -14
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +26 -26
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +13 -13
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +3 -1
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +103 -60
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +61 -61
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +12 -12
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +66 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +245 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +78 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.js +234 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +31 -126
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +229 -524
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.d.ts +41 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.js +22 -0
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +4 -3
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +54 -20
  137. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  138. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +11 -12
  139. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +112 -39
  140. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +99 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +489 -0
  142. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  143. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +6 -3
  144. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +348 -285
  145. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +18 -1
  146. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +107 -5
  147. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  148. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +4 -4
  149. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  150. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  151. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  152. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  153. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +2 -0
  154. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +55 -38
  155. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +20 -1
  156. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +148 -60
  157. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +5 -5
  158. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
  159. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +6 -6
  160. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  161. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
  162. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +29 -14
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +6 -6
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +72 -14
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +5 -3
  166. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  167. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  168. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +5 -2
  169. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +11 -10
  170. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  171. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +8 -0
  172. package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.d.ts +1 -0
  173. package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.js +1 -0
  174. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +8 -0
  175. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +20 -0
  176. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -1
  177. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +72 -23
  178. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +19 -1
  179. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +5 -1
  180. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +6 -1
  181. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +37 -8
  182. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +36 -3
  183. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +4 -4
  184. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +2 -2
  185. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +6 -1
  186. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +71 -25
  187. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +217 -91
  188. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +85 -3
  189. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +257 -63
  190. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +17 -17
  191. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +3 -16
  192. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +7 -50
  193. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +2 -1
  194. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +32 -3
  195. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +1 -1
  196. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +3 -1
  197. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +1 -1
  198. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +7 -6
  199. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +1 -1
  200. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +26 -1
  201. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +287 -88
  202. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +10 -1
  203. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +75 -20
  204. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +121 -0
  205. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +1422 -0
  206. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
  207. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +5 -1
  208. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +81 -41
  209. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +3 -1
  210. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +8 -6
  211. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  212. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +14 -2
  213. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +54 -5
  214. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +6 -5
  215. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +4 -4
  216. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +38 -22
  217. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  218. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +8 -8
  219. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  220. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  221. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  222. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  223. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  224. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +8 -0
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +36 -18
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +6 -0
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +27 -13
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +1 -1
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  245. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  246. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  247. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  248. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -0
  249. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +8 -1
  250. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -12
  251. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -67
@@ -0,0 +1,245 @@
1
+
2
+ import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
3
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
4
+ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
5
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
6
+ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
7
+ import { ChatConfiguration, ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
8
+ import { localChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
9
+ import { TipTrackingCommands } from './chatTipStorageKeys.js';
10
+ import { GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID, GENERATE_PROMPT_COMMAND_ID, GENERATE_AGENT_COMMAND_ID, GENERATE_SKILL_COMMAND_ID, INSERT_FORK_CONVERSATION_COMMAND_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
11
+
12
+ var ChatTipTier;
13
+ (function(ChatTipTier) {
14
+ ChatTipTier["Foundational"] = "foundational";
15
+ ChatTipTier["Qol"] = "qol";
16
+ })(ChatTipTier || (ChatTipTier = {}));
17
+ function formatKeybinding(ctx, commandId) {
18
+ const kb = ctx.keybindingService.lookupKeybinding(commandId);
19
+ return kb ? ` (${kb.getLabel()})` : "";
20
+ }
21
+ function extractCommandIds(markdown) {
22
+ const commandPattern = /\[.*?\]\(command:([^?\s)]+)/g;
23
+ const commands = ( new Set());
24
+ let match;
25
+ while ((match = commandPattern.exec(markdown)) !== null) {
26
+ commands.add(match[1]);
27
+ }
28
+ return [...commands];
29
+ }
30
+ const TIP_CATALOG = [{
31
+ id: "tip.switchToAuto",
32
+ tier: ChatTipTier.Foundational,
33
+ priority: 0,
34
+ buildMessage(_ctx) {
35
+ return (new MarkdownString(localize(
36
+ 6217,
37
+ "Using GPT-4.1? Try switching to [Auto](command:workbench.action.chat.openModelPicker) in the model picker for better coding performance."
38
+ )));
39
+ },
40
+ onlyWhenModelIds: ["gpt-4.1"]
41
+ }, {
42
+ id: "tip.init",
43
+ tier: ChatTipTier.Foundational,
44
+ priority: 50,
45
+ buildMessage(ctx) {
46
+ const kb = formatKeybinding(ctx, GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID);
47
+ return (new MarkdownString(localize(
48
+ 6218,
49
+ "Use [{0}](command:{1}){2} to generate or update a workspace instructions file for AI coding agents.",
50
+ "/init",
51
+ GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID,
52
+ kb
53
+ )));
54
+ },
55
+ when: ( ChatContextKeys.chatSessionType.isEqualTo(localChatSessionType)),
56
+ excludeWhenCommandsExecuted: [
57
+ GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID,
58
+ TipTrackingCommands.CreateAgentInstructionsUsed
59
+ ]
60
+ }, {
61
+ id: "tip.createPrompt",
62
+ tier: ChatTipTier.Foundational,
63
+ buildMessage(ctx) {
64
+ const kb = formatKeybinding(ctx, GENERATE_PROMPT_COMMAND_ID);
65
+ return (new MarkdownString(localize(
66
+ 6219,
67
+ "Use [{0}](command:{1}){2} to generate a reusable prompt file with the agent.",
68
+ "/create-prompt",
69
+ GENERATE_PROMPT_COMMAND_ID,
70
+ kb
71
+ )));
72
+ },
73
+ when: ( ChatContextKeys.chatSessionType.isEqualTo(localChatSessionType)),
74
+ excludeWhenCommandsExecuted: [GENERATE_PROMPT_COMMAND_ID, TipTrackingCommands.CreatePromptUsed]
75
+ }, {
76
+ id: "tip.createAgent",
77
+ tier: ChatTipTier.Foundational,
78
+ priority: 30,
79
+ buildMessage(ctx) {
80
+ const kb = formatKeybinding(ctx, GENERATE_AGENT_COMMAND_ID);
81
+ return (new MarkdownString(localize(
82
+ 6220,
83
+ "Use [{0}](command:{1}){2} to scaffold a custom agent for your workflow.",
84
+ "/create-agent",
85
+ GENERATE_AGENT_COMMAND_ID,
86
+ kb
87
+ )));
88
+ },
89
+ when: ( ChatContextKeys.chatSessionType.isEqualTo(localChatSessionType)),
90
+ excludeWhenCommandsExecuted: [GENERATE_AGENT_COMMAND_ID, TipTrackingCommands.CreateAgentUsed]
91
+ }, {
92
+ id: "tip.createSkill",
93
+ tier: ChatTipTier.Foundational,
94
+ priority: 40,
95
+ buildMessage(ctx) {
96
+ const kb = formatKeybinding(ctx, GENERATE_SKILL_COMMAND_ID);
97
+ return (new MarkdownString(localize(
98
+ 6221,
99
+ "Use [{0}](command:{1}){2} to create a skill the agent can load when relevant.",
100
+ "/create-skill",
101
+ GENERATE_SKILL_COMMAND_ID,
102
+ kb
103
+ )));
104
+ },
105
+ when: ( ChatContextKeys.chatSessionType.isEqualTo(localChatSessionType)),
106
+ excludeWhenCommandsExecuted: [GENERATE_SKILL_COMMAND_ID, TipTrackingCommands.CreateSkillUsed]
107
+ }, {
108
+ id: "tip.planMode",
109
+ tier: ChatTipTier.Foundational,
110
+ priority: 20,
111
+ buildMessage(ctx) {
112
+ const kb = formatKeybinding(ctx, "workbench.action.chat.openPlan");
113
+ return (new MarkdownString(localize(
114
+ 6222,
115
+ "Try the [{0}](command:workbench.action.chat.openPlan){1} to research and plan before implementing changes.",
116
+ "Plan agent",
117
+ kb
118
+ )));
119
+ },
120
+ when: ( ChatContextKeys.chatModeName.notEqualsTo("Plan")),
121
+ excludeWhenCommandsExecuted: ["workbench.action.chat.openPlan"],
122
+ excludeWhenModesUsed: ["Plan"]
123
+ }, {
124
+ id: "tip.attachFiles",
125
+ tier: ChatTipTier.Qol,
126
+ buildMessage() {
127
+ return (new MarkdownString(localize(
128
+ 6223,
129
+ "Reference files or folders with # to give the agent more context about the task."
130
+ )));
131
+ },
132
+ excludeWhenCommandsExecuted: [
133
+ "workbench.action.chat.attachContext",
134
+ "workbench.action.chat.attachFile",
135
+ "workbench.action.chat.attachFolder",
136
+ "workbench.action.chat.attachSelection",
137
+ TipTrackingCommands.AttachFilesReferenceUsed
138
+ ]
139
+ }, {
140
+ id: "tip.codeActions",
141
+ tier: ChatTipTier.Qol,
142
+ buildMessage() {
143
+ return (new MarkdownString(localize(
144
+ 6224,
145
+ "Select a code block in the editor and right-click to access more AI actions."
146
+ )));
147
+ },
148
+ excludeWhenCommandsExecuted: ["inlineChat.start"]
149
+ }, {
150
+ id: "tip.undoChanges",
151
+ tier: ChatTipTier.Qol,
152
+ buildMessage() {
153
+ return (new MarkdownString(localize(
154
+ 6225,
155
+ "Hover a previous request and select \"Restore Checkpoint\" to undo changes after that point in the chat conversation."
156
+ )));
157
+ },
158
+ when: ( ContextKeyExpr.and(( ChatContextKeys.chatSessionType.isEqualTo(localChatSessionType)), ( ContextKeyExpr.or(( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent)), ( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Edit)))))),
159
+ excludeWhenCommandsExecuted: [
160
+ "workbench.action.chat.restoreCheckpoint",
161
+ "workbench.action.chat.restoreLastCheckpoint"
162
+ ]
163
+ }, {
164
+ id: "tip.messageQueueing",
165
+ tier: ChatTipTier.Qol,
166
+ buildMessage() {
167
+ return (new MarkdownString(localize(
168
+ 6226,
169
+ "Steer the agent mid-task by sending follow-up messages. They queue and apply in order."
170
+ )));
171
+ },
172
+ when: ( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent)),
173
+ excludeWhenCommandsExecuted: [
174
+ "workbench.action.chat.queueMessage",
175
+ "workbench.action.chat.steerWithMessage"
176
+ ]
177
+ }, {
178
+ id: "tip.forkConversation",
179
+ tier: ChatTipTier.Qol,
180
+ buildMessage(ctx) {
181
+ const kb = formatKeybinding(ctx, INSERT_FORK_CONVERSATION_COMMAND_ID);
182
+ return (new MarkdownString(localize(
183
+ 6227,
184
+ "Use [{0}](command:{1}){2} to branch the conversation. Explore a different approach without losing the original context.",
185
+ "/fork",
186
+ INSERT_FORK_CONVERSATION_COMMAND_ID,
187
+ kb
188
+ )));
189
+ },
190
+ excludeWhenCommandsExecuted: [
191
+ INSERT_FORK_CONVERSATION_COMMAND_ID,
192
+ "workbench.action.chat.forkConversation",
193
+ TipTrackingCommands.ForkConversationUsed
194
+ ]
195
+ }, {
196
+ id: "tip.agenticBrowser",
197
+ tier: ChatTipTier.Qol,
198
+ buildMessage() {
199
+ return (new MarkdownString(localize(
200
+ 6228,
201
+ "Enable [{0}](command:workbench.action.openSettings?%5B%22workbench.browser.enableChatTools%22%5D) to let the agent open and interact with pages in the Integrated Browser.",
202
+ "agentic browser integration"
203
+ )));
204
+ },
205
+ when: ( ContextKeyExpr.and(( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent)), ( ContextKeyExpr.notEquals("config.workbench.browser.enableChatTools", true)))),
206
+ excludeWhenSettingsChanged: ["workbench.browser.enableChatTools"],
207
+ dismissWhenCommandsClicked: ["workbench.action.openSettings"]
208
+ }, {
209
+ id: "tip.mermaid",
210
+ tier: ChatTipTier.Qol,
211
+ buildMessage() {
212
+ return (new MarkdownString(localize(
213
+ 6229,
214
+ "Ask the agent to draw an architectural diagram or flow chart. It can render Mermaid diagrams directly in chat."
215
+ )));
216
+ },
217
+ when: ( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent)),
218
+ excludeWhenToolsInvoked: ["renderMermaidDiagram"]
219
+ }, {
220
+ id: "tip.subagents",
221
+ tier: ChatTipTier.Qol,
222
+ buildMessage() {
223
+ return (new MarkdownString(
224
+ localize(6230, "Ask the agent to work in parallel to complete large tasks faster.")
225
+ ));
226
+ },
227
+ when: ( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent)),
228
+ excludeWhenToolsInvoked: ["runSubagent"]
229
+ }, {
230
+ id: "tip.thinkingPhrases",
231
+ tier: ChatTipTier.Qol,
232
+ buildMessage() {
233
+ return (new MarkdownString(localize(
234
+ 6231,
235
+ "Customize the loading messages shown while the agent works with [{0}](command:workbench.action.openSettings?%5B%22{1}%22%5D).",
236
+ "thinking phrases",
237
+ ChatConfiguration.ThinkingPhrases
238
+ )));
239
+ },
240
+ when: ( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent)),
241
+ excludeWhenSettingsChanged: [ChatConfiguration.ThinkingPhrases],
242
+ dismissWhenCommandsClicked: ["workbench.action.openSettings"]
243
+ }];
244
+
245
+ export { ChatTipTier, TIP_CATALOG, extractCommandIds };
@@ -0,0 +1,78 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
3
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
4
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
5
+ import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
6
+ import { AgentFileType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService";
7
+ import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service";
8
+ import { PromptsType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes";
9
+ import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
10
+ /**
11
+ * Interface for tip definitions that have exclusion criteria tracked by this class.
12
+ * This subset is all TipEligibilityTracker needs to know about tip definitions.
13
+ */
14
+ export interface ITipExclusionConfig {
15
+ readonly id: string;
16
+ /** Command IDs that, if ever executed, make this tip ineligible. */
17
+ readonly excludeWhenCommandsExecuted?: readonly string[];
18
+ /** Chat mode names that, if ever used, make this tip ineligible. */
19
+ readonly excludeWhenModesUsed?: readonly string[];
20
+ /** Tool IDs that, if ever invoked, make this tip ineligible. */
21
+ readonly excludeWhenToolsInvoked?: readonly string[];
22
+ /** File-based exclusion configuration. */
23
+ readonly excludeWhenPromptFilesExist?: {
24
+ readonly promptType: PromptsType;
25
+ readonly agentFileType?: AgentFileType;
26
+ readonly excludeUntilChecked?: boolean;
27
+ };
28
+ }
29
+ /**
30
+ * Tracks user-level signals that determine whether certain tips should be
31
+ * excluded. Persists state to application storage and disposes listeners once all
32
+ * signals of interest have been observed.
33
+ */
34
+ export declare class TipEligibilityTracker extends Disposable {
35
+ private readonly _storageService;
36
+ private readonly _promptsService;
37
+ private readonly _languageModelToolsService;
38
+ private readonly _logService;
39
+ private readonly _executedCommands;
40
+ private readonly _usedModes;
41
+ private readonly _invokedTools;
42
+ private readonly _pendingCommands;
43
+ private readonly _pendingModes;
44
+ private readonly _pendingTools;
45
+ private readonly _commandListener;
46
+ private readonly _toolListener;
47
+ /**
48
+ * Tip IDs excluded because prompt files of the required type exist in the workspace.
49
+ * Tips with `excludeUntilChecked` are pre-added and removed if no files are found.
50
+ */
51
+ private readonly _excludedByFiles;
52
+ /** Tips that have file-based exclusions, kept for re-checks. */
53
+ private readonly _tipsWithFileExclusions;
54
+ /** Generation counter per tip ID to discard stale async file-check results. */
55
+ private readonly _fileCheckGeneration;
56
+ private readonly _fileChecksInFlight;
57
+ constructor(tips: readonly ITipExclusionConfig[], commandService: ICommandService, _storageService: IStorageService, _promptsService: IPromptsService, _languageModelToolsService: ILanguageModelToolsService, _logService: ILogService);
58
+ recordCommandExecuted(commandId: string): void;
59
+ /**
60
+ * Records the current chat mode (kind + name) so future tip eligibility
61
+ * checks can exclude mode-related tips. No-ops once all tracked modes
62
+ * have been observed.
63
+ */
64
+ recordCurrentMode(contextKeyService: IContextKeyService): void;
65
+ /**
66
+ * Returns `true` when the tip should be **excluded** from the eligible set.
67
+ */
68
+ isExcluded(tip: ITipExclusionConfig): boolean;
69
+ /**
70
+ * Revalidates all file-based tip exclusions. Tips with `excludeUntilChecked`
71
+ * are conservatively hidden until the re-check completes.
72
+ */
73
+ refreshPromptFileExclusions(): void;
74
+ private _checkForPromptFiles;
75
+ private _doCheckForPromptFiles;
76
+ private _persistSet;
77
+ private _readApplicationWithProfileFallback;
78
+ }
@@ -0,0 +1,234 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
4
+ import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
6
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
7
+ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
8
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
9
+ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
10
+ import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
11
+ import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
12
+ import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
13
+ import { TipEligibilityStorageKeys } from './chatTipStorageKeys.js';
14
+
15
+ let TipEligibilityTracker = class TipEligibilityTracker extends Disposable {
16
+ constructor(
17
+ tips,
18
+ commandService,
19
+ _storageService,
20
+ _promptsService,
21
+ _languageModelToolsService,
22
+ _logService
23
+ ) {
24
+ super();
25
+ this._storageService = _storageService;
26
+ this._promptsService = _promptsService;
27
+ this._languageModelToolsService = _languageModelToolsService;
28
+ this._logService = _logService;
29
+ this._commandListener = this._register(( new MutableDisposable()));
30
+ this._toolListener = this._register(( new MutableDisposable()));
31
+ this._excludedByFiles = ( new Set());
32
+ this._fileCheckGeneration = ( new Map());
33
+ this._fileChecksInFlight = ( new Map());
34
+ const storedCmds = this._readApplicationWithProfileFallback(TipEligibilityStorageKeys.ExecutedCommands);
35
+ this._executedCommands = ( new Set(storedCmds ? JSON.parse(storedCmds) : []));
36
+ const storedModes = this._readApplicationWithProfileFallback(TipEligibilityStorageKeys.UsedModes);
37
+ this._usedModes = ( new Set(storedModes ? JSON.parse(storedModes) : []));
38
+ const storedTools = this._readApplicationWithProfileFallback(TipEligibilityStorageKeys.InvokedTools);
39
+ this._invokedTools = ( new Set(storedTools ? JSON.parse(storedTools) : []));
40
+ this._pendingCommands = ( new Set());
41
+ for (const tip of tips) {
42
+ for (const cmd of tip.excludeWhenCommandsExecuted ?? []) {
43
+ if (!( this._executedCommands.has(cmd))) {
44
+ this._pendingCommands.add(cmd);
45
+ }
46
+ }
47
+ }
48
+ this._pendingModes = ( new Set());
49
+ for (const tip of tips) {
50
+ for (const mode of tip.excludeWhenModesUsed ?? []) {
51
+ if (!( this._usedModes.has(mode))) {
52
+ this._pendingModes.add(mode);
53
+ }
54
+ }
55
+ }
56
+ this._pendingTools = ( new Set());
57
+ for (const tip of tips) {
58
+ for (const toolId of tip.excludeWhenToolsInvoked ?? []) {
59
+ if (!( this._invokedTools.has(toolId))) {
60
+ this._pendingTools.add(toolId);
61
+ }
62
+ }
63
+ }
64
+ if (this._pendingCommands.size > 0) {
65
+ this._commandListener.value = commandService.onDidExecuteCommand(e => {
66
+ this.recordCommandExecuted(e.commandId);
67
+ });
68
+ }
69
+ if (this._pendingTools.size > 0) {
70
+ this._toolListener.value = this._languageModelToolsService.onDidInvokeTool(e => {
71
+ if (( this._pendingTools.has(e.toolId))) {
72
+ this._invokedTools.add(e.toolId);
73
+ this._pendingTools.delete(e.toolId);
74
+ this._persistSet(TipEligibilityStorageKeys.InvokedTools, this._invokedTools);
75
+ }
76
+ if (this._pendingTools.size === 0) {
77
+ this._toolListener.clear();
78
+ }
79
+ });
80
+ }
81
+ this._tipsWithFileExclusions = tips.filter(t => t.excludeWhenPromptFilesExist);
82
+ for (const tip of this._tipsWithFileExclusions) {
83
+ if (tip.excludeWhenPromptFilesExist.excludeUntilChecked) {
84
+ this._excludedByFiles.add(tip.id);
85
+ }
86
+ this._checkForPromptFiles(tip);
87
+ }
88
+ this._register(this._promptsService.onDidChangeCustomAgents(() => {
89
+ for (const tip of this._tipsWithFileExclusions) {
90
+ if (tip.excludeWhenPromptFilesExist.promptType === PromptsType.agent) {
91
+ this._checkForPromptFiles(tip);
92
+ }
93
+ }
94
+ }));
95
+ }
96
+ recordCommandExecuted(commandId) {
97
+ if (!( this._pendingCommands.has(commandId))) {
98
+ return;
99
+ }
100
+ this._executedCommands.add(commandId);
101
+ this._persistSet(TipEligibilityStorageKeys.ExecutedCommands, this._executedCommands);
102
+ this._pendingCommands.delete(commandId);
103
+ if (this._pendingCommands.size === 0) {
104
+ this._commandListener.clear();
105
+ }
106
+ }
107
+ recordCurrentMode(contextKeyService) {
108
+ if (this._pendingModes.size === 0) {
109
+ return;
110
+ }
111
+ let changed = false;
112
+ const kind = contextKeyService.getContextKeyValue(ChatContextKeys.chatModeKind.key);
113
+ if (kind && !( this._usedModes.has(kind))) {
114
+ this._usedModes.add(kind);
115
+ this._pendingModes.delete(kind);
116
+ changed = true;
117
+ }
118
+ const name = contextKeyService.getContextKeyValue(ChatContextKeys.chatModeName.key);
119
+ if (name && !( this._usedModes.has(name))) {
120
+ this._usedModes.add(name);
121
+ this._pendingModes.delete(name);
122
+ changed = true;
123
+ }
124
+ if (changed) {
125
+ this._persistSet(TipEligibilityStorageKeys.UsedModes, this._usedModes);
126
+ }
127
+ }
128
+ isExcluded(tip) {
129
+ if (tip.excludeWhenCommandsExecuted) {
130
+ for (const cmd of tip.excludeWhenCommandsExecuted) {
131
+ if (( this._executedCommands.has(cmd))) {
132
+ this._logService.debug("#ChatTips: tip excluded because command was executed", tip.id, cmd);
133
+ return true;
134
+ }
135
+ }
136
+ }
137
+ if (tip.excludeWhenModesUsed) {
138
+ for (const mode of tip.excludeWhenModesUsed) {
139
+ if (( this._usedModes.has(mode))) {
140
+ this._logService.debug("#ChatTips: tip excluded because mode was used", tip.id, mode);
141
+ return true;
142
+ }
143
+ }
144
+ }
145
+ if (tip.excludeWhenToolsInvoked) {
146
+ for (const toolId of tip.excludeWhenToolsInvoked) {
147
+ if (( this._invokedTools.has(toolId))) {
148
+ this._logService.debug("#ChatTips: tip excluded because tool was invoked", tip.id, toolId);
149
+ return true;
150
+ }
151
+ }
152
+ }
153
+ if (tip.excludeWhenPromptFilesExist && ( this._excludedByFiles.has(tip.id))) {
154
+ this._logService.debug("#ChatTips: tip excluded because prompt files exist", tip.id);
155
+ return true;
156
+ }
157
+ return false;
158
+ }
159
+ refreshPromptFileExclusions() {
160
+ for (const tip of this._tipsWithFileExclusions) {
161
+ if (tip.excludeWhenPromptFilesExist.excludeUntilChecked) {
162
+ this._excludedByFiles.add(tip.id);
163
+ }
164
+ this._checkForPromptFiles(tip);
165
+ }
166
+ }
167
+ async _checkForPromptFiles(tip) {
168
+ const inFlight = this._fileChecksInFlight.get(tip.id);
169
+ if (inFlight) {
170
+ await inFlight;
171
+ return;
172
+ }
173
+ const checkPromise = this._doCheckForPromptFiles(tip);
174
+ this._fileChecksInFlight.set(tip.id, checkPromise);
175
+ try {
176
+ await checkPromise;
177
+ } finally {
178
+ if (this._fileChecksInFlight.get(tip.id) === checkPromise) {
179
+ this._fileChecksInFlight.delete(tip.id);
180
+ }
181
+ }
182
+ }
183
+ async _doCheckForPromptFiles(tip) {
184
+ const config = tip.excludeWhenPromptFilesExist;
185
+ const generation = (this._fileCheckGeneration.get(tip.id) ?? 0) + 1;
186
+ this._fileCheckGeneration.set(tip.id, generation);
187
+ try {
188
+ const [promptFiles, agentInstructions] = await Promise.all([
189
+ this._promptsService.listPromptFiles(config.promptType, CancellationToken.None),
190
+ config.agentFileType ? this._promptsService.listAgentInstructions(CancellationToken.None) : Promise.resolve([])
191
+ ]);
192
+ if (this._fileCheckGeneration.get(tip.id) !== generation) {
193
+ return;
194
+ }
195
+ const hasPromptFiles = promptFiles.length > 0;
196
+ const hasAgentFile = config.agentFileType ? ( agentInstructions.some(f => f.type === config.agentFileType)) : false;
197
+ const hasPromptFilesOrAgentFile = hasPromptFiles || hasAgentFile;
198
+ if (hasPromptFilesOrAgentFile) {
199
+ this._excludedByFiles.add(tip.id);
200
+ } else {
201
+ this._excludedByFiles.delete(tip.id);
202
+ }
203
+ } catch {
204
+ if (this._fileCheckGeneration.get(tip.id) !== generation) {
205
+ return;
206
+ }
207
+ if (config.excludeUntilChecked) {
208
+ this._excludedByFiles.add(tip.id);
209
+ }
210
+ }
211
+ }
212
+ _persistSet(key, set) {
213
+ this._storageService.store(
214
+ key,
215
+ JSON.stringify([...set]),
216
+ StorageScope.APPLICATION,
217
+ StorageTarget.MACHINE
218
+ );
219
+ }
220
+ _readApplicationWithProfileFallback(key) {
221
+ const applicationValue = this._storageService.get(key, StorageScope.APPLICATION);
222
+ if (applicationValue) {
223
+ return applicationValue;
224
+ }
225
+ const profileValue = this._storageService.get(key, StorageScope.PROFILE);
226
+ if (profileValue) {
227
+ this._storageService.store(key, profileValue, StorageScope.APPLICATION, StorageTarget.MACHINE);
228
+ }
229
+ return profileValue;
230
+ }
231
+ };
232
+ TipEligibilityTracker = ( __decorate([( __param(1, ICommandService)), ( __param(2, IStorageService)), ( __param(3, IPromptsService)), ( __param(4, ILanguageModelToolsService)), ( __param(5, ILogService))], TipEligibilityTracker));
233
+
234
+ export { TipEligibilityTracker };