@openclaw/diffs 2026.9.5 → 2026.9.7
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/icon.png +0 -0
- package/dist/.setup/{browser.runtime-VjaO3wrj.mjs → browser.runtime-v15gbeC0.mjs} +1 -1
- package/dist/.setup/{viewer-assets-D3qrnaxI.mjs → viewer-assets-Bg9efLih.mjs} +24 -49
- package/dist/assets/viewer-runtime.js +37 -37
- package/dist/index.js +282 -216
- package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +4 -4
- package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/CodeView.js +8 -6
- package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/File.d.ts +4 -15
- package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/File.js +4 -0
- package/node_modules/@pierre/diffs/dist/components/File.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +10 -37
- package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/FileDiff.js +19 -12
- 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/UnresolvedFile.d.ts +1 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js +2 -1
- package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +2 -8
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +19 -18
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +2 -8
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +19 -15
- 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 +0 -1
- 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/editor/EditStateManager.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/EditStateManager.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts.map +1 -1
- 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 +3 -2
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.js +11 -11
- package/node_modules/@pierre/diffs/dist/editor/editPrediction.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editStack.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/editor/editor.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor.js +23 -20
- package/node_modules/@pierre/diffs/dist/editor/editor.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/editor2.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/languages.d.ts +0 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js +2 -1
- package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/marker.d.ts +0 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts +0 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.js +16 -12
- package/node_modules/@pierre/diffs/dist/editor/searchPanel.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selection.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts +0 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocument.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.js +27 -3
- package/node_modules/@pierre/diffs/dist/editor/textMeasure.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts +1 -11
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/editor/types.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/utils.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/editor/utils.js +11 -7
- 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/attachResolvedLanguages.js +8 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.js.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 +3 -2
- package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.js +3 -1
- package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.js.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 +1 -6
- package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts.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/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 +1 -0
- 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 +1 -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 +9 -1
- package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/CodeView.js +39 -33
- package/node_modules/@pierre/diffs/dist/react/CodeView.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts +2 -5
- package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/File.d.ts +1 -23
- package/node_modules/@pierre/diffs/dist/react/File.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/File.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/File.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts +1 -23
- package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/FileDiff.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/FileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts +1 -24
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts +1 -23
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.js +13 -12
- package/node_modules/@pierre/diffs/dist/react/PatchDiff.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts +1 -18
- 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/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 +1 -1
- 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 +1 -16
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts +1 -13
- package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts.map +1 -1
- 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 +2 -18
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js +31 -17
- package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts +2 -16
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js +8 -4
- 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 +4 -9
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +28 -21
- package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +1 -0
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts +3 -9
- package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts.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/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/preloadDiffs.d.ts +6 -34
- package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts +1 -6
- package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts +1 -5
- package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts.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.map +1 -1
- package/node_modules/@pierre/diffs/dist/types.d.ts +0 -1
- 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.map +1 -1
- 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/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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts.map +1 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts.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 +1 -0
- package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts.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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.d.ts.map +1 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts.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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts +0 -1
- package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.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/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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts.map +1 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +2 -1
- 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 +0 -1
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +8 -5
- 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/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/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/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/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/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 +2 -17
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
- package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +48 -43
- 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 +0 -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 +121 -355
- 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 +22 -12
- package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
- package/node_modules/@pierre/diffs/package.json +4 -5
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- 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 +95 -1
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +44 -28
- package/node_modules/zod/src/v4/core/checks.ts +62 -102
- package/node_modules/zod/src/v4/core/compile.ts +218 -93
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
- package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +14 -4
- package/node_modules/zod/src/v4/core/schemas.ts +296 -132
- 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 +35 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
- package/node_modules/zod/src/v4/core/util.ts +218 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/locales/ar.ts +2 -0
- package/node_modules/zod/src/v4/locales/az.ts +2 -0
- package/node_modules/zod/src/v4/locales/be.ts +2 -0
- package/node_modules/zod/src/v4/locales/bg.ts +2 -0
- package/node_modules/zod/src/v4/locales/bn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ca.ts +2 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
- package/node_modules/zod/src/v4/locales/cs.ts +2 -0
- package/node_modules/zod/src/v4/locales/da.ts +2 -0
- package/node_modules/zod/src/v4/locales/de.ts +2 -0
- package/node_modules/zod/src/v4/locales/el.ts +2 -0
- package/node_modules/zod/src/v4/locales/en.ts +2 -0
- package/node_modules/zod/src/v4/locales/eo.ts +2 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +2 -0
- package/node_modules/zod/src/v4/locales/fi.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr.ts +2 -0
- package/node_modules/zod/src/v4/locales/gu.ts +2 -0
- package/node_modules/zod/src/v4/locales/he.ts +2 -0
- package/node_modules/zod/src/v4/locales/hi.ts +2 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +2 -0
- package/node_modules/zod/src/v4/locales/hy.ts +2 -0
- package/node_modules/zod/src/v4/locales/id.ts +2 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +2 -0
- package/node_modules/zod/src/v4/locales/it.ts +2 -0
- package/node_modules/zod/src/v4/locales/ja.ts +2 -0
- package/node_modules/zod/src/v4/locales/ka.ts +2 -0
- package/node_modules/zod/src/v4/locales/km.ts +2 -0
- package/node_modules/zod/src/v4/locales/kn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ko.ts +2 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ms.ts +2 -0
- package/node_modules/zod/src/v4/locales/ne.ts +2 -0
- package/node_modules/zod/src/v4/locales/nl.ts +2 -0
- package/node_modules/zod/src/v4/locales/nn.ts +2 -0
- package/node_modules/zod/src/v4/locales/no.ts +2 -0
- package/node_modules/zod/src/v4/locales/ota.ts +2 -0
- package/node_modules/zod/src/v4/locales/pl.ts +2 -0
- package/node_modules/zod/src/v4/locales/ps.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt.ts +2 -0
- package/node_modules/zod/src/v4/locales/ro.ts +2 -0
- package/node_modules/zod/src/v4/locales/ru.ts +2 -0
- package/node_modules/zod/src/v4/locales/sk.ts +2 -0
- package/node_modules/zod/src/v4/locales/sl.ts +2 -0
- package/node_modules/zod/src/v4/locales/sv.ts +2 -0
- package/node_modules/zod/src/v4/locales/ta.ts +2 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +2 -0
- package/node_modules/zod/src/v4/locales/tk.ts +2 -0
- package/node_modules/zod/src/v4/locales/tr.ts +2 -0
- package/node_modules/zod/src/v4/locales/uk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ur.ts +2 -0
- package/node_modules/zod/src/v4/locales/uz.ts +2 -0
- package/node_modules/zod/src/v4/locales/vi.ts +2 -0
- package/node_modules/zod/src/v4/locales/yo.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -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 +23 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- 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 +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- 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/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -35
- package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -33
- package/node_modules/zod/v4/core/api.cjs +45 -22
- package/node_modules/zod/v4/core/api.d.cts +12 -6
- package/node_modules/zod/v4/core/api.d.ts +12 -6
- package/node_modules/zod/v4/core/api.js +25 -22
- package/node_modules/zod/v4/core/checks.cjs +51 -97
- package/node_modules/zod/v4/core/checks.d.cts +17 -1
- package/node_modules/zod/v4/core/checks.d.ts +17 -1
- package/node_modules/zod/v4/core/checks.js +31 -96
- package/node_modules/zod/v4/core/compile.cjs +173 -78
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +154 -79
- package/node_modules/zod/v4/core/core.cjs +20 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
- 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 +170 -74
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +111 -23
- package/node_modules/zod/v4/core/memoizer.js +69 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +31 -6
- package/node_modules/zod/v4/core/regexes.d.cts +3 -0
- package/node_modules/zod/v4/core/regexes.d.ts +3 -0
- package/node_modules/zod/v4/core/regexes.js +10 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +302 -114
- package/node_modules/zod/v4/core/schemas.d.cts +28 -8
- package/node_modules/zod/v4/core/schemas.d.ts +28 -8
- package/node_modules/zod/v4/core/schemas.js +279 -113
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.js +7 -6
- package/node_modules/zod/v4/core/util.cjs +177 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +156 -143
- 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 +19 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/node_modules/zod/v4/locales/ar.js +2 -0
- package/node_modules/zod/v4/locales/az.cjs +2 -0
- package/node_modules/zod/v4/locales/az.js +2 -0
- package/node_modules/zod/v4/locales/be.cjs +2 -0
- package/node_modules/zod/v4/locales/be.js +2 -0
- package/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/node_modules/zod/v4/locales/bg.js +2 -0
- package/node_modules/zod/v4/locales/bn.cjs +2 -0
- package/node_modules/zod/v4/locales/bn.js +2 -0
- package/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/node_modules/zod/v4/locales/ca.js +2 -0
- package/node_modules/zod/v4/locales/ckb.cjs +2 -0
- package/node_modules/zod/v4/locales/ckb.js +2 -0
- package/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/node_modules/zod/v4/locales/cs.js +2 -0
- package/node_modules/zod/v4/locales/da.cjs +2 -0
- package/node_modules/zod/v4/locales/da.js +2 -0
- package/node_modules/zod/v4/locales/de.cjs +2 -0
- package/node_modules/zod/v4/locales/de.js +2 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/node_modules/zod/v4/locales/eo.js +2 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/node_modules/zod/v4/locales/fa.js +2 -0
- package/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/node_modules/zod/v4/locales/fi.js +2 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/node_modules/zod/v4/locales/fr-CA.js +2 -0
- package/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/node_modules/zod/v4/locales/fr.js +2 -0
- package/node_modules/zod/v4/locales/gu.cjs +2 -0
- package/node_modules/zod/v4/locales/gu.js +2 -0
- package/node_modules/zod/v4/locales/he.cjs +2 -0
- package/node_modules/zod/v4/locales/he.js +2 -0
- package/node_modules/zod/v4/locales/hi.cjs +2 -0
- package/node_modules/zod/v4/locales/hi.js +2 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/node_modules/zod/v4/locales/hu.js +2 -0
- package/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/node_modules/zod/v4/locales/hy.js +2 -0
- package/node_modules/zod/v4/locales/id.cjs +2 -0
- package/node_modules/zod/v4/locales/id.js +2 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +2 -0
- package/node_modules/zod/v4/locales/is.js +2 -0
- package/node_modules/zod/v4/locales/it.cjs +2 -0
- package/node_modules/zod/v4/locales/it.js +2 -0
- package/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/node_modules/zod/v4/locales/ja.js +2 -0
- package/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/node_modules/zod/v4/locales/ka.js +2 -0
- package/node_modules/zod/v4/locales/km.cjs +2 -0
- package/node_modules/zod/v4/locales/km.js +2 -0
- package/node_modules/zod/v4/locales/kn.cjs +2 -0
- package/node_modules/zod/v4/locales/kn.js +2 -0
- package/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/node_modules/zod/v4/locales/ko.js +2 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/node_modules/zod/v4/locales/mk.js +2 -0
- package/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/node_modules/zod/v4/locales/ms.js +2 -0
- package/node_modules/zod/v4/locales/ne.cjs +2 -0
- package/node_modules/zod/v4/locales/ne.js +2 -0
- package/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/node_modules/zod/v4/locales/nl.js +2 -0
- package/node_modules/zod/v4/locales/nn.cjs +2 -0
- package/node_modules/zod/v4/locales/nn.js +2 -0
- package/node_modules/zod/v4/locales/no.cjs +2 -0
- package/node_modules/zod/v4/locales/no.js +2 -0
- package/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/node_modules/zod/v4/locales/ota.js +2 -0
- package/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/node_modules/zod/v4/locales/pl.js +2 -0
- package/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/node_modules/zod/v4/locales/ps.js +2 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
- package/node_modules/zod/v4/locales/pt-BR.js +2 -0
- package/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/node_modules/zod/v4/locales/pt.js +2 -0
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/node_modules/zod/v4/locales/ru.js +2 -0
- package/node_modules/zod/v4/locales/sk.cjs +2 -0
- package/node_modules/zod/v4/locales/sk.js +2 -0
- package/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/node_modules/zod/v4/locales/sl.js +2 -0
- package/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/node_modules/zod/v4/locales/sv.js +2 -0
- package/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/node_modules/zod/v4/locales/ta.js +2 -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 +2 -0
- package/node_modules/zod/v4/locales/th.js +2 -0
- package/node_modules/zod/v4/locales/tk.cjs +2 -0
- package/node_modules/zod/v4/locales/tk.js +2 -0
- package/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/node_modules/zod/v4/locales/tr.js +2 -0
- package/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/node_modules/zod/v4/locales/uk.js +2 -0
- package/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/node_modules/zod/v4/locales/ur.js +2 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/node_modules/zod/v4/locales/vi.js +2 -0
- package/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/node_modules/zod/v4/locales/yo.js +2 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-CN.js +2 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-TW.js +2 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -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 +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +44 -8
- package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
- package/node_modules/zod/v4/mini/schemas.js +21 -6
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +4 -2
- package/package.json +7 -7
- package/dist/api.js +0 -3
- package/dist/runtime-api.js +0 -2
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Virtualizer.js","names":[],"sources":["../../src/components/Virtualizer.ts"],"sourcesContent":["import {\n dequeueRender,\n queueRender,\n} from '../managers/UniversalRenderingManager';\nimport type { VirtualWindowSpecs } from '../types';\nimport { areVirtualWindowSpecsEqual } from '../utils/areVirtualWindowSpecsEqual';\nimport { createWindowFromScrollPosition } from '../utils/createWindowFromScrollPosition';\n\ninterface SubscribedInstance {\n onRender(dirty: boolean): boolean;\n reconcileHeights(): boolean;\n setVisibility(visible: boolean): void;\n}\n\ninterface ScrollAnchor {\n fileElement: HTMLElement;\n fileTypeOffset: 'top' | 'bottom';\n fileOffset: number;\n lineIndex: string | undefined;\n lineOffset: number | undefined;\n}\n\n// 800 seems like the healthy overscan required to\n// keep safari from blanking... if we catch it tho, maybe 900\nconst DEFAULT_OVERSCROLL_SIZE = 1000;\nconst INTERSECTION_OBSERVER_MARGIN = DEFAULT_OVERSCROLL_SIZE * 4;\nconst INTERSECTION_OBSERVER_THRESHOLD = [0, 0.000001, 0.99999, 1];\n\nexport interface VirtualizerConfig {\n /** Extra pixels rendered above and below the viewport to reduce blanking during fast scrolls. */\n overscrollSize: number;\n /** Margin used by IntersectionObserver to decide when items should be considered visible. */\n intersectionObserverMargin: number;\n /** Enables noisy resize logs to help tune metrics and investigate scroll jitter. */\n resizeDebugging: boolean;\n}\n\nexport interface VirtualizerScrollOptions {\n top: number;\n behavior?: ScrollBehavior;\n}\n\nconst DEFAULT_VIRTUALIZER_CONFIG: VirtualizerConfig = {\n overscrollSize: DEFAULT_OVERSCROLL_SIZE,\n intersectionObserverMargin: INTERSECTION_OBSERVER_MARGIN,\n resizeDebugging: false,\n};\n\nlet lastSize = 0;\n\nlet instance = -1;\n\nexport class Virtualizer {\n static __STOP: boolean = false;\n static __lastScrollPosition = 0;\n\n public readonly __id: string = `virtualizer-${++instance}`;\n public readonly config: VirtualizerConfig;\n public type = 'simple' as const;\n private intersectionObserver: IntersectionObserver | undefined;\n private scrollTop: number = 0;\n private height: number = 0;\n private scrollHeight: number = 0;\n private windowSpecs: VirtualWindowSpecs = { top: 0, bottom: 0 };\n private root: HTMLElement | Document | undefined;\n private contentContainer: HTMLElement | undefined;\n\n private resizeObserver: ResizeObserver | undefined;\n private observers: Map<HTMLElement, SubscribedInstance> = new Map();\n private visibleInstances: Map<HTMLElement, SubscribedInstance> = new Map();\n private visibleInstancesDirty: boolean = false;\n private instancesChanged: Set<SubscribedInstance> = new Set();\n // Instances whose content was (re)painted outside a virtualizer-driven\n // onRender — host/React render calls, async highlight completions — and\n // still need a measured-height reconciliation pass. See\n // requestHeightReconcile.\n private reconcileQueue: Set<SubscribedInstance> = new Set();\n\n private scrollDirty = true;\n private heightDirty = true;\n private scrollHeightDirty = true;\n private renderedObservers = 0;\n private connectQueue: Map<HTMLElement, SubscribedInstance> = new Map();\n\n constructor(config?: Partial<VirtualizerConfig>) {\n this.config = { ...DEFAULT_VIRTUALIZER_CONFIG, ...config };\n }\n\n setup(root: HTMLElement | Document, contentContainer?: Element): void {\n if (this.root != null) {\n return;\n }\n this.root = root;\n this.resizeObserver = new ResizeObserver(this.handleContainerResize);\n this.intersectionObserver = new IntersectionObserver(\n this.handleIntersectionChange,\n {\n root: this.root,\n threshold: INTERSECTION_OBSERVER_THRESHOLD,\n rootMargin: `${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`,\n // FIXME(amadeus): Figure out the other settings we'll want in here, or\n // if we should make them configurable...\n }\n );\n if (root instanceof Document) {\n this.setupWindow();\n } else {\n this.setupElement(contentContainer);\n }\n\n // FIXME(amadeus): Remove me before release\n window.__INSTANCE = this;\n window.__TOGGLE = () => {\n if (Virtualizer.__STOP) {\n Virtualizer.__STOP = false;\n const scroller = this.getScrollContainerElement() ?? window;\n scroller.scrollTo({ top: Virtualizer.__lastScrollPosition });\n queueRender(this.computeRenderRangeAndEmit);\n } else {\n Virtualizer.__lastScrollPosition = this.getScrollTop();\n Virtualizer.__STOP = true;\n }\n };\n for (const [container, instance] of this.connectQueue.entries()) {\n this.connect(container, instance);\n }\n this.connectQueue.clear();\n this.markDOMDirty();\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n instanceChanged(instance: SubscribedInstance, domDirty: boolean): void {\n this.instancesChanged.add(instance);\n if (domDirty) {\n this.markDOMDirty();\n }\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n // The render loop only reconciles heights for instances it repainted\n // itself, but content can also land outside a virtualizer pass (a\n // host/React-driven render call, an async highlight completion). Those\n // renders queue themselves here so their measured line deltas — wrapped\n // lines, annotation heights — are re-captured; otherwise a layout reset\n // (e.g. an edit-session exit recompute) leaves the instance stuck on its\n // baseline estimate and its placeholder renders the wrong height.\n requestHeightReconcile(instance: SubscribedInstance): void {\n this.reconcileQueue.add(instance);\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n getWindowSpecs(): VirtualWindowSpecs {\n if (this.windowSpecs.top === 0 && this.windowSpecs.bottom === 0) {\n this.windowSpecs = createWindowFromScrollPosition({\n scrollTop: this.getScrollTop(),\n height: this.getHeight(),\n scrollHeight: this.getScrollHeight(),\n overscrollSize: this.config.overscrollSize,\n });\n }\n return this.windowSpecs;\n }\n\n getRoot(): HTMLElement | Document | undefined {\n return this.root;\n }\n\n isInstanceVisible(elementTop: number, elementHeight: number): boolean {\n const scrollTop = this.getScrollTop();\n const height = this.getHeight();\n const margin = this.config.intersectionObserverMargin;\n const top = scrollTop - margin;\n const bottom = scrollTop + height + margin;\n return !(elementTop < top - elementHeight || elementTop > bottom);\n }\n\n private handleContainerResize = (entries: ResizeObserverEntry[]) => {\n if (this.root == null) return;\n let shouldQueueUpdate = false;\n for (const entry of entries) {\n const blockSize = entry.borderBoxSize[0].blockSize;\n if (this.root instanceof Document) {\n if (blockSize !== this.scrollHeight) {\n this.scrollHeightDirty = true;\n shouldQueueUpdate = true;\n if (this.config.resizeDebugging) {\n console.log('Virtualizer: content size change', this.__id, {\n sizeChange: blockSize - lastSize,\n newSize: blockSize,\n });\n lastSize = blockSize;\n }\n }\n } else {\n if (entry.target === this.root) {\n if (blockSize !== this.height) {\n this.heightDirty = true;\n shouldQueueUpdate = true;\n }\n } else if (entry.target === this.contentContainer) {\n this.scrollHeightDirty = true;\n shouldQueueUpdate = true;\n if (this.config.resizeDebugging) {\n console.log('Virtualizer: scroller size change', this.__id, {\n sizeChange: blockSize - lastSize,\n newSize: blockSize,\n });\n lastSize = blockSize;\n }\n }\n }\n }\n\n if (shouldQueueUpdate) {\n queueRender(this.computeRenderRangeAndEmit);\n }\n };\n\n private setupWindow() {\n if (this.root == null || !(this.root instanceof Document)) {\n throw new Error('Virtualizer.setupWindow: Invalid setup method');\n }\n window.addEventListener('scroll', this.handleWindowScroll, {\n passive: true,\n });\n window.addEventListener('resize', this.handleWindowResize, {\n passive: true,\n });\n this.resizeObserver?.observe(this.root.documentElement);\n }\n\n private setupElement(contentContainer: Element | undefined) {\n if (this.root == null || this.root instanceof Document) {\n throw new Error('Virtualizer.setupElement: Invalid setup method');\n }\n this.root.addEventListener('scroll', this.handleElementScroll, {\n passive: true,\n });\n this.resizeObserver?.observe(this.root);\n contentContainer ??= this.root.firstElementChild ?? undefined;\n if (contentContainer instanceof HTMLElement) {\n this.contentContainer = contentContainer;\n this.resizeObserver?.observe(contentContainer);\n }\n }\n\n cleanUp(): void {\n dequeueRender(this.computeRenderRangeAndEmit);\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = undefined;\n this.root?.removeEventListener('scroll', this.handleElementScroll);\n window.removeEventListener('scroll', this.handleWindowScroll);\n window.removeEventListener('resize', this.handleWindowResize);\n this.root = undefined;\n this.contentContainer = undefined;\n this.observers.clear();\n this.visibleInstances.clear();\n this.instancesChanged.clear();\n this.reconcileQueue.clear();\n this.connectQueue.clear();\n this.visibleInstancesDirty = false;\n this.windowSpecs = { top: 0, bottom: 0 };\n this.scrollTop = 0;\n this.height = 0;\n this.scrollHeight = 0;\n this.scrollDirty = true;\n this.heightDirty = true;\n this.scrollHeightDirty = true;\n }\n\n getOffsetInScrollContainer(element: HTMLElement): number {\n return (\n this.getScrollTop() +\n getRelativeBoundingTop(element, this.getScrollContainerElement())\n );\n }\n\n connect(container: HTMLElement, instance: SubscribedInstance): () => void {\n if (this.observers.has(container)) {\n throw new Error('Virtualizer.connect: instance is already connected...');\n }\n // If we are racing against the intersectionObserver, then we should just\n // queue up the connection for when the observer does get set up\n if (this.intersectionObserver == null) {\n this.connectQueue.set(container, instance);\n } else {\n // FIXME(amadeus): Go through the connection phase a bit more closely...\n this.intersectionObserver.observe(container);\n this.observers.set(container, instance);\n this.instancesChanged.add(instance);\n this.markDOMDirty();\n queueRender(this.computeRenderRangeAndEmit);\n }\n return () => this.disconnect(container);\n }\n\n disconnect(container: HTMLElement): void {\n const instance = this.observers.get(container);\n this.connectQueue.delete(container);\n if (instance == null) {\n return;\n }\n this.intersectionObserver?.unobserve(container);\n this.observers.delete(container);\n this.instancesChanged.delete(instance);\n this.reconcileQueue.delete(instance);\n if (this.visibleInstances.delete(container)) {\n this.visibleInstancesDirty = true;\n }\n this.markDOMDirty();\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n private handleWindowResize = () => {\n if (Virtualizer.__STOP || window.innerHeight === this.height) {\n return;\n }\n this.heightDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n };\n\n private handleWindowScroll = () => {\n if (\n Virtualizer.__STOP ||\n this.root == null ||\n !(this.root instanceof Document)\n ) {\n return;\n }\n this.scrollDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n };\n\n private handleElementScroll = () => {\n if (\n Virtualizer.__STOP ||\n this.root == null ||\n this.root instanceof Document\n ) {\n return;\n }\n this.scrollDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n };\n\n private computeRenderRangeAndEmit = () => {\n if (Virtualizer.__STOP) {\n return;\n }\n const wrapperDirty = this.heightDirty || this.scrollHeightDirty;\n let instancesHaveChanged = this.instancesChanged.size > 0;\n\n // If we got an emitted update from a bunch of instances, we should skip\n // the window check first and attempt to render with existing logic first\n // and then queue up a corrected render after\n if (this.instancesChanged.size === 0) {\n const windowSpecs = createWindowFromScrollPosition({\n scrollTop: this.getScrollTop(),\n height: this.getHeight(),\n scrollHeight: this.getScrollHeight(),\n overscrollSize: this.config.overscrollSize,\n });\n if (\n !wrapperDirty &&\n areVirtualWindowSpecsEqual(this.windowSpecs, windowSpecs) &&\n this.renderedObservers === this.observers.size &&\n !this.visibleInstancesDirty &&\n this.reconcileQueue.size === 0\n ) {\n return;\n }\n this.windowSpecs = windowSpecs;\n }\n this.visibleInstancesDirty = false;\n this.renderedObservers = this.observers.size;\n const anchor = this.getScrollAnchor(this.height);\n const updatedInstances = new Set<SubscribedInstance>();\n // NOTE(amadeus): If the wrapper is dirty, we need to force every component\n // to re-render\n for (const instance of wrapperDirty\n ? this.observers.values()\n : this.visibleInstances.values()) {\n if (instance.onRender(wrapperDirty)) {\n updatedInstances.add(instance);\n }\n }\n for (const instance of this.instancesChanged) {\n if (updatedInstances.has(instance)) continue;\n if (instance.onRender(wrapperDirty)) {\n updatedInstances.add(instance);\n }\n }\n\n this.scrollFix(anchor);\n\n for (const instance of updatedInstances) {\n this.reconcileQueue.delete(instance);\n instance.reconcileHeights();\n }\n // Reconcile externally-rendered instances that may have new heights\n for (const instance of this.reconcileQueue) {\n if (instance.reconcileHeights()) {\n instancesHaveChanged = true;\n }\n }\n this.reconcileQueue.clear();\n instancesHaveChanged ||= this.instancesChanged.size > 0;\n\n // Reconciliation reads virtualized offsets and can consume dirty geometry\n // flags, so mark after it when an instance update needs a corrected pass.\n if (instancesHaveChanged) {\n this.markDOMDirty();\n }\n\n if (instancesHaveChanged || wrapperDirty) {\n queueRender(this.computeRenderRangeAndEmit);\n }\n updatedInstances.clear();\n this.instancesChanged.clear();\n };\n\n private scrollFix(anchor: ScrollAnchor | undefined) {\n if (anchor == null) {\n return;\n }\n const scrollContainer = this.getScrollContainerElement();\n const { lineIndex, lineOffset, fileElement, fileOffset, fileTypeOffset } =\n anchor;\n if (lineIndex != null && lineOffset != null) {\n const element = fileElement.shadowRoot?.querySelector(\n `[data-line][data-line-index=\"${lineIndex}\"]`\n );\n if (element instanceof HTMLElement) {\n const top = getRelativeBoundingTop(element, scrollContainer);\n if (top !== lineOffset) {\n const scrollOffset = top - lineOffset;\n this.applyScrollFix(scrollOffset);\n }\n return;\n }\n }\n const top = getRelativeBoundingTop(fileElement, scrollContainer);\n if (fileTypeOffset === 'top') {\n if (top !== fileOffset) {\n this.applyScrollFix(top - fileOffset);\n }\n } else {\n const bottom = top + fileElement.getBoundingClientRect().height;\n if (bottom !== fileOffset) {\n this.applyScrollFix(bottom - fileOffset);\n }\n }\n }\n\n private applyScrollFix(scrollOffset: number) {\n if (this.root == null || this.root instanceof Document) {\n window.scrollTo({\n top: window.scrollY + scrollOffset,\n behavior: 'instant',\n });\n } else {\n this.root.scrollTo({\n top: this.root.scrollTop + scrollOffset,\n behavior: 'instant',\n });\n }\n // Because we fixed our scroll positions, it means something resized or\n // moved around, so we should mark everything as dirty so the\n // reconciliation call will get the latest data when figuring calling\n // .getOffsetInScrollContainer\n this.markDOMDirty();\n }\n\n // This function tries to figure out the closest file or line to the viewport\n // top that's visible to use as a relative marker for how to fix scroll\n // position after issuing dom updates\n private getScrollAnchor(viewportHeight: number): ScrollAnchor | undefined {\n const scrollContainer = this.getScrollContainerElement();\n let bestAnchor: ScrollAnchor | undefined;\n\n for (const [fileElement] of this.visibleInstances.entries()) {\n const fileTop = getRelativeBoundingTop(fileElement, scrollContainer);\n const fileBottom = fileTop + fileElement.offsetHeight;\n\n // Determine file offset and type based on position\n // Only use bottom anchor when entire file is above viewport\n let fileOffset: number;\n let fileTypeOffset: 'top' | 'bottom';\n if (fileBottom <= 0) {\n // Entire file is above viewport - use bottom as anchor\n fileOffset = fileBottom;\n fileTypeOffset = 'bottom';\n } else {\n // File is at least partially visible or below - use top\n fileOffset = fileTop;\n fileTypeOffset = 'top';\n }\n\n // Find the best line (first fully visible) within this file\n let bestLineIndex: string | undefined;\n let bestLineOffset: number | undefined;\n\n // Only search for lines if file potentially intersects viewport\n if (fileBottom > 0 && fileTop < viewportHeight) {\n for (const line of fileElement.shadowRoot?.querySelectorAll(\n '[data-line][data-line-index]'\n ) ?? []) {\n if (!(line instanceof HTMLElement)) continue;\n const lineIndex = line.dataset.lineIndex;\n if (lineIndex == null) continue;\n\n const lineOffset = getRelativeBoundingTop(line, scrollContainer);\n\n // Ignore lines with negative offsets (above viewport top)\n if (lineOffset < 0) continue;\n\n // First visible line in DOM order is the best one because\n // querySelectorAll will grab lines in order as they appear in the\n // DOM\n bestLineIndex = lineIndex;\n bestLineOffset = lineOffset;\n break;\n }\n }\n\n // If we already have an anchor with a visible line, skip files without one\n if (bestAnchor?.lineOffset != null && bestLineOffset == null) {\n continue;\n }\n\n // Decide if this file should become the new best anchor\n let shouldReplace = false;\n // If we don't already have an anchor we should set one\n if (bestAnchor == null) {\n shouldReplace = true;\n }\n // If we found a better line anchor, we should replace the old one\n else if (\n bestLineOffset != null &&\n (bestAnchor.lineOffset == null ||\n bestLineOffset < bestAnchor.lineOffset)\n ) {\n shouldReplace = true;\n }\n // Otherwise we need to compare file only anchors\n else if (bestLineOffset == null && bestAnchor.lineOffset == null) {\n // Favor files with their tops in view\n if (\n fileOffset >= 0 &&\n (bestAnchor.fileOffset < 0 || fileOffset < bestAnchor.fileOffset)\n ) {\n shouldReplace = true;\n }\n // Or the closest file\n else if (\n fileOffset < 0 &&\n bestAnchor.fileOffset < 0 &&\n fileOffset > bestAnchor.fileOffset\n ) {\n shouldReplace = true;\n }\n }\n\n if (shouldReplace) {\n bestAnchor = {\n fileElement,\n fileTypeOffset,\n fileOffset,\n lineIndex: bestLineIndex,\n lineOffset: bestLineOffset,\n };\n }\n }\n\n return bestAnchor;\n }\n\n private handleIntersectionChange = (\n entries: IntersectionObserverEntry[]\n ): void => {\n this.scrollDirty = true;\n for (const { target, isIntersecting } of entries) {\n if (!(target instanceof HTMLElement)) {\n throw new Error(\n 'Virtualizer.handleIntersectionChange: target not an HTMLElement'\n );\n }\n const instance = this.observers.get(target);\n // IntersectionObserver delivers entries asynchronously, so an entry can\n // arrive after the target was unobserved via disconnect() or releaseElement().\n if (instance == null) {\n continue;\n }\n if (isIntersecting && !this.visibleInstances.has(target)) {\n instance.setVisibility(true);\n this.visibleInstances.set(target, instance);\n this.visibleInstancesDirty = true;\n } else if (!isIntersecting && this.visibleInstances.has(target)) {\n instance.setVisibility(false);\n this.visibleInstances.delete(target);\n this.visibleInstancesDirty = true;\n }\n }\n\n if (this.visibleInstancesDirty) {\n // Since this call is already debounced, should we just call\n // computeRenderRangeAndEmit directly?\n queueRender(this.computeRenderRangeAndEmit);\n }\n // Debug logging for visible instances\n // console.log(\n // 'handleIntersectionChange',\n // ...Array.from(this.visibleInstances.keys())\n // );\n };\n\n /** Return the logical vertical position for the scroll container */\n public getScrollTop(): number {\n if (!this.scrollDirty) {\n return this.scrollTop;\n }\n this.scrollDirty = false;\n let scrollTop = (() => {\n if (this.root == null) {\n return 0;\n }\n if (this.root instanceof Document) {\n return window.scrollY;\n }\n return this.root.scrollTop;\n })();\n\n // Lets always make sure to clamp scroll position cases of\n // over/bounce scroll\n scrollTop = this.clampScrollTop(scrollTop);\n this.scrollTop = scrollTop;\n return scrollTop;\n }\n\n /** Scroll to a logical vertical position and queue the normal render pass. */\n public scrollTo({ top, behavior = 'auto' }: VirtualizerScrollOptions): void {\n const { root } = this;\n if (root == null) {\n return;\n }\n\n const scrollTop = this.clampScrollTop(top);\n if (root instanceof Document) {\n window.scrollTo({ top: scrollTop, behavior });\n } else {\n root.scrollTo({ top: scrollTop, behavior });\n }\n this.scrollDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n private clampScrollTop(scrollTop: number): number {\n return Math.max(\n 0,\n Math.min(scrollTop, this.getScrollHeight() - this.getHeight())\n );\n }\n\n private getScrollHeight() {\n if (!this.scrollHeightDirty) {\n return this.scrollHeight;\n }\n this.scrollHeightDirty = false;\n this.scrollHeight = (() => {\n if (this.root == null) {\n return 0;\n }\n if (this.root instanceof Document) {\n return this.root.documentElement.scrollHeight;\n }\n return this.root.scrollHeight;\n })();\n return this.scrollHeight;\n }\n\n private getHeight() {\n if (!this.heightDirty) {\n return this.height;\n }\n this.heightDirty = false;\n this.height = (() => {\n if (this.root == null) {\n return 0;\n }\n if (this.root instanceof Document) {\n return globalThis.innerHeight;\n }\n return this.root.getBoundingClientRect().height;\n })();\n return this.height;\n }\n\n markDOMDirty(): void {\n this.scrollDirty = true;\n this.scrollHeightDirty = true;\n this.heightDirty = true;\n }\n\n private getScrollContainerElement(): HTMLElement | undefined {\n return this.root == null || this.root instanceof Document\n ? undefined\n : this.root;\n }\n}\n\n// This function is like a generalized getBoundingClientRect for it's relative\n// scroll container\nfunction getRelativeBoundingTop(\n element: HTMLElement,\n scrollContainer: HTMLElement | undefined\n) {\n const rect = element.getBoundingClientRect();\n const scrollContainerTop = scrollContainer?.getBoundingClientRect().top ?? 0;\n return rect.top - scrollContainerTop;\n}\n"],"mappings":";;;;AAwBA,MAAM,0BAA0B;AAChC,MAAM,+BAA+B,0BAA0B;AAC/D,MAAM,kCAAkC;CAAC;CAAG;CAAU;CAAS;AAAC;AAgBhE,MAAM,6BAAgD;CACpD,gBAAgB;CAChB,4BAA4B;CAC5B,iBAAiB;AACnB;AAEA,IAAI,WAAW;AAEf,IAAI,WAAW;AAEf,IAAa,cAAb,MAAa,YAAY;CACvB,OAAO,SAAkB;CACzB,OAAO,uBAAuB;CAE9B,OAA+B,eAAe,EAAE;CAChD;CACA,OAAc;CACd;CACA,YAA4B;CAC5B,SAAyB;CACzB,eAA+B;CAC/B,cAA0C;EAAE,KAAK;EAAG,QAAQ;CAAE;CAC9D;CACA;CAEA;CACA,4BAA0D,IAAI,IAAI;CAClE,mCAAiE,IAAI,IAAI;CACzE,wBAAyC;CACzC,mCAAoD,IAAI,IAAI;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ACzB,KAAK,cAAc;CACrB;CAEA,4BAA6D;EAC3D,OAAO,KAAK,QAAQ,QAAQ,KAAK,gBAAgB,WAC7C,KAAA,IACA,KAAK;CACX;AACF;AAIA,SAAS,uBACP,SACA,iBACA;CACA,MAAM,OAAO,QAAQ,sBAAsB;CAC3C,MAAM,qBAAqB,iBAAiB,sBAAsB,CAAC,CAAC,OAAO;CAC3E,OAAO,KAAK,MAAM;AACpB"}
|
|
1
|
+
{"version":3,"file":"Virtualizer.js","names":[],"sources":["../../src/components/Virtualizer.ts"],"sourcesContent":["import {\n dequeueRender,\n queueRender,\n} from '../managers/UniversalRenderingManager';\nimport type { VirtualWindowSpecs } from '../types';\nimport { areVirtualWindowSpecsEqual } from '../utils/areVirtualWindowSpecsEqual';\nimport { createWindowFromScrollPosition } from '../utils/createWindowFromScrollPosition';\n\ninterface SubscribedInstance {\n onRender(dirty: boolean): boolean;\n reconcileHeights(): boolean;\n setVisibility(visible: boolean): void;\n}\n\ninterface ScrollAnchor {\n fileElement: HTMLElement;\n fileTypeOffset: 'top' | 'bottom';\n fileOffset: number;\n lineIndex: string | undefined;\n lineOffset: number | undefined;\n}\n\n// 800 seems like the healthy overscan required to\n// keep safari from blanking... if we catch it tho, maybe 900\nconst DEFAULT_OVERSCROLL_SIZE = 1000;\nconst INTERSECTION_OBSERVER_MARGIN = DEFAULT_OVERSCROLL_SIZE * 4;\nconst INTERSECTION_OBSERVER_THRESHOLD = [0, 0.000001, 0.99999, 1];\n\nexport interface VirtualizerConfig {\n /** Extra pixels rendered above and below the viewport to reduce blanking during fast scrolls. */\n overscrollSize: number;\n /** Margin used by IntersectionObserver to decide when items should be considered visible. */\n intersectionObserverMargin: number;\n /** Enables noisy resize logs to help tune metrics and investigate scroll jitter. */\n resizeDebugging: boolean;\n}\n\nexport interface VirtualizerScrollOptions {\n top: number;\n behavior?: ScrollBehavior;\n}\n\nconst DEFAULT_VIRTUALIZER_CONFIG: VirtualizerConfig = {\n overscrollSize: DEFAULT_OVERSCROLL_SIZE,\n intersectionObserverMargin: INTERSECTION_OBSERVER_MARGIN,\n resizeDebugging: false,\n};\n\nlet lastSize = 0;\n\nlet instance = -1;\n\nexport class Virtualizer {\n static __STOP: boolean = false;\n static __lastScrollPosition = 0;\n\n public readonly __id: string = `virtualizer-${++instance}`;\n public readonly config: VirtualizerConfig;\n public type = 'simple' as const;\n private intersectionObserver: IntersectionObserver | undefined;\n private scrollTop: number = 0;\n private height: number = 0;\n private scrollHeight: number = 0;\n private windowSpecs: VirtualWindowSpecs = { top: 0, bottom: 0 };\n private root: HTMLElement | Document | undefined;\n private contentContainer: HTMLElement | undefined;\n\n private resizeObserver: ResizeObserver | undefined;\n private observers: Map<HTMLElement, SubscribedInstance> = new Map();\n private visibleInstances: Map<HTMLElement, SubscribedInstance> = new Map();\n private visibleInstancesDirty: boolean = false;\n private instancesChanged: Set<SubscribedInstance> = new Set();\n // Instances whose content was (re)painted outside a virtualizer-driven\n // onRender — host/React render calls, async highlight completions — and\n // still need a measured-height reconciliation pass. See\n // requestHeightReconcile.\n private reconcileQueue: Set<SubscribedInstance> = new Set();\n\n private scrollDirty = true;\n private heightDirty = true;\n private scrollHeightDirty = true;\n private renderedObservers = 0;\n private connectQueue: Map<HTMLElement, SubscribedInstance> = new Map();\n\n constructor(config?: Partial<VirtualizerConfig>) {\n this.config = { ...DEFAULT_VIRTUALIZER_CONFIG, ...config };\n }\n\n setup(root: HTMLElement | Document, contentContainer?: Element): void {\n if (this.root != null) {\n return;\n }\n this.root = root;\n this.resizeObserver = new ResizeObserver(this.handleContainerResize);\n this.intersectionObserver = new IntersectionObserver(\n this.handleIntersectionChange,\n {\n root: this.root,\n threshold: INTERSECTION_OBSERVER_THRESHOLD,\n rootMargin: `${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`,\n // FIXME(amadeus): Figure out the other settings we'll want in here, or\n // if we should make them configurable...\n }\n );\n if (root instanceof Document) {\n this.setupWindow();\n } else {\n this.setupElement(contentContainer);\n }\n\n // FIXME(amadeus): Remove me before release\n window.__INSTANCE = this;\n window.__TOGGLE = () => {\n if (Virtualizer.__STOP) {\n Virtualizer.__STOP = false;\n const scroller = this.getScrollContainerElement() ?? window;\n scroller.scrollTo({ top: Virtualizer.__lastScrollPosition });\n queueRender(this.computeRenderRangeAndEmit);\n } else {\n Virtualizer.__lastScrollPosition = this.getScrollTop();\n Virtualizer.__STOP = true;\n }\n };\n for (const [container, instance] of this.connectQueue.entries()) {\n this.connect(container, instance);\n }\n this.connectQueue.clear();\n this.markDOMDirty();\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n instanceChanged(instance: SubscribedInstance, domDirty: boolean): void {\n this.instancesChanged.add(instance);\n if (domDirty) {\n this.markDOMDirty();\n }\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n // The render loop only reconciles heights for instances it repainted\n // itself, but content can also land outside a virtualizer pass (a\n // host/React-driven render call, an async highlight completion). Those\n // renders queue themselves here so their measured line deltas — wrapped\n // lines, annotation heights — are re-captured; otherwise a layout reset\n // (e.g. an edit-session exit recompute) leaves the instance stuck on its\n // baseline estimate and its placeholder renders the wrong height.\n requestHeightReconcile(instance: SubscribedInstance): void {\n this.reconcileQueue.add(instance);\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n getWindowSpecs(): VirtualWindowSpecs {\n if (this.windowSpecs.top === 0 && this.windowSpecs.bottom === 0) {\n this.windowSpecs = createWindowFromScrollPosition({\n scrollTop: this.getScrollTop(),\n height: this.getHeight(),\n scrollHeight: this.getScrollHeight(),\n overscrollSize: this.config.overscrollSize,\n });\n }\n return this.windowSpecs;\n }\n\n getRoot(): HTMLElement | Document | undefined {\n return this.root;\n }\n\n isInstanceVisible(elementTop: number, elementHeight: number): boolean {\n const scrollTop = this.getScrollTop();\n const height = this.getHeight();\n const margin = this.config.intersectionObserverMargin;\n const top = scrollTop - margin;\n const bottom = scrollTop + height + margin;\n return !(elementTop < top - elementHeight || elementTop > bottom);\n }\n\n private handleContainerResize = (entries: ResizeObserverEntry[]) => {\n if (this.root == null) return;\n let shouldQueueUpdate = false;\n for (const entry of entries) {\n const blockSize = entry.borderBoxSize[0].blockSize;\n if (this.root instanceof Document) {\n if (blockSize !== this.scrollHeight) {\n this.scrollHeightDirty = true;\n shouldQueueUpdate = true;\n if (this.config.resizeDebugging) {\n console.log('Virtualizer: content size change', this.__id, {\n sizeChange: blockSize - lastSize,\n newSize: blockSize,\n });\n lastSize = blockSize;\n }\n }\n } else {\n if (entry.target === this.root) {\n if (blockSize !== this.height) {\n this.heightDirty = true;\n shouldQueueUpdate = true;\n }\n } else if (entry.target === this.contentContainer) {\n this.scrollHeightDirty = true;\n shouldQueueUpdate = true;\n if (this.config.resizeDebugging) {\n console.log('Virtualizer: scroller size change', this.__id, {\n sizeChange: blockSize - lastSize,\n newSize: blockSize,\n });\n lastSize = blockSize;\n }\n }\n }\n }\n\n if (shouldQueueUpdate) {\n queueRender(this.computeRenderRangeAndEmit);\n }\n };\n\n private setupWindow() {\n if (this.root == null || !(this.root instanceof Document)) {\n throw new Error('Virtualizer.setupWindow: Invalid setup method');\n }\n window.addEventListener('scroll', this.handleWindowScroll, {\n passive: true,\n });\n window.addEventListener('resize', this.handleWindowResize, {\n passive: true,\n });\n this.resizeObserver?.observe(this.root.documentElement);\n }\n\n private setupElement(contentContainer: Element | undefined) {\n if (this.root == null || this.root instanceof Document) {\n throw new Error('Virtualizer.setupElement: Invalid setup method');\n }\n this.root.addEventListener('scroll', this.handleElementScroll, {\n passive: true,\n });\n this.resizeObserver?.observe(this.root);\n contentContainer ??= this.root.firstElementChild ?? undefined;\n if (contentContainer instanceof HTMLElement) {\n this.contentContainer = contentContainer;\n this.resizeObserver?.observe(contentContainer);\n }\n }\n\n cleanUp(): void {\n dequeueRender(this.computeRenderRangeAndEmit);\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = undefined;\n this.root?.removeEventListener('scroll', this.handleElementScroll);\n window.removeEventListener('scroll', this.handleWindowScroll);\n window.removeEventListener('resize', this.handleWindowResize);\n this.root = undefined;\n this.contentContainer = undefined;\n this.observers.clear();\n this.visibleInstances.clear();\n this.instancesChanged.clear();\n this.reconcileQueue.clear();\n this.connectQueue.clear();\n this.visibleInstancesDirty = false;\n this.windowSpecs = { top: 0, bottom: 0 };\n this.scrollTop = 0;\n this.height = 0;\n this.scrollHeight = 0;\n this.scrollDirty = true;\n this.heightDirty = true;\n this.scrollHeightDirty = true;\n }\n\n getOffsetInScrollContainer(element: HTMLElement): number {\n return (\n this.getScrollTop() +\n getRelativeBoundingTop(element, this.getScrollContainerElement())\n );\n }\n\n connect(container: HTMLElement, instance: SubscribedInstance): () => void {\n if (this.observers.has(container)) {\n throw new Error('Virtualizer.connect: instance is already connected...');\n }\n // If we are racing against the intersectionObserver, then we should just\n // queue up the connection for when the observer does get set up\n if (this.intersectionObserver == null) {\n this.connectQueue.set(container, instance);\n } else {\n // FIXME(amadeus): Go through the connection phase a bit more closely...\n this.intersectionObserver.observe(container);\n this.observers.set(container, instance);\n this.instancesChanged.add(instance);\n this.markDOMDirty();\n queueRender(this.computeRenderRangeAndEmit);\n }\n return () => this.disconnect(container);\n }\n\n disconnect(container: HTMLElement): void {\n const instance = this.observers.get(container);\n this.connectQueue.delete(container);\n if (instance == null) {\n return;\n }\n this.intersectionObserver?.unobserve(container);\n this.observers.delete(container);\n this.instancesChanged.delete(instance);\n this.reconcileQueue.delete(instance);\n if (this.visibleInstances.delete(container)) {\n this.visibleInstancesDirty = true;\n }\n this.markDOMDirty();\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n private handleWindowResize = () => {\n if (Virtualizer.__STOP || window.innerHeight === this.height) {\n return;\n }\n this.heightDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n };\n\n private handleWindowScroll = () => {\n if (\n Virtualizer.__STOP ||\n this.root == null ||\n !(this.root instanceof Document)\n ) {\n return;\n }\n this.scrollDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n };\n\n private handleElementScroll = () => {\n if (\n Virtualizer.__STOP ||\n this.root == null ||\n this.root instanceof Document\n ) {\n return;\n }\n this.scrollDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n };\n\n private computeRenderRangeAndEmit = () => {\n if (Virtualizer.__STOP) {\n return;\n }\n const wrapperDirty = this.heightDirty || this.scrollHeightDirty;\n let instancesHaveChanged = this.instancesChanged.size > 0;\n\n // If we got an emitted update from a bunch of instances, we should skip\n // the window check first and attempt to render with existing logic first\n // and then queue up a corrected render after\n if (this.instancesChanged.size === 0) {\n const windowSpecs = createWindowFromScrollPosition({\n scrollTop: this.getScrollTop(),\n height: this.getHeight(),\n scrollHeight: this.getScrollHeight(),\n overscrollSize: this.config.overscrollSize,\n });\n if (\n !wrapperDirty &&\n areVirtualWindowSpecsEqual(this.windowSpecs, windowSpecs) &&\n this.renderedObservers === this.observers.size &&\n !this.visibleInstancesDirty &&\n this.reconcileQueue.size === 0\n ) {\n return;\n }\n this.windowSpecs = windowSpecs;\n }\n this.visibleInstancesDirty = false;\n this.renderedObservers = this.observers.size;\n const anchor = this.getScrollAnchor(this.height);\n const updatedInstances = new Set<SubscribedInstance>();\n // NOTE(amadeus): If the wrapper is dirty, we need to force every component\n // to re-render\n for (const instance of wrapperDirty\n ? this.observers.values()\n : this.visibleInstances.values()) {\n if (instance.onRender(wrapperDirty)) {\n updatedInstances.add(instance);\n }\n }\n for (const instance of this.instancesChanged) {\n if (updatedInstances.has(instance)) continue;\n if (instance.onRender(wrapperDirty)) {\n updatedInstances.add(instance);\n }\n }\n\n this.scrollFix(anchor);\n\n for (const instance of updatedInstances) {\n this.reconcileQueue.delete(instance);\n instance.reconcileHeights();\n }\n // Reconcile externally-rendered instances that may have new heights\n for (const instance of this.reconcileQueue) {\n if (instance.reconcileHeights()) {\n instancesHaveChanged = true;\n }\n }\n this.reconcileQueue.clear();\n instancesHaveChanged ||= this.instancesChanged.size > 0;\n\n // Reconciliation reads virtualized offsets and can consume dirty geometry\n // flags, so mark after it when an instance update needs a corrected pass.\n if (instancesHaveChanged) {\n this.markDOMDirty();\n }\n\n if (instancesHaveChanged || wrapperDirty) {\n queueRender(this.computeRenderRangeAndEmit);\n }\n updatedInstances.clear();\n this.instancesChanged.clear();\n };\n\n private scrollFix(anchor: ScrollAnchor | undefined) {\n if (anchor == null) {\n return;\n }\n const scrollContainer = this.getScrollContainerElement();\n const { lineIndex, lineOffset, fileElement, fileOffset, fileTypeOffset } =\n anchor;\n if (lineIndex != null && lineOffset != null) {\n const element = fileElement.shadowRoot?.querySelector(\n `[data-line][data-line-index=\"${lineIndex}\"]`\n );\n if (element instanceof HTMLElement) {\n const top = getRelativeBoundingTop(element, scrollContainer);\n if (top !== lineOffset) {\n const scrollOffset = top - lineOffset;\n this.applyScrollFix(scrollOffset);\n }\n return;\n }\n }\n const top = getRelativeBoundingTop(fileElement, scrollContainer);\n if (fileTypeOffset === 'top') {\n if (top !== fileOffset) {\n this.applyScrollFix(top - fileOffset);\n }\n } else {\n const bottom = top + fileElement.getBoundingClientRect().height;\n if (bottom !== fileOffset) {\n this.applyScrollFix(bottom - fileOffset);\n }\n }\n }\n\n private applyScrollFix(scrollOffset: number) {\n if (this.root == null || this.root instanceof Document) {\n window.scrollTo({\n top: window.scrollY + scrollOffset,\n behavior: 'instant',\n });\n } else {\n this.root.scrollTo({\n top: this.root.scrollTop + scrollOffset,\n behavior: 'instant',\n });\n }\n // Because we fixed our scroll positions, it means something resized or\n // moved around, so we should mark everything as dirty so the\n // reconciliation call will get the latest data when figuring calling\n // .getOffsetInScrollContainer\n this.markDOMDirty();\n }\n\n // This function tries to figure out the closest file or line to the viewport\n // top that's visible to use as a relative marker for how to fix scroll\n // position after issuing dom updates\n private getScrollAnchor(viewportHeight: number): ScrollAnchor | undefined {\n const scrollContainer = this.getScrollContainerElement();\n let bestAnchor: ScrollAnchor | undefined;\n\n for (const [fileElement] of this.visibleInstances.entries()) {\n const fileTop = getRelativeBoundingTop(fileElement, scrollContainer);\n const fileBottom = fileTop + fileElement.offsetHeight;\n\n // Determine file offset and type based on position\n // Only use bottom anchor when entire file is above viewport\n let fileOffset: number;\n let fileTypeOffset: 'top' | 'bottom';\n if (fileBottom <= 0) {\n // Entire file is above viewport - use bottom as anchor\n fileOffset = fileBottom;\n fileTypeOffset = 'bottom';\n } else {\n // File is at least partially visible or below - use top\n fileOffset = fileTop;\n fileTypeOffset = 'top';\n }\n\n // Find the best line (first fully visible) within this file\n let bestLineIndex: string | undefined;\n let bestLineOffset: number | undefined;\n\n // Only search for lines if file potentially intersects viewport\n if (fileBottom > 0 && fileTop < viewportHeight) {\n for (const line of fileElement.shadowRoot?.querySelectorAll(\n '[data-line][data-line-index]'\n ) ?? []) {\n if (!(line instanceof HTMLElement)) continue;\n const lineIndex = line.dataset.lineIndex;\n if (lineIndex == null) continue;\n\n const lineOffset = getRelativeBoundingTop(line, scrollContainer);\n\n // Ignore lines with negative offsets (above viewport top)\n if (lineOffset < 0) continue;\n\n // First visible line in DOM order is the best one because\n // querySelectorAll will grab lines in order as they appear in the\n // DOM\n bestLineIndex = lineIndex;\n bestLineOffset = lineOffset;\n break;\n }\n }\n\n // If we already have an anchor with a visible line, skip files without one\n if (bestAnchor?.lineOffset != null && bestLineOffset == null) {\n continue;\n }\n\n // Decide if this file should become the new best anchor\n let shouldReplace = false;\n // If we don't already have an anchor we should set one\n if (bestAnchor == null) {\n shouldReplace = true;\n }\n // If we found a better line anchor, we should replace the old one\n else if (\n bestLineOffset != null &&\n (bestAnchor.lineOffset == null ||\n bestLineOffset < bestAnchor.lineOffset)\n ) {\n shouldReplace = true;\n }\n // Otherwise we need to compare file only anchors\n else if (bestLineOffset == null && bestAnchor.lineOffset == null) {\n // Favor files with their tops in view\n if (\n fileOffset >= 0 &&\n (bestAnchor.fileOffset < 0 || fileOffset < bestAnchor.fileOffset)\n ) {\n shouldReplace = true;\n }\n // Or the closest file\n else if (\n fileOffset < 0 &&\n bestAnchor.fileOffset < 0 &&\n fileOffset > bestAnchor.fileOffset\n ) {\n shouldReplace = true;\n }\n }\n\n if (shouldReplace) {\n bestAnchor = {\n fileElement,\n fileTypeOffset,\n fileOffset,\n lineIndex: bestLineIndex,\n lineOffset: bestLineOffset,\n };\n }\n }\n\n return bestAnchor;\n }\n\n private handleIntersectionChange = (\n entries: IntersectionObserverEntry[]\n ): void => {\n this.scrollDirty = true;\n for (const { target, isIntersecting } of entries) {\n if (!(target instanceof HTMLElement)) {\n throw new Error(\n 'Virtualizer.handleIntersectionChange: target not an HTMLElement'\n );\n }\n const instance = this.observers.get(target);\n // IntersectionObserver delivers entries asynchronously, so an entry can\n // arrive after the target was unobserved via disconnect() or releaseElement().\n if (instance == null) {\n continue;\n }\n if (isIntersecting && !this.visibleInstances.has(target)) {\n instance.setVisibility(true);\n this.visibleInstances.set(target, instance);\n this.visibleInstancesDirty = true;\n } else if (!isIntersecting && this.visibleInstances.has(target)) {\n instance.setVisibility(false);\n this.visibleInstances.delete(target);\n this.visibleInstancesDirty = true;\n }\n }\n\n if (this.visibleInstancesDirty) {\n // Since this call is already debounced, should we just call\n // computeRenderRangeAndEmit directly?\n queueRender(this.computeRenderRangeAndEmit);\n }\n // Debug logging for visible instances\n // console.log(\n // 'handleIntersectionChange',\n // ...Array.from(this.visibleInstances.keys())\n // );\n };\n\n /** Return the logical vertical position for the scroll container */\n public getScrollTop(): number {\n if (!this.scrollDirty) {\n return this.scrollTop;\n }\n this.scrollDirty = false;\n let scrollTop = (() => {\n if (this.root == null) {\n return 0;\n }\n if (this.root instanceof Document) {\n return window.scrollY;\n }\n return this.root.scrollTop;\n })();\n\n // Lets always make sure to clamp scroll position cases of\n // over/bounce scroll\n scrollTop = this.clampScrollTop(scrollTop);\n this.scrollTop = scrollTop;\n return scrollTop;\n }\n\n /** Scroll to a logical vertical position and queue the normal render pass. */\n public scrollTo({ top, behavior = 'auto' }: VirtualizerScrollOptions): void {\n const { root } = this;\n if (root == null) {\n return;\n }\n\n const scrollTop = this.clampScrollTop(top);\n if (root instanceof Document) {\n window.scrollTo({ top: scrollTop, behavior });\n } else {\n root.scrollTo({ top: scrollTop, behavior });\n }\n this.scrollDirty = true;\n queueRender(this.computeRenderRangeAndEmit);\n }\n\n private clampScrollTop(scrollTop: number): number {\n return Math.max(\n 0,\n Math.min(scrollTop, this.getScrollHeight() - this.getHeight())\n );\n }\n\n private getScrollHeight() {\n if (!this.scrollHeightDirty) {\n return this.scrollHeight;\n }\n this.scrollHeightDirty = false;\n this.scrollHeight = (() => {\n if (this.root == null) {\n return 0;\n }\n if (this.root instanceof Document) {\n return this.root.documentElement.scrollHeight;\n }\n return this.root.scrollHeight;\n })();\n return this.scrollHeight;\n }\n\n private getHeight() {\n if (!this.heightDirty) {\n return this.height;\n }\n this.heightDirty = false;\n this.height = (() => {\n if (this.root == null) {\n return 0;\n }\n if (this.root instanceof Document) {\n return globalThis.innerHeight;\n }\n return this.root.getBoundingClientRect().height;\n })();\n return this.height;\n }\n\n markDOMDirty(): void {\n this.scrollDirty = true;\n this.scrollHeightDirty = true;\n this.heightDirty = true;\n }\n\n private getScrollContainerElement(): HTMLElement | undefined {\n return this.root == null || this.root instanceof Document\n ? undefined\n : this.root;\n }\n}\n\n// This function is like a generalized getBoundingClientRect for it's relative\n// scroll container\nfunction getRelativeBoundingTop(\n element: HTMLElement,\n scrollContainer: HTMLElement | undefined\n) {\n const rect = element.getBoundingClientRect();\n const scrollContainerTop = scrollContainer?.getBoundingClientRect().top ?? 0;\n return rect.top - scrollContainerTop;\n}\n"],"mappings":";;;;AAwBA,MAAM,0BAA0B;AAChC,MAAM,+BAA+B,0BAA0B;AAC/D,MAAM,kCAAkC;CAAC;CAAG;CAAU;CAAS;AAAC;AAgBhE,MAAM,6BAAgD;CACpD,gBAAgB;CAChB,4BAA4B;CAC5B,iBAAiB;AACnB;AAEA,IAAI,WAAW;AAEf,IAAI,WAAW;AAEf,IAAa,cAAb,MAAa,YAAY;CACvB,OAAO,SAAkB;CACzB,OAAO,uBAAu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,aACR,OAAO,KAAK;EAEd,KAAK,cAAc;EACnB,KAAK,gBAAgB;GACnB,IAAI,KAAK,QAAQ,MACf,OAAO;GAET,IAAI,KAAK,gBAAgB,UACvB,OAAO,WAAW;GAEpB,OAAO,KAAK,KAAK,sBAAsB,CAAC,CAAC;EAC3C,EAAA,CAAG;EACH,OAAO,KAAK;CACd;CAEA,eAAqB;EACnB,KAAK,cAAc;EACnB,KAAK,oBAAoB;EACzB,KAAK,cAAc;CACrB;CAEA,4BAA6D;EAC3D,OAAO,KAAK,QAAQ,QAAQ,KAAK,gBAAgB,WAC7C,KAAA,IACA,KAAK;CACX;AACF;AAIA,SAAS,uBACP,SACA,iBACA;CACA,MAAM,OAAO,QAAQ,sBAAsB;CAC3C,MAAM,qBAAqB,iBAAiB,sBAAsB,CAAC,CAAC,OAAO;CAC3E,OAAO,KAAK,MAAM;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtulizerDevelopment.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"VirtulizerDevelopment.d.ts","names":[],"sources":["../../src/components/VirtulizerDevelopment.d.ts"],"mappings":";;;;QAIQ;YACI;;IAER,aAAa,qBAAqB;IAClC;IACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-components.d.ts","names":[],"sources":["../../src/components/web-components.ts"],"mappings":";cAqCa
|
|
1
|
+
{"version":3,"file":"web-components.d.ts","names":[],"sources":["../../src/components/web-components.ts"],"mappings":";cAqCa"}
|
|
@@ -16,7 +16,8 @@ if (typeof HTMLElement !== "undefined" && customElements.get("diffs-container")
|
|
|
16
16
|
shadowRoot.adoptedStyleSheets = [sheet];
|
|
17
17
|
}
|
|
18
18
|
connectedCallback() {
|
|
19
|
-
|
|
19
|
+
const shadowRoot = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
20
|
+
getMeasuredScrollbarGutter(shadowRoot);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
customElements.define(DIFFS_TAG_NAME, FileDiffContainer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-components.js","names":["styles"],"sources":["../../src/components/web-components.ts"],"sourcesContent":["import { DIFFS_TAG_NAME } from '../constants';\nimport styles from '../style.css?inline';\nimport { getMeasuredScrollbarGutter } from '../utils/scrollbarGutter';\n\n// If HTMLElement is undefined it usually means we are in a server environment\n// so best to just not do anything\nif (\n typeof HTMLElement !== 'undefined' &&\n customElements.get(DIFFS_TAG_NAME) == null\n) {\n let sheet: CSSStyleSheet | undefined;\n\n class FileDiffContainer extends HTMLElement {\n constructor() {\n super();\n // If shadow root is already open, we can sorta assume the\n // CSS is already in place\n if (this.shadowRoot != null) {\n return;\n }\n const shadowRoot = this.attachShadow({ mode: 'open' });\n if (sheet == null) {\n sheet = new CSSStyleSheet();\n sheet.replaceSync(styles);\n }\n shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n connectedCallback() {\n const shadowRoot = this.shadowRoot ?? this.attachShadow({ mode: 'open' });\n getMeasuredScrollbarGutter(shadowRoot);\n }\n }\n\n customElements.define(DIFFS_TAG_NAME, FileDiffContainer);\n}\n\nexport const DiffsContainerLoaded = true;\n"],"mappings":";;;;AAMA,IACE,OAAO,gBAAgB,eACvB,eAAe,IAAA,iBAAkB,KAAK,MACtC;CACA,IAAI;CAEJ,MAAM,0BAA0B,YAAY;EAC1C,cAAc;GACZ,MAAM;GAGN,IAAI,KAAK,cAAc,MACrB;GAEF,MAAM,aAAa,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;GACrD,IAAI,SAAS,MAAM;IACjB,QAAQ,IAAI,cAAc;IAC1B,MAAM,YAAYA,aAAM;GAC1B;GACA,WAAW,qBAAqB,CAAC,KAAK;EACxC;EAEA,oBAAoB;
|
|
1
|
+
{"version":3,"file":"web-components.js","names":["styles"],"sources":["../../src/components/web-components.ts"],"sourcesContent":["import { DIFFS_TAG_NAME } from '../constants';\nimport styles from '../style.css?inline';\nimport { getMeasuredScrollbarGutter } from '../utils/scrollbarGutter';\n\n// If HTMLElement is undefined it usually means we are in a server environment\n// so best to just not do anything\nif (\n typeof HTMLElement !== 'undefined' &&\n customElements.get(DIFFS_TAG_NAME) == null\n) {\n let sheet: CSSStyleSheet | undefined;\n\n class FileDiffContainer extends HTMLElement {\n constructor() {\n super();\n // If shadow root is already open, we can sorta assume the\n // CSS is already in place\n if (this.shadowRoot != null) {\n return;\n }\n const shadowRoot = this.attachShadow({ mode: 'open' });\n if (sheet == null) {\n sheet = new CSSStyleSheet();\n sheet.replaceSync(styles);\n }\n shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n connectedCallback() {\n const shadowRoot = this.shadowRoot ?? this.attachShadow({ mode: 'open' });\n getMeasuredScrollbarGutter(shadowRoot);\n }\n }\n\n customElements.define(DIFFS_TAG_NAME, FileDiffContainer);\n}\n\nexport const DiffsContainerLoaded = true;\n"],"mappings":";;;;AAMA,IACE,OAAO,gBAAgB,eACvB,eAAe,IAAA,iBAAkB,KAAK,MACtC;CACA,IAAI;CAEJ,MAAM,0BAA0B,YAAY;EAC1C,cAAc;GACZ,MAAM;GAGN,IAAI,KAAK,cAAc,MACrB;GAEF,MAAM,aAAa,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;GACrD,IAAI,SAAS,MAAM;IACjB,QAAQ,IAAI,cAAc;IAC1B,MAAM,YAAYA,aAAM;GAC1B;GACA,WAAW,qBAAqB,CAAC,KAAK;EACxC;EAEA,oBAAoB;GAClB,MAAM,aAAa,KAAK,cAAc,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;GACxE,2BAA2B,UAAU;EACvC;CACF;CAEA,eAAe,OAAO,gBAAgB,iBAAiB;AACzD;AAEA,MAAa,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";;cASa;cAIA;cASA,uBAAuB;cACvB,2BAA2B;cAC3B,+BAA+B;cAC/B,mBAAmB;cACnB,aAAa;cAEb,qBAAqB;cACrB,uBAAuB;cACvB,2BAA2B;cAE3B,0BAA0B;cAE1B,qBAAqB;cAGrB,mCAAmC;cACnC,kCAAkC;cAClC,uCAAuC;cACvC,iCAAiC;cAEjC;cACA;cACA;cACA;cAEA,gBAAgB;cAKhB;cACA;cACA;cACA;cACA;cACA;cACA;cAGA;cACA;cACA,8BAA8B;cAO9B,gCAAgC;cAKhC,0BAA0B;cAM1B,gCAAgC;cAMhC,yBAAyB;cAKzB,sBAAsB;cAOtB,oBAAoB"}
|
|
@@ -2,7 +2,6 @@ import { FileContents } from "../types.js";
|
|
|
2
2
|
import { EditState, EditorType, EditorViewState, RetainedDiffSessionSnapshot } from "./types.js";
|
|
3
3
|
import { TextDocument } from "./textDocument.js";
|
|
4
4
|
import { Editor } from "./editor.js";
|
|
5
|
-
|
|
6
5
|
//#region src/editor/EditStateManager.d.ts
|
|
7
6
|
interface ManagedEditSessionBase<EType extends EditorType, LAnnotation = unknown> {
|
|
8
7
|
document?: TextDocument<EType, LAnnotation>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditStateManager.d.ts","names":[],"sources":["../../src/editor/EditStateManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EditStateManager.d.ts","names":[],"sources":["../../src/editor/EditStateManager.ts"],"mappings":";;;;;UAcU,uBACR,cAAc,YACd;EAEA,WAAW,aAAa,OAAO;EAC/B,WAAW,KAAK;EAChB,SAAS;;UAGM,uBACf,+BACQ,+BAA+B;EACvC;EACA;;UAGe,2BACf,+BACQ,oCAAoC;EAC5C;EACA,cAAc;;KAGJ,mBACV,cAAc,aAAa,YAC3B,yBACE,uBAAuB,OAAO,gBAC/B,uBACG,KAAK,kDACL,KAAK;;cAuHL;;;EAKJ,SAAS,cAAc,YAAY,aAAa,OAC9C,MAAM,OACN,sBACA,OAAO,OAAO,OAAO,aAAa,QAClC,eAAe,mBAAmB,OAAO,eACxC,mBAAmB,OAAO;;;;;EAoB7B,YAAY,aAAa,OACvB,sBACA,OAAO,eAAe,aAAa,QACnC;;;;;EASF,gBAAgB,aAAa,OAC3B,sBACA,OAAO,oBAAoB,aAAa,QACxC;;EAMF,IAAI,cAAc,YAAY,aAC5B,MAAM,OACN,uBACC,UAAU,OAAO;;EASpB,MACE,MAAM,YACN,sBACA,QAAQ;;EAQV;EAKA,YAAY;;UAMG;EACf;EACA;EACA;EACA;EACA;;iBAGc,qBAAqB,OAAO,kBAAkB;iBAW9C,mBAAmB,cAAc,YAAY,aAC3D,SAAS,mBAAmB,OAAO,eAClC,UAAU,OAAO;cAmCP,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditStateManager.js","names":["#sessions","#states","#files","#diffs"],"sources":["../../src/editor/EditStateManager.ts"],"sourcesContent":["import LRUMapPkg from 'lru_map';\n\nimport type { FileContents } from '../types';\nimport type { Editor } from './editor';\nimport { TextDocument } from './textDocument';\nimport type {\n EditorType,\n EditorViewState,\n EditState,\n RetainedDiffSessionSnapshot,\n} from './types';\n\nconst DEFAULT_EDIT_STATE_CAPACITY = 100;\n\ninterface ManagedEditSessionBase<\n EType extends EditorType,\n LAnnotation = unknown,\n> {\n document?: TextDocument<EType, LAnnotation>;\n fileInfo?: Pick<FileContents, 'lang' | 'name'>;\n editor?: EditorViewState;\n}\n\nexport interface ManagedFileEditSession<\n LAnnotation = unknown,\n> extends ManagedEditSessionBase<'file', LAnnotation> {\n type: 'file';\n diffSession?: never;\n}\n\nexport interface ManagedFileDiffEditSession<\n LAnnotation = unknown,\n> extends ManagedEditSessionBase<'file-diff', LAnnotation> {\n type: 'file-diff';\n diffSession?: RetainedDiffSessionSnapshot;\n}\n\nexport type ManagedEditSession<\n EType extends EditorType = EditorType,\n LAnnotation = unknown,\n> = ManagedEditSessionBase<EType, LAnnotation> &\n (EType extends 'file'\n ? Pick<ManagedFileEditSession, 'type' | 'diffSession'>\n : Pick<ManagedFileDiffEditSession, 'type' | 'diffSession'>);\n\ninterface EditStateManagerSession<K extends EditorType> {\n owner: Editor<K, unknown>;\n session: ManagedEditSession<K>;\n}\n\n/** Owns dormant edit state and active-key exclusion for one editor type. */\nclass EditStateManagerNamespace<EType extends EditorType> {\n #states = new LRUMapPkg.LRUMap<string, EditState<EType>>(\n DEFAULT_EDIT_STATE_CAPACITY\n );\n #sessions = new Map<string, EditStateManagerSession<EType>>();\n\n constructor(readonly type: EType) {}\n\n activate<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<EType, LAnnotation, Caret>,\n initialState?: ManagedEditSession<EType, LAnnotation>\n ): ManagedEditSession<EType, LAnnotation> {\n const activeSession = this.#sessions.get(editStateKey);\n if (activeSession != null && activeSession.owner !== owner) {\n throw new Error(\n `Editor: editStateKey \"${editStateKey}\" is already attached to another editor`\n );\n }\n if (activeSession != null) {\n if (initialState != null) {\n activeSession.session = initialState;\n }\n return activeSession.session as ManagedEditSession<EType, LAnnotation>;\n }\n const retainedState = this.#states.delete(editStateKey);\n const emptyState = {\n type: this.type,\n } as ManagedEditSession<EType>;\n const state = (initialState ??\n retainedState ??\n emptyState) as ManagedEditSession<EType, LAnnotation>;\n this.#sessions.set(editStateKey, {\n owner: owner as Editor<EType, unknown>,\n session: state as ManagedEditSession<EType>,\n });\n return state;\n }\n\n release<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<EType, LAnnotation, Caret>,\n discard = false\n ): void {\n const activeSession = this.#sessions.get(editStateKey);\n if (activeSession?.owner !== owner) {\n return;\n }\n this.#sessions.delete(editStateKey);\n if (discard) {\n return;\n }\n const retainedState = toManagedEditState(activeSession.session);\n if (retainedState != null) {\n this.#states.set(editStateKey, retainedState as EditState<EType>);\n }\n }\n\n get<LAnnotation>(\n editStateKey: string\n ): EditState<EType, LAnnotation> | undefined {\n const activeSession = this.#sessions.get(editStateKey);\n if (activeSession != null) {\n const state = toManagedEditState(\n activeSession.session as ManagedEditSession<EType, LAnnotation>\n );\n if (state == null) {\n return undefined;\n }\n return state;\n }\n const state = this.#states.find(editStateKey);\n return state as EditState<EType, LAnnotation> | undefined;\n }\n\n /** Clear dormant state for a key. Omit `parts` to clear everything. */\n clear(editStateKey: string, parts?: ClearEditStateOptions): boolean {\n if (this.#sessions.has(editStateKey)) {\n return false;\n }\n\n const state = this.#states.find(editStateKey);\n if (state == null) {\n return false;\n }\n if (parts == null || parts.document === true) {\n this.#states.delete(editStateKey);\n } else {\n applyClearEditStateOptions(state, parts);\n }\n return true;\n }\n\n clearAll(): void {\n this.#states.clear();\n }\n\n setCapacity(capacity: number): void {\n if (!Number.isSafeInteger(capacity) || capacity < 1) {\n throw new RangeError(\n 'EditStateManager: capacity must be a positive integer'\n );\n }\n while (this.#states.size > capacity) {\n this.#states.shift();\n }\n this.#states.limit = capacity;\n }\n}\n\n/** Keeps file and diff edit state in independent persistence domains. */\nclass EditStateManagerClass {\n #files = new EditStateManagerNamespace('file');\n #diffs = new EditStateManagerNamespace('file-diff');\n\n /** Mark a keyed session as active and return its initial or stored state. */\n activate<EType extends EditorType, LAnnotation, Caret>(\n type: EType,\n editStateKey: string,\n owner: Editor<EType, LAnnotation, Caret>,\n initialState?: ManagedEditSession<EType, LAnnotation>\n ): ManagedEditSession<EType, LAnnotation> {\n return (\n type === 'file'\n ? this.#files.activate(\n editStateKey,\n owner as Editor<'file', LAnnotation, Caret>,\n initialState as ManagedFileEditSession<LAnnotation> | undefined\n )\n : this.#diffs.activate(\n editStateKey,\n owner as Editor<'file-diff', LAnnotation, Caret>,\n initialState as ManagedFileDiffEditSession<LAnnotation> | undefined\n )\n ) as ManagedEditSession<EType, LAnnotation>;\n }\n\n /**\n * Stop tracking this file session as active and store its current state,\n * unless `discard` is true.\n */\n releaseFile<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<'file', LAnnotation, Caret>,\n discard = false\n ): void {\n this.#files.release(editStateKey, owner, discard);\n }\n\n /**\n * Stop tracking this diff session as active and store its current state,\n * unless `discard` is true.\n */\n releaseFileDiff<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<'file-diff', LAnnotation, Caret>,\n discard = false\n ): void {\n this.#diffs.release(editStateKey, owner, discard);\n }\n\n /** Return current state for an active or dormant editing session. */\n get<EType extends EditorType, LAnnotation>(\n type: EType,\n editStateKey: string\n ): EditState<EType, LAnnotation> | undefined {\n return (\n type === 'file'\n ? this.#files.get<LAnnotation>(editStateKey)\n : this.#diffs.get<LAnnotation>(editStateKey)\n ) as EditState<EType, LAnnotation> | undefined;\n }\n\n /** Clear a dormant session, returning false when it is active or missing. */\n clear(\n type: EditorType,\n editStateKey: string,\n parts?: ClearEditStateOptions\n ): boolean {\n return type === 'file'\n ? this.#files.clear(editStateKey, parts)\n : this.#diffs.clear(editStateKey, parts);\n }\n\n /** Clear all dormant sessions without affecting active editors. */\n clearAll(): void {\n this.#files.clearAll();\n this.#diffs.clearAll();\n }\n\n setCapacity(capacity: number): void {\n this.#files.setCapacity(capacity);\n this.#diffs.setCapacity(capacity);\n }\n}\n\nexport interface ClearEditStateOptions {\n document?: boolean;\n history?: boolean;\n editor?: boolean;\n selections?: boolean;\n view?: boolean;\n}\n\nexport function cloneEditorViewState(state: EditorViewState): EditorViewState {\n return {\n selections: state.selections?.map((selection) => ({\n ...selection,\n start: { ...selection.start },\n end: { ...selection.end },\n })),\n view: state.view == null ? undefined : { ...state.view },\n };\n}\n\nexport function toManagedEditState<EType extends EditorType, LAnnotation>(\n session: ManagedEditSession<EType, LAnnotation>\n): EditState<EType, LAnnotation> | undefined {\n if (session.document == null || session.fileInfo == null) {\n return undefined;\n }\n if (session.type === 'file') {\n session.editor ??= {};\n return session as EditState<EType, LAnnotation>;\n }\n if (session.diffSession == null) {\n return undefined;\n }\n session.editor ??= {};\n return session as EditState<EType, LAnnotation>;\n}\n\nfunction applyClearEditStateOptions(\n session: ManagedEditSession | undefined,\n parts: ClearEditStateOptions\n): void {\n if (session == null) {\n return;\n }\n if (parts.history === true) {\n session.document?.clearHistory();\n }\n if (session.editor != null) {\n if (parts.editor === true || parts.selections === true) {\n session.editor.selections = undefined;\n }\n if (parts.editor === true || parts.view === true) {\n session.editor.view = undefined;\n }\n }\n}\n\nexport const EditStateManager: EditStateManagerClass =\n new EditStateManagerClass();\n"],"mappings":";;AAYA,MAAM,8BAA8B;;AAuCpC,IAAM,4BAAN,MAA0D;CAMnC;CALrB,UAAU,IAAI,UAAU,OACtB,2BACF;CACA,4BAAY,IAAI,IAA4C;CAE5D,YAAY,MAAsB;EAAb,KAAA,OAAA;CAAc;CAEnC,SACE,cACA,OACA,cACwC;EACxC,MAAM,gBAAgB,KAAKA,UAAU,IAAI,YAAY;EACrD,IAAI,iBAAiB,QAAQ,cAAc,UAAU,OACnD,MAAM,IAAI,MACR,yBAAyB,aAAa,wCACxC;EAEF,IAAI,iBAAiB,MAAM;GACzB,IAAI,gBAAgB,MAClB,cAAc,UAAU;GAE1B,OAAO,cAAc;EACvB;EACA,MAAM,gBAAgB,KAAKC,QAAQ,OAAO,YAAY;EACtD,MAAM,aAAa,EACjB,MAAM,KAAK,KACb;EACA,MAAM,QAAS,gBACb,iBACA;EACF,KAAKD,UAAU,IAAI,cAAc;GACxB;GACP,SAAS;EACX,CAAC;EACD,OAAO;CACT;CAEA,QACE,cACA,OACA,UAAU,OACJ;EACN,MAAM,gBAAgB,KAAKA,UAAU,IAAI,YAAY;EACrD,IAAI,eAAe,UAAU,OAC3B;EAEF,KAAKA,UAAU,OAAO,YAAY;EAClC,IAAI,SACF;EAEF,MAAM,gBAAgB,mBAAmB,cAAc,OAAO;EAC9D,IAAI,iBAAiB,MACnB,KAAKC,QAAQ,IAAI,cAAc,aAAiC;CAEpE;CAEA,IACE,cAC2C;EAC3C,MAAM,gBAAgB,KAAKD,UAAU,IAAI,YAAY;EACrD,IAAI,iBAAiB,MAAM;GACzB,MAAM,QAAQ,mBACZ,cAAc,OAChB;GACA,IAAI,SAAS,MACX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AAO,SAAS;EACrB,KAAKC,OAAO,SAAS;CACvB;CAEA,YAAY,UAAwB;EAClC,KAAKD,OAAO,YAAY,QAAQ;EAChC,KAAKC,OAAO,YAAY,QAAQ;CAClC;AACF;AAUA,SAAgB,qBAAqB,OAAyC;CAC5E,OAAO;EACL,YAAY,MAAM,YAAY,KAAK,eAAe;GAChD,GAAG;GACH,OAAO,EAAE,GAAG,UAAU,MAAM;GAC5B,KAAK,EAAE,GAAG,UAAU,IAAI;EAC1B,EAAE;EACF,MAAM,MAAM,QAAQ,OAAO,KAAA,IAAY,EAAE,GAAG,MAAM,KAAK;CACzD;AACF;AAEA,SAAgB,mBACd,SAC2C;CAC3C,IAAI,QAAQ,YAAY,QAAQ,QAAQ,YAAY,MAClD;CAEF,IAAI,QAAQ,SAAS,QAAQ;EAC3B,QAAQ,WAAW,CAAC;EACpB,OAAO;CACT;CACA,IAAI,QAAQ,eAAe,MACzB;CAEF,QAAQ,WAAW,CAAC;CACpB,OAAO;AACT;AAEA,SAAS,2BACP,SACA,OACM;CACN,IAAI,WAAW,MACb;CAEF,IAAI,MAAM,YAAY,MACpB,QAAQ,UAAU,aAAa;CAEjC,IAAI,QAAQ,UAAU,MAAM;EAC1B,IAAI,MAAM,WAAW,QAAQ,MAAM,eAAe,MAChD,QAAQ,OAAO,aAAa,KAAA;EAE9B,IAAI,MAAM,WAAW,QAAQ,MAAM,SAAS,MAC1C,QAAQ,OAAO,OAAO,KAAA;CAE1B;AACF;AAEA,MAAa,mBACX,IAAI,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"EditStateManager.js","names":[],"sources":["../../src/editor/EditStateManager.ts"],"sourcesContent":["import LRUMapPkg from 'lru_map';\n\nimport type { FileContents } from '../types';\nimport type { Editor } from './editor';\nimport { TextDocument } from './textDocument';\nimport type {\n EditorType,\n EditorViewState,\n EditState,\n RetainedDiffSessionSnapshot,\n} from './types';\n\nconst DEFAULT_EDIT_STATE_CAPACITY = 100;\n\ninterface ManagedEditSessionBase<\n EType extends EditorType,\n LAnnotation = unknown,\n> {\n document?: TextDocument<EType, LAnnotation>;\n fileInfo?: Pick<FileContents, 'lang' | 'name'>;\n editor?: EditorViewState;\n}\n\nexport interface ManagedFileEditSession<\n LAnnotation = unknown,\n> extends ManagedEditSessionBase<'file', LAnnotation> {\n type: 'file';\n diffSession?: never;\n}\n\nexport interface ManagedFileDiffEditSession<\n LAnnotation = unknown,\n> extends ManagedEditSessionBase<'file-diff', LAnnotation> {\n type: 'file-diff';\n diffSession?: RetainedDiffSessionSnapshot;\n}\n\nexport type ManagedEditSession<\n EType extends EditorType = EditorType,\n LAnnotation = unknown,\n> = ManagedEditSessionBase<EType, LAnnotation> &\n (EType extends 'file'\n ? Pick<ManagedFileEditSession, 'type' | 'diffSession'>\n : Pick<ManagedFileDiffEditSession, 'type' | 'diffSession'>);\n\ninterface EditStateManagerSession<K extends EditorType> {\n owner: Editor<K, unknown>;\n session: ManagedEditSession<K>;\n}\n\n/** Owns dormant edit state and active-key exclusion for one editor type. */\nclass EditStateManagerNamespace<EType extends EditorType> {\n #states = new LRUMapPkg.LRUMap<string, EditState<EType>>(\n DEFAULT_EDIT_STATE_CAPACITY\n );\n #sessions = new Map<string, EditStateManagerSession<EType>>();\n\n constructor(readonly type: EType) {}\n\n activate<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<EType, LAnnotation, Caret>,\n initialState?: ManagedEditSession<EType, LAnnotation>\n ): ManagedEditSession<EType, LAnnotation> {\n const activeSession = this.#sessions.get(editStateKey);\n if (activeSession != null && activeSession.owner !== owner) {\n throw new Error(\n `Editor: editStateKey \"${editStateKey}\" is already attached to another editor`\n );\n }\n if (activeSession != null) {\n if (initialState != null) {\n activeSession.session = initialState;\n }\n return activeSession.session as ManagedEditSession<EType, LAnnotation>;\n }\n const retainedState = this.#states.delete(editStateKey);\n const emptyState = {\n type: this.type,\n } as ManagedEditSession<EType>;\n const state = (initialState ??\n retainedState ??\n emptyState) as ManagedEditSession<EType, LAnnotation>;\n this.#sessions.set(editStateKey, {\n owner: owner as Editor<EType, unknown>,\n session: state,\n });\n return state;\n }\n\n release<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<EType, LAnnotation, Caret>,\n discard = false\n ): void {\n const activeSession = this.#sessions.get(editStateKey);\n if (activeSession?.owner !== owner) {\n return;\n }\n this.#sessions.delete(editStateKey);\n if (discard) {\n return;\n }\n const retainedState = toManagedEditState(activeSession.session);\n if (retainedState != null) {\n this.#states.set(editStateKey, retainedState);\n }\n }\n\n get<LAnnotation>(\n editStateKey: string\n ): EditState<EType, LAnnotation> | undefined {\n const activeSession = this.#sessions.get(editStateKey);\n if (activeSession != null) {\n const state = toManagedEditState(\n activeSession.session as ManagedEditSession<EType, LAnnotation>\n );\n if (state == null) {\n return undefined;\n }\n return state;\n }\n const state = this.#states.find(editStateKey);\n return state as EditState<EType, LAnnotation> | undefined;\n }\n\n /** Clear dormant state for a key. Omit `parts` to clear everything. */\n clear(editStateKey: string, parts?: ClearEditStateOptions): boolean {\n if (this.#sessions.has(editStateKey)) {\n return false;\n }\n\n const state = this.#states.find(editStateKey);\n if (state == null) {\n return false;\n }\n if (parts == null || parts.document === true) {\n this.#states.delete(editStateKey);\n } else {\n applyClearEditStateOptions(state, parts);\n }\n return true;\n }\n\n clearAll(): void {\n this.#states.clear();\n }\n\n setCapacity(capacity: number): void {\n if (!Number.isSafeInteger(capacity) || capacity < 1) {\n throw new RangeError(\n 'EditStateManager: capacity must be a positive integer'\n );\n }\n while (this.#states.size > capacity) {\n this.#states.shift();\n }\n this.#states.limit = capacity;\n }\n}\n\n/** Keeps file and diff edit state in independent persistence domains. */\nclass EditStateManagerClass {\n #files = new EditStateManagerNamespace('file');\n #diffs = new EditStateManagerNamespace('file-diff');\n\n /** Mark a keyed session as active and return its initial or stored state. */\n activate<EType extends EditorType, LAnnotation, Caret>(\n type: EType,\n editStateKey: string,\n owner: Editor<EType, LAnnotation, Caret>,\n initialState?: ManagedEditSession<EType, LAnnotation>\n ): ManagedEditSession<EType, LAnnotation> {\n return (\n type === 'file'\n ? this.#files.activate(\n editStateKey,\n owner as Editor<'file', LAnnotation, Caret>,\n initialState as ManagedFileEditSession<LAnnotation> | undefined\n )\n : this.#diffs.activate(\n editStateKey,\n owner as Editor<'file-diff', LAnnotation, Caret>,\n initialState as ManagedFileDiffEditSession<LAnnotation> | undefined\n )\n ) as ManagedEditSession<EType, LAnnotation>;\n }\n\n /**\n * Stop tracking this file session as active and store its current state,\n * unless `discard` is true.\n */\n releaseFile<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<'file', LAnnotation, Caret>,\n discard = false\n ): void {\n this.#files.release(editStateKey, owner, discard);\n }\n\n /**\n * Stop tracking this diff session as active and store its current state,\n * unless `discard` is true.\n */\n releaseFileDiff<LAnnotation, Caret>(\n editStateKey: string,\n owner: Editor<'file-diff', LAnnotation, Caret>,\n discard = false\n ): void {\n this.#diffs.release(editStateKey, owner, discard);\n }\n\n /** Return current state for an active or dormant editing session. */\n get<EType extends EditorType, LAnnotation>(\n type: EType,\n editStateKey: string\n ): EditState<EType, LAnnotation> | undefined {\n return (\n type === 'file'\n ? this.#files.get<LAnnotation>(editStateKey)\n : this.#diffs.get<LAnnotation>(editStateKey)\n ) as EditState<EType, LAnnotation> | undefined;\n }\n\n /** Clear a dormant session, returning false when it is active or missing. */\n clear(\n type: EditorType,\n editStateKey: string,\n parts?: ClearEditStateOptions\n ): boolean {\n return type === 'file'\n ? this.#files.clear(editStateKey, parts)\n : this.#diffs.clear(editStateKey, parts);\n }\n\n /** Clear all dormant sessions without affecting active editors. */\n clearAll(): void {\n this.#files.clearAll();\n this.#diffs.clearAll();\n }\n\n setCapacity(capacity: number): void {\n this.#files.setCapacity(capacity);\n this.#diffs.setCapacity(capacity);\n }\n}\n\nexport interface ClearEditStateOptions {\n document?: boolean;\n history?: boolean;\n editor?: boolean;\n selections?: boolean;\n view?: boolean;\n}\n\nexport function cloneEditorViewState(state: EditorViewState): EditorViewState {\n return {\n selections: state.selections?.map((selection) => ({\n ...selection,\n start: { ...selection.start },\n end: { ...selection.end },\n })),\n view: state.view == null ? undefined : { ...state.view },\n };\n}\n\nexport function toManagedEditState<EType extends EditorType, LAnnotation>(\n session: ManagedEditSession<EType, LAnnotation>\n): EditState<EType, LAnnotation> | undefined {\n if (session.document == null || session.fileInfo == null) {\n return undefined;\n }\n if (session.type === 'file') {\n session.editor ??= {};\n return session as EditState<EType, LAnnotation>;\n }\n if (session.diffSession == null) {\n return undefined;\n }\n session.editor ??= {};\n return session as EditState<EType, LAnnotation>;\n}\n\nfunction applyClearEditStateOptions(\n session: ManagedEditSession | undefined,\n parts: ClearEditStateOptions\n): void {\n if (session == null) {\n return;\n }\n if (parts.history === true) {\n session.document?.clearHistory();\n }\n if (session.editor != null) {\n if (parts.editor === true || parts.selections === true) {\n session.editor.selections = undefined;\n }\n if (parts.editor === true || parts.view === true) {\n session.editor.view = undefined;\n }\n }\n}\n\nexport const EditStateManager: EditStateManagerClass =\n new EditStateManagerClass();\n"],"mappings":";;AAYA,MAAM,8BAA8B;;AAuCpC,IAAM,4BAAN,MAA0D;CAMnC;CALrB,UAAU,IAAI,UAAU,OACtB,2BACF;CACA,4BAAY,IAAI,IAA4C;CAE5D,YAAY,MAAsB;EAAb,KAAA,OAAA;CAAc;CAEnC,SACE,cACA,OACA,cACwC;EACxC,MAAM,gBAAgB,KAAK,UAAU,IAAI,YAAY;EACrD,IAAI,iBAAiB,QAAQ,cAAc,UAAU,OACnD,MAAM,IAAI,MACR,yBAAyB,aAAa,wCACxC;EAEF,IAAI,iBAAiB,MAAM;GACzB,IAAI,gBAAgB,MAClB,cAAc,UAAU;GAE1B,OAAO,cAAc;EACvB;EACA,MAAM,gBAAgB,KAAK,QAAQ,OAAO,YAAY;EACtD,MAAM,aAAa,EACjB,MAAM,KAAK,KACb;EACA,MAAM,QAAS,gBACb,iBACA;EACF,KAAK,UAAU,IAAI,cAAc;GACxB;GACP,SAAS;EACX,CAAC;EACD,OAAO;C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WAAW,QAAQ,MAAM,SAAS,MAC1C,QAAQ,OAAO,OAAO,KAAA;CAE1B;AACF;AAEA,MAAa,mBACX,IAAI,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloneRetainedDiffSessionSnapshot.d.ts","names":[],"sources":["../../src/editor/cloneRetainedDiffSessionSnapshot.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cloneRetainedDiffSessionSnapshot.d.ts","names":[],"sources":["../../src/editor/cloneRetainedDiffSessionSnapshot.ts"],"mappings":";;iBAGgB,iCACd,UAAU,8BACT"}
|
|
@@ -5,7 +5,8 @@ type KeyboardModifier = 'cmdOrCtrl' | 'shift' | 'alt' | 'ctrl' | 'cmd';
|
|
|
5
5
|
type EditorShortcut = KeyboardKey | `${KeyboardModifier}+${KeyboardKey}` | `${KeyboardModifier}+${KeyboardModifier}+${KeyboardKey}`;
|
|
6
6
|
/** Later groups take precedence when bindings overlap. */
|
|
7
7
|
type EditorKeymap = ReadonlyArray<{
|
|
8
|
-
/** Undefined applies on every platform. */
|
|
8
|
+
/** Undefined applies on every platform. */
|
|
9
|
+
readonly platform?: 'mac' | 'windows' | 'linux';
|
|
9
10
|
readonly bindings: Readonly<Partial<Record<EditorShortcut, EditorCommand>>>;
|
|
10
11
|
}>;
|
|
11
12
|
declare function resolveEditorCommandFromKeyboardEvent(event: KeyboardEvent, keymap?: EditorKeymap, isMac?: boolean): EditorCommand | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","names":[],"sources":["../../src/editor/command.ts"],"mappings":";KAEY
|
|
1
|
+
{"version":3,"file":"command.d.ts","names":[],"sources":["../../src/editor/command.ts"],"mappings":";KAEY;KAyBA;KA2EA;KAEA,iBACR,iBACG,oBAAoB,mBACpB,oBAAoB,oBAAoB;;KAGnC,eAAe;;WAEhB;WACA,UAAU,SAAS,QAAQ,OAAO,gBAAgB;;iBAsI7C,sCACd,OAAO,eACP,SAAS,cACT,kBACC;iBA8Ca,yBACd,OAAO,eACP"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Position, TextEdit } from "./types.js";
|
|
2
2
|
import { TextDocumentChangeTransaction } from "./textDocumentChangeTransaction.js";
|
|
3
|
-
|
|
4
3
|
//#region src/editor/editPrediction.d.ts
|
|
5
4
|
interface EditPredictRequest {
|
|
6
5
|
/** Current file name/path as supplied to the File or FileDiff component. */
|
|
@@ -22,7 +21,9 @@ interface EditPredictRequest {
|
|
|
22
21
|
};
|
|
23
22
|
/** Chronological, bounded edit history for this document. */
|
|
24
23
|
readonly editHistory: ReadonlyArray<{
|
|
25
|
-
/** Edit in unified-diff format. */
|
|
24
|
+
/** Edit in unified-diff format. */
|
|
25
|
+
readonly diff: string;
|
|
26
|
+
/** Edit source. */
|
|
26
27
|
readonly source: 'user' | 'prediction';
|
|
27
28
|
}>;
|
|
28
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editPrediction.d.ts","names":[],"sources":["../../src/editor/editPrediction.ts"],"mappings":"
|
|
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"}
|
|
@@ -3,7 +3,7 @@ const EDITABLE_TOKENS = 350;
|
|
|
3
3
|
const CONTEXT_TOKENS = 150;
|
|
4
4
|
const MAX_EDITABLE_TOKENS = 512;
|
|
5
5
|
const MAX_CONTEXT_TOKENS = 662;
|
|
6
|
-
const MAX_REQUEST_BYTES =
|
|
6
|
+
const MAX_REQUEST_BYTES = 131072;
|
|
7
7
|
const MAX_CAPTURE_BYTES = 6144;
|
|
8
8
|
const COALESCE_MS = 1e3;
|
|
9
9
|
const COALESCE_LINES = 8;
|
|
@@ -282,8 +282,7 @@ function buildEditPredictionRequest(path, document, cursorOffset, history, isLin
|
|
|
282
282
|
};
|
|
283
283
|
let editableFirst = cursorLine;
|
|
284
284
|
let editableLast = cursorLine;
|
|
285
|
-
|
|
286
|
-
let remaining = Math.max(0, initialBudget - costForLine(cursorLine));
|
|
285
|
+
let remaining = Math.max(0, Math.floor(EDITABLE_TOKENS * 3 / 4) - costForLine(cursorLine));
|
|
287
286
|
while (remaining > 0 && (canEdit(editableFirst - 1) || canEdit(editableLast + 1))) {
|
|
288
287
|
if (canEdit(editableLast + 1)) {
|
|
289
288
|
const cost = costForLine(editableLast + 1);
|
|
@@ -298,7 +297,7 @@ function buildEditPredictionRequest(path, document, cursorOffset, history, isLin
|
|
|
298
297
|
remaining -= cost;
|
|
299
298
|
}
|
|
300
299
|
}
|
|
301
|
-
remaining +=
|
|
300
|
+
remaining += 88;
|
|
302
301
|
({first: editableFirst, last: editableLast} = expandLinewise(document.lineCount, costForLine, canEdit, editableFirst, editableLast, remaining));
|
|
303
302
|
let contextFirst = editableFirst;
|
|
304
303
|
let contextLast = editableLast;
|
|
@@ -347,14 +346,15 @@ function matchesEditPredictionPattern(path, pattern) {
|
|
|
347
346
|
let source = "^";
|
|
348
347
|
for (let index = 0; index < pattern.length; index++) {
|
|
349
348
|
const character = pattern[index];
|
|
350
|
-
if (character === "*")
|
|
351
|
-
index
|
|
352
|
-
if (pattern[index + 1] === "/") {
|
|
349
|
+
if (character === "*") {
|
|
350
|
+
if (pattern[index + 1] === "*") {
|
|
353
351
|
index++;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
if (pattern[index + 1] === "/") {
|
|
353
|
+
index++;
|
|
354
|
+
source += "(?:.*/)?";
|
|
355
|
+
} else source += ".*";
|
|
356
|
+
} else source += "[^/]*";
|
|
357
|
+
} else if (character === "?") source += "[^/]";
|
|
358
358
|
else source += /[\\^$.*+?()[\]{}|]/.test(character) ? `\\${character}` : character;
|
|
359
359
|
}
|
|
360
360
|
return new RegExp(`${source}$`).test(path);
|
|
@@ -1 +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;AAC5B,MAAM,qBAAqB;AAC3B,MAAM,oBAAoB,MAAM;AAEhC,MAAM,oBAAoB;AAC1B,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAE3B,MAAM,0BAA0B,CAC9B,IACA,kBACF;AACA,MAAM,cAAc,IAAI,YAAY;AAEpC,SAAS,WAAW,MAAwB;CAC1C,MAAM,SAAS,CAAC,CAAC;CACjB,KAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,IAAI,KAAK,WAAW,KAAK,MAAM,MAAM,KAAK,WAAW,QAAQ,CAAC,MAAM,IAClE;EAEF,IAAI,KAAK,WAAW,KAAK,MAAM,MAAM,KAAK,WAAW,KAAK,MAAM,IAC9D,OAAO,KAAK,QAAQ,CAAC;CAEzB;CACA,OAAO;AACT;AAIA,SAAS,cAAc,MAAc,QAAmC;CACtE,IAAI,KAAK,WAAW,GAClB,OAAO;CAET,OAAO,OAAO,GAAG,EAAE,MAAM,KAAK,SAAS,OAAO,SAAS,IAAI,OAAO;AACpE;AAEA,SAAS,QACP,MACA,QACA,MACQ;CACR,MAAM,OAAO,OAAO,OAAO;CAC3B,OAAO,SAAS,KAAA,IACZ,KAAK,SACL,QACG,KAAK,WAAW,OAAO,CAAC,MAAM,MAAM,KAAK,WAAW,OAAO,CAAC,MAAM,KAC/D,IACA;AACZ;AAEA,SAAS,WACP,MACA,YACA,UACA,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B,MAAM;GACN;EACF,EAAE;CACN;CACA,OAAO,YAAY,OAAO,KAAK,UAAU,OAAO,CAAC,CAAC,CAAC,cACjD,oBACE,UACA,KAAA;AACN;AAEA,SAAgB,6BACd,MACA,SACS;CACT,IAAI,OAAO,YAAY,UACrB,OAAO,IAAI,OAAO,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,KAAK,IAAI;CAG5D,UAAU,QAAQ,WAAW,MAAM,GAAG;CACtC,IAAI,SAAS;CACb,KAAK,IAAI,QAAQ,GAAG,QAAQ,QAAQ,QAAQ,SAAS;EACnD,MAAM,YAAY,QAAQ;EAC1B,IAAI,cAAc,KAChB,IAAI,QAAQ,QAAQ,OAAO,KAAK;GAC9B;GACA,IAAI,QAAQ,QAAQ,OAAO,KAAK;IAC9B;IACA,UAAU;GACZ,OACE,UAAU;EAEd,OACE,UAAU;OAEP,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
|
+
{"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;AAC5B,MAAM,qBAAqB;AAC3B,MAAM,oBAAoB;AAE1B,MAAM,oBAAoB;AAC1B,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAE3B,MAAM,0BAA0B,CAC9B,IACA,kBACF;AACA,MAAM,cAAc,IAAI,YAAY;AAEpC,SAAS,WAAW,MAAwB;CAC1C,MAAM,SAAS,CAAC,CAAC;CACjB,KAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,IAAI,KAAK,WAAW,KAAK,MAAM,MAAM,KAAK,WAAW,QAAQ,CAAC,MAAM,IAClE;EAEF,IAAI,KAAK,WAAW,KAAK,MAAM,MAAM,KAAK,WAAW,KAAK,MAAM,IAC9D,OAAO,KAAK,QAAQ,CAAC;CAEzB;CACA,OAAO;AACT;AAIA,SAAS,cAAc,MAAc,QAAmC;CACtE,IAAI,KAAK,WAAW,GAClB,OAAO;CAET,OAAO,OAAO,GAAG,EAAE,MAAM,KAAK,SAAS,OAAO,SAAS,IAAI,OAAO;AACpE;AAEA,SAAS,QACP,MACA,QACA,MACQ;CACR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