mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-24 23:10:56 +08:00
feat: v0.45.2 - 优化机器码历史记录和插件加载
- 机器码历史记录改为倒序显示(最新在前) - 修复插件加载器全局变量名推断,自动添加 Plugin 后缀 - 添加更多插件的全局变量名映射
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "proxycast",
|
||||
"private": true,
|
||||
"version": "0.45.1",
|
||||
"version": "0.45.2",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Generated
+1
-1
@@ -3947,7 +3947,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "proxycast"
|
||||
version = "0.45.1"
|
||||
version = "0.45.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arboard",
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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,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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
// 默认回退
|
||||
|
||||
Reference in New Issue
Block a user