mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
Add gpt 4o mini (#486)
This commit is contained in:
parent
283ff122c2
commit
bff586f784
10 changed files with 294 additions and 326 deletions
24
.github/workflows/node.js.yml
vendored
24
.github/workflows/node.js.yml
vendored
|
|
@ -5,13 +5,12 @@ name: Node.js CI
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
branches: ["master"]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
branches: ["master"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
|
|
@ -20,12 +19,13 @@ jobs:
|
|||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm'
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "npm"
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ If you enjoy Copilot for Obsidian, please consider [sponsoring this project](htt
|
|||
|
||||
<a href="https://www.buymeacoffee.com/logancyang" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 40px !important;width: 150px !important;" ></a>
|
||||
|
||||
SPECIAL THANKS TO OUR SPONSORS:
|
||||
@Arlorean, @dashinja, @emaynard, @scmarinelli, @borthwick
|
||||
|
||||
#### 🎉 HIGHLY ANTICIPATED v2.5.0: Vault QA (BETA) mode (with local embedding support)! Claude 3! 🎉🎉🎉
|
||||
|
||||
<a href="https://youtu.be/NSoKRYNlOls" target="_blank"><img src="./images/thumbnail-vault-qa.png" width="700" /></a>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// __mocks__/obsidian.js
|
||||
/* eslint-disable no-undef */
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
393
package-lock.json
generated
393
package-lock.json
generated
|
|
@ -52,9 +52,11 @@
|
|||
"builtin-modules": "3.3.0",
|
||||
"electron": "^27.3.2",
|
||||
"esbuild": "0.17.3",
|
||||
"eslint": "^8.57.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"obsidian": "latest",
|
||||
"prettier": "^3.3.3",
|
||||
"ts-jest": "^29.1.0",
|
||||
"tslib": "2.4.0",
|
||||
"typescript": "4.7.4",
|
||||
|
|
@ -1179,7 +1181,6 @@
|
|||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
||||
"integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
},
|
||||
|
|
@ -1191,25 +1192,23 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@eslint-community/regexpp": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.0.tgz",
|
||||
"integrity": "sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==",
|
||||
"version": "4.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz",
|
||||
"integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz",
|
||||
"integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==",
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
|
||||
"integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"debug": "^4.3.2",
|
||||
"espree": "^9.5.1",
|
||||
"espree": "^9.6.0",
|
||||
"globals": "^13.19.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
|
|
@ -1225,11 +1224,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "8.38.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz",
|
||||
"integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g==",
|
||||
"version": "8.57.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
|
||||
"integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
|
|
@ -1251,14 +1249,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.8",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
|
||||
"integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==",
|
||||
"version": "0.11.14",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
||||
"integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
|
||||
"deprecated": "Use @eslint/config-array instead",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@humanwhocodes/object-schema": "^1.2.1",
|
||||
"debug": "^4.1.1",
|
||||
"@humanwhocodes/object-schema": "^2.0.2",
|
||||
"debug": "^4.3.1",
|
||||
"minimatch": "^3.0.5"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -1270,7 +1268,6 @@
|
|||
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
||||
"integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12.22"
|
||||
},
|
||||
|
|
@ -1280,11 +1277,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/object-schema": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
|
||||
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
|
||||
"deprecated": "Use @eslint/object-schema instead",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@istanbuljs/load-nyc-config": {
|
||||
"version": "1.1.0",
|
||||
|
|
@ -2388,15 +2385,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/env": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.4.tgz",
|
||||
"integrity": "sha512-irQnbMLbUNQpP1wcE5NstJtbuA/69kRfzBrpAD7Gsn8zm/CY6YQYc3HQBz8QPxwISG26tIm5afvvVbu508oBeQ==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.5.tgz",
|
||||
"integrity": "sha512-/zZGkrTOsraVfYjGP8uM0p6r0BDT6xWpkjdVbcz66PJVSpwXX3yNiRycxAuDfBKGWBrZBXRuK/YVlkNgxHGwmA==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@next/swc-darwin-arm64": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.4.tgz",
|
||||
"integrity": "sha512-mF05E/5uPthWzyYDyptcwHptucf/jj09i2SXBPwNzbgBNc+XnwzrL0U6BmPjQeOL+FiB+iG1gwBeq7mlDjSRPg==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.5.tgz",
|
||||
"integrity": "sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -2410,9 +2407,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-x64": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.4.tgz",
|
||||
"integrity": "sha512-IZQ3C7Bx0k2rYtrZZxKKiusMTM9WWcK5ajyhOZkYYTCc8xytmwSzR1skU7qLgVT/EY9xtXDG0WhY6fyujnI3rw==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.5.tgz",
|
||||
"integrity": "sha512-vXHOPCwfDe9qLDuq7U1OYM2wUY+KQ4Ex6ozwsKxp26BlJ6XXbHleOUldenM67JRyBfVjv371oneEvYd3H2gNSA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -2426,9 +2423,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-gnu": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.4.tgz",
|
||||
"integrity": "sha512-VwwZKrBQo/MGb1VOrxJ6LrKvbpo7UbROuyMRvQKTFKhNaXjUmKTu7wxVkIuCARAfiI8JpaWAnKR+D6tzpCcM4w==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.5.tgz",
|
||||
"integrity": "sha512-vlhB8wI+lj8q1ExFW8lbWutA4M2ZazQNvMWuEDqZcuJJc78iUnLdPPunBPX8rC4IgT6lIx/adB+Cwrl99MzNaA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -2442,9 +2439,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-musl": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.4.tgz",
|
||||
"integrity": "sha512-8QftwPEW37XxXoAwsn+nXlodKWHfpMaSvt81W43Wh8dv0gkheD+30ezWMcFGHLI71KiWmHK5PSQbTQGUiidvLQ==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.5.tgz",
|
||||
"integrity": "sha512-NpDB9NUR2t0hXzJJwQSGu1IAOYybsfeB+LxpGsXrRIb7QOrYmidJz3shzY8cM6+rO4Aojuef0N/PEaX18pi9OA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -2458,9 +2455,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-gnu": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.4.tgz",
|
||||
"integrity": "sha512-/s/Pme3VKfZAfISlYVq2hzFS8AcAIOTnoKupc/j4WlvF6GQ0VouS2Q2KEgPuO1eMBwakWPB1aYFIA4VNVh667A==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.5.tgz",
|
||||
"integrity": "sha512-8XFikMSxWleYNryWIjiCX+gU201YS+erTUidKdyOVYi5qUQo/gRxv/3N1oZFCgqpesN6FPeqGM72Zve+nReVXQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -2474,9 +2471,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-musl": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.4.tgz",
|
||||
"integrity": "sha512-m8z/6Fyal4L9Bnlxde5g2Mfa1Z7dasMQyhEhskDATpqr+Y0mjOBZcXQ7G5U+vgL22cI4T7MfvgtrM2jdopqWaw==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.5.tgz",
|
||||
"integrity": "sha512-6QLwi7RaYiQDcRDSU/os40r5o06b5ue7Jsk5JgdRBGGp8l37RZEh9JsLSM8QF0YDsgcosSeHjglgqi25+m04IQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -2490,9 +2487,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-arm64-msvc": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.4.tgz",
|
||||
"integrity": "sha512-7Wv4PRiWIAWbm5XrGz3D8HUkCVDMMz9igffZG4NB1p4u1KoItwx9qjATHz88kwCEal/HXmbShucaslXCQXUM5w==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.5.tgz",
|
||||
"integrity": "sha512-1GpG2VhbspO+aYoMOQPQiqc/tG3LzmsdBH0LhnDS3JrtDx2QmzXe0B6mSZZiN3Bq7IOMXxv1nlsjzoS1+9mzZw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -2506,9 +2503,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-ia32-msvc": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.4.tgz",
|
||||
"integrity": "sha512-zLeNEAPULsl0phfGb4kdzF/cAVIfaC7hY+kt0/d+y9mzcZHsMS3hAS829WbJ31DkSlVKQeHEjZHIdhN+Pg7Gyg==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.5.tgz",
|
||||
"integrity": "sha512-Igh9ZlxwvCDsu6438FXlQTHlRno4gFpJzqPjSIBZooD22tKeI4fE/YMRoHVJHmrQ2P5YL1DoZ0qaOKkbeFWeMg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -2522,9 +2519,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-x64-msvc": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.4.tgz",
|
||||
"integrity": "sha512-yEh2+R8qDlDCjxVpzOTEpBLQTEFAcP2A8fUFLaWNap9GitYKkKv1//y2S6XY6zsR4rCOPRpU7plYDR+az2n30A==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.5.tgz",
|
||||
"integrity": "sha512-tEQ7oinq1/CjSG9uSTerca3v4AZ+dFa+4Yu6ihaG8Ud8ddqLQgFGcnwYls13H5X5CPDPZJdYxyeMui6muOLd4g==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -2608,12 +2605,19 @@
|
|||
"@sinonjs/commons": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@swc/counter": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz",
|
||||
"integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@swc/helpers": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz",
|
||||
"integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==",
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz",
|
||||
"integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@swc/counter": "^0.1.3",
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
|
|
@ -3032,9 +3036,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
|
||||
"integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
|
||||
"version": "7.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/keygrip": {
|
||||
|
|
@ -3616,6 +3620,12 @@
|
|||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@ungap/structured-clone": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
|
||||
"integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/abab": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
|
||||
|
|
@ -3661,9 +3671,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
|
||||
"integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
|
||||
"version": "8.12.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
|
||||
"integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
|
||||
"devOptional": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
|
|
@ -3687,7 +3697,6 @@
|
|||
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
|
||||
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"peerDependencies": {
|
||||
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
}
|
||||
|
|
@ -3729,7 +3738,6 @@
|
|||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
|
|
@ -4037,12 +4045,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
|
|
@ -4243,9 +4251,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001480",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz",
|
||||
"integrity": "sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ==",
|
||||
"version": "1.0.30001643",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz",
|
||||
"integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
|
|
@ -4941,7 +4949,6 @@
|
|||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
|
||||
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
|
|
@ -5348,28 +5355,28 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.38.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.38.0.tgz",
|
||||
"integrity": "sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg==",
|
||||
"version": "8.57.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
|
||||
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.4.0",
|
||||
"@eslint/eslintrc": "^2.0.2",
|
||||
"@eslint/js": "8.38.0",
|
||||
"@humanwhocodes/config-array": "^0.11.8",
|
||||
"@eslint-community/regexpp": "^4.6.1",
|
||||
"@eslint/eslintrc": "^2.1.4",
|
||||
"@eslint/js": "8.57.0",
|
||||
"@humanwhocodes/config-array": "^0.11.14",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
"ajv": "^6.10.0",
|
||||
"@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.1.1",
|
||||
"eslint-visitor-keys": "^3.4.0",
|
||||
"espree": "^9.5.1",
|
||||
"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",
|
||||
|
|
@ -5377,22 +5384,19 @@
|
|||
"find-up": "^5.0.0",
|
||||
"glob-parent": "^6.0.2",
|
||||
"globals": "^13.19.0",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.0.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"is-glob": "^4.0.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
"js-sdsl": "^4.1.4",
|
||||
"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.1",
|
||||
"optionator": "^0.9.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"strip-json-comments": "^3.1.0",
|
||||
"text-table": "^0.2.0"
|
||||
},
|
||||
"bin": {
|
||||
|
|
@ -5446,9 +5450,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint-visitor-keys": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz",
|
||||
"integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==",
|
||||
"version": "3.4.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
|
||||
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
|
|
@ -5462,7 +5466,6 @@
|
|||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
|
|
@ -5475,11 +5478,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint/node_modules/eslint-scope": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz",
|
||||
"integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==",
|
||||
"version": "7.2.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
|
||||
"integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esrecurse": "^4.3.0",
|
||||
"estraverse": "^5.2.0"
|
||||
|
|
@ -5496,21 +5498,19 @@
|
|||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
|
||||
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "9.5.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz",
|
||||
"integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==",
|
||||
"version": "9.6.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
|
||||
"integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"acorn": "^8.8.0",
|
||||
"acorn": "^8.9.0",
|
||||
"acorn-jsx": "^5.3.2",
|
||||
"eslint-visitor-keys": "^3.4.0"
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
|
|
@ -5537,7 +5537,6 @@
|
|||
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
|
||||
"integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"estraverse": "^5.1.0"
|
||||
},
|
||||
|
|
@ -5550,7 +5549,6 @@
|
|||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
|
||||
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
|
|
@ -5712,8 +5710,7 @@
|
|||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.2.12",
|
||||
|
|
@ -5810,7 +5807,6 @@
|
|||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||
"integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"flat-cache": "^3.0.4"
|
||||
},
|
||||
|
|
@ -5819,9 +5815,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
|
|
@ -5835,7 +5831,6 @@
|
|||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
||||
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"locate-path": "^6.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
|
|
@ -5856,13 +5851,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/flat-cache": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
|
||||
"integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
|
||||
"integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"flatted": "^3.1.0",
|
||||
"flatted": "^3.2.9",
|
||||
"keyv": "^4.5.3",
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -5870,16 +5865,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/flatted": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
|
||||
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
|
||||
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.4",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
|
||||
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
|
||||
"version": "1.15.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
|
|
@ -6101,7 +6095,6 @@
|
|||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
|
||||
"integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"is-glob": "^4.0.3"
|
||||
},
|
||||
|
|
@ -6109,12 +6102,6 @@
|
|||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/glob-to-regexp": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
|
||||
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/global-agent": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz",
|
||||
|
|
@ -6134,11 +6121,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "13.20.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz",
|
||||
"integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==",
|
||||
"version": "13.24.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
|
||||
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"type-fest": "^0.20.2"
|
||||
},
|
||||
|
|
@ -6227,12 +6213,11 @@
|
|||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
||||
},
|
||||
"node_modules/grapheme-splitter": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
|
||||
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"node_modules/graphemer": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
|
||||
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/groq-sdk": {
|
||||
"version": "0.3.3",
|
||||
|
|
@ -6637,7 +6622,6 @@
|
|||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
|
||||
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"parent-module": "^1.0.0",
|
||||
"resolve-from": "^4.0.0"
|
||||
|
|
@ -6981,7 +6965,6 @@
|
|||
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
||||
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
|
|
@ -8309,17 +8292,6 @@
|
|||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz",
|
||||
"integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ=="
|
||||
},
|
||||
"node_modules/js-sdsl": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz",
|
||||
"integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/js-sdsl"
|
||||
}
|
||||
},
|
||||
"node_modules/js-tiktoken": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/js-tiktoken/-/js-tiktoken-1.0.8.tgz",
|
||||
|
|
@ -8417,15 +8389,13 @@
|
|||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/json-stable-stringify-without-jsonify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
|
||||
"integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
|
|
@ -8992,7 +8962,6 @@
|
|||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
|
||||
"integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"prelude-ls": "^1.2.1",
|
||||
"type-check": "~0.4.0"
|
||||
|
|
@ -9012,7 +8981,6 @@
|
|||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
|
||||
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"p-locate": "^5.0.0"
|
||||
},
|
||||
|
|
@ -9039,8 +9007,7 @@
|
|||
"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,
|
||||
"peer": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/loose-envify": {
|
||||
"version": "1.4.0",
|
||||
|
|
@ -9853,19 +9820,18 @@
|
|||
}
|
||||
},
|
||||
"node_modules/next": {
|
||||
"version": "14.0.4",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-14.0.4.tgz",
|
||||
"integrity": "sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==",
|
||||
"version": "14.2.5",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-14.2.5.tgz",
|
||||
"integrity": "sha512-0f8aRfBVL+mpzfBjYfQuLWh2WyAwtJXCRfkPF4UJ5qd2YwrHczsrSzXU4tRMV0OAxR8ZJZWPFn6uhSC56UTsLA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@next/env": "14.0.4",
|
||||
"@swc/helpers": "0.5.2",
|
||||
"@next/env": "14.2.5",
|
||||
"@swc/helpers": "0.5.5",
|
||||
"busboy": "1.6.0",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
"caniuse-lite": "^1.0.30001579",
|
||||
"graceful-fs": "^4.2.11",
|
||||
"postcss": "8.4.31",
|
||||
"styled-jsx": "5.1.1",
|
||||
"watchpack": "2.4.0"
|
||||
"styled-jsx": "5.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"next": "dist/bin/next"
|
||||
|
|
@ -9874,18 +9840,19 @@
|
|||
"node": ">=18.17.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@next/swc-darwin-arm64": "14.0.4",
|
||||
"@next/swc-darwin-x64": "14.0.4",
|
||||
"@next/swc-linux-arm64-gnu": "14.0.4",
|
||||
"@next/swc-linux-arm64-musl": "14.0.4",
|
||||
"@next/swc-linux-x64-gnu": "14.0.4",
|
||||
"@next/swc-linux-x64-musl": "14.0.4",
|
||||
"@next/swc-win32-arm64-msvc": "14.0.4",
|
||||
"@next/swc-win32-ia32-msvc": "14.0.4",
|
||||
"@next/swc-win32-x64-msvc": "14.0.4"
|
||||
"@next/swc-darwin-arm64": "14.2.5",
|
||||
"@next/swc-darwin-x64": "14.2.5",
|
||||
"@next/swc-linux-arm64-gnu": "14.2.5",
|
||||
"@next/swc-linux-arm64-musl": "14.2.5",
|
||||
"@next/swc-linux-x64-gnu": "14.2.5",
|
||||
"@next/swc-linux-x64-musl": "14.2.5",
|
||||
"@next/swc-win32-arm64-msvc": "14.2.5",
|
||||
"@next/swc-win32-ia32-msvc": "14.2.5",
|
||||
"@next/swc-win32-x64-msvc": "14.2.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opentelemetry/api": "^1.1.0",
|
||||
"@playwright/test": "^1.41.2",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"sass": "^1.3.0"
|
||||
|
|
@ -9894,6 +9861,9 @@
|
|||
"@opentelemetry/api": {
|
||||
"optional": true
|
||||
},
|
||||
"@playwright/test": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
}
|
||||
|
|
@ -10218,18 +10188,17 @@
|
|||
"integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw=="
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
|
||||
"integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
||||
"integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"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.3"
|
||||
"word-wrap": "^1.2.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
|
|
@ -10272,7 +10241,6 @@
|
|||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
|
||||
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"p-limit": "^3.0.2"
|
||||
},
|
||||
|
|
@ -10335,7 +10303,6 @@
|
|||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"callsites": "^3.0.0"
|
||||
},
|
||||
|
|
@ -10679,11 +10646,25 @@
|
|||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
|
||||
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/pretty-format": {
|
||||
"version": "27.5.1",
|
||||
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
|
||||
|
|
@ -11142,7 +11123,6 @@
|
|||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
|
||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
|
|
@ -11190,8 +11170,8 @@
|
|||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"deprecated": "Rimraf versions prior to v4 are no longer supported",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
|
|
@ -11748,8 +11728,7 @@
|
|||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
|
||||
"dev": true,
|
||||
"peer": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/through2": {
|
||||
"version": "3.0.2",
|
||||
|
|
@ -11942,7 +11921,6 @@
|
|||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
|
||||
"integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"prelude-ls": "^1.2.1"
|
||||
},
|
||||
|
|
@ -11964,7 +11942,6 @@
|
|||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
|
||||
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
|
|
@ -12135,7 +12112,6 @@
|
|||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
|
|
@ -12288,19 +12264,6 @@
|
|||
"makeerror": "1.0.12"
|
||||
}
|
||||
},
|
||||
"node_modules/watchpack": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/web-streams-polyfill": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz",
|
||||
|
|
@ -12477,9 +12440,9 @@
|
|||
"integrity": "sha512-azrivNydKRYt7zwLV5wWUK7YzKTWs3q87xSmY6DlHapPrCvaT6ZrukvM5erV+yCSSPmZT8zkSdttOHQpWWm9zw=="
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.16.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
|
||||
"integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
|
||||
"version": "8.18.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
|
||||
"integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
|
||||
"devOptional": true,
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
"scripts": {
|
||||
"dev": "node esbuild.config.mjs",
|
||||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
||||
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
||||
"version": "node version-bump.mjs && git add manifest.json versions.json",
|
||||
"test": "jest"
|
||||
},
|
||||
|
|
@ -29,9 +31,11 @@
|
|||
"builtin-modules": "3.3.0",
|
||||
"electron": "^27.3.2",
|
||||
"esbuild": "0.17.3",
|
||||
"eslint": "^8.57.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"obsidian": "latest",
|
||||
"prettier": "^3.3.3",
|
||||
"ts-jest": "^29.1.0",
|
||||
"tslib": "2.4.0",
|
||||
"typescript": "4.7.4",
|
||||
|
|
@ -64,4 +68,4 @@
|
|||
"react-syntax-highlighter": "^15.5.0",
|
||||
"sse": "github:mpetazzoni/sse.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
import { LangChainParams } from '@/aiParams';
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { LangChainParams } from "@/aiParams";
|
||||
import {
|
||||
EMBEDDING_MODEL_TO_PROVIDERS,
|
||||
ModelProviders,
|
||||
NOMIC_EMBED_TEXT,
|
||||
} from '@/constants';
|
||||
import EncryptionService from '@/encryptionService';
|
||||
import { ProxyOpenAIEmbeddings } from '@/langchainWrappers';
|
||||
} from "@/constants";
|
||||
import EncryptionService from "@/encryptionService";
|
||||
import { ProxyOpenAIEmbeddings } from "@/langchainWrappers";
|
||||
import { CohereEmbeddings } from "@langchain/cohere";
|
||||
import { Embeddings } from "langchain/embeddings/base";
|
||||
import { OllamaEmbeddings } from "langchain/embeddings/ollama";
|
||||
|
|
@ -15,17 +16,17 @@ export default class EmbeddingManager {
|
|||
private static instance: EmbeddingManager;
|
||||
private constructor(
|
||||
private langChainParams: LangChainParams,
|
||||
private encryptionService: EncryptionService
|
||||
private encryptionService: EncryptionService,
|
||||
) {}
|
||||
|
||||
static getInstance(
|
||||
langChainParams: LangChainParams,
|
||||
encryptionService: EncryptionService
|
||||
encryptionService: EncryptionService,
|
||||
): EmbeddingManager {
|
||||
if (!EmbeddingManager.instance) {
|
||||
EmbeddingManager.instance = new EmbeddingManager(
|
||||
langChainParams,
|
||||
encryptionService
|
||||
encryptionService,
|
||||
);
|
||||
}
|
||||
return EmbeddingManager.instance;
|
||||
|
|
@ -39,7 +40,7 @@ export default class EmbeddingManager {
|
|||
return emb.modelName as string;
|
||||
} else {
|
||||
throw new Error(
|
||||
`Embeddings instance missing model or modelName properties: ${embeddingsInstance}`
|
||||
`Embeddings instance missing model or modelName properties: ${embeddingsInstance}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -58,7 +59,7 @@ export default class EmbeddingManager {
|
|||
if (openAIEmbeddingProxyBaseUrl) {
|
||||
return new ProxyOpenAIEmbeddings({
|
||||
modelName: openAIEmbeddingProxyModelName || embeddingModel,
|
||||
openAIApiKey: openAIApiKey? decrypt(openAIApiKey) : 'default-key',
|
||||
openAIApiKey: openAIApiKey ? decrypt(openAIApiKey) : "default-key",
|
||||
maxRetries: 3,
|
||||
maxConcurrency: 3,
|
||||
timeout: 10000,
|
||||
|
|
@ -67,8 +68,7 @@ export default class EmbeddingManager {
|
|||
} else if (openAIApiKey) {
|
||||
// No proxy URL; now check if the API key exists
|
||||
return new OpenAIEmbeddings({
|
||||
modelName:
|
||||
openAIEmbeddingProxyModelName || embeddingModel,
|
||||
modelName: openAIEmbeddingProxyModelName || embeddingModel,
|
||||
openAIApiKey: decrypt(openAIApiKey),
|
||||
maxRetries: 3,
|
||||
maxConcurrency: 3,
|
||||
|
|
@ -99,7 +99,7 @@ export default class EmbeddingManager {
|
|||
return OpenAIEmbeddingsAPI;
|
||||
}
|
||||
console.error(
|
||||
"OpenAI API key is not provided for the embedding model."
|
||||
"OpenAI API key is not provided for the embedding model.",
|
||||
);
|
||||
break;
|
||||
case ModelProviders.COHEREAI:
|
||||
|
|
@ -120,7 +120,7 @@ export default class EmbeddingManager {
|
|||
});
|
||||
}
|
||||
console.error(
|
||||
"Azure OpenAI API key is not provided for the embedding model."
|
||||
"Azure OpenAI API key is not provided for the embedding model.",
|
||||
);
|
||||
break;
|
||||
case ModelProviders.OLLAMA:
|
||||
|
|
@ -133,7 +133,7 @@ export default class EmbeddingManager {
|
|||
});
|
||||
default:
|
||||
console.error(
|
||||
"No embedding provider set or no valid API key provided. Defaulting to OpenAI."
|
||||
"No embedding provider set or no valid API key provided. Defaulting to OpenAI.",
|
||||
);
|
||||
return (
|
||||
OpenAIEmbeddingsAPI ||
|
||||
|
|
@ -149,4 +149,4 @@ export default class EmbeddingManager {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,6 +171,9 @@ const ChatIcons: React.FC<ChatIconsProps> = ({
|
|||
<option value={ChatModelDisplayNames.GPT_4o}>
|
||||
{ChatModelDisplayNames.GPT_4o}
|
||||
</option>
|
||||
<option value={ChatModelDisplayNames.GPT_4o_mini}>
|
||||
{ChatModelDisplayNames.GPT_4o_mini}
|
||||
</option>
|
||||
<option value={ChatModelDisplayNames.GPT_4_TURBO}>
|
||||
{ChatModelDisplayNames.GPT_4_TURBO}
|
||||
</option>
|
||||
|
|
|
|||
|
|
@ -11,11 +11,12 @@ export enum ChatModels {
|
|||
GPT_35_TURBO_16K = "gpt-3.5-turbo-16k",
|
||||
GPT_4 = "gpt-4",
|
||||
GPT_4o = "gpt-4o",
|
||||
GPT_4o_mini = "gpt-4o-mini",
|
||||
GPT_4_TURBO = "gpt-4-turbo-preview",
|
||||
GPT_4_32K = "gpt-4-32k",
|
||||
GEMINI_PRO = "gemini-pro",
|
||||
GROQ = "llama3-70b-8192",
|
||||
OLLAMA = "ollama",
|
||||
Groq = "llama3-70b-8192",
|
||||
}
|
||||
|
||||
export enum ChatModelDisplayNames {
|
||||
|
|
@ -23,15 +24,16 @@ export enum ChatModelDisplayNames {
|
|||
GPT_35_TURBO_16K = "GPT-3.5 16K",
|
||||
GPT_4 = "GPT-4",
|
||||
GPT_4o = "GPT-4o",
|
||||
GPT_4o_mini = "GPT-4o mini",
|
||||
GPT_4_TURBO = "GPT-4 TURBO",
|
||||
GPT_4_32K = "GPT-4 32K",
|
||||
AZURE_OPENAI = "AZURE OPENAI",
|
||||
CLAUDE = "CLAUDE 3",
|
||||
CLAUDE = "CLAUDE",
|
||||
GEMINI_PRO = "GEMINI PRO",
|
||||
OPENROUTERAI = "OPENROUTER.AI",
|
||||
GROQ = "GROQ",
|
||||
OLLAMA = "OLLAMA (LOCAL)",
|
||||
LM_STUDIO = "LM STUDIO (LOCAL)",
|
||||
GROQ = "Groq",
|
||||
}
|
||||
|
||||
export const OPENAI_MODELS = new Set([
|
||||
|
|
@ -39,6 +41,7 @@ export const OPENAI_MODELS = new Set([
|
|||
ChatModelDisplayNames.GPT_35_TURBO_16K,
|
||||
ChatModelDisplayNames.GPT_4,
|
||||
ChatModelDisplayNames.GPT_4o,
|
||||
ChatModelDisplayNames.GPT_4o_mini,
|
||||
ChatModelDisplayNames.GPT_4_TURBO,
|
||||
ChatModelDisplayNames.GPT_4_32K,
|
||||
ChatModelDisplayNames.LM_STUDIO,
|
||||
|
|
@ -63,6 +66,7 @@ export const DISPLAY_NAME_TO_MODEL: Record<string, string> = {
|
|||
[ChatModelDisplayNames.GPT_35_TURBO_16K]: ChatModels.GPT_35_TURBO_16K,
|
||||
[ChatModelDisplayNames.GPT_4]: ChatModels.GPT_4,
|
||||
[ChatModelDisplayNames.GPT_4o]: ChatModels.GPT_4o,
|
||||
[ChatModelDisplayNames.GPT_4o_mini]: ChatModels.GPT_4o_mini,
|
||||
[ChatModelDisplayNames.GPT_4_TURBO]: ChatModels.GPT_4_TURBO,
|
||||
[ChatModelDisplayNames.GPT_4_32K]: ChatModels.GPT_4_32K,
|
||||
[ChatModelDisplayNames.AZURE_OPENAI]: "azure_openai",
|
||||
|
|
@ -148,7 +152,7 @@ export const DEFAULT_SETTINGS: CopilotSettings = {
|
|||
huggingfaceApiKey: "",
|
||||
cohereApiKey: "",
|
||||
anthropicApiKey: "",
|
||||
anthropicModel: "claude-3-sonnet-20240229",
|
||||
anthropicModel: "claude-3-5-sonnet-20240620",
|
||||
azureOpenAIApiKey: "",
|
||||
azureOpenAIApiInstanceName: "",
|
||||
azureOpenAIApiDeploymentName: "",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { ChatOpenAI } from 'langchain/chat_models/openai';
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { ChatOpenAI } from "langchain/chat_models/openai";
|
||||
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
|
||||
import OpenAI from "openai";
|
||||
|
||||
// Migrated to OpenAI v4 client from v3: https://github.com/openai/openai-node/discussions/217
|
||||
export class ProxyChatOpenAI extends ChatOpenAI {
|
||||
constructor(
|
||||
fields?: any,
|
||||
) {
|
||||
constructor(fields?: any) {
|
||||
super(fields ?? {});
|
||||
|
||||
// Reinitialize the client with the updated clientConfig
|
||||
|
|
@ -18,9 +17,7 @@ export class ProxyChatOpenAI extends ChatOpenAI {
|
|||
}
|
||||
|
||||
export class ProxyOpenAIEmbeddings extends OpenAIEmbeddings {
|
||||
constructor(
|
||||
fields?: any,
|
||||
) {
|
||||
constructor(fields?: any) {
|
||||
super(fields ?? {});
|
||||
|
||||
// Reinitialize the client with the updated clientConfig
|
||||
|
|
|
|||
137
src/main.ts
137
src/main.ts
|
|
@ -29,7 +29,7 @@ import {
|
|||
} from "@/utils";
|
||||
import VectorDBManager, { VectorStoreDocument } from "@/vectorDBManager";
|
||||
import { MD5 } from "crypto-js";
|
||||
import { Editor, Notice, Plugin, TFile, WorkspaceLeaf, Menu } from "obsidian";
|
||||
import { Editor, Menu, Notice, Plugin, TFile, WorkspaceLeaf } from "obsidian";
|
||||
import PouchDB from "pouchdb";
|
||||
|
||||
export default class CopilotPlugin extends Plugin {
|
||||
|
|
@ -57,14 +57,14 @@ export default class CopilotPlugin extends Plugin {
|
|||
const langChainParams = this.getChainManagerParams();
|
||||
this.encryptionService = new EncryptionService(this.settings);
|
||||
this.dbVectorStores = new PouchDB<VectorStoreDocument>(
|
||||
`copilot_vector_stores_${this.getVaultIdentifier()}`,
|
||||
`copilot_vector_stores_${this.getVaultIdentifier()}`
|
||||
);
|
||||
this.chainManager = new ChainManager(
|
||||
this.app,
|
||||
langChainParams,
|
||||
this.encryptionService,
|
||||
this.settings,
|
||||
() => this.dbVectorStores,
|
||||
() => this.dbVectorStores
|
||||
);
|
||||
|
||||
if (this.settings.enableEncryption) {
|
||||
|
|
@ -73,13 +73,13 @@ export default class CopilotPlugin extends Plugin {
|
|||
|
||||
this.embeddingsManager = EmbeddingsManager.getInstance(
|
||||
langChainParams,
|
||||
this.encryptionService,
|
||||
this.encryptionService
|
||||
);
|
||||
this.dbPrompts = new PouchDB<CustomPrompt>("copilot_custom_prompts");
|
||||
|
||||
this.registerView(
|
||||
CHAT_VIEWTYPE,
|
||||
(leaf: WorkspaceLeaf) => new CopilotView(leaf, this),
|
||||
(leaf: WorkspaceLeaf) => new CopilotView(leaf, this)
|
||||
);
|
||||
|
||||
this.addCommand({
|
||||
|
|
@ -115,7 +115,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
new Notice("Custom prompt saved successfully.");
|
||||
} catch (e) {
|
||||
new Notice(
|
||||
"Error saving custom prompt. Please check if the title already exists.",
|
||||
"Error saving custom prompt. Please check if the title already exists."
|
||||
);
|
||||
console.error(e);
|
||||
}
|
||||
|
|
@ -138,30 +138,30 @@ export default class CopilotPlugin extends Plugin {
|
|||
}
|
||||
try {
|
||||
const doc = (await this.dbPrompts.get(
|
||||
promptTitle,
|
||||
promptTitle
|
||||
)) as CustomPrompt;
|
||||
if (!doc.prompt) {
|
||||
new Notice(
|
||||
`No prompt found with the title "${promptTitle}".`,
|
||||
`No prompt found with the title "${promptTitle}".`
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.processCustomPrompt(
|
||||
editor,
|
||||
"applyCustomPrompt",
|
||||
doc.prompt,
|
||||
doc.prompt
|
||||
);
|
||||
} catch (err) {
|
||||
if (err.name === "not_found") {
|
||||
new Notice(
|
||||
`No prompt found with the title "${promptTitle}".`,
|
||||
`No prompt found with the title "${promptTitle}".`
|
||||
);
|
||||
} else {
|
||||
console.error(err);
|
||||
new Notice("An error occurred.");
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
).open();
|
||||
});
|
||||
},
|
||||
|
|
@ -180,7 +180,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
console.error(err);
|
||||
new Notice("An error occurred.");
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
modal.open();
|
||||
|
|
@ -209,25 +209,25 @@ export default class CopilotPlugin extends Plugin {
|
|||
const doc = await this.dbPrompts.get(promptTitle);
|
||||
if (doc._rev) {
|
||||
await this.dbPrompts.remove(
|
||||
doc as PouchDB.Core.RemoveDocument,
|
||||
doc as PouchDB.Core.RemoveDocument
|
||||
);
|
||||
new Notice(`Prompt "${promptTitle}" has been deleted.`);
|
||||
} else {
|
||||
new Notice(
|
||||
`Failed to delete prompt "${promptTitle}": No revision found.`,
|
||||
`Failed to delete prompt "${promptTitle}": No revision found.`
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.name === "not_found") {
|
||||
new Notice(
|
||||
`No prompt found with the title "${promptTitle}".`,
|
||||
`No prompt found with the title "${promptTitle}".`
|
||||
);
|
||||
} else {
|
||||
console.error(err);
|
||||
new Notice("An error occurred while deleting the prompt.");
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
).open();
|
||||
});
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
|
||||
try {
|
||||
const doc = (await this.dbPrompts.get(
|
||||
promptTitle,
|
||||
promptTitle
|
||||
)) as CustomPrompt;
|
||||
if (doc.prompt) {
|
||||
new AddPromptModal(
|
||||
|
|
@ -269,24 +269,24 @@ export default class CopilotPlugin extends Plugin {
|
|||
},
|
||||
doc._id,
|
||||
doc.prompt,
|
||||
true,
|
||||
true
|
||||
).open();
|
||||
} else {
|
||||
new Notice(
|
||||
`No prompt found with the title "${promptTitle}".`,
|
||||
`No prompt found with the title "${promptTitle}".`
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.name === "not_found") {
|
||||
new Notice(
|
||||
`No prompt found with the title "${promptTitle}".`,
|
||||
`No prompt found with the title "${promptTitle}".`
|
||||
);
|
||||
} else {
|
||||
console.error(err);
|
||||
new Notice("An error occurred.");
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
).open();
|
||||
});
|
||||
|
||||
|
|
@ -303,16 +303,16 @@ export default class CopilotPlugin extends Plugin {
|
|||
await this.dbVectorStores.destroy();
|
||||
// Reinitialize the database
|
||||
this.dbVectorStores = new PouchDB<VectorStoreDocument>(
|
||||
`copilot_vector_stores_${this.getVaultIdentifier()}`,
|
||||
`copilot_vector_stores_${this.getVaultIdentifier()}`
|
||||
);
|
||||
new Notice("Local vector store cleared successfully.");
|
||||
console.log(
|
||||
"Local vector store cleared successfully, new instance created.",
|
||||
"Local vector store cleared successfully, new instance created."
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("Error clearing the local vector store:", err);
|
||||
new Notice(
|
||||
"An error occurred while clearing the local vector store.",
|
||||
"An error occurred while clearing the local vector store."
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
@ -326,17 +326,17 @@ export default class CopilotPlugin extends Plugin {
|
|||
const files = this.app.vault.getMarkdownFiles();
|
||||
const filePaths = files.map((file) => file.path);
|
||||
const indexedFiles = await VectorDBManager.getNoteFiles(
|
||||
this.dbVectorStores,
|
||||
this.dbVectorStores
|
||||
);
|
||||
const indexedFilePaths = indexedFiles.map((file) => file.path);
|
||||
const filesToDelete = indexedFilePaths.filter(
|
||||
(filePath) => !filePaths.includes(filePath),
|
||||
(filePath) => !filePaths.includes(filePath)
|
||||
);
|
||||
|
||||
const deletePromises = filesToDelete.map(async (filePath) => {
|
||||
VectorDBManager.removeMemoryVectors(
|
||||
this.dbVectorStores,
|
||||
VectorDBManager.getDocumentHash(filePath),
|
||||
VectorDBManager.getDocumentHash(filePath)
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -344,12 +344,12 @@ export default class CopilotPlugin extends Plugin {
|
|||
|
||||
new Notice("Local vector store garbage collected successfully.");
|
||||
console.log(
|
||||
"Local vector store garbage collected successfully, new instance created.",
|
||||
"Local vector store garbage collected successfully, new instance created."
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("Error clearing the local vector store:", err);
|
||||
new Notice(
|
||||
"An error occurred while clearing the local vector store.",
|
||||
"An error occurred while clearing the local vector store."
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
@ -363,10 +363,10 @@ export default class CopilotPlugin extends Plugin {
|
|||
const indexedFileCount = await this.indexVaultToVectorStore();
|
||||
|
||||
new Notice(
|
||||
`${indexedFileCount} vault files indexed to vector store.`,
|
||||
`${indexedFileCount} vault files indexed to vector store.`
|
||||
);
|
||||
console.log(
|
||||
`${indexedFileCount} vault files indexed to vector store.`,
|
||||
`${indexedFileCount} vault files indexed to vector store.`
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("Error indexing vault to vector store:", err);
|
||||
|
|
@ -383,15 +383,15 @@ export default class CopilotPlugin extends Plugin {
|
|||
const indexedFileCount = await this.indexVaultToVectorStore(true);
|
||||
|
||||
new Notice(
|
||||
`${indexedFileCount} vault files indexed to vector store.`,
|
||||
`${indexedFileCount} vault files indexed to vector store.`
|
||||
);
|
||||
console.log(
|
||||
`${indexedFileCount} vault files indexed to vector store.`,
|
||||
`${indexedFileCount} vault files indexed to vector store.`
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("Error re-indexing vault to vector store:", err);
|
||||
new Notice(
|
||||
"An error occurred while re-indexing vault to vector store.",
|
||||
"An error occurred while re-indexing vault to vector store."
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
@ -409,7 +409,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
this.settings.chatNoteContextPath = path;
|
||||
this.settings.chatNoteContextTags = tags;
|
||||
await this.saveSettings();
|
||||
},
|
||||
}
|
||||
).open();
|
||||
},
|
||||
});
|
||||
|
|
@ -430,7 +430,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
this.app.vault.on("delete", (file) => {
|
||||
const docHash = VectorDBManager.getDocumentHash(file.path);
|
||||
VectorDBManager.removeMemoryVectors(this.dbVectorStores, docHash);
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
// Index vault to vector store on startup and after loading all commands
|
||||
|
|
@ -448,9 +448,8 @@ export default class CopilotPlugin extends Plugin {
|
|||
}
|
||||
|
||||
this.registerEvent(
|
||||
this.app.workspace.on("editor-menu", this.handleContextMenu)
|
||||
);
|
||||
|
||||
this.app.workspace.on("editor-menu", this.handleContextMenu)
|
||||
);
|
||||
}
|
||||
|
||||
private getVaultIdentifier(): string {
|
||||
|
|
@ -484,7 +483,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
|
||||
// Check if embedding model has changed
|
||||
const prevEmbeddingModel = await VectorDBManager.checkEmbeddingModel(
|
||||
this.dbVectorStores,
|
||||
this.dbVectorStores
|
||||
);
|
||||
// TODO: Remove this when Ollama model is dynamically set
|
||||
const currEmbeddingModel =
|
||||
|
|
@ -494,7 +493,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
console.log(
|
||||
"Prev vs Current embedding models:",
|
||||
prevEmbeddingModel,
|
||||
currEmbeddingModel,
|
||||
currEmbeddingModel
|
||||
);
|
||||
|
||||
if (!areEmbeddingModelsSame(prevEmbeddingModel, currEmbeddingModel)) {
|
||||
|
|
@ -506,13 +505,13 @@ export default class CopilotPlugin extends Plugin {
|
|||
await this.dbVectorStores.destroy();
|
||||
// Reinitialize the database
|
||||
this.dbVectorStores = new PouchDB<VectorStoreDocument>(
|
||||
`copilot_vector_stores_${this.getVaultIdentifier()}`,
|
||||
`copilot_vector_stores_${this.getVaultIdentifier()}`
|
||||
);
|
||||
new Notice(
|
||||
"Detected change in embedding model. Rebuild vector store from scratch.",
|
||||
"Detected change in embedding model. Rebuild vector store from scratch."
|
||||
);
|
||||
console.log(
|
||||
"Detected change in embedding model. Rebuild vector store from scratch.",
|
||||
"Detected change in embedding model. Rebuild vector store from scratch."
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("Error clearing vector store for reindexing:", err);
|
||||
|
|
@ -521,7 +520,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
}
|
||||
|
||||
const latestMtime = await VectorDBManager.getLatestFileMtime(
|
||||
this.dbVectorStores,
|
||||
this.dbVectorStores
|
||||
);
|
||||
|
||||
const files = this.app.vault
|
||||
|
|
@ -537,10 +536,10 @@ export default class CopilotPlugin extends Plugin {
|
|||
});
|
||||
|
||||
const fileContents: string[] = await Promise.all(
|
||||
files.map((file) => this.app.vault.cachedRead(file)),
|
||||
files.map((file) => this.app.vault.cachedRead(file))
|
||||
);
|
||||
const fileMetadatas = files.map((file) =>
|
||||
this.app.metadataCache.getFileCache(file),
|
||||
this.app.metadataCache.getFileCache(file)
|
||||
);
|
||||
|
||||
const totalFiles = files.length;
|
||||
|
|
@ -552,7 +551,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
let indexedCount = 0;
|
||||
const indexNotice = new Notice(
|
||||
`Copilot is indexing your vault...\n0/${totalFiles} files processed.`,
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
const errors: string[] = [];
|
||||
|
|
@ -568,12 +567,12 @@ export default class CopilotPlugin extends Plugin {
|
|||
const result = await VectorDBManager.indexFile(
|
||||
this.dbVectorStores,
|
||||
embeddingInstance,
|
||||
noteFile,
|
||||
noteFile
|
||||
);
|
||||
|
||||
indexedCount++;
|
||||
indexNotice.setMessage(
|
||||
`Copilot is indexing your vault...\n${indexedCount}/${totalFiles} files processed.`,
|
||||
`Copilot is indexing your vault...\n${indexedCount}/${totalFiles} files processed.`
|
||||
);
|
||||
return result;
|
||||
} catch (err) {
|
||||
|
|
@ -589,7 +588,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
|
||||
if (errors.length > 0) {
|
||||
new Notice(
|
||||
`Indexing completed with errors. Check the console for details.`,
|
||||
`Indexing completed with errors. Check the console for details.`
|
||||
);
|
||||
console.log("Indexing Errors:", errors.join("\n"));
|
||||
}
|
||||
|
|
@ -600,7 +599,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
editor: Editor,
|
||||
eventType: string,
|
||||
eventSubtype?: string,
|
||||
checkSelectedText = true,
|
||||
checkSelectedText = true
|
||||
) {
|
||||
const selectedText = editor.getSelection();
|
||||
|
||||
|
|
@ -645,7 +644,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
});
|
||||
await this.activateViewPromise;
|
||||
this.app.workspace.revealLeaf(
|
||||
this.app.workspace.getLeavesOfType(CHAT_VIEWTYPE)[0],
|
||||
this.app.workspace.getLeavesOfType(CHAT_VIEWTYPE)[0]
|
||||
);
|
||||
this.chatIsVisible = true;
|
||||
}
|
||||
|
|
@ -668,7 +667,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
});
|
||||
await this.activateViewPromise;
|
||||
this.app.workspace.revealLeaf(
|
||||
this.app.workspace.getLeavesOfType(CHAT_VIEWTYPE)[0],
|
||||
this.app.workspace.getLeavesOfType(CHAT_VIEWTYPE)[0]
|
||||
);
|
||||
this.chatIsVisible = true;
|
||||
}
|
||||
|
|
@ -695,8 +694,9 @@ export default class CopilotPlugin extends Plugin {
|
|||
async countTotalTokens(): Promise<number> {
|
||||
try {
|
||||
const allContent = await getAllNotesContent(this.app.vault);
|
||||
const totalTokens =
|
||||
await this.chainManager.chatModelManager.countTokens(allContent);
|
||||
const totalTokens = await this.chainManager.chatModelManager.countTokens(
|
||||
allContent
|
||||
);
|
||||
return totalTokens;
|
||||
} catch (error) {
|
||||
console.error("Error counting tokens: ", error);
|
||||
|
|
@ -704,27 +704,20 @@ export default class CopilotPlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
handleContextMenu = (
|
||||
menu: Menu,
|
||||
editor: Editor
|
||||
): void => {
|
||||
this.addContextMenu(menu, editor, this);
|
||||
};
|
||||
handleContextMenu = (menu: Menu, editor: Editor): void => {
|
||||
this.addContextMenu(menu, editor, this);
|
||||
};
|
||||
|
||||
addContextMenu = (
|
||||
menu: Menu,
|
||||
editor: Editor,
|
||||
plugin: this,
|
||||
): void => {
|
||||
menu.addItem((item) => {
|
||||
item
|
||||
addContextMenu = (menu: Menu, editor: Editor, plugin: this): void => {
|
||||
menu.addItem((item) => {
|
||||
item
|
||||
.setTitle("Copilot: Summarize Selection")
|
||||
.setIcon("bot")
|
||||
.setIcon("bot")
|
||||
.onClick(async (e) => {
|
||||
plugin.processSelection(editor, "summarizeSelection");
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
getChainManagerParams(): LangChainParams {
|
||||
const {
|
||||
|
|
|
|||
Loading…
Reference in a new issue