feat: v0.45.2 - 优化机器码历史记录和插件加载

- 机器码历史记录改为倒序显示(最新在前)
- 修复插件加载器全局变量名推断,自动添加 Plugin 后缀
- 添加更多插件的全局变量名映射
This commit is contained in:
coso
2026-01-13 13:47:17 +08:00
parent 9363bd9ba3
commit 20df0d2cd8
6 changed files with 20 additions and 9 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "proxycast",
"private": true,
"version": "0.45.1",
"version": "0.45.2",
"type": "module",
"repository": {
"type": "git",
+1 -1
View File
@@ -3947,7 +3947,7 @@ dependencies = [
[[package]]
name = "proxycast"
version = "0.45.1"
version = "0.45.2"
dependencies = [
"anyhow",
"arboard",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "proxycast"
version = "0.45.1"
version = "0.45.2"
description = "AI API Proxy Desktop App"
authors = ["you"]
edition = "2021"
+4 -2
View File
@@ -745,8 +745,10 @@ impl MachineIdService {
Ok(())
}
/// 获取历史记录
/// 获取历史记录(倒序,最新的在前)
pub fn get_history(&self) -> Result<Vec<MachineIdHistory>, String> {
self.load_history()
let mut history = self.load_history()?;
history.reverse();
Ok(history)
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "ProxyCast",
"version": "0.45.1",
"version": "0.45.2",
"identifier": "com.proxycast.app",
"build": {
"beforeDevCommand": "npm run dev",
+12 -3
View File
@@ -43,6 +43,10 @@ const PLUGIN_GLOBAL_NAMES: Record<string, string> = {
"gemini-provider": "GeminiProviderPlugin",
"antigravity-provider": "AntigravityProviderPlugin",
"codex-provider": "CodexProviderPlugin",
"machine-id-tool": "MachineIdToolPlugin",
"browser-interception": "BrowserInterceptionPlugin",
"flow-monitor": "FlowMonitorPlugin",
"config-switch": "ConfigSwitchPlugin",
};
/**
@@ -71,14 +75,19 @@ function getPluginGlobalName(pluginPath: string): string {
}
// 尝试从插件 ID 推断全局变量名
// 例如: my-plugin -> MyPlugin
// 例如: my-plugin -> MyPluginPlugin
// 注意: 插件构建时通常会添加 Plugin 后缀
if (pluginId) {
const camelCase = pluginId
.split("-")
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
.join("");
console.log(`[PluginLoader] 推断全局变量名: ${camelCase}`);
return camelCase;
// 添加 Plugin 后缀(如果还没有)
const globalName = camelCase.endsWith("Plugin")
? camelCase
: `${camelCase}Plugin`;
console.log(`[PluginLoader] 推断全局变量名: ${globalName}`);
return globalName;
}
// 默认回退