ygl-trees 0.68.0 → 0.70.0

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.
@@ -1,64 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- //#region \0rolldown/runtime.js
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __esmMin = (fn, res, err) => () => {
11
- if (err) throw err[0];
12
- try {
13
- return fn && (res = fn(fn = 0)), res;
14
- } catch (e) {
15
- throw err = [e], e;
16
- }
17
- };
18
- var __exportAll = (all, no_symbols) => {
19
- let target = {};
20
- for (var name in all) __defProp(target, name, {
21
- get: all[name],
22
- enumerable: true
23
- });
24
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
25
- return target;
26
- };
27
- var __copyProps = (to, from, except, desc) => {
28
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
29
- key = keys[i];
30
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
31
- get: ((k) => from[k]).bind(null, key),
32
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
33
- });
34
- }
35
- return to;
36
- };
37
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
38
- value: mod,
39
- enumerable: true
40
- }) : target, mod));
41
- var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
42
- //#endregion
3
+ const require_rolldown_runtime = require("./rolldown-runtime-C96Ew50Q.cjs");
43
4
  let node_os = require("node:os");
44
- node_os = __toESM(node_os);
5
+ node_os = require_rolldown_runtime.__toESM(node_os);
45
6
  let node_path = require("node:path");
46
- node_path = __toESM(node_path);
7
+ node_path = require_rolldown_runtime.__toESM(node_path);
47
8
  let node_sqlite3_wasm = require("node-sqlite3-wasm");
48
9
  let node_fs = require("node:fs");
49
- node_fs = __toESM(node_fs);
10
+ node_fs = require_rolldown_runtime.__toESM(node_fs);
50
11
  let node_crypto = require("node:crypto");
51
12
  let _deepseek_ai_cordis = require("@deepseek-ai/cordis");
52
13
  let _deepseek_ai_cordis_plugin_timer = require("@deepseek-ai/cordis-plugin-timer");
53
- _deepseek_ai_cordis_plugin_timer = __toESM(_deepseek_ai_cordis_plugin_timer);
14
+ _deepseek_ai_cordis_plugin_timer = require_rolldown_runtime.__toESM(_deepseek_ai_cordis_plugin_timer);
54
15
  let node_child_process = require("node:child_process");
55
16
  let _deepseek_ai_dsh_atomic_write = require("@deepseek-ai/dsh-atomic-write");
56
17
  require("reflect-metadata");
57
18
  let typeorm = require("typeorm");
58
19
  let _deepseek_ai_schemastery = require("@deepseek-ai/schemastery");
59
- _deepseek_ai_schemastery = __toESM(_deepseek_ai_schemastery);
20
+ _deepseek_ai_schemastery = require_rolldown_runtime.__toESM(_deepseek_ai_schemastery);
60
21
  //#region packages/core/text/src/text.ts
