@eddyskywalker/dsh-chatgpt-subscription 0.86.0 → 0.87.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 (84) hide show
  1. package/README.md +1 -0
  2. package/lib/client.js +1413 -354
  3. package/lib/client.js.map +1 -1
  4. package/lib/codemode.js +6 -5
  5. package/lib/index.js +5687 -2532
  6. package/lib/types/client/common/model-checklist-labels.d.ts +1 -1
  7. package/lib/types/client/features/progress-updates/locales.d.ts +3 -3
  8. package/lib/types/client/features/session-quota/adapters.d.ts +4 -0
  9. package/lib/types/client/features/session-quota/adapters.d.ts.map +1 -1
  10. package/lib/types/client/hub/HubOverview.d.ts +1 -1
  11. package/lib/types/client/hub/HubOverview.d.ts.map +1 -1
  12. package/lib/types/client/hub/HubProviderRow.d.ts +4 -0
  13. package/lib/types/client/hub/HubProviderRow.d.ts.map +1 -1
  14. package/lib/types/client/hub/brand-icons.d.ts +1 -1
  15. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  16. package/lib/types/client/hub/hub-styles.d.ts.map +1 -1
  17. package/lib/types/client/hub/providers.d.ts.map +1 -1
  18. package/lib/types/client/index.d.ts +2 -0
  19. package/lib/types/client/index.d.ts.map +1 -1
  20. package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
  21. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  22. package/lib/types/client/locales-ru/opencode-go.d.ts +3 -0
  23. package/lib/types/client/locales-ru/opencode-go.d.ts.map +1 -0
  24. package/lib/types/client/providers/codex-chatgpt/locales.d.ts +3 -1
  25. package/lib/types/client/providers/codex-chatgpt/locales.d.ts.map +1 -1
  26. package/lib/types/client/providers/opencode-go/OpenCodeGoComposerQuota.d.ts +14 -0
  27. package/lib/types/client/providers/opencode-go/OpenCodeGoComposerQuota.d.ts.map +1 -0
  28. package/lib/types/client/providers/opencode-go/OpenCodeGoQuotaCard.d.ts +12 -0
  29. package/lib/types/client/providers/opencode-go/OpenCodeGoQuotaCard.d.ts.map +1 -0
  30. package/lib/types/client/providers/opencode-go/OpenCodeGoSection.d.ts +8 -0
  31. package/lib/types/client/providers/opencode-go/OpenCodeGoSection.d.ts.map +1 -0
  32. package/lib/types/client/providers/opencode-go/locales.d.ts +318 -0
  33. package/lib/types/client/providers/opencode-go/locales.d.ts.map +1 -0
  34. package/lib/types/client/providers/opencode-go/styles.d.ts +4 -0
  35. package/lib/types/client/providers/opencode-go/styles.d.ts.map +1 -0
  36. package/lib/types/compat.d.ts +1 -1
  37. package/lib/types/host/common/account-pool.d.ts +17 -7
  38. package/lib/types/host/common/account-pool.d.ts.map +1 -1
  39. package/lib/types/host/common/model-request-control.d.ts +1 -1
  40. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  41. package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
  42. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  43. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  44. package/lib/types/host/providers/minimax-code/media-files.d.ts +29 -0
  45. package/lib/types/host/providers/minimax-code/media-files.d.ts.map +1 -0
  46. package/lib/types/host/providers/minimax-code/media-tool.d.ts +20 -0
  47. package/lib/types/host/providers/minimax-code/media-tool.d.ts.map +1 -0
  48. package/lib/types/host/providers/opencode-go/account-pool.d.ts +50 -0
  49. package/lib/types/host/providers/opencode-go/account-pool.d.ts.map +1 -0
  50. package/lib/types/host/providers/opencode-go/adapter.d.ts +36 -0
  51. package/lib/types/host/providers/opencode-go/adapter.d.ts.map +1 -0
  52. package/lib/types/host/providers/opencode-go/client.d.ts +13 -0
  53. package/lib/types/host/providers/opencode-go/client.d.ts.map +1 -0
  54. package/lib/types/host/providers/opencode-go/mapper-gemini.d.ts +13 -0
  55. package/lib/types/host/providers/opencode-go/mapper-gemini.d.ts.map +1 -0
  56. package/lib/types/host/providers/opencode-go/mapper-messages.d.ts +8 -0
  57. package/lib/types/host/providers/opencode-go/mapper-messages.d.ts.map +1 -0
  58. package/lib/types/host/providers/opencode-go/mapper-responses.d.ts +9 -0
  59. package/lib/types/host/providers/opencode-go/mapper-responses.d.ts.map +1 -0
  60. package/lib/types/host/providers/opencode-go/mapper.d.ts +38 -0
  61. package/lib/types/host/providers/opencode-go/mapper.d.ts.map +1 -0
  62. package/lib/types/host/providers/opencode-go/model-catalog.d.ts +57 -0
  63. package/lib/types/host/providers/opencode-go/model-catalog.d.ts.map +1 -0
  64. package/lib/types/host/providers/opencode-go/native-shared.d.ts +31 -0
  65. package/lib/types/host/providers/opencode-go/native-shared.d.ts.map +1 -0
  66. package/lib/types/host/providers/opencode-go/protocol.d.ts +13 -0
  67. package/lib/types/host/providers/opencode-go/protocol.d.ts.map +1 -0
  68. package/lib/types/host/providers/opencode-go/routes.d.ts +13 -0
  69. package/lib/types/host/providers/opencode-go/routes.d.ts.map +1 -0
  70. package/lib/types/host/providers/opencode-go/token-store.d.ts +29 -0
  71. package/lib/types/host/providers/opencode-go/token-store.d.ts.map +1 -0
  72. package/lib/types/host/providers/opencode-go/types.d.ts +20 -0
  73. package/lib/types/host/providers/opencode-go/types.d.ts.map +1 -0
  74. package/lib/types/host/providers/workbuddy/account-pool.d.ts.map +1 -1
  75. package/lib/types/host/runtime/codemode/rules.d.ts +1 -1
  76. package/lib/types/index.d.ts +6 -0
  77. package/lib/types/index.d.ts.map +1 -1
  78. package/lib/types/shared/contracts.d.ts +1 -1
  79. package/lib/types/shared/contracts.d.ts.map +1 -1
  80. package/lib/types/shared/opencode-go-contracts.d.ts +80 -0
  81. package/lib/types/shared/opencode-go-contracts.d.ts.map +1 -0
  82. package/package.json +1 -1
  83. package/presets/dispatch/README.md +2 -2
  84. package/presets/dispatch/agent.cordis.yml +1 -1
