@eddyskywalker/dsh-chatgpt-subscription 0.10.21 → 0.11.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/lib/client.js +53 -8
  3. package/lib/client.js.map +1 -1
  4. package/lib/index.js +2409 -304
  5. package/lib/types/client/command-code/CommandCodeSection.d.ts.map +1 -1
  6. package/lib/types/client/command-code/locales.d.ts +14 -2
  7. package/lib/types/client/command-code/locales.d.ts.map +1 -1
  8. package/lib/types/host/codex-account-pool.d.ts +2 -8
  9. package/lib/types/host/codex-account-pool.d.ts.map +1 -1
  10. package/lib/types/host/command-code/adapter.d.ts +19 -0
  11. package/lib/types/host/command-code/adapter.d.ts.map +1 -1
  12. package/lib/types/host/command-code/client.d.ts +4 -2
  13. package/lib/types/host/command-code/client.d.ts.map +1 -1
  14. package/lib/types/host/command-code/mapper.d.ts +11 -0
  15. package/lib/types/host/command-code/mapper.d.ts.map +1 -1
  16. package/lib/types/host/command-code/routes.d.ts +2 -0
  17. package/lib/types/host/command-code/routes.d.ts.map +1 -1
  18. package/lib/types/host/command-code/token-store.d.ts +7 -0
  19. package/lib/types/host/command-code/token-store.d.ts.map +1 -1
  20. package/lib/types/host/command-code/types.d.ts +15 -0
  21. package/lib/types/host/command-code/types.d.ts.map +1 -1
  22. package/lib/types/host/common/capabilities.d.ts +100 -0
  23. package/lib/types/host/common/capabilities.d.ts.map +1 -0
  24. package/lib/types/host/common/concurrency-gate.d.ts +46 -0
  25. package/lib/types/host/common/concurrency-gate.d.ts.map +1 -0
  26. package/lib/types/host/common/model-request-control.d.ts +21 -0
  27. package/lib/types/host/common/model-request-control.d.ts.map +1 -0
  28. package/lib/types/host/common/request-diagnostics.d.ts +79 -0
  29. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -0
  30. package/lib/types/host/minimax-code/adapter.d.ts.map +1 -1
  31. package/lib/types/host/minimax-code/mapper.d.ts +32 -1
  32. package/lib/types/host/minimax-code/mapper.d.ts.map +1 -1
  33. package/lib/types/host/minimax-code/model-catalog.d.ts +7 -2
  34. package/lib/types/host/minimax-code/model-catalog.d.ts.map +1 -1
  35. package/lib/types/host/minimax-code/types.d.ts +12 -0
  36. package/lib/types/host/minimax-code/types.d.ts.map +1 -1
  37. package/lib/types/host/ollama/adapter.d.ts +18 -4
  38. package/lib/types/host/ollama/adapter.d.ts.map +1 -1
  39. package/lib/types/host/ollama/client.d.ts +14 -0
  40. package/lib/types/host/ollama/client.d.ts.map +1 -1
  41. package/lib/types/host/ollama/mapper.d.ts +5 -0
  42. package/lib/types/host/ollama/mapper.d.ts.map +1 -1
  43. package/lib/types/host/ollama/types.d.ts +23 -0
  44. package/lib/types/host/ollama/types.d.ts.map +1 -1
  45. package/lib/types/host/responses-client.d.ts +27 -10
  46. package/lib/types/host/responses-client.d.ts.map +1 -1
  47. package/lib/types/host/wire-auth.d.ts +19 -5
  48. package/lib/types/host/wire-auth.d.ts.map +1 -1
  49. package/lib/types/host/workbuddy/mapper.d.ts +1 -0
  50. package/lib/types/host/workbuddy/mapper.d.ts.map +1 -1
  51. package/lib/types/index.d.ts.map +1 -1
  52. package/lib/types/shared/command-code-contracts.d.ts +15 -2
  53. package/lib/types/shared/command-code-contracts.d.ts.map +1 -1
  54. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - **Provider 协议复核修复(未发布)**:修正 Command Code Responses 的真实事件标识、块索引与多模态报文;修正 Ollama 原生图片/工具参数、附件降级及工具历史;MiniMax 原生回放增加来源隔离和顺序保护。并发闸门正确处理降限、正小数和取消竞争;Codex 使用请求本地释放函数,不再从普通 429 推断并发上限。
6
+ - Codex 缺少可靠宿主 turn identity 时仍采取不跨请求复用的保守降级,不宣称完整 turn continuity。
7
+ - 后续补齐:八线路生成请求的显式凭据级并发配置、等待超时与取消释放;可选脱敏首字节/耗时/usage/前缀变化诊断;Command Code ZDR 全协议 fail-closed、权限与认证分类、目录过期及隐私状态展示;Ollama 图片/think 和 ZDR 接入精确证据门控。
8
+ - 旧 provider-only 表仍仅为库存,精确门控区分协议/模型/认证及离线证据。配置见 [运行控制](<docs/provider-runtime-controls.md>);原计划状态见 [审计](<docs/plan-provider-agent-optimizations.md>)。未调用真实账号或进行收益 A/B。
9
+
5
10
  - **修复思维坍塌保护每次触发都把当前会话写成坏记录**(用户报告:DSH 弹出「是否修复插件根因」,并指控本插件)。
