dsh-plugin-pack 1.0.17 → 1.0.18

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 (2) hide show
  1. package/client.js +23 -13
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -2228,7 +2228,13 @@ window.__ModuleLoader__.load({ id: 'dsh-plugin-pack', factory: (require) => {
2228
2228
  }
2229
2229
 
2230
2230
  if (quick && Array.isArray(quick.names) && quick.names.length) {
2231
- const installed = new Map((status?.plugins ?? []).map((plugin) => [plugin.name, plugin]));
2231
+ /* 现取一次状态,不要用打开面板时缓存的那份。
2232
+ * 用户可能刚装完插件就拖包进来,缓存里还没有那两个,
2233
+ * 结果全部被标成「新建」——既不弹覆盖/跳过,又会重复装一遍。
2234
+ * 服务端扫描结果有缓存(按目录 mtime 失效),所以这次调用很快。 */
2235
+ const freshStatus = await getStatus().catch(() => null);
2236
+ const sourcePlugins = freshStatus?.plugins ?? status?.plugins ?? [];
2237
+ const installed = new Map(sourcePlugins.map((plugin) => [plugin.name, plugin]));
2232
2238
  const packPlugins = (quick.manifest?.plugins ?? []).filter(Boolean);
2233
2239
  const conflicts = packPlugins
2234
2240
  .filter((plugin) => installed.has(plugin.name))
@@ -2272,18 +2278,22 @@ window.__ModuleLoader__.load({ id: 'dsh-plugin-pack', factory: (require) => {
2272
2278
  };
2273
2279
  });
2274
2280
 
2275
- setPendingImport({
2276
- kind: 'bundle',
2277
- pendingFile: file, // 还没上传,先拿着 File 对象
2278
- file: null,
2279
- conflicts: rows.filter((row) => row.exists),
2280
- rows,
2281
- plugins: packPlugins,
2282
- quick: true,
2283
- });
2284
- setBusy(false);
2285
- setPhase('');
2286
- return;
2281
+ /* manifest 里没有 plugins 清单(老包或手工拼的)就别弹空框,
2282
+ * 让下面的上传 + dryRun 用服务端的真实结果来问。 */
2283
+ if (rows.length) {
2284
+ setPendingImport({
2285
+ kind: 'bundle',
2286
+ pendingFile: file, // 还没上传,先拿着 File 对象
2287
+ file: null,
2288
+ conflicts: rows.filter((row) => row.exists),
2289
+ rows,
2290
+ plugins: packPlugins,
2291
+ quick: true,
2292
+ });
2293
+ setBusy(false);
2294
+ setPhase('');
2295
+ return;
2296
+ }
2287
2297
  }
2288
2298
 
2289
2299
  // 第二步:确认无冲突(或拿不到快速清单)才上传
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-pack",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "DeepSeek Harness 插件整合包:一键把当前 profile 的第三方插件连依赖和配置导出成 zip(内部每个插件是标准 npm tgz),换机/换 profile 拖进去就能还原。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",