@codingame/monaco-vscode-katex-common 34.1.2 → 35.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -10,6 +10,7 @@ import { StateComponents } from '@codingame/monaco-vscode-api/vscode/vs/platform
10
10
  import { isUntitledChatSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
11
11
  import { isClaimedByDedicatedPicker, AgentHostChatInputPicker } from './agentHostChatInputPicker.js';
12
12
  import { IAgentHostSessionWorkingDirectoryResolver } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.service';
13
+ import { IAgentHostNewSessionFolderService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.service';
13
14
  import { IAgentHostUntitledProvisionalSessionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service';
14
15
  import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
15
16
  import { toAgentHostBackendSessionUri } from './agentHostSessionUri.js';
@@ -21,7 +22,8 @@ let AgentHostGenericConfigChips = class AgentHostGenericConfigChips extends Disp
21
22
  _agentHostService,
22
23
  _provisional,
23
24
  _workingDirectoryResolver,
24
- _workspaceContextService
25
+ _workspaceContextService,
26
+ _newSessionFolderService
25
27
  ) {
26
28
  super();
27
29
  this._widget = _widget;
@@ -30,6 +32,7 @@ let AgentHostGenericConfigChips = class AgentHostGenericConfigChips extends Disp
30
32
  this._provisional = _provisional;
31
33
  this._workingDirectoryResolver = _workingDirectoryResolver;
32
34
  this._workspaceContextService = _workspaceContextService;
35
+ this._newSessionFolderService = _newSessionFolderService;
33
36
  this._chips = this._register(( new DisposableMap()));
34
37
  this._subRef = this._register(( new MutableDisposable()));
35
38
  this._initialResolveCts = this._register(( new MutableDisposable()));
@@ -107,11 +110,11 @@ let AgentHostGenericConfigChips = class AgentHostGenericConfigChips extends Disp
107
110
  _readWorkingDirectory() {
108
111
  const state = this._subRef.value?.sub.value;
109
112
  if (state && !(state instanceof Error)) {
110
- const cwd = state.summary.workingDirectory;
113
+ const cwd = state.workingDirectory;
111
114
  return typeof cwd === "string" ? ( URI.parse(cwd)) : cwd;
112
115
  }
113
116
  const sessionResource = this._widget.viewModel?.sessionResource;
114
- return (sessionResource && this._workingDirectoryResolver.resolve(sessionResource)) ?? this._workspaceContextService.getWorkspace().folders[0]?.uri;
117
+ return (sessionResource && this._newSessionFolderService.getFolder(sessionResource)) ?? (sessionResource && this._workingDirectoryResolver.resolve(sessionResource)) ?? this._newSessionFolderService.getDefaultFolder() ?? this._workspaceContextService.getWorkspace().folders[0]?.uri;
115
118
  }
116
119
  _readSchemaProperties() {
117
120
  const sessionResource = this._widget.viewModel?.sessionResource;
@@ -166,6 +169,6 @@ let AgentHostGenericConfigChips = class AgentHostGenericConfigChips extends Disp
166
169
  }
167
170
  }
168
171
  };
169
- AgentHostGenericConfigChips = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IAgentHostService)), ( __param(3, IAgentHostUntitledProvisionalSessionService)), ( __param(4, IAgentHostSessionWorkingDirectoryResolver)), ( __param(5, IWorkspaceContextService))], AgentHostGenericConfigChips));
172
+ AgentHostGenericConfigChips = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IAgentHostService)), ( __param(3, IAgentHostUntitledProvisionalSessionService)), ( __param(4, IAgentHostSessionWorkingDirectoryResolver)), ( __param(5, IWorkspaceContextService)), ( __param(6, IAgentHostNewSessionFolderService))], AgentHostGenericConfigChips));
170
173
 
171
174
  export { AgentHostGenericConfigChips };