6
11
  - **根因**:`reasoning-collapse-guard` 用**手写字面量** `{ role: 'user', content: [...] }` 构造续跑消息(`src/host/reasoning-collapse-guard/index.ts` 的 `createResumeMessage`),既没有 `id` 也没有 `source`。DSH 在 `session.append` 里经 `assertMessageEventShape` 校验每条入站消息,缺 `id` 抛 `lacks an identified message`、缺 `source` 抛 `has invalid source`——**两个都会抛**。
7
12
  - **为什么后果严重**:这个 steer 是在守卫**已经 `cancel` 之后**、于微任务里发出的。抛错发生时,坍塌已经中止、inbox 已保留,而这一轮直接以一条 splice 违规收场,模型什么也没回答——用户看到的正是「提示·等待回答」停在半截。
package/lib/client.js CHANGED
@@ -1168,7 +1168,7 @@ window.__ModuleLoader__.load({
1168
1168
  }),
1169
1169
  connection !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
1170
1170
  label: t("latency"),
1171
- value: `${connection.latencyMs} ms · ${formatDate$5(connection.checkedAt)}`
1171
+ value: `${connection.latencyMs} ms · ${formatDate$6(connection.checkedAt)}`
1172
1172
  }) : null,
1173
1173
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1174
1174
  className: "dsha-muted dsha-models-hint",
@@ -1580,7 +1580,7 @@ window.__ModuleLoader__.load({
1580
1580
  children: [
1581
1581
  t("updated"),
1582
1582
  ": ",
1583
- formatDate$5(quota.fetchedAt)
1583
+ formatDate$6(quota.fetchedAt)
1584
1584
  ]
1585
1585
  }) : null
1586
1586
  ]
@@ -1763,7 +1763,7 @@ window.__ModuleLoader__.load({
1763
1763
  ].filter((part) => part !== null);
1764
1764
  return parts.length > 0 ? parts.join(" · ") : t("unknown");
1765
1765
  }
