ygl-trees 0.75.0 → 0.75.1

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.75.1(2026-10-17)npm 包修复 hotfix——skills/ 确认进入 tarball
4
+ - 0.75.0 发布时 files 字段更新未被 pnpm pack 拾取(时间窗口 bug)——0.75.1 确认 12 个 skills 文件在 tarball 中
5
+ - 包大小:352KB → 381KB(+29KB = 9 个 SKILL.md)
6
+ - 验证:干净安装 → node_modules/ygl-trees/skills/ 存在
7
+
3
8
  ## 0.75.0(2026-10-17)npm 包修复——skills/ 进 tarball + 乱码修复 + fail-loud
4
9
  - **修复(P0)**:npm tarball 现在包含 skills/ 目录——9 个内置技能随包分发,db init 的 "auto-imported" 承诺兑现
5
10
  - **修复**:autoImportBuiltinSkills 找不到技能时不再静默返回 0——显式警告 "skills/ directory not found"
@@ -778,16 +778,20 @@ CREATE UNIQUE INDEX IF NOT EXISTS uq_skill_refs ON skill_refs(skill_id, path);
778
778
  }));
779
779
  //#endregion
780
780
  //#region packages/core/text/src/fmt.ts
781
- init_db();
782
- const C = {
783
- reset: "\x1B[0m",
784
- bold: "\x1B[1m",
785
- dim: "\x1B[2m",
786
- red: "\x1B[31m",
787
- green: "\x1B[32m",
788
- yellow: "\x1B[33m",
789
- cyan: "\x1B[36m"
790
- };
781
+ var fmt_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
782
+ C: () => C,
783
+ ack: () => ack,
784
+ bad: () => bad,
785
+ dump: () => dump,
786
+ head: () => head,
787
+ ok: () => ok,
788
+ out: () => out,
789
+ paint: () => paint,
790
+ show: () => show,
791
+ table: () => table,
792
+ warn: () => warn,
793
+ writeResult: () => writeResult
794
+ });
791
795
  function paint(code, s, on) {
792
796
  return on ? `${code}${s}${C.reset}` : s;
793
797
  }
