akm-cli 0.7.5 → 0.8.0-rc2

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 (152) hide show
  1. package/.github/CHANGELOG.md +1 -1
  2. package/dist/cli/parse-args.js +43 -0
  3. package/dist/cli.js +853 -479
  4. package/dist/commands/agent-dispatch.js +102 -0
  5. package/dist/commands/agent-support.js +62 -0
  6. package/dist/commands/config-cli.js +68 -84
  7. package/dist/commands/consolidate.js +823 -0
  8. package/dist/commands/distill-promotion-policy.js +658 -0
  9. package/dist/commands/distill.js +244 -52
  10. package/dist/commands/eval-cases.js +40 -0
  11. package/dist/commands/events.js +2 -23
  12. package/dist/commands/graph.js +222 -0
  13. package/dist/commands/health.js +376 -0
  14. package/dist/commands/help/help-accept.md +9 -0
  15. package/dist/commands/help/help-improve.md +53 -0
  16. package/dist/commands/help/help-proposals.md +15 -0
  17. package/dist/commands/help/help-propose.md +17 -0
  18. package/dist/commands/help/help-reject.md +8 -0
  19. package/dist/commands/history.js +3 -30
  20. package/dist/commands/improve.js +1170 -0
  21. package/dist/commands/info.js +2 -2
  22. package/dist/commands/init.js +2 -2
  23. package/dist/commands/install-audit.js +5 -1
  24. package/dist/commands/installed-stashes.js +118 -138
  25. package/dist/commands/knowledge.js +133 -0
  26. package/dist/commands/lint/agent-linter.js +46 -0
  27. package/dist/commands/lint/base-linter.js +285 -0
  28. package/dist/commands/lint/command-linter.js +46 -0
  29. package/dist/commands/lint/default-linter.js +13 -0
  30. package/dist/commands/lint/index.js +107 -0
  31. package/dist/commands/lint/knowledge-linter.js +13 -0
  32. package/dist/commands/lint/memory-linter.js +58 -0
  33. package/dist/commands/lint/registry.js +33 -0
  34. package/dist/commands/lint/skill-linter.js +42 -0
  35. package/dist/commands/lint/task-linter.js +47 -0
  36. package/dist/commands/lint/types.js +1 -0
  37. package/dist/commands/lint/workflow-linter.js +53 -0
  38. package/dist/commands/lint.js +1 -0
  39. package/dist/commands/proposal.js +8 -7
  40. package/dist/commands/propose.js +78 -28
  41. package/dist/commands/reflect.js +143 -35
  42. package/dist/commands/registry-search.js +2 -2
  43. package/dist/commands/remember.js +54 -0
  44. package/dist/commands/schema-repair.js +130 -0
  45. package/dist/commands/search.js +21 -5
  46. package/dist/commands/show.js +121 -17
  47. package/dist/commands/source-add.js +10 -10
  48. package/dist/commands/source-manage.js +11 -19
  49. package/dist/commands/tasks.js +385 -0
  50. package/dist/commands/url-checker.js +39 -0
  51. package/dist/commands/vault.js +8 -26
  52. package/dist/core/action-contributors.js +25 -0
  53. package/dist/core/asset-ref.js +4 -0
  54. package/dist/core/asset-registry.js +4 -16
  55. package/dist/core/asset-spec.js +10 -0
  56. package/dist/core/common.js +94 -0
  57. package/dist/core/concurrent.js +22 -0
  58. package/dist/core/config.js +222 -128
  59. package/dist/core/events.js +73 -126
  60. package/dist/core/frontmatter.js +3 -1
  61. package/dist/core/markdown.js +17 -0
  62. package/dist/core/memory-improve.js +678 -0
  63. package/dist/core/parse.js +155 -0
  64. package/dist/core/paths.js +101 -3
  65. package/dist/core/proposal-validators.js +61 -0
  66. package/dist/core/proposals.js +49 -38
  67. package/dist/core/state-db.js +775 -0
  68. package/dist/core/time.js +51 -0
  69. package/dist/core/warn.js +59 -1
  70. package/dist/indexer/db-search.js +52 -238
  71. package/dist/indexer/db.js +378 -1
  72. package/dist/indexer/ensure-index.js +61 -0
  73. package/dist/indexer/graph-boost.js +247 -94
  74. package/dist/indexer/graph-db.js +201 -0
  75. package/dist/indexer/graph-dedup.js +99 -0
  76. package/dist/indexer/graph-extraction.js +409 -76
  77. package/dist/indexer/index-context.js +10 -0
  78. package/dist/indexer/indexer.js +442 -290
  79. package/dist/indexer/llm-cache.js +47 -0
  80. package/dist/indexer/match-contributors.js +141 -0
  81. package/dist/indexer/matchers.js +24 -190
  82. package/dist/indexer/memory-inference.js +63 -29
  83. package/dist/indexer/metadata-contributors.js +26 -0
  84. package/dist/indexer/metadata.js +194 -175
  85. package/dist/indexer/path-resolver.js +89 -0
  86. package/dist/indexer/ranking-contributors.js +204 -0
  87. package/dist/indexer/ranking.js +74 -0
  88. package/dist/indexer/search-hit-enrichers.js +22 -0
  89. package/dist/indexer/search-source.js +24 -9
  90. package/dist/indexer/semantic-status.js +2 -16
  91. package/dist/indexer/walker.js +25 -0
  92. package/dist/integrations/agent/config.js +175 -3
  93. package/dist/integrations/agent/index.js +3 -1
  94. package/dist/integrations/agent/pipeline.js +39 -0
  95. package/dist/integrations/agent/profiles.js +67 -5
  96. package/dist/integrations/agent/prompts.js +77 -72
  97. package/dist/integrations/agent/runners.js +31 -0
  98. package/dist/integrations/agent/sdk-runner.js +120 -0
  99. package/dist/integrations/agent/spawn.js +71 -16
  100. package/dist/integrations/lockfile.js +10 -18
  101. package/dist/integrations/session-logs/index.js +65 -0
  102. package/dist/integrations/session-logs/providers/claude-code.js +56 -0
  103. package/dist/integrations/session-logs/providers/opencode.js +52 -0
  104. package/dist/integrations/session-logs/types.js +1 -0
  105. package/dist/llm/call-ai.js +74 -0
  106. package/dist/llm/client.js +61 -122
  107. package/dist/llm/feature-gate.js +27 -16
  108. package/dist/llm/graph-extract.js +297 -62
  109. package/dist/llm/memory-infer.js +49 -71
  110. package/dist/llm/metadata-enhance.js +39 -22
  111. package/dist/llm/prompts/graph-extract-user-prompt.md +12 -0
  112. package/dist/output/cli-hints-full.md +277 -0
  113. package/dist/output/cli-hints-short.md +65 -0
  114. package/dist/output/cli-hints.js +2 -318
  115. package/dist/output/renderers.js +190 -123
  116. package/dist/output/shapes.js +33 -0
  117. package/dist/output/text.js +239 -2
  118. package/dist/registry/providers/skills-sh.js +61 -49
  119. package/dist/registry/providers/static-index.js +44 -48
  120. package/dist/setup/setup.js +510 -11
  121. package/dist/sources/provider-factory.js +2 -1
  122. package/dist/sources/providers/git.js +2 -2
  123. package/dist/sources/website-ingest.js +4 -0
  124. package/dist/tasks/backends/cron.js +200 -0
  125. package/dist/tasks/backends/exec-utils.js +25 -0
  126. package/dist/tasks/backends/index.js +32 -0
  127. package/dist/tasks/backends/launchd-template.xml +19 -0
  128. package/dist/tasks/backends/launchd.js +184 -0
  129. package/dist/tasks/backends/schtasks-template.xml +29 -0
  130. package/dist/tasks/backends/schtasks.js +212 -0
  131. package/dist/tasks/parser.js +198 -0
  132. package/dist/tasks/resolveAkmBin.js +84 -0
  133. package/dist/tasks/runner.js +432 -0
  134. package/dist/tasks/schedule.js +208 -0
  135. package/dist/tasks/schema.js +13 -0
  136. package/dist/tasks/validator.js +59 -0
  137. package/dist/wiki/index-template.md +12 -0
  138. package/dist/wiki/ingest-workflow-template.md +54 -0
  139. package/dist/wiki/log-template.md +8 -0
  140. package/dist/wiki/schema-template.md +61 -0
  141. package/dist/wiki/wiki-templates.js +12 -0
  142. package/dist/wiki/wiki.js +10 -61
  143. package/dist/workflows/authoring.js +5 -25
  144. package/dist/workflows/renderer.js +8 -3
  145. package/dist/workflows/runs.js +59 -91
  146. package/dist/workflows/validator.js +1 -1
  147. package/dist/workflows/workflow-template.md +24 -0
  148. package/docs/README.md +3 -0
  149. package/docs/migration/release-notes/0.7.0.md +1 -1
  150. package/docs/migration/release-notes/0.8.0.md +43 -0
  151. package/package.json +3 -2
  152. package/dist/templates/wiki-templates.js +0 -100
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Describe what this workflow accomplishes
3
+ tags:
4
+ - example
5
+ params:
6
+ example_param: Explain this parameter
7
+ ---
8
+
9
+ # Workflow: {{TITLE}}
10
+
11
+ ## Step: {{FIRST_STEP_TITLE}}
12
+ Step ID: {{FIRST_STEP_ID}}
13
+
14
+ ### Instructions
15
+ Describe what to do in this step.
16
+
17
+ ### Completion Criteria
18
+ - Confirm the first step is complete
19
+
20
+ ## Step: Second Step
21
+ Step ID: second-step
22
+
23
+ ### Instructions
24
+ Describe what happens next.
package/docs/README.md CHANGED
@@ -33,6 +33,9 @@
33
33
  - [Search](technical/search.md) -- Hybrid search architecture and scoring
