akm-cli 0.10.261014-beta → 0.10.261016-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 (52) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/README.md +7 -8
  3. package/SECURITY.md +3 -3
  4. package/STABILITY.md +2 -1
  5. package/dist/assets/hints/cli-hints-full.md +6 -4
  6. package/dist/assets/hints/cli-hints-short.md +4 -2
  7. package/dist/assets/opencode/akm-plugin.js +16 -8
  8. package/dist/assets/prompts/workflow-unit-preamble.md +3 -1
  9. package/dist/cli.js +2 -2
  10. package/dist/commands/health/plugin-staleness.js +86 -22
  11. package/dist/commands/health/semantic-search-check.js +2 -2
  12. package/dist/commands/read/search-cli.js +2 -2
  13. package/dist/commands/read/show.js +15 -3
  14. package/dist/core/asset/markdown.js +9 -0
  15. package/dist/core/config/config-walker.js +35 -32
  16. package/dist/core/config/schema/connections.js +6 -3
  17. package/dist/core/config/schema/harnesses.js +8 -1
  18. package/dist/core/config/schema/primitives.js +12 -1
  19. package/dist/core/config/schema/sources-bundles.js +2 -2
  20. package/dist/core/npm-package.js +124 -0
  21. package/dist/{integrations/harnesses/opencode/runtime → core}/tar.js +25 -16
  22. package/dist/integrations/harnesses/opencode/runtime/binary.js +8 -75
  23. package/dist/integrations/harnesses/opencode/runtime/index.js +5 -1
  24. package/dist/llm/embedders/local.js +23 -58
  25. package/dist/llm/embedders/onnx-runtime.js +121 -0
  26. package/dist/output/renderers.js +2 -2
  27. package/dist/output/shapes/helpers.js +2 -0
  28. package/dist/output/text/show-format.js +7 -0
  29. package/dist/registry/semver.js +12 -0
  30. package/dist/scripts/akm-migrate-node.js +21638 -5760
  31. package/dist/scripts/akm-migrate.js +21645 -5767
  32. package/dist/setup/semantic-assets.js +9 -6
  33. package/dist/setup/setup.js +56 -2
  34. package/dist/setup/steps/embeddings.js +21 -4
  35. package/dist/storage/database.js +17 -57
  36. package/dist/tasks/backends/cron.js +19 -0
  37. package/docs/architecture/akm-core-principles.md +3 -2
  38. package/docs/architecture/internals/health-advisories.md +2 -2
  39. package/docs/architecture/internals/storage-locations.md +1 -0
  40. package/docs/architecture/specs/ref.md +4 -3
  41. package/docs/architecture/testing/testing-workflow.md +28 -20
  42. package/docs/guides/discover-and-load.md +12 -4
  43. package/docs/guides/getting-started.md +23 -20
  44. package/docs/guides/recipes/headless-install.md +13 -8
  45. package/docs/guides/use-with-any-agent.md +4 -1
  46. package/docs/maintainers/release-checklist.md +15 -8
  47. package/docs/migration/v0.9-to-v0.10.md +17 -0
  48. package/docs/reference/cli.md +42 -12
  49. package/docs/reference/configuration.md +37 -15
  50. package/package.json +6 -9
  51. package/schemas/akm-config.json +535 -302
  52. package/dist/standalone/onnxruntime-library.js +0 -52
@@ -34,23 +34,24 @@ Or download a standalone binary directly from the
34
34
  Hitting a PowerShell execution-policy error on Windows? See
