@eddyskywalker/dsh-chatgpt-subscription 0.39.0 → 0.39.2

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 CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.39.2 - 2026-10-24
6
+ - **[codex] 账号卡登录行不再换行:三个入口改用短标签,完整语义留在 aria-label,窄宽度下省略而不是折行**
7
+ - **现象**:ChatGPT 订阅页账号卡右上角那一行有三个按钮(添加账号 / 用设备代码添加账号 / 导入本机 Codex CLI 登录),在正常设置面板宽度下第三个被挤到下一行,右边还被裁掉一截。
8
+ - **根因**:`.dsha-btn` 自带 `white-space:nowrap`,而 `.dsha-account-add-actions` 是 `flex-wrap:wrap`。两个长标签(`用设备代码添加账号` 9 字、`导入本机 Codex CLI 登录` 14 字符)加起来放不进那一行的剩余宽度,于是容器按 `wrap` 换行——换行不是兜底,它把这个行读成了两块内容。
9
+ - **改法(短标签 + 完整语义)**:`deviceCodeLogin` 由 `用设备代码添加账号` 改为 `设备代码登录`,`localCodexLoginImport` 由 `导入本机 Codex CLI 登录` 改为 `导入本机登录`;新增 `deviceCodeLoginDetail` 键专门存完整句子(`用设备代码添加账号`),接到设备的 `aria-label` 与 `title` 上。中文、英文(`Device-code sign-in` / `Import local sign-in`)、俄文(`Вход по коду устройства` / `Импорт локального входа`)三份语言包同步。可见文字只说机制,完整含义仍在读屏器与 tooltip 里,没有丢信息。
10
+ - **改法(窄宽度兜底)**:`src/client/styles.ts` 为本页的 `.dsha-account-add-actions` 增加两条声明——`flex-wrap:nowrap` + `min-width:0`,子按钮 `flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis`。这样即使将来文案再变长,也是三个按钮等分宽度、超长省略,而不是某个按钮整块掉到下一行。选择器用 `:where()` 裹住以保持低特异性,且只作用于 `.dsh-codex-page` 之内——Claude / GLM / Cline Pass / OpenDesign 等共用同一个类名的线路不受影响。
11
+ - **测试**:`test/codex-local-signin-ui.test.tsx` 由 7 例增至 8 例——新增「完整句子在 accessible name 里而不是可见标签里」(钉住两个按钮的 `aria-label` 与 `title` 都等于 `deviceCodeLoginDetail` / `localCodexLoginImport`),并在原有行内用例补一条长度上限(两个短标签 ≤ 8 字),把「以后改词又变长、再次破版」变成会红的断言。设备码用例里对 `aria-label` 的断言随之更新为 `deviceCodeLoginDetail`。
12
+ - **验证**:`npm run typecheck` 三工程 0 错误;全量 `LANG=C.UTF-8 npm test` **287 文件通过 / 2 skipped,4757 passed / 8 skipped / 0 failed**(比上一版多 1 例即本轮新增);`npm run build` 后核对产物:`设备代码登录` 进入 `lib/client.js`,`用设备代码添加账号` 仅作为 `deviceCodeLoginDetail` 的句子保留。
13
+ - **为什么上一版没生效**:`lib/` 是 `prepack` 里重建的构建产物,`src/` 改完不构建则 DSH 加载的还是旧 bundle。本轮已重新构建;npm 包由 `prepack` 触发重建,不依赖本地 `lib/` 状态。
14
+
15
+ ## 0.39.1 - 2026-10-24
16
+ - **[dispatch] 0.39.0 自审修补:R2 补齐降级路径,plan-mode 访谈上限与 R0 对齐,全插件通用的空清单提示去掉设置推广语**
17
+ - **R2 补“标注缺失”这一读法(`presets/dispatch/agent.cordis.yml` / `src/host/agent-preset.ts`)**:0.39.0 让 R2 从 `list_subagent_models` 的输出里**读**路由姿态,但那段标注是 `tools/post-execute` 写的,而 `src/index.ts:508-520` 里守卫有三条不入场的路径——`subagentModelAuthorization: false`、宿主没有 `sessions` 服务、`tools.guard` 不是函数。三种情况下输出里既没有授权路由块、也没有「No allowlist is in force」,而 0.39.0 的 R2 只写了三态、没写“什么都没读到”怎么办。现在补一段:行为上按 `[State: Unlisted]` 处理(照常派发、不要把缺参数指望守卫来拦),但不得声称任一姿态、只能说「未确认」,且不得据此把任何路由报成「已授权」。这是“把状态塞进工具结果”和“断言工具一定在场”之间的差别,前一版的措辞把后者当成了前提。
18
+ - **plan-mode 访谈上限与 R0 对齐**:`plan-mode` 段仍写 `keep the interview to the 1–2 questions`,而同一次改动把 R0 的对应项改成了 `at most 2 key questions (2 is the cap)`——同一份提示词里两个上限两种写法,正是本次要消掉的那类歧义。改为 `at most 2 questions`,两份拷贝同步。
19
+ - **空清单提示不再推广设置(`src/host/subagent-model-authorization.ts`)**:`UNRESTRICTED_ROUTING_NOTICE` 原来结尾带一句「如需按任务治理,请在 Settings → Subagents 启用并新建会话」。这个监听器挂在 host 级工具注册表上,**对使用本插件的所有会话生效**,而默认 `subagentModelScope = 'session'` 下绝大多数会话根本没勾选模型、也用不到 dispatch preset——那句话在那些会话里是噪音,还会被模型当成指令抄进无关的交付摘要。提示现在只留两条事实(没有允许清单生效、省略路由是正当的);「按任务治理」的建议只留在 dispatch 的 R2 里,按需说一句。
20
+ - **顺带修掉一个自己引入的语法错误**:给 R2 补降级段时在 `agent-preset.ts` 的模板字符串里写了裸反引号(`` `subagentModelAuthorization: false` ``),把模板字符串截断成语法错误;同时该符号名撞上既有断言「persona 里不得出现内部符号名」(那条断言的本意是防止提示词诱使模型去 grep 源码),改为不含符号名的措辞 `the plugin's authorization setting`。
21
+ - **测试**:`test/agent-preset.test.ts` 38 例内扩充——R2 用例新增三条钉住降级段(`If the output says neither` / `the annotation is absent and you cannot read the posture` / `say "unconfirmed" rather than claiming either posture`),plan-mode 字节一致性用例新增两条钉住 `at most 2 questions` 且 `1–2 questions` 不得回归。`test/subagent-model-authorization.test.ts` 27 例内扩充——新增三条断言 `UNRESTRICTED_ROUTING_NOTICE` 不含 `Settings` / `Subagents` / `enable`,把“这条提示不得推广设置”变成可执行约束(该常量是全插件通用的,改坏会波及所有会话)。
22
+ - **验证**:`npm run typecheck` 三工程 0 错误;`npx vitest run test/agent-preset.test.ts test/subagent-model-authorization.test.ts` 65 例全绿;全量 `LANG=C.UTF-8 npm test` **287 文件通过 / 2 skipped,4756 passed / 8 skipped / 0 failed**;`npx tsc -p tsconfig.host.json --noEmit` 单独复核模板字符串语法 0 错误。
23
+ - **边界**:本轮只改措辞与一处提示文本,不改任何运行时判定——`enrichListSubagentModelsOutput` 的分支条件、`delegationDenialReason` 的判定、守卫的安装条件都未动。
24
+
5
25
  ## 0.39.0 - 2026-10-24
