@noob-stupid/dsh-plugin-console 0.3.57 → 0.3.58

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/README.md CHANGED
@@ -311,4 +311,4 @@ The layered-refactor preview lives in its **own repository**: [**`Noob-stupid/ds
311
311
  - **What it is**: the monolithic `lib/index.js` (8547 lines) split into layers — `lib/index.js` **141 lines** + `lib/server/**` **38 modules**; **feature-equivalent to `0.3.57`**, maintainability only;
312
312
  - **Verified**: 19 test suites green · 8 architecture-guard assertions · **route inventory identical** (`status` + response fields) against the stable build;
313
313
  - **Not yet exercised**: real framework upgrade / rollback, restart guardian, component start/stop, real AI run, Gitee OAuth (~10–25% long-tail risk, subjective);
314
- - **For everyday use** stick to npm `@noob-stupid/dsh-plugin-console@0.3.57`, or `main` of this repo.
314
+ - **For everyday use** stick to npm `@noob-stupid/dsh-plugin-console@0.3.58`, or `main` of this repo.
package/README.zh.md CHANGED
@@ -279,5 +279,5 @@ MIT
279
279
  - **已验证**:19 套测试全绿 · 8 条架构守卫断言 · 与稳定版逐条对打**路由清单一致**(`status` + 响应字段);
280
280
  - **已实测**(2026-09-20 真装真卸演练):普通插件 / bundle 插件 / 无 npm 仓库 / 套装 / 技能 / 聚合仓库子包 / 仓库落地 / 服务器组件启停;
281
281
  - **尚未实测**:真框架升级 / 真回滚、重启守护链路、AI 真跑、Gitee OAuth 回调(长尾风险主观估计 **10%~25%**);
282
- - **日常使用请继续用**:npm `@noob-stupid/dsh-plugin-console@0.3.57`,或本仓库 `main`。
282
+ - **日常使用请继续用**:npm `@noob-stupid/dsh-plugin-console@0.3.58`,或本仓库 `main`。
283
283
  - 请多反馈问题
package/lib/index.js CHANGED
@@ -2692,7 +2692,7 @@ export async function searchSubpackageItems(query, token = null, signal = null)
2692
2692
  )
2693
2693
  for (const hit of (codeData.items ?? []).slice(0, 10)) {
2694
2694
  const hitPath = typeof hit.path === 'string' ? hit.path : ''
2695
- if (!/^(?:packages|examples|plugins|skills|apps|extensions|src|lib)\/[^/]+\/package\.json$/u.test(hitPath)) continue
2695
+ if (!/^(?!node_modules\/)[^/]+(?:\/[^/]+)?\/package\.json$/u.test(hitPath)) continue
2696
2696
  const repoName = hit.repository?.full_name ?? ''
2697
2697
  if (!repoName) continue
2698
2698
  const dir = hitPath.split('/').slice(0, -1).join('/')
@@ -3823,7 +3823,7 @@ async function fetchSubpackageNames(repo, branch, auth) {
3823
3823
  try {
3824
3824
  const data = await githubJson(`${GITHUB_API}/repos/${repo}/git/trees/${encodeURIComponent(branch)}?recursive=1`, undefined, auth)
3825
3825
  const paths = (data.tree ?? [])
3826
- .filter((node) => node.type === 'blob' && /^(?:packages|examples|plugins|skills|apps|extensions|src|lib)\/[^/]+\/package\.json$/u.test(node.path))
3826
+ .filter((node) => node.type === 'blob' && /^(?!node_modules\/)[^/]+(?:\/[^/]+)?\/package\.json$/u.test(node.path))
3827
3827
  .map((node) => node.path)
3828
3828
  // 并行读取:黑洞期单条最坏 40s,24 条串行会拖到十几分钟
3829
3829
  const results = await Promise.all(paths.slice(0, 24).map(async (path) => {
@@ -5311,6 +5311,11 @@ async function runInstallJob(job, ctx) {
5311
5311
  job.candidateTotal = candidates.length
5312
5312
  job.candidateDone = false
5313
5313
  for (let index = 0; index < candidates.length && installedName === null; index += 1) {
5314
+ // Issue(2026-09-21):subpackageMode 只表达"优先装子包",不该连坐禁用其它通道。
5315
+ // curl 通道按 name 走 registry(与根包是否 private 无关)→ 子包候选也开放;
5316
+ // release/git 通道是按 job.repo 说的 → 只在"候选就是被请求的那个包"时试,避免对 private 根做无意义尝试。
5317
+ const repoChannelAllowed = !subpackageMode || job.packageName === null || name === job.packageName
5318
+ // 明明 UI 推荐的 `dsh plugin add github:owner/repo` 和 release 通道都没被尝试过。现在:
5314
5319
  if (Date.now() > deadline) break
5315
5320
  const name = candidates[index]
5316
5321
  job.candidateIndex = index + 1
@@ -5329,7 +5334,7 @@ async function runInstallJob(job, ctx) {
5329
5334
  }
5330
5335
  }
5331
5336
  // 加法并行竞速:pnpm 与 curl 同时启动,先成功者生效;失败方 abort,不影响后续串行通道
5332
- if (installedName === null && !subpackageMode && !expanded) {
5337
+ if (installedName === null && !expanded) {
5333
5338
  const raced = await raceInstallChannels(profileDir, name, registries)
5334
5339
  if (raced) {
5335
5340
  installedName = name
@@ -5354,7 +5359,7 @@ async function runInstallJob(job, ctx) {
5354
5359
  if (installedName === null) {
5355
5360
  // 通道 n+1:curl 手动安装(node 网络黑洞时 pnpm 下载卡死、curl 可用)——
5356
5361
  // 下载 registry tarball 解压到 node_modules,零依赖包可完整安装
5357
- if (!subpackageMode && !expanded) {
5362
+ if (!expanded) {
5358
5363
  try {
5359
5364
  const info = await curlManualInstall(profileDir, name, registries)
5360
5365
  installedName = name
@@ -5370,7 +5375,7 @@ async function runInstallJob(job, ctx) {
5370
5375
  // 通道 n+1b:GitHub release 下载安装(npm 上不存在的包,例如面板自身
5371
5376
  // @deepseek-ai/dsh-plugin-console)——拉 latest release 源码 tarball → 盒子验证 → 覆盖。
5372
5377
  // 触发条件:curl 通道失败(registry 404/网络),且能从 job.repo 或已装包 repository 反查到 GitHub。
5373
- if (!subpackageMode && !expanded) {
5378
+ if (repoChannelAllowed && !expanded) {
5374
5379
  let ghRepo = typeof job.repo === 'string' && job.repo !== '' && job.repo.includes('/') ? job.repo : null
5375
5380
  if (ghRepo === null) {
5376
5381
  try {
@@ -5395,7 +5400,7 @@ async function runInstallJob(job, ctx) {
5395
5400
  }
5396
5401
  if (installedName === null) {
5397
5402
  // 通道 n+2:git 通道(GitHub 走加速代理+直连;Gitee 走对应平台;各 60 秒封顶)
5398
- if (!subpackageMode && !expanded) {
5403
+ if (repoChannelAllowed && !expanded) {
5399
5404
  const gitSpecs = job.source === 'gitee'
5400
5405
  ? [`git+https://gitee.com/${job.repo}.git`]
5401
5406
  : [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noob-stupid/dsh-plugin-console",
3
- "version": "0.3.57",
3
+ "version": "0.3.58",
4
4
  "description": "DSH plugin management panel & marketplace: one-click enable/disable, multi-source market (GitHub/Gitee/custom), static-index market (500+ plugins / 300 skills), skills, suites, and one-click framework upgrade.",
5
5
  "repository": {
6
6
  "type": "git",