35
35
  [Troubleshooting](#troubleshooting) at the end of this guide.
36
36
 
37
- ### Standalone binary and semantic search
38
-
39
- Local semantic search (`semanticSearchMode: auto`) runs its embedding model on
40
- ONNX Runtime. A standalone binary carries the library for its platform. The
41
- first time it embeds, it copies that library once into akm's cache directory,
42
- under `onnxruntime/<version>-<platform>-<arch>/` (18 to 34 MB depending on the
43
- platform; `akm info` prints the cache directory), and loads it from there. Two
44
- limits follow:
45
-
46
- - A standalone binary writes its native addon to the system temp directory and
47
- loads it from there, so a temp directory mounted `noexec` blocks semantic
48
- search (`akm index` reports it `blocked`; keyword search works). Set `TMPDIR`
49
- to a writable, executable directory. The cache directory must be on
50
- an executable mount too.
51
- - Alpine/musl and Intel macOS have no native ONNX Runtime library. Semantic
52
- search is unavailable there: `akm index` reports it `blocked` with the reason
53
- and search stays keyword-only. A remote `embedding.endpoint` still works.
37
+ ### Local semantic search
38
+
39
+ Local semantic search runs its embedding model on ONNX Runtime, and akm offers
40
+ it on Linux x64 (glibc) and Apple-silicon macOS; on every other
41
+ platform search is keyword-only or uses an embedding endpoint you configure. Choosing the built-in embedder in
42
+ `akm setup` (or `akm setup --yes --embedding local`) downloads what it needs once
43
+ into akm's cache directory (`akm info` prints it): ONNX Runtime for your platform,
44
+ under `onnxruntime/<version>-<platform>-<arch>/` (about 86 MB downloaded,
45
+ about 36 MB kept), and the model (about 127 MB). Nothing is installed with the npm
46
+ package or carried in a standalone binary, and the first `akm index` downloads
47
+ what setup did not. Two notes:
48
+
49
+ - The cache directory must be on a mount that allows executing files: the
50
+ runtime is loaded from there, and on a `noexec` mount `akm index` reports
51
+ semantic search `blocked` (keyword search works).
52
+ - On a platform without local embeddings, `akm setup` offers an embedding
53
+ endpoint or keyword search only, and `akm setup --embedding local` warns and
54
+ keeps keyword search.
54
55
 
55
56
  ### akm's own agent runtime
56
57
 
@@ -60,7 +61,8 @@ is the same for the npm package and the standalone binary: nothing of OpenCode
60
61
  is installed with akm, and the first time the runtime runs, akm downloads the
61
62
  OpenCode binary for your platform from the npm registry (one package, about
62
63
  114 MB, 240 MB on disk), checks it against the registry's integrity hash and
63
- keeps it in the cache directory under `opencode/<version>/`. It is fetched once.
64
+ keeps it in the cache directory under `opencode/<version>/`. It is fetched once;
65
+ the `akm setup` wizard offers to fetch it then, when agent work runs there.
64
66
  Three limits follow:
65
67
 
66
68
  - That step needs the npm registry. Without network access for it, enable the
@@ -196,8 +198,9 @@ akm show <ref> # e.g. akm show workflows/deploy
196
198
 
197
199
  **Success check:** structured JSON with everything an agent needs to use the
198
200
  asset — a `run` command plus optional `cwd` and `setup` for scripts, a
199
- `prompt` payload for agents, or the document `content` for knowledge (append
200
- `#<heading-slug>` to a ref for one section).
201
+ `prompt` payload for agents, or the document `content` for knowledge (with
202
+ `--detail brief`, just its outline `toc`; append `#<slug>` to a ref for one
203
+ section).
201
204
 
202
205
  AKM retrieves every supported capability type. It directly orchestrates
203
206
  defined execution surfaces such as workflows, agent dispatch, tasks, and
@@ -54,19 +54,24 @@ it and never appears on the command line:
54
54
  akm setup --yes --endpoint https://api.example.com/v1 --api-key-env EXAMPLE_API_KEY
55
55
  ```
56
56
 
57
- `--no-probe` keeps the run offline (the endpoint's model list is not fetched), so a
58
- new connection has no model until `akm models set` names one.
57
+ `--no-probe` keeps the run offline: nothing is contacted or downloaded (the
58
+ endpoint's model list is not fetched, so a new connection has no model until
59
+ `akm models set` names one).
59
60
  For the full set of flags, see `akm setup --help`; for the config they write,
60
61
  see [configuration.md](../../reference/configuration.md).
61
62
 
62
- **Semantic search.** Headless setups (`--yes` or `--from`, no wizard
63
- prompts) defer the embedding-model download to the first `akm index` run,
64
- unlike the interactive wizard which downloads immediately during `akm
65
- setup`. Set the mode explicitly rather than relying on the implicit default:
63
+ **Semantic search.** `--embedding local` chooses the built-in embedder, offered
64
+ on Linux x64 (glibc) and Apple-silicon macOS; elsewhere it warns and
65
+ keeps keyword search. Once the config is saved, a headless setup (`--yes` or
66
+ `--from`) downloads the embedder's runtime and model into akm's cache and
67
+ reports `semanticAssets` in its result (`ready`, `blocked: <reason>`, or
68
+ `skipped` with `--no-probe`, which leaves the download to the first
69
+ `akm index`). Without the flag, semantic search stays as the config has it
70
+ (`off` by default):
66
71
 
67
72
  ```sh
68
- akm config set semanticSearchMode auto # local embeddings, downloaded on first index
69
- akm config set semanticSearchMode off # skip embeddings entirely
73
+ akm setup --yes --embedding local # local embeddings, downloaded now
74
+ akm config set semanticSearchMode off # skip embeddings entirely
70
75
  ```
71
76
 
72
77
  For resource requirements and remote-embedding alternatives, see
@@ -52,7 +52,10 @@ akm feedback workflows/deploy-to-prod --positive --reason "Completed without iss
52
52
 
53
53
  **Get refs from search.** Agents should call `akm search --detail agent` or
54
54
  `akm curate` to discover refs — not guess them. The `ref` field in search
55
- results is the stable token to pass to `akm show`. Feedback closes the loop.
55
+ results is the stable token to pass to `akm show`. For a long document,
56
+ `akm show <ref> --detail brief` returns its outline (`toc`, no body), and
57
+ `akm show <ref>#<slug>` then loads only the sections the task needs. Feedback
58
+ closes the loop.
56
59
  Record `--negative` only when the asset's content is wrong or stale; a note that
57
60
  simply did not fit the task is not negative feedback, so record nothing for it.
58
61
  `akm feedback <ref> --negative --reason "<what is wrong and what should change>"`
@@ -19,7 +19,8 @@ next):
19
19
  the `package.json` version (`tests/workflow-release.test.ts`).
