@openclaw/diffs 2026.9.4 → 2026.9.6
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.
- package/README.md +2 -1
- package/assets/activity.svg +3 -0
- package/assets/icon.png +0 -0
- package/dist/{browser.runtime-DTKAejqd.js → .setup/browser.runtime-VjaO3wrj.mjs} +1 -1
- package/dist/assets/viewer-runtime.js +50 -56
- package/dist/index.js +44 -18
- package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +117 -70
- package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/CodeView.js +197 -65
- package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/File.d.ts +81 -29
- package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/File.js +244 -66
- package/node_modules/@pierre/diffs/dist/components/File.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +109 -57
- package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileDiff.js +445 -112
- package/node_modules/@pierre/diffs/dist/components/FileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileStream.js +1 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts +3 -3
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js +4 -3
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +18 -14
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +153 -62
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +17 -16
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +197 -105
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/Virtualizer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts +1 -2
- package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/web-components.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/web-components.js +2 -1
- package/node_modules/@pierre/diffs/dist/components/web-components.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/constants.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/edit/index.d.ts +7 -4
- package/node_modules/@pierre/diffs/dist/edit/index.js +5 -1
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts +55 -0
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.js +135 -0
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts +6 -0
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.js +16 -0
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/command.d.ts +2 -1
- package/node_modules/@pierre/diffs/dist/editor/command.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts +77 -0
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.js +365 -0
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts +19 -41
- package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editStack.js +67 -4
- package/node_modules/@pierre/diffs/dist/editor/editStack.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor.d.ts +117 -32
- package/node_modules/@pierre/diffs/dist/editor/editor.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor.js +1125 -396
- package/node_modules/@pierre/diffs/dist/editor/editor.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor2.js +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor2.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.d.ts +3 -4
- package/node_modules/@pierre/diffs/dist/editor/languages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.js +1 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts +3 -4
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js +18 -8
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/marker.d.ts +2 -3
- package/node_modules/@pierre/diffs/dist/editor/marker.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/marker.js +5 -3
- package/node_modules/@pierre/diffs/dist/editor/marker.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts +2 -3
- package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/matchBrackets.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts +1 -2
- package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/pieceTable.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/platform.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/editor/platform.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/platform.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/popover.d.ts +12 -12
- package/node_modules/@pierre/diffs/dist/editor/popover.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/popover.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts +2 -3
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.js +17 -13
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.d.ts +32 -24
- package/node_modules/@pierre/diffs/dist/editor/selection.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.js +3 -3
- package/node_modules/@pierre/diffs/dist/editor/selection.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts +3 -4
- package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selectionAction.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts +11 -9
- package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocument.js +28 -5
- package/node_modules/@pierre/diffs/dist/editor/textDocument.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts +14 -0
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.js +12 -0
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts +5 -0
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.js +10 -0
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts +2 -12
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.js +8 -4
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/types.d.ts +266 -0
- package/node_modules/@pierre/diffs/dist/editor/types.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/editor/types.js +0 -0
- package/node_modules/@pierre/diffs/dist/editor/utils.d.ts +2 -1
- package/node_modules/@pierre/diffs/dist/editor/utils.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/utils.js +15 -8
- package/node_modules/@pierre/diffs/dist/editor/utils.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/cleanUpResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts +7 -8
- package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.js +7 -3
- package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.js +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/cleanUpResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomCSSVariableTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/index.d.ts +9 -6
- package/node_modules/@pierre/diffs/dist/index.js +22 -21
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts +2 -26
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js +8 -3
- package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts +1 -4
- package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/ScrollSyncManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts +45 -26
- package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/CodeView.js +52 -45
- package/node_modules/@pierre/diffs/dist/react/CodeView.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts +8 -14
- package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/EditContext.js +2 -9
- package/node_modules/@pierre/diffs/dist/react/EditContext.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/File.d.ts +5 -23
- package/node_modules/@pierre/diffs/dist/react/File.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/File.js +19 -14
- package/node_modules/@pierre/diffs/dist/react/File.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts +5 -22
- package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/FileDiff.js +19 -14
- package/node_modules/@pierre/diffs/dist/react/FileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts +3 -23
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js +19 -22
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts +2 -21
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.js +19 -14
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts +4 -21
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js +15 -14
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts +1 -9
- package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/Virtualizer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts +2 -6
- package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/constants.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/react/constants.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/index.d.ts +8 -5
- package/node_modules/@pierre/diffs/dist/react/jsx.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/react/jsx.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/types.d.ts +47 -10
- package/node_modules/@pierre/diffs/dist/react/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts +6 -0
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js +9 -0
- package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts +11 -24
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js +2 -2
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts +11 -21
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js +2 -2
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts +16 -20
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js +126 -22
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts +11 -19
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js +88 -25
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useStableCallback.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts +1 -12
- package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts +34 -24
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +188 -118
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +28 -11
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +141 -67
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts +5 -11
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.js +2 -2
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/stream.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.js +2 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/sprite.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts +1 -8
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js +8 -3
- package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/index.d.ts +2 -2
- package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts +19 -47
- package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts +5 -10
- package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts +3 -7
- package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/string-import.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/style.js +1 -1
- package/node_modules/@pierre/diffs/dist/style.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/types.d.ts +13 -264
- package/node_modules/@pierre/diffs/dist/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/appendItems.d.ts +5 -0
- package/node_modules/@pierre/diffs/dist/utils/appendItems.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/appendItems.js +8 -0
- package/node_modules/@pierre/diffs/dist/utils/appendItems.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.js +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts +6 -0
- package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.js +8 -0
- package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts +1 -2
- package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areObjectsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts +4 -3
- package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts +3 -3
- package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js +8 -5
- package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.d.ts +6 -0
- package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.js +10 -0
- package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js +9 -8
- package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createAnnotationWrapperNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts +1 -6
- package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createRowNodes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts +1 -10
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.js +12 -10
- package/node_modules/@pierre/diffs/dist/utils/createSeparator.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js +2 -1
- package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createUnsafeCSSStyleNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts +1 -9
- package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js +5 -3
- package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/detachString.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts +68 -0
- package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.js +64 -0
- package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts +5 -4
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js +7 -5
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts +1 -2
- package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts +1 -2
- package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts +1 -6
- package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineEndingType.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts +1 -7
- package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts +2 -12
- package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js +2 -1
- package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isStyleNode.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/isWorkerContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts +1 -10
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js +5 -3
- package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts +15 -0
- package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.js +17 -0
- package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.js.map +1 -0
- package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts +2 -13
- package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts +2 -3
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +8 -7
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts +6 -4
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +42 -14
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/platform.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/prefersReducedMotion.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/prerenderHTMLIfNecessary.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts +1 -8
- package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js +6 -5
- package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js +7 -4
- package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/roundToDevicePixel.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js +2 -1
- package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts +1 -11
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js +1 -3
- package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/splitFileContents.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.js +3 -2
- package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.js +1 -1
- package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts +10 -55
- package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js +1 -1
- package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts +6 -20
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +52 -11
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/types.d.ts +5 -1
- package/node_modules/@pierre/diffs/dist/worker/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker-portable.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker-portable.js +125 -358
- package/node_modules/@pierre/diffs/dist/worker/worker-portable.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/worker/worker.js +28 -17
- package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
- package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/cjs/deserialize.js +12 -2
- package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/cjs/serialize.js +5 -1
- package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/esm/deserialize.js +12 -2
- package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/esm/serialize.js +5 -1
- package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/package.json +1 -1
- package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/structured-json.js +1 -1
- package/node_modules/@pierre/diffs/package.json +12 -5
- package/node_modules/playwright-core/browsers.json +9 -32
- package/node_modules/playwright-core/lib/coreBundle.js +5402 -4419
- package/node_modules/playwright-core/lib/server/electron/loader.js +0 -2
- package/node_modules/playwright-core/lib/serverRegistry.js +1674 -7082
- package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +8 -297
- package/node_modules/playwright-core/lib/tools/cli-client/help.json +19 -6
- package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +1 -1
- package/node_modules/playwright-core/lib/tools/cli-client/output.js +9 -1
- package/node_modules/playwright-core/lib/tools/cli-client/program.js +17 -3
- package/node_modules/playwright-core/lib/tools/cli-client/registry.js +9 -5
- package/node_modules/playwright-core/lib/tools/cli-client/session.js +2 -1
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +5 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +1 -1
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +4 -11
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +6 -2
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +2 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +2 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +6 -3
- package/node_modules/playwright-core/lib/tools/utils/extension.js +13 -2
- package/node_modules/playwright-core/lib/utilsBundle.js +1934 -7341
- package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +8 -297
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/{recorder/assets/codeMirrorModule-CwYYHbcZ.js → dashboard/assets/codeMirrorModule-CQ8RZGBm.js} +1 -1
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
- package/node_modules/playwright-core/lib/vite/dashboard/index.html +2 -2
- package/node_modules/playwright-core/lib/vite/htmlReport/report.css +1 -1
- package/node_modules/playwright-core/lib/vite/htmlReport/report.js +4 -4
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CVQWJZAA.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-hrlLqLtq.js +129 -0
- package/node_modules/playwright-core/lib/vite/recorder/index.html +2 -2
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/{codeMirrorModule-rXmQmLUY.js → codeMirrorModule-BbkfBe3n.js} +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-Ds6CBOo0.js +182 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/{xtermModule-BuZfJS5v.js → xtermModule-DywYcAf8.js} +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.Bqk9acqE.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.B4cLoZK3.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.html +3 -3
- package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +3 -3
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CU5KtEkS.js +5 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/{uiMode.C7UW1sC9.css → uiMode.CyMfwkXJ.css} +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +4 -4
- package/node_modules/playwright-core/package.json +1 -1
- package/node_modules/playwright-core/types/protocol.d.ts +201 -398
- package/node_modules/playwright-core/types/types.d.ts +771 -327
- package/node_modules/typebox/build/compile/validator.d.mts +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
- package/node_modules/typebox/build/format/iri.mjs +5 -1
- package/node_modules/typebox/build/guard/emit.mjs +2 -4
- package/node_modules/typebox/build/guard/guard.mjs +6 -18
- package/node_modules/typebox/build/guard/string.mjs +16 -24
- package/node_modules/typebox/build/schema/build.mjs +2 -2
- package/node_modules/typebox/build/schema/check.mjs +1 -1
- package/node_modules/typebox/build/schema/compile.d.mts +3 -2
- package/node_modules/typebox/build/schema/compile.mjs +8 -8
- package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
- package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
- package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
- package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
- package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
- package/node_modules/typebox/build/schema/errors.d.mts +2 -2
- package/node_modules/typebox/build/schema/errors.mjs +8 -14
- package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
- package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
- package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
- package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
- package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
- package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
- package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
- package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
- package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
- package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
- package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
- package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
- package/node_modules/typebox/build/schema/parse.d.mts +1 -0
- package/node_modules/typebox/build/schema/parse.mjs +10 -5
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
- package/node_modules/typebox/build/schema/schema.d.mts +2 -0
- package/node_modules/typebox/build/schema/schema.mjs +2 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
- package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +59 -89
- package/node_modules/zod/README.md +29 -2
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +21 -2
- package/node_modules/zod/index.d.cts +1 -2
- package/node_modules/zod/index.d.ts +1 -2
- package/node_modules/zod/index.js +5 -2
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +20 -8
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +5 -2
- package/node_modules/zod/src/v3/ZodError.ts +22 -12
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
- package/node_modules/zod/src/v3/types.ts +5 -5
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/compat.ts +26 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +59 -44
- package/node_modules/zod/src/v4/classic/external.ts +14 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +10 -4
- package/node_modules/zod/src/v4/classic/schemas.ts +640 -375
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +186 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +85 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +222 -6
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1812 -204
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +87 -35
- package/node_modules/zod/src/v4/core/checks.ts +119 -146
- package/node_modules/zod/src/v4/core/compile.ts +2313 -0
- package/node_modules/zod/src/v4/core/core.ts +99 -22
- package/node_modules/zod/src/v4/core/doc.ts +17 -9
- package/node_modules/zod/src/v4/core/errors.ts +113 -25
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +424 -156
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +164 -50
- package/node_modules/zod/src/v4/core/regexes.ts +42 -15
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +1000 -538
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +283 -48
- package/node_modules/zod/src/v4/core/util.ts +454 -157
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +5 -0
- package/node_modules/zod/src/v4/locales/az.ts +5 -0
- package/node_modules/zod/src/v4/locales/be.ts +12 -0
- package/node_modules/zod/src/v4/locales/bg.ts +5 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +5 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +5 -0
- package/node_modules/zod/src/v4/locales/da.ts +7 -2
- package/node_modules/zod/src/v4/locales/de.ts +5 -0
- package/node_modules/zod/src/v4/locales/el.ts +3 -0
- package/node_modules/zod/src/v4/locales/en.ts +17 -4
- package/node_modules/zod/src/v4/locales/eo.ts +5 -0
- package/node_modules/zod/src/v4/locales/es.ts +4 -0
- package/node_modules/zod/src/v4/locales/fa.ts +5 -0
- package/node_modules/zod/src/v4/locales/fi.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr.ts +21 -14
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +8 -1
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +4 -0
- package/node_modules/zod/src/v4/locales/hu.ts +5 -0
- package/node_modules/zod/src/v4/locales/hy.ts +11 -0
- package/node_modules/zod/src/v4/locales/id.ts +5 -0
- package/node_modules/zod/src/v4/locales/index.ts +11 -0
- package/node_modules/zod/src/v4/locales/is.ts +5 -0
- package/node_modules/zod/src/v4/locales/it.ts +5 -0
- package/node_modules/zod/src/v4/locales/ja.ts +5 -0
- package/node_modules/zod/src/v4/locales/ka.ts +5 -0
- package/node_modules/zod/src/v4/locales/km.ts +5 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +5 -0
- package/node_modules/zod/src/v4/locales/lt.ts +4 -0
- package/node_modules/zod/src/v4/locales/mk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ms.ts +5 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +5 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +7 -2
- package/node_modules/zod/src/v4/locales/ota.ts +5 -0
- package/node_modules/zod/src/v4/locales/pl.ts +5 -0
- package/node_modules/zod/src/v4/locales/ps.ts +5 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +101 -58
- package/node_modules/zod/src/v4/locales/ro.ts +3 -0
- package/node_modules/zod/src/v4/locales/ru.ts +12 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +5 -0
- package/node_modules/zod/src/v4/locales/sv.ts +7 -2
- package/node_modules/zod/src/v4/locales/ta.ts +5 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +5 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +5 -0
- package/node_modules/zod/src/v4/locales/uk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ur.ts +5 -0
- package/node_modules/zod/src/v4/locales/uz.ts +3 -0
- package/node_modules/zod/src/v4/locales/vi.ts +5 -0
- package/node_modules/zod/src/v4/locales/yo.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +5 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +12 -1
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/parse.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +167 -63
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +158 -5
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +44 -0
- package/node_modules/zod/v3/ZodError.cjs +41 -12
- package/node_modules/zod/v3/ZodError.d.cts +1 -1
- package/node_modules/zod/v3/ZodError.d.ts +1 -1
- package/node_modules/zod/v3/ZodError.js +22 -12
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +26 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +21 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.d.cts +9 -11
- package/node_modules/zod/v4/classic/compat.d.ts +9 -11
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +62 -34
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +43 -34
- package/node_modules/zod/v4/classic/external.cjs +51 -27
- package/node_modules/zod/v4/classic/external.d.cts +5 -2
- package/node_modules/zod/v4/classic/external.d.ts +5 -2
- package/node_modules/zod/v4/classic/external.js +5 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +21 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +30 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/parse.cjs +23 -1
- package/node_modules/zod/v4/classic/parse.d.cts +17 -4
- package/node_modules/zod/v4/classic/parse.d.ts +17 -4
- package/node_modules/zod/v4/classic/parse.js +1 -0
- package/node_modules/zod/v4/classic/schemas.cjs +591 -426
- package/node_modules/zod/v4/classic/schemas.d.cts +68 -19
- package/node_modules/zod/v4/classic/schemas.d.ts +68 -19
- package/node_modules/zod/v4/classic/schemas.js +564 -424
- package/node_modules/zod/v4/core/api.cjs +66 -24
- package/node_modules/zod/v4/core/api.d.cts +22 -12
- package/node_modules/zod/v4/core/api.d.ts +22 -12
- package/node_modules/zod/v4/core/api.js +44 -24
- package/node_modules/zod/v4/core/checks.cjs +88 -128
- package/node_modules/zod/v4/core/checks.d.cts +29 -13
- package/node_modules/zod/v4/core/checks.d.ts +29 -13
- package/node_modules/zod/v4/core/checks.js +68 -127
- package/node_modules/zod/v4/core/compile.cjs +1908 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1858 -0
- package/node_modules/zod/v4/core/core.cjs +101 -19
- package/node_modules/zod/v4/core/core.d.cts +16 -4
- package/node_modules/zod/v4/core/core.d.ts +16 -4
- package/node_modules/zod/v4/core/core.js +83 -20
- package/node_modules/zod/v4/core/doc.cjs +31 -9
- package/node_modules/zod/v4/core/doc.d.cts +3 -1
- package/node_modules/zod/v4/core/doc.d.ts +3 -1
- package/node_modules/zod/v4/core/doc.js +12 -9
- package/node_modules/zod/v4/core/errors.cjs +126 -25
- package/node_modules/zod/v4/core/errors.d.cts +4 -0
- package/node_modules/zod/v4/core/errors.d.ts +4 -0
- package/node_modules/zod/v4/core/errors.js +107 -25
- package/node_modules/zod/v4/core/index.cjs +24 -1
- package/node_modules/zod/v4/core/index.d.cts +3 -0
- package/node_modules/zod/v4/core/index.d.ts +3 -0
- package/node_modules/zod/v4/core/index.js +3 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +400 -158
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
- package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/parse.cjs +148 -46
- package/node_modules/zod/v4/core/parse.d.cts +14 -11
- package/node_modules/zod/v4/core/parse.d.ts +14 -11
- package/node_modules/zod/v4/core/parse.js +127 -45
- package/node_modules/zod/v4/core/regexes.cjs +54 -17
- package/node_modules/zod/v4/core/regexes.d.cts +5 -0
- package/node_modules/zod/v4/core/regexes.d.ts +5 -0
- package/node_modules/zod/v4/core/regexes.js +32 -15
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +785 -386
- package/node_modules/zod/v4/core/schemas.d.cts +123 -34
- package/node_modules/zod/v4/core/schemas.d.ts +123 -34
- package/node_modules/zod/v4/core/schemas.js +753 -386
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
- package/node_modules/zod/v4/core/to-json-schema.d.cts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.d.ts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.js +247 -44
- package/node_modules/zod/v4/core/util.cjs +372 -157
- package/node_modules/zod/v4/core/util.d.cts +79 -1
- package/node_modules/zod/v4/core/util.d.ts +79 -1
- package/node_modules/zod/v4/core/util.js +341 -156
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +34 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +5 -0
- package/node_modules/zod/v4/locales/ar.js +5 -0
- package/node_modules/zod/v4/locales/az.cjs +5 -0
- package/node_modules/zod/v4/locales/az.js +5 -0
- package/node_modules/zod/v4/locales/be.cjs +12 -0
- package/node_modules/zod/v4/locales/be.js +12 -0
- package/node_modules/zod/v4/locales/bg.cjs +5 -0
- package/node_modules/zod/v4/locales/bg.js +5 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +5 -0
- package/node_modules/zod/v4/locales/ca.js +5 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +5 -0
- package/node_modules/zod/v4/locales/cs.js +5 -0
- package/node_modules/zod/v4/locales/da.cjs +7 -2
- package/node_modules/zod/v4/locales/da.js +7 -2
- package/node_modules/zod/v4/locales/de.cjs +5 -0
- package/node_modules/zod/v4/locales/de.js +5 -0
- package/node_modules/zod/v4/locales/el.cjs +3 -0
- package/node_modules/zod/v4/locales/el.js +3 -0
- package/node_modules/zod/v4/locales/en.cjs +16 -4
- package/node_modules/zod/v4/locales/en.js +16 -4
- package/node_modules/zod/v4/locales/eo.cjs +5 -0
- package/node_modules/zod/v4/locales/eo.js +5 -0
- package/node_modules/zod/v4/locales/es.cjs +4 -0
- package/node_modules/zod/v4/locales/es.js +4 -0
- package/node_modules/zod/v4/locales/fa.cjs +5 -0
- package/node_modules/zod/v4/locales/fa.js +5 -0
- package/node_modules/zod/v4/locales/fi.cjs +5 -0
- package/node_modules/zod/v4/locales/fi.js +5 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
- package/node_modules/zod/v4/locales/fr-CA.js +5 -0
- package/node_modules/zod/v4/locales/fr.cjs +18 -14
- package/node_modules/zod/v4/locales/fr.js +18 -14
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +7 -0
- package/node_modules/zod/v4/locales/he.js +7 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +4 -0
- package/node_modules/zod/v4/locales/hr.js +4 -0
- package/node_modules/zod/v4/locales/hu.cjs +5 -0
- package/node_modules/zod/v4/locales/hu.js +5 -0
- package/node_modules/zod/v4/locales/hy.cjs +11 -0
- package/node_modules/zod/v4/locales/hy.js +11 -0
- package/node_modules/zod/v4/locales/id.cjs +5 -0
- package/node_modules/zod/v4/locales/id.js +5 -0
- package/node_modules/zod/v4/locales/index.cjs +43 -2
- package/node_modules/zod/v4/locales/index.d.cts +11 -0
- package/node_modules/zod/v4/locales/index.d.ts +11 -0
- package/node_modules/zod/v4/locales/index.js +11 -0
- package/node_modules/zod/v4/locales/is.cjs +5 -0
- package/node_modules/zod/v4/locales/is.js +5 -0
- package/node_modules/zod/v4/locales/it.cjs +5 -0
- package/node_modules/zod/v4/locales/it.js +5 -0
- package/node_modules/zod/v4/locales/ja.cjs +5 -0
- package/node_modules/zod/v4/locales/ja.js +5 -0
- package/node_modules/zod/v4/locales/ka.cjs +5 -0
- package/node_modules/zod/v4/locales/ka.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +5 -0
- package/node_modules/zod/v4/locales/km.js +5 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +5 -0
- package/node_modules/zod/v4/locales/ko.js +5 -0
- package/node_modules/zod/v4/locales/lt.cjs +4 -0
- package/node_modules/zod/v4/locales/lt.js +4 -0
- package/node_modules/zod/v4/locales/mk.cjs +5 -0
- package/node_modules/zod/v4/locales/mk.js +5 -0
- package/node_modules/zod/v4/locales/ms.cjs +5 -0
- package/node_modules/zod/v4/locales/ms.js +5 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +5 -0
- package/node_modules/zod/v4/locales/nl.js +5 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +7 -2
- package/node_modules/zod/v4/locales/no.js +7 -2
- package/node_modules/zod/v4/locales/ota.cjs +5 -0
- package/node_modules/zod/v4/locales/ota.js +5 -0
- package/node_modules/zod/v4/locales/pl.cjs +5 -0
- package/node_modules/zod/v4/locales/pl.js +5 -0
- package/node_modules/zod/v4/locales/ps.cjs +5 -0
- package/node_modules/zod/v4/locales/ps.js +5 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +89 -55
- package/node_modules/zod/v4/locales/pt.js +89 -55
- package/node_modules/zod/v4/locales/ro.cjs +3 -0
- package/node_modules/zod/v4/locales/ro.js +3 -0
- package/node_modules/zod/v4/locales/ru.cjs +12 -0
- package/node_modules/zod/v4/locales/ru.js +12 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +5 -0
- package/node_modules/zod/v4/locales/sl.js +5 -0
- package/node_modules/zod/v4/locales/sv.cjs +7 -2
- package/node_modules/zod/v4/locales/sv.js +7 -2
- package/node_modules/zod/v4/locales/ta.cjs +5 -0
- package/node_modules/zod/v4/locales/ta.js +5 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +5 -0
- package/node_modules/zod/v4/locales/th.js +5 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +5 -0
- package/node_modules/zod/v4/locales/tr.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +5 -0
- package/node_modules/zod/v4/locales/uk.js +5 -0
- package/node_modules/zod/v4/locales/ur.cjs +5 -0
- package/node_modules/zod/v4/locales/ur.js +5 -0
- package/node_modules/zod/v4/locales/uz.cjs +3 -0
- package/node_modules/zod/v4/locales/uz.js +3 -0
- package/node_modules/zod/v4/locales/vi.cjs +5 -0
- package/node_modules/zod/v4/locales/vi.js +5 -0
- package/node_modules/zod/v4/locales/yo.cjs +5 -0
- package/node_modules/zod/v4/locales/yo.js +5 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-CN.js +5 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-TW.js +5 -0
- package/node_modules/zod/v4/mini/checks.cjs +21 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +33 -1
- package/node_modules/zod/v4/mini/external.d.cts +5 -2
- package/node_modules/zod/v4/mini/external.d.ts +5 -2
- package/node_modules/zod/v4/mini/external.js +3 -1
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +22 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +117 -53
- package/node_modules/zod/v4/mini/schemas.d.cts +49 -14
- package/node_modules/zod/v4/mini/schemas.d.ts +49 -14
- package/node_modules/zod/v4/mini/schemas.js +92 -51
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +19 -3
- package/package.json +10 -8
- package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts +0 -15
- package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts.map +0 -1
- package/node_modules/@pierre/diffs/dist/editor/stateStorage.js +0 -65
- package/node_modules/@pierre/diffs/dist/editor/stateStorage.js.map +0 -1
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +0 -11
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +0 -1
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-DYjdXIbE.js +0 -129
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +0 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-B-dXF5JN.js +0 -181
- package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +0 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/index.KZ4wOW1K.js +0 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Dzuouizj.js +0 -5
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{viewer-assets-D3qrnaxI.js → .setup/viewer-assets-D3qrnaxI.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editPrediction.d.ts","names":[],"sources":["../../src/editor/editPrediction.ts"],"mappings":";;;UAGiB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;aAA0B;aAAwB;;;WAElD,aAAa;;aAEX;;aAEA;;;UAII;;WAEN,QAAQ;;UAGF;;WAEN,gBAAgB;;WAEhB,WAAW;;UAGL;;EAEf,UACE,SAAS,oBACT,SAAS,uBACN,QAAQ;;UAGE;WACN;WACA;WACA;WACA;WACA;WACA;WACA,WAAW;;UAGZ;WACC;WACA;WACA;EACT,WAAW,iBAAiB;EAC5B,YAAY,6BAA6B;EACzC,SAAS,UAAU;EACnB,YAAY;EACZ,cAAc;EACd,aAAa,eAAe;EAC5B,OAAO;;UAGC;WACC;WACA;WACA;WACA;WACA;;iBAmTK,qBACd,kBAAkB,+BAClB,cACA,UAAU,wBACV,aAAa,+BACb,+BACA,cACC;iBAwLa,2BACd,cACA,UAAU,wBACV,sBACA,kBAAkB,+BAClB,iBAAiB,2BAChB;iBAmKa,6BACd,cACA,kBAAkB"}
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
//#region src/editor/editPrediction.ts
|
|
2
|
+
const EDITABLE_TOKENS = 350;
|
|
3
|
+
const CONTEXT_TOKENS = 150;
|
|
4
|
+
const MAX_EDITABLE_TOKENS = 512;
|
|
5
|
+
const MAX_CONTEXT_TOKENS = 662;
|
|
6
|
+
const MAX_REQUEST_BYTES = 131072;
|
|
7
|
+
const MAX_CAPTURE_BYTES = 6144;
|
|
8
|
+
const COALESCE_MS = 1e3;
|
|
9
|
+
const COALESCE_LINES = 8;
|
|
10
|
+
const DIFF_CONTEXT_LINES = 3;
|
|
11
|
+
const CAPTURE_CONTEXT_OPTIONS = [11, DIFF_CONTEXT_LINES];
|
|
12
|
+
const textEncoder = new TextEncoder();
|
|
13
|
+
function lineStarts(text) {
|
|
14
|
+
const starts = [0];
|
|
15
|
+
for (let index = 0; index < text.length; index++) {
|
|
16
|
+
if (text.charCodeAt(index) === 13 && text.charCodeAt(index + 1) === 10) index++;
|
|
17
|
+
if (text.charCodeAt(index) === 10 || text.charCodeAt(index) === 13) starts.push(index + 1);
|
|
18
|
+
}
|
|
19
|
+
return starts;
|
|
20
|
+
}
|
|
21
|
+
function diffLineCount(text, starts) {
|
|
22
|
+
if (text.length === 0) return 0;
|
|
23
|
+
return starts.at(-1) === text.length ? starts.length - 1 : starts.length;
|
|
24
|
+
}
|
|
25
|
+
function lineEnd(text, starts, line) {
|
|
26
|
+
const next = starts[line + 1];
|
|
27
|
+
return next === void 0 ? text.length : next - (text.charCodeAt(next - 1) === 10 && text.charCodeAt(next - 2) === 13 ? 2 : 1);
|
|
28
|
+
}
|
|
29
|
+
function linesEqual(left, leftStarts, leftLine, right, rightStarts, rightLine) {
|
|
30
|
+
const leftStart = leftStarts[leftLine];
|
|
31
|
+
const rightStart = rightStarts[rightLine];
|
|
32
|
+
const length = lineEnd(left, leftStarts, leftLine) - leftStart;
|
|
33
|
+
if (length !== lineEnd(right, rightStarts, rightLine) - rightStart) return false;
|
|
34
|
+
for (let index = 0; index < length; index++) if (left.charCodeAt(leftStart + index) !== right.charCodeAt(rightStart + index)) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
function lineDiffBounds(oldText, oldStarts, newText, newStarts) {
|
|
38
|
+
const oldLineCount = diffLineCount(oldText, oldStarts);
|
|
39
|
+
const newLineCount = diffLineCount(newText, newStarts);
|
|
40
|
+
let prefixLines = 0;
|
|
41
|
+
while (prefixLines < oldLineCount && prefixLines < newLineCount) {
|
|
42
|
+
if (!linesEqual(oldText, oldStarts, prefixLines, newText, newStarts, prefixLines)) break;
|
|
43
|
+
prefixLines++;
|
|
44
|
+
}
|
|
45
|
+
let suffixLines = 0;
|
|
46
|
+
while (suffixLines < oldLineCount - prefixLines && suffixLines < newLineCount - prefixLines) {
|
|
47
|
+
if (!linesEqual(oldText, oldStarts, oldLineCount - 1 - suffixLines, newText, newStarts, newLineCount - 1 - suffixLines)) break;
|
|
48
|
+
suffixLines++;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
oldLineCount,
|
|
52
|
+
newLineCount,
|
|
53
|
+
prefixLines,
|
|
54
|
+
suffixLines
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function formatEditHunk(path, oldText, newText, lineOffset = 0) {
|
|
58
|
+
if (oldText === newText) return;
|
|
59
|
+
const oldStarts = lineStarts(oldText);
|
|
60
|
+
const newStarts = lineStarts(newText);
|
|
61
|
+
const bounds = lineDiffBounds(oldText, oldStarts, newText, newStarts);
|
|
62
|
+
if (bounds.prefixLines === bounds.oldLineCount && bounds.prefixLines === bounds.newLineCount) return;
|
|
63
|
+
const oldChangedEnd = bounds.oldLineCount - bounds.suffixLines;
|
|
64
|
+
const newChangedEnd = bounds.newLineCount - bounds.suffixLines;
|
|
65
|
+
const oldChanged = oldText.slice(oldStarts[bounds.prefixLines] ?? oldText.length, oldStarts[oldChangedEnd] ?? oldText.length);
|
|
66
|
+
const newChanged = newText.slice(newStarts[bounds.prefixLines] ?? newText.length, newStarts[newChangedEnd] ?? newText.length);
|
|
67
|
+
if (textEncoder.encode(oldChanged).byteLength > MAX_CAPTURE_BYTES || textEncoder.encode(newChanged).byteLength > MAX_CAPTURE_BYTES) return;
|
|
68
|
+
const start = Math.max(0, bounds.prefixLines - DIFF_CONTEXT_LINES);
|
|
69
|
+
const oldEnd = Math.min(bounds.oldLineCount, oldChangedEnd + DIFF_CONTEXT_LINES);
|
|
70
|
+
const newEnd = Math.min(bounds.newLineCount, newChangedEnd + DIFF_CONTEXT_LINES);
|
|
71
|
+
const oldCount = oldEnd - start;
|
|
72
|
+
const newCount = newEnd - start;
|
|
73
|
+
const line = start + lineOffset;
|
|
74
|
+
const output = [
|
|
75
|
+
`--- a/${path}`,
|
|
76
|
+
`+++ b/${path}`,
|
|
77
|
+
`@@ -${oldCount === 0 ? line : line + 1},${oldCount} +${newCount === 0 ? line : line + 1},${newCount} @@`
|
|
78
|
+
];
|
|
79
|
+
for (let line = start; line < bounds.prefixLines; line++) output.push(` ${oldText.slice(oldStarts[line], lineEnd(oldText, oldStarts, line))}`);
|
|
80
|
+
for (let line = bounds.prefixLines; line < oldChangedEnd; line++) output.push(`-${oldText.slice(oldStarts[line], lineEnd(oldText, oldStarts, line))}`);
|
|
81
|
+
for (let line = bounds.prefixLines; line < newChangedEnd; line++) output.push(`+${newText.slice(newStarts[line], lineEnd(newText, newStarts, line))}`);
|
|
82
|
+
for (let line = oldChangedEnd; line < oldEnd; line++) output.push(` ${oldText.slice(oldStarts[line], lineEnd(oldText, oldStarts, line))}`);
|
|
83
|
+
const hunk = output.join("\n");
|
|
84
|
+
return textEncoder.encode(hunk).byteLength <= MAX_CAPTURE_BYTES ? {
|
|
85
|
+
hunk,
|
|
86
|
+
bounds
|
|
87
|
+
} : void 0;
|
|
88
|
+
}
|
|
89
|
+
function applyEditsToSlice(text, sliceStart, edits) {
|
|
90
|
+
const chunks = [];
|
|
91
|
+
let offset = 0;
|
|
92
|
+
for (const edit of edits) {
|
|
93
|
+
const start = edit.start - sliceStart;
|
|
94
|
+
const end = edit.end - sliceStart;
|
|
95
|
+
if (start < offset || end < start || end > text.length) return;
|
|
96
|
+
chunks.push(text.slice(offset, start), edit.text);
|
|
97
|
+
offset = end;
|
|
98
|
+
}
|
|
99
|
+
chunks.push(text.slice(offset));
|
|
100
|
+
return chunks.join("");
|
|
101
|
+
}
|
|
102
|
+
function captureEditPredictionTransaction(document, transaction) {
|
|
103
|
+
const inverseEdits = transaction.inverseEdits;
|
|
104
|
+
if (inverseEdits.length === 0) return;
|
|
105
|
+
let changedStart = inverseEdits[0].start;
|
|
106
|
+
let changedEnd = inverseEdits[0].end;
|
|
107
|
+
for (let index = 1; index < inverseEdits.length; index++) {
|
|
108
|
+
changedStart = Math.min(changedStart, inverseEdits[index].start);
|
|
109
|
+
changedEnd = Math.max(changedEnd, inverseEdits[index].end);
|
|
110
|
+
}
|
|
111
|
+
const [startPosition, endPosition] = document.positionsAt([changedStart, changedEnd]);
|
|
112
|
+
for (const contextLines of CAPTURE_CONTEXT_OPTIONS) {
|
|
113
|
+
const startLine = Math.max(0, startPosition.line - contextLines);
|
|
114
|
+
const endLine = Math.min(document.lineCount - 1, endPosition.line + contextLines);
|
|
115
|
+
const afterStart = document.offsetAt({
|
|
116
|
+
line: startLine,
|
|
117
|
+
character: 0
|
|
118
|
+
});
|
|
119
|
+
const afterEnd = endLine + 1 < document.lineCount ? document.offsetAt({
|
|
120
|
+
line: endLine + 1,
|
|
121
|
+
character: 0
|
|
122
|
+
}) : document.offsetAt({
|
|
123
|
+
line: endLine,
|
|
124
|
+
character: document.getLineLength(endLine)
|
|
125
|
+
});
|
|
126
|
+
if (afterEnd - afterStart > MAX_CAPTURE_BYTES) continue;
|
|
127
|
+
const afterText = document.getTextSlice(afterStart, afterEnd);
|
|
128
|
+
if (textEncoder.encode(afterText).byteLength > MAX_CAPTURE_BYTES) continue;
|
|
129
|
+
const beforeText = applyEditsToSlice(afterText, afterStart, inverseEdits);
|
|
130
|
+
if (beforeText === void 0 || beforeText.length > MAX_CAPTURE_BYTES || textEncoder.encode(beforeText).byteLength > MAX_CAPTURE_BYTES) continue;
|
|
131
|
+
return {
|
|
132
|
+
beforeText,
|
|
133
|
+
afterText,
|
|
134
|
+
startOffset: afterStart,
|
|
135
|
+
startLine,
|
|
136
|
+
bounds: lineDiffBounds(beforeText, lineStarts(beforeText), afterText, lineStarts(afterText))
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function recordEditPrediction(history, path, document, transaction, source, at = Date.now()) {
|
|
141
|
+
const kept = history.slice(-10);
|
|
142
|
+
const fragment = captureEditPredictionTransaction(document, transaction);
|
|
143
|
+
if (fragment === void 0) {
|
|
144
|
+
const previous = kept.at(-1);
|
|
145
|
+
if (previous?.fragment !== void 0) kept[kept.length - 1] = {
|
|
146
|
+
...previous,
|
|
147
|
+
fragment: void 0
|
|
148
|
+
};
|
|
149
|
+
return kept;
|
|
150
|
+
}
|
|
151
|
+
if (fragment.beforeText === fragment.afterText) return kept;
|
|
152
|
+
const changedStartLine = fragment.startLine + fragment.bounds.prefixLines;
|
|
153
|
+
const beforeChangedEndLine = fragment.startLine + fragment.bounds.oldLineCount - fragment.bounds.suffixLines;
|
|
154
|
+
const last = kept.at(-1);
|
|
155
|
+
const gap = last !== void 0 && changedStartLine > last.end ? changedStartLine - last.end : last !== void 0 && last.start > beforeChangedEndLine ? last.start - beforeChangedEndLine : 0;
|
|
156
|
+
if (last !== void 0 && last.fragment !== void 0 && last.path === path && last.source === source && at - last.at < COALESCE_MS && gap <= COALESCE_LINES) {
|
|
157
|
+
const previous = last.fragment;
|
|
158
|
+
const beforeEnd = fragment.startOffset + fragment.beforeText.length;
|
|
159
|
+
const overlapStart = Math.max(previous.currentStart, fragment.startOffset);
|
|
160
|
+
const overlapEnd = Math.min(previous.currentEnd, beforeEnd);
|
|
161
|
+
if (overlapStart <= overlapEnd && previous.currentText.slice(overlapStart - previous.currentStart, overlapEnd - previous.currentStart) === fragment.beforeText.slice(overlapStart - fragment.startOffset, overlapEnd - fragment.startOffset)) {
|
|
162
|
+
const unionStart = Math.min(previous.currentStart, fragment.startOffset);
|
|
163
|
+
const currentText = previous.currentStart <= fragment.startOffset ? previous.currentText + fragment.beforeText.slice(Math.max(0, previous.currentEnd - fragment.startOffset)) : fragment.beforeText + previous.currentText.slice(Math.max(0, beforeEnd - previous.currentStart));
|
|
164
|
+
const prefix = currentText.slice(0, previous.currentStart - unionStart);
|
|
165
|
+
const suffix = currentText.slice(previous.currentEnd - unionStart);
|
|
166
|
+
const baseText = prefix + previous.baseText + suffix;
|
|
167
|
+
const nextText = applyEditsToSlice(currentText, unionStart, transaction.appliedEdits);
|
|
168
|
+
const startLine = previous.currentStart <= fragment.startOffset ? previous.startLine : fragment.startLine;
|
|
169
|
+
if (nextText !== void 0 && baseText.length <= MAX_CAPTURE_BYTES && nextText.length <= MAX_CAPTURE_BYTES && textEncoder.encode(baseText).byteLength <= MAX_CAPTURE_BYTES && textEncoder.encode(nextText).byteLength <= MAX_CAPTURE_BYTES) {
|
|
170
|
+
if (baseText === nextText) {
|
|
171
|
+
kept.pop();
|
|
172
|
+
return kept;
|
|
173
|
+
}
|
|
174
|
+
const formatted = formatEditHunk(path, baseText, nextText, startLine);
|
|
175
|
+
if (formatted !== void 0) {
|
|
176
|
+
kept[kept.length - 1] = {
|
|
177
|
+
path,
|
|
178
|
+
hunk: formatted.hunk,
|
|
179
|
+
start: startLine + formatted.bounds.prefixLines,
|
|
180
|
+
end: startLine + formatted.bounds.newLineCount - formatted.bounds.suffixLines,
|
|
181
|
+
at,
|
|
182
|
+
source,
|
|
183
|
+
fragment: {
|
|
184
|
+
baseText,
|
|
185
|
+
currentText: nextText,
|
|
186
|
+
currentStart: unionStart,
|
|
187
|
+
currentEnd: unionStart + nextText.length,
|
|
188
|
+
startLine
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
return kept;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const previous = kept.at(-1);
|
|
197
|
+
if (previous?.fragment !== void 0) kept[kept.length - 1] = {
|
|
198
|
+
...previous,
|
|
199
|
+
fragment: void 0
|
|
200
|
+
};
|
|
201
|
+
const formatted = formatEditHunk(path, fragment.beforeText, fragment.afterText, fragment.startLine);
|
|
202
|
+
if (formatted === void 0) return kept;
|
|
203
|
+
kept.push({
|
|
204
|
+
path,
|
|
205
|
+
hunk: formatted.hunk,
|
|
206
|
+
start: changedStartLine,
|
|
207
|
+
end: fragment.startLine + fragment.bounds.newLineCount - fragment.bounds.suffixLines,
|
|
208
|
+
at,
|
|
209
|
+
source,
|
|
210
|
+
fragment: {
|
|
211
|
+
baseText: fragment.beforeText,
|
|
212
|
+
currentText: fragment.afterText,
|
|
213
|
+
currentStart: fragment.startOffset,
|
|
214
|
+
currentEnd: fragment.startOffset + fragment.afterText.length,
|
|
215
|
+
startLine: fragment.startLine
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return kept.slice(-10);
|
|
219
|
+
}
|
|
220
|
+
function expandLinewise(lineCount, costForLine, canExpandTo, first, last, remaining) {
|
|
221
|
+
while (remaining > 0 && (first > 0 || last < lineCount - 1)) {
|
|
222
|
+
let expanded = false;
|
|
223
|
+
if (first > 0 && canExpandTo(first - 1)) {
|
|
224
|
+
const cost = costForLine(first - 1);
|
|
225
|
+
if (cost <= remaining) {
|
|
226
|
+
first--;
|
|
227
|
+
remaining -= cost;
|
|
228
|
+
expanded = true;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (last < lineCount - 1 && canExpandTo(last + 1)) {
|
|
232
|
+
const cost = costForLine(last + 1);
|
|
233
|
+
if (cost <= remaining) {
|
|
234
|
+
last++;
|
|
235
|
+
remaining -= cost;
|
|
236
|
+
expanded = true;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (!expanded) break;
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
first,
|
|
243
|
+
last
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function buildEditPredictionRequest(path, document, cursorOffset, history, isLineEditable) {
|
|
247
|
+
if (document.lineCount <= 0) return;
|
|
248
|
+
const lastLine = document.lineCount - 1;
|
|
249
|
+
const documentLength = document.offsetAt({
|
|
250
|
+
line: lastLine,
|
|
251
|
+
character: document.getLineLength(lastLine)
|
|
252
|
+
});
|
|
253
|
+
let cursor = Math.max(0, Math.min(Number.isFinite(cursorOffset) ? Math.trunc(cursorOffset) : 0, documentLength));
|
|
254
|
+
const previous = document.charAt(cursor - 1).charCodeAt(0);
|
|
255
|
+
const next = document.charAt(cursor).charCodeAt(0);
|
|
256
|
+
if (cursor > 0 && cursor < documentLength && (previous === 13 && next === 10 || previous >= 55296 && previous <= 56319 && next >= 56320 && next <= 57343)) cursor--;
|
|
257
|
+
const cursorLine = document.positionAt(cursor).line;
|
|
258
|
+
const editableLines = /* @__PURE__ */ new Map();
|
|
259
|
+
const canEdit = (line) => {
|
|
260
|
+
if (line < 0 || line >= document.lineCount) return false;
|
|
261
|
+
let editable = editableLines.get(line);
|
|
262
|
+
if (editable == null) {
|
|
263
|
+
editable = isLineEditable(line);
|
|
264
|
+
editableLines.set(line, editable);
|
|
265
|
+
}
|
|
266
|
+
return editable;
|
|
267
|
+
};
|
|
268
|
+
if (!canEdit(cursorLine)) return;
|
|
269
|
+
const tokenCosts = /* @__PURE__ */ new Map();
|
|
270
|
+
const costForLine = (line) => {
|
|
271
|
+
const cached = tokenCosts.get(line);
|
|
272
|
+
if (cached !== void 0) return cached;
|
|
273
|
+
const lineLength = document.getLineLength(line);
|
|
274
|
+
if (Math.floor(lineLength / 3) > MAX_CONTEXT_TOKENS) {
|
|
275
|
+
const cost = 663;
|
|
276
|
+
tokenCosts.set(line, cost);
|
|
277
|
+
return cost;
|
|
278
|
+
}
|
|
279
|
+
const cost = Math.max(1, Math.floor(textEncoder.encode(document.getLineText(line)).byteLength / 3));
|
|
280
|
+
tokenCosts.set(line, cost);
|
|
281
|
+
return cost;
|
|
282
|
+
};
|
|
283
|
+
let editableFirst = cursorLine;
|
|
284
|
+
let editableLast = cursorLine;
|
|
285
|
+
let remaining = Math.max(0, Math.floor(EDITABLE_TOKENS * 3 / 4) - costForLine(cursorLine));
|
|
286
|
+
while (remaining > 0 && (canEdit(editableFirst - 1) || canEdit(editableLast + 1))) {
|
|
287
|
+
if (canEdit(editableLast + 1)) {
|
|
288
|
+
const cost = costForLine(editableLast + 1);
|
|
289
|
+
if (cost > remaining) break;
|
|
290
|
+
editableLast++;
|
|
291
|
+
remaining -= cost;
|
|
292
|
+
}
|
|
293
|
+
if (canEdit(editableFirst - 1) && remaining > 0) {
|
|
294
|
+
const cost = costForLine(editableFirst - 1);
|
|
295
|
+
if (cost > remaining) break;
|
|
296
|
+
editableFirst--;
|
|
297
|
+
remaining -= cost;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
remaining += 88;
|
|
301
|
+
({first: editableFirst, last: editableLast} = expandLinewise(document.lineCount, costForLine, canEdit, editableFirst, editableLast, remaining));
|
|
302
|
+
let contextFirst = editableFirst;
|
|
303
|
+
let contextLast = editableLast;
|
|
304
|
+
({first: contextFirst, last: contextLast} = expandLinewise(document.lineCount, costForLine, () => true, contextFirst, contextLast, CONTEXT_TOKENS));
|
|
305
|
+
let editableTokens = 0;
|
|
306
|
+
for (let line = editableFirst; line <= editableLast; line++) editableTokens += costForLine(line);
|
|
307
|
+
let contextTokens = 0;
|
|
308
|
+
for (let line = contextFirst; line <= contextLast; line++) contextTokens += costForLine(line);
|
|
309
|
+
if (editableTokens > MAX_EDITABLE_TOKENS || contextTokens > MAX_CONTEXT_TOKENS) return;
|
|
310
|
+
const contextStart = document.offsetAt({
|
|
311
|
+
line: contextFirst,
|
|
312
|
+
character: 0
|
|
313
|
+
});
|
|
314
|
+
const contextEnd = document.offsetAt({
|
|
315
|
+
line: contextLast,
|
|
316
|
+
character: document.getLineLength(contextLast)
|
|
317
|
+
});
|
|
318
|
+
const excerptText = document.getTextSlice(contextStart, contextEnd);
|
|
319
|
+
const request = {
|
|
320
|
+
path,
|
|
321
|
+
version: document.version,
|
|
322
|
+
eol: document.eol,
|
|
323
|
+
excerptText,
|
|
324
|
+
excerptStartLine: contextFirst,
|
|
325
|
+
cursorOffsetInExcerpt: cursor - contextStart,
|
|
326
|
+
editableRange: {
|
|
327
|
+
start: document.offsetAt({
|
|
328
|
+
line: editableFirst,
|
|
329
|
+
character: 0
|
|
330
|
+
}) - contextStart,
|
|
331
|
+
end: document.offsetAt({
|
|
332
|
+
line: editableLast,
|
|
333
|
+
character: document.getLineLength(editableLast)
|
|
334
|
+
}) - contextStart
|
|
335
|
+
},
|
|
336
|
+
editHistory: history.slice(-10).map(({ hunk, source }) => ({
|
|
337
|
+
diff: hunk,
|
|
338
|
+
source
|
|
339
|
+
}))
|
|
340
|
+
};
|
|
341
|
+
return textEncoder.encode(JSON.stringify(request)).byteLength <= MAX_REQUEST_BYTES ? request : void 0;
|
|
342
|
+
}
|
|
343
|
+
function matchesEditPredictionPattern(path, pattern) {
|
|
344
|
+
if (typeof pattern !== "string") return new RegExp(pattern.source, pattern.flags).test(path);
|
|
345
|
+
pattern = pattern.replaceAll("\\", "/");
|
|
346
|
+
let source = "^";
|
|
347
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
348
|
+
const character = pattern[index];
|
|
349
|
+
if (character === "*") {
|
|
350
|
+
if (pattern[index + 1] === "*") {
|
|
351
|
+
index++;
|
|
352
|
+
if (pattern[index + 1] === "/") {
|
|
353
|
+
index++;
|
|
354
|
+
source += "(?:.*/)?";
|
|
355
|
+
} else source += ".*";
|
|
356
|
+
} else source += "[^/]*";
|
|
357
|
+
} else if (character === "?") source += "[^/]";
|
|
358
|
+
else source += /[\\^$.*+?()[\]{}|]/.test(character) ? `\\${character}` : character;
|
|
359
|
+
}
|
|
360
|
+
return new RegExp(`${source}$`).test(path);
|
|
361
|
+
}
|
|
362
|
+
//#endregion
|
|
363
|
+
export { buildEditPredictionRequest, matchesEditPredictionPattern, recordEditPrediction };
|
|
364
|
+
|
|
365
|
+
//# sourceMappingURL=editPrediction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editPrediction.js","names":[],"sources":["../../src/editor/editPrediction.ts"],"sourcesContent":["import type { TextDocumentChangeTransaction } from './textDocumentChangeTransaction';\nimport type { Position, ResolvedTextEdit, TextEdit } from './types';\n\nexport interface EditPredictRequest {\n /** Current file name/path as supplied to the File or FileDiff component. */\n readonly path: string;\n /** Document version. */\n readonly version: number;\n /** Document end-of-line sequence. */\n readonly eol: '\\n' | '\\r\\n' | '\\r';\n /** Bounded slice of the file around the cursor (not the whole file). */\n readonly excerptText: string;\n /** Zero-based document line where the excerpt starts. */\n readonly excerptStartLine: number;\n /** UTF-16 cursor offset relative to `excerptText`. */\n readonly cursorOffsetInExcerpt: number;\n /** Half-open UTF-16 range within `excerptText` that may be edited. */\n readonly editableRange: { readonly start: number; readonly end: number };\n /** Chronological, bounded edit history for this document. */\n readonly editHistory: ReadonlyArray<{\n /** Edit in unified-diff format. */\n readonly diff: string;\n /** Edit source. */\n readonly source: 'user' | 'prediction';\n }>;\n}\n\nexport interface EditPredictContext {\n /** Aborted when the document or cursor changes. */\n readonly signal: AbortSignal;\n}\n\nexport interface EditPredictResponse {\n /** Non-overlapping edits using absolute document positions. */\n readonly edits: readonly TextEdit[];\n /** Absolute post-edit cursor position. */\n readonly newCursor: Position;\n}\n\nexport interface EditPredictProvider {\n /** Predicts the next edit for the given request. */\n predict: (\n request: EditPredictRequest,\n context: EditPredictContext\n ) => Promise<EditPredictResponse>;\n}\n\nexport interface EditPredictionHistoryRecord {\n readonly path: string;\n readonly hunk: string;\n readonly start: number;\n readonly end: number;\n readonly at: number;\n readonly source: 'user' | 'prediction';\n readonly fragment?: EditPredictionHistoryFragment;\n}\n\ninterface EditPredictionDocument {\n readonly version: number;\n readonly eol: '\\n' | '\\r\\n' | '\\r';\n readonly lineCount: number;\n positionAt(offset: number): Position;\n positionsAt(offsets: readonly number[]): Position[];\n offsetAt(position: Position): number;\n getLineText(line: number): string;\n getLineLength(line: number): number;\n getTextSlice(start: number, end: number): string;\n charAt(offset: number): string;\n}\n\ninterface EditPredictionHistoryFragment {\n readonly baseText: string;\n readonly currentText: string;\n readonly currentStart: number;\n readonly currentEnd: number;\n readonly startLine: number;\n}\n\ninterface EditPredictionTransactionFragment {\n readonly beforeText: string;\n readonly afterText: string;\n readonly startOffset: number;\n readonly startLine: number;\n readonly bounds: LineDiffBounds;\n}\n\ninterface LineDiffBounds {\n readonly oldLineCount: number;\n readonly newLineCount: number;\n readonly prefixLines: number;\n readonly suffixLines: number;\n}\n\nconst EDITABLE_TOKENS = 350;\nconst CONTEXT_TOKENS = 150;\nconst MAX_EDITABLE_TOKENS = 512;\nconst MAX_CONTEXT_TOKENS = 662;\nconst MAX_REQUEST_BYTES = 128 * 1024;\nconst MAX_HISTORY_ENTRIES = 10;\nconst MAX_CAPTURE_BYTES = 6144;\nconst COALESCE_MS = 1000;\nconst COALESCE_LINES = 8;\nconst DIFF_CONTEXT_LINES = 3;\nconst CAPTURE_CONTEXT_LINES = DIFF_CONTEXT_LINES + COALESCE_LINES;\nconst CAPTURE_CONTEXT_OPTIONS = [\n CAPTURE_CONTEXT_LINES,\n DIFF_CONTEXT_LINES,\n] as const;\nconst textEncoder = new TextEncoder();\n\nfunction lineStarts(text: string): number[] {\n const starts = [0];\n for (let index = 0; index < text.length; index++) {\n if (text.charCodeAt(index) === 13 && text.charCodeAt(index + 1) === 10) {\n index++;\n }\n if (text.charCodeAt(index) === 10 || text.charCodeAt(index) === 13) {\n starts.push(index + 1);\n }\n }\n return starts;\n}\n\n// A line start at text.length is the boundary after a trailing terminator,\n// not an additional document line for unified-diff counts.\nfunction diffLineCount(text: string, starts: readonly number[]): number {\n if (text.length === 0) {\n return 0;\n }\n return starts.at(-1) === text.length ? starts.length - 1 : starts.length;\n}\n\nfunction lineEnd(\n text: string,\n starts: readonly number[],\n line: number\n): number {\n const next = starts[line + 1];\n return next === undefined\n ? text.length\n : next -\n (text.charCodeAt(next - 1) === 10 && text.charCodeAt(next - 2) === 13\n ? 2\n : 1);\n}\n\nfunction linesEqual(\n left: string,\n leftStarts: readonly number[],\n leftLine: number,\n right: string,\n rightStarts: readonly number[],\n rightLine: number\n): boolean {\n const leftStart = leftStarts[leftLine];\n const rightStart = rightStarts[rightLine];\n const length = lineEnd(left, leftStarts, leftLine) - leftStart;\n if (length !== lineEnd(right, rightStarts, rightLine) - rightStart) {\n return false;\n }\n for (let index = 0; index < length; index++) {\n if (\n left.charCodeAt(leftStart + index) !==\n right.charCodeAt(rightStart + index)\n ) {\n return false;\n }\n }\n return true;\n}\n\nfunction lineDiffBounds(\n oldText: string,\n oldStarts: readonly number[],\n newText: string,\n newStarts: readonly number[]\n): LineDiffBounds {\n const oldLineCount = diffLineCount(oldText, oldStarts);\n const newLineCount = diffLineCount(newText, newStarts);\n let prefixLines = 0;\n while (prefixLines < oldLineCount && prefixLines < newLineCount) {\n if (\n !linesEqual(\n oldText,\n oldStarts,\n prefixLines,\n newText,\n newStarts,\n prefixLines\n )\n ) {\n break;\n }\n prefixLines++;\n }\n\n let suffixLines = 0;\n while (\n suffixLines < oldLineCount - prefixLines &&\n suffixLines < newLineCount - prefixLines\n ) {\n const oldLine = oldLineCount - 1 - suffixLines;\n const newLine = newLineCount - 1 - suffixLines;\n if (!linesEqual(oldText, oldStarts, oldLine, newText, newStarts, newLine)) {\n break;\n }\n suffixLines++;\n }\n return { oldLineCount, newLineCount, prefixLines, suffixLines };\n}\n\nfunction formatEditHunk(\n path: string,\n oldText: string,\n newText: string,\n lineOffset = 0\n): { readonly hunk: string; readonly bounds: LineDiffBounds } | undefined {\n if (oldText === newText) {\n return;\n }\n const oldStarts = lineStarts(oldText);\n const newStarts = lineStarts(newText);\n const bounds = lineDiffBounds(oldText, oldStarts, newText, newStarts);\n if (\n bounds.prefixLines === bounds.oldLineCount &&\n bounds.prefixLines === bounds.newLineCount\n ) {\n return;\n }\n const oldChangedEnd = bounds.oldLineCount - bounds.suffixLines;\n const newChangedEnd = bounds.newLineCount - bounds.suffixLines;\n const oldChanged = oldText.slice(\n oldStarts[bounds.prefixLines] ?? oldText.length,\n oldStarts[oldChangedEnd] ?? oldText.length\n );\n const newChanged = newText.slice(\n newStarts[bounds.prefixLines] ?? newText.length,\n newStarts[newChangedEnd] ?? newText.length\n );\n if (\n textEncoder.encode(oldChanged).byteLength > MAX_CAPTURE_BYTES ||\n textEncoder.encode(newChanged).byteLength > MAX_CAPTURE_BYTES\n ) {\n return;\n }\n\n const start = Math.max(0, bounds.prefixLines - DIFF_CONTEXT_LINES);\n const oldEnd = Math.min(\n bounds.oldLineCount,\n oldChangedEnd + DIFF_CONTEXT_LINES\n );\n const newEnd = Math.min(\n bounds.newLineCount,\n newChangedEnd + DIFF_CONTEXT_LINES\n );\n const oldCount = oldEnd - start;\n const newCount = newEnd - start;\n const line = start + lineOffset;\n const output = [\n `--- a/${path}`,\n `+++ b/${path}`,\n `@@ -${oldCount === 0 ? line : line + 1},${oldCount} +${\n newCount === 0 ? line : line + 1\n },${newCount} @@`,\n ];\n for (let line = start; line < bounds.prefixLines; line++) {\n output.push(\n ` ${oldText.slice(oldStarts[line], lineEnd(oldText, oldStarts, line))}`\n );\n }\n for (let line = bounds.prefixLines; line < oldChangedEnd; line++) {\n output.push(\n `-${oldText.slice(oldStarts[line], lineEnd(oldText, oldStarts, line))}`\n );\n }\n for (let line = bounds.prefixLines; line < newChangedEnd; line++) {\n output.push(\n `+${newText.slice(newStarts[line], lineEnd(newText, newStarts, line))}`\n );\n }\n for (let line = oldChangedEnd; line < oldEnd; line++) {\n output.push(\n ` ${oldText.slice(oldStarts[line], lineEnd(oldText, oldStarts, line))}`\n );\n }\n const hunk = output.join('\\n');\n return textEncoder.encode(hunk).byteLength <= MAX_CAPTURE_BYTES\n ? { hunk, bounds }\n : undefined;\n}\n\n// Applies offset edits to a bounded document slice without materializing the\n// surrounding file. Returns undefined if the slice does not contain the edits.\nfunction applyEditsToSlice(\n text: string,\n sliceStart: number,\n edits: readonly ResolvedTextEdit[]\n): string | undefined {\n const chunks: string[] = [];\n let offset = 0;\n for (const edit of edits) {\n const start = edit.start - sliceStart;\n const end = edit.end - sliceStart;\n if (start < offset || end < start || end > text.length) {\n return;\n }\n chunks.push(text.slice(offset, start), edit.text);\n offset = end;\n }\n chunks.push(text.slice(offset));\n return chunks.join('');\n}\n\n// Captures a small post-edit window and reconstructs its pre-edit contents\n// from the inverse edits already stored by the undo transaction.\nfunction captureEditPredictionTransaction(\n document: EditPredictionDocument,\n transaction: TextDocumentChangeTransaction\n): EditPredictionTransactionFragment | undefined {\n const inverseEdits = transaction.inverseEdits;\n if (inverseEdits.length === 0) {\n return;\n }\n let changedStart = inverseEdits[0].start;\n let changedEnd = inverseEdits[0].end;\n for (let index = 1; index < inverseEdits.length; index++) {\n changedStart = Math.min(changedStart, inverseEdits[index].start);\n changedEnd = Math.max(changedEnd, inverseEdits[index].end);\n }\n const [startPosition, endPosition] = document.positionsAt([\n changedStart,\n changedEnd,\n ]);\n for (const contextLines of CAPTURE_CONTEXT_OPTIONS) {\n const startLine = Math.max(0, startPosition.line - contextLines);\n const endLine = Math.min(\n document.lineCount - 1,\n endPosition.line + contextLines\n );\n const afterStart = document.offsetAt({\n line: startLine,\n character: 0,\n });\n const afterEnd =\n endLine + 1 < document.lineCount\n ? document.offsetAt({ line: endLine + 1, character: 0 })\n : document.offsetAt({\n line: endLine,\n character: document.getLineLength(endLine),\n });\n if (afterEnd - afterStart > MAX_CAPTURE_BYTES) {\n continue;\n }\n const afterText = document.getTextSlice(afterStart, afterEnd);\n if (textEncoder.encode(afterText).byteLength > MAX_CAPTURE_BYTES) {\n continue;\n }\n const beforeText = applyEditsToSlice(afterText, afterStart, inverseEdits);\n if (\n beforeText === undefined ||\n beforeText.length > MAX_CAPTURE_BYTES ||\n textEncoder.encode(beforeText).byteLength > MAX_CAPTURE_BYTES\n ) {\n continue;\n }\n const bounds = lineDiffBounds(\n beforeText,\n lineStarts(beforeText),\n afterText,\n lineStarts(afterText)\n );\n return {\n beforeText,\n afterText,\n startOffset: afterStart,\n startLine,\n bounds,\n };\n }\n return undefined;\n}\n\nexport function recordEditPrediction(\n history: readonly EditPredictionHistoryRecord[],\n path: string,\n document: EditPredictionDocument,\n transaction: TextDocumentChangeTransaction,\n source: 'user' | 'prediction',\n at: number = Date.now()\n): EditPredictionHistoryRecord[] {\n const kept = history.slice(-MAX_HISTORY_ENTRIES);\n const fragment = captureEditPredictionTransaction(document, transaction);\n if (fragment === undefined) {\n const previous = kept.at(-1);\n if (previous?.fragment !== undefined) {\n kept[kept.length - 1] = { ...previous, fragment: undefined };\n }\n return kept;\n }\n if (fragment.beforeText === fragment.afterText) {\n return kept;\n }\n const changedStartLine = fragment.startLine + fragment.bounds.prefixLines;\n const beforeChangedEndLine =\n fragment.startLine +\n fragment.bounds.oldLineCount -\n fragment.bounds.suffixLines;\n const last = kept.at(-1);\n const gap =\n last !== undefined && changedStartLine > last.end\n ? changedStartLine - last.end\n : last !== undefined && last.start > beforeChangedEndLine\n ? last.start - beforeChangedEndLine\n : 0;\n const canMerge =\n last !== undefined &&\n last.fragment !== undefined &&\n last.path === path &&\n last.source === source &&\n at - last.at < COALESCE_MS &&\n gap <= COALESCE_LINES;\n\n if (canMerge) {\n const previous = last.fragment;\n const beforeEnd = fragment.startOffset + fragment.beforeText.length;\n const overlapStart = Math.max(previous.currentStart, fragment.startOffset);\n const overlapEnd = Math.min(previous.currentEnd, beforeEnd);\n if (\n overlapStart <= overlapEnd &&\n previous.currentText.slice(\n overlapStart - previous.currentStart,\n overlapEnd - previous.currentStart\n ) ===\n fragment.beforeText.slice(\n overlapStart - fragment.startOffset,\n overlapEnd - fragment.startOffset\n )\n ) {\n const unionStart = Math.min(previous.currentStart, fragment.startOffset);\n const currentText =\n previous.currentStart <= fragment.startOffset\n ? previous.currentText +\n fragment.beforeText.slice(\n Math.max(0, previous.currentEnd - fragment.startOffset)\n )\n : fragment.beforeText +\n previous.currentText.slice(\n Math.max(0, beforeEnd - previous.currentStart)\n );\n const prefix = currentText.slice(0, previous.currentStart - unionStart);\n const suffix = currentText.slice(previous.currentEnd - unionStart);\n const baseText = prefix + previous.baseText + suffix;\n const nextText = applyEditsToSlice(\n currentText,\n unionStart,\n transaction.appliedEdits\n );\n const startLine =\n previous.currentStart <= fragment.startOffset\n ? previous.startLine\n : fragment.startLine;\n if (\n nextText !== undefined &&\n baseText.length <= MAX_CAPTURE_BYTES &&\n nextText.length <= MAX_CAPTURE_BYTES &&\n textEncoder.encode(baseText).byteLength <= MAX_CAPTURE_BYTES &&\n textEncoder.encode(nextText).byteLength <= MAX_CAPTURE_BYTES\n ) {\n if (baseText === nextText) {\n kept.pop();\n return kept;\n }\n const formatted = formatEditHunk(path, baseText, nextText, startLine);\n if (formatted !== undefined) {\n kept[kept.length - 1] = {\n path,\n hunk: formatted.hunk,\n start: startLine + formatted.bounds.prefixLines,\n end:\n startLine +\n formatted.bounds.newLineCount -\n formatted.bounds.suffixLines,\n at,\n source,\n fragment: {\n baseText,\n currentText: nextText,\n currentStart: unionStart,\n currentEnd: unionStart + nextText.length,\n startLine,\n },\n };\n return kept;\n }\n }\n }\n }\n const previous = kept.at(-1);\n if (previous?.fragment !== undefined) {\n kept[kept.length - 1] = { ...previous, fragment: undefined };\n }\n const formatted = formatEditHunk(\n path,\n fragment.beforeText,\n fragment.afterText,\n fragment.startLine\n );\n if (formatted === undefined) {\n return kept;\n }\n kept.push({\n path,\n hunk: formatted.hunk,\n start: changedStartLine,\n end:\n fragment.startLine +\n fragment.bounds.newLineCount -\n fragment.bounds.suffixLines,\n at,\n source,\n fragment: {\n baseText: fragment.beforeText,\n currentText: fragment.afterText,\n currentStart: fragment.startOffset,\n currentEnd: fragment.startOffset + fragment.afterText.length,\n startLine: fragment.startLine,\n },\n });\n return kept.slice(-MAX_HISTORY_ENTRIES);\n}\n\n// Grows [first, last] one line at a time in both directions while the token\n// budget allows and `canExpandTo` accepts the next line on that side.\nfunction expandLinewise(\n lineCount: number,\n costForLine: (line: number) => number,\n canExpandTo: (line: number) => boolean,\n first: number,\n last: number,\n remaining: number\n): { first: number; last: number } {\n while (remaining > 0 && (first > 0 || last < lineCount - 1)) {\n let expanded = false;\n if (first > 0 && canExpandTo(first - 1)) {\n const cost = costForLine(first - 1);\n if (cost <= remaining) {\n first--;\n remaining -= cost;\n expanded = true;\n }\n }\n if (last < lineCount - 1 && canExpandTo(last + 1)) {\n const cost = costForLine(last + 1);\n if (cost <= remaining) {\n last++;\n remaining -= cost;\n expanded = true;\n }\n }\n if (!expanded) {\n break;\n }\n }\n return { first, last };\n}\n\n// Builds the request sent to the prediction provider. It carries a bounded\n// excerpt of the document around the cursor and marks the part of it the\n// provider may edit. The editable part grows outward from the cursor line and\n// stops at the first line `isLineEditable` rejects, so the provider never sees\n// an editable line the editor could not show a preview for. The rest of the\n// excerpt is read-only context and is not filtered. Returns undefined when the\n// cursor line itself is rejected.\nexport function buildEditPredictionRequest(\n path: string,\n document: EditPredictionDocument,\n cursorOffset: number,\n history: readonly EditPredictionHistoryRecord[],\n isLineEditable: (line: number) => boolean\n): EditPredictRequest | undefined {\n if (document.lineCount <= 0) {\n return;\n }\n const lastLine = document.lineCount - 1;\n const documentLength = document.offsetAt({\n line: lastLine,\n character: document.getLineLength(lastLine),\n });\n const normalizedCursor = Number.isFinite(cursorOffset)\n ? Math.trunc(cursorOffset)\n : 0;\n let cursor = Math.max(0, Math.min(normalizedCursor, documentLength));\n const previous = document.charAt(cursor - 1).charCodeAt(0);\n const next = document.charAt(cursor).charCodeAt(0);\n if (\n cursor > 0 &&\n cursor < documentLength &&\n ((previous === 13 && next === 10) ||\n (previous >= 0xd800 &&\n previous <= 0xdbff &&\n next >= 0xdc00 &&\n next <= 0xdfff))\n ) {\n cursor--;\n }\n const cursorLine = document.positionAt(cursor).line;\n // Cache whether each line may be edited. `isLineEditable` can be costly (a\n // diff has to walk its hunks to answer), and the loops below ask about the\n // same boundary lines over and over.\n const editableLines = new Map<number, boolean>();\n const canEdit = (line: number): boolean => {\n if (line < 0 || line >= document.lineCount) {\n return false;\n }\n let editable = editableLines.get(line);\n if (editable == null) {\n editable = isLineEditable(line);\n editableLines.set(line, editable);\n }\n return editable;\n };\n if (!canEdit(cursorLine)) {\n return;\n }\n const tokenCosts = new Map<number, number>();\n const costForLine = (line: number): number => {\n const cached = tokenCosts.get(line);\n if (cached !== undefined) {\n return cached;\n }\n const lineLength = document.getLineLength(line);\n if (Math.floor(lineLength / 3) > MAX_CONTEXT_TOKENS) {\n const cost = MAX_CONTEXT_TOKENS + 1;\n tokenCosts.set(line, cost);\n return cost;\n }\n const cost = Math.max(\n 1,\n Math.floor(textEncoder.encode(document.getLineText(line)).byteLength / 3)\n );\n tokenCosts.set(line, cost);\n return cost;\n };\n\n let editableFirst = cursorLine;\n let editableLast = cursorLine;\n const initialBudget = Math.floor((EDITABLE_TOKENS * 3) / 4);\n let remaining = Math.max(0, initialBudget - costForLine(cursorLine));\n while (\n remaining > 0 &&\n (canEdit(editableFirst - 1) || canEdit(editableLast + 1))\n ) {\n if (canEdit(editableLast + 1)) {\n const cost = costForLine(editableLast + 1);\n if (cost > remaining) {\n break;\n }\n editableLast++;\n remaining -= cost;\n }\n if (canEdit(editableFirst - 1) && remaining > 0) {\n const cost = costForLine(editableFirst - 1);\n if (cost > remaining) {\n break;\n }\n editableFirst--;\n remaining -= cost;\n }\n }\n remaining += EDITABLE_TOKENS - initialBudget;\n ({ first: editableFirst, last: editableLast } = expandLinewise(\n document.lineCount,\n costForLine,\n canEdit,\n editableFirst,\n editableLast,\n remaining\n ));\n\n let contextFirst = editableFirst;\n let contextLast = editableLast;\n ({ first: contextFirst, last: contextLast } = expandLinewise(\n document.lineCount,\n costForLine,\n () => true,\n contextFirst,\n contextLast,\n CONTEXT_TOKENS\n ));\n let editableTokens = 0;\n for (let line = editableFirst; line <= editableLast; line++) {\n editableTokens += costForLine(line);\n }\n let contextTokens = 0;\n for (let line = contextFirst; line <= contextLast; line++) {\n contextTokens += costForLine(line);\n }\n if (\n editableTokens > MAX_EDITABLE_TOKENS ||\n contextTokens > MAX_CONTEXT_TOKENS\n ) {\n return;\n }\n\n const contextStart = document.offsetAt({\n line: contextFirst,\n character: 0,\n });\n const contextEnd = document.offsetAt({\n line: contextLast,\n character: document.getLineLength(contextLast),\n });\n const excerptText = document.getTextSlice(contextStart, contextEnd);\n const request: EditPredictRequest = {\n path,\n version: document.version,\n eol: document.eol,\n excerptText,\n excerptStartLine: contextFirst,\n cursorOffsetInExcerpt: cursor - contextStart,\n editableRange: {\n start:\n document.offsetAt({ line: editableFirst, character: 0 }) - contextStart,\n end:\n document.offsetAt({\n line: editableLast,\n character: document.getLineLength(editableLast),\n }) - contextStart,\n },\n editHistory: history\n .slice(-MAX_HISTORY_ENTRIES)\n .map(({ hunk, source }) => ({\n diff: hunk,\n source,\n })),\n };\n return textEncoder.encode(JSON.stringify(request)).byteLength <=\n MAX_REQUEST_BYTES\n ? request\n : undefined;\n}\n\nexport function matchesEditPredictionPattern(\n path: string,\n pattern: string | RegExp\n): boolean {\n if (typeof pattern !== 'string') {\n return new RegExp(pattern.source, pattern.flags).test(path);\n }\n\n pattern = pattern.replaceAll('\\\\', '/');\n let source = '^';\n for (let index = 0; index < pattern.length; index++) {\n const character = pattern[index];\n if (character === '*') {\n if (pattern[index + 1] === '*') {\n index++;\n if (pattern[index + 1] === '/') {\n index++;\n source += '(?:.*/)?';\n } else {\n source += '.*';\n }\n } else {\n source += '[^/]*';\n }\n } else if (character === '?') {\n source += '[^/]';\n } else {\n source += /[\\\\^$.*+?()[\\]{}|]/.test(character)\n ? `\\\\${character}`\n : character;\n }\n }\n return new RegExp(`${source}$`).test(path);\n}\n"],"mappings":";AA6FA,MAAM,kBAAkB;AACxB,MAAM,iBAAiB;AACvB,MAAM,sBAAsB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B,IAAI,cAAc,KAAK;GACrB,IAAI,QAAQ,QAAQ,OAAO,KAAK;IAC9B;IACA,IAAI,QAAQ,QAAQ,OAAO,KAAK;KAC9B;KACA,UAAU;IACZ,OACE,UAAU;GAEd,OACE,UAAU;EAEd,OAAO,IAAI,cAAc,KACvB,UAAU;OAEV,UAAU,qBAAqB,KAAK,SAAS,IACzC,KAAK,cACL;CAER;CACA,OAAO,IAAI,OAAO,GAAG,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI;AAC3C"}
|
|
@@ -1,76 +1,54 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EditHistoryEntry, EditHistoryState, EditorLineAnnotation, EditorSelection, EditorType, ResolvedTextEdit } from "./types.js";
|
|
2
2
|
import { TextDocument } from "./textDocument.js";
|
|
3
|
-
|
|
4
3
|
//#region src/editor/editStack.d.ts
|
|
5
|
-
type
|
|
6
|
-
/** An entry in the edit stack. */
|
|
7
|
-
interface EditStackEntry<LAnnotation> {
|
|
8
|
-
/** Forward offset edits from the entry's base text to its final text. */
|
|
9
|
-
forwardEdits: ResolvedTextEdit[];
|
|
10
|
-
/** Inverse offset edits from the entry's final text back to its base text. */
|
|
11
|
-
inverseEdits: ResolvedTextEdit[];
|
|
12
|
-
/** Document version before the entry is applied. */
|
|
13
|
-
versionBefore: number;
|
|
14
|
-
/** Document version after the entry is applied. */
|
|
15
|
-
versionAfter: number;
|
|
16
|
-
/** Selection before the transaction. */
|
|
17
|
-
selectionsBefore?: EditorSelection[];
|
|
18
|
-
/** Selection after the transaction. */
|
|
19
|
-
selectionsAfter?: EditorSelection[];
|
|
20
|
-
/** Line annotations before the transaction. */
|
|
21
|
-
lineAnnotationsBefore?: DiffLineAnnotation<LAnnotation>[];
|
|
22
|
-
/** Line annotations after the transaction. */
|
|
23
|
-
lineAnnotationsAfter?: DiffLineAnnotation<LAnnotation>[];
|
|
24
|
-
/** Input mode inferred from the edit or retained by a coalesced run. */
|
|
25
|
-
coalescingMode?: EditStackCoalescingMode;
|
|
26
|
-
/**
|
|
27
|
-
* When `true`, this entry is its own undo step and never merges with the
|
|
28
|
-
* entry before or after it. Set for paste and cut, which otherwise look like
|
|
29
|
-
* typing and would merge into the previous keystroke.
|
|
30
|
-
*/
|
|
31
|
-
undoBoundary?: boolean;
|
|
32
|
-
}
|
|
4
|
+
type EditStackEntry<EType extends EditorType, LAnnotation = unknown> = EditHistoryEntry<EType, LAnnotation>;
|
|
33
5
|
/** Options for the edit stack. */
|
|
34
6
|
interface EditStackOptions {
|
|
35
7
|
/** The maximum number of entries to keep in the undo stack. */
|
|
36
8
|
maxEntries?: number;
|
|
37
9
|
}
|
|
38
10
|
/** A stack of edit entries. */
|
|
39
|
-
declare class EditStack<LAnnotation> {
|
|
11
|
+
declare class EditStack<EType extends EditorType, LAnnotation = unknown> {
|
|
40
12
|
#private;
|
|
41
13
|
constructor(options?: EditStackOptions);
|
|
42
14
|
get canUndo(): boolean;
|
|
43
15
|
get canRedo(): boolean;
|
|
16
|
+
/** Return an independent, developer-editable history snapshot. */
|
|
17
|
+
getState(): EditHistoryState<EType, LAnnotation>;
|
|
18
|
+
/** Return a live view over this stack without copying its entries. */
|
|
19
|
+
getLiveState(): EditHistoryState<EType, LAnnotation>;
|
|
20
|
+
/** Transfer developer-owned history into an edit stack. */
|
|
21
|
+
static fromState<EType extends EditorType, LAnnotation>(state: EditHistoryState<EType, LAnnotation>): EditStack<EType, LAnnotation>;
|
|
44
22
|
/** Clears both the undo and redo stacks. */
|
|
45
23
|
clear(): void;
|
|
46
24
|
/** Clears the redo stack. */
|
|
47
25
|
clearRedo(): void;
|
|
48
26
|
/** Pushes a new entry onto the undo stack. */
|
|
49
|
-
push(entry: EditStackEntry<LAnnotation>): void;
|
|
27
|
+
push(entry: EditStackEntry<EType, LAnnotation>): void;
|
|
50
28
|
/** Sets the selections after the last undo entry. */
|
|
51
29
|
setLastUndoSelectionsAfter(selections: EditorSelection[]): void;
|
|
52
30
|
/** Sets the line annotations after the last undo entry. */
|
|
53
|
-
setLastUndoLineAnnotations(lineAnnotationsBefore:
|
|
31
|
+
setLastUndoLineAnnotations(lineAnnotationsBefore: EditorLineAnnotation<EType, LAnnotation>[], lineAnnotationsAfter: EditorLineAnnotation<EType, LAnnotation>[]): void;
|
|
54
32
|
/** Returns the last undo entry, or `undefined` if empty. */
|
|
55
|
-
peekUndo(): EditStackEntry<LAnnotation> | undefined;
|
|
33
|
+
peekUndo(): EditStackEntry<EType, LAnnotation> | undefined;
|
|
56
34
|
/** Returns the last undo entry only while its coalescing group is open. */
|
|
57
|
-
peekUndoForCoalescing(): EditStackEntry<LAnnotation> | undefined;
|
|
35
|
+
peekUndoForCoalescing(): EditStackEntry<EType, LAnnotation> | undefined;
|
|
58
36
|
/** Replaces the last undo entry with the given entry. */
|
|
59
|
-
replaceLastUndo(entry: EditStackEntry<LAnnotation>): void;
|
|
37
|
+
replaceLastUndo(entry: EditStackEntry<EType, LAnnotation>): void;
|
|
60
38
|
/** Moves the latest undo entry to the redo stack and returns it, or `undefined` if empty. */
|
|
61
|
-
popUndoToRedo(): EditStackEntry<LAnnotation> | void;
|
|
39
|
+
popUndoToRedo(): EditStackEntry<EType, LAnnotation> | void;
|
|
62
40
|
/** Moves the latest redo entry back to the undo stack and returns it, or `undefined` if empty. */
|
|
63
|
-
popRedoToUndo(): EditStackEntry<LAnnotation> | void;
|
|
41
|
+
popRedoToUndo(): EditStackEntry<EType, LAnnotation> | void;
|
|
64
42
|
}
|
|
65
|
-
declare function createEditStackEntry<LAnnotation>(textDocument: TextDocument<LAnnotation>, resolvedEdits: ResolvedTextEdit[], versionBefore: number, versionAfter: number, selectionsBefore?: EditorSelection[], selectionsAfter?: EditorSelection[], lineAnnotationsBefore?:
|
|
43
|
+
declare function createEditStackEntry<EType extends EditorType, LAnnotation>(textDocument: TextDocument<EType, LAnnotation>, resolvedEdits: ResolvedTextEdit[], versionBefore: number, versionAfter: number, selectionsBefore?: EditorSelection[], selectionsAfter?: EditorSelection[], lineAnnotationsBefore?: EditorLineAnnotation<EType, LAnnotation>[], lineAnnotationsAfter?: EditorLineAnnotation<EType, LAnnotation>[]): EditStackEntry<EType, LAnnotation>;
|
|
66
44
|
/** Determines if the change matches following modes:
|
|
67
45
|
* - 'insert': simple typing
|
|
68
46
|
* - 'backspace': backward delete
|
|
69
47
|
* - 'delete': forward delete
|
|
70
48
|
*/
|
|
71
|
-
declare function shouldCoalesceEditStackEntry<LAnnotation>(previousEntry: EditStackEntry<LAnnotation> | undefined, nextEntry: EditStackEntry<LAnnotation>): boolean;
|
|
49
|
+
declare function shouldCoalesceEditStackEntry<EType extends EditorType, LAnnotation>(previousEntry: EditStackEntry<EType, LAnnotation> | undefined, nextEntry: EditStackEntry<EType, LAnnotation>): boolean;
|
|
72
50
|
/** Coalesce edit stack entries for simple typing and single-character deletes. */
|
|
73
|
-
declare function coalesceEditStackEntries<LAnnotation>(previousEntry: EditStackEntry<LAnnotation>, nextEntry: EditStackEntry<LAnnotation>): EditStackEntry<LAnnotation>;
|
|
51
|
+
declare function coalesceEditStackEntries<EType extends EditorType, LAnnotation>(previousEntry: EditStackEntry<EType, LAnnotation>, nextEntry: EditStackEntry<EType, LAnnotation>): EditStackEntry<EType, LAnnotation>;
|
|
74
52
|
//#endregion
|
|
75
53
|
export { EditStack, EditStackEntry, EditStackOptions, coalesceEditStackEntries, createEditStackEntry, shouldCoalesceEditStackEntry };
|
|
76
54
|
//# sourceMappingURL=editStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editStack.d.ts","names":[],"sources":["../../src/editor/editStack.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"editStack.d.ts","names":[],"sources":["../../src/editor/editStack.ts"],"mappings":";;;KAkBY,eACV,cAAc,YACd,yBACE,iBAAiB,OAAO;;UAIX;;EAEf;;;cAIW,UAAU,cAAc,YAAY;;EAM/C,YAAY,UAAU;MAOlB;MAIA;;EAKJ,YAAY,iBAAiB,OAAO;;EAUpC,gBAAgB,iBAAiB,OAAO;;SAyBjC,UAAU,cAAc,YAAY,aACzC,OAAO,iBAAiB,OAAO,eAC9B,UAAU,OAAO;;EAWpB;;EAOA;;EAKA,KAAK,OAAO,eAAe,OAAO;;EAUlC,2BAA2B,YAAY;;EAUvC,2BACE,uBAAuB,qBAAqB,OAAO,gBACnD,sBAAsB,qBAAqB,OAAO;;EAUpD,YAAY,eAAe,OAAO;;EAKlC,yBAAyB,eAAe,OAAO;;EAK/C,gBAAgB,OAAO,eAAe,OAAO;;EAW7C,iBAAiB,eAAe,OAAO;;EAUvC,iBAAiB,eAAe,OAAO;;iBA8CzB,qBAAqB,cAAc,YAAY,aAC7D,cAAc,aAAa,OAAO,cAClC,eAAe,oBACf,uBACA,sBACA,mBAAmB,mBACnB,kBAAkB,mBAClB,wBAAwB,qBAAqB,OAAO,gBACpD,uBAAuB,qBAAqB,OAAO,iBAClD,eAAe,OAAO;;;;;;iBAmET,6BACd,cAAc,YACd,aAEA,eAAe,eAAe,OAAO,0BACrC,WAAW,eAAe,OAAO;;iBA8FnB,yBAAyB,cAAc,YAAY,aACjE,eAAe,eAAe,OAAO,cACrC,WAAW,eAAe,OAAO,eAChC,eAAe,OAAO"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region src/editor/editStack.ts
|
|
2
2
|
/** Largest number of undo or redo entries kept; oldest entries drop first once exceeded. */
|
|
3
3
|
const DEFAULT_EDIT_STACK_MAX_ENTRIES = 100;
|
|
4
|
-
const COALESCING_MODE_INSERT =
|
|
5
|
-
const COALESCING_MODE_BACKSPACE =
|
|
6
|
-
const COALESCING_MODE_DELETE =
|
|
4
|
+
const COALESCING_MODE_INSERT = "insert";
|
|
5
|
+
const COALESCING_MODE_BACKSPACE = "backspace";
|
|
6
|
+
const COALESCING_MODE_DELETE = "delete";
|
|
7
7
|
/** A stack of edit entries. */
|
|
8
|
-
var EditStack = class {
|
|
8
|
+
var EditStack = class EditStack {
|
|
9
9
|
#undoStack = [];
|
|
10
10
|
#redoStack = [];
|
|
11
11
|
#maxEntries;
|
|
@@ -19,6 +19,44 @@ var EditStack = class {
|
|
|
19
19
|
get canRedo() {
|
|
20
20
|
return this.#redoStack.length > 0;
|
|
21
21
|
}
|
|
22
|
+
/** Return an independent, developer-editable history snapshot. */
|
|
23
|
+
getState() {
|
|
24
|
+
return {
|
|
25
|
+
undoStack: this.#undoStack.map(cloneEditStackEntryForState),
|
|
26
|
+
redoStack: this.#redoStack.map(cloneEditStackEntryForState),
|
|
27
|
+
maxEntries: this.#maxEntries,
|
|
28
|
+
canCoalesce: this.#canCoalesce
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** Return a live view over this stack without copying its entries. */
|
|
32
|
+
getLiveState() {
|
|
33
|
+
return Object.defineProperties({}, {
|
|
34
|
+
undoStack: {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: () => this.#undoStack
|
|
37
|
+
},
|
|
38
|
+
redoStack: {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: () => this.#redoStack
|
|
41
|
+
},
|
|
42
|
+
maxEntries: {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: () => this.#maxEntries
|
|
45
|
+
},
|
|
46
|
+
canCoalesce: {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: () => this.#canCoalesce
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** Transfer developer-owned history into an edit stack. */
|
|
53
|
+
static fromState(state) {
|
|
54
|
+
const stack = new EditStack({ maxEntries: state.maxEntries });
|
|
55
|
+
stack.#undoStack = state.undoStack;
|
|
56
|
+
stack.#redoStack = state.redoStack;
|
|
57
|
+
stack.#canCoalesce = state.canCoalesce;
|
|
58
|
+
return stack;
|
|
59
|
+
}
|
|
22
60
|
/** Clears both the undo and redo stacks. */
|
|
23
61
|
clear() {
|
|
24
62
|
this.#undoStack.length = 0;
|
|
@@ -86,6 +124,31 @@ var EditStack = class {
|
|
|
86
124
|
}
|
|
87
125
|
}
|
|
88
126
|
};
|
|
127
|
+
function cloneEditStackEntry(entry) {
|
|
128
|
+
return {
|
|
129
|
+
...entry,
|
|
130
|
+
forwardEdits: entry.forwardEdits.map((edit) => ({ ...edit })),
|
|
131
|
+
inverseEdits: entry.inverseEdits.map((edit) => ({ ...edit })),
|
|
132
|
+
selectionsBefore: entry.selectionsBefore?.map(cloneSelection),
|
|
133
|
+
selectionsAfter: entry.selectionsAfter?.map(cloneSelection),
|
|
134
|
+
lineAnnotationsBefore: entry.lineAnnotationsBefore?.slice(),
|
|
135
|
+
lineAnnotationsAfter: entry.lineAnnotationsAfter?.slice()
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function cloneEditStackEntryForState(entry) {
|
|
139
|
+
return {
|
|
140
|
+
...cloneEditStackEntry(entry),
|
|
141
|
+
lineAnnotationsBefore: entry.lineAnnotationsBefore?.map((annotation) => ({ ...annotation })),
|
|
142
|
+
lineAnnotationsAfter: entry.lineAnnotationsAfter?.map((annotation) => ({ ...annotation }))
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function cloneSelection(selection) {
|
|
146
|
+
return {
|
|
147
|
+
...selection,
|
|
148
|
+
start: { ...selection.start },
|
|
149
|
+
end: { ...selection.end }
|
|
150
|
+
};
|
|
151
|
+
}
|
|
89
152
|
function createEditStackEntry(textDocument, resolvedEdits, versionBefore, versionAfter, selectionsBefore, selectionsAfter, lineAnnotationsBefore, lineAnnotationsAfter) {
|
|
90
153
|
const forwardEdits = [...resolvedEdits].sort((a, b) => a.start - b.start);
|
|
91
154
|
const inverseEdits = [];
|