akm-cli 0.10.261013-beta → 0.10.261015-beta

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 (479) hide show
  1. package/CHANGELOG.md +539 -3
  2. package/README.md +14 -0
  3. package/SECURITY.md +12 -11
  4. package/STABILITY.md +45 -49
  5. package/dist/assets/hints/cli-hints-full.md +15 -12
  6. package/dist/assets/opencode/akm-plugin.js +177 -0
  7. package/dist/assets/stash-skeleton/README.md +1 -1
  8. package/dist/assets/tasks/core/improve.yml +1 -1
  9. package/dist/assets/tasks/improve/akm-improve-consolidate.yml +1 -1
  10. package/dist/assets/ui/config.js +27 -10
  11. package/dist/assets/workflows/workflow-template.md +2 -2
  12. package/dist/cli/clack.js +3 -1
  13. package/dist/cli/selection.js +33 -0
  14. package/dist/cli/shared.js +14 -1
  15. package/dist/cli/unknown-flags.js +6 -37
  16. package/dist/cli.js +69 -48
  17. package/dist/commands/agent/agent-dispatch.js +17 -25
  18. package/dist/commands/agent/contribute-cli.js +9 -8
  19. package/dist/commands/command/command-cli.js +4 -8
  20. package/dist/commands/command/command-execution.js +25 -39
  21. package/dist/commands/completions.js +1 -1
  22. package/dist/commands/config-cli.js +14 -5
  23. package/dist/commands/env/child-env.js +12 -14
  24. package/dist/commands/env/env-cli.js +2 -2
  25. package/dist/commands/env/secret-cli.js +2 -2
  26. package/dist/commands/health/checks.js +10 -849
  27. package/dist/commands/health/connections-and-harnesses-check.js +109 -0
  28. package/dist/commands/health/egress.js +3 -3
  29. package/dist/commands/health/html-report.js +9 -10
  30. package/dist/commands/health/plugin-staleness.js +18 -11
  31. package/dist/commands/health/report-view-model.js +16 -12
  32. package/dist/commands/health/semantic-search-check.js +85 -0
  33. package/dist/commands/health/type-directory-check.js +0 -3
  34. package/dist/commands/health.js +30 -42
  35. package/dist/commands/improve/consolidate/pair-pass.js +10 -25
  36. package/dist/commands/improve/consolidate.js +10 -15
  37. package/dist/commands/improve/distill.js +5 -15
  38. package/dist/commands/improve/eligibility.js +1 -1
  39. package/dist/commands/improve/execution.js +37 -40
  40. package/dist/commands/improve/extract-cli.js +6 -11
  41. package/dist/commands/improve/extract-prompt.js +2 -2
  42. package/dist/commands/improve/extract.js +67 -97
  43. package/dist/commands/improve/improve-cli.js +22 -128
  44. package/dist/commands/improve/improve-report.js +1 -1
  45. package/dist/commands/improve/improve-strategies.js +25 -108
  46. package/dist/commands/improve/improve.js +10 -14
  47. package/dist/commands/improve/loop-stages.js +3 -0
  48. package/dist/commands/improve/memory/memory-improve.js +1 -1
  49. package/dist/commands/improve/preparation.js +8 -13
  50. package/dist/commands/improve/reflect.js +203 -332
  51. package/dist/commands/improve/retrieval-scope.js +1 -1
  52. package/dist/commands/improve/session-asset.js +3 -2
  53. package/dist/commands/improve/stage.js +87 -115
  54. package/dist/commands/lint/base-linter.js +3 -3
  55. package/dist/commands/lint/index.js +2 -2
  56. package/dist/commands/models-cli.js +103 -63
  57. package/dist/commands/proposal/drain.js +26 -39
  58. package/dist/commands/proposal/proposal-cli.js +14 -18
  59. package/dist/commands/proposal/propose-cli.js +4 -2
  60. package/dist/commands/proposal/propose.js +37 -64
  61. package/dist/commands/proposal/repository.js +17 -17
  62. package/dist/commands/proposal/validators/proposal-validators.js +2 -2
  63. package/dist/commands/read/curate.js +10 -6
  64. package/dist/commands/read/registry-search.js +2 -48
  65. package/dist/commands/read/search-cli.js +1 -8
  66. package/dist/commands/read/search.js +5 -6
  67. package/dist/commands/read/show.js +2 -4
  68. package/dist/commands/remember.js +25 -40
  69. package/dist/commands/sources/bundle-config-ops.js +2 -2
  70. package/dist/commands/sources/info.js +12 -1
  71. package/dist/commands/sources/init.js +1 -1
  72. package/dist/commands/sources/installed-stashes.js +2 -2
  73. package/dist/commands/sources/migration-help.js +1 -1
  74. package/dist/commands/sources/plugin-upgrade.js +8 -15
  75. package/dist/commands/sources/schema-repair.js +4 -8
  76. package/dist/commands/sources/source-add.js +2 -2
  77. package/dist/commands/sources/source-manage.js +4 -4
  78. package/dist/commands/targets.js +175 -0
  79. package/dist/commands/tasks/explain.js +103 -68
  80. package/dist/commands/tasks/tasks-cli.js +9 -11
  81. package/dist/commands/tasks/tasks.js +37 -41
  82. package/dist/commands/ui/api.js +11 -3
  83. package/dist/commands/ui/redact.js +1 -27
  84. package/dist/commands/ui/workspace-actions.js +1 -1
  85. package/dist/commands/workflow/plan.js +1 -1
  86. package/dist/commands/workflow-cli.js +3 -4
  87. package/dist/core/adapter/adapters/agent-skills-adapter.js +10 -11
  88. package/dist/core/adapter/adapters/akm-adapter.js +33 -38
  89. package/dist/core/adapter/adapters/akm-lint.js +7 -8
  90. package/dist/core/adapter/adapters/akm-task-adapter.js +3 -3
  91. package/dist/core/adapter/adapters/akm-workflow-adapter.js +5 -5
  92. package/dist/core/adapter/adapters/claude-adapter.js +1 -1
  93. package/dist/core/adapter/adapters/dotenv-adapter.js +3 -3
  94. package/dist/core/adapter/adapters/generic-files-adapter.js +5 -5
  95. package/dist/core/adapter/adapters/index.js +3 -4
  96. package/dist/core/adapter/adapters/llm-wiki-adapter.js +12 -14
  97. package/dist/core/adapter/adapters/okf-adapter.js +8 -10
  98. package/dist/core/adapter/adapters/opencode-adapter.js +1 -1
  99. package/dist/core/adapter/adapters/shared.js +3 -3
  100. package/dist/core/adapter/adapters/tool-dir-shared.js +7 -25
  101. package/dist/core/adapter/adapters/website-snapshot-adapter.js +3 -3
  102. package/dist/core/adapter/detect-adapter.js +1 -1
  103. package/dist/core/adapter/execution-source.js +13 -35
  104. package/dist/core/adapter/registry.js +1 -1
  105. package/dist/core/adapter/validate-context.js +2 -4
  106. package/dist/core/asset/asset-placement.js +1 -1
  107. package/dist/core/asset/asset-ref.js +3 -3
  108. package/dist/core/closest-match.js +37 -0
  109. package/dist/core/common.js +33 -5
  110. package/dist/core/config/config-io.js +26 -18
  111. package/dist/core/config/config-schema.js +19 -106
  112. package/dist/core/config/config-sources.js +3 -3
  113. package/dist/core/config/config-types.js +4 -4
  114. package/dist/core/config/config-walker.js +50 -77
  115. package/dist/core/config/config.js +385 -93
  116. package/dist/core/config/convert-engine-references.js +114 -0
  117. package/dist/core/config/convert-engines-shared.js +40 -0
  118. package/dist/core/config/convert-engines.js +300 -0
  119. package/dist/core/config/convert-models-overlay.js +137 -0
  120. package/dist/core/config/credentials.js +304 -0
  121. package/dist/core/config/engine-semantics.js +3 -3
  122. package/dist/core/config/migrate-keys.js +222 -0
  123. package/dist/core/config/model-aliases.js +37 -0
  124. package/dist/core/config/models-file.js +34 -0
  125. package/dist/core/config/retired-engines.js +53 -0
  126. package/dist/core/config/schema/connections.js +41 -0
  127. package/dist/core/config/schema/embedding.js +2 -2
  128. package/dist/core/config/schema/harnesses.js +41 -0
  129. package/dist/core/config/schema/improve-processes.js +9 -28
  130. package/dist/core/config/schema/improve.js +36 -1
  131. package/dist/core/config/schema/index-config.js +18 -20
  132. package/dist/core/config/schema/primitives.js +41 -22
  133. package/dist/core/config/schema/search.js +6 -11
  134. package/dist/core/config/schema/sources-bundles.js +7 -7
  135. package/dist/core/config/schema/workflow.js +2 -6
  136. package/dist/core/config/unusable-entries.js +66 -0
  137. package/dist/core/content-safety.js +3 -6
  138. package/dist/core/endpoint-url.js +47 -0
  139. package/dist/core/errors.js +9 -15
  140. package/dist/core/extra-params.js +3 -3
  141. package/dist/core/improve-result.js +8 -9
  142. package/dist/core/json-schema.js +1 -1
  143. package/dist/core/lesson-lint.js +1 -1
  144. package/dist/core/llm-inference.js +80 -0
  145. package/dist/core/npm-package.js +89 -0
  146. package/dist/core/parse.js +2 -2
  147. package/dist/core/paths.js +32 -4
  148. package/dist/core/recognition-util.js +8 -10
  149. package/dist/core/redaction.js +78 -52
  150. package/dist/core/state/migrations.js +17 -22
  151. package/dist/core/structured.js +2 -68
  152. package/dist/core/subprocess.js +63 -22
  153. package/dist/core/tar.js +116 -0
  154. package/dist/core/type-presentation.js +10 -14
  155. package/dist/execution/input-contract.js +3 -6
  156. package/dist/execution/notices.js +49 -0
  157. package/dist/execution/resolved-request.js +24 -40
  158. package/dist/execution/source.js +21 -45
  159. package/dist/execution/target-ref.js +2 -2
  160. package/dist/indexer/bundle-identity-guard.js +6 -5
  161. package/dist/indexer/ensure-index.js +1 -1
  162. package/dist/indexer/index-writer-lock.js +1 -1
  163. package/dist/indexer/indexer.js +19 -6
  164. package/dist/indexer/installations.js +11 -14
  165. package/dist/indexer/materialize-embeddings.js +20 -16
  166. package/dist/indexer/passes/memory-inference.js +21 -50
  167. package/dist/indexer/passes/metadata.js +5 -5
  168. package/dist/indexer/scan/doc-to-entry.js +1 -1
  169. package/dist/indexer/scan/drain-dir.js +6 -8
  170. package/dist/indexer/search/db-search.js +9 -7
  171. package/dist/indexer/search/search-source.js +40 -22
  172. package/dist/indexer/usage/usage-events.js +2 -3
  173. package/dist/indexer/walk/index-context.js +2 -1
  174. package/dist/indexer/walk/matchers.js +3 -11
  175. package/dist/indexer/walk/walker.js +14 -4
  176. package/dist/integrations/agent/akm-read-tools.js +81 -0
  177. package/dist/integrations/agent/config.js +1 -1
  178. package/dist/integrations/agent/detect.js +32 -36
  179. package/dist/integrations/agent/execution.js +130 -428
  180. package/dist/integrations/agent/index.js +1 -1
  181. package/dist/integrations/agent/profiles.js +24 -28
  182. package/dist/integrations/agent/prompts.js +17 -30
  183. package/dist/integrations/agent/request-lowering.js +67 -101
  184. package/dist/integrations/agent/resolution.js +332 -0
  185. package/dist/integrations/agent/runner-dispatch.js +154 -178
  186. package/dist/integrations/agent/runner.js +20 -72
  187. package/dist/integrations/agent/runtime-port.js +4 -0
  188. package/dist/integrations/agent/runtime.js +10 -0
  189. package/dist/integrations/agent/spawn.js +65 -190
  190. package/dist/integrations/harnesses/aider/index.js +19 -39
  191. package/dist/integrations/harnesses/amazonq/index.js +17 -32
  192. package/dist/integrations/harnesses/claude/index.js +59 -28
  193. package/dist/integrations/harnesses/claude/session-log.js +7 -5
  194. package/dist/integrations/harnesses/codex/index.js +19 -31
  195. package/dist/integrations/harnesses/copilot/index.js +17 -35
  196. package/dist/integrations/harnesses/gemini/index.js +18 -34
  197. package/dist/integrations/harnesses/harness.js +36 -0
  198. package/dist/integrations/harnesses/index.js +20 -51
  199. package/dist/integrations/harnesses/opencode/agent-builder.js +132 -100
  200. package/dist/integrations/harnesses/opencode/index.js +11 -33
  201. package/dist/integrations/harnesses/opencode/roots.js +50 -0
  202. package/dist/integrations/harnesses/opencode/runtime/binary.js +139 -0
  203. package/dist/integrations/harnesses/opencode/runtime/command.js +152 -0
  204. package/dist/integrations/harnesses/opencode/runtime/index.js +181 -0
  205. package/dist/integrations/harnesses/opencode/session-log-v1.js +15 -7
  206. package/dist/integrations/harnesses/opencode/session-log-v2.js +72 -48
  207. package/dist/integrations/harnesses/opencode/session-log.js +58 -137
  208. package/dist/integrations/harnesses/opencode/version.js +34 -53
  209. package/dist/integrations/harnesses/openhands/index.js +13 -37
  210. package/dist/integrations/harnesses/pi/index.js +21 -32
  211. package/dist/integrations/lockfile.js +1 -1
  212. package/dist/integrations/session-logs/index.js +11 -31
  213. package/dist/llm/client.js +93 -111
  214. package/dist/llm/embedder.js +19 -34
  215. package/dist/llm/embedders/connection.js +31 -0
  216. package/dist/llm/embedders/local-model-files.js +56 -0
  217. package/dist/llm/embedders/local.js +111 -115
  218. package/dist/llm/embedders/onnx-runtime.js +121 -0
  219. package/dist/llm/embedders/remote.js +26 -24
  220. package/dist/llm/embedders/types.js +1 -1
  221. package/dist/llm/index-passes.js +33 -39
  222. package/dist/llm/memory-infer.js +67 -77
  223. package/dist/llm/model-list.js +35 -0
  224. package/dist/llm/rerank-client.js +8 -14
  225. package/dist/llm/structured-call.js +45 -99
  226. package/dist/llm/structured.js +60 -0
  227. package/dist/output/renderers.js +2 -7
  228. package/dist/output/shapes/helpers.js +18 -42
  229. package/dist/output/shapes/passthrough.js +1 -0
  230. package/dist/output/shapes.js +1 -7
  231. package/dist/output/text/command-format.js +29 -37
  232. package/dist/output/text/health-format.js +8 -2
  233. package/dist/output/text/helpers.js +1 -1
  234. package/dist/output/text/migrate.js +12 -0
  235. package/dist/output/text/models.js +3 -2
  236. package/dist/output/text/registry-commands.js +1 -2
  237. package/dist/output/text/show-format.js +0 -2
  238. package/dist/output/text/targets-table.js +70 -0
  239. package/dist/output/text/workflow-format.js +7 -8
  240. package/dist/output/text.js +1 -1
  241. package/dist/registry/providers/skills-sh.js +1 -28
  242. package/dist/registry/providers/static-index.js +1 -71
  243. package/dist/runtime.js +6 -2
  244. package/dist/scripts/akm-migrate-node.js +5197 -4193
  245. package/dist/scripts/akm-migrate.js +5197 -4193
  246. package/dist/setup/detect.js +28 -273
  247. package/dist/setup/endpoint.js +36 -0
  248. package/dist/setup/semantic-assets.js +18 -21
  249. package/dist/setup/setup-flags.js +77 -0
  250. package/dist/setup/setup-plan.js +144 -0
  251. package/dist/setup/setup.js +184 -354
  252. package/dist/setup/steps/connection-shared.js +49 -101
  253. package/dist/setup/steps/connection.js +121 -524
  254. package/dist/setup/steps/embeddings.js +168 -0
  255. package/dist/setup/steps/harnesses.js +118 -0
  256. package/dist/setup/steps/platforms.js +2 -81
  257. package/dist/setup/steps.js +10 -0
  258. package/dist/setup/summary.js +67 -0
  259. package/dist/sources/freshness.js +16 -21
  260. package/dist/sources/providers/git-provider.js +2 -9
  261. package/dist/sources/providers/provider-utils.js +1 -5
  262. package/dist/sources/snapshot-fetchers/robots.js +11 -12
  263. package/dist/sources/snapshot-fetchers/website-ingest.js +8 -15
  264. package/dist/storage/database.js +17 -57
  265. package/dist/storage/repositories/improve-ledger-repository.js +1 -1
  266. package/dist/storage/repositories/improve-runs-repository.js +0 -13
  267. package/dist/storage/repositories/index-entries-repository.js +2 -2
  268. package/dist/storage/repositories/workflow-runs-repository.js +8 -15
  269. package/dist/storage/sqlite-read-snapshot.js +33 -29
  270. package/dist/tasks/log-redaction.js +7 -119
  271. package/dist/tasks/prepare/prepare-support.js +5 -5
  272. package/dist/tasks/prepare/prepare.js +5 -5
  273. package/dist/tasks/prepare/script-capture.js +3 -5
  274. package/dist/tasks/run/attempt-lifecycle.js +17 -35
  275. package/dist/tasks/run/load-task.js +8 -13
  276. package/dist/tasks/run/run-command-task.js +15 -10
  277. package/dist/tasks/run/run-native-task.js +8 -13
  278. package/dist/tasks/run/run-task.js +5 -8
  279. package/dist/tasks/run/run-workflow-task.js +12 -19
  280. package/dist/tasks/run/task-history.js +9 -17
  281. package/dist/tasks/run/task-log.js +1 -5
  282. package/dist/tasks/scheduler-invocation.js +13 -18
  283. package/dist/tasks/source/bounded-document.js +31 -76
  284. package/dist/tasks/source/project-v4.js +5 -3
  285. package/dist/tasks/source/task-input-diagnostics.js +3 -4
  286. package/dist/tasks/source/task-source-v4.js +47 -68
  287. package/dist/tasks/source-v3.js +2 -5
  288. package/dist/tasks/task-run-reserved-flags.js +1 -2
  289. package/dist/workflows/authoring/authoring.js +2 -7
  290. package/dist/workflows/concurrency-policy.js +4 -4
  291. package/dist/workflows/exec/child-workflow.js +0 -2
  292. package/dist/workflows/exec/dispatch-redaction.js +14 -83
  293. package/dist/workflows/exec/environment.js +2 -3
  294. package/dist/workflows/exec/exec-unit.js +10 -59
  295. package/dist/workflows/exec/frozen-judge.js +10 -26
  296. package/dist/workflows/exec/native-executor.js +56 -45
  297. package/dist/workflows/exec/run-workflow.js +7 -24
  298. package/dist/workflows/exec/step-work.js +9 -14
  299. package/dist/workflows/exec/unit-dispatch.js +6 -13
  300. package/dist/workflows/freeze/freeze.js +14 -32
  301. package/dist/workflows/freeze/step-values.js +5 -11
  302. package/dist/workflows/freeze/targets/command.js +3 -6
  303. package/dist/workflows/freeze/task-bindings.js +0 -1
  304. package/dist/workflows/parser.js +44 -34
  305. package/dist/workflows/plan.js +3 -1
  306. package/dist/workflows/renderer.js +6 -5
  307. package/dist/workflows/resource-limits.js +2 -2
  308. package/dist/workflows/runtime/run-plan.js +2 -1
  309. package/dist/workflows/runtime/runs.js +14 -9
  310. package/docs/README.md +10 -16
  311. package/docs/architecture/README.md +2 -37
  312. package/docs/architecture/adapters.md +2 -2
  313. package/docs/architecture/akm-core-principles.md +257 -118
  314. package/docs/architecture/architecture.md +282 -98
  315. package/docs/architecture/improvement.md +8 -2
  316. package/docs/architecture/internals/classification.md +1 -3
  317. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +7 -6
  318. package/docs/architecture/internals/health-advisories.md +35 -74
  319. package/docs/architecture/internals/improve-workflow.md +27 -26
  320. package/docs/architecture/internals/indexing.md +3 -3
  321. package/docs/architecture/internals/storage-locations.md +46 -12
  322. package/docs/architecture/persisted-data-compat.md +9 -6
  323. package/docs/architecture/specs/okf-support.md +9 -11
  324. package/docs/architecture/specs/ref.md +7 -9
  325. package/docs/architecture/testing/testing-workflow.md +173 -42
  326. package/docs/architecture/workflow-engine.md +17 -14
  327. package/docs/guides/README.md +0 -1
  328. package/docs/guides/author-bundles.md +1 -3
  329. package/docs/guides/author-workflows.md +61 -73
  330. package/docs/guides/bundles.md +4 -5
  331. package/docs/guides/discover-and-load.md +1 -1
  332. package/docs/guides/getting-started.md +51 -3
  333. package/docs/guides/improve-the-library.md +10 -4
  334. package/docs/guides/recipes/headless-install.md +21 -21
  335. package/docs/guides/run-workflows.md +6 -9
  336. package/docs/guides/scheduling.md +2 -2
  337. package/docs/guides/use-with-any-agent.md +20 -22
  338. package/docs/integration/bundling-akm.md +19 -9
  339. package/docs/maintainers/README.md +0 -3
  340. package/docs/migration/README.md +10 -3
  341. package/docs/migration/release-notes/0.10.0.md +81 -16
  342. package/docs/migration/release-notes/0.6.0.md +1 -1
  343. package/docs/migration/release-notes/0.7.0.md +1 -1
  344. package/docs/migration/release-notes/0.9.0.md +1 -1
  345. package/docs/migration/release-notes/README.md +1 -1
  346. package/docs/migration/v0.9-to-v0.10.md +312 -59
  347. package/docs/migration/v0.9.1-to-v0.9.2.md +6 -5
  348. package/docs/posts/config-v2-lessons-16.md +1 -1
  349. package/docs/posts/llm-mode-reflect-13.md +1 -1
  350. package/docs/posts/release-0.6.0.md +11 -11
  351. package/docs/posts/release-0.8.0.md +4 -4
  352. package/docs/posts/workflows-vaults-09.md +1 -1
  353. package/docs/reference/README.md +1 -1
  354. package/docs/reference/asset-types.md +2 -2
  355. package/docs/reference/cli.md +367 -279
  356. package/docs/reference/configuration.md +591 -557
  357. package/docs/reference/data-and-telemetry.md +8 -5
  358. package/docs/reference/env-and-secrets.md +11 -5
  359. package/docs/reference/refs.md +3 -20
  360. package/docs/reference/registry.md +6 -27
  361. package/docs/reference/supported-formats.md +1 -1
  362. package/docs/reference/tasks.md +11 -8
  363. package/docs/reference/ui-api.md +11 -6
  364. package/docs/reference/workflow-schema.md +106 -134
  365. package/docs/reference/workflows.md +4 -6
  366. package/package.json +9 -14
  367. package/schemas/akm-config.json +1696 -2922
  368. package/schemas/akm-task.json +2 -0
  369. package/schemas/akm-workflow.json +36 -9
  370. package/ROADMAP.md +0 -112
  371. package/dist/assets/models.json +0 -35
  372. package/dist/commands/health/engine-usage.js +0 -45
  373. package/dist/core/config/schema/engines.js +0 -160
  374. package/dist/core/config/schema/execution.js +0 -23
  375. package/dist/core/spawn-env.js +0 -268
  376. package/dist/integrations/agent/builder-shared.js +0 -33
  377. package/dist/integrations/agent/builders.js +0 -43
  378. package/dist/integrations/agent/engine-fallback.js +0 -59
  379. package/dist/integrations/agent/engine-resolution.js +0 -335
  380. package/dist/integrations/agent/model-map.js +0 -475
  381. package/dist/integrations/harnesses/aider/agent-builder.js +0 -107
  382. package/dist/integrations/harnesses/aider/result-extractor.js +0 -53
  383. package/dist/integrations/harnesses/amazonq/agent-builder.js +0 -138
  384. package/dist/integrations/harnesses/amazonq/result-extractor.js +0 -48
  385. package/dist/integrations/harnesses/claude/agent-builder.js +0 -106
  386. package/dist/integrations/harnesses/claude/config-import.js +0 -67
  387. package/dist/integrations/harnesses/claude/result-extractor.js +0 -67
  388. package/dist/integrations/harnesses/codex/agent-builder.js +0 -150
  389. package/dist/integrations/harnesses/codex/result-extractor.js +0 -110
  390. package/dist/integrations/harnesses/copilot/agent-builder.js +0 -117
  391. package/dist/integrations/harnesses/copilot/result-extractor.js +0 -178
  392. package/dist/integrations/harnesses/gemini/agent-builder.js +0 -114
  393. package/dist/integrations/harnesses/gemini/result-extractor.js +0 -149
  394. package/dist/integrations/harnesses/opencode/config-import.js +0 -149
  395. package/dist/integrations/harnesses/opencode/model-config.js +0 -33
  396. package/dist/integrations/harnesses/opencode/model-work-agent.js +0 -115
  397. package/dist/integrations/harnesses/opencode/session-log-types.js +0 -12
  398. package/dist/integrations/harnesses/opencode-sdk/index.js +0 -44
  399. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +0 -1052
  400. package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +0 -199
  401. package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +0 -254
  402. package/dist/integrations/harnesses/opencode-sdk/wire.js +0 -66
  403. package/dist/integrations/harnesses/openhands/agent-builder.js +0 -120
  404. package/dist/integrations/harnesses/openhands/result-extractor.js +0 -135
  405. package/dist/integrations/harnesses/pi/agent-builder.js +0 -89
  406. package/dist/integrations/harnesses/pi/result-extractor.js +0 -168
  407. package/dist/integrations/harnesses/shared.js +0 -18
  408. package/dist/integrations/harnesses/types.js +0 -55
  409. package/dist/llm/feature-gate.js +0 -115
  410. package/dist/output/shapes/models-list.js +0 -16
  411. package/dist/output/shapes/registry-search.js +0 -10
  412. package/dist/setup/detected-engines.js +0 -136
  413. package/dist/setup/engine-config.js +0 -97
  414. package/dist/setup/harness-config-import.js +0 -47
  415. package/dist/setup/providers.js +0 -14
  416. package/dist/setup/steps/semantic.js +0 -39
  417. package/dist/workflows/exec/lowering-notices.js +0 -23
  418. package/docs/architecture/0.10-process-rules.md +0 -832
  419. package/docs/architecture/akm-architecture-decision-history.md +0 -2055
  420. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +0 -544
  421. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +0 -72
  422. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +0 -142
  423. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +0 -187
  424. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +0 -97
  425. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +0 -108
  426. package/docs/architecture/decisions/0006-task-source-version-routing.md +0 -124
  427. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +0 -83
  428. package/docs/architecture/decisions/0008-task-binding-normalization.md +0 -88
  429. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +0 -80
  430. package/docs/architecture/decisions/0010-driver-protocol-cut.md +0 -36
  431. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +0 -125
  432. package/docs/architecture/decisions/README.md +0 -62
  433. package/docs/architecture/internals/functional-contract-patterns.md +0 -340
  434. package/docs/architecture/internals/registry-network-boundary.md +0 -57
  435. package/docs/architecture/internals/search.md +0 -248
  436. package/docs/architecture/reviews/env-secret-access.md +0 -319
  437. package/docs/architecture/runtime-boundary-design.md +0 -153
  438. package/docs/architecture/specs/0.9.0-close-out-plan.md +0 -361
  439. package/docs/architecture/specs/0.9.0-decisions.md +0 -532
  440. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +0 -745
  441. package/docs/architecture/specs/0.9.0-open-items-register.md +0 -135
  442. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +0 -740
  443. package/docs/architecture/specs/0.9.0-release-surface-review.md +0 -636
  444. package/docs/architecture/specs/agent-command-engine-model-design.md +0 -513
  445. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +0 -501
  446. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +0 -291
  447. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +0 -2059
  448. package/docs/architecture/specs/di-seams-plan.md +0 -539
  449. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +0 -275
  450. package/docs/architecture/specs/fact-asset-type.md +0 -142
  451. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +0 -634
  452. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +0 -72
  453. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +0 -152
  454. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +0 -352
  455. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +0 -300
  456. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +0 -402
  457. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +0 -758
  458. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +0 -645
  459. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +0 -602
  460. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +0 -27
  461. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +0 -27
  462. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +0 -74
  463. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +0 -15
  464. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +0 -132
  465. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +0 -147
  466. package/docs/architecture/specs/stash-conventions-code-spec.md +0 -275
  467. package/docs/architecture/specs/stash-organization-conventions.md +0 -377
  468. package/docs/architecture/specs/task-workflow-format-unification.md +0 -721
  469. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +0 -231
  470. package/docs/architecture/specs/workflow-format-unification.md +0 -432
  471. package/docs/architecture/testing/manual-testing-checklist.md +0 -3379
  472. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +0 -924
  473. package/docs/architecture/testing/task-workflow-manual-tests.md +0 -1702
  474. package/docs/guides/claude-code-vs-akm-workflows.md +0 -29
  475. package/docs/guides/knowledge-management.md +0 -18
  476. package/docs/maintainers/curate-workmap.md +0 -335
  477. package/docs/migration/v0.5-to-v0.6.md +0 -759
  478. package/docs/migration/v0.7-to-v0.8.md +0 -1378
  479. package/docs/plans/0.9.2-agent-command-workflow-plan.md +0 -423