@@ -797,6 +801,9 @@ function out(ctx, msg = "") {
797
801
  function ok(ctx, msg) {
798
802
  out(ctx, paint(C.green, ` ✓ ${msg}`, ctx.color));
799
803
  }
804
+ function warn(ctx, msg) {
805
+ out(ctx, paint(C.yellow, ` ! ${msg}`, ctx.color));
806
+ }
800
807
  /**
801
808
  * Failure report. In --json mode stdout is the MACHINE channel, so a failure
802
809
  * must still be parseable there: a single `{"error": "..."}` object (the exit
@@ -858,6 +865,10 @@ function show(ctx, obj, title) {
858
865
  out(ctx, ` ${paint(C.dim, k.padEnd(width), ctx.color)} ${val}`);
859
866
  }
860
867
  }
868
+ function dump(ctx, data) {
869
+ if (ctx.json) console.log(JSON.stringify(data, null, 2));
870
+ else console.log(typeof data === "string" ? data : JSON.stringify(data, null, 2));
871
+ }
861
872
  /**
862
873
  * Write-path result printer with JSON discipline: under --json the ONLY
863
874
  * stdout is one JSON object (duplicate or new, duplicates carry
@@ -881,8 +892,22 @@ function ack(ctx, payload, msg) {
881
892
  if (ctx.json) console.log(JSON.stringify(payload, null, 2));
882
893
  else ok(ctx, msg);
883
894
  }
895
+ var C;
896
+ var init_fmt = require_rolldown_runtime.__esmMin((() => {
897
+ C = {
898
+ reset: "\x1B[0m",
899
+ bold: "\x1B[1m",
900
+ dim: "\x1B[2m",
901
+ red: "\x1B[31m",
902
+ green: "\x1B[32m",
903
+ yellow: "\x1B[33m",
904
+ cyan: "\x1B[36m"
905
+ };
906
+ }));
884
907
  //#endregion
885
908
  //#region packages/core/database/src/types.ts
909
+ init_db();
910
+ init_fmt();
886
911
  const BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
887
912
  "json",
888
913
  "no-color",
@@ -4587,6 +4612,7 @@ var init_writes = require_rolldown_runtime.__esmMin((() => {
4587
4612
  //#endregion
4588
4613
  //#region packages/ops/tools/src/db-cmds.ts
4589
4614
  var db_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$12 });
4615
+ init_fmt();
4590
4616
  init_db();
4591
4617
  /**
4592
4618
  * Cold-start: import the built-in skills that ship with this package, so a
@@ -4607,7 +4633,14 @@ async function autoImportBuiltinSkills(env, dbFile) {
4607
4633
  }
4608
4634
  }
4609
4635
  }
4610
- if (!skillsDir) return 0;
4636
+ if (!skillsDir) {
4637
+ const { out: outFn, paint: paintFn, C: Cf } = (init_fmt(), require_rolldown_runtime.__toCommonJS(fmt_exports));
4638
+ if (env.ctx && !env.ctx.json) {
4639
+ outFn(env.ctx, paintFn(Cf.yellow, " ! built-in skills: 0 found (skills/ not shipped or not in package)", env.ctx.color));
4640
+ outFn(env.ctx, paintFn(Cf.dim, " this is a packaging bug — skills/ should be in the npm tarball", env.ctx.color));
4641
+ }
4642
+ return 0;
4643
+ }
4611
4644
  const { getOrm } = (init_orm(), require_rolldown_runtime.__toCommonJS(orm_exports));
4612
4645
  const writes = (init_writes(), require_rolldown_runtime.__toCommonJS(writes_exports));
4613
4646
  const { parseFrontmatter } = (init_text(), require_rolldown_runtime.__toCommonJS(text_exports));
@@ -4645,6 +4678,7 @@ function run$12(env, action, rest, args) {
4645
4678
  ok(ctx, `database: ${file}`);
4646
4679
  autoImportBuiltinSkills(env, file).then(async (n) => {
4647
4680
  if (n > 0) ok(ctx, `built-in skills: ${n} imported (agent match ready)`);
4681
+ else warn(ctx, "built-in skills: 0 imported — skills/ directory not found in package");
4648
4682
  try {
4649
4683
  const { closeOrm } = (init_orm(), require_rolldown_runtime.__toCommonJS(orm_exports));
4650
4684
  await closeOrm();
@@ -5282,6 +5316,7 @@ function configReset(db, key) {
5282
5316
  //#endregion
5283
5317
  //#region packages/ops/tools/src/config-cmds.ts
5284
5318
  var config_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$11 });
5319
+ init_fmt();
5285
5320
  function run$11(env, action, rest, args) {
5286
5321
  const { ctx, db } = env;
5287
5322
  switch (action) {
@@ -5368,6 +5403,7 @@ function run$11(env, action, rest, args) {
5368
5403
  /** job group — batch + schedule. `job tick` is what cron/systemctl drives.
5369
5404
  * Writes (add) run on the TypeORM write service (src/writes.ts). */
5370
5405
  var job_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$10 });
5406
+ init_fmt();
5371
5407
  init_text();
5372
5408
  init_orm();
5373
5409
  init_writes();
@@ -5575,6 +5611,7 @@ var agent_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
5575
5611
  buildBrief: () => buildBrief,
5576
5612
  run: () => run$9
5577
5613
  });
5614
+ init_fmt();
5578
5615
  init_text();
5579
5616
  /** Build the brief payload (where am I / what exists / what next).
5580
5617
  * Shared by the `agent brief` command and the WebUI dashboard. */
@@ -5939,11 +5976,7 @@ function run$9(env, action, rest, args) {
5939
5976
  }
5940
5977
  //#endregion
5941
5978
  //#region packages/core/text/src/flagcheck.ts
5942
- /**
5943
- * Flag validation helpers (0.54): the cold-user audits found that bare flags
5944
- * (parser returns boolean true) were silently stored as "true" strings, and
5945
- * enum flags accepted arbitrary values. These helpers centralize the checks.
5946
- */
5979
+ init_fmt();
5947
5980
  /**
5948
5981
  * Reject bare flags (given without a value → parser yields boolean true).
5949
5982
  * Returns true if any flag failed (caller should `return 2`).
@@ -6121,6 +6154,7 @@ var init_eval_enhance = require_rolldown_runtime.__esmMin((() => {
6121
6154
  * `source fetch` is async (Node 18+ global fetch) and returns a promise.
6122
6155
  * List commands run on TypeORM (src/orm.ts); search stays raw SQL (FTS5). */
6123
6156
  var cmds_exports$2 = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$8 });
6157
+ init_fmt();
6124
6158
  init_text();
6125
6159
  init_orm();
6126
6160
  init_writes();
