@codingame/monaco-vscode-katex-common 29.1.1 → 30.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 (180) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actions/browser/buttonbar.js +14 -13
  3. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +34 -34
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -20
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +14 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +208 -0
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +22 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +637 -0
  12. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -0
  14. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
  15. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +9 -1
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +202 -13
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +4 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +17 -8
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +53 -5
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +296 -63
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +59 -23
  23. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +55 -42
  24. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
  25. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +110 -59
  26. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  27. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +5 -4
  31. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +24 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +384 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
  34. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +12 -7
  35. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +220 -61
  36. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +1 -2
  37. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  38. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +14 -1
  41. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
  42. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +5 -4
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +5 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +14 -14
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +11 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +40 -12
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +1 -0
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +97 -54
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +5 -4
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +6 -6
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +8 -7
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +15 -2
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +155 -22
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +3 -1
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +36 -19
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +13 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.d.ts +17 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +68 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +6 -6
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +16 -16
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +33 -25
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -7
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +12 -3
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +4 -13
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +37 -113
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +1 -1
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +10 -3
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +66 -39
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +13 -2
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +103 -61
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +2 -1
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +35 -23
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +4 -4
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +6 -6
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +5 -5
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +1 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +4 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +2 -1
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +39 -24
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +6 -5
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +44 -18
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +60 -10
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
  113. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
  114. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
  115. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +4 -0
  116. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +4 -4
  117. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +5 -5
  118. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -1
  119. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +5 -2
  120. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +6 -11
  121. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
  122. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -39
  123. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  124. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  125. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  126. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
  127. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +746 -0
  128. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
  129. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +300 -0
  130. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
  131. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
  132. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
  133. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1963 -0
  134. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
  135. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +314 -0
  136. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
  137. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +886 -0
  138. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
  139. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +118 -0
  140. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
  141. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +71 -0
  142. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
  143. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
  144. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
  145. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +313 -0
  146. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
  147. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +265 -0
  148. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +185 -0
  150. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
  151. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +104 -0
  152. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +43 -0
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +41 -0
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +69 -0
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +933 -0
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +32 -0
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +643 -0
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +197 -0
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +539 -0
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
  171. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
  172. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +90 -0
  173. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
  174. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
  175. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  176. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -152
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1317
  179. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.d.ts +0 -47
  180. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.js +0 -95
