@eddyskywalker/dsh-chatgpt-subscription 0.68.1 → 0.70.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 +41 -0
- package/README.md +5 -7
- package/lib/client.js +338 -1357
- package/lib/client.js.map +1 -1
- package/lib/codemode.js +440 -18
- package/lib/{entry-plan-mode-gqE4UeU5.js → entry-plan-mode-5DBZA4Il.js} +38 -11
- package/lib/index.js +2900 -7157
- package/lib/plan-mode-pipeline.js +20 -6
- package/lib/plan-mode.js +1 -1
- package/lib/types/client/CodexImageToolView.d.ts.map +1 -1
- package/lib/types/client/claude/locales.d.ts +2 -2
- package/lib/types/client/codemode/CodeRunToolView.d.ts.map +1 -1
- package/lib/types/client/command-code/locales.d.ts +2 -2
- package/lib/types/client/common/ContextWindowEditor.d.ts.map +1 -1
- package/lib/types/client/common/account-pool-labels.d.ts +1 -1
- package/lib/types/client/common/account-pool-labels.d.ts.map +1 -1
- package/lib/types/client/common/format.d.ts +1 -1
- package/lib/types/client/glm-coding-plan/locales.d.ts +2 -2
- package/lib/types/client/hub/brand-icons.d.ts +1 -1
- package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
- package/lib/types/client/hub/providers.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +0 -2
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/kimi-code/locales.d.ts +2 -2
- package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
- package/lib/types/client/locales-ru/index.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +1 -3
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/minimax-code/locales.d.ts +2 -2
- package/lib/types/client/progress-updates/locales.d.ts +3 -3
- package/lib/types/client/progress-updates/styles.d.ts +1 -1
- package/lib/types/client/qoder/locales.d.ts +1 -1
- package/lib/types/client/step-code/StepCodeComposerQuota.d.ts +3 -5
- package/lib/types/client/step-code/StepCodeComposerQuota.d.ts.map +1 -1
- package/lib/types/client/step-code/locales.d.ts +2 -2
- package/lib/types/compat.d.ts +1 -10
- package/lib/types/compat.d.ts.map +1 -1
- package/lib/types/entry-codemode.d.ts.map +1 -1
- package/lib/types/entry-plan-mode-pipeline.d.ts.map +1 -1
- package/lib/types/host/agent-preset.d.ts +5 -3
- package/lib/types/host/agent-preset.d.ts.map +1 -1
- package/lib/types/host/codemode/transport.d.ts +61 -5
- package/lib/types/host/codemode/transport.d.ts.map +1 -1
- package/lib/types/host/common/capabilities.d.ts.map +1 -1
- package/lib/types/host/common/i18n/en.d.ts.map +1 -1
- package/lib/types/host/common/i18n/ru.d.ts.map +1 -1
- package/lib/types/host/common/i18n/zh.d.ts +0 -2
- package/lib/types/host/common/i18n/zh.d.ts.map +1 -1
- package/lib/types/host/common/idle-watchdog.d.ts +10 -2
- package/lib/types/host/common/idle-watchdog.d.ts.map +1 -1
- package/lib/types/host/common/model-request-control.d.ts +1 -1
- package/lib/types/host/common/model-request-control.d.ts.map +1 -1
- package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
- package/lib/types/host/credential-store-secret-service.d.ts +3 -5
- package/lib/types/host/credential-store-secret-service.d.ts.map +1 -1
- package/lib/types/host/dispatch-execution-guard.d.ts.map +1 -1
- package/lib/types/host/glm-coding-plan/oauth.d.ts +1 -1
- package/lib/types/host/kimi-code/adapter.d.ts +6 -2
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/types.d.ts +14 -0
- package/lib/types/host/kimi-code/types.d.ts.map +1 -1
- package/lib/types/host/opendesign/types.d.ts +1 -2
- package/lib/types/host/opendesign/types.d.ts.map +1 -1
- package/lib/types/host/preset-sync.d.ts +2 -2
- package/lib/types/host/preset-sync.d.ts.map +1 -1
- package/lib/types/host/proxy-manager.d.ts +10 -10
- package/lib/types/host/proxy-manager.d.ts.map +1 -1
- package/lib/types/host/widget-board/line-contracts.d.ts +1 -1
- package/lib/types/host/widget-board/line-quota.d.ts +1 -16
- package/lib/types/host/widget-board/line-quota.d.ts.map +1 -1
- package/lib/types/host/widget-board/line-registry.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -8
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/minimax-code-contracts.d.ts +1 -1
- package/package.json +26 -24
- package/widgets/line-flip/widget.json +2 -7
- package/bin/antigravity-login.mjs +0 -47
- package/lib/types/client/antigravity/AntigravityComposerQuota.d.ts +0 -32
- package/lib/types/client/antigravity/AntigravityComposerQuota.d.ts.map +0 -1
- package/lib/types/client/antigravity/AntigravitySection.d.ts +0 -8
- package/lib/types/client/antigravity/AntigravitySection.d.ts.map +0 -1
- package/lib/types/client/antigravity/locales.d.ts +0 -290
- package/lib/types/client/antigravity/locales.d.ts.map +0 -1
- package/lib/types/client/antigravity/styles.d.ts +0 -3
- package/lib/types/client/antigravity/styles.d.ts.map +0 -1
- package/lib/types/client/locales-ru/antigravity.d.ts +0 -10
- package/lib/types/client/locales-ru/antigravity.d.ts.map +0 -1
- package/lib/types/host/antigravity/account-pool.d.ts +0 -158
- package/lib/types/host/antigravity/account-pool.d.ts.map +0 -1
- package/lib/types/host/antigravity/adapter.d.ts +0 -71
- package/lib/types/host/antigravity/adapter.d.ts.map +0 -1
- package/lib/types/host/antigravity/cache-stats.d.ts +0 -166
- package/lib/types/host/antigravity/cache-stats.d.ts.map +0 -1
- package/lib/types/host/antigravity/catalog-limits.d.ts +0 -23
- package/lib/types/host/antigravity/catalog-limits.d.ts.map +0 -1
- package/lib/types/host/antigravity/client-version.d.ts +0 -55
- package/lib/types/host/antigravity/client-version.d.ts.map +0 -1
- package/lib/types/host/antigravity/client.d.ts +0 -74
- package/lib/types/host/antigravity/client.d.ts.map +0 -1
- package/lib/types/host/antigravity/image-tool.d.ts +0 -73
- package/lib/types/host/antigravity/image-tool.d.ts.map +0 -1
- package/lib/types/host/antigravity/mapper.d.ts +0 -165
- package/lib/types/host/antigravity/mapper.d.ts.map +0 -1
- package/lib/types/host/antigravity/oauth.d.ts +0 -98
- package/lib/types/host/antigravity/oauth.d.ts.map +0 -1
- package/lib/types/host/antigravity/port-constants.d.ts +0 -33
- package/lib/types/host/antigravity/port-constants.d.ts.map +0 -1
- package/lib/types/host/antigravity/routes.d.ts +0 -7
- package/lib/types/host/antigravity/routes.d.ts.map +0 -1
- package/lib/types/host/antigravity/token-store.d.ts +0 -76
- package/lib/types/host/antigravity/token-store.d.ts.map +0 -1
- package/lib/types/host/antigravity/tool-schema.d.ts +0 -14
- package/lib/types/host/antigravity/tool-schema.d.ts.map +0 -1
- package/lib/types/host/antigravity/types.d.ts +0 -119
- package/lib/types/host/antigravity/types.d.ts.map +0 -1
- package/lib/types/shared/antigravity-contracts.d.ts +0 -175
- package/lib/types/shared/antigravity-contracts.d.ts.map +0 -1
package/lib/client.js
CHANGED
|
@@ -50,7 +50,7 @@ window.__ModuleLoader__.load({
|
|
|
50
50
|
* 路由前缀(host 暴露、client 消费)。
|
|
51
51
|
*
|
|
52
52
|
* 与其余各订阅线路一致:每条线路把自己的设置面挂在 `/<line>/api` 下
|
|
53
|
-
* (
|
|
53
|
+
* (claude / command-code / kimi-code 都是如此),
|
|
54
54
|
* 而不是挂到 Codex 那条线路的 `/api/dsh-chatgpt-subscription` 前缀下面。
|
|
55
55
|
* 唯一的 `/api/dsh-chatgpt-subscription` 前缀属于 Codex 自己的路由表。
|
|
56
56
|
*/
|
|
@@ -58,14 +58,6 @@ window.__ModuleLoader__.load({
|
|
|
58
58
|
const ROUTE_PREFIX = "/api/dsh-chatgpt-subscription";
|
|
59
59
|
const CODEX_CHATGPT_PROVIDER_ID = "codex-chatgpt";
|
|
60
60
|
const CODEX_IMAGE_TOOL_NAME = "codex_image_generate";
|
|
61
|
-
/**
|
|
62
|
-
* The Antigravity image tool and the runtime it calls.
|
|
63
|
-
*
|
|
64
|
-
* `gemini-3.1-flash-image` is listed by `fetchAvailableModels`, but its product
|
|
65
|
-
* is an image and the harness accepts text-only assistant output, so it is
|
|
66
|
-
* served as a tool (like Codex images) rather than as a chat model.
|
|
67
|
-
*/
|
|
68
|
-
const ANTIGRAVITY_IMAGE_TOOL_NAME = "antigravity_image_generate";
|
|
69
61
|
//#endregion
|
|
70
62
|
//#region src/client/common/use-store.ts
|
|
71
63
|
/**
|
|
@@ -156,12 +148,10 @@ window.__ModuleLoader__.load({
|
|
|
156
148
|
//#endregion
|
|
157
149
|
//#region src/client/CodexImageToolView.tsx
|
|
158
150
|
/**
|
|
159
|
-
* Aspect ratios
|
|
151
|
+
* Aspect ratios recognized when sizing an image tool's placeholder.
|
|
160
152
|
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* square instead of producing a wrong request — the value is never sent
|
|
164
|
-
* anywhere, and the host enum stays the single authority over what is legal.
|
|
153
|
+
* The value only affects local presentation and is never sent upstream; an
|
|
154
|
+
* unrecognized ratio falls back to the default square.
|
|
165
155
|
*/
|
|
166
156
|
const IMAGE_ASPECT_RATIOS = /* @__PURE__ */ new Set([
|
|
167
157
|
"1:1",
|
|
@@ -364,7 +354,7 @@ window.__ModuleLoader__.load({
|
|
|
364
354
|
const HUB_OVERVIEW_PATH = `${ROUTE_PREFIX}/hub/overview`;
|
|
365
355
|
//#endregion
|
|
366
356
|
//#region src/client/common/account-pool-labels.ts
|
|
367
|
-
/** Chinese labels
|
|
357
|
+
/** Chinese labels shared by every provider account-pool card. */
|
|
368
358
|
const accountPoolZh = {
|
|
369
359
|
accountPool: "账号管理",
|
|
370
360
|
addAccount: "添加账号",
|
|
@@ -519,10 +509,6 @@ window.__ModuleLoader__.load({
|
|
|
519
509
|
color: "#10A37F",
|
|
520
510
|
tile: "#10A37F"
|
|
521
511
|
},
|
|
522
|
-
antigravity: {
|
|
523
|
-
mark: "gemini",
|
|
524
|
-
tile: "#3186FF"
|
|
525
|
-
},
|
|
526
512
|
"command-code": {
|
|
527
513
|
monogram: ">_",
|
|
528
514
|
color: "#7C6AEF",
|
|
@@ -1214,7 +1200,7 @@ window.__ModuleLoader__.load({
|
|
|
1214
1200
|
* The capacity, date and countdown formatting every provider settings card shares.
|
|
1215
1201
|
*
|
|
1216
1202
|
* Each card used to carry its own copy of the capacity pair. The five copies
|
|
1217
|
-
* were byte-identical
|
|
1203
|
+
* were byte-identical apart from one historical card, which had lost the
|
|
1218
1204
|
* 1K floor and so rendered a zero as "0K" while its siblings rendered "0". The
|
|
1219
1205
|
* parse has to mean the same thing on every line — it takes free-text user input
|
|
1220
1206
|
* that feeds the overflow judgement — so this is the one place it lives. The
|
|
@@ -3051,6 +3037,94 @@ window.__ModuleLoader__.load({
|
|
|
3051
3037
|
return error instanceof Error ? error.message : String(error);
|
|
3052
3038
|
}
|
|
3053
3039
|
//#endregion
|
|
3040
|
+
//#region src/shared/command-code-contracts.ts
|
|
3041
|
+
/** Every level, in escalating order; the settings card renders exactly these. */
|
|
3042
|
+
const COMMAND_CODE_REASONING_EFFORTS = [
|
|
3043
|
+
"none",
|
|
3044
|
+
"minimal",
|
|
3045
|
+
"low",
|
|
3046
|
+
"medium",
|
|
3047
|
+
"high",
|
|
3048
|
+
"xhigh",
|
|
3049
|
+
"max"
|
|
3050
|
+
];
|
|
3051
|
+
//#endregion
|
|
3052
|
+
//#region src/client/common/line-locale.ts
|
|
3053
|
+
/**
|
|
3054
|
+
* Locale plumbing shared by the provider detail pages.
|
|
3055
|
+
*
|
|
3056
|
+
* Every card used to render its `zh` dictionary object directly, which pinned
|
|
3057
|
+
* the whole page to Chinese whatever the active locale was: the dictionaries
|
|
3058
|
+
* carry a complete English half, but nothing ever asked the locale service for
|
|
3059
|
+
* it. A card now renders a dictionary-shaped view of the registered namespace
|
|
3060
|
+
* instead — same property access (`t.signIn`), but each read goes through the
|
|
3061
|
+
* registry, so the active locale (and any language pack registered later)
|
|
3062
|
+
* decides the text.
|
|
3063
|
+
*
|
|
3064
|
+
* The view keeps the fallback's own keys, in its own order, and resolves every
|
|
3065
|
+
* value lazily on read: the object identity is stable per namespace + fallback,
|
|
3066
|
+
* so a card can keep passing `t` into helpers, while the strings still follow a
|
|
3067
|
+
* locale switch without remounting.
|
|
3068
|
+
*/
|
|
3069
|
+
const NOOP_SUBSCRIBE = () => () => {};
|
|
3070
|
+
const ZERO_REVISION = () => 0;
|
|
3071
|
+
let runtime;
|
|
3072
|
+
let subscribe = NOOP_SUBSCRIBE;
|
|
3073
|
+
let revision = ZERO_REVISION;
|
|
3074
|
+
const bound = /* @__PURE__ */ new Map();
|
|
3075
|
+
/**
|
|
3076
|
+
* Hand the client locale runtime to this module.
|
|
3077
|
+
*
|
|
3078
|
+
* Called once from the plugin entry, before any card mounts. Rendering without
|
|
3079
|
+
* it (unit tests that mount a card bare) keeps the dictionary's own values,
|
|
3080
|
+
* which is what those tests assert against.
|
|
3081
|
+
*
|
|
3082
|
+
* @param locale - the plugin context's locale runtime.
|
|
3083
|
+
*/
|
|
3084
|
+
function installLineLocale(locale) {
|
|
3085
|
+
runtime = locale;
|
|
3086
|
+
subscribe = typeof locale?.subscribe === "function" ? (listener) => locale.subscribe(listener) : NOOP_SUBSCRIBE;
|
|
3087
|
+
revision = typeof locale?.getSnapshot === "function" ? () => locale.getSnapshot().revision : ZERO_REVISION;
|
|
3088
|
+
bound.clear();
|
|
3089
|
+
}
|
|
3090
|
+
/** Bound translator of one namespace, or `undefined` when no locale service exists. */
|
|
3091
|
+
function translatorOf(ns) {
|
|
3092
|
+
if (runtime === void 0) return void 0;
|
|
3093
|
+
const cached = bound.get(ns);
|
|
3094
|
+
if (cached !== void 0) return cached;
|
|
3095
|
+
let translate;
|
|
3096
|
+
try {
|
|
3097
|
+
translate = runtime.bind(ns);
|
|
3098
|
+
} catch {
|
|
3099
|
+
return;
|
|
3100
|
+
}
|
|
3101
|
+
bound.set(ns, translate);
|
|
3102
|
+
return translate;
|
|
3103
|
+
}
|
|
3104
|
+
/**
|
|
3105
|
+
* Dictionary-shaped view of one namespace, resolved through the active locale.
|
|
3106
|
+
*
|
|
3107
|
+
* @param ns - the namespace the card registered its dictionaries under.
|
|
3108
|
+
* @param fallback - the card's own `zh` dictionary: source of the key set and
|
|
3109
|
+
* of the value used when no locale service is installed.
|
|
3110
|
+
* @returns the same key shape as `fallback`, with values read at render time.
|
|
3111
|
+
*/
|
|
3112
|
+
function useLineDict(ns, fallback) {
|
|
3113
|
+
(0, react.useSyncExternalStore)(subscribe, revision, revision);
|
|
3114
|
+
return (0, react.useMemo)(() => liveDict(ns, fallback), [ns, fallback]);
|
|
3115
|
+
}
|
|
3116
|
+
/** Build the lazy dictionary view: one enumerable getter per fallback key. */
|
|
3117
|
+
function liveDict(ns, fallback) {
|
|
3118
|
+
const translate = translatorOf(ns);
|
|
3119
|
+
const view = {};
|
|
3120
|
+
for (const key of Object.keys(fallback)) Object.defineProperty(view, key, {
|
|
3121
|
+
enumerable: true,
|
|
3122
|
+
configurable: false,
|
|
3123
|
+
get: () => translate === void 0 ? fallback[key] : translate(key)
|
|
3124
|
+
});
|
|
3125
|
+
return view;
|
|
3126
|
+
}
|
|
3127
|
+
//#endregion
|
|
3054
3128
|
//#region src/client/common/ContextWindowEditor.tsx
|
|
3055
3129
|
/**
|
|
3056
3130
|
* The shared "model context windows" block every provider settings card renders.
|
|
@@ -3063,11 +3137,9 @@ window.__ModuleLoader__.load({
|
|
|
3063
3137
|
* hardcoded English `context window` input label four of them carry);
|
|
3064
3138
|
* - whether a row shows the model's effective window beside the name when it
|
|
3065
3139
|
* exceeds the model's default, and which stylesheet class that figure wears;
|
|
3066
|
-
* - whether the capacity input carries an `aria-label` at all
|
|
3067
|
-
* does not);
|
|
3140
|
+
* - whether the capacity input carries an `aria-label` at all;
|
|
3068
3141
|
* - how a save or a restore is carried out, which stays in each card because
|
|
3069
|
-
*
|
|
3070
|
-
* restore first.
|
|
3142
|
+
* lines normalize their status payloads and confirmations differently.
|
|
3071
3143
|
*
|
|
3072
3144
|
* Everything the rows and callbacks need is therefore the whole interface: the
|
|
3073
3145
|
* editor parses, seeds and stores nothing.
|
|
@@ -3195,47 +3267,57 @@ window.__ModuleLoader__.load({
|
|
|
3195
3267
|
};
|
|
3196
3268
|
}
|
|
3197
3269
|
//#endregion
|
|
3198
|
-
//#region src/client/
|
|
3199
|
-
const
|
|
3200
|
-
const zh$
|
|
3270
|
+
//#region src/client/command-code/locales.ts
|
|
3271
|
+
const NS_COMMAND_CODE = "dsh-command-code";
|
|
3272
|
+
const zh$14 = {
|
|
3201
3273
|
...accountPoolZh,
|
|
3202
|
-
title: "
|
|
3203
|
-
pageDesc: "登录
|
|
3204
|
-
account: "
|
|
3274
|
+
title: "Command Code",
|
|
3275
|
+
pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。",
|
|
3276
|
+
account: "账号",
|
|
3205
3277
|
signedIn: "已登录",
|
|
3206
3278
|
signedOut: "未登录",
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
primaryAccount: "主账号",
|
|
3210
|
-
activeAccount: "当前使用",
|
|
3211
|
-
setPrimary: "设为主账号",
|
|
3212
|
-
deleteAccount: "删除",
|
|
3213
|
-
cooling: "冷却中",
|
|
3214
|
-
clearCooldown: "重置冷却",
|
|
3215
|
-
rotationStrategy: "调度策略",
|
|
3216
|
-
strategySequential: "顺序耗尽(当前优先,遇限流自动切号)",
|
|
3217
|
-
strategyRoundRobin: "轮询调度(按账号循环均匀分摊)",
|
|
3218
|
-
strategySticky: "会话粘性(保持当前账号直到被限流)",
|
|
3219
|
-
noAccounts: "暂无账号,点击「添加账号」完成登录授权。",
|
|
3279
|
+
keyName: "密钥名称",
|
|
3280
|
+
organization: "组织",
|
|
3220
3281
|
plan: "套餐",
|
|
3221
|
-
|
|
3222
|
-
|
|
3282
|
+
planUnknown: "—",
|
|
3283
|
+
subscription: "订阅状态",
|
|
3284
|
+
renews: "续费于",
|
|
3285
|
+
authenticatedAt: "登录时间",
|
|
3286
|
+
signIn: "浏览器登录",
|
|
3223
3287
|
signInAgain: "重新登录",
|
|
3224
|
-
refreshToken: "刷新凭据",
|
|
3225
|
-
signOut: "注销",
|
|
3226
|
-
signIn: "登录",
|
|
3227
3288
|
signingIn: "登录中...",
|
|
3289
|
+
signOut: "注销",
|
|
3290
|
+
cancelSignIn: "取消登录",
|
|
3291
|
+
openSignInPage: "打开登录页面",
|
|
3292
|
+
apiKeySection: "手动填写 API Key",
|
|
3293
|
+
apiKeyHint: "在 Command Code Studio 创建 API Key 后粘贴到此处;浏览器登录不可用时使用。",
|
|
3294
|
+
apiKeyPlaceholder: "粘贴 Command Code API Key",
|
|
3295
|
+
apiKeySave: "保存并验证",
|
|
3296
|
+
apiKeySaving: "验证中...",
|
|
3297
|
+
apiKeySaved: "已保存",
|
|
3228
3298
|
connection: "连接",
|
|
3229
|
-
|
|
3299
|
+
testConnection: "测试连接",
|
|
3300
|
+
testingConnection: "测试中...",
|
|
3301
|
+
routeOwned: "模型路由由本插件提供",
|
|
3302
|
+
routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重试。",
|
|
3230
3303
|
modelsSection: "模型",
|
|
3304
|
+
modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;全部取消勾选或关闭概览卡片上的开关可在列表中隐藏该供应商。",
|
|
3305
|
+
refreshCatalog: "刷新模型目录",
|
|
3306
|
+
refreshingCatalog: "刷新中...",
|
|
3307
|
+
catalogStale: "目录来自缓存,可能过期;可手动刷新",
|
|
3308
|
+
catalogFresh: "目录已同步",
|
|
3309
|
+
zdrEnabled: "已请求零数据保留(ZDR);服务端无符合条件的路由时将拒绝请求,不自动降低隐私要求。",
|
|
3231
3310
|
selectAll: "全选",
|
|
3232
3311
|
unselectAll: "全不选",
|
|
3312
|
+
wireAnthropic: "Anthropic",
|
|
3313
|
+
wireOpenai: "OpenAI",
|
|
3314
|
+
wireResponses: "OpenAI Responses",
|
|
3233
3315
|
enhanced: "增强功能",
|
|
3234
3316
|
defaultReasoningEffort: "默认思考深度",
|
|
3235
|
-
defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。",
|
|
3317
|
+
defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。Anthropic 模型会映射为 thinking 预算。",
|
|
3236
3318
|
defaultEffortAuto: "使用 Provider 默认值",
|
|
3237
3319
|
contextWindowSection: "模型上下文窗口",
|
|
3238
|
-
contextWindowHint: "
|
|
3320
|
+
contextWindowHint: "默认取 Command Code 模型目录的 context length;可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。",
|
|
3239
3321
|
contextWindowReset: "恢复默认",
|
|
3240
3322
|
contextWindowResetAll: "全部恢复默认",
|
|
3241
3323
|
contextWindowResetAllConfirm: "确定把已改过的模型上下文窗口全部恢复为默认值吗?",
|
|
@@ -3243,77 +3325,67 @@ window.__ModuleLoader__.load({
|
|
|
3243
3325
|
save: "保存",
|
|
3244
3326
|
saved: "已保存",
|
|
3245
3327
|
saving: "保存中...",
|
|
3246
|
-
cacheSection: "缓存",
|
|
3247
|
-
cacheDesc: "Antigravity 的缓存由服务端隐式命中,客户端不发送任何缓存控制字段,因此这里用实际读缓存的比例反映效果。下面只报「整段未命中」的那一次,并给出它之前的空闲时长——缓存是按空闲时间过期的,而每次新对话都必然改变内容,把每次变化都报出来等于什么都没说。统计只保存在内存中,并按会话隔离。",
|
|
3248
|
-
cacheEmpty: "本进程还没有带用量回报的请求。",
|
|
3249
|
-
cacheHitRatio: "缓存命中率",
|
|
3250
|
-
cacheCached: "命中 tokens",
|
|
3251
|
-
cacheFresh: "新增 tokens",
|
|
3252
|
-
cacheRequests: "请求数",
|
|
3253
|
-
cacheMiss: "最近一次整段未命中",
|
|
3254
|
-
cacheMissIdle: "未命中前空闲",
|
|
3255
|
-
cacheDriftNone: "前缀未变化",
|
|
3256
|
-
cacheDriftContents: "对话内容变化",
|
|
3257
|
-
cacheDriftSystemInstruction: "系统指令变化",
|
|
3258
|
-
cacheDriftTools: "工具列表变化",
|
|
3259
|
-
cacheDriftSessionId: "会话标识变化",
|
|
3260
|
-
cacheDriftNewSession: "本次会话的首次请求",
|
|
3261
3328
|
quotaSection: "用量与配额",
|
|
3262
|
-
quotaDesc: "数据来自
|
|
3329
|
+
quotaDesc: "数据来自 Command Code 账户接口,页面可见时最多每 60 秒刷新一次。",
|
|
3263
3330
|
refreshQuota: "刷新用量",
|
|
3264
3331
|
refreshingQuota: "刷新中...",
|
|
3265
3332
|
quotaEmpty: "暂无配额数据,点击「刷新用量」重试。",
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
resetUnavailable: "重置: n/a",
|
|
3269
|
-
resetNow: "现在",
|
|
3270
|
-
timeDayHour: "{days}天 {hours}时",
|
|
3271
|
-
timeHourMin: "{hours}h {minutes}m",
|
|
3272
|
-
timeMin: "{minutes}m",
|
|
3333
|
+
quotaCredits: "剩余额度",
|
|
3334
|
+
quotaUnlimited: "不限量",
|
|
3273
3335
|
updatedAt: "更新时间:{time}",
|
|
3274
3336
|
loading: "加载中...",
|
|
3275
3337
|
loginFailed: "登录失败",
|
|
3276
3338
|
tokens: "tokens"
|
|
3277
3339
|
};
|
|
3278
|
-
const en$
|
|
3340
|
+
const en$14 = {
|
|
3279
3341
|
...accountPoolEn,
|
|
3280
|
-
title: "
|
|
3281
|
-
pageDesc: "Sign in to
|
|
3282
|
-
account: "
|
|
3342
|
+
title: "Command Code",
|
|
3343
|
+
pageDesc: "Sign in to Command Code and manage models, context windows, and quota.",
|
|
3344
|
+
account: "Account",
|
|
3283
3345
|
signedIn: "Signed in",
|
|
3284
3346
|
signedOut: "Not signed in",
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
primaryAccount: "Primary",
|
|
3288
|
-
activeAccount: "In Use",
|
|
3289
|
-
setPrimary: "Set as Primary",
|
|
3290
|
-
deleteAccount: "Delete",
|
|
3291
|
-
cooling: "In Cooldown",
|
|
3292
|
-
clearCooldown: "Clear Cooldown",
|
|
3293
|
-
rotationStrategy: "Scheduling Strategy",
|
|
3294
|
-
strategySequential: "Sequential Drain (Primary first, failover on 429)",
|
|
3295
|
-
strategyRoundRobin: "Round-Robin (Evenly rotate across accounts)",
|
|
3296
|
-
strategySticky: "Sticky session (hold the current account until it is limited)",
|
|
3297
|
-
noAccounts: "No accounts yet. Click \"Add Account\" to authorize.",
|
|
3347
|
+
keyName: "Key name",
|
|
3348
|
+
organization: "Organization",
|
|
3298
3349
|
plan: "Plan",
|
|
3299
|
-
|
|
3300
|
-
|
|
3350
|
+
planUnknown: "—",
|
|
3351
|
+
subscription: "Subscription",
|
|
3352
|
+
renews: "renews",
|
|
3353
|
+
authenticatedAt: "Signed in at",
|
|
3354
|
+
signIn: "Sign in with browser",
|
|
3301
3355
|
signInAgain: "Sign in again",
|
|
3302
|
-
refreshToken: "Refresh token",
|
|
3303
|
-
signOut: "Sign out",
|
|
3304
|
-
signIn: "Sign in",
|
|
3305
3356
|
signingIn: "Signing in...",
|
|
3357
|
+
signOut: "Sign out",
|
|
3358
|
+
cancelSignIn: "Cancel",
|
|
3359
|
+
openSignInPage: "Open the sign-in page",
|
|
3360
|
+
apiKeySection: "Paste an API key",
|
|
3361
|
+
apiKeyHint: "Create a key in Command Code Studio and paste it here; use this when the browser flow is unavailable.",
|
|
3362
|
+
apiKeyPlaceholder: "Command Code API key",
|
|
3363
|
+
apiKeySave: "Save and verify",
|
|
3364
|
+
apiKeySaving: "Verifying...",
|
|
3365
|
+
apiKeySaved: "Saved",
|
|
3306
3366
|
connection: "Connection",
|
|
3307
|
-
|
|
3367
|
+
testConnection: "Test connection",
|
|
3368
|
+
testingConnection: "Testing...",
|
|
3369
|
+
routeOwned: "This plugin serves the model route",
|
|
3370
|
+
routeConflict: "Another provider already owns the model route: {detail}. Remove the duplicate provider configuration in DSH settings and reload.",
|
|
3308
3371
|
modelsSection: "Models",
|
|
3372
|
+
modelsHint: "Checked models appear in the DSH conversation model list; unchecking all or turning off the switch on the overview card hides this provider.",
|
|
3373
|
+
refreshCatalog: "Refresh catalog",
|
|
3374
|
+
refreshingCatalog: "Refreshing...",
|
|
3375
|
+
catalogStale: "Cached catalog may be stale; refresh to revalidate",
|
|
3376
|
+
catalogFresh: "Catalog synchronized",
|
|
3377
|
+
zdrEnabled: "Zero Data Retention requested; requests fail closed if no compliant route is available.",
|
|
3309
3378
|
selectAll: "Select all",
|
|
3310
3379
|
unselectAll: "Deselect all",
|
|
3311
|
-
|
|
3380
|
+
wireAnthropic: "Anthropic",
|
|
3381
|
+
wireOpenai: "OpenAI",
|
|
3382
|
+
wireResponses: "OpenAI Responses",
|
|
3383
|
+
enhanced: "Enhanced features",
|
|
3312
3384
|
defaultReasoningEffort: "Default reasoning effort",
|
|
3313
|
-
defaultReasoningEffortHint: "
|
|
3314
|
-
defaultEffortAuto: "Use
|
|
3315
|
-
contextWindowSection: "Model
|
|
3316
|
-
contextWindowHint: "Defaults to
|
|
3385
|
+
defaultReasoningEffortHint: "Reasoning effort for models that support it when the conversation does not specify one. Anthropic models map it to a thinking budget.",
|
|
3386
|
+
defaultEffortAuto: "Use provider default",
|
|
3387
|
+
contextWindowSection: "Model context window",
|
|
3388
|
+
contextWindowHint: "Defaults to the context length in the Command Code catalog; override it with the capacity DSH should use for compaction and overflow decisions (e.g., 1M, 512K, 200K).",
|
|
3317
3389
|
contextWindowReset: "Restore default",
|
|
3318
3390
|
contextWindowResetAll: "Restore all defaults",
|
|
3319
3391
|
contextWindowResetAllConfirm: "Restore every changed model context window to its default?",
|
|
@@ -3321,166 +3393,72 @@ window.__ModuleLoader__.load({
|
|
|
3321
3393
|
save: "Save",
|
|
3322
3394
|
saved: "Saved",
|
|
3323
3395
|
saving: "Saving...",
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
cacheEmpty: "No request in this process has reported usage yet.",
|
|
3327
|
-
cacheHitRatio: "Cache hit ratio",
|
|
3328
|
-
cacheCached: "Cached tokens",
|
|
3329
|
-
cacheFresh: "Fresh tokens",
|
|
3330
|
-
cacheRequests: "Requests",
|
|
3331
|
-
cacheMiss: "Last total miss",
|
|
3332
|
-
cacheMissIdle: "Idle before that miss",
|
|
3333
|
-
cacheDriftNone: "Prefix unchanged",
|
|
3334
|
-
cacheDriftContents: "Conversation contents changed",
|
|
3335
|
-
cacheDriftSystemInstruction: "System instruction changed",
|
|
3336
|
-
cacheDriftTools: "Tool list changed",
|
|
3337
|
-
cacheDriftSessionId: "Session identifier changed",
|
|
3338
|
-
cacheDriftNewSession: "This session's first request",
|
|
3339
|
-
quotaSection: "Usage & Quota",
|
|
3340
|
-
quotaDesc: "Data from Google Cloud Code Assist quota service; refreshes up to once every 60 seconds when visible.",
|
|
3396
|
+
quotaSection: "Usage & quota",
|
|
3397
|
+
quotaDesc: "Read from the Command Code account endpoints; refreshes at most once every 60 seconds while visible.",
|
|
3341
3398
|
refreshQuota: "Refresh quota",
|
|
3342
3399
|
refreshingQuota: "Refreshing...",
|
|
3343
3400
|
quotaEmpty: "No quota data yet — use “Refresh quota” to retry.",
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
resetUnavailable: "Reset: n/a",
|
|
3347
|
-
resetNow: "now",
|
|
3348
|
-
timeDayHour: "{days}d {hours}h",
|
|
3349
|
-
timeHourMin: "{hours}h {minutes}m",
|
|
3350
|
-
timeMin: "{minutes}m",
|
|
3401
|
+
quotaCredits: "Remaining credits",
|
|
3402
|
+
quotaUnlimited: "Unlimited",
|
|
3351
3403
|
updatedAt: "Updated at: {time}",
|
|
3352
3404
|
loading: "Loading...",
|
|
3353
|
-
loginFailed: "
|
|
3405
|
+
loginFailed: "Sign-in failed",
|
|
3354
3406
|
tokens: "tokens"
|
|
3355
3407
|
};
|
|
3356
|
-
const dictionaries$
|
|
3357
|
-
zh: zh$
|
|
3358
|
-
"zh-CN": zh$
|
|
3359
|
-
en: en$
|
|
3360
|
-
"en-US": en$
|
|
3408
|
+
const dictionaries$14 = {
|
|
3409
|
+
zh: zh$14,
|
|
3410
|
+
"zh-CN": zh$14,
|
|
3411
|
+
en: en$14,
|
|
3412
|
+
"en-US": en$14
|
|
3361
3413
|
};
|
|
3362
3414
|
//#endregion
|
|
3363
|
-
//#region src/client/
|
|
3364
|
-
/**
|
|
3365
|
-
* Locale plumbing shared by the provider detail pages.
|
|
3366
|
-
*
|
|
3367
|
-
* Every card used to render its `zh` dictionary object directly, which pinned
|
|
3368
|
-
* the whole page to Chinese whatever the active locale was: the dictionaries
|
|
3369
|
-
* carry a complete English half, but nothing ever asked the locale service for
|
|
3370
|
-
* it. A card now renders a dictionary-shaped view of the registered namespace
|
|
3371
|
-
* instead — same property access (`t.signIn`), but each read goes through the
|
|
3372
|
-
* registry, so the active locale (and any language pack registered later)
|
|
3373
|
-
* decides the text.
|
|
3374
|
-
*
|
|
3375
|
-
* The view keeps the fallback's own keys, in its own order, and resolves every
|
|
3376
|
-
* value lazily on read: the object identity is stable per namespace + fallback,
|
|
3377
|
-
* so a card can keep passing `t` into helpers, while the strings still follow a
|
|
3378
|
-
* locale switch without remounting.
|
|
3379
|
-
*/
|
|
3380
|
-
const NOOP_SUBSCRIBE = () => () => {};
|
|
3381
|
-
const ZERO_REVISION = () => 0;
|
|
3382
|
-
let runtime;
|
|
3383
|
-
let subscribe = NOOP_SUBSCRIBE;
|
|
3384
|
-
let revision = ZERO_REVISION;
|
|
3385
|
-
const bound = /* @__PURE__ */ new Map();
|
|
3415
|
+
//#region src/client/command-code/CommandCodeSection.tsx
|
|
3386
3416
|
/**
|
|
3387
|
-
*
|
|
3388
|
-
*
|
|
3389
|
-
* Called once from the plugin entry, before any card mounts. Rendering without
|
|
3390
|
-
* it (unit tests that mount a card bare) keeps the dictionary's own values,
|
|
3391
|
-
* which is what those tests assert against.
|
|
3392
|
-
*
|
|
3393
|
-
* @param locale - the plugin context's locale runtime.
|
|
3417
|
+
* Display label per reasoning level. The locale dictionary only accepts flat
|
|
3418
|
+
* string values, so this nested table lives with the control that renders it.
|
|
3394
3419
|
*/
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
if (cached !== void 0) return cached;
|
|
3406
|
-
let translate;
|
|
3407
|
-
try {
|
|
3408
|
-
translate = runtime.bind(ns);
|
|
3409
|
-
} catch {
|
|
3410
|
-
return;
|
|
3411
|
-
}
|
|
3412
|
-
bound.set(ns, translate);
|
|
3413
|
-
return translate;
|
|
3414
|
-
}
|
|
3420
|
+
const EFFORT_LABELS$3 = {
|
|
3421
|
+
none: "Off",
|
|
3422
|
+
minimal: "Minimal",
|
|
3423
|
+
low: "Low",
|
|
3424
|
+
medium: "Medium",
|
|
3425
|
+
high: "High",
|
|
3426
|
+
xhigh: "X-High",
|
|
3427
|
+
max: "Max"
|
|
3428
|
+
};
|
|
3429
|
+
const api$14 = createLineApi("/command-code/api", "Command Code");
|
|
3415
3430
|
/**
|
|
3416
|
-
*
|
|
3431
|
+
* Route name shown next to a model.
|
|
3417
3432
|
*
|
|
3418
|
-
*
|
|
3419
|
-
*
|
|
3420
|
-
*
|
|
3421
|
-
* @returns the same key shape as `fallback`, with values read at render time.
|
|
3433
|
+
* The three routes are not interchangeable: the provider serves each model on
|
|
3434
|
+
* exactly one and rejects the others, so the label states which one this model
|
|
3435
|
+
* actually uses.
|
|
3422
3436
|
*/
|
|
3423
|
-
function
|
|
3424
|
-
(
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
/** Build the lazy dictionary view: one enumerable getter per fallback key. */
|
|
3428
|
-
function liveDict(ns, fallback) {
|
|
3429
|
-
const translate = translatorOf(ns);
|
|
3430
|
-
const view = {};
|
|
3431
|
-
for (const key of Object.keys(fallback)) Object.defineProperty(view, key, {
|
|
3432
|
-
enumerable: true,
|
|
3433
|
-
configurable: false,
|
|
3434
|
-
get: () => translate === void 0 ? fallback[key] : translate(key)
|
|
3435
|
-
});
|
|
3436
|
-
return view;
|
|
3437
|
-
}
|
|
3438
|
-
//#endregion
|
|
3439
|
-
//#region src/client/antigravity/AntigravitySection.tsx
|
|
3440
|
-
const api$16 = createLineApi("/antigravity/api", "Antigravity");
|
|
3441
|
-
/** A gap in human units, so the idle reading is legible without arithmetic. */
|
|
3442
|
-
function idleLabel(ms) {
|
|
3443
|
-
const seconds = Math.round(ms / 1e3);
|
|
3444
|
-
if (seconds < 60) return `${seconds}s`;
|
|
3445
|
-
const minutes = Math.floor(seconds / 60);
|
|
3446
|
-
const rest = seconds % 60;
|
|
3447
|
-
return rest === 0 ? `${minutes}m` : `${minutes}m ${rest}s`;
|
|
3448
|
-
}
|
|
3449
|
-
/** Human label for the cause of the last request that lost the whole cache. */
|
|
3450
|
-
function missLabel(cause, t) {
|
|
3451
|
-
switch (cause) {
|
|
3452
|
-
case "none": return t.cacheDriftNone;
|
|
3453
|
-
case "contents": return t.cacheDriftContents;
|
|
3454
|
-
case "systemInstruction": return t.cacheDriftSystemInstruction;
|
|
3455
|
-
case "tools": return t.cacheDriftTools;
|
|
3456
|
-
case "session-id": return t.cacheDriftSessionId;
|
|
3457
|
-
case "new-session": return t.cacheDriftNewSession;
|
|
3458
|
-
default: return String(cause);
|
|
3459
|
-
}
|
|
3437
|
+
function wireLabel$1(wire, t) {
|
|
3438
|
+
if (wire === "anthropic") return t.wireAnthropic;
|
|
3439
|
+
if (wire === "responses") return t.wireResponses;
|
|
3440
|
+
return t.wireOpenai;
|
|
3460
3441
|
}
|
|
3461
|
-
function
|
|
3442
|
+
function CommandCodeSection({ onModelChange, loadModelDirectory }) {
|
|
3462
3443
|
const [status, setStatus] = (0, react.useState)(null);
|
|
3463
3444
|
const [loading, setLoading] = (0, react.useState)(true);
|
|
3464
3445
|
const [busy, setBusy] = (0, react.useState)(null);
|
|
3465
3446
|
const [error, setError] = (0, react.useState)(null);
|
|
3466
|
-
const [validationUrl, setValidationUrl] = (0, react.useState)(null);
|
|
3467
3447
|
const [loginProgress, setLoginProgress] = (0, react.useState)(null);
|
|
3468
3448
|
const [contextDrafts, setContextDrafts] = (0, react.useState)({});
|
|
3469
3449
|
const [savingModel, setSavingModel] = (0, react.useState)(null);
|
|
3450
|
+
const [apiKey, setApiKey] = (0, react.useState)("");
|
|
3470
3451
|
/** Follow-up poll owed while the host refreshes the quota behind an answer. */
|
|
3471
3452
|
const quotaFollowUp = (0, react.useRef)(null);
|
|
3472
|
-
const t = useLineDict(
|
|
3453
|
+
const t = useLineDict(NS_COMMAND_CODE, zh$14);
|
|
3473
3454
|
const notifyChange = (0, react.useCallback)(() => {
|
|
3474
3455
|
onModelChange?.();
|
|
3475
3456
|
loadModelDirectory?.();
|
|
3476
3457
|
}, [onModelChange, loadModelDirectory]);
|
|
3477
3458
|
const loadStatus = (0, react.useCallback)(async (quiet = false) => {
|
|
3478
|
-
if (!quiet)
|
|
3479
|
-
setError(null);
|
|
3480
|
-
setValidationUrl(null);
|
|
3481
|
-
}
|
|
3459
|
+
if (!quiet) setError(null);
|
|
3482
3460
|
try {
|
|
3483
|
-
const data = await api$
|
|
3461
|
+
const data = await api$14.request("/status");
|
|
3484
3462
|
setStatus(data);
|
|
3485
3463
|
setContextDrafts(contextDraftsFor(data));
|
|
3486
3464
|
quotaFollowUp.current ??= createQuotaFollowUp();
|
|
@@ -3510,748 +3488,13 @@ window.__ModuleLoader__.load({
|
|
|
3510
3488
|
try {
|
|
3511
3489
|
setBusy("login");
|
|
3512
3490
|
setError(null);
|
|
3513
|
-
setValidationUrl(null);
|
|
3514
3491
|
setLoginProgress(null);
|
|
3515
|
-
const flow = await api$
|
|
3516
|
-
if (flow.authUrl) window.open(flow.authUrl, "_blank");
|
|
3517
|
-
const pollTimer = setInterval(async () => {
|
|
3518
|
-
try {
|
|
3519
|
-
const pollStatus = await api$16.request("/login/status");
|
|
3520
|
-
if (pollStatus.progress) setLoginProgress(pollStatus.progress);
|
|
3521
|
-
if (pollStatus.status === "complete") {
|
|
3522
|
-
clearInterval(pollTimer);
|
|
3523
|
-
setBusy(null);
|
|
3524
|
-
setLoginProgress(null);
|
|
3525
|
-
await loadStatus();
|
|
3526
|
-
notifyChange();
|
|
3527
|
-
} else if (pollStatus.status === "error") {
|
|
3528
|
-
clearInterval(pollTimer);
|
|
3529
|
-
setBusy(null);
|
|
3530
|
-
setLoginProgress(null);
|
|
3531
|
-
setError(pollStatus.error || t.loginFailed);
|
|
3532
|
-
if (pollStatus.validationUrl) setValidationUrl(pollStatus.validationUrl);
|
|
3533
|
-
}
|
|
3534
|
-
} catch {}
|
|
3535
|
-
}, 1500);
|
|
3536
|
-
setTimeout(() => {
|
|
3537
|
-
clearInterval(pollTimer);
|
|
3538
|
-
setBusy(null);
|
|
3539
|
-
setLoginProgress(null);
|
|
3540
|
-
}, 300 * 1e3);
|
|
3541
|
-
} catch (err) {
|
|
3542
|
-
setBusy(null);
|
|
3543
|
-
setLoginProgress(null);
|
|
3544
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3545
|
-
}
|
|
3546
|
-
};
|
|
3547
|
-
const handleRefreshQuota = async () => {
|
|
3548
|
-
try {
|
|
3549
|
-
setBusy("quota");
|
|
3550
|
-
setError(null);
|
|
3551
|
-
const updated = await api$16.request("/quota", { method: "POST" });
|
|
3552
|
-
setStatus(updated);
|
|
3553
|
-
} catch (err) {
|
|
3554
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3555
|
-
} finally {
|
|
3556
|
-
setBusy(null);
|
|
3557
|
-
}
|
|
3558
|
-
};
|
|
3559
|
-
const handleSetPrimary = async (accountId) => {
|
|
3560
|
-
try {
|
|
3561
|
-
setBusy(`primary-${accountId}`);
|
|
3562
|
-
setError(null);
|
|
3563
|
-
const updated = await api$16.request("/accounts", {
|
|
3564
|
-
method: "POST",
|
|
3565
|
-
body: JSON.stringify({
|
|
3566
|
-
action: "set-primary",
|
|
3567
|
-
accountId
|
|
3568
|
-
})
|
|
3569
|
-
});
|
|
3570
|
-
setStatus(updated);
|
|
3571
|
-
notifyChange();
|
|
3572
|
-
} catch (err) {
|
|
3573
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3574
|
-
} finally {
|
|
3575
|
-
setBusy(null);
|
|
3576
|
-
}
|
|
3577
|
-
};
|
|
3578
|
-
const handleDeleteAccount = async (accountId) => {
|
|
3579
|
-
try {
|
|
3580
|
-
setBusy(`delete-${accountId}`);
|
|
3581
|
-
setError(null);
|
|
3582
|
-
const updated = await api$16.request("/accounts", {
|
|
3583
|
-
method: "POST",
|
|
3584
|
-
body: JSON.stringify({
|
|
3585
|
-
action: "delete",
|
|
3586
|
-
accountId
|
|
3587
|
-
})
|
|
3588
|
-
});
|
|
3589
|
-
setStatus(updated);
|
|
3590
|
-
notifyChange();
|
|
3591
|
-
} catch (err) {
|
|
3592
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3593
|
-
} finally {
|
|
3594
|
-
setBusy(null);
|
|
3595
|
-
}
|
|
3596
|
-
};
|
|
3597
|
-
const handleClearCooldown = async (accountId) => {
|
|
3598
|
-
try {
|
|
3599
|
-
setBusy(`cooldown-${accountId}`);
|
|
3600
|
-
setError(null);
|
|
3601
|
-
const updated = await api$16.request("/accounts", {
|
|
3602
|
-
method: "POST",
|
|
3603
|
-
body: JSON.stringify({
|
|
3604
|
-
action: "clear-cooldown",
|
|
3605
|
-
accountId
|
|
3606
|
-
})
|
|
3607
|
-
});
|
|
3608
|
-
setStatus(updated);
|
|
3609
|
-
} catch (err) {
|
|
3610
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3611
|
-
} finally {
|
|
3612
|
-
setBusy(null);
|
|
3613
|
-
}
|
|
3614
|
-
};
|
|
3615
|
-
const handleSetStrategy = async (strategy) => {
|
|
3616
|
-
try {
|
|
3617
|
-
setBusy("strategy");
|
|
3618
|
-
setError(null);
|
|
3619
|
-
const updated = await api$16.request("/accounts", {
|
|
3620
|
-
method: "POST",
|
|
3621
|
-
body: JSON.stringify({
|
|
3622
|
-
action: "strategy",
|
|
3623
|
-
strategy
|
|
3624
|
-
})
|
|
3625
|
-
});
|
|
3626
|
-
setStatus(updated);
|
|
3627
|
-
} catch (err) {
|
|
3628
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3629
|
-
} finally {
|
|
3630
|
-
setBusy(null);
|
|
3631
|
-
}
|
|
3632
|
-
};
|
|
3633
|
-
const toggleModel = async (modelId, checked) => {
|
|
3634
|
-
if (!status) return;
|
|
3635
|
-
const currentEnabled = status.models.filter((m) => m.enabled).map((m) => m.id);
|
|
3636
|
-
const nextEnabled = checked ? [.../* @__PURE__ */ new Set([...currentEnabled, modelId])] : currentEnabled.filter((id) => id !== modelId);
|
|
3637
|
-
try {
|
|
3638
|
-
const updated = await api$16.request("/models", {
|
|
3639
|
-
method: "POST",
|
|
3640
|
-
body: JSON.stringify({ enabledModelIds: nextEnabled })
|
|
3641
|
-
});
|
|
3642
|
-
setStatus(updated);
|
|
3643
|
-
setContextDrafts(contextDraftsFor(updated));
|
|
3644
|
-
notifyChange();
|
|
3645
|
-
} catch (err) {
|
|
3646
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3647
|
-
}
|
|
3648
|
-
};
|
|
3649
|
-
const setAllModels = async (selectAll) => {
|
|
3650
|
-
if (!status) return;
|
|
3651
|
-
const nextEnabled = selectAll ? status.models.map((m) => m.id) : [];
|
|
3652
|
-
try {
|
|
3653
|
-
const updated = await api$16.request("/models", {
|
|
3654
|
-
method: "POST",
|
|
3655
|
-
body: JSON.stringify({ enabledModelIds: nextEnabled })
|
|
3656
|
-
});
|
|
3657
|
-
setStatus(updated);
|
|
3658
|
-
setContextDrafts(contextDraftsFor(updated));
|
|
3659
|
-
notifyChange();
|
|
3660
|
-
} catch (err) {
|
|
3661
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3662
|
-
}
|
|
3663
|
-
};
|
|
3664
|
-
const handleUpdateEffort = async (effort) => {
|
|
3665
|
-
try {
|
|
3666
|
-
const updated = await api$16.request("/settings", {
|
|
3667
|
-
method: "POST",
|
|
3668
|
-
body: JSON.stringify({ defaultReasoningEffort: effort })
|
|
3669
|
-
});
|
|
3670
|
-
setStatus(updated);
|
|
3671
|
-
notifyChange();
|
|
3672
|
-
} catch (err) {
|
|
3673
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3674
|
-
}
|
|
3675
|
-
};
|
|
3676
|
-
const handleSaveContextWindow = async (modelId) => {
|
|
3677
|
-
const raw = contextDrafts[modelId] || "";
|
|
3678
|
-
const parsed = parsePositiveCapacity$1(raw);
|
|
3679
|
-
if (parsed === null) {
|
|
3680
|
-
setError(`无效的上下文容量值: ${raw}`);
|
|
3681
|
-
return;
|
|
3682
|
-
}
|
|
3683
|
-
try {
|
|
3684
|
-
setSavingModel(modelId);
|
|
3685
|
-
setError(null);
|
|
3686
|
-
const updated = await api$16.request("/settings", {
|
|
3687
|
-
method: "POST",
|
|
3688
|
-
body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
|
|
3689
|
-
});
|
|
3690
|
-
setStatus(updated);
|
|
3691
|
-
setContextDrafts((prev) => ({
|
|
3692
|
-
...prev,
|
|
3693
|
-
[modelId]: formatCapacity$1(parsed)
|
|
3694
|
-
}));
|
|
3695
|
-
notifyChange();
|
|
3696
|
-
} catch (err) {
|
|
3697
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3698
|
-
} finally {
|
|
3699
|
-
setSavingModel(null);
|
|
3700
|
-
}
|
|
3701
|
-
};
|
|
3702
|
-
/** Clear one override; the row falls back to the catalog length. */
|
|
3703
|
-
const handleResetContextWindow = async (modelId) => {
|
|
3704
|
-
try {
|
|
3705
|
-
setSavingModel(modelId);
|
|
3706
|
-
setError(null);
|
|
3707
|
-
const updated = await api$16.request("/settings", {
|
|
3708
|
-
method: "POST",
|
|
3709
|
-
body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
|
|
3710
|
-
});
|
|
3711
|
-
setStatus(updated);
|
|
3712
|
-
setContextDrafts((prev) => {
|
|
3713
|
-
const model = updated.models.find((candidate) => candidate.id === modelId);
|
|
3714
|
-
return model === void 0 ? prev : {
|
|
3715
|
-
...prev,
|
|
3716
|
-
[modelId]: formatCapacity$1(model.defaultContextWindow)
|
|
3717
|
-
};
|
|
3718
|
-
});
|
|
3719
|
-
notifyChange();
|
|
3720
|
-
} catch (err) {
|
|
3721
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3722
|
-
} finally {
|
|
3723
|
-
setSavingModel(null);
|
|
3724
|
-
}
|
|
3725
|
-
};
|
|
3726
|
-
/** Clear every stored override, including models the picker no longer shows. */
|
|
3727
|
-
const handleResetAllContextWindows = async () => {
|
|
3728
|
-
const models = Object.keys(status?.contextWindowOverrides ?? {});
|
|
3729
|
-
if (models.length === 0) return;
|
|
3730
|
-
if (typeof window !== "undefined" && !window.confirm(t.contextWindowResetAllConfirm)) return;
|
|
3731
|
-
try {
|
|
3732
|
-
setBusy("context");
|
|
3733
|
-
setError(null);
|
|
3734
|
-
const updated = await api$16.request("/settings", {
|
|
3735
|
-
method: "POST",
|
|
3736
|
-
body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
|
|
3737
|
-
});
|
|
3738
|
-
setStatus(updated);
|
|
3739
|
-
setContextDrafts(contextDraftsFor(updated));
|
|
3740
|
-
notifyChange();
|
|
3741
|
-
} catch (err) {
|
|
3742
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
3743
|
-
} finally {
|
|
3744
|
-
setBusy(null);
|
|
3745
|
-
}
|
|
3746
|
-
};
|
|
3747
|
-
const contextModels = status?.models.filter((model) => model.enabled) ?? [];
|
|
3748
|
-
const overrideCount = Object.keys(status?.contextWindowOverrides ?? {}).length;
|
|
3749
|
-
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3750
|
-
className: "dsha-page",
|
|
3751
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3752
|
-
className: "dsha-empty",
|
|
3753
|
-
children: t.loading
|
|
3754
|
-
})
|
|
3755
|
-
});
|
|
3756
|
-
const quota = status?.quota;
|
|
3757
|
-
const groups = quota?.groups || [];
|
|
3758
|
-
status?.models.filter((m) => m.enabled).length;
|
|
3759
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3760
|
-
className: "dsha-page",
|
|
3761
|
-
children: [
|
|
3762
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountPoolSection, {
|
|
3763
|
-
accounts: status?.accounts ?? [],
|
|
3764
|
-
activeAccountId: status?.activeAccountId,
|
|
3765
|
-
rotationStrategy: status?.rotationStrategy ?? "sticky",
|
|
3766
|
-
busy,
|
|
3767
|
-
labels: t,
|
|
3768
|
-
loginBusyLabel: busy === "login" ? loginProgress || t.signingIn : void 0,
|
|
3769
|
-
onLogin: () => void handleLogin(),
|
|
3770
|
-
onSetPrimary: (accountId) => void handleSetPrimary(accountId),
|
|
3771
|
-
onDelete: (accountId) => void handleDeleteAccount(accountId),
|
|
3772
|
-
onClearCooldown: (accountId) => void handleClearCooldown(accountId),
|
|
3773
|
-
onSetStrategy: (strategy) => void handleSetStrategy(strategy),
|
|
3774
|
-
showQuota: true,
|
|
3775
|
-
renderDetails: (account) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
3776
|
-
t.accountId,
|
|
3777
|
-
": ",
|
|
3778
|
-
account.projectId || "antigravity-default"
|
|
3779
|
-
] })
|
|
3780
|
-
}),
|
|
3781
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3782
|
-
className: "dsha-group",
|
|
3783
|
-
children: [
|
|
3784
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3785
|
-
className: "dsha-grouphead",
|
|
3786
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.modelsSection })
|
|
3787
|
-
}),
|
|
3788
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3789
|
-
className: "dsha-muted dsha-models-hint",
|
|
3790
|
-
children: t.modelsHint
|
|
3791
|
-
}),
|
|
3792
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelChecklist, {
|
|
3793
|
-
items: (status?.models ?? []).map((model) => ({
|
|
3794
|
-
id: model.id,
|
|
3795
|
-
name: model.name,
|
|
3796
|
-
hint: model.defaultContextWindow ? formatCapacity$1(model.defaultContextWindow) : void 0,
|
|
3797
|
-
enabled: model.enabled
|
|
3798
|
-
})),
|
|
3799
|
-
busy: busy !== null,
|
|
3800
|
-
onToggle: (id, enabled) => void toggleModel(id, enabled),
|
|
3801
|
-
onToggleAll: setAllModels,
|
|
3802
|
-
labels: {
|
|
3803
|
-
selectAll: t.selectAll,
|
|
3804
|
-
clearAll: t.unselectAll,
|
|
3805
|
-
list: t.modelsSection
|
|
3806
|
-
}
|
|
3807
|
-
})
|
|
3808
|
-
]
|
|
3809
|
-
}),
|
|
3810
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3811
|
-
className: "dsha-group",
|
|
3812
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3813
|
-
className: "dsha-grouphead",
|
|
3814
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.enhanced })
|
|
3815
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3816
|
-
className: "dsha-pref-row",
|
|
3817
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.defaultReasoningEffort }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3818
|
-
className: "dsha-muted",
|
|
3819
|
-
children: t.defaultReasoningEffortHint
|
|
3820
|
-
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
3821
|
-
className: "dsha-select",
|
|
3822
|
-
"aria-label": t.defaultReasoningEffort,
|
|
3823
|
-
value: status?.defaultReasoningEffort ?? "",
|
|
3824
|
-
disabled: busy !== null,
|
|
3825
|
-
onChange: (e) => {
|
|
3826
|
-
const val = e.currentTarget.value;
|
|
3827
|
-
handleUpdateEffort(val === "" ? null : val);
|
|
3828
|
-
},
|
|
3829
|
-
children: [
|
|
3830
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3831
|
-
value: "",
|
|
3832
|
-
children: t.defaultEffortAuto
|
|
3833
|
-
}),
|
|
3834
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3835
|
-
value: "low",
|
|
3836
|
-
children: "Low"
|
|
3837
|
-
}),
|
|
3838
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3839
|
-
value: "medium",
|
|
3840
|
-
children: "Medium"
|
|
3841
|
-
}),
|
|
3842
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3843
|
-
value: "high",
|
|
3844
|
-
children: "High"
|
|
3845
|
-
})
|
|
3846
|
-
]
|
|
3847
|
-
})]
|
|
3848
|
-
})]
|
|
3849
|
-
}),
|
|
3850
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3851
|
-
className: "dsha-group",
|
|
3852
|
-
children: [
|
|
3853
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3854
|
-
className: "dsha-grouphead",
|
|
3855
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.contextWindowSection })
|
|
3856
|
-
}),
|
|
3857
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3858
|
-
className: "dsha-muted",
|
|
3859
|
-
children: t.contextWindowHint
|
|
3860
|
-
}),
|
|
3861
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextWindowEditor, {
|
|
3862
|
-
rows: contextModels.map((model) => ({
|
|
3863
|
-
id: model.id,
|
|
3864
|
-
name: model.name,
|
|
3865
|
-
draft: contextDrafts[model.id] ?? "",
|
|
3866
|
-
hasOverride: status?.contextWindowOverrides[model.id] !== void 0,
|
|
3867
|
-
saving: savingModel === model.id
|
|
3868
|
-
})),
|
|
3869
|
-
labels: {
|
|
3870
|
-
tokens: t.tokens,
|
|
3871
|
-
save: t.save,
|
|
3872
|
-
saving: t.saving,
|
|
3873
|
-
reset: t.contextWindowReset,
|
|
3874
|
-
resetAll: t.contextWindowResetAll,
|
|
3875
|
-
empty: t.contextWindowNoneEnabled
|
|
3876
|
-
},
|
|
3877
|
-
busy: busy !== null,
|
|
3878
|
-
overrideCount,
|
|
3879
|
-
onDraftChange: (id, draft) => setContextDrafts((prev) => ({
|
|
3880
|
-
...prev,
|
|
3881
|
-
[id]: draft
|
|
3882
|
-
})),
|
|
3883
|
-
onCommit: (id) => void handleSaveContextWindow(id),
|
|
3884
|
-
onReset: (id) => void handleResetContextWindow(id),
|
|
3885
|
-
onResetAll: () => void handleResetAllContextWindows()
|
|
3886
|
-
})
|
|
3887
|
-
]
|
|
3888
|
-
}),
|
|
3889
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3890
|
-
className: "dsha-group",
|
|
3891
|
-
children: [
|
|
3892
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3893
|
-
className: "dsha-grouphead",
|
|
3894
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.cacheSection })
|
|
3895
|
-
}),
|
|
3896
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3897
|
-
className: "dsha-muted",
|
|
3898
|
-
children: t.cacheDesc
|
|
3899
|
-
}),
|
|
3900
|
-
status?.cache == null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3901
|
-
className: "dsha-empty",
|
|
3902
|
-
children: t.cacheEmpty
|
|
3903
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3904
|
-
className: "dsha-quota-card",
|
|
3905
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3906
|
-
className: "dsha-meter-wrap",
|
|
3907
|
-
children: [
|
|
3908
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3909
|
-
className: "dsha-meter-label",
|
|
3910
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t.cacheHitRatio }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: status.cache.hitRatio === null ? "—" : `${(status.cache.hitRatio * 100).toFixed(1)}%` })]
|
|
3911
|
-
}),
|
|
3912
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3913
|
-
className: `dsha-meter ${(status.cache.hitRatio ?? 0) >= .9 ? "dsha-meter-green" : "dsha-meter-cyan"}`,
|
|
3914
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { style: { width: `${Math.round((status.cache.hitRatio ?? 0) * 100)}%` } })
|
|
3915
|
-
}),
|
|
3916
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3917
|
-
className: "dsha-meter-meta",
|
|
3918
|
-
children: [
|
|
3919
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
3920
|
-
t.cacheCached,
|
|
3921
|
-
": ",
|
|
3922
|
-
status.cache.cachedTokens.toLocaleString()
|
|
3923
|
-
] }),
|
|
3924
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
3925
|
-
t.cacheFresh,
|
|
3926
|
-
": ",
|
|
3927
|
-
status.cache.freshTokens.toLocaleString()
|
|
3928
|
-
] }),
|
|
3929
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
3930
|
-
t.cacheRequests,
|
|
3931
|
-
": ",
|
|
3932
|
-
status.cache.requests
|
|
3933
|
-
] })
|
|
3934
|
-
]
|
|
3935
|
-
})
|
|
3936
|
-
]
|
|
3937
|
-
}), status.cache.lastMiss !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3938
|
-
className: "dsha-row",
|
|
3939
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3940
|
-
className: "dsha-label",
|
|
3941
|
-
children: t.cacheMiss
|
|
3942
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3943
|
-
className: "dsha-value",
|
|
3944
|
-
children: missLabel(status.cache.lastMiss.cause, t)
|
|
3945
|
-
})]
|
|
3946
|
-
}), status.cache.lastMiss.idleMs !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3947
|
-
className: "dsha-row",
|
|
3948
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3949
|
-
className: "dsha-label",
|
|
3950
|
-
children: t.cacheMissIdle
|
|
3951
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3952
|
-
className: "dsha-value",
|
|
3953
|
-
children: idleLabel(status.cache.lastMiss.idleMs)
|
|
3954
|
-
})]
|
|
3955
|
-
})] })]
|
|
3956
|
-
})
|
|
3957
|
-
]
|
|
3958
|
-
}),
|
|
3959
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3960
|
-
className: "dsha-group",
|
|
3961
|
-
children: [
|
|
3962
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3963
|
-
className: "dsha-grouphead",
|
|
3964
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.quotaSection }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3965
|
-
className: "dsha-btn",
|
|
3966
|
-
disabled: busy !== null || !status?.authenticated,
|
|
3967
|
-
onClick: handleRefreshQuota,
|
|
3968
|
-
children: busy === "quota" ? t.refreshingQuota : t.refreshQuota
|
|
3969
|
-
})]
|
|
3970
|
-
}),
|
|
3971
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3972
|
-
className: "dsha-muted",
|
|
3973
|
-
children: t.quotaDesc
|
|
3974
|
-
}),
|
|
3975
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3976
|
-
className: "dsha-muted",
|
|
3977
|
-
children: t.quotaFactsScope
|
|
3978
|
-
}),
|
|
3979
|
-
!status?.authenticated ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3980
|
-
className: "dsha-empty",
|
|
3981
|
-
children: t.signedOut
|
|
3982
|
-
}) : groups.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3983
|
-
className: "dsha-empty",
|
|
3984
|
-
children: busy === "quota" ? t.refreshingQuota : t.quotaEmpty
|
|
3985
|
-
}) : null,
|
|
3986
|
-
quota?.fetchedAt && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3987
|
-
className: "dsha-timestamp",
|
|
3988
|
-
children: ["更新时间: ", new Date(quota.fetchedAt).toLocaleString()]
|
|
3989
|
-
})
|
|
3990
|
-
]
|
|
3991
|
-
}),
|
|
3992
|
-
error && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3993
|
-
className: "dsha-error",
|
|
3994
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: error }), validationUrl && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3995
|
-
style: { marginTop: "8px" },
|
|
3996
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
3997
|
-
href: validationUrl,
|
|
3998
|
-
target: "_blank",
|
|
3999
|
-
rel: "noreferrer",
|
|
4000
|
-
className: "dsha-btn dsha-btn-primary",
|
|
4001
|
-
style: {
|
|
4002
|
-
display: "inline-block",
|
|
4003
|
-
textDecoration: "none",
|
|
4004
|
-
padding: "4px 10px",
|
|
4005
|
-
fontSize: "12px"
|
|
4006
|
-
},
|
|
4007
|
-
children: t.googleValidation
|
|
4008
|
-
})
|
|
4009
|
-
})]
|
|
4010
|
-
})
|
|
4011
|
-
]
|
|
4012
|
-
});
|
|
4013
|
-
}
|
|
4014
|
-
//#endregion
|
|
4015
|
-
//#region src/shared/command-code-contracts.ts
|
|
4016
|
-
/** Every level, in escalating order; the settings card renders exactly these. */
|
|
4017
|
-
const COMMAND_CODE_REASONING_EFFORTS = [
|
|
4018
|
-
"none",
|
|
4019
|
-
"minimal",
|
|
4020
|
-
"low",
|
|
4021
|
-
"medium",
|
|
4022
|
-
"high",
|
|
4023
|
-
"xhigh",
|
|
4024
|
-
"max"
|
|
4025
|
-
];
|
|
4026
|
-
//#endregion
|
|
4027
|
-
//#region src/client/command-code/locales.ts
|
|
4028
|
-
const NS_COMMAND_CODE = "dsh-command-code";
|
|
4029
|
-
const zh$14 = {
|
|
4030
|
-
...accountPoolZh,
|
|
4031
|
-
title: "Command Code",
|
|
4032
|
-
pageDesc: "登录 Command Code,管理可用模型、上下文窗口与额度。",
|
|
4033
|
-
account: "账号",
|
|
4034
|
-
signedIn: "已登录",
|
|
4035
|
-
signedOut: "未登录",
|
|
4036
|
-
keyName: "密钥名称",
|
|
4037
|
-
organization: "组织",
|
|
4038
|
-
plan: "套餐",
|
|
4039
|
-
planUnknown: "—",
|
|
4040
|
-
subscription: "订阅状态",
|
|
4041
|
-
renews: "续费于",
|
|
4042
|
-
authenticatedAt: "登录时间",
|
|
4043
|
-
signIn: "浏览器登录",
|
|
4044
|
-
signInAgain: "重新登录",
|
|
4045
|
-
signingIn: "登录中...",
|
|
4046
|
-
signOut: "注销",
|
|
4047
|
-
cancelSignIn: "取消登录",
|
|
4048
|
-
openSignInPage: "打开登录页面",
|
|
4049
|
-
apiKeySection: "手动填写 API Key",
|
|
4050
|
-
apiKeyHint: "在 Command Code Studio 创建 API Key 后粘贴到此处;浏览器登录不可用时使用。",
|
|
4051
|
-
apiKeyPlaceholder: "粘贴 Command Code API Key",
|
|
4052
|
-
apiKeySave: "保存并验证",
|
|
4053
|
-
apiKeySaving: "验证中...",
|
|
4054
|
-
apiKeySaved: "已保存",
|
|
4055
|
-
connection: "连接",
|
|
4056
|
-
testConnection: "测试连接",
|
|
4057
|
-
testingConnection: "测试中...",
|
|
4058
|
-
routeOwned: "模型路由由本插件提供",
|
|
4059
|
-
routeConflict: "模型路由已被其他 Provider 占用:{detail}。请在 DSH 设置中移除重复的 Provider 配置后重试。",
|
|
4060
|
-
modelsSection: "模型",
|
|
4061
|
-
modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;全部取消勾选或关闭概览卡片上的开关可在列表中隐藏该供应商。",
|
|
4062
|
-
refreshCatalog: "刷新模型目录",
|
|
4063
|
-
refreshingCatalog: "刷新中...",
|
|
4064
|
-
catalogStale: "目录来自缓存,可能过期;可手动刷新",
|
|
4065
|
-
catalogFresh: "目录已同步",
|
|
4066
|
-
zdrEnabled: "已请求零数据保留(ZDR);服务端无符合条件的路由时将拒绝请求,不自动降低隐私要求。",
|
|
4067
|
-
selectAll: "全选",
|
|
4068
|
-
unselectAll: "全不选",
|
|
4069
|
-
wireAnthropic: "Anthropic",
|
|
4070
|
-
wireOpenai: "OpenAI",
|
|
4071
|
-
wireResponses: "OpenAI Responses",
|
|
4072
|
-
enhanced: "增强功能",
|
|
4073
|
-
defaultReasoningEffort: "默认思考深度",
|
|
4074
|
-
defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。Anthropic 模型会映射为 thinking 预算。",
|
|
4075
|
-
defaultEffortAuto: "使用 Provider 默认值",
|
|
4076
|
-
contextWindowSection: "模型上下文窗口",
|
|
4077
|
-
contextWindowHint: "默认取 Command Code 模型目录的 context length;可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。",
|
|
4078
|
-
contextWindowReset: "恢复默认",
|
|
4079
|
-
contextWindowResetAll: "全部恢复默认",
|
|
4080
|
-
contextWindowResetAllConfirm: "确定把已改过的模型上下文窗口全部恢复为默认值吗?",
|
|
4081
|
-
contextWindowNoneEnabled: "还没有勾选任何模型。在上方勾选后,这里会出现该模型的上下文窗口设置。",
|
|
4082
|
-
save: "保存",
|
|
4083
|
-
saved: "已保存",
|
|
4084
|
-
saving: "保存中...",
|
|
4085
|
-
quotaSection: "用量与配额",
|
|
4086
|
-
quotaDesc: "数据来自 Command Code 账户接口,页面可见时最多每 60 秒刷新一次。",
|
|
4087
|
-
refreshQuota: "刷新用量",
|
|
4088
|
-
refreshingQuota: "刷新中...",
|
|
4089
|
-
quotaEmpty: "暂无配额数据,点击「刷新用量」重试。",
|
|
4090
|
-
quotaCredits: "剩余额度",
|
|
4091
|
-
quotaUnlimited: "不限量",
|
|
4092
|
-
updatedAt: "更新时间:{time}",
|
|
4093
|
-
loading: "加载中...",
|
|
4094
|
-
loginFailed: "登录失败",
|
|
4095
|
-
tokens: "tokens"
|
|
4096
|
-
};
|
|
4097
|
-
const en$14 = {
|
|
4098
|
-
...accountPoolEn,
|
|
4099
|
-
title: "Command Code",
|
|
4100
|
-
pageDesc: "Sign in to Command Code and manage models, context windows, and quota.",
|
|
4101
|
-
account: "Account",
|
|
4102
|
-
signedIn: "Signed in",
|
|
4103
|
-
signedOut: "Not signed in",
|
|
4104
|
-
keyName: "Key name",
|
|
4105
|
-
organization: "Organization",
|
|
4106
|
-
plan: "Plan",
|
|
4107
|
-
planUnknown: "—",
|
|
4108
|
-
subscription: "Subscription",
|
|
4109
|
-
renews: "renews",
|
|
4110
|
-
authenticatedAt: "Signed in at",
|
|
4111
|
-
signIn: "Sign in with browser",
|
|
4112
|
-
signInAgain: "Sign in again",
|
|
4113
|
-
signingIn: "Signing in...",
|
|
4114
|
-
signOut: "Sign out",
|
|
4115
|
-
cancelSignIn: "Cancel",
|
|
4116
|
-
openSignInPage: "Open the sign-in page",
|
|
4117
|
-
apiKeySection: "Paste an API key",
|
|
4118
|
-
apiKeyHint: "Create a key in Command Code Studio and paste it here; use this when the browser flow is unavailable.",
|
|
4119
|
-
apiKeyPlaceholder: "Command Code API key",
|
|
4120
|
-
apiKeySave: "Save and verify",
|
|
4121
|
-
apiKeySaving: "Verifying...",
|
|
4122
|
-
apiKeySaved: "Saved",
|
|
4123
|
-
connection: "Connection",
|
|
4124
|
-
testConnection: "Test connection",
|
|
4125
|
-
testingConnection: "Testing...",
|
|
4126
|
-
routeOwned: "This plugin serves the model route",
|
|
4127
|
-
routeConflict: "Another provider already owns the model route: {detail}. Remove the duplicate provider configuration in DSH settings and reload.",
|
|
4128
|
-
modelsSection: "Models",
|
|
4129
|
-
modelsHint: "Checked models appear in the DSH conversation model list; unchecking all or turning off the switch on the overview card hides this provider.",
|
|
4130
|
-
refreshCatalog: "Refresh catalog",
|
|
4131
|
-
refreshingCatalog: "Refreshing...",
|
|
4132
|
-
catalogStale: "Cached catalog may be stale; refresh to revalidate",
|
|
4133
|
-
catalogFresh: "Catalog synchronized",
|
|
4134
|
-
zdrEnabled: "Zero Data Retention requested; requests fail closed if no compliant route is available.",
|
|
4135
|
-
selectAll: "Select all",
|
|
4136
|
-
unselectAll: "Deselect all",
|
|
4137
|
-
wireAnthropic: "Anthropic",
|
|
4138
|
-
wireOpenai: "OpenAI",
|
|
4139
|
-
wireResponses: "OpenAI Responses",
|
|
4140
|
-
enhanced: "Enhanced features",
|
|
4141
|
-
defaultReasoningEffort: "Default reasoning effort",
|
|
4142
|
-
defaultReasoningEffortHint: "Reasoning effort for models that support it when the conversation does not specify one. Anthropic models map it to a thinking budget.",
|
|
4143
|
-
defaultEffortAuto: "Use provider default",
|
|
4144
|
-
contextWindowSection: "Model context window",
|
|
4145
|
-
contextWindowHint: "Defaults to the context length in the Command Code catalog; override it with the capacity DSH should use for compaction and overflow decisions (e.g., 1M, 512K, 200K).",
|
|
4146
|
-
contextWindowReset: "Restore default",
|
|
4147
|
-
contextWindowResetAll: "Restore all defaults",
|
|
4148
|
-
contextWindowResetAllConfirm: "Restore every changed model context window to its default?",
|
|
4149
|
-
contextWindowNoneEnabled: "No model is checked yet. Check one above and its context window setting appears here.",
|
|
4150
|
-
save: "Save",
|
|
4151
|
-
saved: "Saved",
|
|
4152
|
-
saving: "Saving...",
|
|
4153
|
-
quotaSection: "Usage & quota",
|
|
4154
|
-
quotaDesc: "Read from the Command Code account endpoints; refreshes at most once every 60 seconds while visible.",
|
|
4155
|
-
refreshQuota: "Refresh quota",
|
|
4156
|
-
refreshingQuota: "Refreshing...",
|
|
4157
|
-
quotaEmpty: "No quota data yet — use “Refresh quota” to retry.",
|
|
4158
|
-
quotaCredits: "Remaining credits",
|
|
4159
|
-
quotaUnlimited: "Unlimited",
|
|
4160
|
-
updatedAt: "Updated at: {time}",
|
|
4161
|
-
loading: "Loading...",
|
|
4162
|
-
loginFailed: "Sign-in failed",
|
|
4163
|
-
tokens: "tokens"
|
|
4164
|
-
};
|
|
4165
|
-
const dictionaries$14 = {
|
|
4166
|
-
zh: zh$14,
|
|
4167
|
-
"zh-CN": zh$14,
|
|
4168
|
-
en: en$14,
|
|
4169
|
-
"en-US": en$14
|
|
4170
|
-
};
|
|
4171
|
-
//#endregion
|
|
4172
|
-
//#region src/client/command-code/CommandCodeSection.tsx
|
|
4173
|
-
/**
|
|
4174
|
-
* Display label per reasoning level. The locale dictionary only accepts flat
|
|
4175
|
-
* string values, so this nested table lives with the control that renders it.
|
|
4176
|
-
*/
|
|
4177
|
-
const EFFORT_LABELS$3 = {
|
|
4178
|
-
none: "Off",
|
|
4179
|
-
minimal: "Minimal",
|
|
4180
|
-
low: "Low",
|
|
4181
|
-
medium: "Medium",
|
|
4182
|
-
high: "High",
|
|
4183
|
-
xhigh: "X-High",
|
|
4184
|
-
max: "Max"
|
|
4185
|
-
};
|
|
4186
|
-
const api$15 = createLineApi("/command-code/api", "Command Code");
|
|
4187
|
-
/**
|
|
4188
|
-
* Route name shown next to a model.
|
|
4189
|
-
*
|
|
4190
|
-
* The three routes are not interchangeable: the provider serves each model on
|
|
4191
|
-
* exactly one and rejects the others, so the label states which one this model
|
|
4192
|
-
* actually uses.
|
|
4193
|
-
*/
|
|
4194
|
-
function wireLabel$1(wire, t) {
|
|
4195
|
-
if (wire === "anthropic") return t.wireAnthropic;
|
|
4196
|
-
if (wire === "responses") return t.wireResponses;
|
|
4197
|
-
return t.wireOpenai;
|
|
4198
|
-
}
|
|
4199
|
-
function CommandCodeSection({ onModelChange, loadModelDirectory }) {
|
|
4200
|
-
const [status, setStatus] = (0, react.useState)(null);
|
|
4201
|
-
const [loading, setLoading] = (0, react.useState)(true);
|
|
4202
|
-
const [busy, setBusy] = (0, react.useState)(null);
|
|
4203
|
-
const [error, setError] = (0, react.useState)(null);
|
|
4204
|
-
const [loginProgress, setLoginProgress] = (0, react.useState)(null);
|
|
4205
|
-
const [contextDrafts, setContextDrafts] = (0, react.useState)({});
|
|
4206
|
-
const [savingModel, setSavingModel] = (0, react.useState)(null);
|
|
4207
|
-
const [apiKey, setApiKey] = (0, react.useState)("");
|
|
4208
|
-
/** Follow-up poll owed while the host refreshes the quota behind an answer. */
|
|
4209
|
-
const quotaFollowUp = (0, react.useRef)(null);
|
|
4210
|
-
const t = useLineDict(NS_COMMAND_CODE, zh$14);
|
|
4211
|
-
const notifyChange = (0, react.useCallback)(() => {
|
|
4212
|
-
onModelChange?.();
|
|
4213
|
-
loadModelDirectory?.();
|
|
4214
|
-
}, [onModelChange, loadModelDirectory]);
|
|
4215
|
-
const loadStatus = (0, react.useCallback)(async (quiet = false) => {
|
|
4216
|
-
if (!quiet) setError(null);
|
|
4217
|
-
try {
|
|
4218
|
-
const data = await api$15.request("/status");
|
|
4219
|
-
setStatus(data);
|
|
4220
|
-
setContextDrafts(contextDraftsFor(data));
|
|
4221
|
-
quotaFollowUp.current ??= createQuotaFollowUp();
|
|
4222
|
-
quotaFollowUp.current.observe(data.quotaRefreshing === true, () => {
|
|
4223
|
-
loadStatus(true);
|
|
4224
|
-
});
|
|
4225
|
-
} catch (err) {
|
|
4226
|
-
if (!quiet) setError(err instanceof Error ? err.message : String(err));
|
|
4227
|
-
} finally {
|
|
4228
|
-
setLoading(false);
|
|
4229
|
-
}
|
|
4230
|
-
}, []);
|
|
4231
|
-
(0, react.useEffect)(() => {
|
|
4232
|
-
loadStatus();
|
|
4233
|
-
const refreshWhenVisible = () => {
|
|
4234
|
-
if (document.visibilityState === "visible") loadStatus(true);
|
|
4235
|
-
};
|
|
4236
|
-
document.addEventListener("visibilitychange", refreshWhenVisible);
|
|
4237
|
-
const timer = window.setInterval(refreshWhenVisible, 6e4);
|
|
4238
|
-
return () => {
|
|
4239
|
-
window.clearInterval(timer);
|
|
4240
|
-
document.removeEventListener("visibilitychange", refreshWhenVisible);
|
|
4241
|
-
quotaFollowUp.current?.cancel();
|
|
4242
|
-
};
|
|
4243
|
-
}, [loadStatus]);
|
|
4244
|
-
const handleLogin = async () => {
|
|
4245
|
-
try {
|
|
4246
|
-
setBusy("login");
|
|
4247
|
-
setError(null);
|
|
4248
|
-
setLoginProgress(null);
|
|
4249
|
-
const flow = await api$15.request("/login", { method: "POST" });
|
|
3492
|
+
const flow = await api$14.request("/login", { method: "POST" });
|
|
4250
3493
|
if (flow.authUrl) window.open(flow.authUrl, "_blank");
|
|
4251
3494
|
const pollTimer = window.setInterval(() => {
|
|
4252
3495
|
(async () => {
|
|
4253
3496
|
try {
|
|
4254
|
-
const poll = await api$
|
|
3497
|
+
const poll = await api$14.request("/login/status");
|
|
4255
3498
|
if (poll.progress) setLoginProgress(poll.progress);
|
|
4256
3499
|
if (poll.status === "complete") {
|
|
4257
3500
|
window.clearInterval(pollTimer);
|
|
@@ -4283,7 +3526,7 @@ window.__ModuleLoader__.load({
|
|
|
4283
3526
|
try {
|
|
4284
3527
|
setBusy("apikey");
|
|
4285
3528
|
setError(null);
|
|
4286
|
-
const updated = await api$
|
|
3529
|
+
const updated = await api$14.request("/login/apikey", {
|
|
4287
3530
|
method: "POST",
|
|
4288
3531
|
body: JSON.stringify({ apiKey })
|
|
4289
3532
|
});
|
|
@@ -4301,7 +3544,7 @@ window.__ModuleLoader__.load({
|
|
|
4301
3544
|
try {
|
|
4302
3545
|
setBusy(`${action}-${accountId}`);
|
|
4303
3546
|
setError(null);
|
|
4304
|
-
const updated = await api$
|
|
3547
|
+
const updated = await api$14.request("/accounts", {
|
|
4305
3548
|
method: "POST",
|
|
4306
3549
|
body: JSON.stringify({
|
|
4307
3550
|
action,
|
|
@@ -4320,7 +3563,7 @@ window.__ModuleLoader__.load({
|
|
|
4320
3563
|
try {
|
|
4321
3564
|
setBusy("strategy");
|
|
4322
3565
|
setError(null);
|
|
4323
|
-
const updated = await api$
|
|
3566
|
+
const updated = await api$14.request("/accounts", {
|
|
4324
3567
|
method: "POST",
|
|
4325
3568
|
body: JSON.stringify({
|
|
4326
3569
|
action: "strategy",
|
|
@@ -4343,7 +3586,7 @@ window.__ModuleLoader__.load({
|
|
|
4343
3586
|
const handleRelogin = (accountId) => {
|
|
4344
3587
|
(async () => {
|
|
4345
3588
|
try {
|
|
4346
|
-
const updated = await api$
|
|
3589
|
+
const updated = await api$14.request("/accounts", {
|
|
4347
3590
|
method: "POST",
|
|
4348
3591
|
body: JSON.stringify({
|
|
4349
3592
|
action: "relogin",
|
|
@@ -4362,7 +3605,7 @@ window.__ModuleLoader__.load({
|
|
|
4362
3605
|
try {
|
|
4363
3606
|
setBusy("quota");
|
|
4364
3607
|
setError(null);
|
|
4365
|
-
const updated = await api$
|
|
3608
|
+
const updated = await api$14.request("/quota", { method: "POST" });
|
|
4366
3609
|
setStatus(updated);
|
|
4367
3610
|
} catch (err) {
|
|
4368
3611
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4374,7 +3617,7 @@ window.__ModuleLoader__.load({
|
|
|
4374
3617
|
try {
|
|
4375
3618
|
setBusy("catalog");
|
|
4376
3619
|
setError(null);
|
|
4377
|
-
const updated = await api$
|
|
3620
|
+
const updated = await api$14.request("/catalog/refresh", { method: "POST" });
|
|
4378
3621
|
setStatus(updated);
|
|
4379
3622
|
setContextDrafts(contextDraftsFor(updated));
|
|
4380
3623
|
notifyChange();
|
|
@@ -4388,7 +3631,7 @@ window.__ModuleLoader__.load({
|
|
|
4388
3631
|
try {
|
|
4389
3632
|
setBusy("connection");
|
|
4390
3633
|
setError(null);
|
|
4391
|
-
await api$
|
|
3634
|
+
await api$14.post("/connection/test");
|
|
4392
3635
|
await loadStatus(true);
|
|
4393
3636
|
} catch (err) {
|
|
4394
3637
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4398,7 +3641,7 @@ window.__ModuleLoader__.load({
|
|
|
4398
3641
|
};
|
|
4399
3642
|
const applyEnabled = async (enabledModelIds) => {
|
|
4400
3643
|
try {
|
|
4401
|
-
const updated = await api$
|
|
3644
|
+
const updated = await api$14.request("/models", {
|
|
4402
3645
|
method: "POST",
|
|
4403
3646
|
body: JSON.stringify({ enabledModelIds })
|
|
4404
3647
|
});
|
|
@@ -4421,7 +3664,7 @@ window.__ModuleLoader__.load({
|
|
|
4421
3664
|
};
|
|
4422
3665
|
const handleUpdateEffort = async (effort) => {
|
|
4423
3666
|
try {
|
|
4424
|
-
const updated = await api$
|
|
3667
|
+
const updated = await api$14.request("/settings", {
|
|
4425
3668
|
method: "POST",
|
|
4426
3669
|
body: JSON.stringify({ defaultReasoningEffort: effort })
|
|
4427
3670
|
});
|
|
@@ -4441,7 +3684,7 @@ window.__ModuleLoader__.load({
|
|
|
4441
3684
|
try {
|
|
4442
3685
|
setSavingModel(modelId);
|
|
4443
3686
|
setError(null);
|
|
4444
|
-
const updated = await api$
|
|
3687
|
+
const updated = await api$14.request("/settings", {
|
|
4445
3688
|
method: "POST",
|
|
4446
3689
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
|
|
4447
3690
|
});
|
|
@@ -4462,7 +3705,7 @@ window.__ModuleLoader__.load({
|
|
|
4462
3705
|
try {
|
|
4463
3706
|
setSavingModel(modelId);
|
|
4464
3707
|
setError(null);
|
|
4465
|
-
const updated = await api$
|
|
3708
|
+
const updated = await api$14.request("/settings", {
|
|
4466
3709
|
method: "POST",
|
|
4467
3710
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
|
|
4468
3711
|
});
|
|
@@ -4489,7 +3732,7 @@ window.__ModuleLoader__.load({
|
|
|
4489
3732
|
try {
|
|
4490
3733
|
setBusy("context");
|
|
4491
3734
|
setError(null);
|
|
4492
|
-
const updated = await api$
|
|
3735
|
+
const updated = await api$14.request("/settings", {
|
|
4493
3736
|
method: "POST",
|
|
4494
3737
|
body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
|
|
4495
3738
|
});
|
|
@@ -5860,7 +5103,7 @@ window.__ModuleLoader__.load({
|
|
|
5860
5103
|
}
|
|
5861
5104
|
//#endregion
|
|
5862
5105
|
//#region src/client/kimi-code/KimiCodeSection.tsx
|
|
5863
|
-
const api$
|
|
5106
|
+
const api$13 = createLineApi("/kimi-code/api", "Kimi Code");
|
|
5864
5107
|
/**
|
|
5865
5108
|
* One token count as the card prints it.
|
|
5866
5109
|
*
|
|
@@ -5996,7 +5239,7 @@ window.__ModuleLoader__.load({
|
|
|
5996
5239
|
const generation = ++statusGeneration.current;
|
|
5997
5240
|
if (!quiet) setError(null);
|
|
5998
5241
|
try {
|
|
5999
|
-
const data = await api$
|
|
5242
|
+
const data = await api$13.request("/status");
|
|
6000
5243
|
if (generation !== statusGeneration.current) return;
|
|
6001
5244
|
setStatus(data);
|
|
6002
5245
|
setContextDrafts(contextDraftsFor(data));
|
|
@@ -6038,7 +5281,7 @@ window.__ModuleLoader__.load({
|
|
|
6038
5281
|
const timer = window.setInterval(() => {
|
|
6039
5282
|
(async () => {
|
|
6040
5283
|
try {
|
|
6041
|
-
const poll = await api$
|
|
5284
|
+
const poll = await api$13.request("/login/status");
|
|
6042
5285
|
setFlow(poll);
|
|
6043
5286
|
if (poll.status === "complete") {
|
|
6044
5287
|
await loadStatus();
|
|
@@ -6060,7 +5303,7 @@ window.__ModuleLoader__.load({
|
|
|
6060
5303
|
setBusy("login");
|
|
6061
5304
|
setError(null);
|
|
6062
5305
|
setCopied(false);
|
|
6063
|
-
const next = await api$
|
|
5306
|
+
const next = await api$13.request("/login", {
|
|
6064
5307
|
method: "POST",
|
|
6065
5308
|
body: JSON.stringify(accountId === void 0 ? {} : { accountId })
|
|
6066
5309
|
});
|
|
@@ -6073,7 +5316,7 @@ window.__ModuleLoader__.load({
|
|
|
6073
5316
|
};
|
|
6074
5317
|
const handleCancelLogin = async () => {
|
|
6075
5318
|
try {
|
|
6076
|
-
await api$
|
|
5319
|
+
await api$13.request("/login/cancel", { method: "POST" });
|
|
6077
5320
|
setFlow({ status: "idle" });
|
|
6078
5321
|
} catch (err) {
|
|
6079
5322
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -6093,7 +5336,7 @@ window.__ModuleLoader__.load({
|
|
|
6093
5336
|
try {
|
|
6094
5337
|
setBusy(`${action}-${accountId}`);
|
|
6095
5338
|
setError(null);
|
|
6096
|
-
const updated = await api$
|
|
5339
|
+
const updated = await api$13.request("/accounts", {
|
|
6097
5340
|
method: "POST",
|
|
6098
5341
|
body: JSON.stringify({
|
|
6099
5342
|
action,
|
|
@@ -6113,7 +5356,7 @@ window.__ModuleLoader__.load({
|
|
|
6113
5356
|
try {
|
|
6114
5357
|
setBusy("strategy");
|
|
6115
5358
|
setError(null);
|
|
6116
|
-
const updated = await api$
|
|
5359
|
+
const updated = await api$13.request("/accounts", {
|
|
6117
5360
|
method: "POST",
|
|
6118
5361
|
body: JSON.stringify({
|
|
6119
5362
|
action: "strategy",
|
|
@@ -6136,7 +5379,7 @@ window.__ModuleLoader__.load({
|
|
|
6136
5379
|
const handleRelogin = (accountId) => {
|
|
6137
5380
|
(async () => {
|
|
6138
5381
|
try {
|
|
6139
|
-
const updated = await api$
|
|
5382
|
+
const updated = await api$13.request("/accounts", {
|
|
6140
5383
|
method: "POST",
|
|
6141
5384
|
body: JSON.stringify({
|
|
6142
5385
|
action: "relogin",
|
|
@@ -6155,7 +5398,7 @@ window.__ModuleLoader__.load({
|
|
|
6155
5398
|
try {
|
|
6156
5399
|
setBusy("quota");
|
|
6157
5400
|
setError(null);
|
|
6158
|
-
const updated = await api$
|
|
5401
|
+
const updated = await api$13.request("/quota", { method: "POST" });
|
|
6159
5402
|
applyStatus(updated);
|
|
6160
5403
|
} catch (err) {
|
|
6161
5404
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -6168,7 +5411,7 @@ window.__ModuleLoader__.load({
|
|
|
6168
5411
|
try {
|
|
6169
5412
|
setBusy("catalog");
|
|
6170
5413
|
setError(null);
|
|
6171
|
-
const updated = await api$
|
|
5414
|
+
const updated = await api$13.request("/catalog/refresh", { method: "POST" });
|
|
6172
5415
|
applyStatus(updated);
|
|
6173
5416
|
setContextDrafts(contextDraftsFor(updated));
|
|
6174
5417
|
notifyChange();
|
|
@@ -6183,7 +5426,7 @@ window.__ModuleLoader__.load({
|
|
|
6183
5426
|
setBusy("connection");
|
|
6184
5427
|
setError(null);
|
|
6185
5428
|
setConnectionNotice(null);
|
|
6186
|
-
const result = await api$
|
|
5429
|
+
const result = await api$13.request("/connection/test", { method: "POST" });
|
|
6187
5430
|
setConnectionNotice(result.connected ? `${t.testSuccess} · ${result.latencyMs} ms` : t.testFailed);
|
|
6188
5431
|
await loadStatus(true);
|
|
6189
5432
|
} catch (err) {
|
|
@@ -6194,7 +5437,7 @@ window.__ModuleLoader__.load({
|
|
|
6194
5437
|
};
|
|
6195
5438
|
const applyEnabled = async (enabledModelIds) => {
|
|
6196
5439
|
try {
|
|
6197
|
-
const updated = await api$
|
|
5440
|
+
const updated = await api$13.request("/models", {
|
|
6198
5441
|
method: "POST",
|
|
6199
5442
|
body: JSON.stringify({ enabledModelIds })
|
|
6200
5443
|
});
|
|
@@ -6217,7 +5460,7 @@ window.__ModuleLoader__.load({
|
|
|
6217
5460
|
};
|
|
6218
5461
|
const handleUpdateEffort = async (effort) => {
|
|
6219
5462
|
try {
|
|
6220
|
-
const updated = await api$
|
|
5463
|
+
const updated = await api$13.request("/settings", {
|
|
6221
5464
|
method: "POST",
|
|
6222
5465
|
body: JSON.stringify({ defaultReasoningEffort: effort })
|
|
6223
5466
|
});
|
|
@@ -6237,7 +5480,7 @@ window.__ModuleLoader__.load({
|
|
|
6237
5480
|
try {
|
|
6238
5481
|
setSavingModel(modelId);
|
|
6239
5482
|
setError(null);
|
|
6240
|
-
const updated = await api$
|
|
5483
|
+
const updated = await api$13.request("/settings", {
|
|
6241
5484
|
method: "POST",
|
|
6242
5485
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
|
|
6243
5486
|
});
|
|
@@ -6258,7 +5501,7 @@ window.__ModuleLoader__.load({
|
|
|
6258
5501
|
try {
|
|
6259
5502
|
setSavingModel(modelId);
|
|
6260
5503
|
setError(null);
|
|
6261
|
-
const updated = await api$
|
|
5504
|
+
const updated = await api$13.request("/settings", {
|
|
6262
5505
|
method: "POST",
|
|
6263
5506
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
|
|
6264
5507
|
});
|
|
@@ -6285,7 +5528,7 @@ window.__ModuleLoader__.load({
|
|
|
6285
5528
|
try {
|
|
6286
5529
|
setBusy("context");
|
|
6287
5530
|
setError(null);
|
|
6288
|
-
const updated = await api$
|
|
5531
|
+
const updated = await api$13.request("/settings", {
|
|
6289
5532
|
method: "POST",
|
|
6290
5533
|
body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
|
|
6291
5534
|
});
|
|
@@ -6765,10 +6008,10 @@ window.__ModuleLoader__.load({
|
|
|
6765
6008
|
* The names stay as they were so the hook that consumes them does not have to
|
|
6766
6009
|
* change with the reader.
|
|
6767
6010
|
*/
|
|
6768
|
-
const api$
|
|
6769
|
-
api$
|
|
6770
|
-
const get$3 = api$
|
|
6771
|
-
const post$4 = api$
|
|
6011
|
+
const api$12 = createLineApi(MINIMAX_CODE_ROUTE_PREFIX, "MiniMax Code");
|
|
6012
|
+
api$12.request;
|
|
6013
|
+
const get$3 = api$12.get;
|
|
6014
|
+
const post$4 = api$12.post;
|
|
6772
6015
|
function messageOf$3(cause) {
|
|
6773
6016
|
return cause instanceof Error ? cause.message : String(cause);
|
|
6774
6017
|
}
|
|
@@ -9518,9 +8761,9 @@ window.__ModuleLoader__.load({
|
|
|
9518
8761
|
* 除 adopt 与 connection/test 外,全部走共享的 { ok, value } 信封,
|
|
9519
8762
|
* 因此答案都是裸 DTO——createLineApi 已经把信封拆掉了。
|
|
9520
8763
|
*/
|
|
9521
|
-
const api$
|
|
9522
|
-
const get$2 = api$
|
|
9523
|
-
const post$3 = api$
|
|
8764
|
+
const api$11 = createLineApi(GLM_CODING_PLAN_ROUTE_PREFIX, GLM_CODING_PLAN_PROVIDER_NAME);
|
|
8765
|
+
const get$2 = api$11.get;
|
|
8766
|
+
const post$3 = api$11.post;
|
|
9524
8767
|
function messageOf$2(cause) {
|
|
9525
8768
|
return cause instanceof Error ? cause.message : String(cause);
|
|
9526
8769
|
}
|
|
@@ -10682,7 +9925,7 @@ window.__ModuleLoader__.load({
|
|
|
10682
9925
|
* `ClaudeSectionView` — so the contract between the two is visible here rather
|
|
10683
9926
|
* than inferred from a thousand lines of JSX.
|
|
10684
9927
|
*/
|
|
10685
|
-
const api$
|
|
9928
|
+
const api$10 = createLineApi("/claude/api", "Claude");
|
|
10686
9929
|
/**
|
|
10687
9930
|
* The poll cadence of a pending sign-in.
|
|
10688
9931
|
*
|
|
@@ -10715,7 +9958,7 @@ window.__ModuleLoader__.load({
|
|
|
10715
9958
|
const loadStatus = (0, react.useCallback)(async (quiet = false) => {
|
|
10716
9959
|
if (!quiet) setError(null);
|
|
10717
9960
|
try {
|
|
10718
|
-
const data = await api$
|
|
9961
|
+
const data = await api$10.request("/status");
|
|
10719
9962
|
setStatus(data);
|
|
10720
9963
|
setContextDrafts(contextDraftsFor(data));
|
|
10721
9964
|
quotaFollowUp.current ??= createQuotaFollowUp();
|
|
@@ -10746,7 +9989,7 @@ window.__ModuleLoader__.load({
|
|
|
10746
9989
|
const timer = window.setInterval(() => {
|
|
10747
9990
|
(async () => {
|
|
10748
9991
|
try {
|
|
10749
|
-
const poll = await api$
|
|
9992
|
+
const poll = await api$10.request("/login/status");
|
|
10750
9993
|
setFlow(poll);
|
|
10751
9994
|
if (poll.status === "complete") {
|
|
10752
9995
|
setPasteValue("");
|
|
@@ -10768,7 +10011,7 @@ window.__ModuleLoader__.load({
|
|
|
10768
10011
|
setBusy("login");
|
|
10769
10012
|
setError(null);
|
|
10770
10013
|
setPasteValue("");
|
|
10771
|
-
const next = await api$
|
|
10014
|
+
const next = await api$10.request("/login", {
|
|
10772
10015
|
method: "POST",
|
|
10773
10016
|
body: JSON.stringify({})
|
|
10774
10017
|
});
|
|
@@ -10782,7 +10025,7 @@ window.__ModuleLoader__.load({
|
|
|
10782
10025
|
};
|
|
10783
10026
|
const cancelLogin = async () => {
|
|
10784
10027
|
try {
|
|
10785
|
-
const next = await api$
|
|
10028
|
+
const next = await api$10.request("/login/cancel", { method: "POST" });
|
|
10786
10029
|
setFlow(next);
|
|
10787
10030
|
} catch (err) {
|
|
10788
10031
|
reportError(err);
|
|
@@ -10794,7 +10037,7 @@ window.__ModuleLoader__.load({
|
|
|
10794
10037
|
try {
|
|
10795
10038
|
setBusy("login-input");
|
|
10796
10039
|
setError(null);
|
|
10797
|
-
const updated = await api$
|
|
10040
|
+
const updated = await api$10.request("/login/input", {
|
|
10798
10041
|
method: "POST",
|
|
10799
10042
|
body: JSON.stringify({ input: pasteValue })
|
|
10800
10043
|
});
|
|
@@ -10818,7 +10061,7 @@ window.__ModuleLoader__.load({
|
|
|
10818
10061
|
try {
|
|
10819
10062
|
setBusy("adopt");
|
|
10820
10063
|
setError(null);
|
|
10821
|
-
const updated = await api$
|
|
10064
|
+
const updated = await api$10.request("/adopt", { method: "POST" });
|
|
10822
10065
|
setStatus(updated);
|
|
10823
10066
|
setContextDrafts(contextDraftsFor(updated));
|
|
10824
10067
|
notifyChange();
|
|
@@ -10833,7 +10076,7 @@ window.__ModuleLoader__.load({
|
|
|
10833
10076
|
try {
|
|
10834
10077
|
setBusy(accountId === void 0 ? "adopt-disable" : `adopt-disable-${accountId}`);
|
|
10835
10078
|
setError(null);
|
|
10836
|
-
const updated = await api$
|
|
10079
|
+
const updated = await api$10.request("/adopt/disable", {
|
|
10837
10080
|
method: "POST",
|
|
10838
10081
|
body: JSON.stringify(accountId === void 0 ? {} : { accountId })
|
|
10839
10082
|
});
|
|
@@ -10850,7 +10093,7 @@ window.__ModuleLoader__.load({
|
|
|
10850
10093
|
try {
|
|
10851
10094
|
setBusy(`${action}-${accountId}`);
|
|
10852
10095
|
setError(null);
|
|
10853
|
-
const updated = await api$
|
|
10096
|
+
const updated = await api$10.request("/accounts", {
|
|
10854
10097
|
method: "POST",
|
|
10855
10098
|
body: JSON.stringify({
|
|
10856
10099
|
action,
|
|
@@ -10869,7 +10112,7 @@ window.__ModuleLoader__.load({
|
|
|
10869
10112
|
try {
|
|
10870
10113
|
setBusy("strategy");
|
|
10871
10114
|
setError(null);
|
|
10872
|
-
const updated = await api$
|
|
10115
|
+
const updated = await api$10.request("/accounts", {
|
|
10873
10116
|
method: "POST",
|
|
10874
10117
|
body: JSON.stringify({
|
|
10875
10118
|
action: "strategy",
|
|
@@ -10896,7 +10139,7 @@ window.__ModuleLoader__.load({
|
|
|
10896
10139
|
setBusy(`relogin-${accountId}`);
|
|
10897
10140
|
setError(null);
|
|
10898
10141
|
setPasteValue("");
|
|
10899
|
-
const next = await api$
|
|
10142
|
+
const next = await api$10.request("/login", {
|
|
10900
10143
|
method: "POST",
|
|
10901
10144
|
body: JSON.stringify({ accountId })
|
|
10902
10145
|
});
|
|
@@ -10913,7 +10156,7 @@ window.__ModuleLoader__.load({
|
|
|
10913
10156
|
try {
|
|
10914
10157
|
setBusy("quota");
|
|
10915
10158
|
setError(null);
|
|
10916
|
-
const updated = await api$
|
|
10159
|
+
const updated = await api$10.request("/quota", { method: "POST" });
|
|
10917
10160
|
setStatus(updated);
|
|
10918
10161
|
} catch (err) {
|
|
10919
10162
|
reportError(err);
|
|
@@ -10926,7 +10169,7 @@ window.__ModuleLoader__.load({
|
|
|
10926
10169
|
try {
|
|
10927
10170
|
setBusy("catalog");
|
|
10928
10171
|
setError(null);
|
|
10929
|
-
const updated = await api$
|
|
10172
|
+
const updated = await api$10.request("/catalog/refresh", { method: "POST" });
|
|
10930
10173
|
setStatus(updated);
|
|
10931
10174
|
setContextDrafts(contextDraftsFor(updated));
|
|
10932
10175
|
notifyChange();
|
|
@@ -10941,7 +10184,7 @@ window.__ModuleLoader__.load({
|
|
|
10941
10184
|
setBusy("connection");
|
|
10942
10185
|
setError(null);
|
|
10943
10186
|
setConnection(null);
|
|
10944
|
-
const result = await api$
|
|
10187
|
+
const result = await api$10.request("/connection/test", { method: "POST" });
|
|
10945
10188
|
setConnection(result);
|
|
10946
10189
|
await loadStatus(true);
|
|
10947
10190
|
} catch (err) {
|
|
@@ -10952,7 +10195,7 @@ window.__ModuleLoader__.load({
|
|
|
10952
10195
|
};
|
|
10953
10196
|
const applyEnabled = async (enabledModelIds) => {
|
|
10954
10197
|
try {
|
|
10955
|
-
const updated = await api$
|
|
10198
|
+
const updated = await api$10.request("/models", {
|
|
10956
10199
|
method: "POST",
|
|
10957
10200
|
body: JSON.stringify({ enabledModelIds })
|
|
10958
10201
|
});
|
|
@@ -10975,7 +10218,7 @@ window.__ModuleLoader__.load({
|
|
|
10975
10218
|
};
|
|
10976
10219
|
const updateEffort = async (effort) => {
|
|
10977
10220
|
try {
|
|
10978
|
-
const updated = await api$
|
|
10221
|
+
const updated = await api$10.request("/settings", {
|
|
10979
10222
|
method: "POST",
|
|
10980
10223
|
body: JSON.stringify({ defaultReasoningEffort: effort })
|
|
10981
10224
|
});
|
|
@@ -10987,7 +10230,7 @@ window.__ModuleLoader__.load({
|
|
|
10987
10230
|
};
|
|
10988
10231
|
const updateCacheTtl = async (ttl) => {
|
|
10989
10232
|
try {
|
|
10990
|
-
const updated = await api$
|
|
10233
|
+
const updated = await api$10.request("/settings", {
|
|
10991
10234
|
method: "POST",
|
|
10992
10235
|
body: JSON.stringify({ cacheTtl: ttl })
|
|
10993
10236
|
});
|
|
@@ -11007,7 +10250,7 @@ window.__ModuleLoader__.load({
|
|
|
11007
10250
|
try {
|
|
11008
10251
|
setSavingModel(modelId);
|
|
11009
10252
|
setError(null);
|
|
11010
|
-
const updated = await api$
|
|
10253
|
+
const updated = await api$10.request("/settings", {
|
|
11011
10254
|
method: "POST",
|
|
11012
10255
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
|
|
11013
10256
|
});
|
|
@@ -11034,7 +10277,7 @@ window.__ModuleLoader__.load({
|
|
|
11034
10277
|
try {
|
|
11035
10278
|
setSavingModel(modelId);
|
|
11036
10279
|
setError(null);
|
|
11037
|
-
const updated = await api$
|
|
10280
|
+
const updated = await api$10.request("/settings", {
|
|
11038
10281
|
method: "POST",
|
|
11039
10282
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
|
|
11040
10283
|
});
|
|
@@ -11061,7 +10304,7 @@ window.__ModuleLoader__.load({
|
|
|
11061
10304
|
try {
|
|
11062
10305
|
setBusy("context");
|
|
11063
10306
|
setError(null);
|
|
11064
|
-
const updated = await api$
|
|
10307
|
+
const updated = await api$10.request("/settings", {
|
|
11065
10308
|
method: "POST",
|
|
11066
10309
|
body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
|
|
11067
10310
|
});
|
|
@@ -12669,9 +11912,9 @@ window.__ModuleLoader__.load({
|
|
|
12669
11912
|
* **仅有的两处**带秘密的形状,它们只在这两个函数调用点的字面量里出现,
|
|
12670
11913
|
* 既不进 URL、也不进日志,卡片那边同样没有别的地方可以读到它们。
|
|
12671
11914
|
*/
|
|
12672
|
-
const api$
|
|
12673
|
-
const get$1 = api$
|
|
12674
|
-
const post$1 = api$
|
|
11915
|
+
const api$9 = createLineApi(STEP_CODE_ROUTE_PREFIX, STEP_CODE_PROVIDER_NAME);
|
|
11916
|
+
const get$1 = api$9.get;
|
|
11917
|
+
const post$1 = api$9.post;
|
|
12675
11918
|
function messageOf$1(cause) {
|
|
12676
11919
|
return cause instanceof Error ? cause.message : String(cause);
|
|
12677
11920
|
}
|
|
@@ -14170,7 +13413,7 @@ window.__ModuleLoader__.load({
|
|
|
14170
13413
|
}
|
|
14171
13414
|
//#endregion
|
|
14172
13415
|
//#region src/client/cline-pass/api.ts
|
|
14173
|
-
const api$
|
|
13416
|
+
const api$8 = createLineApi(CLINE_PASS_ROUTE_PREFIX, "Cline Pass");
|
|
14174
13417
|
/**
|
|
14175
13418
|
* Whether the host is refreshing the quota behind this answer.
|
|
14176
13419
|
*
|
|
@@ -14201,62 +13444,62 @@ window.__ModuleLoader__.load({
|
|
|
14201
13444
|
* raw quota payload.
|
|
14202
13445
|
*/
|
|
14203
13446
|
status(refresh = false) {
|
|
14204
|
-
if (!refresh) return api$
|
|
14205
|
-
return api$
|
|
13447
|
+
if (!refresh) return api$8.get("/status");
|
|
13448
|
+
return api$8.post("/usage", {}).then((outcome) => outcome.status);
|
|
14206
13449
|
}
|
|
14207
13450
|
updateSettings(patch) {
|
|
14208
|
-
return api$
|
|
13451
|
+
return api$8.post("/settings", patch).then(() => this.status());
|
|
14209
13452
|
}
|
|
14210
13453
|
accountAction(action, body = {}) {
|
|
14211
|
-
return api$
|
|
13454
|
+
return api$8.post("/accounts", {
|
|
14212
13455
|
action,
|
|
14213
13456
|
...body
|
|
14214
13457
|
});
|
|
14215
13458
|
}
|
|
14216
13459
|
/** Verify a key without storing it; the host answers the verdict directly. */
|
|
14217
13460
|
testKey(body) {
|
|
14218
|
-
return api$
|
|
13461
|
+
return api$8.post("/accounts", {
|
|
14219
13462
|
action: "test",
|
|
14220
13463
|
...body
|
|
14221
13464
|
});
|
|
14222
13465
|
}
|
|
14223
13466
|
/** Start the Cline device-code sign-in. */
|
|
14224
13467
|
startLogin() {
|
|
14225
|
-
return api$
|
|
13468
|
+
return api$8.post("/login/start", {});
|
|
14226
13469
|
}
|
|
14227
13470
|
/** One poll of the pending sign-in; the host throttles it to WorkOS's interval. */
|
|
14228
13471
|
loginStatus(id) {
|
|
14229
|
-
return api$
|
|
13472
|
+
return api$8.get(`/login/status?id=${encodeURIComponent(id)}`);
|
|
14230
13473
|
}
|
|
14231
13474
|
cancelLogin(id) {
|
|
14232
|
-
return api$
|
|
13475
|
+
return api$8.post("/login/cancel", { id });
|
|
14233
13476
|
}
|
|
14234
13477
|
setEnabledModels(enabledModelIds) {
|
|
14235
|
-
return api$
|
|
13478
|
+
return api$8.post("/models", { enabledModelIds });
|
|
14236
13479
|
}
|
|
14237
13480
|
setContextWindow(model, contextWindow) {
|
|
14238
|
-
return api$
|
|
13481
|
+
return api$8.post("/models/context-window", {
|
|
14239
13482
|
model,
|
|
14240
13483
|
contextWindow
|
|
14241
13484
|
});
|
|
14242
13485
|
}
|
|
14243
13486
|
test(model) {
|
|
14244
|
-
return api$
|
|
13487
|
+
return api$8.post("/models/test", { model });
|
|
14245
13488
|
}
|
|
14246
13489
|
setVisibility(model, visible) {
|
|
14247
|
-
return api$
|
|
13490
|
+
return api$8.post("/models/visibility", {
|
|
14248
13491
|
model,
|
|
14249
13492
|
visible
|
|
14250
13493
|
});
|
|
14251
13494
|
}
|
|
14252
13495
|
setVisibilityAll(mode) {
|
|
14253
|
-
return api$
|
|
13496
|
+
return api$8.post("/models/visibility-all", { mode });
|
|
14254
13497
|
}
|
|
14255
13498
|
refreshCatalog() {
|
|
14256
|
-
return api$
|
|
13499
|
+
return api$8.post("/catalog/refresh", {});
|
|
14257
13500
|
}
|
|
14258
13501
|
searchCatalog(query) {
|
|
14259
|
-
return api$
|
|
13502
|
+
return api$8.get("/catalog/search?q=" + encodeURIComponent(query));
|
|
14260
13503
|
}
|
|
14261
13504
|
/**
|
|
14262
13505
|
* Add one search hit.
|
|
@@ -14265,20 +13508,20 @@ window.__ModuleLoader__.load({
|
|
|
14265
13508
|
* refuses it until the caller acknowledges that (`acknowledgeBilling`).
|
|
14266
13509
|
*/
|
|
14267
13510
|
addCatalogModel(model, acknowledgeBilling = false) {
|
|
14268
|
-
return api$
|
|
13511
|
+
return api$8.post("/catalog/add", acknowledgeBilling ? {
|
|
14269
13512
|
model,
|
|
14270
13513
|
acknowledgeBilling: true
|
|
14271
13514
|
} : { model });
|
|
14272
13515
|
}
|
|
14273
13516
|
readUsage() {
|
|
14274
|
-
return api$
|
|
13517
|
+
return api$8.post("/usage", {});
|
|
14275
13518
|
}
|
|
14276
13519
|
history(limit = 25, model = "") {
|
|
14277
13520
|
const query = new URLSearchParams({
|
|
14278
13521
|
limit: String(limit),
|
|
14279
13522
|
...model === "" ? {} : { model }
|
|
14280
13523
|
});
|
|
14281
|
-
return api$
|
|
13524
|
+
return api$8.get("/history?" + query.toString());
|
|
14282
13525
|
}
|
|
14283
13526
|
};
|
|
14284
13527
|
//#endregion
|
|
@@ -15950,9 +15193,9 @@ window.__ModuleLoader__.load({
|
|
|
15950
15193
|
* 凭据边界也写在这里:/login/manual 的请求体是本文件里**唯一**带秘密的形状,
|
|
15951
15194
|
* 它只在这个函数调用点的字面量里出现,既不进 URL、也不进日志。
|
|
15952
15195
|
*/
|
|
15953
|
-
const api$
|
|
15954
|
-
const get = api$
|
|
15955
|
-
const post = api$
|
|
15196
|
+
const api$7 = createLineApi(QODER_ROUTE_PREFIX, QODER_PROVIDER_NAME);
|
|
15197
|
+
const get = api$7.get;
|
|
15198
|
+
const post = api$7.post;
|
|
15956
15199
|
function messageOf(cause) {
|
|
15957
15200
|
return cause instanceof Error ? cause.message : String(cause);
|
|
15958
15201
|
}
|
|
@@ -17076,7 +16319,7 @@ window.__ModuleLoader__.load({
|
|
|
17076
16319
|
const OPENDESIGN_ROUTE_PREFIX = "/opendesign/api";
|
|
17077
16320
|
//#endregion
|
|
17078
16321
|
//#region src/client/opendesign/api.ts
|
|
17079
|
-
const api$
|
|
16322
|
+
const api$6 = createLineApi(OPENDESIGN_ROUTE_PREFIX, "OpenDesign");
|
|
17080
16323
|
/**
|
|
17081
16324
|
* The OpenDesign settings API, as the card uses it.
|
|
17082
16325
|
*
|
|
@@ -17085,59 +16328,59 @@ window.__ModuleLoader__.load({
|
|
|
17085
16328
|
*/
|
|
17086
16329
|
var OpenDesignApi = class {
|
|
17087
16330
|
status() {
|
|
17088
|
-
return api$
|
|
16331
|
+
return api$6.get("/status");
|
|
17089
16332
|
}
|
|
17090
16333
|
updateSettings(patch) {
|
|
17091
|
-
return api$
|
|
16334
|
+
return api$6.post("/settings", patch).then(() => this.status());
|
|
17092
16335
|
}
|
|
17093
16336
|
accountAction(action, body = {}) {
|
|
17094
|
-
return api$
|
|
16337
|
+
return api$6.post("/accounts", {
|
|
17095
16338
|
action,
|
|
17096
16339
|
...body
|
|
17097
16340
|
});
|
|
17098
16341
|
}
|
|
17099
16342
|
/** Verify a key without storing it; the host answers the verdict directly. */
|
|
17100
16343
|
testKey(body) {
|
|
17101
|
-
return api$
|
|
16344
|
+
return api$6.post("/accounts", {
|
|
17102
16345
|
action: "test",
|
|
17103
16346
|
...body
|
|
17104
16347
|
});
|
|
17105
16348
|
}
|
|
17106
16349
|
/** Start the browser device-authorization sign-in. */
|
|
17107
16350
|
startLogin() {
|
|
17108
|
-
return api$
|
|
16351
|
+
return api$6.post("/login/start", {});
|
|
17109
16352
|
}
|
|
17110
16353
|
/** One poll of the pending sign-in; the host throttles it to the advertised interval. */
|
|
17111
16354
|
loginStatus(id) {
|
|
17112
|
-
return api$
|
|
16355
|
+
return api$6.get(`/login/status?id=${encodeURIComponent(id)}`);
|
|
17113
16356
|
}
|
|
17114
16357
|
cancelLogin(id) {
|
|
17115
|
-
return api$
|
|
16358
|
+
return api$6.post("/login/cancel", { id });
|
|
17116
16359
|
}
|
|
17117
16360
|
/** Read each OAuth account's wallet balance once (one upstream call per account). */
|
|
17118
16361
|
readUsage() {
|
|
17119
|
-
return api$
|
|
16362
|
+
return api$6.post("/usage", {});
|
|
17120
16363
|
}
|
|
17121
16364
|
setEnabledModels(enabledModelIds) {
|
|
17122
|
-
return api$
|
|
16365
|
+
return api$6.post("/models", { enabledModelIds });
|
|
17123
16366
|
}
|
|
17124
16367
|
setContextWindow(model, contextWindow) {
|
|
17125
|
-
return api$
|
|
16368
|
+
return api$6.post("/models/context-window", {
|
|
17126
16369
|
model,
|
|
17127
16370
|
contextWindow
|
|
17128
16371
|
});
|
|
17129
16372
|
}
|
|
17130
16373
|
setVisibility(model, visible) {
|
|
17131
|
-
return api$
|
|
16374
|
+
return api$6.post("/models/visibility", {
|
|
17132
16375
|
model,
|
|
17133
16376
|
visible
|
|
17134
16377
|
});
|
|
17135
16378
|
}
|
|
17136
16379
|
setVisibilityAll(mode) {
|
|
17137
|
-
return api$
|
|
16380
|
+
return api$6.post("/models/visibility-all", { mode });
|
|
17138
16381
|
}
|
|
17139
16382
|
refreshCatalog() {
|
|
17140
|
-
return api$
|
|
16383
|
+
return api$6.post("/catalog/refresh", {});
|
|
17141
16384
|
}
|
|
17142
16385
|
};
|
|
17143
16386
|
//#endregion
|
|
@@ -18713,7 +17956,7 @@ window.__ModuleLoader__.load({
|
|
|
18713
17956
|
* is exactly what a stale host half produces) be reported as such instead of as
|
|
18714
17957
|
* a bare "Unexpected end of JSON input".
|
|
18715
17958
|
*/
|
|
18716
|
-
const api$
|
|
17959
|
+
const api$5 = createLineApi(API$2, "WorkBuddy");
|
|
18717
17960
|
/**
|
|
18718
17961
|
* Reasoning levels the default-effort control may offer.
|
|
18719
17962
|
*
|
|
@@ -18782,7 +18025,7 @@ window.__ModuleLoader__.load({
|
|
|
18782
18025
|
const loadStatus = (0, react.useCallback)(async (quiet = false) => {
|
|
18783
18026
|
if (!quiet) setError(null);
|
|
18784
18027
|
try {
|
|
18785
|
-
const data = await api$
|
|
18028
|
+
const data = await api$5.request("/status");
|
|
18786
18029
|
const normalized = normalizeStatus(data);
|
|
18787
18030
|
setStatus(normalized);
|
|
18788
18031
|
setStatusFailed(false);
|
|
@@ -18817,7 +18060,7 @@ window.__ModuleLoader__.load({
|
|
|
18817
18060
|
try {
|
|
18818
18061
|
setBusy("rescan");
|
|
18819
18062
|
setError(null);
|
|
18820
|
-
const updated = await api$
|
|
18063
|
+
const updated = await api$5.request("/rescan", { method: "POST" });
|
|
18821
18064
|
setStatus(normalizeStatus(updated));
|
|
18822
18065
|
notifyChange();
|
|
18823
18066
|
} catch (err) {
|
|
@@ -18831,7 +18074,7 @@ window.__ModuleLoader__.load({
|
|
|
18831
18074
|
setBusy(`login:${region}`);
|
|
18832
18075
|
setError(null);
|
|
18833
18076
|
setLoginProgress(t.loginWaiting);
|
|
18834
|
-
const flow = await api$
|
|
18077
|
+
const flow = await api$5.request("/accounts/login", {
|
|
18835
18078
|
method: "POST",
|
|
18836
18079
|
body: JSON.stringify({ region })
|
|
18837
18080
|
});
|
|
@@ -18841,7 +18084,7 @@ window.__ModuleLoader__.load({
|
|
|
18841
18084
|
const timer = window.setInterval(() => {
|
|
18842
18085
|
(async () => {
|
|
18843
18086
|
try {
|
|
18844
|
-
const poll = await api$
|
|
18087
|
+
const poll = await api$5.request("/accounts/login/status");
|
|
18845
18088
|
if (poll.progress) setLoginProgress(poll.progress);
|
|
18846
18089
|
if (poll.status === "complete") {
|
|
18847
18090
|
window.clearInterval(timer);
|
|
@@ -18850,7 +18093,7 @@ window.__ModuleLoader__.load({
|
|
|
18850
18093
|
loginTimeoutRef.current = null;
|
|
18851
18094
|
setBusy(null);
|
|
18852
18095
|
setLoginProgress(null);
|
|
18853
|
-
if (poll.accountId) await api$
|
|
18096
|
+
if (poll.accountId) await api$5.request("/settings", {
|
|
18854
18097
|
method: "POST",
|
|
18855
18098
|
body: JSON.stringify({ selectedAccountId: poll.accountId })
|
|
18856
18099
|
});
|
|
@@ -18890,7 +18133,7 @@ window.__ModuleLoader__.load({
|
|
|
18890
18133
|
try {
|
|
18891
18134
|
setBusy(`${action}:${accountId}`);
|
|
18892
18135
|
setError(null);
|
|
18893
|
-
const updated = await api$
|
|
18136
|
+
const updated = await api$5.request("/accounts/action", {
|
|
18894
18137
|
method: "POST",
|
|
18895
18138
|
body: JSON.stringify({
|
|
18896
18139
|
action,
|
|
@@ -18913,7 +18156,7 @@ window.__ModuleLoader__.load({
|
|
|
18913
18156
|
try {
|
|
18914
18157
|
setBusy("strategy");
|
|
18915
18158
|
setError(null);
|
|
18916
|
-
const updated = await api$
|
|
18159
|
+
const updated = await api$5.request("/accounts/strategy", {
|
|
18917
18160
|
method: "POST",
|
|
18918
18161
|
body: JSON.stringify({ strategy })
|
|
18919
18162
|
});
|
|
@@ -18928,7 +18171,7 @@ window.__ModuleLoader__.load({
|
|
|
18928
18171
|
try {
|
|
18929
18172
|
setBusy("connection");
|
|
18930
18173
|
setError(null);
|
|
18931
|
-
setConnection(await api$
|
|
18174
|
+
setConnection(await api$5.request("/connection/test", { method: "POST" }));
|
|
18932
18175
|
} catch (err) {
|
|
18933
18176
|
setError(err instanceof Error ? err.message : String(err));
|
|
18934
18177
|
} finally {
|
|
@@ -18939,7 +18182,7 @@ window.__ModuleLoader__.load({
|
|
|
18939
18182
|
try {
|
|
18940
18183
|
setBusy("quota");
|
|
18941
18184
|
setError(null);
|
|
18942
|
-
const updated = await api$
|
|
18185
|
+
const updated = await api$5.request("/quota", { method: "POST" });
|
|
18943
18186
|
setStatus(updated);
|
|
18944
18187
|
} catch (err) {
|
|
18945
18188
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -18951,7 +18194,7 @@ window.__ModuleLoader__.load({
|
|
|
18951
18194
|
try {
|
|
18952
18195
|
setBusy("checkin");
|
|
18953
18196
|
setError(null);
|
|
18954
|
-
const updated = await api$
|
|
18197
|
+
const updated = await api$5.request("/checkin/now", { method: "POST" });
|
|
18955
18198
|
setStatus(normalizeStatus(updated));
|
|
18956
18199
|
} catch (err) {
|
|
18957
18200
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -18963,7 +18206,7 @@ window.__ModuleLoader__.load({
|
|
|
18963
18206
|
try {
|
|
18964
18207
|
setBusy("checkin");
|
|
18965
18208
|
setError(null);
|
|
18966
|
-
const updated = await api$
|
|
18209
|
+
const updated = await api$5.request("/settings", {
|
|
18967
18210
|
method: "POST",
|
|
18968
18211
|
body: JSON.stringify({ checkin })
|
|
18969
18212
|
});
|
|
@@ -18979,7 +18222,7 @@ window.__ModuleLoader__.load({
|
|
|
18979
18222
|
try {
|
|
18980
18223
|
setBusy("outbound");
|
|
18981
18224
|
setError(null);
|
|
18982
|
-
const updated = await api$
|
|
18225
|
+
const updated = await api$5.request("/settings", {
|
|
18983
18226
|
method: "POST",
|
|
18984
18227
|
body: JSON.stringify({ outboundIdentity })
|
|
18985
18228
|
});
|
|
@@ -18995,7 +18238,7 @@ window.__ModuleLoader__.load({
|
|
|
18995
18238
|
try {
|
|
18996
18239
|
setBusy("guardrails");
|
|
18997
18240
|
setError(null);
|
|
18998
|
-
const updated = await api$
|
|
18241
|
+
const updated = await api$5.request("/settings", {
|
|
18999
18242
|
method: "POST",
|
|
19000
18243
|
body: JSON.stringify({ guardrails })
|
|
19001
18244
|
});
|
|
@@ -19011,7 +18254,7 @@ window.__ModuleLoader__.load({
|
|
|
19011
18254
|
try {
|
|
19012
18255
|
setBusy("atrest");
|
|
19013
18256
|
setError(null);
|
|
19014
|
-
const updated = await api$
|
|
18257
|
+
const updated = await api$5.request("/at-rest-key", {
|
|
19015
18258
|
method: "POST",
|
|
19016
18259
|
body: JSON.stringify({ key })
|
|
19017
18260
|
});
|
|
@@ -19027,7 +18270,7 @@ window.__ModuleLoader__.load({
|
|
|
19027
18270
|
try {
|
|
19028
18271
|
setBusy("atrest");
|
|
19029
18272
|
setError(null);
|
|
19030
|
-
const updated = await api$
|
|
18273
|
+
const updated = await api$5.request("/at-rest-key", { method: "DELETE" });
|
|
19031
18274
|
setStatus(normalizeStatus(updated));
|
|
19032
18275
|
} catch (err) {
|
|
19033
18276
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -19042,7 +18285,7 @@ window.__ModuleLoader__.load({
|
|
|
19042
18285
|
try {
|
|
19043
18286
|
setBusy(`model:${modelId}`);
|
|
19044
18287
|
setError(null);
|
|
19045
|
-
const normalized = normalizeStatus(await api$
|
|
18288
|
+
const normalized = normalizeStatus(await api$5.request("/settings", {
|
|
19046
18289
|
method: "POST",
|
|
19047
18290
|
body: JSON.stringify({ enabledModelIds: next })
|
|
19048
18291
|
}));
|
|
@@ -19060,7 +18303,7 @@ window.__ModuleLoader__.load({
|
|
|
19060
18303
|
try {
|
|
19061
18304
|
setBusy("models-all");
|
|
19062
18305
|
setError(null);
|
|
19063
|
-
const normalized = normalizeStatus(await api$
|
|
18306
|
+
const normalized = normalizeStatus(await api$5.request("/settings", {
|
|
19064
18307
|
method: "POST",
|
|
19065
18308
|
body: JSON.stringify({ enabledModelIds: enabled ? status.models.map((model) => model.id) : [] })
|
|
19066
18309
|
}));
|
|
@@ -19077,7 +18320,7 @@ window.__ModuleLoader__.load({
|
|
|
19077
18320
|
try {
|
|
19078
18321
|
setBusy("effort");
|
|
19079
18322
|
setError(null);
|
|
19080
|
-
const updated = await api$
|
|
18323
|
+
const updated = await api$5.request("/settings", {
|
|
19081
18324
|
method: "POST",
|
|
19082
18325
|
body: JSON.stringify({ defaultReasoningEffort: effort })
|
|
19083
18326
|
});
|
|
@@ -19093,7 +18336,7 @@ window.__ModuleLoader__.load({
|
|
|
19093
18336
|
try {
|
|
19094
18337
|
setBusy("catalog");
|
|
19095
18338
|
setError(null);
|
|
19096
|
-
const normalized = normalizeStatus(await api$
|
|
18339
|
+
const normalized = normalizeStatus(await api$5.request("/catalog/refresh", { method: "POST" }));
|
|
19097
18340
|
setStatus(normalized);
|
|
19098
18341
|
setContextDrafts(contextDraftsFor(normalized));
|
|
19099
18342
|
notifyChange();
|
|
@@ -19113,7 +18356,7 @@ window.__ModuleLoader__.load({
|
|
|
19113
18356
|
try {
|
|
19114
18357
|
setSavingModel(modelId);
|
|
19115
18358
|
setError(null);
|
|
19116
|
-
const updated = await api$
|
|
18359
|
+
const updated = await api$5.request("/settings", {
|
|
19117
18360
|
method: "POST",
|
|
19118
18361
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: parsed } })
|
|
19119
18362
|
});
|
|
@@ -19134,7 +18377,7 @@ window.__ModuleLoader__.load({
|
|
|
19134
18377
|
try {
|
|
19135
18378
|
setSavingModel(modelId);
|
|
19136
18379
|
setError(null);
|
|
19137
|
-
const updated = normalizeStatus(await api$
|
|
18380
|
+
const updated = normalizeStatus(await api$5.request("/settings", {
|
|
19138
18381
|
method: "POST",
|
|
19139
18382
|
body: JSON.stringify({ contextWindowOverrides: { [modelId]: null } })
|
|
19140
18383
|
}));
|
|
@@ -19161,7 +18404,7 @@ window.__ModuleLoader__.load({
|
|
|
19161
18404
|
try {
|
|
19162
18405
|
setBusy("context");
|
|
19163
18406
|
setError(null);
|
|
19164
|
-
const updated = normalizeStatus(await api$
|
|
18407
|
+
const updated = normalizeStatus(await api$5.request("/settings", {
|
|
19165
18408
|
method: "POST",
|
|
19166
18409
|
body: JSON.stringify({ contextWindowOverrides: Object.fromEntries(models.map((model) => [model, null])) })
|
|
19167
18410
|
}));
|
|
@@ -20052,12 +19295,6 @@ window.__ModuleLoader__.load({
|
|
|
20052
19295
|
...runtime
|
|
20053
19296
|
})
|
|
20054
19297
|
},
|
|
20055
|
-
{
|
|
20056
|
-
id: "antigravity",
|
|
20057
|
-
name: "Antigravity",
|
|
20058
|
-
setEnabled: (enabled) => postLineSettings("/antigravity/api", { enabled }),
|
|
20059
|
-
renderDetail: ({ onModelChange }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AntigravitySection, { onModelChange })
|
|
20060
|
-
},
|
|
20061
19298
|
{
|
|
20062
19299
|
id: "command-code",
|
|
20063
19300
|
name: "Command Code",
|
|
@@ -20834,7 +20071,6 @@ window.__ModuleLoader__.load({
|
|
|
20834
20071
|
stopImportingBusy: "停止导入中…",
|
|
20835
20072
|
stopImportingHint: "停止导入只会让本插件忘记本机 CLI 登录的副本;Codex CLI 自己的登录文件不会被删除或修改。账号池不允许逐条删除借来的凭据,所以这里一次会停止全部导入。",
|
|
20836
20073
|
"cardName.chatgpt": "ChatGPT",
|
|
20837
|
-
"cardName.antigravity": "Antigravity",
|
|
20838
20074
|
"cardName.command-code": "Command Code",
|
|
20839
20075
|
"cardName.kimi-code": "Kimi Code",
|
|
20840
20076
|
"cardName.minimax-code": "MiniMax Code",
|
|
@@ -21057,7 +20293,6 @@ window.__ModuleLoader__.load({
|
|
|
21057
20293
|
stopImportingBusy: "Stopping the import…",
|
|
21058
20294
|
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.",
|
|
21059
20295
|
"cardName.chatgpt": "ChatGPT",
|
|
21060
|
-
"cardName.antigravity": "Antigravity",
|
|
21061
20296
|
"cardName.command-code": "Command Code",
|
|
21062
20297
|
"cardName.kimi-code": "Kimi Code",
|
|
21063
20298
|
"cardName.minimax-code": "MiniMax Code",
|
|
@@ -21285,7 +20520,7 @@ window.__ModuleLoader__.load({
|
|
|
21285
20520
|
settingsToolRunawayGuardName: "工具失控治理",
|
|
21286
20521
|
settingsToolRunawayGuardNote: "同一工具与参数连续重复时分级提醒;Kimi 保留第 12 次强停,其他线路只提醒",
|
|
21287
20522
|
settingsMediaToolsName: "媒体工具",
|
|
21288
|
-
settingsMediaToolsNote: "统一注册 Codex
|
|
20523
|
+
settingsMediaToolsNote: "统一注册 Codex 生图、Kimi 视频挂载与 MiniMax 视频工具;重载插件或重启后生效,Kimi 既有会话在工具表变化后会重建一次前缀缓存",
|
|
21289
20524
|
settingsTeamPolicyCacheGuardName: "智能体团队策略段",
|
|
21290
20525
|
settingsTeamPolicyCacheGuardNote: "把内置 Agent Teams 的策略段从系统提示词摘掉,改为开启团队协作时以尾部消息投递一次;会话中途切开关不再刷掉整段前缀缓存(默认开启)",
|
|
21291
20526
|
settingsThresholdName: "催促阈值",
|
|
@@ -21340,7 +20575,7 @@ window.__ModuleLoader__.load({
|
|
|
21340
20575
|
settingsToolRunawayGuardName: "Tool runaway guard",
|
|
21341
20576
|
settingsToolRunawayGuardNote: "Remind the agent when the same tool call repeats; Kimi keeps its 12th-call handoff, while other lines receive reminders only",
|
|
21342
20577
|
settingsMediaToolsName: "Media tools",
|
|
21343
|
-
settingsMediaToolsNote: "Register Codex
|
|
20578
|
+
settingsMediaToolsNote: "Register Codex image generation, Kimi video attachment, and MiniMax video tools together; reload the plugin or restart DSH to apply. Existing Kimi sessions rebuild their prefix once after the tool table changes",
|
|
21344
20579
|
settingsTeamPolicyCacheGuardName: "Agent Teams policy section",
|
|
21345
20580
|
settingsTeamPolicyCacheGuardNote: "Lift the built-in Agent Teams policy section out of the system prompt and deliver it as one tail message when team collaboration is switched on, so toggling mid-session no longer rebuilds the whole prefix cache (on by default)",
|
|
21346
20581
|
settingsThresholdName: "Nudge threshold",
|
|
@@ -21400,86 +20635,6 @@ window.__ModuleLoader__.load({
|
|
|
21400
20635
|
composerLabel: "Квота"
|
|
21401
20636
|
};
|
|
21402
20637
|
//#endregion
|
|
21403
|
-
//#region src/client/locales-ru/antigravity.ts
|
|
21404
|
-
const dictionary$14 = {
|
|
21405
|
-
...accountPoolRu,
|
|
21406
|
-
title: "Antigravity",
|
|
21407
|
-
pageDesc: "Войдите в Google Antigravity / Cloud Code Assist и смотрите общую квоту текущего аккаунта.",
|
|
21408
|
-
account: "Вход выполнен",
|
|
21409
|
-
signedIn: "Вход выполнен",
|
|
21410
|
-
signedOut: "Вход не выполнен",
|
|
21411
|
-
accountPool: "Аккаунты",
|
|
21412
|
-
addAccount: "Добавить аккаунт",
|
|
21413
|
-
primaryAccount: "Основной",
|
|
21414
|
-
activeAccount: "Используется",
|
|
21415
|
-
setPrimary: "Сделать основным",
|
|
21416
|
-
deleteAccount: "Удалить",
|
|
21417
|
-
cooling: "В паузе",
|
|
21418
|
-
clearCooldown: "Сбросить паузу",
|
|
21419
|
-
rotationStrategy: "Порядок переключения",
|
|
21420
|
-
strategySequential: "По очереди (основной первым, переключение при 429)",
|
|
21421
|
-
strategyRoundRobin: "По кругу (равномерно между аккаунтами)",
|
|
21422
|
-
strategySticky: "Закрепление (держать текущий аккаунт до лимита)",
|
|
21423
|
-
noAccounts: "Аккаунтов пока нет. Нажмите «Добавить аккаунт», чтобы авторизоваться.",
|
|
21424
|
-
plan: "Тариф",
|
|
21425
|
-
accountId: "ID аккаунта",
|
|
21426
|
-
expires: "Токен истекает",
|
|
21427
|
-
signInAgain: "Войти заново",
|
|
21428
|
-
refreshToken: "Обновить токен",
|
|
21429
|
-
signOut: "Выйти",
|
|
21430
|
-
signIn: "Войти",
|
|
21431
|
-
signingIn: "Вход…",
|
|
21432
|
-
connection: "Подключение",
|
|
21433
|
-
modelsHint: "Отмеченные модели появятся в списке моделей диалога DSH; если снять все отметки или выключить переключатель на карточке обзора, провайдер скроется из списка.",
|
|
21434
|
-
modelsSection: "Модели",
|
|
21435
|
-
selectAll: "Выбрать все",
|
|
21436
|
-
unselectAll: "Снять все",
|
|
21437
|
-
enhanced: "Дополнительные возможности",
|
|
21438
|
-
defaultReasoningEffort: "Уровень рассуждений по умолчанию",
|
|
21439
|
-
defaultReasoningEffortHint: "Уровень рассуждений для моделей, которые его поддерживают, когда в диалоге он не задан явно.",
|
|
21440
|
-
defaultEffortAuto: "По умолчанию у провайдера",
|
|
21441
|
-
contextWindowSection: "Контекстное окно модели",
|
|
21442
|
-
contextWindowHint: "По умолчанию — как в спецификации модели; можно задать свою ёмкость, которую DSH использует при сжатии и определении переполнения (например, 1M, 512K, 200K).",
|
|
21443
|
-
contextWindowReset: "Вернуть значение по умолчанию",
|
|
21444
|
-
contextWindowResetAll: "Вернуть все значения",
|
|
21445
|
-
contextWindowResetAllConfirm: "Вернуть к значениям по умолчанию все изменённые контекстные окна?",
|
|
21446
|
-
contextWindowNoneEnabled: "Ни одна модель не отмечена. Отметьте её выше — и здесь появятся настройки её контекстного окна.",
|
|
21447
|
-
save: "Сохранить",
|
|
21448
|
-
saved: "Сохранено",
|
|
21449
|
-
saving: "Сохранение…",
|
|
21450
|
-
cacheSection: "Кеш",
|
|
21451
|
-
cacheDesc: "Кеш Antigravity сопоставляется сервисом неявно — клиент не передаёт ни одного поля управления кешем, — поэтому единственное доказательство его работы — доля ответа, прочитанная из кеша. Ниже сообщается только о полном промахе и о том, сколько клиент простаивал перед ним: кеш истекает по времени простоя, а каждый новый ход меняет диалог, так что сообщать о каждом изменении значило бы сообщать одно и то же. Счётчики живут в памяти и раздельны по сессиям.",
|
|
21452
|
-
cacheEmpty: "В этом процессе ещё не было запросов с отчётом о расходе.",
|
|
21453
|
-
cacheHitRatio: "Доля попаданий в кеш",
|
|
21454
|
-
cacheCached: "Токены из кеша",
|
|
21455
|
-
cacheFresh: "Новые токены",
|
|
21456
|
-
cacheRequests: "Запросы",
|
|
21457
|
-
cacheMiss: "Последний полный промах",
|
|
21458
|
-
cacheMissIdle: "Простой перед промахом",
|
|
21459
|
-
cacheDriftNone: "Префикс не менялся",
|
|
21460
|
-
cacheDriftContents: "Изменилось содержимое диалога",
|
|
21461
|
-
cacheDriftSystemInstruction: "Изменилась системная инструкция",
|
|
21462
|
-
cacheDriftTools: "Изменился список инструментов",
|
|
21463
|
-
cacheDriftSessionId: "Изменился идентификатор сессии",
|
|
21464
|
-
cacheDriftNewSession: "Первый запрос этой сессии",
|
|
21465
|
-
quotaSection: "Расход и квота",
|
|
21466
|
-
quotaDesc: "Данные из сервиса квот Google Cloud Code Assist; обновляются не чаще раза в 60 секунд, пока страница открыта.",
|
|
21467
|
-
refreshQuota: "Обновить квоту",
|
|
21468
|
-
refreshingQuota: "Обновление…",
|
|
21469
|
-
quotaEmpty: "Данных о квоте пока нет — нажмите «Обновить квоту», чтобы повторить.",
|
|
21470
|
-
googleValidation: "Подтвердите аккаунт в Google",
|
|
21471
|
-
resetPrefix: "Сброс: {time}",
|
|
21472
|
-
resetUnavailable: "Сброс: н/д",
|
|
21473
|
-
resetNow: "сейчас",
|
|
21474
|
-
timeDayHour: "{days} д {hours} ч",
|
|
21475
|
-
timeHourMin: "{hours} ч {minutes} мин",
|
|
21476
|
-
timeMin: "{minutes} мин",
|
|
21477
|
-
updatedAt: "Обновлено: {time}",
|
|
21478
|
-
loading: "Загрузка…",
|
|
21479
|
-
loginFailed: "Вход не выполнен",
|
|
21480
|
-
tokens: "токены"
|
|
21481
|
-
};
|
|
21482
|
-
//#endregion
|
|
21483
20638
|
//#region src/client/locales-ru/claude.ts
|
|
21484
20639
|
/**
|
|
21485
20640
|
* Russian dictionary for the Claude subscription tab.
|
|
@@ -22102,7 +21257,6 @@ window.__ModuleLoader__.load({
|
|
|
22102
21257
|
stopImportingBusy: "Останавливаем импорт…",
|
|
22103
21258
|
stopImportingHint: "Остановка лишь заставляет плагин забыть копию входа локального CLI; собственный файл входа Codex CLI не удаляется и не меняется. Пул аккаунтов не позволяет удалять заимствованные учётные данные по одному, поэтому здесь импорт останавливается сразу для всех.",
|
|
22104
21259
|
"cardName.chatgpt": "ChatGPT",
|
|
22105
|
-
"cardName.antigravity": "Antigravity",
|
|
22106
21260
|
"cardName.command-code": "Command Code",
|
|
22107
21261
|
"cardName.kimi-code": "Kimi Code",
|
|
22108
21262
|
"cardName.minimax-code": "MiniMax Code",
|
|
@@ -22745,7 +21899,7 @@ window.__ModuleLoader__.load({
|
|
|
22745
21899
|
settingsToolRunawayGuardName: "Защита от циклов инструментов",
|
|
22746
21900
|
settingsToolRunawayGuardNote: "Напоминать агенту о повторяющихся вызовах; Kimi сохраняет передачу управления на 12-м вызове, другие линии получают только напоминания",
|
|
22747
21901
|
settingsMediaToolsName: "Медиаинструменты",
|
|
22748
|
-
settingsMediaToolsNote: "Единая регистрация генерации изображений Codex
|
|
21902
|
+
settingsMediaToolsNote: "Единая регистрация генерации изображений Codex, прикрепления видео Kimi и видеоинструментов MiniMax; применяется после перезагрузки плагина или DSH. В существующих сессиях Kimi после изменения набора инструментов префиксный кеш один раз пересобирается",
|
|
22749
21903
|
settingsTeamPolicyCacheGuardName: "Раздел политики Agent Teams",
|
|
22750
21904
|
settingsTeamPolicyCacheGuardNote: "Убрать встроенный раздел политики Agent Teams из системного промпта и передавать его одним сообщением в хвосте при включении командной работы, чтобы переключение посреди сессии больше не пересобирало весь префиксный кеш (включено по умолчанию)",
|
|
22751
21905
|
settingsThresholdName: "Порог напоминания",
|
|
@@ -23212,7 +22366,6 @@ window.__ModuleLoader__.load({
|
|
|
23212
22366
|
const dictionaries = [
|
|
23213
22367
|
[NS, dictionary$9],
|
|
23214
22368
|
[NS_CLAUDE, dictionary$13],
|
|
23215
|
-
[NS_ANTIGRAVITY, dictionary$14],
|
|
23216
22369
|
[NS_COMMAND_CODE, dictionary$11],
|
|
23217
22370
|
[NS_KIMI_CODE, dictionary$8],
|
|
23218
22371
|
[NS_MINIMAX_CODE, dictionary$7],
|
|
@@ -23557,86 +22710,6 @@ window.__ModuleLoader__.load({
|
|
|
23557
22710
|
installPluginStyle("model-checklist", CSS$2);
|
|
23558
22711
|
}
|
|
23559
22712
|
//#endregion
|
|
23560
|
-
//#region src/client/antigravity/styles.ts
|
|
23561
|
-
const STYLE_ID$7 = "dsh-antigravity-settings-style";
|
|
23562
|
-
function installAntigravityStyles() {
|
|
23563
|
-
installPluginStyle("antigravity", `
|
|
23564
|
-
.dsha-page{box-sizing:border-box;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:20px;max-width:780px;min-width:0;padding:2px 0 30px}
|
|
23565
|
-
.dsha-page *{box-sizing:border-box}
|
|
23566
|
-
.dsha-group{border-top:0.5px solid var(--dsw-alias-border-l2);min-width:0}
|
|
23567
|
-
.dsha-group:first-of-type{border-top:0}
|
|
23568
|
-
.dsha-grouphead{align-items:center;display:flex;gap:12px;justify-content:space-between;min-height:48px}
|
|
23569
|
-
.dsha-grouphead h3{font-size:14px;font-weight:650;margin:0;color:var(--dsw-alias-label-primary)}
|
|
23570
|
-
.dsha-row{align-items:center;border-bottom:0.5px solid var(--dsw-alias-border-l2);display:flex;gap:20px;justify-content:space-between;min-height:44px;padding:8px 0}
|
|
23571
|
-
.dsha-label{color:var(--dsw-alias-label-secondary);font-size:13px;flex:0 0 auto}
|
|
23572
|
-
.dsha-value{font-size:13px;min-width:0;overflow-wrap:anywhere;text-align:right;color:var(--dsw-alias-label-primary)}
|
|
23573
|
-
.dsha-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;padding-top:12px}
|
|
23574
|
-
.dsha-btn{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:999px;corner-shape:round;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;font-size:13px;line-height:1;padding:8px 13px;white-space:nowrap}
|
|
23575
|
-
/* The hover tint belongs to the unfilled button only: it is a translucent wash
|
|
23576
|
-
over the neutral fill, and letting it match .dsha-btn-primary would paint the
|
|
23577
|
-
filled button with the wash while the label stayed white — the primary fill
|
|
23578
|
-
is (0,1,0) and this rule is (0,3,0), so nothing else could win it back. The
|
|
23579
|
-
exclusion is written into the selector, like the shared chip's
|
|
23580
|
-
:not([aria-pressed='true']), so a later filled variant cannot reintroduce it. */
|
|
23581
|
-
.dsha-btn:hover:not(:disabled):not(.dsha-btn-primary){background:var(--dsw-alias-interactive-bg-hover)}
|
|
23582
|
-
.dsha-btn:disabled{cursor:default;opacity:.5}
|
|
23583
|
-
.dsha-btn-primary{background:var(--dsw-alias-button-info-fill,#397ee8);border-color:transparent;color:var(--dsw-alias-button-info-label,#fff)}
|
|
23584
|
-
.dsha-btn-primary:hover:not(:disabled){opacity:.9}
|
|
23585
|
-
.dsha-notice{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.55;margin:12px 0 0;padding:10px 12px}
|
|
23586
|
-
.dsha-muted{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.55;margin:0}
|
|
23587
|
-
.dsha-models-hint{padding-top:10px}
|
|
23588
|
-
.dsha-pref-row{align-items:center;border-bottom:0.5px solid var(--dsw-alias-border-l2);display:flex;gap:16px;justify-content:space-between;min-height:58px;padding:10px 0}
|
|
23589
|
-
.dsha-pref-row strong{display:block;font-size:13px;font-weight:600;line-height:1.35;color:var(--dsw-alias-label-primary)}
|
|
23590
|
-
.dsha-select{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:7px 9px;max-width:220px;min-width:160px}
|
|
23591
|
-
.dsha-context-settings{border-bottom:0.5px solid var(--dsw-alias-border-l2);display:grid;gap:10px;padding:12px 0}
|
|
23592
|
-
.dsha-context-settings>div>strong{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
23593
|
-
.dsha-context-row{align-items:center;display:flex;font-size:12px;gap:14px;justify-content:space-between}
|
|
23594
|
-
.dsha-capacity-control{align-items:center;display:flex;gap:7px}
|
|
23595
|
-
.dsha-capacity-control input{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-primary);font:inherit;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;padding:7px 9px;text-align:right;width:90px}
|
|
23596
|
-
.dsha-capacity-control small{color:var(--dsw-alias-label-tertiary);font-size:11px;width:42px}
|
|
23597
|
-
.dsha-context-save{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;font-size:12px;line-height:1;padding:8px 10px;white-space:nowrap}
|
|
23598
|
-
.dsha-context-save:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
|
|
23599
|
-
.dsha-context-save:disabled{cursor:default;opacity:.45}
|
|
23600
|
-
.dsha-context-reset{color:var(--dsw-alias-label-secondary)}
|
|
23601
|
-
.dsha-context-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}
|
|
23602
|
-
.dsha-quota-card{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:8px;margin-top:12px;padding:12px}
|
|
23603
|
-
.dsha-quota-title{align-items:center;display:flex;font-size:13px;gap:8px;justify-content:space-between;color:var(--dsw-alias-label-primary);font-weight:650}
|
|
23604
|
-
.dsha-quota-title span{color:var(--dsw-alias-label-tertiary);font-size:11px;text-transform:uppercase}
|
|
23605
|
-
.dsha-meter-wrap{margin-top:13px}
|
|
23606
|
-
.dsha-meter-label,.dsha-meter-meta{display:flex;gap:10px;justify-content:space-between}
|
|
23607
|
-
.dsha-meter-label{font-size:12px;margin-bottom:6px;color:var(--dsw-alias-label-primary)}
|
|
23608
|
-
.dsha-meter-meta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.45;margin-top:6px}
|
|
23609
|
-
.dsha-meter{background:var(--dsw-alias-bg-layer-1,rgba(127,127,127,.15));border-radius:999px;corner-shape:round;height:7px;overflow:hidden;width:100%}
|
|
23610
|
-
.dsha-meter>span{background:var(--dsw-alias-button-info-fill,#397ee8);border-radius:inherit;display:block;height:100%;max-width:100%;min-width:0;transition:width .25s ease}
|
|
23611
|
-
.dsha-meter-green>span{background:var(--dsw-alias-label-success,#10b981)}
|
|
23612
|
-
.dsha-meter-cyan>span{background:#06b6d4}
|
|
23613
|
-
.dsha-timestamp{color:var(--dsw-alias-label-tertiary);font-size:11px;margin:10px 0 0;text-align:right}
|
|
23614
|
-
.dsha-mini-btn{border:0;background:transparent;color:var(--dsw-alias-label-link,#397ee8);font-size:12px;line-height:18px;cursor:pointer;padding:0;margin-left:8px}
|
|
23615
|
-
.dsha-mini-btn:hover{text-decoration:underline}
|
|
23616
|
-
.dsha-empty{border:0.5px dashed var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-tertiary);font-size:12px;margin:12px 0 0;padding:16px;text-align:center}
|
|
23617
|
-
.dsha-error{color:var(--dsw-alias-label-danger,#d94b4b);font-size:12px;margin:8px 0 0}
|
|
23618
|
-
.dsha-composer-quota{align-items:center;background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:999px;corner-shape:round;color:var(--dsw-alias-label-secondary);cursor:pointer;display:inline-flex;font-size:11px;gap:6px;height:28px;line-height:1;max-width:160px;padding:0 9px;white-space:nowrap;user-select:none;transition:all .15s ease}
|
|
23619
|
-
.dsha-composer-quota:hover{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l1,var(--dsw-alias-border-l2))}
|
|
23620
|
-
.dsha-composer-quota strong{color:var(--dsw-alias-label-primary);font-size:11px;font-weight:650}
|
|
23621
|
-
.dsha-composer-quota[data-level=warning] strong{color:var(--dsw-alias-label-warning,#d58a24)}
|
|
23622
|
-
.dsha-composer-quota[data-level=danger] strong{color:var(--dsw-alias-label-danger,#d94b4b)}
|
|
23623
|
-
.dsha-accounts-list{display:flex;flex-direction:column;gap:10px;margin-top:10px}
|
|
23624
|
-
.dsha-account-card{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:8px;transition:border-color .15s ease}
|
|
23625
|
-
.dsha-account-card.active{border-color:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 60%,var(--dsw-alias-border-l2))}
|
|
23626
|
-
.dsha-account-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
|
|
23627
|
-
.dsha-account-identity{display:flex;align-items:center;gap:8px;min-width:0}
|
|
23628
|
-
.dsha-account-title{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
23629
|
-
.dsha-badges{display:flex;align-items:center;gap:6px}
|
|
23630
|
-
.dsha-badge{font-size:11px;line-height:1;padding:3px 7px;border-radius:4px;font-weight:550;white-space:nowrap}
|
|
23631
|
-
.dsha-badge.primary{background:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 18%,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-button-info-fill,#397ee8);border:0.5px solid color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 40%,transparent)}
|
|
23632
|
-
.dsha-badge.active{background:color-mix(in srgb,var(--dsw-alias-label-success,#10b981) 18%,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-success,#10b981);border:0.5px solid color-mix(in srgb,var(--dsw-alias-label-success,#10b981) 40%,transparent)}
|
|
23633
|
-
.dsha-badge.cooldown{background:color-mix(in srgb,var(--dsw-alias-label-warning,#d58a24) 18%,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-warning,#d58a24);border:0.5px solid color-mix(in srgb,var(--dsw-alias-label-warning,#d58a24) 40%,transparent)}
|
|
23634
|
-
.dsha-account-details{display:flex;flex-wrap:wrap;gap:14px;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
23635
|
-
.dsha-account-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
|
|
23636
|
-
.dsha-account-actions .dsha-btn{padding:5px 10px;font-size:12px}
|
|
23637
|
-
`, STYLE_ID$7);
|
|
23638
|
-
}
|
|
23639
|
-
//#endregion
|
|
23640
22713
|
//#region src/client/common/styles.ts
|
|
23641
22714
|
const POOL_STYLE_ID = "dsh-provider-pool-style";
|
|
23642
22715
|
/**
|
|
@@ -23766,78 +22839,6 @@ window.__ModuleLoader__.load({
|
|
|
23766
22839
|
});
|
|
23767
22840
|
}
|
|
23768
22841
|
//#endregion
|
|
23769
|
-
//#region src/client/antigravity/AntigravityComposerQuota.tsx
|
|
23770
|
-
const api$5 = createLineApi("/antigravity/api", "Antigravity");
|
|
23771
|
-
/**
|
|
23772
|
-
* The bucket this badge should speak for, or null when it cannot speak for one.
|
|
23773
|
-
*
|
|
23774
|
-
* The service reports the same allowances under separate model groups, and a
|
|
23775
|
-
* bucket the service never measured must not be published as "0% left". So the
|
|
23776
|
-
* badge skips it and takes the next measured one in the group, and shows nothing
|
|
23777
|
-
* at all when the group has none. Falling back to another group's numbers would
|
|
23778
|
-
* label one allowance with another's reading.
|
|
23779
|
-
*
|
|
23780
|
-
* Exported for its own regression test; the badge is its only caller.
|
|
23781
|
-
*/
|
|
23782
|
-
function selectQuotaBucketForModel(groups, modelId) {
|
|
23783
|
-
if (!groups || groups.length === 0) return null;
|
|
23784
|
-
const isClaudeOrGpt = modelId ? /claude|gpt/i.test(modelId) : false;
|
|
23785
|
-
const targetGroup = groups.find((g) => {
|
|
23786
|
-
const match = /claude|gpt|3p/i.test(g.displayName);
|
|
23787
|
-
return isClaudeOrGpt ? match : !match;
|
|
23788
|
-
}) || groups[0];
|
|
23789
|
-
if (!targetGroup || !targetGroup.buckets || targetGroup.buckets.length === 0) return null;
|
|
23790
|
-
const measured = (bucket) => typeof bucket.remainingFraction === "number" && Number.isFinite(bucket.remainingFraction);
|
|
23791
|
-
const shortBucket = targetGroup.buckets.find((b) => /5\s*小时|hour|5h/i.test(b.displayName) && measured(b)) ?? targetGroup.buckets.find(measured);
|
|
23792
|
-
if (shortBucket === void 0) return null;
|
|
23793
|
-
const remaining = shortBucket.remainingFraction;
|
|
23794
|
-
if (typeof remaining !== "number" || !Number.isFinite(remaining)) return null;
|
|
23795
|
-
return {
|
|
23796
|
-
groupName: targetGroup.displayName,
|
|
23797
|
-
bucketName: shortBucket.displayName,
|
|
23798
|
-
remainingPercent: Math.round(remaining * 100),
|
|
23799
|
-
resetTime: shortBucket.resetTime
|
|
23800
|
-
};
|
|
23801
|
-
}
|
|
23802
|
-
function formatResetCountdown(resetTime) {
|
|
23803
|
-
if (!resetTime) return "";
|
|
23804
|
-
try {
|
|
23805
|
-
const diff = new Date(resetTime).getTime() - Date.now();
|
|
23806
|
-
if (diff <= 0) return "即将重置";
|
|
23807
|
-
const h = Math.floor(diff / 36e5);
|
|
23808
|
-
const m = Math.floor(diff % 36e5 / 6e4);
|
|
23809
|
-
if (h > 0) return `${h}小时${m}分后重置`;
|
|
23810
|
-
return `${m}分钟后重置`;
|
|
23811
|
-
} catch {
|
|
23812
|
-
return "";
|
|
23813
|
-
}
|
|
23814
|
-
}
|
|
23815
|
-
/** The allowance the selected model actually draws on, as the badge's facts. */
|
|
23816
|
-
function selectBadgeFacts$8(status, modelId) {
|
|
23817
|
-
const info = selectQuotaBucketForModel(status?.quota?.groups ?? [], modelId);
|
|
23818
|
-
if (info === null) return {
|
|
23819
|
-
text: "—",
|
|
23820
|
-
tooltip: "点击刷新 Antigravity 配额",
|
|
23821
|
-
level: "normal"
|
|
23822
|
-
};
|
|
23823
|
-
const countdown = info.resetTime ? formatResetCountdown(info.resetTime) : "";
|
|
23824
|
-
return {
|
|
23825
|
-
text: `${info.remainingPercent}%`,
|
|
23826
|
-
tooltip: `[Antigravity] ${info.groupName} - ${info.bucketName}: 剩余 ${info.remainingPercent}%${countdown ? ` (${countdown})` : ""},点击刷新`,
|
|
23827
|
-
level: quotaLevel(info.remainingPercent)
|
|
23828
|
-
};
|
|
23829
|
-
}
|
|
23830
|
-
function AntigravityComposerQuota({ directory, loadModelDirectory, t }) {
|
|
23831
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
|
|
23832
|
-
directory,
|
|
23833
|
-
loadModelDirectory,
|
|
23834
|
-
providerId: "antigravity",
|
|
23835
|
-
readStatus: (refresh) => refresh ? api$5.post("/quota") : api$5.get("/status"),
|
|
23836
|
-
selectFacts: selectBadgeFacts$8,
|
|
23837
|
-
label: t("composerLabel")
|
|
23838
|
-
});
|
|
23839
|
-
}
|
|
23840
|
-
//#endregion
|
|
23841
22842
|
//#region src/client/claude/ClaudeComposerQuota.tsx
|
|
23842
22843
|
const api$4 = createLineApi("/claude/api", "Claude");
|
|
23843
22844
|
/**
|
|
@@ -24980,7 +23981,7 @@ window.__ModuleLoader__.load({
|
|
|
24980
23981
|
换行与间距。按钮的主次由各自的 class 决定 —— 主按钮带 .dsha-btn-primary,取信息
|
|
24981
23982
|
色填充;次要入口(设备码登录、导入本地登录)保持中性外观,这样一行里才读得出
|
|
24982
23983
|
「主入口 + 另外两种进入方式」。这里原先统一涂成信息色,是为了绕开
|
|
24983
|
-
.dsha-btn:hover 盖掉主按钮填充的问题(见
|
|
23984
|
+
.dsha-btn:hover 盖掉主按钮填充的问题(见 kimi-code 表里的
|
|
24984
23985
|
:not(.dsha-btn-primary));通用 hover 修好后它只剩副作用:把 .dsha-btn 的次要
|
|
24985
23986
|
按钮也画成主按钮,故删除。 */
|
|
24986
23987
|
.dsha-account-add-actions{display:flex;flex-wrap:wrap;gap:8px}
|
|
@@ -25032,11 +24033,9 @@ window.__ModuleLoader__.load({
|
|
|
25032
24033
|
/**
|
|
25033
24034
|
* 输入框右侧的额度胶囊本体。
|
|
25034
24035
|
*
|
|
25035
|
-
* **槽位号由波次 4
|
|
25036
|
-
*
|
|
25037
|
-
*
|
|
25038
|
-
* 'step-code-quota',locale 为 NS_STEP_CODE。顺延而不是插号:给新线路重排既有号会让
|
|
25039
|
-
* 已上线线路的槽位位置无谓地变一次。
|
|
24036
|
+
* **槽位号由波次 4 注册,本文件不注册任何槽位**:本线路在
|
|
24037
|
+
* conversation.input.right 使用 order 43,id 为 'step-code-quota',locale 为
|
|
24038
|
+
* NS_STEP_CODE。顺延而不是插入重排,避免无谓移动已上线线路的位置。
|
|
25040
24039
|
*/
|
|
25041
24040
|
function StepCodeComposerQuota({ directory, loadModelDirectory, t }) {
|
|
25042
24041
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
|
|
@@ -56434,7 +55433,7 @@ window.__ModuleLoader__.load({
|
|
|
56434
55433
|
*
|
|
56435
55434
|
* ## 为什么是字符串而不是 CSS Modules
|
|
56436
55435
|
*
|
|
56437
|
-
* 本插件其余线路(hub /
|
|
55436
|
+
* 本插件其余线路(hub / claude / kimi-code / step-code ……)全部走
|
|
56438
55437
|
* `common/plugin-style.ts` 的 `installPluginStyle`:它把 CSS 作为一张带
|
|
56439
55438
|
* `data-plugin` 归属的 <style> 注入,模块系统因此不会把这张表认领成别人的、
|
|
56440
55439
|
* 也不会顺手删掉。CSS Modules 的 lightningcss 编译这条链路不在本插件的 tsdown
|
|
@@ -59940,7 +58939,7 @@ window.__ModuleLoader__.load({
|
|
|
59940
58939
|
const errCode = block.error.code ?? "UNKNOWN";
|
|
59941
58940
|
parts.push(`${errName}: ${errCode}`);
|
|
59942
58941
|
}
|
|
59943
|
-
const joined = parts.
|
|
58942
|
+
const joined = parts.reduce((text, part, index) => text + (index === 0 || text.endsWith("\n") ? "" : "\n") + part, "");
|
|
59944
58943
|
return joined === "" ? null : joined;
|
|
59945
58944
|
}
|
|
59946
58945
|
function resolveLanguage(meta) {
|
|
@@ -60644,11 +59643,6 @@ window.__ModuleLoader__.load({
|
|
|
60644
59643
|
installModelChecklistStyles();
|
|
60645
59644
|
return () => {};
|
|
60646
59645
|
}, "dsh-chatgpt-subscription: hub styles");
|
|
60647
|
-
ctx.effect(() => ctx.locale.register(NS_ANTIGRAVITY, dictionaries$15), "dsh-antigravity: dictionaries");
|
|
60648
|
-
ctx.effect(() => {
|
|
60649
|
-
installAntigravityStyles();
|
|
60650
|
-
return () => {};
|
|
60651
|
-
}, "dsh-antigravity: styles");
|
|
60652
59646
|
ctx.effect(() => ctx.locale.register(NS_CLAUDE, dictionaries$10), "dsh-claude: dictionaries");
|
|
60653
59647
|
ctx.effect(() => {
|
|
60654
59648
|
installClaudeStyles();
|
|
@@ -60742,13 +59736,6 @@ window.__ModuleLoader__.load({
|
|
|
60742
59736
|
locale: NS,
|
|
60743
59737
|
inject: (sessionId) => composerBadgeInject(ctx, sessionId, { withApi: true })
|
|
60744
59738
|
}, CodexComposerQuota));
|
|
60745
|
-
ctx.slots.inject("conversation.input.right", () => ctx.slots.register({
|
|
60746
|
-
name: "conversation.input.right",
|
|
60747
|
-
id: "antigravity-quota",
|
|
60748
|
-
order: 36,
|
|
60749
|
-
locale: NS_ANTIGRAVITY,
|
|
60750
|
-
inject: (sessionId) => composerBadgeInject(ctx, sessionId)
|
|
60751
|
-
}, AntigravityComposerQuota));
|
|
60752
59739
|
ctx.slots.inject("conversation.input.right", () => ctx.slots.register({
|
|
60753
59740
|
name: "conversation.input.right",
|
|
60754
59741
|
id: "command-code-quota",
|
|
@@ -60825,12 +59812,6 @@ window.__ModuleLoader__.load({
|
|
|
60825
59812
|
locale: NS,
|
|
60826
59813
|
inject: (sessionId) => ({ loadImage: imageLoader(ctx, sessionId) })
|
|
60827
59814
|
}, CodexImageToolView));
|
|
60828
|
-
ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
|
|
60829
|
-
name: "tool.call.toolview",
|
|
60830
|
-
key: ANTIGRAVITY_IMAGE_TOOL_NAME,
|
|
60831
|
-
locale: NS,
|
|
60832
|
-
inject: (sessionId) => ({ loadImage: imageLoader(ctx, sessionId) })
|
|
60833
|
-
}, CodexImageToolView));
|
|
60834
59815
|
ctx.slots.inject("tool.call.toolview", () => ctx.slots.register({
|
|
60835
59816
|
name: "tool.call.toolview",
|
|
60836
59817
|
key: MINIMAX_VIDEO_TOOL_NAME,
|