package/STABILITY.md CHANGED
@@ -33,6 +33,29 @@ spelling is in the CHANGELOG entry and the CLI reference.
33
33
  | `akm config path --all` | `akm info` |
34
34
  | `--run` / `--since` on `akm improve` | `akm improve report --run` / `--since` |
35
35
 
36
+ **Connections and harnesses (0.10, #1244).** `engines` and `defaults` are
37
+ replaced by `connections` and `harnesses`. A config in the old form still loads
38
+ (converted in memory, with a warning that names `akm migrate apply`), and `akm
39
+ migrate apply` converts it.
40
+
41
+ `--engine <name>` (on `agent`, `command run`, `task add`, `proposal new` and
42
+ `proposal extract`) and `--require-engines` (on `improve`) are hidden from
43
+ `--help` and still run, with one warning, through 0.10. `--require-engines`
44
+ does nothing. Change a script to `--connection <name>` or `--harness <name>`,
45
+ and `--model <alias|name>`; how an old engine name resolves is under
46
+ [The `engines` form](docs/reference/configuration.md#the-engines-form).
47
+
48
+ `AKM_ENGINE_<NAME>_API_KEY`, `AKM_LLM_API_KEY` and `AKM_EMBED_API_KEY` are no
49
+ longer read implicitly: put `"apiKey": "$VAR"` on the connection, or the key in
50
+ `credentials.json`.
51
+
52
+ These are unknown flags or commands (exit 2) from 0.10, with no alias:
53
+
54
+ | Gone | Use |
55
+ | --- | --- |
56
+ | `akm setup --config <json>` and `--probe` | `akm setup --endpoint <url> --yes` and the other answer flags; `--no-probe` for an offline run (probing is the default) |
57
+ | `akm models list`, `akm models copy-defaults` | `akm models`, `akm models set <alias> <model>` |
58
+
36
59
  **Version numbers (0.10 onward, #1089).** A 0.10 release is numbered
37
60
  `0.10.YYMMNN`: `YY` the UTC year, `MM` the month (`01` to `12`) and `NN` the
38
61
  release within that month (`01` to `99`), each two digits. Every release takes
@@ -84,7 +107,7 @@ enumeration of the whole `proposal` noun group.
84
107
 
85
108
  | Command | Tier | Notes |
86
109
  | --- | --- | --- |
87
- | `akm setup` | Stable | |
110
+ | `akm setup` | Stable | The answer flags (`--endpoint`, `--api-key-env`, `--name`, `--harness`, `--embedding`, ...) are new in 0.10; `--config` and `--probe` are gone (see the table above). |
88
111
  | `akm index` | Stable | |
89
112
  | `akm health` | Evolving | Exit codes are Evolving; report *content* and rendered `md`/`html` layout are Experimental — do not script against report layout. |
90
113
  | `akm metrics` | Experimental | New in 0.9.28. Report content, JSON shape and the `html` dashboard may change. |
@@ -126,7 +149,7 @@ enumeration of the whole `proposal` noun group.
126
149
  | `akm log` | Evolving | |
127
150
  | `akm agent` | Evolving | |
128
151
  | `akm command run` | Evolving | Runs stored command templates through the same agent dispatch as `akm agent`. |
129
- | `akm models` | Evolving | `list` and `copy-defaults` for model intent aliases. |
152
+ | `akm models` | Evolving | The alias picks of a connection, then the models its endpoint lists, and `set` to change one. |
130
153
  | `akm lint` | Evolving | |
131
154
  | `akm improve` | Evolving | Review-first by default; mutating lanes require `experimental.improveAutonomy` — see below. |
132
155
  | `akm improve report` | Evolving | Subcommand since 0.10 (was a magic `scope` value); owns `--run` and `--since`. |
@@ -314,7 +337,7 @@ CHANGELOG with a migration note.
314
337
  `list`/`remove`/`init`/`enable`/`disable`); task source v4 YAML (typed
315
338
  `inputs:`, optional `schedule:`) is the only accepted version — task v3 and
316
339
  task v2 sources are converted by `akm migrate apply`. Command tasks use
317
- named engines and task history metadata is versioned. Schema additions in
340
+ a named connection or harness, and task history metadata is versioned. Schema additions in
318
341
  patch releases; removals only at minor. Bare `akm task` is a usage error
319
342
  naming the subcommands (`akm task doctor` reports scheduler diagnostics).
320
343
  `akm task explain <ref>` (new in 0.9.2) and `akm workflow plan <ref>` are
@@ -355,20 +378,17 @@ CHANGELOG with a migration note.
355
378
  `log.md` / `raw/` / `pages/` and its ingest flow); wiki pages are addressed
356
379
  as ordinary concepts inside their bundle. Adapter behavior and page
357
380
  conventions are still iterating.
358
- - **Agent dispatch** — `akm agent` and `akm command run`. Supported backends:
359
- `claude`, `opencode-sdk` (the primary OpenCode interface), `codex`, and the
360
- `opencode` CLI path, `copilot`, `pi`, `gemini`, `aider`, `amazonq`,
361
- `openhands`. Every harness is Evolving: the harness implementation is being
362
- reworked so harnesses are easy to add, remove and update (0.10). The set will
363
- grow.
364
- **Deprecated:** the `opencode` CLI dispatch path (an agent engine with
365
- `platform: "opencode"`, which runs `opencode run` per call). It still works on
366
- OpenCode 1 and 2 throughout 0.10; use an `opencode-sdk` engine instead, which
367
- covers it, including a default agent (#1098). It may be removed in 0.11 or
368
- later. The rest of the OpenCode integration (session-log import, config
369
- import) is not deprecated.
370
- - **Model aliases** — `akm models list|copy-defaults` and the intent-alias
371
- defaults they expose.
381
+ - **Agent dispatch** — `akm agent` and `akm command run`. Supported
382
+ harnesses: `claude`, `codex`, `opencode` (through `opencode run`, for OpenCode 2
383
+ and for the legacy OpenCode 1, which keeps working with no removal date),
384
+ `copilot`, `pi`, `gemini`, `aider`, `amazonq` and `openhands`. Every harness is Evolving: a harness is a thin shell that turns a
385
+ request into a command, and the set is easy to add to, remove from and update.
386
+ The set will grow. A harness runs with your environment as it is
387
+ ([Configuration](docs/reference/configuration.md#how-akm-runs-a-harness)). With
388
+ no harness configured, agent work runs on akm's own runtime over a connection,
389
+ which is Evolving too.
390
+ - **Model aliases** — `akm models` and `akm models set`, and the intent-alias
391
+ picks a connection holds.
372
392
  - **Proposal queue** — quality classifications (`accepted`, `pending`,
373
393
  `proposed`, `rejected`, `archived`) are stable; the JSON shape of a
374
394
  proposal record may add fields.
@@ -402,14 +422,13 @@ for scripted use.
402
422
  least settled part and are kept only in that simple form; `akm workflow list
403
423
  --children` goes with them.
404
424
 
405
- Per-key status today, from the Outcome section of
406
- `docs/plans/0.10-workflows.md`. It stands until the promote-or-remove
425
+ Per-key status today. It stands until the promote-or-remove
407
426
  decision in [#1096](https://github.com/itlackey/akm/issues/1096); every key
408
427
  is still Experimental until then.
409
428
 
410
429
  | Key | Status |
411
430
  | --- | --- |
412
- | `params`, `steps`, `inputs`, `output` / `unit.output`, `defaults.engine`, `### gate` | Core: the feature set pinned by `core-feature-set.test.ts` |
431
+ | `params`, `steps`, `inputs`, `output` / `unit.output`, `defaults.connection` / `defaults.harness`, `### gate` | Core: the feature set pinned by `core-feature-set.test.ts` |
413
432
  | exec units (`unit.exec`), `budget`, `unit.retry`, `map`, `gate.max_loops` | Kept in the 0.10 trim |
414
433
  | child workflows (`unit.workflow`, `unit.with`) | Experimental: least settled |
415
434
  - **`akm metrics`** — new in 0.9.28. What it reports, its JSON shape and the
@@ -443,9 +462,9 @@ for scripted use.
443
462
  than `default` and `consolidate` and the proactive-maintenance lane. 0.10 measures each and keeps, folds or removes it
444
463
  (#1094). `quick`, `reflect-distill`, `thorough` and `catchup` were removed
445
464
  in 0.10 (#1130), as were `proactive-maintenance` and the high-salience lane (#1129); a user-defined strategy of the same name keeps working.
446
- - **Improve tuning config** — `improve.strategies.*.processes.*` (per-process
447
- engines, limits, gates, and the CLS knobs) and
448
- the `index.*` per-pass config. The 0.9.x series is explicitly still settling
465
+ - **Improve tuning config** — `improve.strategies.*.processes.*` (limits,
466
+ gates, and the CLS knobs), `improve.processes.*` and `improve.qualityGate`
467
+ (where each process runs) and the `index.*` per-pass config. The 0.9.x series is explicitly still settling
449
468
  the design of the improve processes, so **keys in these two families may be
450
469
  added, renamed, or dropped in any 0.9.x or 0.10.x release**. The `akm
451
470
  improve` *command* surface is Evolving (above); its tuning config is not.
@@ -487,15 +506,15 @@ the pair pass stages a retirement when its claim checks pass and there is no
487
506
  continuity risk. `triage` with `applyMode: "promote"` can accept that staged
488
507
  retirement unattended; an unstaged retirement stays pending. Both retirement
489
508
  checks receive complete note bodies with lexical attention hints, so the selected
490
- engine must accommodate them. The pair judge supplies distinct-claim lists; AKM
509
+ model must accommodate them. The pair judge supplies distinct-claim lists; AKM
491
510
  derives duplicate/subsumed/overlap outcomes and retirement direction from those
492
511
  lists. Historical queued retirement labels remain readable. Before unattended drain after an upgrade, review pending/staged
493
512
  retirements produced by older builds from notes over 12,000 body characters:
494
513
  upgrading does not revalidate their evidence (#1195).
495
514
 
496
515
  Because the gate is applied before the LLM preflight, a review-first workspace
497
- also needs fewer engines configured: a strategy whose only model-backed process
498
- is a gated lane resolves without an engine at all.
516
+ also needs fewer connections or harnesses configured: a strategy whose only
517
+ model-backed process is a gated lane resolves without one at all.
499
518
 
500
519
  **Three direct writes are deliberately NOT gated**, because they are additive or
501
520
  already independently controlled:
@@ -539,8 +558,6 @@ on them.
539
558
  | Variable | Purpose |
540
559
  | --- | --- |
541
560
  | `AKM_BUNDLE_DIR`, `AKM_CONFIG_DIR`, `AKM_DATA_DIR`, `AKM_CACHE_DIR` | Filesystem layout overrides |
542
- | `AKM_LLM_API_KEY`, `AKM_EMBED_API_KEY`, `AKM_ENGINE_<NAME>_API_KEY` | Credential provision for `$VAR` config references |
543
- | `AKM_LLM_ENDPOINT`, `AKM_LLM_BASE_URL` | Setup provider inference |
544
561
  | `AKM_VERBOSE`, `AKM_DEBUG` | Diagnostics |
545
562
  | `AKM_REGISTRY_URL` | akm registry mirror override |
546
563
  | `AKM_NPM_REGISTRY` | npm mirror override — redirects BOTH the trusted-tarball host allowlist and package metadata lookups (`npm view`-equivalent resolution) to the given registry base, replacing `registry.npmjs.org` wholesale rather than merging with it |
@@ -572,22 +589,6 @@ These changes are planned and will land in a known future release. They
572
589
  are not part of the current stability contract; you should plan migrations
573
590
  around them.
574
591
 
575
- **The 0.9.0 decision record is fully shipped.** The
576
- [decision record](https://github.com/itlackey/akm/blob/main/docs/architecture/specs/0.9.0-decisions.md) settles a set of
577
- breaking changes; every one of them is now in the code, and each decision
578
- carries its own shipped status.
579
-
580
- Shipped from that record: **D1** (`#fragment` section selection),
581
- **D2** (the `akm show <ref> toc|section|lines|frontmatter|full` view grammar is
582
- gone — `#fragment` is the only section selector), **D4** (conceptId /
583
- `bundle//` prefix browse), **D5** (`akm bundle` removed), **D6** (open `type`
584
- set at runtime), **D7** (all six `--format` values everywhere), **D8** (the
585
- `experimental.improveAutonomy` gate), **D9** (`--auto-accept` removed, a hard error since 0.10),
586
- and partially **D10** (an `akm-migrate` binary now exists, though the code still
587
- lives in this repo). **D3** shipped too, in the end: `akm mv` was removed in
588
- 0.9.0 (see the Renames bullet above), with `scripts/rekey-asset-ref.ts` as the
589
- Internal replacement for the one capability nothing else covered.
590
-
591
592
  - **0.10 — `config set`/`config unset` may drop the config dump** in favor of
592
593
  a compact `{ok, shape, key}` result; `akm config list` remains the full read.
593
594
  - **0.10 — migration extraction.** The migration machinery lives in its own
@@ -595,9 +596,6 @@ Internal replacement for the one capability nothing else covered.
595
596
  `akm` (no separate npm package). The task-source migrator (`task-to-v4.ts`,
596
597
  `task-source-v3-frozen.ts`) lives with it under `scripts/akm-migrate/migrate/`,
597
598
  out of `src/`.
598
- - **0.11 or later — the `opencode` CLI dispatch path may be removed.**
599
- Deprecated in 0.10 (see Agent dispatch under Evolving); `opencode-sdk`
600
- engines replace it.
601
599
  - **0.10 — `BundleAdapter.placeNew()` is removed.** Nothing called it; writes use AKM's fixed type→directory table.
602
600
  Writable bundles in a non-akm layout would need per-adapter placement back
603
601
  ([#1163](https://github.com/itlackey/akm/issues/1163)).
@@ -624,7 +622,5 @@ worth fixing.
624
622
  (independent of the feature-stability policy above).
625
623
  - [`docs/architecture/specs/ref.md`](https://github.com/itlackey/akm/blob/main/docs/architecture/specs/ref.md) — the
626
624
  normative ref grammar.
627
- - [`docs/architecture/specs/0.9.0-decisions.md`](https://github.com/itlackey/akm/blob/main/docs/architecture/specs/0.9.0-decisions.md)
628
- — the decision record behind the 0.9.0 surface changes.
629
625
  - [`docs/reference/data-and-telemetry.md`](./docs/reference/data-and-telemetry.md) — what
630
626
  state akm reads and writes locally.
@@ -68,7 +68,7 @@ akm show knowledge/my-doc # Show materialized local content
68
68
  | script | `run`, `setup`, `cwd` |
69
69
  | skill | `content` (full SKILL.md) |
70
70
  | command | `template`, `description`, `parameters` |
71
- | agent | `prompt`, `description`, `modelHint`, `toolPolicy` |
71
+ | agent | `prompt`, `description`, `modelHint` |
72
72
  | knowledge | `content` (whole document, or one section via `#fragment`) |
73
73
  | workflow | `workflowTitle`, `workflowParameters`, `steps` |
74
74
  | memory | `content` (recalled context) |
@@ -297,7 +297,6 @@ akm registry add <url> --name my-team # Add with label
297
297
  akm registry add <url> --provider skills-sh # Specify provider type
298
298
  akm registry remove <url-or-name> # Remove a registry
299
299
  akm search "<query>" --from registry # Search all registries (registry search was folded into search)
300
- akm search "<query>" --from registry --assets # Include asset-level results
301
300
  ```
302
301
 
303
302
  ## Configuration
@@ -307,15 +306,18 @@ akm config list # Show current config
307
306
  akm config get <key> # Read a value
308
307
  akm config set <key> <value> # Set a value
309
308
  akm config unset <key> # Remove a key
309
+ akm models # Which model answers each alias, then what the endpoint lists
310
+ akm models set <alias> <model> # Change one (--connection <name> for another connection)
310
311
  ```
311
312
 
312
313
  ## Other Commands
313
314
 
314
315
  ```sh
315
316
  akm bundle create # Initialize working bundle (scaffold only)
316
- akm setup # Interactive wizard: bundle + LLM/embedding + agent + registry config
317
+ akm setup # Interactive wizard: agent programs, model connection, embeddings, bundle + registry config
317
318
  akm setup --dir ~/custom-bundle # Run the wizard against a custom bundle path
318
319
  akm setup --yes # Non-interactive, accepts all defaults
320
+ akm setup --endpoint <url> --yes # Non-interactive, adds a model connection (an OpenAI-compatible endpoint)
319
321
  akm index # Rebuild search index
320
322
  akm index --full # Full reindex
321
323
  akm bundle list # List all sources
@@ -333,8 +335,8 @@ akm completions --install # Install completions
333
335
  ```
334
336
 
335
337
  `akm bundle create` only scaffolds the bundle directory and registers it in config;
336
- `akm setup` additionally walks through embedding/LLM connections, agent
337
- profiles, sources, and registries. Use `setup` for first-time onboarding,
338
+ `akm setup` additionally walks through agent programs, a model connection,
339
+ embeddings, sources, and registries. Use `setup` for first-time onboarding,
338
340
  `bundle create` when you just need a bare bundle.
339
341
 
340
342
  ## Proposals & Improvement (0.8.0+)
@@ -378,7 +380,7 @@ akm search --type task # Enumerate task assets
378
380
  ```
379
381
 
380
382
  Task files use task source v4 (`version: 4`). There is no `akm:` options bag
381
- or `on:` block — every control (`schedule`, `timeout`, `engine`, `model`,
383
+ or `on:` block — every control (`schedule`, `timeout`, `connection`, `harness`, `model`,
382
384
  `redact`, `maxSteps`, `maxRetries`, …) is a top-level key now. Typed
383
385
  `inputs:` declarations and a bounded `output:` schema work like a
384
386
  workflow's (`output:` replaces v3's `akm.outputSchema`). Task source never
@@ -386,23 +388,24 @@ controls activation: use `akm task enable` / `disable`, which update the
386
388
  host-local config allow-list and sync. To remove one, delete the YAML and run
387
389
  `akm task sync` — the scheduler entry is unbound. Top-level
388
390
  `timeout:` may be `null` (disable the invocation timer) or a duration/number
389
- overriding the selected engine invocation timeout. Preview old task-v2/v3
391
+ overriding the selected connection's or harness's timeout. Preview old task-v2/v3
390
392
  conversion with `akm migrate apply --dry-run`.
391
393
 
392
394
  ## Agent Dispatch
393
395
 
394
396
  ```sh
395
- akm agent --prompt "summarize open proposals" # Dispatch the configured agent CLI
396
- akm agent agents/architect --prompt "..." # Embody a bundle agent asset (system prompt, model, tool policy)
397
+ akm agent --prompt "summarize open proposals" # Run an agent on your default harness (else akm's own runtime over your connection)
398
+ akm agent agents/architect --prompt "..." # Embody a bundle agent asset (system prompt, model)
397
399
  akm command run commands/release # Canonical reusable-command dispatch
398
- akm agent --model sonnet --prompt "..." # Model override (aliases or exact IDs)
400
+ akm agent --model reasoning --prompt "..." # Model override (alias fast|balanced|reasoning, or an exact name)
401
+ akm agent --harness claude --prompt "..." # Run on a named harness (or --connection <name>)
399
402
  ```
400
403
 
401
404
  ## Health, Info, and the Event Log
402
405
 
403
406
  ```sh
404
- akm info # Capabilities, bundle dir, index stats, semantic-search status
405
- akm health # Runtime diagnostics; exit 0 ok / 4 warn / 1 fail
407
+ akm info # Capabilities, bundle dir, index stats, semantic-search status, connections and harnesses
408
+ akm health # Runtime diagnostics, connections and harnesses; exit 0 ok / 4 warn / 1 fail
406
409
  akm health --report # Adds accept-rate metrics
407
410
  akm metrics # Usage, feedback, utility, LLM tokens, tasks, workflows (last 30d, read-only)
408
411
  akm metrics --since 7d # Narrow the window
@@ -0,0 +1,177 @@
1
+ // This Source Code Form is subject to the terms of the Mozilla Public
2
+ // License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+
5
+ // The OpenCode 2 plugin of akm's own agent runtime. akm writes this file to the runtime's config directory and names
6
+ // it in the inline config's `plugins` list (src/integrations/harnesses/opencode/runtime/). It runs inside OpenCode, so
7
+ // it imports no package: only Node's own child_process, to call back into akm.
8
+ //
9
+ // - akm's three read tools, each a run of the akm that started OpenCode, with `--detail agent --format json`. akm
10
+ // passes the argv that runs it in `AKM_OPENCODE_CLI`, a JSON array: the executable alone for a compiled akm, the
11
+ // runtime and the script for one run as a script (Node and `dist/akm`, say), so no shebang or shell is needed on
12
+ // any platform. The run's environment is the call's, so a stamped run's reads (`AKM_EVENT_SOURCE`) are recorded as
13
+ // that run's.
14
+ // - The environment of the commands the agent runs: the variables akm set for the OpenCode process (its roots and
15
+ // its OpenCode settings) are put back to what akm runs in, or removed, so the agent's shell sees the environment a
16
+ // harness's child would.
17
+ // - The connection's request fields, laid over each model request in the endpoint's own field names, as the chat
18
+ // transport sends them. OpenCode sizes every request's output cap from the model's limit and sends it as
19
+ // `max_tokens` or `max_completion_tokens`; that is its own accounting, not a cap anyone asked for, so it is
20
+ // dropped, and the connection's fields carry a cap only when the connection writes one.
21
+
22
+ import { execFile } from "node:child_process";
23
+
24
+ const OUTPUT_LIMIT_BYTES = 8 * 1024 * 1024;
25
+
26
+ const TOOLS = [
27
+ {
28
+ name: "akm_curate",
29
+ command: "curate",
30
+ positional: "query",
31
+ description:
32
+ "Find the akm assets (skills, knowledge, memories, workflows) that best fit a task. Read one with akm_show before relying on it.",
33
+ input: {
34
+ type: "object",
35
+ properties: {
36
+ query: { type: "string", description: "The task or question" },
37
+ type: { type: "string", description: "Optional asset type filter" },
38
+ limit: { type: "integer", minimum: 1 },
39
+ },
40
+ required: ["query"],
41
+ },
42
+ },
43
+ {
44
+ name: "akm_search",
45
+ command: "search",
46
+ positional: "query",
47
+ description: "Search akm assets by name or keyword.",
48
+ input: {
49
+ type: "object",
50
+ properties: {
51
+ query: { type: "string" },
52
+ type: { type: "string", description: "Optional asset type filter" },
53
+ limit: { type: "integer", minimum: 1 },
54
+ },
55
+ required: ["query"],
56
+ },
57
+ },
58
+ {
59
+ name: "akm_show",
60
+ command: "show",
61
+ positional: "ref",
62
+ description: "Read one akm asset by its ref, as returned by akm_curate or akm_search.",
63
+ input: { type: "object", properties: { ref: { type: "string" } }, required: ["ref"] },
64
+ },
65
+ ];
66
+
67
+ const text = (value) => (typeof value === "string" && value.trim() !== "" ? value.trim() : undefined);
68
+
69
+ /** The arguments of one tool call for the akm CLI; throws when the required one is missing. */
70
+ function cliArguments(tool, input) {
71
+ const value = text(input?.[tool.positional]);
72
+ if (!value) throw new Error(`"${tool.positional}" is required`);
73
+ const type = text(input?.type);
74
+ const limit = Number.isInteger(input?.limit) && input.limit > 0 ? String(input.limit) : undefined;
75
+ return [
76
+ tool.command,
77
+ value,
78
+ ...(type && tool.positional !== "ref" ? ["--type", type] : []),
79
+ ...(limit && tool.positional !== "ref" ? ["--limit", limit] : []),
80
+ "--detail",
81
+ "agent",
82
+ "--format",
83
+ "json",
84
+ ];
85
+ }
86
+
87
+ /** The argv in `AKM_OPENCODE_CLI`; throws unless it is a JSON array of strings with at least the executable. */
88
+ function akmArgv() {
89
+ const raw = process.env.AKM_OPENCODE_CLI;
90
+ if (!raw) throw new Error("AKM_OPENCODE_CLI is not set");
91
+ const argv = JSON.parse(raw);
92
+ if (!Array.isArray(argv) || argv.length === 0 || !argv.every((part) => typeof part === "string")) {
93
+ throw new Error("AKM_OPENCODE_CLI is not a JSON array of strings");
94
+ }
95
+ return argv;
96
+ }
97
+
98
+ function runAkm([executable, ...prefix], args) {
99
+ return new Promise((resolve, reject) => {
100
+ execFile(
101
+ executable,
102
+ [...prefix, ...args],
103
+ { encoding: "utf8", maxBuffer: OUTPUT_LIMIT_BYTES, env: process.env },
104
+ (error, stdout, stderr) => {
105
+ if (error) reject(new Error((stderr || error.message).trim()));
106
+ else resolve(stdout);
107
+ },
108
+ );
109
+ });
110
+ }
111
+
112
+ const isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
113
+
114
+ /** `over` laid over `base`; an object on both sides is merged one level deep, anything else of `over` wins. */
115
+ function withFields(base, over) {
116
+ const merged = { ...base };
117
+ for (const [key, value] of Object.entries(over)) {
118
+ merged[key] = isObject(merged[key]) && isObject(value) ? { ...merged[key], ...value } : value;
119
+ }
120
+ return merged;
121
+ }
122
+
123
+ export default {
124
+ id: "akm",
125
+ setup: async (ctx) => {
126
+ await ctx.tool.transform((editor) => {
127
+ for (const tool of TOOLS) {
128
+ editor.add({
129
+ name: tool.name,
130
+ description: tool.description,
131
+ input: tool.input,
132
+ options: { codemode: false },
133
+ execute: async (input) => {
134
+ try {
135
+ const args = cliArguments(tool, input);
136
+ return { content: await runAkm(akmArgv(), args) };
137
+ } catch (error) {
138
+ return { content: `${tool.name} failed: ${error instanceof Error ? error.message : String(error)}` };
139
+ }
140
+ },
141
+ });
142
+ }
143
+ });
144
+
145
+ const shellEnv = ctx.options?.shellEnv;
146
+ if (isObject(shellEnv)) {
147
+ await ctx.shell.hook("create.before", async (event) => {
148
+ for (const [name, value] of Object.entries(shellEnv)) {
149
+ if (typeof value === "string") event.env[name] = value;
150
+ else delete event.env[name];
151
+ }
152
+ });
153
+ }
154
+
155
+ const fields = ctx.options?.requestFields;
156
+ await ctx.session.hook("http.request", async (event) => {
157
+ const request = event.request;
158
+ if (request.body === null) return;
159
+ let body;
160
+ try {
161
+ body = JSON.parse(await request.clone().text());
162
+ } catch {
163
+ return;
164
+ }
165
+ if (!isObject(body)) return;
166
+ const { max_tokens: _own, max_completion_tokens: _ownCompletion, ...kept } = body;
167
+ const headers = new Headers(request.headers);
168
+ headers.delete("content-length");
169
+ event.request = new Request(request.url, {
170
+ method: request.method,
171
+ headers,
172
+ body: JSON.stringify(isObject(fields) ? withFields(kept, fields) : kept),
173
+ signal: request.signal,
174
+ });
175
+ });
176
+ },
177
+ };
@@ -13,7 +13,7 @@ consistency and reducing repeated context-setting.
13
13
  | `knowledge/` | Knowledge | Reference documents, guides, architecture notes |
14
14
  | `memories/` | Memories | Persistent facts and preferences learned over time |
15
15
  | `commands/` | Commands | Parameterised prompt templates for common workflows |
16
- | `agents/` | Agents | Agent definitions with system prompts and tool policies |
16
+ | `agents/` | Agents | Agent definitions with system prompts |
17
17
  | `workflows/` | Workflows | Multi-step orchestration sequences |
18
18
  | `tasks/` | Tasks | Scheduled or on-demand automation tasks |
19
19
  | `lessons/` | Lessons | Durable lessons extracted from past sessions |
@@ -1,4 +1,4 @@
1
1
  version: 4
2
- run: akm improve --require-engines
2
+ run: akm improve
3
3
  description: Run improve pipeline nightly
4
4
  schedule: "0 2 * * *"
@@ -1,4 +1,4 @@
1
1
  version: 4
2
- run: akm improve --strategy consolidate --timeout-ms 3600000 --skip-if-locked --require-engines
2
+ run: akm improve --strategy consolidate --timeout-ms 3600000 --skip-if-locked
3
3
  description: Consolidation-only pass (every 4h at :20)
4
4
  schedule: "20 */4 * * *"
@@ -34,16 +34,32 @@ function node(key, value, path, sources, depth) {
34
34
  return html`<li class="leaf"><span class="mono key">${key}</span><span class="leaf-value">${leafValue(value)}</span>${sourceBadge(source)}</li>`;
35
35
  }
36
36
 
37
- function enginesTable(engines) {
38
- if (engines.length === 0) return emptyState("No engines are configured.");
39
- const rest = (e) => {
40
- const { name, kind, endpoint, model, ...others } = e;
41
- return Object.keys(others).length > 0 ? JSON.stringify(others) : "";
42
- };
37
+ /** What a table shows of an entry beyond its named columns, as compact JSON. */
38
+ function otherFields(entry, shown) {
39
+ const rest = Object.fromEntries(Object.entries(entry).filter(([key]) => !shown.includes(key)));
40
+ return Object.keys(rest).length > 0 ? JSON.stringify(rest) : "";
41
+ }
42
+
43
+ function connectionsTable(connections) {
44
+ if (connections.length === 0) return emptyState("No connections are configured.");
45
+ const aliases = (c) =>
46
+ Object.entries(c.models ?? {})
47
+ .map(([alias, entry]) => `${alias}: ${typeof entry === "string" ? entry : entry.model}`)
48
+ .join(", ");
49
+ return tableWrap(
50
+ html`<table><thead><tr><th>Name</th><th>Endpoint</th><th>Models</th><th>Other</th></tr></thead><tbody>${connections.map(
51
+ (c) =>
52
+ html`<tr><td class="mono">${c.name}</td><td class="mono wrap">${c.endpoint ?? ""}</td><td class="mono wrap">${aliases(c)}</td><td class="mono small wrap">${otherFields(c, ["name", "endpoint", "models"])}</td></tr>`,
53
+ )}</tbody></table>`,
54
+ );
55
+ }
56
+
57
+ function harnessesTable(harnesses) {
58
+ if (harnesses.length === 0) return emptyState("No harnesses are configured.");
43
59
  return tableWrap(
44
- html`<table><thead><tr><th>Name</th><th>Kind</th><th>Endpoint</th><th>Model</th><th>Other</th></tr></thead><tbody>${engines.map(
45
- (e) =>
46
- html`<tr><td class="mono">${e.name}</td><td>${e.kind}</td><td class="mono wrap">${e.endpoint ?? ""}</td><td class="mono">${e.model ?? ""}</td><td class="mono small wrap">${rest(e)}</td></tr>`,
60
+ html`<table><thead><tr><th>Name</th><th>Platform</th><th>Other</th></tr></thead><tbody>${harnesses.map(
61
+ (h) =>
62
+ html`<tr><td class="mono">${h.name}</td><td class="mono">${h.platform ?? h.name}</td><td class="mono small wrap">${otherFields(h, ["name", "platform"])}</td></tr>`,
47
63
  )}</tbody></table>`,
48
64
  );
49
65
  }
@@ -58,7 +74,8 @@ export async function render() {
58
74
  ])}${data.exists ? "" : html`<p class="muted">There is no config file, so everything below is a default.</p>`}</section>
59
75
  <section><h2>Effective config</h2><p class="legend-line">Source: ${sourceBadge("default")} built-in ${sourceBadge("file")} this install's config.json ${sourceBadge("extends:ref")} a config it extends</p>
60
76
  ${keys.length === 0 ? emptyState("The effective config is empty.") : html`<ul class="tree root">${keys.map((k) => node(k, data.config[k], k, sources, 0))}</ul>`}</section>
61
- <section><h2>Engines</h2>${enginesTable(data.engines)}</section>
77
+ <section><h2>Connections</h2>${connectionsTable(data.connections)}</section>
78
+ <section><h2>Harnesses</h2>${harnessesTable(data.harnesses)}</section>
62
79
  <section><h2>Environment</h2><p class="muted">AKM_* variables set for the server. They override paths and credentials.</p>${
63
80
  data.env.length === 0
64
81
  ? emptyState("No AKM_* environment variables are set.")
@@ -37,8 +37,8 @@ first step's attached artifact."
37
37
 
38
38
  A `### gate` sub-heading is the step's completion rubric: the judge
39
39
  receives this whole section byte-exact. Omit the heading or leave its text
40
- empty to skip validation. A non-empty rubric requires
41
- `workflow.judgeEngine`; verifier failures and malformed verdicts reject the
40
+ empty to skip validation. A non-empty rubric needs a connection or a harness
41
+ to judge it; verifier failures and malformed verdicts reject the
42
42
  gate rather than silently skipping it.
43
43
 
44
44
  - Confirm the step accomplished what it set out to do.
package/dist/cli/clack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // This Source Code Form is subject to the terms of the Mozilla Public
2
2
  // License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
- import { cancel as realCancel, confirm as realConfirm, intro as realIntro, isCancel as realIsCancel, log as realLog, multiselect as realMultiselect, note as realNote, outro as realOutro, select as realSelect, spinner as realSpinner, text as realText, } from "@clack/prompts";
4
+ import { cancel as realCancel, confirm as realConfirm, intro as realIntro, isCancel as realIsCancel, log as realLog, multiselect as realMultiselect, note as realNote, outro as realOutro, password as realPassword, select as realSelect, spinner as realSpinner, text as realText, } from "@clack/prompts";
5
5
  // ── Test seam ────────────────────────────────────────────────────────────────
6
6
  // Swap-and-restore override. Inert in production; only tests call the setter
7
7
  // (via tests/_helpers/seams.ts `overrideSeam`, never directly).
@@ -18,6 +18,7 @@ const realFns = {
18
18
  select: realSelect,
19
19
  multiselect: realMultiselect,
20
20
  text: realText,
21
+ password: realPassword,
21
22
  spinner: realSpinner,
22
23
  note: realNote,
23
24
  isCancel: realIsCancel,
@@ -42,6 +43,7 @@ export const confirm = bind("confirm");
42
43
  export const select = bind("select");
43
44
  export const multiselect = bind("multiselect");
44
45
  export const text = bind("text");
46
+ export const password = bind("password");
45
47
  export const spinner = bind("spinner");
46
48
  export const note = bind("note");
47
49
  export const isCancel = bind("isCancel");
@@ -0,0 +1,33 @@
1
+ // This Source Code Form is subject to the terms of the Mozilla Public
2
+ // License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ import { UsageError } from "../core/errors.js";
5
+ import { warnOnce } from "../core/warn.js";
6
+ import { getStringArg } from "./parse-args.js";
7
+ export const SELECTION_ARGS = {
8
+ connection: { type: "string", description: "Run on this connection, by name (default: the default connection)" },
9
+ harness: { type: "string", description: "Run on this harness, by name or platform (default: the default harness)" },
10
+ model: { type: "string", description: "Model to run, by alias (fast, balanced, reasoning) or exact name" },
11
+ };
12
+ /** The retired `--engine`: parsed, left out of `--help` (`withoutHiddenArgs`). Spread it where the flag existed. */
13
+ export const RETIRED_ENGINE_ARG = {
14
+ engine: { type: "string", hidden: true, description: "Retired: use --connection or --harness." },
15
+ };
16
+ export function selectionFromArgs(args) {
17
+ const connection = getStringArg(args, "connection");
18
+ const harness = getStringArg(args, "harness");
19
+ if (connection !== undefined && harness !== undefined) {
20
+ throw new UsageError("--connection and --harness are mutually exclusive. Pick one.", "INVALID_FLAG_VALUE");
21
+ }
22
+ const engine = getStringArg(args, "engine");
23
+ if (engine !== undefined) {
24
+ warnOnce("retired-flag:--engine", "--engine is retired: use --connection or --harness. For now it names a connection by that name, else a harness.");
25
+ }
26
+ const model = getStringArg(args, "model");
27
+ return {
28
+ ...(connection !== undefined ? { connection } : {}),
29
+ ...(harness !== undefined ? { harness } : {}),
30
+ ...(engine !== undefined ? { engine } : {}),
31
+ ...(model !== undefined ? { model } : {}),
32
+ };
33
+ }
@@ -92,7 +92,7 @@ function extractHint(error) {
92
92
  * R-067: this used to call `process.exit(exitCode)` directly, which
93
93
  * terminates the process synchronously and skips every pending `finally`
94
94
  * block up the call stack — including `src/cli.ts`'s own
95
- * `disposeDispatchResources()` cleanup and citty's per-command `cleanup`
95
+ * `disposeLlmUsageSink()` cleanup and citty's per-command `cleanup`
96
96
  * hooks. `process.exitCode = exitCode; return;` is equivalent for every
97
97
  * caller here: Node/Bun exits with that code once the event loop drains
98
98
  * naturally, but cleanup on the way there still runs.
@@ -183,6 +183,19 @@ export const GLOBAL_OUTPUT_ARGS = {
183
183
  default: false,
184
184
  },
185
185
  };
186
+ /**
187
+ * A command with the args marked `hidden` left out: what `--help` renders. A
188
+ * hidden arg parses like any other and is simply not advertised, the way
189
+ * `meta.hidden` keeps a command out of the COMMANDS list. It is for a retired
190
+ * spelling that still works, so a scheduled command written for an earlier
191
+ * release keeps running.
192
+ */
193
+ export function withoutHiddenArgs(command) {
194
+ const args = command.args;
195
+ if (!args)
196
+ return command;
197
+ return { ...command, args: Object.fromEntries(Object.entries(args).filter(([, def]) => def.hidden !== true)) };
198
+ }
186
199
  /**
187
200
  * Define a citty command whose `run` body is automatically wrapped in
188
201
  * `runWithJsonErrors`, so the handler emits a byte-identical JSON error