package/lib/codemode.js CHANGED
@@ -470,7 +470,7 @@ const DEFAULT_HIDDEN_PREFIXES = Object.freeze(["mcp__"]);
470
470
  * 默认始终原生呈现的名字。
471
471
  *
472
472
  * 恒定系统提示词或子代理运行时契约里点名要求直接调用这些工具(大输出预览补读、调度账本查询、
473
- * 进展更新汇报、结构化子代理输出提交,以及 Windows 下替代被撤回 `pwsh` 的 `win_bash`):
473
+ * 进展更新汇报、结构化子代理输出提交,以及兼容旧部署可选 Shell 的 `win_bash`):
474
474
  * 遮蔽它们要么让提示词指向模型看不见的名字并触发整批 `UNKNOWN_TOOL` 重跑,要么让会话顶层
475
475
  * 失去唯一可用的 Shell。若某个工具当前未在宿主/子会话注册,保留在此集合中不会凭空暴露它。
476
476
  */
@@ -636,7 +636,8 @@ function buildCodemodeSectionText(input) {
636
636
  "read_image",
637
637
  "ask_user_question",
638
638
  "subagent",
639
- "win_bash"
639
+ "bash",
640
+ "pwsh"
640
641
  ].filter((name) => !nativeNames.includes(name));
641
642
  const whitelistGuidance = nativeOnly ? ["Whenever another instruction names a non-whitelist tool, it means the corresponding `tools.<name>(...)` call inside " + run + ", never a top-level call." + (commonProgramTools.length > 0 ? " Common mappings: " + commonProgramTools.map((name) => "`" + name + "` → `tools." + name + "`").join(", ") + "." : "")] : [];