34
34
  - [Indexing](technical/indexing.md) -- How the search index is built
35
35
  - [Classification](technical/classification.md) -- Matcher and renderer behavior
36
+ - [Functional Contract Patterns](technical/functional-contract-patterns.md) -- Quick reference for contributor pipelines and small process contracts
37
+ - [Implementation Plan: Functional Contract Refactor](technical/implementation-plan-functional-contract-refactor.md) -- Phased plan to move behavior from type-centric switchboards to process-local contributors
38
+ - [Architecture Cleanup Checklist](technical/architecture-cleanup-checklist.md) -- Living checklist for executing the cleanup plan with parity gates, reviews, and git hygiene
36
39
  - [Show Response](technical/show-response.md) -- `akm show` output fields by asset type
37
40
  - [Testing Workflow](technical/testing-workflow.md) -- End-to-end, Docker, deployment, and upgrade validation
38
41
  - [Ref Format](technical/ref.md) -- Wire format for asset references
@@ -90,7 +90,7 @@ until the user opts in. Seven keys ship in 0.7.0:
90
90
  | `feedback_distillation` | `akm distill <ref>` |
91
91
  | `embedding_fallback_score` | scorer fallback when embeddings unavailable |
92
92
  | `memory_inference` | indexer split of pending memories into atomic facts |
