@eddyskywalker/dsh-chatgpt-subscription 0.95.2 → 0.96.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 (34) hide show
  1. package/lib/client.js +66 -26
  2. package/lib/client.js.map +1 -1
  3. package/lib/codemode.js +6 -2
  4. package/lib/index.js +345 -67
  5. package/lib/{preset-sync-6QI9tVA0.js → preset-sync-CF9xlG1l.js} +7 -1
  6. package/lib/types/client/locales-ru/command-code.d.ts.map +1 -1
  7. package/lib/types/client/providers/command-code/CommandCodeSection.d.ts.map +1 -1
  8. package/lib/types/client/providers/command-code/locales.d.ts +11 -2
  9. package/lib/types/client/providers/command-code/locales.d.ts.map +1 -1
  10. package/lib/types/compat.d.ts +1 -1
  11. package/lib/types/host/common/reasoning-seed-replay.d.ts +25 -0
  12. package/lib/types/host/common/reasoning-seed-replay.d.ts.map +1 -0
  13. package/lib/types/host/providers/command-code/adapter.d.ts +6 -3
  14. package/lib/types/host/providers/command-code/adapter.d.ts.map +1 -1
  15. package/lib/types/host/providers/command-code/mapper.d.ts.map +1 -1
  16. package/lib/types/host/providers/command-code/routes.d.ts.map +1 -1
  17. package/lib/types/host/providers/command-code/token-store.d.ts +4 -0
  18. package/lib/types/host/providers/command-code/token-store.d.ts.map +1 -1
  19. package/lib/types/host/providers/opencode-go/mapper.d.ts.map +1 -1
  20. package/lib/types/host/providers/opencode-zen/mapper.d.ts.map +1 -1
  21. package/lib/types/host/providers/relayone/mapper-openai.d.ts.map +1 -1
  22. package/lib/types/host/runtime/codemode/transport.d.ts +1 -0
  23. package/lib/types/host/runtime/codemode/transport.d.ts.map +1 -1
  24. package/lib/types/host/runtime/deepseek-v41-flash/discipline.d.ts +1 -1
  25. package/lib/types/host/runtime/deepseek-v41-flash/discipline.d.ts.map +1 -1
  26. package/lib/types/host/runtime/deepseek-v41-flash/reasoning-seed.d.ts +113 -0
  27. package/lib/types/host/runtime/deepseek-v41-flash/reasoning-seed.d.ts.map +1 -0
  28. package/lib/types/index.d.ts +7 -0
  29. package/lib/types/index.d.ts.map +1 -1
  30. package/lib/types/shared/advisor-contracts.d.ts +1 -0
  31. package/lib/types/shared/advisor-contracts.d.ts.map +1 -1
  32. package/lib/types/shared/command-code-contracts.d.ts +2 -0
  33. package/lib/types/shared/command-code-contracts.d.ts.map +1 -1
  34. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -4902,6 +4902,9 @@ window.__ModuleLoader__.load({
4902
4902
  defaultReasoningEffort: "默认思考深度",
4903
4903
  defaultReasoningEffortHint: "控制支持推理的模型在未单独指定时的思考强度。Anthropic 模型会映射为 thinking 预算。",
4904
4904
  defaultEffortAuto: "使用 Provider 默认值",
4905
+ zdrToggle: "零数据保留(ZDR)",
4906
+ zdrToggleHint: "只把请求交给不保留数据的上游。某个模型没有这样的上游时会直接报错,不会改用普通通道。",
4907
+ zdrLocked: "已由环境变量或启动配置固定,这里无法更改。",
4905
4908
  contextWindowSection: "模型上下文窗口",
4906
4909
  contextWindowHint: "默认取 Command Code 模型目录的 context length;可覆盖为自定义容量,该值用于 DSH 的压缩与溢出判断,可输入 1M、512K、200K 等容量。",
4907
4910
  contextWindowReset: "恢复默认",
@@ -4976,6 +4979,9 @@ window.__ModuleLoader__.load({
4976
4979
  defaultReasoningEffort: "Default reasoning effort",
4977
4980
  defaultReasoningEffortHint: "Reasoning effort for models that support it when the conversation does not specify one. Anthropic models map it to a thinking budget.",
4978
4981
  defaultEffortAuto: "Use provider default",
4982
+ zdrToggle: "Zero Data Retention (ZDR)",
4983
+ zdrToggleHint: "Send requests only to upstreams that keep no data. A model without such an upstream fails instead of falling back to a regular route.",
4984
+ zdrLocked: "Fixed by an environment variable or host configuration; it cannot be changed here.",
4979
4985
  contextWindowSection: "Model context window",
4980
4986
  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).",
4981
4987
  contextWindowReset: "Restore default",
@@ -5279,6 +5285,18 @@ window.__ModuleLoader__.load({
5279
5285
  setError(err instanceof Error ? err.message : String(err));
5280
5286
  }
5281
5287
  };
5288
+ const handleUpdateZdr = async (zeroDataRetention) => {
5289
+ try {
5290
+ const updated = await api$29.request("/settings", {
5291
+ method: "POST",
5292
+ body: JSON.stringify({ zeroDataRetention })
5293
+ });
5294
+ setStatus(updated);
5295
+ notifyChange();
5296
+ } catch (err) {
5297
+ setError(err instanceof Error ? err.message : String(err));
5298
+ }
5299
+ };
5282
5300
  const handleSaveContextWindow = async (modelId) => {
5283
5301
  const raw = contextDrafts[modelId] || "";
5284
5302
  const parsed = parsePositiveCapacity$1(raw);
@@ -5491,32 +5509,51 @@ window.__ModuleLoader__.load({
5491
5509
  }),
5492
5510
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
5493
5511
  className: "dsha-group",
5494
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5495
- className: "dsha-grouphead",
5496
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.enhanced })
5497
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5498
- className: "dsha-pref-row",
5499
- 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", {
5500
- className: "dsha-muted",
5501
- children: t.defaultReasoningEffortHint
5502
- })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
5503
- className: "dsha-select",
5504
- "aria-label": t.defaultReasoningEffort,
5505
- value: status?.defaultReasoningEffort ?? "",
5506
- disabled: busy !== null,
5507
- onChange: (event) => {
5508
- const value = event.currentTarget.value;
5509
- handleUpdateEffort(value === "" ? null : value);
5510
- },
5511
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
5512
- value: "",
5513
- children: t.defaultEffortAuto
5514
- }), COMMAND_CODE_REASONING_EFFORTS.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
5515
- value: effort,
5516
- children: EFFORT_LABELS$3[effort]
5517
- }, effort))]
5518
- })]
5519
- })]
5512
+ children: [
5513
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5514
+ className: "dsha-grouphead",
5515
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t.enhanced })
5516
+ }),
5517
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5518
+ className: "dsha-pref-row",
5519
+ 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", {
5520
+ className: "dsha-muted",
5521
+ children: t.defaultReasoningEffortHint
5522
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
5523
+ className: "dsha-select",
5524
+ "aria-label": t.defaultReasoningEffort,
5525
+ value: status?.defaultReasoningEffort ?? "",
5526
+ disabled: busy !== null,
5527
+ onChange: (event) => {
5528
+ const value = event.currentTarget.value;
5529
+ handleUpdateEffort(value === "" ? null : value);
5530
+ },
5531
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
5532
+ value: "",
5533
+ children: t.defaultEffortAuto
5534
+ }), COMMAND_CODE_REASONING_EFFORTS.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
5535
+ value: effort,
5536
+ children: EFFORT_LABELS$3[effort]
5537
+ }, effort))]
5538
+ })]
5539
+ }),
5540
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5541
+ className: "dsha-pref-row",
5542
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.zdrToggle }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5543
+ className: "dsha-muted",
5544
+ children: status?.zeroDataRetentionLocked === true ? t.zdrLocked : t.zdrToggleHint
5545
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
5546
+ type: "checkbox",
5547
+ "aria-label": t.zdrToggle,
5548
+ "data-testid": "command-code-zdr-toggle",
5549
+ checked: status?.zeroDataRetention === true,
5550
+ disabled: busy !== null || status === null || status.zeroDataRetentionLocked === true,
5551
+ onChange: (event) => {
5552
+ handleUpdateZdr(event.currentTarget.checked);
5553
+ }
5554
+ })]
5555
+ })
5556
+ ]
5520
5557
  }),
5521
5558
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
5522
5559
  className: "dsha-group",
@@ -34368,6 +34405,9 @@ window.__ModuleLoader__.load({
34368
34405
  defaultReasoningEffort: "Уровень рассуждений по умолчанию",
34369
34406
  defaultReasoningEffortHint: "Уровень рассуждений для моделей, которые его поддерживают, когда диалог не задаёт его явно. У моделей Anthropic он превращается в бюджет размышлений.",
34370
34407
  defaultEffortAuto: "По умолчанию у провайдера",
34408
+ zdrToggle: "Нулевое хранение данных (ZDR)",
34409
+ zdrToggleHint: "Отправлять запросы только поставщикам, которые не хранят данные. Если у модели такого поставщика нет, запрос завершится ошибкой без перехода на обычный маршрут.",
34410
+ zdrLocked: "Задано переменной окружения или конфигурацией хоста; здесь изменить нельзя.",
34371
34411
  contextWindowSection: "Контекстное окно модели",
34372
34412
  contextWindowHint: "По умолчанию берётся context length из каталога Command Code; можно задать свою ёмкость, которую DSH будет использовать при сжатии и определении переполнения (например, 1M, 512K, 200K).",
34373
34413
  contextWindowReset: "Вернуть значение по умолчанию",