知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.
Swift androidlinuxlive-captionsmacosmeeting-notesmenubar-appsimultaneous-interpretationspeech-recognitionsubtitlesswiftswiftuitranslationwindows
feat: when the AI service fails, Settings shows which step broke and how to fix it
wquguru21a0f7aad9f4
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.stringsindex 934994b..6dc3127 100644--- a/Resources/en.lproj/Localizable.strings+++ b/Resources/en.lproj/Localizable.strings@@ -1,3 +1,39 @@+/* AICheck */+"连上 %@" = "Reach %@";+"key 可以用" = "Key works";+"纪要和翻译" = "Notes and translation";+"这台 Mac 访问不到 %@。" = "This Mac can't reach %@.";+"地址要用 https,只有 localhost 可以用 http。" = "The address must use https; only localhost can use http.";+"%@ 说这个 key 无效,可能没复制全,或已删除。" = "%@ says this key is invalid. It may be incomplete or deleted.";+"这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。" = "This is a ZenMux management key, which can't call models. Paste a key that starts with sk-payg.";+"%@ 账户余额不足。" = "Your %@ balance has run out.";+"%@ 上找不到 %@ 这个模型。" = "%1$@ doesn't have the model %2$@.";+"这个服务不支持 JSON,纪要写不了;翻译照常。" = "This service doesn't support JSON, so notes can't be written. Translation still works.";+"%@ 现在很忙,key 没问题。开会时会自动重试。" = "%@ is busy right now; the key is fine. Meetings retry automatically.";+"%@ 暂时出错(HTTP %lld),稍后再试。" = "%@ has a temporary error (HTTP %lld). Try again shortly.";+"开了代理也连不上:换一个节点,或检查代理软件是否放过 %@。" = "A proxy is on but it still can't connect. Try another server, or check that your proxy app routes %@.";+"代理软件在运行(端口 %@),但没开系统代理。在代理软件里打开“系统代理”。" = "A proxy app is running (port %@), but the system proxy is off. Turn on “System Proxy” in the proxy app.";+"这台电脑没开代理。在国内通常要开代理才能用 %@。" = "No proxy is on. In mainland China, %@ usually needs one.";+"%@ 余额快用完了(还剩 $%@)" = "%1$@ balance is almost used up ($%2$@ left)";++/* AICheckView */+"%@ 秒" = "%@ s";+"开会用过一次后确认" = "Confirmed after the first meeting";+"重新检查" = "Check again";+"怎么设置代理" = "How to set up a proxy";+"更换 key" = "Change Key";+"打开 %@" = "Open %@";+"去充值" = "Add credits";+"换成推荐的 %@" = "Use recommended %@";+"字幕照常;纪要和整句翻译先停下" = "Subtitles go on; notes and full-sentence translation pause";+"连不上 %@" = "Can't reach %@";+"%@ 的 key 用不了" = "The %@ key doesn't work";+"AI 服务的设置要改一下" = "AI service settings need a change";+"打开设置" = "Open Settings";+"用完后纪要会停下" = "Notes stop when it runs out";+"%@ 开会时用过" = "used in a meeting %@";+"响应约 %@ 秒" = "responds in about %@ s";+/* AIProviders */"更准" = "More accurate";"更快、更省" = "Faster, cheaper";@@ -13,13 +49,21 @@/* AISettings */"现在能用的" = "What works now";"用 %@" = "Uses %@";+"连上 %@ 后可用" = "Available once %@ is reachable";+"换好 key 后可用" = "Available with a working key";+"填好 key 后可用" = "Available once a key is set";"实时纪要" = "Live notes";+"很忙" = "Busy";+"会自动重试,纪要可能晚一点" = "Retries automatically; notes may be a little late";+"暂不可用" = "Unavailable";"需要 key" = "Needs key";"会中每 45 秒更新" = "Updated every 45 s during a meeting";-"填好 key 后可用" = "Available once a key is set";+"这个服务不支持 JSON" = "This service doesn't support JSON";+"换一个模型后可用" = "Available with another model";"翻译" = "Translation";"整句用它;不行时换 Google、本机" = "Used for full sentences; falls back to Google, then on-device";"整句用它;不行时换 Google" = "Used for full sentences; falls back to Google";+"先用 Google 翻译" = "Google Translate for now";"没有 key 时照常可用" = "Works without a key";"同传声音" = "Interpreting voice";"本机" = "On-device";@@ -40,20 +84,21 @@"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "Billed by chosen model. Only text is sent; speech recognition stays on-device.";"在 %@ 创建 key,复制后粘贴到这里。" = "Create a key on %@, then copy and paste it here.";"打开 %@ ↗" = "Open %@ ↗";+"暂时连不上" = "Can't connect right now";+"这个 key 用不了" = "This key doesn't work";+"模型用不了" = "The model doesn't work";"还没填好" = "Incomplete";"还没填 API key" = "No API key yet";"正在检查…" = "Checking…";"已连接" = "Connected";-"这个 key 用不了" = "This key doesn't work";-"暂时连不上" = "Can't connect right now";-"%@ · 响应约 %@ 秒" = "%1$@ · responds in about %2$@ s";-"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@ says the key is invalid. Check if it's copied completely, or create a new one.";+"%@ 现在很忙" = "%@ is busy right now";"不填 key 时,字幕和翻译仍可正常使用" = "Subtitles and translation work without a key";"更换" = "Change";-"重试" = "Retry";"保存并检查" = "Save and check";"取消" = "Cancel";"本机服务可不填" = "Optional for local services";+"这是 %@ 的 key。" = "This key is for %@.";+"改用 %@" = "Switch to %@";"移除" = "Remove";"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "Stored only on this Mac (readable only by your account) and sent only to %@";"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "Stored only on this Mac (readable only by your account) and sent only to %@ (%@)";@@ -61,6 +106,10 @@"地址" = "URL";"例如 qwen3:14b" = "e.g. qwen3:14b";"你填的地址" = "the URL you entered";+"%@ · 响应约 %@ 秒" = "%1$@ · responds in about %2$@ s";+"先用本机声音" = "Using this Mac's voice for now";+"上次同传时正常" = "Worked last time it interpreted";+"上次同传没出声,用了本机声音" = "Silent last time; this Mac's voice spoke instead";"Ming 的声音" = "Ming's voice";"没有 key 时用本机声音" = "Uses the Mac's voice without a key";"没填声音模型,用本机声音" = "No voice model set; using on-device voice";@@ -159,6 +208,7 @@"导入" = "Import";"欢迎使用%@" = "Welcome to %@";"设置" = "Settings";+"有新版本 %@" = "Version %@ is available";"正在记录会议" = "A meeting is being recorded";"退出会结束这场记录,已记下的内容会保存。" = "Quitting ends this recording. What has been recorded so far is saved.";"退出" = "Quit";@@ -295,10 +345,6 @@/* Ling */"这个服务" = "this service";-"找不到模型,或地址不对(HTTP %lld)" = "Model not found, or wrong URL (HTTP %lld)";-"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@ rejected the request (HTTP %lld). Check the model name.";-"连不上 %@,请检查网络或代理" = "Can't connect to %@. Check your network or proxy.";-"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "This service doesn't support JSON (HTTP %lld), so notes won't work";/* ListenEngine */"%@(识别中…)→ %@" = "%1$@ (detecting…) → %2$@";@@ -390,7 +436,8 @@/* NotesWindow */"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "The key stopped working (token deleted or free quota used up). Notes stop at %@.";-"请求过于频繁,稍后会自动重试。纪要停留在 %@。" = "Too many requests; retrying shortly. Notes stop at %@.";+"%@ 很忙,纪要稍后补上。字幕照常。" = "%@ is busy; notes will catch up. Subtitles go on.";+"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "Can't reach %1$@; notes stop at %2$@ for now. They resume when the network is back.";"这轮没整理好,下一轮会自动重试。" = "This round failed; the next one will retry.";"会议纪要" = "Meeting notes";"结束这场会议" = "End this meeting";@@ -434,7 +481,6 @@"改用%@重新整理" = "Rewrite in %@";"在会议记录中查看" = "View in Meetings";"开始新会议" = "New Meeting";-"更换 key" = "Change Key";"生成纪要需要 API key" = "Notes need an API key";"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "Transcript is still being saved. Enter a %@ key to generate notes from the beginning.";"获取 %@ key ↗" = "Get %@ key ↗";@@ -533,11 +579,6 @@"‹ 还是用 Ling" = "‹ Use Ling instead";"用不了 Ling?" = "Can't use Ling?";"粘贴 %@ 的 key" = "Paste %@ key";-"打开 %@" = "Open %@";-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "This key doesn't work. Check it was copied in full, or create a new one";-"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "No key starting with sk- in clipboard. Copy one from %@ first.";-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "No key starting with sk- on the clipboard. Copy it from the Ling platform first.";-"只保存在这台 Mac 上,只发给 %@" = "Stored only on this Mac, sent only to %@";"少了:" = "Missing:";"(只有 Ling 支持)" = "(Ling only)";"自然的同传声音、你自己的声音" = "Natural interpreting voice, your own voice";@@ -545,6 +586,10 @@"国内直接注册,不用代理;登录后点“创建令牌”" = "Sign up directly in China without a proxy; click \"Create Token\" after signing in";"打开 Ling 开放平台" = "Open Ling platform";"复制 sk- 开头的 key,回来粘贴" = "Copy the key that starts with sk-, then paste it here";+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "This key doesn't work. Check it was copied in full, or create a new one";+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "No key starting with sk- in clipboard. Copy one from %@ first.";+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "No key starting with sk- on the clipboard. Copy it from the Ling platform first.";+"只保存在这台 Mac 上,只发给 %@" = "Stored only on this Mac, sent only to %@";"现在可以用了" = "Now available";"开会时,纪要会跟着字幕一起更新。" = "In meetings, the notes update along with the subtitles.";"人名、术语前后一致" = "Names and terms stay consistent";@@ -757,7 +802,6 @@"同时录下对方那一侧" = "Recording their side at the same time";"停" = "Stop";"听" = "Play";-"%@ 秒" = "%@ s";"合成首音" = "First audio";"到达虚拟麦克风" = "Into the virtual mic";"没有 Ling key 时用 Google 翻译,需要能访问 Google。" = "Without a Ling key, translation uses Google, which must be reachable.";@@ -801,7 +845,6 @@"关掉说话人识别,记录里的名字一起收起" = "Turn off speaker identification; the names in your records are hidden too";"Ling 从对话里认出,点一下可以改" = "Ling found this name in the conversation; click to change";"改名字,或和别人合并" = "Rename, or merge with someone else";-"改名字" = "Rename";"不准?关掉" = "Wrong? Turn off";"说了 %lld 句" = "%lld lines";"是谁" = "Who";@@ -830,12 +873,14 @@"无法创建系统音频 Tap(%d)" = "Can't create the system audio tap (%d)";/* UpdateViews */-"下载进度" = "Download progress";"新版本 %@" = "Version %@";+"更新说明" = "Release Notes";+"下载进度" = "Download progress";"正在下载 %lld%%,完成后自动重新打开" = "Downloading %lld%%, reopens when done";"没能自动更新:%@。已打开下载页" = "Couldn’t update automatically: %@. Opened the download page";"安装后自动重新打开" = "Reopens after installing";-"更新说明" = "Release Notes";+"安装并重新打开" = "Install and Reopen";+"重试" = "Retry";"登录时打开" = "Open at Login";"版本 %@" = "Version %@";"首次引导" = "Getting started";@@ -843,13 +888,9 @@"开机后在菜单栏待命,不弹窗口" = "Waits in the menu bar, no windows";"正在下载 %@:%lld%%" = "Downloading %@: %lld%%";"没能自动更新:%@" = "Couldn’t update automatically: %@";-"有新版本 %@" = "Version %@ is available";-"知了有新版本 %@" = "Cicada %@ is available";-"点按安装,完成后自动重新打开" = "Click to install. Cicada reopens when it's done.";"已是最新版本" = "You’re up to date";"连不上 GitHub,请稍后再试" = "GitHub can’t be reached; try again later";"上次检查 %@" = "Last checked %@";-"安装并重新打开" = "Install and Reopen";"检查更新" = "Check for Updates";"重新看" = "Show Again";@@ -864,6 +905,8 @@"更新包无效" = "The update package is invalid";/* Updates */+"知了有新版本 %@" = "Cicada %@ is available";+"点按安装,完成后自动重新打开" = "Click to install. Cicada reopens when it's done.";"刚刚查过" = "checked now";"%lld 分钟前查过" = "checked %lld min ago";"%lld 小时前查过" = "checked %lld h ago";@@ -1054,24 +1097,30 @@/* Debug */"导入录音或视频" = "Import a Recording or Video";-/* RecordsView */-"%lld 人" = "%lld people";--/* RootView */-"好" = "OK";-"下一版就能用" = "Coming in the next version";+/* LiveViews */"正在听 · %@" = "Listening · %@";"对方说和翻译成" = "They speak, and translate into";"%lld 人在说" = "%lld people talking";"纪要 · %lld 条新" = "Notes · %lld new";"开始说话后,字幕会出现在这里" = "Subtitles show up here once people start talking";++/* RecordView */"只看 %@ · %lld 段 · 再点一下取消" = "Only %@ · %lld turns · tap again to clear";"只看这个人;按住可改名字,或和别人合并" = "Shows only this person; press and hold to rename or merge";+"改名字" = "Rename";++/* RecordsView */+"%lld 人" = "%lld people";++/* RoomListen */"正在准备…" = "Getting ready…";"请在设置里允许知了使用麦克风" = "Allow Cicada to use the microphone in Settings";"识别中断了,请重新开始听" = "Recognition stopped. Start listening again";-/* SettingsView (iOS) */+/* RootView */+"下一版就能用" = "Coming in the next version";++/* SettingsView */"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "On the Ling platform, click “Create token” and copy the string that starts with sk-.";"打开 Ling 开放平台 ↗" = "Open the Ling platform ↗";"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling says this token is invalid. Check that you copied all of it, or create a new one";diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.stringsindex 6afa0b5..81b63b8 100644--- a/Resources/ja.lproj/Localizable.strings+++ b/Resources/ja.lproj/Localizable.strings@@ -1,3 +1,39 @@+/* AICheck */+"连上 %@" = "%@ に接続";+"key 可以用" = "key が使える";+"纪要和翻译" = "メモと翻訳";+"这台 Mac 访问不到 %@。" = "この Mac から %@ にアクセスできません。";+"地址要用 https,只有 localhost 可以用 http。" = "アドレスは https にしてください。http は localhost のみ使えます。";+"%@ 说这个 key 无效,可能没复制全,或已删除。" = "%@ によるとこの key は無効です。コピーが途中で切れたか、削除された可能性があります。";+"这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。" = "これは ZenMux の管理用 key で、モデルを呼び出せません。sk-payg で始まる key を貼り付けてください。";+"%@ 账户余额不足。" = "%@ の残高が足りません。";+"%@ 上找不到 %@ 这个模型。" = "%1$@ にモデル %2$@ が見つかりません。";+"这个服务不支持 JSON,纪要写不了;翻译照常。" = "このサービスは JSON に対応していないため、メモを作れません。翻訳はそのまま使えます。";+"%@ 现在很忙,key 没问题。开会时会自动重试。" = "%@ は混み合っています。key は問題ありません。会議中は自動で再試行します。";+"%@ 暂时出错(HTTP %lld),稍后再试。" = "%@ で一時的なエラーです(HTTP %lld)。少し待ってから試してください。";+"开了代理也连不上:换一个节点,或检查代理软件是否放过 %@。" = "プロキシはオンですが接続できません。別のサーバーに切り替えるか、プロキシアプリが %@ を通しているか確認してください。";+"代理软件在运行(端口 %@),但没开系统代理。在代理软件里打开“系统代理”。" = "プロキシアプリは動いています(ポート %@)が、システムプロキシがオフです。プロキシアプリで「システムプロキシ」をオンにしてください。";+"这台电脑没开代理。在国内通常要开代理才能用 %@。" = "プロキシがオフです。中国本土では %@ を使うのに通常プロキシが必要です。";+"%@ 余额快用完了(还剩 $%@)" = "%1$@ の残高がもうすぐなくなります(残り $%2$@)";++/* AICheckView */+"%@ 秒" = "%@ 秒";+"开会用过一次后确认" = "最初の会議で確認されます";+"重新检查" = "再確認";+"怎么设置代理" = "プロキシの設定方法";+"更换 key" = "キーを変更";+"打开 %@" = "%@ を開く";+"去充值" = "チャージ";+"换成推荐的 %@" = "おすすめの %@ にする";+"字幕照常;纪要和整句翻译先停下" = "字幕はそのまま。メモと文単位の翻訳は一時停止します";+"连不上 %@" = "%@ に接続できません";+"%@ 的 key 用不了" = "%@ の key が使えません";+"AI 服务的设置要改一下" = "AI サービスの設定を見直してください";+"打开设置" = "設定を開く";+"用完后纪要会停下" = "なくなるとメモが止まります";+"%@ 开会时用过" = "%@に会議で使用";+"响应约 %@ 秒" = "応答 約 %@ 秒";+/* AIProviders */"更准" = "より正確";"更快、更省" = "高速・低コスト";@@ -13,13 +49,21 @@/* AISettings */"现在能用的" = "現在使える機能";"用 %@" = "%@ を使用";+"连上 %@ 后可用" = "%@ に接続すると使えます";+"换好 key 后可用" = "使える key にすると使えます";+"填好 key 后可用" = "キーを設定すると使えます";"实时纪要" = "ライブ議事メモ";+"很忙" = "混雑";+"会自动重试,纪要可能晚一点" = "自動で再試行します。メモは少し遅れることがあります";+"暂不可用" = "一時的に使えません";"需要 key" = "キーが必要";"会中每 45 秒更新" = "会議中は45秒ごとに更新";-"填好 key 后可用" = "キーを設定すると使えます";+"这个服务不支持 JSON" = "このサービスは JSON に非対応";+"换一个模型后可用" = "別のモデルにすると使えます";"翻译" = "翻訳";"整句用它;不行时换 Google、本机" = "文単位で使用(不可時は Google、オンデバイスに切替)";"整句用它;不行时换 Google" = "文単位で使用(不可時は Google に切替)";+"先用 Google 翻译" = "当面は Google 翻訳";"没有 key 时照常可用" = "キーがなくても使えます";"同传声音" = "同時通訳の声";"本机" = "オンデバイス";@@ -40,20 +84,21 @@"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "選択したモデルに応じて課金されます。送信されるのはテキストのみで、音声認識はオンデバイスで行われます。";"在 %@ 创建 key,复制后粘贴到这里。" = "%@ でキーを作成し、コピーしてここに貼り付けてください。";"打开 %@ ↗" = "%@ を開く ↗";+"暂时连不上" = "現在接続できません";+"这个 key 用不了" = "このキーは使えません";+"模型用不了" = "モデルが使えません";"还没填好" = "未入力の項目があります";"还没填 API key" = "API key が未設定";"正在检查…" = "確認中…";"已连接" = "接続済み";-"这个 key 用不了" = "このキーは使えません";-"暂时连不上" = "現在接続できません";-"%@ · 响应约 %@ 秒" = "%1$@ · 応答 約%2$@秒";-"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@ からキーが無効と返されました。すべてコピーされているか確認するか、新しく作成してください";+"%@ 现在很忙" = "%@ は混み合っています";"不填 key 时,字幕和翻译仍可正常使用" = "キーがなくても、字幕と翻訳は通常どおり使えます";"更换" = "変更";-"重试" = "再試行";"保存并检查" = "保存して確認";"取消" = "キャンセル";"本机服务可不填" = "ローカルサービスでは省略可";+"这是 %@ 的 key。" = "これは %@ の key です。";+"改用 %@" = "%@ に切り替える";"移除" = "削除";"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "この Mac にのみ保存され(あなたのアカウントのみ読み取り可)、%@ にのみ送信されます";"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "この Mac にのみ保存され(あなたのアカウントのみ読み取り可)、%@(%@)にのみ送信されます";@@ -61,6 +106,10 @@"地址" = "URL";"例如 qwen3:14b" = "例: qwen3:14b";"你填的地址" = "入力した URL";+"%@ · 响应约 %@ 秒" = "%1$@ · 応答 約%2$@秒";+"先用本机声音" = "当面はこの Mac の音声";+"上次同传时正常" = "前回の同時通訳では正常";+"上次同传没出声,用了本机声音" = "前回は音が出ず、この Mac の音声を使いました";"Ming 的声音" = "Ming の声";"没有 key 时用本机声音" = "キーがない場合は Mac の音声を使用";"没填声音模型,用本机声音" = "音声モデル未入力のため、オンデバイス音声を使用";@@ -159,6 +208,7 @@"导入" = "読み込む";"欢迎使用%@" = "%@へようこそ";"设置" = "設定";+"有新版本 %@" = "新しいバージョン %@ があります";"正在记录会议" = "会議を記録中です";"退出会结束这场记录,已记下的内容会保存。" = "終了するとこの記録も終わります。ここまでの内容は保存されます。";"退出" = "終了";@@ -295,10 +345,6 @@/* Ling */"这个服务" = "このサービス";-"找不到模型,或地址不对(HTTP %lld)" = "モデルが見つからないか、URL が間違っています(HTTP %lld)";-"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@ がリクエストを拒否しました(HTTP %lld)。モデル名を確認してください";-"连不上 %@,请检查网络或代理" = "%@ に接続できません。ネットワークまたはプロキシを確認してください";-"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "このサービスは JSON 非対応(HTTP %lld)のため、議事メモは使えません";/* ListenEngine */"%@(识别中…)→ %@" = "%1$@(検出中…)→ %2$@";@@ -390,7 +436,8 @@/* NotesWindow */"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "キーが無効になりました(トークンの削除、または無料枠の上限)。議事メモは%@で止まっています。";-"请求过于频繁,稍后会自动重试。纪要停留在 %@。" = "リクエストが多すぎます。しばらくして自動で再試行します。議事メモは%@で止まっています。";+"%@ 很忙,纪要稍后补上。字幕照常。" = "%@ が混み合っています。メモは後で追いつきます。字幕はそのまま。";+"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "%1$@ に接続できないため、メモは %2$@ で止まっています。ネットワークが戻ると自動で再開します。";"这轮没整理好,下一轮会自动重试。" = "今回の整理に失敗しました。次回自動で再試行します。";"会议纪要" = "会議の議事メモ";"结束这场会议" = "この会議を終了";@@ -434,7 +481,6 @@"改用%@重新整理" = "%@で書き直す";"在会议记录中查看" = "会議の記録で見る";"开始新会议" = "新しい会議を開始";-"更换 key" = "キーを変更";"生成纪要需要 API key" = "議事メモの作成には API key が必要です";"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "文字起こしは保存されています。%@ のキーを入力すると、最初から議事メモをまとめます。";"获取 %@ key ↗" = "%@ のキーを取得 ↗";@@ -533,11 +579,6 @@"‹ 还是用 Ling" = "‹ やはり Ling を使う";"用不了 Ling?" = "Ling が使えませんか?";"粘贴 %@ 的 key" = "%@ のキーを貼り付け";-"打开 %@" = "%@ を開く";-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "この key は無効です。最後までコピーできているか確認するか、作り直してください";-"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "クリップボードに sk- で始まるキーがありません。先に %@ でコピーしてください。";-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "クリップボードに sk- で始まるキーがありません。先に Ling プラットフォームでコピーしてください。";-"只保存在这台 Mac 上,只发给 %@" = "この Mac にのみ保存され、%@ にのみ送信されます";"少了:" = "使えない機能:";"(只有 Ling 支持)" = "(Ling のみ対応)";"自然的同传声音、你自己的声音" = "自然な同時通訳の声、自分の声";@@ -545,6 +586,10 @@"国内直接注册,不用代理;登录后点“创建令牌”" = "中国国内からプロキシなしで登録可能。ログイン後に「トークンを作成」をクリック";"打开 Ling 开放平台" = "Ling プラットフォームを開く";"复制 sk- 开头的 key,回来粘贴" = "sk- で始まるキーをコピーして、ここに貼り付け";+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "この key は無効です。最後までコピーできているか確認するか、作り直してください";+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "クリップボードに sk- で始まるキーがありません。先に %@ でコピーしてください。";+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "クリップボードに sk- で始まるキーがありません。先に Ling プラットフォームでコピーしてください。";+"只保存在这台 Mac 上,只发给 %@" = "この Mac にのみ保存され、%@ にのみ送信されます";"现在可以用了" = "使えるようになったもの";"开会时,纪要会跟着字幕一起更新。" = "会議中は、議事メモが字幕と一緒に更新されます。";"人名、术语前后一致" = "人名や用語が一貫";@@ -757,7 +802,6 @@"同时录下对方那一侧" = "相手側も同時に録音";"停" = "停止";"听" = "再生";-"%@ 秒" = "%@ 秒";"合成首音" = "最初の音";"到达虚拟麦克风" = "仮想マイク到達";"没有 Ling key 时用 Google 翻译,需要能访问 Google。" = "Ling key がない場合は Google 翻訳を使うため、Google に接続できる必要があります。";@@ -801,7 +845,6 @@"关掉说话人识别,记录里的名字一起收起" = "話者識別をオフにします(記録の名前も隠れます)";"Ling 从对话里认出,点一下可以改" = "Ling が会話から見つけた名前です。クリックで変更";"改名字,或和别人合并" = "名前を付ける、またはほかの人とまとめる";-"改名字" = "名前を変更";"不准?关掉" = "不正確?オフにする";"说了 %lld 句" = "%lld 回発言";"是谁" = "誰か";@@ -830,12 +873,14 @@"无法创建系统音频 Tap(%d)" = "システム音声 Tap を作成できません(%d)";/* UpdateViews */-"下载进度" = "ダウンロードの進行状況";"新版本 %@" = "バージョン %@";+"更新说明" = "リリースノート";+"下载进度" = "ダウンロードの進行状況";"正在下载 %lld%%,完成后自动重新打开" = "ダウンロード中 %lld%%、完了後に再起動";"没能自动更新:%@。已打开下载页" = "自動アップデートできませんでした:%@。ダウンロードページを開きました";"安装后自动重新打开" = "インストール後に自動で再起動";-"更新说明" = "リリースノート";+"安装并重新打开" = "インストールして再起動";+"重试" = "再試行";"登录时打开" = "ログイン時に開く";"版本 %@" = "バージョン %@";"首次引导" = "はじめに";@@ -843,13 +888,9 @@"开机后在菜单栏待命,不弹窗口" = "メニューバーで待機し、ウインドウは開きません";"正在下载 %@:%lld%%" = "%@ をダウンロード中:%lld%%";"没能自动更新:%@" = "自動アップデートできませんでした:%@";-"有新版本 %@" = "新しいバージョン %@ があります";-"知了有新版本 %@" = "Cicada %@ が利用可能です";-"点按安装,完成后自动重新打开" = "クリックでインストール。完了すると自動で開き直します";"已是最新版本" = "最新バージョンです";"连不上 GitHub,请稍后再试" = "GitHub に接続できません。後でお試しください";"上次检查 %@" = "最終確認 %@";-"安装并重新打开" = "インストールして再起動";"检查更新" = "アップデートを確認";"重新看" = "もう一度見る";@@ -864,6 +905,8 @@"更新包无效" = "アップデートパッケージが無効です";/* Updates */+"知了有新版本 %@" = "Cicada %@ が利用可能です";+"点按安装,完成后自动重新打开" = "クリックでインストール。完了すると自動で開き直します";"刚刚查过" = "たった今確認";"%lld 分钟前查过" = "%lld 分前に確認";"%lld 小时前查过" = "%lld 時間前に確認";@@ -1054,24 +1097,30 @@/* Debug */"导入录音或视频" = "録音や動画を読み込む";-/* RecordsView */-"%lld 人" = "%lld 人";--/* RootView */-"好" = "OK";-"下一版就能用" = "次のバージョンで使えます";+/* LiveViews */"正在听 · %@" = "聞いています · %@";"对方说和翻译成" = "相手の言語と翻訳先";"%lld 人在说" = "%lld 人が話しています";"纪要 · %lld 条新" = "メモ · 新着 %lld 件";"开始说话后,字幕会出现在这里" = "話し始めると、ここに字幕が出ます";++/* RecordView */"只看 %@ · %lld 段 · 再点一下取消" = "%@ だけ · %lld か所 · もう一度タップで解除";"只看这个人;按住可改名字,或和别人合并" = "この人だけを表示。長押しで名前の変更や統合";+"改名字" = "名前を変更";++/* RecordsView */+"%lld 人" = "%lld 人";++/* RoomListen */"正在准备…" = "準備しています…";"请在设置里允许知了使用麦克风" = "設定で Cicada にマイクの使用を許可してください";"识别中断了,请重新开始听" = "認識が止まりました。もう一度聞き始めてください";-/* SettingsView (iOS) */+/* RootView */+"下一版就能用" = "次のバージョンで使えます";++/* SettingsView */"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "Ling のプラットフォームで「トークンを作成」をクリックし、sk- で始まる文字列をコピーします。";"打开 Ling 开放平台 ↗" = "Ling プラットフォームを開く ↗";"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling がこのトークンは無効だと通知しました。全体をコピーできているか確認するか、新しく作成してください";diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.stringsindex cdac75d..ca244e5 100644--- a/Resources/ko.lproj/Localizable.strings+++ b/Resources/ko.lproj/Localizable.strings@@ -1,3 +1,39 @@+/* AICheck */+"连上 %@" = "%@ 연결";+"key 可以用" = "key 사용 가능";+"纪要和翻译" = "노트와 번역";+"这台 Mac 访问不到 %@。" = "이 Mac에서 %@에 접속할 수 없습니다.";+"地址要用 https,只有 localhost 可以用 http。" = "주소는 https여야 합니다. http는 localhost에서만 쓸 수 있습니다.";+"%@ 说这个 key 无效,可能没复制全,或已删除。" = "%@에서 이 key가 유효하지 않다고 합니다. 일부만 복사됐거나 삭제됐을 수 있습니다.";+"这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。" = "ZenMux 관리용 key라서 모델을 호출할 수 없습니다. sk-payg로 시작하는 key를 붙여넣으세요.";+"%@ 账户余额不足。" = "%@ 잔액이 부족합니다.";+"%@ 上找不到 %@ 这个模型。" = "%1$@에 %2$@ 모델이 없습니다.";+"这个服务不支持 JSON,纪要写不了;翻译照常。" = "이 서비스는 JSON을 지원하지 않아 노트를 만들 수 없습니다. 번역은 그대로 됩니다.";+"%@ 现在很忙,key 没问题。开会时会自动重试。" = "%@가 지금 붐빕니다. key는 문제없습니다. 회의 중에는 자동으로 다시 시도합니다.";+"%@ 暂时出错(HTTP %lld),稍后再试。" = "%@에 일시적인 오류가 있습니다(HTTP %lld). 잠시 후 다시 시도하세요.";+"开了代理也连不上:换一个节点,或检查代理软件是否放过 %@。" = "프록시가 켜져 있는데도 연결되지 않습니다. 다른 서버로 바꾸거나 프록시 앱이 %@를 통과시키는지 확인하세요.";+"代理软件在运行(端口 %@),但没开系统代理。在代理软件里打开“系统代理”。" = "프록시 앱이 실행 중이지만(포트 %@) 시스템 프록시가 꺼져 있습니다. 프록시 앱에서 ‘시스템 프록시’를 켜세요.";+"这台电脑没开代理。在国内通常要开代理才能用 %@。" = "프록시가 꺼져 있습니다. 중국 본토에서는 보통 %@를 쓰려면 프록시가 필요합니다.";+"%@ 余额快用完了(还剩 $%@)" = "%1$@ 잔액이 거의 다 떨어졌습니다(남은 금액 $%2$@)";++/* AICheckView */+"%@ 秒" = "%@초";+"开会用过一次后确认" = "첫 회의 후 확인됩니다";+"重新检查" = "다시 확인";+"怎么设置代理" = "프록시 설정 방법";+"更换 key" = "key 변경";+"打开 %@" = "%@ 열기";+"去充值" = "충전하기";+"换成推荐的 %@" = "추천 모델 %@로 바꾸기";+"字幕照常;纪要和整句翻译先停下" = "자막은 그대로이고 노트와 문장 번역은 잠시 멈춥니다";+"连不上 %@" = "%@에 연결할 수 없음";+"%@ 的 key 用不了" = "%@ key를 쓸 수 없음";+"AI 服务的设置要改一下" = "AI 서비스 설정을 바꿔야 합니다";+"打开设置" = "설정 열기";+"用完后纪要会停下" = "다 쓰면 노트가 멈춥니다";+"%@ 开会时用过" = "%@ 회의에서 사용함";+"响应约 %@ 秒" = "응답 약 %@초";+/* AIProviders */"更准" = "더 정확함";"更快、更省" = "더 빠르고 저렴함";@@ -13,13 +49,21 @@/* AISettings */"现在能用的" = "지금 사용 가능";"用 %@" = "%@ 사용";+"连上 %@ 后可用" = "%@에 연결되면 사용 가능";+"换好 key 后可用" = "작동하는 key를 넣으면 사용 가능";+"填好 key 后可用" = "key를 입력하면 사용할 수 있습니다";"实时纪要" = "실시간 회의록";+"很忙" = "붐빔";+"会自动重试,纪要可能晚一点" = "자동으로 다시 시도합니다. 노트가 조금 늦을 수 있습니다";+"暂不可用" = "지금은 사용 불가";"需要 key" = "key 필요";"会中每 45 秒更新" = "회의 중 45초마다 업데이트";-"填好 key 后可用" = "key를 입력하면 사용할 수 있습니다";+"这个服务不支持 JSON" = "이 서비스는 JSON 미지원";+"换一个模型后可用" = "다른 모델로 바꾸면 사용 가능";"翻译" = "번역";"整句用它;不行时换 Google、本机" = "전체 문장에 사용, 실패 시 Google 및 온디바이스로 전환";"整句用它;不行时换 Google" = "전체 문장에 사용, 실패 시 Google로 전환";+"先用 Google 翻译" = "당분간 Google 번역 사용";"没有 key 时照常可用" = "key 없이도 사용 가능";"同传声音" = "동시통역 음성";"本机" = "온디바이스";@@ -40,20 +84,21 @@"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "선택한 모델 기준으로 과금됩니다. 텍스트만 전송되며 음성 인식은 온디바이스에서 처리됩니다.";"在 %@ 创建 key,复制后粘贴到这里。" = "%@에서 key를 생성한 후 복사하여 여기에 붙여넣으세요.";"打开 %@ ↗" = "%@ 열기 ↗";+"暂时连不上" = "지금은 연결할 수 없음";+"这个 key 用不了" = "이 key는 사용할 수 없음";+"模型用不了" = "모델을 쓸 수 없음";"还没填好" = "아직 입력되지 않음";"还没填 API key" = "API key 없음";"正在检查…" = "확인 중…";"已连接" = "연결됨";-"这个 key 用不了" = "이 key는 사용할 수 없음";-"暂时连不上" = "지금은 연결할 수 없음";-"%@ · 响应约 %@ 秒" = "%1$@ · 응답 약 %2$@초";-"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@에서 유효하지 않은 key라고 합니다. 전체가 복사되었는지 확인하거나 새로 생성하세요";+"%@ 现在很忙" = "%@가 지금 붐빕니다";"不填 key 时,字幕和翻译仍可正常使用" = "key 없이도 자막과 번역은 사용할 수 있습니다";"更换" = "변경";-"重试" = "다시 시도";"保存并检查" = "저장 및 확인";"取消" = "취소";"本机服务可不填" = "로컬 서비스는 비워둘 수 있음";+"这是 %@ 的 key。" = "%@ key입니다.";+"改用 %@" = "%@로 바꾸기";"移除" = "제거";"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "이 Mac에만 저장되며(내 계정만 읽기 가능) %@에만 전송됩니다";"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "이 Mac에만 저장되며(내 계정만 읽기 가능) %@(%@)에만 전송됩니다";@@ -61,6 +106,10 @@"地址" = "주소";"例如 qwen3:14b" = "예: qwen3:14b";"你填的地址" = "입력한 주소";+"%@ · 响应约 %@ 秒" = "%1$@ · 응답 약 %2$@초";+"先用本机声音" = "당분간 이 Mac의 음성 사용";+"上次同传时正常" = "지난 통역 때 정상";+"上次同传没出声,用了本机声音" = "지난번엔 소리가 안 나서 이 Mac의 음성을 썼습니다";"Ming 的声音" = "Ming의 음성";"没有 key 时用本机声音" = "key가 없으면 이 Mac의 음성 사용";"没填声音模型,用本机声音" = "음성 모델 미입력, 온디바이스 음성 사용";@@ -159,6 +208,7 @@"导入" = "가져오기";"欢迎使用%@" = "%@에 오신 것을 환영합니다";"设置" = "설정";+"有新版本 %@" = "새 버전 %@ 사용 가능";"正在记录会议" = "회의를 기록하는 중";"退出会结束这场记录,已记下的内容会保存。" = "종료하면 이 기록이 끝납니다. 지금까지 기록한 내용은 저장됩니다.";"退出" = "종료";@@ -295,10 +345,6 @@/* Ling */"这个服务" = "이 서비스";-"找不到模型,或地址不对(HTTP %lld)" = "모델을 찾을 수 없거나 주소가 잘못됨 (HTTP %lld)";-"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@에서 요청을 거부함(HTTP %lld). 모델 이름을 확인하세요";-"连不上 %@,请检查网络或代理" = "%@에 연결할 수 없음. 네트워크 또는 프록시를 확인하세요";-"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "이 서비스는 JSON을 지원하지 않아(HTTP %lld) 회의록을 사용할 수 없음";/* ListenEngine */"%@(识别中…)→ %@" = "%1$@(감지 중…) → %2$@";@@ -390,7 +436,8 @@/* NotesWindow */"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "key가 만료되었습니다(토큰 삭제 또는 무료 한도 소진). 회의록은 %@까지만 작성되었습니다.";-"请求过于频繁,稍后会自动重试。纪要停留在 %@。" = "요청이 너무 잦습니다. 곧 자동으로 다시 시도합니다. 회의록은 %@까지입니다.";+"%@ 很忙,纪要稍后补上。字幕照常。" = "%@가 붐빕니다. 노트는 나중에 채워집니다. 자막은 그대로입니다.";+"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "%1$@에 연결할 수 없어 노트가 %2$@에서 멈춰 있습니다. 네트워크가 돌아오면 자동으로 이어집니다.";"这轮没整理好,下一轮会自动重试。" = "이번에는 정리하지 못했습니다. 다음 차례에 자동으로 다시 시도합니다.";"会议纪要" = "회의록";"结束这场会议" = "이 회의 종료";@@ -434,7 +481,6 @@"改用%@重新整理" = "%@로 다시 작성";"在会议记录中查看" = "회의 기록에서 보기";"开始新会议" = "새 회의 시작";-"更换 key" = "key 변경";"生成纪要需要 API key" = "회의록 작성에는 API key가 필요합니다";"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "텍스트 기록은 계속 저장 중입니다. %@의 key를 입력하면 처음부터 전체 회의록을 정리합니다.";"获取 %@ key ↗" = "%@ key 받기 ↗";@@ -533,11 +579,6 @@"‹ 还是用 Ling" = "‹ 그래도 Ling 사용";"用不了 Ling?" = "Ling을 사용할 수 없나요?";"粘贴 %@ 的 key" = "%@ key 붙여넣기";-"打开 %@" = "%@ 열기";-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "이 key는 유효하지 않습니다. 전부 복사됐는지 확인하거나 새로 만드세요";-"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "클립보드에 sk-로 시작하는 key가 없습니다. 먼저 %@에서 복사하세요.";-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "클립보드에 sk-로 시작하는 키가 없습니다. 먼저 Ling 플랫폼에서 복사하세요.";-"只保存在这台 Mac 上,只发给 %@" = "이 Mac에만 저장되며 %@에만 전송됨";"少了:" = "제외된 기능:";"(只有 Ling 支持)" = "(Ling만 지원)";"自然的同传声音、你自己的声音" = "자연스러운 동시통역 음성, 내 목소리";@@ -545,6 +586,10 @@"国内直接注册,不用代理;登录后点“创建令牌”" = "중국 내에서 프록시 없이 직접 가입 가능. 로그인 후 '토큰 생성' 클릭";"打开 Ling 开放平台" = "Ling 플랫폼 열기";"复制 sk- 开头的 key,回来粘贴" = "sk-로 시작하는 키를 복사해 여기에 붙여넣기";+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "이 key는 유효하지 않습니다. 전부 복사됐는지 확인하거나 새로 만드세요";+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "클립보드에 sk-로 시작하는 key가 없습니다. 먼저 %@에서 복사하세요.";+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "클립보드에 sk-로 시작하는 키가 없습니다. 먼저 Ling 플랫폼에서 복사하세요.";+"只保存在这台 Mac 上,只发给 %@" = "이 Mac에만 저장되며 %@에만 전송됨";"现在可以用了" = "이제 사용 가능";"开会时,纪要会跟着字幕一起更新。" = "회의 중에는 회의록이 자막과 함께 업데이트됩니다.";"人名、术语前后一致" = "이름과 용어가 일관됨";@@ -757,7 +802,6 @@"同时录下对方那一侧" = "상대 쪽도 동시에 녹음";"停" = "정지";"听" = "재생";-"%@ 秒" = "%@초";"合成首音" = "첫 음성";"到达虚拟麦克风" = "가상 마이크 도달";"没有 Ling key 时用 Google 翻译,需要能访问 Google。" = "Ling key가 없으면 Google 번역을 쓰므로 Google에 접속할 수 있어야 합니다.";@@ -801,7 +845,6 @@"关掉说话人识别,记录里的名字一起收起" = "화자 인식을 꺼요(기록의 이름도 숨겨져요)";"Ling 从对话里认出,点一下可以改" = "Ling이 대화에서 찾은 이름이에요. 클릭해서 바꿀 수 있어요";"改名字,或和别人合并" = "이름을 바꾸거나 다른 사람과 합치기";-"改名字" = "이름 바꾸기";"不准?关掉" = "틀렸나요? 끄기";"说了 %lld 句" = "%lld번 발언";"是谁" = "누구인지";@@ -830,12 +873,14 @@"无法创建系统音频 Tap(%d)" = "시스템 오디오 Tap을 만들 수 없습니다(%d)";/* UpdateViews */-"下载进度" = "다운로드 진행률";"新版本 %@" = "버전 %@";+"更新说明" = "릴리스 노트";+"下载进度" = "다운로드 진행률";"正在下载 %lld%%,完成后自动重新打开" = "다운로드 중 %lld%%, 완료되면 다시 열림";"没能自动更新:%@。已打开下载页" = "자동 업데이트 실패: %@. 다운로드 페이지를 열었습니다";"安装后自动重新打开" = "설치 후 자동으로 다시 열림";-"更新说明" = "릴리스 노트";+"安装并重新打开" = "설치 후 다시 열기";+"重试" = "다시 시도";"登录时打开" = "로그인 시 열기";"版本 %@" = "버전 %@";"首次引导" = "시작 안내";@@ -843,13 +888,9 @@"开机后在菜单栏待命,不弹窗口" = "메뉴 막대에서 대기하며 창을 띄우지 않음";"正在下载 %@:%lld%%" = "%@ 다운로드 중: %lld%%";"没能自动更新:%@" = "자동 업데이트 실패: %@";-"有新版本 %@" = "새 버전 %@ 사용 가능";-"知了有新版本 %@" = "Cicada %@ 버전이 나왔습니다";-"点按安装,完成后自动重新打开" = "클릭하면 설치하고, 끝나면 다시 열립니다";"已是最新版本" = "최신 버전입니다";"连不上 GitHub,请稍后再试" = "GitHub에 연결할 수 없습니다. 나중에 다시 시도하세요";"上次检查 %@" = "마지막 확인 %@";-"安装并重新打开" = "설치 후 다시 열기";"检查更新" = "업데이트 확인";"重新看" = "다시 보기";@@ -864,6 +905,8 @@"更新包无效" = "업데이트 패키지가 올바르지 않습니다";/* Updates */+"知了有新版本 %@" = "Cicada %@ 버전이 나왔습니다";+"点按安装,完成后自动重新打开" = "클릭하면 설치하고, 끝나면 다시 열립니다";"刚刚查过" = "방금 확인함";"%lld 分钟前查过" = "%lld분 전 확인";"%lld 小时前查过" = "%lld시간 전 확인";@@ -1054,24 +1097,30 @@/* Debug */"导入录音或视频" = "녹음 또는 동영상 가져오기";-/* RecordsView */-"%lld 人" = "%lld명";--/* RootView */-"好" = "확인";-"下一版就能用" = "다음 버전에서 사용할 수 있어요";+/* LiveViews */"正在听 · %@" = "듣는 중 · %@";"对方说和翻译成" = "상대 언어와 번역할 언어";"%lld 人在说" = "%lld명이 말하는 중";"纪要 · %lld 条新" = "회의록 · 새 항목 %lld개";"开始说话后,字幕会出现在这里" = "말하기 시작하면 여기에 자막이 나타납니다";++/* RecordView */"只看 %@ · %lld 段 · 再点一下取消" = "%@만 보기 · %lld개 구간 · 다시 탭하면 해제";"只看这个人;按住可改名字,或和别人合并" = "이 사람만 표시합니다. 길게 눌러 이름을 바꾸거나 합칩니다";+"改名字" = "이름 바꾸기";++/* RecordsView */+"%lld 人" = "%lld명";++/* RoomListen */"正在准备…" = "준비하는 중…";"请在设置里允许知了使用麦克风" = "설정에서 Cicada의 마이크 사용을 허용하세요";"识别中断了,请重新开始听" = "인식이 멈췄습니다. 다시 듣기를 시작하세요";-/* SettingsView (iOS) */+/* RootView */+"下一版就能用" = "다음 버전에서 사용할 수 있어요";++/* SettingsView */"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "Ling 개발자 플랫폼에서 “토큰 만들기”를 클릭하고 sk-로 시작하는 문자열을 복사하세요.";"打开 Ling 开放平台 ↗" = "Ling 개발자 플랫폼 열기 ↗";"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling에서 이 토큰이 유효하지 않다고 합니다. 전체를 복사했는지 확인하거나 새로 만드세요";diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.stringsindex c4084be..51d5082 100644--- a/Resources/zh-Hans.lproj/Localizable.strings+++ b/Resources/zh-Hans.lproj/Localizable.strings@@ -1,3 +1,39 @@+/* AICheck */+"连上 %@" = "连上 %@";+"key 可以用" = "key 可以用";+"纪要和翻译" = "纪要和翻译";+"这台 Mac 访问不到 %@。" = "这台 Mac 访问不到 %@。";+"地址要用 https,只有 localhost 可以用 http。" = "地址要用 https,只有 localhost 可以用 http。";+"%@ 说这个 key 无效,可能没复制全,或已删除。" = "%@ 说这个 key 无效,可能没复制全,或已删除。";+"这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。" = "这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。";+"%@ 账户余额不足。" = "%@ 账户余额不足。";+"%@ 上找不到 %@ 这个模型。" = "%@ 上找不到 %@ 这个模型。";+"这个服务不支持 JSON,纪要写不了;翻译照常。" = "这个服务不支持 JSON,纪要写不了;翻译照常。";+"%@ 现在很忙,key 没问题。开会时会自动重试。" = "%@ 现在很忙,key 没问题。开会时会自动重试。";+"%@ 暂时出错(HTTP %lld),稍后再试。" = "%@ 暂时出错(HTTP %lld),稍后再试。";+"开了代理也连不上:换一个节点,或检查代理软件是否放过 %@。" = "开了代理也连不上:换一个节点,或检查代理软件是否放过 %@。";+"代理软件在运行(端口 %@),但没开系统代理。在代理软件里打开“系统代理”。" = "代理软件在运行(端口 %@),但没开系统代理。在代理软件里打开“系统代理”。";+"这台电脑没开代理。在国内通常要开代理才能用 %@。" = "这台电脑没开代理。在国内通常要开代理才能用 %@。";+"%@ 余额快用完了(还剩 $%@)" = "%@ 余额快用完了(还剩 $%@)";++/* AICheckView */+"%@ 秒" = "%@ 秒";+"开会用过一次后确认" = "开会用过一次后确认";+"重新检查" = "重新检查";+"怎么设置代理" = "怎么设置代理";+"更换 key" = "更换 key";+"打开 %@" = "打开 %@";+"去充值" = "去充值";+"换成推荐的 %@" = "换成推荐的 %@";+"字幕照常;纪要和整句翻译先停下" = "字幕照常;纪要和整句翻译先停下";+"连不上 %@" = "连不上 %@";+"%@ 的 key 用不了" = "%@ 的 key 用不了";+"AI 服务的设置要改一下" = "AI 服务的设置要改一下";+"打开设置" = "打开设置";+"用完后纪要会停下" = "用完后纪要会停下";+"%@ 开会时用过" = "%@ 开会时用过";+"响应约 %@ 秒" = "响应约 %@ 秒";+/* AIProviders */"更准" = "更准";"更快、更省" = "更快、更省";@@ -13,13 +49,21 @@/* AISettings */"现在能用的" = "现在能用的";"用 %@" = "用 %@";+"连上 %@ 后可用" = "连上 %@ 后可用";+"换好 key 后可用" = "换好 key 后可用";+"填好 key 后可用" = "填好 key 后可用";"实时纪要" = "实时纪要";+"很忙" = "很忙";+"会自动重试,纪要可能晚一点" = "会自动重试,纪要可能晚一点";+"暂不可用" = "暂不可用";"需要 key" = "需要 key";"会中每 45 秒更新" = "会中每 45 秒更新";-"填好 key 后可用" = "填好 key 后可用";+"这个服务不支持 JSON" = "这个服务不支持 JSON";+"换一个模型后可用" = "换一个模型后可用";"翻译" = "翻译";"整句用它;不行时换 Google、本机" = "整句用它;不行时换 Google、本机";"整句用它;不行时换 Google" = "整句用它;不行时换 Google";+"先用 Google 翻译" = "先用 Google 翻译";"没有 key 时照常可用" = "没有 key 时照常可用";"同传声音" = "同传声音";"本机" = "本机";@@ -40,20 +84,21 @@"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "按所选模型计费。发出去的只有文字,语音识别留在本机。";"在 %@ 创建 key,复制后粘贴到这里。" = "在 %@ 创建 key,复制后粘贴到这里。";"打开 %@ ↗" = "打开 %@ ↗";+"暂时连不上" = "暂时连不上";+"这个 key 用不了" = "这个 key 用不了";+"模型用不了" = "模型用不了";"还没填好" = "还没填好";"还没填 API key" = "还没填 API key";"正在检查…" = "正在检查…";"已连接" = "已连接";-"这个 key 用不了" = "这个 key 用不了";-"暂时连不上" = "暂时连不上";-"%@ · 响应约 %@ 秒" = "%@ · 响应约 %@ 秒";-"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@ 提示 key 无效,请检查是否复制完整,或重新创建一个";+"%@ 现在很忙" = "%@ 现在很忙";"不填 key 时,字幕和翻译仍可正常使用" = "不填 key 时,字幕和翻译仍可正常使用";"更换" = "更换";-"重试" = "重试";"保存并检查" = "保存并检查";"取消" = "取消";"本机服务可不填" = "本机服务可不填";+"这是 %@ 的 key。" = "这是 %@ 的 key。";+"改用 %@" = "改用 %@";"移除" = "移除";"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "只存在这台 Mac 上(只有你的账户能读),只发给 %@";"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)";@@ -61,6 +106,10 @@"地址" = "地址";"例如 qwen3:14b" = "例如 qwen3:14b";"你填的地址" = "你填的地址";+"%@ · 响应约 %@ 秒" = "%@ · 响应约 %@ 秒";+"先用本机声音" = "先用本机声音";+"上次同传时正常" = "上次同传时正常";+"上次同传没出声,用了本机声音" = "上次同传没出声,用了本机声音";"Ming 的声音" = "Ming 的声音";"没有 key 时用本机声音" = "没有 key 时用本机声音";"没填声音模型,用本机声音" = "没填声音模型,用本机声音";@@ -159,6 +208,7 @@"导入" = "导入";"欢迎使用%@" = "欢迎使用%@";"设置" = "设置";+"有新版本 %@" = "有新版本 %@";"正在记录会议" = "正在记录会议";"退出会结束这场记录,已记下的内容会保存。" = "退出会结束这场记录,已记下的内容会保存。";"退出" = "退出";@@ -295,10 +345,6 @@/* Ling */"这个服务" = "这个服务";-"找不到模型,或地址不对(HTTP %lld)" = "找不到模型,或地址不对(HTTP %lld)";-"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@ 拒绝了请求(HTTP %lld),请检查模型名";-"连不上 %@,请检查网络或代理" = "连不上 %@,请检查网络或代理";-"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "这个服务不支持 JSON(HTTP %lld),纪要用不了";/* ListenEngine */"%@(识别中…)→ %@" = "%@(识别中…)→ %@";@@ -390,7 +436,8 @@/* NotesWindow */"key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。" = "key 已失效(令牌被删或免费额度用尽),纪要停留在 %@。";-"请求过于频繁,稍后会自动重试。纪要停留在 %@。" = "请求过于频繁,稍后会自动重试。纪要停留在 %@。";+"%@ 很忙,纪要稍后补上。字幕照常。" = "%@ 很忙,纪要稍后补上。字幕照常。";+"连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。" = "连不上 %@,这段时间的纪要先停在 %@。网络恢复后自动继续。";"这轮没整理好,下一轮会自动重试。" = "这轮没整理好,下一轮会自动重试。";"会议纪要" = "会议纪要";"结束这场会议" = "结束这场会议";@@ -434,7 +481,6 @@"改用%@重新整理" = "改用%@重新整理";"在会议记录中查看" = "在会议记录中查看";"开始新会议" = "开始新会议";-"更换 key" = "更换 key";"生成纪要需要 API key" = "生成纪要需要 API key";"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。";"获取 %@ key ↗" = "获取 %@ key ↗";@@ -533,11 +579,6 @@"‹ 还是用 Ling" = "‹ 还是用 Ling";"用不了 Ling?" = "用不了 Ling?";"粘贴 %@ 的 key" = "粘贴 %@ 的 key";-"打开 %@" = "打开 %@";-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "这个 key 无效,请检查是否复制完整,或重新创建一个";-"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。";-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。";-"只保存在这台 Mac 上,只发给 %@" = "只保存在这台 Mac 上,只发给 %@";"少了:" = "少了:";"(只有 Ling 支持)" = "(只有 Ling 支持)";"自然的同传声音、你自己的声音" = "自然的同传声音、你自己的声音";@@ -545,6 +586,10 @@"国内直接注册,不用代理;登录后点“创建令牌”" = "国内直接注册,不用代理;登录后点“创建令牌”";"打开 Ling 开放平台" = "打开 Ling 开放平台";"复制 sk- 开头的 key,回来粘贴" = "复制 sk- 开头的 key,回来粘贴";+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "这个 key 无效,请检查是否复制完整,或重新创建一个";+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。";+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。";+"只保存在这台 Mac 上,只发给 %@" = "只保存在这台 Mac 上,只发给 %@";"现在可以用了" = "现在可以用了";"开会时,纪要会跟着字幕一起更新。" = "开会时,纪要会跟着字幕一起更新。";"人名、术语前后一致" = "人名、术语前后一致";@@ -757,7 +802,6 @@"同时录下对方那一侧" = "同时录下对方那一侧";"停" = "停";"听" = "听";-"%@ 秒" = "%@ 秒";"合成首音" = "合成首音";"到达虚拟麦克风" = "到达虚拟麦克风";"没有 Ling key 时用 Google 翻译,需要能访问 Google。" = "没有 Ling key 时用 Google 翻译,需要能访问 Google。";@@ -801,7 +845,6 @@"关掉说话人识别,记录里的名字一起收起" = "关掉说话人识别,记录里的名字一起收起";"Ling 从对话里认出,点一下可以改" = "Ling 从对话里认出,点一下可以改";"改名字,或和别人合并" = "改名字,或和别人合并";-"改名字" = "改名字";"不准?关掉" = "不准?关掉";"说了 %lld 句" = "说了 %lld 句";"是谁" = "是谁";@@ -830,12 +873,14 @@"无法创建系统音频 Tap(%d)" = "无法创建系统音频 Tap(%d)";/* UpdateViews */-"下载进度" = "下载进度";"新版本 %@" = "新版本 %@";+"更新说明" = "更新说明";+"下载进度" = "下载进度";"正在下载 %lld%%,完成后自动重新打开" = "正在下载 %lld%%,完成后自动重新打开";"没能自动更新:%@。已打开下载页" = "没能自动更新:%@。已打开下载页";"安装后自动重新打开" = "安装后自动重新打开";-"更新说明" = "更新说明";+"安装并重新打开" = "安装并重新打开";+"重试" = "重试";"登录时打开" = "登录时打开";"版本 %@" = "版本 %@";"首次引导" = "首次引导";@@ -843,13 +888,9 @@"开机后在菜单栏待命,不弹窗口" = "开机后在菜单栏待命,不弹窗口";"正在下载 %@:%lld%%" = "正在下载 %@:%lld%%";"没能自动更新:%@" = "没能自动更新:%@";-"有新版本 %@" = "有新版本 %@";-"知了有新版本 %@" = "知了有新版本 %@";-"点按安装,完成后自动重新打开" = "点按安装,完成后自动重新打开";"已是最新版本" = "已是最新版本";"连不上 GitHub,请稍后再试" = "连不上 GitHub,请稍后再试";"上次检查 %@" = "上次检查 %@";-"安装并重新打开" = "安装并重新打开";"检查更新" = "检查更新";"重新看" = "重新看";@@ -864,6 +905,8 @@"更新包无效" = "更新包无效";/* Updates */+"知了有新版本 %@" = "知了有新版本 %@";+"点按安装,完成后自动重新打开" = "点按安装,完成后自动重新打开";"刚刚查过" = "刚刚查过";"%lld 分钟前查过" = "%lld 分钟前查过";"%lld 小时前查过" = "%lld 小时前查过";@@ -1054,24 +1097,30 @@/* Debug */"导入录音或视频" = "导入录音或视频";-/* RecordsView */-"%lld 人" = "%lld 人";--/* RootView */-"好" = "好";-"下一版就能用" = "下一版就能用";+/* LiveViews */"正在听 · %@" = "正在听 · %@";"对方说和翻译成" = "对方说和翻译成";"%lld 人在说" = "%lld 人在说";"纪要 · %lld 条新" = "纪要 · %lld 条新";"开始说话后,字幕会出现在这里" = "开始说话后,字幕会出现在这里";++/* RecordView */"只看 %@ · %lld 段 · 再点一下取消" = "只看 %@ · %lld 段 · 再点一下取消";"只看这个人;按住可改名字,或和别人合并" = "只看这个人;按住可改名字,或和别人合并";+"改名字" = "改名字";++/* RecordsView */+"%lld 人" = "%lld 人";++/* RoomListen */"正在准备…" = "正在准备…";"请在设置里允许知了使用麦克风" = "请在设置里允许知了使用麦克风";"识别中断了,请重新开始听" = "识别中断了,请重新开始听";-/* SettingsView (iOS) */+/* RootView */+"下一版就能用" = "下一版就能用";++/* SettingsView */"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。";"打开 Ling 开放平台 ↗" = "打开 Ling 开放平台 ↗";"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个";diff --git a/Sources/Cicada/AICheck.swift b/Sources/Cicada/AICheck.swiftnew file mode 100644index 0000000..6d14f87--- /dev/null+++ b/Sources/Cicada/AICheck.swift@@ -0,0 +1,222 @@+import Foundation++/// What the last look at the AI service found, step by step: can this Mac reach it, does it take+/// the key, does the text model answer. A failed step stops the ones after it, so the settings can+/// say exactly where it broke and offer the one thing that fixes it.+///+/// Most of the time the answer comes from real requests (notes, translation): every call reports+/// back here, so a meeting keeps the steps current without any extra request. An explicit check+/// runs only when the service, model or key changes, at launch, on "重新检查", and when the network+/// comes back after the service was unreachable.+struct AICheck: Equatable {+ enum StepID: String, CaseIterable { case reach, key, text }++ enum Reason: String, CaseIterable {+ case unreachable, badAddress, invalidKey, mgmtKey, noCredit, noModel, noJSON, busy, serverError+ }++ enum State: Equatable {+ case running+ /// `seconds` of the request that proved it; nil when it came with another step's request.+ case ok(seconds: Double?)+ /// 429: the service is busy but the key works. Counts as passed.+ case busy+ case fail(Reason, code: Int? = nil)+ case skipped+ /// Nothing has proven it yet (OpenRouter's key check never calls the text model).+ case untested+ }++ struct Step: Equatable {+ let id: StepID+ var state: State+ }++ /// Where the proxy stands when the service can't be reached: only read, to word the hint.+ enum ProxyHint: Equatable {+ /// A system proxy is on, and the service still can't be reached.+ case systemOn+ /// Nothing in the system settings, but a proxy app listens on this port.+ case appRunning(port: Int)+ case none+ }++ var steps: [Step] = StepID.allCases.map { Step(id: $0, state: .untested) }+ /// When the newest result came in.+ var at: Date?+ /// The newest result came from a real request in a meeting, not from a check.+ var passive = false+ var proxy: ProxyHint?+ /// OpenRouter only: dollars left (the smaller of the key's limit and the account's credits).+ var balance: Double?++ static let lowBalance = 0.5++ subscript(_ id: StepID) -> State {+ get { steps.first { $0.id == id }?.state ?? .untested }+ set { if let i = steps.firstIndex(where: { $0.id == id }) { steps[i].state = newValue } }+ }++ /// The first step that failed, and why.+ var failure: (step: StepID, reason: Reason, code: Int?)? {+ for s in steps { if case .fail(let r, let code) = s.state { return (s.id, r, code) } }+ return nil+ }++ var running: Bool { steps.contains { $0.state == .running } }+ var busy: Bool { steps.contains { $0.state == .busy } }+ /// Every step passed (busy counts; a step nothing has tested yet does not block).+ var passed: Bool { at != nil && failure == nil && !running }+ var lowBalance: Bool { (balance ?? .infinity) < Self.lowBalance }++ /// Something only the user can fix (a busy service fixes itself).+ var needsUser: Bool {+ guard let f = failure else { return lowBalance }+ return f.reason != .busy && f.reason != .serverError+ }++ /// `step` failed and the ones after it were never reached. `reached`: a reply came back, so+ /// the steps before it passed (false when nothing was sent, like a management key).+ mutating func fail(_ step: StepID, _ reason: Reason, code: Int? = nil, reached: Bool = true) {+ var after = false+ for i in steps.indices {+ if steps[i].id == step { steps[i].state = .fail(reason, code: code); after = true }+ else if after { steps[i].state = .skipped }+ else if reached, !Self.isOK(steps[i].state) { steps[i].state = .ok(seconds: nil) }+ }+ if reason != .unreachable { proxy = nil }+ }++ /// One request proved every step up to `step` (a chat proves the address, the key and the+ /// model). Clears what failed before; steps after it that were skipped are open again.+ mutating func pass(upTo step: StepID, seconds: Double?) {+ var after = false+ for i in steps.indices {+ if after {+ if steps[i].state == .skipped { steps[i].state = .untested }+ } else if steps[i].id == step {+ steps[i].state = .ok(seconds: seconds)+ after = true+ } else if !Self.isOK(steps[i].state) {+ steps[i].state = .ok(seconds: nil)+ }+ }+ proxy = nil+ }++ static func isOK(_ s: State) -> Bool { if case .ok = s { true } else { false } }++ /// The step a check's first request was proving: OpenRouter and OpenAI read key info, the+ /// others ask the text model directly.+ static func firstStep(_ provider: AIProvider.Kind) -> StepID {+ provider == .openrouter || provider == .openai ? .key : .text+ }++ /// Which step a failed request stops at, and why. `step` is the step the request was proving+ /// (the key for a key-info request, the text model for a chat).+ static func classify(_ failure: LingClient.Failure, at step: StepID) -> (StepID, Reason, Int?)? {+ switch failure {+ case .network, .timeout: return (.reach, .unreachable, nil)+ case .invalidKey: return (.key, .invalidKey, nil)+ case .rateLimited: return (step, .busy, nil)+ case .http(402): return (.key, .noCredit, 402)+ case .http(let code) where code == 400 || code == 404: return (step == .key ? .key : .text, step == .key ? .serverError : .noModel, code)+ case .http(let code) where code >= 500: return (step, .serverError, code)+ case .http(let code): return (step, .serverError, code)+ case .noKey, .hijacked, .parse: return nil+ }+ }++ /// The prefix of a key says whose it is: `sk-or-` OpenRouter, `sk-payg` ZenMux, `sk-mgmt` ZenMux's+ /// management key (it can't call models). nil: nothing to tell.+ static func owner(ofKey key: String) -> (service: AIProvider.Kind, management: Bool)? {+ let k = key.trimmingCharacters(in: .whitespacesAndNewlines)+ if k.hasPrefix("sk-or-") { return (.openrouter, false) }+ if k.hasPrefix("sk-payg") { return (.zenmux, false) }+ if k.hasPrefix("sk-mgmt") { return (.zenmux, true) }+ return nil+ }++ /// Model ids in a `/models` reply, as listed (nil when the reply can't be read).+ static func listedModels(_ data: Data) -> Set<String>? {+ guard let root = try? JSONSerialization.jsonObject(with: data) as? [String: Any],+ let list = root["data"] as? [[String: Any]] else { return nil }+ let ids = list.compactMap { $0["id"] as? String }+ return ids.isEmpty ? nil : Set(ids)+ }++ /// OpenRouter: dollars left from `/key` (`limit_remaining`, null without a key limit) and+ /// `/credits` (bought minus used); the smaller one is what the next meeting can spend.+ static func balance(key: [String: Any]?, credits: [String: Any]?) -> Double? {+ let k = (key?["data"] as? [String: Any])?["limit_remaining"] as? Double+ var c: Double?+ if let d = credits?["data"] as? [String: Any], let total = d["total_credits"] as? Double,+ let used = d["total_usage"] as? Double { c = total - used }+ switch (k, c) {+ case let (a?, b?): return min(a, b)+ case let (a?, nil): return a+ case let (nil, b?): return b+ default: return nil+ }+ }++ // MARK: Words++ static func title(_ id: StepID, host: String) -> String {+ switch id {+ case .reach: L("连上 \(host)")+ case .key: L("key 可以用")+ case .text: L("纪要和翻译")+ }+ }++ /// Why the failed step failed, in one sentence. `model`: the text model in use.+ func message(service: String, host: String, model: String) -> String? {+ guard let f = failure else { return busy ? L("\(service) 现在很忙,key 没问题。开会时会自动重试。") : nil }+ switch f.reason {+ case .unreachable: return L("这台 Mac 访问不到 \(host)。")+ case .badAddress: return L("地址要用 https,只有 localhost 可以用 http。")+ case .invalidKey: return L("\(service) 说这个 key 无效,可能没复制全,或已删除。")+ case .mgmtKey: return L("这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。")+ case .noCredit: return L("\(service) 账户余额不足。")+ case .noModel: return L("\(service) 上找不到 \(model) 这个模型。")+ case .noJSON: return L("这个服务不支持 JSON,纪要写不了;翻译照常。")+ case .busy: return L("\(service) 现在很忙,key 没问题。开会时会自动重试。")+ case .serverError: return L("\(service) 暂时出错(HTTP \(f.code ?? 0)),稍后再试。")+ }+ }++ /// The proxy line under "can't reach": what this Mac's proxy looks like, and what to do.+ func proxyLine(service: String, host: String) -> String? {+ guard failure?.reason == .unreachable, let proxy else { return nil }+ switch proxy {+ case .systemOn: return L("开了代理也连不上:换一个节点,或检查代理软件是否放过 \(host)。")+ // As text: a number would be grouped ("7,890").+ case .appRunning(let port): return L("代理软件在运行(端口 \(String(port))),但没开系统代理。在代理软件里打开“系统代理”。")+ case .none: return L("这台电脑没开代理。在国内通常要开代理才能用 \(service)。")+ }+ }++ /// "OpenRouter 余额快用完了(还剩 $0.40)" when it is.+ func balanceLine(service: String) -> String? {+ guard lowBalance, let balance else { return nil }+ let left = String(format: "%.2f", max(0, balance))+ return L("\(service) 余额快用完了(还剩 $\(left))")+ }++ /// Debug and logs: "reach=ok key=fail(invalidKey) text=skipped".+ var summary: String {+ steps.map { s -> String in+ let v: String = switch s.state {+ case .running: "running"+ case .ok(let sec): sec.map { "ok(\(String(format: "%.1f", $0))s)" } ?? "ok"+ case .busy: "busy"+ case .fail(let r, let code): "fail(\(r.rawValue)\(code.map { " \($0)" } ?? ""))"+ case .skipped: "skipped"+ case .untested: "untested"+ }+ return "\(s.id.rawValue)=\(v)"+ }.joined(separator: " ") + (proxy.map { " proxy=\($0)" } ?? "") + (balance.map { " balance=\(String(format: "%.2f", $0))" } ?? "")+ + (passive ? " passive" : "")+ }+}diff --git a/Sources/Cicada/AICheckView.swift b/Sources/Cicada/AICheckView.swiftnew file mode 100644index 0000000..92f44ab--- /dev/null+++ b/Sources/Cicada/AICheckView.swift@@ -0,0 +1,180 @@+import AppKit+import SwiftUI++extension Palette {+ /// "Busy, retrying": a passing state that still deserves a word.+ static let warn = Color(red: 0.54, green: 0.35, blue: 0.0)+ static let warnPale = Color(red: 1.0, green: 0.957, blue: 0.839)+}++/// The AI service's check, step by step (`AICheck`): settings and onboarding show the same list.+/// Every step that ran shows its result; the one that failed says why in one line and offers the+/// one thing that fixes it. All passed folds into one line (`AICheckSummary`).+struct AICheckSteps: View {+ @ObservedObject var model: AppModel+ @ObservedObject var ling: LingClient+ /// The settings have 重新检查 beside the key already; onboarding needs it in the failed step.+ var recheckInStep = true+ /// The key field opens (settings: 更换; onboarding: back to pasting).+ var changeKey: () -> Void++ private var check: AICheck { ling.aiCheck }+ private var service: String { ling.serviceName }+ private var host: String { ling.serviceHost }++ var body: some View {+ VStack(alignment: .leading, spacing: 0) {+ ForEach(check.steps, id: \.id) { step in+ row(step)+ if step.id != check.steps.last?.id { Divider().padding(.leading, 30) }+ }+ }+ }++ private func row(_ step: AICheck.Step) -> some View {+ HStack(alignment: .top, spacing: 10) {+ icon(step.state).padding(.top, 1)+ VStack(alignment: .leading, spacing: 4) {+ Text(AICheck.title(step.id, host: host)).font(.system(size: 13, weight: .medium))+ .foregroundStyle(step.state == .skipped || step.state == .untested ? Palette.tertiary : Palette.ink)+ if case .ok = step.state, step.id == .text {+ Text(model.settings.textModel).font(.system(size: 11)).foregroundStyle(Palette.tertiary)+ }+ if step.state == .untested, step.id == .text, check.passed {+ Text("开会用过一次后确认").font(.system(size: 11)).foregroundStyle(Palette.tertiary)+ }+ if isFailed(step.state) || step.state == .busy { problem(step.state) }+ }+ Spacer(minLength: 4)+ if case .ok(let s?) = step.state {+ Text(L("\(String(format: "%.1f", s)) 秒")).font(.system(size: 11).monospacedDigit()).foregroundStyle(Palette.tertiary)+ }+ }+ .padding(.vertical, 8)+ }++ @ViewBuilder private func problem(_ state: AICheck.State) -> some View {+ let model = self.model.settings.textModel+ if let why = check.message(service: service, host: host, model: model) {+ Text(why).font(.system(size: 12)).foregroundStyle(state == .busy ? Palette.warn : Palette.error)+ .fixedSize(horizontal: false, vertical: true)+ }+ if let proxy = check.proxyLine(service: service, host: host) {+ Text(proxy).font(.system(size: 12)).foregroundStyle(Palette.body)+ .padding(.horizontal, 10).padding(.vertical, 7)+ .frame(maxWidth: .infinity, alignment: .leading)+ .background(RoundedRectangle(cornerRadius: 8).fill(Palette.fill))+ .fixedSize(horizontal: false, vertical: true)+ }+ let acts = actions+ if !acts.isEmpty {+ HStack(spacing: 8) {+ ForEach(Array(acts.enumerated()), id: \.offset) { i, a in+ SoftButton(a.title, dark: i == 0, action: a.run)+ }+ }+ .padding(.top, 2)+ }+ }++ private struct Action { let title: String; let run: () -> Void }++ /// One primary fix (dark) and at most one other.+ private var actions: [Action] {+ guard let f = check.failure else { return [] }+ let p = ling.provider+ let recheck = recheckInStep ? [Action(title: L("重新检查")) { Task { await ling.check() } }] : []+ switch f.reason {+ case .unreachable:+ return [Action(title: L("怎么设置代理")) { NSWorkspace.shared.open(ProxyProbe.helpURL) }] + recheck+ case .invalidKey, .mgmtKey:+ var a = [Action(title: L("更换 key"), run: changeKey)]+ if let site = p.site { a.append(Action(title: L("打开 \(p.name)")) { NSWorkspace.shared.open(site) }) }+ return a+ case .noCredit:+ return [Action(title: L("去充值")) { NSWorkspace.shared.open(AICheckSteps.topUp(p)) }] + recheck+ case .noModel:+ guard let rec = p.textModels.first?.id, rec != model.settings.textModel else { return recheck }+ return [Action(title: L("换成推荐的 \(rec)")) { model.useRecommendedTextModel() }]+ case .serverError:+ return recheck+ case .badAddress, .noJSON, .busy:+ return []+ }+ }++ /// Where to add money: OpenRouter's credits page, else the service's own site.+ static func topUp(_ p: AIProvider) -> URL {+ p.id == .openrouter ? URL(string: "https://openrouter.ai/settings/credits")! : (p.site ?? URL(string: "https://openrouter.ai")!)+ }++ private func isFailed(_ s: AICheck.State) -> Bool { if case .fail = s { true } else { false } }++ @ViewBuilder private func icon(_ s: AICheck.State) -> some View {+ let (symbol, fg, bg): (String, Color, Color) = switch s {+ case .ok: ("checkmark", Palette.ok, Palette.okPale)+ case .fail: ("xmark", Palette.error, Palette.errorPale)+ case .busy: ("exclamationmark", Palette.warn, Palette.warnPale)+ case .running: ("ellipsis", Palette.accentInk, Palette.accentPale)+ case .skipped, .untested: ("minus", Palette.tertiary, Palette.fill)+ }+ Image(systemName: symbol).font(.system(size: 9, weight: .bold)).foregroundStyle(fg)+ .frame(width: 20, height: 20).background(Circle().fill(bg))+ }+}++/// The menu bar panel's line when the AI service needs the user (can't reach it, the key, money,+/// a model gone). Subtitles go on regardless (on-device recognition, Google), so it says so.+struct AIServiceStrip: View {+ @ObservedObject var model: AppModel+ @ObservedObject var ling: LingClient++ var body: some View {+ if let (title, detail) = words {+ HStack(spacing: 10) {+ VStack(alignment: .leading, spacing: 2) {+ Text(title).font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.accentInk)+ Text(detail).font(.system(size: 11)).foregroundStyle(Palette.secondary)+ }+ Spacer()+ SoftButton(L("打开设置"), dark: true) { model.openSettings(.ai) }+ }+ .padding(10).frame(maxWidth: .infinity, alignment: .leading)+ .background(RoundedRectangle(cornerRadius: 9).fill(Palette.accentPale))+ }+ }++ private var words: (String, String)? {+ let c = ling.aiCheck+ guard ling.hasKey, c.needsUser else { return nil }+ let name = ling.serviceName+ let stopped = L("字幕照常;纪要和整句翻译先停下")+ guard let f = c.failure else {+ return c.balanceLine(service: name).map { ($0, L("用完后纪要会停下")) }+ }+ switch f.reason {+ case .unreachable: return (L("连不上 \(name)"), stopped)+ case .invalidKey, .mgmtKey: return (L("\(name) 的 key 用不了"), stopped)+ case .noCredit: return (L("\(name) 账户余额不足。"), stopped)+ case .noModel: return (L("\(name) 上找不到 \(model.settings.textModel) 这个模型。"), stopped)+ case .badAddress, .noJSON: return (L("AI 服务的设置要改一下"), stopped)+ case .busy, .serverError: return nil+ }+ }+}++/// All passed, in one line: "文字 1.8 秒", or when the newest evidence came from a meeting,+/// "12 分钟前开会时用过".+struct AICheckSummary {+ static func text(_ check: AICheck) -> String? {+ guard check.passed, !check.busy else { return nil }+ if check.passive, let at = check.at {+ let f = RelativeDateTimeFormatter()+ f.locale = uiLocale+ f.unitsStyle = .short+ return L("\(f.localizedString(for: at, relativeTo: Date())) 开会时用过")+ }+ for s in check.steps.reversed() { if case .ok(let sec?) = s.state { return L("响应约 \(String(format: "%.1f", sec)) 秒") } }+ return nil+ }+}diff --git a/Sources/Cicada/AISettings.swift b/Sources/Cicada/AISettings.swiftindex c927150..e672f73 100644--- a/Sources/Cicada/AISettings.swift+++ b/Sources/Cicada/AISettings.swift@@ -12,6 +12,8 @@ struct AISettingsView: View {@State private var editing = false@State private var baseDraft = ""@State private var textDraft = ""+ /// A pasted key that belongs elsewhere: what it is, and (for another service's key) where it fits.+ @State private var keyHint: (text: String, service: AIProvider.Kind?, key: String)?private var provider: AIProvider { settings.provider }private var name: String { provider.name }@@ -36,7 +38,7 @@ struct AISettingsView: View {.fixedSize(horizontal: false, vertical: true)}.onAppear { syncDrafts() }- .onChange(of: settings.aiProvider) { _, _ in syncDrafts(); editing = false; draft = "" }+ .onChange(of: settings.aiProvider) { _, _ in syncDrafts(); editing = false; draft = ""; keyHint = nil }}// MARK: Key@@ -59,9 +61,22 @@ struct AISettingsView: View {.background(RoundedRectangle(cornerRadius: 10).fill(Color.white)).overlay(RoundedRectangle(cornerRadius: 10).stroke(Palette.line, lineWidth: 1))SoftButton(L("更换")) { draft = ""; editing = true }- if case .unreachable = ling.keyState {- SoftButton(L("重试")) { Task { await ling.check() } }+ SoftButton(ling.aiCheck.running ? L("正在检查…") : L("重新检查")) { Task { await ling.check() } }+ .disabled(ling.aiCheck.running)+ }+ if showSteps {+ AICheckSteps(model: model, ling: ling, recheckInStep: false) { draft = ""; editing = true }+ .padding(.horizontal, 12).padding(.vertical, 2)+ .background(RoundedRectangle(cornerRadius: 10).fill(Color.white))+ .overlay(RoundedRectangle(cornerRadius: 10).stroke(Palette.line, lineWidth: 1))+ }+ if let low = ling.aiCheck.balanceLine(service: name) {+ HStack(spacing: 8) {+ Text(low).font(.system(size: 12)).foregroundStyle(Palette.warn)+ Spacer()+ SoftButton(L("去充值")) { NSWorkspace.shared.open(AICheckSteps.topUp(provider)) }}+ .padding(10).background(RoundedRectangle(cornerRadius: 10).fill(Palette.warnPale))}} else {if ling.key == nil, provider.id != .custom {@@ -76,7 +91,22 @@ struct AISettingsView: View {.overlay(RoundedRectangle(cornerRadius: 10).stroke(Palette.ink.opacity(0.6), lineWidth: 1)).onSubmit(save)SoftButton(L("保存并检查"), dark: true, action: save)- if editing { SoftButton(L("取消")) { editing = false } }+ if editing { SoftButton(L("取消")) { editing = false; keyHint = nil } }+ }+ if let hint = keyHint {+ HStack(spacing: 8) {+ Text(hint.text).font(.system(size: 12)).foregroundStyle(Palette.error)+ .fixedSize(horizontal: false, vertical: true)+ Spacer()+ if let other = hint.service {+ SoftButton(L("改用 \(AIProvider.named(other.rawValue).name)"), dark: true) {+ let k = hint.key+ keyHint = nil+ editing = false+ model.switchService(other, key: k)+ }+ }+ }}if let site = provider.site, ling.key == nil {Button(L("打开 \(name) ↗")) { NSWorkspace.shared.open(site) }@@ -142,6 +172,19 @@ struct AISettingsView: View {model.applyAIService()}let k = draft.trimmingCharacters(in: .whitespacesAndNewlines)+ keyHint = nil+ // The prefix says whose key it is: a management key can't call models, and another+ // service's key goes there with one click (never a silent switch).+ if let owner = AICheck.owner(ofKey: k) {+ if owner.management {+ keyHint = (L("这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。"), nil, "")+ return+ }+ if owner.service != provider.id {+ keyHint = (L("这是 \(AIProvider.named(owner.service.rawValue).name) 的 key。"), owner.service, k)+ return+ }+ }draft = ""editing = falseif k.isEmpty {@@ -156,8 +199,15 @@ struct AISettingsView: View {textDraft = settings.aiModels["custom"] ?? ""}+ /// The steps show while something is wrong or being checked; all passed folds into the title line.+ private var showSteps: Bool {+ let c = ling.aiCheck+ return c.running || c.failure != nil || c.busy || (c.at != nil && !c.passed)+ }+private var statusColor: Color {- switch ling.keyState {+ if ling.aiCheck.busy, ling.aiCheck.failure == nil { return Palette.warn }+ return switch ling.keyState {case .ok: Palette.okcase .invalid, .unreachable: Palette.errorcase .checking, .unchecked: Palette.accent@@ -166,7 +216,15 @@ struct AISettingsView: View {}private var statusTitle: String {- switch ling.keyState {+ // Named after the step that failed: a missing model is not a connection problem.+ if let f = ling.aiCheck.failure, f.reason != .busy, !ling.aiCheck.running {+ switch f.step {+ case .reach: return L("暂时连不上")+ case .key: return L("这个 key 用不了")+ case .text: return L("模型用不了")+ }+ }+ return switch ling.keyState {case .none: provider.id == .custom ? L("还没填好") : L("还没填 API key")case .unchecked, .checking: L("正在检查…")case .ok: L("已连接")@@ -177,9 +235,9 @@ struct AISettingsView: View {private var statusDetail: String? {switch ling.keyState {- case .ok(let s): L("\(settings.textModel) · 响应约 \(String(format: "%.1f", s)) 秒")- case .invalid: L("\(name) 提示 key 无效,请检查是否复制完整,或重新创建一个")- case .unreachable(let why): why+ case .ok(let s): ling.aiCheck.busy ? L("\(name) 现在很忙") : AICheckSummary.text(ling.aiCheck).map { "\(settings.textModel) · \($0)" }+ ?? L("\(settings.textModel) · 响应约 \(String(format: "%.1f", s)) 秒")+ case .invalid, .unreachable: nilcase .none: L("不填 key 时,字幕和翻译仍可正常使用")default: nil}@@ -187,37 +245,55 @@ struct AISettingsView: View {// MARK: What works+ /// Only what the last result supports: when the service can't be reached (or the key fails)+ /// nothing says "用 ZenMux" in green.@ViewBuilder private var usage: some View {- let on = ling.usable+ let reason = ling.aiCheck.failure?.reason+ let down = ling.hasKey && [.unreachable, .badAddress, .invalidKey, .mgmtKey, .noCredit].contains(reason)+ let on = ling.usable && !down+ let textOn = on && reason != .noModel+ let notesOn = textOn && reason != .noJSONlet uses = L("用 \(name)")- usageRow(L("实时纪要"), tag: on ? uses : L("需要 key"), style: on ? .ok : .off,- note: on ? L("会中每 45 秒更新") : L("填好 key 后可用"))- usageRow(L("翻译"), tag: on ? uses : "Google", style: on ? .ok : .off,- note: on ? (Recognition.hasOnDeviceTranslation ? L("整句用它;不行时换 Google、本机") : L("整句用它;不行时换 Google"))- : L("没有 key 时照常可用"))- usageRow(L("同传声音"), tag: ling.speaks ? uses : L("本机"), style: ling.speaks ? .ok : .off, note: voiceNote)+ let later = down ? (reason == .unreachable ? L("连上 \(name) 后可用") : L("换好 key 后可用")) : L("填好 key 后可用")+ if notesOn, ling.aiCheck.busy {+ usageRow(L("实时纪要"), tag: L("很忙"), style: .warn, note: L("会自动重试,纪要可能晚一点"))+ } else {+ usageRow(L("实时纪要"), tag: notesOn ? uses : ling.hasKey ? L("暂不可用") : L("需要 key"), style: notesOn ? .ok : .off,+ note: notesOn ? L("会中每 45 秒更新") : reason == .noJSON ? L("这个服务不支持 JSON") : reason == .noModel ? L("换一个模型后可用") : later)+ }+ usageRow(L("翻译"), tag: textOn ? uses : "Google", style: textOn ? .ok : .off,+ note: textOn ? (Recognition.hasOnDeviceTranslation ? L("整句用它;不行时换 Google、本机") : L("整句用它;不行时换 Google"))+ : ling.hasKey ? L("先用 Google 翻译") : L("没有 key 时照常可用"))+ let speaks = ling.speaks && !down+ usageRow(L("同传声音"), tag: speaks ? uses : L("本机"), style: speaks ? .ok : .off, note: voiceNote(down: down))if provider.clones {- usageRow(L("你自己的声音"), tag: on ? uses : L("需要 key"), style: on ? .ok : .off, note: L("录一段,让对方听到你的音色"))+ usageRow(L("你自己的声音"), tag: on ? uses : ling.hasKey ? L("暂不可用") : L("需要 key"), style: on ? .ok : .off,+ note: on ? L("录一段,让对方听到你的音色") : later)} else {usageRow(L("你自己的声音"), tag: L("只有 Ling"), style: .ling, note: L("换用 Ling 才有"))}usageRow(L("语音识别"), tag: L("本机"), style: .off, note: L("更快,不花钱"), divider: false)}- private var voiceNote: String {- if ling.speaks { return provider.id == .ling ? L("Ming 的声音") : (settings.aiConfig.voiceModel ?? "") }+ private func voiceNote(down: Bool) -> String {+ if down { return L("先用本机声音") }+ if ling.speaks {+ if let last = ling.lastVoice { return last.ok ? L("上次同传时正常") : L("上次同传没出声,用了本机声音") }+ return provider.id == .ling ? L("Ming 的声音") : (settings.aiConfig.voiceModel ?? "")+ }if !ling.usable { return L("没有 key 时用本机声音") }return provider.id == .custom ? L("没填声音模型,用本机声音") : L("\(name) 暂不能出声音,用本机声音")}- private enum TagStyle { case ok, off, ling }+ private enum TagStyle { case ok, off, ling, warn }private func usageRow(_ title: String, tag: String, style: TagStyle, note: String, divider: Bool = true) -> some View {SettingsRow(title: title, detail: note, divider: divider) {Text(tag).font(.system(size: 11, weight: .semibold))- .foregroundStyle(style == .ok ? Palette.ok : style == .ling ? Palette.accentInk : Palette.secondary)+ .foregroundStyle(style == .ok ? Palette.ok : style == .ling ? Palette.accentInk : style == .warn ? Palette.warn : Palette.secondary).padding(.horizontal, 8).padding(.vertical, 3)- .background(RoundedRectangle(cornerRadius: 6).fill(style == .ok ? Palette.okPale : style == .ling ? Palette.accentPale : Palette.fill))+ .background(RoundedRectangle(cornerRadius: 6).fill(style == .ok ? Palette.okPale : style == .ling ? Palette.accentPale+ : style == .warn ? Palette.warnPale : Palette.fill)).lineLimit(1).fixedSize()}}diff --git a/Sources/Cicada/AppModel.swift b/Sources/Cicada/AppModel.swiftindex 54868b3..223437f 100644--- a/Sources/Cicada/AppModel.swift+++ b/Sources/Cicada/AppModel.swift@@ -2,6 +2,7 @@ import AppKitimport AVFoundationimport Carbon.HIToolboximport Combine+import Networkimport SwiftUIimport Speechimport UserNotifications@@ -107,6 +108,10 @@ final class AppModel: ObservableObject {private var shortcutsSuspended = falselet installer = VirtualMicInstaller()let ling = LingClient()+ /// Network changes (a proxy app turned on, Wi-Fi back): the AI service is looked at again+ /// when it was unreachable. No timer: nothing is checked while the network stays the same.+ private let networkMonitor = NWPathMonitor()+ private var networkDebounce: DispatchWorkItem?lazy var translator = TranslationService(ling: ling)let diagnostics = Diagnostics()let updates = Updates()@@ -185,6 +190,8 @@ final class AppModel: ObservableObject {await self?.listen.translate(text, source: from, target: to, kind: .speak, trace: TranslateTrace())}ling.onCall = { [weak self] in self?.diagnostics.record($0) }+ ling.proxyHint = { await ProxyProbe.hint() }+ watchNetwork()translator.onDraft = { [weak self] in self?.diagnostics.recordDraft(seconds: $0, ok: $1) }ling.config = { [weak self] in self?.settings.aiConfig ?? AIConfig(provider: .ling, base: AIProvider.ling.base, textModel: "Ling-3.1-flash") }@@ -866,6 +873,38 @@ final class AppModel: ObservableObject {return VoiceCatalog.remote(for: language).contains { $0.id == id } ? id : fallback}+ /// Any change of route (an interface, a VPN or TUN from a proxy app) waits 3 s for the network+ /// to settle, then the AI client looks again if the service was unreachable.+ private func watchNetwork() {+ networkMonitor.pathUpdateHandler = { [weak self] path in+ guard path.status == .satisfied else { return }+ DispatchQueue.main.async {+ MainActor.assumeIsolated {+ guard let self else { return }+ self.networkDebounce?.cancel()+ let work = DispatchWorkItem { [weak self] in MainActor.assumeIsolated { self?.ling.networkChanged() } }+ self.networkDebounce = work+ DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: work)+ }+ }+ }+ networkMonitor.start(queue: DispatchQueue(label: "cicada.ai-network"))+ }++ /// One click on "换成推荐的": the service's first recommended text model, then a fresh check.+ func useRecommendedTextModel() {+ guard let first = settings.provider.textModels.first?.id else { return }+ if settings.provider.id == .ling { settings.aiModel = first } else { settings.aiModels[settings.aiProvider] = first }+ applyAIService()+ }++ /// A key pasted for one service that belongs to another ("改用 OpenRouter"): switch, save it there, check.+ func switchService(_ kind: AIProvider.Kind, key: String) {+ settings.aiProvider = kind.rawValue+ applyAIService()+ Task { await ling.setKey(key) }+ }+/// Settings changed the AI service, its address or a model: voices follow, the key is checked again.func applyAIService() {let c = settings.aiConfig@@ -1529,7 +1568,13 @@ final class AppModel: ObservableObject {case "aiState":let c = settings.aiConfigdebugLog("ai state=\(ling.keyState) provider=\(c.provider.id.rawValue) hasKey=\(ling.hasKey) model=\(c.textModel) "- + "voice=\(c.voiceModel ?? "-") speaks=\(ling.speaks) clones=\(ling.clones) catalog=\(ling.catalog.count)")+ + "voice=\(c.voiceModel ?? "-") speaks=\(ling.speaks) clones=\(ling.clones) catalog=\(ling.catalog.count)"+ + " check=[\(ling.aiCheck.summary)]")+ case "aiCheckSim":+ // aiCheckSim:<reason|lowBalance|off>: every check ends this way (screenshots of each state).+ ling.simulateCheck = AICheck.Reason(rawValue: arg)+ ling.simulateBalance = arg == "lowBalance" ? 0.4 : nil+ Task { await ling.check() }// AI service: aiProvider:<ling|openrouter|zenmux|openai|custom>, aiTextModel:<id>, aiVoiceModel:<id|"">,// aiCustomBase:<url>, aiCustomVoiceBase:<url|"">, aiCustomVoice:<name>.case "aiProvider": settings.aiProvider = AIProvider.named(arg).id.rawValue; applyAIService()diff --git a/Sources/Cicada/Ling.swift b/Sources/Cicada/Ling.swiftindex 2056249..e35cd0a 100644--- a/Sources/Cicada/Ling.swift+++ b/Sources/Cicada/Ling.swift@@ -158,8 +158,21 @@ final class LingClient: ObservableObject {@Published private(set) var keyState: KeyState@Published private(set) var rateLimitedAt: Date?+ /// Step by step, where the service stands (`keyState` is its short form for older callers).+ @Published private(set) var aiCheck = AICheck()+ /// The last time the room voice spoke (or failed to) through this service.+ @Published private(set) var lastVoice: (ok: Bool, at: Date)?/// The service's text models from its `/models`, recommended first (empty until fetched).@Published private(set) var catalog: [String] = []+ /// Every model id the service lists, to tell whether the chosen one still exists.+ private var listed: Set<String>?+ /// Reads this device's proxy settings to word the "can't reach" hint (never used to connect).+ var proxyHint: (() async -> AICheck.ProxyHint)?++ /// Debug control only: the next checks end this way (for screenshots of every state).+ var simulateCheck: AICheck.Reason?+ /// Debug control only: report this OpenRouter balance instead of the real one.+ var simulateBalance: Double?/// The service in use, its address and models. Set by the app from settings.var config: () -> AIConfig = { AIConfig(provider: .ling, base: AIProvider.ling.base, textModel: "Ling-3.1-flash",voiceModel: "Ming-3.0-tts-0.5B", voiceBase: AIProvider.ling.base) }@@ -201,6 +214,9 @@ final class LingClient: ObservableObject {/// Settings switched service, address or model: forget the old state and check again.func reconfigure() {catalog = []+ listed = nil+ aiCheck = AICheck()+ lastVoice = nilkeyState = hasKey ? .unchecked : .noneif hasKey { Task { await check() } }}@@ -219,54 +235,168 @@ final class LingClient: ObservableObject {func removeKey() {AIKey.remove(provider.id.rawValue)catalog = []+ listed = nil+ aiCheck = AICheck()keyState = hasKey ? .unchecked : .none}- /// The cheapest request that proves the key: Ling's tiny model, OpenRouter's key info, OpenAI's- /// model list, else one token from the chosen model. A custom service must also return JSON- /// (the notes need it).+ /// The service's name for messages ("这个服务" for a custom address) and its host.+ var serviceName: String { provider.id == .custom ? L("这个服务") : provider.name }+ var serviceHost: String { config().base?.host ?? provider.base?.host ?? "" }++ /// The cheapest requests that prove each step: Ling's tiny model; OpenRouter's key info (plus+ /// its credits, for the balance); OpenAI's model list; else one token from the chosen model. A+ /// custom service must also return JSON (the notes need it). The model list then tells whether+ /// the chosen text model still exists.func check() async {- guard let key else { keyState = .none; return }+ guard let key else { keyState = .none; aiCheck = AICheck(); return }keyState = .checking+ checkGeneration += 1+ let generation = checkGenerationlet c = config()+ var r = AICheck()+ r[.reach] = .running+ aiCheck = rlet started = Date()- let name = c.provider.id == .custom ? L("这个服务") : c.provider.name+ if let reason = simulateCheck {+ await finishCheck(Self.simulated(reason), c, generation)+ return+ }+ if c.provider.id == .custom, c.base == nil {+ r.fail(.reach, .badAddress, reached: false)+ await finishCheck(r, c, generation)+ return+ }+ if AICheck.owner(ofKey: key)?.management == true {+ r.fail(.key, .mgmtKey, reached: false)+ await finishCheck(r, c, generation)+ return+ }do {switch c.provider.id {case .ling:_ = try await post("chat/completions", body: ["model": "Ling-3.0-tiny", "messages": [["role": "user", "content": "hi"]],"max_tokens": 1, "thinking": ["type": "disabled"]], key: key, timeout: 15)+ r.pass(upTo: .text, seconds: Date().timeIntervalSince(started))case .openrouter:- _ = try await get("key", key: key)+ let info = try await get("key", key: key)+ r.pass(upTo: .key, seconds: Date().timeIntervalSince(started))+ let credits = try? await get("credits", key: key)+ r.balance = AICheck.balance(key: info, credits: credits)case .openai:_ = try await get("models", key: key)+ r.pass(upTo: .key, seconds: Date().timeIntervalSince(started))case .zenmux, .custom:var body: [String: Any] = ["model": c.textModel, "messages": [["role": "user", "content": "hi"]]]c.shape(&body, maxTokens: 1)_ = try await post("chat/completions", body: body, key: key, timeout: 20)+ r.pass(upTo: .text, seconds: Date().timeIntervalSince(started))if c.provider.id == .custom {var json: [String: Any] = ["model": c.textModel, "response_format": ["type": "json_object"],"messages": [["role": "system", "content": "Reply with the JSON object {\"ok\": true}."],["role": "user", "content": "Reply."]]]c.shape(&json, maxTokens: 20)do { _ = try await post("chat/completions", body: json, key: key, timeout: 20) } catch Failure.http(let code) {- keyState = .unreachable(L("这个服务不支持 JSON(HTTP \(code)),纪要用不了"))- return+ r.fail(.text, .noJSON, code: code)}}}- keyState = .ok(seconds: Date().timeIntervalSince(started))- } catch Failure.invalidKey {- keyState = .invalid- } catch Failure.rateLimited {- keyState = .ok(seconds: Date().timeIntervalSince(started))- } catch Failure.http(let code) where code == 404 || code == 400 {- keyState = .unreachable(c.provider.id == .custom ? L("找不到模型,或地址不对(HTTP \(code))") : L("\(name) 拒绝了请求(HTTP \(code)),请检查模型名"))+ } catch let failure as Failure {+ if let (step, reason, code) = AICheck.classify(failure, at: AICheck.firstStep(c.provider.id)) {+ if reason == .busy { r.pass(upTo: step, seconds: nil); r[step] = .busy } else { r.fail(step, reason, code: code) }+ }} catch {- keyState = .unreachable(L("连不上 \(name),请检查网络或代理"))+ r.fail(.reach, .unreachable)+ }+ if r.failure == nil, c.provider.id != .ling {+ await fetchCatalog()+ // A model the service no longer lists fails here, before a meeting finds out.+ if let listed, !c.textModel.isEmpty {+ if !listed.contains(c.textModel) { r.fail(.text, .noModel) } else if r[.text] == .untested { r[.text] = .ok(seconds: nil) }+ }}- debugLog("ai \(c.provider.id.rawValue): key check → \(keyState)")- if case .ok = keyState, c.provider.id != .ling { await fetchCatalog() }+ await finishCheck(r, c, generation)+ }++ /// Bumped by every check: a slower, older check (a model changed twice quickly) must not+ /// land after the newer one and overwrite it.+ private var checkGeneration = 0++ private func finishCheck(_ result: AICheck, _ c: AIConfig, _ generation: Int) async {+ var r = result+ if r.failure?.reason == .unreachable, r.proxy == nil { r.proxy = await proxyHint?() }+ guard generation == checkGeneration else {+ debugLog("ai \(c.provider.id.rawValue): an older check finished late, dropped")+ return+ }+ if let simulateBalance { r.balance = simulateBalance }+ r.at = Date()+ aiCheck = r+ syncKeyState()+ debugLog("ai \(c.provider.id.rawValue): check → \(r.summary)")+ }++ /// A made-up result for `reason` (debug screenshots of every state).+ private static func simulated(_ reason: AICheck.Reason) -> AICheck {+ var r = AICheck()+ switch reason {+ case .busy:+ r.pass(upTo: .text, seconds: 1.2)+ r[.text] = .busy+ case .unreachable, .badAddress: r.fail(.reach, reason, reached: false)+ case .invalidKey, .noCredit: r.fail(.key, reason, code: reason == .noCredit ? 402 : nil)+ case .mgmtKey: r.fail(.key, reason, reached: false)+ case .noModel, .noJSON: r.fail(.text, reason, code: 404)+ case .serverError: r.fail(.text, reason, code: 503)+ }+ return r+ }++ /// The short form older callers read: invalid stops every request, another failure says why.+ private func syncKeyState() {+ guard hasKey else { keyState = .none; return }+ let c = aiCheck+ if let f = c.failure, f.reason != .busy {+ keyState = f.reason == .invalidKey || f.reason == .mgmtKey ? .invalid+ : .unreachable(c.message(service: serviceName, host: serviceHost, model: config().textModel) ?? "")+ } else if c.passed {+ var seconds = 0.0+ for s in c.steps { if case .ok(let sec?) = s.state { seconds = sec } }+ keyState = .ok(seconds: seconds)+ }+ }++ /// A real request (notes, translation) came back: keep the steps current without a check.+ /// One server error in a meeting isn't worth repainting the settings for.+ private func observe(_ failure: Failure?, seconds: Double = 0, audio: Bool = false) {+ guard hasKey, !aiCheck.running, simulateCheck == nil else { return }+ var r = aiCheck+ if let failure {+ guard let (step, reason, code) = AICheck.classify(failure, at: .text), reason != .serverError else { return }+ // An audio request (Ming hearing speak-back) says nothing about the text model.+ if audio, step == .text { return }+ if reason == .busy { r.pass(upTo: .key, seconds: nil); r[step] = .busy } else { r.fail(step, reason, code: code) }+ } else {+ r.pass(upTo: audio ? .key : .text, seconds: seconds)+ }+ let wasUnreachable = aiCheck.failure?.reason == .unreachable+ r.at = Date()+ r.passive = true+ if r.failure?.reason != .unreachable { r.proxy = nil }+ if r.steps == aiCheck.steps, aiCheck.passive { aiCheck.at = r.at; return }+ aiCheck = r+ syncKeyState()+ debugLog("ai: from a real request → \(r.summary)")+ if r.failure?.reason == .unreachable, !wasUnreachable, let proxyHint {+ Task { let hint = await proxyHint(); if aiCheck.failure?.reason == .unreachable { aiCheck.proxy = hint } }+ }+ }++ /// The network came back (or changed) while the service was unreachable: look again.+ func networkChanged() {+ guard hasKey, aiCheck.failure?.reason == .unreachable, !aiCheck.running else { return }+ debugLog("ai: network changed while unreachable, checking again")+ Task { await check() }}/// The service's text models, for the model menu. Quietly empty when it has no `/models`.@@ -274,6 +404,7 @@ final class LingClient: ObservableObject {let c = config()guard let key, c.provider.id != .ling, let data = try? await getData("models", key: key) else { return }catalog = AIConfig.textModels(fromCatalog: data, recommended: c.provider.textModels.map(\.id))+ listed = AICheck.listedModels(data)debugLog("ai \(c.provider.id.rawValue): \(catalog.count) models")}@@ -332,9 +463,11 @@ final class LingClient: ObservableObject {report(call, priority, at: started, queued: queued, outcome: "ok",tokens: (usage?["prompt_tokens"] as? Int ?? 0, usage?["completion_tokens"] as? Int ?? 0))if rateLimitedAt != nil { rateLimitedAt = nil }+ observe(nil, seconds: Double(ms) / 1000, audio: audio != nil)return trimmed} catch let failure as Failure {report(call, priority, at: started, queued: queued, outcome: Self.name(failure))+ observe(failure, audio: audio != nil)guard failure == .rateLimited else { throw failure }guard attempt <= waits.count else {rateLimitedAt = Date()@@ -463,11 +596,13 @@ final class LingClient: ObservableObject {if !chunk.isEmpty { yield(chunk) }}self.report(call, .speak, at: started, queued: queued, outcome: "ok", chars: text.count, firstAudio: firstAudio)+ self.lastVoice = (true, Date())cont.finish()} catch {// Cancelled: the voice was cut short on purpose (stop, a new press), not a failure.let outcome = Task.isCancelled ? "cancelled" : (error as? Failure).map(Self.name) ?? "network"self.report(call, .speak, at: started, queued: queued, outcome: outcome, chars: text.count, firstAudio: firstAudio)+ if !Task.isCancelled { self.lastVoice = (false, Date()) }cont.finish(throwing: error)}}diff --git a/Sources/Cicada/NotesWindow.swift b/Sources/Cicada/NotesWindow.swiftindex fcc7c5e..3e57a6e 100644--- a/Sources/Cicada/NotesWindow.swift+++ b/Sources/Cicada/NotesWindow.swift@@ -596,7 +596,13 @@ struct NotesWindowView: View {SoftButton(L("更换 key"), dark: true) { model.openSettings(.ai) }}case .rateLimited:- notice(L("请求过于频繁,稍后会自动重试。纪要停留在 \(NotesEngine.clock(lastCovered))。"), tint: Palette.fill) { EmptyView() }+ notice(L("\(model.ling.serviceName) 很忙,纪要稍后补上。字幕照常。"), tint: Palette.warnPale) { EmptyView() }+ case .failed where model.ling.aiCheck.failure?.reason == .unreachable:+ // The network or the proxy, not the notes: say which, and that it picks up by itself.+ notice(L("连不上 \(model.ling.serviceName),这段时间的纪要先停在 \(NotesEngine.clock(lastCovered))。网络恢复后自动继续。"),+ tint: Palette.errorPale) {+ SoftButton(L("设置")) { model.openSettings(.ai) }+ }case .failed:notice(L("这轮没整理好,下一轮会自动重试。"), tint: Palette.fill) { EmptyView() }default:diff --git a/Sources/Cicada/OnboardingKey.swift b/Sources/Cicada/OnboardingKey.swiftindex 4ad8d81..fdccd27 100644--- a/Sources/Cicada/OnboardingKey.swift+++ b/Sources/Cicada/OnboardingKey.swift@@ -13,6 +13,8 @@ struct OnboardingKeyStep: View {@Binding var skipping: Bool@State private var draft = ""@State private var clipboardEmpty = false+ /// A pasted key that belongs elsewhere: what it is, and (for another service's key) where it fits.+ @State private var keyHint: (text: String, service: AIProvider.Kind?, key: String)?/// Showing another service instead of Ling: follows the setting, so a change made in Settings/// while this step is open (or a reused window) never leaves the Ling title over another service.private var other: Bool { settings.provider.id != .ling }@@ -66,6 +68,7 @@ struct OnboardingKeyStep: View {private func switchTo(_ p: AIProvider) {draft = ""clipboardEmpty = false+ keyHint = nilguard settings.aiProvider != p.id.rawValue else { return }settings.aiProvider = p.id.rawValuemodel.applyAIService()@@ -152,9 +155,32 @@ struct OnboardingKeyStep: View {}@ViewBuilder private var status: some View {+ if let hint = keyHint {+ HStack(spacing: 8) {+ line(Palette.error, hint.text, Palette.accentInk)+ Spacer()+ if let other = hint.service {+ SoftButton(L("改用 \(AIProvider.named(other.rawValue).name)"), dark: true) {+ let k = hint.key+ keyHint = nil+ model.switchService(other, key: k)+ }+ }+ }+ } else if ling.hasKey, ling.aiCheck.running || ling.aiCheck.failure != nil {+ // Where it broke and the one thing that fixes it, as in the settings.+ AICheckSteps(model: model, ling: ling) { draft = "" }+ } else {+ switch ling.keyState {+ case .checking, .unchecked:+ line(Palette.accent, L("正在检查…"), Palette.secondary)+ default: idleStatus+ }+ }+ }++ @ViewBuilder private var idleStatus: some View {switch ling.keyState {- case .checking, .unchecked:- line(Palette.accent, L("正在检查…"), Palette.secondary)case .invalid:line(Palette.error, L("这个 key 无效,请检查是否复制完整,或重新创建一个"), Palette.accentInk)case .unreachable(let why):@@ -295,6 +321,18 @@ struct OnboardingKeyStep: View {let k = raw.trimmingCharacters(in: .whitespacesAndNewlines)guard !k.isEmpty else { return }clipboardEmpty = false+ keyHint = nil+ // The prefix says whose key it is (AISettingsView.save does the same).+ if let owner = AICheck.owner(ofKey: k) {+ if owner.management {+ keyHint = (L("这是 ZenMux 的管理 key,不能用来调用模型。请粘贴 sk-payg 开头的 key。"), nil, "")+ return+ }+ if owner.service != settings.provider.id {+ keyHint = (L("这是 \(AIProvider.named(owner.service.rawValue).name) 的 key。"), owner.service, k)+ return+ }+ }draft = ""Task { await ling.setKey(k) }}diff --git a/Sources/Cicada/ProxyHint.swift b/Sources/Cicada/ProxyHint.swiftnew file mode 100644index 0000000..9dd2bae--- /dev/null+++ b/Sources/Cicada/ProxyHint.swift@@ -0,0 +1,63 @@+import CFNetwork+import Foundation+import Network++/// Words the "can't reach the AI service" hint. Read-only on purpose: the app never sets or uses a+/// proxy of its own (URLSession already goes through the system proxy); it only tells the user+/// which of three situations they are in, so the hint says what to do.+enum ProxyProbe {+ /// Ports common proxy apps listen on (Clash 7890, Clash Verge 7897, SOCKS 1080).+ static let ports = [7890, 7897, 1080]++ static func hint() async -> AICheck.ProxyHint {+ if systemProxyOn() { return .systemOn }+ for port in ports where await listening(port) { return .appRunning(port: port) }+ return .none+ }++ /// An HTTPS, SOCKS or auto-config (PAC) proxy in System Settings › Network.+ static func systemProxyOn() -> Bool {+ guard let s = CFNetworkCopySystemProxySettings()?.takeRetainedValue() as? [String: Any] else { return false }+ func on(_ key: CFString) -> Bool { (s[key as String] as? Int ?? 0) == 1 }+ return on(kCFNetworkProxiesHTTPSEnable) || on(kCFNetworkProxiesSOCKSEnable) || on(kCFNetworkProxiesProxyAutoConfigEnable)+ }++ /// Something accepts a TCP connection on 127.0.0.1:`port` within 0.3 s. Nothing is sent.+ static func listening(_ port: Int) async -> Bool {+ guard let p = NWEndpoint.Port(rawValue: UInt16(port)) else { return false }+ let conn = NWConnection(host: "127.0.0.1", port: p, using: .tcp)+ return await withCheckedContinuation { cont in+ let once = Once()+ conn.stateUpdateHandler = { state in+ switch state {+ case .ready: if once.take() { conn.cancel(); cont.resume(returning: true) }+ case .failed, .waiting: if once.take() { conn.cancel(); cont.resume(returning: false) }+ default: break+ }+ }+ conn.start(queue: .global())+ DispatchQueue.global().asyncAfter(deadline: .now() + 0.3) {+ if once.take() { conn.cancel(); cont.resume(returning: false) }+ }+ }+ }++ /// Resumes a continuation exactly once across the connection's callbacks and the timeout.+ private final class Once: @unchecked Sendable {+ private let lock = NSLock()+ private var done = false+ func take() -> Bool {+ lock.lock(); defer { lock.unlock() }+ if done { return false }+ done = true+ return true+ }+ }++ /// The website's proxy help, in the UI language.+ static var helpURL: URL {+ let lang = Bundle.main.preferredLocalizations.first ?? "zh"+ let prefix = ["en", "ja", "ko"].first { lang.hasPrefix($0) }.map { "/\($0)" } ?? ""+ return URL(string: "https://cicada.indaloop.app\(prefix)/start/#proxy")!+ }+}diff --git a/Sources/Cicada/Views.swift b/Sources/Cicada/Views.swiftindex 336e84a..f1ef6cd 100644--- a/Sources/Cicada/Views.swift+++ b/Sources/Cicada/Views.swift@@ -188,6 +188,7 @@ struct MenuPanelView: View {// In subtitle-bar mode this is where the bar sends you to pick.if model.running { LanguageNotice(model: model) }if model.roomPrompt { roomPromptStrip }+ AIServiceStrip(model: model, ling: model.ling)// Right under the header: below the settings it was easy to miss.UpdateBanner(updates: model.updates, model: model)diff --git a/Tests/CicadaTests/AICheckTests.swift b/Tests/CicadaTests/AICheckTests.swiftnew file mode 100644index 0000000..5747192--- /dev/null+++ b/Tests/CicadaTests/AICheckTests.swift@@ -0,0 +1,94 @@+import Foundation+import Testing+@testable import Cicada++struct AICheckTests {+ @Test func eachFailureStopsAtItsStep() {+ #expect(AICheck.classify(.network, at: .text)! == (.reach, .unreachable, nil))+ #expect(AICheck.classify(.timeout, at: .key)! == (.reach, .unreachable, nil))+ #expect(AICheck.classify(.invalidKey, at: .text)! == (.key, .invalidKey, nil))+ #expect(AICheck.classify(.http(402), at: .text)! == (.key, .noCredit, 402))+ #expect(AICheck.classify(.http(404), at: .text)! == (.text, .noModel, 404))+ #expect(AICheck.classify(.http(400), at: .text)! == (.text, .noModel, 400))+ #expect(AICheck.classify(.rateLimited, at: .text)! == (.text, .busy, nil))+ #expect(AICheck.classify(.http(503), at: .key)! == (.key, .serverError, 503))+ #expect(AICheck.classify(.hijacked, at: .text) == nil)+ }++ @Test func aFailedStepSkipsTheRestAndAReplyProvesTheOnesBefore() {+ var c = AICheck()+ c.fail(.key, .invalidKey)+ #expect(c[.reach] == .ok(seconds: nil))+ #expect(c[.key] == .fail(.invalidKey, code: nil))+ #expect(c[.text] == .skipped)+ #expect(c.failure?.step == .key)++ var m = AICheck()+ m.fail(.key, .mgmtKey, reached: false)+ #expect(m[.reach] == .untested)+ }++ @Test func aSuccessClearsAnEarlierFailure() {+ var c = AICheck()+ c.fail(.reach, .unreachable)+ c.proxy = AICheck.ProxyHint.none+ c.pass(upTo: .text, seconds: 1.5)+ #expect(c.failure == nil)+ #expect(c[.reach] == .ok(seconds: nil) && c[.text] == .ok(seconds: 1.5))+ #expect(c.proxy == nil)++ // A key-info request proves reach and key; the text model stays open.+ var k = AICheck()+ k.fail(.reach, .unreachable)+ k.pass(upTo: .key, seconds: 0.3)+ #expect(k[.text] == .untested)+ }++ @Test func busyPassesAndNeedsNobody() {+ var c = AICheck()+ c.pass(upTo: .text, seconds: nil)+ c[.text] = .busy+ c.at = Date()+ #expect(c.passed && c.busy && !c.needsUser)+ }++ @Test func keyPrefixesTellWhoseKeyItIs() {+ #expect(AICheck.owner(ofKey: "sk-or-v1-abc")! == (.openrouter, false))+ #expect(AICheck.owner(ofKey: " sk-payg-abc\n")! == (.zenmux, false))+ #expect(AICheck.owner(ofKey: "sk-mgmt-abc")! == (.zenmux, true))+ #expect(AICheck.owner(ofKey: "sk-abc") == nil)+ }++ @Test func balanceIsTheSmallerOfKeyLimitAndCredits() {+ let key: [String: Any] = ["data": ["limit_remaining": 1.72]]+ let credits: [String: Any] = ["data": ["total_credits": 10.0, "total_usage": 3.92]]+ #expect(AICheck.balance(key: key, credits: credits) == 1.72)+ #expect(abs(AICheck.balance(key: ["data": ["limit_remaining": NSNull()]], credits: credits)! - 6.08) < 0.001)+ #expect(AICheck.balance(key: key, credits: nil) == 1.72)+ #expect(AICheck.balance(key: nil, credits: nil) == nil)+ var c = AICheck()+ c.balance = 0.3+ #expect(c.lowBalance && c.needsUser)+ }++ @Test func listedModelsReadsEveryID() {+ let data = Data(#"{"data":[{"id":"inclusionai/ling-3.0-flash"},{"id":"qwen/qwen3.8-flash"}]}"#.utf8)+ #expect(AICheck.listedModels(data) == ["inclusionai/ling-3.0-flash", "qwen/qwen3.8-flash"])+ #expect(AICheck.listedModels(Data("{}".utf8)) == nil)+ #expect(AICheck.listedModels(Data(#"{"data":[]}"#.utf8)) == nil)+ }++ @Test func messagesNameTheServiceAndTheProxyHintFollowsTheProxy() {+ var c = AICheck()+ c.fail(.reach, .unreachable)+ #expect(c.message(service: "ZenMux", host: "zenmux.ai", model: "m")?.contains("zenmux.ai") == true)+ #expect(c.proxyLine(service: "ZenMux", host: "zenmux.ai") == nil)+ c.proxy = .appRunning(port: 7890)+ #expect(c.proxyLine(service: "ZenMux", host: "zenmux.ai")?.contains("7890") == true)+ c.proxy = .systemOn+ #expect(c.proxyLine(service: "ZenMux", host: "zenmux.ai")?.contains("zenmux.ai") == true)+ var m = AICheck()+ m.fail(.text, .noModel, code: 404)+ #expect(m.message(service: "ZenMux", host: "zenmux.ai", model: "x/y")?.contains("x/y") == true)+ }+}diff --git a/ios/shared-sources.txt b/ios/shared-sources.txtindex ab0b151..cb41dea 100644--- a/ios/shared-sources.txt+++ b/ios/shared-sources.txt@@ -3,6 +3,7 @@# needs the rest of the Mac app with #if !CICADA_IOS (the iOS build sets it). ios/scripts/typecheck.sh checks.Sources/Cicada/Ling.swiftSources/Cicada/AIProviders.swift+Sources/Cicada/AICheck.swiftSources/Cicada/Notes.swiftSources/Cicada/HeardText.swiftSources/Cicada/MeetingEnd.swift