1766
- function formatDate$5(seconds) {
1766
+ function formatDate$6(seconds) {
1767
1767
  if (seconds === void 0 || seconds === null || typeof seconds !== "number" || !Number.isFinite(seconds) || seconds <= 0) return "—";
1768
1768
  const ms = seconds > 1e10 ? seconds : seconds * 1e3;
1769
1769
  try {
@@ -1778,7 +1778,7 @@ window.__ModuleLoader__.load({
1778
1778
  function formatReset$4(seconds) {
1779
1779
  if (seconds === void 0 || seconds === null || typeof seconds !== "number" || !Number.isFinite(seconds) || seconds <= 0) return "—";
1780
1780
  const ms = seconds > 1e10 ? seconds : seconds * 1e3;
1781
- const absolute = formatDate$5(seconds);
1781
+ const absolute = formatDate$6(seconds);
1782
1782
  const diff = ms - Date.now();
1783
1783
  const abs = Math.abs(diff);
1784
1784
  const [amount, unit] = abs >= 864e5 ? [Math.round(diff / 864e5), "day"] : abs >= 36e5 ? [Math.round(diff / 36e5), "hour"] : [Math.round(diff / 6e4), "minute"];
@@ -1988,7 +1988,7 @@ window.__ModuleLoader__.load({
1988
1988
  if (hours > 0) return `${hours}h ${mins % 60}m`;
1989
1989
  return `${mins}m`;
1990
1990
  }
1991
- function formatDate$4(ms) {
1991
+ function formatDate$5(ms) {
1992
1992
  if (!ms || ms <= 0) return "—";
1993
1993
  try {
1994
1994
  return new Intl.DateTimeFormat(void 0, {
@@ -2343,12 +2343,12 @@ window.__ModuleLoader__.load({
2343
2343
  account.expiresAt && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
2344
2344
  t.expires,
2345
2345
  ": ",
2346
- formatDate$4(account.expiresAt)
2346
+ formatDate$5(account.expiresAt)
2347
2347
  ] }),
2348
2348
  account.lastUsedAt && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
2349
2349
  t.lastUsed,
2350
2350
  ": ",
2351
- formatDate$4(account.lastUsedAt)
2351
+ formatDate$5(account.lastUsedAt)
2352
2352
  ] })
2353
2353
  ] })
2354
2354
  }),
@@ -2671,10 +2671,14 @@ window.__ModuleLoader__.load({
2671
2671
  modelsHint: "勾选后模型才会出现在对话页的模型选择列表中;全部取消勾选或关闭上方开关可在列表中隐藏该供应商。",
2672
2672
  refreshCatalog: "刷新模型目录",
2673
2673
  refreshingCatalog: "刷新中...",
2674
+ catalogStale: "目录来自缓存,可能过期;可手动刷新",
2675
+ catalogFresh: "目录已同步",
2676
+ zdrEnabled: "已请求零数据保留(ZDR);服务端无符合条件的路由时将拒绝请求,不自动降低隐私要求。",
2674
2677
  selectAll: "全选",
2675
2678
  unselectAll: "全不选",
2676
2679
  wireAnthropic: "Anthropic",
2677
2680
  wireOpenai: "OpenAI",
2681
+ wireResponses: "OpenAI Responses",
2678
2682
  enhanced: "增强功能",
2679
2683
  defaultReasoningEffort: "默认思考深度",
2680
2684
  defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。Anthropic 模型会映射为 thinking 预算。",
@@ -2743,10 +2747,14 @@ window.__ModuleLoader__.load({
2743
2747
  modelsHint: "Checked models appear in the DSH conversation model list; unchecking all or turning off the switch hides this provider.",
2744
2748
  refreshCatalog: "Refresh catalog",
2745
2749
  refreshingCatalog: "Refreshing...",
2750
+ catalogStale: "Cached catalog may be stale; refresh to revalidate",
2751
+ catalogFresh: "Catalog synchronized",
2752
+ zdrEnabled: "Zero Data Retention requested; requests fail closed if no compliant route is available.",
2746
2753
  selectAll: "Select all",
2747
2754
  unselectAll: "Deselect all",
2748
2755
  wireAnthropic: "Anthropic",
2749
2756
  wireOpenai: "OpenAI",
2757
+ wireResponses: "OpenAI Responses",
2750
2758
  enhanced: "Enhanced features",
2751
2759
  defaultReasoningEffort: "Default reasoning effort",
2752
2760
  defaultReasoningEffortHint: "Reasoning effort for models that support it when the conversation does not specify one. Anthropic models map it to a thinking budget.",
@@ -2829,6 +2837,17 @@ window.__ModuleLoader__.load({
2829
2837
  for (const model of status.models) drafts[model.id] = formatCapacity$4(status.contextWindowOverrides[model.id] || model.defaultContextWindow);
2830
2838
  return drafts;
2831
2839
  }
2840
+ function formatDate$4(ms) {
2841
+ if (ms === void 0 || ms === null || ms <= 0) return "—";
2842
+ try {
2843
+ return new Intl.DateTimeFormat(void 0, {
2844
+ dateStyle: "medium",
2845
+ timeStyle: "short"
2846
+ }).format(ms);
2847
+ } catch {
2848
+ return "—";
2849
+ }
2850
+ }
2832
2851
  function formatReset$3(resetsAt) {
2833
2852
  if (resetsAt === void 0 || resetsAt === null || resetsAt <= 0) return "";
2834
2853
  const diff = resetsAt - Date.now();
@@ -2840,6 +2859,18 @@ window.__ModuleLoader__.load({
2840
2859
  if (hours > 0) return `${hours}h ${mins % 60}m`;
2841
2860
  return `${mins}m`;
2842
2861
  }
2862
+ /**
2863
+ * Route name shown next to a model.
2864
+ *
2865
+ * The three routes are not interchangeable: the provider serves each model on
2866
+ * exactly one and rejects the others, so the label states which one this model
2867
+ * actually uses.
2868
+ */
2869
+ function wireLabel(wire, t) {
2870
+ if (wire === "anthropic") return t.wireAnthropic;
2871
+ if (wire === "responses") return t.wireResponses;
2872
+ return t.wireOpenai;
2873
+ }
2843
2874
  function CommandCodeSection({ onModelChange, loadModelDirectory }) {
2844
2875
  const [status, setStatus] = (0, react.useState)(null);
2845
2876
  const [loading, setLoading] = (0, react.useState)(true);
@@ -3297,12 +3328,26 @@ window.__ModuleLoader__.load({
3297
3328
  className: "dsha-muted dsha-models-hint",
3298
3329
  children: t.modelsHint
3299
3330
  }),
3331
+ status?.catalogStale !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
3332
+ className: "dsha-muted",
3333
+ "data-testid": "command-code-catalog-freshness",
3334
+ children: [
3335
+ status.catalogStale ? t.catalogStale : t.catalogFresh,
3336
+ " · ",
3337
+ formatDate$4(status.catalogFetchedAt)
3338
+ ]
3339
+ }),
3340
+ status?.zeroDataRetention === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3341
+ className: "dsha-notice",
3342
+ "data-testid": "command-code-zdr",
3343
+ children: t.zdrEnabled
3344
+ }),
3300
3345
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3301
3346
  className: "dsha-models",
3302
3347
  "aria-label": "Command Code Models",
3303
3348
  children: status?.models.map((model) => {
3304
3349
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3305
- title: `${model.id} · ${model.wire === "anthropic" ? t.wireAnthropic : t.wireOpenai}`,
3350
+ title: `${model.id} · ${wireLabel(model.wire, t)}`,
3306
3351
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3307
3352
  type: "checkbox",
3308
3353
  checked: model.enabled,