6
26
  - **[dispatch] 调度模式按行为实测重写纪律:限额写成上限、任务书带限额台账、注意到风险必须处置、路由三态可读**
7
27
  - **背景**:一份对 `deepseek-v4.1-flash-1017` 的路口调度基准对比报告(三局均值 567.98 vs 旧版 687.30)连同其后的定向行为探针(超市盲盒、路口日志复演、团队采购荷兰拍,共三个 POV、86 局以上)把结论收敛成几条可迁移的行为事实:规则写明时照做、没写明的取最严解读且不去验证;写明的代价会提前处理,要从环境动态推出来的二阶后果不处理;预算靠心算且几乎总是零余量收尾;把事后才到的信号当事前保护。本 preset 是一份纯提示词契约,这些点逐条落在它上面。
package/lib/client.js CHANGED
@@ -2040,7 +2040,8 @@ window.__ModuleLoader__.load({
2040
2040
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2041
2041
  className: "dsha-btn",
2042
2042
  disabled: busy !== null,
2043
- "aria-label": t("deviceCodeLogin"),
2043
+ "aria-label": t("deviceCodeLoginDetail"),
2044
+ title: t("deviceCodeLoginDetail"),
2044
2045
  onClick: () => void startDeviceLogin(),
2045
2046
  children: busy === "device-login" ? t("deviceCodeLoginStarting") : t("deviceCodeLogin")
2046
2047
  }),
@@ -2048,6 +2049,7 @@ window.__ModuleLoader__.load({
2048
2049
  className: "dsha-btn",
2049
2050
  disabled: busy !== null,
2050
2051
  "aria-label": t("localCodexLoginImport"),
2052
+ title: t("localCodexLoginImport"),
2051
2053
  onClick: () => void importLocalSignIn(),
2052
2054
  children: busy === "adopt" ? t("localCodexLoginImporting") : t("localCodexLoginImport")
2053
2055
  })
