@eddyskywalker/dsh-chatgpt-subscription 0.22.0 → 0.23.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 +19 -0
- package/README.md +5 -2
- package/lib/client.js +100 -17
- package/lib/client.js.map +1 -1
- package/lib/index.js +385 -520
- package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -1
- package/lib/types/client/glm-coding-plan/locales.d.ts +8 -11
- package/lib/types/client/glm-coding-plan/locales.d.ts.map +1 -1
- package/lib/types/client/ollama/OllamaSection.d.ts.map +1 -1
- package/lib/types/client/ollama/api.d.ts +13 -0
- package/lib/types/client/ollama/api.d.ts.map +1 -1
- package/lib/types/client/ollama/locales.d.ts +24 -0
- package/lib/types/client/ollama/locales.d.ts.map +1 -1
- package/lib/types/client/step-code/locales.d.ts +2 -2
- package/lib/types/host/glm-coding-plan/adapter.d.ts +1 -14
- package/lib/types/host/glm-coding-plan/adapter.d.ts.map +1 -1
- package/lib/types/host/glm-coding-plan/client.d.ts.map +1 -1
- package/lib/types/host/glm-coding-plan/types.d.ts +0 -10
- package/lib/types/host/glm-coding-plan/types.d.ts.map +1 -1
- package/lib/types/host/ollama/adapter.d.ts +26 -2
- package/lib/types/host/ollama/adapter.d.ts.map +1 -1
- package/lib/types/host/ollama/client.d.ts +16 -1
- package/lib/types/host/ollama/client.d.ts.map +1 -1
- package/lib/types/host/ollama/routes.d.ts +1 -1
- package/lib/types/host/ollama/routes.d.ts.map +1 -1
- package/lib/types/host/ollama/types.d.ts +74 -8
- package/lib/types/host/ollama/types.d.ts.map +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/ollama-contracts.d.ts +30 -0
- package/lib/types/shared/ollama-contracts.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/types/host/glm-coding-plan/signing.d.ts +0 -323
- package/lib/types/host/glm-coding-plan/signing.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.23.0 - 2026-10-13
|
|
6
|
+
- **[Ollama] 思考档位从「猜白名单」改为「读模型自己声明的事实」,并接通设置页的默认档位(用户报障:ollama 线路缺少模型思考档位选择器)**
|
|
7
|
+
- **问题(三层各缺一环,不是 UI 漏做)**:本插件其余每条线路都在 `adapter.resolveModel()` 里返回 `reasoning: { efforts, defaultEffort }`,Harness 的模型选择器只在拿到它时才渲染档位下拉——Ollama 是唯一不返回的线路,所以下拉根本不出现。而 Harness 侧的行为不是「静默忽略」而是硬拒绝:`resolveCallWithInfo` 在 `reasoning === undefined` 且调用方传了 `reasoningEffort` 时抛 `UNSUPPORTED_REASONING_EFFORT`。同时设置页的 `defaultReasoningEffort` 是一个**写进去就没人读的死字段**——`token-store.ts` 读写完备,但 `/settings` 路由只处理 `enabled`,卡片没有下拉,`OllamaWebStatus` 里也没有这个字段。
|
|
8
|
+
- **第一处:档位阶梯改为由模型元数据驱动**。`POST /api/show` 返回的顶层 `thinking: { values, default }` 是该模型**唯一一处**自述其 `think` 接受值的来源(官方 thinking.mdx 逐字)。新增 `fetchModelThinking()` 读取它,`reasoningEffortsForModel()` 据此构建阶梯;原有的 `gpt-oss` / `deepseek-r1` / `qwq` / `qwen3` 四个前缀白名单**降级为回退**——只在元数据读不到时使用,无 `declared` 时行为逐字不变。于是白名单之外的家族(如 `glm-4.6:cloud` 若声明 `['low','high']`)也能拿到自己的正确阶梯。
|
|
9
|
+
- **第二处(本轮最关键的缺陷,验收阶段抓出并退回返工)**:档位集合与 wire 取值曾由**两张不同的表**产生——集合走 `reasoningEffortsForModel`,取值走 `thinkForModel`——于是对声明 `values: [true]` 的模型(支持思考、**不允许关闭**),集合仍无条件给出「关闭思考」位置,选中后发出 `reasoning_effort: 'none'`,而官方文档明写 `"none"` 请求 `false`:**等于对一个明确声明不接受 `false` 的模型发了 `false`**。同源漏洞是混合声明 `['low','high',false]` 被判成 `levels` 后 `false` 被字符串分支静默丢弃,该位置**选了什么也不发**。修法不是加特例,而是让正反两向由**同一张表** `{ value, id, name }` 导出:`true` → 开启思考、`false` → 关闭思考、字符串原样保留拼写与声明顺序。`values:[true]` 因此不再提供关闭位,`['low','high',false]` 则三项齐全且各自发出正确的 wire 值。
|
|
10
|
+
- **第三处:接通设置页默认档位**。`OllamaWebStatus` 增加 `defaultReasoningEffort`,`/settings` 与 `/models` 两个分支接受并校验它(只收 `null` 或四档词表,越界返回 400;校验前置到写入之前,避免带多个字段的请求被半应用),客户端新增 `setDefaultReasoningEffort()` 与一个下拉框,`null` 是「不指定」这一可撤销的真实取值而非缺省。
|
|
11
|
+
- **降级纪律**:探测的每一种失败形态(无凭据 / 网络错 / 401 / 500 / 代理 HTML / 结构不符 / 空 values)都返回 `undefined` 且**绝不抛错**——读不到元数据只是「少一个阶梯」,不能让设置页或聊天链路出错。请求侧同理:目标模型表达不出的档位**只丢档位、不丢回合**。探测按 modelId 记忆化(仅成功才缓存,并发合并为一次),且在 `requestStream` 内**惰性**发起——无条件探测会读空 `test/stream-activity-idle.test.ts` 手工喂的心跳流,该用例会变红(此约束写在 `adapter.ts` 注释里)。
|
|
12
|
+
- **验证**:`npm run typecheck` 0 错误;全量 `npm test` 220 passed | 1 skipped(221 文件)、**3670 passed | 7 skipped | 0 failed**。新增 `test/ollama-thinking.test.ts`(24 例,覆盖 `[true]` 无关闭位、两种布尔声明顺序、混合声明三位置各自的 wire 值、8 种探测失败形态、记忆化与并发合并、`:cloud` 后缀命中)与路由/卡片各 7 例。既有 20 例中 19 例一字未改;1 例按新语义重新锚定(`drops an unexpressible stored level...`:原断言 `reasoning_effort === 'auto'`,那正是「把 high 强扭成 true」的旧特例,改为 `toBeUndefined()`——新值更严格,用例主张不变)。
|
|
13
|
+
- **独立验证**:调度者另写一次性用例断言最强不变量——「每一个被提供的档位都能反查回一个声明过的 wire 值」,7/7 通过后删除。
|
|
14
|
+
- **诚实声明**:全部证据来自官方文档与桩测,**没有**对真实 Ollama Cloud 账号实测过各模型的 `/api/show` 返回;「档位会正确出现」是由文档加 444 例桩测推出的结论,不是眼见为实。
|
|
15
|
+
|
|
16
|
+
- **[GLM(ZCode 账号)] 删除客户端签名层(Client Signing V4),并把四条外部证据补进 README 已知限制**
|
|
17
|
+
- **问题**:签名层以「实现了但默认关闭 + 能力门控」的形态长期留在生产路径上——`signing.ts`、契约里的能力位、`DSH_GLM_*` 开关一应俱全,README 也照此写着「默认关、需要显式打开」。它本身是 C 级证据(社区经验 / 架构推断,无实测),按本仓库规则 C 级「不得进入默认路径」;而这一次连一份**能证明自己有用**的证据都没有。
|
|
18
|
+
- **后果**:一个逆向来的签名算法(移植自 MIT 的 `zcode-signer.ts`)留在仓库里、留在能力清单里、留在环境变量表里,此后每一轮改动都要再回答一次「这个开关要不要动」。唯一有实测记录的项目做过 A/B 对照,**带签名与不带签名的响应归一化后完全一致**(都是 429/1113);官方那个本可当作开关信号的 feature gate 端点 `/api/v1/agent/configs` **根本不校验凭据**,两类凭据拿到逐字相同的响应,答不了「签名是否启用」。README 里那句「默认关、需要显式打开」还会让读者以为存在一个可开启的官方机制。
|
|
19
|
+
- **修法**:**整层删除**——生产路径上不再有任何签名接线、能力门控或环境变量入口,能力清单里的对应条目一并去掉。**没被证明的那一半照记不误**:服务端是否真会因为缺签名返回签名错误,至今从未被观察到;这不是「已验证不需要签名」,而是「从未验证过」,两者的区别不因为实现被删掉而消失。
|
|
20
|
+
- **文档**:四条有外部证据的事实补进 README 的「已知限制」,逐字引用并注明来源与证据等级:① 签名层**已删除**及其依据(实测 A/B 归一化一致 + 官方 gate 不校验凭据);② 资源包 / 充值余额与套餐额度**互不消耗**,资源包的入口是通用面 `/api/paas/v4` + 开放平台 API Key,本线路不接(官方配置页 zcode.z.ai/cn/docs/configuration 逐字);③ 免费体验额度的**逐模型构成**(GLM-5.3 300 万 token / 日、GLM-5.3-Flash 500 万 token / 日)与**时限**(仅限 5 天、过期不再补发,官方配置页逐字);④ 本线路**直连** `api.z.ai/api/anthropic`,而官方客户端在 fetch 层把它重写到 `/api/v1/ultra*` 托管网关(官方开源仓库逐字),因此记为观察项而非缺陷。
|
|
21
|
+
- **测试**:删除 `test/glm-coding-plan-signing.test.ts`(原 514 行);不新增用例——被删掉的是一整条能力,生产面随之消失,没有留下需要新覆盖的分支。
|
|
22
|
+
- **验证:`npm run typecheck` 0 错误;全量 `npm test` 219 passed | 1 skipped(220 文件)、3632 passed | 7 skipped | 0 failed。** 改动前基线为 221 passed | 1 skipped(221 文件)、3653 passed | 7 skipped(3660):减少的 21 例与 1 个文件正是被删掉的 `test/glm-coding-plan-signing.test.ts`(21 例 / 514 行),其余用例计数未变。
|
|
23
|
+
|
|
5
24
|
## 0.22.0 - 2026-10-12
|
|
6
25
|
- **[WorkBuddy / 共享号池] 非鉴权的 403 不再误杀整个账号池;「全部账号不可用」不再伪造 429 与 15 分钟冷却(issue #53)**
|
|
7
26
|
- **问题 1(403 一律=凭据失效)**:WorkBuddy 的 `classifyFailure` 只看状态码,`401 || 403` 无条件返回 `INVALID_CREDENTIAL`。代理 / lane 策略 / 同 lane 其它插件合成的应用层拒绝(issue 给出的实测体:`{"error":{"type":"server_error","code":"dsh_compaction_refused","retryable":false}}`)因此被当成 token 失效,账号池把**每一个**账号依次 `markAuthFailed` → `authStatus="expired"`——拒绝属于 lane 而不属于某个账号,所以三个账号无一幸免——此后每个请求在发出前即失败,且**不会自愈**,只有重新登录才能恢复。
|
package/README.md
CHANGED
|
@@ -860,9 +860,12 @@ access token / refresh token / 授权码 / PKCE verifier**;诊断里提到某
|
|
|
860
860
|
确切错误码与重置节奏;
|
|
861
861
|
- 「闲时任务」类免费算力(welcome 页所述)本线路**未接入**,它属于另一条调度路径。
|
|
862
862
|
- **上游没有 refresh_token 交换接口。** 官方客户端对刷新直接抛「OAuth 暂未提供 refresh token 交换接口,请重新登录」。因此 `access_token` 过期**只能重新登录**;插件能自动重取的只有业务 JWT 这一层(提前 120 秒 + 0~60 秒抖动防尖峰),而且**它只服务国际区**。账号行上的「重新登录」在 host 这一侧只做两件事:撤掉鉴权失败标记与冷却,让这一行重新参与轮转;真正的登录要由卡片再开一次流程。
|
|
863
|
-
- **客户端签名层(Client Signing V4
|
|
863
|
+
- **客户端签名层(Client Signing V4)已从本线路删除——不是默认关闭,也没有可显式打开的开关。** 生产路径上不再有任何签名接线、能力门控或环境变量入口,一个逆向来的签名算法连同它自己那份故障面一起被移除。删它的理由是它**从未有过能支撑上线的证据**:唯一有实测记录的项目做过 A/B 对照,**带签名与不带签名的响应归一化后完全一致**(都是 429/1113),从未观察到服务端因为缺签名而拒绝请求;而官方那个本可当作开关信号的 feature gate 端点 `/api/v1/agent/configs` **根本不校验凭据**——两类凭据拿到逐字相同的响应,所以它答不了「签名是否启用」,拿它当证据等于把一份不区分凭据的响应读成了区分。留下这条限制是为了同时记着**没被证明的那一半**:服务端是否真会因为缺签名返回签名错误,**至今从未被观察到**——这不是「已验证不需要签名」,而是「从未验证过」,两者的区别不因为实现被删掉而消失。
|
|
864
|
+
- **资源包 / 充值余额与套餐额度互不消耗,本线路两边都碰不到用户充的钱。** 官方文档 zcode.z.ai/cn/docs/configuration 把资源包写成**与 Coding Plan 并列的另一个入口**:一节标题就是『资源包 / 充值余额』,正文『使用开放平台模型资源包或充值余额等通用 API 场景,填写 OpenAI 接口地址即可』,给的地址是通用面 `https://open.bigmodel.cn/api/paas/v4`(国际区 `https://api.z.ai/api/paas/v4`)。同一页逐字:『Anthropic 接口不适用于资源包 / 余额场景:只有从未购买过 Coding Plan 的账号,走 Anthropic 接口时才会消耗余额;只要买过套餐(无论是否用完、是否到期),该接口都不会走余额,需要额外加白处理』;『Coding 端点仅限 Coding 场景,与通用端点不可互相替代,也不会互相消耗额度』。因此本线路的模型面(Anthropic)与套餐面在结构上就不触及资源包:**资源包的入口是上面那个通用面,凭据是开放平台的 API Key**——官方在这一节的措辞是「API Key 模式」,与「编程套餐」授权绑定账号的**非 API Key 模式**相对,**不是本线路换出来的那把 Coding Plan Key,本线路根本不接这类 Key**。用户在这条线路上**不会**误烧充值余额;要确实用资源包,请走 DSH 自带的「自定义模型 API」,那是另一个面、另一把 Key。
|
|
865
|
+
- **免费体验额度的逐模型构成与时限(只补上一条已有条目没写的两项,不重复它)。** 上一条只写了体验额度存在,没写它由哪几个模型、各多少、什么时候失效。官方配置页(逐字:zcode.z.ai/cn/docs/configuration):『每日体验额度由两类模型额度组成…… GLM-5.3 300 万 token / 日;GLM-5.3-Flash 500 万 token / 日』;『注意:体验额度仅限 5 天。每日额度只在这 5 天内发放,体验期结束后即失效,并非长期每天都有』。两者相加正好是那句「每天 800 万 token」——但**这是两个模型各自的份额,不是所有 GLM 模型共享的一口池子**,也只有 GLM-5.3 / GLM-5.3-Flash 沾得到;体验期一过额度**不再补发**,卡片上「免费体验额度」那一档不能读成长期权益。**仍未验证(拿到账号后请先复验)**:这两个日额度用尽后服务端返回的确切业务码、以及每日重置发生在什么钟点,仍没有实机样本。
|
|
866
|
+
- **与官方路径的形态差异:本线路直连 `api.z.ai/api/anthropic`,官方客户端却在 fetch 层把同一个 URL 重写到托管网关。** 官方开源仓库 `zai-org/ZCode` 的 `apps/zcode-cli/packages/adapters/src/model/official-coding-plan-gateway.ts` 里,`GATEWAY_PATH_BY_ENDPOINT` 把 `'https://api.z.ai:443/api/anthropic/v1/messages'` 映射到 `'/api/v1/ultra-zai/anthropic/v1/messages'`、把 `'https://open.bigmodel.cn:443/api/anthropic/v1/messages'` 映射到 `'/api/v1/ultra/anthropic/v1/messages'`。也就是说官方那一侧**不打这个基址**,而是在 fetch 层改写到 `/api/v1/ultra*` 网关前缀下;本线路照抄的是前一个形状。这记为**观察项而不是缺陷**:两个独立的第三方实现直连该基址都成功过(能拿到 1113 业务码恰恰说明认证这一关已经过了),而网关前缀是官方托管面自己的编排,本线路不复刻它、也不需要它。**仍未验证**:托管网关是否会在某些请求特征上施加通用面没有的额外策略。
|
|
864
867
|
- **国区兑换链未验证。** 证据来自三个社区实现(等级 B,逆向实测而非官方契约),三者**都以国际区为主**,国区业务面的形状是否同构没有实测样本。国区兑换失败会带上明确说明与下一步建议(改用国际区,或用 `DSH_GLM_CN_BUSINESS_HOST` 等环境变量指向实测过的部署),**不静默失败**。同理,国区配额到底打 `bigmodel.cn` 还是官方文档里那句「亦可用 `open.bigmodel.cn`」也没有实测,本插件取 `bigmodel.cn`。
|
|
865
|
-
- **兑换链的所有端点都可用 `DSH_GLM_*` 环境变量覆盖**(两区的业务 host、模型面 host、授权入口、appId / client_id、Key 名、OAuth
|
|
868
|
+
- **兑换链的所有端点都可用 `DSH_GLM_*` 环境变量覆盖**(两区的业务 host、模型面 host、授权入口、appId / client_id、Key 名、OAuth 控制面基址)。这是为等级 B 的兑换链准备的退路:上游一次变更让整条链失效时,回滚是改一个环境变量,而不是发一个版本。
|
|
866
869
|
|
|
867
870
|
## Step Code(Step Plan 订阅)线路
|
|
868
871
|
|
package/lib/client.js
CHANGED
|
@@ -3511,7 +3511,7 @@ window.__ModuleLoader__.load({
|
|
|
3511
3511
|
* Display label per reasoning level. The locale dictionary only accepts flat
|
|
3512
3512
|
* string values, so this nested table lives with the control that renders it.
|
|
3513
3513
|
*/
|
|
3514
|
-
const EFFORT_LABELS$
|
|
3514
|
+
const EFFORT_LABELS$3 = {
|
|
3515
3515
|
none: "Off",
|
|
3516
3516
|
minimal: "Minimal",
|
|
3517
3517
|
low: "Low",
|
|
@@ -3995,7 +3995,7 @@ window.__ModuleLoader__.load({
|
|
|
3995
3995
|
children: t.defaultEffortAuto
|
|
3996
3996
|
}), COMMAND_CODE_REASONING_EFFORTS.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3997
3997
|
value: effort,
|
|
3998
|
-
children: EFFORT_LABELS$
|
|
3998
|
+
children: EFFORT_LABELS$3[effort]
|
|
3999
3999
|
}, effort))]
|
|
4000
4000
|
})]
|
|
4001
4001
|
})]
|
|
@@ -5912,7 +5912,7 @@ window.__ModuleLoader__.load({
|
|
|
5912
5912
|
* Display label per reasoning level. The locale dictionary only accepts flat
|
|
5913
5913
|
* string values, so this nested table lives with the control that renders it.
|
|
5914
5914
|
*/
|
|
5915
|
-
const EFFORT_LABELS$
|
|
5915
|
+
const EFFORT_LABELS$2 = {
|
|
5916
5916
|
minimal: "Minimal",
|
|
5917
5917
|
low: "Low",
|
|
5918
5918
|
medium: "Medium",
|
|
@@ -6228,11 +6228,11 @@ window.__ModuleLoader__.load({
|
|
|
6228
6228
|
}),
|
|
6229
6229
|
strayEffort !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6230
6230
|
value: strayEffort,
|
|
6231
|
-
children: `${EFFORT_LABELS$
|
|
6231
|
+
children: `${EFFORT_LABELS$2[strayEffort]} (${t.effortUnsupported})`
|
|
6232
6232
|
}) : null,
|
|
6233
6233
|
effortChoices.map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6234
6234
|
value: choice.value,
|
|
6235
|
-
children: choice.models.length === allModels.length ? EFFORT_LABELS$
|
|
6235
|
+
children: choice.models.length === allModels.length ? EFFORT_LABELS$2[choice.value] : `${EFFORT_LABELS$2[choice.value]} (${choice.models.length}/${allModels.length})`
|
|
6236
6236
|
}, choice.value))
|
|
6237
6237
|
]
|
|
6238
6238
|
})]
|
|
@@ -7822,7 +7822,7 @@ window.__ModuleLoader__.load({
|
|
|
7822
7822
|
saved: "已保存",
|
|
7823
7823
|
invalidCapacity: "容量格式无效:{value}",
|
|
7824
7824
|
quotaSection: "用量与配额",
|
|
7825
|
-
quotaDesc: "数据来自 Coding Plan
|
|
7825
|
+
quotaDesc: "数据来自 Coding Plan 的配额接口,页面可见时最多每 60 秒刷新一次。",
|
|
7826
7826
|
quotaRefresh: "刷新用量",
|
|
7827
7827
|
quotaRefreshing: "刷新中...",
|
|
7828
7828
|
quotaSignedOut: "未登录,先在上方完成登录授权。",
|
|
@@ -7832,14 +7832,13 @@ window.__ModuleLoader__.load({
|
|
|
7832
7832
|
quotaRenews: "续费时间",
|
|
7833
7833
|
quotaReadAt: "读取时间",
|
|
7834
7834
|
quotaSources: "数据源",
|
|
7835
|
-
quotaWindowNames: "窗口名按窗口长度本地化(5 小时 / 1 周 / 1 月),不在本页硬编码;每个账号自己的进度条画在它的账号卡片里。",
|
|
7836
7835
|
quotaRefreshingNote: "正在后台刷新配额,下方是上一次读到的数字。",
|
|
7837
7836
|
quotaErrorLabel: "配额读取失败",
|
|
7838
7837
|
quotaAllowance: "额度类型",
|
|
7839
7838
|
quotaAllowancePlan: "付费套餐",
|
|
7840
7839
|
quotaAllowanceFreeTrial: "免费体验额度",
|
|
7841
7840
|
quotaAllowanceUnknown: "未判定",
|
|
7842
|
-
quotaAllowanceHint: "
|
|
7841
|
+
quotaAllowanceHint: "登录时探活认定的额度来源。「免费体验额度」指新用户注册后自动获得、首次使用起 5 天内每天 800 万 token 的体验额度。"
|
|
7843
7842
|
};
|
|
7844
7843
|
const en$4 = {
|
|
7845
7844
|
...accountPoolEn,
|
|
@@ -7917,7 +7916,7 @@ window.__ModuleLoader__.load({
|
|
|
7917
7916
|
saved: "Saved",
|
|
7918
7917
|
invalidCapacity: "Invalid capacity: {value}",
|
|
7919
7918
|
quotaSection: "Usage & quota",
|
|
7920
|
-
quotaDesc: "Read from the Coding Plan quota endpoint
|
|
7919
|
+
quotaDesc: "Read from the Coding Plan quota endpoint; refreshes at most once every 60 seconds while visible.",
|
|
7921
7920
|
quotaRefresh: "Refresh usage",
|
|
7922
7921
|
quotaRefreshing: "Refreshing...",
|
|
7923
7922
|
quotaSignedOut: "Not signed in — finish the sign-in above first.",
|
|
@@ -7927,14 +7926,13 @@ window.__ModuleLoader__.load({
|
|
|
7927
7926
|
quotaRenews: "Renews",
|
|
7928
7927
|
quotaReadAt: "Read at",
|
|
7929
7928
|
quotaSources: "Sources",
|
|
7930
|
-
quotaWindowNames: "Window names are localized from the window length (5 hours / 1 week / 1 month) rather than hardcoded here; each account's own progress bar is drawn on its account card.",
|
|
7931
7929
|
quotaRefreshingNote: "Quota is refreshing in the background; the figures below are the last read.",
|
|
7932
7930
|
quotaErrorLabel: "Quota read failed",
|
|
7933
7931
|
quotaAllowance: "Allowance",
|
|
7934
7932
|
quotaAllowancePlan: "Paid plan",
|
|
7935
7933
|
quotaAllowanceFreeTrial: "Free trial allowance",
|
|
7936
7934
|
quotaAllowanceUnknown: "Undetermined",
|
|
7937
|
-
quotaAllowanceHint: "The allowance source established by the sign-in probe. “Free trial allowance”
|
|
7935
|
+
quotaAllowanceHint: "The allowance source established by the sign-in probe. “Free trial allowance” means 8M tokens per day for 5 days from first use, granted automatically to new accounts."
|
|
7938
7936
|
};
|
|
7939
7937
|
const dictionaries$4 = {
|
|
7940
7938
|
zh: zh$4,
|
|
@@ -8788,10 +8786,6 @@ window.__ModuleLoader__.load({
|
|
|
8788
8786
|
className: "dsha-muted",
|
|
8789
8787
|
children: poolLabels.quotaFactsScope
|
|
8790
8788
|
}),
|
|
8791
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8792
|
-
className: "dsha-muted",
|
|
8793
|
-
children: t.quotaWindowNames
|
|
8794
|
-
}),
|
|
8795
8789
|
status?.quotaRefreshing === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8796
8790
|
className: "dsha-notice",
|
|
8797
8791
|
children: t.quotaRefreshingNote
|
|
@@ -9632,7 +9626,7 @@ window.__ModuleLoader__.load({
|
|
|
9632
9626
|
* Every level the wire can name is listed, 'xhigh' included: filtering a level
|
|
9633
9627
|
* out here would hide a choice the host would accept and a catalog may expose.
|
|
9634
9628
|
*/
|
|
9635
|
-
const EFFORT_LABELS = {
|
|
9629
|
+
const EFFORT_LABELS$1 = {
|
|
9636
9630
|
low: zh$3.effortLow,
|
|
9637
9631
|
medium: zh$3.effortMedium,
|
|
9638
9632
|
high: zh$3.effortHigh,
|
|
@@ -9915,7 +9909,7 @@ window.__ModuleLoader__.load({
|
|
|
9915
9909
|
children: t.defaultEffortAuto
|
|
9916
9910
|
}), CLAUDE_REASONING_EFFORTS.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9917
9911
|
value: effort,
|
|
9918
|
-
children: EFFORT_LABELS[effort]
|
|
9912
|
+
children: EFFORT_LABELS$1[effort]
|
|
9919
9913
|
}, effort))]
|
|
9920
9914
|
})]
|
|
9921
9915
|
}),
|
|
@@ -10116,6 +10110,29 @@ window.__ModuleLoader__.load({
|
|
|
10116
10110
|
});
|
|
10117
10111
|
}
|
|
10118
10112
|
//#endregion
|
|
10113
|
+
//#region src/shared/ollama-contracts.ts
|
|
10114
|
+
/**
|
|
10115
|
+
* The thinking levels this line's card offers.
|
|
10116
|
+
*
|
|
10117
|
+
* Deliberately narrower than the union of what every model accepts. Ollama's
|
|
10118
|
+
* thinking control comes in three shapes (see {@link thinkingModeForModel} in
|
|
10119
|
+
* src/host/ollama/types.ts): gpt-oss takes low/medium/high, the boolean models
|
|
10120
|
+
* (deepseek-r1, qwq, qwen3) take only on/off, and every other model takes no
|
|
10121
|
+
* thinking control at all. These four strings are the vocabulary both shapes can
|
|
10122
|
+
* be expressed with, so one dropdown covers the whole line.
|
|
10123
|
+
*
|
|
10124
|
+
* Whether a given model can actually honour a level is decided by the host, not
|
|
10125
|
+
* by this list: {@link thinkForModel} in src/host/ollama/types.ts drops what a
|
|
10126
|
+
* model cannot express, so picking 'high' is safe for a user whose catalog holds
|
|
10127
|
+
* a mixture of families.
|
|
10128
|
+
*/
|
|
10129
|
+
const OLLAMA_REASONING_EFFORTS = [
|
|
10130
|
+
"none",
|
|
10131
|
+
"low",
|
|
10132
|
+
"medium",
|
|
10133
|
+
"high"
|
|
10134
|
+
];
|
|
10135
|
+
//#endregion
|
|
10119
10136
|
//#region src/client/ollama/api.ts
|
|
10120
10137
|
const API$1 = "/ollama/api";
|
|
10121
10138
|
/**
|
|
@@ -10144,6 +10161,21 @@ window.__ModuleLoader__.load({
|
|
|
10144
10161
|
return post$1(`${API$1}/catalog/refresh`, {});
|
|
10145
10162
|
}
|
|
10146
10163
|
/**
|
|
10164
|
+
* Store the default thinking level, answering with the refreshed status.
|
|
10165
|
+
*
|
|
10166
|
+
* '/settings' replies with the stored settings document rather than with the
|
|
10167
|
+
* status the card renders, so the status is re-read behind the write. That is
|
|
10168
|
+
* the same shape {@link refreshCatalog} needs, and it is why the return type is
|
|
10169
|
+
* a status: handing the settings document to the renderer would blank the
|
|
10170
|
+
* model list the user just configured.
|
|
10171
|
+
*
|
|
10172
|
+
* null is a real value ('do not specify'), not an absent one, so it is sent
|
|
10173
|
+
* explicitly rather than left out of the body.
|
|
10174
|
+
*/
|
|
10175
|
+
setDefaultReasoningEffort(effort) {
|
|
10176
|
+
return post$1(`${API$1}/settings`, { defaultReasoningEffort: effort }).then(() => this.status());
|
|
10177
|
+
}
|
|
10178
|
+
/**
|
|
10147
10179
|
* Replace the enabled-model selection.
|
|
10148
10180
|
*
|
|
10149
10181
|
* The whole list is sent rather than a single id's new state, because the card
|
|
@@ -10242,6 +10274,10 @@ window.__ModuleLoader__.load({
|
|
|
10242
10274
|
selectAll: "全选",
|
|
10243
10275
|
unselectAll: "全不选",
|
|
10244
10276
|
noneSelected: "未选择任何模型,该线路不会出现在模型选择器中。",
|
|
10277
|
+
enhanced: "增强功能",
|
|
10278
|
+
defaultReasoningEffort: "默认思考档位",
|
|
10279
|
+
defaultReasoningEffortHint: "只对支持思考控制的模型生效。具体可选档位由模型自身决定:gpt-oss 一类只接受 low / medium / high,deepseek-r1 一类只有开或关,其余模型不接受思考控制,Host 会按模型形态收敛。选「不指定」时使用模型自身的默认值。",
|
|
10280
|
+
defaultEffortAuto: "不指定",
|
|
10245
10281
|
limitsSection: "能力边界",
|
|
10246
10282
|
limitsHint: "以下为 Ollama Cloud 官方文档列出的限制,本线路不会绕过:",
|
|
10247
10283
|
limitNoStateful: "不支持 Responses 的有状态会话(仅无状态形式)。",
|
|
@@ -10290,6 +10326,10 @@ window.__ModuleLoader__.load({
|
|
|
10290
10326
|
selectAll: "Select all",
|
|
10291
10327
|
unselectAll: "Clear all",
|
|
10292
10328
|
noneSelected: "No models are selected, so this line will not appear in the model picker.",
|
|
10329
|
+
enhanced: "Enhanced",
|
|
10330
|
+
defaultReasoningEffort: "Default thinking level",
|
|
10331
|
+
defaultReasoningEffortHint: "Applies only to models that accept thinking control. The levels a model can take are its own: the gpt-oss family takes low / medium / high, the deepseek-r1 family takes only on or off, and the rest take no thinking control at all — the Host narrows the stored level to what the target model accepts. Choose \"Do not specify\" to leave each model on its own default.",
|
|
10332
|
+
defaultEffortAuto: "Do not specify",
|
|
10293
10333
|
limitsSection: "Documented limits",
|
|
10294
10334
|
limitsHint: "Ollama Cloud documents these limits; this line does not work around them:",
|
|
10295
10335
|
limitNoStateful: "No stateful Responses (stateless only).",
|
|
@@ -10317,6 +10357,20 @@ window.__ModuleLoader__.load({
|
|
|
10317
10357
|
//#region src/client/ollama/OllamaSection.tsx
|
|
10318
10358
|
const API = new OllamaApi();
|
|
10319
10359
|
/**
|
|
10360
|
+
* What each thinking level says in this card.
|
|
10361
|
+
*
|
|
10362
|
+
* 'none' is the only one that needs words, because it is not a weaker rung on
|
|
10363
|
+
* the same ladder: it means "send no thinking control", which for the boolean
|
|
10364
|
+
* families (deepseek-r1 and friends) is an explicit off, and for gpt-oss means
|
|
10365
|
+
* nothing at all. The other three are spelled the way the models spell them.
|
|
10366
|
+
*/
|
|
10367
|
+
const EFFORT_LABELS = {
|
|
10368
|
+
none: "none(关闭思考)",
|
|
10369
|
+
low: "low(低)",
|
|
10370
|
+
medium: "medium(中)",
|
|
10371
|
+
high: "high(高)"
|
|
10372
|
+
};
|
|
10373
|
+
/**
|
|
10320
10374
|
* A token count short enough to sit in an account card.
|
|
10321
10375
|
*
|
|
10322
10376
|
* Exact below a thousand, then thousands, then millions. A six-figure number with
|
|
@@ -10420,6 +10474,9 @@ window.__ModuleLoader__.load({
|
|
|
10420
10474
|
const setAllModels = (0, react.useCallback)((selectAll) => {
|
|
10421
10475
|
applyEnabled(selectAll ? null : []);
|
|
10422
10476
|
}, [applyEnabled]);
|
|
10477
|
+
const setEffort = (0, react.useCallback)((value) => {
|
|
10478
|
+
run("effort", () => API.setDefaultReasoningEffort(value === "" ? null : value));
|
|
10479
|
+
}, [run]);
|
|
10423
10480
|
const t = zh$2;
|
|
10424
10481
|
const pool = status?.pool;
|
|
10425
10482
|
const models = status?.models ?? [];
|
|
@@ -10593,6 +10650,32 @@ window.__ModuleLoader__.load({
|
|
|
10593
10650
|
})] })
|
|
10594
10651
|
]
|
|
10595
10652
|
}),
|
|
10653
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10654
|
+
className: "dsha-group",
|
|
10655
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10656
|
+
className: "dsha-grouphead",
|
|
10657
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.enhanced })
|
|
10658
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10659
|
+
className: "dsha-pref-row",
|
|
10660
|
+
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", {
|
|
10661
|
+
className: "dsha-muted",
|
|
10662
|
+
children: t.defaultReasoningEffortHint
|
|
10663
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
10664
|
+
className: "dsha-select",
|
|
10665
|
+
"aria-label": t.defaultReasoningEffort,
|
|
10666
|
+
value: status?.defaultReasoningEffort ?? "",
|
|
10667
|
+
disabled: busy !== null,
|
|
10668
|
+
onChange: (event) => setEffort(event.currentTarget.value),
|
|
10669
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
10670
|
+
value: "",
|
|
10671
|
+
children: t.defaultEffortAuto
|
|
10672
|
+
}), OLLAMA_REASONING_EFFORTS.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
10673
|
+
value: effort,
|
|
10674
|
+
children: EFFORT_LABELS[effort]
|
|
10675
|
+
}, effort))]
|
|
10676
|
+
})]
|
|
10677
|
+
})]
|
|
10678
|
+
}),
|
|
10596
10679
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10597
10680
|
className: "dsha-group",
|
|
10598
10681
|
children: [
|