ygl-trees 0.77.0 → 0.77.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.77.2(2026-10-17)JSON 纯净性修复
4
+ - **契约修复**:unknown-group 错误路径的 try 提示不再泄漏到 --json stdout(冷启动之旅实测发现)
5
+ - degraded mode 提示在 json 模式改走 stderr
6
+ - 冷安装全链路验证通过(npm install → init → doctor → research → tree → kb → webui)
7
+
8
+ ## 0.77.1(2026-10-17)DEP0190 hotfix
9
+ - 所有 shell:true 消除(resolvePm 的 where/version 检查改用无 shell 调用)
10
+ - plugin install/remove 零弃用警告
11
+
3
12
  ## 0.77.0(2026-10-17)plugin 安全加固 + DEP0190 消除
4
13
  - **P0 修复**:plugin install 坏路径不再被记录——存在性校验 + package.json name 校验(a2a 7aa5c871)
5
14
  - **P0 修复**:StartupError 时 plugin 命令走 degraded mode——坏插件不再砖死 home,plugin remove 自愈可用
@@ -386,7 +386,11 @@ async function main(argv) {
386
386
  home, dbFile: dbFile2, ctx,
387
387
  db: null, store: null, cordis: null,
388
388
  };
389
- (0, fmt_1.out)(ctx, (0, fmt_1.paint)(fmt_1.C.yellow, " ! degraded mode: user plugins failed to load — plugin commands only", ctx.color));
389
+ // JSON purity: stdout is the machine channel — degraded-mode notice goes to stderr there
390
+ if (ctx.json)
391
+ console.error((0, fmt_1.paint)(fmt_1.C.yellow, " ! degraded mode: user plugins failed to load — plugin commands only", ctx.color));
392
+ else
393
+ (0, fmt_1.out)(ctx, (0, fmt_1.paint)(fmt_1.C.yellow, " ! degraded mode: user plugins failed to load — plugin commands only", ctx.color));
390
394
  return pluginCmds.runPluginCommand(env2, action || "list", args._.slice(2), args);
391
395
  }
392
396
  (0, startup_diagnostics_1.reportStartupFailure)(e, home, VERSION);