@@ -0,0 +1,90 @@
1
+
2
+ import { toFormattedString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/jsonFormatter';
3
+ import { NotebookMetadataUri, NotebookCellsChangeType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
4
+ import { StringSHA1 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
5
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
+ import { DefaultEndOfLine, EndOfLinePreference } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
7
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
8
+ import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
9
+ import { createTextBuffer } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
10
+
11
+ function getFormattedNotebookMetadataJSON(transientMetadata, metadata) {
12
+ let filteredMetadata = {};
13
+ if (transientMetadata) {
14
+ const keys = ( new Set([...( Object.keys(metadata))]));
15
+ for (const key of keys) {
16
+ if (!(transientMetadata[key])) {
17
+ filteredMetadata[key] = metadata[key];
18
+ }
19
+ }
20
+ } else {
21
+ filteredMetadata = metadata;
22
+ }
23
+ const metadataSource = toFormattedString(filteredMetadata, {});
24
+ return metadataSource;
25
+ }
26
+ class NotebookDocumentMetadataTextModel extends Disposable {
27
+ get metadata() {
28
+ return this.notebookModel.metadata;
29
+ }
30
+ get textBuffer() {
31
+ if (this._textBuffer) {
32
+ return this._textBuffer;
33
+ }
34
+ const source = getFormattedNotebookMetadataJSON(
35
+ this.notebookModel.transientOptions.transientDocumentMetadata,
36
+ this.metadata
37
+ );
38
+ this._textBuffer = this._register(createTextBuffer(source, DefaultEndOfLine.LF).textBuffer);
39
+ this._register(this._textBuffer.onDidChangeContent(() => {
40
+ this._onDidChange.fire();
41
+ }));
42
+ return this._textBuffer;
43
+ }
44
+ constructor(notebookModel) {
45
+ super();
46
+ this.notebookModel = notebookModel;
47
+ this._onDidChange = this._register(( new Emitter()));
48
+ this.onDidChange = this._onDidChange.event;
49
+ this._textBufferHash = null;
50
+ this.uri = NotebookMetadataUri.generate(this.notebookModel.uri);
51
+ this._register(this.notebookModel.onDidChangeContent(e => {
52
+ if (( e.rawEvents.some(
53
+ event => event.kind === NotebookCellsChangeType.ChangeDocumentMetadata || event.kind === NotebookCellsChangeType.ModelChange
54
+ ))) {
55
+ this._textBuffer?.dispose();
56
+ this._textBuffer = undefined;
57
+ this._textBufferHash = null;
58
+ this._onDidChange.fire();
59
+ }
60
+ }));
61
+ }
62
+ getHash() {
63
+ if (this._textBufferHash !== null) {
64
+ return this._textBufferHash;
65
+ }
66
+ const shaComputer = ( new StringSHA1());
67
+ const snapshot = this.textBuffer.createSnapshot(false);
68
+ let text;
69
+ while ((text = snapshot.read())) {
70
+ shaComputer.update(text);
71
+ }
72
+ this._textBufferHash = shaComputer.digest();
73
+ return this._textBufferHash;
74
+ }
75
+ getValue() {
76
+ const fullRange = this.getFullModelRange();
77
+ const eol = this.textBuffer.getEOL();
78
+ if (eol === "\n") {
79
+ return this.textBuffer.getValueInRange(fullRange, EndOfLinePreference.LF);
80
+ } else {
81
+ return this.textBuffer.getValueInRange(fullRange, EndOfLinePreference.CRLF);
82
+ }
83
+ }
84
+ getFullModelRange() {
85
+ const lineCount = this.textBuffer.getLineCount();
86
+ return ( new Range(1, 1, lineCount, this.textBuffer.getLineLength(lineCount) + 1));
87
+ }
88
+ }
89
+
90
+ export { NotebookDocumentMetadataTextModel, getFormattedNotebookMetadataJSON };
@@ -0,0 +1,26 @@
1
+ import { CellKind, INotebookDiffResult } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
2
+ export type CellDiffInfo = {
3
+ originalCellIndex: number;
4
+ modifiedCellIndex: number;
5
+ type: "unchanged" | "modified";
6
+ } | {
7
+ originalCellIndex: number;
8
+ type: "delete";
9
+ } | {
10
+ modifiedCellIndex: number;
11
+ type: "insert";
12
+ };
13
+ interface ICell {
14
+ cellKind: CellKind;
15
+ getHashValue(): number;
16
+ equal(cell: ICell): boolean;
17
+ }
18
+ export declare function computeDiff(originalModel: {
19
+ readonly cells: readonly ICell[];
20
+ }, modifiedModel: {
21
+ readonly cells: readonly ICell[];
22
+ }, diffResult: INotebookDiffResult): {
23
+ cellDiffInfo: CellDiffInfo[];
24
+ firstChangeIndex: number;
25
+ };
26
+ export {};
@@ -0,0 +1,92 @@
1
+
2
+
3
+ function computeDiff(originalModel, modifiedModel, diffResult) {
4
+ const cellChanges = diffResult.cellsDiff.changes;
5
+ const cellDiffInfo = [];
6
+ let originalCellIndex = 0;
7
+ let modifiedCellIndex = 0;
8
+ let firstChangeIndex = -1;
9
+ for (let i = 0; i < cellChanges.length; i++) {
10
+ const change = cellChanges[i];
11
+ for (let j = 0; j < change.originalStart - originalCellIndex; j++) {
12
+ const originalCell = originalModel.cells[originalCellIndex + j];
13
+ const modifiedCell = modifiedModel.cells[modifiedCellIndex + j];
14
+ if (originalCell.getHashValue() === modifiedCell.getHashValue()) {
15
+ cellDiffInfo.push({
16
+ originalCellIndex: originalCellIndex + j,
17
+ modifiedCellIndex: modifiedCellIndex + j,
18
+ type: 'unchanged'
19
+ });
20
+ }
21
+ else {
22
+ if (firstChangeIndex === -1) {
23
+ firstChangeIndex = cellDiffInfo.length;
24
+ }
25
+ cellDiffInfo.push({
26
+ originalCellIndex: originalCellIndex + j,
27
+ modifiedCellIndex: modifiedCellIndex + j,
28
+ type: 'modified'
29
+ });
30
+ }
31
+ }
32
+ const modifiedLCS = computeModifiedLCS(change, originalModel, modifiedModel);
33
+ if (modifiedLCS.length && firstChangeIndex === -1) {
34
+ firstChangeIndex = cellDiffInfo.length;
35
+ }
36
+ cellDiffInfo.push(...modifiedLCS);
37
+ originalCellIndex = change.originalStart + change.originalLength;
38
+ modifiedCellIndex = change.modifiedStart + change.modifiedLength;
39
+ }
40
+ for (let i = originalCellIndex; i < originalModel.cells.length; i++) {
41
+ cellDiffInfo.push({
42
+ originalCellIndex: i,
43
+ modifiedCellIndex: i - originalCellIndex + modifiedCellIndex,
44
+ type: 'unchanged'
45
+ });
46
+ }
47
+ return {
48
+ cellDiffInfo,
49
+ firstChangeIndex
50
+ };
51
+ }
52
+ function computeModifiedLCS(change, originalModel, modifiedModel) {
53
+ const result = [];
54
+ const modifiedLen = Math.min(change.originalLength, change.modifiedLength);
55
+ for (let j = 0; j < modifiedLen; j++) {
56
+ const originalCell = originalModel.cells[change.originalStart + j];
57
+ const modifiedCell = modifiedModel.cells[change.modifiedStart + j];
58
+ if (originalCell.cellKind !== modifiedCell.cellKind) {
59
+ result.push({
60
+ originalCellIndex: change.originalStart + j,
61
+ type: 'delete'
62
+ });
63
+ result.push({
64
+ modifiedCellIndex: change.modifiedStart + j,
65
+ type: 'insert'
66
+ });
67
+ }
68
+ else {
69
+ const isTheSame = originalCell.equal(modifiedCell);
70
+ result.push({
71
+ originalCellIndex: change.originalStart + j,
72
+ modifiedCellIndex: change.modifiedStart + j,
73
+ type: isTheSame ? 'unchanged' : 'modified'
74
+ });
75
+ }
76
+ }
77
+ for (let j = modifiedLen; j < change.originalLength; j++) {
78
+ result.push({
79
+ originalCellIndex: change.originalStart + j,
80
+ type: 'delete'
81
+ });
82
+ }
83
+ for (let j = modifiedLen; j < change.modifiedLength; j++) {
84
+ result.push({
85
+ modifiedCellIndex: change.modifiedStart + j,
86
+ type: 'insert'
87
+ });
88
+ }
89
+ return result;
90
+ }
91
+
92
+ export { computeDiff };
@@ -243,7 +243,7 @@ let ReplEditor = class ReplEditor extends EditorPane {
243
243
  ...editorOptions,
244
244
  ...editorOptionsOverride,
245
245
  ...{
246
- ariaLabel: ( localize(12127, "REPL Input")),
246
+ ariaLabel: ( localize(12192, "REPL Input")),
247
247
  glyphMargin: true,
248
248
  padding: {
249
249
  top: INPUT_EDITOR_PADDING,
@@ -23,7 +23,7 @@ import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscod
23
23
  import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
24
24
 
25
25
  var ReplEditorInput_1;
26
- const replTabIcon = registerIcon("repl-editor-label-icon", Codicon.debugLineByLine, ( localize(12141, "Icon of the REPL editor label.")));
26
+ const replTabIcon = registerIcon("repl-editor-label-icon", Codicon.debugLineByLine, ( localize(12206, "Icon of the REPL editor label.")));
27
27
  let ReplEditorInput = class ReplEditorInput extends NotebookEditorInput {
28
28
  static {
29
29
  ReplEditorInput_1 = this;
@@ -1,152 +0,0 @@
1
- import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
2
- import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
- import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
- import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
5
- import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service";
6
- import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
7
- import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
8
- import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
9
- import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
10
- import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
11
- import { IChatAgentAttachmentCapabilities } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents";
12
- import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service";
13
- import { IChatNewSessionRequest, IChatSession, IChatSessionContentProvider, IChatSessionItem, IChatSessionItemController, IChatSessionItemsDelta, IChatSessionOptionsChangeEvent, IChatSessionProviderOptionGroup, IChatSessionProviderOptionItem, IChatSessionRequestHistoryItem, IChatSessionsExtensionPoint, ReadonlyChatSessionOptionsMap, ResolvedChatSessionsExtensionPoint } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
14
- import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
15
- import { IChatModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel";
16
- import { Target } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes";
17
- export declare class ChatSessionsService extends Disposable implements IChatSessionsService {
18
- private readonly _logService;
19
- private readonly _chatAgentService;
20
- private readonly _extensionService;
21
- private readonly _contextKeyService;
22
- private readonly _menuService;
23
- private readonly _themeService;
24
- private readonly _labelService;
25
- readonly _serviceBrand: undefined;
26
- private readonly _itemControllers;
27
- private readonly _contributions;
28
- private readonly _contributionDisposables;
29
- private readonly _contentProviders;
30
- private readonly _alternativeIdMap;
31
- private readonly _contextKeys;
32
- private readonly _onDidChangeItemsProviders;
33
- readonly onDidChangeItemsProviders: Event<{
34
- readonly chatSessionType: string;
35
- }>;
36
- private readonly _onDidChangeSessionItems;
37
- readonly onDidChangeSessionItems: Event<IChatSessionItemsDelta>;
38
- private readonly _onDidChangeAvailability;
39
- readonly onDidChangeAvailability: Event<void>;
40
- private readonly _onDidChangeInProgress;
41
- get onDidChangeInProgress(): Event<void>;
42
- private readonly _onDidChangeContentProviderSchemes;
43
- get onDidChangeContentProviderSchemes(): Event<{
44
- readonly added: string[];
45
- readonly removed: string[];
46
- }>;
47
- private readonly _onDidChangeSessionOptions;
48
- get onDidChangeSessionOptions(): Event<IChatSessionOptionsChangeEvent>;
49
- private readonly _onDidChangeOptionGroups;
50
- get onDidChangeOptionGroups(): Event<string>;
51
- private readonly inProgressMap;
52
- private readonly _sessionTypeOptions;
53
- private readonly _sessionTypeNewSessionOptions;
54
- private readonly _sessions;
55
- private readonly _resourceAliases;
56
- private readonly _hasCanDelegateProvidersKey;
57
- constructor(_logService: ILogService, _chatAgentService: IChatAgentService, _extensionService: IExtensionService, _contextKeyService: IContextKeyService, _menuService: IMenuService, _themeService: IThemeService, _labelService: ILabelService);
58
- private reportInProgress;
59
- getInProgress(): {
60
- chatSessionType: string;
61
- count: number;
62
- }[];
63
- private updateInProgressStatus;
64
- private registerContribution;
65
- private _isContributionAvailable;
66
- /**
67
- * Resolves a session type to its primary type, checking for alternative IDs.
68
- * @param sessionType The session type or alternative ID to resolve
69
- * @returns The primary session type, or undefined if not found or not available
70
- */
71
- private _resolveToPrimaryType;
72
- private _registerMenuItems;
73
- private _registerCommands;
74
- private _evaluateAvailability;
75
- private _enableContribution;
76
- /**
77
- * Disposes of all sessions that belong to a contribution
78
- *
79
- * @returns List of session resources that were disposed.
80
- */
81
- private _disposeSessionsForContribution;
82
- private _registerAgent;
83
- getAllChatSessionContributions(): ResolvedChatSessionsExtensionPoint[];
84
- private _updateHasCanDelegateProvidersContextKey;
85
- getChatSessionContribution(chatSessionType: string): ResolvedChatSessionsExtensionPoint | undefined;
86
- private resolveChatSessionContribution;
87
- private getContributionIcon;
88
- private resolveIconForCurrentColorTheme;
89
- registerChatSessionContribution(contribution: IChatSessionsExtensionPoint): IDisposable;
90
- activateChatSessionItemProvider(chatViewType: string): Promise<void>;
91
- private doActivateChatSessionItemController;
92
- canResolveChatSession(sessionType: string): Promise<boolean>;
93
- private tryActivateControllers;
94
- getChatSessionItems(providersToResolve: readonly string[] | undefined, token: CancellationToken): AsyncIterable<{
95
- readonly chatSessionType: string;
96
- readonly items: readonly IChatSessionItem[];
97
- }>;
98
- refreshChatSessionItems(providersToResolve: readonly string[] | undefined, token: CancellationToken): Promise<void>;
99
- getRegisteredChatSessionItemProviders(): readonly string[];
100
- registerChatSessionItemController(chatSessionType: string, controller: IChatSessionItemController): IDisposable;
101
- registerChatSessionContentProvider(chatSessionType: string, provider: IChatSessionContentProvider): IDisposable;
102
- getInProgressSessionDescription(chatModel: IChatModel): string | undefined;
103
- createNewChatSessionItem(chatSessionType: string, request: IChatNewSessionRequest, token: CancellationToken): Promise<IChatSessionItem | undefined>;
104
- getOrCreateChatSession(sessionResource: URI, token: CancellationToken): Promise<IChatSession>;
105
- hasAnySessionOptions(sessionResource: URI): boolean;
106
- getSessionOptions(sessionResource: URI): Map<string, string> | undefined;
107
- getSessionOption(sessionResource: URI, optionId: string): string | IChatSessionProviderOptionItem | undefined;
108
- setSessionOption(sessionResource: URI, optionId: string, value: string | IChatSessionProviderOptionItem): boolean;
109
- updateSessionOptions(sessionResource: URI, updates: ReadonlyChatSessionOptionsMap): boolean;
110
- /**
111
- * Resolve a resource through the alias map. If the resource is a real
112
- * resource that has been aliased to an untitled resource, return the
113
- * untitled resource (the canonical key in {@link _sessions}).
114
- */
115
- private _resolveResource;
116
- registerSessionResourceAlias(untitledResource: URI, realResource: URI): void;
117
- /**
118
- * Store option groups for a session type
119
- */
120
- setOptionGroupsForSessionType(chatSessionType: string, handle: number, optionGroups?: IChatSessionProviderOptionGroup[]): void;
121
- /**
122
- * Get available option groups for a session type
123
- */
124
- getOptionGroupsForSessionType(chatSessionType: string): IChatSessionProviderOptionGroup[] | undefined;
125
- getNewSessionOptionsForSessionType(chatSessionType: string): ReadonlyChatSessionOptionsMap | undefined;
126
- setNewSessionOptionsForSessionType(chatSessionType: string, options: ReadonlyChatSessionOptionsMap): void;
127
- /**
128
- * Get the capabilities for a specific session type
129
- */
130
- getCapabilitiesForSessionType(chatSessionType: string): IChatAgentAttachmentCapabilities | undefined;
131
- /**
132
- * Get the customAgentTarget for a specific session type.
133
- * When set, the mode picker should show filtered custom agents matching this target.
134
- */
135
- getCustomAgentTargetForSessionType(chatSessionType: string): Target;
136
- requiresCustomModelsForSessionType(chatSessionType: string): boolean;
137
- supportsDelegationForSessionType(chatSessionType: string): boolean;
138
- sessionSupportsFork(sessionResource: URI): boolean;
139
- forkChatSession(sessionResource: URI, request: IChatSessionRequestHistoryItem | undefined, token: CancellationToken): Promise<IChatSessionItem>;
140
- getContentProviderSchemes(): string[];
141
- }
142
- export declare enum ChatSessionPosition {
143
- Editor = "editor",
144
- Sidebar = "sidebar"
145
- }
146
- export type NewChatSessionOpenOptions = {
147
- readonly type: string;
148
- readonly position: ChatSessionPosition;
149
- readonly displayName: string;
150
- readonly replaceEditor?: boolean;
151
- };
152
- export declare function getResourceForNewChatSession(options: NewChatSessionOpenOptions): URI;