akm-cli 0.9.0-beta.51 → 0.9.0-beta.53

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 (45) hide show
  1. package/dist/assets/hints/cli-hints-full.md +6 -5
  2. package/dist/assets/wiki/ingest-workflow-template.md +7 -6
  3. package/dist/assets/wiki/schema-template.md +4 -4
  4. package/dist/cli.js +0 -7
  5. package/dist/commands/env/env-cli.js +3 -2
  6. package/dist/commands/env/env.js +14 -67
  7. package/dist/commands/health/checks.js +28 -15
  8. package/dist/commands/health.js +68 -1
  9. package/dist/commands/improve/collapse-detector.js +419 -0
  10. package/dist/commands/improve/consolidate.js +72 -54
  11. package/dist/commands/improve/distill.js +79 -13
  12. package/dist/commands/improve/extract.js +13 -6
  13. package/dist/commands/improve/homeostatic.js +109 -79
  14. package/dist/commands/improve/improve-cli.js +67 -1
  15. package/dist/commands/improve/improve.js +10 -0
  16. package/dist/commands/improve/loop-stages.js +39 -1
  17. package/dist/commands/improve/outcome-loop.js +15 -3
  18. package/dist/commands/improve/preparation.js +27 -10
  19. package/dist/commands/improve/salience.js +49 -32
  20. package/dist/commands/read/curate.js +5 -9
  21. package/dist/commands/read/knowledge.js +4 -0
  22. package/dist/commands/read/search.js +5 -2
  23. package/dist/commands/read/show.js +3 -3
  24. package/dist/core/asset/asset-spec.js +3 -2
  25. package/dist/core/config/config-schema.js +39 -17
  26. package/dist/core/eval/rank-metrics.js +113 -0
  27. package/dist/core/state/migrations.js +56 -0
  28. package/dist/core/state-db.js +146 -19
  29. package/dist/indexer/ensure-index.js +33 -90
  30. package/dist/indexer/index-writer-lock.js +0 -11
  31. package/dist/indexer/index-written-assets.js +105 -0
  32. package/dist/indexer/passes/metadata.js +20 -0
  33. package/dist/indexer/search/db-search.js +29 -1
  34. package/dist/indexer/search/ranking-contributors.js +33 -1
  35. package/dist/indexer/search/ranking.js +66 -0
  36. package/dist/indexer/search/search-fields.js +6 -0
  37. package/dist/llm/feature-gate.js +6 -2
  38. package/dist/output/renderers.js +8 -13
  39. package/dist/output/shapes/helpers.js +0 -3
  40. package/dist/output/shapes/passthrough.js +1 -0
  41. package/dist/scripts/migrate-storage.js +152 -33
  42. package/dist/scripts/migrations/import-fs-improve-runs-to-db.js +41 -18
  43. package/dist/storage/repositories/index-db.js +10 -1
  44. package/dist/wiki/wiki.js +15 -11
  45. package/package.json +2 -4
package/dist/wiki/wiki.js CHANGED
@@ -58,6 +58,8 @@ export const SCHEMA_MD = "schema.md";
58
58
  export const INDEX_MD = "index.md";
59
59
  export const LOG_MD = "log.md";
60
60
  export const RAW_SUBDIR = "raw";
61
+ /** Canonical location for agent-authored pages, mirroring RAW_SUBDIR. */
62
+ export const PAGES_SUBDIR = "pages";
61
63
  /** Files at a wiki root that are not pages. */
62
64
  const WIKI_SPECIAL_FILES = new Set([SCHEMA_MD, INDEX_MD, LOG_MD]);
63
65
  const WIKI_NAME_RE = /^[a-z0-9][a-z0-9-]*$/;
@@ -406,18 +408,20 @@ export function createWiki(stashDir, name) {
406
408
  fs.writeFileSync(absPath, content, "utf8");
407
409
  created.push(absPath);
408
410
  }
409
- // Ensure raw/ exists with a .gitkeep so empty wikis survive clean clones.
410
- // Handle the dir-exists-but-no-.gitkeep case too (partial scaffolds,
411
+ // Ensure raw/ and pages/ exist with a .gitkeep so empty wikis survive clean
412
+ // clones. Handle the dir-exists-but-no-.gitkeep case too (partial scaffolds,
411
413
  // user-created directories) so the invariant always holds after `create`.
412
- const rawDir = path.join(wikiDir, RAW_SUBDIR);
413
- fs.mkdirSync(rawDir, { recursive: true });
414
- const gitkeepPath = path.join(rawDir, ".gitkeep");
415
- if (fs.existsSync(gitkeepPath)) {
416
- skipped.push(gitkeepPath);
417
- }
418
- else {
419
- fs.writeFileSync(gitkeepPath, "", "utf8");
420
- created.push(gitkeepPath);
414
+ for (const subdir of [RAW_SUBDIR, PAGES_SUBDIR]) {
415
+ const dir = path.join(wikiDir, subdir);
416
+ fs.mkdirSync(dir, { recursive: true });
417
+ const gitkeepPath = path.join(dir, ".gitkeep");
418
+ if (fs.existsSync(gitkeepPath)) {
419
+ skipped.push(gitkeepPath);
420
+ }
421
+ else {
422
+ fs.writeFileSync(gitkeepPath, "", "utf8");
423
+ created.push(gitkeepPath);
424
+ }
421
425
  }
422
426
  return { name, ref: `wiki:${name}`, path: wikiDir, created, skipped };
423
427
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akm-cli",
3
- "version": "0.9.0-beta.51",
3
+ "version": "0.9.0-beta.53",
4
4
  "type": "module",
5
5
  "description": "akm (Agent Knowledge Management) — A package manager for AI agent skills, commands, tools, and knowledge. Works with Claude Code, OpenCode, Cursor, and any AI coding assistant.",
6
6
  "keywords": [
@@ -58,9 +58,7 @@
58
58
  "sweep:tmp": "bun scripts/sweep-test-tmp.ts",
59
59
  "test": "bash scripts/test-unit.sh",
60
60
  "test:unit": "bash scripts/test-unit.sh",
61
- "test:integration": "bun run sweep:tmp && bun test --isolate --timeout=30000 ./tests/integration ./tests/commands ./tests/workflows",
62
- "test:unit:shard": "bun run sweep:tmp && bun test --isolate --timeout=30000 ./tests --path-ignore-patterns=tests/integration --shard=${SHARD:?set SHARD=k/N}",
63
- "test:integration:shard": "bun run sweep:tmp && bun test --isolate --timeout=30000 ./tests/integration ./tests/commands ./tests/workflows --shard=${SHARD:?set SHARD=k/N}",
61
+ "test:integration": "bun run sweep:tmp && bun test --isolate --timeout=30000 ./tests/integration",
64
62
  "test:node-smoke": "bun scripts/node-smoke.ts",
65
63
  "test:node-compat": "AKM_NODE_COMPAT_TESTS=1 bun test --timeout=120000 tests/integration/node-compat.test.ts",
66
64
  "test:time": "bun scripts/test-timing-report.ts",