20
20
  3. Add a migration note if the release needs one (see
21
21
  [CONTRIBUTING](https://github.com/itlackey/akm/blob/main/.github/CONTRIBUTING.md#shipping-a-release--migration-notes)).
22
- 4. Commit `release: <version>`, push it to the branch, and let CI run on it.
22
+ 4. Commit `release: <version>`, push it to the branch and dispatch the release
23
+ (next section); the workflow waits for CI on that commit.
23
24
 
24
25
  ## 2. Release akm
25
26
 
@@ -31,13 +32,19 @@ The Release workflow, on the pushed commit:
31
32
 
32
33
  1. runs Gated CI: semantic search with real embeddings, the Docker install
33
34
  matrix, and the native schedulers on Linux, macOS and Windows;
34
- 2. requires CI to have passed on the same commit (it does not run lint, the
35
- typecheck or the test suites again);
36
- 3. runs `tests/release-check.sh --skip-docker`: the packaged artifact's bin
37
- targets and migrator, package acceptance, and the upgrade rehearsal against
38
- the packed tarball;
39
- 4. builds the package and standalone binaries, publishes to npm (`latest` for
40
- a stable version, `next` for a prerelease) and creates the GitHub release.
35
+ 2. runs `tests/release-check.sh --skip-docker`: the packaged artifact's bin
36
+ targets and migrator, and package acceptance;
37
+ 3. builds the package and standalone binaries;
38
+ 4. requires CI to pass on the same commit, waiting up to 25 minutes for the run
39
+ to finish: the newest push or manual run counts, a pull request's does not
40
+ (it does not run lint, the typecheck, the test suites or the upgrade
41
+ rehearsal again);
42
+ 5. publishes to npm (`latest` for a stable version, `next` for a prerelease)
43
+ and creates the GitHub release.
44
+
45
+ Push nothing else to the branch until the Release finishes: a push cancels the
46
+ release commit's CI run (`ci.yml` cancels an in-progress run on the same ref),
47
+ and the Release then fails.
41
48
 
42
49
  If a job fails on a flake, rerun the failed jobs. If the fix needs a code
43
50
  change, commit it and release that commit. npm can take several minutes to show
@@ -609,6 +609,23 @@ yours to run it, and its runs are in your OpenCode history, which improve reads.
609
609
  - **A transient reflect failure** (transport error, timeout, crash) no longer
610
610
  uses up the feedback that planned it; the ref is retried next run.
611
611
 
612
+ ### Local semantic search and installs
613
+
614
+ - **akm no longer installs ONNX Runtime through npm.** `akm setup` with the
615
+ built-in embedder (`--embedding local`), or the first `akm index` after the
616
+ upgrade, downloads ONNX Runtime 1.24.3 once (about 86 MB) into akm's cache.
617
+ The vectors are unchanged, so no re-index is needed.
618
+ - **Local embeddings are offered on Linux x64 (glibc) and
619
+ Apple-silicon macOS.** Every other platform uses keyword search or an
620
+ embedding endpoint, and `akm setup` offers only those there.
621
+ - **Standalone binaries are up to 36 MB smaller**, and a `noexec` temp directory
622
+ no longer matters; akm's cache directory must still allow executing files.
623
+ - **On Node, the SQLite driver ships prebuilt for every supported Node
624
+ version**, so `npm install -g akm-cli` works where npm skips install scripts
625
+ (npm 12 does by default), and a Node upgrade no longer needs `npm rebuild`.
626
+ Nothing in the package runs an install script, the Node.js version check
627
+ included: akm checks the version when it starts.
628
+
612
629
  ### The environment programs run in
613
630
 
614
631
  A harness (agent tasks and workflow agent steps included) and an `exec` unit's
@@ -218,9 +218,16 @@ The wizard asks, in order:
218
218
  the config as this run will save it: a further `--name` connection does not
219
219
  serve embeddings, its models are not offered, and with several connections
220
220
  none called `default`, `--embedding <model>` refuses and asks you to name one
221
- default or pass `--embedding-endpoint`.
221
+ default or pass `--embedding-endpoint`. The built-in embedder is offered on
222
+ Linux x64 (glibc) and Apple-silicon macOS only; elsewhere the step
223
+ says so in one sentence and offers an endpoint or off, and `--embedding local`
224
+ warns and saves off.
222
225
  5. **Save.** The config is written, the bundle directory initialized, and a
223
- summary says what runs where.
226
+ summary says what runs where. With the built-in embedder chosen, setup then
227
+ downloads its runtime (ONNX Runtime, about 86 MB) and model (about 127 MB)
228
+ into akm's cache and loads them; the wizard asks first. When agent work runs
229
+ on akm's own runtime, the wizard also offers to download its OpenCode binary
230
+ (about 114 MB) now rather than on the first agent run.
224
231
 
225
232
  Flags answer one question each; `--yes` takes the detected default for every
226
233
  question left, so nothing is prompted. Without a terminal, `akm setup` refuses
@@ -236,7 +243,7 @@ unless `--yes` or `--from` is given.
236
243
  | `--embedding-endpoint <url>`, `--embedding-api-key-env <NAME>` | Another endpoint serving the embedding model |
237
244
  | `--from <file>` | A config file (JSON or YAML) to merge |
238
245
  | `--dir <path>`, `--no-init` | The bundle directory; skip scaffolding it |
239
- | `--no-probe` | Offline: the endpoint is not contacted and its models are not listed; a connection added this way has no model until `akm models set` names one |
246
+ | `--no-probe` | Offline: nothing is contacted or downloaded. The endpoint's models are not listed, so a connection added this way has no model until `akm models set` names one, and the built-in embedder's runtime and model are downloaded by the first `akm index` |
240
247
 
241
248
  The detected defaults are: when no agent program is configured yet, every one
242
249
  found on `PATH` is enabled and the first found is the default. If no connection
@@ -249,7 +256,11 @@ whose endpoint lists an embedding model.
249
256
 
250
257
  The wizard also lets you review registries and add bundle sources. A scripted run
251
258
  prints its result with a `runs` object saying what runs where: `modelCalls`,
252
- `agentWork` and `embeddings`.
259
+ `agentWork` and `embeddings`. When the saved config uses the built-in embedder,
260
+ the result also has `semanticAssets`: `ready` once its runtime and model are
261
+ downloaded and load, `blocked: <reason>` when they do not (the config is saved
262
+ all the same), or `skipped` with `--no-probe`. A scripted run does not download
263
+ akm's own agent runtime; its first agent run does.
253
264
 
254
265
  ### index
255
266
 
@@ -424,6 +435,10 @@ to each connection's endpoint, one probe per distinct endpoint, checks the
424
435
  installed akm-cli version against the latest GitHub release (`cli-version`),
425
436
  runs the scheduler's recorded akm binary with `--version` to check it
426
437
  against the running CLI (`scheduler-binary`).
438
+ The `plugin-version` advisory compares the installed Claude Code plugin with the
439
+ channel its marketplace clone follows: the newest stable tag on the remote's
440
+ default branch, the release tag on the branch head for another branch such as
441
+ `next`, and the pinned tag for a marketplace added at a tag.
427
442
 
428
443
  Primary result fields:
429
444
 
@@ -464,13 +479,13 @@ search, with the index's entry and vector counts read now. It loads no model and
464
479
  sends no request. It `pass`es when every entry has a vector (and a local model
465
480
  embedded on `onnxruntime-node`) or `semanticSearchMode` is `off`; `warn`s when
466
481
  vectors lag the entries (`akm index` embeds the rest), local embeddings ran on
467
- another runtime, or this platform has no native ONNX Runtime library
468
- (Alpine/musl, Intel macOS: keyword search is all there is, so the message says to
469
- set `semanticSearchMode` to `off` or `embedding.endpoint` to a remote service);
482
+ another runtime, or akm offers no local embeddings on this platform (keyword
483
+ search or an endpoint is the default there, so the message names
484
+ `akm setup --embedding off` and `akm setup --embedding <model> --embedding-endpoint <url>`);
470
485
  `fail`s, with the recorded reason, when the last index found semantic search
471
486
  `blocked` (an embedding endpoint or model download failed) or `unavailable` for
472
- a cause that can be fixed (the library is there but did not load: a missing
473
- package or addon, a `noexec` temp or cache directory); and is `unknown` before
487
+ a cause that can be fixed (the runtime could not be downloaded or did not load,
488
+ for example from a `noexec` cache directory); and is `unknown` before
474
489
  the first index. Search never reads this record: a query still
475
490
  tries semantic search and falls back to keyword search on its own. A fix shows
476
491
  here after the next `akm index`. `evidence` carries the recorded `status`,
@@ -811,7 +826,10 @@ contends with a full `akm index` rebuild in progress.
811
826
 
812
827
  Display an asset by ref. On a markdown document `#fragment` selects one
813
828
  section by heading slug (falling back to case-insensitive heading text); an
814
- unmatched fragment lists the available slugs.
829
+ unmatched fragment lists the available slugs. For a large document, read the
830
+ outline first and then only the sections you need: `akm show <ref> --detail
831
+ brief` returns the document's `toc` without the body, and `akm show
832
+ <ref>#<slug>` returns one section.
815
833
 
816
834
  ```sh
817
835
  akm show scripts/deploy.sh
@@ -819,7 +837,8 @@ akm show skills/code-review
819
837
  akm show agents/architect
820
838
  akm show commands/release
821
839
  akm show workflows/ship-release
822
- akm show knowledge/guide # the whole document
840
+ akm show knowledge/guide # the whole document, plus its toc
841
+ akm show knowledge/guide --detail brief # the outline (toc), no body
823
842
  akm show knowledge/guide#authentication # just that section
824
843
  akm show '<search-result-ref>' --context lead --max-tokens 800
825
844
  akm show knowledge/guide#nope # lists the available fragment slugs
@@ -868,6 +887,17 @@ reduced metadata-first view without `content`/`template`/`prompt`;
868
887
  including `ref`/`path`/`editable`, plus the optional fragment metadata
869
888
  described below.
870
889
 
890
+ `toc` is the outline of a whole Markdown document (knowledge, and every other
891
+ Markdown asset whose `#fragment` selects a section): one
892
+ `{ "level", "text", "slug", "startLine" }` entry per heading, in order, at every
893
+ `--detail` level, `brief` and `agent` included. `slug` is exactly what
894
+ `<ref>#<slug>` selects, duplicate headings included (`notes`, `notes-1`, ...),
895
+ and `startLine` is the heading's 1-based line in the file. It is read from the
896
+ same file the section is cut from, so it never lists a slug the show cannot
897
+ resolve. It is omitted for non-Markdown assets, for documents with no headings,
898
+ and for a fragment show (`<ref>#<slug>`). `--format text` prints it as a
899
+ `toc:` block.
900
+
871
901
  `links` lists the asset's declared links, grouped by kind: `outgoing` (the
872
902
  assets its own `xrefs:`, `supersededBy:`, `contradictedBy:`,
873
903
  `currentBeliefRefs:`, wiki `sources:`, `.derived` parent, page links, or
@@ -933,7 +963,7 @@ Returns type-specific payloads:
933
963
  | skill | `content` (full SKILL.md) |
934
964
  | command | `template`, `description` |
935
965
  | agent | `prompt`, `description`, `modelHint` |
936
- | knowledge | `content` — the whole document, or one section via `#fragment` |
966
+ | knowledge | `content` — the whole document, or one section via `#fragment`; `toc` on a whole document |
937
967
  | workflow | `workflowTitle`, `workflowParameters`, `steps` (each step's `orchestration` summary names its `engine` (the connection or harness it runs on) and model, or — for an [exec step](https://github.com/itlackey/akm/blob/main/docs/reference/workflow-schema.md#what-akm-show-reports-for-an-exec-step) — its `exec.command` and no engine at all) |
938
968
  | memory | `content` |
939
969
  | env | `keys` (key names only — values and comment text never returned) |
@@ -690,21 +690,43 @@ semantic search is disabled or has not been built. A read-only sandbox that
690
690
  cannot record best-effort usage telemetry does not by itself mark search as
691
691
  degraded.
692
692
  The local embedder runs its model (`Xenova/bge-small-en-v1.5` unless
693
- `embedding.localModel` names another) on `onnxruntime-node`, with
694
- `@huggingface/tokenizers` for the token ids. Both are normal dependencies of the
695
- package, imported directly; AKM does not carry a copied runtime under `src/` or
696
- `dist/`. The model's four files (about 127 MB) are fetched from the Hugging Face
697
- Hub on first use into `$HF_HOME/<repo>/` (default `<cache dir>/models`), and
698
- `HF_HUB_OFFLINE=1` forbids the fetch. `akm index --format json` reports the
699
- runtime it embedded with as `verification.embeddingRuntime`.
700
- If the runtime cannot load, because the dependency is missing or the platform
701
- has no native ONNX Runtime library (Alpine/musl, Intel macOS), the index reports
702
- semantic search `blocked` with the reason and search stays keyword-only:
703
- reinstall `akm-cli` for a missing dependency, or configure a remote
704
- `embedding.endpoint`. A standalone binary copies the library it embeds once into
705
- `<cache dir>/onnxruntime/` (see
706
- [Getting Started](../guides/getting-started.md#standalone-binary-and-semantic-search)).
707
- Setup does not mutate a global installation to add runtime packages.
693
+ `embedding.localModel` names another) on ONNX Runtime, through
694
+ `onnxruntime-node`'s native binding, with `@huggingface/tokenizers` for the token
695
+ ids. akm offers local embeddings on Linux x64 (glibc) and Apple-silicon
696
+ macOS; on every other platform semantic search uses an embedding endpoint or
697
+ stays keyword-only. akm does not install `onnxruntime-node`:
698
+ `akm setup --embedding local` (or the wizard's built-in embedder) downloads that
699
+ package's binding and library for this platform once from the npm registry
700
+ (about 86 MB; the registry's sha512 integrity is checked before anything is
701
+ extracted) into `<cache dir>/onnxruntime/<version>-<platform>-<arch>/`, and the
702
+ first local embedding downloads them when setup did not. The model's four files
703
+ (about 127 MB) come from the Hugging Face Hub the same way, into
704
+ `$HF_HOME/<repo>/` (default `<cache dir>/models`); `HF_HUB_OFFLINE=1` forbids
705
+ that download. `akm index --format json` reports the runtime it embedded with as
706
+ `verification.embeddingRuntime`. If the runtime cannot be downloaded or does not
707
+ load (the cache directory is mounted `noexec`), the index reports semantic search
708
+ `blocked` with the reason and search stays keyword-only. On a platform without
709
+ local embeddings, `akm setup` offers an endpoint or keyword search,
710
+ `--embedding local` warns and saves keyword search, and a config that turns
711
+ semantic search on anyway gets it reported unavailable for the platform by the
712
+ index and a warning from `akm health`.
713
+
714
+ **Without network access**, fill akm's cache directory (`akm info` prints
715
+ `cacheDir`; `AKM_CACHE_DIR` moves it) before the first `akm index`:
716
+
717
+ - `onnxruntime/<version>-<platform>-<arch>/` (for example
718
+ `onnxruntime/1.24.3-linux-x64/`) holding `onnxruntime_binding.node` and the
719
+ library it links (`libonnxruntime.so.1` on Linux,
720
+ `libonnxruntime.1.24.3.dylib` on macOS). Take both from
721
+ `package/bin/napi-v6/<platform>/<arch>/` in the `onnxruntime-node@1.24.3`
722
+ tarball (`npm pack onnxruntime-node@1.24.3`), or copy the folder from a
723
+ connected machine of the same platform after
724
+ `akm setup --yes --embedding local`.
725
+ - `models/Xenova/bge-small-en-v1.5/` holding `tokenizer.json`,
726
+ `tokenizer_config.json`, `config.json` and `onnx/model.onnx`, or set `HF_HOME`
727
+ to a directory that holds them and `HF_HUB_OFFLINE=1`.
728
+ - `opencode/2.1.4/opencode` (`opencode.exe` on Windows) for akm's own agent
729
+ runtime.
708
730
  The default is `"off"` so a bare or headless install (`akm bundle create`, `--yes`,
709
731
  `--config`) never silently downloads the local embedding model on first
710
732
  index. A config that has an `embedding` block and sets no `semanticSearchMode`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akm-cli",
3
- "version": "0.10.261014-beta",
3
+ "version": "0.10.261016-beta",
4
4
  "type": "module",
5
5
  "description": "akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cursor.",
6
6
  "keywords": [
@@ -34,9 +34,8 @@
34
34
  },
35
35
  "license": "MPL-2.0",
36
36
  "pinNotes": {
37
- "better-sqlite3@12.11.1": "Exact pin (#790). This is the SQLite driver akm loads on Node (src/storage/database.ts); Bun never touches it. The pin is about PREBUILT BINARIES, not API surface. better-sqlite3 ships one prebuild per Node ABI as a GitHub release asset and its install script is `prebuild-install || node-gyp rebuild` — so any (version, Node ABI) pair with no prebuild silently COMPILES FROM SOURCE against the headers of whatever Node is on the machine that day. The 11.x line predates Node 24 and declares no `engines` at all: its newest release (11.10.0, 2025-05-08) publishes ABI 108/115/127/131 (Node 18/20/22/23) and nothing for ABI 137 (Node 24). Node 24.19.0 then changed the public `node_object_wrap.h` so `node::ObjectWrap`'s ctor/dtor register and unregister an environment cleanup hook; a from-source 11.x build against those headers aborts at teardown in `Statement::~Statement()` with `RemoveEnvironmentCleanupHook ... Assertion (env) != nullptr`, intermittently, depending on GC timing. 12.11.1 publishes ABI 127/137/141/147 (Node 22/24/25/26) and declares `engines: 20.x || 22.x || 23.x || 24.x || 25.x || 26.x`, so every Node akm supports installs a prebuilt binary and never compiles. Before bumping: confirm the target version publishes a prebuild for EVERY Node major in `engines` (probe https://github.com/WiseLibs/better-sqlite3/releases/download/vX.Y.Z/better-sqlite3-vX.Y.Z-node-vABI-linux-x64.tar.gz), not just that the version is newer. 13.x is the eventual destination — it moved to node-addon-api/N-API with prebuilds bundled in the npm tarball and no install script, which retires this failure mode entirely — but it is a fresh major rewrite of the binding, so it wants its own soak, not a patch release. The CI node-smoke job installs this exact string by reading it back out of this file (.github/workflows/ci.yml), so the two cannot drift.",
37
+ "better-sqlite3@13.0.3": "Exact pin. The SQLite driver akm loads on Node (src/storage/database.ts); Bun uses bun:sqlite and never loads it. 13.x is built on N-API (node-addon-api), so one binding per platform serves every Node version, and the npm tarball carries those bindings prebuilt in prebuilds/ for Linux (glibc and musl) and macOS on x64 and arm64 and for Windows on x64 and arm64. It declares no install script and sets gypfile: false, so it installs the same where npm runs install scripts and where it does not (npm 12 blocks dependency scripts by default). Not covered: 32-bit ARM Linux (linux-arm, linuxmusl-arm), which 12.x served only through its install script; akm under Node has no SQLite driver there. `bun install` tries to build it anyway (Bun ignores gypfile: false for a trusted package) and, as an optional dependency, drops it silently when that fails, which is why CI installs it with npm. This replaced 12.11.1, whose binding came per Node ABI from its install script (`prebuild-install || node-gyp rebuild`, #790); the earlier note asked for a soak before 13.x, and 13.0.3 soaks through the 0.10 betas instead. Before bumping: the tarball must still carry prebuilds/ for every platform above and declare no install script, and the CI node-smoke job, which installs this exact string read back out of this file (.github/workflows/ci.yml), must pass on every Node major in engines.",
38
38
  "@huggingface/tokenizers@0.1.3": "Exact pin: the tokenizer of the local embedding model (src/llm/embedders/local.ts). Pure JS with no dependencies. A different release can change the token ids and with them every stored vector, so re-run the real-model semantic gate (tests/integration/semantic-search-e2e.test.ts, which compares the vectors with tests/fixtures/embedder-reference-vectors.json) before changing it.",
39
- "onnxruntime-node@1.24.3": "Exact pin: the local embedding runtime. The standalone binary embeds this version's native library from node_modules/onnxruntime-node/bin/napi-v6/ (src/standalone/native/) and its addon is bound to exactly that library, so a bump moves this pin, the library file names in src/standalone/native/ (the macOS one carries the version), the list of platforms it ships a library for in src/llm/embedders/local.ts and the real-model semantic gate together.",
40
39
  "ajv@8.20.0": "Exact pin (devDependency, used only by tests: tests/tasks-schema.test.ts validates task sources against schemas/akm-task.json, tests/contracts/config-schema-drift.test.ts checks schemas/akm-config.json). Pinned in 4d7d77992 without a recorded reason; keep exact until the pin is next reviewed.",
41
40
  "cmd-shim@9.0.2": "Exact pin (devDependency), from cd5a3be12 \"pin cmd-shim for launcher tests\": tests/integration/install/package-launcher.test.ts writes the Windows shims npm would write with this package, where it used to load the copy inside the installed npm's own node_modules. That commit records no reason for an exact version over a range; keep exact until the pin is next reviewed."
42
41
  },
@@ -72,11 +71,11 @@
72
71
  "akm-migrate": "dist/akm-migrate"
73
72
  },
74
73
  "scripts": {
75
- "preinstall": "node -e \"var v=(process.versions.node||'0').split('.').map(function(n){return parseInt(n,10)||0});var ok=v[0]>=22;if(ok){process.exit(0)}console.error('\\n ERROR: the akm-cli npm package requires Node.js >= 22.\\n A working Bun >= 1.0 on PATH is optional and preferred for akm and akm-migrate.\\n Upgrade Node.js (https://nodejs.org), or install the runtime-free standalone binary:\\n curl -fsSL https://github.com/itlackey/akm/releases/latest/download/install.sh | bash\\n');process.exit(1)\"",
76
74
  "build": "rm -rf dist && bun scripts/gen-config-schema.ts &&bun run tsc --project ./tsconfig.build.json && bun scripts/copy-assets.ts && bun scripts/fix-esm-extensions.ts",
77
75
  "check": "bun run lint && bunx tsc --noEmit && bun run test:unit && bun run test:integration",
78
76
  "check:fast": "bun run lint && bunx tsc --noEmit && bun run test:unit",
79
77
  "check:changed": "bun run lint && bunx tsc --noEmit && bun test tests/integration/output-baseline.test.ts tests/integration/registry/registry-search.test.ts tests/integration/show-argv-entrypoint.test.ts tests/output-shapes-unit.test.ts",
78
+ "check:ci": "bash scripts/check-like-ci.sh",
80
79
  "sweep:tmp": "bun scripts/sweep-test-tmp.ts",
81
80
  "test": "bash scripts/test-unit.sh",
82
81
  "test:unit": "bash scripts/test-unit.sh",
@@ -105,11 +104,10 @@
105
104
  "ajv": "8.20.0",
106
105
  "bun-types": "^1.3.13",
107
106
  "cmd-shim": "9.0.2",
108
- "typescript": "^5.9.3",
109
- "zod-to-json-schema": "^3.23.0"
107
+ "typescript": "^5.9.3"
110
108
  },
111
109
  "optionalDependencies": {
112
- "better-sqlite3": "12.11.1",
110
+ "better-sqlite3": "13.0.3",
113
111
  "sqlite-vec": "^0.1.9"
114
112
  },
115
113
  "engines": {
@@ -123,10 +121,9 @@
123
121
  "fast-xml-parser": "^5.10.1",
124
122
  "marked": "^18.1.1",
125
123
  "node-html-parser": "^9.0.1",
126
- "onnxruntime-node": "1.24.3",
127
124
  "semver": "^7.6.0",
128
125
  "turndown": "^7.2.4",
129
126
  "yaml": "^2.8.4",
130
- "zod": "^3.23.0"
127
+ "zod": "^4.6.6"
131
128
  }
132
129
  }