@eddyskywalker/dsh-chatgpt-subscription 0.75.1 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +1 -1
- package/lib/client.js +1014 -812
- package/lib/client.js.map +1 -1
- package/lib/index.js +953 -386
- package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -1
- package/lib/types/client/antigravity-acp/AntigravityAcpSection.d.ts.map +1 -1
- package/lib/types/client/antigravity-acp/locales.d.ts +12 -12
- package/lib/types/client/claude/ClaudeSection.d.ts.map +1 -1
- package/lib/types/client/cline-pass/ClinePassSection.d.ts.map +1 -1
- package/lib/types/client/command-code/CommandCodeSection.d.ts.map +1 -1
- package/lib/types/client/common/LineProxySection.d.ts +78 -0
- package/lib/types/client/common/LineProxySection.d.ts.map +1 -0
- package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +15 -3
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/minimax-code/MinimaxCodeSection.d.ts.map +1 -1
- package/lib/types/client/ollama/OllamaSection.d.ts.map +1 -1
- package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -1
- package/lib/types/client/qoder/QoderSection.d.ts.map +1 -1
- package/lib/types/client/step-code/StepCodeSection.d.ts.map +1 -1
- package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +1 -1
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/host/antigravity-acp/adapter.d.ts +17 -0
- package/lib/types/host/antigravity-acp/adapter.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/auth-cache.d.ts +11 -2
- package/lib/types/host/antigravity-acp/auth-cache.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/binary.d.ts +68 -0
- package/lib/types/host/antigravity-acp/binary.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/catalog.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/errors.d.ts +10 -0
- package/lib/types/host/antigravity-acp/errors.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/login.d.ts +22 -6
- package/lib/types/host/antigravity-acp/login.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/mcp-bridge.d.ts +9 -2
- package/lib/types/host/antigravity-acp/mcp-bridge.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/routes.d.ts +23 -4
- package/lib/types/host/antigravity-acp/routes.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/subagent.d.ts +32 -0
- package/lib/types/host/antigravity-acp/subagent.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/types.d.ts +15 -0
- package/lib/types/host/antigravity-acp/types.d.ts.map +1 -1
- package/lib/types/host/preferences.d.ts.map +1 -1
- package/lib/types/host/proxy-manager.d.ts +37 -3
- package/lib/types/host/proxy-manager.d.ts.map +1 -1
- package/lib/types/host/routes.d.ts.map +1 -1
- package/lib/types/host/workbuddy/model-catalog.d.ts +20 -10
- package/lib/types/host/workbuddy/model-catalog.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +53 -0
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/lib/types/shared/preferences.d.ts +51 -1
- package/lib/types/shared/preferences.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1066,6 +1066,772 @@ window.__ModuleLoader__.load({
|
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
1068
|
//#endregion
|
|
1069
|
+
//#region src/client/locales.ts
|
|
1070
|
+
const NS = "dsh-chatgpt-subscription";
|
|
1071
|
+
const zh$15 = {
|
|
1072
|
+
...accountPoolZh,
|
|
1073
|
+
title: "ChatGPT",
|
|
1074
|
+
hubTitle: "订阅服务",
|
|
1075
|
+
intro: "使用 ChatGPT 账号登录,在 DSH 中使用订阅可用的模型。",
|
|
1076
|
+
account: "账号",
|
|
1077
|
+
signedOut: "尚未登录",
|
|
1078
|
+
signedIn: "已登录",
|
|
1079
|
+
plan: "套餐",
|
|
1080
|
+
accountId: "账号 ID",
|
|
1081
|
+
expires: "令牌到期",
|
|
1082
|
+
signIn: "使用 ChatGPT 登录",
|
|
1083
|
+
signInAgain: "重新登录",
|
|
1084
|
+
cancel: "取消登录",
|
|
1085
|
+
signOut: "注销",
|
|
1086
|
+
refreshToken: "刷新凭据",
|
|
1087
|
+
pending: "请在浏览器中完成登录。",
|
|
1088
|
+
popupBlocked: "浏览器拦截了登录窗口,请使用下面的链接继续。",
|
|
1089
|
+
continueLogin: "打开 ChatGPT 登录页",
|
|
1090
|
+
loading: "正在读取状态…",
|
|
1091
|
+
connection: "连接",
|
|
1092
|
+
testConnection: "测试连接",
|
|
1093
|
+
testing: "测试中…",
|
|
1094
|
+
latency: "最近延迟",
|
|
1095
|
+
selectAll: "全选",
|
|
1096
|
+
unselectAll: "全不选",
|
|
1097
|
+
models: "可用模型",
|
|
1098
|
+
modelsHint: "勾选后模型才会显示在对话页的模型选择列表中;全部取消勾选或关闭上方开关可在列表中隐藏该供应商。",
|
|
1099
|
+
proxySettings: "网络代理",
|
|
1100
|
+
proxyMode: "代理模式",
|
|
1101
|
+
proxyModeHint: "只影响本线路的对话、登录与续期、模型目录和额度读取;支持自动读取系统代理,修改后对后续请求生效。",
|
|
1102
|
+
proxyModeAuto: "系统代理(自动检测)",
|
|
1103
|
+
proxyModeCustom: "自定义代理",
|
|
1104
|
+
proxyModeDirect: "直连(禁用代理)",
|
|
1105
|
+
customProxyUrl: "自定义代理地址",
|
|
1106
|
+
customProxyUrlHint: "支持 HTTP/HTTPS/SOCKS5 代理地址,例如 http://127.0.0.1:7890",
|
|
1107
|
+
customProxyUrlPlaceholder: "例如: http://127.0.0.1:7890",
|
|
1108
|
+
saveProxyUrl: "保存代理地址",
|
|
1109
|
+
noProxy: "不使用代理的主机",
|
|
1110
|
+
noProxyHint: "这些主机始终直连。此列表全局生效、所有线路共用。用逗号或空格分隔,支持精确主机、域名后缀(api.corp.example)与 host:port,并与进程环境和 $DSH_HOME/.env 里的 NO_PROXY 合并。",
|
|
1111
|
+
noProxyPlaceholder: "例如: copilot.tencent.com, *.corp.example, gateway.lan:8080",
|
|
1112
|
+
saveNoProxy: "保存直连主机列表",
|
|
1113
|
+
proxyDirectActive: "当前生效:直连(不经过代理)",
|
|
1114
|
+
proxyActiveTemplate: "当前生效:{proxy}",
|
|
1115
|
+
proxyDetected: "检测到系统代理",
|
|
1116
|
+
proxyDetectedEffective: "(已自动生效)",
|
|
1117
|
+
proxyNoneDetected: "未检测到系统代理,将使用直连",
|
|
1118
|
+
proxyDirectHint: "本插件的全部请求将直接连接,不经过任何代理服务器。",
|
|
1119
|
+
poolStorageTitle: "账号存储位置",
|
|
1120
|
+
poolStorageKeyring: "桌面密钥环",
|
|
1121
|
+
poolStorageCredentials: "DSH 凭据库",
|
|
1122
|
+
poolStorageKeyringHint: "仅限桌面安装:使用操作系统密钥环(DPAPI / 钥匙串 / Secret Service)。在服务器或无桌面的 Linux 主机上密钥环通常不可用,登录会失败——请改选 DSH 凭据库。",
|
|
1123
|
+
poolStorageCredentialsHint: "DSH 的标准密钥存储($DSH_HOME/.credentials.yaml)。POSIX 上强制 0600、创建者独占;Windows 上只有 profile ACL,没有权限位可强制。服务器以及任何没有桌面密钥环的主机都用它。静态不加密,靠宿主权限保护。",
|
|
1124
|
+
poolStorageEffective: "当前实际使用:{storage}",
|
|
1125
|
+
poolStorageBackendKeyring: "桌面密钥环(Secret Service),静态加密",
|
|
1126
|
+
poolStorageBackendDpapi: "Windows DPAPI,静态加密",
|
|
1127
|
+
poolStorageBackendKeychain: "macOS 钥匙串,静态加密",
|
|
1128
|
+
poolStorageBackendCredentials: "DSH 凭据库(.credentials.yaml),由文件权限保护",
|
|
1129
|
+
poolStorageSwitchWarning: "已保存在另一个存储里的账号会留在原处,切回去之前不会显示。不会做迁移。",
|
|
1130
|
+
poolStorageUnavailableKeyring: "这台主机上没有可用的桌面密钥环,因此号池无法读写。请把「账号存储位置」改成 DSH 凭据库。",
|
|
1131
|
+
poolStorageUnavailableCredentials: "这个 harness 没有凭据库(ctx.credentials),因此号池无法读写。请把「账号存储位置」改成桌面密钥环。",
|
|
1132
|
+
poolStorageUnavailableStore: "号池存储这次没有应答,所以这里没有列出账号——账号并没有被删除,存储恢复后重新打开本页即可。",
|
|
1133
|
+
enhancements: "增强功能",
|
|
1134
|
+
fastMode: "快速模式(1.5x 速度)",
|
|
1135
|
+
fastModeHint: "提升 Token 生成速度至约 1.5 倍;将以约 2x–2.5x 速度消耗 Codex 订阅额度。",
|
|
1136
|
+
outputVerbosity: "输出详细程度",
|
|
1137
|
+
outputVerbosityHint: "控制 Codex 最终回答的详细程度;不影响思考深度。默认值与官方 Codex 客户端一致(低)。",
|
|
1138
|
+
verbosityLow: "低(保持回答简洁)",
|
|
1139
|
+
verbosityMedium: "中(兼顾细节与简洁)",
|
|
1140
|
+
verbosityHigh: "高(在回答中包含更多细节)",
|
|
1141
|
+
reasoningSummary: "推理摘要",
|
|
1142
|
+
reasoningSummaryHint: "选择 ChatGPT 总结其推理的方式;不影响思考深度。默认值与官方 Codex 客户端一致(不生成摘要,可省额度)。",
|
|
1143
|
+
summaryAuto: "自动(让模型选择摘要详细程度)",
|
|
1144
|
+
summaryConcise: "简洁(显示简要推理摘要)",
|
|
1145
|
+
summaryDetailed: "详细(显示更详细的推理摘要)",
|
|
1146
|
+
summaryNone: "无(不显示推理摘要)",
|
|
1147
|
+
searchProvider: "搜索来源",
|
|
1148
|
+
searchProviderHint: "选择 DSH 联网搜索使用默认来源,或改用当前 ChatGPT 订阅的 Codex 来源(自动走代理隧道)。抓取模式为 auto 时,抓取来源跟随此选择。",
|
|
1149
|
+
searchProviderDsh: "DSH 默认",
|
|
1150
|
+
searchProviderCodex: "ChatGPT(代理隧道)",
|
|
1151
|
+
fetchStatus: "抓取来源(只读)",
|
|
1152
|
+
fetchStatusHint: "以下内容由 Host 上报,只读展示。",
|
|
1153
|
+
fetchConfiguredProvider: "配置的抓取 Provider",
|
|
1154
|
+
fetchProviderDshDefault: "DSH 默认(Host 未固定抓取 provider)",
|
|
1155
|
+
switcherState: "抓取选择器状态",
|
|
1156
|
+
switcherStateIdle: "空闲(尚未应用选择)",
|
|
1157
|
+
switcherStateApplying: "应用中(正在切换 Host 的 web provider)",
|
|
1158
|
+
switcherStateApplied: "已应用",
|
|
1159
|
+
switcherStateMissing: "未找到可切换的 web 服务",
|
|
1160
|
+
switcherStateFailed: "切换失败,请检查 Host 日志",
|
|
1161
|
+
fetchMode: "抓取模式",
|
|
1162
|
+
fetchModeAuto: "auto(有可用代理或选了 ChatGPT 搜索时用插件抓取)",
|
|
1163
|
+
fetchModePlugin: "plugin(始终用本插件抓取)",
|
|
1164
|
+
fetchModeDsh: "dsh(保留 DSH 原有抓取来源)",
|
|
1165
|
+
fetchMaxBodyChars: "插件正文上限",
|
|
1166
|
+
fetchMaxResponseBytes: "插件响应体上限",
|
|
1167
|
+
characters: "字符",
|
|
1168
|
+
bytes: "字节",
|
|
1169
|
+
fetchLimitsInactive: "仅在实际使用插件抓取时生效;走 DSH 原有抓取来源时不适用这两个上限。",
|
|
1170
|
+
fetchConfigSource: "模式与上限在插件 Config 中修改(不是本页面偏好),修改后重载插件或重启 DSH 生效。",
|
|
1171
|
+
providerDefault: "使用 Provider 默认值",
|
|
1172
|
+
contextWindows: "模型上下文窗口",
|
|
1173
|
+
contextWindowsHint: "只列出已勾选「可用模型」的条目。默认取模型目录值(GPT-6 系列 384K,最高 872K;其余最高 1M),该值用于 DSH 的压缩与溢出判断,可输入 872K、512K 等容量;改过的模型可单独或一键恢复默认。",
|
|
1174
|
+
contextWindow: "上下文窗口",
|
|
1175
|
+
contextWindowInvalid: "上下文窗口必须是正整数,且不能超过模型上限(GPT-6 系列为 872K,其余为 1M);可使用 K 或 M 后缀。",
|
|
1176
|
+
contextWindowReset: "恢复默认",
|
|
1177
|
+
contextWindowResetAll: "全部恢复默认",
|
|
1178
|
+
contextWindowResetAllConfirm: "确定把已改过的模型上下文窗口全部恢复为默认值吗?",
|
|
1179
|
+
contextWindowsNoneEnabled: "还没有勾选任何模型。在上方「可用模型」里勾选后,这里会出现该模型的上下文窗口设置。",
|
|
1180
|
+
saveContextWindow: "保存上下文窗口",
|
|
1181
|
+
save: "保存",
|
|
1182
|
+
tokens: "tokens",
|
|
1183
|
+
quickQuota: "在输入框旁显示快捷用量",
|
|
1184
|
+
quickQuotaHint: "仅在当前会话选中 codex-chatgpt 模型时显示。",
|
|
1185
|
+
quota: "用量与限额",
|
|
1186
|
+
quotaIntro: "数据来自 ChatGPT Codex 用量服务。页面可见时最多每 60 秒刷新一次。",
|
|
1187
|
+
refreshQuota: "刷新用量",
|
|
1188
|
+
refreshing: "刷新中…",
|
|
1189
|
+
noQuota: "当前套餐未返回可显示的限额窗口。",
|
|
1190
|
+
quotaSignedOut: "登录后可查看订阅限额。",
|
|
1191
|
+
stale: "显示的是上次成功获取的数据。",
|
|
1192
|
+
updated: "更新时间",
|
|
1193
|
+
primary: "主要窗口",
|
|
1194
|
+
secondary: "次要窗口",
|
|
1195
|
+
limitWindow: "额度",
|
|
1196
|
+
used: "已使用",
|
|
1197
|
+
remaining: "剩余",
|
|
1198
|
+
available: "可用",
|
|
1199
|
+
unavailable: "不可用",
|
|
1200
|
+
unlimited: "无限",
|
|
1201
|
+
credits: "Credits",
|
|
1202
|
+
monthlySpend: "月度消费控制",
|
|
1203
|
+
resetCredits: "重置次数",
|
|
1204
|
+
resetCreditExpires: "到期时间",
|
|
1205
|
+
useResetCredit: "使用重置卡",
|
|
1206
|
+
usingResetCredit: "使用中…",
|
|
1207
|
+
useResetCreditConfirm: "使用后会立即消耗 1 次重置机会,并重置符合条件的 Codex 额度窗口。确定继续吗?",
|
|
1208
|
+
resetCreditUsed: "重置卡已使用,用量数据已刷新。",
|
|
1209
|
+
spendControlReached: "已触发月度消费控制,新的订阅调用可能被限制。",
|
|
1210
|
+
limit: "上限",
|
|
1211
|
+
exhausted: "额度已用尽",
|
|
1212
|
+
resets: "重置",
|
|
1213
|
+
quickQuotaLabel: "Codex 剩余",
|
|
1214
|
+
quickQuotaLoading: "用量…",
|
|
1215
|
+
imageToolRunning: "正在生成图片",
|
|
1216
|
+
imageToolDone: "已生成图片",
|
|
1217
|
+
imageToolFailed: "图片生成失败",
|
|
1218
|
+
image: "图片",
|
|
1219
|
+
openImage: "打开图片",
|
|
1220
|
+
openNamedImage: "打开 {name}",
|
|
1221
|
+
imageLoading: "加载图片…",
|
|
1222
|
+
imageLoadFailed: "图片加载失败,点击重试",
|
|
1223
|
+
imagePreviewClose: "关闭",
|
|
1224
|
+
imagePreviewOpenOriginal: "打开原图",
|
|
1225
|
+
retry: "重试",
|
|
1226
|
+
unknown: "未知",
|
|
1227
|
+
hubBack: "订阅服务",
|
|
1228
|
+
hubOverviewHint: "选择供应商以管理账号、模型与配额;右侧开关控制该供应商是否出现在模型列表中。",
|
|
1229
|
+
hubAccountCount: "{count} 个账号",
|
|
1230
|
+
hubNoAccounts: "暂无账号,点击进入添加",
|
|
1231
|
+
hubStateEnabled: "已启用",
|
|
1232
|
+
hubStateDisabled: "已停用",
|
|
1233
|
+
hubModelsEnabled: "{count} 个模型可用",
|
|
1234
|
+
hubModelsEnabledOfTotal: "{count}/{total} 个模型可用",
|
|
1235
|
+
hubStatusFailed: "状态读取失败",
|
|
1236
|
+
hubSwitchOn: "启用 {name}",
|
|
1237
|
+
hubSwitchOff: "停用 {name}",
|
|
1238
|
+
hubCardLabel: "{name},{annotation}",
|
|
1239
|
+
hubUpdateCheck: "检测更新",
|
|
1240
|
+
hubUpdateChecking: "检测中…",
|
|
1241
|
+
hubUpdateApply: "更新到 v{version}",
|
|
1242
|
+
hubUpdateApplying: "更新中…",
|
|
1243
|
+
hubUpdateUpToDate: "已是最新版本 {version}",
|
|
1244
|
+
hubUpdateLatestWithUnknownCurrent: "最新版本 {version},当前版本未知",
|
|
1245
|
+
hubUpdateAvailable: "有新版本 {version},当前 {current}",
|
|
1246
|
+
hubUpdateInstalled: "已安装 v{version},重启宿主后生效",
|
|
1247
|
+
hubUpdateInstalledReplaced: "已移除旧版并安装 v{version},重启宿主后生效",
|
|
1248
|
+
hubUpdateInstalledLive: "已安装 v{version},当前已生效,无需重启",
|
|
1249
|
+
hubUpdateInstalledReplacedLive: "已移除旧版并安装 v{version},当前已生效,无需重启",
|
|
1250
|
+
hubUpdateFailedRestored: "更新失败,已恢复 v{version}",
|
|
1251
|
+
hubUpdateFailedRollbackFailed: "更新失败,且旧版本也没能重新装回来——插件可能已不可用",
|
|
1252
|
+
hubUpdateFailedRollbackSkipped: "更新失败,且无法自动恢复原版本——插件可能已被移除",
|
|
1253
|
+
hubUpdateDevelopmentInstall: "有新版本 {version};当前是本地链接安装,无法自动更新",
|
|
1254
|
+
hubUpdatePluginManagerMissing: "有新版本 {version};宿主未提供 pluginManager,无法自动更新",
|
|
1255
|
+
hubUpdateManualOnly: "有新版本 {version};当前安装方式无法自动更新",
|
|
1256
|
+
hubUpdateCheckFailed: "检测失败:无法连接 npm 源,请检查网络或代理",
|
|
1257
|
+
hubUpdateCommandLabel: "手动更新命令",
|
|
1258
|
+
localCodexLoginImport: "导入本机登录",
|
|
1259
|
+
localCodexLoginImporting: "导入中…",
|
|
1260
|
+
deviceCodeLogin: "设备代码登录",
|
|
1261
|
+
deviceCodeLoginStarting: "获取代码…",
|
|
1262
|
+
deviceCodeLoginDetail: "用设备代码添加账号",
|
|
1263
|
+
deviceCodeHint: "在任意设备上打开下面的链接并输入这个代码,本页会自动完成登录:这条路不需要浏览器回调到本机端口。",
|
|
1264
|
+
deviceCodeLabel: "设备代码",
|
|
1265
|
+
deviceCodeOpen: "打开确认页面",
|
|
1266
|
+
deviceCodeCopy: "复制到剪贴板",
|
|
1267
|
+
deviceCodeWaiting: "等待确认… 剩余 {time}",
|
|
1268
|
+
stopImporting: "停止导入全部本机登录",
|
|
1269
|
+
stopImportingLabel: "停止导入全部本机登录(当前 {count} 个)",
|
|
1270
|
+
stopImportingBusy: "停止导入中…",
|
|
1271
|
+
stopImportingHint: "停止导入只会让本插件忘记本机 CLI 登录的副本;Codex CLI 自己的登录文件不会被删除或修改。账号池不允许逐条删除借来的凭据,所以这里一次会停止全部导入。",
|
|
1272
|
+
"cardName.chatgpt": "ChatGPT",
|
|
1273
|
+
"cardName.command-code": "Command Code",
|
|
1274
|
+
"cardName.kimi-code": "Kimi Code",
|
|
1275
|
+
"cardName.minimax-code": "MiniMax Code",
|
|
1276
|
+
"cardName.glm-coding-plan": "GLM(ZCode 账号)",
|
|
1277
|
+
"cardName.claude": "Claude",
|
|
1278
|
+
"cardName.ollama": "Ollama",
|
|
1279
|
+
"cardName.step-code": "Step Code(Step Plan 订阅)",
|
|
1280
|
+
"cardName.cline-pass": "Cline Pass",
|
|
1281
|
+
"cardName.qoder": "Qoder(订阅)",
|
|
1282
|
+
"cardName.opendesign": "OpenDesign",
|
|
1283
|
+
"cardName.workbuddy": "WorkBuddy",
|
|
1284
|
+
"cardName.antigravity-acp": "Antigravity(ACP)",
|
|
1285
|
+
modelChecklistCount: "已启用 {count}/{total}",
|
|
1286
|
+
codeRunTitle: "代码",
|
|
1287
|
+
codeRunOutput: "输出",
|
|
1288
|
+
codeRunCopy: "复制",
|
|
1289
|
+
codeRunCopied: "已复制",
|
|
1290
|
+
codeRunWrap: "自动换行",
|
|
1291
|
+
codeRunUnwrap: "取消自动换行",
|
|
1292
|
+
codeRunInspect: "查看轨迹",
|
|
1293
|
+
codeRunPreparing: "准备中",
|
|
1294
|
+
codeRunRunning: "运行中",
|
|
1295
|
+
codeRunFailed: "失败",
|
|
1296
|
+
codeRunStopped: "已停止"
|
|
1297
|
+
};
|
|
1298
|
+
const dictionaries$15 = {
|
|
1299
|
+
zh: zh$15,
|
|
1300
|
+
en: {
|
|
1301
|
+
...accountPoolEn,
|
|
1302
|
+
title: "ChatGPT",
|
|
1303
|
+
hubTitle: "Subscriptions",
|
|
1304
|
+
intro: "Sign in with ChatGPT to use models available to your subscription in DSH.",
|
|
1305
|
+
account: "Account",
|
|
1306
|
+
signedOut: "Not signed in",
|
|
1307
|
+
signedIn: "Signed in",
|
|
1308
|
+
plan: "Plan",
|
|
1309
|
+
accountId: "Account ID",
|
|
1310
|
+
expires: "Token expires",
|
|
1311
|
+
signIn: "Sign in with ChatGPT",
|
|
1312
|
+
signInAgain: "Sign in again",
|
|
1313
|
+
cancel: "Cancel sign-in",
|
|
1314
|
+
signOut: "Sign out",
|
|
1315
|
+
refreshToken: "Refresh credentials",
|
|
1316
|
+
pending: "Complete sign-in in your browser.",
|
|
1317
|
+
popupBlocked: "The sign-in window was blocked. Use the link below to continue.",
|
|
1318
|
+
continueLogin: "Open ChatGPT sign-in",
|
|
1319
|
+
loading: "Reading status…",
|
|
1320
|
+
connection: "Connection",
|
|
1321
|
+
testConnection: "Test connection",
|
|
1322
|
+
testing: "Testing…",
|
|
1323
|
+
latency: "Last latency",
|
|
1324
|
+
selectAll: "Select all",
|
|
1325
|
+
unselectAll: "Unselect all",
|
|
1326
|
+
models: "Available models",
|
|
1327
|
+
modelsHint: "Checked models appear in the conversation model picker; unchecking all or turning off the switch hides this provider from the picker.",
|
|
1328
|
+
proxySettings: "Network Proxy",
|
|
1329
|
+
proxyMode: "Proxy Mode",
|
|
1330
|
+
proxyModeHint: "Affects only this line: its conversations, sign-in and renewal, model catalog and quota reads. Supports system proxy detection; changes apply to subsequent requests.",
|
|
1331
|
+
proxyModeAuto: "System Proxy (Auto-detect)",
|
|
1332
|
+
proxyModeCustom: "Custom Proxy",
|
|
1333
|
+
proxyModeDirect: "Direct (No Proxy)",
|
|
1334
|
+
customProxyUrl: "Custom Proxy URL",
|
|
1335
|
+
customProxyUrlHint: "Supports HTTP/HTTPS/SOCKS5 proxy URLs, e.g. http://127.0.0.1:7890",
|
|
1336
|
+
customProxyUrlPlaceholder: "e.g. http://127.0.0.1:7890",
|
|
1337
|
+
saveProxyUrl: "Save Proxy URL",
|
|
1338
|
+
noProxy: "Hosts that bypass the proxy",
|
|
1339
|
+
noProxyHint: "These hosts always connect directly. This list is global: every line shares it. Separate entries with commas or spaces; exact hosts, domain suffixes (api.corp.example) and host:port are supported, and the list is merged with NO_PROXY from the process environment and $DSH_HOME/.env.",
|
|
1340
|
+
noProxyPlaceholder: "e.g. copilot.tencent.com, *.corp.example, gateway.lan:8080",
|
|
1341
|
+
saveNoProxy: "Save bypass list",
|
|
1342
|
+
proxyDirectActive: "Active now: direct (no proxy)",
|
|
1343
|
+
proxyActiveTemplate: "Active now: {proxy}",
|
|
1344
|
+
proxyDetected: "Detected system proxy",
|
|
1345
|
+
proxyDetectedEffective: " (active)",
|
|
1346
|
+
proxyNoneDetected: "No system proxy detected; connecting directly",
|
|
1347
|
+
proxyDirectHint: "Every request from this plugin connects directly without using any proxy server.",
|
|
1348
|
+
poolStorageTitle: "Account storage",
|
|
1349
|
+
poolStorageKeyring: "Desktop keyring",
|
|
1350
|
+
poolStorageCredentials: "DSH credential store",
|
|
1351
|
+
poolStorageKeyringHint: "Desktop installs only: uses the OS keyring (DPAPI / Keychain / Secret Service). On a server or a headless Linux host the keyring is usually unavailable and sign-in will fail — pick the DSH credential store instead.",
|
|
1352
|
+
poolStorageCredentialsHint: "The standard DSH secret store ($DSH_HOME/.credentials.yaml). POSIX: 0600 enforced, owner-only; Windows: profile ACL, no mode enforcement. Use this on servers and any host without a desktop keyring. Stored unencrypted at rest, protected by the host.",
|
|
1353
|
+
poolStorageEffective: "In use now: {storage}",
|
|
1354
|
+
poolStorageBackendKeyring: "desktop keyring (Secret Service), encrypted at rest",
|
|
1355
|
+
poolStorageBackendDpapi: "Windows DPAPI, encrypted at rest",
|
|
1356
|
+
poolStorageBackendKeychain: "macOS Keychain, encrypted at rest",
|
|
1357
|
+
poolStorageBackendCredentials: "DSH credential store (.credentials.yaml), protected by file permissions",
|
|
1358
|
+
poolStorageSwitchWarning: "Accounts saved in the other store stay there and are not shown until you switch back. There is no migration.",
|
|
1359
|
+
poolStorageUnavailableKeyring: "This host has no usable desktop keyring, so the account pool cannot be read or written. Switch Account storage to the DSH credential store.",
|
|
1360
|
+
poolStorageUnavailableCredentials: "This harness has no credential store (ctx.credentials), so the account pool cannot be read or written. Switch Account storage to the desktop keyring.",
|
|
1361
|
+
poolStorageUnavailableStore: "The pool store did not answer this time, so no accounts are listed here — none were deleted; reopen this page once the store answers again.",
|
|
1362
|
+
enhancements: "Enhancements",
|
|
1363
|
+
fastMode: "Fast mode (1.5x speed)",
|
|
1364
|
+
fastModeHint: "Generates tokens ~1.5x faster; consumes Codex subscription quota at ~2x–2.5x the normal rate.",
|
|
1365
|
+
outputVerbosity: "Output verbosity",
|
|
1366
|
+
outputVerbosityHint: "Controls the detail level of final Codex answers without changing reasoning effort. The default matches the official Codex client (low).",
|
|
1367
|
+
verbosityLow: "Low (keep answers concise)",
|
|
1368
|
+
verbosityMedium: "Medium (balance detail and brevity)",
|
|
1369
|
+
verbosityHigh: "High (include more detail)",
|
|
1370
|
+
reasoningSummary: "Reasoning summary",
|
|
1371
|
+
reasoningSummaryHint: "Controls how ChatGPT summarizes its chain of thought; does not change reasoning depth. The default matches the official Codex client (no summary, which saves quota).",
|
|
1372
|
+
summaryAuto: "Auto (let model determine detail)",
|
|
1373
|
+
summaryConcise: "Concise (brief summary)",
|
|
1374
|
+
summaryDetailed: "Detailed (in-depth summary)",
|
|
1375
|
+
summaryNone: "None (hide reasoning summary)",
|
|
1376
|
+
searchProvider: "Search provider",
|
|
1377
|
+
searchProviderHint: "Choose whether DSH web search uses the default provider or the Codex proxy-backed source from this ChatGPT subscription. Fetch mode \"auto\" follows this choice.",
|
|
1378
|
+
searchProviderDsh: "DSH default",
|
|
1379
|
+
searchProviderCodex: "ChatGPT (Proxy tunnel)",
|
|
1380
|
+
fetchStatus: "Fetch source (read-only)",
|
|
1381
|
+
fetchStatusHint: "Reported by the host. Read-only.",
|
|
1382
|
+
fetchConfiguredProvider: "Configured fetch provider",
|
|
1383
|
+
fetchProviderDshDefault: "DSH default (the host pins no fetch provider)",
|
|
1384
|
+
switcherState: "Fetch switcher state",
|
|
1385
|
+
switcherStateIdle: "Idle (no selection applied yet)",
|
|
1386
|
+
switcherStateApplying: "Applying (host web provider switch in progress)",
|
|
1387
|
+
switcherStateApplied: "Applied",
|
|
1388
|
+
switcherStateMissing: "No web service found to switch",
|
|
1389
|
+
switcherStateFailed: "Switch failed, check the host log",
|
|
1390
|
+
fetchMode: "Fetch mode",
|
|
1391
|
+
fetchModeAuto: "auto (fetches with the plugin when a proxy is available or the ChatGPT search source is selected)",
|
|
1392
|
+
fetchModePlugin: "plugin (always fetch with this plugin)",
|
|
1393
|
+
fetchModeDsh: "dsh (keep the DSH default fetch source)",
|
|
1394
|
+
fetchMaxBodyChars: "Plugin body limit",
|
|
1395
|
+
fetchMaxResponseBytes: "Plugin response limit",
|
|
1396
|
+
characters: "chars",
|
|
1397
|
+
bytes: "bytes",
|
|
1398
|
+
fetchLimitsInactive: "Only applied when the plugin actually fetches; the DSH default fetch source does not use these two limits.",
|
|
1399
|
+
fetchConfigSource: "Mode and limits are changed in the plugin Config, not in these settings; they take effect after a plugin reload or a DSH restart.",
|
|
1400
|
+
providerDefault: "Use provider default",
|
|
1401
|
+
contextWindows: "Model context windows",
|
|
1402
|
+
contextWindowsHint: "Lists the models checked under Available models. Each starts at its catalog value (384K for the GPT-6 family, up to 872K; up to 1M otherwise); DSH uses it for compaction and overflow detection. Values such as 872K and 512K are accepted, and a changed model can be restored one by one or all at once.",
|
|
1403
|
+
contextWindow: "Context window",
|
|
1404
|
+
contextWindowInvalid: "The context window must be a positive integer within the model limit (872K for the GPT-6 family, 1M otherwise). K and M suffixes are accepted.",
|
|
1405
|
+
contextWindowReset: "Restore default",
|
|
1406
|
+
contextWindowResetAll: "Restore all defaults",
|
|
1407
|
+
contextWindowResetAllConfirm: "Restore every changed model context window to its default?",
|
|
1408
|
+
contextWindowsNoneEnabled: "No model is checked yet. Check one under Available models above and its context window setting appears here.",
|
|
1409
|
+
saveContextWindow: "Save context window",
|
|
1410
|
+
save: "Save",
|
|
1411
|
+
tokens: "tokens",
|
|
1412
|
+
quickQuota: "Show quick usage beside the composer",
|
|
1413
|
+
quickQuotaHint: "Shown only when the current session uses a codex-chatgpt model.",
|
|
1414
|
+
quota: "Usage and limits",
|
|
1415
|
+
quotaIntro: "Data comes from the ChatGPT Codex usage service and refreshes at most once per minute while visible.",
|
|
1416
|
+
refreshQuota: "Refresh usage",
|
|
1417
|
+
refreshing: "Refreshing…",
|
|
1418
|
+
noQuota: "Your plan did not return any displayable limit windows.",
|
|
1419
|
+
quotaSignedOut: "Sign in to view subscription limits.",
|
|
1420
|
+
stale: "Showing the last successfully fetched data.",
|
|
1421
|
+
updated: "Updated",
|
|
1422
|
+
primary: "Primary window",
|
|
1423
|
+
secondary: "Secondary window",
|
|
1424
|
+
limitWindow: "limit",
|
|
1425
|
+
used: "used",
|
|
1426
|
+
remaining: "remaining",
|
|
1427
|
+
available: "Available",
|
|
1428
|
+
unavailable: "Unavailable",
|
|
1429
|
+
unlimited: "Unlimited",
|
|
1430
|
+
credits: "Credits",
|
|
1431
|
+
monthlySpend: "Monthly spend control",
|
|
1432
|
+
resetCredits: "Reset credits",
|
|
1433
|
+
resetCreditExpires: "Expires",
|
|
1434
|
+
useResetCredit: "Use reset credit",
|
|
1435
|
+
usingResetCredit: "Using…",
|
|
1436
|
+
useResetCreditConfirm: "This immediately spends one reset credit and resets eligible Codex limit windows. Continue?",
|
|
1437
|
+
resetCreditUsed: "The reset credit was used and usage data was refreshed.",
|
|
1438
|
+
spendControlReached: "Monthly spend control has been reached; new subscription calls may be limited.",
|
|
1439
|
+
limit: "Limit",
|
|
1440
|
+
exhausted: "Quota exhausted",
|
|
1441
|
+
resets: "Resets",
|
|
1442
|
+
quickQuotaLabel: "Codex left",
|
|
1443
|
+
quickQuotaLoading: "Usage…",
|
|
1444
|
+
imageToolRunning: "Generating image",
|
|
1445
|
+
imageToolDone: "Generated image",
|
|
1446
|
+
imageToolFailed: "Image generation failed",
|
|
1447
|
+
image: "Image",
|
|
1448
|
+
openImage: "Open image",
|
|
1449
|
+
openNamedImage: "Open {name}",
|
|
1450
|
+
imageLoading: "Loading image…",
|
|
1451
|
+
imageLoadFailed: "Image failed to load. Click to retry",
|
|
1452
|
+
imagePreviewClose: "Close",
|
|
1453
|
+
imagePreviewOpenOriginal: "Open original",
|
|
1454
|
+
retry: "Retry",
|
|
1455
|
+
unknown: "Unknown",
|
|
1456
|
+
hubBack: "Subscriptions",
|
|
1457
|
+
hubOverviewHint: "Pick a provider to manage its accounts, models and quota. The switch controls whether it appears in the model picker.",
|
|
1458
|
+
hubAccountCount: "{count} accounts",
|
|
1459
|
+
hubNoAccounts: "No accounts yet — open to add one",
|
|
1460
|
+
hubStateEnabled: "Enabled",
|
|
1461
|
+
hubStateDisabled: "Disabled",
|
|
1462
|
+
hubModelsEnabled: "{count} models available",
|
|
1463
|
+
hubModelsEnabledOfTotal: "{count}/{total} models available",
|
|
1464
|
+
hubStatusFailed: "Status unavailable",
|
|
1465
|
+
hubSwitchOn: "Enable {name}",
|
|
1466
|
+
hubSwitchOff: "Disable {name}",
|
|
1467
|
+
hubCardLabel: "{name}, {annotation}",
|
|
1468
|
+
hubUpdateCheck: "Check for updates",
|
|
1469
|
+
hubUpdateChecking: "Checking…",
|
|
1470
|
+
hubUpdateApply: "Update to v{version}",
|
|
1471
|
+
hubUpdateApplying: "Updating…",
|
|
1472
|
+
hubUpdateUpToDate: "Up to date ({version})",
|
|
1473
|
+
hubUpdateLatestWithUnknownCurrent: "Latest is {version}; the running version is unknown",
|
|
1474
|
+
hubUpdateAvailable: "{version} is available — you have {current}",
|
|
1475
|
+
hubUpdateInstalled: "Installed v{version} — restart the Host to apply it",
|
|
1476
|
+
hubUpdateInstalledReplaced: "Removed the old copy and installed v{version} — restart the Host to apply it",
|
|
1477
|
+
hubUpdateInstalledLive: "Installed v{version} — active now, no restart needed",
|
|
1478
|
+
hubUpdateInstalledReplacedLive: "Removed the old copy and installed v{version} — active now, no restart needed",
|
|
1479
|
+
hubUpdateFailedRestored: "Update failed; v{version} was restored",
|
|
1480
|
+
hubUpdateFailedRollbackFailed: "Update failed, and the previous version could not be reinstalled — the plugin may no longer be available",
|
|
1481
|
+
hubUpdateFailedRollbackSkipped: "Update failed, and the previous version could not be restored — the plugin may have been removed",
|
|
1482
|
+
hubUpdateDevelopmentInstall: "{version} is available, but this copy is a local link and cannot update itself",
|
|
1483
|
+
hubUpdatePluginManagerMissing: "{version} is available, but this Host exposes no pluginManager to install it",
|
|
1484
|
+
hubUpdateManualOnly: "{version} is available, but this install cannot update itself",
|
|
1485
|
+
hubUpdateCheckFailed: "Check failed: the npm registry could not be reached — check the network or proxy",
|
|
1486
|
+
hubUpdateCommandLabel: "Manual update command",
|
|
1487
|
+
localCodexLoginImport: "Import local sign-in",
|
|
1488
|
+
localCodexLoginImporting: "Importing…",
|
|
1489
|
+
deviceCodeLogin: "Device-code sign-in",
|
|
1490
|
+
deviceCodeLoginStarting: "Requesting code…",
|
|
1491
|
+
deviceCodeLoginDetail: "Add account with device code",
|
|
1492
|
+
deviceCodeHint: "Open the link below on any device and enter this code. This page finishes the sign-in by itself: nothing has to call back to a local port.",
|
|
1493
|
+
deviceCodeLabel: "Device code",
|
|
1494
|
+
deviceCodeOpen: "Open the confirmation page",
|
|
1495
|
+
deviceCodeCopy: "Copy to clipboard",
|
|
1496
|
+
deviceCodeWaiting: "Waiting for confirmation… {time} remaining",
|
|
1497
|
+
stopImporting: "Stop importing all local sign-ins",
|
|
1498
|
+
stopImportingLabel: "Stop importing all local sign-ins ({count} currently imported)",
|
|
1499
|
+
stopImportingBusy: "Stopping the import…",
|
|
1500
|
+
stopImportingHint: "Stopping the import only makes this plugin forget its copy of the local CLI sign-in; the Codex CLI own sign-in file is never deleted or changed. The account pool does not allow deleting a borrowed credential one at a time, so this stops every import at once.",
|
|
1501
|
+
"cardName.chatgpt": "ChatGPT",
|
|
1502
|
+
"cardName.command-code": "Command Code",
|
|
1503
|
+
"cardName.kimi-code": "Kimi Code",
|
|
1504
|
+
"cardName.minimax-code": "MiniMax Code",
|
|
1505
|
+
"cardName.glm-coding-plan": "GLM (ZCode Account)",
|
|
1506
|
+
"cardName.claude": "Claude",
|
|
1507
|
+
"cardName.ollama": "Ollama",
|
|
1508
|
+
"cardName.step-code": "Step Code (Step Plan Subscription)",
|
|
1509
|
+
"cardName.cline-pass": "Cline Pass",
|
|
1510
|
+
"cardName.qoder": "Qoder Subscription",
|
|
1511
|
+
"cardName.opendesign": "OpenDesign",
|
|
1512
|
+
"cardName.workbuddy": "WorkBuddy",
|
|
1513
|
+
"cardName.antigravity-acp": "Antigravity (ACP)",
|
|
1514
|
+
modelChecklistCount: "{count}/{total} enabled",
|
|
1515
|
+
codeRunTitle: "Code",
|
|
1516
|
+
codeRunOutput: "Output",
|
|
1517
|
+
codeRunCopy: "Copy",
|
|
1518
|
+
codeRunCopied: "Copied",
|
|
1519
|
+
codeRunWrap: "Wrap lines",
|
|
1520
|
+
codeRunUnwrap: "Do not wrap lines",
|
|
1521
|
+
codeRunInspect: "Inspect",
|
|
1522
|
+
codeRunPreparing: "Preparing",
|
|
1523
|
+
codeRunRunning: "Running",
|
|
1524
|
+
codeRunFailed: "Failed",
|
|
1525
|
+
codeRunStopped: "Stopped"
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
//#endregion
|
|
1529
|
+
//#region src/client/common/line-locale.ts
|
|
1530
|
+
/**
|
|
1531
|
+
* Locale plumbing shared by the provider detail pages.
|
|
1532
|
+
*
|
|
1533
|
+
* Every card used to render its `zh` dictionary object directly, which pinned
|
|
1534
|
+
* the whole page to Chinese whatever the active locale was: the dictionaries
|
|
1535
|
+
* carry a complete English half, but nothing ever asked the locale service for
|
|
1536
|
+
* it. A card now renders a dictionary-shaped view of the registered namespace
|
|
1537
|
+
* instead — same property access (`t.signIn`), but each read goes through the
|
|
1538
|
+
* registry, so the active locale (and any language pack registered later)
|
|
1539
|
+
* decides the text.
|
|
1540
|
+
*
|
|
1541
|
+
* The view keeps the fallback's own keys, in its own order, and resolves every
|
|
1542
|
+
* value lazily on read: the object identity is stable per namespace + fallback,
|
|
1543
|
+
* so a card can keep passing `t` into helpers, while the strings still follow a
|
|
1544
|
+
* locale switch without remounting.
|
|
1545
|
+
*/
|
|
1546
|
+
const NOOP_SUBSCRIBE = () => () => {};
|
|
1547
|
+
const ZERO_REVISION = () => 0;
|
|
1548
|
+
let runtime;
|
|
1549
|
+
let subscribe = NOOP_SUBSCRIBE;
|
|
1550
|
+
let revision = ZERO_REVISION;
|
|
1551
|
+
const bound = /* @__PURE__ */ new Map();
|
|
1552
|
+
/**
|
|
1553
|
+
* Hand the client locale runtime to this module.
|
|
1554
|
+
*
|
|
1555
|
+
* Called once from the plugin entry, before any card mounts. Rendering without
|
|
1556
|
+
* it (unit tests that mount a card bare) keeps the dictionary's own values,
|
|
1557
|
+
* which is what those tests assert against.
|
|
1558
|
+
*
|
|
1559
|
+
* @param locale - the plugin context's locale runtime.
|
|
1560
|
+
*/
|
|
1561
|
+
function installLineLocale(locale) {
|
|
1562
|
+
runtime = locale;
|
|
1563
|
+
subscribe = typeof locale?.subscribe === "function" ? (listener) => locale.subscribe(listener) : NOOP_SUBSCRIBE;
|
|
1564
|
+
revision = typeof locale?.getSnapshot === "function" ? () => locale.getSnapshot().revision : ZERO_REVISION;
|
|
1565
|
+
bound.clear();
|
|
1566
|
+
}
|
|
1567
|
+
/** Bound translator of one namespace, or `undefined` when no locale service exists. */
|
|
1568
|
+
function translatorOf(ns) {
|
|
1569
|
+
if (runtime === void 0) return void 0;
|
|
1570
|
+
const cached = bound.get(ns);
|
|
1571
|
+
if (cached !== void 0) return cached;
|
|
1572
|
+
let translate;
|
|
1573
|
+
try {
|
|
1574
|
+
translate = runtime.bind(ns);
|
|
1575
|
+
} catch {
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
bound.set(ns, translate);
|
|
1579
|
+
return translate;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Dictionary-shaped view of one namespace, resolved through the active locale.
|
|
1583
|
+
*
|
|
1584
|
+
* @param ns - the namespace the card registered its dictionaries under.
|
|
1585
|
+
* @param fallback - the card's own `zh` dictionary: source of the key set and
|
|
1586
|
+
* of the value used when no locale service is installed.
|
|
1587
|
+
* @returns the same key shape as `fallback`, with values read at render time.
|
|
1588
|
+
*/
|
|
1589
|
+
function useLineDict(ns, fallback) {
|
|
1590
|
+
(0, react.useSyncExternalStore)(subscribe, revision, revision);
|
|
1591
|
+
return (0, react.useMemo)(() => liveDict(ns, fallback), [ns, fallback]);
|
|
1592
|
+
}
|
|
1593
|
+
/** Build the lazy dictionary view: one enumerable getter per fallback key. */
|
|
1594
|
+
function liveDict(ns, fallback) {
|
|
1595
|
+
const translate = translatorOf(ns);
|
|
1596
|
+
const view = {};
|
|
1597
|
+
for (const key of Object.keys(fallback)) Object.defineProperty(view, key, {
|
|
1598
|
+
enumerable: true,
|
|
1599
|
+
configurable: false,
|
|
1600
|
+
get: () => translate === void 0 ? fallback[key] : translate(key)
|
|
1601
|
+
});
|
|
1602
|
+
return view;
|
|
1603
|
+
}
|
|
1604
|
+
//#endregion
|
|
1605
|
+
//#region src/client/common/LineProxySection.tsx
|
|
1606
|
+
/**
|
|
1607
|
+
* The proxy card one provider line owns.
|
|
1608
|
+
*
|
|
1609
|
+
* Before this component the plugin had ONE proxy setting for all thirteen
|
|
1610
|
+
* lines, rendered inside the ChatGPT card. A Chinese mixed network needs the
|
|
1611
|
+
* opposite: the foreign lines go through the local Clash, a domestic endpoint
|
|
1612
|
+
* must not. Flipping the shared setting repainted every line at once, and the
|
|
1613
|
+
* "direct" side effect (bare `fetch`) silently changed whether other middleware
|
|
1614
|
+
* saw the traffic at all.
|
|
1615
|
+
*
|
|
1616
|
+
* One component serves every line so the twelve cards cannot drift: each passes
|
|
1617
|
+
* its own provider id and reads/writes the same preference shape through the
|
|
1618
|
+
* same plugin route. The copy lives in the plugin's own namespace (zh + en
|
|
1619
|
+
* built in, ru in the language pack), so a line card does not have to carry a
|
|
1620
|
+
* second dictionary just for this section.
|
|
1621
|
+
*
|
|
1622
|
+
* The BYPASS list is deliberately NOT per-line: a bypass is a host-level fact
|
|
1623
|
+
* ("`copilot.tencent.com` is reachable directly"), and thirteen copies of it
|
|
1624
|
+
* would mean a user fixes one line and leaves twelve broken. Every card shows
|
|
1625
|
+
* the same list and says so.
|
|
1626
|
+
*
|
|
1627
|
+
* @module @eddyskywalker/dsh-chatgpt-subscription/client/common/LineProxySection
|
|
1628
|
+
*/
|
|
1629
|
+
/**
|
|
1630
|
+
* The proxy card for one provider line: mode, custom address, and the shared
|
|
1631
|
+
* bypass list.
|
|
1632
|
+
*
|
|
1633
|
+
* Drafts are local so typing does not round-trip; saving posts the field and
|
|
1634
|
+
* clears the draft once the host has answered with the canonical form (the host
|
|
1635
|
+
* normalizes the list and the URL, and what it answers is what the matcher
|
|
1636
|
+
* reads).
|
|
1637
|
+
*/
|
|
1638
|
+
function LineProxySection({ line, fetchSnapshot, onSave, idPrefix, snapshot: provided }) {
|
|
1639
|
+
const labels = useLineDict(NS, zh$15);
|
|
1640
|
+
const readSnapshotFromRoute = (0, react.useCallback)(() => (fetchSnapshot ?? (() => fetchLineProxySnapshot("/api/dsh-chatgpt-subscription")))(), [fetchSnapshot]);
|
|
1641
|
+
const writePreferences = (0, react.useCallback)((patch) => (onSave ?? ((next) => savePreferences("/api/dsh-chatgpt-subscription", next)))(patch), [onSave]);
|
|
1642
|
+
const [readSnapshot, setReadSnapshot] = (0, react.useState)(null);
|
|
1643
|
+
const snapshot = provided !== void 0 ? provided : readSnapshot;
|
|
1644
|
+
const [customDraft, setCustomDraft] = (0, react.useState)(null);
|
|
1645
|
+
const [noProxyDraft, setNoProxyDraft] = (0, react.useState)(null);
|
|
1646
|
+
const [saving, setSaving] = (0, react.useState)(null);
|
|
1647
|
+
const [error, setError] = (0, react.useState)(null);
|
|
1648
|
+
const prefix = idPrefix ?? line;
|
|
1649
|
+
const reload = (0, react.useCallback)(async () => {
|
|
1650
|
+
if (provided !== void 0) return;
|
|
1651
|
+
try {
|
|
1652
|
+
setReadSnapshot(await readSnapshotFromRoute());
|
|
1653
|
+
} catch (cause) {
|
|
1654
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
1655
|
+
}
|
|
1656
|
+
}, [provided, readSnapshotFromRoute]);
|
|
1657
|
+
(0, react.useEffect)(() => {
|
|
1658
|
+
reload();
|
|
1659
|
+
}, [reload]);
|
|
1660
|
+
const config = snapshot?.lineProxies?.[line] ?? null;
|
|
1661
|
+
const mode = config?.mode ?? "auto";
|
|
1662
|
+
const activeProxy = snapshot?.activeProxies?.[line] ?? null;
|
|
1663
|
+
const save = async (kind, patch) => {
|
|
1664
|
+
setSaving(kind);
|
|
1665
|
+
setError(null);
|
|
1666
|
+
try {
|
|
1667
|
+
await writePreferences(patch);
|
|
1668
|
+
if (kind === "line") setCustomDraft(null);
|
|
1669
|
+
else setNoProxyDraft(null);
|
|
1670
|
+
await reload();
|
|
1671
|
+
} catch (cause) {
|
|
1672
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
1673
|
+
} finally {
|
|
1674
|
+
setSaving(null);
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
const saveUrl = () => {
|
|
1678
|
+
const draft = customDraft?.trim();
|
|
1679
|
+
save("line", { lineProxies: { [line]: {
|
|
1680
|
+
mode: "custom",
|
|
1681
|
+
customProxyUrl: draft ? draft : null
|
|
1682
|
+
} } });
|
|
1683
|
+
};
|
|
1684
|
+
const saveBypass = () => {
|
|
1685
|
+
const draft = noProxyDraft?.trim();
|
|
1686
|
+
save("bypass", { noProxy: draft ? draft : null });
|
|
1687
|
+
};
|
|
1688
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
1689
|
+
className: "dsha-group",
|
|
1690
|
+
"data-line-proxy": line,
|
|
1691
|
+
children: [
|
|
1692
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1693
|
+
className: "dsha-grouphead",
|
|
1694
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: labels.proxySettings })
|
|
1695
|
+
}),
|
|
1696
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1697
|
+
className: "dsha-pref-row",
|
|
1698
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: labels.proxyMode }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1699
|
+
className: "dsha-muted",
|
|
1700
|
+
children: labels.proxyModeHint
|
|
1701
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1702
|
+
className: "dsha-select",
|
|
1703
|
+
"aria-label": labels.proxyMode,
|
|
1704
|
+
value: mode,
|
|
1705
|
+
disabled: saving !== null,
|
|
1706
|
+
onChange: (event) => {
|
|
1707
|
+
const next = event.currentTarget.value;
|
|
1708
|
+
save("line", { lineProxies: { [line]: {
|
|
1709
|
+
mode: next,
|
|
1710
|
+
customProxyUrl: next === "custom" ? config?.customProxyUrl ?? null : null
|
|
1711
|
+
} } });
|
|
1712
|
+
},
|
|
1713
|
+
children: [
|
|
1714
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1715
|
+
value: "auto",
|
|
1716
|
+
children: labels.proxyModeAuto
|
|
1717
|
+
}),
|
|
1718
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1719
|
+
value: "custom",
|
|
1720
|
+
children: labels.proxyModeCustom
|
|
1721
|
+
}),
|
|
1722
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1723
|
+
value: "direct",
|
|
1724
|
+
children: labels.proxyModeDirect
|
|
1725
|
+
})
|
|
1726
|
+
]
|
|
1727
|
+
})]
|
|
1728
|
+
}),
|
|
1729
|
+
mode === "custom" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1730
|
+
className: "dsha-context-settings",
|
|
1731
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: labels.customProxyUrl }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1732
|
+
className: "dsha-muted",
|
|
1733
|
+
children: labels.customProxyUrlHint
|
|
1734
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1735
|
+
className: "dsh-codex-proxy-control",
|
|
1736
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1737
|
+
id: `${prefix}-proxy-url`,
|
|
1738
|
+
type: "text",
|
|
1739
|
+
placeholder: labels.customProxyUrlPlaceholder,
|
|
1740
|
+
value: customDraft ?? config?.customProxyUrl ?? "",
|
|
1741
|
+
disabled: saving !== null,
|
|
1742
|
+
"aria-label": labels.customProxyUrl,
|
|
1743
|
+
onChange: (event) => setCustomDraft(event.currentTarget.value),
|
|
1744
|
+
onKeyDown: (event) => {
|
|
1745
|
+
if (event.key !== "Enter") return;
|
|
1746
|
+
event.preventDefault();
|
|
1747
|
+
saveUrl();
|
|
1748
|
+
}
|
|
1749
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1750
|
+
className: "dsha-context-save",
|
|
1751
|
+
type: "button",
|
|
1752
|
+
"aria-label": labels.saveProxyUrl,
|
|
1753
|
+
disabled: saving !== null || customDraft === null,
|
|
1754
|
+
onClick: saveUrl,
|
|
1755
|
+
children: labels.save
|
|
1756
|
+
})]
|
|
1757
|
+
}) })]
|
|
1758
|
+
}) : null,
|
|
1759
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1760
|
+
className: "dsha-muted",
|
|
1761
|
+
"data-line-proxy-active": line,
|
|
1762
|
+
children: activeProxy === null ? labels.proxyDirectActive : labels.proxyActiveTemplate.replace("{proxy}", activeProxy)
|
|
1763
|
+
}),
|
|
1764
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1765
|
+
className: "dsha-context-settings",
|
|
1766
|
+
"data-proxy-bypass": true,
|
|
1767
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: labels.noProxy }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1768
|
+
className: "dsha-muted",
|
|
1769
|
+
children: labels.noProxyHint
|
|
1770
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1771
|
+
className: "dsh-codex-proxy-control",
|
|
1772
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1773
|
+
id: `${prefix}-no-proxy`,
|
|
1774
|
+
type: "text",
|
|
1775
|
+
placeholder: labels.noProxyPlaceholder,
|
|
1776
|
+
value: noProxyDraft ?? snapshot?.noProxy ?? "",
|
|
1777
|
+
disabled: saving !== null,
|
|
1778
|
+
"aria-label": labels.noProxy,
|
|
1779
|
+
onChange: (event) => setNoProxyDraft(event.currentTarget.value),
|
|
1780
|
+
onKeyDown: (event) => {
|
|
1781
|
+
if (event.key !== "Enter") return;
|
|
1782
|
+
event.preventDefault();
|
|
1783
|
+
saveBypass();
|
|
1784
|
+
}
|
|
1785
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1786
|
+
className: "dsha-context-save",
|
|
1787
|
+
type: "button",
|
|
1788
|
+
"aria-label": labels.saveNoProxy,
|
|
1789
|
+
disabled: saving !== null || noProxyDraft === null,
|
|
1790
|
+
onClick: saveBypass,
|
|
1791
|
+
children: labels.save
|
|
1792
|
+
})]
|
|
1793
|
+
}) })]
|
|
1794
|
+
}),
|
|
1795
|
+
error === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1796
|
+
className: "dsh-codex-error",
|
|
1797
|
+
role: "status",
|
|
1798
|
+
children: error
|
|
1799
|
+
})
|
|
1800
|
+
]
|
|
1801
|
+
});
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Read that snapshot from the plugin's own proxy route.
|
|
1805
|
+
*
|
|
1806
|
+
* The same route serves every card, so saving from one card and reading from
|
|
1807
|
+
* another always sees the same document.
|
|
1808
|
+
* @param base - Plugin route prefix (`ROUTE_PREFIX`).
|
|
1809
|
+
* @returns the parsed snapshot.
|
|
1810
|
+
*/
|
|
1811
|
+
async function fetchLineProxySnapshot(base) {
|
|
1812
|
+
const response = await fetch(`${base}/proxy`, { credentials: "same-origin" });
|
|
1813
|
+
const envelope = await response.json();
|
|
1814
|
+
if (!response.ok || !envelope.ok) throw new Error(envelope.ok ? `Proxy settings route failed (HTTP ${response.status})` : envelope.error.message);
|
|
1815
|
+
return envelope.value;
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* Write one preferences patch through the plugin route.
|
|
1819
|
+
* @param base - Plugin route prefix (`ROUTE_PREFIX`).
|
|
1820
|
+
* @param patch - Preferences to merge.
|
|
1821
|
+
* @returns the refreshed preferences.
|
|
1822
|
+
*/
|
|
1823
|
+
async function savePreferences(base, patch) {
|
|
1824
|
+
const response = await fetch(`${base}/preferences/update`, {
|
|
1825
|
+
method: "POST",
|
|
1826
|
+
credentials: "same-origin",
|
|
1827
|
+
headers: { "content-type": "application/json" },
|
|
1828
|
+
body: JSON.stringify(patch)
|
|
1829
|
+
});
|
|
1830
|
+
const envelope = await response.json();
|
|
1831
|
+
if (!response.ok || !envelope.ok) throw new Error(envelope.ok ? `Saving the proxy setting failed (HTTP ${response.status})` : envelope.error.message);
|
|
1832
|
+
return envelope.value;
|
|
1833
|
+
}
|
|
1834
|
+
//#endregion
|
|
1069
1835
|
//#region src/client/common/account-quota.tsx
|
|
1070
1836
|
/**
|
|
1071
1837
|
* Percent with at most one decimal.
|
|
@@ -1732,7 +2498,6 @@ window.__ModuleLoader__.load({
|
|
|
1732
2498
|
const [resetCreditNotice, setResetCreditNotice] = (0, react.useState)(null);
|
|
1733
2499
|
const [connection, setConnection] = (0, react.useState)(null);
|
|
1734
2500
|
const [contextDrafts, setContextDrafts] = (0, react.useState)({});
|
|
1735
|
-
const [customProxyDraft, setCustomProxyDraft] = (0, react.useState)(null);
|
|
1736
2501
|
const load = (0, react.useCallback)(async (quiet = false) => {
|
|
1737
2502
|
if (!quiet) setError(null);
|
|
1738
2503
|
try {
|
|
@@ -1994,11 +2759,29 @@ window.__ModuleLoader__.load({
|
|
|
1994
2759
|
await updatePreferences({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) });
|
|
1995
2760
|
setContextDrafts({});
|
|
1996
2761
|
};
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2762
|
+
/**
|
|
2763
|
+
* Read this card's proxy snapshot.
|
|
2764
|
+
*
|
|
2765
|
+
* Kept beside the tab's own status because the shared section renders from
|
|
2766
|
+
* `GET /proxy`, the same route every other line card reads: one document, one
|
|
2767
|
+
* meaning, and saving on any card is visible to the rest.
|
|
2768
|
+
*/
|
|
2769
|
+
/**
|
|
2770
|
+
* This card's proxy snapshot, taken from the status it already reads.
|
|
2771
|
+
*
|
|
2772
|
+
* The shared section can read `/proxy` on its own, but this tab answers from
|
|
2773
|
+
* one status document; a second request per render would double the polling
|
|
2774
|
+
* for data the status already carries.
|
|
2775
|
+
*/
|
|
2776
|
+
const proxySnapshot = (0, react.useMemo)(() => {
|
|
2777
|
+
if (status === null) return null;
|
|
2778
|
+
return {
|
|
2779
|
+
lineProxies: status.preferences.lineProxies ?? {},
|
|
2780
|
+
noProxy: status.preferences.noProxy ?? null,
|
|
2781
|
+
detectedProxy: status.detectedProxy ?? null,
|
|
2782
|
+
activeProxies: status.activeProxies ?? {}
|
|
2783
|
+
};
|
|
2784
|
+
}, [status]);
|
|
2002
2785
|
/**
|
|
2003
2786
|
* The shared card takes a label object while this tab translates by key, so
|
|
2004
2787
|
* every pool label is resolved through the tab's own translator and follows
|
|
@@ -2381,104 +3164,13 @@ window.__ModuleLoader__.load({
|
|
|
2381
3164
|
})
|
|
2382
3165
|
]
|
|
2383
3166
|
}),
|
|
2384
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
children: t("proxyModeHint")
|
|
2392
|
-
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
2393
|
-
className: "dsha-select",
|
|
2394
|
-
"aria-label": t("proxyMode"),
|
|
2395
|
-
value: preferences?.proxyMode ?? "auto",
|
|
2396
|
-
disabled: busy !== null,
|
|
2397
|
-
onChange: (event) => {
|
|
2398
|
-
const mode = event.currentTarget.value;
|
|
2399
|
-
setStatus((current) => current ? {
|
|
2400
|
-
...current,
|
|
2401
|
-
preferences: {
|
|
2402
|
-
...current.preferences,
|
|
2403
|
-
proxyMode: mode
|
|
2404
|
-
}
|
|
2405
|
-
} : current);
|
|
2406
|
-
updatePreferences({ proxyMode: mode });
|
|
2407
|
-
},
|
|
2408
|
-
children: [
|
|
2409
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
2410
|
-
value: "auto",
|
|
2411
|
-
children: t("proxyModeAuto")
|
|
2412
|
-
}),
|
|
2413
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
2414
|
-
value: "custom",
|
|
2415
|
-
children: t("proxyModeCustom")
|
|
2416
|
-
}),
|
|
2417
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
2418
|
-
value: "direct",
|
|
2419
|
-
children: t("proxyModeDirect")
|
|
2420
|
-
})
|
|
2421
|
-
]
|
|
2422
|
-
})]
|
|
2423
|
-
}),
|
|
2424
|
-
(preferences?.proxyMode ?? "auto") === "auto" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2425
|
-
className: "dsh-codex-proxy-status",
|
|
2426
|
-
children: status?.detectedProxy ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
2427
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [t("proxyDetected"), ":"] }),
|
|
2428
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
2429
|
-
className: "dsh-codex-proxy-tag",
|
|
2430
|
-
children: status.detectedProxy
|
|
2431
|
-
}),
|
|
2432
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2433
|
-
className: "dsh-codex-success",
|
|
2434
|
-
children: t("proxyDetectedEffective")
|
|
2435
|
-
})
|
|
2436
|
-
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2437
|
-
className: "dsha-muted",
|
|
2438
|
-
children: t("proxyNoneDetected")
|
|
2439
|
-
})
|
|
2440
|
-
}) : null,
|
|
2441
|
-
preferences?.proxyMode === "direct" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2442
|
-
className: "dsha-muted",
|
|
2443
|
-
style: { margin: "8px 0 0" },
|
|
2444
|
-
children: t("proxyDirectHint")
|
|
2445
|
-
}) : null,
|
|
2446
|
-
preferences?.proxyMode === "custom" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2447
|
-
className: "dsha-context-settings",
|
|
2448
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("customProxyUrl") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2449
|
-
className: "dsha-muted",
|
|
2450
|
-
children: t("customProxyUrlHint")
|
|
2451
|
-
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2452
|
-
className: "dsha-context-row",
|
|
2453
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2454
|
-
className: "dsh-codex-proxy-control",
|
|
2455
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2456
|
-
id: "dsh-codex-custom-proxy",
|
|
2457
|
-
type: "text",
|
|
2458
|
-
placeholder: t("customProxyUrlPlaceholder"),
|
|
2459
|
-
value: customProxyDraft ?? preferences?.customProxyUrl ?? "",
|
|
2460
|
-
disabled: busy !== null,
|
|
2461
|
-
"aria-label": t("customProxyUrl"),
|
|
2462
|
-
onChange: (event) => {
|
|
2463
|
-
setCustomProxyDraft(event.currentTarget.value);
|
|
2464
|
-
},
|
|
2465
|
-
onKeyDown: (event) => {
|
|
2466
|
-
if (event.key !== "Enter") return;
|
|
2467
|
-
event.preventDefault();
|
|
2468
|
-
updateCustomProxyUrl();
|
|
2469
|
-
}
|
|
2470
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2471
|
-
className: "dsha-context-save",
|
|
2472
|
-
type: "button",
|
|
2473
|
-
"aria-label": t("saveProxyUrl"),
|
|
2474
|
-
disabled: busy !== null || customProxyDraft === null,
|
|
2475
|
-
onClick: () => void updateCustomProxyUrl(),
|
|
2476
|
-
children: t("save")
|
|
2477
|
-
})]
|
|
2478
|
-
})
|
|
2479
|
-
})]
|
|
2480
|
-
}) : null
|
|
2481
|
-
]
|
|
3167
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, {
|
|
3168
|
+
line: "codex-chatgpt",
|
|
3169
|
+
idPrefix: "codex-chatgpt",
|
|
3170
|
+
snapshot: proxySnapshot,
|
|
3171
|
+
onSave: async (patch) => {
|
|
3172
|
+
await updatePreferences(patch);
|
|
3173
|
+
}
|
|
2482
3174
|
}),
|
|
2483
3175
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
2484
3176
|
title: t("enhancements"),
|
|
@@ -3056,82 +3748,6 @@ window.__ModuleLoader__.load({
|
|
|
3056
3748
|
"max"
|
|
3057
3749
|
];
|
|
3058
3750
|
//#endregion
|
|
3059
|
-
//#region src/client/common/line-locale.ts
|
|
3060
|
-
/**
|
|
3061
|
-
* Locale plumbing shared by the provider detail pages.
|
|
3062
|
-
*
|
|
3063
|
-
* Every card used to render its `zh` dictionary object directly, which pinned
|
|
3064
|
-
* the whole page to Chinese whatever the active locale was: the dictionaries
|
|
3065
|
-
* carry a complete English half, but nothing ever asked the locale service for
|
|
3066
|
-
* it. A card now renders a dictionary-shaped view of the registered namespace
|
|
3067
|
-
* instead — same property access (`t.signIn`), but each read goes through the
|
|
3068
|
-
* registry, so the active locale (and any language pack registered later)
|
|
3069
|
-
* decides the text.
|
|
3070
|
-
*
|
|
3071
|
-
* The view keeps the fallback's own keys, in its own order, and resolves every
|
|
3072
|
-
* value lazily on read: the object identity is stable per namespace + fallback,
|
|
3073
|
-
* so a card can keep passing `t` into helpers, while the strings still follow a
|
|
3074
|
-
* locale switch without remounting.
|
|
3075
|
-
*/
|
|
3076
|
-
const NOOP_SUBSCRIBE = () => () => {};
|
|
3077
|
-
const ZERO_REVISION = () => 0;
|
|
3078
|
-
let runtime;
|
|
3079
|
-
let subscribe = NOOP_SUBSCRIBE;
|
|
3080
|
-
let revision = ZERO_REVISION;
|
|
3081
|
-
const bound = /* @__PURE__ */ new Map();
|
|
3082
|
-
/**
|
|
3083
|
-
* Hand the client locale runtime to this module.
|
|
3084
|
-
*
|
|
3085
|
-
* Called once from the plugin entry, before any card mounts. Rendering without
|
|
3086
|
-
* it (unit tests that mount a card bare) keeps the dictionary's own values,
|
|
3087
|
-
* which is what those tests assert against.
|
|
3088
|
-
*
|
|
3089
|
-
* @param locale - the plugin context's locale runtime.
|
|
3090
|
-
*/
|
|
3091
|
-
function installLineLocale(locale) {
|
|
3092
|
-
runtime = locale;
|
|
3093
|
-
subscribe = typeof locale?.subscribe === "function" ? (listener) => locale.subscribe(listener) : NOOP_SUBSCRIBE;
|
|
3094
|
-
revision = typeof locale?.getSnapshot === "function" ? () => locale.getSnapshot().revision : ZERO_REVISION;
|
|
3095
|
-
bound.clear();
|
|
3096
|
-
}
|
|
3097
|
-
/** Bound translator of one namespace, or `undefined` when no locale service exists. */
|
|
3098
|
-
function translatorOf(ns) {
|
|
3099
|
-
if (runtime === void 0) return void 0;
|
|
3100
|
-
const cached = bound.get(ns);
|
|
3101
|
-
if (cached !== void 0) return cached;
|
|
3102
|
-
let translate;
|
|
3103
|
-
try {
|
|
3104
|
-
translate = runtime.bind(ns);
|
|
3105
|
-
} catch {
|
|
3106
|
-
return;
|
|
3107
|
-
}
|
|
3108
|
-
bound.set(ns, translate);
|
|
3109
|
-
return translate;
|
|
3110
|
-
}
|
|
3111
|
-
/**
|
|
3112
|
-
* Dictionary-shaped view of one namespace, resolved through the active locale.
|
|
3113
|
-
*
|
|
3114
|
-
* @param ns - the namespace the card registered its dictionaries under.
|
|
3115
|
-
* @param fallback - the card's own `zh` dictionary: source of the key set and
|
|
3116
|
-
* of the value used when no locale service is installed.
|
|
3117
|
-
* @returns the same key shape as `fallback`, with values read at render time.
|
|
3118
|
-
*/
|
|
3119
|
-
function useLineDict(ns, fallback) {
|
|
3120
|
-
(0, react.useSyncExternalStore)(subscribe, revision, revision);
|
|
3121
|
-
return (0, react.useMemo)(() => liveDict(ns, fallback), [ns, fallback]);
|
|
3122
|
-
}
|
|
3123
|
-
/** Build the lazy dictionary view: one enumerable getter per fallback key. */
|
|
3124
|
-
function liveDict(ns, fallback) {
|
|
3125
|
-
const translate = translatorOf(ns);
|
|
3126
|
-
const view = {};
|
|
3127
|
-
for (const key of Object.keys(fallback)) Object.defineProperty(view, key, {
|
|
3128
|
-
enumerable: true,
|
|
3129
|
-
configurable: false,
|
|
3130
|
-
get: () => translate === void 0 ? fallback[key] : translate(key)
|
|
3131
|
-
});
|
|
3132
|
-
return view;
|
|
3133
|
-
}
|
|
3134
|
-
//#endregion
|
|
3135
3751
|
//#region src/client/common/ContextWindowEditor.tsx
|
|
3136
3752
|
/**
|
|
3137
3753
|
* The shared "model context windows" block every provider settings card renders.
|
|
@@ -3276,7 +3892,7 @@ window.__ModuleLoader__.load({
|
|
|
3276
3892
|
//#endregion
|
|
3277
3893
|
//#region src/client/command-code/locales.ts
|
|
3278
3894
|
const NS_COMMAND_CODE = "dsh-command-code";
|
|
3279
|
-
const zh$
|
|
3895
|
+
const zh$14 = {
|
|
3280
3896
|
...accountPoolZh,
|
|
3281
3897
|
title: "Command Code",
|
|
3282
3898
|
pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。",
|
|
@@ -3344,7 +3960,7 @@ window.__ModuleLoader__.load({
|
|
|
3344
3960
|
loginFailed: "登录失败",
|
|
3345
3961
|
tokens: "tokens"
|
|
3346
3962
|
};
|
|
3347
|
-
const en$
|
|
3963
|
+
const en$14 = {
|
|
3348
3964
|
...accountPoolEn,
|
|
3349
3965
|
title: "Command Code",
|
|
3350
3966
|
pageDesc: "Sign in to Command Code and manage models, context windows, and quota.",
|
|
@@ -3412,11 +4028,11 @@ window.__ModuleLoader__.load({
|
|
|
3412
4028
|
loginFailed: "Sign-in failed",
|
|
3413
4029
|
tokens: "tokens"
|
|
3414
4030
|
};
|
|
3415
|
-
const dictionaries$
|
|
3416
|
-
zh: zh$
|
|
3417
|
-
"zh-CN": zh$
|
|
3418
|
-
en: en$
|
|
3419
|
-
"en-US": en$
|
|
4031
|
+
const dictionaries$14 = {
|
|
4032
|
+
zh: zh$14,
|
|
4033
|
+
"zh-CN": zh$14,
|
|
4034
|
+
en: en$14,
|
|
4035
|
+
"en-US": en$14
|
|
3420
4036
|
};
|
|
3421
4037
|
//#endregion
|
|
3422
4038
|
//#region src/client/command-code/CommandCodeSection.tsx
|
|
@@ -3457,7 +4073,7 @@ window.__ModuleLoader__.load({
|
|
|
3457
4073
|
const [apiKey, setApiKey] = (0, react.useState)("");
|
|
3458
4074
|
/** Follow-up poll owed while the host refreshes the quota behind an answer. */
|
|
3459
4075
|
const quotaFollowUp = (0, react.useRef)(null);
|
|
3460
|
-
const t = useLineDict(NS_COMMAND_CODE, zh$
|
|
4076
|
+
const t = useLineDict(NS_COMMAND_CODE, zh$14);
|
|
3461
4077
|
const notifyChange = (0, react.useCallback)(() => {
|
|
3462
4078
|
onModelChange?.();
|
|
3463
4079
|
loadModelDirectory?.();
|
|
@@ -4019,6 +4635,7 @@ window.__ModuleLoader__.load({
|
|
|
4019
4635
|
})
|
|
4020
4636
|
]
|
|
4021
4637
|
}),
|
|
4638
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "command-code" }),
|
|
4022
4639
|
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4023
4640
|
className: "dsha-error",
|
|
4024
4641
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -4218,7 +4835,7 @@ window.__ModuleLoader__.load({
|
|
|
4218
4835
|
//#endregion
|
|
4219
4836
|
//#region src/client/kimi-code/locales.ts
|
|
4220
4837
|
const NS_KIMI_CODE = "dsh-kimi-code";
|
|
4221
|
-
const zh$
|
|
4838
|
+
const zh$13 = {
|
|
4222
4839
|
...accountPoolZh,
|
|
4223
4840
|
title: "Kimi Code",
|
|
4224
4841
|
pageDesc: "登录 Kimi Code 订阅,管理模型、思考档位、上下文窗口与额度。",
|
|
@@ -4405,7 +5022,7 @@ window.__ModuleLoader__.load({
|
|
|
4405
5022
|
compactionRouteNoImage: "该模型不接受图片:摘要里的截图会被替换为占位文本。",
|
|
4406
5023
|
compactionRouteEmpty: "没有可用的线路——先登录任意一条线路再回来设置。"
|
|
4407
5024
|
};
|
|
4408
|
-
const en$
|
|
5025
|
+
const en$13 = {
|
|
4409
5026
|
...accountPoolEn,
|
|
4410
5027
|
title: "Kimi Code",
|
|
4411
5028
|
pageDesc: "Sign in to the Kimi Code subscription and manage models, thinking level, context windows, and quota.",
|
|
@@ -4592,11 +5209,11 @@ window.__ModuleLoader__.load({
|
|
|
4592
5209
|
compactionRouteNoImage: "This model takes no images: screenshots become placeholder text in the summary.",
|
|
4593
5210
|
compactionRouteEmpty: "No route is available — sign in to one first."
|
|
4594
5211
|
};
|
|
4595
|
-
const dictionaries$
|
|
4596
|
-
zh: zh$
|
|
4597
|
-
"zh-CN": zh$
|
|
4598
|
-
en: en$
|
|
4599
|
-
"en-US": en$
|
|
5212
|
+
const dictionaries$13 = {
|
|
5213
|
+
zh: zh$13,
|
|
5214
|
+
"zh-CN": zh$13,
|
|
5215
|
+
en: en$13,
|
|
5216
|
+
"en-US": en$13
|
|
4600
5217
|
};
|
|
4601
5218
|
//#endregion
|
|
4602
5219
|
//#region src/shared/kimi-code-contracts.ts
|
|
@@ -4708,7 +5325,7 @@ window.__ModuleLoader__.load({
|
|
|
4708
5325
|
return `${value}x`;
|
|
4709
5326
|
}
|
|
4710
5327
|
function KimiModelCapabilities({ models }) {
|
|
4711
|
-
const t = useLineDict(NS_KIMI_CODE, zh$
|
|
5328
|
+
const t = useLineDict(NS_KIMI_CODE, zh$13);
|
|
4712
5329
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4713
5330
|
className: "dsha-cap-table",
|
|
4714
5331
|
children: [
|
|
@@ -5237,7 +5854,7 @@ window.__ModuleLoader__.load({
|
|
|
5237
5854
|
statusGeneration.current += 1;
|
|
5238
5855
|
setStatus(next);
|
|
5239
5856
|
}, []);
|
|
5240
|
-
const t = useLineDict(NS_KIMI_CODE, zh$
|
|
5857
|
+
const t = useLineDict(NS_KIMI_CODE, zh$13);
|
|
5241
5858
|
const notifyChange = (0, react.useCallback)(() => {
|
|
5242
5859
|
onModelChange?.();
|
|
5243
5860
|
loadModelDirectory?.();
|
|
@@ -5993,6 +6610,7 @@ window.__ModuleLoader__.load({
|
|
|
5993
6610
|
})
|
|
5994
6611
|
]
|
|
5995
6612
|
}),
|
|
6613
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "kimi-code" }),
|
|
5996
6614
|
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5997
6615
|
className: "dsha-error",
|
|
5998
6616
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -6045,7 +6663,7 @@ window.__ModuleLoader__.load({
|
|
|
6045
6663
|
//#endregion
|
|
6046
6664
|
//#region src/client/minimax-code/locales.ts
|
|
6047
6665
|
const NS_MINIMAX_CODE = "dsh-minimax-code";
|
|
6048
|
-
const zh$
|
|
6666
|
+
const zh$12 = {
|
|
6049
6667
|
...accountPoolZh,
|
|
6050
6668
|
title: "MiniMax Code",
|
|
6051
6669
|
pageDesc: "登录 MiniMax Code 编程订阅(设备码 OAuth),复用本机 MiniMax Code 的登录态,管理账号、连接与模型。",
|
|
@@ -6243,7 +6861,7 @@ window.__ModuleLoader__.load({
|
|
|
6243
6861
|
videoHistoryEncrypted: "已由系统凭据后端加密",
|
|
6244
6862
|
videoHistoryPlain: "本机没有可用的凭据后端,记录为明文"
|
|
6245
6863
|
};
|
|
6246
|
-
const en$
|
|
6864
|
+
const en$12 = {
|
|
6247
6865
|
...accountPoolEn,
|
|
6248
6866
|
title: "MiniMax Code",
|
|
6249
6867
|
pageDesc: "Sign in to the MiniMax Code coding subscription (device-code OAuth) and reuse the local MiniMax Code sign-in to manage the account, connection, and models.",
|
|
@@ -6441,11 +7059,11 @@ window.__ModuleLoader__.load({
|
|
|
6441
7059
|
videoHistoryEncrypted: "Encrypted by the platform credential backend",
|
|
6442
7060
|
videoHistoryPlain: "No credential backend on this host; stored as plain text"
|
|
6443
7061
|
};
|
|
6444
|
-
const dictionaries$
|
|
6445
|
-
zh: zh$
|
|
6446
|
-
"zh-CN": zh$
|
|
6447
|
-
en: en$
|
|
6448
|
-
"en-US": en$
|
|
7062
|
+
const dictionaries$12 = {
|
|
7063
|
+
zh: zh$12,
|
|
7064
|
+
"zh-CN": zh$12,
|
|
7065
|
+
en: en$12,
|
|
7066
|
+
"en-US": en$12
|
|
6449
7067
|
};
|
|
6450
7068
|
//#endregion
|
|
6451
7069
|
//#region src/client/minimax-code/useMinimaxCodeSection.ts
|
|
@@ -6459,7 +7077,7 @@ window.__ModuleLoader__.load({
|
|
|
6459
7077
|
* rather than inferred from the JSX.
|
|
6460
7078
|
*/
|
|
6461
7079
|
/** The card's own dictionary; stable identity keeps effect dependencies intact. */
|
|
6462
|
-
const fallbackTranslate$7 = (key) => zh$
|
|
7080
|
+
const fallbackTranslate$7 = (key) => zh$12[key];
|
|
6463
7081
|
/**
|
|
6464
7082
|
* The shared pool card's labels, resolved through this card's dictionary.
|
|
6465
7083
|
*
|
|
@@ -8500,6 +9118,7 @@ window.__ModuleLoader__.load({
|
|
|
8500
9118
|
onSave: saveVideoDefaults
|
|
8501
9119
|
}),
|
|
8502
9120
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(VideoHistorySection, { t }),
|
|
9121
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "minimax-code" }),
|
|
8503
9122
|
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8504
9123
|
className: "dsha-error",
|
|
8505
9124
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -8517,7 +9136,7 @@ window.__ModuleLoader__.load({
|
|
|
8517
9136
|
* 键名重合的会被渲染成 ChatGPT 的措辞,不重合的会把键名本身打印出来)。
|
|
8518
9137
|
*/
|
|
8519
9138
|
const NS_GLM_CODING_PLAN = "dsh-glm-coding-plan";
|
|
8520
|
-
const zh$
|
|
9139
|
+
const zh$11 = {
|
|
8521
9140
|
...accountPoolZh,
|
|
8522
9141
|
title: "GLM(ZCode 账号)",
|
|
8523
9142
|
pageDesc: "用 ZCode 账号授权接入 GLM Coding Plan(国区 bigmodel.cn / 国际区 z.ai),管理账号池、套餐额度与模型勾选。两个区域的凭据各自独立,池内可以同时存在两区账号。",
|
|
@@ -8611,7 +9230,7 @@ window.__ModuleLoader__.load({
|
|
|
8611
9230
|
quotaAllowanceUnknown: "未判定",
|
|
8612
9231
|
quotaAllowanceHint: "登录时探活认定的额度来源。「免费体验额度」指新用户注册后自动获得、首次使用起 5 天内每天 800 万 token 的体验额度。"
|
|
8613
9232
|
};
|
|
8614
|
-
const en$
|
|
9233
|
+
const en$11 = {
|
|
8615
9234
|
...accountPoolEn,
|
|
8616
9235
|
title: "GLM (ZCode account)",
|
|
8617
9236
|
pageDesc: "Sign in with a ZCode account to reach GLM Coding Plan (China bigmodel.cn / International z.ai), and manage the account pool, plan quota and model selection. The two regions hold independent credentials, so a pool can carry accounts from both.",
|
|
@@ -8705,11 +9324,11 @@ window.__ModuleLoader__.load({
|
|
|
8705
9324
|
quotaAllowanceUnknown: "Undetermined",
|
|
8706
9325
|
quotaAllowanceHint: "The allowance source established by the sign-in probe. “Free trial allowance” means 8M tokens per day for 5 days from first use, granted automatically to new accounts."
|
|
8707
9326
|
};
|
|
8708
|
-
const dictionaries$
|
|
8709
|
-
zh: zh$
|
|
8710
|
-
"zh-CN": zh$
|
|
8711
|
-
en: en$
|
|
8712
|
-
"en-US": en$
|
|
9327
|
+
const dictionaries$11 = {
|
|
9328
|
+
zh: zh$11,
|
|
9329
|
+
"zh-CN": zh$11,
|
|
9330
|
+
en: en$11,
|
|
9331
|
+
"en-US": en$11
|
|
8713
9332
|
};
|
|
8714
9333
|
/** 一个配额窗口的键到「窗口长度(分钟)」的映射。 */
|
|
8715
9334
|
const QUOTA_WINDOW_MINUTES$1 = {
|
|
@@ -8790,7 +9409,7 @@ window.__ModuleLoader__.load({
|
|
|
8790
9409
|
/** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
|
|
8791
9410
|
const LOGIN_POLL_INTERVAL_MS$2 = 2e3;
|
|
8792
9411
|
/** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
|
|
8793
|
-
const fallbackTranslate$6 = (key) => zh$
|
|
9412
|
+
const fallbackTranslate$6 = (key) => zh$11[key];
|
|
8794
9413
|
/**
|
|
8795
9414
|
* 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
|
|
8796
9415
|
*
|
|
@@ -9216,7 +9835,7 @@ window.__ModuleLoader__.load({
|
|
|
9216
9835
|
const { status, loading, busy, error, connection, adoptResult, pasteValue, region, pasteOpen, contextDrafts, savingModel } = state;
|
|
9217
9836
|
const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels } = derived;
|
|
9218
9837
|
const { setRegion, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, refreshQuota, refreshCatalog, testConnection } = actions;
|
|
9219
|
-
const t = useLineDict(NS_GLM_CODING_PLAN, zh$
|
|
9838
|
+
const t = useLineDict(NS_GLM_CODING_PLAN, zh$11);
|
|
9220
9839
|
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
9221
9840
|
className: "dsha-page",
|
|
9222
9841
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -9636,6 +10255,7 @@ window.__ModuleLoader__.load({
|
|
|
9636
10255
|
})
|
|
9637
10256
|
]
|
|
9638
10257
|
}),
|
|
10258
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "glm-coding-plan" }),
|
|
9639
10259
|
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
9640
10260
|
className: "dsha-error",
|
|
9641
10261
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -9681,7 +10301,7 @@ window.__ModuleLoader__.load({
|
|
|
9681
10301
|
* provider — the same reason every sibling line has one.
|
|
9682
10302
|
*/
|
|
9683
10303
|
const NS_CLAUDE = "dsh-claude";
|
|
9684
|
-
const zh$
|
|
10304
|
+
const zh$10 = {
|
|
9685
10305
|
...accountPoolZh,
|
|
9686
10306
|
title: "Claude(订阅)",
|
|
9687
10307
|
pageDesc: "登录 Claude Pro/Max 订阅,管理模型、思考档位、上下文窗口与额度。",
|
|
@@ -9798,7 +10418,7 @@ window.__ModuleLoader__.load({
|
|
|
9798
10418
|
copy: "复制",
|
|
9799
10419
|
copied: "已复制"
|
|
9800
10420
|
};
|
|
9801
|
-
const en$
|
|
10421
|
+
const en$10 = {
|
|
9802
10422
|
...accountPoolEn,
|
|
9803
10423
|
title: "Claude (subscription)",
|
|
9804
10424
|
pageDesc: "Sign in to a Claude Pro/Max subscription and manage models, thinking levels, context windows and quota.",
|
|
@@ -9915,11 +10535,11 @@ window.__ModuleLoader__.load({
|
|
|
9915
10535
|
copy: "Copy",
|
|
9916
10536
|
copied: "Copied"
|
|
9917
10537
|
};
|
|
9918
|
-
const dictionaries$
|
|
9919
|
-
zh: zh$
|
|
9920
|
-
"zh-CN": zh$
|
|
9921
|
-
en: en$
|
|
9922
|
-
"en-US": en$
|
|
10538
|
+
const dictionaries$10 = {
|
|
10539
|
+
zh: zh$10,
|
|
10540
|
+
"zh-CN": zh$10,
|
|
10541
|
+
en: en$10,
|
|
10542
|
+
"en-US": en$10
|
|
9923
10543
|
};
|
|
9924
10544
|
//#endregion
|
|
9925
10545
|
//#region src/client/claude/useClaudeSection.ts
|
|
@@ -9953,7 +10573,7 @@ window.__ModuleLoader__.load({
|
|
|
9953
10573
|
const [connection, setConnection] = (0, react.useState)(null);
|
|
9954
10574
|
/** Follow-up poll owed while the host refreshes the quota behind an answer. */
|
|
9955
10575
|
const quotaFollowUp = (0, react.useRef)(null);
|
|
9956
|
-
const t = useLineDict(NS_CLAUDE, zh$
|
|
10576
|
+
const t = useLineDict(NS_CLAUDE, zh$10);
|
|
9957
10577
|
const notifyChange = (0, react.useCallback)(() => {
|
|
9958
10578
|
onModelChange?.();
|
|
9959
10579
|
loadModelDirectory?.();
|
|
@@ -10400,11 +11020,11 @@ window.__ModuleLoader__.load({
|
|
|
10400
11020
|
* out here would hide a choice the host would accept and a catalog may expose.
|
|
10401
11021
|
*/
|
|
10402
11022
|
const EFFORT_LABELS$2 = {
|
|
10403
|
-
low: zh$
|
|
10404
|
-
medium: zh$
|
|
10405
|
-
high: zh$
|
|
10406
|
-
xhigh: zh$
|
|
10407
|
-
max: zh$
|
|
11023
|
+
low: zh$10.effortLow,
|
|
11024
|
+
medium: zh$10.effortMedium,
|
|
11025
|
+
high: zh$10.effortHigh,
|
|
11026
|
+
xhigh: zh$10.effortXHigh,
|
|
11027
|
+
max: zh$10.effortMax
|
|
10408
11028
|
};
|
|
10409
11029
|
/** One-line capability summary shown as a model pill's hover title. */
|
|
10410
11030
|
function modelFacts(model, t) {
|
|
@@ -10425,7 +11045,7 @@ window.__ModuleLoader__.load({
|
|
|
10425
11045
|
const { status, loading, busy, error, flow, connection, pasteValue, contextDrafts, savingModel } = state;
|
|
10426
11046
|
const { accounts, hasAdopted, contextModels, overrideCount, quota, windows, poolLabels } = derived;
|
|
10427
11047
|
const { login, cancelLogin, submitPaste, adopt, stopImporting, accountAction, setStrategy, relogin, refreshQuota, refreshCatalog, testConnection, toggleModel, setAllModels, updateEffort, updateCacheTtl, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setPasteValue } = actions;
|
|
10428
|
-
const t = useLineDict(NS_CLAUDE, zh$
|
|
11048
|
+
const t = useLineDict(NS_CLAUDE, zh$10);
|
|
10429
11049
|
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10430
11050
|
className: "dsha-page",
|
|
10431
11051
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -10875,6 +11495,7 @@ window.__ModuleLoader__.load({
|
|
|
10875
11495
|
})
|
|
10876
11496
|
]
|
|
10877
11497
|
}),
|
|
11498
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "claude-subscription" }),
|
|
10878
11499
|
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10879
11500
|
className: "dsha-error",
|
|
10880
11501
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -11016,7 +11637,7 @@ window.__ModuleLoader__.load({
|
|
|
11016
11637
|
//#endregion
|
|
11017
11638
|
//#region src/client/ollama/locales.ts
|
|
11018
11639
|
const NS_OLLAMA = "dsh-ollama";
|
|
11019
|
-
const zh$
|
|
11640
|
+
const zh$9 = {
|
|
11020
11641
|
...accountPoolZh,
|
|
11021
11642
|
relogin: "更换 Key",
|
|
11022
11643
|
needsRelogin: "Key 已失效",
|
|
@@ -11068,7 +11689,7 @@ window.__ModuleLoader__.load({
|
|
|
11068
11689
|
usageNone: "尚无请求",
|
|
11069
11690
|
usageHint: "按 Ollama 每次响应自带的 token 计数本地累加。"
|
|
11070
11691
|
};
|
|
11071
|
-
const en$
|
|
11692
|
+
const en$9 = {
|
|
11072
11693
|
...accountPoolEn,
|
|
11073
11694
|
relogin: "Replace Key",
|
|
11074
11695
|
needsRelogin: "Key rejected",
|
|
@@ -11120,11 +11741,11 @@ window.__ModuleLoader__.load({
|
|
|
11120
11741
|
usageNone: "No requests yet",
|
|
11121
11742
|
usageHint: "Summed locally from the token counts Ollama returns on each response."
|
|
11122
11743
|
};
|
|
11123
|
-
const dictionaries$
|
|
11124
|
-
zh: zh$
|
|
11125
|
-
"zh-CN": zh$
|
|
11126
|
-
en: en$
|
|
11127
|
-
"en-US": en$
|
|
11744
|
+
const dictionaries$9 = {
|
|
11745
|
+
zh: zh$9,
|
|
11746
|
+
"zh-CN": zh$9,
|
|
11747
|
+
en: en$9,
|
|
11748
|
+
"en-US": en$9
|
|
11128
11749
|
};
|
|
11129
11750
|
//#endregion
|
|
11130
11751
|
//#region src/client/ollama/OllamaSection.tsx
|
|
@@ -11250,7 +11871,7 @@ window.__ModuleLoader__.load({
|
|
|
11250
11871
|
const setEffort = (0, react.useCallback)((value) => {
|
|
11251
11872
|
run("effort", () => API$8.setDefaultReasoningEffort(value === "" ? null : value));
|
|
11252
11873
|
}, [run]);
|
|
11253
|
-
const t = useLineDict(NS_OLLAMA, zh$
|
|
11874
|
+
const t = useLineDict(NS_OLLAMA, zh$9);
|
|
11254
11875
|
const pool = status?.pool;
|
|
11255
11876
|
const models = status?.models ?? [];
|
|
11256
11877
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
@@ -11365,7 +11986,7 @@ window.__ModuleLoader__.load({
|
|
|
11365
11986
|
className: "dsha-btn",
|
|
11366
11987
|
disabled: busy !== null,
|
|
11367
11988
|
onClick: () => setShowKeyForm(false),
|
|
11368
|
-
children: zh$
|
|
11989
|
+
children: zh$9.deleteAccount
|
|
11369
11990
|
})]
|
|
11370
11991
|
})
|
|
11371
11992
|
]
|
|
@@ -11472,7 +12093,8 @@ window.__ModuleLoader__.load({
|
|
|
11472
12093
|
]
|
|
11473
12094
|
})
|
|
11474
12095
|
]
|
|
11475
|
-
})
|
|
12096
|
+
}),
|
|
12097
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "ollama" })
|
|
11476
12098
|
] });
|
|
11477
12099
|
}
|
|
11478
12100
|
//#endregion
|
|
@@ -11563,7 +12185,7 @@ window.__ModuleLoader__.load({
|
|
|
11563
12185
|
//#endregion
|
|
11564
12186
|
//#region src/client/antigravity-acp/locales.ts
|
|
11565
12187
|
const NS_ANTIGRAVITY_ACP = "dsh-antigravity-acp";
|
|
11566
|
-
const zh$
|
|
12188
|
+
const zh$8 = {
|
|
11567
12189
|
title: "Antigravity(ACP)",
|
|
11568
12190
|
pageDesc: "通过 Google 官方 Antigravity CLI 的 Agent Client Protocol(ACP)接入:模型、工具与会话全部由官方进程驱动,登录态由官方进程自己保管。",
|
|
11569
12191
|
routeOwned: "模型路由由本插件提供",
|
|
@@ -11590,7 +12212,6 @@ window.__ModuleLoader__.load({
|
|
|
11590
12212
|
signInAgain: "重新登录",
|
|
11591
12213
|
signInStarting: "正在启动…",
|
|
11592
12214
|
signInSuccess: "已发起登录:浏览器由 Antigravity CLI 打开,完成授权后状态会自动变为「已登录」。",
|
|
11593
|
-
signInAlready: "当前已是登录状态,无需重复登录。",
|
|
11594
12215
|
signInHintSummary: "登录是怎么完成的?",
|
|
11595
12216
|
signInHint: "登录由 Antigravity CLI 自己完成:点击后它会打开浏览器,完成后回到这里刷新状态。本插件不读取、不保存你的 Google 凭据。",
|
|
11596
12217
|
signInHeadless: "无界面环境请在终端执行 agy acp --login,然后回到此页刷新。",
|
|
@@ -11645,9 +12266,10 @@ window.__ModuleLoader__.load({
|
|
|
11645
12266
|
scopeHintSummary: "展开看这四条限制",
|
|
11646
12267
|
scopeHint: "这些是 ACP 与官方 Agent 的客观限制,本线路不做绕过:",
|
|
11647
12268
|
scopePrompt: "ACP 没有独立的 system 提示槽位:DSH 的系统提示会作为提示首段随会话发送,官方 Agent 自身的系统提示无法移除。",
|
|
11648
|
-
scopeHistory: "
|
|
12269
|
+
scopeHistory: "正常结束后会话随进程一起停放供下次复用:下一条消息若前缀指纹与工具目录未变,只发送增量;历史被压缩或改写、工具集变化或进程死亡时才重建会话并重放带锚点的历史。",
|
|
11649
12270
|
scopeTools: "作为主模型时工具由 DSH 执行并把关;作为子代理时子进程使用官方 Agent 自己的工具集。",
|
|
11650
12271
|
scopeQuota: "官方服务端不公布剩余额度,因此本卡片不显示任何百分比或余额。",
|
|
12272
|
+
scopeNetwork: "本线路的网络请求由官方 CLI(agy)自己管理,插件无法为它单独指定代理;这里的代理设置也不会作用于它。",
|
|
11651
12273
|
error: "操作失败:{detail}",
|
|
11652
12274
|
complianceSummary: "条款风险(点开查看)",
|
|
11653
12275
|
complianceNotice: "⚠️ 条款风险:Google Antigravity 官方 FAQ 明确写着「使用第三方软件、工具或服务访问 Antigravity 违反其服务条款」,且「把 agy 包装进第三方编码 Agent 或应用、或自动化账号轮换,在消费者套餐下不受支持」,可能导致账号被暂停或终止。本插件运行的是 Google 官方 agy 与官方 ACP 服务器(不逆向协议、不读取凭据、单账号不轮换),但这些措施不能消除条款风险。是否继续使用请自行判断;需要零争议时请改用 Gemini Enterprise 或 Google AI Studio API Key。",
|
|
@@ -11655,7 +12277,7 @@ window.__ModuleLoader__.load({
|
|
|
11655
12277
|
enabledHint: "该线路当前已启用。",
|
|
11656
12278
|
toggleHint: "可在「订阅服务」总览页的该线路卡片上随时停用。"
|
|
11657
12279
|
};
|
|
11658
|
-
const en$
|
|
12280
|
+
const en$8 = {
|
|
11659
12281
|
title: "Antigravity (ACP)",
|
|
11660
12282
|
pageDesc: "Connect through Google's official Antigravity CLI over the Agent Client Protocol (ACP): the model, its tools and its sessions all come from the official process, which also keeps its own sign-in state.",
|
|
11661
12283
|
routeOwned: "Model route served by this plugin",
|
|
@@ -11682,7 +12304,6 @@ window.__ModuleLoader__.load({
|
|
|
11682
12304
|
signInAgain: "Sign in again",
|
|
11683
12305
|
signInStarting: "Starting...",
|
|
11684
12306
|
signInSuccess: "Sign-in started: the Antigravity CLI opens the browser, and the status here turns to signed in once you approve it.",
|
|
11685
|
-
signInAlready: "This line is already signed in; there is nothing to do.",
|
|
11686
12307
|
signInHintSummary: "How does sign-in work?",
|
|
11687
12308
|
signInHint: "The Antigravity CLI performs the sign-in itself: it opens the browser, and you come back here to refresh the state. This plugin never reads or stores your Google credentials.",
|
|
11688
12309
|
signInHeadless: "On a headless host run agy acp --login in a terminal, then refresh here.",
|
|
@@ -11737,9 +12358,10 @@ window.__ModuleLoader__.load({
|
|
|
11737
12358
|
scopeHintSummary: "Show the four limits",
|
|
11738
12359
|
scopeHint: "These are objective ACP and official-agent limits; this line does not work around them:",
|
|
11739
12360
|
scopePrompt: "ACP has no separate system-prompt slot: the DSH system prompt travels as the head of the prompt, and the official agent's own system prompt cannot be removed.",
|
|
11740
|
-
scopeHistory: "
|
|
12361
|
+
scopeHistory: "After a normal finish the session parks with its process for reuse: the next message sends only the increment if the prefix fingerprint and tool catalogue are unchanged, and only a compacted or rewritten history, a changed tool set, or a dead process triggers a rebuild with an anchored replay.",
|
|
11741
12362
|
scopeTools: "As a main model its tool calls are executed and gated by DSH; as a subagent the child runs the official agent's own tools.",
|
|
11742
12363
|
scopeQuota: "The official server publishes no remaining quota, so this card shows no percentage and no balance.",
|
|
12364
|
+
scopeNetwork: "This line's network requests are managed by the official CLI (agy) itself; the plugin cannot give it a separate proxy, and the proxy settings elsewhere do not apply to it.",
|
|
11743
12365
|
error: "Action failed: {detail}",
|
|
11744
12366
|
complianceSummary: "Terms risk (click to read)",
|
|
11745
12367
|
complianceNotice: "Terms risk: Google Antigravity's official FAQ states that accessing Antigravity through third-party software, tools, or services violates its Terms of Service, and that wrapping agy inside third-party coding agents or applications, or automating account rotation, is not supported under consumer plans - either can result in suspension or termination of your account. This plugin runs Google's own agy CLI and official ACP server (no protocol reverse-engineering, no credential access, single account, no rotation), but those measures do not remove the risk. Whether to keep using it is your decision; where a zero-controversy setup is required, use a Gemini Enterprise or Google AI Studio API key instead.",
|
|
@@ -11747,11 +12369,11 @@ window.__ModuleLoader__.load({
|
|
|
11747
12369
|
enabledHint: "This line is enabled.",
|
|
11748
12370
|
toggleHint: "You can switch it off at any time from its card in the subscription overview."
|
|
11749
12371
|
};
|
|
11750
|
-
const dictionaries$
|
|
11751
|
-
zh: zh$
|
|
11752
|
-
"zh-CN": zh$
|
|
11753
|
-
en: en$
|
|
11754
|
-
"en-US": en$
|
|
12372
|
+
const dictionaries$8 = {
|
|
12373
|
+
zh: zh$8,
|
|
12374
|
+
"zh-CN": zh$8,
|
|
12375
|
+
en: en$8,
|
|
12376
|
+
"en-US": en$8
|
|
11755
12377
|
};
|
|
11756
12378
|
//#endregion
|
|
11757
12379
|
//#region src/client/antigravity-acp/AntigravityAcpSection.tsx
|
|
@@ -11808,7 +12430,7 @@ window.__ModuleLoader__.load({
|
|
|
11808
12430
|
setBusy(null);
|
|
11809
12431
|
}
|
|
11810
12432
|
}, [props]);
|
|
11811
|
-
const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$
|
|
12433
|
+
const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$8);
|
|
11812
12434
|
const models = status?.models ?? [];
|
|
11813
12435
|
const auth = status?.auth;
|
|
11814
12436
|
const usage = status?.usage;
|
|
@@ -11842,13 +12464,20 @@ window.__ModuleLoader__.load({
|
|
|
11842
12464
|
setError(null);
|
|
11843
12465
|
setLoginNotice(null);
|
|
11844
12466
|
API$6.startLogin().then(async (result) => {
|
|
11845
|
-
setLoginNotice(
|
|
12467
|
+
setLoginNotice(t.signInSuccess);
|
|
11846
12468
|
await reload();
|
|
11847
12469
|
}).catch((cause) => setError(cause instanceof Error ? cause.message : String(cause))).finally(() => setBusy(null));
|
|
11848
12470
|
}, [reload, t]);
|
|
11849
12471
|
const saveBinaryPath = (0, react.useCallback)(() => {
|
|
11850
12472
|
run("binary", () => API$6.update({ binaryPath: binaryPath.trim() === "" ? null : binaryPath.trim() }));
|
|
11851
12473
|
}, [run, binaryPath]);
|
|
12474
|
+
const resetBinaryPath = (0, react.useCallback)(() => {
|
|
12475
|
+
run("binary", async () => {
|
|
12476
|
+
const result = await API$6.update({ binaryPath: null });
|
|
12477
|
+
setBinaryPath("");
|
|
12478
|
+
return result;
|
|
12479
|
+
});
|
|
12480
|
+
}, [run]);
|
|
11852
12481
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
11853
12482
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11854
12483
|
className: "dsha-group",
|
|
@@ -11958,22 +12587,31 @@ window.__ModuleLoader__.load({
|
|
|
11958
12587
|
marginLeft: "auto",
|
|
11959
12588
|
flex: "0 1 520px"
|
|
11960
12589
|
},
|
|
11961
|
-
children: [
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
12590
|
+
children: [
|
|
12591
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
12592
|
+
className: "dsha-input",
|
|
12593
|
+
style: {
|
|
12594
|
+
flex: "1 1 260px",
|
|
12595
|
+
minWidth: 180
|
|
12596
|
+
},
|
|
12597
|
+
value: binaryPath,
|
|
12598
|
+
placeholder: t.binaryPathPlaceholder,
|
|
12599
|
+
disabled: busy !== null,
|
|
12600
|
+
onChange: (event) => setBinaryPath(event.target.value)
|
|
12601
|
+
}),
|
|
12602
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
12603
|
+
className: "dsha-btn",
|
|
12604
|
+
disabled: busy !== null,
|
|
12605
|
+
onClick: saveBinaryPath,
|
|
12606
|
+
children: t.binaryPathSave
|
|
12607
|
+
}),
|
|
12608
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
12609
|
+
className: "dsha-btn",
|
|
12610
|
+
disabled: busy !== null,
|
|
12611
|
+
onClick: resetBinaryPath,
|
|
12612
|
+
children: t.binaryPathReset
|
|
12613
|
+
})
|
|
12614
|
+
]
|
|
11977
12615
|
})]
|
|
11978
12616
|
}),
|
|
11979
12617
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
@@ -12253,7 +12891,8 @@ window.__ModuleLoader__.load({
|
|
|
12253
12891
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: t.scopePrompt }),
|
|
12254
12892
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: t.scopeHistory }),
|
|
12255
12893
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: t.scopeTools }),
|
|
12256
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: t.scopeQuota })
|
|
12894
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: t.scopeQuota }),
|
|
12895
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: t.scopeNetwork })
|
|
12257
12896
|
]
|
|
12258
12897
|
})]
|
|
12259
12898
|
})
|
|
@@ -12282,7 +12921,7 @@ window.__ModuleLoader__.load({
|
|
|
12282
12921
|
* 键名重合的会被渲染成 ChatGPT 的措辞,不重合的会把键名本身打印出来)。
|
|
12283
12922
|
*/
|
|
12284
12923
|
const NS_STEP_CODE = "dsh-step-code";
|
|
12285
|
-
const zh$
|
|
12924
|
+
const zh$7 = {
|
|
12286
12925
|
...accountPoolZh,
|
|
12287
12926
|
title: "Step Code(Step Plan 订阅)",
|
|
12288
12927
|
pageDesc: "用 StepFun 的 Step Plan 订阅(国区 api.stepfun.com / 国际区 api.stepfun.ai)或开放平台 API Key 接入,管理账号池、套餐额度、缓存用量与模型勾选。区域是凭据的属性,两区凭据互不通用,因此号池里可以同时存在两区账号。",
|
|
@@ -12452,7 +13091,7 @@ window.__ModuleLoader__.load({
|
|
|
12452
13091
|
cacheExpiredHint: "缓存可能已过期:距上次请求约 {minutes} 分钟,下次会重新处理前缀。",
|
|
12453
13092
|
cacheHitRatioUnavailable: "—"
|
|
12454
13093
|
};
|
|
12455
|
-
const en$
|
|
13094
|
+
const en$7 = {
|
|
12456
13095
|
...accountPoolEn,
|
|
12457
13096
|
title: "Step Code (Step Plan subscription)",
|
|
12458
13097
|
pageDesc: "Reach StepFun with a Step Plan subscription (China api.stepfun.com / international api.stepfun.ai) or an open-platform API key, and manage the account pool, plan quota, cache usage and model selection. A region is a property of the credential and the two never share, so a pool can carry accounts from both.",
|
|
@@ -12620,11 +13259,11 @@ window.__ModuleLoader__.load({
|
|
|
12620
13259
|
cacheExpiredHint: "The cache has likely expired: about {minutes} minutes since the last request, so the next turn will reprocess the prefix.",
|
|
12621
13260
|
cacheHitRatioUnavailable: "—"
|
|
12622
13261
|
};
|
|
12623
|
-
const dictionaries$
|
|
12624
|
-
zh: zh$
|
|
12625
|
-
"zh-CN": zh$
|
|
12626
|
-
en: en$
|
|
12627
|
-
"en-US": en$
|
|
13262
|
+
const dictionaries$7 = {
|
|
13263
|
+
zh: zh$7,
|
|
13264
|
+
"zh-CN": zh$7,
|
|
13265
|
+
en: en$7,
|
|
13266
|
+
"en-US": en$7
|
|
12628
13267
|
};
|
|
12629
13268
|
/** 一个额度窗口的键到「窗口长度(分钟)」的映射。窗口名由共享组件按长度本地化。 */
|
|
12630
13269
|
const QUOTA_WINDOW_MINUTES = {
|
|
@@ -12742,7 +13381,7 @@ window.__ModuleLoader__.load({
|
|
|
12742
13381
|
/** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
|
|
12743
13382
|
const LOGIN_POLL_INTERVAL_MS$1 = 2e3;
|
|
12744
13383
|
/** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
|
|
12745
|
-
const fallbackTranslate$5 = (key) => zh$
|
|
13384
|
+
const fallbackTranslate$5 = (key) => zh$7[key];
|
|
12746
13385
|
/**
|
|
12747
13386
|
* 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
|
|
12748
13387
|
*
|
|
@@ -13428,7 +14067,7 @@ window.__ModuleLoader__.load({
|
|
|
13428
14067
|
const { status, loading, busy, error, connection, adoptResult, pasteValue, profile, pasteOpen, contextDrafts, savingModel, quotaAccount, quotaPassword, quotaToken } = state;
|
|
13429
14068
|
const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels, cache, cacheHitRatio: hitRatio, quotaCredential } = derived;
|
|
13430
14069
|
const { setProfile, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setDefaultReasoningEffort, setCacheRequestParams, refreshQuota, refreshCatalog, testConnection, setQuotaAccount, setQuotaPassword, setQuotaToken, submitQuotaPassword, submitQuotaToken, clearQuotaCredential } = actions;
|
|
13431
|
-
const t = useLineDict(NS_STEP_CODE, zh$
|
|
14070
|
+
const t = useLineDict(NS_STEP_CODE, zh$7);
|
|
13432
14071
|
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
13433
14072
|
className: "dsha-page",
|
|
13434
14073
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -14145,6 +14784,7 @@ window.__ModuleLoader__.load({
|
|
|
14145
14784
|
})
|
|
14146
14785
|
]
|
|
14147
14786
|
}),
|
|
14787
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "step-code" }),
|
|
14148
14788
|
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
14149
14789
|
className: "dsha-error",
|
|
14150
14790
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -14331,7 +14971,7 @@ window.__ModuleLoader__.load({
|
|
|
14331
14971
|
//#endregion
|
|
14332
14972
|
//#region src/client/cline-pass/locales.ts
|
|
14333
14973
|
const NS_CLINE_PASS = "dsh-cline-pass";
|
|
14334
|
-
const zh$
|
|
14974
|
+
const zh$6 = {
|
|
14335
14975
|
...accountPoolZh,
|
|
14336
14976
|
relogin: "重新登录",
|
|
14337
14977
|
needsRelogin: "登录已失效",
|
|
@@ -14455,7 +15095,7 @@ window.__ModuleLoader__.load({
|
|
|
14455
15095
|
limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 cline-pass,本卡仍可配置,但请求由对方服务。",
|
|
14456
15096
|
limitQuota: "额度窗口来自网关的 usage-limits 接口;接口失败时卡片保留上一次读数并显示原因。"
|
|
14457
15097
|
};
|
|
14458
|
-
const en$
|
|
15098
|
+
const en$6 = {
|
|
14459
15099
|
...accountPoolEn,
|
|
14460
15100
|
relogin: "Sign in again",
|
|
14461
15101
|
needsRelogin: "Sign-in expired",
|
|
@@ -14579,11 +15219,11 @@ window.__ModuleLoader__.load({
|
|
|
14579
15219
|
limitRoute: "The route is claimed by provider id: if another plugin already serves cline-pass, this card still configures the line but that provider answers the requests.",
|
|
14580
15220
|
limitQuota: "Quota windows come from the gateway usage-limits endpoint; when it fails the card keeps the previous reading and says why."
|
|
14581
15221
|
};
|
|
14582
|
-
const dictionaries$
|
|
14583
|
-
zh: zh$
|
|
14584
|
-
"zh-CN": zh$
|
|
14585
|
-
en: en$
|
|
14586
|
-
"en-US": en$
|
|
15222
|
+
const dictionaries$6 = {
|
|
15223
|
+
zh: zh$6,
|
|
15224
|
+
"zh-CN": zh$6,
|
|
15225
|
+
en: en$6,
|
|
15226
|
+
"en-US": en$6
|
|
14587
15227
|
};
|
|
14588
15228
|
//#endregion
|
|
14589
15229
|
//#region src/client/cline-pass/ClinePassSection.tsx
|
|
@@ -14702,10 +15342,10 @@ window.__ModuleLoader__.load({
|
|
|
14702
15342
|
API$5.loginStatus(flow.id).then((next) => {
|
|
14703
15343
|
setLoginFlow(next);
|
|
14704
15344
|
if (next.status === "complete") {
|
|
14705
|
-
setNotice(zh$
|
|
15345
|
+
setNotice(zh$6.loginComplete.replace("{account}", next.accountAlias === "" ? "Cline Pass" : next.accountAlias));
|
|
14706
15346
|
setShowKeyForm(false);
|
|
14707
15347
|
loadStatus();
|
|
14708
|
-
} else if (next.status === "failed") setError(zh$
|
|
15348
|
+
} else if (next.status === "failed") setError(zh$6.loginFailed.replace("{detail}", next.error));
|
|
14709
15349
|
}).catch((cause) => setError(detail$1(cause)));
|
|
14710
15350
|
}, Math.max(2, flow.intervalSeconds) * 1e3);
|
|
14711
15351
|
return () => window.clearInterval(timer);
|
|
@@ -14779,7 +15419,7 @@ window.__ModuleLoader__.load({
|
|
|
14779
15419
|
apiKey: trimmed,
|
|
14780
15420
|
...keyBaseURL.trim() === "" ? {} : { baseURL: keyBaseURL.trim() }
|
|
14781
15421
|
}).then((result) => {
|
|
14782
|
-
setNotice(result.authorized ? zh$
|
|
15422
|
+
setNotice(result.authorized ? zh$6.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$6.keyTestFailed.replace("{detail}", result.error));
|
|
14783
15423
|
}).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
|
|
14784
15424
|
}, [key, keyBaseURL]);
|
|
14785
15425
|
const testStored = (0, react.useCallback)((accountId) => {
|
|
@@ -14787,7 +15427,7 @@ window.__ModuleLoader__.load({
|
|
|
14787
15427
|
setError(null);
|
|
14788
15428
|
setNotice(null);
|
|
14789
15429
|
API$5.testKey({ accountId }).then((result) => {
|
|
14790
|
-
setNotice(result.authorized ? zh$
|
|
15430
|
+
setNotice(result.authorized ? zh$6.keyTestOk.replace("{ms}", String(Math.round(result.ms))) : zh$6.keyTestFailed.replace("{detail}", result.error));
|
|
14791
15431
|
}).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
|
|
14792
15432
|
}, []);
|
|
14793
15433
|
const enabledModels = (0, react.useMemo)(() => (status?.models ?? []).filter((model) => model.enabled), [status]);
|
|
@@ -14813,7 +15453,7 @@ window.__ModuleLoader__.load({
|
|
|
14813
15453
|
if (model === void 0) return;
|
|
14814
15454
|
const parsed = parsePositiveCapacity$1(drafts[id] ?? formatCapacity$1(model.contextWindow));
|
|
14815
15455
|
if (parsed === null) {
|
|
14816
|
-
setError(zh$
|
|
15456
|
+
setError(zh$6.error.replace("{detail}", zh$6.defaultContextWindow));
|
|
14817
15457
|
return;
|
|
14818
15458
|
}
|
|
14819
15459
|
run("ctx:" + id, () => API$5.setContextWindow(id, parsed));
|
|
@@ -14835,7 +15475,7 @@ window.__ModuleLoader__.load({
|
|
|
14835
15475
|
}, [run, status]);
|
|
14836
15476
|
const resetAllContext = (0, react.useCallback)(() => {
|
|
14837
15477
|
if (status === null) return;
|
|
14838
|
-
if (typeof window !== "undefined" && !window.confirm(zh$
|
|
15478
|
+
if (typeof window !== "undefined" && !window.confirm(zh$6.contextResetAll)) return;
|
|
14839
15479
|
const overridden = status.models.filter((model) => model.contextWindowOverride !== void 0);
|
|
14840
15480
|
run("ctx-all", async () => {
|
|
14841
15481
|
let next = status;
|
|
@@ -14876,7 +15516,7 @@ window.__ModuleLoader__.load({
|
|
|
14876
15516
|
const refreshUsage = (0, react.useCallback)(() => {
|
|
14877
15517
|
run("usage", async () => {
|
|
14878
15518
|
const outcome = await API$5.readUsage();
|
|
14879
|
-
setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$
|
|
15519
|
+
setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$6.usageEmpty);
|
|
14880
15520
|
return outcome.status;
|
|
14881
15521
|
});
|
|
14882
15522
|
}, [run]);
|
|
@@ -14896,7 +15536,7 @@ window.__ModuleLoader__.load({
|
|
|
14896
15536
|
};
|
|
14897
15537
|
const invalid = Object.entries(numbers).find(([, value]) => !Number.isSafeInteger(value) || value < 0);
|
|
14898
15538
|
if (invalid !== void 0) {
|
|
14899
|
-
setError(zh$
|
|
15539
|
+
setError(zh$6.error.replace("{detail}", invalid[0]));
|
|
14900
15540
|
return;
|
|
14901
15541
|
}
|
|
14902
15542
|
setBusy("settings");
|
|
@@ -14907,7 +15547,7 @@ window.__ModuleLoader__.load({
|
|
|
14907
15547
|
}).then((next) => {
|
|
14908
15548
|
applyStatus(next);
|
|
14909
15549
|
setSettingsForm(settingsFormOf$1(next));
|
|
14910
|
-
setNotice(zh$
|
|
15550
|
+
setNotice(zh$6.saved);
|
|
14911
15551
|
}).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
|
|
14912
15552
|
}, [settingsForm, applyStatus]);
|
|
14913
15553
|
const toggleTools = (0, react.useCallback)(() => {
|
|
@@ -14918,10 +15558,10 @@ window.__ModuleLoader__.load({
|
|
|
14918
15558
|
API$5.updateSettings({ exposeTools: value }).then((next) => {
|
|
14919
15559
|
applyStatus(next);
|
|
14920
15560
|
setSettingsForm(settingsFormOf$1(next));
|
|
14921
|
-
setNotice(zh$
|
|
15561
|
+
setNotice(zh$6.restartRequired);
|
|
14922
15562
|
}).catch((cause) => setError(detail$1(cause))).finally(() => setBusy(null));
|
|
14923
15563
|
}, [status, applyStatus]);
|
|
14924
|
-
const t = useLineDict(NS_CLINE_PASS, zh$
|
|
15564
|
+
const t = useLineDict(NS_CLINE_PASS, zh$6);
|
|
14925
15565
|
const errorPrefix = t.error.split("{detail}")[0] ?? "";
|
|
14926
15566
|
const pool = status?.pool;
|
|
14927
15567
|
const accounts = (0, react.useMemo)(() => {
|
|
@@ -15641,6 +16281,7 @@ window.__ModuleLoader__.load({
|
|
|
15641
16281
|
children: warning
|
|
15642
16282
|
}, warning))
|
|
15643
16283
|
] }),
|
|
16284
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "cline-pass" }),
|
|
15644
16285
|
result.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
15645
16286
|
className: "dshcp-warning",
|
|
15646
16287
|
children: result.error
|
|
@@ -15695,7 +16336,7 @@ window.__ModuleLoader__.load({
|
|
|
15695
16336
|
* 'settings.section' 上的那张座位(那张座绑定的是 ChatGPT 的键集)。
|
|
15696
16337
|
*/
|
|
15697
16338
|
const NS_QODER = "dsh-qoder";
|
|
15698
|
-
const zh$
|
|
16339
|
+
const zh$5 = {
|
|
15699
16340
|
modelRowEfforts: "档位 {list}",
|
|
15700
16341
|
modelRowNoEfforts: "无档位",
|
|
15701
16342
|
modelRowOutput: "输出 {cap}",
|
|
@@ -15819,8 +16460,8 @@ window.__ModuleLoader__.load({
|
|
|
15819
16460
|
quotaWindow: "额度窗口"
|
|
15820
16461
|
};
|
|
15821
16462
|
/** 两套字典。 */
|
|
15822
|
-
const dictionaries$
|
|
15823
|
-
zh: zh$
|
|
16463
|
+
const dictionaries$5 = {
|
|
16464
|
+
zh: zh$5,
|
|
15824
16465
|
en: {
|
|
15825
16466
|
modelRowEfforts: "efforts {list}",
|
|
15826
16467
|
modelRowNoEfforts: "no efforts",
|
|
@@ -16021,7 +16662,7 @@ window.__ModuleLoader__.load({
|
|
|
16021
16662
|
/** 登录状态机的轮询节奏。真实超时与间隔由 host 拥有,卡片只是跟随。 */
|
|
16022
16663
|
const LOGIN_POLL_INTERVAL_MS = 2e3;
|
|
16023
16664
|
/** 本卡片的字典;身份稳定,依赖它的 effect 才不会每次渲染重建。 */
|
|
16024
|
-
const fallbackTranslate$4 = (key) => zh$
|
|
16665
|
+
const fallbackTranslate$4 = (key) => zh$5[key];
|
|
16025
16666
|
/**
|
|
16026
16667
|
* 共享账号池卡片需要的标签集,按本卡片的字典逐键查出来。
|
|
16027
16668
|
*
|
|
@@ -16587,7 +17228,7 @@ window.__ModuleLoader__.load({
|
|
|
16587
17228
|
* `defaultMaxTokens`),客户端不按模型名推断任何一项。与 OpenDesign 卡同一写法:
|
|
16588
17229
|
* 数据一行,散文进折叠区。
|
|
16589
17230
|
*/
|
|
16590
|
-
function qoderModelRowHint(model, t = zh$
|
|
17231
|
+
function qoderModelRowHint(model, t = zh$5) {
|
|
16591
17232
|
return `${formatTokenCount(model.contextWindow)} · ${model.supportsImages ? "text+image" : "text"} · ${model.reasoningEfforts.length === 0 ? t.modelRowNoEfforts : t.modelRowEfforts.replace("{list}", model.reasoningEfforts.join("/"))} · ${t.modelRowOutput.replace("{cap}", formatTokenCount(model.defaultMaxTokens))}`;
|
|
16592
17233
|
}
|
|
16593
17234
|
function QoderSection({ onModelChange } = {}) {
|
|
@@ -16595,7 +17236,7 @@ window.__ModuleLoader__.load({
|
|
|
16595
17236
|
const { status, loading, busy, error, connection, adoptResult, pasteValue, region, pasteOpen, contextDrafts, savingModel } = state;
|
|
16596
17237
|
const { accounts, models, contextModels, overrideCount, login, quota, authenticated, poolLabels, cache, cacheHitRatio: hitRatio } = derived;
|
|
16597
17238
|
const { setRegion, login: startLogin, cancelLogin, submitPaste, setPasteValue, togglePaste, adopt, clearAdoptResult, accountAction, setStrategy, toggleModel, setAllModels, saveContextWindow, resetContextWindow, resetAllContextWindows, updateContextDraft, setDefaultReasoningEffort, refreshQuota, refreshCatalog, testConnection } = actions;
|
|
16598
|
-
const t = useLineDict(NS_QODER, zh$
|
|
17239
|
+
const t = useLineDict(NS_QODER, zh$5);
|
|
16599
17240
|
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
16600
17241
|
className: "dsha-page",
|
|
16601
17242
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -17110,6 +17751,7 @@ window.__ModuleLoader__.load({
|
|
|
17110
17751
|
moreNotes(t.moreNotes, [t.quotaDesc])
|
|
17111
17752
|
]
|
|
17112
17753
|
}),
|
|
17754
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "qoder" }),
|
|
17113
17755
|
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
17114
17756
|
className: "dsha-error",
|
|
17115
17757
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -17190,7 +17832,7 @@ window.__ModuleLoader__.load({
|
|
|
17190
17832
|
//#endregion
|
|
17191
17833
|
//#region src/client/opendesign/locales.ts
|
|
17192
17834
|
const NS_OPENDESIGN = "dsh-opendesign";
|
|
17193
|
-
const zh$
|
|
17835
|
+
const zh$4 = {
|
|
17194
17836
|
...accountPoolZh,
|
|
17195
17837
|
relogin: "重新登录",
|
|
17196
17838
|
needsRelogin: "登录已失效",
|
|
@@ -17298,7 +17940,7 @@ window.__ModuleLoader__.load({
|
|
|
17298
17940
|
limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 opendesign,本卡仍可配置,但请求由对方服务。",
|
|
17299
17941
|
limitQuota: "套餐与额度读取只覆盖浏览器授权登录的账号;粘贴的 API Key 没有控制 Key,请在 OpenDesign Cloud 控制台查看用量。"
|
|
17300
17942
|
};
|
|
17301
|
-
const en$
|
|
17943
|
+
const en$4 = {
|
|
17302
17944
|
...accountPoolEn,
|
|
17303
17945
|
relogin: "Add again",
|
|
17304
17946
|
needsRelogin: "Key invalid",
|
|
@@ -17406,11 +18048,11 @@ window.__ModuleLoader__.load({
|
|
|
17406
18048
|
limitRoute: "The route is claimed by provider id: if another plugin already serves opendesign, this card still configures the line but that provider answers the requests.",
|
|
17407
18049
|
limitQuota: "Plan and credit reads cover browser-signed-in accounts only; a pasted API key has no control key, so see usage in the OpenDesign Cloud console."
|
|
17408
18050
|
};
|
|
17409
|
-
const dictionaries$
|
|
17410
|
-
zh: zh$
|
|
17411
|
-
"zh-CN": zh$
|
|
17412
|
-
en: en$
|
|
17413
|
-
"en-US": en$
|
|
18051
|
+
const dictionaries$4 = {
|
|
18052
|
+
zh: zh$4,
|
|
18053
|
+
"zh-CN": zh$4,
|
|
18054
|
+
en: en$4,
|
|
18055
|
+
"en-US": en$4
|
|
17414
18056
|
};
|
|
17415
18057
|
//#endregion
|
|
17416
18058
|
//#region src/client/opendesign/OpenDesignSection.tsx
|
|
@@ -17705,7 +18347,7 @@ window.__ModuleLoader__.load({
|
|
|
17705
18347
|
try {
|
|
17706
18348
|
const outcome = await API$4.readUsage();
|
|
17707
18349
|
setStatus(outcome.status);
|
|
17708
|
-
if (!silent) setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$
|
|
18350
|
+
if (!silent) setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$4.usageEmpty);
|
|
17709
18351
|
} catch (cause) {
|
|
17710
18352
|
if (!silent) setError(detail(cause));
|
|
17711
18353
|
}
|
|
@@ -17742,10 +18384,10 @@ window.__ModuleLoader__.load({
|
|
|
17742
18384
|
API$4.loginStatus(flow.id).then((next) => {
|
|
17743
18385
|
setLoginFlow(next);
|
|
17744
18386
|
if (next.status === "complete") {
|
|
17745
|
-
setNotice(zh$
|
|
18387
|
+
setNotice(zh$4.loginComplete.replace("{account}", next.accountAlias === "" ? "OpenDesign" : next.accountAlias));
|
|
17746
18388
|
setShowKeyForm(false);
|
|
17747
18389
|
reload();
|
|
17748
|
-
} else if (next.status === "failed") setError(zh$
|
|
18390
|
+
} else if (next.status === "failed") setError(zh$4.loginFailed.replace("{detail}", next.error));
|
|
17749
18391
|
}).catch((cause) => setError(detail(cause)));
|
|
17750
18392
|
}, Math.max(2, flow.intervalSeconds) * 1e3);
|
|
17751
18393
|
return () => window.clearInterval(timer);
|
|
@@ -17811,7 +18453,7 @@ window.__ModuleLoader__.load({
|
|
|
17811
18453
|
const refreshUsage = (0, react.useCallback)(() => {
|
|
17812
18454
|
run("usage", async () => {
|
|
17813
18455
|
const outcome = await API$4.readUsage();
|
|
17814
|
-
setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$
|
|
18456
|
+
setNotice(outcome.usage.accounts.some((account) => account.ok) ? "" : zh$4.usageEmpty);
|
|
17815
18457
|
return outcome.status;
|
|
17816
18458
|
});
|
|
17817
18459
|
}, [run]);
|
|
@@ -17846,7 +18488,7 @@ window.__ModuleLoader__.load({
|
|
|
17846
18488
|
apiKey: trimmed,
|
|
17847
18489
|
...keyBaseURL.trim() === "" ? {} : { baseURL: keyBaseURL.trim() }
|
|
17848
18490
|
}).then((result) => {
|
|
17849
|
-
setNotice(result.authorized ? zh$
|
|
18491
|
+
setNotice(result.authorized ? zh$4.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$4.keyTestFailed.replace("{detail}", result.error));
|
|
17850
18492
|
}).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
|
|
17851
18493
|
}, [key, keyBaseURL]);
|
|
17852
18494
|
const testStored = (0, react.useCallback)((accountId) => {
|
|
@@ -17854,7 +18496,7 @@ window.__ModuleLoader__.load({
|
|
|
17854
18496
|
setError(null);
|
|
17855
18497
|
setNotice(null);
|
|
17856
18498
|
API$4.testKey({ accountId }).then((result) => {
|
|
17857
|
-
setNotice(result.authorized ? zh$
|
|
18499
|
+
setNotice(result.authorized ? zh$4.keyTestOk.replace("{ms}", String(Math.round(result.ms))).replace("{count}", String(result.modelCount)) : zh$4.keyTestFailed.replace("{detail}", result.error));
|
|
17858
18500
|
}).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
|
|
17859
18501
|
}, []);
|
|
17860
18502
|
const enabledModels = (0, react.useMemo)(() => (status?.models ?? []).filter((model) => model.enabled), [status]);
|
|
@@ -17880,7 +18522,7 @@ window.__ModuleLoader__.load({
|
|
|
17880
18522
|
if (model === void 0) return;
|
|
17881
18523
|
const parsed = parsePositiveCapacity$1(drafts[id] ?? formatCapacity$1(model.contextWindow));
|
|
17882
18524
|
if (parsed === null) {
|
|
17883
|
-
setError(zh$
|
|
18525
|
+
setError(zh$4.error.replace("{detail}", zh$4.defaultContextWindow));
|
|
17884
18526
|
return;
|
|
17885
18527
|
}
|
|
17886
18528
|
run("ctx:" + id, () => API$4.setContextWindow(id, parsed));
|
|
@@ -17902,7 +18544,7 @@ window.__ModuleLoader__.load({
|
|
|
17902
18544
|
}, [run, status]);
|
|
17903
18545
|
const resetAllContext = (0, react.useCallback)(() => {
|
|
17904
18546
|
if (status === null) return;
|
|
17905
|
-
if (typeof window !== "undefined" && !window.confirm(zh$
|
|
18547
|
+
if (typeof window !== "undefined" && !window.confirm(zh$4.contextResetAll)) return;
|
|
17906
18548
|
const overridden = status.models.filter((model) => model.contextWindowOverride !== void 0);
|
|
17907
18549
|
run("ctx-all", async () => {
|
|
17908
18550
|
let next = status;
|
|
@@ -17918,7 +18560,7 @@ window.__ModuleLoader__.load({
|
|
|
17918
18560
|
const refreshCatalog = (0, react.useCallback)(() => {
|
|
17919
18561
|
run("catalog", async () => {
|
|
17920
18562
|
const outcome = await API$4.refreshCatalog();
|
|
17921
|
-
setNotice(zh$
|
|
18563
|
+
setNotice(zh$4.catalogSyncedNote.replace("{count}", String(outcome.status.catalogCount)));
|
|
17922
18564
|
return outcome.status;
|
|
17923
18565
|
});
|
|
17924
18566
|
}, [run]);
|
|
@@ -17932,7 +18574,7 @@ window.__ModuleLoader__.load({
|
|
|
17932
18574
|
};
|
|
17933
18575
|
const invalid = Object.entries(numbers).find(([, value]) => !Number.isSafeInteger(value) || value < 0);
|
|
17934
18576
|
if (invalid !== void 0) {
|
|
17935
|
-
setError(zh$
|
|
18577
|
+
setError(zh$4.error.replace("{detail}", invalid[0]));
|
|
17936
18578
|
return;
|
|
17937
18579
|
}
|
|
17938
18580
|
setBusy("settings");
|
|
@@ -17943,10 +18585,10 @@ window.__ModuleLoader__.load({
|
|
|
17943
18585
|
}).then((next) => {
|
|
17944
18586
|
applyStatus(next);
|
|
17945
18587
|
setSettingsForm(settingsFormOf(next));
|
|
17946
|
-
setNotice(zh$
|
|
18588
|
+
setNotice(zh$4.saved);
|
|
17947
18589
|
}).catch((cause) => setError(detail(cause))).finally(() => setBusy(null));
|
|
17948
18590
|
}, [settingsForm, applyStatus]);
|
|
17949
|
-
const t = useLineDict(NS_OPENDESIGN, zh$
|
|
18591
|
+
const t = useLineDict(NS_OPENDESIGN, zh$4);
|
|
17950
18592
|
const errorPrefix = t.error.split("{detail}")[0] ?? "";
|
|
17951
18593
|
const pool = status?.pool;
|
|
17952
18594
|
const accounts = pool?.accounts ?? [];
|
|
@@ -18416,7 +19058,8 @@ window.__ModuleLoader__.load({
|
|
|
18416
19058
|
onClick: saveSettings,
|
|
18417
19059
|
children: busy === "settings" ? t.savingSettings : t.saveSettings
|
|
18418
19060
|
})
|
|
18419
|
-
})
|
|
19061
|
+
}),
|
|
19062
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "opendesign" })
|
|
18420
19063
|
]
|
|
18421
19064
|
})
|
|
18422
19065
|
]
|
|
@@ -18463,7 +19106,7 @@ window.__ModuleLoader__.load({
|
|
|
18463
19106
|
* control that renders it instead.
|
|
18464
19107
|
*/
|
|
18465
19108
|
const NS_WORKBUDDY = "dsh-workbuddy";
|
|
18466
|
-
const zh$
|
|
19109
|
+
const zh$3 = {
|
|
18467
19110
|
title: "WorkBuddy",
|
|
18468
19111
|
pageDesc: "复用本机 CodeBuddy 桌面端登录态,管理 WorkBuddy(CodeBuddy 订阅)模型、上下文窗口与额度。",
|
|
18469
19112
|
account: "账号",
|
|
@@ -18589,7 +19232,7 @@ window.__ModuleLoader__.load({
|
|
|
18589
19232
|
modelCooldownActive: "模型限流中",
|
|
18590
19233
|
notRoutable: "当前不可路由"
|
|
18591
19234
|
};
|
|
18592
|
-
const en$
|
|
19235
|
+
const en$3 = {
|
|
18593
19236
|
title: "WorkBuddy",
|
|
18594
19237
|
pageDesc: "Reuse the local CodeBuddy desktop sign-in to manage WorkBuddy (CodeBuddy subscription) models, context windows, and quota.",
|
|
18595
19238
|
account: "Account",
|
|
@@ -18715,11 +19358,11 @@ window.__ModuleLoader__.load({
|
|
|
18715
19358
|
modelCooldownActive: "Model parked",
|
|
18716
19359
|
notRoutable: "Not routable right now"
|
|
18717
19360
|
};
|
|
18718
|
-
const dictionaries$
|
|
18719
|
-
zh: zh$
|
|
18720
|
-
"zh-CN": zh$
|
|
18721
|
-
en: en$
|
|
18722
|
-
"en-US": en$
|
|
19361
|
+
const dictionaries$3 = {
|
|
19362
|
+
zh: zh$3,
|
|
19363
|
+
"zh-CN": zh$3,
|
|
19364
|
+
en: en$3,
|
|
19365
|
+
"en-US": en$3
|
|
18723
19366
|
};
|
|
18724
19367
|
//#endregion
|
|
18725
19368
|
//#region src/client/workbuddy/useWorkBuddySection.ts
|
|
@@ -18817,7 +19460,7 @@ window.__ModuleLoader__.load({
|
|
|
18817
19460
|
const quotaFollowUp = (0, react.useRef)(null);
|
|
18818
19461
|
const [contextDrafts, setContextDrafts] = (0, react.useState)({});
|
|
18819
19462
|
const [savingModel, setSavingModel] = (0, react.useState)(null);
|
|
18820
|
-
const t = useLineDict(NS_WORKBUDDY, zh$
|
|
19463
|
+
const t = useLineDict(NS_WORKBUDDY, zh$3);
|
|
18821
19464
|
const notifyChange = (0, react.useCallback)(() => {
|
|
18822
19465
|
onModelChange?.();
|
|
18823
19466
|
loadModelDirectory?.();
|
|
@@ -19451,7 +20094,7 @@ window.__ModuleLoader__.load({
|
|
|
19451
20094
|
const timer = window.setInterval(() => setNow(Date.now()), 1e3);
|
|
19452
20095
|
return () => window.clearInterval(timer);
|
|
19453
20096
|
}, [pausedUntil]);
|
|
19454
|
-
const t = useLineDict(NS_WORKBUDDY, zh$
|
|
20097
|
+
const t = useLineDict(NS_WORKBUDDY, zh$3);
|
|
19455
20098
|
const poolState = poolStateLines(pool, t, now);
|
|
19456
20099
|
const storageLine = poolStorageLine(pool?.storage, t);
|
|
19457
20100
|
const storageUnavailable = pool?.storage === void 0 ? null : poolStorageUnavailableLabel(pool.storage, t);
|
|
@@ -20038,6 +20681,7 @@ window.__ModuleLoader__.load({
|
|
|
20038
20681
|
})
|
|
20039
20682
|
]
|
|
20040
20683
|
}),
|
|
20684
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineProxySection, { line: "workbuddy-subscription" }),
|
|
20041
20685
|
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
20042
20686
|
className: "dsha-error",
|
|
20043
20687
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error })
|
|
@@ -20683,454 +21327,6 @@ window.__ModuleLoader__.load({
|
|
|
20683
21327
|
});
|
|
20684
21328
|
}
|
|
20685
21329
|
//#endregion
|
|
20686
|
-
//#region src/client/locales.ts
|
|
20687
|
-
const NS = "dsh-chatgpt-subscription";
|
|
20688
|
-
const zh$3 = {
|
|
20689
|
-
...accountPoolZh,
|
|
20690
|
-
title: "ChatGPT",
|
|
20691
|
-
hubTitle: "订阅服务",
|
|
20692
|
-
intro: "使用 ChatGPT 账号登录,在 DSH 中使用订阅可用的模型。",
|
|
20693
|
-
account: "账号",
|
|
20694
|
-
signedOut: "尚未登录",
|
|
20695
|
-
signedIn: "已登录",
|
|
20696
|
-
plan: "套餐",
|
|
20697
|
-
accountId: "账号 ID",
|
|
20698
|
-
expires: "令牌到期",
|
|
20699
|
-
signIn: "使用 ChatGPT 登录",
|
|
20700
|
-
signInAgain: "重新登录",
|
|
20701
|
-
cancel: "取消登录",
|
|
20702
|
-
signOut: "注销",
|
|
20703
|
-
refreshToken: "刷新凭据",
|
|
20704
|
-
pending: "请在浏览器中完成登录。",
|
|
20705
|
-
popupBlocked: "浏览器拦截了登录窗口,请使用下面的链接继续。",
|
|
20706
|
-
continueLogin: "打开 ChatGPT 登录页",
|
|
20707
|
-
loading: "正在读取状态…",
|
|
20708
|
-
connection: "连接",
|
|
20709
|
-
testConnection: "测试连接",
|
|
20710
|
-
testing: "测试中…",
|
|
20711
|
-
latency: "最近延迟",
|
|
20712
|
-
selectAll: "全选",
|
|
20713
|
-
unselectAll: "全不选",
|
|
20714
|
-
models: "可用模型",
|
|
20715
|
-
modelsHint: "勾选后模型才会显示在对话页的模型选择列表中;全部取消勾选或关闭上方开关可在列表中隐藏该供应商。",
|
|
20716
|
-
proxySettings: "网络代理",
|
|
20717
|
-
proxyMode: "代理模式",
|
|
20718
|
-
proxyModeHint: "本插件的全部供应线路共用这一份代理设置,登录、令牌续期、模型目录与配额读取同样经过它;支持自动读取系统代理,修改后对后续请求生效。",
|
|
20719
|
-
proxyModeAuto: "系统代理(自动检测)",
|
|
20720
|
-
proxyModeCustom: "自定义代理",
|
|
20721
|
-
proxyModeDirect: "直连(禁用代理)",
|
|
20722
|
-
customProxyUrl: "自定义代理地址",
|
|
20723
|
-
customProxyUrlHint: "支持 HTTP/HTTPS/SOCKS5 代理地址,例如 http://127.0.0.1:7890",
|
|
20724
|
-
customProxyUrlPlaceholder: "例如: http://127.0.0.1:7890",
|
|
20725
|
-
saveProxyUrl: "保存代理地址",
|
|
20726
|
-
proxyDetected: "检测到系统代理",
|
|
20727
|
-
proxyDetectedEffective: "(已自动生效)",
|
|
20728
|
-
proxyNoneDetected: "未检测到系统代理,将使用直连",
|
|
20729
|
-
proxyDirectHint: "本插件的全部请求将直接连接,不经过任何代理服务器。",
|
|
20730
|
-
poolStorageTitle: "账号存储位置",
|
|
20731
|
-
poolStorageKeyring: "桌面密钥环",
|
|
20732
|
-
poolStorageCredentials: "DSH 凭据库",
|
|
20733
|
-
poolStorageKeyringHint: "仅限桌面安装:使用操作系统密钥环(DPAPI / 钥匙串 / Secret Service)。在服务器或无桌面的 Linux 主机上密钥环通常不可用,登录会失败——请改选 DSH 凭据库。",
|
|
20734
|
-
poolStorageCredentialsHint: "DSH 的标准密钥存储($DSH_HOME/.credentials.yaml)。POSIX 上强制 0600、创建者独占;Windows 上只有 profile ACL,没有权限位可强制。服务器以及任何没有桌面密钥环的主机都用它。静态不加密,靠宿主权限保护。",
|
|
20735
|
-
poolStorageEffective: "当前实际使用:{storage}",
|
|
20736
|
-
poolStorageBackendKeyring: "桌面密钥环(Secret Service),静态加密",
|
|
20737
|
-
poolStorageBackendDpapi: "Windows DPAPI,静态加密",
|
|
20738
|
-
poolStorageBackendKeychain: "macOS 钥匙串,静态加密",
|
|
20739
|
-
poolStorageBackendCredentials: "DSH 凭据库(.credentials.yaml),由文件权限保护",
|
|
20740
|
-
poolStorageSwitchWarning: "已保存在另一个存储里的账号会留在原处,切回去之前不会显示。不会做迁移。",
|
|
20741
|
-
poolStorageUnavailableKeyring: "这台主机上没有可用的桌面密钥环,因此号池无法读写。请把「账号存储位置」改成 DSH 凭据库。",
|
|
20742
|
-
poolStorageUnavailableCredentials: "这个 harness 没有凭据库(ctx.credentials),因此号池无法读写。请把「账号存储位置」改成桌面密钥环。",
|
|
20743
|
-
poolStorageUnavailableStore: "号池存储这次没有应答,所以这里没有列出账号——账号并没有被删除,存储恢复后重新打开本页即可。",
|
|
20744
|
-
enhancements: "增强功能",
|
|
20745
|
-
fastMode: "快速模式(1.5x 速度)",
|
|
20746
|
-
fastModeHint: "提升 Token 生成速度至约 1.5 倍;将以约 2x–2.5x 速度消耗 Codex 订阅额度。",
|
|
20747
|
-
outputVerbosity: "输出详细程度",
|
|
20748
|
-
outputVerbosityHint: "控制 Codex 最终回答的详细程度;不影响思考深度。默认值与官方 Codex 客户端一致(低)。",
|
|
20749
|
-
verbosityLow: "低(保持回答简洁)",
|
|
20750
|
-
verbosityMedium: "中(兼顾细节与简洁)",
|
|
20751
|
-
verbosityHigh: "高(在回答中包含更多细节)",
|
|
20752
|
-
reasoningSummary: "推理摘要",
|
|
20753
|
-
reasoningSummaryHint: "选择 ChatGPT 总结其推理的方式;不影响思考深度。默认值与官方 Codex 客户端一致(不生成摘要,可省额度)。",
|
|
20754
|
-
summaryAuto: "自动(让模型选择摘要详细程度)",
|
|
20755
|
-
summaryConcise: "简洁(显示简要推理摘要)",
|
|
20756
|
-
summaryDetailed: "详细(显示更详细的推理摘要)",
|
|
20757
|
-
summaryNone: "无(不显示推理摘要)",
|
|
20758
|
-
searchProvider: "搜索来源",
|
|
20759
|
-
searchProviderHint: "选择 DSH 联网搜索使用默认来源,或改用当前 ChatGPT 订阅的 Codex 来源(自动走代理隧道)。抓取模式为 auto 时,抓取来源跟随此选择。",
|
|
20760
|
-
searchProviderDsh: "DSH 默认",
|
|
20761
|
-
searchProviderCodex: "ChatGPT(代理隧道)",
|
|
20762
|
-
fetchStatus: "抓取来源(只读)",
|
|
20763
|
-
fetchStatusHint: "以下内容由 Host 上报,只读展示。",
|
|
20764
|
-
fetchConfiguredProvider: "配置的抓取 Provider",
|
|
20765
|
-
fetchProviderDshDefault: "DSH 默认(Host 未固定抓取 provider)",
|
|
20766
|
-
switcherState: "抓取选择器状态",
|
|
20767
|
-
switcherStateIdle: "空闲(尚未应用选择)",
|
|
20768
|
-
switcherStateApplying: "应用中(正在切换 Host 的 web provider)",
|
|
20769
|
-
switcherStateApplied: "已应用",
|
|
20770
|
-
switcherStateMissing: "未找到可切换的 web 服务",
|
|
20771
|
-
switcherStateFailed: "切换失败,请检查 Host 日志",
|
|
20772
|
-
fetchMode: "抓取模式",
|
|
20773
|
-
fetchModeAuto: "auto(有可用代理或选了 ChatGPT 搜索时用插件抓取)",
|
|
20774
|
-
fetchModePlugin: "plugin(始终用本插件抓取)",
|
|
20775
|
-
fetchModeDsh: "dsh(保留 DSH 原有抓取来源)",
|
|
20776
|
-
fetchMaxBodyChars: "插件正文上限",
|
|
20777
|
-
fetchMaxResponseBytes: "插件响应体上限",
|
|
20778
|
-
characters: "字符",
|
|
20779
|
-
bytes: "字节",
|
|
20780
|
-
fetchLimitsInactive: "仅在实际使用插件抓取时生效;走 DSH 原有抓取来源时不适用这两个上限。",
|
|
20781
|
-
fetchConfigSource: "模式与上限在插件 Config 中修改(不是本页面偏好),修改后重载插件或重启 DSH 生效。",
|
|
20782
|
-
providerDefault: "使用 Provider 默认值",
|
|
20783
|
-
contextWindows: "模型上下文窗口",
|
|
20784
|
-
contextWindowsHint: "只列出已勾选「可用模型」的条目。默认取模型目录值(GPT-6 系列 384K,最高 872K;其余最高 1M),该值用于 DSH 的压缩与溢出判断,可输入 872K、512K 等容量;改过的模型可单独或一键恢复默认。",
|
|
20785
|
-
contextWindow: "上下文窗口",
|
|
20786
|
-
contextWindowInvalid: "上下文窗口必须是正整数,且不能超过模型上限(GPT-6 系列为 872K,其余为 1M);可使用 K 或 M 后缀。",
|
|
20787
|
-
contextWindowReset: "恢复默认",
|
|
20788
|
-
contextWindowResetAll: "全部恢复默认",
|
|
20789
|
-
contextWindowResetAllConfirm: "确定把已改过的模型上下文窗口全部恢复为默认值吗?",
|
|
20790
|
-
contextWindowsNoneEnabled: "还没有勾选任何模型。在上方「可用模型」里勾选后,这里会出现该模型的上下文窗口设置。",
|
|
20791
|
-
saveContextWindow: "保存上下文窗口",
|
|
20792
|
-
save: "保存",
|
|
20793
|
-
tokens: "tokens",
|
|
20794
|
-
quickQuota: "在输入框旁显示快捷用量",
|
|
20795
|
-
quickQuotaHint: "仅在当前会话选中 codex-chatgpt 模型时显示。",
|
|
20796
|
-
quota: "用量与限额",
|
|
20797
|
-
quotaIntro: "数据来自 ChatGPT Codex 用量服务。页面可见时最多每 60 秒刷新一次。",
|
|
20798
|
-
refreshQuota: "刷新用量",
|
|
20799
|
-
refreshing: "刷新中…",
|
|
20800
|
-
noQuota: "当前套餐未返回可显示的限额窗口。",
|
|
20801
|
-
quotaSignedOut: "登录后可查看订阅限额。",
|
|
20802
|
-
stale: "显示的是上次成功获取的数据。",
|
|
20803
|
-
updated: "更新时间",
|
|
20804
|
-
primary: "主要窗口",
|
|
20805
|
-
secondary: "次要窗口",
|
|
20806
|
-
limitWindow: "额度",
|
|
20807
|
-
used: "已使用",
|
|
20808
|
-
remaining: "剩余",
|
|
20809
|
-
available: "可用",
|
|
20810
|
-
unavailable: "不可用",
|
|
20811
|
-
unlimited: "无限",
|
|
20812
|
-
credits: "Credits",
|
|
20813
|
-
monthlySpend: "月度消费控制",
|
|
20814
|
-
resetCredits: "重置次数",
|
|
20815
|
-
resetCreditExpires: "到期时间",
|
|
20816
|
-
useResetCredit: "使用重置卡",
|
|
20817
|
-
usingResetCredit: "使用中…",
|
|
20818
|
-
useResetCreditConfirm: "使用后会立即消耗 1 次重置机会,并重置符合条件的 Codex 额度窗口。确定继续吗?",
|
|
20819
|
-
resetCreditUsed: "重置卡已使用,用量数据已刷新。",
|
|
20820
|
-
spendControlReached: "已触发月度消费控制,新的订阅调用可能被限制。",
|
|
20821
|
-
limit: "上限",
|
|
20822
|
-
exhausted: "额度已用尽",
|
|
20823
|
-
resets: "重置",
|
|
20824
|
-
quickQuotaLabel: "Codex 剩余",
|
|
20825
|
-
quickQuotaLoading: "用量…",
|
|
20826
|
-
imageToolRunning: "正在生成图片",
|
|
20827
|
-
imageToolDone: "已生成图片",
|
|
20828
|
-
imageToolFailed: "图片生成失败",
|
|
20829
|
-
image: "图片",
|
|
20830
|
-
openImage: "打开图片",
|
|
20831
|
-
openNamedImage: "打开 {name}",
|
|
20832
|
-
imageLoading: "加载图片…",
|
|
20833
|
-
imageLoadFailed: "图片加载失败,点击重试",
|
|
20834
|
-
imagePreviewClose: "关闭",
|
|
20835
|
-
imagePreviewOpenOriginal: "打开原图",
|
|
20836
|
-
retry: "重试",
|
|
20837
|
-
unknown: "未知",
|
|
20838
|
-
hubBack: "订阅服务",
|
|
20839
|
-
hubOverviewHint: "选择供应商以管理账号、模型与配额;右侧开关控制该供应商是否出现在模型列表中。",
|
|
20840
|
-
hubAccountCount: "{count} 个账号",
|
|
20841
|
-
hubNoAccounts: "暂无账号,点击进入添加",
|
|
20842
|
-
hubStateEnabled: "已启用",
|
|
20843
|
-
hubStateDisabled: "已停用",
|
|
20844
|
-
hubModelsEnabled: "{count} 个模型可用",
|
|
20845
|
-
hubModelsEnabledOfTotal: "{count}/{total} 个模型可用",
|
|
20846
|
-
hubStatusFailed: "状态读取失败",
|
|
20847
|
-
hubSwitchOn: "启用 {name}",
|
|
20848
|
-
hubSwitchOff: "停用 {name}",
|
|
20849
|
-
hubCardLabel: "{name},{annotation}",
|
|
20850
|
-
hubUpdateCheck: "检测更新",
|
|
20851
|
-
hubUpdateChecking: "检测中…",
|
|
20852
|
-
hubUpdateApply: "更新到 v{version}",
|
|
20853
|
-
hubUpdateApplying: "更新中…",
|
|
20854
|
-
hubUpdateUpToDate: "已是最新版本 {version}",
|
|
20855
|
-
hubUpdateLatestWithUnknownCurrent: "最新版本 {version},当前版本未知",
|
|
20856
|
-
hubUpdateAvailable: "有新版本 {version},当前 {current}",
|
|
20857
|
-
hubUpdateInstalled: "已安装 v{version},重启宿主后生效",
|
|
20858
|
-
hubUpdateInstalledReplaced: "已移除旧版并安装 v{version},重启宿主后生效",
|
|
20859
|
-
hubUpdateInstalledLive: "已安装 v{version},当前已生效,无需重启",
|
|
20860
|
-
hubUpdateInstalledReplacedLive: "已移除旧版并安装 v{version},当前已生效,无需重启",
|
|
20861
|
-
hubUpdateFailedRestored: "更新失败,已恢复 v{version}",
|
|
20862
|
-
hubUpdateFailedRollbackFailed: "更新失败,且旧版本也没能重新装回来——插件可能已不可用",
|
|
20863
|
-
hubUpdateFailedRollbackSkipped: "更新失败,且无法自动恢复原版本——插件可能已被移除",
|
|
20864
|
-
hubUpdateDevelopmentInstall: "有新版本 {version};当前是本地链接安装,无法自动更新",
|
|
20865
|
-
hubUpdatePluginManagerMissing: "有新版本 {version};宿主未提供 pluginManager,无法自动更新",
|
|
20866
|
-
hubUpdateManualOnly: "有新版本 {version};当前安装方式无法自动更新",
|
|
20867
|
-
hubUpdateCheckFailed: "检测失败:无法连接 npm 源,请检查网络或代理",
|
|
20868
|
-
hubUpdateCommandLabel: "手动更新命令",
|
|
20869
|
-
localCodexLoginImport: "导入本机登录",
|
|
20870
|
-
localCodexLoginImporting: "导入中…",
|
|
20871
|
-
deviceCodeLogin: "设备代码登录",
|
|
20872
|
-
deviceCodeLoginStarting: "获取代码…",
|
|
20873
|
-
deviceCodeLoginDetail: "用设备代码添加账号",
|
|
20874
|
-
deviceCodeHint: "在任意设备上打开下面的链接并输入这个代码,本页会自动完成登录:这条路不需要浏览器回调到本机端口。",
|
|
20875
|
-
deviceCodeLabel: "设备代码",
|
|
20876
|
-
deviceCodeOpen: "打开确认页面",
|
|
20877
|
-
deviceCodeCopy: "复制到剪贴板",
|
|
20878
|
-
deviceCodeWaiting: "等待确认… 剩余 {time}",
|
|
20879
|
-
stopImporting: "停止导入全部本机登录",
|
|
20880
|
-
stopImportingLabel: "停止导入全部本机登录(当前 {count} 个)",
|
|
20881
|
-
stopImportingBusy: "停止导入中…",
|
|
20882
|
-
stopImportingHint: "停止导入只会让本插件忘记本机 CLI 登录的副本;Codex CLI 自己的登录文件不会被删除或修改。账号池不允许逐条删除借来的凭据,所以这里一次会停止全部导入。",
|
|
20883
|
-
"cardName.chatgpt": "ChatGPT",
|
|
20884
|
-
"cardName.command-code": "Command Code",
|
|
20885
|
-
"cardName.kimi-code": "Kimi Code",
|
|
20886
|
-
"cardName.minimax-code": "MiniMax Code",
|
|
20887
|
-
"cardName.glm-coding-plan": "GLM(ZCode 账号)",
|
|
20888
|
-
"cardName.claude": "Claude",
|
|
20889
|
-
"cardName.ollama": "Ollama",
|
|
20890
|
-
"cardName.step-code": "Step Code(Step Plan 订阅)",
|
|
20891
|
-
"cardName.cline-pass": "Cline Pass",
|
|
20892
|
-
"cardName.qoder": "Qoder(订阅)",
|
|
20893
|
-
"cardName.opendesign": "OpenDesign",
|
|
20894
|
-
"cardName.workbuddy": "WorkBuddy",
|
|
20895
|
-
"cardName.antigravity-acp": "Antigravity(ACP)",
|
|
20896
|
-
modelChecklistCount: "已启用 {count}/{total}",
|
|
20897
|
-
codeRunTitle: "代码",
|
|
20898
|
-
codeRunOutput: "输出",
|
|
20899
|
-
codeRunCopy: "复制",
|
|
20900
|
-
codeRunCopied: "已复制",
|
|
20901
|
-
codeRunWrap: "自动换行",
|
|
20902
|
-
codeRunUnwrap: "取消自动换行",
|
|
20903
|
-
codeRunInspect: "查看轨迹",
|
|
20904
|
-
codeRunPreparing: "准备中",
|
|
20905
|
-
codeRunRunning: "运行中",
|
|
20906
|
-
codeRunFailed: "失败",
|
|
20907
|
-
codeRunStopped: "已停止"
|
|
20908
|
-
};
|
|
20909
|
-
const dictionaries$3 = {
|
|
20910
|
-
zh: zh$3,
|
|
20911
|
-
en: {
|
|
20912
|
-
...accountPoolEn,
|
|
20913
|
-
title: "ChatGPT",
|
|
20914
|
-
hubTitle: "Subscriptions",
|
|
20915
|
-
intro: "Sign in with ChatGPT to use models available to your subscription in DSH.",
|
|
20916
|
-
account: "Account",
|
|
20917
|
-
signedOut: "Not signed in",
|
|
20918
|
-
signedIn: "Signed in",
|
|
20919
|
-
plan: "Plan",
|
|
20920
|
-
accountId: "Account ID",
|
|
20921
|
-
expires: "Token expires",
|
|
20922
|
-
signIn: "Sign in with ChatGPT",
|
|
20923
|
-
signInAgain: "Sign in again",
|
|
20924
|
-
cancel: "Cancel sign-in",
|
|
20925
|
-
signOut: "Sign out",
|
|
20926
|
-
refreshToken: "Refresh credentials",
|
|
20927
|
-
pending: "Complete sign-in in your browser.",
|
|
20928
|
-
popupBlocked: "The sign-in window was blocked. Use the link below to continue.",
|
|
20929
|
-
continueLogin: "Open ChatGPT sign-in",
|
|
20930
|
-
loading: "Reading status…",
|
|
20931
|
-
connection: "Connection",
|
|
20932
|
-
testConnection: "Test connection",
|
|
20933
|
-
testing: "Testing…",
|
|
20934
|
-
latency: "Last latency",
|
|
20935
|
-
selectAll: "Select all",
|
|
20936
|
-
unselectAll: "Unselect all",
|
|
20937
|
-
models: "Available models",
|
|
20938
|
-
modelsHint: "Checked models appear in the conversation model picker; unchecking all or turning off the switch hides this provider from the picker.",
|
|
20939
|
-
proxySettings: "Network Proxy",
|
|
20940
|
-
proxyMode: "Proxy Mode",
|
|
20941
|
-
proxyModeHint: "Every provider line in this plugin shares these proxy settings, including sign-in, token renewal, model catalog and quota reads. Supports system proxy detection; changes apply to subsequent requests.",
|
|
20942
|
-
proxyModeAuto: "System Proxy (Auto-detect)",
|
|
20943
|
-
proxyModeCustom: "Custom Proxy",
|
|
20944
|
-
proxyModeDirect: "Direct (No Proxy)",
|
|
20945
|
-
customProxyUrl: "Custom Proxy URL",
|
|
20946
|
-
customProxyUrlHint: "Supports HTTP/HTTPS/SOCKS5 proxy URLs, e.g. http://127.0.0.1:7890",
|
|
20947
|
-
customProxyUrlPlaceholder: "e.g. http://127.0.0.1:7890",
|
|
20948
|
-
saveProxyUrl: "Save Proxy URL",
|
|
20949
|
-
proxyDetected: "Detected system proxy",
|
|
20950
|
-
proxyDetectedEffective: " (active)",
|
|
20951
|
-
proxyNoneDetected: "No system proxy detected; connecting directly",
|
|
20952
|
-
proxyDirectHint: "Every request from this plugin connects directly without using any proxy server.",
|
|
20953
|
-
poolStorageTitle: "Account storage",
|
|
20954
|
-
poolStorageKeyring: "Desktop keyring",
|
|
20955
|
-
poolStorageCredentials: "DSH credential store",
|
|
20956
|
-
poolStorageKeyringHint: "Desktop installs only: uses the OS keyring (DPAPI / Keychain / Secret Service). On a server or a headless Linux host the keyring is usually unavailable and sign-in will fail — pick the DSH credential store instead.",
|
|
20957
|
-
poolStorageCredentialsHint: "The standard DSH secret store ($DSH_HOME/.credentials.yaml). POSIX: 0600 enforced, owner-only; Windows: profile ACL, no mode enforcement. Use this on servers and any host without a desktop keyring. Stored unencrypted at rest, protected by the host.",
|
|
20958
|
-
poolStorageEffective: "In use now: {storage}",
|
|
20959
|
-
poolStorageBackendKeyring: "desktop keyring (Secret Service), encrypted at rest",
|
|
20960
|
-
poolStorageBackendDpapi: "Windows DPAPI, encrypted at rest",
|
|
20961
|
-
poolStorageBackendKeychain: "macOS Keychain, encrypted at rest",
|
|
20962
|
-
poolStorageBackendCredentials: "DSH credential store (.credentials.yaml), protected by file permissions",
|
|
20963
|
-
poolStorageSwitchWarning: "Accounts saved in the other store stay there and are not shown until you switch back. There is no migration.",
|
|
20964
|
-
poolStorageUnavailableKeyring: "This host has no usable desktop keyring, so the account pool cannot be read or written. Switch Account storage to the DSH credential store.",
|
|
20965
|
-
poolStorageUnavailableCredentials: "This harness has no credential store (ctx.credentials), so the account pool cannot be read or written. Switch Account storage to the desktop keyring.",
|
|
20966
|
-
poolStorageUnavailableStore: "The pool store did not answer this time, so no accounts are listed here — none were deleted; reopen this page once the store answers again.",
|
|
20967
|
-
enhancements: "Enhancements",
|
|
20968
|
-
fastMode: "Fast mode (1.5x speed)",
|
|
20969
|
-
fastModeHint: "Generates tokens ~1.5x faster; consumes Codex subscription quota at ~2x–2.5x the normal rate.",
|
|
20970
|
-
outputVerbosity: "Output verbosity",
|
|
20971
|
-
outputVerbosityHint: "Controls the detail level of final Codex answers without changing reasoning effort. The default matches the official Codex client (low).",
|
|
20972
|
-
verbosityLow: "Low (keep answers concise)",
|
|
20973
|
-
verbosityMedium: "Medium (balance detail and brevity)",
|
|
20974
|
-
verbosityHigh: "High (include more detail)",
|
|
20975
|
-
reasoningSummary: "Reasoning summary",
|
|
20976
|
-
reasoningSummaryHint: "Controls how ChatGPT summarizes its chain of thought; does not change reasoning depth. The default matches the official Codex client (no summary, which saves quota).",
|
|
20977
|
-
summaryAuto: "Auto (let model determine detail)",
|
|
20978
|
-
summaryConcise: "Concise (brief summary)",
|
|
20979
|
-
summaryDetailed: "Detailed (in-depth summary)",
|
|
20980
|
-
summaryNone: "None (hide reasoning summary)",
|
|
20981
|
-
searchProvider: "Search provider",
|
|
20982
|
-
searchProviderHint: "Choose whether DSH web search uses the default provider or the Codex proxy-backed source from this ChatGPT subscription. Fetch mode \"auto\" follows this choice.",
|
|
20983
|
-
searchProviderDsh: "DSH default",
|
|
20984
|
-
searchProviderCodex: "ChatGPT (Proxy tunnel)",
|
|
20985
|
-
fetchStatus: "Fetch source (read-only)",
|
|
20986
|
-
fetchStatusHint: "Reported by the host. Read-only.",
|
|
20987
|
-
fetchConfiguredProvider: "Configured fetch provider",
|
|
20988
|
-
fetchProviderDshDefault: "DSH default (the host pins no fetch provider)",
|
|
20989
|
-
switcherState: "Fetch switcher state",
|
|
20990
|
-
switcherStateIdle: "Idle (no selection applied yet)",
|
|
20991
|
-
switcherStateApplying: "Applying (host web provider switch in progress)",
|
|
20992
|
-
switcherStateApplied: "Applied",
|
|
20993
|
-
switcherStateMissing: "No web service found to switch",
|
|
20994
|
-
switcherStateFailed: "Switch failed, check the host log",
|
|
20995
|
-
fetchMode: "Fetch mode",
|
|
20996
|
-
fetchModeAuto: "auto (fetches with the plugin when a proxy is available or the ChatGPT search source is selected)",
|
|
20997
|
-
fetchModePlugin: "plugin (always fetch with this plugin)",
|
|
20998
|
-
fetchModeDsh: "dsh (keep the DSH default fetch source)",
|
|
20999
|
-
fetchMaxBodyChars: "Plugin body limit",
|
|
21000
|
-
fetchMaxResponseBytes: "Plugin response limit",
|
|
21001
|
-
characters: "chars",
|
|
21002
|
-
bytes: "bytes",
|
|
21003
|
-
fetchLimitsInactive: "Only applied when the plugin actually fetches; the DSH default fetch source does not use these two limits.",
|
|
21004
|
-
fetchConfigSource: "Mode and limits are changed in the plugin Config, not in these settings; they take effect after a plugin reload or a DSH restart.",
|
|
21005
|
-
providerDefault: "Use provider default",
|
|
21006
|
-
contextWindows: "Model context windows",
|
|
21007
|
-
contextWindowsHint: "Lists the models checked under Available models. Each starts at its catalog value (384K for the GPT-6 family, up to 872K; up to 1M otherwise); DSH uses it for compaction and overflow detection. Values such as 872K and 512K are accepted, and a changed model can be restored one by one or all at once.",
|
|
21008
|
-
contextWindow: "Context window",
|
|
21009
|
-
contextWindowInvalid: "The context window must be a positive integer within the model limit (872K for the GPT-6 family, 1M otherwise). K and M suffixes are accepted.",
|
|
21010
|
-
contextWindowReset: "Restore default",
|
|
21011
|
-
contextWindowResetAll: "Restore all defaults",
|
|
21012
|
-
contextWindowResetAllConfirm: "Restore every changed model context window to its default?",
|
|
21013
|
-
contextWindowsNoneEnabled: "No model is checked yet. Check one under Available models above and its context window setting appears here.",
|
|
21014
|
-
saveContextWindow: "Save context window",
|
|
21015
|
-
save: "Save",
|
|
21016
|
-
tokens: "tokens",
|
|
21017
|
-
quickQuota: "Show quick usage beside the composer",
|
|
21018
|
-
quickQuotaHint: "Shown only when the current session uses a codex-chatgpt model.",
|
|
21019
|
-
quota: "Usage and limits",
|
|
21020
|
-
quotaIntro: "Data comes from the ChatGPT Codex usage service and refreshes at most once per minute while visible.",
|
|
21021
|
-
refreshQuota: "Refresh usage",
|
|
21022
|
-
refreshing: "Refreshing…",
|
|
21023
|
-
noQuota: "Your plan did not return any displayable limit windows.",
|
|
21024
|
-
quotaSignedOut: "Sign in to view subscription limits.",
|
|
21025
|
-
stale: "Showing the last successfully fetched data.",
|
|
21026
|
-
updated: "Updated",
|
|
21027
|
-
primary: "Primary window",
|
|
21028
|
-
secondary: "Secondary window",
|
|
21029
|
-
limitWindow: "limit",
|
|
21030
|
-
used: "used",
|
|
21031
|
-
remaining: "remaining",
|
|
21032
|
-
available: "Available",
|
|
21033
|
-
unavailable: "Unavailable",
|
|
21034
|
-
unlimited: "Unlimited",
|
|
21035
|
-
credits: "Credits",
|
|
21036
|
-
monthlySpend: "Monthly spend control",
|
|
21037
|
-
resetCredits: "Reset credits",
|
|
21038
|
-
resetCreditExpires: "Expires",
|
|
21039
|
-
useResetCredit: "Use reset credit",
|
|
21040
|
-
usingResetCredit: "Using…",
|
|
21041
|
-
useResetCreditConfirm: "This immediately spends one reset credit and resets eligible Codex limit windows. Continue?",
|
|
21042
|
-
resetCreditUsed: "The reset credit was used and usage data was refreshed.",
|
|
21043
|
-
spendControlReached: "Monthly spend control has been reached; new subscription calls may be limited.",
|
|
21044
|
-
limit: "Limit",
|
|
21045
|
-
exhausted: "Quota exhausted",
|
|
21046
|
-
resets: "Resets",
|
|
21047
|
-
quickQuotaLabel: "Codex left",
|
|
21048
|
-
quickQuotaLoading: "Usage…",
|
|
21049
|
-
imageToolRunning: "Generating image",
|
|
21050
|
-
imageToolDone: "Generated image",
|
|
21051
|
-
imageToolFailed: "Image generation failed",
|
|
21052
|
-
image: "Image",
|
|
21053
|
-
openImage: "Open image",
|
|
21054
|
-
openNamedImage: "Open {name}",
|
|
21055
|
-
imageLoading: "Loading image…",
|
|
21056
|
-
imageLoadFailed: "Image failed to load. Click to retry",
|
|
21057
|
-
imagePreviewClose: "Close",
|
|
21058
|
-
imagePreviewOpenOriginal: "Open original",
|
|
21059
|
-
retry: "Retry",
|
|
21060
|
-
unknown: "Unknown",
|
|
21061
|
-
hubBack: "Subscriptions",
|
|
21062
|
-
hubOverviewHint: "Pick a provider to manage its accounts, models and quota. The switch controls whether it appears in the model picker.",
|
|
21063
|
-
hubAccountCount: "{count} accounts",
|
|
21064
|
-
hubNoAccounts: "No accounts yet — open to add one",
|
|
21065
|
-
hubStateEnabled: "Enabled",
|
|
21066
|
-
hubStateDisabled: "Disabled",
|
|
21067
|
-
hubModelsEnabled: "{count} models available",
|
|
21068
|
-
hubModelsEnabledOfTotal: "{count}/{total} models available",
|
|
21069
|
-
hubStatusFailed: "Status unavailable",
|
|
21070
|
-
hubSwitchOn: "Enable {name}",
|
|
21071
|
-
hubSwitchOff: "Disable {name}",
|
|
21072
|
-
hubCardLabel: "{name}, {annotation}",
|
|
21073
|
-
hubUpdateCheck: "Check for updates",
|
|
21074
|
-
hubUpdateChecking: "Checking…",
|
|
21075
|
-
hubUpdateApply: "Update to v{version}",
|
|
21076
|
-
hubUpdateApplying: "Updating…",
|
|
21077
|
-
hubUpdateUpToDate: "Up to date ({version})",
|
|
21078
|
-
hubUpdateLatestWithUnknownCurrent: "Latest is {version}; the running version is unknown",
|
|
21079
|
-
hubUpdateAvailable: "{version} is available — you have {current}",
|
|
21080
|
-
hubUpdateInstalled: "Installed v{version} — restart the Host to apply it",
|
|
21081
|
-
hubUpdateInstalledReplaced: "Removed the old copy and installed v{version} — restart the Host to apply it",
|
|
21082
|
-
hubUpdateInstalledLive: "Installed v{version} — active now, no restart needed",
|
|
21083
|
-
hubUpdateInstalledReplacedLive: "Removed the old copy and installed v{version} — active now, no restart needed",
|
|
21084
|
-
hubUpdateFailedRestored: "Update failed; v{version} was restored",
|
|
21085
|
-
hubUpdateFailedRollbackFailed: "Update failed, and the previous version could not be reinstalled — the plugin may no longer be available",
|
|
21086
|
-
hubUpdateFailedRollbackSkipped: "Update failed, and the previous version could not be restored — the plugin may have been removed",
|
|
21087
|
-
hubUpdateDevelopmentInstall: "{version} is available, but this copy is a local link and cannot update itself",
|
|
21088
|
-
hubUpdatePluginManagerMissing: "{version} is available, but this Host exposes no pluginManager to install it",
|
|
21089
|
-
hubUpdateManualOnly: "{version} is available, but this install cannot update itself",
|
|
21090
|
-
hubUpdateCheckFailed: "Check failed: the npm registry could not be reached — check the network or proxy",
|
|
21091
|
-
hubUpdateCommandLabel: "Manual update command",
|
|
21092
|
-
localCodexLoginImport: "Import local sign-in",
|
|
21093
|
-
localCodexLoginImporting: "Importing…",
|
|
21094
|
-
deviceCodeLogin: "Device-code sign-in",
|
|
21095
|
-
deviceCodeLoginStarting: "Requesting code…",
|
|
21096
|
-
deviceCodeLoginDetail: "Add account with device code",
|
|
21097
|
-
deviceCodeHint: "Open the link below on any device and enter this code. This page finishes the sign-in by itself: nothing has to call back to a local port.",
|
|
21098
|
-
deviceCodeLabel: "Device code",
|
|
21099
|
-
deviceCodeOpen: "Open the confirmation page",
|
|
21100
|
-
deviceCodeCopy: "Copy to clipboard",
|
|
21101
|
-
deviceCodeWaiting: "Waiting for confirmation… {time} remaining",
|
|
21102
|
-
stopImporting: "Stop importing all local sign-ins",
|
|
21103
|
-
stopImportingLabel: "Stop importing all local sign-ins ({count} currently imported)",
|
|
21104
|
-
stopImportingBusy: "Stopping the import…",
|
|
21105
|
-
stopImportingHint: "Stopping the import only makes this plugin forget its copy of the local CLI sign-in; the Codex CLI own sign-in file is never deleted or changed. The account pool does not allow deleting a borrowed credential one at a time, so this stops every import at once.",
|
|
21106
|
-
"cardName.chatgpt": "ChatGPT",
|
|
21107
|
-
"cardName.command-code": "Command Code",
|
|
21108
|
-
"cardName.kimi-code": "Kimi Code",
|
|
21109
|
-
"cardName.minimax-code": "MiniMax Code",
|
|
21110
|
-
"cardName.glm-coding-plan": "GLM (ZCode Account)",
|
|
21111
|
-
"cardName.claude": "Claude",
|
|
21112
|
-
"cardName.ollama": "Ollama",
|
|
21113
|
-
"cardName.step-code": "Step Code (Step Plan Subscription)",
|
|
21114
|
-
"cardName.cline-pass": "Cline Pass",
|
|
21115
|
-
"cardName.qoder": "Qoder Subscription",
|
|
21116
|
-
"cardName.opendesign": "OpenDesign",
|
|
21117
|
-
"cardName.workbuddy": "WorkBuddy",
|
|
21118
|
-
"cardName.antigravity-acp": "Antigravity (ACP)",
|
|
21119
|
-
modelChecklistCount: "{count}/{total} enabled",
|
|
21120
|
-
codeRunTitle: "Code",
|
|
21121
|
-
codeRunOutput: "Output",
|
|
21122
|
-
codeRunCopy: "Copy",
|
|
21123
|
-
codeRunCopied: "Copied",
|
|
21124
|
-
codeRunWrap: "Wrap lines",
|
|
21125
|
-
codeRunUnwrap: "Do not wrap lines",
|
|
21126
|
-
codeRunInspect: "Inspect",
|
|
21127
|
-
codeRunPreparing: "Preparing",
|
|
21128
|
-
codeRunRunning: "Running",
|
|
21129
|
-
codeRunFailed: "Failed",
|
|
21130
|
-
codeRunStopped: "Stopped"
|
|
21131
|
-
}
|
|
21132
|
-
};
|
|
21133
|
-
//#endregion
|
|
21134
21330
|
//#region src/shared/i18n-contracts.ts
|
|
21135
21331
|
/**
|
|
21136
21332
|
* Language ids this plugin speaks, and the one parser that decides which one a
|
|
@@ -21903,7 +22099,7 @@ window.__ModuleLoader__.load({
|
|
|
21903
22099
|
modelsHint: "Отмеченные модели появляются в списке выбора модели на странице диалога; если снять все отметки или выключить переключатель выше, провайдер исчезнет из списка.",
|
|
21904
22100
|
proxySettings: "Сетевой прокси",
|
|
21905
22101
|
proxyMode: "Режим прокси",
|
|
21906
|
-
proxyModeHint: "
|
|
22102
|
+
proxyModeHint: "Влияет только на эту линию: её диалоги, вход и обновление токенов, каталог моделей и чтение квот; поддерживается автоопределение системного прокси, изменения действуют на последующие запросы.",
|
|
21907
22103
|
proxyModeAuto: "Системный прокси (автоопределение)",
|
|
21908
22104
|
proxyModeCustom: "Свой прокси",
|
|
21909
22105
|
proxyModeDirect: "Напрямую (без прокси)",
|
|
@@ -21911,6 +22107,12 @@ window.__ModuleLoader__.load({
|
|
|
21911
22107
|
customProxyUrlHint: "Поддерживаются адреса HTTP/HTTPS/SOCKS5, например http://127.0.0.1:7890",
|
|
21912
22108
|
customProxyUrlPlaceholder: "например http://127.0.0.1:7890",
|
|
21913
22109
|
saveProxyUrl: "Сохранить адрес прокси",
|
|
22110
|
+
noProxy: "Хосты в обход прокси",
|
|
22111
|
+
noProxyHint: "Эти хосты всегда подключаются напрямую. Список действует глобально и общий для всех линий. Разделяйте записи запятыми или пробелами; поддерживаются точные хосты, суффиксы доменов (api.corp.example) и host:port; список объединяется с NO_PROXY из переменных окружения и $DSH_HOME/.env.",
|
|
22112
|
+
noProxyPlaceholder: "например copilot.tencent.com, *.corp.example, gateway.lan:8080",
|
|
22113
|
+
saveNoProxy: "Сохранить список обхода",
|
|
22114
|
+
proxyDirectActive: "Сейчас действует: напрямую (без прокси)",
|
|
22115
|
+
proxyActiveTemplate: "Сейчас действует: {proxy}",
|
|
21914
22116
|
proxyDetected: "Обнаружен системный прокси",
|
|
21915
22117
|
proxyDetectedEffective: " (уже действует)",
|
|
21916
22118
|
proxyNoneDetected: "Системный прокси не обнаружен, соединение напрямую",
|
|
@@ -22566,7 +22768,6 @@ window.__ModuleLoader__.load({
|
|
|
22566
22768
|
signInAgain: "Войти снова",
|
|
22567
22769
|
signInStarting: "Запуск…",
|
|
22568
22770
|
signInSuccess: "Вход запущен: браузер откроет Antigravity CLI, а состояние здесь сменится на «выполнен вход» после подтверждения.",
|
|
22569
|
-
signInAlready: "Вход уже выполнен, повторять его не нужно.",
|
|
22570
22771
|
signInHintSummary: "Как проходит вход?",
|
|
22571
22772
|
signInHint: "Вход выполняет сам Antigravity CLI: он откроет браузер, после чего вернитесь сюда и обновите состояние. Плагин не читает и не сохраняет ваши учётные данные Google.",
|
|
22572
22773
|
signInHeadless: "На хосте без графической среды выполните в терминале agy acp --login, затем обновите страницу.",
|
|
@@ -22621,8 +22822,9 @@ window.__ModuleLoader__.load({
|
|
|
22621
22822
|
scopeHintSummary: "Показать четыре ограничения",
|
|
22622
22823
|
scopeHint: "Это объективные ограничения ACP и официального агента; данная линия их не обходит:",
|
|
22623
22824
|
scopePrompt: "В ACP нет отдельного слота системного промпта: системный промпт DSH передаётся в начале запроса, а собственный системный промпт официального агента убрать нельзя.",
|
|
22624
|
-
scopeHistory: "
|
|
22825
|
+
scopeHistory: "После нормального завершения сессия паркуется вместе с процессом для повторного использования: если отпечаток префикса и набор инструментов не изменились, следующее сообщение отправляет только приращение; полная перестройка с повторной отправкой и якорем нужна лишь при сжатии или переписывании истории, смене набора инструментов или смерти процесса.",
|
|
22625
22826
|
scopeTools: "Как основная модель линия выполняет вызовы инструментов через DSH и под его контролем; как субагент дочерний процесс использует собственные инструменты официального агента.",
|
|
22827
|
+
scopeNetwork: "Сетевые запросы этой линии выполняет сам официальный CLI (agy); плагин не может назначить ей отдельный прокси, и настройки прокси в других местах на неё не действуют.",
|
|
22626
22828
|
scopeQuota: "Официальный сервер не публикует остаток квоты, поэтому карточка не показывает ни процентов, ни баланса.",
|
|
22627
22829
|
error: "Не удалось выполнить действие: {detail}",
|
|
22628
22830
|
complianceSummary: "Риск по условиям (нажмите, чтобы прочитать)",
|
|
@@ -24247,7 +24449,7 @@ window.__ModuleLoader__.load({
|
|
|
24247
24449
|
//#region src/client/minimax-code/MinimaxVideoDocumentBody.tsx
|
|
24248
24450
|
/** 兜底翻译:只在没有 locale 座位时用到。 */
|
|
24249
24451
|
function translate$1(key) {
|
|
24250
|
-
return zh$
|
|
24452
|
+
return zh$12[key] ?? key;
|
|
24251
24453
|
}
|
|
24252
24454
|
/**
|
|
24253
24455
|
* 一个文件地址里的会话与路径。
|
|
@@ -24383,7 +24585,7 @@ window.__ModuleLoader__.load({
|
|
|
24383
24585
|
*/
|
|
24384
24586
|
/** 兜底翻译:只在没有 locale 座位时用到,走同一份 zh 字典。 */
|
|
24385
24587
|
function translate(key) {
|
|
24386
|
-
return zh$
|
|
24588
|
+
return zh$12[key] ?? key;
|
|
24387
24589
|
}
|
|
24388
24590
|
/**
|
|
24389
24591
|
* 一张视频工具卡片。
|
|
@@ -24839,7 +25041,7 @@ window.__ModuleLoader__.load({
|
|
|
24839
25041
|
* 没有快照、没有窗口、或全部窗口都没有百分比时返回 null,即**不渲染胶囊**:
|
|
24840
25042
|
* 契约允许 quota 为 null,装一个占位数字比不显示更像坏了。
|
|
24841
25043
|
*/
|
|
24842
|
-
function selectBadgeFacts$3(status, lookup = (key) => zh$
|
|
25044
|
+
function selectBadgeFacts$3(status, lookup = (key) => zh$11[key]) {
|
|
24843
25045
|
const measured = (status?.quota?.windows ?? []).filter((window) => typeof window.usedPercent === "number" && Number.isFinite(window.usedPercent));
|
|
24844
25046
|
if (measured.length === 0) return null;
|
|
24845
25047
|
const tightest = measured.reduce((best, window) => {
|
|
@@ -24935,7 +25137,7 @@ window.__ModuleLoader__.load({
|
|
|
24935
25137
|
* single most misleading pixel on the page.
|
|
24936
25138
|
*/
|
|
24937
25139
|
function AntigravityAcpComposerBadge(props) {
|
|
24938
|
-
const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$
|
|
25140
|
+
const t = useLineDict(NS_ANTIGRAVITY_ACP, zh$8);
|
|
24939
25141
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
|
|
24940
25142
|
directory: props.directory,
|
|
24941
25143
|
loadModelDirectory: props.loadModelDirectory,
|
|
@@ -25019,7 +25221,7 @@ window.__ModuleLoader__.load({
|
|
|
25019
25221
|
*
|
|
25020
25222
|
* 没有快照、没有窗口、或全部窗口都没有百分比时返回 null(见文件头)。
|
|
25021
25223
|
*/
|
|
25022
|
-
function selectBadgeFacts$2(status, lookup = (key) => zh$
|
|
25224
|
+
function selectBadgeFacts$2(status, lookup = (key) => zh$7[key]) {
|
|
25023
25225
|
const quota = status?.quota;
|
|
25024
25226
|
if (quota === null || quota === void 0) return null;
|
|
25025
25227
|
if (quota.kind !== "windowed") return null;
|
|
@@ -25166,7 +25368,7 @@ window.__ModuleLoader__.load({
|
|
|
25166
25368
|
directory: props.directory,
|
|
25167
25369
|
loadModelDirectory: props.loadModelDirectory,
|
|
25168
25370
|
providerId: "cline-pass",
|
|
25169
|
-
label: zh$
|
|
25371
|
+
label: zh$6.composerLabel,
|
|
25170
25372
|
readStatus: (refresh) => API$1.status(refresh),
|
|
25171
25373
|
selectFacts: selectClinePassFacts
|
|
25172
25374
|
});
|
|
@@ -25252,7 +25454,7 @@ window.__ModuleLoader__.load({
|
|
|
25252
25454
|
* 另外那只可能还剩一大半。所以这里不平均、不取最小剩余,而是取最大已用比例。
|
|
25253
25455
|
* 没有快照、没有桶、或全部桶都没有总额时返回 null(见文件头)。
|
|
25254
25456
|
*/
|
|
25255
|
-
function selectBadgeFacts$1(status, lookup = (key) => zh$
|
|
25457
|
+
function selectBadgeFacts$1(status, lookup = (key) => zh$5[key]) {
|
|
25256
25458
|
const quota = status?.quota;
|
|
25257
25459
|
if (quota === null || quota === void 0) return null;
|
|
25258
25460
|
const measurable = quota.buckets.filter((bucket) => bucket.total !== null && bucket.total > 0 && bucket.used !== null);
|
|
@@ -25262,7 +25464,7 @@ window.__ModuleLoader__.load({
|
|
|
25262
25464
|
const remaining = Math.round((1 - used) * 100);
|
|
25263
25465
|
const unit = tightest.unit !== null && tightest.unit !== "" ? " " + tightest.unit : "";
|
|
25264
25466
|
const bucketLabel = quotaBucketText(tightest.kind, {
|
|
25265
|
-
...zh$
|
|
25467
|
+
...zh$5,
|
|
25266
25468
|
quotaBucketPersonal: lookup("quotaBucketPersonal"),
|
|
25267
25469
|
quotaBucketAddOn: lookup("quotaBucketAddOn"),
|
|
25268
25470
|
quotaBucketOrg: lookup("quotaBucketOrg")
|
|
@@ -25373,7 +25575,7 @@ window.__ModuleLoader__.load({
|
|
|
25373
25575
|
directory: props.directory,
|
|
25374
25576
|
loadModelDirectory: props.loadModelDirectory,
|
|
25375
25577
|
providerId: "opendesign",
|
|
25376
|
-
label: zh$
|
|
25578
|
+
label: zh$4.composerLabel,
|
|
25377
25579
|
readStatus: () => API.status(),
|
|
25378
25580
|
selectFacts: selectOpenDesignFacts
|
|
25379
25581
|
});
|
|
@@ -25394,9 +25596,9 @@ window.__ModuleLoader__.load({
|
|
|
25394
25596
|
* is not), and one decimal is what keeps "1.5 小时" from reading as "2 小时".
|
|
25395
25597
|
*/
|
|
25396
25598
|
function planWindowName(seconds) {
|
|
25397
|
-
if (seconds >= 86400 && seconds % 86400 === 0) return zh$
|
|
25398
|
-
if (seconds >= 3600) return zh$
|
|
25399
|
-
return zh$
|
|
25599
|
+
if (seconds >= 86400 && seconds % 86400 === 0) return zh$4.usageWindowDays.replace("{count}", String(seconds / 86400));
|
|
25600
|
+
if (seconds >= 3600) return zh$4.usageWindowHours.replace("{count}", formatDecimal(seconds / 3600));
|
|
25601
|
+
return zh$4.usageWindowMinutes.replace("{count}", formatDecimal(seconds / 60));
|
|
25400
25602
|
}
|
|
25401
25603
|
/** What a window still has, from the grant and the remainder it states. */
|
|
25402
25604
|
function windowRemaining(limitCredits, remainingCredits) {
|
|
@@ -25429,7 +25631,7 @@ window.__ModuleLoader__.load({
|
|
|
25429
25631
|
const primaryId = status.pool.activeAccountId ?? status.pool.accounts.find((account) => account.isPrimary)?.id;
|
|
25430
25632
|
const reading = readings.find((account) => account.accountId === primaryId) ?? readings[0];
|
|
25431
25633
|
const amount = reading.balanceUsd;
|
|
25432
|
-
const readAt = zh$
|
|
25634
|
+
const readAt = zh$4.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString());
|
|
25433
25635
|
const windows = planWindows(reading.codingPlan);
|
|
25434
25636
|
if (windows.length === 0) return {
|
|
25435
25637
|
text: `$${amount}`,
|
|
@@ -25438,8 +25640,8 @@ window.__ModuleLoader__.load({
|
|
|
25438
25640
|
};
|
|
25439
25641
|
const narrowest = windows[0];
|
|
25440
25642
|
return {
|
|
25441
|
-
text: zh$
|
|
25442
|
-
tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$
|
|
25643
|
+
text: zh$4.usageWindowRemaining.replace("{remaining}", formatDecimal(narrowest.remaining)),
|
|
25644
|
+
tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$4.usageWindowRemaining.replace("{remaining}", formatDecimal(window.remaining))}`).join(" · ")} · ${readAt}`,
|
|
25443
25645
|
level: quotaLevel(narrowest.remaining),
|
|
25444
25646
|
percent: narrowest.remaining
|
|
25445
25647
|
};
|
|
@@ -27268,7 +27470,7 @@ window.__ModuleLoader__.load({
|
|
|
27268
27470
|
}
|
|
27269
27471
|
/** 兜底翻译:只在没有 locale 服务时用到(测试、以及菜单渲染早于字典注册)。 */
|
|
27270
27472
|
function fallbackTranslate$3(key, params) {
|
|
27271
|
-
const template = zh$
|
|
27473
|
+
const template = zh$12[key] ?? key;
|
|
27272
27474
|
if (params === void 0) return template;
|
|
27273
27475
|
return template.replace(/\{(\w+)\}/g, (_match, name) => String(params[name] ?? ""));
|
|
27274
27476
|
}
|
|
@@ -56566,7 +56768,7 @@ window.__ModuleLoader__.load({
|
|
|
56566
56768
|
providerId: "workbuddy-subscription",
|
|
56567
56769
|
readStatus: (refresh) => refresh ? api.post("/quota") : api.get("/status"),
|
|
56568
56770
|
selectFacts: selectBadgeFacts,
|
|
56569
|
-
label: useLineDict(NS_WORKBUDDY, zh$
|
|
56771
|
+
label: useLineDict(NS_WORKBUDDY, zh$3).composerLabel
|
|
56570
56772
|
});
|
|
56571
56773
|
}
|
|
56572
56774
|
//#endregion
|
|
@@ -59896,7 +60098,7 @@ window.__ModuleLoader__.load({
|
|
|
59896
60098
|
* @module @eddyskywalker/dsh-chatgpt-subscription/client/codemode/CodeRunToolView
|
|
59897
60099
|
*/
|
|
59898
60100
|
function fallbackTranslate(key) {
|
|
59899
|
-
return zh$
|
|
60101
|
+
return zh$15[key] ?? key;
|
|
59900
60102
|
}
|
|
59901
60103
|
function firstLine(text) {
|
|
59902
60104
|
const nl = text.indexOf("\n");
|
|
@@ -60654,36 +60856,36 @@ window.__ModuleLoader__.load({
|
|
|
60654
60856
|
installLineLocale(ctx.locale);
|
|
60655
60857
|
ctx.effect(() => installHostLocaleMirror(ctx.locale), "dsh-chatgpt-subscription: host locale mirror");
|
|
60656
60858
|
installRussianLocale(ctx);
|
|
60657
|
-
ctx.effect(() => ctx.locale.register(NS, dictionaries$
|
|
60859
|
+
ctx.effect(() => ctx.locale.register(NS, dictionaries$15), "dsh-chatgpt-subscription: dictionaries");
|
|
60658
60860
|
ctx.effect(() => installStyles(), "dsh-chatgpt-subscription: styles");
|
|
60659
60861
|
ctx.effect(() => {
|
|
60660
60862
|
installHubStyles();
|
|
60661
60863
|
installModelChecklistStyles();
|
|
60662
60864
|
return () => {};
|
|
60663
60865
|
}, "dsh-chatgpt-subscription: hub styles");
|
|
60664
|
-
ctx.effect(() => ctx.locale.register(NS_CLAUDE, dictionaries$
|
|
60866
|
+
ctx.effect(() => ctx.locale.register(NS_CLAUDE, dictionaries$10), "dsh-claude: dictionaries");
|
|
60665
60867
|
ctx.effect(() => {
|
|
60666
60868
|
installClaudeStyles();
|
|
60667
60869
|
return () => {};
|
|
60668
60870
|
}, "dsh-claude: styles");
|
|
60669
|
-
ctx.effect(() => ctx.locale.register(NS_COMMAND_CODE, dictionaries$
|
|
60670
|
-
ctx.effect(() => ctx.locale.register(NS_KIMI_CODE, dictionaries$
|
|
60871
|
+
ctx.effect(() => ctx.locale.register(NS_COMMAND_CODE, dictionaries$14), "dsh-command-code: dictionaries");
|
|
60872
|
+
ctx.effect(() => ctx.locale.register(NS_KIMI_CODE, dictionaries$13), "dsh-kimi-code: dictionaries");
|
|
60671
60873
|
ctx.effect(() => {
|
|
60672
60874
|
installKimiCodeStyles();
|
|
60673
60875
|
return () => {};
|
|
60674
60876
|
}, "dsh-kimi-code: styles");
|
|
60675
|
-
ctx.effect(() => ctx.locale.register(NS_MINIMAX_CODE, dictionaries$
|
|
60877
|
+
ctx.effect(() => ctx.locale.register(NS_MINIMAX_CODE, dictionaries$12), "dsh-minimax-code: dictionaries");
|
|
60676
60878
|
ctx.effect(() => {
|
|
60677
60879
|
installMinimaxCodeStyles();
|
|
60678
60880
|
return () => {};
|
|
60679
60881
|
}, "dsh-minimax-code: styles");
|
|
60680
|
-
ctx.effect(() => ctx.locale.register(NS_GLM_CODING_PLAN, dictionaries$
|
|
60882
|
+
ctx.effect(() => ctx.locale.register(NS_GLM_CODING_PLAN, dictionaries$11), "dsh-glm-coding-plan: dictionaries");
|
|
60681
60883
|
ctx.effect(() => {
|
|
60682
60884
|
installGlmCodingPlanStyles();
|
|
60683
60885
|
return () => {};
|
|
60684
60886
|
}, "dsh-glm-coding-plan: styles");
|
|
60685
|
-
ctx.effect(() => ctx.locale.register(NS_OLLAMA, dictionaries$
|
|
60686
|
-
ctx.effect(() => ctx.locale.register(NS_ANTIGRAVITY_ACP, dictionaries$
|
|
60887
|
+
ctx.effect(() => ctx.locale.register(NS_OLLAMA, dictionaries$9), "dsh-ollama: dictionaries");
|
|
60888
|
+
ctx.effect(() => ctx.locale.register(NS_ANTIGRAVITY_ACP, dictionaries$8), "dsh-antigravity-acp: dictionaries");
|
|
60687
60889
|
ctx.effect(() => {
|
|
60688
60890
|
installAntigravityAcpStyles();
|
|
60689
60891
|
return () => {};
|
|
@@ -60693,27 +60895,27 @@ window.__ModuleLoader__.load({
|
|
|
60693
60895
|
installProgressUpdatesStyles();
|
|
60694
60896
|
return () => {};
|
|
60695
60897
|
}, "dsh-progress-updates: styles");
|
|
60696
|
-
ctx.effect(() => ctx.locale.register(NS_STEP_CODE, dictionaries$
|
|
60898
|
+
ctx.effect(() => ctx.locale.register(NS_STEP_CODE, dictionaries$7), "dsh-step-code: dictionaries");
|
|
60697
60899
|
ctx.effect(() => {
|
|
60698
60900
|
installStepCodeStyles();
|
|
60699
60901
|
return () => {};
|
|
60700
60902
|
}, "dsh-step-code: styles");
|
|
60701
|
-
ctx.effect(() => ctx.locale.register(NS_CLINE_PASS, dictionaries$
|
|
60903
|
+
ctx.effect(() => ctx.locale.register(NS_CLINE_PASS, dictionaries$6), "dsh-cline-pass: dictionaries");
|
|
60702
60904
|
ctx.effect(() => {
|
|
60703
60905
|
installClinePassStyles();
|
|
60704
60906
|
return () => {};
|
|
60705
60907
|
}, "dsh-cline-pass: styles");
|
|
60706
|
-
ctx.effect(() => ctx.locale.register(NS_QODER, dictionaries$
|
|
60908
|
+
ctx.effect(() => ctx.locale.register(NS_QODER, dictionaries$5), "dsh-qoder: dictionaries");
|
|
60707
60909
|
ctx.effect(() => {
|
|
60708
60910
|
installQoderStyles();
|
|
60709
60911
|
return () => {};
|
|
60710
60912
|
}, "dsh-qoder: styles");
|
|
60711
|
-
ctx.effect(() => ctx.locale.register(NS_OPENDESIGN, dictionaries$
|
|
60913
|
+
ctx.effect(() => ctx.locale.register(NS_OPENDESIGN, dictionaries$4), "dsh-opendesign: dictionaries");
|
|
60712
60914
|
ctx.effect(() => {
|
|
60713
60915
|
installOpenDesignStyles();
|
|
60714
60916
|
return () => {};
|
|
60715
60917
|
}, "dsh-opendesign: styles");
|
|
60716
|
-
ctx.effect(() => ctx.locale.register(NS_WORKBUDDY, dictionaries$
|
|
60918
|
+
ctx.effect(() => ctx.locale.register(NS_WORKBUDDY, dictionaries$3), "dsh-workbuddy: dictionaries");
|
|
60717
60919
|
ctx.effect(() => {
|
|
60718
60920
|
installWorkBuddyStyles();
|
|
60719
60921
|
return () => {};
|