93
- | `graph_extraction` | indexer entity/relation extraction → `graph.json` |
93
+ | `graph_extraction` | indexer entity/relation extraction → SQLite graph tables |
94
94
 
95
95
  Every gated call site uses `tryLlmFeature(feature, config, fn, fallback)`
96
96
  from `src/llm/feature-gate.ts`. The wrapper guarantees:
@@ -0,0 +1,43 @@
1
+ Migration notes for akm v0.8.0
2
+
3
+ This release combines the 0.8.0 CLI/storage break with the final improve-owned
4
+ maintenance migration work that landed before release validation closed.
5
+
6
+ Key operator-facing changes:
7
+
8
+ - `akm index --enrich` and `akm index --re-enrich` are removed.
9
+ - Plain `akm index` now owns metadata enhancement only.
10
+ - Memory inference and graph extraction now run from `akm improve` after
11
+ consolidation, not from `akm index`.
12
+ - Manual QA and sandbox guidance now require isolating `AKM_DATA_DIR` in
13
+ addition to `HOME`, XDG dirs, and `AKM_STASH_DIR`.
14
+ - `akm health` is available for post-upgrade runtime checks against `state.db`,
15
+ task-history integrity, agent availability, and recent improve telemetry.
16
+
17
+ Primary public command family for 0.8.0:
18
+
19
+ - `akm improve [<type>|<ref>]`
20
+ - `akm propose <type> <name> (--task "..." | --file <path>)`
21
+ - `akm proposals`
22
+ - `akm show proposal <id>`
23
+ - `akm diff proposal <id>`
24
+ - `akm accept <id>`
25
+ - `akm reject <id> --reason "..."`
26
+
27
+ Proposal-queue and improvement workflows are consolidated around this family.
28
+ Update scripts, prompts, docs, and agent instructions before upgrading.
29
+
30
+ Behavior changes worth noting:
31
+
32
+ - `akm search` with no query now fails with `MISSING_REQUIRED_ARGUMENT`.
33
+ - `akm remember --enrich` is fail-soft: if no LLM is configured, the memory is
34
+ still written.
35
+ - `akm wiki stash <wiki> <url>` once again fetches and stores URL snapshots in
36
+ `wikis/<name>/raw/`.
37
+ - `akm health --since 24h` provides a fast operator check for state-db
38
+ round-trip health, task-log backing, and recent improve outcomes.
39
+
40
+ Release validation status for the final 0.8.0 cut:
41
+
42
+ - Full repo test suite passed.
43
+ - Docker install matrix passed for both Bun and binary install paths.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akm-cli",
3
- "version": "0.7.5",
3
+ "version": "0.8.0-rc2",
4
4
  "type": "module",
5
5
  "description": "akm (Agent Kit Manager) — 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": [
@@ -42,7 +42,7 @@
42
42
  "akm": "dist/cli.js"
43
43
  },
