dshmarket 1.62.0 → 1.63.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 (3) hide show
  1. package/lib/check.js +39 -20
  2. package/package.json +1 -1
  3. package/src/check.ts +39 -21
package/lib/check.js CHANGED
@@ -33,13 +33,20 @@ import { findDshInstallDir } from './dsh-install.js';
33
33
  import { resolveDshHome } from './home-paths.js';
34
34
  import { INBOX_BUNDLES, readBundleRules, suggestOrder, validateOrder } from './order.js';
35
35
  // Electron's app.asar packages can be loadable by the host while invisible to
36
- // filesystem probes made from a profile plugin. Keep this fallback limited to
37
- // packages confirmed to ship with the official Desktop app, and only use it
38
- // when the install anchor is the packaged app.
39
- const DESKTOP_HOST_BUNDLES = new Set(['@deepseek-ai/dsh-experimental-agent-team-profile']);
40
- const DESKTOP_HOST_LOADERS = new Set(['@deepseek-ai/dsh-mcp-client']);
36
+ // filesystem probes made from a profile plugin. This is a property of the
37
+ // LAYOUT, not of any particular package: inside an archive every probe
38
+ // answers "absent" for every name, so the fallback keys on the layout, on
39
+ // whether the name is DeepSeek's (`@deepseek-ai/` — only they publish the
40
+ // host), and on nothing else.
41
+ //
42
+ // It used to be two fixed name lists — `dsh-experimental-agent-team-profile`
43
+ // as a bundle, `dsh-mcp-client` as a loader — and every name a Desktop build
44
+ // shipped that was not on them reproduced the same false "will fail to boot"
45
+ // (#676: two reporters, `dsh-experimental-agent-team-profile` AND
46
+ // `dsh-experimental-agent-team-web-profile`). A list of which bundles a host
47
+ // ships cannot be maintained from inside a market that cannot see the host.
41
48
  function isPackagedDesktopInstall(dshInstallDir) {
42
- return dshInstallDir !== null && /[/\\]app\.asar[/\\]dsh$/iu.test(dshInstallDir);
49
+ return dshInstallDir !== null && /[/\\]app\.asar[/\\]/iu.test(dshInstallDir);
43
50
  }
44
51
  export { findDshInstallDir } from './dsh-install.js';
45
52
  /** js-yaml dialect for `!!js` scalars — identical to dsh-app-boot's entryListSchema. */
