dsh-plugin-toolkit 0.9.1 → 0.9.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.9.2
2
+
3
+ - `doctor` reports a shipped client bundle that no `dsh.client` declares. The host
4
+ serves `client.js` only for packages declaring `dsh.client`, so a plugin could
5
+ ship the bundle, mount it in `verify`, and still have no panel in the app — the
6
+ same silent failure as a tarball without it.
7
+ - The toolkit's own manifest now declares `dsh.client` (`platform: web`,
8
+ `inject: ['@deepseek-ai/dsh-client-ui-sidebar-right']`), which is what makes the
9
+ Plugin doctor tab reachable at all.
10
+ - The `not-shipped` fixture declares its client entry, so it keeps demonstrating
11
+ the `files` gap instead of tripping the new declaration check.
12
+
1
13
  ## 0.9.1
2
14
 
3
15
  - `audit` separates problems from advisories. Running 0.9.0 on a real profile
package/README.md CHANGED
@@ -313,6 +313,12 @@ dsh-plugin verify: stopped at pack
313
313
 
314
314
  ## When the panel does not appear
315
315
 
316
+ The first question is whether the host ever served your bundle. A package that
317
+ ships `client.js` but declares no `dsh.client` loads its host half and shows no
318
+ panel — `doctor` now fails that, because the host serves client bundles only for
319
+ packages that declare one:
320
+
321
+
316
322
  The install reports success and nothing shows up. In this order:
317
323
 
318
324
  1. **Did the host restart?** Client bundles are read at startup. `dsh plugin add`
package/lib/doctor.mjs CHANGED
@@ -110,6 +110,30 @@ export function checkClientEntry(dir, manifest) {
110
110
  return found ? null : `dsh.client is declared but none of ${entries.join(', ')} exists`;
111
111
  }
112
112
 
113
+ /**
114
+ * A client bundle the harness will never serve is the same failure as a tarball
115
+ * without one: the plugin loads, the row mounts, and no panel appears. The host
116
+ * serves `client.js` only for packages declaring `dsh.client`, so shipping the
117
+ * file by convention is not enough.
118
+ */
119
+ const CLIENT_FILES = ['client.js', 'lib/client.js', 'dist/client.js'];
120
+
121
+ export function checkClientDeclaration(dir, manifest) {
122
+ const client = manifest.dsh?.client;
123
+ if (client !== undefined && client !== null) {
124
+ const platform = client.platform;
125
+ if (platform === undefined || platform === 'web') return null;
126
+ return `dsh.client.platform is ${JSON.stringify(platform)}, but the harness serves client bundles on web`;
127
+ }
128
+ const exported = manifest.exports;
129
+ const subpath = typeof exported === 'string' ? undefined : exportTarget(exported?.['./client']);
130
+ const shipped = [subpath, ...CLIENT_FILES].find(
131
+ (file) => typeof file === 'string' && fs.existsSync(path.join(dir, file.replace(/^\.\//u, ''))),
132
+ );
133
+ if (shipped === undefined) return null;
134
+ return `${shipped.replace(/^\.\//u, '')} ships but dsh.client is not declared, so the harness never serves the bundle and the panel cannot appear`;
135
+ }
136
+
113
137
  /** Every path the manifest points at: exports, the bundle patch, the client entry. */
114
138
  export function declaredPaths(manifest) {
115
139
  const paths = new Set();
@@ -200,6 +224,7 @@ export function doctor(dir, { installed = false } = {}) {
200
224
  ['dsh field', checkDshField(manifest)],
201
225
  ['patch file', checkPatchFile(dir, manifest)],
202
226
  ['client entry', checkClientEntry(dir, manifest)],
227
+ ['client declaration', checkClientDeclaration(dir, manifest)],
203
228
  // After install the tarball is already unpacked, so `files` cannot be used to
204
229
  // decide what shipped: npm always ships package.json and the README.
205
230
  ['files list', installed === true ? null : checkFilesList(manifest)],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-toolkit",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Preflight, release and test DeepSeek Harness plugins: checks what the host needs, waits for npm to actually serve the version, and keeps the market index honest.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -74,6 +74,13 @@
74
74
  "dsh": {
75
75
  "bundle": {
76
76
  "patch": "./cordis.patch.yml"
77
+ },
78
+ "client": {
79
+ "platform": "web",
80
+ "immediately": true,
81
+ "inject": [
82
+ "@deepseek-ai/dsh-client-ui-sidebar-right"
83
+ ]
77
84
  }
78
85
  },
79
86
  "main": "index.js"