61
- var text_exports = /* @__PURE__ */ __exportAll({
22
+ var text_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
62
23
  clip: () => clip,
63
24
  contentHash: () => contentHash,
64
25
  ngram: () => ngram,
@@ -167,7 +128,7 @@ function splitTags(v) {
167
128
  return (v || "").split(/[,,;;\s]+/).map((s) => s.trim()).filter(Boolean);
168
129
  }
169
130
  var CJK, CJK_RUN_RE, CJK_ONLY_RE;
170
- var init_text = __esmMin((() => {
131
+ var init_text = require_rolldown_runtime.__esmMin((() => {
171
132
  CJK = "\\u4e00-\\u9fff\\u3400-\\u4dbf\\uf900-\\ufaff";
172
133
  new RegExp(`[${CJK}]`, "u");
173
134
  CJK_RUN_RE = new RegExp(`[${CJK}]+|[^\\s${CJK}]+`, "gu");
@@ -181,7 +142,7 @@ var init_text = __esmMin((() => {
181
142
  * Everything — skills, research state, evidence, drafts, knowledge notes and
182
143
  * schedules — lives in one SQLite file. No sidecar JSON, no git-as-database.
183
144
  */
184
- var db_exports = /* @__PURE__ */ __exportAll({
145
+ var db_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
185
146
  COND_KINDS: () => COND_KINDS,
186
147
  DB: () => DB,
187
148
  EDGE_MODES: () => EDGE_MODES,
@@ -195,7 +156,7 @@ function dbPath(home) {
195
156
  return node_path.join(home, "ygl-trees.db");
196
157
  }
197
158
  var SCHEMA_SQL, DB, EDGE_RELS, EDGE_MODES, COND_KINDS;
198
- var init_db = __esmMin((() => {
159
+ var init_db = require_rolldown_runtime.__esmMin((() => {
199
160
  init_text();
200
161
  SCHEMA_SQL = `
201
162
  -- ---------------------------------------------------------------- meta
@@ -1425,7 +1386,7 @@ function mapOutcome(r, high = .7, low = .4) {
1425
1386
  };
1426
1387
  }
1427
1388
  var GATEWAY_URL, MODEL_ID, NO_TOKEN;
1428
- var init_eval = __esmMin((() => {
1389
+ var init_eval = require_rolldown_runtime.__esmMin((() => {
1429
1390
  GATEWAY_URL = "https://ai-gateway.vercel.sh/v4/ai/evaluation-model";
1430
1391
  MODEL_ID = "typesafe-ai/jev";
1431
1392
  NO_TOKEN = "no evaluator configured (set config decision_model_llm_token, or AI_GATEWAY_API_KEY / ~/.vercel.ai-gateway.env)";
@@ -1937,7 +1898,7 @@ var TreeStore = class {
1937
1898
  /** Full-text search over nodes. Title/key substring hits outrank same-hit
1938
1899
  * rows (same ranking semantics as kb/skill/source search). */
1939
1900
  nodeSearch(treeId, q, limit = 20) {
1940
- const tokens = Array.from(new Set(String((init_text(), __toCommonJS(text_exports)).ngram(q) || "").split(/\s+/).filter(Boolean)));
1901
+ const tokens = Array.from(new Set(String((init_text(), require_rolldown_runtime.__toCommonJS(text_exports)).ngram(q) || "").split(/\s+/).filter(Boolean)));
1941
1902
  if (!tokens.length) return [];
1942
1903
  const agg = /* @__PURE__ */ new Map();
1943
1904
  const st = this.db.db.prepare(`SELECT n.id,n.key,n.name,n.tier, bm25(nodes_fts) AS score
@@ -2591,7 +2552,7 @@ function apply(ctx) {
2591
2552
  *
2592
2553
  * @module @ygl/ops-tools/plugins
2593
2554
  */
2594
- var plugins_exports = /* @__PURE__ */ __exportAll({
2555
+ var plugins_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
2595
2556
  initProfile: () => initProfile,
2596
2557
  installPlugin: () => installPlugin,
2597
2558
  listPlugins: () => listPlugins,
@@ -2842,7 +2803,7 @@ function loadUserPlugins(home) {
2842
2803
  };
2843
2804
  }
2844
2805
  var PROFILE_PKG, cachedPm, q2;
2845
- var init_plugins = __esmMin((() => {
2806
+ var init_plugins = require_rolldown_runtime.__esmMin((() => {
2846
2807
  PROFILE_PKG = () => ({
2847
2808
  name: "ygl-user-plugins",
2848
2809
  private: true,
@@ -3073,7 +3034,7 @@ function runPluginCommand(env, action, rest, args) {
3073
3034
  bad(ctx, `'${name}' is not in the user bundle`);
3074
3035
  return 1;
3075
3036
  }
3076
- const bundle = (init_plugins(), __toCommonJS(plugins_exports)).readUserBundle(home).find((p) => p.name === name);
3037
+ const bundle = (init_plugins(), require_rolldown_runtime.__toCommonJS(plugins_exports)).readUserBundle(home).find((p) => p.name === name);
3077
3038
  out(ctx, JSON.stringify(bundle?.config ?? {}, null, 2));
3078
3039
  return 0;
3079
3040
  }
@@ -3484,7 +3445,7 @@ function preflightTypeCheck(db) {
3484
3445
  function __decorateMetadata(k, v) {
3485
3446
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
3486
3447
  }
3487
- var init_decorateMetadata = __esmMin((() => {}));
3448
+ var init_decorateMetadata = require_rolldown_runtime.__esmMin((() => {}));
3488
3449
  //#endregion
3489
3450
  //#region \0@oxc-project+runtime@0.154.0/helpers/esm/decorate.js
3490
3451
  function __decorate(decorators, target, key, desc) {
@@ -3493,7 +3454,7 @@ function __decorate(decorators, target, key, desc) {
3493
3454
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3494
3455
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3495
3456
  }
3496
- var init_decorate = __esmMin((() => {}));
3457
+ var init_decorate = require_rolldown_runtime.__esmMin((() => {}));
3497
3458
  //#endregion
3498
3459
  //#region packages/research/pipeline/src/entities.ts
3499
3460
  /**
@@ -3508,7 +3469,7 @@ var init_decorate = __esmMin((() => {}));
3508
3469
  * stay raw SQL in store.ts (see docs/plan.md TypeORM boundaries).
3509
3470
  */
3510
3471
  var Project, Query, Source, QuerySource, Evidence, Claim, ClaimEvidence, RESEARCH_ENTITIES;
3511
- var init_entities$1 = __esmMin((() => {
3472
+ var init_entities$1 = require_rolldown_runtime.__esmMin((() => {
3512
3473
  init_decorateMetadata();
3513
3474
  init_decorate();
3514
3475
  Project = class Project {
@@ -3882,7 +3843,7 @@ var init_entities$1 = __esmMin((() => {
3882
3843
  /** Cross-cutting entities (audit trail). Research-domain entities live in
3883
3844
  * research.ts; both are registered in src/orm.ts. */
3884
3845
  var Event, CORE_ENTITIES;
3885
- var init_entities = __esmMin((() => {
3846
+ var init_entities = require_rolldown_runtime.__esmMin((() => {
3886
3847
  init_decorateMetadata();
3887
3848
  init_decorate();
3888
3849
  Event = class Event {
@@ -3948,7 +3909,7 @@ var init_entities = __esmMin((() => {
3948
3909
  * - CLI commands using the ORM must return a Promise (main() awaits) so
3949
3910
  * the DataSource settles before the wasm DB closes.
3950
3911
  */
3951
- var orm_exports = /* @__PURE__ */ __exportAll({
3912
+ var orm_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
3952
3913
  closeOrm: () => closeOrm,
3953
3914
  getOrm: () => getOrm
3954
3915
  });
@@ -3979,14 +3940,14 @@ async function closeOrm() {
3979
3940
  }
3980
3941
  }
3981
3942
  var cached;
3982
- var init_orm = __esmMin((() => {
3943
+ var init_orm = require_rolldown_runtime.__esmMin((() => {
3983
3944
  init_entities$1();
3984
3945
  init_entities();
3985
3946
  cached = null;
3986
3947
  }));
3987
3948
  //#endregion
3988
3949
  //#region packages/research/pipeline/src/writes.ts
3989
- var writes_exports = /* @__PURE__ */ __exportAll({
3950
+ var writes_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
3990
3951
  artifactAdd: () => artifactAdd,
3991
3952
  claimAdd: () => claimAdd,
3992
3953
  claimLink: () => claimLink,
@@ -4611,7 +4572,7 @@ async function projectCreate(ds, name, question = "") {
4611
4572
  });
4612
4573
  }
4613
4574
  var TASK_STATUSES;
4614
- var init_writes = __esmMin((() => {
4575
+ var init_writes = require_rolldown_runtime.__esmMin((() => {
4615
4576
  init_entities$1();
4616
4577
  init_entities();
4617
4578
  init_text();
@@ -4623,7 +4584,7 @@ var init_writes = __esmMin((() => {
4623
4584
  }));
4624
4585
  //#endregion
4625
4586
  //#region packages/ops/tools/src/db-cmds.ts
4626
- var db_cmds_exports = /* @__PURE__ */ __exportAll({ run: () => run$12 });
4587
+ var db_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$12 });
4627
4588
  init_db();
4628
4589
  /**
4629
4590
  * Cold-start: import the built-in skills that ship with this package, so a
@@ -4645,9 +4606,9 @@ async function autoImportBuiltinSkills(env, dbFile) {
4645
4606
  }
4646
4607
  }
4647
4608
  if (!skillsDir) return 0;
4648
- const { getOrm } = (init_orm(), __toCommonJS(orm_exports));
4649
- const writes = (init_writes(), __toCommonJS(writes_exports));
4650
- const { parseFrontmatter } = (init_text(), __toCommonJS(text_exports));
4609
+ const { getOrm } = (init_orm(), require_rolldown_runtime.__toCommonJS(orm_exports));
4610
+ const writes = (init_writes(), require_rolldown_runtime.__toCommonJS(writes_exports));
4611
+ const { parseFrontmatter } = (init_text(), require_rolldown_runtime.__toCommonJS(text_exports));
4651
4612
  const ds = await getOrm(dbFile);
4652
4613
  let count = 0;
4653
4614
  for (const entry of fs2.readdirSync(skillsDir)) {
@@ -4674,16 +4635,16 @@ function run$12(env, action, rest, args) {
4674
4635
  switch (action) {
4675
4636
  case "init": {
4676
4637
  node_fs.mkdirSync(home, { recursive: true });
4677
- const d = new (init_db(), __toCommonJS(db_exports)).DB(file);
4638
+ const d = new (init_db(), require_rolldown_runtime.__toCommonJS(db_exports)).DB(file);
4678
4639
  d.metaSet("created", (/* @__PURE__ */ new Date()).toISOString());
4679
- d.metaSet("schema_version", String((init_db(), __toCommonJS(db_exports)).SCHEMA_VERSION));
4640
+ d.metaSet("schema_version", String((init_db(), require_rolldown_runtime.__toCommonJS(db_exports)).SCHEMA_VERSION));
4680
4641
  d.close();
4681
4642
  ok(ctx, `workspace ready: ${home}`);
4682
4643
  ok(ctx, `database: ${file}`);
4683
4644
  autoImportBuiltinSkills(env, file).then(async (n) => {
4684
4645
  if (n > 0) ok(ctx, `built-in skills: ${n} imported (agent match ready)`);
4685
4646
  try {
4686
- const { closeOrm } = (init_orm(), __toCommonJS(orm_exports));
4647
+ const { closeOrm } = (init_orm(), require_rolldown_runtime.__toCommonJS(orm_exports));
4687
4648
  await closeOrm();
4688
4649
  } catch {}
4689
4650
  });
@@ -5029,7 +4990,7 @@ function configReset(db, key) {
5029
4990
  }
5030
4991
  //#endregion
5031
4992
  //#region packages/ops/tools/src/config-cmds.ts
5032
- var config_cmds_exports = /* @__PURE__ */ __exportAll({ run: () => run$11 });
4993
+ var config_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$11 });
5033
4994
  function run$11(env, action, rest, args) {
5034
4995
  const { ctx, db } = env;
5035
4996
  switch (action) {
@@ -5115,7 +5076,7 @@ function run$11(env, action, rest, args) {
5115
5076
  //#region packages/ops/tools/src/job-cmds.ts
5116
5077
  /** job group — batch + schedule. `job tick` is what cron/systemctl drives.
5117
5078
  * Writes (add) run on the TypeORM write service (src/writes.ts). */
5118
- var job_cmds_exports = /* @__PURE__ */ __exportAll({ run: () => run$10 });
5079
+ var job_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$10 });
5119
5080
  init_text();
5120
5081
  init_orm();
5121
5082
  init_writes();
@@ -5319,7 +5280,7 @@ function withTickLock(env, fn) {
5319
5280
  }
5320
5281
  //#endregion
5321
5282
  //#region packages/ops/tools/src/agent-cmds.ts
5322
- var agent_cmds_exports = /* @__PURE__ */ __exportAll({
5283
+ var agent_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
5323
5284
  buildBrief: () => buildBrief,
5324
5285
  run: () => run$9
5325
5286
  });
@@ -5390,6 +5351,72 @@ function buildBrief(env) {
5390
5351
  function run$9(env, action, rest, args) {
5391
5352
  const { ctx, store } = env;
5392
5353
  switch (action) {
5354
+ case "metrics": {
5355
+ const t0 = Date.now();
5356
+ const brief = buildBrief(env);
5357
+ const briefMs = Date.now() - t0;
5358
+ const kbTotal = env.db.get("SELECT COUNT(*) AS n FROM kb_notes")?.n || 0;
5359
+ const kbRecent = env.db.get("SELECT COUNT(*) AS n FROM kb_notes WHERE created > datetime('now', '-7 days')")?.n || 0;
5360
+ const claims = env.db.get("SELECT COUNT(*) AS n FROM claims")?.n || 0;
5361
+ const claimsVerified = env.db.get("SELECT COUNT(*) AS n FROM claims WHERE status='supported'")?.n || 0;
5362
+ const evidence = env.db.get("SELECT COUNT(*) AS n FROM evidence")?.n || 0;
5363
+ const sources = env.db.get("SELECT COUNT(*) AS n FROM sources")?.n || 0;
5364
+ const skills = store.skillList();
5365
+ const skillHits = skills.reduce((s, x) => s + (x.hits || 0), 0);
5366
+ const trees = env.db.all("SELECT id, name FROM trees");
5367
+ let nodesTotal = 0, nodesUnlocked = 0;
5368
+ for (const t of trees) {
5369
+ const r = env.db.get("SELECT COUNT(*) AS total, SUM(CASE WHEN ns.status='unlocked' THEN 1 ELSE 0 END) AS unlocked FROM nodes n LEFT JOIN node_state ns ON ns.node_id=n.id AND ns.context='default' WHERE n.tree_id=?", [t.id]);
5370
+ nodesTotal += r?.total || 0;
5371
+ nodesUnlocked += r?.unlocked || 0;
5372
+ }
5373
+ const events7d = env.db.get("SELECT COUNT(*) AS n FROM events WHERE ts > datetime('now', '-7 days')")?.n || 0;
5374
+ const metrics = {
5375
+ cold_start: {
5376
+ brief_ms: briefMs,
5377
+ next_actions: brief.next_actions?.length || 0,
5378
+ skills_available: skills.length
5379
+ },
5380
+ knowledge: {
5381
+ total_notes: kbTotal,
5382
+ recent_7d: kbRecent,
5383
+ growth_rate_7d: kbTotal > 0 ? Math.round(kbRecent / kbTotal * 100) : 0
5384
+ },
5385
+ research: {
5386
+ sources,
5387
+ evidence,
5388
+ claims,
5389
+ verified_claims: claimsVerified,
5390
+ verification_rate: claims > 0 ? Math.round(claimsVerified / claims * 100) : 0,
5391
+ evidence_per_claim: claims > 0 ? (evidence / claims).toFixed(1) : "0"
5392
+ },
5393
+ skills: {
5394
+ total: skills.length,
5395
+ total_hits: skillHits,
5396
+ avg_hits: skills.length > 0 ? (skillHits / skills.length).toFixed(1) : "0"
5397
+ },
5398
+ trees: {
5399
+ total_trees: trees.length,
5400
+ nodes: nodesTotal,
5401
+ unlocked: nodesUnlocked,
5402
+ unlock_rate: nodesTotal > 0 ? Math.round(nodesUnlocked / nodesTotal * 100) : 0
5403
+ },
5404
+ activity: { events_7d: events7d },
5405
+ doctor: "run `doctor` for health checks"
5406
+ };
5407
+ if (ctx.json) {
5408
+ console.log(JSON.stringify(metrics, null, 2));
5409
+ return 0;
5410
+ }
5411
+ head(ctx, "ygl-trees metrics");
5412
+ out(ctx, ` 冷启动 brief ${metrics.cold_start.brief_ms}ms · ${metrics.cold_start.next_actions} next actions · ${metrics.cold_start.skills_available} skills`);
5413
+ out(ctx, ` 知识 ${metrics.knowledge.total_notes} notes (${metrics.knowledge.recent_7d} in 7d, ${metrics.knowledge.growth_rate_7d}% growth)`);
5414
+ out(ctx, ` 研究 ${metrics.research.sources} sources · ${metrics.research.evidence} evidence · ${metrics.research.verified_claims}/${metrics.research.claims} verified (${metrics.research.verification_rate}%)`);
5415
+ out(ctx, ` 技能 ${metrics.skills.total} skills · ${metrics.skills.total_hits} hits (avg ${metrics.skills.avg_hits})`);
5416
+ out(ctx, ` 科技树 ${metrics.trees.total_trees} trees · ${metrics.trees.unlocked}/${metrics.trees.nodes} unlocked (${metrics.trees.unlock_rate}%)`);
5417
+ out(ctx, ` 活动 ${metrics.activity.events_7d} events in 7d`);
5418
+ return 0;
5419
+ }
5393
5420
  case "brief": {
5394
5421
  const payload = buildBrief(env);
5395
5422
  const cur = payload.current_project;
@@ -5565,7 +5592,7 @@ function validateEnum(ctx, flags, name, allowed, required = false) {
5565
5592
  }
5566
5593
  //#endregion
5567
5594
  //#region packages/ops/tools/src/eval-enhance.ts
5568
- var eval_enhance_exports = /* @__PURE__ */ __exportAll({
5595
+ var eval_enhance_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
5569
5596
  assessEvidenceQuality: () => assessEvidenceQuality,
5570
5597
  evaluateClaimConfidence: () => evaluateClaimConfidence,
5571
5598
  semanticReRank: () => semanticReRank
@@ -5693,7 +5720,7 @@ async function assessEvidenceQuality(ctx, token) {
5693
5720
  usage: r.usage
5694
5721
  };
5695
5722
  }
5696
- var init_eval_enhance = __esmMin((() => {
5723
+ var init_eval_enhance = require_rolldown_runtime.__esmMin((() => {
5697
5724
  init_eval();
5698
5725
  }));
5699
5726
  //#endregion
@@ -5701,7 +5728,7 @@ var init_eval_enhance = __esmMin((() => {
5701
5728
  /** research group — collect → screen → extract → claim.
5702
5729
  * `source fetch` is async (Node 18+ global fetch) and returns a promise.
5703
5730
  * List commands run on TypeORM (src/orm.ts); search stays raw SQL (FTS5). */
5704
- var cmds_exports$2 = /* @__PURE__ */ __exportAll({ run: () => run$8 });
5731
+ var cmds_exports$2 = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$8 });
5705
5732
  init_text();
5706
5733
  init_orm();
5707
5734
  init_writes();
@@ -6028,7 +6055,7 @@ function run$8(env, action, rest, args) {
6028
6055
  bad(ctx, `evidence not found: ${id}`);
6029
6056
  return 1;
6030
6057
  }
6031
- const { assessEvidenceQuality } = (init_eval_enhance(), __toCommonJS(eval_enhance_exports));
6058
+ const { assessEvidenceQuality } = (init_eval_enhance(), require_rolldown_runtime.__toCommonJS(eval_enhance_exports));
6032
6059
  return assessEvidenceQuality({
6033
6060
  quote: ev.quote,
6034
6061
  locator: ev.locator,
@@ -6120,7 +6147,7 @@ function run$8(env, action, rest, args) {
6120
6147
  return getOrm(env.db.path).then((ds) => claimLink(ds, rest[1], rest[2], stance)).then((r) => {
6121
6148
  ok(ctx, `linked; claim status now: ${r.status}`);
6122
6149
  try {
6123
- const { evaluateClaimConfidence } = (init_eval_enhance(), __toCommonJS(eval_enhance_exports));
6150
+ const { evaluateClaimConfidence } = (init_eval_enhance(), require_rolldown_runtime.__toCommonJS(eval_enhance_exports));
6124
6151
  const evRows = store.db.all(`SELECT e.quote, ce.stance, s.title AS source_title
6125
6152
  FROM claim_evidence ce
6126
6153
  JOIN evidence e ON e.id = ce.evidence_id
@@ -6202,7 +6229,7 @@ function run$8(env, action, rest, args) {
6202
6229
  JOIN evidence e ON e.id = ce.evidence_id
6203
6230
  LEFT JOIN sources s ON s.id = e.source_id
6204
6231
  WHERE ce.claim_id = ?`, [id]);
6205
- const { evaluateClaimConfidence } = (init_eval_enhance(), __toCommonJS(eval_enhance_exports));
6232
+ const { evaluateClaimConfidence } = (init_eval_enhance(), require_rolldown_runtime.__toCommonJS(eval_enhance_exports));
6206
6233
  return (async () => {
6207
6234
  const result = await evaluateClaimConfidence({
6208
6235
  claim_text: claim.text,
@@ -6277,7 +6304,7 @@ function run$8(env, action, rest, args) {
6277
6304
  }
6278
6305
  //#endregion
6279
6306
  //#region packages/research/produce/src/project-cmds.ts
6280
- var project_cmds_exports = /* @__PURE__ */ __exportAll({ run: () => run$7 });
6307
+ var project_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$7 });
6281
6308
  init_orm();
6282
6309
  init_writes();
6283
6310
  init_entities$1();
@@ -6415,7 +6442,7 @@ function run$7(env, action, rest, args) {
6415
6442
  /** produce group — evidence-backed outline → sections → report.
6416
6443
  * Writes run on the TypeORM write service (src/writes.ts); reads stay on
6417
6444
  * Store until their own migration batch. */
6418
- var produce_cmds_exports = /* @__PURE__ */ __exportAll({ run: () => run$6 });
6445
+ var produce_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$6 });
6419
6446
  init_text();
6420
6447
  init_orm();
6421
6448
  init_writes();
@@ -7305,7 +7332,7 @@ async function importTree(ds, spec, opts = {}) {
7305
7332
  * ygl-trees node validate sanity checks
7306
7333
  * ygl-trees node export [--out file] portable JSON
7307
7334
  */
7308
- var cmds_exports$1 = /* @__PURE__ */ __exportAll({ run: () => run$5 });
7335
+ var cmds_exports$1 = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$5 });
7309
7336
  init_orm();
7310
7337
  init_eval();
7311
7338
  init_text();
@@ -8151,7 +8178,7 @@ function parseState(args) {
8151
8178
  //#region packages/knowledge/skills/src/skill-cmds.ts
8152
8179
  /** skill group — the L1/L2/L3 registry agents query before acting.
8153
8180
  * Writes run on the TypeORM write service (src/writes.ts). */
8154
- var skill_cmds_exports = /* @__PURE__ */ __exportAll({ run: () => run$4 });
8181
+ var skill_cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$4 });
8155
8182
  init_text();
8156
8183
  init_orm();
8157
8184
  init_writes();
@@ -8404,7 +8431,7 @@ function wrap(text, indent = 4) {
8404
8431
  //#region packages/knowledge/skills/src/cmds.ts
8405
8432
  /** kb group — long-term knowledge: store, retrieve, connect, promote to skill.
8406
8433
  * Writes (add/ingest) run on the TypeORM write service (src/writes.ts). */
8407
- var cmds_exports = /* @__PURE__ */ __exportAll({ run: () => run$3 });
8434
+ var cmds_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run$3 });
8408
8435
  init_text();
8409
8436
  init_orm();
8410
8437
  init_writes();
@@ -8453,7 +8480,7 @@ function run$3(env, action, rest, args) {
8453
8480
  }
8454
8481
  const raw = store.kbSearch(q, Number(args.flags.limit || configGetNumber(env.db, "search.limit")));
8455
8482
  if (args.flags.eval) {
8456
- const { semanticReRank } = (init_eval_enhance(), __toCommonJS(eval_enhance_exports));
8483
+ const { semanticReRank } = (init_eval_enhance(), require_rolldown_runtime.__toCommonJS(eval_enhance_exports));
8457
8484
  return semanticReRank(q, raw.map((r) => ({
8458
8485
  id: r.id,
8459
8486
  title: r.title,
@@ -8708,7 +8735,7 @@ function run$3(env, action, rest, args) {
8708
8735
  }
8709
8736
  //#endregion
8710
8737
  //#region packages/ops/tools/src/rels.ts
8711
- var rels_exports = /* @__PURE__ */ __exportAll({
8738
+ var rels_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
8712
8739
  REL_TYPES: () => REL_TYPES,
8713
8740
  RelError: () => RelError,
8714
8741
  relAdd: () => relAdd,
@@ -9014,7 +9041,7 @@ function run$2(env, action, rest, args) {
9014
9041
  }
9015
9042
  //#endregion
9016
9043
  //#region packages/ops/tools/src/webui.ts
9017
- var webui_exports = /* @__PURE__ */ __exportAll({
9044
+ var webui_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
9018
9045
  createDashboardServer: () => createDashboardServer,
9019
9046
  gatherData: () => gatherData,
9020
9047
  generateHTML: () => generateHTML,
@@ -9936,7 +9963,7 @@ function serve(env, args) {
9936
9963
  }
9937
9964
  //#endregion
9938
9965
  //#region packages/ops/tools/src/doctor.ts
9939
- var doctor_exports = /* @__PURE__ */ __exportAll({ run: () => run });
9966
+ var doctor_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ run: () => run });
9940
9967
  init_eval();
9941
9968
  init_db();
9942
9969
  init_plugins();
@@ -10363,6 +10390,11 @@ async function main(argv) {
10363
10390
  out(ctx, generateLlmsManifest());
10364
10391
  return 0;
10365
10392
  }
10393
+ if (group === "mcp") {
10394
+ const { serveMcp } = await Promise.resolve().then(() => require("./mcp-C27lIHd1.cjs"));
10395
+ serveMcp();
10396
+ return new Promise(() => {});
10397
+ }
10366
10398
  if (!group || group === "help" || group === "-h" || group === "--help") {
10367
10399
  if (!ctx.json) out(ctx, usage());
10368
10400
  return 0;
@@ -10437,7 +10469,7 @@ async function main(argv) {
10437
10469
  db?.close();
10438
10470
  } catch {}
10439
10471
  try {
10440
- (init_db(), __toCommonJS(db_exports)).DB.releaseLockFor(file);
10472
+ (init_db(), require_rolldown_runtime.__toCommonJS(db_exports)).DB.releaseLockFor(file);
10441
10473
  } catch {}
10442
10474
  });
10443
10475
  process.on("SIGINT", () => shutdown.interrupt(0));