@codingame/monaco-vscode-katex-common 34.1.3 → 35.0.1

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 (244) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/base/browser/animationSync.d.ts +36 -0
  3. package/vscode/src/vs/base/browser/animationSync.js +23 -0
  4. package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.js +23 -2
  5. package/vscode/src/vs/platform/actions/browser/buttonbar.js +3 -2
  6. package/vscode/src/vs/platform/agentHost/common/claudeSessionConfigKeys.d.ts +5 -5
  7. package/vscode/src/vs/platform/agentHost/common/fileEditDiff.d.ts +32 -0
  8. package/vscode/src/vs/platform/agentHost/common/fileEditDiff.js +33 -0
  9. package/vscode/src/vs/platform/agentHost/common/meta/agentFeedbackAnnotations.d.ts +90 -0
  10. package/vscode/src/vs/platform/agentHost/common/meta/agentFeedbackAttachments.d.ts +30 -0
  11. package/vscode/src/vs/platform/agentHost/common/meta/agentToolCallMeta.d.ts +65 -0
  12. package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.d.ts +16 -5
  13. package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.js +3 -2
  14. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-resource-watch/reducer.d.ts +21 -0
  15. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +8 -0
  16. package/vscode/src/vs/platform/agentHost/common/state/sessionReducers.d.ts +9 -0
  17. package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +2 -2
  18. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +29 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +105 -28
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +15 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +74 -44
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +2 -2
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +98 -24
  28. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.d.ts +8 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.js +31 -4
  30. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.d.ts +45 -4
  31. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.js +163 -37
  32. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostFolderPickerActionItem.d.ts +47 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostFolderPickerActionItem.js +172 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.d.ts +3 -1
  35. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.js +7 -4
  36. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionReferenceAttachment.d.ts +12 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSnapshotController.d.ts +116 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSnapshotController.js +348 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.d.ts +211 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.js +64 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +18 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +13 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +1 -1
  45. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +30 -18
  46. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +4 -1
  47. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +29 -4
  48. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
  49. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
  50. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +24 -1
  51. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +119 -41
  52. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +27 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionTypeAvailability.d.ts +63 -0
  54. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionTypeAvailability.js +97 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +5 -6
  56. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +105 -88
  57. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +13 -13
  58. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +1 -0
  59. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +46 -48
  60. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +28 -0
  61. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +98 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +3 -3
  63. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +9 -7
  64. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatTurnPills.css +162 -0
  65. package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.d.ts +9 -2
  66. package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +95 -24
  67. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +22 -1
  68. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +151 -20
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +20 -2
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +5 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +61 -17
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAutoModeResolutionContentPart.d.ts +20 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAutoModeResolutionContentPart.js +55 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +6 -2
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +81 -30
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +2 -2
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.d.ts +11 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.js +13 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +9 -33
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.d.ts +6 -2
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.js +21 -11
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +6 -2
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +40 -19
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpAuthenticationContentPart.d.ts +35 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpAuthenticationContentPart.js +140 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersStartingContentPart.d.ts +24 -0
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersStartingContentPart.js +58 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +3 -1
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +29 -8
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +30 -30
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +1 -1
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +44 -44
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +1 -2
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +12 -66
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +39 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +167 -43
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +1 -15
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +9 -86
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSystemNotificationContentPart.d.ts +12 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSystemNotificationContentPart.js +23 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +9 -1
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +141 -72
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +2 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +17 -3
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTurnPillsPart.d.ts +29 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTurnPillsPart.js +110 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatAgentFeedbackReviewConfirmation.css +133 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatAutoModeResolution.css +30 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +4 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +18 -8
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +23 -7
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +33 -18
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +23 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +44 -0
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +2 -0
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +1 -1
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +9 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +21 -4
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatAgentFeedbackReviewConfirmationSubPart.d.ts +48 -0
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatAgentFeedbackReviewConfirmationSubPart.js +279 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +43 -1
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +53 -15
  144. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +7 -9
  145. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  146. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.d.ts +4 -1
  147. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +24 -10
  148. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/{chatMissingSandboxDepsConfirmationSubPart.d.ts → chatSandboxPrerequisiteConfirmationSubPart.d.ts} +3 -2
  149. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/{chatMissingSandboxDepsConfirmationSubPart.js → chatSandboxPrerequisiteConfirmationSubPart.js} +14 -10
  150. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +0 -1
  151. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +30 -59
  152. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +2 -1
  153. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +41 -29
  154. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +8 -8
  155. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +2 -1
  156. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +12 -9
  157. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +1 -1
  158. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +43 -35
  159. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  160. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
  161. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +2 -1
  162. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +11 -8
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeHelper.d.ts +18 -0
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeHelper.js +51 -0
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +4 -4
  166. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  167. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +18 -3
  168. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +266 -98
  169. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +1 -0
  170. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +8 -3
  171. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatRestoreCheckpointActionViewItem.d.ts +32 -0
  172. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatRestoreCheckpointActionViewItem.js +135 -0
  173. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatTurnPills.d.ts +85 -0
  174. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatTurnPills.js +275 -0
  175. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +18 -1
  176. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +84 -37
  177. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  178. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.js +4 -4
  179. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +14 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +6 -1
  181. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +52 -4
  182. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +187 -13
  183. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +435 -139
  184. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatePersistence.d.ts +6 -0
  185. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatePersistence.js +21 -0
  186. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationLogic.d.ts +50 -0
  187. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationLogic.js +49 -0
  188. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationStore.d.ts +79 -0
  189. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationStore.js +127 -0
  190. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +84 -8
  191. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +658 -430
  192. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +72 -8
  193. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +82 -7
  194. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +2 -2
  195. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +3 -3
  196. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +6 -3
  197. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +2 -1
  198. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +23 -9
  199. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatGoalBannerWidget.css +2 -2
  200. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +28 -12
  201. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +3 -0
  202. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +15 -14
  203. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +60 -0
  204. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +18 -7
  205. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +49 -1
  206. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +141 -81
  207. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +7 -15
  208. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +30 -47
  209. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
  210. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerInputActionItem.d.ts +20 -0
  211. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerInputActionItem.js +18 -0
  212. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +469 -148
  213. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +11 -2
  214. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +79 -28
  215. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +71 -2
  216. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +107 -45
  217. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +20 -0
  218. package/vscode/src/vs/workbench/contrib/chat/common/chatErrorMessages.d.ts +110 -0
  219. package/vscode/src/vs/workbench/contrib/chat/common/chatErrorMessages.js +37 -0
  220. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +4 -1
  221. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +13 -11
  222. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.d.ts +8 -1
  223. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +57 -21
  224. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +18 -18
  225. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +4 -4
  226. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
  227. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
  228. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +30 -30
  229. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  230. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +39 -8
  231. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +168 -72
  232. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
  239. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  240. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  241. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  242. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  243. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.d.ts +0 -30
  244. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.js +0 -147
