@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,600 +0,0 @@
1
-
2
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
3
- import { CancellationError } from '../../../../../../base/common/errors.js';
4
- import { MarkdownString } from '../../../../../../base/common/htmlContent.js';
5
- import { Disposable } from '../../../../../../base/common/lifecycle.js';
6
- import { hasKey } from '../../../../../../base/common/types.js';
7
- import { generateUuid } from '../../../../../../base/common/uuid.js';
8
- import { localize } from '../../../../../../nls.js';
9
- import { IChatToolInvocation } from '../../chatService/chatService.js';
10
- import { IChatService } from '../../chatService/chatService.service.js';
11
- import { ChatQuestionCarouselData } from '../../model/chatProgressTypes/chatQuestionCarouselData.js';
12
- import { ChatPermissionLevel, ChatConfiguration } from '../../constants.js';
13
- import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.service.js';
14
- import { StopWatch } from '../../../../../../base/common/stopwatch.js';
15
- import { ILogService } from '../../../../../../platform/log/common/log.service.js';
16
- import { ITelemetryService } from '../../../../../../platform/telemetry/common/telemetry.service.js';
17
- import { ToolDataSource } from '../languageModelToolsService.js';
18
- import { ThemeIcon } from '../../../../../../base/common/themables.js';
19
- import { Codicon } from '../../../../../../base/common/codicons.js';
20
- import { raceCancellation } from '../../../../../../base/common/async.js';
21
- import { TerminalToolId } from '../terminalToolIds.js';
22
-
23
- const AUTOPILOT_ASK_USER_RESPONSE = "The user is not available to respond and will review your work later. Work autonomously and make good decisions.";
24
- const AskQuestionsToolId = "vscode_askQuestions";
25
- const SoftLimits = {
26
- header: 50,
27
- question: 200
28
- };
29
- const HardLimits = {
30
- header: 75
31
- };
32
- function truncateToLimit(value, limit) {
33
- if (value === undefined) {
34
- return undefined;
35
- }
36
- if (value.length > limit) {
37
- return value.slice(0, limit - 3) + "...";
38
- }
39
- return value;
40
- }
41
- function createAskQuestionsToolData() {
42
- const questionSchema = {
43
- type: "object",
44
- properties: {
45
- header: {
46
- type: "string",
47
- description: `Short identifier for the question. Must be unique so answers can be mapped back to the question. Maximum ${SoftLimits.header} characters.`,
48
- maxLength: SoftLimits.header
49
- },
50
- question: {
51
- type: "string",
52
- description: `The question text to display to the user. Keep it concise, ideally one sentence. Maximum ${SoftLimits.question} characters.`,
53
- maxLength: SoftLimits.question
54
- },
55
- multiSelect: {
56
- type: "boolean",
57
- description: "Allow selecting multiple options when options are provided."
58
- },
59
- allowFreeformInput: {
60
- type: "boolean",
61
- description: "Allow freeform text answers in addition to option selection. Defaults to true; set to false to restrict to predefined options only."
62
- },
63
- message: {
64
- type: "string",
65
- description: "Optional markdown message to display below the question text, providing additional context or details."
66
- },
67
- options: {
68
- type: "array",
69
- description: "Optional list of selectable answers. If omitted, the question is free text.",
70
- items: {
71
- type: "object",
72
- properties: {
73
- label: {
74
- type: "string",
75
- description: "Display label and value for the option."
76
- },
77
- description: {
78
- type: "string",
79
- description: "Optional secondary text shown with the option."
80
- },
81
- recommended: {
82
- type: "boolean",
83
- description: "Mark this option as the recommended default."
84
- }
85
- },
86
- required: ["label"]
87
- }
88
- }
89
- },
90
- required: ["header", "question"]
91
- };
92
- const inputSchema = {
93
- type: "object",
94
- properties: {
95
- questions: {
96
- type: "array",
97
- description: "List of questions to ask the user. Order is preserved.",
98
- items: questionSchema,
99
- minItems: 1
100
- }
101
- },
102
- required: ["questions"]
103
- };
104
- return {
105
- id: AskQuestionsToolId,
106
- toolReferenceName: "askQuestions",
107
- legacyToolReferenceFullNames: [AskQuestionsToolId, "vscode/askQuestions"],
108
- canBeReferencedInPrompt: false,
109
- icon: ThemeIcon.fromId(Codicon.question.id),
110
- displayName: ( localize(10867, "Ask Clarifying Questions")),
111
- userDescription: ( localize(
112
- 10868,
113
- "Ask structured clarifying questions using single select, multi-select, or freeform inputs to collect task requirements before proceeding."
114
- )),
115
- modelDescription: "Use this tool to ask the user a small number of clarifying questions before proceeding. Provide the questions array with concise headers and prompts. Use options for fixed choices, set multiSelect when multiple selections are allowed. Users can always provide a freeform text answer alongside options unless you set allowFreeformInput to false.",
116
- source: ToolDataSource.Internal,
117
- inputSchema
118
- };
119
- }
120
- const AskQuestionsToolData = createAskQuestionsToolData();
121
- let AskQuestionsTool = class AskQuestionsTool extends Disposable {
122
- constructor(chatService, telemetryService, logService, configService) {
123
- super();
124
- this.chatService = chatService;
125
- this.telemetryService = telemetryService;
126
- this.logService = logService;
127
- this.configService = configService;
128
- }
129
- async invoke(invocation, _countTokens, progress, token) {
130
- const stopWatch = StopWatch.create(true);
131
- const parameters = invocation.parameters;
132
- const {
133
- questions
134
- } = parameters;
135
- this.logService.trace(`[AskQuestionsTool] Invoking with ${questions?.length ?? 0} question(s)`);
136
- if (!questions || questions.length === 0) {
137
- throw ( new Error(( localize(
138
- 10869,
139
- "No questions provided. The questions array must contain at least one question."
140
- ))));
141
- }
142
- const chatSessionResource = invocation.context?.sessionResource;
143
- const chatRequestId = invocation.chatRequestId;
144
- const {
145
- request,
146
- sessionResource
147
- } = this.getRequest(chatSessionResource, chatRequestId);
148
- if (!sessionResource || !request) {
149
- this.logService.warn(
150
- "[AskQuestionsTool] Missing chat context; marking all questions as skipped."
151
- );
152
- return this.createSkippedResult(questions);
153
- }
154
- const resolveId = invocation.chatStreamToolCallId ?? invocation.callId;
155
- if (request.modeInfo?.permissionLevel === ChatPermissionLevel.Autopilot || this.configService.getValue(ChatConfiguration.AutoReply)) {
156
- const reason = request.modeInfo?.permissionLevel === ChatPermissionLevel.Autopilot ? "Autopilot mode" : "Auto-reply enabled";
157
- this.logService.info(`[AskQuestionsTool] ${reason}: auto-responding to questions`);
158
- const {
159
- carousel,
160
- idToHeaderMap
161
- } = this.toQuestionCarousel(questions, resolveId);
162
- carousel.terminalId = this.extractTerminalId(request);
163
- carousel.data = this.buildAutopilotCarouselAnswers(questions, carousel, idToHeaderMap);
164
- carousel.isUsed = true;
165
- this.chatService.appendProgress(request, carousel);
166
- return this.createAutopilotResult(questions);
167
- }
168
- const {
169
- carousel,
170
- idToHeaderMap
171
- } = this.toQuestionCarousel(questions, resolveId);
172
- carousel.terminalId = this.extractTerminalId(request);
173
- this.logService.trace(
174
- `[AskQuestionsTool] request=${request.id} terminalExecutionId=${request.terminalExecutionId ?? "undefined"} carousel.terminalId=${carousel.terminalId ?? "undefined"}`
175
- );
176
- this.chatService.appendProgress(request, carousel);
177
- const externalAnswerListener = this.chatService.onDidReceiveQuestionCarouselAnswer(event => {
178
- if (event.resolveId !== carousel.resolveId || carousel.isUsed) {
179
- return;
180
- }
181
- carousel.dismiss(event.answers);
182
- });
183
- let answerResult;
184
- try {
185
- answerResult = await raceCancellation(carousel.completion.p, token);
186
- } catch (error) {
187
- if (error instanceof CancellationError) {
188
- carousel.dismiss(undefined);
189
- }
190
- throw error;
191
- } finally {
192
- externalAnswerListener.dispose();
193
- }
194
- if (!answerResult) {
195
- carousel.dismiss(undefined);
196
- throw ( new CancellationError());
197
- }
198
- if (token.isCancellationRequested) {
199
- throw ( new CancellationError());
200
- }
201
- if (carousel.dismissedByTerminalInput && carousel.terminalId) {
202
- this.logService.info(
203
- `[AskQuestionsTool] Carousel dismissed because user typed directly in terminal ${carousel.terminalId}`
204
- );
205
- return {
206
- content: [{
207
- kind: "text",
208
- value: `The user is replying to the terminal prompts directly. Do not ask more questions or send input to the terminal. You will be automatically notified when the command in terminal ${carousel.terminalId} completes.`
209
- }]
210
- };
211
- }
212
- progress.report({
213
- message: ( localize(10870, "Analyzing your answers..."))
214
- });
215
- const converted = this.convertCarouselAnswers(questions, answerResult?.answers, idToHeaderMap);
216
- const {
217
- answeredCount,
218
- skippedCount,
219
- freeTextCount,
220
- recommendedAvailableCount,
221
- recommendedSelectedCount
222
- } = this.collectMetrics(questions, converted);
223
- this.sendTelemetry(
224
- invocation.chatRequestId,
225
- questions.length,
226
- answeredCount,
227
- skippedCount,
228
- freeTextCount,
229
- recommendedAvailableCount,
230
- recommendedSelectedCount,
231
- stopWatch.elapsed()
232
- );
233
- const toolResultJson = JSON.stringify(converted);
234
- this.logService.trace(
235
- `[AskQuestionsTool] Returning tool result with metrics: questions=${questions.length}, answered=${answeredCount}, skipped=${skippedCount}, freeText=${freeTextCount}, recommendedAvailable=${recommendedAvailableCount}, recommendedSelected=${recommendedSelectedCount}`
236
- );
237
- return {
238
- content: [{
239
- kind: "text",
240
- value: toolResultJson
241
- }]
242
- };
243
- }
244
- async prepareToolInvocation(context, _token) {
245
- const parameters = context.parameters;
246
- const {
247
- questions
248
- } = parameters;
249
- if (!questions || questions.length === 0) {
250
- throw ( new Error(( localize(
251
- 10869,
252
- "No questions provided. The questions array must contain at least one question."
253
- ))));
254
- }
255
- for (const question of questions) {
256
- if (question.options && question.options.length === 1 && !question.allowFreeformInput) {
257
- throw ( new Error(( localize(
258
- 10871,
259
- "Question \"{0}\" must have at least two options, or set allowFreeformInput when providing a single option, or omit options for free text input.",
260
- question.header
261
- ))));
262
- }
263
- }
264
- const questionCount = questions.length;
265
- const headers = ( questions.map(q => q.header)).join(", ");
266
- const message = questionCount === 1 ? ( localize(10872, "Asking a question ({0})", headers)) : ( localize(10873, "Asking {0} questions ({1})", questionCount, headers));
267
- const pastMessage = questionCount === 1 ? ( localize(10874, "Asked a question ({0})", headers)) : ( localize(10875, "Asked {0} questions ({1})", questionCount, headers));
268
- return {
269
- invocationMessage: ( new MarkdownString(message)),
270
- pastTenseMessage: ( new MarkdownString(pastMessage))
271
- };
272
- }
273
- getRequest(chatSessionResource, chatRequestId) {
274
- if (!chatSessionResource) {
275
- return {
276
- request: undefined,
277
- sessionResource: undefined
278
- };
279
- }
280
- const model = this.chatService.getSession(chatSessionResource);
281
- let request;
282
- if (model) {
283
- if (chatRequestId) {
284
- request = model.getRequests().find(r => r.id === chatRequestId);
285
- }
286
- if (!request) {
287
- request = model.getRequests().at(-1);
288
- }
289
- }
290
- if (!request) {
291
- return {
292
- request: undefined,
293
- sessionResource: chatSessionResource
294
- };
295
- }
296
- return {
297
- request,
298
- sessionResource: chatSessionResource
299
- };
300
- }
301
- extractTerminalId(request) {
302
- if (request.terminalExecutionId) {
303
- return request.terminalExecutionId;
304
- }
305
- const match = request.message.text.match(/\[Terminal (?<termId>\S+) notification:/);
306
- if (match?.groups?.termId) {
307
- return match.groups.termId;
308
- }
309
- const response = request.response;
310
- if (response) {
311
- const parts = response.response.value;
312
- for (let i = parts.length - 1; i >= 0; i--) {
313
- const part = parts[i];
314
- if (part.kind === "toolInvocation" && part.toolId === TerminalToolId.RunInTerminal) {
315
- const state = part.state.get();
316
- if (state.type === IChatToolInvocation.StateKind.Completed && state.contentForModel) {
317
- for (const item of state.contentForModel) {
318
- if (item.kind === "text") {
319
- const idMatch = item.value.match(
320
- /(?:running in terminal ID|may still be running in terminal ID) ([0-9a-fA-F-]+)/
321
- );
322
- if (idMatch) {
323
- return idMatch[1];
324
- }
325
- }
326
- }
327
- }
328
- }
329
- }
330
- }
331
- return undefined;
332
- }
333
- toQuestionCarousel(questions, resolveId) {
334
- const idToHeaderMap = ( new Map());
335
- const carouselResolveId = resolveId ?? generateUuid();
336
- const mappedQuestions = ( questions.map(
337
- (question, index) => this.toChatQuestion(question, idToHeaderMap, carouselResolveId, index)
338
- ));
339
- return {
340
- carousel: ( new ChatQuestionCarouselData(mappedQuestions, true, carouselResolveId)),
341
- idToHeaderMap
342
- };
343
- }
344
- toChatQuestion(question, idToHeaderMap, resolveId, index) {
345
- let type;
346
- if (!question.options || question.options.length === 0) {
347
- type = "text";
348
- } else if (question.multiSelect) {
349
- type = "multiSelect";
350
- } else {
351
- type = "singleSelect";
352
- }
353
- let defaultValue;
354
- if (question.options) {
355
- const recommendedOptions = question.options.filter(opt => opt.recommended);
356
- if (recommendedOptions.length > 0) {
357
- defaultValue = question.multiSelect ? ( recommendedOptions.map(opt => opt.label)) : recommendedOptions[0].label;
358
- }
359
- }
360
- const internalId = `${resolveId}:${index}`;
361
- idToHeaderMap.set(internalId, question.header);
362
- const displayTitle = truncateToLimit(question.header, HardLimits.header) ?? question.header;
363
- return {
364
- id: internalId,
365
- type,
366
- title: displayTitle,
367
- message: question.question,
368
- detailedMessage: question.message,
369
- options: question.options?.map(opt => ({
370
- id: opt.label,
371
- label: opt.description ? `${opt.label} - ${opt.description}` : opt.label,
372
- value: opt.label
373
- })),
374
- defaultValue,
375
- allowFreeformInput: question.allowFreeformInput ?? true
376
- };
377
- }
378
- convertCarouselAnswers(questions, carouselAnswers, idToHeaderMap) {
379
- const result = {
380
- answers: {}
381
- };
382
- if (carouselAnswers) {
383
- this.logService.trace(`[AskQuestionsTool] Carousel answer keys: ${( Object.keys(carouselAnswers)).join(", ")}`);
384
- this.logService.trace(`[AskQuestionsTool] Question headers: ${( questions.map(q => q.header)).join(", ")}`);
385
- }
386
- const headerToIdMap = ( new Map());
387
- for (const [internalId, originalHeader] of idToHeaderMap) {
388
- headerToIdMap.set(originalHeader, internalId);
389
- }
390
- for (const question of questions) {
391
- if (!carouselAnswers) {
392
- result.answers[question.header] = {
393
- selected: [],
394
- freeText: null,
395
- skipped: true
396
- };
397
- continue;
398
- }
399
- const internalId = headerToIdMap.get(question.header);
400
- const answer = internalId ? carouselAnswers[internalId] : undefined;
401
- this.logService.trace(
402
- `[AskQuestionsTool] Processing question "${question.header}" (internal ID: ${internalId}), raw answer: ${JSON.stringify(answer)}, type: ${typeof answer}`
403
- );
404
- if (answer === undefined) {
405
- result.answers[question.header] = {
406
- selected: [],
407
- freeText: null,
408
- skipped: true
409
- };
410
- } else if (typeof answer === "string") {
411
- if (question.options?.some(opt => opt.label === answer)) {
412
- result.answers[question.header] = {
413
- selected: [answer],
414
- freeText: null,
415
- skipped: false
416
- };
417
- } else {
418
- result.answers[question.header] = {
419
- selected: [],
420
- freeText: answer,
421
- skipped: false
422
- };
423
- }
424
- } else if (Array.isArray(answer)) {
425
- result.answers[question.header] = {
426
- selected: ( answer.map(a => String(a))),
427
- freeText: null,
428
- skipped: false
429
- };
430
- } else if (typeof answer === "object" && hasKey(answer, {
431
- selectedValues: true
432
- })) {
433
- const {
434
- selectedValues,
435
- freeformValue
436
- } = answer;
437
- result.answers[question.header] = {
438
- selected: selectedValues,
439
- freeText: freeformValue ?? null,
440
- skipped: false
441
- };
442
- } else if (typeof answer === "object" && (hasKey(answer, {
443
- selectedValue: true
444
- }) || hasKey(answer, {
445
- freeformValue: true
446
- }))) {
447
- const {
448
- selectedValue,
449
- freeformValue
450
- } = answer;
451
- if (freeformValue) {
452
- result.answers[question.header] = {
453
- selected: [],
454
- freeText: freeformValue,
455
- skipped: false
456
- };
457
- } else if (selectedValue !== undefined) {
458
- if (question.options?.some(opt => opt.label === selectedValue)) {
459
- result.answers[question.header] = {
460
- selected: [selectedValue],
461
- freeText: null,
462
- skipped: false
463
- };
464
- } else {
465
- result.answers[question.header] = {
466
- selected: [],
467
- freeText: selectedValue,
468
- skipped: false
469
- };
470
- }
471
- } else {
472
- result.answers[question.header] = {
473
- selected: [],
474
- freeText: null,
475
- skipped: true
476
- };
477
- }
478
- } else {
479
- this.logService.warn(
480
- `[AskQuestionsTool] Unknown answer format for "${question.header}": ${JSON.stringify(answer)}`
481
- );
482
- result.answers[question.header] = {
483
- selected: [],
484
- freeText: null,
485
- skipped: true
486
- };
487
- }
488
- }
489
- return result;
490
- }
491
- collectMetrics(questions, result) {
492
- const answers = ( Object.values(result.answers));
493
- const answeredCount = answers.filter(a => !a.skipped).length;
494
- const skippedCount = answers.filter(a => a.skipped).length;
495
- const freeTextCount = answers.filter(a => a.freeText !== null).length;
496
- const recommendedAvailableCount = questions.filter(q => q.options?.some(opt => opt.recommended)).length;
497
- const recommendedSelectedCount = questions.filter(q => {
498
- const answer = result.answers[q.header];
499
- const recommendedOption = q.options?.find(opt => opt.recommended);
500
- return answer && !answer.skipped && recommendedOption && answer.selected.includes(recommendedOption.label);
501
- }).length;
502
- return {
503
- answeredCount,
504
- skippedCount,
505
- freeTextCount,
506
- recommendedAvailableCount,
507
- recommendedSelectedCount
508
- };
509
- }
510
- createSkippedResult(questions) {
511
- const skippedAnswers = {};
512
- for (const question of questions) {
513
- skippedAnswers[question.header] = {
514
- selected: [],
515
- freeText: null,
516
- skipped: true
517
- };
518
- }
519
- return {
520
- content: [{
521
- kind: "text",
522
- value: JSON.stringify({
523
- answers: skippedAnswers
524
- })
525
- }]
526
- };
527
- }
528
- createAutopilotResult(questions) {
529
- const answers = {};
530
- for (const question of questions) {
531
- answers[question.header] = {
532
- selected: [],
533
- freeText: AUTOPILOT_ASK_USER_RESPONSE,
534
- skipped: false
535
- };
536
- }
537
- return {
538
- content: [{
539
- kind: "text",
540
- value: JSON.stringify({
541
- answers
542
- })
543
- }]
544
- };
545
- }
546
- buildAutopilotCarouselAnswers(questions, carousel, idToHeaderMap) {
547
- const data = {};
548
- const headerToIdMap = ( new Map());
549
- for (const [internalId, originalHeader] of idToHeaderMap) {
550
- headerToIdMap.set(originalHeader, internalId);
551
- }
552
- for (const question of questions) {
553
- const internalId = headerToIdMap.get(question.header);
554
- if (!internalId) {
555
- continue;
556
- }
557
- const chatQuestion = carousel.questions.find(q => q.id === internalId);
558
- if (!chatQuestion) {
559
- continue;
560
- }
561
- if (chatQuestion.type === "multiSelect") {
562
- data[internalId] = {
563
- selectedValues: [],
564
- freeformValue: AUTOPILOT_ASK_USER_RESPONSE
565
- };
566
- } else if (chatQuestion.type === "singleSelect") {
567
- data[internalId] = {
568
- freeformValue: AUTOPILOT_ASK_USER_RESPONSE
569
- };
570
- } else {
571
- data[internalId] = AUTOPILOT_ASK_USER_RESPONSE;
572
- }
573
- }
574
- return data;
575
- }
576
- sendTelemetry(
577
- requestId,
578
- questionCount,
579
- answeredCount,
580
- skippedCount,
581
- freeTextCount,
582
- recommendedAvailableCount,
583
- recommendedSelectedCount,
584
- duration
585
- ) {
586
- this.telemetryService.publicLog2("askQuestionsToolInvoked", {
587
- requestId,
588
- questionCount,
589
- answeredCount,
590
- skippedCount,
591
- freeTextCount,
592
- recommendedAvailableCount,
593
- recommendedSelectedCount,
594
- duration
595
- });
596
- }
597
- };
598
- AskQuestionsTool = ( __decorate([( __param(0, IChatService)), ( __param(1, ITelemetryService)), ( __param(2, ILogService)), ( __param(3, IConfigurationService))], AskQuestionsTool));
599
-
600
- export { AUTOPILOT_ASK_USER_RESPONSE, AskQuestionsTool, AskQuestionsToolData, AskQuestionsToolId, createAskQuestionsToolData };
@@ -1,36 +0,0 @@
1
- import { CancellationToken } from "../../../../../../base/common/cancellation.js";
2
- import { CountTokensCallback, IPreparedToolInvocation, IToolData, IToolImpl, IToolInvocation, IToolInvocationPreparationContext, IToolResult, ToolProgress } from "../languageModelToolsService.js";
3
- export declare const ConfirmationToolId = "vscode_get_confirmation";
4
- export declare const ConfirmationToolWithOptionsId = "vscode_get_confirmation_with_options";
5
- export declare const ModifiedFilesConfirmationToolId = "vscode_get_modified_files_confirmation";
6
- export declare const ConfirmationToolData: IToolData;
7
- export declare const ConfirmationToolWithOptionsData: IToolData;
8
- export declare const ModifiedFilesConfirmationToolData: IToolData;
9
- export interface IConfirmationToolParams {
10
- title: string;
11
- message: string;
12
- confirmationType?: "basic" | "terminal";
13
- terminalCommand?: string;
14
- buttons?: string[];
15
- }
16
- export interface IModifiedFilesConfirmationToolParams {
17
- title: string;
18
- message: string;
19
- options: string[];
20
- modifiedFiles: {
21
- uri: string;
22
- originalUri?: string;
23
- insertions?: number;
24
- deletions?: number;
25
- title?: string;
26
- description?: string;
27
- }[];
28
- }
29
- export declare class ConfirmationTool implements IToolImpl {
30
- prepareToolInvocation(context: IToolInvocationPreparationContext, token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
31
- invoke(invocation: IToolInvocation, countTokens: CountTokensCallback, progress: ToolProgress, token: CancellationToken): Promise<IToolResult>;
32
- }
33
- export declare class ModifiedFilesConfirmationTool implements IToolImpl {
34
- prepareToolInvocation(context: IToolInvocationPreparationContext, token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
35
- invoke(invocation: IToolInvocation, countTokens: CountTokensCallback, progress: ToolProgress, token: CancellationToken): Promise<IToolResult>;
36
- }