@@ -18745,10 +18747,11 @@ window.__ModuleLoader__.load({
18745
18747
  hubUpdateManualOnly: "有新版本 {version};当前安装方式无法自动更新",
18746
18748
  hubUpdateCheckFailed: "检测失败:无法连接 npm 源,请检查网络或代理",
18747
18749
  hubUpdateCommandLabel: "手动更新命令",
18748
- localCodexLoginImport: "导入本机 Codex CLI 登录",
18750
+ localCodexLoginImport: "导入本机登录",
18749
18751
  localCodexLoginImporting: "导入中…",
18750
- deviceCodeLogin: "用设备代码添加账号",
18751
- deviceCodeLoginStarting: "正在获取代码…",
18752
+ deviceCodeLogin: "设备代码登录",
18753
+ deviceCodeLoginStarting: "获取代码…",
18754
+ deviceCodeLoginDetail: "用设备代码添加账号",
18752
18755
  deviceCodeHint: "在任意设备上打开下面的链接并输入这个代码,本页会自动完成登录:这条路不需要浏览器回调到本机端口。",
18753
18756
  deviceCodeLabel: "设备代码",
18754
18757
  deviceCodeOpen: "打开确认页面",
@@ -18941,10 +18944,11 @@ window.__ModuleLoader__.load({
18941
18944
  hubUpdateManualOnly: "{version} is available, but this install cannot update itself",
18942
18945
  hubUpdateCheckFailed: "Check failed: the npm registry could not be reached — check the network or proxy",
18943
18946
  hubUpdateCommandLabel: "Manual update command",
18944
- localCodexLoginImport: "Import the local Codex CLI sign-in",
18947
+ localCodexLoginImport: "Import local sign-in",
18945
18948
  localCodexLoginImporting: "Importing…",
18946
- deviceCodeLogin: "Add account with device code",
18949
+ deviceCodeLogin: "Device-code sign-in",
18947
18950
  deviceCodeLoginStarting: "Requesting code…",
18951
+ deviceCodeLoginDetail: "Add account with device code",
18948
18952
  deviceCodeHint: "Open the link below on any device and enter this code. This page finishes the sign-in by itself: nothing has to call back to a local port.",
18949
18953
  deviceCodeLabel: "Device code",
18950
18954
  deviceCodeOpen: "Open the confirmation page",
@@ -19817,10 +19821,11 @@ window.__ModuleLoader__.load({
19817
19821
  hubUpdateManualOnly: "Доступна версия {version}; этот способ установки не обновляется сам",
19818
19822
  hubUpdateCheckFailed: "Проверка не удалась: реестр npm недоступен, проверьте сеть или прокси",
19819
19823
  hubUpdateCommandLabel: "Команда для ручного обновления",
19820
- localCodexLoginImport: "Импортировать вход локального Codex CLI",
19824
+ localCodexLoginImport: "Импорт локального входа",
19821
19825
  localCodexLoginImporting: "Импорт…",
19822
- deviceCodeLogin: "Добавить аккаунт по коду устройства",
19826
+ deviceCodeLogin: "Вход по коду устройства",
19823
19827
  deviceCodeLoginStarting: "Получаем код…",
19828
+ deviceCodeLoginDetail: "Добавить аккаунт по коду устройства",
19824
19829
  deviceCodeHint: "Открой ссылку ниже на любом устройстве и введи этот код. Эта страница завершит вход сама: обращаться к локальному порту не нужно.",
19825
19830
  deviceCodeLabel: "Код устройства",
19826
19831
  deviceCodeOpen: "Открыть страницу подтверждения",
@@ -20738,6 +20743,15 @@ window.__ModuleLoader__.load({
20738
20743
  const CSS$3 = `
20739
20744
  .dsh-codex-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}
20740
20745
  .dsh-codex-page *{box-sizing:border-box}
20746
+ /* The pool card's login row holds three entries. They must stay on ONE line: a
20747
+ wrapped row stops reading as a set of alternatives, and the third entry is the
20748
+ one that gets pushed out. .dsha-btn carries white-space:nowrap, so shrinking
20749
+ the row means letting the buttons shrink and ellipsizing the label inside —
20750
+ the accessible name stays whole in aria-label/title, which is where the full
20751
+ sentence lives. flex-basis 0 keeps the three of them sharing the width evenly
20752
+ instead of the longest one claiming it. */
20753
+ .dsh-codex-page :where(.dsha-account-add-actions){flex-wrap:nowrap;min-width:0}
20754
+ .dsh-codex-page :where(.dsha-account-add-actions) > .dsha-btn{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis}
20741
20755
  .dsh-codex-title{font-size:15px;font-weight:650;line-height:1.4;margin:0 0 5px}
20742
20756
  .dsh-codex-intro,.dsh-codex-muted{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.55;margin:0}
20743
20757
  .dsh-codex-group{border-top:0.5px solid var(--dsw-alias-border-l2);min-width:0}