44
44
  "scripts": {
45
- "build": "rm -rf dist && bun run tsc --project ./tsconfig.build.json",
45
+ "build": "rm -rf dist && bun run tsc --project ./tsconfig.build.json && bun scripts/copy-assets.ts",
46
46
  "check": "bun run lint && bunx tsc --noEmit && bun test ./tests",
47
47
  "check:changed": "bun test tests/output-baseline.test.ts tests/e2e.test.ts tests/stash-search.test.ts && bun run lint && bunx tsc --noEmit",
48
48
  "test": "bun test ./tests",
@@ -74,6 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@clack/prompts": "^1.3.0",
77
+ "@opencode-ai/sdk": "1.2.20",
77
78
  "citty": "^0.2.2",
78
79
  "dotenv": "^17.4.2",
79
80
  "yaml": "^2.8.4"
@@ -1,100 +0,0 @@
1
- /**
2
- * Scaffolded content for a fresh `wikis/<name>/` directory.
3
- *
4
- * Inlined as TypeScript constants so they ship with the published bundle
5
- * (the build step is `tsc` — non-TS files are not copied to dist).
6
- *
7
- * The scaffold is deliberately minimal: akm does not prescribe conventions
8
- * beyond the three-layer layout. `schema.md` is the per-wiki rulebook the
9
- * agent reads first; authors customise it freely.
10
- */
11
- export function buildSchemaMd(wikiName) {
12
- return `---
13
- description: Rules that govern this wiki. Read before ingesting, searching, or editing pages.
14
- wikiRole: schema
15
- ---
16
-
17
- # ${wikiName} wiki schema
18
-
19
- This wiki follows the three-layer pattern:
20
-
21
- - \`raw/\` — immutable ingested sources (never edit)
22
- - \`<page>.md\` and \`<topic>/<page>.md\` — agent-authored pages
23
- - \`schema.md\` (this file), \`index.md\`, \`log.md\` — wiki-level metadata
24
-
25
- ## Page frontmatter
26
-
27
- Every page should carry frontmatter so akm can index and link it:
28
-
29
- \`\`\`yaml
30
- ---
31
- description: one-sentence summary used in search and lint
32
- pageKind: entity | concept | question | note | <your-custom-kind>
33
- xrefs:
34
- - wiki:${wikiName}/other-page
35
- sources:
36
- - raw/<slug>.md
37
- ---
38
- \`\`\`
39
-
40
- \`pageKind\` accepts any non-empty string. Add new categories freely; they
41
- will surface in \`index.md\` as new sections after the next \`akm index\` run.
42
-
43
- ## Three operations
44
-
45
- ### Ingest
46
-
47
- 1. Copy the new source into \`raw/\` with \`akm wiki stash ${wikiName} <path>\`.
48
- 2. Find related pages: \`akm wiki search ${wikiName} "<terms>"\`.
49
- 3. For each related page: append a section, note a contradiction, or create a
50
- new page. Update xrefs on both sides.
51
- 4. Cite the raw source in each touched page's \`sources:\` frontmatter.
52
- 5. Append one entry to \`log.md\` describing what was assimilated.
53
-
54
- ### Query
55
-
56
- 1. \`akm wiki search ${wikiName} "<question>"\` — find candidate pages.
57
- 2. \`akm show wiki:${wikiName}/<page>\` — read the top hits.
58
- 3. Compose the answer from the wiki; cite raw sources only when the wiki
59
- points at them.
60
-
61
- ### Lint
62
-
63
- 1. \`akm wiki lint ${wikiName}\` — deterministic structural checks.
64
- 2. Resolve each finding: link orphans, fix broken xrefs, add descriptions,
65
- cite uncited raws, refresh the index.
66
-
67
- ## Hard rules
68
-
69
- - \`raw/\` is immutable. Never edit ingested sources.
70
- - Cross-references must point at pages that actually exist.
71
- - Prefer appending to an existing page over duplicating one.
72
- - Cite the raw source id (e.g. \`raw/2026-04-foo.md\`) when copying claims.
73
- `;
74
- }
75
- export function buildIndexMd(wikiName) {
76
- return `---
77
- description: Catalog of pages in the ${wikiName} wiki. Regenerated by \`akm index\`.
78
- wikiRole: index
79
- ---
80
-
81
- # ${wikiName} — index
82
-
83
- _This file is regenerated on every \`akm index\` run. Manual edits are
84
- preserved until the next regeneration, then replaced._
85
-
86
- _(no pages yet — create one with your editor, or ingest a source with \`akm
87
- wiki stash ${wikiName} <path>\`.)_
88
- `;
89
- }
90
- export function buildLogMd(wikiName) {
91
- return `---
92
- description: Append-only log for the ${wikiName} wiki. Newest entries at the top.
93
- wikiRole: log
94
- ---
95
-
96
- # ${wikiName} — log
97
-
98
- _Each entry: ISO date, operation, brief summary._
99
- `;
100
- }