Compare commits
3 Commits
40f1fdcd05
...
0b662ec519
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b662ec519 | |||
| 1f96e3553e | |||
| 3f34a48d41 |
@@ -5,18 +5,18 @@
|
|||||||
"": {
|
"": {
|
||||||
"name": "tg-chat-bot",
|
"name": "tg-chat-bot",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "^1.41.0",
|
"@google/genai": "^1.42.0",
|
||||||
"@libsql/client": "^0.17.0",
|
"@libsql/client": "^0.17.0",
|
||||||
"@mistralai/mistralai": "^1.14.0",
|
"@mistralai/mistralai": "^1.14.0",
|
||||||
"@napi-rs/canvas": "^0.1.91",
|
"@napi-rs/canvas": "^0.1.95",
|
||||||
"axios": "^1.13.5",
|
"axios": "^1.13.5",
|
||||||
"dotenv": "^17.2.4",
|
"dotenv": "^17.3.1",
|
||||||
"drizzle-orm": "^1.0.0-beta.9-e89174b",
|
"drizzle-orm": "^1.0.0-beta.9-e89174b",
|
||||||
"emoji-regex": "^10.6.0",
|
"emoji-regex": "^10.6.0",
|
||||||
"fluent-ffmpeg": "^2.1.3",
|
"fluent-ffmpeg": "^2.1.3",
|
||||||
"ollama": "^0.6.3",
|
"ollama": "^0.6.3",
|
||||||
"openai": "^6.21.0",
|
"openai": "^6.25.0",
|
||||||
"puppeteer": "^24.37.2",
|
"puppeteer": "^24.37.5",
|
||||||
"puppeteer-extra": "^3.3.6",
|
"puppeteer-extra": "^3.3.6",
|
||||||
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
||||||
"qrcode": "^1.5.4",
|
"qrcode": "^1.5.4",
|
||||||
@@ -30,12 +30,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "^1.3.9",
|
"@types/bun": "^1.3.9",
|
||||||
"@types/fluent-ffmpeg": "^2.1.28",
|
"@types/fluent-ffmpeg": "^2.1.28",
|
||||||
"@types/node": "^25.2.3",
|
"@types/node": "^25.3.0",
|
||||||
"@types/qrcode": "^1.5.6",
|
"@types/qrcode": "^1.5.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||||
"@typescript-eslint/parser": "^8.55.0",
|
"@typescript-eslint/parser": "^8.56.1",
|
||||||
"drizzle-kit": "^1.0.0-beta.9-e89174b",
|
"drizzle-kit": "^1.0.0-beta.9-e89174b",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "^9.39.3",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "^4.21.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
},
|
},
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
|
|
||||||
"@eslint/plugin-kit": ["@eslint/plugin-kit@0.4.1", "", { "dependencies": { "@eslint/core": "^0.17.0", "levn": "^0.4.1" } }, "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA=="],
|
"@eslint/plugin-kit": ["@eslint/plugin-kit@0.4.1", "", { "dependencies": { "@eslint/core": "^0.17.0", "levn": "^0.4.1" } }, "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA=="],
|
||||||
|
|
||||||
"@google/genai": ["@google/genai@1.42.0", "", { "dependencies": { "google-auth-library": "^10.3.0", "p-retry": "^4.6.2", "protobufjs": "^7.5.4", "ws": "^8.18.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": "^1.25.2" }, "optionalPeers": ["@modelcontextprotocol/sdk"] }, "sha512-+3nlMTcrQufbQ8IumGkOphxD5Pd5kKyJOzLcnY0/1IuE8upJk5aLmoexZ2BJhBp1zAjRJMEB4a2CJwKI9e2EYw=="],
|
"@google/genai": ["@google/genai@1.43.0", "", { "dependencies": { "google-auth-library": "^10.3.0", "p-retry": "^4.6.2", "protobufjs": "^7.5.4", "ws": "^8.18.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": "^1.25.2" }, "optionalPeers": ["@modelcontextprotocol/sdk"] }, "sha512-hklCsJNdMlDM1IwcCVcGQFBg2izY0+t5BIGbRsxi2UnKi6AGKL7pqJqmBDNRbw0bYCs4y3NA7TB+fkKfP/Nrdw=="],
|
||||||
|
|
||||||
"@humanfs/core": ["@humanfs/core@0.19.1", "", {}, "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA=="],
|
"@humanfs/core": ["@humanfs/core@0.19.1", "", {}, "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA=="],
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
|
|
||||||
"@libsql/win32-x64-msvc": ["@libsql/win32-x64-msvc@0.5.22", "", { "os": "win32", "cpu": "x64" }, "sha512-Fj0j8RnBpo43tVZUVoNK6BV/9AtDUM5S7DF3LB4qTYg1LMSZqi3yeCneUTLJD6XomQJlZzbI4mst89yspVSAnA=="],
|
"@libsql/win32-x64-msvc": ["@libsql/win32-x64-msvc@0.5.22", "", { "os": "win32", "cpu": "x64" }, "sha512-Fj0j8RnBpo43tVZUVoNK6BV/9AtDUM5S7DF3LB4qTYg1LMSZqi3yeCneUTLJD6XomQJlZzbI4mst89yspVSAnA=="],
|
||||||
|
|
||||||
"@mistralai/mistralai": ["@mistralai/mistralai@1.14.0", "", { "dependencies": { "ws": "^8.18.0", "zod": "^3.25.0 || ^4.0.0", "zod-to-json-schema": "^3.24.1" } }, "sha512-6zaj2f2LCd37cRpBvCgctkDbXtYBlAC85p+u4uU/726zjtsI+sdVH34qRzkm9iE3tRb8BoaiI0/P7TD+uMvLLQ=="],
|
"@mistralai/mistralai": ["@mistralai/mistralai@1.14.1", "", { "dependencies": { "ws": "^8.18.0", "zod": "^3.25.0 || ^4.0.0", "zod-to-json-schema": "^3.24.1" } }, "sha512-IiLmmZFCCTReQgPAT33r7KQ1nYo5JPdvGkrkZqA8qQ2qB1GHgs5LoP5K2ICyrjnpw2n8oSxMM/VP+liiKcGNlQ=="],
|
||||||
|
|
||||||
"@napi-rs/canvas": ["@napi-rs/canvas@0.1.95", "", { "optionalDependencies": { "@napi-rs/canvas-android-arm64": "0.1.95", "@napi-rs/canvas-darwin-arm64": "0.1.95", "@napi-rs/canvas-darwin-x64": "0.1.95", "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.95", "@napi-rs/canvas-linux-arm64-gnu": "0.1.95", "@napi-rs/canvas-linux-arm64-musl": "0.1.95", "@napi-rs/canvas-linux-riscv64-gnu": "0.1.95", "@napi-rs/canvas-linux-x64-gnu": "0.1.95", "@napi-rs/canvas-linux-x64-musl": "0.1.95", "@napi-rs/canvas-win32-arm64-msvc": "0.1.95", "@napi-rs/canvas-win32-x64-msvc": "0.1.95" } }, "sha512-lkg23ge+rgyhgUwXmlbkPEhuhHq/hUi/gXKH+4I7vO+lJrbNfEYcQdJLIGjKyXLQzgFiiyDAwh5vAe/tITAE+w=="],
|
"@napi-rs/canvas": ["@napi-rs/canvas@0.1.95", "", { "optionalDependencies": { "@napi-rs/canvas-android-arm64": "0.1.95", "@napi-rs/canvas-darwin-arm64": "0.1.95", "@napi-rs/canvas-darwin-x64": "0.1.95", "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.95", "@napi-rs/canvas-linux-arm64-gnu": "0.1.95", "@napi-rs/canvas-linux-arm64-musl": "0.1.95", "@napi-rs/canvas-linux-riscv64-gnu": "0.1.95", "@napi-rs/canvas-linux-x64-gnu": "0.1.95", "@napi-rs/canvas-linux-x64-musl": "0.1.95", "@napi-rs/canvas-win32-arm64-msvc": "0.1.95", "@napi-rs/canvas-win32-x64-msvc": "0.1.95" } }, "sha512-lkg23ge+rgyhgUwXmlbkPEhuhHq/hUi/gXKH+4I7vO+lJrbNfEYcQdJLIGjKyXLQzgFiiyDAwh5vAe/tITAE+w=="],
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@
|
|||||||
|
|
||||||
"@types/mssql": ["@types/mssql@9.1.8", "", { "dependencies": { "@types/node": "*", "tarn": "^3.0.1", "tedious": "*" } }, "sha512-mt9h5jWj+DYE5jxnKaWSV/GqDf9FV52XYVk6T3XZF69noEe+JJV6MKirii48l81+cjmAkSq+qeKX+k61fHkYrQ=="],
|
"@types/mssql": ["@types/mssql@9.1.8", "", { "dependencies": { "@types/node": "*", "tarn": "^3.0.1", "tedious": "*" } }, "sha512-mt9h5jWj+DYE5jxnKaWSV/GqDf9FV52XYVk6T3XZF69noEe+JJV6MKirii48l81+cjmAkSq+qeKX+k61fHkYrQ=="],
|
||||||
|
|
||||||
"@types/node": ["@types/node@25.3.0", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-4K3bqJpXpqfg2XKGK9bpDTc6xO/xoUP/RBWS7AtRMug6zZFaRekiLzjVtAoZMquxoAbzBvy5nxQ7veS5eYzf8A=="],
|
"@types/node": ["@types/node@25.3.3", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-DpzbrH7wIcBaJibpKo9nnSQL0MTRdnWttGyE5haGwK86xgMOkFLp7vEyfQPGLOJh5wNYiJ3V9PmUMDhV9u8kkQ=="],
|
||||||
|
|
||||||
"@types/qrcode": ["@types/qrcode@1.5.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw=="],
|
"@types/qrcode": ["@types/qrcode@1.5.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw=="],
|
||||||
|
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
|
|
||||||
"asynckit": ["asynckit@0.4.0", "", {}, "sha1-x57Zf380y48robyXkLzDZkdLS3k="],
|
"asynckit": ["asynckit@0.4.0", "", {}, "sha1-x57Zf380y48robyXkLzDZkdLS3k="],
|
||||||
|
|
||||||
"axios": ["axios@1.13.5", "", { "dependencies": { "follow-redirects": "^1.15.11", "form-data": "^4.0.5", "proxy-from-env": "^1.1.0" } }, "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q=="],
|
"axios": ["axios@1.13.6", "", { "dependencies": { "follow-redirects": "^1.15.11", "form-data": "^4.0.5", "proxy-from-env": "^1.1.0" } }, "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ=="],
|
||||||
|
|
||||||
"b4a": ["b4a@1.7.3", "", { "peerDependencies": { "react-native-b4a": "*" }, "optionalPeers": ["react-native-b4a"] }, "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q=="],
|
"b4a": ["b4a@1.7.3", "", { "peerDependencies": { "react-native-b4a": "*" }, "optionalPeers": ["react-native-b4a"] }, "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q=="],
|
||||||
|
|
||||||
|
|||||||
Generated
+135
-244
@@ -8,11 +8,11 @@
|
|||||||
"name": "tg-chat-bot",
|
"name": "tg-chat-bot",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "^1.42.0",
|
"@google/genai": "^1.43.0",
|
||||||
"@libsql/client": "^0.17.0",
|
"@libsql/client": "^0.17.0",
|
||||||
"@mistralai/mistralai": "^1.14.0",
|
"@mistralai/mistralai": "^1.14.1",
|
||||||
"@napi-rs/canvas": "^0.1.95",
|
"@napi-rs/canvas": "^0.1.95",
|
||||||
"axios": "^1.13.5",
|
"axios": "^1.13.6",
|
||||||
"dotenv": "^17.3.1",
|
"dotenv": "^17.3.1",
|
||||||
"drizzle-orm": "^1.0.0-beta.9-e89174b",
|
"drizzle-orm": "^1.0.0-beta.9-e89174b",
|
||||||
"emoji-regex": "^10.6.0",
|
"emoji-regex": "^10.6.0",
|
||||||
@@ -33,12 +33,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "^1.3.9",
|
"@types/bun": "^1.3.9",
|
||||||
"@types/fluent-ffmpeg": "^2.1.28",
|
"@types/fluent-ffmpeg": "^2.1.28",
|
||||||
"@types/node": "^25.3.0",
|
"@types/node": "^25.3.3",
|
||||||
"@types/qrcode": "^1.5.6",
|
"@types/qrcode": "^1.5.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||||
"@typescript-eslint/parser": "^8.56.1",
|
"@typescript-eslint/parser": "^8.56.1",
|
||||||
"drizzle-kit": "^1.0.0-beta.9-e89174b",
|
"drizzle-kit": "^1.0.0-beta.9-e89174b",
|
||||||
"eslint": "^9.39.3",
|
"eslint": "^10.0.2",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "^4.21.0",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
@@ -836,169 +836,113 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-array": {
|
"node_modules/@eslint/config-array": {
|
||||||
"version": "0.21.1",
|
"version": "0.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.2.tgz",
|
||||||
"integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==",
|
"integrity": "sha512-YF+fE6LV4v5MGWRGj7G404/OZzGNepVF8fxk7jqmqo3lrza7a0uUcDnROGRBG1WFC1omYUS/Wp1f42i0M+3Q3A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/object-schema": "^2.1.7",
|
"@eslint/object-schema": "^3.0.2",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"minimatch": "^3.1.2"
|
"minimatch": "^10.2.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@eslint/config-array/node_modules/balanced-match": {
|
||||||
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "18 || 20 || >=22"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-array/node_modules/brace-expansion": {
|
"node_modules/@eslint/config-array/node_modules/brace-expansion": {
|
||||||
"version": "1.1.12",
|
"version": "5.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz",
|
||||||
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
"integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^4.0.2"
|
||||||
"concat-map": "0.0.1"
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "18 || 20 || >=22"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-array/node_modules/minimatch": {
|
"node_modules/@eslint/config-array/node_modules/minimatch": {
|
||||||
"version": "3.1.4",
|
"version": "10.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
|
||||||
"integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
|
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "BlueOak-1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^5.0.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "18 || 20 || >=22"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-helpers": {
|
"node_modules/@eslint/config-helpers": {
|
||||||
"version": "0.4.2",
|
"version": "0.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.2.tgz",
|
||||||
"integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
|
"integrity": "sha512-a5MxrdDXEvqnIq+LisyCX6tQMPF/dSJpCfBgBauY+pNZ28yCtSsTvyTYrMhaI+LK26bVyCJfJkT0u8KIj2i1dQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/core": "^0.17.0"
|
"@eslint/core": "^1.1.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/core": {
|
"node_modules/@eslint/core": {
|
||||||
"version": "0.17.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.1.0.tgz",
|
||||||
"integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
|
"integrity": "sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/json-schema": "^7.0.15"
|
"@types/json-schema": "^7.0.15"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@eslint/eslintrc": {
|
|
||||||
"version": "3.3.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.4.tgz",
|
|
||||||
"integrity": "sha512-4h4MVF8pmBsncB60r0wSJiIeUKTSD4m7FmTFThG8RHlsg9ajqckLm9OraguFGZE4vVdpiI1Q4+hFnisopmG6gQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"ajv": "^6.14.0",
|
|
||||||
"debug": "^4.3.2",
|
|
||||||
"espree": "^10.0.1",
|
|
||||||
"globals": "^14.0.0",
|
|
||||||
"ignore": "^5.2.0",
|
|
||||||
"import-fresh": "^3.2.1",
|
|
||||||
"js-yaml": "^4.1.1",
|
|
||||||
"minimatch": "^3.1.3",
|
|
||||||
"strip-json-comments": "^3.1.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://opencollective.com/eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@eslint/eslintrc/node_modules/brace-expansion": {
|
|
||||||
"version": "1.1.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
|
||||||
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"balanced-match": "^1.0.0",
|
|
||||||
"concat-map": "0.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@eslint/eslintrc/node_modules/ignore": {
|
|
||||||
"version": "5.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
|
|
||||||
"integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@eslint/eslintrc/node_modules/minimatch": {
|
|
||||||
"version": "3.1.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
|
|
||||||
"integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"brace-expansion": "^1.1.7"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@eslint/js": {
|
|
||||||
"version": "9.39.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.3.tgz",
|
|
||||||
"integrity": "sha512-1B1VkCq6FuUNlQvlBYb+1jDu/gV297TIs/OeiaSR9l1H27SVW55ONE1e1Vp16NqP683+xEGzxYtv4XCiDPaQiw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://eslint.org/donate"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/object-schema": {
|
"node_modules/@eslint/object-schema": {
|
||||||
"version": "2.1.7",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.2.tgz",
|
||||||
"integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
|
"integrity": "sha512-HOy56KJt48Bx8KmJ+XGQNSUMT/6dZee/M54XyUyuvTvPXJmsERRvBchsUVx1UMe1WwIH49XLAczNC7V2INsuUw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/plugin-kit": {
|
"node_modules/@eslint/plugin-kit": {
|
||||||
"version": "0.4.1",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.6.0.tgz",
|
||||||
"integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
|
"integrity": "sha512-bIZEUzOI1jkhviX2cp5vNyXQc6olzb2ohewQubuYlMXZ2Q/XjBO0x0XhGPvc9fjSIiUN0vw+0hq53BJ4eQSJKQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/core": "^0.17.0",
|
"@eslint/core": "^1.1.0",
|
||||||
"levn": "^0.4.1"
|
"levn": "^0.4.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@google/genai": {
|
"node_modules/@google/genai": {
|
||||||
"version": "1.42.0",
|
"version": "1.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@google/genai/-/genai-1.42.0.tgz",
|
"resolved": "https://registry.npmjs.org/@google/genai/-/genai-1.43.0.tgz",
|
||||||
"integrity": "sha512-+3nlMTcrQufbQ8IumGkOphxD5Pd5kKyJOzLcnY0/1IuE8upJk5aLmoexZ2BJhBp1zAjRJMEB4a2CJwKI9e2EYw==",
|
"integrity": "sha512-hklCsJNdMlDM1IwcCVcGQFBg2izY0+t5BIGbRsxi2UnKi6AGKL7pqJqmBDNRbw0bYCs4y3NA7TB+fkKfP/Nrdw==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"google-auth-library": "^10.3.0",
|
"google-auth-library": "^10.3.0",
|
||||||
@@ -1734,9 +1678,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@mistralai/mistralai": {
|
"node_modules/@mistralai/mistralai": {
|
||||||
"version": "1.14.0",
|
"version": "1.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-1.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-1.14.1.tgz",
|
||||||
"integrity": "sha512-6zaj2f2LCd37cRpBvCgctkDbXtYBlAC85p+u4uU/726zjtsI+sdVH34qRzkm9iE3tRb8BoaiI0/P7TD+uMvLLQ==",
|
"integrity": "sha512-IiLmmZFCCTReQgPAT33r7KQ1nYo5JPdvGkrkZqA8qQ2qB1GHgs5LoP5K2ICyrjnpw2n8oSxMM/VP+liiKcGNlQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ws": "^8.18.0",
|
"ws": "^8.18.0",
|
||||||
"zod": "^3.25.0 || ^4.0.0",
|
"zod": "^3.25.0 || ^4.0.0",
|
||||||
@@ -2233,6 +2177,13 @@
|
|||||||
"@types/ms": "*"
|
"@types/ms": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/esrecurse": {
|
||||||
|
"version": "4.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz",
|
||||||
|
"integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@types/estree": {
|
"node_modules/@types/estree": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
|
||||||
@@ -2276,9 +2227,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "25.3.0",
|
"version": "25.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.3.tgz",
|
||||||
"integrity": "sha512-4K3bqJpXpqfg2XKGK9bpDTc6xO/xoUP/RBWS7AtRMug6zZFaRekiLzjVtAoZMquxoAbzBvy5nxQ7veS5eYzf8A==",
|
"integrity": "sha512-DpzbrH7wIcBaJibpKo9nnSQL0MTRdnWttGyE5haGwK86xgMOkFLp7vEyfQPGLOJh5wNYiJ3V9PmUMDhV9u8kkQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~7.18.0"
|
"undici-types": "~7.18.0"
|
||||||
@@ -2743,9 +2694,9 @@
|
|||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.13.5",
|
"version": "1.13.6",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
|
||||||
"integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==",
|
"integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.11",
|
"follow-redirects": "^1.15.11",
|
||||||
@@ -3037,23 +2988,6 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chalk": {
|
|
||||||
"version": "4.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
|
||||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-styles": "^4.1.0",
|
|
||||||
"supports-color": "^7.1.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/chromium-bidi": {
|
"node_modules/chromium-bidi": {
|
||||||
"version": "14.0.0",
|
"version": "14.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-14.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-14.0.0.tgz",
|
||||||
@@ -3773,33 +3707,30 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "9.39.3",
|
"version": "10.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.3.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.0.2.tgz",
|
||||||
"integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==",
|
"integrity": "sha512-uYixubwmqJZH+KLVYIVKY1JQt7tysXhtj21WSvjcSmU5SVNzMus1bgLe+pAt816yQ8opKfheVVoPLqvVMGejYw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.8.0",
|
"@eslint-community/eslint-utils": "^4.8.0",
|
||||||
"@eslint-community/regexpp": "^4.12.1",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@eslint/config-array": "^0.21.1",
|
"@eslint/config-array": "^0.23.2",
|
||||||
"@eslint/config-helpers": "^0.4.2",
|
"@eslint/config-helpers": "^0.5.2",
|
||||||
"@eslint/core": "^0.17.0",
|
"@eslint/core": "^1.1.0",
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/plugin-kit": "^0.6.0",
|
||||||
"@eslint/js": "9.39.3",
|
|
||||||
"@eslint/plugin-kit": "^0.4.1",
|
|
||||||
"@humanfs/node": "^0.16.6",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@humanwhocodes/retry": "^0.4.2",
|
"@humanwhocodes/retry": "^0.4.2",
|
||||||
"@types/estree": "^1.0.6",
|
"@types/estree": "^1.0.6",
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.14.0",
|
||||||
"chalk": "^4.0.0",
|
|
||||||
"cross-spawn": "^7.0.6",
|
"cross-spawn": "^7.0.6",
|
||||||
"debug": "^4.3.2",
|
"debug": "^4.3.2",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
"eslint-scope": "^8.4.0",
|
"eslint-scope": "^9.1.1",
|
||||||
"eslint-visitor-keys": "^4.2.1",
|
"eslint-visitor-keys": "^5.0.1",
|
||||||
"espree": "^10.4.0",
|
"espree": "^11.1.1",
|
||||||
"esquery": "^1.5.0",
|
"esquery": "^1.7.0",
|
||||||
"esutils": "^2.0.2",
|
"esutils": "^2.0.2",
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"file-entry-cache": "^8.0.0",
|
"file-entry-cache": "^8.0.0",
|
||||||
@@ -3809,8 +3740,7 @@
|
|||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
"is-glob": "^4.0.0",
|
"is-glob": "^4.0.0",
|
||||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||||
"lodash.merge": "^4.6.2",
|
"minimatch": "^10.2.1",
|
||||||
"minimatch": "^3.1.2",
|
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
"optionator": "^0.9.3"
|
"optionator": "^0.9.3"
|
||||||
},
|
},
|
||||||
@@ -3818,7 +3748,7 @@
|
|||||||
"eslint": "bin/eslint.js"
|
"eslint": "bin/eslint.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://eslint.org/donate"
|
"url": "https://eslint.org/donate"
|
||||||
@@ -3833,17 +3763,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-scope": {
|
"node_modules/eslint-scope": {
|
||||||
"version": "8.4.0",
|
"version": "9.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.1.tgz",
|
||||||
"integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
|
"integrity": "sha512-GaUN0sWim5qc8KVErfPBWmc31LEsOkrUJbvJZV+xuL3u2phMUK4HIvXlWAakfC8W4nzlK+chPEAkYOYb5ZScIw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/esrecurse": "^4.3.1",
|
||||||
|
"@types/estree": "^1.0.8",
|
||||||
"esrecurse": "^4.3.0",
|
"esrecurse": "^4.3.0",
|
||||||
"estraverse": "^5.2.0"
|
"estraverse": "^5.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
@@ -3862,25 +3794,37 @@
|
|||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/eslint/node_modules/balanced-match": {
|
||||||
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "18 || 20 || >=22"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/eslint/node_modules/brace-expansion": {
|
"node_modules/eslint/node_modules/brace-expansion": {
|
||||||
"version": "1.1.12",
|
"version": "5.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz",
|
||||||
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
"integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^4.0.2"
|
||||||
"concat-map": "0.0.1"
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "18 || 20 || >=22"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
||||||
"version": "4.2.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
|
||||||
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
|
"integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
@@ -3897,44 +3841,47 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint/node_modules/minimatch": {
|
"node_modules/eslint/node_modules/minimatch": {
|
||||||
"version": "3.1.4",
|
"version": "10.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
|
||||||
"integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
|
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "BlueOak-1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^5.0.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "18 || 20 || >=22"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/espree": {
|
"node_modules/espree": {
|
||||||
"version": "10.4.0",
|
"version": "11.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/espree/-/espree-11.1.1.tgz",
|
||||||
"integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
|
"integrity": "sha512-AVHPqQoZYc+RUM4/3Ly5udlZY/U4LS8pIG05jEjWM2lQMU/oaZ7qshzAl2YP1tfNmXfftH3ohurfwNAug+MnsQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acorn": "^8.15.0",
|
"acorn": "^8.16.0",
|
||||||
"acorn-jsx": "^5.3.2",
|
"acorn-jsx": "^5.3.2",
|
||||||
"eslint-visitor-keys": "^4.2.1"
|
"eslint-visitor-keys": "^5.0.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/espree/node_modules/eslint-visitor-keys": {
|
"node_modules/espree/node_modules/eslint-visitor-keys": {
|
||||||
"version": "4.2.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
|
||||||
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
|
"integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
@@ -4487,19 +4434,6 @@
|
|||||||
"node": ">=10.13.0"
|
"node": ">=10.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/globals": {
|
|
||||||
"version": "14.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
|
|
||||||
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/google-auth-library": {
|
"node_modules/google-auth-library": {
|
||||||
"version": "10.5.0",
|
"version": "10.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.5.0.tgz",
|
||||||
@@ -4558,16 +4492,6 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/has-flag": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/has-symbols": {
|
"node_modules/has-symbols": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||||
@@ -5159,13 +5083,6 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/lodash.merge": {
|
|
||||||
"version": "4.6.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
|
||||||
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/lodash.once": {
|
"node_modules/lodash.once": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
|
||||||
@@ -6516,32 +6433,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/strip-json-comments": {
|
|
||||||
"version": "3.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
|
|
||||||
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/supports-color": {
|
|
||||||
"version": "7.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
|
||||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"has-flag": "^4.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/systeminformation": {
|
"node_modules/systeminformation": {
|
||||||
"version": "5.31.1",
|
"version": "5.31.1",
|
||||||
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.31.1.tgz",
|
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.31.1.tgz",
|
||||||
|
|||||||
+5
-5
@@ -8,11 +8,11 @@
|
|||||||
"bun:start": "bun run dist/index.js"
|
"bun:start": "bun run dist/index.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "^1.42.0",
|
"@google/genai": "^1.43.0",
|
||||||
"@libsql/client": "^0.17.0",
|
"@libsql/client": "^0.17.0",
|
||||||
"@mistralai/mistralai": "^1.14.0",
|
"@mistralai/mistralai": "^1.14.1",
|
||||||
"@napi-rs/canvas": "^0.1.95",
|
"@napi-rs/canvas": "^0.1.95",
|
||||||
"axios": "^1.13.5",
|
"axios": "^1.13.6",
|
||||||
"dotenv": "^17.3.1",
|
"dotenv": "^17.3.1",
|
||||||
"drizzle-orm": "^1.0.0-beta.9-e89174b",
|
"drizzle-orm": "^1.0.0-beta.9-e89174b",
|
||||||
"emoji-regex": "^10.6.0",
|
"emoji-regex": "^10.6.0",
|
||||||
@@ -32,13 +32,13 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "^1.3.9",
|
"@types/bun": "^1.3.9",
|
||||||
"@types/node": "^25.3.0",
|
"@types/node": "^25.3.3",
|
||||||
"@types/qrcode": "^1.5.6",
|
"@types/qrcode": "^1.5.6",
|
||||||
"@types/fluent-ffmpeg": "^2.1.28",
|
"@types/fluent-ffmpeg": "^2.1.28",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||||
"@typescript-eslint/parser": "^8.56.1",
|
"@typescript-eslint/parser": "^8.56.1",
|
||||||
"drizzle-kit": "^1.0.0-beta.9-e89174b",
|
"drizzle-kit": "^1.0.0-beta.9-e89174b",
|
||||||
"eslint": "^9.39.3",
|
"eslint": "^10.0.2",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "^4.21.0",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import {CallbackCommand} from "../base/callback-command";
|
||||||
|
import {CallbackQuery} from "typescript-telegram-bot-api";
|
||||||
|
import {Requirements} from "../base/requirements";
|
||||||
|
import {Requirement} from "../base/requirement";
|
||||||
|
import {commands} from "../index";
|
||||||
|
import {YouTubeDownload} from "../commands/youtube-download";
|
||||||
|
|
||||||
|
const downloadText = " 📥 Скачать";
|
||||||
|
const getFromCacheText = "📥 Загрузить из кэша";
|
||||||
|
|
||||||
|
export class DownloadYtVideo extends CallbackCommand {
|
||||||
|
data = "/ytdl";
|
||||||
|
text = " 📥 Скачать";
|
||||||
|
|
||||||
|
requirements = Requirements.Build(Requirement.SAME_USER);
|
||||||
|
|
||||||
|
constructor(text?: string, data?: string) {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.text = text || this.text;
|
||||||
|
this.data = data || this.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
static withData(inCache?: boolean, data?: string): DownloadYtVideo {
|
||||||
|
return new DownloadYtVideo(inCache ? getFromCacheText : downloadText, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(query: CallbackQuery): Promise<void> {
|
||||||
|
const videoId = query.data.split(" ")[1];
|
||||||
|
if (!videoId) return;
|
||||||
|
|
||||||
|
const yt = commands.find(c => c instanceof YouTubeDownload);
|
||||||
|
if (!yt) return;
|
||||||
|
await yt.downloadYouTubeVideo(query.message, {videoId: videoId});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import {CallbackCommand} from "../base/callback-command";
|
||||||
|
|
||||||
|
export class TryAgain extends CallbackCommand {
|
||||||
|
data = "";
|
||||||
|
text = "🔁 Повторить";
|
||||||
|
|
||||||
|
constructor(text?: string, data?: string) {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.text = text ?? this.text;
|
||||||
|
this.data = data ?? this.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
static withData(data?: string): TryAgain {
|
||||||
|
return new TryAgain(null, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(): Promise<void> {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import {CallbackCommand} from "../base/callback-command";
|
||||||
|
import {CallbackQuery} from "typescript-telegram-bot-api";
|
||||||
|
import {processYouTubeLink} from "../util/utils";
|
||||||
|
|
||||||
|
export class YtInfo extends CallbackCommand {
|
||||||
|
data = "/ytinfo";
|
||||||
|
text: string;
|
||||||
|
|
||||||
|
async execute(query: CallbackQuery): Promise<void> {
|
||||||
|
const videoUrl = query.data.split(" ")[1];
|
||||||
|
if (!videoUrl) return;
|
||||||
|
|
||||||
|
await processYouTubeLink(query.message, videoUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -80,7 +80,7 @@ export class GeminiChat extends ChatCommand {
|
|||||||
try {
|
try {
|
||||||
waitMessage = await bot.sendMessage({
|
waitMessage = await bot.sendMessage({
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
text: Environment.waitText,
|
text: Environment.waitThinkText,
|
||||||
reply_parameters: {
|
reply_parameters: {
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
message_id: msg.message_id
|
message_id: msg.message_id
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export class GeminiGenerateImage extends Command {
|
|||||||
await replyToMessage({
|
await replyToMessage({
|
||||||
message: waitMessage,
|
message: waitMessage,
|
||||||
text: `Произошла ошибка!\n${e.toString()}`,
|
text: `Произошла ошибка!\n${e.toString()}`,
|
||||||
disableLinkPreview: true
|
link_preview_options: {is_disabled: true}
|
||||||
}).catch(logError);
|
}).catch(logError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export class MistralChat extends ChatCommand {
|
|||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
text: imagesCount ?
|
text: imagesCount ?
|
||||||
imagesCount > 1 ? Environment.analyzingPicturesText : Environment.analyzingPictureText
|
imagesCount > 1 ? Environment.analyzingPicturesText : Environment.analyzingPictureText
|
||||||
: Environment.waitText,
|
: Environment.waitThinkText,
|
||||||
|
|
||||||
reply_parameters: {
|
reply_parameters: {
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export class OllamaChat extends ChatCommand {
|
|||||||
message: msg,
|
message: msg,
|
||||||
text: (!think && imagesCount) ?
|
text: (!think && imagesCount) ?
|
||||||
imagesCount > 1 ? Environment.analyzingPicturesText : Environment.analyzingPictureText
|
imagesCount > 1 ? Environment.analyzingPicturesText : Environment.analyzingPictureText
|
||||||
: Environment.waitText
|
: Environment.waitThinkText
|
||||||
});
|
});
|
||||||
|
|
||||||
const stream = await ollama.chat({
|
const stream = await ollama.chat({
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export class OllamaPrompt extends Command {
|
|||||||
|
|
||||||
waitMessage = await bot.sendMessage({
|
waitMessage = await bot.sendMessage({
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
text: Environment.waitText,
|
text: Environment.waitThinkText,
|
||||||
reply_parameters: {
|
reply_parameters: {
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
message_id: msg.message_id
|
message_id: msg.message_id
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {Requirement} from "../base/requirement";
|
|||||||
import {Message} from "typescript-telegram-bot-api";
|
import {Message} from "typescript-telegram-bot-api";
|
||||||
import {bot, ollama} from "../index";
|
import {bot, ollama} from "../index";
|
||||||
import {WebSearchResponse} from "../model/web-search-response";
|
import {WebSearchResponse} from "../model/web-search-response";
|
||||||
import {editMessageText, logError} from "../util/utils";
|
import {oldEditMessageText, logError} from "../util/utils";
|
||||||
import {Environment} from "../common/environment";
|
import {Environment} from "../common/environment";
|
||||||
|
|
||||||
export class OllamaSearch extends Command {
|
export class OllamaSearch extends Command {
|
||||||
@@ -23,7 +23,7 @@ export class OllamaSearch extends Command {
|
|||||||
try {
|
try {
|
||||||
const wait = await bot.sendMessage({
|
const wait = await bot.sendMessage({
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
text: Environment.waitText,
|
text: Environment.waitThinkText,
|
||||||
reply_parameters: {
|
reply_parameters: {
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
message_id: msg.message_id
|
message_id: msg.message_id
|
||||||
@@ -40,7 +40,7 @@ export class OllamaSearch extends Command {
|
|||||||
message += `${index + 1}. ${r.url}\n`;
|
message += `${index + 1}. ${r.url}\n`;
|
||||||
});
|
});
|
||||||
|
|
||||||
await editMessageText(chatId, wait.message_id, message);
|
await oldEditMessageText(chatId, wait.message_id, message);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logError(error);
|
logError(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export class OpenAIChat extends ChatCommand {
|
|||||||
try {
|
try {
|
||||||
waitMessage = await bot.sendMessage({
|
waitMessage = await bot.sendMessage({
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
text: Environment.waitText,
|
text: Environment.waitThinkText,
|
||||||
reply_parameters: {
|
reply_parameters: {
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
message_id: msg.message_id
|
message_id: msg.message_id
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {Requirement} from "../base/requirement";
|
|||||||
import {bot, openAi, photoGenDir} from "../index";
|
import {bot, openAi, photoGenDir} from "../index";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import {editMessageText, logError, replyToMessage} from "../util/utils";
|
import {oldEditMessageText, logError, replyToMessage} from "../util/utils";
|
||||||
import {Environment} from "../common/environment";
|
import {Environment} from "../common/environment";
|
||||||
import {APIError} from "openai";
|
import {APIError} from "openai";
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ export class OpenAIGenImage extends ChatCommand {
|
|||||||
const text = "❌ Мне запрещено такое генерировать 😠";
|
const text = "❌ Мне запрещено такое генерировать 😠";
|
||||||
|
|
||||||
if (waitMessage) {
|
if (waitMessage) {
|
||||||
await editMessageText(msg.chat.id, waitMessage.message_id, text).catch(logError);
|
await oldEditMessageText(msg.chat.id, waitMessage.message_id, text).catch(logError);
|
||||||
} else {
|
} else {
|
||||||
await replyToMessage({message: msg, text: text}).catch(logError);
|
await replyToMessage({message: msg, text: text}).catch(logError);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import {Command} from "../base/command";
|
import {Command} from "../base/command";
|
||||||
import {Message} from "typescript-telegram-bot-api";
|
import {Message} from "typescript-telegram-bot-api";
|
||||||
import {logError, replyToMessage} from "../util/utils";
|
import {editMessageText, logError, replyToMessage} from "../util/utils";
|
||||||
import {bot} from "../index";
|
import {bot, botUser} from "../index";
|
||||||
import {downloadVideoFromYouTube} from "../util/ytdl";
|
import {DownloadOptions, downloadVideoFromYouTube, getYouTubeVideoId} from "../util/ytdl";
|
||||||
|
import {Environment} from "../common/environment";
|
||||||
|
import {TryAgain} from "../callback_commands/try-again";
|
||||||
|
|
||||||
export class YouTubeDownload extends Command {
|
export class YouTubeDownload extends Command {
|
||||||
command = ["ytdl", "youtube"];
|
command = ["ytdl", "youtube"];
|
||||||
@@ -10,16 +12,22 @@ export class YouTubeDownload extends Command {
|
|||||||
|
|
||||||
async execute(msg: Message, match?: RegExpExecArray): Promise<void> {
|
async execute(msg: Message, match?: RegExpExecArray): Promise<void> {
|
||||||
const url = match?.[3];
|
const url = match?.[3];
|
||||||
return this.downloadYouTubeVideo(msg, url);
|
return this.downloadYouTubeVideo(msg, {url: url});
|
||||||
}
|
}
|
||||||
|
|
||||||
async downloadYouTubeVideo(msg: Message, url: string): Promise<void> {
|
async downloadYouTubeVideo(msg: Message, options: DownloadOptions): Promise<void> {
|
||||||
let waitMessage: Message | null = null;
|
// TODO: 02.03.2026, Danil Nikolaev: add check for date
|
||||||
|
let waitMessage: Message | null = (msg.from.id === botUser.id) ? msg : null;
|
||||||
|
const videoId = "videoId" in options ? options.videoId : getYouTubeVideoId(options.url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
waitMessage = await replyToMessage({message: msg, text: "⏳ Секунду..."});
|
if (!waitMessage) {
|
||||||
|
waitMessage = await replyToMessage({message: msg, text: Environment.waitText});
|
||||||
|
} else {
|
||||||
|
await editMessageText({message: msg, text: Environment.waitText});
|
||||||
|
}
|
||||||
|
|
||||||
const {time, exists, buffer} = await downloadVideoFromYouTube(url);
|
const {time, exists, buffer} = await downloadVideoFromYouTube({videoId: videoId});
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
waitMessage = await bot.editMessageMedia({
|
waitMessage = await bot.editMessageMedia({
|
||||||
@@ -35,7 +43,7 @@ export class YouTubeDownload extends Command {
|
|||||||
waitMessage = await bot.editMessageCaption({
|
waitMessage = await bot.editMessageCaption({
|
||||||
chat_id: msg.chat.id,
|
chat_id: msg.chat.id,
|
||||||
message_id: waitMessage.message_id,
|
message_id: waitMessage.message_id,
|
||||||
caption: `✅ [Видео](${url})` + (exists ? " загружено из кэша" : " успешно скачано") + " за " + (time + diff) + "мс",
|
caption: "✅ [Видео]" + (exists ? " загружено из кэша" : " успешно скачано") + " за " + (time + diff) + "мс",
|
||||||
parse_mode: "MarkdownV2"
|
parse_mode: "MarkdownV2"
|
||||||
}) as Message;
|
}) as Message;
|
||||||
}
|
}
|
||||||
@@ -46,7 +54,12 @@ export class YouTubeDownload extends Command {
|
|||||||
await bot.editMessageText({
|
await bot.editMessageText({
|
||||||
chat_id: msg.chat.id,
|
chat_id: msg.chat.id,
|
||||||
message_id: waitMessage.message_id,
|
message_id: waitMessage.message_id,
|
||||||
text: `⚠️ Произошла ошибка.\n${e}`,
|
text: Environment.errorText,
|
||||||
|
reply_markup: {
|
||||||
|
inline_keyboard: [[
|
||||||
|
TryAgain.withData("/ytdl " + videoId).asButton()
|
||||||
|
]]
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ export class Environment {
|
|||||||
|
|
||||||
static MAX_PHOTO_SIZE: number;
|
static MAX_PHOTO_SIZE: number;
|
||||||
|
|
||||||
|
static PROCESS_LINKS: boolean;
|
||||||
|
|
||||||
static DEFAULT_AI_PROVIDER: AiProvider;
|
static DEFAULT_AI_PROVIDER: AiProvider;
|
||||||
|
|
||||||
static SYSTEM_PROMPT?: string;
|
static SYSTEM_PROMPT?: string;
|
||||||
@@ -49,7 +51,9 @@ export class Environment {
|
|||||||
static OPENAI_MODEL: string;
|
static OPENAI_MODEL: string;
|
||||||
static OPENAI_IMAGE_MODEL: string;
|
static OPENAI_IMAGE_MODEL: string;
|
||||||
|
|
||||||
static waitText = "⏳ Дайте-ка подумать...";
|
static errorText = "⚠️ Произошла ошибка.";
|
||||||
|
static waitText = "⏳ Секунду...";
|
||||||
|
static waitThinkText = "⏳ Дайте-ка подумать...";
|
||||||
static analyzingPictureText = "🔍 Внимательно изучаю изображение...";
|
static analyzingPictureText = "🔍 Внимательно изучаю изображение...";
|
||||||
static analyzingPicturesText = "🔍 Внимательно изучаю изображения...";
|
static analyzingPicturesText = "🔍 Внимательно изучаю изображения...";
|
||||||
static genImageText = "👨🎨 Генерирую изображение...";
|
static genImageText = "👨🎨 Генерирую изображение...";
|
||||||
@@ -73,6 +77,8 @@ export class Environment {
|
|||||||
|
|
||||||
Environment.MAX_PHOTO_SIZE = Number(process.env.MAX_PHOTO_SIZE || "1280");
|
Environment.MAX_PHOTO_SIZE = Number(process.env.MAX_PHOTO_SIZE || "1280");
|
||||||
|
|
||||||
|
Environment.PROCESS_LINKS = ifTrue(process.env.PROCESS_LINKS);
|
||||||
|
|
||||||
const aiProvider = process.env.DEFAULT_AI_PROVIDER || "OLLAMA";
|
const aiProvider = process.env.DEFAULT_AI_PROVIDER || "OLLAMA";
|
||||||
if (Object.values(AiProvider).includes(aiProvider as AiProvider)) {
|
if (Object.values(AiProvider).includes(aiProvider as AiProvider)) {
|
||||||
Environment.DEFAULT_AI_PROVIDER = aiProvider as AiProvider;
|
Environment.DEFAULT_AI_PROVIDER = aiProvider as AiProvider;
|
||||||
|
|||||||
+5
-1
@@ -79,6 +79,8 @@ import {OpenAISetModel} from "./commands/openai-set-model";
|
|||||||
import {Info} from "./commands/info";
|
import {Info} from "./commands/info";
|
||||||
import {OpenAIGenImage} from "./commands/openai-gen-image";
|
import {OpenAIGenImage} from "./commands/openai-gen-image";
|
||||||
import {clearUpFolderFromOldFiles} from "./util/files";
|
import {clearUpFolderFromOldFiles} from "./util/files";
|
||||||
|
import {DownloadYtVideo} from "./callback_commands/download-yt-video";
|
||||||
|
import {YtInfo} from "./callback_commands/yt-info";
|
||||||
|
|
||||||
process.setUncaughtExceptionCaptureCallback(logError);
|
process.setUncaughtExceptionCaptureCallback(logError);
|
||||||
|
|
||||||
@@ -171,7 +173,9 @@ if (Environment.ENABLE_UNSAFE_EVAL) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const callbackCommands: CallbackCommand[] = [
|
export const callbackCommands: CallbackCommand[] = [
|
||||||
new OllamaCancel()
|
new OllamaCancel(),
|
||||||
|
new DownloadYtVideo(),
|
||||||
|
new YtInfo()
|
||||||
];
|
];
|
||||||
|
|
||||||
if (Environment.OLLAMA_ADDRESS && Environment.OLLAMA_MODEL && Environment.SYSTEM_PROMPT) {
|
if (Environment.OLLAMA_ADDRESS && Environment.OLLAMA_MODEL && Environment.SYSTEM_PROMPT) {
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import {InlineKeyboardMarkup, Message, ParseMode} from "typescript-telegram-bot-api";
|
||||||
|
import {LinkPreviewOptions, MessageEntity} from "typescript-telegram-bot-api/dist/types";
|
||||||
|
|
||||||
|
export type EditOptions = ({
|
||||||
|
message: Message
|
||||||
|
} | {
|
||||||
|
chat_id: number;
|
||||||
|
message_id: number;
|
||||||
|
}) & {
|
||||||
|
text: string;
|
||||||
|
parse_mode?: ParseMode;
|
||||||
|
entities?: MessageEntity[];
|
||||||
|
link_preview_options?: LinkPreviewOptions;
|
||||||
|
reply_markup?: InlineKeyboardMarkup;
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
import {InlineKeyboardMarkup, Message, ParseMode} from "typescript-telegram-bot-api";
|
||||||
|
import {
|
||||||
|
ForceReply,
|
||||||
|
LinkPreviewOptions,
|
||||||
|
MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove,
|
||||||
|
ReplyParameters,
|
||||||
|
SuggestedPostParameters
|
||||||
|
} from "typescript-telegram-bot-api/dist/types";
|
||||||
|
|
||||||
|
export type SendOptions = ({
|
||||||
|
message: Message
|
||||||
|
} | {
|
||||||
|
/**
|
||||||
|
* Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||||
|
*/
|
||||||
|
chat_id: number | string;
|
||||||
|
message_id?: number;
|
||||||
|
}) & {
|
||||||
|
/**
|
||||||
|
* Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
||||||
|
*/
|
||||||
|
message_thread_id?: number;
|
||||||
|
/**
|
||||||
|
* Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a
|
||||||
|
* direct messages chat
|
||||||
|
*/
|
||||||
|
direct_messages_topic_id?: number;
|
||||||
|
/**
|
||||||
|
* Text of the message to be sent, 1-4096 characters after entities parsing
|
||||||
|
*/
|
||||||
|
text: string;
|
||||||
|
/**
|
||||||
|
* Mode for parsing entities in the message text. See formatting options for more details.
|
||||||
|
*/
|
||||||
|
parse_mode?: ParseMode;
|
||||||
|
/**
|
||||||
|
* A JSON-serialized list of special entities that appear in message text, which can be specified instead of
|
||||||
|
* parse_mode
|
||||||
|
*/
|
||||||
|
entities?: MessageEntity[];
|
||||||
|
/**
|
||||||
|
* Link preview generation options for the message
|
||||||
|
*/
|
||||||
|
link_preview_options?: LinkPreviewOptions;
|
||||||
|
/**
|
||||||
|
* Sends the message silently. Users will receive a notification with no sound.
|
||||||
|
*/
|
||||||
|
disable_notification?: boolean;
|
||||||
|
/**
|
||||||
|
* Protects the contents of the sent message from forwarding and saving
|
||||||
|
*/
|
||||||
|
protect_content?: boolean;
|
||||||
|
/**
|
||||||
|
* Pass True to allow up to 1000 messages per second, ignoring
|
||||||
|
* [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once)
|
||||||
|
* for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||||
|
*/
|
||||||
|
allow_paid_broadcast?: boolean;
|
||||||
|
/**
|
||||||
|
* Unique identifier of the message effect to be added to the message; for private chats only
|
||||||
|
*/
|
||||||
|
message_effect_id?: string;
|
||||||
|
/**
|
||||||
|
* A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
|
||||||
|
* If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
|
||||||
|
*/
|
||||||
|
suggested_post_parameters?: SuggestedPostParameters;
|
||||||
|
/**
|
||||||
|
* Description of the message to reply to
|
||||||
|
*/
|
||||||
|
reply_parameters?: ReplyParameters;
|
||||||
|
/**
|
||||||
|
* Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard,
|
||||||
|
* instructions to remove a reply keyboard or to force a reply from the user
|
||||||
|
*/
|
||||||
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
||||||
|
};
|
||||||
+171
-82
@@ -11,6 +11,7 @@ import {
|
|||||||
Message,
|
Message,
|
||||||
ParseMode,
|
ParseMode,
|
||||||
PhotoSize,
|
PhotoSize,
|
||||||
|
TelegramBot,
|
||||||
User
|
User
|
||||||
} from "typescript-telegram-bot-api";
|
} from "typescript-telegram-bot-api";
|
||||||
import {Environment} from "../common/environment";
|
import {Environment} from "../common/environment";
|
||||||
@@ -30,7 +31,7 @@ import {MessageStore} from "../common/message-store";
|
|||||||
import {SystemInfo} from "../commands/system-info";
|
import {SystemInfo} from "../commands/system-info";
|
||||||
import {PrefixResponse} from "../commands/prefix-response";
|
import {PrefixResponse} from "../commands/prefix-response";
|
||||||
import {OllamaChat} from "../commands/ollama-chat";
|
import {OllamaChat} from "../commands/ollama-chat";
|
||||||
import {getYouTubeVideoId} from "./ytdl";
|
import {getYouTubeVideoId, getYouTubeVideoInfo, isVideoExists} from "./ytdl";
|
||||||
import {YouTubeDownload} from "../commands/youtube-download";
|
import {YouTubeDownload} from "../commands/youtube-download";
|
||||||
import {ChatCommand} from "../base/chat-command";
|
import {ChatCommand} from "../base/chat-command";
|
||||||
import {WebSearchResponse} from "../model/web-search-response";
|
import {WebSearchResponse} from "../model/web-search-response";
|
||||||
@@ -43,6 +44,11 @@ import {OllamaGetModel} from "../commands/ollama-get-model";
|
|||||||
import {GeminiGetModel} from "../commands/gemini-get-model";
|
import {GeminiGetModel} from "../commands/gemini-get-model";
|
||||||
import {MistralGetModel} from "../commands/mistral-get-model";
|
import {MistralGetModel} from "../commands/mistral-get-model";
|
||||||
import {OpenAIGetModel} from "../commands/openai-get-model";
|
import {OpenAIGetModel} from "../commands/openai-get-model";
|
||||||
|
import {SendOptions} from "../model/send-options";
|
||||||
|
import {EditOptions} from "../model/edit-options";
|
||||||
|
import VideoInfo from "youtubei.js/dist/src/parser/youtube/VideoInfo";
|
||||||
|
import {DownloadYtVideo} from "../callback_commands/download-yt-video";
|
||||||
|
import {TryAgain} from "../callback_commands/try-again";
|
||||||
|
|
||||||
export const ignore = () => {
|
export const ignore = () => {
|
||||||
};
|
};
|
||||||
@@ -54,7 +60,7 @@ export const ignoreIfNotChanged = (e: Error | TelegramError) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ignoreIfMarkupFailed = (e: Error | TelegramError) => {
|
export const ignoreIfMarkupFailed = (e: Error | TelegramError) => {
|
||||||
if (!(e instanceof TelegramError && e?.response?.description?.startsWith("Bad Request: can't parse entities"))) {
|
if (!isMarkupFailed(e)) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -67,6 +73,18 @@ export const errorPlaceholder = async (msg: Message) => {
|
|||||||
await sendErrorPlaceholder(msg).catch(logError);
|
await sendErrorPlaceholder(msg).catch(logError);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isMarkupFailed = (e: Error | TelegramError) => {
|
||||||
|
return TelegramBot.isTelegramError(e) && e?.response?.description?.startsWith("Bad Request: can't parse entities");
|
||||||
|
};
|
||||||
|
|
||||||
|
export const isTooManyRequests = (e: Error | TelegramError) => {
|
||||||
|
return TelegramBot.isTelegramError(e) && e.response.description.includes("Too Many Requests");
|
||||||
|
};
|
||||||
|
|
||||||
|
export const isMessageTooLong = (e: Error | TelegramError) => {
|
||||||
|
return TelegramBot.isTelegramError(e) && e.response.description.includes("MESSAGE_TOO_LONG");
|
||||||
|
};
|
||||||
|
|
||||||
export function searchChatCommand(
|
export function searchChatCommand(
|
||||||
commands: Command[],
|
commands: Command[],
|
||||||
text: string,
|
text: string,
|
||||||
@@ -117,7 +135,7 @@ export async function checkRequirements(cmd: Command | CallbackCommand | null, m
|
|||||||
|
|
||||||
const cbId = cb?.id;
|
const cbId = cb?.id;
|
||||||
const chatId = msg?.chat?.id || cb?.message?.chat?.id || -1;
|
const chatId = msg?.chat?.id || cb?.message?.chat?.id || -1;
|
||||||
const messageId = msg?.message_id || cb?.message?.message_id || -1;
|
const messageId = msg?.message_id || (cb && cb.message && "reply_to_message" in cb.message ? cb.message.reply_to_message.message_id : null) || -1;
|
||||||
const fromId = msg?.from?.id || cb?.from?.id || -1;
|
const fromId = msg?.from?.id || cb?.from?.id || -1;
|
||||||
const chatType = msg?.chat?.type || cb?.message?.chat?.type || null;
|
const chatType = msg?.chat?.type || cb?.message?.chat?.type || null;
|
||||||
|
|
||||||
@@ -196,11 +214,8 @@ export async function checkRequirements(cmd: Command | CallbackCommand | null, m
|
|||||||
if (reqs.isRequiresSameUser()) {
|
if (reqs.isRequiresSameUser()) {
|
||||||
let originalFromId: number | null;
|
let originalFromId: number | null;
|
||||||
try {
|
try {
|
||||||
const queryMessage = await MessageStore.get(chatId, messageId);
|
const originalMessage = await MessageStore.get(chatId, messageId);
|
||||||
if (queryMessage && queryMessage.replyToMessageId) {
|
originalFromId = originalMessage?.fromId;
|
||||||
const originalMessage = await MessageStore.get(chatId, queryMessage.replyToMessageId);
|
|
||||||
originalFromId = originalMessage?.fromId;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e);
|
logError(e);
|
||||||
originalFromId = null;
|
originalFromId = null;
|
||||||
@@ -239,92 +254,87 @@ export async function findAndExecuteCallbackCommand(commands: CallbackCommand[],
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function editMessageText(chatId: number, messageId: number, messageText: string, parseMode?: ParseMode, replyMarkup?: InlineKeyboardMarkup): Promise<void> {
|
export async function oldEditMessageText(chatId: number, messageId: number, messageText: string, parseMode?: ParseMode, replyMarkup?: InlineKeyboardMarkup): Promise<boolean | Message> {
|
||||||
if (messageText.trim().length === 0) return Promise.resolve();
|
return editMessageText({
|
||||||
|
chat_id: chatId,
|
||||||
|
message_id: messageId,
|
||||||
|
text: messageText,
|
||||||
|
parse_mode: parseMode,
|
||||||
|
reply_markup: replyMarkup,
|
||||||
|
link_preview_options: {is_disabled: true}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function editMessageText(options: EditOptions) {
|
||||||
|
if (options.text.trim().length === 0) return Promise.resolve(false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await bot.editMessageText({
|
const message = await bot.editMessageText({
|
||||||
chat_id: chatId,
|
chat_id: "message" in options ? options.message.chat.id : options.chat_id,
|
||||||
message_id: messageId,
|
message_id: "message" in options ? options.message.message_id : options.message_id,
|
||||||
text: messageText,
|
text: options.text,
|
||||||
parse_mode: parseMode,
|
parse_mode: options.parse_mode,
|
||||||
link_preview_options: {
|
reply_markup: options.reply_markup,
|
||||||
is_disabled: true
|
link_preview_options: options.link_preview_options,
|
||||||
},
|
});
|
||||||
reply_markup: replyMarkup
|
return Promise.resolve(message);
|
||||||
}).catch(ignoreIfMarkupFailed);
|
|
||||||
return Promise.resolve();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e);
|
logError(e);
|
||||||
|
|
||||||
if (e instanceof TelegramError && e.response.description.includes("Too Many Requests")) {
|
if (isMarkupFailed(e)) {
|
||||||
|
return Promise.resolve(true);
|
||||||
|
} else if (isTooManyRequests(e)) {
|
||||||
const delay = Number(e.message.split("retry after ")[1]) || 30;
|
const delay = Number(e.message.split("retry after ")[1]) || 30;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}, delay * 1000);
|
}, delay * 1000);
|
||||||
} else if (e instanceof TelegramError && e.response.description.includes("MESSAGE_TOO_LONG")) {
|
|
||||||
return Promise.reject(e);
|
|
||||||
} else {
|
} else {
|
||||||
return Promise.resolve();
|
return Promise.reject(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SendOptions = {
|
|
||||||
chat_id?: number;
|
|
||||||
message?: Message,
|
|
||||||
message_id?: number;
|
|
||||||
text: string,
|
|
||||||
parse_mode?: ParseMode,
|
|
||||||
disableLinkPreview?: boolean
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function oldSendMessage(message: Message, text: string, parseMode?: ParseMode): Promise<Message> {
|
export async function oldSendMessage(message: Message, text: string, parseMode?: ParseMode): Promise<Message> {
|
||||||
const response = await bot.sendMessage({
|
return sendMessage({
|
||||||
chat_id: message.chat.id,
|
message: message,
|
||||||
text: text,
|
text: text,
|
||||||
parse_mode: parseMode
|
parse_mode: parseMode
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.resolve(response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function sendMessage(options: SendOptions): Promise<Message> {
|
export async function sendMessage(options: SendOptions): Promise<Message> {
|
||||||
const response = await bot.sendMessage({
|
const response = await bot.sendMessage({
|
||||||
chat_id: options.chat_id ?? options.message?.chat?.id,
|
chat_id: "message" in options ? options.message.chat.id : options.chat_id,
|
||||||
text: options.text,
|
text: options.text,
|
||||||
parse_mode: options.parse_mode,
|
parse_mode: options.parse_mode,
|
||||||
link_preview_options: {
|
link_preview_options: options.link_preview_options,
|
||||||
is_disabled: options.disableLinkPreview
|
reply_markup: options.reply_markup,
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.resolve(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function replyToMessage(options: SendOptions): Promise<Message> {
|
|
||||||
const response = await bot.sendMessage({
|
|
||||||
chat_id: options.chat_id ?? options.message?.chat?.id,
|
|
||||||
text: options.text,
|
|
||||||
parse_mode: options.parse_mode,
|
|
||||||
reply_parameters: {
|
|
||||||
message_id: options.message_id || options.message?.message_id
|
|
||||||
},
|
|
||||||
link_preview_options: {
|
|
||||||
is_disabled: options.disableLinkPreview
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.resolve(response);
|
return Promise.resolve(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function oldReplyToMessage(message: Message, text: string, parseMode?: ParseMode): Promise<Message> {
|
export async function oldReplyToMessage(message: Message, text: string, parseMode?: ParseMode): Promise<Message> {
|
||||||
const response = await bot.sendMessage({
|
return replyToMessage({
|
||||||
chat_id: message.chat.id,
|
message: message,
|
||||||
text: text,
|
text: text,
|
||||||
|
parse_mode: parseMode
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function replyToMessage(options: SendOptions): Promise<Message> {
|
||||||
|
if (!("message" in options) && !options.message_id) {
|
||||||
|
return Promise.reject("for reply there must be message or message_id");
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await bot.sendMessage({
|
||||||
|
chat_id: "message" in options ? options.message.chat.id : options.chat_id,
|
||||||
|
text: options.text,
|
||||||
|
parse_mode: options.parse_mode,
|
||||||
reply_parameters: {
|
reply_parameters: {
|
||||||
message_id: message.message_id
|
message_id: "message" in options ? options.message.message_id : options.message_id
|
||||||
},
|
},
|
||||||
parse_mode: parseMode,
|
link_preview_options: options.link_preview_options
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.resolve(response);
|
return Promise.resolve(response);
|
||||||
@@ -1200,27 +1210,8 @@ export async function processNewMessage(msg: Message): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const textToCheck = startsWithPrefix ? messageWithoutPrefix : cmdText;
|
const textToCheck = startsWithPrefix ? messageWithoutPrefix : cmdText;
|
||||||
if (msg.entities) {
|
|
||||||
const urlEntities = msg.entities.filter(e => e.type === "url");
|
|
||||||
if (urlEntities.length) {
|
|
||||||
for (const e of urlEntities) {
|
|
||||||
const url = msg.text.substring(e.offset, e.offset + e.length);
|
|
||||||
// TODO: 31/01/2026, Danil Nikolaev: implement proper checking
|
|
||||||
try {
|
|
||||||
getYouTubeVideoId(url);
|
|
||||||
|
|
||||||
const yt = commands.find(e => e instanceof YouTubeDownload);
|
|
||||||
if (await checkRequirements(yt, msg)) {
|
|
||||||
await yt.downloadYouTubeVideo(msg, url);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} catch (e) {
|
|
||||||
logError(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (Environment.PROCESS_LINKS && await processYouTubeLink(msg, getFirstLink(msg))) return;
|
||||||
if (!startsWithPrefix && msg.chat.type !== "private") return;
|
if (!startsWithPrefix && msg.chat.type !== "private") return;
|
||||||
if (msg.chat.type === "private" && !Environment.ADMIN_IDS.has(msg.chat.id)) return;
|
if (msg.chat.type === "private" && !Environment.ADMIN_IDS.has(msg.chat.id)) return;
|
||||||
|
|
||||||
@@ -1244,6 +1235,104 @@ export async function processNewMessage(msg: Message): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFirstLink(msg: Message): string | null {
|
||||||
|
if (msg.entities) {
|
||||||
|
const urlEntities = msg.entities.filter(e => e.type === "url");
|
||||||
|
if (urlEntities.length) {
|
||||||
|
const e = urlEntities[0];
|
||||||
|
return msg.text.substring(e.offset, e.offset + e.length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function processYouTubeLink(msg: Message, url: string): Promise<boolean> {
|
||||||
|
if (!url) return false;
|
||||||
|
try {
|
||||||
|
const videoId = getYouTubeVideoId(url);
|
||||||
|
const yt = commands.find(e => e instanceof YouTubeDownload);
|
||||||
|
|
||||||
|
if (await checkRequirements(yt, msg)) {
|
||||||
|
const waitMessage = msg.from.id === botUser.id ? msg : await replyToMessage({
|
||||||
|
message: msg,
|
||||||
|
text: "⏳ Ищу информацию о видео..."
|
||||||
|
});
|
||||||
|
|
||||||
|
if (msg.from.id === botUser.id) {
|
||||||
|
await editMessageText({message: msg, text: "⏳ Ищу информацию о видео..."});
|
||||||
|
}
|
||||||
|
|
||||||
|
let videoInfo: VideoInfo | null = null;
|
||||||
|
let ytError: string = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
videoInfo = await getYouTubeVideoInfo(videoId);
|
||||||
|
} catch (e) {
|
||||||
|
logError(e);
|
||||||
|
|
||||||
|
if ("version" in e) {
|
||||||
|
ytError = e.message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("VIDEO_INFO", videoInfo);
|
||||||
|
|
||||||
|
let text: string = null;
|
||||||
|
|
||||||
|
const inCache = isVideoExists({videoId: videoId});
|
||||||
|
|
||||||
|
const duration = videoInfo?.basic_info?.duration || null;
|
||||||
|
const canDownload = inCache || duration && duration <= 300;
|
||||||
|
|
||||||
|
if (videoInfo) {
|
||||||
|
text = "Видео с YouTube\n\n" +
|
||||||
|
`Название: ${videoInfo.basic_info?.title}\n` +
|
||||||
|
`Автор: ${videoInfo.secondary_info?.owner?.author?.name}\n` +
|
||||||
|
`Длительность: ${duration} сек.`;
|
||||||
|
|
||||||
|
if (!canDownload) {
|
||||||
|
text += `\n\nВидео слишком длинное (${duration} сек. > 300 сек.)`;
|
||||||
|
}
|
||||||
|
} else if (!ytError) {
|
||||||
|
text = "Информация о видео не найдена";
|
||||||
|
}
|
||||||
|
|
||||||
|
const errorButInCache = !videoInfo && ytError && inCache;
|
||||||
|
if (errorButInCache) {
|
||||||
|
text = "Я не смогу получить информацию о видео, но нашёл его в кэше.";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!text && ytError) {
|
||||||
|
await editMessageText({
|
||||||
|
message: waitMessage,
|
||||||
|
text: Environment.errorText,
|
||||||
|
reply_markup: {
|
||||||
|
inline_keyboard: [[
|
||||||
|
TryAgain.withData("/ytinfo " + url).asButton()
|
||||||
|
]]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await editMessageText({
|
||||||
|
message: waitMessage,
|
||||||
|
text: text,
|
||||||
|
reply_markup: canDownload ? {
|
||||||
|
inline_keyboard: [[
|
||||||
|
DownloadYtVideo.withData(inCache, "/ytdl " + videoId).asButton()
|
||||||
|
]]
|
||||||
|
} : {inline_keyboard: []}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
logError(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
export async function processEditedMessage(msg: Message): Promise<void> {
|
export async function processEditedMessage(msg: Message): Promise<void> {
|
||||||
console.log("Edited Message", msg);
|
console.log("Edited Message", msg);
|
||||||
|
|
||||||
|
|||||||
+48
-7
@@ -6,6 +6,21 @@ import Innertube, {Platform, Types} from "youtubei.js";
|
|||||||
import {Readable} from "node:stream";
|
import {Readable} from "node:stream";
|
||||||
import {logError} from "./utils";
|
import {logError} from "./utils";
|
||||||
import {performFFmpeg} from "./ffmpeg";
|
import {performFFmpeg} from "./ffmpeg";
|
||||||
|
import VideoInfo from "youtubei.js/dist/src/parser/youtube/VideoInfo";
|
||||||
|
|
||||||
|
let innertube: Innertube | null = null;
|
||||||
|
|
||||||
|
export async function getYT(): Promise<Innertube> {
|
||||||
|
if (innertube) {
|
||||||
|
return innertube;
|
||||||
|
} else {
|
||||||
|
innertube = await Innertube.create({
|
||||||
|
generate_session_locally: true,
|
||||||
|
retrieve_player: true
|
||||||
|
});
|
||||||
|
return innertube;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getYouTubeVideoId(url: string): string {
|
export function getYouTubeVideoId(url: string): string {
|
||||||
const regex = /(?:(?:youtube\.com|music\.youtube\.com)\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?|shorts|clip)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/i;
|
const regex = /(?:(?:youtube\.com|music\.youtube\.com)\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?|shorts|clip)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/i;
|
||||||
@@ -14,7 +29,34 @@ export function getYouTubeVideoId(url: string): string {
|
|||||||
return match[1];
|
return match[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function downloadVideoFromYouTube(url: string): Promise<{
|
export async function getYouTubeVideoInfo(videoId: string): Promise<VideoInfo> {
|
||||||
|
try {
|
||||||
|
return (await getYT()).getInfo(videoId, {client: "ANDROID"});
|
||||||
|
} catch (e) {
|
||||||
|
logError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isVideoExists(options: DownloadOptions): boolean {
|
||||||
|
const videoId = "videoId" in options ? options.videoId : getYouTubeVideoId(options.url);
|
||||||
|
const filePath = path.join(videoDir, `${videoId}.mp4`);
|
||||||
|
return fs.existsSync(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getVideoFromCache(videoId: string): Buffer | null {
|
||||||
|
if (!isVideoExists({videoId: videoId})) return null;
|
||||||
|
|
||||||
|
const filePath = path.join(videoDir, `${videoId}.mp4`);
|
||||||
|
return Buffer.from(fs.readFileSync(filePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DownloadOptions = {
|
||||||
|
url: string
|
||||||
|
} | {
|
||||||
|
videoId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function downloadVideoFromYouTube(options: DownloadOptions): Promise<{
|
||||||
time: number,
|
time: number,
|
||||||
exists?: boolean,
|
exists?: boolean,
|
||||||
buffer: Buffer | null
|
buffer: Buffer | null
|
||||||
@@ -23,7 +65,7 @@ export async function downloadVideoFromYouTube(url: string): Promise<{
|
|||||||
let buffer: Buffer | null = null;
|
let buffer: Buffer | null = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const videoId = getYouTubeVideoId(url);
|
const videoId = "videoId" in options ? options.videoId : getYouTubeVideoId(options.url);
|
||||||
const filePath = path.join(videoDir, `${videoId}.mp4`);
|
const filePath = path.join(videoDir, `${videoId}.mp4`);
|
||||||
if (fs.existsSync(filePath)) {
|
if (fs.existsSync(filePath)) {
|
||||||
const buffer = Buffer.from(fs.readFileSync(filePath));
|
const buffer = Buffer.from(fs.readFileSync(filePath));
|
||||||
@@ -42,12 +84,11 @@ export async function downloadVideoFromYouTube(url: string): Promise<{
|
|||||||
const code = `${data.output}\nreturn { ${properties.join(", ")} }`;
|
const code = `${data.output}\nreturn { ${properties.join(", ")} }`;
|
||||||
return new Function(code)();
|
return new Function(code)();
|
||||||
};
|
};
|
||||||
const yt = await Innertube.create({
|
|
||||||
generate_session_locally: true,
|
const yt = await getYT();
|
||||||
retrieve_player: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const videoInfo = await yt.getInfo(videoId, {client: "ANDROID"});
|
const videoInfo = await yt.getInfo(videoId, {client: "ANDROID"});
|
||||||
|
console.log("Video info", videoInfo);
|
||||||
|
|
||||||
console.log(`Fetching metadata for: ${videoId}...`);
|
console.log(`Fetching metadata for: ${videoId}...`);
|
||||||
|
|
||||||
@@ -119,7 +160,7 @@ export async function downloadVideoFromYouTube(url: string): Promise<{
|
|||||||
|
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
const diff = end - start;
|
const diff = end - start;
|
||||||
console.log(`Video downloaded. URL: ${url}\ntook ${diff}ms`);
|
console.log(`Video downloaded.\ntook ${diff}ms`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
time: diff,
|
time: diff,
|
||||||
|
|||||||
Reference in New Issue
Block a user