@@ -711,8 +718,9 @@ function lockfileCoreVersions(profileDir) {
711
718
  */
712
719
  export function buildBundleLayers(profileDirectory, bundleNames, specs, dshInstallDir) {
713
720
  const bundles = bundleNames.map((name) => {
721
+ const officialScope = name.startsWith('@deepseek-ai/');
714
722
  const hostProvided = INBOX_BUNDLES.has(name)
715
- || (isPackagedDesktopInstall(dshInstallDir) && DESKTOP_HOST_BUNDLES.has(name));
723
+ || (isPackagedDesktopInstall(dshInstallDir) && officialScope);
716
724
  // The real loader gives the DSH installation first refusal for in-box
717
725
  // bundles. Desktop keeps that installation private from plugins, so a
718
726
  // DIRECT profile-local copy with the same official name is only a stale
@@ -760,18 +768,23 @@ export function buildBundleLayers(profileDirectory, bundleNames, specs, dshInsta
760
768
  // --dump-config` on the same profile exited 0. Unknown has to read as
761
769
  // unknown; the profile's own bundles are still judged normally.
762
770
  //
763
- // The same holds for any official bundle while the installation itself
764
- // cannot be located (#676): a desktop build ships more in-box bundles
765
- // than the three named in INBOX_BUNDLES —
766
- // `@deepseek-ai/dsh-experimental-agent-team-profile` among them — and a
767
- // fixed list, or an install-path shape, cannot know which. Two
768
- // reporters saw that bundle called "not installed — will fail to boot"
769
- // while its three entries were active in the running host. Only
770
- // DeepSeek publishes under `@deepseek-ai/`, so while the installation
771
- // is out of sight such a bundle is unknown, not missing. When the
772
- // installation IS located and the bundle is in neither it nor the
773
- // profile, the fatal verdict below still applies.
774
- if (hostProvided || (dshInstallDir === null && name.startsWith('@deepseek-ai/'))) {
771
+ // The same holds for an official bundle (#676). Two independent reasons
772
+ // one can be absent from every probe and still be supplied by the
773
+ // running host:
774
+ //
775
+ // - the installation is out of sight entirely — `dshHostInfo` found
776
+ // no anchor at all, which is what a packaged Desktop looks like
777
+ // from in here (#553, and the reporter who could not produce a
778
+ // `dsh --dump-config` because there is no `dsh` on PATH at all);
779
+ // - we have an anchor but it is an ARCHIVE, where a filesystem probe
780
+ // answers "absent" for every name, including the host's own.
781
+ //
782
+ // `hostProvided` is the second case; the first is the check below. Both
783
+ // are gaps in what this process can see, not defects in the profile, so
784
+ // both read as unknown. Community bundles are untouched by this: they
785
+ // resolve through the profile's own node_modules ancestry, which this
786
+ // process CAN probe, so a missing one stays fatal.
787
+ if (hostProvided || (officialScope && dshInstallDir === null)) {
775
788
  layer.error = null;
776
789
  layer.unresolvedInbox = true;
777
790
  return layer;
@@ -991,7 +1004,13 @@ export function analyzeProfile(profileDirectory, options = {}) {
991
1004
  if (dshInstall !== null && core.has(packageName)
992
1005
  && resolvePackageDir(join(dshInstall, 'package.json'), packageName) !== null)
993
1006
  continue;
994
- if (isPackagedDesktopInstall(dshInstall) && DESKTOP_HOST_LOADERS.has(packageName)) {
1007
+ // Same rule as the bundle stack above: inside an archive the probe is
1008
+ // blind for EVERY `@deepseek-ai/` name, so the verdict depends on the
1009
+ // name being DeepSeek's and not on whether it appears on a list of the
1010
+ // ones we happen to have seen. `dsh-mcp-client` was that list's only
1011
+ // entry, and the next host-shipped loader would have been a fresh fatal
1012
+ // error (#676).
1013
+ if (isPackagedDesktopInstall(dshInstall) && packageName.startsWith('@deepseek-ai/')) {
995
1014
  warnings.push(`${row.layer}: bundled Desktop loader ${packageName} could not be independently resolved from app.asar`);
996
1015
  continue;
997
1016
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dshmarket",
3
3
  "description": "Visual plugin market inside DeepSeek Harness — browse, search, and one-click install community plugins. · DSH 可视化插件市场:逛一逛,点一下,装好。",
4
- "version": "1.62.0",
4
+ "version": "1.63.0",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",
package/src/check.ts CHANGED
@@ -35,14 +35,20 @@ import { resolveDshHome } from './home-paths.ts'
35
35
  import { INBOX_BUNDLES, readBundleRules, suggestOrder, validateOrder } from './order.ts'
36
36
 
37
37
  // Electron's app.asar packages can be loadable by the host while invisible to
38
- // filesystem probes made from a profile plugin. Keep this fallback limited to
39
- // packages confirmed to ship with the official Desktop app, and only use it
40
- // when the install anchor is the packaged app.
41
- const DESKTOP_HOST_BUNDLES = new Set(['@deepseek-ai/dsh-experimental-agent-team-profile'])
42
- const DESKTOP_HOST_LOADERS = new Set(['@deepseek-ai/dsh-mcp-client'])
43
-
38
+ // filesystem probes made from a profile plugin. This is a property of the
39
+ // LAYOUT, not of any particular package: inside an archive every probe
40
+ // answers "absent" for every name, so the fallback keys on the layout, on
41
+ // whether the name is DeepSeek's (`@deepseek-ai/` — only they publish the
42
+ // host), and on nothing else.
43
+ //
44
+ // It used to be two fixed name lists — `dsh-experimental-agent-team-profile`
45
+ // as a bundle, `dsh-mcp-client` as a loader — and every name a Desktop build
46
+ // shipped that was not on them reproduced the same false "will fail to boot"
47
+ // (#676: two reporters, `dsh-experimental-agent-team-profile` AND
48
+ // `dsh-experimental-agent-team-web-profile`). A list of which bundles a host
49
+ // ships cannot be maintained from inside a market that cannot see the host.
44
50
  function isPackagedDesktopInstall(dshInstallDir: string | null): boolean {
45
- return dshInstallDir !== null && /[/\\]app\.asar[/\\]dsh$/iu.test(dshInstallDir)
51
+ return dshInstallDir !== null && /[/\\]app\.asar[/\\]/iu.test(dshInstallDir)
46
52
  }
47
53
 
48
54
  export { findDshInstallDir } from './dsh-install.ts'
@@ -901,8 +907,9 @@ export function buildBundleLayers(
901
907
  dshInstallDir: string | null,
902
908
  ): { bundles: BundleLayer[]; layers: LayerInput[] } {
903
909
  const bundles: BundleLayer[] = bundleNames.map((name) => {
910
+ const officialScope = name.startsWith('@deepseek-ai/')
904
911
  const hostProvided = INBOX_BUNDLES.has(name)
905
- || (isPackagedDesktopInstall(dshInstallDir) && DESKTOP_HOST_BUNDLES.has(name))
912
+ || (isPackagedDesktopInstall(dshInstallDir) && officialScope)
906
913
  // The real loader gives the DSH installation first refusal for in-box
907
914
  // bundles. Desktop keeps that installation private from plugins, so a
908
915
  // DIRECT profile-local copy with the same official name is only a stale
@@ -948,18 +955,23 @@ export function buildBundleLayers(
948
955
  // --dump-config` on the same profile exited 0. Unknown has to read as
949
956
  // unknown; the profile's own bundles are still judged normally.
950
957
  //
951
- // The same holds for any official bundle while the installation itself
952
- // cannot be located (#676): a desktop build ships more in-box bundles
953
- // than the three named in INBOX_BUNDLES —
954
- // `@deepseek-ai/dsh-experimental-agent-team-profile` among them — and a
955
- // fixed list, or an install-path shape, cannot know which. Two
956
- // reporters saw that bundle called "not installed — will fail to boot"
957
- // while its three entries were active in the running host. Only
958
- // DeepSeek publishes under `@deepseek-ai/`, so while the installation
959
- // is out of sight such a bundle is unknown, not missing. When the
960
- // installation IS located and the bundle is in neither it nor the
961
- // profile, the fatal verdict below still applies.
962
- if (hostProvided || (dshInstallDir === null && name.startsWith('@deepseek-ai/'))) {
958
+ // The same holds for an official bundle (#676). Two independent reasons
959
+ // one can be absent from every probe and still be supplied by the
960
+ // running host:
961
+ //
962
+ // - the installation is out of sight entirely — `dshHostInfo` found
963
+ // no anchor at all, which is what a packaged Desktop looks like
964
+ // from in here (#553, and the reporter who could not produce a
965
+ // `dsh --dump-config` because there is no `dsh` on PATH at all);
966
+ // - we have an anchor but it is an ARCHIVE, where a filesystem probe
967
+ // answers "absent" for every name, including the host's own.
968
+ //
969
+ // `hostProvided` is the second case; the first is the check below. Both
970
+ // are gaps in what this process can see, not defects in the profile, so
971
+ // both read as unknown. Community bundles are untouched by this: they
972
+ // resolve through the profile's own node_modules ancestry, which this
973
+ // process CAN probe, so a missing one stays fatal.
974
+ if (hostProvided || (officialScope && dshInstallDir === null)) {
963
975
  layer.error = null
964
976
  layer.unresolvedInbox = true
965
977
  return layer
@@ -1174,7 +1186,13 @@ export function analyzeProfile(profileDirectory: string, options: CheckOptions =
1174
1186
  // the writable profile. The loader can resolve them from this anchor.
1175
1187
  if (dshInstall !== null && core.has(packageName)
1176
1188
  && resolvePackageDir(join(dshInstall, 'package.json'), packageName) !== null) continue
1177
- if (isPackagedDesktopInstall(dshInstall) && DESKTOP_HOST_LOADERS.has(packageName)) {
1189
+ // Same rule as the bundle stack above: inside an archive the probe is
1190
+ // blind for EVERY `@deepseek-ai/` name, so the verdict depends on the
1191
+ // name being DeepSeek's and not on whether it appears on a list of the
1192
+ // ones we happen to have seen. `dsh-mcp-client` was that list's only
1193
+ // entry, and the next host-shipped loader would have been a fresh fatal
1194
+ // error (#676).
1195
+ if (isPackagedDesktopInstall(dshInstall) && packageName.startsWith('@deepseek-ai/')) {
1178
1196
  warnings.push(`${row.layer}: bundled Desktop loader ${packageName} could not be independently resolved from app.asar`)
1179
1197
  continue
1180
1198
  }