Files
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
9.3 KiB
JSON

{"repo": "an928159783-blip/xuanyi", "files": {"HoverTranslate.Core/Models/ApiProfileAddPresets.cs": {"638bd140eeb9125dabec1b86a249bda9ee24d087": {"t": 1785746196.3652294, "n": 1118, "h": "b1e9197d8a404cd7", "c": "namespace HoverTranslate.Core.Models;\n\n/// <summary>设置页「+ 添加」可选的预设(仅百炼 / DeepSeek / 自定义)。</summary>\npublic static class ApiProfileAddPresets\n{\n public sealed record Preset(string Id, string Label, string Kind, string DefaultName, string DefaultModel, string DefaultBaseUrl, string Hint);\n\n public static IReadOnlyList<Preset> All { get; } =\n [\n new(\"bailian\", \"阿里云百炼 · qwen-turbo\", ApiProfileKinds.OpenAiCompatible,\n \"qwen-turbo\", \"qwen-turbo\", \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"在百炼控制台创建 API Key;可按需改为 qwen-plus、qwen-long 等模型。\"),\n new(\"deepseek\", \"DeepSeek · deepseek-chat\", ApiProfileKinds.OpenAiCompatible,\n \"deepseek-chat\", \"deepseek-chat\", \"https://api.deepseek.com\",\n \"在 DeepSeek 控制台创建 API Key,模型一般为 deepseek-chat。\"),\n new(\"custom\", \"自定义\", ApiProfileKinds.OpenAiCompatible,\n \"my-model\", \"my-model\", \"https://api.example.com/v1\",\n \"填写兼容 OpenAI Chat Completions 的 Base URL、模型名与 API Key。\")\n ];\n\n public static Preset Get(string? id) =>\n All.FirstOrDefault(p => p.Id == id) ?? All[0];\n}\n"}, "70e5a661e22c66947ba31a4be30ebbb60dfb56f0": {"t": 1785760524.0894146, "n": 1118, "h": "b1e9197d8a404cd7", "c": "namespace HoverTranslate.Core.Models;\n\n/// <summary>设置页「+ 添加」可选的预设(仅百炼 / DeepSeek / 自定义)。</summary>\npublic static class ApiProfileAddPresets\n{\n public sealed record Preset(string Id, string Label, string Kind, string DefaultName, string DefaultModel, string DefaultBaseUrl, string Hint);\n\n public static IReadOnlyList<Preset> All { get; } =\n [\n new(\"bailian\", \"阿里云百炼 · qwen-turbo\", ApiProfileKinds.OpenAiCompatible,\n \"qwen-turbo\", \"qwen-turbo\", \"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n \"在百炼控制台创建 API Key;可按需改为 qwen-plus、qwen-long 等模型。\"),\n new(\"deepseek\", \"DeepSeek · deepseek-chat\", ApiProfileKinds.OpenAiCompatible,\n \"deepseek-chat\", \"deepseek-chat\", \"https://api.deepseek.com\",\n \"在 DeepSeek 控制台创建 API Key,模型一般为 deepseek-chat。\"),\n new(\"custom\", \"自定义\", ApiProfileKinds.OpenAiCompatible,\n \"my-model\", \"my-model\", \"https://api.example.com/v1\",\n \"填写兼容 OpenAI Chat Completions 的 Base URL、模型名与 API Key。\")\n ];\n\n public static Preset Get(string? id) =>\n All.FirstOrDefault(p => p.Id == id) ?? All[0];\n}\n"}}, "HoverTranslate.Core/Services/ConfigMigration.cs": {"638bd140eeb9125dabec1b86a249bda9ee24d087": {"t": 1785746215.0206773, "n": 2088, "h": "6ad0e03ddab170dd", "c": "using HoverTranslate.Core.Models;\n\nnamespace HoverTranslate.Core.Services;\n\n/// <summary>将旧版内置 DeepSeek/百炼配置迁移为 ApiProfiles,不再在 UI 中展示内置通道。</summary>\npublic static class ConfigMigration\n{\n public static void MigrateBuiltInToProfiles(AppConfig config)\n {\n var hasProfiles = config.ApiProfiles.Count > 0;\n\n if (!hasProfiles && !string.IsNullOrWhiteSpace(config.Deepseek.ApiKey))\n {\n config.ApiProfiles.Add(new ApiProfile\n {\n Name = \"DeepSeek\",\n Kind = ApiProfileKinds.OpenAiCompatible,\n ApiKey = config.Deepseek.ApiKey,\n BaseUrl = string.IsNullOrWhiteSpace(config.Deepseek.BaseUrl)\n ? \"https://api.deepseek.com\"\n : config.Deepseek.BaseUrl,\n Model = string.IsNullOrWhiteSpace(config.Deepseek.Model)\n ? \"deepseek-chat\"\n : config.Deepseek.Model\n });\n }\n\n if (!hasProfiles && !string.IsNullOrWhiteSpace(config.Bailian.ApiKey))\n {\n config.ApiProfiles.Add(new ApiProfile\n {\n Name = \"阿里云百炼\",\n Kind = ApiProfileKinds.OpenAiCompatible,\n ApiKey = config.Bailian.ApiKey,\n BaseUrl = string.IsNullOrWhiteSpace(config.Bailian.BaseUrl)\n ? \"https://dashscope.aliyuncs.com/compatible-mode/v1\"\n : config.Bailian.BaseUrl,\n Model = string.IsNullOrWhiteSpace(config.Bailian.Model)\n ? \"qwen-turbo\"\n : config.Bailian.Model\n });\n }\n\n if (string.Equals(config.Provider, \"deepseek\", StringComparison.OrdinalIgnoreCase)\n || string.Equals(config.Provider, \"bailian\", StringComparison.OrdinalIgnoreCase))\n {\n var migrated = config.ApiProfiles.FirstOrDefault();\n config.Provider = migrated?.Id ?? \"auto\";\n }\n\n if (string.IsNullOrWhiteSpace(config.Provider) && config.ApiProfiles.Count > 0)\n config.Provider = \"auto\";\n }\n}\n"}, "f7e6b4d69a578b3f5a312db876ab79e54313c4fb": {"t": 1785760524.0241652, "n": 2088, "h": "6ad0e03ddab170dd", "c": "using HoverTranslate.Core.Models;\n\nnamespace HoverTranslate.Core.Services;\n\n/// <summary>将旧版内置 DeepSeek/百炼配置迁移为 ApiProfiles,不再在 UI 中展示内置通道。</summary>\npublic static class ConfigMigration\n{\n public static void MigrateBuiltInToProfiles(AppConfig config)\n {\n var hasProfiles = config.ApiProfiles.Count > 0;\n\n if (!hasProfiles && !string.IsNullOrWhiteSpace(config.Deepseek.ApiKey))\n {\n config.ApiProfiles.Add(new ApiProfile\n {\n Name = \"DeepSeek\",\n Kind = ApiProfileKinds.OpenAiCompatible,\n ApiKey = config.Deepseek.ApiKey,\n BaseUrl = string.IsNullOrWhiteSpace(config.Deepseek.BaseUrl)\n ? \"https://api.deepseek.com\"\n : config.Deepseek.BaseUrl,\n Model = string.IsNullOrWhiteSpace(config.Deepseek.Model)\n ? \"deepseek-chat\"\n : config.Deepseek.Model\n });\n }\n\n if (!hasProfiles && !string.IsNullOrWhiteSpace(config.Bailian.ApiKey))\n {\n config.ApiProfiles.Add(new ApiProfile\n {\n Name = \"阿里云百炼\",\n Kind = ApiProfileKinds.OpenAiCompatible,\n ApiKey = config.Bailian.ApiKey,\n BaseUrl = string.IsNullOrWhiteSpace(config.Bailian.BaseUrl)\n ? \"https://dashscope.aliyuncs.com/compatible-mode/v1\"\n : config.Bailian.BaseUrl,\n Model = string.IsNullOrWhiteSpace(config.Bailian.Model)\n ? \"qwen-turbo\"\n : config.Bailian.Model\n });\n }\n\n if (string.Equals(config.Provider, \"deepseek\", StringComparison.OrdinalIgnoreCase)\n || string.Equals(config.Provider, \"bailian\", StringComparison.OrdinalIgnoreCase))\n {\n var migrated = config.ApiProfiles.FirstOrDefault();\n config.Provider = migrated?.Id ?? \"auto\";\n }\n\n if (string.IsNullOrWhiteSpace(config.Provider) && config.ApiProfiles.Count > 0)\n config.Provider = \"auto\";\n }\n}\n"}}, "HoverTranslate.Core.Tests/TranslatorFactoryTests.cs": {"638bd140eeb9125dabec1b86a249bda9ee24d087": {"t": 1786067641.3070908, "n": 1544, "h": "8021d6814a8cb220", "c": "using HoverTranslate.Core.Models;\nusing HoverTranslate.Core.Services;\nusing HoverTranslate.Core.Translators;\nusing Xunit;\n\nnamespace HoverTranslate.Core.Tests;\n\npublic class TranslatorFactoryTests\n{\n [Fact]\n public void ProfileFactory_Microsoft_ReturnsMicrosoftTranslator()\n {\n var profile = new ApiProfile { Kind = ApiProfileKinds.Microsoft, Name = \"MS\", ApiKey = \"k\" };\n var t = ProfileTranslatorFactory.Create(profile, new AppConfig(), new GlossaryService());\n Assert.IsType<MicrosoftTranslator>(t);\n }\n\n [Fact]\n public void ProfileFactory_Google_ReturnsGoogleTranslator()\n {\n var profile = new ApiProfile { Kind = ApiProfileKinds.Google, Name = \"G\", ApiKey = \"k\" };\n var t = ProfileTranslatorFactory.Create(profile, new AppConfig(), new GlossaryService());\n Assert.IsType<GoogleTranslator>(t);\n }\n\n [Fact]\n public void ProfileFactory_OpenAi_ReturnsGenericLlm()\n {\n var profile = new ApiProfile\n {\n Kind = ApiProfileKinds.OpenAiCompatible,\n Name = \"DS\",\n ApiKey = \"k\",\n BaseUrl = \"https://api.deepseek.com\",\n Model = \"deepseek-chat\"\n };\n var t = ProfileTranslatorFactory.Create(profile, new AppConfig(), new GlossaryService());\n Assert.IsType<GenericLlmTranslator>(t);\n }\n\n [Fact]\n public void AutoTranslator_ProviderName_IsAuto()\n {\n var t = new AutoTranslator(new AppConfig(), new GlossaryService());\n Assert.Equal(\"auto\", t.ProviderName);\n }\n}\n"}}}}