🚀 feat(config): enable auto-update option for the crystelf-plugin in the configuration file.

🎉 feat(index): implement automatic update checks based on the config setting in the plugin initialization.
This commit is contained in:
Jerry 2025-11-25 12:55:38 +08:00
parent 56d4ac06c4
commit c82f3e9cb7
3 changed files with 15 additions and 4 deletions

View File

@ -97,6 +97,7 @@
- [X] 自定义上下文长度 - [X] 自定义上下文长度
- [X] 记忆存储及搜索 - [X] 记忆存储及搜索
- [X] 自定义会话管理 - [X] 自定义会话管理
- [X] 支持获取引用消息,使用seq标记
- [ ] 支持调用更多工具 - [ ] 支持调用更多工具
- [ ] 获取引用消息 - [ ] 获取引用消息
- [ ] 适配多模态模型,查看图片等 - [ ] 适配多模态模型,查看图片等
@ -129,6 +130,8 @@
{ {
"maxFeed": 10,//使用rss推送功能时,本地记录的最长长度,用于检测最新文章 "maxFeed": 10,//使用rss推送功能时,本地记录的最长长度,用于检测最新文章
//功能是否启用 //功能是否启用
"?autoUpdate": "是否自动更新插件",
"autoUpdate": true,
"poke": true, "poke": true,
"60s": true, "60s": true,
"fanqie": true, "fanqie": true,

View File

@ -4,6 +4,8 @@
"core": true, "core": true,
"?maxFeed": "最长订阅", "?maxFeed": "最长订阅",
"maxFeed": 10, "maxFeed": 10,
"?autoUpdate": "是否自动更新插件",
"autoUpdate": true,
"poke": true, "poke": true,
"60s": true, "60s": true,
"fanqie": true, "fanqie": true,

View File

@ -9,11 +9,17 @@ logger.info(
chalk.rgb(134, 142, 204)(`crystelf-plugin ${Version.ver} 初始化~ by ${Version.author}`) chalk.rgb(134, 142, 204)(`crystelf-plugin ${Version.ver} 初始化~ by ${Version.author}`)
); );
await crystelfInit.CSH().then(logger.mark('[crystelf-plugin] crystelf-plugin 完成初始化'));
import ConfigControl from "./lib/config/configControl.js";
const appConfig = await ConfigControl.get('config');
if(appConfig.autoUpdate) {
logger.info('[crystelf-plugin] 自动更新已启用,正在自动检查更新..');
updater.checkAndUpdate().catch((err) => { updater.checkAndUpdate().catch((err) => {
logger.error(err); logger.error(err);
}); });
}
await crystelfInit.CSH().then(logger.mark('[crystelf-plugin] crystelf-plugin 完成初始化'));
const appPath = Path.apps; const appPath = Path.apps;
const jsFiles = await fc.readDirRecursive(appPath, 'js'); const jsFiles = await fc.readDirRecursive(appPath, 'js');