@klhapp/skillmux 1.9.2 → 1.10.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/docs/README.md +1 -1
  4. package/docs/cli.md +74 -3
  5. package/docs/concepts.md +1 -1
  6. package/docs/configuration.md +52 -1
  7. package/docs/deployment.md +10 -6
  8. package/docs/getting-started.md +1 -1
  9. package/docs/skill-management.md +49 -0
  10. package/package.json +1 -1
  11. package/src/adapters.ts +148 -2
  12. package/src/cli.ts +302 -1291
  13. package/src/clients.ts +17 -0
  14. package/src/commands/audit.ts +54 -51
  15. package/src/commands/config.ts +11 -12
  16. package/src/commands/context.ts +103 -0
  17. package/src/commands/core.ts +5 -1
  18. package/src/commands/doctor.ts +76 -0
  19. package/src/commands/eval.ts +10 -13
  20. package/src/commands/init.ts +621 -0
  21. package/src/commands/install.ts +132 -0
  22. package/src/commands/local-vault.ts +60 -0
  23. package/src/commands/models.ts +10 -0
  24. package/src/commands/outdated.ts +8 -5
  25. package/src/commands/project.ts +37 -11
  26. package/src/commands/report.ts +66 -0
  27. package/src/commands/scan.ts +61 -0
  28. package/src/commands/skill.ts +32 -0
  29. package/src/commands/sync.ts +232 -0
  30. package/src/commands/target.ts +18 -6
  31. package/src/commands/update.ts +11 -5
  32. package/src/concurrency-limiter.ts +61 -0
  33. package/src/config-service.ts +1 -51
  34. package/src/config.ts +5 -0
  35. package/src/context.ts +8 -3
  36. package/src/db-audit.ts +286 -0
  37. package/src/db-index.ts +238 -0
  38. package/src/db.ts +3 -413
  39. package/src/global-flags.ts +46 -0
  40. package/src/install.ts +15 -0
  41. package/src/logger.ts +26 -0
  42. package/src/output.ts +30 -5
  43. package/src/redact.ts +52 -0
  44. package/src/router-core.ts +8 -27
  45. package/src/server.ts +594 -267
  46. package/src/toml-writer.ts +51 -0
  47. package/src/types.ts +7 -0
@@ -4,6 +4,8 @@ import { join } from "node:path";
4
4
  import { buildAuditRow } from "./audit";
5
5
  import { embeddingDimension, embeddingFingerprint, expandHome, loadConfig } from "./config";
6
6
  import { RemoteInferenceError } from "./clients";
7
+ import { log } from "./logger";
8
+ import { warn } from "./output";
7
9
  import {
8
10
  deleteSkill,
9
11
  findExactMatch,
@@ -274,7 +276,7 @@ export async function syncVaultIfNeeded(): Promise<void> {
274
276
  const invalidIds: string[] = [];
275
277
  const skills = await scanVaults(vaultPath, localVaultPaths, (skillId, error) => {
276
278
  invalidIds.push(skillId);
277
- console.error(`warning: keeping previous index entry for ${skillId}: ${error}`);
279
+ warn(`keeping previous index entry for ${skillId}: ${error}`);
278
280
  });
279
281
  const rows = skills.map(toSkillRow);
280
282
  // See rebuildIndex: a skill_id invalid in one root can still be valid in
@@ -361,7 +363,7 @@ async function reindexOneSkill(db: Database, vaultPath: string, skillId: string)
361
363
  upsertSkill(db, await readSkill(vaultPath, skillId));
362
364
  backfillEmbeddings().catch(() => {});
363
365
  } catch (error) {
364
- console.error(`warning: keeping previous index entry for ${skillId}: ${error}`);
366
+ warn(`keeping previous index entry for ${skillId}: ${error}`);
365
367
  }
366
368
  }
367
369
 
@@ -395,7 +397,7 @@ export async function startVaultWatcher(): Promise<() => void> {
395
397
  // A watcher error (e.g. the vault root disappearing) must degrade the index,
396
398
  // not crash the server — an unhandled 'error' event would throw.
397
399
  watcher.on("error", (error) => {
398
- console.error(`warning: vault watcher error, live updates paused: ${error}`);
400
+ warn(`vault watcher error, live updates paused: ${error}`);
399
401
  });
400
402
 
401
403
  return () => {
@@ -554,14 +556,7 @@ export async function retrieveAndRerank(
554
556
  retrieval = "lexical";
555
557
  degraded_from = clients.rerank ? "reranked" : "hybrid";
556
558
  degradation_reason = classifyInferenceError("embedding", embedRes.error);
557
- console.error(
558
- JSON.stringify({
559
- level: "warn",
560
- stage: "embedding",
561
- degraded_from,
562
- reason: degradation_reason,
563
- }),
564
- );
559
+ log.warn("embedding", { degraded_from, reason: degradation_reason });
565
560
  } else {
566
561
  try {
567
562
  const queryVec = (embedRes as Float32Array[])[0];
@@ -574,14 +569,7 @@ export async function retrieveAndRerank(
574
569
  retrieval = "lexical";
575
570
  degraded_from = clients.rerank ? "reranked" : "hybrid";
576
571
  degradation_reason = classifyInferenceError("embedding", embedError);
577
- console.error(
578
- JSON.stringify({
579
- level: "warn",
580
- stage: "embedding",
581
- degraded_from,
582
- reason: degradation_reason,
583
- }),
584
- );
572
+ log.warn("embedding", { degraded_from, reason: degradation_reason });
585
573
  }
586
574
  }
587
575
  }
@@ -601,14 +589,7 @@ export async function retrieveAndRerank(
601
589
  scores = null;
602
590
  degraded_from = "reranked";
603
591
  degradation_reason = classifyInferenceError("reranker", rerankError);
604
- console.error(
605
- JSON.stringify({
606
- level: "warn",
607
- stage: "reranker",
608
- degraded_from,
609
- reason: degradation_reason,
610
- }),
611
- );
592
+ log.warn("reranker", { degraded_from, reason: degradation_reason });
612
593
  }
613
594
  }
614
595