{"versions":{"0.1.0":{"name":"dsh-fix","version":"0.1.0","description":"Standalone cross-platform repair tool for DeepSeek Harness (DSH): diagnose and fix startup failures caused by installed plugins. 独立的 DSH 插件故障诊断与修复工具，不依赖 DSH。","license":"MIT","type":"module","bin":{"dsh-fix":"bin/dsh-fix.mjs"},"engines":{"node":">=18.0.0"},"scripts":{"test":"node --test test/","check":"node --check bin/dsh-fix.mjs && node --check lib/cli.js && node --check lib/doctor.js && node --check lib/actions.js && node --check lib/backup.js && node --check lib/home.js && node --check lib/i18n.js && node --check lib/resolve.js && node --check lib/validate.js && node --check lib/yaml.js"},"keywords":["dsh","deepseek-harness","cordis","plugin","repair","doctor","diagnose","cli","cross-platform"],"repository":{"type":"git","url":"git+https://github.com/SherlockGougou/dsh-plugins-fix.git"},"bugs":{"url":"https://github.com/SherlockGougou/dsh-plugins-fix/issues"},"gitHead":"f07f051e8bb4b18cf63aefd2d4ac98d5d6e9eacc","_id":"dsh-fix@0.1.0","homepage":"https://github.com/SherlockGougou/dsh-plugins-fix#readme","_nodeVersion":"26.3.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-+af5vdAsLZQUgbmTRlv6w1y5uKQOzrOUQm6LBH8wt93CKlW/TkwsAjhnXoTEdc7v6yRAJ57TjF8oTkNSu1Q2dA==","shasum":"c0e2462f7fc527f16e7f6fec680ced71b15ddcd2","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-fix/-/dsh-fix-0.1.0.tgz","fileCount":16,"unpackedSize":179726,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDXgrCSDO0nbWdid7+T8I8dxtEOS616adKzWDAba4RTPgIhALWl0LdQauik1saDDI12nLO2L4MEXU7Hv53f0yMuWSk8"}],"size":47418},"_npmUser":{"name":"anonymous","email":"qinglingou@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"qinglingou@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-fix_0.1.0_1786756556042_0.1878388773889479"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-15T01:15:56.166Z","publish_time":1786756556166,"_source_registry_name":"default","contributors":[]},"0.2.0":{"name":"dsh-fix","version":"0.2.0","description":"Standalone cross-platform repair tool for DeepSeek Harness (DSH): diagnose and fix startup failures caused by installed plugins. 独立的 DSH 插件故障诊断与修复工具，不依赖 DSH。","license":"MIT","type":"module","bin":{"dsh-fix":"bin/dsh-fix.mjs"},"engines":{"node":">=18.0.0"},"keywords":["dsh","deepseek-harness","cordis","plugin","repair","doctor","diagnose","cli","cross-platform"],"repository":{"type":"git","url":"git+https://github.com/SherlockGougou/dsh-plugins-fix.git"},"bugs":{"url":"https://github.com/SherlockGougou/dsh-plugins-fix/issues"},"dist":{"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-fix/-/dsh-fix-0.2.0.tgz","shasum":"725c8c9bc970abc2a5653a09be50564d5017a644","integrity":"sha512-obIda/jdGXyBWHqSJImf7vv/cE6sWOziN3LA+C49C9S16L94cz1CxWAG0fQueRu/x8bfOm6VVJ5fN66T0Dkd1g==","fileCount":16,"unpackedSize":187417,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCY//MAVJe1iF3Pd473M+44tbDMMOeI/UqvG4gc3eGEQQIgGfl2aAH7vB6DtDbMFCIWnr6CioXQmvBCtwVjrhB3wZU="}],"size":49758},"_npmUser":{"name":"anonymous","email":"qinglingou@gmail.com"},"_id":"dsh-fix@0.2.0","directories":{},"maintainers":[{"name":"anonymous","email":"qinglingou@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-fix_0.2.0_1786758224445_0.13139079888284355"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-15T01:43:44.601Z","publish_time":1786758224601,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.2.0"},"name":"dsh-fix","time":{"created":"2026-08-15T01:16:11.170Z","modified":"2026-08-15T01:43:52.017Z","0.1.0":"2026-08-15T01:15:56.166Z","0.2.0":"2026-08-15T01:43:44.601Z"},"readme":"# dsh-fix\n\n> Standalone diagnosis & repair tool for DeepSeek Harness (DSH) plugin startup failures. No DSH required, zero npm dependencies.\n\nPlugins installed into DSH (entries in the `cordis.patch.yml` patch layer) can break DSH startup when the config is malformed, a plugin package is missing, or a plugin crashes during initialization. `dsh-fix` runs **outside** DSH to diagnose the problem, drop into a safe mode, disable the culprit plugin, and bisect which plugin is at fault — with every change fully reversible.\n\n- **Zero dependencies** — pure Node.js stdlib + a vendored js-yaml; no `node_modules`\n- **Cross-platform** — Windows / macOS / Linux (any DSH user already has Node ≥ 18)\n- **Non-destructive** — automatic backup before every change, `restore` rolls back\n- **Bilingual output** — follows the system locale (zh / en), override with `--lang`\n\n## When to use\n\n- DSH fails to boot with errors like `plugin(s) failed to load`, `failed to parse patches`, or a patch parse error\n- DSH broke right after installing/updating a plugin\n- Boot fails and you don't know which plugin is responsible\n\n## Quick start\n\n```bash\n# Option 1: run directly from the repo (no install)\ngit clone https://github.com/SherlockGougou/dsh-plugins-fix.git\ncd dsh-plugins-fix\nnode bin/dsh-fix.mjs doctor\n\n# Option 2: global install (provides the dsh-fix command)\nnpm install -g dsh-fix\ndsh-fix doctor\n\n# Option 3: one-off via npx\nnpx dsh-fix doctor\n```\n\n> Defaults to `$DSH_HOME` (or `~/.dsh`); use `--home <path>` for a custom location.\n\n## Typical recovery flow\n\n### 1. Diagnose\n\n```bash\ndsh-fix doctor\n```\n\nRead-only checks: patch file syntax (the exact YAML dialect DSH uses, including `!!js` expressions), entry structure, plugin package resolvability (simulated Node module resolution), duplicate ids, broken `node_modules` symlinks, missing dependencies. Exit code is 1 when errors are found.\n\nThe output follows flutter doctor's style: one `[✓]` / `[!]` / `[✗]` status line per check, problems indented below, and a summary with a suggested next step at the end:\n\n```text\nDoctor summary (to see all details, run dsh-fix doctor -v):\n[✓] DSH home: ~/.dsh\n[✓] Home patch layer: absent (optional)\n[✗] profile web (1 entry)\n    ✗ plugin \"plugin-nowhere\" (entry \"alpha\") is NOT installed: not found. ...\n    ! profile web lists dependency \"plugin-c\"@^1.0.0 ...\n\n1 error, 1 warning, 0 notes across 1 profile and 1 plugin entry.\n✗ Doctor found issues: 1 error, 1 warning.\nTip: run \"dsh-fix safe\" ...\n```\n\n`dsh-fix doctor -v` (or `--verbose`) appends the per-check checklist — package.json, node_modules, patch entry counts, each plugin's module resolution result, plus info-level hints (hidden by default).\n\n### 2. Safe mode — get DSH booting again\n\n```bash\ndsh-fix safe\n```\n\nAppends `disabled: true` patches for every user plugin entry so DSH starts with only its built-ins. The appended blocks carry `# dsh-fix:` markers and are fully reversible.\n\n### 3. Bisect — find the culprit\n\n```bash\ndsh-fix bisect\n```\n\nInteractive binary search: each round disables half of the remaining candidates, you start DSH once and answer y/n. The culprit is usually pinned in a few rounds; it stays disabled and everything else is re-enabled.\n\n### 4. Fine control & rollback\n\n```bash\ndsh-fix list                  # list plugin entries per profile\ndsh-fix disable <id>          # disable one plugin entry\ndsh-fix enable <id>           # re-enable an entry disabled by dsh-fix\ndsh-fix clear                 # remove every dsh-fix disable block (undo safe/bisect)\ndsh-fix backups               # list backups\ndsh-fix restore [index]       # restore from a backup (default: newest)\n```\n\n## Command reference\n\n| Command | Description | Modifies files |\n|---|---|---|\n| `doctor` | read-only diagnosis with exit codes | no |\n| `list` | list plugin entries & missing dependencies | no |\n| `safe` | safe mode: disable all user plugin entries | yes (backed up) |\n| `disable <id>` | disable one plugin entry | yes (backed up) |\n| `enable <id>` | re-enable an entry disabled by dsh-fix | yes (backed up) |\n| `clear` | remove all dsh-fix disable blocks | yes (backed up) |\n| `restore [index]` | restore the patch file from a backup | yes (backed up) |\n| `backups` | list patch file backups | no |\n| `bisect` | interactive binary search for the culprit | yes (backed up) |\n| `version` / `help` | version / help | no |\n\nCommon options: `--home <path>`, `--profile <name>`, `--lang zh|en`, `--json` (JSON output for doctor/list, handy for scripting), `-v` (verbose per-check doctor output).\n\n## How it works\n\nEach DSH profile (`$DSH_HOME/profiles/<name>/`) is a Cordis composition: at boot, DSH applies bundle patch layers, then the user patch layer `cordis.patch.yml` (a top-level YAML array), then CLI overlays. User-installed plugins are `- insert:` entries in that patch file, backed by npm packages declared in the profile's `package.json`.\n\n**The three boot-failure root causes** (all covered by `dsh-fix doctor`):\n\n1. **Malformed patch file** — a parse failure makes DSH refuse to boot (`failed to parse patches`)\n2. **Missing/broken plugin package** — the loader cannot resolve the `name` module (`plugin(s) failed to load`)\n3. **Plugin init crash** — thrown errors or missing Services during activation\n\n`dsh-fix` repairs with exactly one mechanism: **appending marked disable patches** at the end of the patch file:\n\n```yaml\n# dsh-fix: disabled entry \"mcp-figma\" at 2026-08-15T00:44:49.804Z\n- id: \"mcp-figma\"\n  disabled: true\n```\n\nThis is native DSH patch semantics (a later patch can target earlier entries of the same layer), so:\n\n- Original content is never deleted or rewritten; `enable` restores it byte-for-byte\n- Every write is snapshotted first as `cordis.patch.yml.bak-<timestamp>` (same naming DSH itself uses); `restore` rolls back to any backup (10 kept)\n- The YAML dialect matches DSH exactly (js-yaml JSON_SCHEMA + `!!js` tag), so diagnosis mirrors what boot sees\n\n## Platform notes\n\n- Requires [Node.js](https://nodejs.org) ≥ 18 (DSH itself needs ≥ 22, so every DSH user has it)\n- Windows: run from CMD / PowerShell as `node bin\\dsh-fix.mjs doctor`\n- Paths and line endings (CRLF/LF) are handled; `bisect` works on a real terminal or piped stdin\n- CI runs the full suite on Ubuntu / Windows / macOS (see `.github/workflows/ci.yml`)\n\n## Development\n\n```bash\nnpm test        # node:test suite\nnpm run check   # syntax checks\n```\n\nTests cover the YAML dialect, entry validation, module-resolution simulation, disable/enable/safe/bisect/backup/restore, and CLI behavior with exit codes.\n\n## FAQ\n\n**Q: `doctor` reports `@deepseek-ai/*` plugins as unresolvable?**\nDSH resolves built-in plugins from its own installation directory, which dsh-fix cannot see, so those are warnings, not errors. The guidance still applies if the package genuinely is missing.\n\n**Q: Should DSH be stopped before making changes?**\nYes, ideally. DSH hot-reloads patch files; editing while DSH runs may trigger a reload.\n\n**Q: Custom DSH_HOME locations?**\nSupported via `--home` or the `$DSH_HOME` environment variable.\n\n## License\n\n[MIT](LICENSE) · js-yaml (vendored) is MIT too, see `vendor/LICENSE.js-yaml`","users":{}}