{"versions":{"0.1.0":{"name":"dsh-plugin-doctor","version":"0.1.0","description":"Compatibility, security, isolated-install and rollback doctor for DeepSeek Harness plugins","type":"module","bin":{"dsh-plugin-doctor":"src/cli.js"},"exports":{".":"./src/index.js"},"scripts":{"test":"node --test test/*.test.js","check":"node --check src/cli.js && node --test test/*.test.js","smoke":"node src/cli.js check test/fixtures/safe-plugin --no-isolate --report-dir .doctor-smoke"},"engines":{"node":">=20.0.0"},"keywords":["deepseek-harness","dsh","cordis","plugin","security"],"license":"MIT","author":{"name":"Xrainsmile"},"repository":{"type":"git","url":"git+https://github.com/Xrainsmile/DSH-Plugin-Doctor.git"},"bugs":{"url":"https://github.com/Xrainsmile/DSH-Plugin-Doctor/issues"},"homepage":"https://github.com/Xrainsmile/DSH-Plugin-Doctor#readme","dependencies":{"commander":"^14.0.1","semver":"^7.7.2","tar":"^7.4.3","yaml":"^2.8.1"},"_id":"dsh-plugin-doctor@0.1.0","gitHead":"f82c28765e8159e422b3c7db17107416c76e9985","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-LkmS2XUXQjKbWsjjKWAMm4kFPbukCXye/Du2OwFIbJF53CYC4oVE/R1KMdwp0FgibGGRHlQUiQdh1AJh6orc0A==","shasum":"286910b178e02e0b6909ba897419a148693adf16","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-plugin-doctor/-/dsh-plugin-doctor-0.1.0.tgz","fileCount":19,"unpackedSize":66467,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEUs5uSaU4pAYLVLsLTudF8spXEnUEq0WQemaMEaceQ3AiEA/mVeJJKB1r+/iB0fYkoOUbgz7muSQTSr+/rx2PpSIws="}],"size":20891},"_npmUser":{"name":"anonymous","email":"xrain.smile@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"xrain.smile@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-plugin-doctor_0.1.0_1786716884753_0.8306387537507101"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-14T14:14:44.903Z","publish_time":1786716884903,"_source_registry_name":"default","contributors":[]},"0.1.1":{"name":"dsh-plugin-doctor","version":"0.1.1","description":"Compatibility, security, isolated-install and rollback doctor for DeepSeek Harness plugins","type":"module","bin":{"dsh-plugin-doctor":"src/cli.js"},"exports":{".":"./src/index.js"},"scripts":{"test":"node --test test/*.test.js","check":"node --check src/cli.js && node --test test/*.test.js","smoke":"node src/cli.js check test/fixtures/safe-plugin --no-isolate --report-dir .doctor-smoke"},"engines":{"node":">=20.0.0"},"keywords":["deepseek-harness","dsh","cordis","plugin","security"],"license":"MIT","author":{"name":"Xrainsmile"},"repository":{"type":"git","url":"git+https://github.com/Xrainsmile/DSH-Plugin-Doctor.git"},"bugs":{"url":"https://github.com/Xrainsmile/DSH-Plugin-Doctor/issues"},"homepage":"https://github.com/Xrainsmile/DSH-Plugin-Doctor#readme","dependencies":{"commander":"^14.0.1","semver":"^7.7.2","tar":"^7.4.3","yaml":"^2.8.1"},"_id":"dsh-plugin-doctor@0.1.1","gitHead":"8239dd2bfb1585750f97cb021cddcd14bf6a82ec","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-CpyWKri4nLsx/e3jMTYPqX4HA1DlS7RapPNVKdIId4I4lVIPKgWHbij6h1/41LpgsUzNfb6A85GgZCQur8NLaQ==","shasum":"3686e554e435b4d8e1fc4cecc2f4ac4133530254","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-plugin-doctor/-/dsh-plugin-doctor-0.1.1.tgz","fileCount":19,"unpackedSize":67534,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDYVjZ8uGwDdwdYT262jjekccOaVutZx5iB3pkIZpIJpwIhANHswK8KeqQcioODR61SlplgcVtdbm5fMKi+5/RdGX3x"}],"size":21288},"_npmUser":{"name":"anonymous","email":"xrain.smile@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"xrain.smile@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-plugin-doctor_0.1.1_1787126709607_0.38209886350216427"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-19T08:05:09.777Z","publish_time":1787126709777,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.1.1"},"name":"dsh-plugin-doctor","time":{"created":"2026-08-14T14:14:56.394Z","modified":"2026-08-19T08:05:21.634Z","0.1.0":"2026-08-14T14:14:44.903Z","0.1.1":"2026-08-19T08:05:09.777Z"},"readme":"# DSH Plugin Doctor\n\n`dsh-plugin-doctor` audits DeepSeek Harness npm Bundles before they reach a real Profile. It validates the Bundle manifest, scans risky behavior, installs into a temporary `DSH_HOME`, boots the Web Profile, produces machine- and human-readable reports, and can install with automatic Profile rollback.\n\nThe implementation follows the official [DSH quickstart](https://deepseek-harness.github.io/deepseek-harness/guide/quickstart) and [Bundle publishing guide](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/user/develop/basic/publish.md).\n\nDeepSeek Harness is in Developer Preview. Doctor therefore records the exact Node, DSH, Cordis/peer dependency and operating-system evidence instead of treating one successful run as permanent compatibility.\n\n## What v0.1 checks\n\n- `package.json`, `dsh.bundle.patch`, published `files`, YAML patch syntax and Cordis rows\n- Node engine, DSH compatibility declaration, Cordis and all peer dependency ranges\n- package lifecycle scripts, Cordis hooks, shell/process execution, filesystem reads/writes, network access, credential access, dynamic code and native modules\n- temporary-Home installation with `dsh plugin --profile web add ... --ignore-scripts`\n- composed configuration before/after installation and real Web startup on loopback\n- JSON, Markdown, SVG compatibility badge and a DSH regression matrix\n- team allowlists, scoped private registries and per-package permission grants\n\nThe static scanner is deliberately explainable: every finding includes a file, line, evidence, permission and confidence. It is a review aid, not a proof that unflagged code is safe.\n\n## Install and use\n\nDSH itself currently requires Node `^22.19 || >=24`; Node 24 is recommended when running isolated checks.\n\n```sh\nnpm install -g dsh-plugin-doctor\n\n# Local checkout, full isolated test against the DSH on PATH\ndsh-plugin-doctor check .\n\n# Published or private npm package, tested against several DSH releases\ndsh-plugin-doctor check @acme/dsh-tools \\\n  --dsh-version 0.1.0-rc.2 \\\n  --dsh-version 0.1.0-rc.3 \\\n  --dsh-version 0.1.0-rc.6\n\n# Strict mode also blocks unacknowledged high-risk permissions\ndsh-plugin-doctor check . --strict --allow-permission hooks\n\n# Audit, isolate-test, install into the real Profile, then boot-test it\ndsh-plugin-doctor install @acme/dsh-tools --profile web\n\n# Restore the latest saved Profile snapshot\ndsh-plugin-doctor rollback --profile web\n```\n\nReports are written to `reports/` by default:\n\n```text\nreports/\n├── acme-dsh-tools.doctor.json\n├── acme-dsh-tools.doctor.md\n└── acme-dsh-tools.badge.svg\n```\n\n## Safety model\n\nAcquisition uses `npm pack --ignore-scripts`, so static inspection does not execute the target package. Isolated and real installs also pass `--ignore-scripts` by default. A plugin requiring a git `prepare`, `preinstall`, `install`, or `postinstall` script receives the critical `install-script` permission and is blocked until it is explicitly acknowledged:\n\n```sh\ndsh-plugin-doctor check github:acme/plugin#<commit> \\\n  --allow-scripts \\\n  --allow-permission install-script\n```\n\n`--allow-scripts` means package code can run outside the agent sandbox during package-manager installation. A temporary `DSH_HOME` protects Profile state; it is not an operating-system sandbox. CI or an ephemeral VM/container is recommended for packages with installation scripts or native code.\n\nThe Web startup probe binds only to `127.0.0.1` on a temporary port, runs from an empty temporary workspace, strips inherited credentials from the plugin runtime, and disables DSH telemetry. Registry credentials are retained only for the package-manager step, where lifecycle scripts remain disabled by default. Captured output is redacted for common token and authorization patterns.\n\n## Installation and rollback\n\n`install` performs the full isolated check first. When it passes, Doctor:\n\n1. resolves `$DSH_HOME` (`DSH_HOME`, otherwise `~/.dsh`);\n2. snapshots `$DSH_HOME/profiles/<profile>` under `$DSH_HOME/.plugin-doctor/backups/`;\n3. runs the official `dsh plugin --profile <profile> add <package>` path;\n4. composes the Profile and starts Web when the target is `web`;\n5. restores the snapshot automatically on any install, composition or startup failure.\n\nThe failed post-install Profile is preserved beside the real Profile as `*.failed-<timestamp>` for diagnosis. Successful installs keep their backup for one-command rollback.\n\n## Team policy, private registries and allowlist\n\nGenerate a starting policy:\n\n```sh\ndsh-plugin-doctor init\n```\n\nThe resulting `.dsh-doctor.json` supports:\n\n```json\n{\n  \"policy\": {\n    \"blockSeverities\": [\"critical\"],\n    \"allowedPermissions\": [],\n    \"packagePermissions\": {\n      \"@acme/*\": [\"hooks\", \"network\"]\n    }\n  },\n  \"allowlist\": [\n    { \"package\": \"@acme/*\", \"owner\": \"platform-security\" },\n    \"github:acme/*\"\n  ],\n  \"registries\": {\n    \"@acme\": \"https://npm.acme.internal\"\n  }\n}\n```\n\nAuthentication remains with npm (`.npmrc`, `NODE_AUTH_TOKEN`, OIDC or the runner's configured credentials). Doctor passes registry selection to npm but never parses or copies credential files into reports.\n\nWhen an allowlist is non-empty, packages that do not match it are blocked. Package permission rules acknowledge only the named capabilities; new capabilities introduced by an update remain visible and subject to policy.\n\n## GitHub Actions\n\nThis repository provides a composite action in [`action.yml`](action.yml). A release matrix can test each supported OS and DSH version:\n\n```yaml\nname: Plugin compatibility\non:\n  release:\n    types: [published]\n\njobs:\n  doctor:\n    strategy:\n      fail-fast: false\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n        dsh: [0.1.0-rc.2, 0.1.0-rc.3, 0.1.0-rc.6]\n    runs-on: ${{ matrix.os }}\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 24\n      - uses: github.com/Xrainsmile/DSH-Plugin-Doctor\n        with:\n          plugin: .\n          dsh-version: ${{ matrix.dsh }}\n      - uses: actions/upload-artifact@v4\n        if: always()\n        with:\n          name: doctor-${{ matrix.os }}-${{ matrix.dsh }}\n          path: reports/\n```\n\nFor private packages, configure npm authentication before the Doctor step. The full working matrix used by this project is in [`.github/workflows/plugin-doctor.yml`](.github/workflows/plugin-doctor.yml).\n\n## Bundle compatibility declaration\n\nThe official Bundle minimum remains:\n\n```json\n{\n  \"dsh\": {\n    \"bundle\": {\n      \"patch\": \"./cordis.patch.yml\"\n    }\n  }\n}\n```\n\nDoctor also recognizes an optional plugin-owned range for regression reporting:\n\n```json\n{\n  \"dsh\": {\n    \"compatibility\": {\n      \"dsh\": \">=0.1.0-rc.2 <0.2.0\"\n    }\n  }\n}\n```\n\nThis extra field is Doctor metadata; DSH itself currently consumes `dsh.bundle.patch` and the Profile's ordered `dsh.profile.bundles` list.","users":{}}