dshmarket 1.28.1 → 1.28.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/lib/dsh-cli.js CHANGED
@@ -299,6 +299,17 @@ const EXACT_NPM_TARGET_RE = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~
299
299
  * ordinary path, which on that host reports their own refusal — an accurate
300
300
  * message about their contract, rather than one this package invented.
301
301
  */
302
+ /**
303
+ * Added to a refusal from a host whose install boundary only takes
304
+ * `name@exact.version`. Their message is accurate and stays first; this says
305
+ * which property of the plugin put it out of reach, because the user picked a
306
+ * card and has no way to know the difference from the outside (#138).
307
+ */
308
+ const NPM_ONLY_HOST_NOTE = '这个桌面客户端只能安装已发布到 npm 的插件,而该插件仅提供 GitHub 源,因此装不了——这是客户端的安装边界,不是插件或市场的问题。'
309
+ + '可以改用普通 dsh web 安装,或请插件作者发布 npm 包。 / '
310
+ + 'This desktop client can only install plugins published to npm, and this one is GitHub-only, so it cannot be installed here. '
311
+ + 'That is the client\'s install boundary, not a fault in the plugin or the market. '
312
+ + 'Install it from plain dsh web instead, or ask the author to publish to npm.';
302
313
  async function exactNpmArgs(args) {
303
314
  const targets = args.slice(1).filter(argument => !argument.startsWith('-'));
304
315
  const target = targets[0];
@@ -732,6 +743,8 @@ export function createDesktopPluginRuntime(service, activeProfileDir, invokingDi
732
743
  }
733
744
  const abort = new AbortController();
734
745
  let handle;
746
+ /** Set when this host only installs npm packages and the target is not one. */
747
+ let boundaryRefusesTarget = false;
735
748
  try {
736
749
  // `add` goes through Anywhere Labs' install boundary when that host
737
750
  // publishes one, because their Desktop rejects `add` on `runPlugin`
@@ -740,6 +753,13 @@ export function createDesktopPluginRuntime(service, activeProfileDir, invokingDi
740
753
  // in #292 — the ordinary call below is what runs, unchanged.
741
754
  const boundary = prepared.args[0] === 'add' ? service.runExternalMarketPluginInstall : undefined;
742
755
  const viaBoundary = boundary === undefined ? null : await exactNpmArgs(prepared.args);
756
+ // A host that publishes the boundary accepts ONLY `name@exact.version`
757
+ // through it, so a github-sourced plugin has nowhere to go: the
758
+ // fallback below is a call that host refuses outright. Their refusal is
759
+ // accurate but says nothing about why THIS plugin, and roughly half the
760
+ // catalog has no npm package — reported in #138 after the user found
761
+ // out by clicking Install and reading `exit 127`.
762
+ boundaryRefusesTarget = boundary !== undefined && viaBoundary === null;
743
763
  handle = boundary === undefined || viaBoundary === null
744
764
  ? service.runPlugin(prepared.args, invokingDir, abort.signal)
745
765
  : boundary.call(service, viaBoundary, invokingDir, abort.signal);
@@ -751,7 +771,7 @@ export function createDesktopPluginRuntime(service, activeProfileDir, invokingDi
751
771
  exitCode: 127,
752
772
  timedOut: false,
753
773
  stdout: '',
754
- stderr: message,
774
+ stderr: boundaryRefusesTarget ? `${message}\n${NPM_ONLY_HOST_NOTE}` : message,
755
775
  cancelled: false,
756
776
  ...(busy ? { busy: true } : {}),
757
777
  };
@@ -799,11 +819,12 @@ export function createDesktopPluginRuntime(service, activeProfileDir, invokingDi
799
819
  catch (error) {
800
820
  const message = error instanceof Error ? error.message : String(error);
801
821
  progress.error = tracker.snapshot.error;
822
+ const detail = `${stderr}${stderr === '' ? '' : '\n'}${message}`;
802
823
  return {
803
824
  exitCode: 127,
804
825
  timedOut,
805
826
  stdout,
806
- stderr: `${stderr}${stderr === '' ? '' : '\n'}${message}`,
827
+ stderr: boundaryRefusesTarget ? `${detail}\n${NPM_ONLY_HOST_NOTE}` : detail,
807
828
  cancelled: active.userCancelled,
808
829
  };
809
830
  }
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.28.1",
4
+ "version": "1.28.2",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",
package/src/dsh-cli.ts CHANGED
@@ -413,6 +413,19 @@ const EXACT_NPM_TARGET_RE = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~
413
413
  * ordinary path, which on that host reports their own refusal — an accurate
414
414
  * message about their contract, rather than one this package invented.
415
415
  */
416
+ /**
417
+ * Added to a refusal from a host whose install boundary only takes
418
+ * `name@exact.version`. Their message is accurate and stays first; this says
419
+ * which property of the plugin put it out of reach, because the user picked a
420
+ * card and has no way to know the difference from the outside (#138).
421
+ */
422
+ const NPM_ONLY_HOST_NOTE
423
+ = '这个桌面客户端只能安装已发布到 npm 的插件,而该插件仅提供 GitHub 源,因此装不了——这是客户端的安装边界,不是插件或市场的问题。'
424
+ + '可以改用普通 dsh web 安装,或请插件作者发布 npm 包。 / '
425
+ + 'This desktop client can only install plugins published to npm, and this one is GitHub-only, so it cannot be installed here. '
426
+ + 'That is the client\'s install boundary, not a fault in the plugin or the market. '
427
+ + 'Install it from plain dsh web instead, or ask the author to publish to npm.'
428
+
416
429
  async function exactNpmArgs(args: readonly string[]): Promise<string[] | null> {
417
430
  const targets = args.slice(1).filter(argument => !argument.startsWith('-'))
418
431
  const target = targets[0]
@@ -883,6 +896,8 @@ export function createDesktopPluginRuntime(
883
896
 
884
897
  const abort = new AbortController()
885
898
  let handle: DesktopPnpmHandleLike
899
+ /** Set when this host only installs npm packages and the target is not one. */
900
+ let boundaryRefusesTarget = false
886
901
  try {
887
902
  // `add` goes through Anywhere Labs' install boundary when that host
888
903
  // publishes one, because their Desktop rejects `add` on `runPlugin`
@@ -891,6 +906,13 @@ export function createDesktopPluginRuntime(
891
906
  // in #292 — the ordinary call below is what runs, unchanged.
892
907
  const boundary = prepared.args[0] === 'add' ? service.runExternalMarketPluginInstall : undefined
893
908
  const viaBoundary = boundary === undefined ? null : await exactNpmArgs(prepared.args)
909
+ // A host that publishes the boundary accepts ONLY `name@exact.version`
910
+ // through it, so a github-sourced plugin has nowhere to go: the
911
+ // fallback below is a call that host refuses outright. Their refusal is
912
+ // accurate but says nothing about why THIS plugin, and roughly half the
913
+ // catalog has no npm package — reported in #138 after the user found
914
+ // out by clicking Install and reading `exit 127`.
915
+ boundaryRefusesTarget = boundary !== undefined && viaBoundary === null
894
916
  handle = boundary === undefined || viaBoundary === null
895
917
  ? service.runPlugin(prepared.args, invokingDir, abort.signal)
896
918
  : boundary.call(service, viaBoundary, invokingDir, abort.signal)
@@ -901,7 +923,7 @@ export function createDesktopPluginRuntime(
901
923
  exitCode: 127,
902
924
  timedOut: false,
903
925
  stdout: '',
904
- stderr: message,
926
+ stderr: boundaryRefusesTarget ? `${message}\n${NPM_ONLY_HOST_NOTE}` : message,
905
927
  cancelled: false,
906
928
  ...(busy ? { busy: true } : {}),
907
929
  }
@@ -949,11 +971,12 @@ export function createDesktopPluginRuntime(
949
971
  } catch (error) {
950
972
  const message = error instanceof Error ? error.message : String(error)
951
973
  progress.error = tracker.snapshot.error
974
+ const detail = `${stderr}${stderr === '' ? '' : '\n'}${message}`
952
975
  return {
953
976
  exitCode: 127,
954
977
  timedOut,
955
978
  stdout,
956
- stderr: `${stderr}${stderr === '' ? '' : '\n'}${message}`,
979
+ stderr: boundaryRefusesTarget ? `${detail}\n${NPM_ONLY_HOST_NOTE}` : detail,
957
980
  cancelled: active.userCancelled,
958
981
  }
959
982
  } finally {