@@ -6697,6 +6731,7 @@ function run$8(env, action, rest, args) {
6697
6731
  //#endregion
6698
6732
  //#region packages/research/produce/src/project-cmds.ts
6699
6733
  var project_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$7 });
6734
+ init_fmt();
6700
6735
  init_orm();
6701
6736
  init_writes();
6702
6737
  init_entities$1();
@@ -6835,6 +6870,7 @@ function run$7(env, action, rest, args) {
6835
6870
  * Writes run on the TypeORM write service (src/writes.ts); reads stay on
6836
6871
  * Store until their own migration batch. */
6837
6872
  var produce_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$6 });
6873
+ init_fmt();
6838
6874
  init_text();
6839
6875
  init_orm();
6840
6876
  init_writes();
@@ -7725,6 +7761,7 @@ async function importTree(ds, spec, opts = {}) {
7725
7761
  * ygl-trees node export [--out file] portable JSON
7726
7762
  */
7727
7763
  var cmds_exports$1 = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$5 });
7764
+ init_fmt();
7728
7765
  init_orm();
7729
7766
  init_eval();
7730
7767
  init_text();
@@ -8571,6 +8608,7 @@ function parseState(args) {
8571
8608
  /** skill group — the L1/L2/L3 registry agents query before acting.
8572
8609
  * Writes run on the TypeORM write service (src/writes.ts). */
8573
8610
  var skill_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$4 });
8611
+ init_fmt();
8574
8612
  init_text();
8575
8613
  init_orm();
8576
8614
  init_writes();
@@ -8888,6 +8926,7 @@ function wrap(text, indent = 4) {
8888
8926
  /** kb group — long-term knowledge: store, retrieve, connect, promote to skill.
8889
8927
  * Writes (add/ingest) run on the TypeORM write service (src/writes.ts). */
8890
8928
  var cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$3 });
8929
+ init_fmt();
8891
8930
  init_text();
8892
8931
  init_orm();
8893
8932
  init_writes();
@@ -9200,6 +9239,7 @@ var rels_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
9200
9239
  resolveRef: () => resolveRef,
9201
9240
  run: () => run$2
9202
9241
  });
9242
+ init_fmt();
9203
9243
  init_text();
9204
9244
  init_orm();
9205
9245
  const REL_TYPES = [
@@ -9504,6 +9544,7 @@ var webui_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
9504
9544
  nodeDetail: () => nodeDetail,
9505
9545
  run: () => run$1
9506
9546
  });
9547
+ init_fmt();
9507
9548
  init_orm();
9508
9549
  function run$1(env, action, rest, args) {
9509
9550
  if (action === "serve") return serve(env, args);
@@ -10475,6 +10516,7 @@ function serve(env, args) {
10475
10516
  //#endregion
10476
10517
  //#region packages/ops/tools/src/doctor.ts
10477
10518
  var doctor_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run });
10519
+ init_fmt();
10478
10520
  init_eval();
10479
10521
  init_db();
10480
10522
  init_plugins();
@@ -10713,6 +10755,7 @@ const DOMAIN_MODULES = {
10713
10755
  * Composition happens in profile-boot; no domain logic here.
10714
10756
  */
10715
10757
  init_db();
10758
+ init_fmt();
10716
10759
  const HOME = process.env.YGL_HOME || node_path.join(node_os.homedir(), ".ygl-trees");
10717
10760
  const PLUGINS = {
10718
10761
  database: {
@@ -118,7 +118,7 @@ function run(env, action, rest, args) {
118
118
  if (n > 0)
119
119
  (0, fmt_1.ok)(ctx, `built-in skills: ${n} imported (agent match ready)`);
120
120
  else
121
- warn(ctx, "built-in skills: 0 imported — skills/ directory not found in package");
121
+ (0, fmt_1.warn)(ctx, "built-in skills: 0 imported — skills/ directory not found in package");
122
122
  // Release the ORM connection so the lock doesn't linger
123
123
  try {
124
124
  const { closeOrm } = require("../../../core/database/src/orm");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ygl-trees",
3
- "version": "0.75.0",
3
+ "version": "0.75.1",
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,8 +26,8 @@
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/cordis-plugin-timer": "~1.1.7-alpha.2",
30
29
  "@deepseek-ai/schemastery": "~3.18.5-alpha.2",
30
+ "@deepseek-ai/cordis-plugin-timer": "~1.1.7-alpha.2",
31
31
  "@deepseek-ai/cosmokit": "~1.8.6-alpha.2"
32
32
  },
33
33
  "devDependencies": {