642
643
  return [
@@ -653,16 +654,16 @@ function buildCodemodeSectionText(input) {
653
654
  python ? retained ? "- A retained Python REPL: top-level await and a final expression. Its variables and imported modules survive into your later programs in this session." : "- Async Python program: top-level await works; print or evaluate a final expression to produce output." : retained ? "- A retained TypeScript REPL: top-level declarations, await, and a final expression. Its variables and imported modules survive into your later programs in this session." : "- Erasable TypeScript, run as the body of an async function: top-level await and return work.",
654
655
  !python && retained ? "- Only what you pass to inspect(...values) (or a sole final expression when nothing was inspected) reaches the conversation; every intermediate result stays in the program, so filter and aggregate there. Never write a top-level `return` (an early `return` inside `if` is a SyntaxError in the REPL)." : "- Only what you inspect(...values), return, or console.log reaches the conversation; every intermediate result stays in the program, so filter and aggregate there instead of returning raw payloads.",
655
656
  "- File, search, and shell tool results are named-field objects, never bare strings — read the field, not the envelope (`job_list` and `list_agents` are the only bare arrays):",
656
- " `read` → `{ path, offset, lines: [{ number, text }], totalLines }` · `glob` → `{ root, paths }` · `grep` → `{ matches: [{ path, lineNumber, line }] }` · `edit` → `{ path, before, after }` · `write` → `{ path, operation, before, after }` · `win_bash` → `{ stdout, stderr, exitCode }` · `web_fetch` → `{ url, statusCode, body, truncated }` · `job_output` → `{ text, job }` · `read_image` → `{ path, image }` · `skill` → `{ name, content }` · `subagent` → `{ kind, name }`.",
657
+ " `read` → `{ path, offset, lines: [{ number, text }], totalLines }` · `glob` → `{ root, paths }` · `grep` → `{ matches: [{ path, lineNumber, line }] }` · `edit` → `{ path, before, after }` · `write` → `{ path, operation, before, after }` · `bash` / `pwsh` → foreground `{ kind, cwd, exitCode, stdout: { text, truncated }, stderr: { text, truncated } }` (background/promoted variants also exist) · `web_fetch` → `{ url, statusCode, body, truncated }` · `job_output` → `{ text, job }` · `read_image` → `{ path, image }` · `skill` → `{ name, content }` · `subagent` → `{ kind, name }`.",
657
658
  python ? "- Read the field: `page[\"lines\"]`, `match[\"text\"]`. Calling `.split()`, `.splitlines()` or `in` on the envelope itself is always wrong." : "- Read the field: `r.lines.map((l) => l.text)`. Calling `.map`, `.filter`, `.split` or `in` on the envelope itself is always wrong.",
658
659
  "- Anything not listed above (MCP tools, hidden plugin tools) answers with its **declared output schema**: call `" + describeTool + "({ name })` and read the top-level keys before picking a field. One discovery call is far cheaper than the `TypeError` that loses the whole program.",
659
660
  "- Discovery returns whole objects too: `" + listTool + "` answers `{ tools: [{ name, description, namespace }] }`, `" + searchTool + "` answers `{ tools: [{ name, namespace, description, parameters, output? }], fallback? }`, and `" + describeTool + "` answers `{ found, name?, namespace?, description?, parameters?, output? }`.",
660
661
  !python && retained ? "- Tool argument objects and evaluated values must be lossless JSON: **never leave `undefined` in an object property value** — `{ a: x.opt }` fails the call when `x.opt === undefined`. Omit the key, write `x.opt ?? null`, or inspect it with `inspect(x)`." : "- Tool argument objects and `return` values must be lossless JSON: **never leave `undefined` in an object property value** — `{ a: x.opt }` fails the call when `x.opt === undefined`. Omit the key, write `x.opt ?? null`, or print it with `inspect` / `console.log`.",
661
- "- Parameter keys: `read`, `edit`, `write`, and `read_image` take `file_path` (not `path`); `glob` and `grep` take `path`; `win_bash` takes `workdir` (not `cwd`).",
662
+ "- Parameter keys: `read`, `edit`, `write`, and `read_image` take `file_path` (not `path`); `glob` and `grep` take `path`; `bash` and `pwsh` take `workdir` (not `cwd`).",
662
663
  ...python ? [] : [
663
664
  "- Paths and regexes: write a Windows path with forward slashes (`C:/Users/...`) or wrap it in `String.raw`; a literal `C:\\Users` inside an ordinary string is read as the escape `\\U` and the program never starts (`Expected unicode escape`). Regex backslashes (`\\d`, `\\.`) have the same trap — double them or use `String.raw`.",
664
665
  ...retained ? ["- Modules in the retained REPL: CommonJS `require` / `module` and host packages like `import('vscode')` are unavailable; dynamic `await import('./src/x.ts')` resolves relative to the session's initial working directory (whereas `process.cwd()` and relative file paths follow the current session directory on each call).", "- Retained REPL scope: each call copies prior top-level bindings into a fresh scope (mutating an object persists; reassigning a primitive only updates that call's copy). Either use a copied name or redeclare it — never self-reference in `let x = x + 1`, avoid `var` inside blocks, and never declare `__$binding_*` identifiers."] : ["- A program is not a module: `import('./src/x.ts')` and `import('vscode')` cannot resolve — the program runs in a fresh process with no module graph. Read files with `tools.read`; `await import('node:fs')` works only for Node built-ins."],
665
- "- `process.env` is empty inside the program: `os.tmpdir()` and credentialed CLIs (`gh`, `git`, `npm`) spawned via `node:child_process` miss `TEMP`, `HOME`, `APPDATA`, and auth tokens. Run shell and CLI commands through `await tools.win_bash({ command })` instead."
666
+ "- `process.env` is empty inside the program: `os.tmpdir()` and credentialed CLIs (`gh`, `git`, `npm`) spawned via `node:child_process` miss `TEMP`, `HOME`, `APPDATA`, and auth tokens. Run shell and CLI commands through `await tools.bash({ command })` (POSIX) or `await tools.pwsh({ command })` (Windows) instead."
666
667
  ],
667
668
  "- Prefer batching multi-step read/search chains inside one " + run + " program instead of issuing many sequential single-tool turns.",
668
669
  "- Independent read-only calls may overlap under Promise.all; mutating calls run alone, in submission order.",