diff --git a/frontend/package-lock.json b/frontend/package-lock.json index d1b3e36512..b487591c47 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -24,6 +24,7 @@ "@json2csv/plainjs": "^7.0.6", "@leeoniya/ufuzzy": "^1.0.8", "@melt-ui/svelte": "^0.86.2", + "@pierre/diffs": "1.6.4", "@popperjs/core": "^2.11.8", "@redocly/json-to-json-schema": "^0.0.1", "@scalar/openapi-parser": "^0.15.0", @@ -1687,6 +1688,87 @@ "integrity": "sha512-8awtpHXCx/bNpFt4mt2xdkgtgVvKqty8VbjHI/WWWQuEw+KLzFot3f4+LkQY9YmOtq7A5GdOnqoIC8Pdygjk2g==", "license": "MIT" }, + "node_modules/@pierre/diffs": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@pierre/diffs/-/diffs-1.6.4.tgz", + "integrity": "sha512-RsKoruCOp50qaDM3a7BQan5K77xMkGWT1NF01fiYP1PfT3v4CvIjwytNk5WjZG0BesBkMOP2UbrBIDigB1k0ug==", + "license": "apache-2.0", + "dependencies": { + "@pierre/highlights": "0.4.0", + "@pierre/theme": "2.0.0", + "@pierre/theming": "1.0.2", + "diff": "9.0.0", + "hast-util-to-html": "9.0.5", + "lru_map": "0.4.1", + "shiki": "^3.0.0 || ^4.0.0" + }, + "peerDependencies": { + "react": "^18.3.1 || ^19.0.0", + "react-dom": "^18.3.1 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/@pierre/diffs/node_modules/diff": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", + "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/@pierre/highlights": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@pierre/highlights/-/highlights-0.4.0.tgz", + "integrity": "sha512-2a38H7ep3KweGi1fGQpJk+Krod2OMpDIXagKPlqBd1Y9P460T7zQmc66Wm2JAH1SpIG93wCyyhZVrkc5dnAJVQ==", + "license": "apache-2.0" + }, + "node_modules/@pierre/theme": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@pierre/theme/-/theme-2.0.0.tgz", + "integrity": "sha512-yNDd9GYLQl1mEUJR8AneJ5e4ohLIHQd/wZLWr4fagt78vS2RwwZNW530vVgHqXFAyFVcFlRmGUD5ramXH46OXw==", + "license": "apache-2.0", + "engines": { + "vscode": "^1.0.0" + } + }, + "node_modules/@pierre/theming": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pierre/theming/-/theming-1.0.2.tgz", + "integrity": "sha512-RmXLLqtx31UGcR8kZyO5hGAQ1EXz6loT1Cu0BFAGsbnBboIxp2BlomkLfWyvdT4WZXnBGyu25onL1gKpFQuSUw==", + "license": "apache-2.0", + "peerDependencies": { + "@pierre/theme": "^1.1.0 || ^2.0.0", + "@shikijs/themes": "^3.0.0 || ^4.0.0", + "react": "^18.3.1 || ^19.0.0", + "react-dom": "^18.3.1 || ^19.0.0", + "shiki": "^3.0.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "@pierre/theme": { + "optional": true + }, + "@shikijs/themes": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "shiki": { + "optional": true + } + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -1744,7 +1826,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1761,7 +1842,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1778,7 +1858,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1795,7 +1874,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1812,7 +1890,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1829,7 +1906,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1846,7 +1922,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1863,7 +1938,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1880,7 +1954,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1897,7 +1970,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1914,7 +1986,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1931,7 +2002,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1948,7 +2018,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1965,7 +2034,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1999,6 +2067,129 @@ "node": ">=20" } }, + "node_modules/@shikijs/core": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.6.0.tgz", + "integrity": "sha512-bfd4OKgvoyXYiYmMRuleA656P4V7M/Du9lcTl38Ngm6KszMj7bq4J1IGZwSYR4c95Tv5UQALtYNWUwaI9UT3xw==", + "license": "MIT", + "dependencies": { + "@shikijs/primitive": "4.6.0", + "@shikijs/types": "4.6.0", + "@shikijs/vscode-textmate": "^10.1.0", + "@types/hast": "^3.0.5", + "hast-util-to-html": "^9.0.6" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/core/node_modules/hast-util-to-html": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.6.tgz", + "integrity": "sha512-1SZUxCN3TtJAE7e2BQN2MBHsoZ1gnmi9GoCP5Di59CSWptIezSAW09yDZyVbanb78V9eCwrKqdQsjtfVTxYHWA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.6.0.tgz", + "integrity": "sha512-K0oqxFoL+kEMdz89mHLFO15Tsbv3kFZ6WR1cXZKMvLSc+oqaM00A6pyga1qSeXB22dP0tTiSApRcGBaKWsEccg==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.6.0", + "@shikijs/vscode-textmate": "^10.1.0", + "oniguruma-to-es": "^4.3.6" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.6.0.tgz", + "integrity": "sha512-aggd6Q7SuJOXNnsUbfG2XesxBJKBMAw/PDTUo9PyRjMaaJJ2dNrI+q0C+25ARXAK9yLHAlwxc9oRT2u68YKZ7w==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.6.0", + "@shikijs/vscode-textmate": "^10.1.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/langs": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.6.0.tgz", + "integrity": "sha512-1yMEX3oCVV54LUq/ovfpRkDQoYDkcvjSWFFa/YLUDMiSoRzMi2uxLJYbv41ahT8Lu9lFMaa7hecd3Q39trqUyg==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.6.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/primitive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.6.0.tgz", + "integrity": "sha512-c54+TQEo9ToqgfL/AU8FpjnV09+GA9Oa7M5ROkkXteZfp5XzpAJGXjjvZQFQioJOwm/w/6Z3lIzQstAkl8coag==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.6.0", + "@shikijs/vscode-textmate": "^10.1.0", + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/themes": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.6.0.tgz", + "integrity": "sha512-qHAVAs80RiGD+IRuH9G+JPDOEc9A/kHsng4EzCUCwB9bLzW6Z0y9WETh2YyCcADJBmfrIaJ1Jp7KBNP6FHkgtQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.6.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/types": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.6.0.tgz", + "integrity": "sha512-+ENG1adsKt/X7cRYw1Nl7BEpBmPOjmQ7bR/eGmHuMlT8gtOFf3KEi5l31DJYyAWhW6Y6bjP1plU7FmaxWGENFw==", + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.1.0", + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.1.0.tgz", + "integrity": "sha512-cVBuhDQjBZaNMTwBquYfPydrUP+E3hE6oYGasx8h6ZrODIM7/r+gxLDXdd66oszbrggZHEntdE6j+5gYIVyMWQ==", + "license": "MIT" + }, "node_modules/@smithy/types": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.7.0.tgz", @@ -2549,9 +2740,9 @@ "license": "MIT" }, "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", "license": "MIT", "dependencies": { "@types/unist": "*" @@ -3977,6 +4168,26 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chart.js": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.1.tgz", @@ -6953,6 +7164,29 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-html": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", + "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-to-parse5": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", @@ -6982,6 +7216,19 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hastscript": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz", @@ -7420,7 +7667,7 @@ "version": "1.21.7", "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", - "dev": true, + "devOptional": true, "license": "MIT", "bin": { "jiti": "bin/jiti.js" @@ -8126,7 +8373,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8147,7 +8393,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8168,7 +8413,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8189,7 +8433,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8210,7 +8453,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8231,7 +8473,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8252,7 +8493,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8273,7 +8513,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8294,7 +8533,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8315,7 +8553,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8336,7 +8573,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -8469,6 +8705,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/lru_map": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.4.1.tgz", + "integrity": "sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg==", + "license": "MIT" + }, "node_modules/lru-cache": { "version": "11.5.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", @@ -10061,6 +10303,23 @@ "wrappy": "1" } }, + "node_modules/oniguruma-parser": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", + "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==", + "license": "MIT" + }, + "node_modules/oniguruma-to-es": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz", + "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==", + "license": "MIT", + "dependencies": { + "oniguruma-parser": "^0.12.2", + "regex": "^6.1.0", + "regex-recursion": "^6.0.2" + } + }, "node_modules/openai": { "version": "6.9.1", "resolved": "https://registry.npmjs.org/openai/-/openai-6.9.1.tgz", @@ -11724,6 +11983,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz", + "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-recursion": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz", + "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-utilities": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", + "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", + "license": "MIT" + }, "node_modules/rehype-github-alerts": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/rehype-github-alerts/-/rehype-github-alerts-3.0.0.tgz", @@ -12149,6 +12432,25 @@ "node": ">=8" } }, + "node_modules/shiki": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.6.0.tgz", + "integrity": "sha512-imjLsVHgPuWhvpU3P+zOekvMYqnel7QmKsFC4Sn0fCuAvaaalBsxwKEsrU8Ko5BdFnZA6Go/8a0RzahS634UgA==", + "license": "MIT", + "dependencies": { + "@shikijs/core": "4.6.0", + "@shikijs/engine-javascript": "4.6.0", + "@shikijs/engine-oniguruma": "4.6.0", + "@shikijs/langs": "4.6.0", + "@shikijs/themes": "4.6.0", + "@shikijs/types": "4.6.0", + "@shikijs/vscode-textmate": "^10.1.0", + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/side-channel": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", @@ -12500,6 +12802,20 @@ "node": ">=8" } }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -13007,21 +13323,6 @@ } } }, - "node_modules/svelte-check/node_modules/picomatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", - "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/svelte-eslint-parser": { "version": "0.43.0", "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.43.0.tgz", @@ -13227,21 +13528,6 @@ "svelte": "^4.2.19 || ^5.1.0" } }, - "node_modules/svelte/node_modules/@typescript-eslint/types": { - "version": "8.70.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.70.0.tgz", - "integrity": "sha512-asTOIYhDg4zdzOScCyaytrsV3cR6B4ecPQlXw/dJIm7J/MZTtCtfVII9JD8Geh4jTCrK/Xe6cg5UevoleMcoJQ==", - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/svelte/node_modules/esrap": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.3.7.tgz", @@ -13827,7 +14113,7 @@ "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", diff --git a/frontend/package.json b/frontend/package.json index 3a91129bda..a5a68fc8b2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -91,6 +91,7 @@ "@json2csv/plainjs": "^7.0.6", "@leeoniya/ufuzzy": "^1.0.8", "@melt-ui/svelte": "^0.86.2", + "@pierre/diffs": "1.6.4", "@popperjs/core": "^2.11.8", "@redocly/json-to-json-schema": "^0.0.1", "@scalar/openapi-parser": "^0.15.0", diff --git a/frontend/src/lib/components/pierre/PierreCodeView.svelte b/frontend/src/lib/components/pierre/PierreCodeView.svelte new file mode 100644 index 0000000000..9bc3c55c13 --- /dev/null +++ b/frontend/src/lib/components/pierre/PierreCodeView.svelte @@ -0,0 +1,54 @@ + + +
diff --git a/frontend/src/lib/components/pierre/PierreDiff.svelte b/frontend/src/lib/components/pierre/PierreDiff.svelte new file mode 100644 index 0000000000..a9eaf090ad --- /dev/null +++ b/frontend/src/lib/components/pierre/PierreDiff.svelte @@ -0,0 +1,154 @@ + + +
diff --git a/frontend/src/lib/components/pierre/PierreFileEditor.svelte b/frontend/src/lib/components/pierre/PierreFileEditor.svelte new file mode 100644 index 0000000000..510dd1f0ab --- /dev/null +++ b/frontend/src/lib/components/pierre/PierreFileEditor.svelte @@ -0,0 +1,124 @@ + + +
diff --git a/frontend/src/lib/components/pierre/PierreMergeConflict.svelte b/frontend/src/lib/components/pierre/PierreMergeConflict.svelte new file mode 100644 index 0000000000..ac93694c9c --- /dev/null +++ b/frontend/src/lib/components/pierre/PierreMergeConflict.svelte @@ -0,0 +1,53 @@ + + +
diff --git a/frontend/src/lib/components/pierre/SnippetHost.svelte b/frontend/src/lib/components/pierre/SnippetHost.svelte new file mode 100644 index 0000000000..3584eafdad --- /dev/null +++ b/frontend/src/lib/components/pierre/SnippetHost.svelte @@ -0,0 +1,7 @@ + + +{@render snippet(arg)} diff --git a/frontend/src/lib/components/pierre/pierre.ts b/frontend/src/lib/components/pierre/pierre.ts new file mode 100644 index 0000000000..733f7d5361 --- /dev/null +++ b/frontend/src/lib/components/pierre/pierre.ts @@ -0,0 +1,56 @@ +import { + disposeHighlighter, + type HighlighterTypes, + type SupportedLanguages, + type ThemesType +} from '@pierre/diffs' +import { WorkerPoolManager } from '@pierre/diffs/worker' +import PierreWorkerUrl from '@pierre/diffs/worker/worker.js?worker&url' + +export const PIERRE_THEME: ThemesType = { dark: 'pierre-dark', light: 'pierre-light' } + +// Keyed by the editor language `scriptLangToEditorLang` returns. Every other id is passed +// through, since Monaco and Shiki share most names. +// for related places search: ADD_NEW_LANG +const SHIKI_LANG_BY_MONACO: Record = { + shell: 'shellscript', + nu: 'nushell', + plaintext: 'text' +} + +export function pierreLang(monacoLang: string | undefined): SupportedLanguages | undefined { + if (!monacoLang) return undefined + return (SHIKI_LANG_BY_MONACO[monacoLang] ?? monacoLang) as SupportedLanguages +} + +let mainThreadHighlighter: HighlighterTypes | undefined + +/** + * Components without a pool share one main-thread highlighter, created with the first backend + * any of them asked for; later `preferredHighlighter` values are ignored until it is disposed. + * Call before mounting a component that needs another backend, after unmounting the old ones. + */ +export async function switchMainThreadHighlighter(type: HighlighterTypes): Promise { + if (mainThreadHighlighter !== undefined && mainThreadHighlighter !== type) { + await disposeHighlighter() + } + mainThreadHighlighter = type +} + +const pools = new Map() + +/** One pool per highlighter backend: a pool's backend is fixed when its workers start. */ +export function pierreWorkerPool(preferredHighlighter: HighlighterTypes): WorkerPoolManager { + let pool = pools.get(preferredHighlighter) + if (!pool) { + pool = new WorkerPoolManager( + { + workerFactory: () => new Worker(PierreWorkerUrl, { type: 'module' }), + poolSize: Math.min(4, navigator.hardwareConcurrency || 2) + }, + { theme: PIERRE_THEME, preferredHighlighter } + ) + pools.set(preferredHighlighter, pool) + } + return pool +} diff --git a/frontend/src/lib/components/pierre/snippetElements.ts b/frontend/src/lib/components/pierre/snippetElements.ts new file mode 100644 index 0000000000..eecfec9422 --- /dev/null +++ b/frontend/src/lib/components/pierre/snippetElements.ts @@ -0,0 +1,27 @@ +import { mount, unmount, type Snippet } from 'svelte' +import SnippetHost from './SnippetHost.svelte' + +/** + * Pierre's render callbacks return detached DOM nodes. This mounts a Svelte snippet into one + * and keeps every mount so the owner can unmount them all when it is destroyed. + */ +export function snippetElements() { + const mounted: Record[] = [] + let destroyed = false + return { + render(snippet: Snippet<[T]>, arg: T, tag: 'div' | 'span' = 'div'): HTMLElement { + const target = document.createElement(tag) + // Pierre re-renders synchronously when an edit session ends, which can be inside an + // effect teardown, where Svelte refuses to create the mounted component's effects. + queueMicrotask(() => { + if (destroyed) return + mounted.push(mount(SnippetHost, { target, props: { snippet, arg } })) + }) + return target + }, + destroy() { + destroyed = true + for (const m of mounted.splice(0)) unmount(m) + } + } +} diff --git a/frontend/src/routes/(styled)/test_dev/diff-comparison/+page.svelte b/frontend/src/routes/(styled)/test_dev/diff-comparison/+page.svelte index c473dbcb64..9104881d51 100644 --- a/frontend/src/routes/(styled)/test_dev/diff-comparison/+page.svelte +++ b/frontend/src/routes/(styled)/test_dev/diff-comparison/+page.svelte @@ -1,94 +1,12 @@ @@ -96,44 +14,30 @@
-
- {#each cases as item} - - {/each} -
- -
-
-

Monaco

-
- {#key activeCase.id} - - {/key} +

Diff comparison

+

+ Monaco, our highlight.js diff view and @pierre/diffs on the same inputs. +

+ + + + + + + {#snippet content()} +
+ {#if tab === 'diff'} + + {:else if tab === 'review'} + + {:else if tab === 'multi'} + + {:else if tab === 'editor'} + + {:else if tab === 'merge'} + + {/if}
-
- -
-

Native

-
- {#key activeCase.id} - - {/key} -
-
-
+ {/snippet} +
diff --git a/frontend/src/routes/(styled)/test_dev/diff-comparison/Benchmark.svelte b/frontend/src/routes/(styled)/test_dev/diff-comparison/Benchmark.svelte new file mode 100644 index 0000000000..69426b1816 --- /dev/null +++ b/frontend/src/routes/(styled)/test_dev/diff-comparison/Benchmark.svelte @@ -0,0 +1,192 @@ + + +
+
+

Benchmark

+ + Mounts each renderer alone on the current case. Run 1 includes loading code, grammars and + workers; run 2 is warm. Long tasks are main-thread blocks over 50 ms (Chromium only). "–" + under Highlighted means no colors within 10 s: the native view skips highlighting past 2,000 + lines. + +
+
+ + {#if running && current} + Rendering {current.label}… + {/if} +
+ + {#if results.length > 0} + + + + + + + + + + + + + {#each results as r (`${r.run}:${r.label}`)} + + + + + + + + + {/each} + +
RunRendererFirst lineHighlightedLong tasksDOM nodes
{r.run === 1 ? 'cold' : 'warm'}{r.label}{formatMs(r.painted)}{formatMs(r.highlighted)}{formatMs(r.longTasks)}{r.nodes.toLocaleString()}
+ {/if} + +
+ {#if current?.id === 'monaco'} + + {:else if current?.id === 'native'} + + {:else if current?.pierre?.virtualized} + + {:else if current?.pierre} + + {/if} +
+
diff --git a/frontend/src/routes/(styled)/test_dev/diff-comparison/DiffTab.svelte b/frontend/src/routes/(styled)/test_dev/diff-comparison/DiffTab.svelte new file mode 100644 index 0000000000..106f45a1b2 --- /dev/null +++ b/frontend/src/routes/(styled)/test_dev/diff-comparison/DiffTab.svelte @@ -0,0 +1,115 @@ + + +
+
+ {#each cases as item (item.id)} + + {/each} +
+ { + workspaceCase = c + activeCaseId = c.id + }} + /> + +
+
+

Monaco

+
+ {#key `${activeCase.id}:${settings.diffStyle}`} + + {/key} +
+
+ +
+

Native (highlight.js)

+
+ {#key activeCase.id} + + {/key} +
+
+
+ +
+
+

Pierre

+ +
+ +
+ + {#key `${settings.useWorkers}:${settings.highlighter}:${virtualized}`} + {#await settings.useWorkers ? undefined : switchMainThreadHighlighter(settings.highlighter) then} + {@render pierre()} + {/await} + {/key} +
+
+ + +
+ +{#snippet pierre()} + {#if virtualized} + + {:else} + + {/if} +{/snippet} diff --git a/frontend/src/routes/(styled)/test_dev/diff-comparison/EditorTab.svelte b/frontend/src/routes/(styled)/test_dev/diff-comparison/EditorTab.svelte new file mode 100644 index 0000000000..89841dc914 --- /dev/null +++ b/frontend/src/routes/(styled)/test_dev/diff-comparison/EditorTab.svelte @@ -0,0 +1,171 @@ + + +
+
+

Pierre editor

+
+ + + + {#each ['pierre', 'monaco'] as const as side (side)} + {@const s = stats[side]} + {#if s} + + {side}: first line {formatMs(s.painted)}, long tasks {formatMs(s.longTasks)}, + {s.nodes.toLocaleString()} nodes + + {/if} + {/each} +
+ + +
+ {#if shown === 'pierre'} + {#key `${settings.useWorkers}:${settings.highlighter}`} + + {/key} + {:else if shown === 'monaco'} + {#each files.slice(0, MONACO_MAX) as f (f.name)} +
{f.name}
+
+ +
+ {/each} + {/if} +
+
diff --git a/frontend/src/routes/(styled)/test_dev/diff-comparison/PierreSettingsBar.svelte b/frontend/src/routes/(styled)/test_dev/diff-comparison/PierreSettingsBar.svelte new file mode 100644 index 0000000000..4de28a22cb --- /dev/null +++ b/frontend/src/routes/(styled)/test_dev/diff-comparison/PierreSettingsBar.svelte @@ -0,0 +1,71 @@ + + +
+ + + + + + + + +
diff --git a/frontend/src/routes/(styled)/test_dev/diff-comparison/ReviewTab.svelte b/frontend/src/routes/(styled)/test_dev/diff-comparison/ReviewTab.svelte new file mode 100644 index 0000000000..da8be1ac50 --- /dev/null +++ b/frontend/src/routes/(styled)/test_dev/diff-comparison/ReviewTab.svelte @@ -0,0 +1,262 @@ + + +{#snippet headerMetadata(_diff: FileDiffMetadata)} + 0 ? 'yellow' : 'green'}> + {remaining > 0 ? `${remaining} to review` : 'reviewed'} + +{/snippet} + +{#snippet note(a: DiffLineAnnotation)} + {#if a.metadata.kind === 'change'} + {@const m = a.metadata} +
+ + Change {m.change + 1} of hunk {m.hunk + 1}: +{m.additions} −{m.deletions} + + + +
+ {:else} + {@const id = a.metadata.id} +
+ +
+ {/if} +{/snippet} + +
+
+

Pierre: review an AI change

+

+ Accept or reject each change block, add a comment from the gutter (+), select lines, hover a + token, or edit the new side directly. Demo lint markers follow the edited text. +

+
+ + + + + {#if editor} +
+
+ + Selection: {selected ? `${selected.side ?? ''} ${selected.start}–${selected.end}` : 'none'} + + Hovered token: {hoveredToken ?? '–'} + Markers: {markers.length} +
+
+ (editor = e)} + onEditChange={(text) => (liveAfter = text)} + onEdited={(_text, fileDiff) => { + reviewDiff = fileDiff + liveAfter = undefined + log = ['edit session accepted', ...log] + }} + /> +
+
+ +
+

Monaco: editable diff

+

+ Monaco's equivalent: the new side is editable and the gutter arrow reverts a change. No + per-change accept, no inline comments. +

+
+ +
+

Resulting file (Pierre side)

+
{liveAfter ?? resultText}
+

Events

+
    + {#each log as entry, i (log.length - i)}
  • {entry}
  • {/each} +
+
+
diff --git a/frontend/src/routes/(styled)/test_dev/diff-comparison/WorkspaceScriptPicker.svelte b/frontend/src/routes/(styled)/test_dev/diff-comparison/WorkspaceScriptPicker.svelte new file mode 100644 index 0000000000..54ea9c7dfb --- /dev/null +++ b/frontend/src/routes/(styled)/test_dev/diff-comparison/WorkspaceScriptPicker.svelte @@ -0,0 +1,84 @@ + + +
+ Workspace script + {#if !$workspaceStore} + Log in and pick a workspace to diff real script versions + {:else if error} + {error} + {:else} + + → +