Initial commit
This commit is contained in:
1
.buildpacks
Normal file
1
.buildpacks
Normal file
@@ -0,0 +1 @@
|
||||
https://github.com/joshzeigler/heroku-buildpack-bun.git
|
||||
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
node_modules
|
||||
# dist
|
||||
.env
|
||||
*.log
|
||||
downloads
|
||||
packages/client/dist
|
||||
packages/server/dist
|
||||
913
bun.lock
Normal file
913
bun.lock
Normal file
@@ -0,0 +1,913 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "torrent-client-monorepo",
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.2",
|
||||
"vitest": "^0.34.4",
|
||||
},
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@torrent-client/client",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@torrent-client/shared": "*",
|
||||
"clsx": "^2.0.0",
|
||||
"framer-motion": "^10.16.4",
|
||||
"lucide-react": "^0.284.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"tailwind-merge": "^1.14.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.2.15",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"@vitejs/plugin-react": "^4.0.3",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"eslint": "^8.45.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.3",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"vite": "^4.4.5",
|
||||
},
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@torrent-client/server",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@torrent-client/shared": "*",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.18.2",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.13",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/node": "^18.17.0",
|
||||
"bun-types": "latest",
|
||||
"nodemon": "^3.0.1",
|
||||
"ts-node": "^10.9.1",
|
||||
},
|
||||
},
|
||||
"packages/shared": {
|
||||
"name": "@torrent-client/shared",
|
||||
"version": "1.0.0",
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.17.0",
|
||||
},
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="],
|
||||
|
||||
"@babel/code-frame": ["@babel/code-frame@7.27.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg=="],
|
||||
|
||||
"@babel/compat-data": ["@babel/compat-data@7.28.5", "", {}, "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA=="],
|
||||
|
||||
"@babel/core": ["@babel/core@7.28.5", "", { "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", "@babel/helper-compilation-targets": "^7.27.2", "@babel/helper-module-transforms": "^7.28.3", "@babel/helpers": "^7.28.4", "@babel/parser": "^7.28.5", "@babel/template": "^7.27.2", "@babel/traverse": "^7.28.5", "@babel/types": "^7.28.5", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw=="],
|
||||
|
||||
"@babel/generator": ["@babel/generator@7.28.5", "", { "dependencies": { "@babel/parser": "^7.28.5", "@babel/types": "^7.28.5", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ=="],
|
||||
|
||||
"@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.27.2", "", { "dependencies": { "@babel/compat-data": "^7.27.2", "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ=="],
|
||||
|
||||
"@babel/helper-globals": ["@babel/helper-globals@7.28.0", "", {}, "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="],
|
||||
|
||||
"@babel/helper-module-imports": ["@babel/helper-module-imports@7.27.1", "", { "dependencies": { "@babel/traverse": "^7.27.1", "@babel/types": "^7.27.1" } }, "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w=="],
|
||||
|
||||
"@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.28.3", "", { "dependencies": { "@babel/helper-module-imports": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1", "@babel/traverse": "^7.28.3" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw=="],
|
||||
|
||||
"@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.27.1", "", {}, "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw=="],
|
||||
|
||||
"@babel/helper-string-parser": ["@babel/helper-string-parser@7.27.1", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="],
|
||||
|
||||
"@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="],
|
||||
|
||||
"@babel/helper-validator-option": ["@babel/helper-validator-option@7.27.1", "", {}, "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="],
|
||||
|
||||
"@babel/helpers": ["@babel/helpers@7.28.4", "", { "dependencies": { "@babel/template": "^7.27.2", "@babel/types": "^7.28.4" } }, "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w=="],
|
||||
|
||||
"@babel/parser": ["@babel/parser@7.28.5", "", { "dependencies": { "@babel/types": "^7.28.5" }, "bin": "./bin/babel-parser.js" }, "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ=="],
|
||||
|
||||
"@babel/plugin-transform-react-jsx-self": ["@babel/plugin-transform-react-jsx-self@7.27.1", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw=="],
|
||||
|
||||
"@babel/plugin-transform-react-jsx-source": ["@babel/plugin-transform-react-jsx-source@7.27.1", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw=="],
|
||||
|
||||
"@babel/template": ["@babel/template@7.27.2", "", { "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/parser": "^7.27.2", "@babel/types": "^7.27.1" } }, "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw=="],
|
||||
|
||||
"@babel/traverse": ["@babel/traverse@7.28.5", "", { "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.28.5", "@babel/template": "^7.27.2", "@babel/types": "^7.28.5", "debug": "^4.3.1" } }, "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ=="],
|
||||
|
||||
"@babel/types": ["@babel/types@7.28.5", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA=="],
|
||||
|
||||
"@cspotcode/source-map-support": ["@cspotcode/source-map-support@0.8.1", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.9" } }, "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw=="],
|
||||
|
||||
"@emotion/is-prop-valid": ["@emotion/is-prop-valid@0.8.8", "", { "dependencies": { "@emotion/memoize": "0.7.4" } }, "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA=="],
|
||||
|
||||
"@emotion/memoize": ["@emotion/memoize@0.7.4", "", {}, "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw=="],
|
||||
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.18.20", "", { "os": "android", "cpu": "arm" }, "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw=="],
|
||||
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.18.20", "", { "os": "android", "cpu": "arm64" }, "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ=="],
|
||||
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.18.20", "", { "os": "android", "cpu": "x64" }, "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg=="],
|
||||
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.18.20", "", { "os": "darwin", "cpu": "arm64" }, "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA=="],
|
||||
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.18.20", "", { "os": "darwin", "cpu": "x64" }, "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ=="],
|
||||
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.18.20", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw=="],
|
||||
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.18.20", "", { "os": "freebsd", "cpu": "x64" }, "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ=="],
|
||||
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.18.20", "", { "os": "linux", "cpu": "arm" }, "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg=="],
|
||||
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.18.20", "", { "os": "linux", "cpu": "arm64" }, "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA=="],
|
||||
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.18.20", "", { "os": "linux", "cpu": "ia32" }, "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA=="],
|
||||
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg=="],
|
||||
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ=="],
|
||||
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.18.20", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA=="],
|
||||
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A=="],
|
||||
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.18.20", "", { "os": "linux", "cpu": "s390x" }, "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ=="],
|
||||
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.18.20", "", { "os": "linux", "cpu": "x64" }, "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w=="],
|
||||
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.18.20", "", { "os": "none", "cpu": "x64" }, "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A=="],
|
||||
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.18.20", "", { "os": "openbsd", "cpu": "x64" }, "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg=="],
|
||||
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.18.20", "", { "os": "sunos", "cpu": "x64" }, "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ=="],
|
||||
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.18.20", "", { "os": "win32", "cpu": "arm64" }, "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg=="],
|
||||
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.18.20", "", { "os": "win32", "cpu": "ia32" }, "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.18.20", "", { "os": "win32", "cpu": "x64" }, "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ=="],
|
||||
|
||||
"@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.0", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g=="],
|
||||
|
||||
"@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="],
|
||||
|
||||
"@eslint/eslintrc": ["@eslint/eslintrc@2.1.4", "", { "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ=="],
|
||||
|
||||
"@eslint/js": ["@eslint/js@8.57.1", "", {}, "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q=="],
|
||||
|
||||
"@humanwhocodes/config-array": ["@humanwhocodes/config-array@0.13.0", "", { "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", "minimatch": "^3.0.5" } }, "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw=="],
|
||||
|
||||
"@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="],
|
||||
|
||||
"@humanwhocodes/object-schema": ["@humanwhocodes/object-schema@2.0.3", "", {}, "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA=="],
|
||||
|
||||
"@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="],
|
||||
|
||||
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
|
||||
|
||||
"@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
|
||||
|
||||
"@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
|
||||
|
||||
"@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
|
||||
|
||||
"@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="],
|
||||
|
||||
"@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
|
||||
|
||||
"@nodelib/fs.stat": ["@nodelib/fs.stat@2.0.5", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="],
|
||||
|
||||
"@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="],
|
||||
|
||||
"@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-beta.27", "", {}, "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA=="],
|
||||
|
||||
"@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="],
|
||||
|
||||
"@torrent-client/client": ["@torrent-client/client@workspace:packages/client"],
|
||||
|
||||
"@torrent-client/server": ["@torrent-client/server@workspace:packages/server"],
|
||||
|
||||
"@torrent-client/shared": ["@torrent-client/shared@workspace:packages/shared"],
|
||||
|
||||
"@tsconfig/node10": ["@tsconfig/node10@1.0.12", "", {}, "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ=="],
|
||||
|
||||
"@tsconfig/node12": ["@tsconfig/node12@1.0.11", "", {}, "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag=="],
|
||||
|
||||
"@tsconfig/node14": ["@tsconfig/node14@1.0.3", "", {}, "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow=="],
|
||||
|
||||
"@tsconfig/node16": ["@tsconfig/node16@1.0.4", "", {}, "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA=="],
|
||||
|
||||
"@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
|
||||
|
||||
"@types/babel__generator": ["@types/babel__generator@7.27.0", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="],
|
||||
|
||||
"@types/babel__template": ["@types/babel__template@7.4.4", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="],
|
||||
|
||||
"@types/babel__traverse": ["@types/babel__traverse@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],
|
||||
|
||||
"@types/body-parser": ["@types/body-parser@1.19.6", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g=="],
|
||||
|
||||
"@types/chai": ["@types/chai@4.3.20", "", {}, "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ=="],
|
||||
|
||||
"@types/chai-subset": ["@types/chai-subset@1.3.6", "", { "peerDependencies": { "@types/chai": "<5.2.0" } }, "sha512-m8lERkkQj+uek18hXOZuec3W/fCRTrU4hrnXjH3qhHy96ytuPaPiWGgu7sJb7tZxZonO75vYAjCvpe/e4VUwRw=="],
|
||||
|
||||
"@types/connect": ["@types/connect@3.4.38", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="],
|
||||
|
||||
"@types/cors": ["@types/cors@2.8.19", "", { "dependencies": { "@types/node": "*" } }, "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg=="],
|
||||
|
||||
"@types/express": ["@types/express@4.17.25", "", { "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "^1" } }, "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw=="],
|
||||
|
||||
"@types/express-serve-static-core": ["@types/express-serve-static-core@4.19.7", "", { "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*", "@types/send": "*" } }, "sha512-FvPtiIf1LfhzsaIXhv/PHan/2FeQBbtBDtfX2QfvPxdUelMDEckK08SM6nqo1MIZY3RUlfA+HV8+hFUSio78qg=="],
|
||||
|
||||
"@types/http-errors": ["@types/http-errors@2.0.5", "", {}, "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg=="],
|
||||
|
||||
"@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="],
|
||||
|
||||
"@types/mime": ["@types/mime@1.3.5", "", {}, "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="],
|
||||
|
||||
"@types/node": ["@types/node@18.19.130", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg=="],
|
||||
|
||||
"@types/prop-types": ["@types/prop-types@15.7.15", "", {}, "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw=="],
|
||||
|
||||
"@types/qs": ["@types/qs@6.14.0", "", {}, "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ=="],
|
||||
|
||||
"@types/range-parser": ["@types/range-parser@1.2.7", "", {}, "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="],
|
||||
|
||||
"@types/react": ["@types/react@18.3.27", "", { "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" } }, "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w=="],
|
||||
|
||||
"@types/react-dom": ["@types/react-dom@18.3.7", "", { "peerDependencies": { "@types/react": "^18.0.0" } }, "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ=="],
|
||||
|
||||
"@types/semver": ["@types/semver@7.7.1", "", {}, "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA=="],
|
||||
|
||||
"@types/send": ["@types/send@0.17.6", "", { "dependencies": { "@types/mime": "^1", "@types/node": "*" } }, "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og=="],
|
||||
|
||||
"@types/serve-static": ["@types/serve-static@1.15.10", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "<1" } }, "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw=="],
|
||||
|
||||
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@6.21.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.5.1", "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/type-utils": "6.21.0", "@typescript-eslint/utils": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", "natural-compare": "^1.4.0", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, "peerDependencies": { "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", "eslint": "^7.0.0 || ^8.0.0" } }, "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA=="],
|
||||
|
||||
"@typescript-eslint/parser": ["@typescript-eslint/parser@6.21.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", "@typescript-eslint/typescript-estree": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" } }, "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ=="],
|
||||
|
||||
"@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@6.21.0", "", { "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0" } }, "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg=="],
|
||||
|
||||
"@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@6.21.0", "", { "dependencies": { "@typescript-eslint/typescript-estree": "6.21.0", "@typescript-eslint/utils": "6.21.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" } }, "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag=="],
|
||||
|
||||
"@typescript-eslint/types": ["@typescript-eslint/types@6.21.0", "", {}, "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg=="],
|
||||
|
||||
"@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@6.21.0", "", { "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "minimatch": "9.0.3", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" } }, "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ=="],
|
||||
|
||||
"@typescript-eslint/utils": ["@typescript-eslint/utils@6.21.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", "@typescript-eslint/typescript-estree": "6.21.0", "semver": "^7.5.4" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" } }, "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ=="],
|
||||
|
||||
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@6.21.0", "", { "dependencies": { "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" } }, "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A=="],
|
||||
|
||||
"@ungap/structured-clone": ["@ungap/structured-clone@1.3.0", "", {}, "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g=="],
|
||||
|
||||
"@vitejs/plugin-react": ["@vitejs/plugin-react@4.7.0", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-beta.27", "@types/babel__core": "^7.20.5", "react-refresh": "^0.17.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA=="],
|
||||
|
||||
"@vitest/expect": ["@vitest/expect@0.34.6", "", { "dependencies": { "@vitest/spy": "0.34.6", "@vitest/utils": "0.34.6", "chai": "^4.3.10" } }, "sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw=="],
|
||||
|
||||
"@vitest/runner": ["@vitest/runner@0.34.6", "", { "dependencies": { "@vitest/utils": "0.34.6", "p-limit": "^4.0.0", "pathe": "^1.1.1" } }, "sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ=="],
|
||||
|
||||
"@vitest/snapshot": ["@vitest/snapshot@0.34.6", "", { "dependencies": { "magic-string": "^0.30.1", "pathe": "^1.1.1", "pretty-format": "^29.5.0" } }, "sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w=="],
|
||||
|
||||
"@vitest/spy": ["@vitest/spy@0.34.6", "", { "dependencies": { "tinyspy": "^2.1.1" } }, "sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ=="],
|
||||
|
||||
"@vitest/utils": ["@vitest/utils@0.34.6", "", { "dependencies": { "diff-sequences": "^29.4.3", "loupe": "^2.3.6", "pretty-format": "^29.5.0" } }, "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A=="],
|
||||
|
||||
"accepts": ["accepts@1.3.8", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="],
|
||||
|
||||
"acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="],
|
||||
|
||||
"acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
|
||||
|
||||
"acorn-walk": ["acorn-walk@8.3.4", "", { "dependencies": { "acorn": "^8.11.0" } }, "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g=="],
|
||||
|
||||
"ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="],
|
||||
|
||||
"ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
|
||||
|
||||
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
|
||||
|
||||
"any-promise": ["any-promise@1.3.0", "", {}, "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="],
|
||||
|
||||
"anymatch": ["anymatch@3.1.3", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="],
|
||||
|
||||
"arg": ["arg@5.0.2", "", {}, "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="],
|
||||
|
||||
"argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="],
|
||||
|
||||
"array-flatten": ["array-flatten@1.1.1", "", {}, "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="],
|
||||
|
||||
"array-union": ["array-union@2.1.0", "", {}, "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw=="],
|
||||
|
||||
"assertion-error": ["assertion-error@1.1.0", "", {}, "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw=="],
|
||||
|
||||
"autoprefixer": ["autoprefixer@10.4.23", "", { "dependencies": { "browserslist": "^4.28.1", "caniuse-lite": "^1.0.30001760", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-YYTXSFulfwytnjAPlw8QHncHJmlvFKtczb8InXaAx9Q0LbfDnfEYDE55omerIJKihhmU61Ft+cAOSzQVaBUmeA=="],
|
||||
|
||||
"balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
||||
|
||||
"baseline-browser-mapping": ["baseline-browser-mapping@2.9.11", "", { "bin": { "baseline-browser-mapping": "dist/cli.js" } }, "sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ=="],
|
||||
|
||||
"binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="],
|
||||
|
||||
"body-parser": ["body-parser@1.20.4", "", { "dependencies": { "bytes": "~3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "~1.2.0", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "on-finished": "~2.4.1", "qs": "~6.14.0", "raw-body": "~2.5.3", "type-is": "~1.6.18", "unpipe": "~1.0.0" } }, "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA=="],
|
||||
|
||||
"brace-expansion": ["brace-expansion@1.1.12", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg=="],
|
||||
|
||||
"braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
|
||||
|
||||
"browserslist": ["browserslist@4.28.1", "", { "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", "electron-to-chromium": "^1.5.263", "node-releases": "^2.0.27", "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA=="],
|
||||
|
||||
"bun-types": ["bun-types@1.3.5", "", { "dependencies": { "@types/node": "*" } }, "sha512-inmAYe2PFLs0SUbFOWSVD24sg1jFlMPxOjOSSCYqUgn4Hsc3rDc7dFvfVYjFPNHtov6kgUeulV4SxbuIV/stPw=="],
|
||||
|
||||
"bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
|
||||
|
||||
"cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="],
|
||||
|
||||
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
||||
|
||||
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
|
||||
|
||||
"callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],
|
||||
|
||||
"camelcase-css": ["camelcase-css@2.0.1", "", {}, "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="],
|
||||
|
||||
"caniuse-lite": ["caniuse-lite@1.0.30001762", "", {}, "sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw=="],
|
||||
|
||||
"chai": ["chai@4.5.0", "", { "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", "deep-eql": "^4.1.3", "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", "type-detect": "^4.1.0" } }, "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw=="],
|
||||
|
||||
"chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
|
||||
|
||||
"check-error": ["check-error@1.0.3", "", { "dependencies": { "get-func-name": "^2.0.2" } }, "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg=="],
|
||||
|
||||
"chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="],
|
||||
|
||||
"clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
|
||||
|
||||
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
|
||||
|
||||
"color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
|
||||
|
||||
"commander": ["commander@4.1.1", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="],
|
||||
|
||||
"concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
|
||||
|
||||
"confbox": ["confbox@0.1.8", "", {}, "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w=="],
|
||||
|
||||
"content-disposition": ["content-disposition@0.5.4", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ=="],
|
||||
|
||||
"content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="],
|
||||
|
||||
"convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
|
||||
|
||||
"cookie": ["cookie@0.7.2", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],
|
||||
|
||||
"cookie-signature": ["cookie-signature@1.0.7", "", {}, "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA=="],
|
||||
|
||||
"cors": ["cors@2.8.5", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g=="],
|
||||
|
||||
"create-require": ["create-require@1.1.1", "", {}, "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ=="],
|
||||
|
||||
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
|
||||
|
||||
"cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="],
|
||||
|
||||
"csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
|
||||
|
||||
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||
|
||||
"deep-eql": ["deep-eql@4.1.4", "", { "dependencies": { "type-detect": "^4.0.0" } }, "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg=="],
|
||||
|
||||
"deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="],
|
||||
|
||||
"depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],
|
||||
|
||||
"destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="],
|
||||
|
||||
"didyoumean": ["didyoumean@1.2.2", "", {}, "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw=="],
|
||||
|
||||
"diff": ["diff@4.0.2", "", {}, "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A=="],
|
||||
|
||||
"diff-sequences": ["diff-sequences@29.6.3", "", {}, "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q=="],
|
||||
|
||||
"dir-glob": ["dir-glob@3.0.1", "", { "dependencies": { "path-type": "^4.0.0" } }, "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA=="],
|
||||
|
||||
"dlv": ["dlv@1.1.3", "", {}, "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA=="],
|
||||
|
||||
"doctrine": ["doctrine@3.0.0", "", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w=="],
|
||||
|
||||
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
||||
|
||||
"ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
|
||||
|
||||
"electron-to-chromium": ["electron-to-chromium@1.5.267", "", {}, "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw=="],
|
||||
|
||||
"encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],
|
||||
|
||||
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
||||
|
||||
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
|
||||
|
||||
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
|
||||
|
||||
"esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="],
|
||||
|
||||
"escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
|
||||
|
||||
"escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="],
|
||||
|
||||
"escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],
|
||||
|
||||
"eslint": ["eslint@8.57.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", "@eslint/js": "8.57.1", "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.2", "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" } }, "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA=="],
|
||||
|
||||
"eslint-plugin-react-hooks": ["eslint-plugin-react-hooks@4.6.2", "", { "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" } }, "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ=="],
|
||||
|
||||
"eslint-plugin-react-refresh": ["eslint-plugin-react-refresh@0.4.26", "", { "peerDependencies": { "eslint": ">=8.40" } }, "sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ=="],
|
||||
|
||||
"eslint-scope": ["eslint-scope@7.2.2", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg=="],
|
||||
|
||||
"eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
|
||||
|
||||
"espree": ["espree@9.6.1", "", { "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" } }, "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ=="],
|
||||
|
||||
"esquery": ["esquery@1.6.0", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg=="],
|
||||
|
||||
"esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="],
|
||||
|
||||
"estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="],
|
||||
|
||||
"esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="],
|
||||
|
||||
"etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="],
|
||||
|
||||
"express": ["express@4.22.1", "", { "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "~1.20.3", "content-disposition": "~0.5.4", "content-type": "~1.0.4", "cookie": "~0.7.1", "cookie-signature": "~1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "~1.3.1", "fresh": "~0.5.2", "http-errors": "~2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "~2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "~0.1.12", "proxy-addr": "~2.0.7", "qs": "~6.14.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "~0.19.0", "serve-static": "~1.16.2", "setprototypeof": "1.2.0", "statuses": "~2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" } }, "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g=="],
|
||||
|
||||
"fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
|
||||
|
||||
"fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="],
|
||||
|
||||
"fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="],
|
||||
|
||||
"fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="],
|
||||
|
||||
"fastq": ["fastq@1.20.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="],
|
||||
|
||||
"fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
|
||||
|
||||
"file-entry-cache": ["file-entry-cache@6.0.1", "", { "dependencies": { "flat-cache": "^3.0.4" } }, "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg=="],
|
||||
|
||||
"fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
|
||||
|
||||
"finalhandler": ["finalhandler@1.3.2", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "~2.4.1", "parseurl": "~1.3.3", "statuses": "~2.0.2", "unpipe": "~1.0.0" } }, "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg=="],
|
||||
|
||||
"find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="],
|
||||
|
||||
"flat-cache": ["flat-cache@3.2.0", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw=="],
|
||||
|
||||
"flatted": ["flatted@3.3.3", "", {}, "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg=="],
|
||||
|
||||
"forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="],
|
||||
|
||||
"fraction.js": ["fraction.js@5.3.4", "", {}, "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ=="],
|
||||
|
||||
"framer-motion": ["framer-motion@10.18.0", "", { "dependencies": { "tslib": "^2.4.0" }, "optionalDependencies": { "@emotion/is-prop-valid": "^0.8.2" }, "peerDependencies": { "react": "^18.0.0", "react-dom": "^18.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-oGlDh1Q1XqYPksuTD/usb0I70hq95OUzmL9+6Zd+Hs4XV0oaISBa/UUMSjYiq6m8EUF32132mOJ8xVZS+I0S6w=="],
|
||||
|
||||
"fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="],
|
||||
|
||||
"fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="],
|
||||
|
||||
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||
|
||||
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
|
||||
|
||||
"gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
|
||||
|
||||
"get-func-name": ["get-func-name@2.0.2", "", {}, "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ=="],
|
||||
|
||||
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
||||
|
||||
"glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="],
|
||||
|
||||
"glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="],
|
||||
|
||||
"globals": ["globals@13.24.0", "", { "dependencies": { "type-fest": "^0.20.2" } }, "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ=="],
|
||||
|
||||
"globby": ["globby@11.1.0", "", { "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" } }, "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g=="],
|
||||
|
||||
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"graphemer": ["graphemer@1.4.0", "", {}, "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag=="],
|
||||
|
||||
"has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="],
|
||||
|
||||
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
||||
|
||||
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
|
||||
|
||||
"http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
|
||||
|
||||
"iconv-lite": ["iconv-lite@0.4.24", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="],
|
||||
|
||||
"ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
|
||||
|
||||
"ignore-by-default": ["ignore-by-default@1.0.1", "", {}, "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA=="],
|
||||
|
||||
"import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="],
|
||||
|
||||
"imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
|
||||
|
||||
"inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="],
|
||||
|
||||
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
||||
|
||||
"ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
|
||||
|
||||
"is-binary-path": ["is-binary-path@2.1.0", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="],
|
||||
|
||||
"is-core-module": ["is-core-module@2.16.1", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="],
|
||||
|
||||
"is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],
|
||||
|
||||
"is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],
|
||||
|
||||
"is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],
|
||||
|
||||
"is-path-inside": ["is-path-inside@3.0.3", "", {}, "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ=="],
|
||||
|
||||
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
|
||||
|
||||
"jiti": ["jiti@1.21.7", "", { "bin": { "jiti": "bin/jiti.js" } }, "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A=="],
|
||||
|
||||
"js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
|
||||
|
||||
"js-yaml": ["js-yaml@4.1.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="],
|
||||
|
||||
"jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
|
||||
|
||||
"json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="],
|
||||
|
||||
"json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="],
|
||||
|
||||
"json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="],
|
||||
|
||||
"json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
|
||||
|
||||
"keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],
|
||||
|
||||
"levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],
|
||||
|
||||
"lilconfig": ["lilconfig@3.1.3", "", {}, "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw=="],
|
||||
|
||||
"lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="],
|
||||
|
||||
"local-pkg": ["local-pkg@0.4.3", "", {}, "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g=="],
|
||||
|
||||
"locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
|
||||
|
||||
"lodash.merge": ["lodash.merge@4.6.2", "", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="],
|
||||
|
||||
"loose-envify": ["loose-envify@1.4.0", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="],
|
||||
|
||||
"loupe": ["loupe@2.3.7", "", { "dependencies": { "get-func-name": "^2.0.1" } }, "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA=="],
|
||||
|
||||
"lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],
|
||||
|
||||
"lucide-react": ["lucide-react@0.284.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0" } }, "sha512-dVSMHYAya/TeY3+vsk+VQJEKNQN2AhIo0+Dp09B2qpzvcBuu93H98YZykFcjIAfmanFiDd8nqfXFR38L757cyQ=="],
|
||||
|
||||
"magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
|
||||
|
||||
"make-error": ["make-error@1.3.6", "", {}, "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="],
|
||||
|
||||
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
|
||||
|
||||
"media-typer": ["media-typer@0.3.0", "", {}, "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="],
|
||||
|
||||
"merge-descriptors": ["merge-descriptors@1.0.3", "", {}, "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ=="],
|
||||
|
||||
"merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="],
|
||||
|
||||
"methods": ["methods@1.1.2", "", {}, "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="],
|
||||
|
||||
"micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="],
|
||||
|
||||
"mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="],
|
||||
|
||||
"mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
|
||||
|
||||
"mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
|
||||
|
||||
"minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="],
|
||||
|
||||
"mlly": ["mlly@1.8.0", "", { "dependencies": { "acorn": "^8.15.0", "pathe": "^2.0.3", "pkg-types": "^1.3.1", "ufo": "^1.6.1" } }, "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g=="],
|
||||
|
||||
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||
|
||||
"mz": ["mz@2.7.0", "", { "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", "thenify-all": "^1.0.0" } }, "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q=="],
|
||||
|
||||
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
|
||||
|
||||
"natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="],
|
||||
|
||||
"negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="],
|
||||
|
||||
"node-releases": ["node-releases@2.0.27", "", {}, "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA=="],
|
||||
|
||||
"nodemon": ["nodemon@3.1.11", "", { "dependencies": { "chokidar": "^3.5.2", "debug": "^4", "ignore-by-default": "^1.0.1", "minimatch": "^3.1.2", "pstree.remy": "^1.1.8", "semver": "^7.5.3", "simple-update-notifier": "^2.0.0", "supports-color": "^5.5.0", "touch": "^3.1.0", "undefsafe": "^2.0.5" }, "bin": { "nodemon": "bin/nodemon.js" } }, "sha512-is96t8F/1//UHAjNPHpbsNY46ELPpftGUoSVNXwUfMk/qdjSylYrWSu1XavVTBOn526kFiOR733ATgNBCQyH0g=="],
|
||||
|
||||
"normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="],
|
||||
|
||||
"object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
|
||||
|
||||
"object-hash": ["object-hash@3.0.0", "", {}, "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw=="],
|
||||
|
||||
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||
|
||||
"on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
|
||||
|
||||
"once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],
|
||||
|
||||
"optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="],
|
||||
|
||||
"p-limit": ["p-limit@4.0.0", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="],
|
||||
|
||||
"p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="],
|
||||
|
||||
"parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="],
|
||||
|
||||
"parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],
|
||||
|
||||
"path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
|
||||
|
||||
"path-is-absolute": ["path-is-absolute@1.0.1", "", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="],
|
||||
|
||||
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
|
||||
|
||||
"path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="],
|
||||
|
||||
"path-to-regexp": ["path-to-regexp@0.1.12", "", {}, "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="],
|
||||
|
||||
"path-type": ["path-type@4.0.0", "", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="],
|
||||
|
||||
"pathe": ["pathe@1.1.2", "", {}, "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ=="],
|
||||
|
||||
"pathval": ["pathval@1.1.1", "", {}, "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ=="],
|
||||
|
||||
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
||||
|
||||
"picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
|
||||
|
||||
"pify": ["pify@2.3.0", "", {}, "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog=="],
|
||||
|
||||
"pirates": ["pirates@4.0.7", "", {}, "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA=="],
|
||||
|
||||
"pkg-types": ["pkg-types@1.3.1", "", { "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", "pathe": "^2.0.1" } }, "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ=="],
|
||||
|
||||
"postcss": ["postcss@8.5.6", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="],
|
||||
|
||||
"postcss-import": ["postcss-import@15.1.0", "", { "dependencies": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", "resolve": "^1.1.7" }, "peerDependencies": { "postcss": "^8.0.0" } }, "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew=="],
|
||||
|
||||
"postcss-js": ["postcss-js@4.1.0", "", { "dependencies": { "camelcase-css": "^2.0.1" }, "peerDependencies": { "postcss": "^8.4.21" } }, "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw=="],
|
||||
|
||||
"postcss-load-config": ["postcss-load-config@6.0.1", "", { "dependencies": { "lilconfig": "^3.1.1" }, "peerDependencies": { "jiti": ">=1.21.0", "postcss": ">=8.0.9", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["jiti", "postcss", "tsx", "yaml"] }, "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g=="],
|
||||
|
||||
"postcss-nested": ["postcss-nested@6.2.0", "", { "dependencies": { "postcss-selector-parser": "^6.1.1" }, "peerDependencies": { "postcss": "^8.2.14" } }, "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ=="],
|
||||
|
||||
"postcss-selector-parser": ["postcss-selector-parser@6.1.2", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg=="],
|
||||
|
||||
"postcss-value-parser": ["postcss-value-parser@4.2.0", "", {}, "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="],
|
||||
|
||||
"prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="],
|
||||
|
||||
"pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="],
|
||||
|
||||
"proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="],
|
||||
|
||||
"pstree.remy": ["pstree.remy@1.1.8", "", {}, "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w=="],
|
||||
|
||||
"punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
|
||||
|
||||
"qs": ["qs@6.14.1", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ=="],
|
||||
|
||||
"queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="],
|
||||
|
||||
"range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],
|
||||
|
||||
"raw-body": ["raw-body@2.5.3", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "unpipe": "~1.0.0" } }, "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA=="],
|
||||
|
||||
"react": ["react@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ=="],
|
||||
|
||||
"react-dom": ["react-dom@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw=="],
|
||||
|
||||
"react-is": ["react-is@18.3.1", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="],
|
||||
|
||||
"react-refresh": ["react-refresh@0.17.0", "", {}, "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ=="],
|
||||
|
||||
"read-cache": ["read-cache@1.0.0", "", { "dependencies": { "pify": "^2.3.0" } }, "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA=="],
|
||||
|
||||
"readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="],
|
||||
|
||||
"resolve": ["resolve@1.22.11", "", { "dependencies": { "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ=="],
|
||||
|
||||
"resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="],
|
||||
|
||||
"reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="],
|
||||
|
||||
"rimraf": ["rimraf@3.0.2", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="],
|
||||
|
||||
"rollup": ["rollup@3.29.5", "", { "optionalDependencies": { "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w=="],
|
||||
|
||||
"run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="],
|
||||
|
||||
"safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
|
||||
|
||||
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
|
||||
|
||||
"scheduler": ["scheduler@0.23.2", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="],
|
||||
|
||||
"semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="],
|
||||
|
||||
"send": ["send@0.19.2", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "~0.5.2", "http-errors": "~2.0.1", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "~2.4.1", "range-parser": "~1.2.1", "statuses": "~2.0.2" } }, "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg=="],
|
||||
|
||||
"serve-static": ["serve-static@1.16.3", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "~0.19.1" } }, "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA=="],
|
||||
|
||||
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
|
||||
|
||||
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
|
||||
|
||||
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
|
||||
|
||||
"side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
|
||||
|
||||
"side-channel-list": ["side-channel-list@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="],
|
||||
|
||||
"side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
|
||||
|
||||
"side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
|
||||
|
||||
"siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
|
||||
|
||||
"simple-update-notifier": ["simple-update-notifier@2.0.0", "", { "dependencies": { "semver": "^7.5.3" } }, "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w=="],
|
||||
|
||||
"slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="],
|
||||
|
||||
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
|
||||
|
||||
"stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="],
|
||||
|
||||
"statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
|
||||
|
||||
"std-env": ["std-env@3.10.0", "", {}, "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg=="],
|
||||
|
||||
"strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
|
||||
|
||||
"strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="],
|
||||
|
||||
"strip-literal": ["strip-literal@1.3.0", "", { "dependencies": { "acorn": "^8.10.0" } }, "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg=="],
|
||||
|
||||
"sucrase": ["sucrase@3.35.1", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", "tinyglobby": "^0.2.11", "ts-interface-checker": "^0.1.9" }, "bin": { "sucrase": "bin/sucrase", "sucrase-node": "bin/sucrase-node" } }, "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw=="],
|
||||
|
||||
"supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="],
|
||||
|
||||
"supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="],
|
||||
|
||||
"tailwind-merge": ["tailwind-merge@1.14.0", "", {}, "sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ=="],
|
||||
|
||||
"tailwindcss": ["tailwindcss@3.4.19", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", "jiti": "^1.21.7", "lilconfig": "^3.1.3", "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.1.1", "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", "postcss-nested": "^6.2.0", "postcss-selector-parser": "^6.1.2", "resolve": "^1.22.8", "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", "tailwindcss": "lib/cli.js" } }, "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ=="],
|
||||
|
||||
"text-table": ["text-table@0.2.0", "", {}, "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="],
|
||||
|
||||
"thenify": ["thenify@3.3.1", "", { "dependencies": { "any-promise": "^1.0.0" } }, "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw=="],
|
||||
|
||||
"thenify-all": ["thenify-all@1.6.0", "", { "dependencies": { "thenify": ">= 3.1.0 < 4" } }, "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA=="],
|
||||
|
||||
"tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="],
|
||||
|
||||
"tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
|
||||
|
||||
"tinypool": ["tinypool@0.7.0", "", {}, "sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww=="],
|
||||
|
||||
"tinyspy": ["tinyspy@2.2.1", "", {}, "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A=="],
|
||||
|
||||
"to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
|
||||
|
||||
"toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],
|
||||
|
||||
"touch": ["touch@3.1.1", "", { "bin": { "nodetouch": "bin/nodetouch.js" } }, "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA=="],
|
||||
|
||||
"ts-api-utils": ["ts-api-utils@1.4.3", "", { "peerDependencies": { "typescript": ">=4.2.0" } }, "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw=="],
|
||||
|
||||
"ts-interface-checker": ["ts-interface-checker@0.1.13", "", {}, "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="],
|
||||
|
||||
"ts-node": ["ts-node@10.9.2", "", { "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "peerDependencies": { "@swc/core": ">=1.2.50", "@swc/wasm": ">=1.2.50", "@types/node": "*", "typescript": ">=2.7" }, "optionalPeers": ["@swc/core", "@swc/wasm"], "bin": { "ts-node": "dist/bin.js", "ts-script": "dist/bin-script-deprecated.js", "ts-node-cwd": "dist/bin-cwd.js", "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js" } }, "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ=="],
|
||||
|
||||
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||
|
||||
"type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="],
|
||||
|
||||
"type-detect": ["type-detect@4.1.0", "", {}, "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw=="],
|
||||
|
||||
"type-fest": ["type-fest@0.20.2", "", {}, "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="],
|
||||
|
||||
"type-is": ["type-is@1.6.18", "", { "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="],
|
||||
|
||||
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
||||
|
||||
"ufo": ["ufo@1.6.1", "", {}, "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA=="],
|
||||
|
||||
"undefsafe": ["undefsafe@2.0.5", "", {}, "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA=="],
|
||||
|
||||
"undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
||||
|
||||
"unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
|
||||
|
||||
"update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
|
||||
|
||||
"uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="],
|
||||
|
||||
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
||||
|
||||
"utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],
|
||||
|
||||
"v8-compile-cache-lib": ["v8-compile-cache-lib@3.0.1", "", {}, "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg=="],
|
||||
|
||||
"vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
|
||||
|
||||
"vite": ["vite@4.5.14", "", { "dependencies": { "esbuild": "^0.18.10", "postcss": "^8.4.27", "rollup": "^3.27.1" }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { "@types/node": ">= 14", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "optionalPeers": ["@types/node", "less", "lightningcss", "sass", "stylus", "sugarss", "terser"], "bin": { "vite": "bin/vite.js" } }, "sha512-+v57oAaoYNnO3hIu5Z/tJRZjq5aHM2zDve9YZ8HngVHbhk66RStobhb1sqPMIPEleV6cNKYK4eGrAbE9Ulbl2g=="],
|
||||
|
||||
"vite-node": ["vite-node@0.34.6", "", { "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", "mlly": "^1.4.0", "pathe": "^1.1.1", "picocolors": "^1.0.0", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0-0" }, "bin": { "vite-node": "vite-node.mjs" } }, "sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA=="],
|
||||
|
||||
"vitest": ["vitest@0.34.6", "", { "dependencies": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", "@vitest/expect": "0.34.6", "@vitest/runner": "0.34.6", "@vitest/snapshot": "0.34.6", "@vitest/spy": "0.34.6", "@vitest/utils": "0.34.6", "acorn": "^8.9.0", "acorn-walk": "^8.2.0", "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", "local-pkg": "^0.4.3", "magic-string": "^0.30.1", "pathe": "^1.1.1", "picocolors": "^1.0.0", "std-env": "^3.3.3", "strip-literal": "^1.0.1", "tinybench": "^2.5.0", "tinypool": "^0.7.0", "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", "vite-node": "0.34.6", "why-is-node-running": "^2.2.2" }, "peerDependencies": { "@edge-runtime/vm": "*", "@vitest/browser": "*", "@vitest/ui": "*", "happy-dom": "*", "jsdom": "*", "playwright": "*", "safaridriver": "*", "webdriverio": "*" }, "optionalPeers": ["@edge-runtime/vm", "@vitest/browser", "@vitest/ui", "happy-dom", "jsdom", "playwright", "safaridriver", "webdriverio"], "bin": { "vitest": "vitest.mjs" } }, "sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q=="],
|
||||
|
||||
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
|
||||
|
||||
"why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="],
|
||||
|
||||
"word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="],
|
||||
|
||||
"wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
|
||||
|
||||
"yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
|
||||
|
||||
"yn": ["yn@3.1.1", "", {}, "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="],
|
||||
|
||||
"yocto-queue": ["yocto-queue@1.2.2", "", {}, "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ=="],
|
||||
|
||||
"@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
|
||||
|
||||
"@babel/generator/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
|
||||
|
||||
"@babel/helper-compilation-targets/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
|
||||
|
||||
"@jridgewell/gen-mapping/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
|
||||
|
||||
"@jridgewell/remapping/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
|
||||
|
||||
"@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.3", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg=="],
|
||||
|
||||
"body-parser/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"chalk/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
|
||||
|
||||
"chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
|
||||
|
||||
"express/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
|
||||
|
||||
"finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"mlly/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
||||
|
||||
"p-locate/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
|
||||
|
||||
"pkg-types/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
||||
|
||||
"pretty-format/ansi-styles": ["ansi-styles@5.2.0", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="],
|
||||
|
||||
"send/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"tinyglobby/picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
|
||||
|
||||
"ts-node/arg": ["arg@4.1.3", "", {}, "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA=="],
|
||||
|
||||
"@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
|
||||
|
||||
"body-parser/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
|
||||
"chalk/supports-color/has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
|
||||
|
||||
"express/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
|
||||
"finalhandler/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
|
||||
"p-locate/p-limit/yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
|
||||
|
||||
"send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
}
|
||||
}
|
||||
17
package.json
Normal file
17
package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "torrent-client-monorepo",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "bun --filter \"*\" dev",
|
||||
"build": "bun --filter \"*\" build",
|
||||
"test": "bun --filter \"*\" test",
|
||||
"start": "bun packages/server/src/index.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.2",
|
||||
"vitest": "^0.34.4"
|
||||
}
|
||||
}
|
||||
13
packages/client/index.html
Normal file
13
packages/client/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Torrent Client</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
35
packages/client/package.json
Normal file
35
packages/client/package.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@torrent-client/client",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@torrent-client/shared": "*",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"lucide-react": "^0.284.0",
|
||||
"framer-motion": "^10.16.4",
|
||||
"clsx": "^2.0.0",
|
||||
"tailwind-merge": "^1.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.2.15",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"@vitejs/plugin-react": "^4.0.3",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"eslint": "^8.45.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.3",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"vite": "^4.4.5"
|
||||
}
|
||||
}
|
||||
6
packages/client/postcss.config.js
Normal file
6
packages/client/postcss.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
348
packages/client/src/App.tsx
Normal file
348
packages/client/src/App.tsx
Normal file
@@ -0,0 +1,348 @@
|
||||
import { useState, useCallback, useEffect } from 'react'
|
||||
import { Magnet, Info, CheckCircle2, Search, Activity, Network, FileText, Globe, ArrowRight, Trash2, Plus, Zap, Shield, BarChart3, DownloadCloud, Box, Layers, Play } from 'lucide-react'
|
||||
import { motion, AnimatePresence } from 'framer-motion'
|
||||
|
||||
interface TorrentSession {
|
||||
hash: string;
|
||||
name: string;
|
||||
status: 'discovering' | 'ready' | 'downloading' | 'paused' | 'completed' | 'error';
|
||||
progress: number;
|
||||
peers: number;
|
||||
activeConnections: number;
|
||||
files: { name: string, size: number }[];
|
||||
errorMessage: string | null;
|
||||
}
|
||||
|
||||
function App() {
|
||||
const [magnetInput, setMagnetInput] = useState('')
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [torrents, setTorrents] = useState<TorrentSession[]>([])
|
||||
const [isAdding, setIsAdding] = useState(false)
|
||||
|
||||
const fetchTorrents = useCallback(async () => {
|
||||
try {
|
||||
const response = await fetch('/api/torrents')
|
||||
if (response.ok) {
|
||||
const data = await response.json()
|
||||
setTorrents(data)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch torrents:', err)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
fetchTorrents()
|
||||
const interval = setInterval(fetchTorrents, 2000)
|
||||
return () => clearInterval(interval)
|
||||
}, [fetchTorrents])
|
||||
|
||||
const handleAddTorrent = async () => {
|
||||
if (!magnetInput.trim()) return
|
||||
setError(null)
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/torrents', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ magnetURI: magnetInput.trim() })
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
const data = await response.json()
|
||||
throw new Error(data.error || 'Failed to add torrent')
|
||||
}
|
||||
|
||||
setMagnetInput('')
|
||||
setIsAdding(false)
|
||||
fetchTorrents()
|
||||
} catch (err: any) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
const startDownload = async (hash: string) => {
|
||||
await fetch(`/api/torrents/${hash}/start`, { method: 'POST' })
|
||||
fetchTorrents()
|
||||
}
|
||||
|
||||
const removeTorrent = async (hash: string) => {
|
||||
await fetch(`/api/torrents/${hash}`, { method: 'DELETE' })
|
||||
fetchTorrents()
|
||||
}
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
switch (status) {
|
||||
case 'completed': return 'text-emerald-400 bg-emerald-500/10 border-emerald-500/20';
|
||||
case 'downloading': return 'text-blue-400 bg-blue-500/10 border-blue-500/20';
|
||||
case 'error': return 'text-rose-400 bg-rose-500/10 border-rose-500/20';
|
||||
case 'paused': return 'text-amber-400 bg-amber-500/10 border-amber-500/20';
|
||||
default: return 'text-slate-400 bg-slate-500/10 border-slate-500/20';
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="w-full max-w-7xl px-6 py-12 selection:bg-blue-500/30">
|
||||
{/* Header */}
|
||||
<header className="flex items-center justify-between mb-16">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="relative group">
|
||||
<div className="absolute inset-0 bg-blue-600 blur-xl opacity-20 group-hover:opacity-40 transition-opacity duration-500" />
|
||||
<div className="relative w-12 h-12 bg-gradient-to-br from-blue-600 to-indigo-600 rounded-2xl flex items-center justify-center shadow-2xl shadow-blue-500/20 border border-white/10 group-hover:scale-105 transition-transform duration-300">
|
||||
<Zap className="text-white fill-white" size={24} />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="text-3xl font-black tracking-tight text-white mb-1">
|
||||
GRAVITY <span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-indigo-400">TORRENT</span>
|
||||
</h1>
|
||||
<div className="flex items-center gap-2 text-[11px] font-bold text-slate-500 tracking-widest uppercase">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.5)] animate-pulse" />
|
||||
System Operational
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<motion.button
|
||||
whileHover={{ scale: 1.02 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
onClick={() => setIsAdding(true)}
|
||||
className="flex items-center gap-2 px-6 py-3 bg-white text-slate-950 rounded-xl font-bold hover:bg-blue-50 transition-colors shadow-[0_0_20px_rgba(255,255,255,0.1)] hover:shadow-[0_0_25px_rgba(255,255,255,0.2)]"
|
||||
>
|
||||
<Plus size={18} strokeWidth={3} />
|
||||
<span>Add Torrent</span>
|
||||
</motion.button>
|
||||
</header>
|
||||
|
||||
{/* Stats Dashboard */}
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mb-12">
|
||||
{[
|
||||
{ label: 'Network Activity', value: torrents.length + ' Sessions', icon: Activity, color: 'text-blue-400', bg: 'bg-blue-400/10' },
|
||||
{ label: 'Swarm Peers', value: torrents.reduce((a, b) => a + b.peers, 0) + ' Connected', icon: Network, color: 'text-emerald-400', bg: 'bg-emerald-400/10' },
|
||||
{ label: 'Global Progress', value: torrents.length ? (torrents.reduce((a, b) => a + b.progress, 0) / torrents.length).toFixed(0) + '%' : '0%', icon: Layers, color: 'text-indigo-400', bg: 'bg-indigo-400/10' },
|
||||
{ label: 'Protocols', value: 'UDP / TCP', icon: Box, color: 'text-amber-400', bg: 'bg-amber-400/10' },
|
||||
].map((stat, i) => (
|
||||
<motion.div
|
||||
key={i}
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: i * 0.1 }}
|
||||
className="bg-slate-900/50 backdrop-blur-xl border border-white/5 p-5 rounded-3xl hover:border-white/10 transition-colors"
|
||||
>
|
||||
<div className="flex items-start justify-between mb-4">
|
||||
<div className={`p-2.5 rounded-xl ${stat.bg}`}>
|
||||
<stat.icon size={18} className={stat.color} />
|
||||
</div>
|
||||
<span className="text-[10px] uppercase font-bold text-slate-500 tracking-wider">0{i + 1}</span>
|
||||
</div>
|
||||
<p className="text-2xl font-bold text-white mb-1">{stat.value}</p>
|
||||
<p className="text-[11px] font-medium text-slate-500 uppercase tracking-wide">{stat.label}</p>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Torrents List */}
|
||||
<div className="space-y-6">
|
||||
<AnimatePresence mode="popLayout">
|
||||
{torrents.length === 0 ? (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.9 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
className="flex flex-col items-center justify-center py-40 border border-dashed border-slate-800/50 rounded-[2.5rem] bg-slate-900/20"
|
||||
>
|
||||
<div className="w-20 h-20 bg-slate-800/50 rounded-full flex items-center justify-center mb-6">
|
||||
<DownloadCloud size={32} className="text-slate-600" />
|
||||
</div>
|
||||
<h3 className="text-xl font-bold text-slate-300 mb-2">No Active Swarms</h3>
|
||||
<p className="text-slate-500 text-sm max-w-sm text-center leading-relaxed">
|
||||
Initialize a new torrent session to begin the discovery and download process.
|
||||
</p>
|
||||
</motion.div>
|
||||
) : (
|
||||
torrents.map((torrent) => (
|
||||
<motion.div
|
||||
key={torrent.hash}
|
||||
layout
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
exit={{ opacity: 0, scale: 0.95 }}
|
||||
className="group bg-slate-900/40 backdrop-blur-md border border-white/5 rounded-[2rem] p-8 hover:border-blue-500/30 transition-all duration-500 shadow-xl shadow-black/20"
|
||||
>
|
||||
<div className="flex flex-col lg:flex-row gap-8 items-start lg:items-center">
|
||||
{/* Main Info */}
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-3 mb-3">
|
||||
<h3 className="text-xl font-bold text-white truncate pr-4">{torrent.name}</h3>
|
||||
<span className={`px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-wider border ${getStatusColor(torrent.status)}`}>
|
||||
{torrent.status}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap gap-6 text-xs text-slate-400 font-medium">
|
||||
<div className="flex items-center gap-2 px-3 py-1.5 bg-slate-950/50 rounded-lg border border-white/5">
|
||||
<Globe size={14} className="text-emerald-500" />
|
||||
<span>{torrent.peers} peers linked</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 px-3 py-1.5 bg-slate-950/50 rounded-lg border border-white/5">
|
||||
<Network size={14} className="text-blue-500" />
|
||||
<span>{torrent.activeConnections} active pipes</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 px-3 py-1.5 bg-slate-950/50 rounded-lg border border-white/5 font-mono text-slate-500">
|
||||
<span>HASH: {torrent.hash.slice(0, 12)}...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Progress Section */}
|
||||
<div className="w-full lg:w-80">
|
||||
<div className="flex justify-between text-[11px] font-bold text-slate-500 mb-2 uppercase tracking-wider">
|
||||
<span>Completion</span>
|
||||
<span className={torrent.status === 'completed' ? 'text-emerald-400' : 'text-blue-400'}>
|
||||
{torrent.status === 'completed' ? 100 : torrent.progress}%
|
||||
</span>
|
||||
</div>
|
||||
<div className="relative h-2.5 bg-slate-950 rounded-full overflow-hidden shadow-inner border border-white/5">
|
||||
<motion.div
|
||||
className={`absolute inset-y-0 left-0 ${torrent.status === 'completed' ? 'bg-gradient-to-r from-emerald-500 to-teal-400' : 'bg-gradient-to-r from-blue-600 to-indigo-500'}`}
|
||||
initial={{ width: 0 }}
|
||||
animate={{ width: `${torrent.status === 'completed' ? 100 : torrent.progress}%` }}
|
||||
transition={{ type: 'spring', damping: 20 }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Action Buttons */}
|
||||
<div className="flex gap-3">
|
||||
{torrent.status === 'ready' && (
|
||||
<motion.button
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
onClick={() => startDownload(torrent.hash)}
|
||||
className="w-12 h-12 rounded-2xl bg-blue-600 flex items-center justify-center text-white shadow-lg shadow-blue-600/20 hover:bg-blue-500 transition-colors"
|
||||
>
|
||||
<Play size={20} fill="currentColor" />
|
||||
</motion.button>
|
||||
)}
|
||||
<motion.button
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
onClick={() => removeTorrent(torrent.hash)}
|
||||
className="w-12 h-12 rounded-2xl bg-slate-800 flex items-center justify-center text-slate-400 hover:text-rose-400 hover:bg-slate-700 transition-colors"
|
||||
>
|
||||
<Trash2 size={20} />
|
||||
</motion.button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* File List */}
|
||||
<AnimatePresence>
|
||||
{torrent.files.length > 0 && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, height: 0 }}
|
||||
animate={{ opacity: 1, height: 'auto' }}
|
||||
className="mt-8 pt-8 border-t border-white/5 overflow-hidden"
|
||||
>
|
||||
<h4 className="text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-4">Payload Contents</h4>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3">
|
||||
{torrent.files.map((file, i) => (
|
||||
<div key={i} className="group/file flex items-center gap-4 bg-slate-950/30 hover:bg-slate-950/50 p-4 rounded-xl border border-white/5 hover:border-blue-500/20 transition-all duration-300">
|
||||
<div className="p-2 bg-slate-800/50 rounded-lg text-slate-400 group-hover/file:text-blue-400 transition-colors">
|
||||
<FileText size={16} />
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-sm font-semibold text-slate-300 truncate group-hover/file:text-white transition-colors">{file.name}</p>
|
||||
<p className="text-[10px] font-medium text-slate-600">{(file.size / (1024 * 1024)).toFixed(2)} MB</p>
|
||||
</div>
|
||||
{torrent.status === 'completed' && (
|
||||
<a
|
||||
href={`/api/torrents/${torrent.hash}/download/${encodeURIComponent(file.name)}`}
|
||||
target="_blank"
|
||||
title="Download"
|
||||
className="p-2 rounded-lg bg-blue-500/10 text-blue-400 hover:bg-blue-600 hover:text-white opacity-0 group-hover/file:opacity-100 transition-all transform scale-90 group-hover/file:scale-100"
|
||||
>
|
||||
<DownloadCloud size={16} />
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</motion.div>
|
||||
))
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
|
||||
{/* Modal */}
|
||||
<AnimatePresence>
|
||||
{isAdding && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/60 backdrop-blur-sm">
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
onClick={() => setIsAdding(false)}
|
||||
className="absolute inset-0"
|
||||
/>
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.9, y: 20 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
exit={{ opacity: 0, scale: 0.9, y: 20 }}
|
||||
className="relative w-full max-w-2xl bg-[#0a0f1c] border border-white/10 rounded-[2rem] p-10 shadow-2xl shadow-black/50"
|
||||
>
|
||||
<h2 className="text-3xl font-black text-white mb-8 tracking-tight">Init Swarm Connection.</h2>
|
||||
|
||||
<div className="space-y-8">
|
||||
<div>
|
||||
<label className="text-xs font-bold text-slate-500 uppercase tracking-widest block mb-3">Target Magnet URI</label>
|
||||
<div className="relative group">
|
||||
<input
|
||||
autoFocus
|
||||
type="text"
|
||||
value={magnetInput}
|
||||
onChange={(e) => setMagnetInput(e.target.value)}
|
||||
placeholder="magnet:?xt=urn:btih:..."
|
||||
className="w-full bg-slate-950 border border-slate-800 rounded-2xl px-6 py-5 pr-14 text-slate-200 placeholder:text-slate-700 focus:outline-none focus:border-blue-500/50 focus:ring-4 focus:ring-blue-500/10 transition-all font-mono text-sm"
|
||||
/>
|
||||
<div className="absolute right-5 top-1/2 -translate-y-1/2 text-slate-700 group-focus-within:text-blue-500 transition-colors">
|
||||
<Magnet size={24} />
|
||||
</div>
|
||||
</div>
|
||||
{error && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: -5 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className="mt-3 flex items-center gap-2 text-rose-400 text-xs font-bold bg-rose-950/30 px-3 py-2 rounded-lg inline-block border border-rose-500/20"
|
||||
>
|
||||
<Info size={12} /> {error}
|
||||
</motion.div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex gap-4 pt-2">
|
||||
<button
|
||||
onClick={() => setIsAdding(false)}
|
||||
className="flex-1 py-4 rounded-xl font-bold bg-slate-900 border border-white/5 text-slate-400 hover:bg-slate-800 hover:text-white transition-colors"
|
||||
>
|
||||
Cancel Protocol
|
||||
</button>
|
||||
<button
|
||||
onClick={handleAddTorrent}
|
||||
className="flex-[2] py-4 rounded-xl font-bold bg-gradient-to-r from-blue-600 to-indigo-600 text-white hover:shadow-lg hover:shadow-blue-600/20 hover:scale-[1.02] transition-all flex items-center justify-center gap-3"
|
||||
>
|
||||
<span>Establish Uplink</span>
|
||||
<ArrowRight size={20} strokeWidth={2.5} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
53
packages/client/src/index.css
Normal file
53
packages/client/src/index.css
Normal file
@@ -0,0 +1,53 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
||||
line-height: 1.5;
|
||||
font-weight: 400;
|
||||
|
||||
color-scheme: dark;
|
||||
color: rgba(255, 255, 255, 0.92);
|
||||
background-color: #030712;
|
||||
/* Slate 950 base */
|
||||
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
place-items: start;
|
||||
justify-content: center;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
background-image:
|
||||
radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
|
||||
radial-gradient(circle at 80% 10%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
/* Custom Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #1e293b;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #334155;
|
||||
}
|
||||
10
packages/client/src/main.tsx
Normal file
10
packages/client/src/main.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import App from './App'
|
||||
import './index.css'
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
)
|
||||
11
packages/client/tailwind.config.js
Normal file
11
packages/client/tailwind.config.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.{js,ts,jsx,tsx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
31
packages/client/tsconfig.json
Normal file
31
packages/client/tsconfig.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"DOM.Iterable",
|
||||
"ESNext"
|
||||
],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.node.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
12
packages/client/tsconfig.node.json
Normal file
12
packages/client/tsconfig.node.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": [
|
||||
"vite.config.ts"
|
||||
]
|
||||
}
|
||||
7
packages/client/vite.config.ts
Normal file
7
packages/client/vite.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
})
|
||||
25
packages/server/package.json
Normal file
25
packages/server/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@torrent-client/server",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "bun src/index.ts",
|
||||
"dev": "bun --watch src/index.ts",
|
||||
"build": "tsc",
|
||||
"test": "bun test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@torrent-client/shared": "*",
|
||||
"express": "^4.18.2",
|
||||
"cors": "^2.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/cors": "^2.8.13",
|
||||
"@types/node": "^18.17.0",
|
||||
"bun-types": "latest",
|
||||
"ts-node": "^10.9.1",
|
||||
"nodemon": "^3.0.1"
|
||||
}
|
||||
}
|
||||
107
packages/server/src/download.integration.test.ts
Normal file
107
packages/server/src/download.integration.test.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { TorrentSession } from "./engine";
|
||||
import { Bitfield } from "@torrent-client/shared";
|
||||
import crypto from 'node:crypto';
|
||||
import { rmSync, existsSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
describe("Download Integration", () => {
|
||||
const MOCK_HASH = "A18230D43BDA105BE7DEF84CB711859018AAA92C"; // Dummy hash
|
||||
const MAGNET = `magnet:?xt=urn:btih:${MOCK_HASH}&dn=Test`;
|
||||
|
||||
test("Full Handshake and Piece Request Flow", async () => {
|
||||
// 1. Setup Mock Peer Server
|
||||
let receivedHandshake = false;
|
||||
let receivedRequest = false;
|
||||
|
||||
const server = Bun.listen({
|
||||
hostname: "127.0.0.1",
|
||||
port: 6881,
|
||||
socket: {
|
||||
data(s, data) {
|
||||
let buf = data;
|
||||
if (!receivedHandshake && buf.length >= 68 && buf[0] === 19) {
|
||||
receivedHandshake = true;
|
||||
// Send Handshake back
|
||||
const reserved = Buffer.alloc(8);
|
||||
const peerId = Buffer.alloc(20);
|
||||
Buffer.from("-BT0001-TESTPEER").copy(peerId);
|
||||
s.write(Buffer.concat([
|
||||
Buffer.from([19]), Buffer.from("BitTorrent protocol"),
|
||||
reserved, Buffer.from(MOCK_HASH, 'hex'), peerId
|
||||
]));
|
||||
// Send Bitfield (we have all pieces)
|
||||
const bitfield = Buffer.from([255]);
|
||||
const len = Buffer.alloc(4);
|
||||
len.writeUInt32BE(bitfield.length + 1);
|
||||
s.write(Buffer.concat([len, Buffer.from([5]), bitfield]));
|
||||
// Unchoke
|
||||
s.write(Buffer.from([0, 0, 0, 1, 1]));
|
||||
buf = buf.slice(68);
|
||||
}
|
||||
|
||||
while (buf.length >= 4) {
|
||||
const msgLen = buf.readUInt32BE(0);
|
||||
if (msgLen === 0) { buf = buf.slice(4); continue; }
|
||||
if (buf.length < msgLen + 4) break;
|
||||
|
||||
const id = buf[4];
|
||||
if (id === 6) {
|
||||
receivedRequest = true;
|
||||
// Send dummy piece back
|
||||
const index = buf.readUInt32BE(5);
|
||||
const block = Buffer.alloc(16384);
|
||||
const payload = Buffer.alloc(16384 + 8);
|
||||
payload.writeUInt32BE(index, 0);
|
||||
payload.writeUInt32BE(0, 4);
|
||||
block.copy(payload, 8);
|
||||
|
||||
const resLen = Buffer.alloc(4);
|
||||
resLen.writeUInt32BE(payload.length + 1);
|
||||
s.write(Buffer.concat([resLen, Buffer.from([7]), payload]));
|
||||
}
|
||||
buf = buf.slice(msgLen + 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 2. Initialize Session
|
||||
const session = new TorrentSession(MAGNET);
|
||||
|
||||
// Mock metadata discovery for test
|
||||
(session as any).solvedMetadata = true;
|
||||
(session as any).files = [{ name: "test.dat", size: 16384 }];
|
||||
(session as any).pieceLength = 16384;
|
||||
(session as any).totalSize = 16384; // Added this field
|
||||
(session as any).bitfield = new Bitfield(1);
|
||||
(session as any).pieceHashes = crypto.createHash('sha1').update(Buffer.alloc(16384)).digest();
|
||||
(session as any).status = 'ready';
|
||||
(session as any).peers = ["127.0.0.1:6881"];
|
||||
|
||||
// 3. Start Download
|
||||
session.startDownload();
|
||||
|
||||
// 4. Wait for completion or timeout
|
||||
let attempts = 0;
|
||||
while (session.status !== 'completed' && attempts < 20) {
|
||||
await new Promise(r => setTimeout(r, 200));
|
||||
attempts++;
|
||||
}
|
||||
|
||||
// 5. Assertions
|
||||
expect(receivedHandshake).toBe(true);
|
||||
expect(receivedRequest).toBe(true);
|
||||
expect(session.status).toBe('completed');
|
||||
expect(session.progress).toBe(100);
|
||||
|
||||
server.stop();
|
||||
session.destroy();
|
||||
|
||||
// Cleanup
|
||||
const downloadPath = join(process.cwd(), 'downloads', MOCK_HASH);
|
||||
if (existsSync(downloadPath)) {
|
||||
rmSync(downloadPath, { recursive: true, force: true });
|
||||
}
|
||||
}, 10000);
|
||||
});
|
||||
42
packages/server/src/download.real.test.ts
Normal file
42
packages/server/src/download.real.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { TorrentSession } from "./engine";
|
||||
|
||||
describe("Real Swarm Download", () => {
|
||||
// Debian 12.8.0 netinst magnet (highly seeded)
|
||||
const REAL_MAGNET = "magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=debian-12.8.0-amd64-netinst.iso";
|
||||
|
||||
test("Discover and download first block from real swarm", async () => {
|
||||
const session = new TorrentSession(REAL_MAGNET);
|
||||
|
||||
console.log("[Test] Waiting for metadata discovery...");
|
||||
let attempts = 0;
|
||||
while (session.status === 'discovering' && attempts < 60) {
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
attempts++;
|
||||
}
|
||||
|
||||
expect(session.status).toBe('ready');
|
||||
console.log(`[Test] Metadata discovered! ${session.files[0].name} (${session.files[0].size} bytes)`);
|
||||
|
||||
console.log("[Test] Starting download...");
|
||||
session.startDownload();
|
||||
|
||||
// Wait for at least 1% progress or 1 active connection
|
||||
let downloadAttempts = 0;
|
||||
let foundPeers = false;
|
||||
while (session.progress < 1 && downloadAttempts < 60) {
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
if (session.activeConnections > 0) foundPeers = true;
|
||||
if (session.progress > 0) break;
|
||||
downloadAttempts++;
|
||||
}
|
||||
|
||||
console.log(`[Test] Final Status: ${session.status}, Progress: ${session.progress}%, Active: ${session.activeConnections}`);
|
||||
|
||||
expect(foundPeers).toBe(true);
|
||||
// We don't strictly expect progress > 0 because peers might be slow/choked,
|
||||
// but we at least want to see active connections and INTERESTED signals in logs.
|
||||
|
||||
session.destroy();
|
||||
}, 125000); // 2 minute timeout for real network
|
||||
});
|
||||
296
packages/server/src/engine.ts
Normal file
296
packages/server/src/engine.ts
Normal file
@@ -0,0 +1,296 @@
|
||||
import { parseMagnetURI, type MagnetData, Bitfield } from '@torrent-client/shared';
|
||||
import { getPeersFromUDPTracker, fetchMetadataFromPeer, PUBLIC_TRACKERS } from './index';
|
||||
import { StorageManager } from './storage';
|
||||
import { PeerWorker } from './worker';
|
||||
import { PieceReassembler } from './reassembler';
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
export type SessionStatus = 'discovering' | 'ready' | 'downloading' | 'paused' | 'completed' | 'error';
|
||||
|
||||
export interface TorrentFile {
|
||||
name: string;
|
||||
size: number;
|
||||
}
|
||||
|
||||
export class TorrentSession {
|
||||
public hash: string;
|
||||
public magnetData: MagnetData;
|
||||
public status: SessionStatus = 'discovering';
|
||||
public files: TorrentFile[] = [];
|
||||
public peers: string[] = [];
|
||||
public activeConnections: number = 0;
|
||||
public progress: number = 0;
|
||||
public errorMessage: string | null = null;
|
||||
|
||||
private peerSet = new Set<string>();
|
||||
private solvedMetadata = false;
|
||||
private isDestroyed = false;
|
||||
|
||||
private storage?: StorageManager;
|
||||
private bitfield?: Bitfield;
|
||||
private pieceHashes?: Uint8Array;
|
||||
private pieceLength: number = 0;
|
||||
private totalSize: number = 0;
|
||||
private workers: PeerWorker[] = [];
|
||||
private reassemblers: Map<number, PieceReassembler> = new Map();
|
||||
private peerIndex = 0;
|
||||
private MAX_WORKERS = 30;
|
||||
|
||||
constructor(magnetURI: string) {
|
||||
const parsed = parseMagnetURI(magnetURI);
|
||||
if (!parsed?.hash) throw new Error("Invalid magnet link");
|
||||
this.hash = parsed.hash;
|
||||
this.magnetData = parsed;
|
||||
|
||||
this.startDiscovery();
|
||||
}
|
||||
|
||||
private async startDiscovery() {
|
||||
const trackers = [...new Set([...(this.magnetData.tr || []), ...PUBLIC_TRACKERS])].filter(t => t.startsWith("udp:"));
|
||||
console.log(`[Engine] Session ${this.hash}: Starting discovery from ${trackers.length} trackers...`);
|
||||
|
||||
trackers.forEach(async (tracker) => {
|
||||
try {
|
||||
const trackerPeers = await getPeersFromUDPTracker(tracker, this.hash);
|
||||
for (const peer of trackerPeers) {
|
||||
if (this.isDestroyed || this.solvedMetadata || this.peerSet.has(peer)) continue;
|
||||
this.peerSet.add(peer);
|
||||
this.peers = Array.from(this.peerSet);
|
||||
|
||||
if (this.peerSet.size <= 50) {
|
||||
this.tryFetchMetadata(peer);
|
||||
}
|
||||
|
||||
// If we are already downloading, immediately try to use new peers
|
||||
if (this.status === 'downloading') {
|
||||
this.refillWorkers();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Tracker error
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
if (!this.isDestroyed && this.status === 'discovering' && !this.solvedMetadata) {
|
||||
this.status = 'error';
|
||||
this.errorMessage = "Metadata discovery timed out.";
|
||||
}
|
||||
}, 30000);
|
||||
}
|
||||
|
||||
private async tryFetchMetadata(peer: string) {
|
||||
if (this.isDestroyed || this.solvedMetadata) return;
|
||||
this.activeConnections++;
|
||||
const [host, p] = peer.split(':');
|
||||
try {
|
||||
const res = await fetchMetadataFromPeer(this.hash, host, parseInt(p));
|
||||
if (res && !this.solvedMetadata && !this.isDestroyed) {
|
||||
this.solvedMetadata = true;
|
||||
this.files = res.files || [{ name: res.name, size: res.size }];
|
||||
this.pieceHashes = res.pieces;
|
||||
this.pieceLength = res.pieceLength;
|
||||
this.totalSize = res.size;
|
||||
this.status = 'ready';
|
||||
|
||||
const totalPieces = Math.ceil(res.size / res.pieceLength);
|
||||
this.bitfield = new Bitfield(totalPieces);
|
||||
this.storage = new StorageManager(this.hash, this.files);
|
||||
|
||||
console.log(`[Engine] Session ${this.hash}: Metadata verified. ${totalPieces} pieces total.`);
|
||||
}
|
||||
} catch (e) {
|
||||
// Peer failed
|
||||
} finally {
|
||||
this.activeConnections--;
|
||||
}
|
||||
}
|
||||
|
||||
public startDownload() {
|
||||
if (this.status !== 'ready') return;
|
||||
this.status = 'downloading';
|
||||
console.log(`[Engine] Session ${this.hash}: Initializing swarm download...`);
|
||||
this.refillWorkers();
|
||||
}
|
||||
|
||||
private refillWorkers() {
|
||||
if (this.status !== 'downloading' || this.isDestroyed) return;
|
||||
|
||||
while (this.workers.length < this.MAX_WORKERS && this.peerIndex < this.peers.length) {
|
||||
const peer = this.peers[this.peerIndex++];
|
||||
const [host, p] = peer.split(':');
|
||||
|
||||
const worker = new PeerWorker(
|
||||
this.hash, host, parseInt(p),
|
||||
this.bitfield!.totalPieces,
|
||||
(idx, begin, block) => this.handleBlock(idx, begin, block),
|
||||
() => this.onWorkerReady(worker),
|
||||
() => this.onWorkerClose(worker)
|
||||
);
|
||||
this.workers.push(worker);
|
||||
worker.connect();
|
||||
}
|
||||
}
|
||||
|
||||
private onWorkerReady(worker: PeerWorker) {
|
||||
if (this.status !== 'downloading') return;
|
||||
worker.signalInterest(); // Proactively tell them we want data!
|
||||
this.activeConnections = this.workers.length;
|
||||
this.scheduleWork();
|
||||
}
|
||||
|
||||
private onWorkerClose(worker: PeerWorker) {
|
||||
this.workers = this.workers.filter(w => w !== worker);
|
||||
this.activeConnections = this.workers.length;
|
||||
this.refillWorkers(); // Try to get a new peer
|
||||
}
|
||||
|
||||
private scheduleWork() {
|
||||
if (this.status !== 'downloading' || !this.bitfield) return;
|
||||
|
||||
const allPending = new Set<string>();
|
||||
for (const w of this.workers) {
|
||||
for (const p of w.getPendingRequests()) allPending.add(p);
|
||||
}
|
||||
|
||||
for (const worker of this.workers) {
|
||||
if (worker.getPendingRequests().size >= 5) continue;
|
||||
|
||||
// 1. Prioritize ongoing piece reassembly
|
||||
let foundWork = false;
|
||||
for (const [pieceIdx, reassembler] of this.reassemblers.entries()) {
|
||||
if (worker.hasPiece(pieceIdx)) {
|
||||
const missing = reassembler.getMissingBlocks();
|
||||
for (const begin of missing) {
|
||||
const key = `${pieceIdx}:${begin}`;
|
||||
if (!allPending.has(key) && worker.getPendingRequests().size < 5) {
|
||||
const blockSize = Math.min(16384, reassembler.totalSize - begin);
|
||||
worker.requestBlock(pieceIdx, begin, blockSize);
|
||||
allPending.add(key);
|
||||
foundWork = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (foundWork) continue;
|
||||
|
||||
// 2. Start a new piece
|
||||
for (let i = 0; i < this.bitfield.totalPieces; i++) {
|
||||
if (!this.bitfield.has(i) && !this.reassemblers.has(i) && worker.hasPiece(i)) {
|
||||
const size = (i === this.bitfield.totalPieces - 1)
|
||||
? (this.totalSize % this.pieceLength || this.pieceLength)
|
||||
: this.pieceLength;
|
||||
const re = new PieceReassembler(size);
|
||||
this.reassemblers.set(i, re);
|
||||
|
||||
const missing = re.getMissingBlocks();
|
||||
for (const begin of missing) {
|
||||
const key = `${i}:${begin}`;
|
||||
if (!allPending.has(key) && worker.getPendingRequests().size < 5) {
|
||||
const blockSize = Math.min(16384, size - begin);
|
||||
worker.requestBlock(i, begin, blockSize);
|
||||
allPending.add(key);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private handleBlock(index: number, begin: number, block: Buffer) {
|
||||
if (!this.bitfield || this.bitfield.has(index)) return;
|
||||
const reassembler = this.reassemblers.get(index);
|
||||
if (!reassembler) return;
|
||||
|
||||
if (reassembler.addBlock(begin, block)) {
|
||||
// Piece is complete!
|
||||
const fullPiece = reassembler.getFullPiece();
|
||||
if (!fullPiece) return;
|
||||
|
||||
const expectedHash = this.pieceHashes?.slice(index * 20, (index + 1) * 20);
|
||||
const actualHash = crypto.createHash('sha1').update(fullPiece).digest();
|
||||
|
||||
if (expectedHash && Buffer.compare(actualHash, expectedHash) === 0) {
|
||||
this.bitfield.set(index);
|
||||
this.storage?.writePiece(index, this.pieceLength, fullPiece);
|
||||
this.reassemblers.delete(index);
|
||||
|
||||
const completed = Array.from({ length: this.bitfield.totalPieces }).filter((_, i) => this.bitfield!.has(i)).length;
|
||||
this.progress = Math.floor((completed / this.bitfield.totalPieces) * 100);
|
||||
|
||||
if (this.progress >= 100) {
|
||||
this.status = 'completed';
|
||||
console.log(`[Engine] Torrent ${this.hash} download COMPLETED!`);
|
||||
}
|
||||
} else {
|
||||
// Hash failed, restart piece
|
||||
this.reassemblers.delete(index);
|
||||
}
|
||||
}
|
||||
|
||||
this.scheduleWork();
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
this.isDestroyed = true;
|
||||
this.solvedMetadata = true;
|
||||
this.status = 'paused';
|
||||
this.workers.forEach(w => { /* close socket if possible */ });
|
||||
console.log(`[Engine] Session ${this.hash}: Destroyed.`);
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
return {
|
||||
hash: this.hash,
|
||||
name: this.magnetData.dn || this.files[0]?.name || this.hash,
|
||||
status: this.status,
|
||||
progress: this.progress,
|
||||
peers: this.peers.length,
|
||||
activeConnections: this.workers.length,
|
||||
files: this.files,
|
||||
errorMessage: this.errorMessage
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class TorrentManager {
|
||||
private static instance: TorrentManager;
|
||||
private sessions = new Map<string, TorrentSession>();
|
||||
|
||||
private constructor() {}
|
||||
|
||||
public static getInstance(): TorrentManager {
|
||||
if (!TorrentManager.instance) {
|
||||
TorrentManager.instance = new TorrentManager();
|
||||
}
|
||||
return TorrentManager.instance;
|
||||
}
|
||||
|
||||
public addTorrent(magnetURI: string): TorrentSession {
|
||||
const parsed = parseMagnetURI(magnetURI);
|
||||
if (!parsed?.hash) throw new Error("Invalid magnet");
|
||||
|
||||
if (this.sessions.has(parsed.hash)) {
|
||||
return this.sessions.get(parsed.hash)!;
|
||||
}
|
||||
|
||||
const session = new TorrentSession(magnetURI);
|
||||
this.sessions.set(session.hash, session);
|
||||
return session;
|
||||
}
|
||||
|
||||
public getSession(hash: string): TorrentSession | undefined {
|
||||
return this.sessions.get(hash);
|
||||
}
|
||||
|
||||
public getAllSessions(): TorrentSession[] {
|
||||
return Array.from(this.sessions.values());
|
||||
}
|
||||
|
||||
public removeSession(hash: string) {
|
||||
const s = this.sessions.get(hash);
|
||||
if (s) s.destroy();
|
||||
this.sessions.delete(hash);
|
||||
}
|
||||
}
|
||||
317
packages/server/src/index.ts
Normal file
317
packages/server/src/index.ts
Normal file
@@ -0,0 +1,317 @@
|
||||
import { parseMagnetURI, BencodeDecoder, BencodeEncoder, MetadataReassembler } from "@torrent-client/shared";
|
||||
import dgram from "node:dgram";
|
||||
import crypto from "node:crypto";
|
||||
import { join } from "node:path";
|
||||
import { TorrentManager } from "./engine";
|
||||
|
||||
const port = process.env.PORT || 3001;
|
||||
const getCONFIG = () => ({
|
||||
TRACKER_TIMEOUT: parseInt(process.env.TRACKER_TIMEOUT || "3000"),
|
||||
METADATA_TIMEOUT: parseInt(process.env.METADATA_TIMEOUT || "10000"),
|
||||
});
|
||||
|
||||
export const PUBLIC_TRACKERS = [
|
||||
"udp://tracker.opentrackr.org:1337/announce",
|
||||
"udp://tracker.openbittorrent.com:6969/announce",
|
||||
"udp://exodus.desync.com:6969/announce",
|
||||
"udp://open.stealth.si:80/announce",
|
||||
"udp://tracker.torrent.eu.org:451/announce"
|
||||
];
|
||||
|
||||
console.log(`Torrent Engine (Bun) running at http://localhost:${port}`);
|
||||
|
||||
export async function getPeersFromUDPTracker(trackerUrl: string, infoHashHex: string): Promise<string[]> {
|
||||
const url = new URL(trackerUrl);
|
||||
if (url.protocol !== "udp:") return [];
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const client = dgram.createSocket("udp4");
|
||||
const transactionId = crypto.randomBytes(4);
|
||||
const connectionId = Buffer.from("0000041727101980", "hex");
|
||||
|
||||
const connectMsg = Buffer.concat([connectionId, Buffer.from([0, 0, 0, 0]), transactionId]);
|
||||
|
||||
const timeout = setTimeout(() => { client.close(); resolve([]); }, getCONFIG().TRACKER_TIMEOUT);
|
||||
|
||||
client.on("message", (msg) => {
|
||||
const action = msg.readInt32BE(0);
|
||||
const receivedTransactionId = msg.slice(4, 8);
|
||||
if (!transactionId.equals(receivedTransactionId)) return;
|
||||
|
||||
if (action === 0) {
|
||||
const receivedConnectionId = msg.slice(8, 16);
|
||||
const announceMsg = Buffer.concat([
|
||||
receivedConnectionId, Buffer.from([0, 0, 0, 1]), transactionId,
|
||||
Buffer.from(infoHashHex, "hex"), Buffer.from("-BT0001-" + crypto.randomBytes(6).toString("hex")),
|
||||
Buffer.alloc(8), Buffer.alloc(8), Buffer.alloc(8),
|
||||
Buffer.from([0, 0, 0, 2]), Buffer.alloc(4), Buffer.alloc(4),
|
||||
Buffer.from([0xFF, 0xFF, 0xFF, 0xFF]), Buffer.from([0x1B, 0x39])
|
||||
]);
|
||||
client.send(announceMsg, parseInt(url.port), url.hostname);
|
||||
} else if (action === 1) {
|
||||
const peers = [];
|
||||
for (let i = 20; i + 6 <= msg.length; i += 6) {
|
||||
peers.push(`${msg[i]}.${msg[i + 1]}.${msg[i + 2]}.${msg[i + 3]}:${msg.readUInt16BE(i + 4)}`);
|
||||
}
|
||||
clearTimeout(timeout); client.close(); resolve(peers);
|
||||
}
|
||||
});
|
||||
|
||||
client.send(connectMsg, parseInt(url.port), url.hostname, () => {});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Full BEP 9/10 Metadata Retrieval
|
||||
*/
|
||||
export async function fetchMetadataFromPeer(hash: string, host: string, portNum: number): Promise<{ name: string; size: number; pieces: Uint8Array; pieceLength: number; files?: any[] } | null> {
|
||||
return new Promise((resolve) => {
|
||||
let receivedHandshake = false;
|
||||
let utMetadataId: number | null = null;
|
||||
let metadataSize: number | null = null;
|
||||
let reassembler: MetadataReassembler | null = null;
|
||||
let buffer = Buffer.alloc(0);
|
||||
let socketInstance: any = null;
|
||||
|
||||
let isSettled = false;
|
||||
const timer = setTimeout(() => {
|
||||
if (isSettled) return;
|
||||
if (socketInstance) {
|
||||
console.log(`[Metadata] Timeout reaching ${host}:${portNum}`);
|
||||
socketInstance.end();
|
||||
} else {
|
||||
console.log(`[Metadata] Connection attempt to ${host}:${portNum} timed out`);
|
||||
}
|
||||
isSettled = true;
|
||||
resolve(null);
|
||||
}, getCONFIG().METADATA_TIMEOUT);
|
||||
|
||||
const finish = (result: any) => {
|
||||
if (isSettled) return;
|
||||
isSettled = true;
|
||||
clearTimeout(timer);
|
||||
resolve(result);
|
||||
};
|
||||
|
||||
try {
|
||||
const socket = Bun.connect({
|
||||
hostname: host,
|
||||
port: portNum,
|
||||
socket: {
|
||||
open(s: any) {
|
||||
socketInstance = s;
|
||||
console.log(`[Metadata] Socket open to ${host}:${portNum}`);
|
||||
const reserved = Buffer.alloc(8);
|
||||
reserved[5] |= 0x10; // Extension protocol
|
||||
s.write(Buffer.concat([
|
||||
Buffer.from([19]), Buffer.from("BitTorrent protocol"),
|
||||
reserved, Buffer.from(hash, 'hex'), Buffer.from("-BT0001-" + crypto.randomBytes(6).toString("hex"))
|
||||
]));
|
||||
},
|
||||
data(s: any, data: Buffer) {
|
||||
buffer = Buffer.concat([buffer, data]);
|
||||
|
||||
if (!receivedHandshake) {
|
||||
if (buffer.length >= 68 && buffer[0] === 19) {
|
||||
receivedHandshake = true;
|
||||
console.log(`[Metadata] Handshake with ${host} OK`);
|
||||
buffer = buffer.slice(68);
|
||||
// Signal interested + Extended Handshake
|
||||
s.write(Buffer.from([0, 0, 0, 1, 2])); // interested
|
||||
const extHandshake = BencodeEncoder.encode({ m: { ut_metadata: 1 } });
|
||||
const msgLen = Buffer.alloc(4);
|
||||
msgLen.writeUInt32BE(extHandshake.length + 2);
|
||||
s.write(Buffer.concat([msgLen, Buffer.from([20, 0]), extHandshake]));
|
||||
} else return;
|
||||
}
|
||||
|
||||
while (buffer.length >= 4) {
|
||||
const length = buffer.readUInt32BE(0);
|
||||
if (length === 0) {
|
||||
buffer = buffer.slice(4);
|
||||
continue;
|
||||
}
|
||||
if (buffer.length < length + 4) break;
|
||||
|
||||
const msg = buffer.slice(4, length + 4);
|
||||
buffer = buffer.slice(length + 4);
|
||||
|
||||
if (msg[0] === 20) {
|
||||
const extId = msg[1];
|
||||
const payload = msg.slice(2);
|
||||
|
||||
if (extId === 0) {
|
||||
try {
|
||||
const decoded = BencodeDecoder.decode(payload) as any;
|
||||
utMetadataId = decoded.m?.ut_metadata;
|
||||
metadataSize = decoded.metadata_size;
|
||||
console.log(`[Metadata] ${host} metadata_size: ${metadataSize}, ut_metadata: ${utMetadataId}`);
|
||||
|
||||
if (utMetadataId !== undefined && utMetadataId !== null && metadataSize) {
|
||||
reassembler = new MetadataReassembler(metadataSize);
|
||||
console.log(`[Metadata] Requesting piece 0 from ${host}`);
|
||||
const req = BencodeEncoder.encode({ msg_type: 0, piece: 0 });
|
||||
const len = Buffer.alloc(4);
|
||||
len.writeUInt32BE(req.length + 2);
|
||||
s.write(Buffer.concat([len, Buffer.from([20, utMetadataId]), req]));
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`[Metadata] Bencode error from ${host}`);
|
||||
}
|
||||
} else if (extId === 1 && reassembler) { // Message for OUR ut_metadata assignment
|
||||
try {
|
||||
const decoder = new BencodeDecoder(payload);
|
||||
const dict = decoder.decode() as any;
|
||||
const pieceData = payload.slice(decoder.getOffset());
|
||||
console.log(`[Metadata] Received piece ${dict.piece} from ${host} (${pieceData.length} bytes)`);
|
||||
|
||||
if (dict.msg_type === 1) {
|
||||
const complete = reassembler.addPiece(dict.piece, pieceData);
|
||||
if (complete) {
|
||||
console.log(`[Metadata] Fetched all info from ${host}!`);
|
||||
const fullMetadata = reassembler.getFullMetadata();
|
||||
if (fullMetadata) {
|
||||
const info = BencodeDecoder.decode(fullMetadata) as any;
|
||||
const files = info.files
|
||||
? info.files.map((f: any) => ({
|
||||
name: Array.isArray(f.path)
|
||||
? f.path.map((p: any) => p instanceof Uint8Array ? new TextDecoder().decode(p) : p).join('/')
|
||||
: (f.path instanceof Uint8Array ? new TextDecoder().decode(f.path) : f.path),
|
||||
size: f.length
|
||||
}))
|
||||
: [{
|
||||
name: info.name instanceof Uint8Array ? new TextDecoder().decode(info.name) : info.name,
|
||||
size: info.length
|
||||
}];
|
||||
finish({
|
||||
name: info.name instanceof Uint8Array ? new TextDecoder().decode(info.name) : info.name,
|
||||
size: info.length || files.reduce((acc: number, f: any) => acc + f.size, 0),
|
||||
pieces: info.pieces,
|
||||
pieceLength: info['piece length'],
|
||||
files
|
||||
}); // Resolve before closing to prevent race
|
||||
s.end();
|
||||
}
|
||||
} else {
|
||||
console.log(`[Metadata] Requesting next piece from ${host}`);
|
||||
const req = BencodeEncoder.encode({ msg_type: 0, piece: dict.piece + 1 });
|
||||
const len = Buffer.alloc(4);
|
||||
len.writeUInt32BE(req.length + 2);
|
||||
s.write(Buffer.concat([len, Buffer.from([20, utMetadataId as number]), req]));
|
||||
}
|
||||
} else if (dict.msg_type === 2) {
|
||||
console.log(`[Metadata] Peer ${host} rejected piece ${dict.piece}`);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(`[Metadata] Error parsing data from ${host}`);
|
||||
}
|
||||
} else {
|
||||
console.log(`[Metadata] Received unknown extension ${extId} from ${host}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
close() { if (!isSettled) { console.log(`[Metadata] Connection closed by ${host}`); finish(null); } },
|
||||
connectError() { if (!isSettled) { console.log(`[Metadata] Connect error to ${host}:${portNum}`); finish(null); } },
|
||||
error(err: any) { if (!isSettled) { console.log(`[Metadata] Socket error from ${host}: ${err}`); finish(null); } }
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(`[Metadata] Bun.connect failed for ${host}: ${e}`);
|
||||
finish(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function handleRequest(req: Request): Promise<Response> {
|
||||
const url = new URL(req.url);
|
||||
const headers = { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "POST, OPTIONS", "Access-Control-Allow-Headers": "Content-Type" };
|
||||
|
||||
if (req.method === "OPTIONS") return new Response(null, { headers });
|
||||
|
||||
if (url.pathname === "/api/torrents" && req.method === "GET") {
|
||||
const sessions = TorrentManager.getInstance().getAllSessions().map(s => s.toJSON());
|
||||
return new Response(JSON.stringify(sessions), { headers });
|
||||
}
|
||||
|
||||
if (url.pathname === "/api/torrents" && req.method === "POST") {
|
||||
const { magnetURI } = await req.json();
|
||||
try {
|
||||
const session = TorrentManager.getInstance().addTorrent(magnetURI);
|
||||
return new Response(JSON.stringify(session.toJSON()), { headers });
|
||||
} catch (e: any) {
|
||||
return new Response(JSON.stringify({ error: e.message }), { status: 400, headers });
|
||||
}
|
||||
}
|
||||
|
||||
if (url.pathname.startsWith("/api/torrents/") && url.pathname.endsWith("/start") && req.method === "POST") {
|
||||
const hash = url.pathname.split("/")[3];
|
||||
const session = TorrentManager.getInstance().getSession(hash);
|
||||
if (session) {
|
||||
session.startDownload();
|
||||
return new Response(JSON.stringify({ success: true }), { headers });
|
||||
}
|
||||
return new Response(JSON.stringify({ error: "Session not found" }), { status: 404, headers });
|
||||
}
|
||||
|
||||
if (url.pathname.startsWith("/api/torrents/") && req.method === "DELETE") {
|
||||
const hash = url.pathname.split("/").pop();
|
||||
if (hash) TorrentManager.getInstance().removeSession(hash);
|
||||
return new Response(JSON.stringify({ success: true }), { headers });
|
||||
}
|
||||
|
||||
// File Download Endpoint
|
||||
const downloadMatch = url.pathname.match(/\/api\/torrents\/([^\/]+)\/download\/(.+)/);
|
||||
if (downloadMatch && req.method === "GET") {
|
||||
const hash = downloadMatch[1];
|
||||
const filename = decodeURIComponent(downloadMatch[2]);
|
||||
|
||||
const session = TorrentManager.getInstance().getSession(hash);
|
||||
if (!session) {
|
||||
return new Response(JSON.stringify({ error: "Session not found" }), { status: 404, headers });
|
||||
}
|
||||
|
||||
const filePath = join(process.cwd(), "downloads", hash, filename);
|
||||
const file = Bun.file(filePath);
|
||||
|
||||
if (await file.exists()) {
|
||||
return new Response(file, {
|
||||
headers: {
|
||||
...headers,
|
||||
"Content-Disposition": `attachment; filename="${filename.split('/').pop()}"`
|
||||
}
|
||||
});
|
||||
}
|
||||
return new Response(JSON.stringify({ error: "File not found on disk" }), { status: 404, headers });
|
||||
}
|
||||
|
||||
// Deprecated single-request metadata endpoint (maintained for compatibility)
|
||||
if (url.pathname === "/api/metadata") {
|
||||
const { magnetURI } = await req.json();
|
||||
const session = TorrentManager.getInstance().addTorrent(magnetURI);
|
||||
|
||||
// Return current state (might be discovering)
|
||||
return new Response(JSON.stringify({
|
||||
message: session.status === 'ready' ? "Successfully fetched metadata!" : "Metadata retrieval in progress...",
|
||||
parsed: session.magnetData,
|
||||
peers: session.peers.slice(0, 10),
|
||||
files: session.files
|
||||
}), { headers });
|
||||
}
|
||||
|
||||
const distPath = join(process.cwd(), "packages", "client", "dist");
|
||||
const filePath = url.pathname === "/" ? "index.html" : url.pathname.slice(1);
|
||||
const file = Bun.file(join(distPath, filePath));
|
||||
|
||||
if (await file.exists()) {
|
||||
return new Response(file);
|
||||
}
|
||||
return new Response(Bun.file(join(distPath, "index.html")));
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== "test") {
|
||||
Bun.serve({
|
||||
port: port,
|
||||
fetch: handleRequest
|
||||
});
|
||||
}
|
||||
33
packages/server/src/metadata.multi-tracker.test.ts
Normal file
33
packages/server/src/metadata.multi-tracker.test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { handleRequest } from "./index";
|
||||
|
||||
describe("Metadata API (Multi-Tracker)", () => {
|
||||
test("aggregates peers from multiple trackers", async () => {
|
||||
// Magnet with multiple trackers
|
||||
const magnetURI = "magnet:?xt=urn:btih:A18230D43BDA105BE7DEF84CB711859018AAA92D&dn=Snow%20Crash&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce";
|
||||
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ magnetURI }),
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
|
||||
console.log("[Test] Querying multiple trackers for aggregation...");
|
||||
const res: Response = await handleRequest(req);
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
const body = await res.json();
|
||||
console.log(`[Test] Total peers found: ${body.peers.length}`);
|
||||
|
||||
// We expect a decent number of unique peers if trackers are responsive
|
||||
// Even if metadata retrieval fails, we want to see peer discovery working
|
||||
expect(body.peers).toBeDefined();
|
||||
|
||||
// Check if duplicates are handled (internal logic verification)
|
||||
const uniquePeers = new Set(body.peers);
|
||||
expect(uniquePeers.size).toBe(body.peers.length);
|
||||
|
||||
// Message should reflect that we found peers
|
||||
expect(body.message).toMatch(/Successfully fetched metadata!|Peers found but metadata retrieval timed out/);
|
||||
}, 30000);
|
||||
});
|
||||
32
packages/server/src/metadata.real.test.ts
Normal file
32
packages/server/src/metadata.real.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { handleRequest } from "./index";
|
||||
|
||||
describe("Metadata API (Real World)", () => {
|
||||
test("successfully fetches metadata for a real magnet link", async () => {
|
||||
// Snow Crash - Neal Stephenson (EPUB) - Very stable and highly seeded
|
||||
const magnetURI = "magnet:?xt=urn:btih:A18230D43BDA105BE7DEF84CB711859018AAA92D&dn=Snow%20Crash&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337";
|
||||
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ magnetURI }),
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
|
||||
console.log("[Test] Starting real-world metadata fetch (timeout 60s)...");
|
||||
const res: Response = await handleRequest(req);
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
const body = await res.json();
|
||||
console.log("[Test] API Response:", JSON.stringify(body, null, 2));
|
||||
|
||||
expect(body.message).toBe("Successfully fetched metadata!");
|
||||
expect(body.files).toBeDefined();
|
||||
expect(body.files.length).toBeGreaterThan(0);
|
||||
|
||||
// Verify file structure
|
||||
const file = body.files[0];
|
||||
expect(file.name).toBeDefined();
|
||||
expect(file.size).toBeGreaterThan(0);
|
||||
|
||||
}, 60000); // 60s timeout for real network retrieval
|
||||
});
|
||||
31
packages/server/src/metadata.single-file.test.ts
Normal file
31
packages/server/src/metadata.single-file.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { handleRequest } from "./index";
|
||||
|
||||
describe("Metadata API (Single File)", () => {
|
||||
test("successfully fetches metadata for a single-file torrent", async () => {
|
||||
// Ubuntu 22.04.3 Live Server AMD64 ISO - Standard single-file torrent
|
||||
const magnetURI = "magnet:?xt=urn:btih:3e2de7a6d8590bb25b41097fa668045952fcc506&dn=ubuntu-22.04.3-live-server-amd64.iso&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337";
|
||||
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ magnetURI }),
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
|
||||
console.log("[Test] Starting single-file metadata fetch...");
|
||||
const res: Response = await handleRequest(req);
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
const body = await res.json();
|
||||
console.log("[Test] API Response:", JSON.stringify(body, null, 2));
|
||||
|
||||
// Even if it times out on some networks, we check the logic branch if it succeeds
|
||||
if (body.files.length > 0) {
|
||||
expect(body.files.length).toBe(1);
|
||||
expect(body.files[0].name).toMatch(/ubuntu/i);
|
||||
expect(body.files[0].size).toBeGreaterThan(1000000000); // ~2GB
|
||||
} else {
|
||||
console.log("[Test] Metadata fetch timed out (expected on some restricted networks)");
|
||||
}
|
||||
}, 45000);
|
||||
});
|
||||
70
packages/server/src/metadata.test.ts
Normal file
70
packages/server/src/metadata.test.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
// No global overrides to ensure clean integration test environment
|
||||
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { handleRequest } from "./index";
|
||||
|
||||
describe("Metadata API", () => {
|
||||
test("returns 400 for invalid magnet URI", async () => {
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ magnetURI: "invalid-magnet" }),
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
|
||||
const res: Response = await handleRequest(req);
|
||||
expect(res.status).toBe(400);
|
||||
const body = await res.json();
|
||||
expect(body.error).toBe("Invalid magnet");
|
||||
});
|
||||
|
||||
test("returns 'No peers found' for valid magnet with no trackers (simulated)", async () => {
|
||||
// A truly random hash that 100% won't have peers
|
||||
const randomHash = "1234567890abcdef1234567890abcdef" + Math.random().toString(16).slice(2, 10);
|
||||
const validMagnet = `magnet:?xt=urn:btih:${randomHash}&dn=random.iso`;
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ magnetURI: validMagnet }),
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
|
||||
const res: Response = await handleRequest(req);
|
||||
expect(res.status).toBe(200);
|
||||
const body = await res.json();
|
||||
// Message can be either "No peers found" or "Peers found but metadata retrieval timed out..."
|
||||
expect(body.message).toMatch(/No peers found|Peers found but metadata retrieval timed out|All attempted peers failed/);
|
||||
expect(body.files).toEqual([]);
|
||||
// Verify parsing logic is also invoked
|
||||
expect(body.parsed).toBeDefined();
|
||||
expect(body.parsed.hash).toBeDefined();
|
||||
expect(body.parsed.dn).toBe("random.iso");
|
||||
}, 15000);
|
||||
|
||||
test("successfully parses a complex magnet URI", async () => {
|
||||
const complexMagnet = "magnet:?xt=urn:btih:A18230D43BDA105BE7DEF84CB711859018AAA92D&dn=Snow%20Crash&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&xl=1024";
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ magnetURI: complexMagnet }),
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
|
||||
const res: Response = await handleRequest(req);
|
||||
const body = await res.json();
|
||||
|
||||
expect(res.status).toBe(200);
|
||||
expect(body.parsed).toBeDefined();
|
||||
expect(body.parsed.hash).toBe("A18230D43BDA105BE7DEF84CB711859018AAA92D");
|
||||
expect(body.parsed.dn).toBe("Snow Crash");
|
||||
expect(body.parsed.tr).toContain("udp://tracker.opentrackr.org:1337");
|
||||
expect(body.parsed.xl).toBe(1024);
|
||||
}, 10000);
|
||||
|
||||
test("returns 200 for OPTIONS request (CORS)", async () => {
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "OPTIONS"
|
||||
});
|
||||
|
||||
const res = await handleRequest(req);
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.headers.get("Access-Control-Allow-Origin")).toBe("*");
|
||||
});
|
||||
});
|
||||
37
packages/server/src/metadata.tracker-resilience.test.ts
Normal file
37
packages/server/src/metadata.tracker-resilience.test.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { handleRequest } from "./index";
|
||||
|
||||
describe("Metadata API (Tracker Resilience)", () => {
|
||||
test("handles timeouts from unresponsive trackers correctly", async () => {
|
||||
// Magnet with one real tracker and two non-existent ones
|
||||
const magnetURI = "magnet:?xt=urn:btih:A18230D43BDA105BE7DEF84CB711859018AAA92D&tr=udp%3A%2F%2F127.0.0.1%3A1%2Fannounce&tr=udp%3A%2F%2F10.255.255.1%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337";
|
||||
|
||||
const req = new Request("http://localhost/api/metadata", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ magnetURI }),
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
|
||||
console.log("[Test] Querying mix of garbage and real trackers...");
|
||||
const startTime = Date.now();
|
||||
const res: Response = await handleRequest(req);
|
||||
const duration = Date.now() - startTime;
|
||||
|
||||
expect(res.status).toBe(200);
|
||||
const body = await res.json();
|
||||
|
||||
console.log(`[Test] Request completed in ${duration}ms`);
|
||||
console.log(`[Test] Peers found: ${body.peers.length}`);
|
||||
|
||||
// The tracker timeout is 3s. Total time shouldn't exceed the meta-timeout (10s)
|
||||
// significantly unless retrieval is actually happening.
|
||||
expect(duration).toBeLessThan(45000);
|
||||
|
||||
// Even with 2 garbage trackers, we should find peers from opentrackr
|
||||
if (body.peers.length === 0) {
|
||||
console.log("[Test] Warning: No peers found in resilience test. This can happen if opentrackr is down.");
|
||||
} else {
|
||||
expect(body.peers.length).toBeGreaterThan(0);
|
||||
}
|
||||
}, 60000);
|
||||
});
|
||||
38
packages/server/src/reassembler.ts
Normal file
38
packages/server/src/reassembler.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
export class PieceReassembler {
|
||||
private blocks: Map<number, Uint8Array> = new Map();
|
||||
public totalSize: number;
|
||||
private blockSize: number = 16384;
|
||||
|
||||
constructor(totalSize: number) {
|
||||
this.totalSize = totalSize;
|
||||
}
|
||||
|
||||
public addBlock(begin: number, data: Uint8Array): boolean {
|
||||
this.blocks.set(begin, data);
|
||||
return this.isComplete();
|
||||
}
|
||||
|
||||
public isComplete(): boolean {
|
||||
const totalBlocks = Math.ceil(this.totalSize / this.blockSize);
|
||||
return this.blocks.size === totalBlocks;
|
||||
}
|
||||
|
||||
public getFullPiece(): Uint8Array | null {
|
||||
if (!this.isComplete()) return null;
|
||||
const fullData = new Uint8Array(this.totalSize);
|
||||
for (const [begin, data] of this.blocks.entries()) {
|
||||
fullData.set(data, begin);
|
||||
}
|
||||
return fullData;
|
||||
}
|
||||
|
||||
public getMissingBlocks(): number[] {
|
||||
const missing = [];
|
||||
const totalBlocks = Math.ceil(this.totalSize / this.blockSize);
|
||||
for (let i = 0; i < totalBlocks; i++) {
|
||||
const begin = i * this.blockSize;
|
||||
if (!this.blocks.has(begin)) missing.push(begin);
|
||||
}
|
||||
return missing;
|
||||
}
|
||||
}
|
||||
65
packages/server/src/storage.ts
Normal file
65
packages/server/src/storage.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import { join } from 'node:path';
|
||||
import { mkdirSync, openSync, writeSync, closeSync, existsSync } from 'node:fs';
|
||||
|
||||
export interface FileInfo {
|
||||
name: string;
|
||||
size: number;
|
||||
}
|
||||
|
||||
export class StorageManager {
|
||||
private baseDir: string;
|
||||
private files: { name: string; size: number; offset: number }[] = [];
|
||||
private totalSize: number = 0;
|
||||
|
||||
constructor(hash: string, fileList: FileInfo[]) {
|
||||
this.baseDir = join(process.cwd(), 'downloads', hash);
|
||||
if (!existsSync(this.baseDir)) {
|
||||
mkdirSync(this.baseDir, { recursive: true });
|
||||
}
|
||||
|
||||
let currentOffset = 0;
|
||||
for (const f of fileList) {
|
||||
this.files.push({ ...f, offset: currentOffset });
|
||||
currentOffset += f.size;
|
||||
|
||||
const filePath = join(this.baseDir, f.name);
|
||||
const dirPath = join(filePath, '..');
|
||||
if (!existsSync(dirPath)) {
|
||||
mkdirSync(dirPath, { recursive: true });
|
||||
}
|
||||
|
||||
// Pre-create the file if it doesn't exist
|
||||
if (!existsSync(filePath)) {
|
||||
const fd = openSync(filePath, 'w');
|
||||
closeSync(fd);
|
||||
}
|
||||
}
|
||||
this.totalSize = currentOffset;
|
||||
}
|
||||
|
||||
public writePiece(pieceIndex: number, pieceSize: number, data: Uint8Array) {
|
||||
let pieceOffset = pieceIndex * pieceSize;
|
||||
let bytesRemaining = data.length;
|
||||
let dataOffset = 0;
|
||||
|
||||
for (const file of this.files) {
|
||||
const fileEnd = file.offset + file.size;
|
||||
|
||||
// Check if this piece overlaps with this file
|
||||
if (pieceOffset < fileEnd && (pieceOffset + bytesRemaining) > file.offset) {
|
||||
const fileStartInPiece = Math.max(pieceOffset, file.offset);
|
||||
const fileEndInPiece = Math.min(pieceOffset + bytesRemaining, fileEnd);
|
||||
const writeSize = fileEndInPiece - fileStartInPiece;
|
||||
|
||||
const fileWriteOffset = fileStartInPiece - file.offset;
|
||||
const dataReadOffset = dataOffset + (fileStartInPiece - pieceOffset);
|
||||
|
||||
const filePath = join(this.baseDir, file.name);
|
||||
// Use 'r+' to allow seeking correctly on Windows
|
||||
const fd = openSync(filePath, 'r+');
|
||||
writeSync(fd, data, dataReadOffset, writeSize, fileWriteOffset);
|
||||
closeSync(fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
177
packages/server/src/worker.ts
Normal file
177
packages/server/src/worker.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
import { Bitfield } from '@torrent-client/shared';
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
export class PeerWorker {
|
||||
private socket: any = null;
|
||||
private buffer = Buffer.alloc(0);
|
||||
private handshakeDone = false;
|
||||
private peerBitfield: Bitfield | null = null;
|
||||
private amInterested = false;
|
||||
private peerChoked = true;
|
||||
private activeRequests = 0;
|
||||
|
||||
constructor(
|
||||
private hash: string,
|
||||
private host: string,
|
||||
private port: number,
|
||||
private totalPieces: number,
|
||||
private onPiece: (index: number, begin: number, data: Buffer) => void,
|
||||
private onReady: () => void,
|
||||
private onClose: () => void
|
||||
) {
|
||||
this.peerBitfield = new Bitfield(totalPieces);
|
||||
}
|
||||
|
||||
public connect() {
|
||||
console.log(`[Worker] Connecting to ${this.host}:${this.port}...`);
|
||||
try {
|
||||
this.socket = Bun.connect({
|
||||
hostname: this.host,
|
||||
port: this.port,
|
||||
socket: {
|
||||
open: (s: any) => this.onOpen(s),
|
||||
data: (s: any, d: Buffer) => this.onData(s, d),
|
||||
close: () => {
|
||||
console.log(`[Worker] Connection closed: ${this.host}`);
|
||||
this.onClose();
|
||||
},
|
||||
connectError: () => {
|
||||
console.log(`[Worker] Connect error: ${this.host}`);
|
||||
this.onClose();
|
||||
},
|
||||
error: (e: any) => {
|
||||
console.log(`[Worker] Socket error for ${this.host}:`, e);
|
||||
this.onClose();
|
||||
},
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
this.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
public getHost() {
|
||||
return this.host;
|
||||
}
|
||||
|
||||
private onOpen(s: any) {
|
||||
this.socket = s; // Ensure we use the active socket instance
|
||||
const reserved = Buffer.alloc(8);
|
||||
reserved[5] |= 0x10; // Extension Protocol support (BEP 10)
|
||||
s.write(Buffer.concat([
|
||||
Buffer.from([19]), Buffer.from("BitTorrent protocol"),
|
||||
reserved, Buffer.from(this.hash, 'hex'), Buffer.from("-BT0001-" + crypto.randomBytes(6).toString("hex"))
|
||||
]));
|
||||
}
|
||||
|
||||
private onData(s: any, data: Buffer) {
|
||||
this.socket = s;
|
||||
this.buffer = Buffer.concat([this.buffer, data]);
|
||||
|
||||
if (!this.handshakeDone) {
|
||||
if (this.buffer.length >= 68 && this.buffer[0] === 19) {
|
||||
this.handshakeDone = true;
|
||||
this.buffer = this.buffer.slice(68);
|
||||
console.log(`[Worker] Handshake done with ${this.host}`);
|
||||
this.onReady(); // Trigger scheduler to send INTERESTED
|
||||
} else return;
|
||||
}
|
||||
|
||||
while (this.buffer.length >= 4) {
|
||||
const length = this.buffer.readUInt32BE(0);
|
||||
if (length === 0) { // keep-alive
|
||||
this.buffer = this.buffer.slice(4);
|
||||
continue;
|
||||
}
|
||||
if (this.buffer.length < length + 4) break;
|
||||
|
||||
const msg = this.buffer.slice(4, length + 4);
|
||||
this.buffer = this.buffer.slice(length + 4);
|
||||
|
||||
this.handleMessage(s, msg);
|
||||
}
|
||||
}
|
||||
|
||||
private handleMessage(s: any, msg: Buffer) {
|
||||
this.socket = s;
|
||||
const id = msg[0];
|
||||
const payload = msg.slice(1);
|
||||
// Silent for now unless debugging: console.log(`[Worker] MSG ${id} from ${this.host}`);
|
||||
|
||||
switch (id) {
|
||||
case 0: // choke
|
||||
this.peerChoked = true;
|
||||
break;
|
||||
case 1: // unchoke
|
||||
this.peerChoked = false;
|
||||
this.onReady(); // Ready to request blocks now!
|
||||
break;
|
||||
case 4: // have
|
||||
const haveIdx = payload.readUInt32BE(0);
|
||||
this.peerBitfield?.set(haveIdx);
|
||||
this.onReady();
|
||||
break;
|
||||
case 5: // bitfield
|
||||
if (this.peerBitfield) {
|
||||
console.log(`[Worker] BITFIELD from ${this.host} (${payload.length} bytes)`);
|
||||
this.peerBitfield.fromBuffer(payload);
|
||||
}
|
||||
this.onReady(); // Check for interest
|
||||
break;
|
||||
case 7: // piece
|
||||
const index = payload.readUInt32BE(0);
|
||||
const begin = payload.readUInt32BE(4);
|
||||
const block = payload.slice(8);
|
||||
this.pendingRequests.delete(`${index}:${begin}`);
|
||||
this.onPiece(index, begin, block);
|
||||
this.activeRequests--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public signalInterest() {
|
||||
if (!this.socket || this.amInterested) return;
|
||||
console.log(`[Worker] Proactively sending INTERESTED to ${this.host}`);
|
||||
this.socket.write(Buffer.from([0, 0, 0, 1, 2]));
|
||||
this.amInterested = true;
|
||||
}
|
||||
|
||||
private pendingRequests = new Set<string>(); // "index:begin"
|
||||
|
||||
public getPendingRequests() {
|
||||
return this.pendingRequests;
|
||||
}
|
||||
|
||||
public requestBlock(index: number, begin: number, length: number) {
|
||||
if (!this.socket) return;
|
||||
const key = `${index}:${begin}`;
|
||||
if (this.pendingRequests.has(key)) return;
|
||||
|
||||
// Signal interest if not already
|
||||
if (!this.amInterested) {
|
||||
console.log(`[Worker] Sending INTERESTED to ${this.host}`);
|
||||
this.socket.write(Buffer.from([0, 0, 0, 1, 2]));
|
||||
this.amInterested = true;
|
||||
}
|
||||
|
||||
if (this.peerChoked) return; // Wait for unchoke BEFORE sending REQUEST
|
||||
|
||||
if (this.activeRequests < 5) {
|
||||
const req = Buffer.alloc(13);
|
||||
req[0] = 6; // request ID
|
||||
req.writeUInt32BE(index, 1);
|
||||
req.writeUInt32BE(begin, 5);
|
||||
req.writeUInt32BE(length, 9);
|
||||
|
||||
const len = Buffer.alloc(4);
|
||||
len.writeUInt32BE(13);
|
||||
this.socket.write(Buffer.concat([len, req]));
|
||||
this.activeRequests++;
|
||||
this.pendingRequests.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
public hasPiece(index: number) {
|
||||
return this.peerBitfield?.has(index) ?? false;
|
||||
}
|
||||
}
|
||||
25
packages/server/tsconfig.json
Normal file
25
packages/server/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"outDir": "dist",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@torrent-client/shared": [
|
||||
"../shared/src"
|
||||
]
|
||||
},
|
||||
"types": [
|
||||
"bun-types"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
16
packages/shared/package.json
Normal file
16
packages/shared/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "@torrent-client/shared",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest run"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.17.0",
|
||||
"bun-types": "latest"
|
||||
}
|
||||
}
|
||||
137
packages/shared/src/bencode.js
Normal file
137
packages/shared/src/bencode.js
Normal file
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* Bencode Decoder
|
||||
* Implements the BitTorrent Bencode format:
|
||||
* Strings: <length>:<contents>
|
||||
* Integers: i<integer>e
|
||||
* Lists: l<contents>e
|
||||
* Dictionaries: d<contents>e
|
||||
*/
|
||||
export class BencodeDecoder {
|
||||
buffer;
|
||||
offset = 0;
|
||||
getOffset() { return this.offset; }
|
||||
constructor(data) {
|
||||
if (typeof data === 'string') {
|
||||
this.buffer = new TextEncoder().encode(data);
|
||||
}
|
||||
else {
|
||||
this.buffer = data;
|
||||
}
|
||||
}
|
||||
decode() {
|
||||
const char = String.fromCharCode(this.buffer[this.offset]);
|
||||
if (char === 'i') {
|
||||
return this.decodeInteger();
|
||||
}
|
||||
else if (char === 'l') {
|
||||
return this.decodeList();
|
||||
}
|
||||
else if (char === 'd') {
|
||||
return this.decodeDictionary();
|
||||
}
|
||||
else if (char >= '0' && char <= '9') {
|
||||
return this.decodeString();
|
||||
}
|
||||
throw new Error(`Unexpected character at offset ${this.offset}: ${char}`);
|
||||
}
|
||||
decodeInteger() {
|
||||
this.offset++; // skip 'i'
|
||||
const end = this.buffer.indexOf(101, this.offset); // 'e' is 101
|
||||
if (end === -1)
|
||||
throw new Error('Unterminated integer');
|
||||
const raw = new TextDecoder().decode(this.buffer.subarray(this.offset, end));
|
||||
this.offset = end + 1;
|
||||
return parseInt(raw, 10);
|
||||
}
|
||||
decodeString() {
|
||||
const colonIndex = this.buffer.indexOf(58, this.offset); // ':' is 58
|
||||
if (colonIndex === -1)
|
||||
throw new Error('Invalid string length');
|
||||
const lengthStr = new TextDecoder().decode(this.buffer.subarray(this.offset, colonIndex));
|
||||
const length = parseInt(lengthStr, 10);
|
||||
this.offset = colonIndex + 1;
|
||||
const data = this.buffer.subarray(this.offset, this.offset + length);
|
||||
this.offset += length;
|
||||
// Try to decode as UTF-8, if it fails or looks binary, keep as Uint8Array
|
||||
try {
|
||||
const decoded = new TextDecoder('utf-8', { fatal: true }).decode(data);
|
||||
// Heuristic: if it contains non-printable characters or looks like a hash, keep as binary
|
||||
// But for simplicity in this learning exercise, we'll try to return string where possible
|
||||
return decoded;
|
||||
}
|
||||
catch {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
decodeList() {
|
||||
this.offset++; // skip 'l'
|
||||
const list = [];
|
||||
while (this.buffer[this.offset] !== 101) { // 'e'
|
||||
list.push(this.decode());
|
||||
}
|
||||
this.offset++; // skip 'e'
|
||||
return list;
|
||||
}
|
||||
decodeDictionary() {
|
||||
this.offset++; // skip 'd'
|
||||
const dict = {};
|
||||
while (this.buffer[this.offset] !== 101) { // 'e'
|
||||
const key = this.decode();
|
||||
if (typeof key !== 'string')
|
||||
throw new Error('Dictionary keys must be strings');
|
||||
const value = this.decode();
|
||||
dict[key] = value;
|
||||
}
|
||||
this.offset++; // skip 'e'
|
||||
return dict;
|
||||
}
|
||||
static decode(data) {
|
||||
return new BencodeDecoder(data).decode();
|
||||
}
|
||||
}
|
||||
export class BencodeEncoder {
|
||||
static encoder = new TextEncoder();
|
||||
static concatUint8Arrays(arrays) {
|
||||
const totalLength = arrays.reduce((acc, arr) => acc + arr.length, 0);
|
||||
const result = new Uint8Array(totalLength);
|
||||
let offset = 0;
|
||||
for (const arr of arrays) {
|
||||
result.set(arr, offset);
|
||||
offset += arr.length;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
static encode(value) {
|
||||
if (typeof value === 'string') {
|
||||
const bytes = this.encoder.encode(value);
|
||||
const prefix = this.encoder.encode(`${bytes.length}:`);
|
||||
return this.concatUint8Arrays([prefix, bytes]);
|
||||
}
|
||||
else if (typeof value === 'number') {
|
||||
return this.encoder.encode(`i${Math.floor(value)}e`);
|
||||
}
|
||||
else if (value instanceof Uint8Array) {
|
||||
const prefix = this.encoder.encode(`${value.length}:`);
|
||||
return this.concatUint8Arrays([prefix, value]);
|
||||
}
|
||||
else if (Array.isArray(value)) {
|
||||
const parts = [this.encoder.encode('l')];
|
||||
for (const item of value) {
|
||||
parts.push(BencodeEncoder.encode(item));
|
||||
}
|
||||
parts.push(this.encoder.encode('e'));
|
||||
return this.concatUint8Arrays(parts);
|
||||
}
|
||||
else if (typeof value === 'object' && value !== null) {
|
||||
const parts = [this.encoder.encode('d')];
|
||||
const keys = Object.keys(value).sort();
|
||||
for (const key of keys) {
|
||||
parts.push(BencodeEncoder.encode(key));
|
||||
parts.push(BencodeEncoder.encode(value[key]));
|
||||
}
|
||||
parts.push(this.encoder.encode('e'));
|
||||
return this.concatUint8Arrays(parts);
|
||||
}
|
||||
throw new Error(`Unsupported value type for bencoding: ${typeof value}`);
|
||||
}
|
||||
}
|
||||
37
packages/shared/src/bencode.test.js
Normal file
37
packages/shared/src/bencode.test.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { BencodeDecoder } from './bencode';
|
||||
describe('BencodeDecoder', () => {
|
||||
it('should decode integers', () => {
|
||||
expect(BencodeDecoder.decode('i42e')).toBe(42);
|
||||
expect(BencodeDecoder.decode('i-42e')).toBe(-42);
|
||||
expect(BencodeDecoder.decode('i0e')).toBe(0);
|
||||
});
|
||||
it('should decode strings', () => {
|
||||
expect(BencodeDecoder.decode('4:spam')).toBe('spam');
|
||||
expect(BencodeDecoder.decode('0:')).toBe('');
|
||||
});
|
||||
it('should decode lists', () => {
|
||||
expect(BencodeDecoder.decode('l4:spami42ee')).toEqual(['spam', 42]);
|
||||
expect(BencodeDecoder.decode('le')).toEqual([]);
|
||||
});
|
||||
it('should decode dictionaries', () => {
|
||||
expect(BencodeDecoder.decode('d3:bar4:spam3:fooi42ee')).toEqual({
|
||||
bar: 'spam',
|
||||
foo: 42
|
||||
});
|
||||
expect(BencodeDecoder.decode('de')).toEqual({});
|
||||
});
|
||||
it('should handle nested structures', () => {
|
||||
const encoded = 'd4:listl4:spami42ee3:subd3:key5:valueee';
|
||||
const decoded = BencodeDecoder.decode(encoded);
|
||||
expect(decoded).toEqual({
|
||||
list: ['spam', 42],
|
||||
sub: { key: 'value' }
|
||||
});
|
||||
});
|
||||
it('should throw error on invalid bencode', () => {
|
||||
expect(() => BencodeDecoder.decode('x')).toThrow();
|
||||
expect(() => BencodeDecoder.decode('i42')).toThrow();
|
||||
expect(() => BencodeDecoder.decode('l4:spam')).toThrow();
|
||||
});
|
||||
});
|
||||
43
packages/shared/src/bencode.test.ts
Normal file
43
packages/shared/src/bencode.test.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { BencodeDecoder } from './bencode';
|
||||
|
||||
describe('BencodeDecoder', () => {
|
||||
it('should decode integers', () => {
|
||||
expect(BencodeDecoder.decode('i42e')).toBe(42);
|
||||
expect(BencodeDecoder.decode('i-42e')).toBe(-42);
|
||||
expect(BencodeDecoder.decode('i0e')).toBe(0);
|
||||
});
|
||||
|
||||
it('should decode strings', () => {
|
||||
expect(BencodeDecoder.decode('4:spam')).toBe('spam');
|
||||
expect(BencodeDecoder.decode('0:')).toBe('');
|
||||
});
|
||||
|
||||
it('should decode lists', () => {
|
||||
expect(BencodeDecoder.decode('l4:spami42ee')).toEqual(['spam', 42]);
|
||||
expect(BencodeDecoder.decode('le')).toEqual([]);
|
||||
});
|
||||
|
||||
it('should decode dictionaries', () => {
|
||||
expect(BencodeDecoder.decode('d3:bar4:spam3:fooi42ee')).toEqual({
|
||||
bar: 'spam',
|
||||
foo: 42
|
||||
});
|
||||
expect(BencodeDecoder.decode('de')).toEqual({});
|
||||
});
|
||||
|
||||
it('should handle nested structures', () => {
|
||||
const encoded = 'd4:listl4:spami42ee3:subd3:key5:valueee';
|
||||
const decoded = BencodeDecoder.decode(encoded);
|
||||
expect(decoded).toEqual({
|
||||
list: ['spam', 42],
|
||||
sub: { key: 'value' }
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw error on invalid bencode', () => {
|
||||
expect(() => BencodeDecoder.decode('x')).toThrow();
|
||||
expect(() => BencodeDecoder.decode('i42')).toThrow();
|
||||
expect(() => BencodeDecoder.decode('l4:spam')).toThrow();
|
||||
});
|
||||
});
|
||||
148
packages/shared/src/bencode.ts
Normal file
148
packages/shared/src/bencode.ts
Normal file
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* Bencode Decoder
|
||||
* Implements the BitTorrent Bencode format:
|
||||
* Strings: <length>:<contents>
|
||||
* Integers: i<integer>e
|
||||
* Lists: l<contents>e
|
||||
* Dictionaries: d<contents>e
|
||||
*/
|
||||
|
||||
export type BencodeValue = string | number | BencodeValue[] | { [key: string]: BencodeValue } | Uint8Array;
|
||||
|
||||
export class BencodeDecoder {
|
||||
private buffer: Uint8Array;
|
||||
private offset: number = 0;
|
||||
public getOffset(): number { return this.offset; }
|
||||
|
||||
constructor(data: Uint8Array | string) {
|
||||
if (typeof data === 'string') {
|
||||
this.buffer = new TextEncoder().encode(data);
|
||||
} else {
|
||||
this.buffer = data;
|
||||
}
|
||||
}
|
||||
|
||||
public decode(): BencodeValue {
|
||||
const char = String.fromCharCode(this.buffer[this.offset]);
|
||||
|
||||
if (char === 'i') {
|
||||
return this.decodeInteger();
|
||||
} else if (char === 'l') {
|
||||
return this.decodeList();
|
||||
} else if (char === 'd') {
|
||||
return this.decodeDictionary();
|
||||
} else if (char >= '0' && char <= '9') {
|
||||
return this.decodeString();
|
||||
}
|
||||
|
||||
throw new Error(`Unexpected character at offset ${this.offset}: ${char}`);
|
||||
}
|
||||
|
||||
private decodeInteger(): number {
|
||||
this.offset++; // skip 'i'
|
||||
const end = this.buffer.indexOf(101, this.offset); // 'e' is 101
|
||||
if (end === -1) throw new Error('Unterminated integer');
|
||||
|
||||
const raw = new TextDecoder().decode(this.buffer.subarray(this.offset, end));
|
||||
this.offset = end + 1;
|
||||
return parseInt(raw, 10);
|
||||
}
|
||||
|
||||
private decodeString(): Uint8Array | string {
|
||||
const colonIndex = this.buffer.indexOf(58, this.offset); // ':' is 58
|
||||
if (colonIndex === -1) throw new Error('Invalid string length');
|
||||
|
||||
const lengthStr = new TextDecoder().decode(this.buffer.subarray(this.offset, colonIndex));
|
||||
const length = parseInt(lengthStr, 10);
|
||||
this.offset = colonIndex + 1;
|
||||
|
||||
const data = this.buffer.subarray(this.offset, this.offset + length);
|
||||
this.offset += length;
|
||||
|
||||
// Try to decode as UTF-8, if it fails or looks binary, keep as Uint8Array
|
||||
try {
|
||||
const decoded = new TextDecoder('utf-8', { fatal: true }).decode(data);
|
||||
// Heuristic: if it contains non-printable characters or looks like a hash, keep as binary
|
||||
// But for simplicity in this learning exercise, we'll try to return string where possible
|
||||
return decoded;
|
||||
} catch {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
private decodeList(): BencodeValue[] {
|
||||
this.offset++; // skip 'l'
|
||||
const list: BencodeValue[] = [];
|
||||
|
||||
while (this.buffer[this.offset] !== 101) { // 'e'
|
||||
list.push(this.decode());
|
||||
}
|
||||
|
||||
this.offset++; // skip 'e'
|
||||
return list;
|
||||
}
|
||||
|
||||
private decodeDictionary(): { [key: string]: BencodeValue } {
|
||||
this.offset++; // skip 'd'
|
||||
const dict: { [key: string]: BencodeValue } = {};
|
||||
|
||||
while (this.buffer[this.offset] !== 101) { // 'e'
|
||||
const key = this.decode();
|
||||
if (typeof key !== 'string') throw new Error('Dictionary keys must be strings');
|
||||
const value = this.decode();
|
||||
dict[key] = value;
|
||||
}
|
||||
|
||||
this.offset++; // skip 'e'
|
||||
return dict;
|
||||
}
|
||||
|
||||
public static decode(data: Uint8Array | string): BencodeValue {
|
||||
return new BencodeDecoder(data).decode();
|
||||
}
|
||||
}
|
||||
|
||||
export class BencodeEncoder {
|
||||
private static encoder = new TextEncoder();
|
||||
|
||||
private static concatUint8Arrays(arrays: Uint8Array[]): Uint8Array {
|
||||
const totalLength = arrays.reduce((acc, arr) => acc + arr.length, 0);
|
||||
const result = new Uint8Array(totalLength);
|
||||
let offset = 0;
|
||||
for (const arr of arrays) {
|
||||
result.set(arr, offset);
|
||||
offset += arr.length;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static encode(value: BencodeValue): Uint8Array {
|
||||
if (typeof value === 'string') {
|
||||
const bytes = this.encoder.encode(value);
|
||||
const prefix = this.encoder.encode(`${bytes.length}:`);
|
||||
return this.concatUint8Arrays([prefix as Uint8Array, bytes as Uint8Array]);
|
||||
} else if (typeof value === 'number') {
|
||||
return this.encoder.encode(`i${Math.floor(value)}e`);
|
||||
} else if (value instanceof Uint8Array) {
|
||||
const prefix = this.encoder.encode(`${value.length}:`);
|
||||
return this.concatUint8Arrays([prefix as Uint8Array, value as Uint8Array]);
|
||||
} else if (Array.isArray(value)) {
|
||||
const parts: Uint8Array[] = [this.encoder.encode('l') as Uint8Array];
|
||||
for (const item of value) {
|
||||
parts.push(BencodeEncoder.encode(item) as Uint8Array);
|
||||
}
|
||||
parts.push(this.encoder.encode('e') as Uint8Array);
|
||||
return this.concatUint8Arrays(parts);
|
||||
} else if (typeof value === 'object' && value !== null) {
|
||||
const parts: Uint8Array[] = [this.encoder.encode('d') as Uint8Array];
|
||||
const keys = Object.keys(value).sort();
|
||||
for (const key of keys) {
|
||||
parts.push(BencodeEncoder.encode(key) as Uint8Array);
|
||||
parts.push(BencodeEncoder.encode(value[key as string]) as Uint8Array);
|
||||
}
|
||||
parts.push(this.encoder.encode('e') as Uint8Array);
|
||||
return this.concatUint8Arrays(parts);
|
||||
}
|
||||
throw new Error(`Unsupported value type for bencoding: ${typeof value}`);
|
||||
}
|
||||
}
|
||||
3
packages/shared/src/index.js
Normal file
3
packages/shared/src/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './magnetParser';
|
||||
export * from './bencode';
|
||||
export * from './protocol';
|
||||
3
packages/shared/src/index.ts
Normal file
3
packages/shared/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './magnetParser';
|
||||
export * from './bencode';
|
||||
export * from './protocol';
|
||||
70
packages/shared/src/magnetParser.js
Normal file
70
packages/shared/src/magnetParser.js
Normal file
@@ -0,0 +1,70 @@
|
||||
export function parseMagnetURI(uri) {
|
||||
if (!uri.startsWith('magnet:?')) {
|
||||
return null;
|
||||
}
|
||||
const result = {
|
||||
tr: [],
|
||||
kt: [],
|
||||
ws: [],
|
||||
so: [],
|
||||
"x.pe": [],
|
||||
};
|
||||
const params = uri.substring(8).split('&');
|
||||
for (const param of params) {
|
||||
const [key, value] = param.split('=').map(decodeURIComponent);
|
||||
if (!key || !value)
|
||||
continue;
|
||||
switch (key) {
|
||||
case 'xt':
|
||||
result.xt = value;
|
||||
if (value.startsWith('urn:btih:')) {
|
||||
result.hash = value.substring(9);
|
||||
}
|
||||
break;
|
||||
case 'dn':
|
||||
result.dn = value;
|
||||
break;
|
||||
case 'tr':
|
||||
result.tr.push(value);
|
||||
break;
|
||||
case 'xl':
|
||||
result.xl = parseInt(value, 10);
|
||||
break;
|
||||
case 'as':
|
||||
result.as = value;
|
||||
break;
|
||||
case 'xs':
|
||||
result.xs = value;
|
||||
break;
|
||||
case 'kt':
|
||||
result.kt?.push(value);
|
||||
break;
|
||||
case 'ws':
|
||||
result.ws?.push(value);
|
||||
break;
|
||||
case 'mt':
|
||||
result.mt = value;
|
||||
break;
|
||||
case 'so':
|
||||
result.so?.push(value);
|
||||
break;
|
||||
case 'x.pe':
|
||||
result["x.pe"]?.push(value);
|
||||
break;
|
||||
default:
|
||||
// Handle potentially multiple values for unknown keys
|
||||
if (result[key]) {
|
||||
if (Array.isArray(result[key])) {
|
||||
result[key].push(value);
|
||||
}
|
||||
else {
|
||||
result[key] = [result[key], value];
|
||||
}
|
||||
}
|
||||
else {
|
||||
result[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
52
packages/shared/src/magnetParser.test.js
Normal file
52
packages/shared/src/magnetParser.test.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { parseMagnetURI } from './magnetParser';
|
||||
describe('magnetParser', () => {
|
||||
it('should parse a standard magnet link correctly', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:A18230D43BDA105BE7DEF84CB711859018AAA92D&dn=Snow%20Crash%20by%20Neal%20Stephenson%20EPUB&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(result).not.toBeNull();
|
||||
expect(result?.hash).toBe('A18230D43BDA105BE7DEF84CB711859018AAA92D');
|
||||
expect(result?.dn).toBe('Snow Crash by Neal Stephenson EPUB');
|
||||
expect(result?.tr).toContain('udp://tracker.opentrackr.org:1337');
|
||||
});
|
||||
it('should handle multiple trackers', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&tr=tracker1&tr=tracker2';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(result?.tr).toHaveLength(2);
|
||||
expect(result?.tr).toContain('tracker1');
|
||||
expect(result?.tr).toContain('tracker2');
|
||||
});
|
||||
it('should parse file length (xl)', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&xl=1024';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(result?.xl).toBe(1024);
|
||||
});
|
||||
it('should parse acceptable sources (as)', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&as=http://example.com/file';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(result?.as).toBe('http://example.com/file');
|
||||
});
|
||||
it('should parse keywords (kt)', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&kt=ebook&kt=stephenson';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(result?.kt).toContain('ebook');
|
||||
expect(result?.kt).toContain('stephenson');
|
||||
});
|
||||
it('should return null for invalid schemes', () => {
|
||||
const uri = 'http://example.com';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
it('should handle unknown parameters', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&foo=bar';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(result?.foo).toBe('bar');
|
||||
});
|
||||
it('should handle multiple unknown parameters with the same key', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&foo=bar&foo=baz';
|
||||
const result = parseMagnetURI(uri);
|
||||
expect(Array.isArray(result?.foo)).toBe(true);
|
||||
expect(result?.foo).toContain('bar');
|
||||
expect(result?.foo).toContain('baz');
|
||||
});
|
||||
});
|
||||
68
packages/shared/src/magnetParser.test.ts
Normal file
68
packages/shared/src/magnetParser.test.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { parseMagnetURI } from './magnetParser';
|
||||
|
||||
describe('magnetParser', () => {
|
||||
it('should parse a standard magnet link correctly', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:A18230D43BDA105BE7DEF84CB711859018AAA92D&dn=Snow%20Crash%20by%20Neal%20Stephenson%20EPUB&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result?.hash).toBe('A18230D43BDA105BE7DEF84CB711859018AAA92D');
|
||||
expect(result?.dn).toBe('Snow Crash by Neal Stephenson EPUB');
|
||||
expect(result?.tr).toContain('udp://tracker.opentrackr.org:1337');
|
||||
});
|
||||
|
||||
it('should handle multiple trackers', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&tr=tracker1&tr=tracker2';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(result?.tr).toHaveLength(2);
|
||||
expect(result?.tr).toContain('tracker1');
|
||||
expect(result?.tr).toContain('tracker2');
|
||||
});
|
||||
|
||||
it('should parse file length (xl)', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&xl=1024';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(result?.xl).toBe(1024);
|
||||
});
|
||||
|
||||
it('should parse acceptable sources (as)', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&as=http://example.com/file';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(result?.as).toBe('http://example.com/file');
|
||||
});
|
||||
|
||||
it('should parse keywords (kt)', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&kt=ebook&kt=stephenson';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(result?.kt).toContain('ebook');
|
||||
expect(result?.kt).toContain('stephenson');
|
||||
});
|
||||
|
||||
it('should return null for invalid schemes', () => {
|
||||
const uri = 'http://example.com';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
it('should handle unknown parameters', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&foo=bar';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(result?.foo).toBe('bar');
|
||||
});
|
||||
|
||||
it('should handle multiple unknown parameters with the same key', () => {
|
||||
const uri = 'magnet:?xt=urn:btih:hash&foo=bar&foo=baz';
|
||||
const result = parseMagnetURI(uri);
|
||||
|
||||
expect(Array.isArray(result?.foo)).toBe(true);
|
||||
expect(result?.foo).toContain('bar');
|
||||
expect(result?.foo).toContain('baz');
|
||||
});
|
||||
});
|
||||
88
packages/shared/src/magnetParser.ts
Normal file
88
packages/shared/src/magnetParser.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
export interface MagnetData {
|
||||
xt?: string;
|
||||
hash?: string;
|
||||
dn?: string;
|
||||
tr: string[];
|
||||
xl?: number;
|
||||
as?: string;
|
||||
xs?: string;
|
||||
kt?: string[];
|
||||
ws?: string[];
|
||||
mt?: string;
|
||||
so?: string[];
|
||||
"x.pe"?: string[];
|
||||
[key: string]: string | string[] | number | undefined;
|
||||
}
|
||||
|
||||
export function parseMagnetURI(uri: string): MagnetData | null {
|
||||
if (!uri.startsWith('magnet:?')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const result: MagnetData = {
|
||||
tr: [],
|
||||
kt: [],
|
||||
ws: [],
|
||||
so: [],
|
||||
"x.pe": [],
|
||||
};
|
||||
|
||||
const params = uri.substring(8).split('&');
|
||||
|
||||
for (const param of params) {
|
||||
const [key, value] = param.split('=').map(decodeURIComponent);
|
||||
if (!key || !value) continue;
|
||||
|
||||
switch (key) {
|
||||
case 'xt':
|
||||
result.xt = value;
|
||||
if (value.startsWith('urn:btih:')) {
|
||||
result.hash = value.substring(9);
|
||||
}
|
||||
break;
|
||||
case 'dn':
|
||||
result.dn = value;
|
||||
break;
|
||||
case 'tr':
|
||||
result.tr.push(value);
|
||||
break;
|
||||
case 'xl':
|
||||
result.xl = parseInt(value, 10);
|
||||
break;
|
||||
case 'as':
|
||||
result.as = value;
|
||||
break;
|
||||
case 'xs':
|
||||
result.xs = value;
|
||||
break;
|
||||
case 'kt':
|
||||
result.kt?.push(value);
|
||||
break;
|
||||
case 'ws':
|
||||
result.ws?.push(value);
|
||||
break;
|
||||
case 'mt':
|
||||
result.mt = value;
|
||||
break;
|
||||
case 'so':
|
||||
result.so?.push(value);
|
||||
break;
|
||||
case 'x.pe':
|
||||
result["x.pe"]?.push(value);
|
||||
break;
|
||||
default:
|
||||
// Handle potentially multiple values for unknown keys
|
||||
if (result[key]) {
|
||||
if (Array.isArray(result[key])) {
|
||||
(result[key] as string[]).push(value);
|
||||
} else {
|
||||
result[key] = [result[key] as string, value];
|
||||
}
|
||||
} else {
|
||||
result[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
72
packages/shared/src/protocol.js
Normal file
72
packages/shared/src/protocol.js
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* BitTorrent Protocol Structures (BEP 9 & 10)
|
||||
* This file defines the structures for the Extension Protocol and Metadata Extension.
|
||||
*/
|
||||
/**
|
||||
* Simulates the reassembly of metadata pieces.
|
||||
* In a real scenario, these pieces would come from different peers over individual TCP packets.
|
||||
*/
|
||||
export class MetadataReassembler {
|
||||
pieces = new Map();
|
||||
totalSize;
|
||||
pieceSize = 16384; // 16KiB
|
||||
constructor(totalSize) {
|
||||
this.totalSize = totalSize;
|
||||
}
|
||||
addPiece(index, data) {
|
||||
this.pieces.set(index, data);
|
||||
return this.isComplete();
|
||||
}
|
||||
isComplete() {
|
||||
const totalPieces = Math.ceil(this.totalSize / this.pieceSize);
|
||||
return this.pieces.size === totalPieces;
|
||||
}
|
||||
getFullMetadata() {
|
||||
if (!this.isComplete())
|
||||
return null;
|
||||
const fullData = new Uint8Array(this.totalSize);
|
||||
const sortedIndices = Array.from(this.pieces.keys()).sort((a, b) => a - b);
|
||||
let offset = 0;
|
||||
for (const index of sortedIndices) {
|
||||
const piece = this.pieces.get(index);
|
||||
fullData.set(piece, offset);
|
||||
offset += piece.length;
|
||||
}
|
||||
return fullData;
|
||||
}
|
||||
getProgress() {
|
||||
const totalPieces = Math.ceil(this.totalSize / this.pieceSize);
|
||||
return (this.pieces.size / totalPieces) * 100;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Tracks which pieces we have and provides bitfield generation.
|
||||
*/
|
||||
export class Bitfield {
|
||||
bits;
|
||||
totalPieces;
|
||||
constructor(totalPieces) {
|
||||
this.totalPieces = totalPieces;
|
||||
this.bits = new Uint8Array(Math.ceil(totalPieces / 8));
|
||||
}
|
||||
set(index) {
|
||||
if (index >= this.totalPieces)
|
||||
return;
|
||||
const byteIndex = Math.floor(index / 8);
|
||||
const bitIndex = 7 - (index % 8);
|
||||
this.bits[byteIndex] |= (1 << bitIndex);
|
||||
}
|
||||
has(index) {
|
||||
if (index >= this.totalPieces)
|
||||
return false;
|
||||
const byteIndex = Math.floor(index / 8);
|
||||
const bitIndex = 7 - (index % 8);
|
||||
return (this.bits[byteIndex] & (1 << bitIndex)) !== 0;
|
||||
}
|
||||
toBuffer() {
|
||||
return this.bits;
|
||||
}
|
||||
fromBuffer(buffer) {
|
||||
this.bits = new Uint8Array(buffer);
|
||||
}
|
||||
}
|
||||
40
packages/shared/src/protocol.test.js
Normal file
40
packages/shared/src/protocol.test.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { MetadataReassembler } from "./protocol";
|
||||
describe("MetadataReassembler", () => {
|
||||
test("reassembles single piece correctly", () => {
|
||||
const data = new TextEncoder().encode("metadata-content");
|
||||
const reassembler = new MetadataReassembler(data.length);
|
||||
expect(reassembler.isComplete()).toBe(false);
|
||||
const complete = reassembler.addPiece(0, data);
|
||||
expect(complete).toBe(true);
|
||||
expect(reassembler.isComplete()).toBe(true);
|
||||
expect(reassembler.getProgress()).toBe(100);
|
||||
const result = reassembler.getFullMetadata();
|
||||
expect(new TextDecoder().decode(result)).toBe("metadata-content");
|
||||
});
|
||||
test("reassembles multiple pieces out of order", () => {
|
||||
// 16KiB is the default piece size
|
||||
const p0 = new Uint8Array(16384).fill(1);
|
||||
const p1 = new Uint8Array(16384).fill(2);
|
||||
const p2 = new Uint8Array(100).fill(3); // Final piece
|
||||
const reassembler = new MetadataReassembler(16384 * 2 + 100);
|
||||
// Add pieces out of order: 2, 0, 1
|
||||
reassembler.addPiece(2, p2);
|
||||
expect(reassembler.isComplete()).toBe(false);
|
||||
expect(reassembler.getProgress()).toBeCloseTo(33.3, 1);
|
||||
reassembler.addPiece(0, p0);
|
||||
expect(reassembler.isComplete()).toBe(false);
|
||||
const complete = reassembler.addPiece(1, p1);
|
||||
expect(complete).toBe(true);
|
||||
const full = reassembler.getFullMetadata();
|
||||
expect(full.length).toBe(16384 * 2 + 100);
|
||||
expect(full.slice(0, 16384)).toEqual(p0);
|
||||
expect(full.slice(16384, 16384 * 2)).toEqual(p1);
|
||||
expect(full.slice(16384 * 2)).toEqual(p2);
|
||||
});
|
||||
test("returns null for incomplete metadata", () => {
|
||||
const reassembler = new MetadataReassembler(20000);
|
||||
reassembler.addPiece(0, new Uint8Array(16384));
|
||||
expect(reassembler.getFullMetadata()).toBeNull();
|
||||
});
|
||||
});
|
||||
51
packages/shared/src/protocol.test.ts
Normal file
51
packages/shared/src/protocol.test.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { expect, test, describe } from "bun:test";
|
||||
import { MetadataReassembler } from "./protocol";
|
||||
|
||||
describe("MetadataReassembler", () => {
|
||||
test("reassembles single piece correctly", () => {
|
||||
const data = new TextEncoder().encode("metadata-content");
|
||||
const reassembler = new MetadataReassembler(data.length);
|
||||
|
||||
expect(reassembler.isComplete()).toBe(false);
|
||||
const complete = reassembler.addPiece(0, data);
|
||||
|
||||
expect(complete).toBe(true);
|
||||
expect(reassembler.isComplete()).toBe(true);
|
||||
expect(reassembler.getProgress()).toBe(100);
|
||||
|
||||
const result = reassembler.getFullMetadata();
|
||||
expect(new TextDecoder().decode(result!)).toBe("metadata-content");
|
||||
});
|
||||
|
||||
test("reassembles multiple pieces out of order", () => {
|
||||
// 16KiB is the default piece size
|
||||
const p0 = new Uint8Array(16384).fill(1);
|
||||
const p1 = new Uint8Array(16384).fill(2);
|
||||
const p2 = new Uint8Array(100).fill(3); // Final piece
|
||||
|
||||
const reassembler = new MetadataReassembler(16384 * 2 + 100);
|
||||
|
||||
// Add pieces out of order: 2, 0, 1
|
||||
reassembler.addPiece(2, p2);
|
||||
expect(reassembler.isComplete()).toBe(false);
|
||||
expect(reassembler.getProgress()).toBeCloseTo(33.3, 1);
|
||||
|
||||
reassembler.addPiece(0, p0);
|
||||
expect(reassembler.isComplete()).toBe(false);
|
||||
|
||||
const complete = reassembler.addPiece(1, p1);
|
||||
expect(complete).toBe(true);
|
||||
|
||||
const full = reassembler.getFullMetadata()!;
|
||||
expect(full.length).toBe(16384 * 2 + 100);
|
||||
expect(full.slice(0, 16384)).toEqual(p0);
|
||||
expect(full.slice(16384, 16384 * 2)).toEqual(p1);
|
||||
expect(full.slice(16384 * 2)).toEqual(p2);
|
||||
});
|
||||
|
||||
test("returns null for incomplete metadata", () => {
|
||||
const reassembler = new MetadataReassembler(20000);
|
||||
reassembler.addPiece(0, new Uint8Array(16384));
|
||||
expect(reassembler.getFullMetadata()).toBeNull();
|
||||
});
|
||||
});
|
||||
97
packages/shared/src/protocol.ts
Normal file
97
packages/shared/src/protocol.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* BitTorrent Protocol Structures (BEP 9 & 10)
|
||||
* This file defines the structures for the Extension Protocol and Metadata Extension.
|
||||
*/
|
||||
|
||||
export interface ExtensionHandshake {
|
||||
m: { [extensionName: string]: number }; // Supported extensions and their local IDs
|
||||
p?: number; // Local TCP port
|
||||
v?: string; // Client version string
|
||||
metadata_size?: number; // Total size of the info dictionary in bytes
|
||||
}
|
||||
|
||||
export interface MetadataRequest {
|
||||
msg_type: number; // 0 for request, 1 for data, 2 for reject
|
||||
piece: number; // The piece index being requested
|
||||
total_size?: number; // Only for data messages
|
||||
}
|
||||
|
||||
/**
|
||||
* Simulates the reassembly of metadata pieces.
|
||||
* In a real scenario, these pieces would come from different peers over individual TCP packets.
|
||||
*/
|
||||
export class MetadataReassembler {
|
||||
private pieces: Map<number, Uint8Array> = new Map();
|
||||
private totalSize: number;
|
||||
private pieceSize: number = 16384; // 16KiB
|
||||
|
||||
constructor(totalSize: number) {
|
||||
this.totalSize = totalSize;
|
||||
}
|
||||
|
||||
public addPiece(index: number, data: Uint8Array): boolean {
|
||||
this.pieces.set(index, data);
|
||||
return this.isComplete();
|
||||
}
|
||||
|
||||
public isComplete(): boolean {
|
||||
const totalPieces = Math.ceil(this.totalSize / this.pieceSize);
|
||||
return this.pieces.size === totalPieces;
|
||||
}
|
||||
|
||||
public getFullMetadata(): Uint8Array | null {
|
||||
if (!this.isComplete()) return null;
|
||||
|
||||
const fullData = new Uint8Array(this.totalSize);
|
||||
const sortedIndices = Array.from(this.pieces.keys()).sort((a, b) => a - b);
|
||||
|
||||
let offset = 0;
|
||||
for (const index of sortedIndices) {
|
||||
const piece = this.pieces.get(index)!;
|
||||
fullData.set(piece, offset);
|
||||
offset += piece.length;
|
||||
}
|
||||
|
||||
return fullData;
|
||||
}
|
||||
|
||||
public getProgress(): number {
|
||||
const totalPieces = Math.ceil(this.totalSize / this.pieceSize);
|
||||
return (this.pieces.size / totalPieces) * 100;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks which pieces we have and provides bitfield generation.
|
||||
*/
|
||||
export class Bitfield {
|
||||
private bits: Uint8Array;
|
||||
public totalPieces: number;
|
||||
|
||||
constructor(totalPieces: number) {
|
||||
this.totalPieces = totalPieces;
|
||||
this.bits = new Uint8Array(Math.ceil(totalPieces / 8));
|
||||
}
|
||||
|
||||
public set(index: number) {
|
||||
if (index >= this.totalPieces) return;
|
||||
const byteIndex = Math.floor(index / 8);
|
||||
const bitIndex = 7 - (index % 8);
|
||||
this.bits[byteIndex] |= (1 << bitIndex);
|
||||
}
|
||||
|
||||
public has(index: number): boolean {
|
||||
if (index >= this.totalPieces) return false;
|
||||
const byteIndex = Math.floor(index / 8);
|
||||
const bitIndex = 7 - (index % 8);
|
||||
return (this.bits[byteIndex] & (1 << bitIndex)) !== 0;
|
||||
}
|
||||
|
||||
public toBuffer(): Uint8Array {
|
||||
return this.bits;
|
||||
}
|
||||
|
||||
public fromBuffer(buffer: Uint8Array) {
|
||||
this.bits = new Uint8Array(buffer);
|
||||
}
|
||||
}
|
||||
23
packages/shared/tsconfig.json
Normal file
23
packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@torrent-client/shared": [
|
||||
"./src"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.test.ts"
|
||||
]
|
||||
}
|
||||
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./packages/client"
|
||||
},
|
||||
{
|
||||
"path": "./packages/server"
|
||||
},
|
||||
{
|
||||
"path": "./packages/shared"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user