@@ -0,0 +1,279 @@
1
+
2
+ import { registerCss } from '@codingame/monaco-vscode-api/css';
3
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
+ import { $, clearNode, append, addDisposableListener, EventType, getWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
5
+ import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
6
+ import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
7
+ import { Checkbox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
8
+ import { Action } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
9
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
10
+ import { DisposableMap, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
11
+ import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
12
+ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
13
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
14
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
15
+ import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
16
+ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
17
+ import { FileKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
18
+ import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
19
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
20
+ import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
21
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
22
+ import { defaultCheckboxStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
23
+ import { ResourceLabels, DEFAULT_LABELS_CONTAINER } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/labels';
24
+ import { ToolConfirmKind, AgentFeedbackReviewCommandId, IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
25
+ import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
26
+ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
27
+ import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
28
+ import { IChatToolRiskAssessmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service';
29
+ import { ChatCustomConfirmationWidget } from '../chatConfirmationWidget.js';
30
+ import { AbstractToolConfirmationSubPart } from './abstractToolConfirmationSubPart.js';
31
+ import * as chatAgentFeedbackReviewConfirmation from '../media/chatAgentFeedbackReviewConfirmation.css';
32
+
33
+ registerCss(chatAgentFeedbackReviewConfirmation);
34
+ let ChatAgentFeedbackReviewConfirmationSubPart = class ChatAgentFeedbackReviewConfirmationSubPart extends AbstractToolConfirmationSubPart {
35
+ constructor(
36
+ toolInvocation,
37
+ context,
38
+ instantiationService,
39
+ keybindingService,
40
+ contextKeyService,
41
+ chatWidgetService,
42
+ languageModelToolsService,
43
+ riskAssessmentService,
44
+ commandService,
45
+ logService,
46
+ hoverService
47
+ ) {
48
+ super(
49
+ toolInvocation,
50
+ context,
51
+ instantiationService,
52
+ keybindingService,
53
+ contextKeyService,
54
+ chatWidgetService,
55
+ languageModelToolsService,
56
+ riskAssessmentService
57
+ );
58
+ this.commandService = commandService;
59
+ this.logService = logService;
60
+ this.hoverService = hoverService;
61
+ this.codeblocks = [];
62
+ this._rows = ( new Map());
63
+ this._rowStores = this._register(( new DisposableMap()));
64
+ const data = toolInvocation.toolSpecificData;
65
+ if (!data || data.kind !== "agentFeedbackReviewConfirmation") {
66
+ throw ( new Error("Agent feedback review confirmation data is missing"));
67
+ }
68
+ this._resourceLabels = this._register(
69
+ this.instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER)
70
+ );
71
+ const listElement = $(".chat-agent-feedback-review-list");
72
+ void this._populate(listElement);
73
+ const revealLabel = data.options[0] ?? ( localize(8060, "Reveal Selected"));
74
+ const buttons = [{
75
+ label: revealLabel,
76
+ data: () => this._onReveal()
77
+ }, {
78
+ label: ( localize(8061, "Cancel")),
79
+ isSecondary: true,
80
+ data: () => this.confirmWith(this.toolInvocation, {
81
+ type: ToolConfirmKind.Skipped
82
+ })
83
+ }];
84
+ const confirmWidget = this._register(
85
+ this.instantiationService.createInstance(ChatCustomConfirmationWidget, this.context, {
86
+ title: this.getTitle(),
87
+ icon: Codicon.commentDiscussion,
88
+ message: listElement,
89
+ buttons
90
+ })
91
+ );
92
+ const hasToolConfirmation = ChatContextKeys.Editing.hasToolConfirmation.bindTo(this.contextKeyService);
93
+ hasToolConfirmation.set(true);
94
+ this._register(confirmWidget.onDidClick((
95
+ {
96
+ button,
97
+ isTouchClick
98
+ }
99
+ ) => {
100
+ button.data();
101
+ if (!isTouchClick) {
102
+ this.chatWidgetService.getWidgetBySessionResource(this.context.element.sessionResource)?.focusInput();
103
+ }
104
+ }));
105
+ this._register(toDisposable(() => hasToolConfirmation.reset()));
106
+ this.domNode = confirmWidget.domNode;
107
+ }
108
+ get _sessionResource() {
109
+ return this.context.element.sessionResource;
110
+ }
111
+ async _populate(listElement) {
112
+ let comments = [];
113
+ try {
114
+ comments = (await this.commandService.executeCommand(AgentFeedbackReviewCommandId.GetComments, this._sessionResource)) ?? [];
115
+ } catch (error) {
116
+ this.logService.warn("[AgentFeedbackReview] Failed to fetch unreviewed comments", error);
117
+ }
118
+ if (this._store.isDisposed) {
119
+ return;
120
+ }
121
+ clearNode(listElement);
122
+ if (!comments.length) {
123
+ listElement.append($(".chat-agent-feedback-review-empty", undefined, ( localize(8062, "No unreviewed comments."))));
124
+ return;
125
+ }
126
+ for (const comment of comments) {
127
+ this._renderRow(listElement, comment);
128
+ }
129
+ }
130
+ _renderRow(listElement, comment) {
131
+ const rowStore = ( new DisposableStore());
132
+ this._rowStores.set(comment.id, rowStore);
133
+ const rowElement = append(listElement, $(".chat-agent-feedback-review-row"));
134
+ const checkbox = rowStore.add(( new Checkbox(( localize(8063, "Reveal this comment to the agent")), true, defaultCheckboxStyles)));
135
+ append(rowElement, checkbox.domNode);
136
+ const main = append(rowElement, $(".chat-agent-feedback-review-main"));
137
+ const header = append(main, $(".chat-agent-feedback-review-header"));
138
+ if (comment.kindLabel) {
139
+ append(
140
+ header,
141
+ $(".chat-agent-feedback-review-kind", undefined, comment.kindLabel)
142
+ );
143
+ }
144
+ const fileUri = URI.revive(comment.fileUri);
145
+ const fileLabel = rowStore.add(this._resourceLabels.create(header));
146
+ fileLabel.element.classList.add("chat-agent-feedback-review-file");
147
+ fileLabel.setResource({
148
+ resource: fileUri,
149
+ name: basename(fileUri)
150
+ }, {
151
+ fileKind: FileKind.FILE,
152
+ title: fileUri.fsPath || fileUri.path
153
+ });
154
+ this._renderCommentText(rowStore, main, comment.text);
155
+ const actionsContainer = append(rowElement, $(".chat-agent-feedback-review-actions"));
156
+ const actionBar = rowStore.add(( new ActionBar(actionsContainer)));
157
+ actionBar.push(rowStore.add(( new Action("agentFeedbackReview.reveal", ( localize(8064, "Open File and Reveal Comment")), ThemeIcon.asClassName(Codicon.goToFile), true, () => this._reveal(comment.id)))), {
158
+ icon: true,
159
+ label: false
160
+ });
161
+ actionBar.push(rowStore.add(( new Action("agentFeedbackReview.delete", ( localize(8065, "Delete Comment")), ThemeIcon.asClassName(Codicon.close), true, () => this._delete(comment.id)))), {
162
+ icon: true,
163
+ label: false
164
+ });
165
+ this._rows.set(comment.id, {
166
+ comment,
167
+ checkbox,
168
+ element: rowElement
169
+ });
170
+ }
171
+ _renderCommentText(rowStore, main, text) {
172
+ const container = append(main, $(".chat-agent-feedback-review-text-container"));
173
+ const textElement = append(container, $(".chat-agent-feedback-review-text"));
174
+ textElement.textContent = text;
175
+ const toggle = append(container, $("button.chat-agent-feedback-review-expand-toggle"));
176
+ toggle.type = "button";
177
+ toggle.tabIndex = 0;
178
+ const toggleIcon = append(toggle, $("span.codicon"));
179
+ toggleIcon.setAttribute("aria-hidden", "true");
180
+ const expandLabel = ( localize(8066, "Show More"));
181
+ const collapseLabel = ( localize(8067, "Show Less"));
182
+ let expanded = false;
183
+ const renderState = () => {
184
+ container.classList.toggle("collapsed", !expanded);
185
+ container.classList.toggle("expanded", expanded);
186
+ toggleIcon.classList.toggle("codicon-chevron-down", !expanded);
187
+ toggleIcon.classList.toggle("codicon-chevron-up", expanded);
188
+ toggle.setAttribute("aria-label", expanded ? collapseLabel : expandLabel);
189
+ toggle.setAttribute("aria-expanded", String(expanded));
190
+ };
191
+ const isOverflowing = () => {
192
+ const wasExpanded = expanded;
193
+ if (wasExpanded) {
194
+ container.classList.add("collapsed");
195
+ container.classList.remove("expanded");
196
+ }
197
+ const overflowing = textElement.scrollHeight - textElement.clientHeight > 1;
198
+ if (wasExpanded) {
199
+ container.classList.remove("collapsed");
200
+ container.classList.add("expanded");
201
+ }
202
+ return overflowing;
203
+ };
204
+ const updateOverflow = () => {
205
+ const overflowing = isOverflowing();
206
+ container.classList.toggle("overflowing", overflowing);
207
+ if (!overflowing && expanded) {
208
+ expanded = false;
209
+ renderState();
210
+ }
211
+ };
212
+ rowStore.add(this.hoverService.setupManagedHover(
213
+ getDefaultHoverDelegate("element"),
214
+ toggle,
215
+ () => expanded ? collapseLabel : expandLabel
216
+ ));
217
+ rowStore.add(addDisposableListener(toggle, EventType.CLICK, e => {
218
+ e.preventDefault();
219
+ e.stopPropagation();
220
+ expanded = !expanded;
221
+ renderState();
222
+ }));
223
+ renderState();
224
+ const targetWindow = getWindow(container);
225
+ const observer = new targetWindow.ResizeObserver(() => updateOverflow());
226
+ observer.observe(textElement);
227
+ rowStore.add(toDisposable(() => observer.disconnect()));
228
+ }
229
+ async _reveal(commentId) {
230
+ try {
231
+ await this.commandService.executeCommand(AgentFeedbackReviewCommandId.Reveal, this._sessionResource, commentId);
232
+ } catch (error) {
233
+ this.logService.warn("[AgentFeedbackReview] Failed to reveal comment", error);
234
+ }
235
+ }
236
+ async _delete(commentId) {
237
+ const row = this._rows.get(commentId);
238
+ try {
239
+ await this.commandService.executeCommand(AgentFeedbackReviewCommandId.Delete, this._sessionResource, commentId);
240
+ row?.element.remove();
241
+ this._rows.delete(commentId);
242
+ this._rowStores.deleteAndDispose(commentId);
243
+ } catch (error) {
244
+ this.logService.warn("[AgentFeedbackReview] Failed to delete comment", error);
245
+ }
246
+ }
247
+ async _onReveal() {
248
+ const checkedIds = [];
249
+ for (const row of ( this._rows.values())) {
250
+ if (row.checkbox.checked) {
251
+ checkedIds.push(row.comment.id);
252
+ }
253
+ }
254
+ if (checkedIds.length) {
255
+ try {
256
+ await this.commandService.executeCommand(AgentFeedbackReviewCommandId.Accept, this._sessionResource, checkedIds);
257
+ } catch (error) {
258
+ this.logService.warn("[AgentFeedbackReview] Failed to accept comments", error);
259
+ }
260
+ }
261
+ this.confirmWith(this.toolInvocation, {
262
+ type: ToolConfirmKind.UserAction
263
+ });
264
+ }
265
+ createContentElement() {
266
+ return "";
267
+ }
268
+ getTitle() {
269
+ const state = this.toolInvocation.state.get();
270
+ if (state.type !== IChatToolInvocation.StateKind.WaitingForConfirmation) {
271
+ return "";
272
+ }
273
+ const title = state.confirmationMessages?.title;
274
+ return typeof title === "string" ? title : title?.value ?? "";
275
+ }
276
+ };
277
+ ChatAgentFeedbackReviewConfirmationSubPart = ( __decorate([( __param(2, IInstantiationService)), ( __param(3, IKeybindingService)), ( __param(4, IContextKeyService)), ( __param(5, IChatWidgetService)), ( __param(6, ILanguageModelToolsService)), ( __param(7, IChatToolRiskAssessmentService)), ( __param(8, ICommandService)), ( __param(9, ILogService)), ( __param(10, IHoverService))], ChatAgentFeedbackReviewConfirmationSubPart));
278
+
279
+ export { ChatAgentFeedbackReviewConfirmationSubPart };
@@ -46,9 +46,9 @@ let ExtensionsInstallConfirmationWidgetSubPart = class ExtensionsInstallConfirma
46
46
  append(this.domNode, chatExtensionsContentPart.domNode);
47
47
  const state = toolInvocation.state.get();
48
48
  if (state.type === IChatToolInvocation.StateKind.WaitingForConfirmation) {
49
- const allowLabel = ( localize(7517, "Allow"));
49
+ const allowLabel = ( localize(8068, "Allow"));
50
50
  const allowTooltip = keybindingService.appendKeybinding(allowLabel, AcceptToolConfirmationActionId);
51
- const cancelLabel = ( localize(7518, "Cancel"));
51
+ const cancelLabel = ( localize(8069, "Cancel"));
52
52
  const cancelTooltip = keybindingService.appendKeybinding(cancelLabel, CancelChatActionId);
53
53
  const enableAllowButtonEvent = this._register(( new Emitter()));
54
54
  const buttons = [{
@@ -68,9 +68,9 @@ let ExtensionsInstallConfirmationWidgetSubPart = class ExtensionsInstallConfirma
68
68
  tooltip: cancelTooltip
69
69
  }];
70
70
  const confirmWidget = this._register(instantiationService.createInstance(ChatConfirmationWidget, context, {
71
- title: state.confirmationMessages?.title ?? ( localize(7519, "Install Extensions")),
71
+ title: state.confirmationMessages?.title ?? ( localize(8070, "Install Extensions")),
72
72
  message: state.confirmationMessages?.message ?? ( localize(
73
- 7520,
73
+ 8071,
74
74
  "Click the Install button on the extension and then press Allow when finished."
75
75
  )),
76
76
  buttons
@@ -40,7 +40,17 @@ export declare class ChatMcpAppModel extends Disposable {
40
40
  private readonly _productService;
41
41
  private readonly _openerService;
42
42
  private static readonly heightCache;
43
- /** Origin store for persistent webview origins per server */
43
+ /**
44
+ * In-memory origin map for agent-host MCP servers. Agent-host server
45
+ * ids embed the session id, so they're effectively single-use across
46
+ * VS Code restarts — using {@link WebviewOriginStore} for them would
47
+ * accumulate one persisted entry per agent-host session forever. The
48
+ * in-memory map keeps origins stable for the lifetime of the app
49
+ * (enough for webview state to persist across re-renders) without
50
+ * touching application storage.
51
+ */
52
+ private static readonly _agentHostOrigins;
53
+ /** Origin store for persistent webview origins per server (local MCP only) */
44
54
  private readonly _originStore;
45
55
  /** The webview element instance */
46
56
  private readonly _webview;
@@ -97,6 +107,32 @@ export declare class ChatMcpAppModel extends Disposable {
97
107
  /**
98
108
  * Sends the tool result notification when the result becomes available.
99
109
  */
110
+ /**
111
+ * Returns a stable identifier for the originating MCP server to use
112
+ * as the webview origin key. Local servers use their definition id,
113
+ * agent-host servers use the per-session `serverId`.
114
+ */
115
+ private _serverOriginId;
116
+ /**
117
+ * Picks a stable webview origin for this server. Local MCP servers
118
+ * get a persisted origin via {@link WebviewOriginStore} since their
119
+ * server-definition id is stable across VS Code restarts. Agent-host
120
+ * servers fall back to the static in-memory {@link _agentHostOrigins}
121
+ * map keyed by `serverId`, so origins are stable within the app
122
+ * lifetime without leaking entries into application storage for
123
+ * every session.
124
+ */
125
+ private _computeWebviewOrigin;
126
+ /**
127
+ * Resolves a server-relative resource URI into a workbench URI.
128
+ * - Local servers: wrap in {@link McpResourceURI.fromServer} so it
129
+ * resolves through the MCP filesystem provider.
130
+ * - Agent-host servers: pass through as a plain {@link URI}. There's
131
+ * no host-side resolver for AHP-backed servers in v1, so these
132
+ * URIs may not be openable, but they preserve the original
133
+ * resource reference for the user.
134
+ */
135
+ private _resolveServerResourceUri;
100
136
  private _sendToolResult;
101
137
  private _handleUiMessage;
102
138
  private _handleUpdateModelContext;
@@ -112,6 +148,12 @@ export declare class ChatMcpAppModel extends Disposable {
112
148
  * Handles resources/read requests from the MCP App.
113
149
  */
114
150
  private _handleResourcesRead;
151
+ /**
152
+ * Handles sampling/createMessage requests from the MCP App. Forwarded
153
+ * to the host-side sampling implementation through the underlying
154
+ * transport (typically an agent host that owns the MCP server).
155
+ */
156
+ private _handleSamplingCreateMessage;
115
157
  private _sendResponse;
116
158
  private _sendError;
117
159
  private _sendNotification;
@@ -14,6 +14,7 @@ import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/res
14
14
  import { isFalsyOrWhitespace } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
15
15
  import { hasKey, isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
16
16
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
17
+ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
17
18
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
18
19
  import { IChatResponseResourceFileSystemProvider } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.service';
19
20
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
@@ -41,6 +42,9 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
41
42
  static {
42
43
  this.heightCache = ( new WeakMap());
43
44
  }
45
+ static {
46
+ this._agentHostOrigins = ( new Map());
47
+ }
44
48
  constructor(
45
49
  toolInvocation,
46
50
  renderData,
@@ -79,12 +83,12 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
79
83
  this._downloadParts = observableValue(this, []);
80
84
  this.downloadParts = this._downloadParts;
81
85
  this._originStore = ( new WebviewOriginStore(ORIGIN_STORE_KEY, storageService));
82
- this._webviewOrigin = this._originStore.getOrigin("mcpApp", renderData.serverDefinitionId);
86
+ this._webviewOrigin = this._computeWebviewOrigin();
83
87
  this._mcpToolCallUI = this._register(this._instantiationService.createInstance(McpToolCallUI, renderData));
84
88
  this._height = ChatMcpAppModel_1.heightCache.get(this.toolInvocation) ?? 300;
85
89
  this._webview = this._register(this._webviewService.createWebviewElement({
86
90
  origin: this._webviewOrigin,
87
- title: ( localize(7521, "MCP App")),
91
+ title: ( localize(8072, "MCP App")),
88
92
  options: {
89
93
  purpose: WebviewContentPurpose.ChatOutputItem,
90
94
  enableFindWidget: false,
@@ -127,6 +131,16 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
127
131
  ) => {
128
132
  await this._handleWebviewMessage(message);
129
133
  }));
134
+ this._register(this._mcpToolCallUI.onNotification(n => {
135
+ if (!this._announcedCapabilities) {
136
+ return;
137
+ }
138
+ this._webview.postMessage({
139
+ jsonrpc: "2.0",
140
+ method: n.method,
141
+ params: n.params
142
+ });
143
+ }));
130
144
  this._loadContent();
131
145
  }
132
146
  get height() {
@@ -339,6 +353,9 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
339
353
  case "resources/read":
340
354
  result = await this._handleResourcesRead(request.params, token);
341
355
  break;
356
+ case "sampling/createMessage":
357
+ result = await this._handleSamplingCreateMessage(request.params, token);
358
+ break;
342
359
  case "ping":
343
360
  break;
344
361
  case "ui/notifications/size-changed":
@@ -456,6 +473,30 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
456
473
  hostContext: this.hostContext.get()
457
474
  };
458
475
  }
476
+ _serverOriginId() {
477
+ return this.renderData.kind === "agentHost" ? this.renderData.serverId : this.renderData.serverDefinitionId;
478
+ }
479
+ _computeWebviewOrigin() {
480
+ if (this.renderData.kind !== "agentHost") {
481
+ return this._originStore.getOrigin("mcpApp", this._serverOriginId());
482
+ }
483
+ const key = this._serverOriginId();
484
+ let origin = ChatMcpAppModel_1._agentHostOrigins.get(key);
485
+ if (!origin) {
486
+ origin = generateUuid();
487
+ ChatMcpAppModel_1._agentHostOrigins.set(key, origin);
488
+ }
489
+ return origin;
490
+ }
491
+ _resolveServerResourceUri(serverUri) {
492
+ if (this.renderData.kind === "agentHost") {
493
+ return ( URI.parse(serverUri));
494
+ }
495
+ return McpResourceURI.fromServer({
496
+ id: this.renderData.serverDefinitionId,
497
+ label: ""
498
+ }, serverUri);
499
+ }
459
500
  _sendToolResult(resultDetails) {
460
501
  if (isToolResultInputOutputDetails(resultDetails) && resultDetails.mcpOutput) {
461
502
  this._sendNotification({
@@ -487,10 +528,7 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
487
528
  name: "Image"
488
529
  };
489
530
  } else if (c.type === "resource_link") {
490
- const uri = McpResourceURI.fromServer({
491
- id: this.renderData.serverDefinitionId,
492
- label: ""
493
- }, c.uri);
531
+ const uri = this._resolveServerResourceUri(c.uri);
494
532
  return {
495
533
  kind: "file",
496
534
  value: uri,
@@ -511,7 +549,7 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
511
549
  if (!widget) {
512
550
  return {};
513
551
  }
514
- const idPrefix = `mcpui-context-${hash(this.renderData.serverDefinitionId)}-`;
552
+ const idPrefix = `mcpui-context-${hash(this._serverOriginId())}-`;
515
553
  const toDelete = widget.attachmentModel.getAttachmentIDs();
516
554
  const idsToDelete = Array.from(toDelete).filter(id => id.startsWith(idPrefix));
517
555
  const entries = [];
@@ -528,10 +566,7 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
528
566
  mimeType: block.mimeType
529
567
  });
530
568
  } else if (block.type === "resource_link") {
531
- const uri = McpResourceURI.fromServer({
532
- id: this.renderData.serverDefinitionId,
533
- label: ""
534
- }, block.uri);
569
+ const uri = this._resolveServerResourceUri(block.uri);
535
570
  entries.push({
536
571
  kind: "file",
537
572
  value: uri,
@@ -613,10 +648,7 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
613
648
  uri
614
649
  });
615
650
  } else if (content.type === "resource_link") {
616
- const mcpUri = McpResourceURI.fromServer({
617
- id: this.renderData.serverDefinitionId,
618
- label: ""
619
- }, content.uri);
651
+ const mcpUri = this._resolveServerResourceUri(content.uri);
620
652
  newParts.push({
621
653
  kind: "data",
622
654
  mimeType: content.mimeType,
@@ -673,6 +705,12 @@ let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
673
705
  }
674
706
  return this._mcpToolCallUI.readResource(params.uri, token);
675
707
  }
708
+ async _handleSamplingCreateMessage(params, token) {
709
+ if (!params) {
710
+ throw ( new Error("Missing params in sampling/createMessage request"));
711
+ }
712
+ return this._mcpToolCallUI.sampling(params, token);
713
+ }
676
714
  async _sendResponse(id, result) {
677
715
  await this._webview.postMessage({
678
716
  jsonrpc: "2.0",
@@ -2,25 +2,23 @@ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"
2
2
  import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
3
3
  import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
4
4
  import { IMarkdownRendererService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service";
5
- import { IChatToolInvocation, IChatToolInvocationSerialized } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
5
+ import { ChatMcpAppData, IChatToolInvocation, IChatToolInvocationSerialized } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
6
6
  import { IChatCodeBlockInfo } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
7
7
  import { IChatContentPartRenderContext } from "../chatContentParts.js";
8
8
  import { BaseChatToolInvocationSubPart } from "./chatToolInvocationSubPart.js";
9
9
  /**
10
10
  * Data needed to render an MCP App, available before tool completion.
11
+ *
12
+ * Composed of the underlying MCP App backend descriptor (a discriminated
13
+ * union — see {@link ChatMcpAppData}) plus rendering context (`input`,
14
+ * `sessionResource`).
11
15
  */
12
- export interface IMcpAppRenderData {
13
- /** URI of the UI resource for rendering (e.g., "ui://weather-server/dashboard") */
14
- readonly resourceUri: string;
15
- /** Reference to the server definition for reconnection */
16
- readonly serverDefinitionId: string;
17
- /** Reference to the collection containing the server */
18
- readonly collectionId: string;
16
+ export type IMcpAppRenderData = ChatMcpAppData & {
19
17
  /** The tool input arguments as a JSON string */
20
18
  readonly input: string;
21
19
  /** The session resource URI for the chat session */
22
20
  readonly sessionResource: URI;
23
- }
21
+ };
24
22
  /**
25
23
  * Sub-part for rendering MCP App webviews in chat tool output.
26
24
  * This is a thin view layer that delegates to ChatMcpAppModel.
@@ -100,7 +100,7 @@ let ChatMcpAppSubPart = class ChatMcpAppSubPart extends BaseChatToolInvocationSu
100
100
  {
101
101
  container.style.display = "none";
102
102
  const progressMessage = $("span");
103
- progressMessage.textContent = ( localize(7522, "Loading MCP App..."));
103
+ progressMessage.textContent = ( localize(8073, "Loading MCP App..."));
104
104
  const progressPart = this._instantiationService.createInstance(
105
105
  ChatProgressSubPart,
106
106
  progressMessage,
@@ -130,12 +130,12 @@ let ChatMcpAppSubPart = class ChatMcpAppSubPart extends BaseChatToolInvocationSu
130
130
  _showError(container, error) {
131
131
  const errorNode = $(".mcp-app-error");
132
132
  const errorMessage = ( new MarkdownString());
133
- errorMessage.appendText(( localize(7523, "Error loading MCP App: {0}", error.message || String(error))));
133
+ errorMessage.appendText(( localize(8074, "Error loading MCP App: {0}", error.message || String(error))));
134
134
  const errorWidget = this._register(( new ChatErrorWidget(ChatErrorLevel.Error, errorMessage, this._markdownRendererService)));
135
135
  errorNode.appendChild(errorWidget.domNode);
136
136
  const buttonContainer = append(errorNode, $(".chat-buttons-container"));
137
137
  const retryButton = this._register(( new Button(buttonContainer, defaultButtonStyles)));
138
- retryButton.label = ( localize(7524, "Retry"));
138
+ retryButton.label = ( localize(8075, "Retry"));
139
139
  this._register(retryButton.onDidClick(() => {
140
140
  this._model.retry();
141
141
  }));
@@ -7,18 +7,21 @@ import { IChatToolInvocation } from "@codingame/monaco-vscode-api/vscode/vs/work
7
7
  import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
8
8
  import { IChatCodeBlockInfo } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
9
9
  import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
10
+ import { IChatToolRiskAssessmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service";
10
11
  import { IChatContentPartRenderContext } from "../chatContentParts.js";
12
+ import { IChatMarkdownAnchorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service";
11
13
  import { CollapsibleListPool } from "../chatReferencesContentPart.js";
12
14
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
13
15
  import { AbstractToolConfirmationSubPart } from "./abstractToolConfirmationSubPart.js";
14
16
  export declare class ChatModifiedFilesConfirmationSubPart extends AbstractToolConfirmationSubPart {
15
17
  private readonly listPool;
16
18
  private readonly markdownRendererService;
19
+ private readonly chatMarkdownAnchorService;
17
20
  private readonly editorService;
18
21
  private readonly commandService;
19
22
  readonly domNode: HTMLElement;
20
23
  readonly codeblocks: IChatCodeBlockInfo[];
21
- constructor(toolInvocation: IChatToolInvocation, context: IChatContentPartRenderContext, listPool: CollapsibleListPool, instantiationService: IInstantiationService, keybindingService: IKeybindingService, contextKeyService: IContextKeyService, chatWidgetService: IChatWidgetService, languageModelToolsService: ILanguageModelToolsService, markdownRendererService: IMarkdownRendererService, editorService: IEditorService, commandService: ICommandService);
24
+ constructor(toolInvocation: IChatToolInvocation, context: IChatContentPartRenderContext, listPool: CollapsibleListPool, instantiationService: IInstantiationService, keybindingService: IKeybindingService, contextKeyService: IContextKeyService, chatWidgetService: IChatWidgetService, languageModelToolsService: ILanguageModelToolsService, markdownRendererService: IMarkdownRendererService, chatMarkdownAnchorService: IChatMarkdownAnchorService, editorService: IEditorService, commandService: ICommandService, riskAssessmentService: IChatToolRiskAssessmentService);
22
25
  private createButtons;
23
26
  private createWidgetContentElement;
24
27
  private createModifiedFilesElement;