@eddyskywalker/dsh-chatgpt-subscription 0.43.1 → 0.45.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 +29 -0
- package/cordis.patch.yml +5 -0
- package/lib/client.js +94 -8
- package/lib/client.js.map +1 -1
- package/lib/entry-progress-updates-CkGJr_fe.js +1004 -0
- package/lib/index.js +2011 -847
- package/lib/progress-updates.js +2 -0
- package/lib/types/client/progress-updates/host-source.d.ts +16 -0
- package/lib/types/client/progress-updates/host-source.d.ts.map +1 -1
- package/lib/types/client/progress-updates/index.d.ts.map +1 -1
- package/lib/types/client/progress-updates/settings-binding.d.ts +5 -0
- package/lib/types/client/progress-updates/settings-binding.d.ts.map +1 -1
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/entry-progress-updates.d.ts +43 -0
- package/lib/types/entry-progress-updates.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/budget.d.ts +64 -0
- package/lib/types/host/cache-warmup/budget.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/contracts.d.ts +267 -0
- package/lib/types/host/cache-warmup/contracts.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/index.d.ts +21 -0
- package/lib/types/host/cache-warmup/index.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/install.d.ts +130 -0
- package/lib/types/host/cache-warmup/install.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/logging.d.ts +120 -0
- package/lib/types/host/cache-warmup/logging.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/projection.d.ts +29 -0
- package/lib/types/host/cache-warmup/projection.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/result-tool.d.ts +87 -0
- package/lib/types/host/cache-warmup/result-tool.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/settings.d.ts +73 -0
- package/lib/types/host/cache-warmup/settings.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/store.d.ts +108 -0
- package/lib/types/host/cache-warmup/store.d.ts.map +1 -0
- package/lib/types/host/cache-warmup/usage.d.ts +86 -0
- package/lib/types/host/cache-warmup/usage.d.ts.map +1 -0
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/proxy-manager.d.ts +6 -0
- package/lib/types/host/proxy-manager.d.ts.map +1 -1
- package/lib/types/index.d.ts +32 -25
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/model-catalog.d.ts +12 -1
- package/lib/types/shared/model-catalog.d.ts.map +1 -1
- package/locale/progress-updates/en.json +6 -0
- package/locale/progress-updates/zh.json +6 -0
- package/package.json +13 -3
- package/progress-updates.svg +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.45.0 - 2026-10-28
|
|
6
|
+
|
|
7
|
+
- **[kimi-code] 新增 `cache-warmup` 子包:稳定前缀下快速预热、保守结果投影与原文引用**
|
|
8
|
+
- **实现**:新增 `src/host/cache-warmup/`,提供内容寻址原文存储、UTF-8/结构化分页、完整失败集与日志投影、预热预算、真实 Kimi 用量观测、`cache_warmup_result` 精确补读、设置开关及脱敏结构化日志;`cacheWarmup` 默认开启且只影响新结果。
|
|
9
|
+
- **保护**:不改 promptCacheKey、replay、动态工具 in-history 或漂移保护;旧历史永不回写,原始 `value` 保留,`stable`/`first-request` 不再被误判为漂移,真实 drift 仍立即收回预算。
|
|
10
|
+
- **准确性**:源码、契约、完整或被截断的 JSON、混合证据与未知大文本保持原样;只有可完整提取的日志/结构化结果生成 preview,完整失败集装不下时回退原文。
|
|
11
|
+
- **验证**:六份相关测试 104 passed / 1 skipped;全量 Vitest 309 files / 5093 tests passed(9 skipped);typecheck、build、pack dry-run、npm ci dry-run 全过。真实 110 条工具结果重放仅 1 条测试日志被投影。
|
|
12
|
+
- **真实 Kimi**:k3.1-pro 第二次请求命中率 97.66%(达到 97% 目标,但仅一次达标,未满足连续两次),第三次 95.52%,控制器保持保守预算;三次额度内未证明进入稳态,详见 `docs/cache-warmup.md`。
|
|
13
|
+
|
|
14
|
+
- **[codex-chatgpt] 随包兜底目录补齐 GPT 6.1 Terra (#76)**
|
|
15
|
+
- 新增 `gpt-6.1-terra` / `6.1 Terra` 并默认可见,沿用 GPT-6 的上下文、输出预留、图像输入和推理能力;实时 `/backend-api/codex/models` 发现链路保持不变。
|
|
16
|
+
- 补齐适配器目录、GPT-6 能力与设置页渲染回归覆盖;PR #77。
|
|
17
|
+
|
|
18
|
+
## 0.44.0 - 2026-10-27
|
|
19
|
+
|
|
20
|
+
- **[packaging] 「进展更新」拆成独立组件:同包第二行,可在插件管理页单独关闭**
|
|
21
|
+
- **机制**:`cordis.patch.yml` 现在插两行 loader 条目;新增 `src/entry-progress-updates.ts` 作为第二个宿主入口(自带 `Config`、`inject` 与 `apply`),`package.json` 增加 `exports["./progress-updates"]` 与子路径行的 `locale/*.json` / `icon`,构建多入口产出 `lib/progress-updates.js`。管理页的「包含的组件」因此从 1 变成 2。
|
|
22
|
+
- **设置字段留在核心行**:三个 `volatile` 字段仍声明在 `src/index.ts` 的 `Config`,由核心在 `apply` 时通过 `attachProgressSettings()` 把读取器交给新行(两行的挂载顺序两种都兜住)。不能搬走的原因很实在:profile 的 patch 层按 id 定位**替换整行 config**,而用户 profile 早就在核心行写了 `progressUpdates: true`——字段搬去新行,那条 patch 会把新行配置整体抹掉、schema 默认值填回 false,于是「设置显示打开、实际是关的」。
|
|
23
|
+
- **前端自隐**:同包多行只拆宿主——浏览器半边仍按包加载。客户端挂载时探一次 `GET api/dsh-progress-updates/updates`:**只有路由自己回的 JSON 404/405** 才说明那一行没装(网关兜底的纯文本 `not found` 也是 404,第一版据此把装着它的实例的 UI 也撤了),网络错误按「装着」处理。
|
|
24
|
+
- **回归**:`progress-updates-live-ref-and-route` 改为读新入口的 `Config`;新增 3 例(宿主不在时撤注册、宿主在时不动、探测失败按装着);`minimax-media-tool-registration` 改为断言 `progress_update` 不再属于核心行。
|
|
25
|
+
- **验证**:`npm run typecheck` 0 错误;全量 Vitest **4906 passed / 10 skipped**(唯一失败仍是 GLM adopt 那个环境用例);`npm run build` 产出 `lib/index.js` + `lib/progress-updates.js`;`npm pack --dry-run` 含 `lib/progress-updates.js`、`locale/progress-updates/{zh,en}.json`、`progress-updates.svg`;直接 import 构建产物确认 `name / apply / Config` 三项齐全、默认值解析为 `true / 8 / auto`。
|
|
26
|
+
- **未验证**:插件管理页上真的出现两个开关需要重启 DSH(bundle patch 在启动时应用),本轮没有重启你的实例。
|
|
27
|
+
|
|
28
|
+
- **[proxy] 代理连接池被销毁不再让回答卡死:死连接自动换新,卸载时优雅关闭**
|
|
29
|
+
- **现象**:长思考进行到一半,界面出现「已重试模型请求(1/3)」与 `terminated: The client is destroyed`,随后「已停止」。与 0.43.0 修的 180 秒超时是两个不同的故障。
|
|
30
|
+
- **为什么**:`terminated` 是 undici 的包装错误,`The client is destroyed` 是它的 `ClientDestroyedError`——请求还在流式读取时,脚下的连接池已经不存在了。这条线还有两处会把「一次事故」放大成「持续故障」:`ProxyManager.dispose()` 用 `destroy()` 立刻拆连接(任何插件卸载都会掐断在途回答),以及被销毁的 agent 仍留在按 URL 缓存的表里,之后每个请求都复用它并在瞬间失败。
|
|
31
|
+
- **改法**:卸载改为 `close()`——等在建请求跑完再释放 socket;代理请求遇到 destroyed-client 家族的错误时,把该 URL 的缓存 agent 摘掉、换一个新连接**重试一次**;错误判定只认这一族,普通的连接失败仍然不重放(那是另一种决定)。
|
|
32
|
+
- **测试**:`test/proxy-manager.test.ts` 新增两例——销毁后换新连接并成功(断言第二次的 dispatcher 不是第一次那个)、普通传输失败只跑一次。
|
|
33
|
+
|
|
5
34
|
## 0.43.1 - 2026-10-27
|
|
6
35
|
|
|
7
36
|
- **[qoder] 上游排队不再被说成「API 密钥无效」;额度用尽与排队分成两条路**
|
package/cordis.patch.yml
CHANGED
|
@@ -4,3 +4,8 @@
|
|
|
4
4
|
- insert:
|
|
5
5
|
- id: dsh-chatgpt-subscription
|
|
6
6
|
name: '@eddyskywalker/dsh-chatgpt-subscription'
|
|
7
|
+
# 第二个组件:「进展更新」。同包多行 = 两个独立的 loader 条目,管理页各有一
|
|
8
|
+
# 个开关;浏览器半边仍只有一份 bundle(`dsh.client` 按包声明),所以它自己
|
|
9
|
+
# 探测这一行的路由在不在,不在就不注册面板与设置分区。
|
|
10
|
+
- id: dsh-chatgpt-subscription-progress-updates
|
|
11
|
+
name: '@eddyskywalker/dsh-chatgpt-subscription/progress-updates'
|
package/lib/client.js
CHANGED
|
@@ -743,6 +743,18 @@ window.__ModuleLoader__.load({
|
|
|
743
743
|
supportsOutputVerbosity: true,
|
|
744
744
|
defaultOutputVerbosity: "low"
|
|
745
745
|
},
|
|
746
|
+
{
|
|
747
|
+
id: "gpt-6.1-terra",
|
|
748
|
+
name: "6.1 Terra",
|
|
749
|
+
contextWindow: GPT_6_DEFAULT_CONTEXT_WINDOW,
|
|
750
|
+
inputModalities: ["text", "image"],
|
|
751
|
+
defaultReasoningEffort: "medium",
|
|
752
|
+
reasoningProfile: "gpt-6",
|
|
753
|
+
supportsReasoningSummary: true,
|
|
754
|
+
maxTokens: GPT_6_MAX_TOKENS,
|
|
755
|
+
supportsOutputVerbosity: true,
|
|
756
|
+
defaultOutputVerbosity: "low"
|
|
757
|
+
},
|
|
746
758
|
{
|
|
747
759
|
id: "gpt-6-sol",
|
|
748
760
|
name: "6 Sol",
|
|
@@ -834,6 +846,7 @@ window.__ModuleLoader__.load({
|
|
|
834
846
|
const DEFAULT_VISIBLE_CODEX_MODEL_IDS = [
|
|
835
847
|
"gpt-6-astra",
|
|
836
848
|
"gpt-6.1-sol",
|
|
849
|
+
"gpt-6.1-terra",
|
|
837
850
|
"gpt-6-sol",
|
|
838
851
|
"gpt-6-luna",
|
|
839
852
|
"gpt-5.6-sol",
|
|
@@ -53423,6 +53436,44 @@ window.__ModuleLoader__.load({
|
|
|
53423
53436
|
* (同 dsh-usage / dsh-git-graph 的处理)。
|
|
53424
53437
|
*/
|
|
53425
53438
|
const PROGRESS_UPDATES_PATH = "api/dsh-progress-updates/updates";
|
|
53439
|
+
/**
|
|
53440
|
+
* 宿主那一行今天装没装。
|
|
53441
|
+
*
|
|
53442
|
+
* 这个包的浏览器半边按**包**加载:即使「进展更新」那一行被关掉,本 bundle 照样
|
|
53443
|
+
* 会跑,面板与设置分区就会变成两个永远空的壳。所以挂载前问一次宿主的只读路由。
|
|
53444
|
+
*
|
|
53445
|
+
* **只在路由自己说不存在时判「没装」**:本路由的 403(非 loopback)与 200 都说明
|
|
53446
|
+
* 它在;而网关对一个不认识的路径回的那句 `not found`(纯文本或 HTML)也常常是
|
|
53447
|
+
* 404,把「任何 404」当成没装会让装着它的实例把 UI 自己撤掉——第一版就是这么写的,
|
|
53448
|
+
* 实测踩到了。
|
|
53449
|
+
*
|
|
53450
|
+
* 探测失败(网络错误、超时、无法判断)一律按「装着」处理:宁可多一格外壳,也不能
|
|
53451
|
+
* 因为一次抖动把装着的功能判成没装。
|
|
53452
|
+
* @returns 宿主半边是否在线。
|
|
53453
|
+
*/
|
|
53454
|
+
async function isProgressUpdatesHostPresent() {
|
|
53455
|
+
if (typeof fetch !== "function") return true;
|
|
53456
|
+
let response;
|
|
53457
|
+
try {
|
|
53458
|
+
response = await fetch(PROGRESS_UPDATES_PATH, {
|
|
53459
|
+
method: "GET",
|
|
53460
|
+
headers: { accept: "application/json" }
|
|
53461
|
+
});
|
|
53462
|
+
} catch {
|
|
53463
|
+
return true;
|
|
53464
|
+
}
|
|
53465
|
+
if (response.status !== 404 && response.status !== 405) return true;
|
|
53466
|
+
if (!(response.headers.get("content-type") ?? "").toLowerCase().includes("json")) return true;
|
|
53467
|
+
let body;
|
|
53468
|
+
try {
|
|
53469
|
+
body = await response.json();
|
|
53470
|
+
} catch {
|
|
53471
|
+
return true;
|
|
53472
|
+
}
|
|
53473
|
+
if (body === null || typeof body !== "object") return true;
|
|
53474
|
+
const ok = body.ok;
|
|
53475
|
+
return typeof ok === "boolean" ? ok : true;
|
|
53476
|
+
}
|
|
53426
53477
|
/** 默认定时器:直接转发到 `globalThis`(浏览器与 Node 都能跑)。 */
|
|
53427
53478
|
const DEFAULT_TIMERS = {
|
|
53428
53479
|
setInterval: (handler, ms) => globalThis.setInterval(handler, ms),
|
|
@@ -53644,6 +53695,11 @@ window.__ModuleLoader__.load({
|
|
|
53644
53695
|
* 第一项来自 `cordis.patch.yml` 的行 id(独立安装的唯一形态);后两项是聚合安装
|
|
53645
53696
|
* 可能套的前缀。镜像答上来之后不再用这张表的顺序,改用"值里带 `progressUpdates`
|
|
53646
53697
|
* 的那一条"。
|
|
53698
|
+
*
|
|
53699
|
+
* 这三个字段挂在**核心那一行**(`src/index.ts` 的 Config)而不是「进展更新」那一行:
|
|
53700
|
+
* 用户/profile 早就在核心行的 config 里写过 `progressUpdates`,而 loader 的 profile
|
|
53701
|
+
* 层是按 id 替换整行 config 的——字段若搬去新行,profile 一写就等于把那行的开关
|
|
53702
|
+
* 抹成默认值,于是「设置里显示打开」和「实际是关的」同时成立。
|
|
53647
53703
|
*/
|
|
53648
53704
|
const PROGRESS_SETTINGS_ENTRY_IDS = [
|
|
53649
53705
|
"dsh-chatgpt-subscription",
|
|
@@ -53684,6 +53740,10 @@ window.__ModuleLoader__.load({
|
|
|
53684
53740
|
}
|
|
53685
53741
|
/**
|
|
53686
53742
|
* 判断一个条目的解析值是不是本插件的 Config 切片。
|
|
53743
|
+
*
|
|
53744
|
+
* 按**键**认领而不是按行 id:聚合安装会给条目套家族前缀,而字段名是唯一稳定的。
|
|
53745
|
+
* 认领对象是核心行(进度更新的实现行现在没有这些字段了),所以「值里带
|
|
53746
|
+
* `progressUpdates` 的那一条」就正好是设置该写进去的那一条。
|
|
53687
53747
|
* @param value - describe 交来的解析值。
|
|
53688
53748
|
* @returns 是否带 `progressUpdates` 这个键。
|
|
53689
53749
|
*/
|
|
@@ -53857,6 +53917,28 @@ window.__ModuleLoader__.load({
|
|
|
53857
53917
|
*/
|
|
53858
53918
|
const explicitSource = options.source;
|
|
53859
53919
|
/**
|
|
53920
|
+
* 宿主那一行是不是装着。
|
|
53921
|
+
*
|
|
53922
|
+
* 同包多组件之后,关掉「进展更新」只会卸掉宿主那一行:浏览器半边仍随本包的
|
|
53923
|
+
* bundle 加载,面板与设置分区就会变成永远空的壳。启动时问一次宿主的只读路由,
|
|
53924
|
+
* 缺了就撤掉已经注册的槽位、并且不再响应后续出现的槽位。
|
|
53925
|
+
*
|
|
53926
|
+
* 显式给了数据源(测试与将来替换实现)时不探测:那时宿主根本不在链路里。
|
|
53927
|
+
*/
|
|
53928
|
+
let hostPresent = true;
|
|
53929
|
+
const registrations = [];
|
|
53930
|
+
const keep = (dispose) => {
|
|
53931
|
+
registrations.push(dispose);
|
|
53932
|
+
return dispose;
|
|
53933
|
+
};
|
|
53934
|
+
if (explicitSource === void 0) isProgressUpdatesHostPresent().then((present) => {
|
|
53935
|
+
if (present) return;
|
|
53936
|
+
hostPresent = false;
|
|
53937
|
+
for (const dispose of registrations.splice(0)) try {
|
|
53938
|
+
dispose();
|
|
53939
|
+
} catch {}
|
|
53940
|
+
});
|
|
53941
|
+
/**
|
|
53860
53942
|
* 默认数据源:每个会话一份轮询源。
|
|
53861
53943
|
*
|
|
53862
53944
|
* 槽位是 session 作用域的,同一个页签在会话切换时会被重新注入一次;按会话 id
|
|
@@ -53981,37 +54063,40 @@ window.__ModuleLoader__.load({
|
|
|
53981
54063
|
* 这是本特写的主形态——不依赖侧栏,也不依赖宿主路由,只看工具调用的参数。
|
|
53982
54064
|
*/
|
|
53983
54065
|
ctx.slots.inject("tool.call.toolview", () => {
|
|
54066
|
+
if (!hostPresent) return () => {};
|
|
53984
54067
|
try {
|
|
53985
|
-
return ctx.slots.register({
|
|
54068
|
+
return keep(ctx.slots.register({
|
|
53986
54069
|
name: "tool.call.toolview",
|
|
53987
54070
|
key: PROGRESS_UPDATE_TOOL_NAME,
|
|
53988
54071
|
locale: NS_PROGRESS_UPDATES
|
|
53989
|
-
}, ProgressRow);
|
|
54072
|
+
}, ProgressRow));
|
|
53990
54073
|
} catch {
|
|
53991
54074
|
return () => {};
|
|
53992
54075
|
}
|
|
53993
54076
|
});
|
|
53994
54077
|
/** 阶段二:同一个 id 下渲染页签正文。 */
|
|
53995
54078
|
ctx.slots.inject("sidebar.right.pane.tab", () => {
|
|
54079
|
+
if (!hostPresent) return () => {};
|
|
53996
54080
|
try {
|
|
53997
|
-
return ctx.slots.register({
|
|
54081
|
+
return keep(ctx.slots.register({
|
|
53998
54082
|
name: "sidebar.right.pane.tab",
|
|
53999
54083
|
key: PANEL_TAB_ID,
|
|
54000
54084
|
locale: NS_PROGRESS_UPDATES,
|
|
54001
54085
|
inject: (sessionId) => ({ source: explicitSource ?? hostSourceOf(sessionId) })
|
|
54002
|
-
}, ProgressUpdatesTab);
|
|
54086
|
+
}, ProgressUpdatesTab));
|
|
54003
54087
|
} catch {
|
|
54004
54088
|
return () => {};
|
|
54005
54089
|
}
|
|
54006
54090
|
});
|
|
54007
54091
|
/** 阶段二:同一个 id 下渲染页签条上的标题。 */
|
|
54008
54092
|
ctx.slots.inject("sidebar.right.pane.tab.title", () => {
|
|
54093
|
+
if (!hostPresent) return () => {};
|
|
54009
54094
|
try {
|
|
54010
|
-
return ctx.slots.register({
|
|
54095
|
+
return keep(ctx.slots.register({
|
|
54011
54096
|
name: "sidebar.right.pane.tab.title",
|
|
54012
54097
|
key: PANEL_TAB_ID,
|
|
54013
54098
|
locale: NS_PROGRESS_UPDATES
|
|
54014
|
-
}, ProgressUpdatesTabTitle);
|
|
54099
|
+
}, ProgressUpdatesTabTitle));
|
|
54015
54100
|
} catch {
|
|
54016
54101
|
return () => {};
|
|
54017
54102
|
}
|
|
@@ -54022,9 +54107,10 @@ window.__ModuleLoader__.load({
|
|
|
54022
54107
|
* 没有这一格,面板就是注册好了也永远点不开——类型和正文都不会自己长出入口。
|
|
54023
54108
|
*/
|
|
54024
54109
|
ctx.slots.inject("settings.section", () => {
|
|
54110
|
+
if (!hostPresent) return () => {};
|
|
54025
54111
|
try {
|
|
54026
54112
|
const openPanel = openPanelAction(ctx, options.openPanel);
|
|
54027
|
-
return ctx.slots.register({
|
|
54113
|
+
return keep(ctx.slots.register({
|
|
54028
54114
|
name: "settings.section",
|
|
54029
54115
|
id: SETTINGS_SECTION_ID,
|
|
54030
54116
|
order: 150,
|
|
@@ -54043,7 +54129,7 @@ window.__ModuleLoader__.load({
|
|
|
54043
54129
|
settings: currentSettings
|
|
54044
54130
|
};
|
|
54045
54131
|
}
|
|
54046
|
-
}, ProgressUpdatesSettingsSection);
|
|
54132
|
+
}, ProgressUpdatesSettingsSection));
|
|
54047
54133
|
} catch {
|
|
54048
54134
|
return () => {};
|
|
54049
54135
|
}
|