dsh-agentone 0.5.10 → 0.5.11

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/lib/index.js +14 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -328,11 +328,17 @@ const BUILTIN_PLUGIN_ALLOW_BUILD = {
328
328
  'dsh-im': [],
329
329
  };
330
330
 
331
- /** 安装:白名单校验后转发(desktop 受管 pnpm / 官方 CLI;参数数组,无 shell)。 */
331
+ /** 安装:白名单校验后转发(desktop 受管 pnpm / 官方 CLI;参数数组,无 shell)。
332
+ * pnpm 11 在 profile 存在被忽略的构建脚本时 add 以 ERR_PNPM_IGNORED_BUILDS
333
+ * 非零退出,但包本身已装上(先装后报)——以落盘为准,装上即成功。 */
332
334
  async function installProfilePlugin(config, name, version) {
333
335
  assertValidPackage(name, version);
334
336
  const target = version ? `${name}@${version}` : name;
335
- await runPluginCli(['add', target, ...(BUILTIN_PLUGIN_ALLOW_BUILD[name] || [])]);
337
+ try {
338
+ await runPluginCli(['add', target, ...(BUILTIN_PLUGIN_ALLOW_BUILD[name] || [])]);
339
+ } catch (error) {
340
+ if ((await installedVersion(pluginProfileDir(config), name)) === null) throw error;
341
+ }
336
342
  return listProfilePlugins(config);
337
343
  }
338
344
 
@@ -377,7 +383,12 @@ async function upgradeProfilePlugin(config, name) {
377
383
  if (latest === current || (current && compareSemver(latest, current) <= 0)) {
378
384
  throw new Error(`已是最新版本(v${current ?? latest})`);
379
385
  }
380
- await runPluginCli(['add', `${name}@${latest}`, ...(BUILTIN_PLUGIN_ALLOW_BUILD[name] || [])]);
386
+ try {
387
+ await runPluginCli(['add', `${name}@${latest}`, ...(BUILTIN_PLUGIN_ALLOW_BUILD[name] || [])]);
388
+ } catch (error) {
389
+ // 同 install:ERR_PNPM_IGNORED_BUILDS 非零退出但包已装上,不阻断升级
390
+ if ((await installedVersion(dir, name)) !== latest) throw error;
391
+ }
381
392
  const after = await installedVersion(dir, name);
382
393
  if (after !== latest) {
383
394
  // 兑现「插件已升级」提示的前置校验:没升上去就明说,不再假报成功
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agentone",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "AgentOne 平台集成插件:飞书登录、平台模型、SkillHub 技能、套餐申请、插件管理、lark-cli / ccpg-cli 探测(请求超时与错误码透传、令牌轮换 single-flight、凭据损坏容错、状态页 UX 增强)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",