@noob-stupid/dsh-plugin-console 0.5.18 → 0.5.20

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.
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { installJobView } from '../domain/install.js'
5
5
  import { runInstallJob } from '../domain/install-job.js'
6
- import { githubRepoInfo } from '../domain/market.js'
6
+ import { fetchRepoPackageEx, githubRepoInfo, subpackageCandidates } from '../domain/market.js'
7
7
  import { runSkillInstallJob } from '../domain/skills.js'
8
8
  import { probeGitmodules, resolveInstallKind, runSuiteInstallJob } from '../domain/suite.js'
9
9
  import { sendError, sendJson } from '../infra/httpd.js'
@@ -83,10 +83,15 @@ async function routeInstall(req, res, rc) {
83
83
  // 套装通道兜底:探测说有、clone 下来却没有 .gitmodules(假阳性 / 仓库已重构)时
84
84
  // 回落普通插件安装,而不是给用户一个「未找到 .gitmodules」的失败。
85
85
  const runSuiteThenFallback = async () => {
86
- const result = await runSuiteInstallJob(job, ctx)
86
+ // 0.5.19:套装作业入口自己也有一道判据(根包/子包已发布 → 不克隆整个仓库),它需要真实探测:
87
+ // 显式「安装套装」(前端 hasSuite=true 的卡片)走的就是这条路,不经过 install-job 的候选循环。
88
+ const result = await runSuiteInstallJob(job, ctx, {
89
+ probes: { fetchRepoPackageEx, subpackageCandidates, probeGitmodules },
90
+ })
87
91
  if (result?.notASuite !== true) return
88
92
  job.kind = 'plugin'
89
- job.suiteNote = '仓库实际内容与探测不符(没有 .gitmodules),已自动回落普通插件安装'
93
+ // 回落文案一律用 result.reason:克隆失败与"内容不符"是两回事,不能都报成后者(用户会被带偏)
94
+ job.suiteNote = result.reason ?? '仓库实际内容与探测不符(没有 .gitmodules),已自动回落普通插件安装'
90
95
  await runInstallJob(job, ctx)
91
96
  }
92
97
  // 后台执行:请求立即返回,安装不受客户端断开/离开面板影响
@@ -109,7 +114,14 @@ async function routeInstallStatus(req, res, rc) {
109
114
  sendError(res, 404, '没有这个安装任务')
110
115
  return
111
116
  }
112
- sendJson(res, 200, { ok: true, ...installJobView(job) })
117
+ sendJson(res, 200, {
118
+ ok: true,
119
+ ...installJobView(job),
120
+ // 结构化建议动作(2026-09-27 加法,向后兼容):老客户端忽略该字段;
121
+ // 新客户端在安装结果卡片里渲染「执行 / 复制」小框(POST /plugin-console/run-suggested)。
122
+ // 放这里而不是 install.js#installJobView:那个模块已贴着 600 行架构棘轮(见 test-architecture-guard.mjs)。
123
+ suggestedAction: job.suggestedAction ?? null,
124
+ })
113
125
  return
114
126
  }
115
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noob-stupid/dsh-plugin-console",
3
- "version": "0.5.18",
3
+ "version": "0.5.20",
4
4
  "description": "DSH 框架升级安全与插件升级门控:一键升级、失败自动回滚、升级后回滚上版、旧插件不适配自动禁用;内置多源插件市场为发现层,插件源全部可自定义,可指向公司内网私有源 / 私有索引 / 本地 Git 仓库,纯内网离线可用 | Framework upgrade safety & plugin version gating for DSH, with a customizable multi-source plugin market: point every source at internal mirrors or a local file:// repo for intranet-only, offline installs.",
5
5
  "repository": {
6
6
  "type": "git",