@eddyskywalker/dsh-chatgpt-subscription 0.87.0 → 0.88.1

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/lib/client.js.map +1 -1
  2. package/lib/codemode.js +6 -5
  3. package/lib/index.js +1676 -931
  4. package/lib/{tool-result-pruner-CIZ8RtkC.js → tool-result-pruner-Dy6X17gv.js} +3 -3
  5. package/lib/tool-result-pruner.js +1 -1
  6. package/lib/types/compat.d.ts +1 -1
  7. package/lib/types/host/common/session-effort-memory.d.ts +36 -0
  8. package/lib/types/host/common/session-effort-memory.d.ts.map +1 -0
  9. package/lib/types/host/providers/antigravity-acp/adapter.d.ts +5 -0
  10. package/lib/types/host/providers/antigravity-acp/adapter.d.ts.map +1 -1
  11. package/lib/types/host/providers/aws-quick/adapter.d.ts +2 -0
  12. package/lib/types/host/providers/aws-quick/adapter.d.ts.map +1 -1
  13. package/lib/types/host/providers/cline-pass/adapter.d.ts +2 -0
  14. package/lib/types/host/providers/cline-pass/adapter.d.ts.map +1 -1
  15. package/lib/types/host/providers/codex-chatgpt/adapter.d.ts +6 -0
  16. package/lib/types/host/providers/codex-chatgpt/adapter.d.ts.map +1 -1
  17. package/lib/types/host/providers/command-code/adapter.d.ts +2 -0
  18. package/lib/types/host/providers/command-code/adapter.d.ts.map +1 -1
  19. package/lib/types/host/providers/glm-coding-plan/adapter.d.ts +2 -0
  20. package/lib/types/host/providers/glm-coding-plan/adapter.d.ts.map +1 -1
  21. package/lib/types/host/providers/kimi-code/adapter.d.ts +6 -0
  22. package/lib/types/host/providers/kimi-code/adapter.d.ts.map +1 -1
  23. package/lib/types/host/providers/minimax-code/adapter.d.ts +2 -0
  24. package/lib/types/host/providers/minimax-code/adapter.d.ts.map +1 -1
  25. package/lib/types/host/providers/ollama/adapter.d.ts +5 -0
  26. package/lib/types/host/providers/ollama/adapter.d.ts.map +1 -1
  27. package/lib/types/host/providers/opencode-go/adapter.d.ts +2 -0
  28. package/lib/types/host/providers/opencode-go/adapter.d.ts.map +1 -1
  29. package/lib/types/host/providers/opendesign/adapter.d.ts +6 -0
  30. package/lib/types/host/providers/opendesign/adapter.d.ts.map +1 -1
  31. package/lib/types/host/providers/qianwen-token-plan/adapter.d.ts +2 -0
  32. package/lib/types/host/providers/qianwen-token-plan/adapter.d.ts.map +1 -1
  33. package/lib/types/host/providers/qoder/adapter.d.ts +2 -0
  34. package/lib/types/host/providers/qoder/adapter.d.ts.map +1 -1
  35. package/lib/types/host/providers/relayone/adapter.d.ts +8 -0
  36. package/lib/types/host/providers/relayone/adapter.d.ts.map +1 -1
  37. package/lib/types/host/providers/step-code/adapter.d.ts +2 -0
  38. package/lib/types/host/providers/step-code/adapter.d.ts.map +1 -1
  39. package/lib/types/host/providers/workbuddy/adapter.d.ts +2 -0
  40. package/lib/types/host/providers/workbuddy/adapter.d.ts.map +1 -1
  41. package/lib/types/host/runtime/deepseek-v41-flash/goal-intake.d.ts +79 -0
  42. package/lib/types/host/runtime/deepseek-v41-flash/goal-intake.d.ts.map +1 -0
  43. package/lib/types/host/runtime/deepseek-v41-flash/index.d.ts +12 -7
  44. package/lib/types/host/runtime/deepseek-v41-flash/index.d.ts.map +1 -1
  45. package/lib/types/host/runtime/deepseek-v41-flash/progress-governor.d.ts +38 -0
  46. package/lib/types/host/runtime/deepseek-v41-flash/progress-governor.d.ts.map +1 -0
  47. package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts +15 -7
  48. package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts.map +1 -1
  49. package/lib/types/host/runtime/open-models/state-anchor.d.ts +3 -1
  50. package/lib/types/host/runtime/open-models/state-anchor.d.ts.map +1 -1
  51. package/lib/types/host/runtime/reasoning-collapse-guard/index.d.ts +5 -0
  52. package/lib/types/host/runtime/reasoning-collapse-guard/index.d.ts.map +1 -1
  53. package/lib/types/index.d.ts +2 -2
  54. package/package.json +1 -1
package/lib/codemode.js CHANGED
@@ -637,7 +637,8 @@ function buildCodemodeSectionText(input) {
637
637
  "ask_user_question",
638
638
  "subagent",
639
639
  "bash",
640
- "pwsh"
640
+ "pwsh",
641
+ "win_bash"
641
642
  ].filter((name) => !nativeNames.includes(name));
642
643
  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(", ") + "." : "")] : [];
643
644
  return [
@@ -654,20 +655,20 @@ function buildCodemodeSectionText(input) {
654
655
  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.",
655
656
  !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.",
656
657
  "- 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):",
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 }`.",
658
+ " `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) · `win_bash` → `{ exitCode, stdout, stderr }` with plain-string streams · `web_fetch` → `{ url, statusCode, body, truncated }` · `job_output` → `{ text, job }` · `read_image` → `{ path, image }` · `skill` → `{ name, content }` · `subagent` → `{ kind, name }`.",
658
659
  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.",
659
660
  "- 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.",
660
661
  "- 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? }`.",
661
662
  !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`.",
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`).",
663
+ "- Parameter keys: `read`, `edit`, `write`, and `read_image` take `file_path` (not `path`); `glob` and `grep` take `path`; `bash`, `pwsh`, and `win_bash` take `workdir` (not `cwd`).",
663
664
  ...python ? [] : [
664
665
  "- 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`.",
665
666
  ...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."],
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."
667
+ "- `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 the shell tool this session registers instead: `tools.bash` (POSIX), `tools.pwsh` (Windows), or `tools.win_bash` (Windows deployments that replace pwsh with a pinned bash). Only registered names exist on `tools`; when unsure which one is present, check `typeof tools.pwsh === \"function\"` inside the same program rather than spending a failed run on each guess."
667
668
  ],
668
669
  "- Prefer batching multi-step read/search chains inside one " + run + " program instead of issuing many sequential single-tool turns.",
669
670
  "- Independent read-only calls may overlap under Promise.all; mutating calls run alone, in submission order.",
670
- "- A failed sub-call rejects; try/catch or Promise.allSettled it to keep the calls that succeeded. Completed calls are real side effects and are not rolled back.",
671
+ "- A failed sub-call rejects (a `glob`/`grep` path that does not exist fails too); under Promise.all one rejection fails the whole program and aborts its unfinished siblings, so try/catch or Promise.allSettled calls that may fail. Completed calls are real side effects and are not rolled back.",
671
672
  "",
672
673
  "### Discovery API (callable from inside a program)",
673
674
  "",