@@ -0,0 +1,12 @@
1
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
+ import { type SimpleMessageAttachment } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
3
+ import { type IChatRequestSessionReferenceVariableEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries";
4
+ export declare const AgentHostSessionReferenceAttachmentDisplayKind = "sessionReference";
5
+ export declare const AgentHostSessionReferenceTrajectoryAttachmentDisplayKind = "sessionReferenceTrajectory";
6
+ export declare const AgentHostSessionReferenceAttachmentMetadataKey = "vscode.agentHost.sessionReference";
7
+ export declare function toSessionReferenceModelRepresentation(label: string, sessionResource: URI, trajectoryPath?: string): string;
8
+ export declare function toSessionReferenceAttachmentMeta(sessionResource: URI): NonNullable<SimpleMessageAttachment["_meta"]>;
9
+ export declare function restoreSessionReferenceVariableEntryFromAttachment(attachment: SimpleMessageAttachment): IChatRequestSessionReferenceVariableEntry | undefined;
10
+ export declare function isSessionReferenceTrajectoryAttachment(attachment: {
11
+ readonly displayKind?: string;
12
+ }): boolean;
@@ -0,0 +1,116 @@
1
+ import { VSBuffer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/buffer";
2
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { IObservable, IReader } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
5
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
6
+ import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
7
+ import { type ToolCallState } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState";
8
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
9
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
10
+ import { IChatProgress, IChatWorkspaceEdit } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
11
+ import { ChatEditingSessionState, IChatEditingSession, IEditSessionDiffStats, IEditSessionEntryDiff, IModifiedFileEntry, IStreamingEdits } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService";
12
+ import { IChatRequestDisablement, IChatResponseModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel";
13
+ /**
14
+ * A thin {@link IChatEditingSession} for agent host sessions. The agent host
15
+ * has its own diff / changeset machinery and renders file edits via the
16
+ * dedicated {@link IChatExternalEdit} progress part — so this session only
17
+ * needs to support the chat-level "restore to checkpoint" UX.
18
+ *
19
+ * Concretely it implements:
20
+ * - {@link restoreSnapshot} (writes before/after content to disk)
21
+ * - {@link requestDisablement} (so disabled-request UI works after restore)
22
+ * - {@link getSnapshotUri} / {@link getSnapshotContents} (so checkpoint diff
23
+ * viewers can resolve historical content)
24
+ *
25
+ * Everything else is a no-op / empty observable / `undefined`. In particular:
26
+ * - `entries` is always empty → the global accept/reject UI doesn't appear
27
+ * - no diff computation, no multi-diff editor, no streaming-edits APIs
28
+ *
29
+ * Undo/redo granularity is per-request: every request occupies one checkpoint
30
+ * regardless of how many tool calls it ran. The `stopId` parameters on
31
+ * {@link restoreSnapshot}, {@link getSnapshotUri}, and {@link getSnapshotContents}
32
+ * are accepted for interface compatibility but ignored.
33
+ *
34
+ * Hydrated by the session handler via {@link ensureRequestCheckpoint} and
35
+ * {@link addToolCallEdits} as turns and tool calls arrive.
36
+ */
37
+ export declare class AgentHostSnapshotController extends Disposable implements IChatEditingSession {
38
+ readonly chatSessionResource: URI;
39
+ private readonly _connectionAuthority;
40
+ private readonly _logService;
41
+ private readonly _fileService;
42
+ readonly supportsKeepUndo = false;
43
+ readonly isGlobalEditingSession = false;
44
+ readonly state: IObservable<ChatEditingSessionState>;
45
+ readonly entries: IObservable<readonly IModifiedFileEntry[]>;
46
+ readonly requestDisablement: IObservable<IChatRequestDisablement[]>;
47
+ readonly canUndo: IObservable<boolean>;
48
+ readonly canRedo: IObservable<boolean>;
49
+ private readonly _onDidDispose;
50
+ readonly onDidDispose: Event<void>;
51
+ private readonly _checkpoints;
52
+ private readonly _currentCheckpointIndex;
53
+ private readonly _undoRedoSequencer;
54
+ constructor(chatSessionResource: URI, _connectionAuthority: string, _logService: ILogService, _fileService: IFileService);
55
+ /**
56
+ * Ensures a checkpoint exists for the given request. Called at the start
57
+ * of every turn (and during history hydration) so {@link requestDisablement}
58
+ * and {@link restoreSnapshot} can reference every request, even ones that
59
+ * produce no file edits.
60
+ *
61
+ * Splices away stale checkpoints past the current index (undo branch
62
+ * semantics) when a new request arrives after a checkpoint restore.
63
+ */
64
+ ensureRequestCheckpoint(requestId: string): void;
65
+ /**
66
+ * Folds a completed tool call's file edits into the checkpoint for the
67
+ * given request. Idempotent on `toolCallId`.
68
+ */
69
+ addToolCallEdits(requestId: string, tc: ToolCallState): void;
70
+ private _findCheckpointIndex;
71
+ restoreSnapshot(requestId: string, _stopId: string | undefined): Promise<void>;
72
+ /**
73
+ * Steps a single checkpoint backwards, undoing the edits of the current
74
+ * checkpoint. The "Undo" UI invokes this once per click.
75
+ */
76
+ undoInteraction(): Promise<void>;
77
+ /**
78
+ * Steps a single checkpoint forwards, redoing the edits of the next
79
+ * checkpoint.
80
+ *
81
+ * Implementing this is essential: the "Redo" action repeatedly calls this
82
+ * while {@link canRedo} is `true`, so a no-op implementation would spin
83
+ * forever and hang the window.
84
+ */
85
+ redoInteraction(): Promise<void>;
86
+ /**
87
+ * Moves the on-disk file state and the checkpoint cursor to `targetIdx`,
88
+ * writing each crossed checkpoint's before/after content. Must run inside
89
+ * the {@link _undoRedoSequencer} to avoid racing writes.
90
+ */
91
+ private _navigateToCheckpointIndex;
92
+ getSnapshotUri(requestId: string, uri: URI, _stopId: string | undefined): URI | undefined;
93
+ getSnapshotContents(requestId: string, uri: URI, _stopId: string | undefined): Promise<VSBuffer | undefined>;
94
+ getSnapshotModel(_requestId: string, _undoStop: string | undefined, _snapshotUri: URI): Promise<ITextModel | null>;
95
+ hasEditsInRequest(requestId: string, _reader?: IReader): boolean;
96
+ show(_previousChanges?: boolean): Promise<void>;
97
+ getEntry(_uri: URI): IModifiedFileEntry | undefined;
98
+ readEntry(_uri: URI, _reader: IReader): IModifiedFileEntry | undefined;
99
+ accept(..._uris: URI[]): Promise<void>;
100
+ reject(..._uris: URI[]): Promise<void>;
101
+ getEntryDiffBetweenStops(_uri: URI, _requestId: string | undefined, _stopId: string | undefined): IObservable<IEditSessionEntryDiff | undefined> | undefined;
102
+ getEntryDiffBetweenRequests(_uri: URI, _startRequestId: string, _stopRequestId: string): IObservable<IEditSessionEntryDiff | undefined>;
103
+ getDiffsForFilesInSession(): IObservable<readonly IEditSessionEntryDiff[]>;
104
+ getDiffsForFilesInRequest(_requestId: string): IObservable<readonly IEditSessionEntryDiff[]>;
105
+ getDiffForSession(): IObservable<IEditSessionDiffStats>;
106
+ triggerExplanationGeneration(): Promise<void>;
107
+ clearExplanations(): void;
108
+ hasExplanations(): boolean;
109
+ startStreamingEdits(_resource: URI, _responseModel: IChatResponseModel, _inUndoStop: string | undefined): IStreamingEdits;
110
+ applyWorkspaceEdit(_edit: IChatWorkspaceEdit, _responseModel: IChatResponseModel, _undoStopId: string): void;
111
+ startExternalEdits(_responseModel: IChatResponseModel, _operationId: number, _resources: URI[], _undoStopId: string, _contentFor?: URI[]): Promise<IChatProgress[]>;
112
+ stopExternalEdits(_responseModel: IChatResponseModel, _operationId: number, _contentFor?: URI[]): Promise<IChatProgress[]>;
113
+ stop(_clearState?: boolean): Promise<void>;
114
+ dispose(): void;
115
+ private _writeCheckpointContent;
116
+ }
@@ -0,0 +1,348 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Sequencer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
5
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
6
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
8
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
9
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
10
+ import { toAgentHostUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
11
+ import { FileEditKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
12
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
13
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
14
+ import { ChatEditingSessionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
15
+ import { fileEditsToExternalEdits } from './stateToProgressAdapter.js';
16
+ import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
17
+ import { derivedOpts, derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
18
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
19
+ import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
20
+ import { ToolCallStatus } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
21
+
22
+ let AgentHostSnapshotController = class AgentHostSnapshotController extends Disposable {
23
+ constructor(chatSessionResource, _connectionAuthority, _logService, _fileService) {
24
+ super();
25
+ this.chatSessionResource = chatSessionResource;
26
+ this._connectionAuthority = _connectionAuthority;
27
+ this._logService = _logService;
28
+ this._fileService = _fileService;
29
+ this.supportsKeepUndo = false;
30
+ this.isGlobalEditingSession = false;
31
+ this.state = constObservable(ChatEditingSessionState.Idle);
32
+ this.entries = constObservable([]);
33
+ this.requestDisablement = derivedOpts({
34
+ equalsFn: (a, b) => a.length === b.length && a.every((v, i) => v.requestId === b[i].requestId)
35
+ }, reader => {
36
+ const currentIdx = this._currentCheckpointIndex.read(reader);
37
+ const disabled = [];
38
+ for (let i = currentIdx + 1; i < this._checkpoints.length; i++) {
39
+ disabled.push({
40
+ requestId: this._checkpoints[i].requestId
41
+ });
42
+ }
43
+ return disabled;
44
+ });
45
+ this.canUndo = derived(this, r => this._currentCheckpointIndex.read(r) >= 0);
46
+ this.canRedo = derived(
47
+ this,
48
+ r => this._currentCheckpointIndex.read(r) < this._checkpoints.length - 1
49
+ );
50
+ this._onDidDispose = this._register(( new Emitter()));
51
+ this.onDidDispose = this._onDidDispose.event;
52
+ this._checkpoints = [];
53
+ this._currentCheckpointIndex = observableValue(this, -1);
54
+ this._undoRedoSequencer = ( new Sequencer());
55
+ }
56
+ ensureRequestCheckpoint(requestId) {
57
+ if (( this._checkpoints.some(cp => cp.requestId === requestId))) {
58
+ return;
59
+ }
60
+ const currentIdx = this._currentCheckpointIndex.get();
61
+ if (currentIdx < this._checkpoints.length - 1) {
62
+ this._checkpoints.splice(currentIdx + 1);
63
+ }
64
+ this._checkpoints.push({
65
+ requestId,
66
+ edits: [],
67
+ seenToolCallIds: ( new Set())
68
+ });
69
+ transaction(tx => {
70
+ this._currentCheckpointIndex.set(this._checkpoints.length - 1, tx);
71
+ });
72
+ }
73
+ addToolCallEdits(requestId, tc) {
74
+ if (tc.status !== ToolCallStatus.Completed) {
75
+ return;
76
+ }
77
+ this.ensureRequestCheckpoint(requestId);
78
+ const cp = this._checkpoints.find(c => c.requestId === requestId);
79
+ if (!cp || ( cp.seenToolCallIds.has(tc.toolCallId))) {
80
+ return;
81
+ }
82
+ cp.seenToolCallIds.add(tc.toolCallId);
83
+ const fileEdits = fileEditsToExternalEdits(tc);
84
+ if (fileEdits.length === 0) {
85
+ return;
86
+ }
87
+ const authority = this._connectionAuthority;
88
+ for (const edit of fileEdits) {
89
+ const resource = toAgentHostUri(edit.resource, authority);
90
+ const entry = {
91
+ kind: edit.kind,
92
+ resource,
93
+ originalResource: edit.originalResource ? toAgentHostUri(edit.originalResource, authority) : undefined,
94
+ beforeContentUri: edit.beforeContentUri ? toAgentHostUri(edit.beforeContentUri, authority) : undefined,
95
+ afterContentUri: edit.afterContentUri ? toAgentHostUri(edit.afterContentUri, authority) : undefined,
96
+ undoStopId: edit.undoStopId,
97
+ diff: edit.diff
98
+ };
99
+ const existingIdx = cp.edits.findIndex(e => ( e.resource.toString()) === ( resource.toString()));
100
+ if (existingIdx < 0) {
101
+ cp.edits.push(entry);
102
+ } else {
103
+ cp.edits[existingIdx] = mergeFileEdit(cp.edits[existingIdx], entry);
104
+ }
105
+ }
106
+ }
107
+ _findCheckpointIndex(requestId) {
108
+ return this._checkpoints.findIndex(cp => cp.requestId === requestId);
109
+ }
110
+ async restoreSnapshot(requestId, _stopId) {
111
+ return this._undoRedoSequencer.queue(async () => {
112
+ const cpIdx = this._findCheckpointIndex(requestId);
113
+ if (cpIdx < 0) {
114
+ this._logService.warn(
115
+ `[AgentHostSnapshotController] No checkpoint found for requestId=${requestId}`
116
+ );
117
+ return;
118
+ }
119
+ await this._navigateToCheckpointIndex(cpIdx - 1);
120
+ });
121
+ }
122
+ async undoInteraction() {
123
+ return this._undoRedoSequencer.queue(async () => {
124
+ const currentIdx = this._currentCheckpointIndex.get();
125
+ if (currentIdx < 0) {
126
+ return;
127
+ }
128
+ await this._navigateToCheckpointIndex(currentIdx - 1);
129
+ });
130
+ }
131
+ async redoInteraction() {
132
+ return this._undoRedoSequencer.queue(async () => {
133
+ const currentIdx = this._currentCheckpointIndex.get();
134
+ if (currentIdx >= this._checkpoints.length - 1) {
135
+ return;
136
+ }
137
+ await this._navigateToCheckpointIndex(currentIdx + 1);
138
+ });
139
+ }
140
+ async _navigateToCheckpointIndex(targetIdx) {
141
+ const currentIdx = this._currentCheckpointIndex.get();
142
+ if (targetIdx < currentIdx) {
143
+ for (let i = currentIdx; i > targetIdx; i--) {
144
+ await this._writeCheckpointContent(this._checkpoints[i], "before");
145
+ }
146
+ } else if (targetIdx > currentIdx) {
147
+ for (let i = currentIdx + 1; i <= targetIdx; i++) {
148
+ await this._writeCheckpointContent(this._checkpoints[i], "after");
149
+ }
150
+ }
151
+ transaction(tx => {
152
+ this._currentCheckpointIndex.set(targetIdx, tx);
153
+ });
154
+ }
155
+ getSnapshotUri(requestId, uri, _stopId) {
156
+ const cp = this._checkpoints.find(c => c.requestId === requestId);
157
+ if (!cp || !( cp.edits.some(e => ( e.resource.toString()) === ( uri.toString())))) {
158
+ return undefined;
159
+ }
160
+ return ( URI.from({
161
+ scheme: Schemas.chatEditingSnapshotScheme,
162
+ path: uri.path,
163
+ query: JSON.stringify({
164
+ session: ( this.chatSessionResource.toString()),
165
+ requestId,
166
+ undoStop: ""
167
+ })
168
+ }));
169
+ }
170
+ async getSnapshotContents(requestId, uri, _stopId) {
171
+ const cp = this._checkpoints.find(c => c.requestId === requestId);
172
+ if (!cp) {
173
+ return undefined;
174
+ }
175
+ const uriStr = ( uri.toString());
176
+ let edit;
177
+ for (let i = cp.edits.length - 1; i >= 0; i--) {
178
+ if (( cp.edits[i].resource.toString()) === uriStr) {
179
+ edit = cp.edits[i];
180
+ break;
181
+ }
182
+ }
183
+ if (!edit) {
184
+ return undefined;
185
+ }
186
+ try {
187
+ if (!edit.afterContentUri) {
188
+ return VSBuffer.fromByteArray([]);
189
+ }
190
+ const content = await this._fileService.readFile(edit.afterContentUri);
191
+ return content.value;
192
+ } catch (err) {
193
+ this._logService.warn(`[AgentHostSnapshotController] Failed to fetch snapshot content`, err);
194
+ return undefined;
195
+ }
196
+ }
197
+ async getSnapshotModel(_requestId, _undoStop, _snapshotUri) {
198
+ return null;
199
+ }
200
+ hasEditsInRequest(requestId, _reader) {
201
+ const cp = this._checkpoints.find(c => c.requestId === requestId);
202
+ return !!cp && cp.edits.length > 0;
203
+ }
204
+ async show(_previousChanges) {}
205
+ getEntry(_uri) {
206
+ return undefined;
207
+ }
208
+ readEntry(_uri, _reader) {
209
+ return undefined;
210
+ }
211
+ async accept(..._uris) {}
212
+ async reject(..._uris) {}
213
+ getEntryDiffBetweenStops(_uri, _requestId, _stopId) {
214
+ return undefined;
215
+ }
216
+ getEntryDiffBetweenRequests(_uri, _startRequestId, _stopRequestId) {
217
+ return constObservable(undefined);
218
+ }
219
+ getDiffsForFilesInSession() {
220
+ return constObservable([]);
221
+ }
222
+ getDiffsForFilesInRequest(_requestId) {
223
+ return constObservable([]);
224
+ }
225
+ getDiffForSession() {
226
+ return constObservable({
227
+ added: 0,
228
+ removed: 0
229
+ });
230
+ }
231
+ async triggerExplanationGeneration() {}
232
+ clearExplanations() {}
233
+ hasExplanations() {
234
+ return false;
235
+ }
236
+ startStreamingEdits(_resource, _responseModel, _inUndoStop) {
237
+ throw ( new Error("Not supported for agent host sessions"));
238
+ }
239
+ applyWorkspaceEdit(_edit, _responseModel, _undoStopId) {
240
+ throw ( new Error("Not supported for agent host sessions"));
241
+ }
242
+ async startExternalEdits(_responseModel, _operationId, _resources, _undoStopId, _contentFor) {
243
+ throw ( new Error("Not supported for agent host sessions"));
244
+ }
245
+ async stopExternalEdits(_responseModel, _operationId, _contentFor) {
246
+ throw ( new Error("Not supported for agent host sessions"));
247
+ }
248
+ async stop(_clearState) {
249
+ this.dispose();
250
+ }
251
+ dispose() {
252
+ this._onDidDispose.fire();
253
+ super.dispose();
254
+ }
255
+ async _writeCheckpointContent(checkpoint, direction) {
256
+ const ops = ( checkpoint.edits.map(async edit => {
257
+ try {
258
+ if (direction === "before") {
259
+ switch (edit.kind) {
260
+ case FileEditKind.Create:
261
+ await this._fileService.del(edit.resource);
262
+ break;
263
+ case FileEditKind.Delete:
264
+ if (edit.beforeContentUri) {
265
+ const content = await this._fileService.readFile(edit.beforeContentUri);
266
+ await this._fileService.writeFile(edit.resource, content.value);
267
+ }
268
+ break;
269
+ case FileEditKind.Rename:
270
+ if (edit.originalResource) {
271
+ await this._fileService.move(edit.resource, edit.originalResource, true);
272
+ }
273
+ if (edit.beforeContentUri && edit.originalResource) {
274
+ const content = await this._fileService.readFile(edit.beforeContentUri);
275
+ await this._fileService.writeFile(edit.originalResource, content.value);
276
+ }
277
+ break;
278
+ case FileEditKind.Edit:
279
+ if (edit.beforeContentUri) {
280
+ const content = await this._fileService.readFile(edit.beforeContentUri);
281
+ await this._fileService.writeFile(edit.resource, content.value);
282
+ }
283
+ break;
284
+ }
285
+ } else {
286
+ switch (edit.kind) {
287
+ case FileEditKind.Create:
288
+ if (edit.afterContentUri) {
289
+ const content = await this._fileService.readFile(edit.afterContentUri);
290
+ await this._fileService.writeFile(edit.resource, content.value);
291
+ }
292
+ break;
293
+ case FileEditKind.Delete:
294
+ await this._fileService.del(edit.resource);
295
+ break;
296
+ case FileEditKind.Rename:
297
+ if (edit.originalResource) {
298
+ await this._fileService.move(edit.originalResource, edit.resource, true);
299
+ }
300
+ if (edit.afterContentUri) {
301
+ const content = await this._fileService.readFile(edit.afterContentUri);
302
+ await this._fileService.writeFile(edit.resource, content.value);
303
+ }
304
+ break;
305
+ case FileEditKind.Edit:
306
+ if (edit.afterContentUri) {
307
+ const content = await this._fileService.readFile(edit.afterContentUri);
308
+ await this._fileService.writeFile(edit.resource, content.value);
309
+ }
310
+ break;
311
+ }
312
+ }
313
+ } catch (err) {
314
+ this._logService.warn(
315
+ `[AgentHostSnapshotController] Failed to ${direction === "before" ? "undo" : "redo"} ${edit.kind} for ${( edit.resource.toString())}`,
316
+ err
317
+ );
318
+ }
319
+ }));
320
+ await Promise.all(ops);
321
+ }
322
+ };
323
+ AgentHostSnapshotController = ( __decorate([( __param(2, ILogService)), ( __param(3, IFileService))], AgentHostSnapshotController));
324
+ function mergeFileEdit(prev, next) {
325
+ const startsAbsent = prev.kind === FileEditKind.Create;
326
+ const endsAbsent = next.kind === FileEditKind.Delete;
327
+ let kind;
328
+ if (startsAbsent && endsAbsent) {
329
+ kind = FileEditKind.Edit;
330
+ } else if (startsAbsent) {
331
+ kind = FileEditKind.Create;
332
+ } else if (endsAbsent) {
333
+ kind = FileEditKind.Delete;
334
+ } else {
335
+ kind = FileEditKind.Edit;
336
+ }
337
+ return {
338
+ kind,
339
+ resource: next.resource,
340
+ originalResource: next.originalResource ?? prev.originalResource,
341
+ beforeContentUri: prev.beforeContentUri,
342
+ afterContentUri: next.afterContentUri,
343
+ undoStopId: prev.undoStopId,
344
+ diff: next.diff ?? prev.diff
345
+ };
346
+ }
347
+
348
+ export { AgentHostSnapshotController };
@@ -99,7 +99,7 @@
99
99
  container-type: inline-size;
100
100
  }
101
101
 
102
- @container (max-width: 480px) {
102
+ @container (max-width: 400px) {
103
103
  .agent-host-chat-input-picker-label {
104
104
  display: none;
105
105
  }