@@ -541,8 +545,9 @@ async function main(argv) {
541
545
  else {
542
546
  (0, fmt_1.bad)(ctx, `unknown group: ${group}`);
543
547
  }
544
- (0, fmt_1.out)(ctx, (0, fmt_1.paint)(fmt_1.C.dim, " try: ygl-trees (no args) for full usage", ctx.color));
545
- ;
548
+ if (!ctx.json) {
549
+ (0, fmt_1.out)(ctx, (0, fmt_1.paint)(fmt_1.C.dim, " try: ygl-trees (no args) for full usage", ctx.color));
550
+ }
546
551
  if (!ctx.json)
547
552
  (0, fmt_1.out)(ctx, usage()); // usage text belongs to the human channel
548
553
  return 2;
@@ -3164,13 +3164,14 @@ function resolvePm(pm) {
3164
3164
  try {
3165
3165
  const where = (0, node_child_process.execFileSync)("where", [pm], {
3166
3166
  stdio: "pipe",
3167
- shell: true
3167
+ shell: false
3168
3168
  }).toString().split(/\r?\n/).filter(Boolean);
3169
3169
  for (const candidate of where) try {
3170
- (0, node_child_process.execFileSync)([q2(candidate), "--version"].join(" "), {
3171
- stdio: "pipe",
3172
- shell: true
3173
- });
3170
+ (0, node_child_process.execFileSync)("cmd", [
3171
+ "/c",
3172
+ candidate,
3173
+ "--version"
3174
+ ], { stdio: "pipe" });
3174
3175
  cachedPm = candidate;
3175
3176
  return candidate;
3176
3177
  } catch {}
@@ -3317,7 +3318,7 @@ function loadUserPlugins(home) {
3317
3318
  issues
3318
3319
  };
3319
3320
  }
3320
- var PROFILE_PKG, cachedPm, q2;
3321
+ var PROFILE_PKG, cachedPm;
3321
3322
  var init_plugins = require_rolldown_runtime.__esmMin((() => {
3322
3323
  PROFILE_PKG = () => ({
3323
3324
  name: "ygl-user-plugins",
@@ -3325,7 +3326,6 @@ var init_plugins = require_rolldown_runtime.__esmMin((() => {
3325
3326
  version: "0.0.0",
3326
3327
  description: "ygl-trees user plugin profile (spec R14 L3)"
3327
3328
  });
3328
- q2 = (s) => `"${String(s).replace(/["&|<>^]/g, "")}"`;
3329
3329
  }));
3330
3330
  //#endregion
3331
3331
  //#region apps/cli/src/startup-diagnostics.ts
@@ -11071,7 +11071,8 @@ async function main(argv) {
11071
11071
  store: null,
11072
11072
  cordis: null
11073
11073
  };
11074
- out(ctx, paint(C.yellow, " ! degraded mode: user plugins failed to load — plugin commands only", ctx.color));
11074
+ if (ctx.json) console.error(paint(C.yellow, " ! degraded mode: user plugins failed to load — plugin commands only", ctx.color));
11075
+ else out(ctx, paint(C.yellow, " ! degraded mode: user plugins failed to load — plugin commands only", ctx.color));
11075
11076
  return pluginCmds.runPluginCommand(env2, action || "list", args._.slice(2), args);
11076
11077
  }
11077
11078
  reportStartupFailure(e, home, VERSION);
@@ -11238,7 +11239,7 @@ async function main(argv) {
11238
11239
  if (suggestions.length === 1) bad(ctx, `unknown group: ${group} — did you mean "${suggestions[0]}"?`);
11239
11240
  else if (suggestions.length > 1) bad(ctx, `unknown group: ${group} — did you mean: ${suggestions.slice(0, 3).join(" | ")}?`);
11240
11241
  else bad(ctx, `unknown group: ${group}`);
11241
- out(ctx, paint(C.dim, " try: ygl-trees (no args) for full usage", ctx.color));
11242
+ if (!ctx.json) out(ctx, paint(C.dim, " try: ygl-trees (no args) for full usage", ctx.color));
11242
11243
  if (!ctx.json) out(ctx, usage());
11243
11244
  return 2;
11244
11245
  }
@@ -182,10 +182,10 @@ function resolvePm(pm) {
182
182
  return cachedPm || pm;
183
183
  cachedPm = null;
184
184
  try {
185
- const where = (0, node_child_process_1.execFileSync)("where", [pm], { stdio: "pipe", shell: true }).toString().split(/\r?\n/).filter(Boolean);
185
+ const where = (0, node_child_process_1.execFileSync)("where", [pm], { stdio: "pipe", shell: false }).toString().split(/\r?\n/).filter(Boolean);
186
186
  for (const candidate of where) {
187
187
  try {
188
- (0, node_child_process_1.execFileSync)([q2(candidate), "--version"].join(" "), { stdio: "pipe", shell: true });
188
+ (0, node_child_process_1.execFileSync)("cmd", ["/c", candidate, "--version"], { stdio: "pipe" });
189
189
  cachedPm = candidate;
190
190
  return candidate;
191
191
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ygl-trees",
3
- "version": "0.77.0",
3
+ "version": "0.77.2",
4
4
  "description": "猿光 · 科技树 — database-centric CLI for research → production → knowledge reuse, built for AI agents.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/apps/cli/index.js",
@@ -26,9 +26,9 @@
26
26
  "reflect-metadata": "^0.2.2",
27
27
  "typeorm": "^1.1.2",
28
28
  "@deepseek-ai/cordis": "~4.0.5-alpha.2",
29
- "@deepseek-ai/schemastery": "~3.18.5-alpha.2",
30
29
  "@deepseek-ai/cordis-plugin-timer": "~1.1.7-alpha.2",
31
- "@deepseek-ai/cosmokit": "~1.8.6-alpha.2"
30
+ "@deepseek-ai/cosmokit": "~1.8.6-alpha.2",
31
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.0.0",