@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/codemode.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PLUGIN_MESSAGE_SOURCE_KIND, t as candidatePackageRoots } from "./preset-sync-6QI9tVA0.js";
1
+ import { c as PLUGIN_MESSAGE_SOURCE_KIND, t as candidatePackageRoots } from "./preset-sync-CF9xlG1l.js";
2
2
  import { createRequire } from "node:module";
3
3
  import * as dshLlm from "@deepseek-ai/dsh-llm";
4
4
  import { HarnessError, createUserMessage } from "@deepseek-ai/dsh-llm";
@@ -1046,6 +1046,8 @@ function currentCatalogSnapshot() {
1046
1046
  }
1047
1047
  /** 传输工具名(与 {@link DEFAULT_RUN_TOOL_NAME} 一致,导出方便测试引用)。 */
1048
1048
  const TRANSPORT_TOOL_NAME = "code_run";
1049
+ const TRANSPORT_TOOL_TIMEOUT_MS = 6e5;
1050
+ const ADVISOR_CALL_PATTERN = /\btools\s*\.\s*consult_advisor\s*\(/;
1049
1051
  /** 进展汇报工具名:融合参数里救回来的简报用它补发。 */
1050
1052
  const PROGRESS_UPDATE_TOOL = "progress_update";
1051
1053
  /** 允许单次提权的目标沙箱模式(对齐 `@deepseek-ai/dsh-sandbox` 的 `ESCALATION_TARGETS`)。 */
@@ -1282,6 +1284,7 @@ function createTransportDefinition(host, rules) {
1282
1284
  name: runToolName,
1283
1285
  description: buildTransportDescription(void 0),
1284
1286
  parameters: buildTransportParameters(void 0),
1287
+ timeoutMs: TRANSPORT_TOOL_TIMEOUT_MS,
1285
1288
  output: {
1286
1289
  schema: {
1287
1290
  type: "object",
@@ -1546,6 +1549,7 @@ function createTransportDefinition(host, rules) {
1546
1549
  signal: nestedSignal,
1547
1550
  mode: runMode
1548
1551
  }) ?? untrackRun;
1552
+ const timeoutMs = input.timeoutMs ?? (ADVISOR_CALL_PATTERN.test(sanitizedCode) ? 305e3 : void 0);
1549
1553
  const request = {
1550
1554
  program: sanitizedCode,
1551
1555
  bindings: [{
@@ -1559,7 +1563,7 @@ function createTransportDefinition(host, rules) {
1559
1563
  ...escalated ? {} : { stateOwner: owner },
1560
1564
  ...authority?.cwd === void 0 ? {} : { cwd: authority.cwd },
1561
1565
  ...effectivePolicy === void 0 ? {} : { sandboxPolicy: effectivePolicy },
1562
- ...input.timeoutMs === void 0 ? {} : { timeoutMs: input.timeoutMs },
1566
+ ...timeoutMs === void 0 ? {} : { timeoutMs },
1563
1567
  signal: nestedSignal
1564
1568
  };
1565
1569
  const spec = typeof runtime.resolve === "function" ? runtime.resolve(request) : request;