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
@@ -1,52 +0,0 @@
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 ONNX Runtime shared library for a compiled standalone binary.
6
- *
7
- * `onnxruntime-node`'s addon links a shared library that sits beside it in the
8
- * package. A Bun executable extracts an embedded addon at load but not the
9
- * library it links, so the addon cannot start. The standalone build embeds the
10
- * library for its target (`src/standalone/native/`, chosen by
11
- * `scripts/build-standalone.ts`); this copies it once into akm's cache and
12
- * loads it with `bun:ffi`, after which the addon's own link to it is already
13
- * satisfied.
14
- *
15
- * Outside a standalone binary (`bun src/cli.ts`, the Node build) nothing here
16
- * is defined and nothing is evaluated: the package's own files are used.
17
- */
18
- import fs from "node:fs";
19
- import path from "node:path";
20
- import { getCacheDir } from "../core/paths.js";
21
- /**
22
- * Put the embedded library on disk and load it, before `onnxruntime-node` is
23
- * imported. Throws when the library cannot be loaded; the caller reports that
24
- * as the embedding runtime being unavailable.
25
- */
26
- export async function preloadOnnxRuntimeLibrary() {
27
- if (typeof AKM_STANDALONE_NATIVE_MODULE === "undefined")
28
- return;
29
- // The specifier is a build constant, so the standalone build bundles this one module and no other build bundles any.
30
- const { embeddedPath, fileName } = (await import(AKM_STANDALONE_NATIVE_MODULE));
31
- if (!embeddedPath || !fileName)
32
- return;
33
- const directory = path.join(getCacheDir(), "onnxruntime", `${AKM_ONNXRUNTIME_VERSION}-${process.platform}-${process.arch}`);
34
- const library = path.join(directory, fileName);
35
- const size = fs.statSync(embeddedPath).size;
36
- if (!fs.existsSync(library) || fs.statSync(library).size !== size) {
37
- fs.mkdirSync(directory, { recursive: true });
38
- const partial = `${library}.${process.pid}.tmp`;
39
- fs.writeFileSync(partial, fs.readFileSync(embeddedPath));
40
- try {
41
- fs.renameSync(partial, library);
42
- }
43
- catch (error) {
44
- // Another akm process copied it first and has it loaded, which Windows will not replace: use that copy.
45
- fs.rmSync(partial, { force: true });
46
- if (!fs.existsSync(library) || fs.statSync(library).size !== size)
47
- throw error;
48
- }
49
- }
50
- const { dlopen } = await import("bun:ffi");
51
- dlopen(library, { OrtGetApiBase: { args: [], returns: "ptr" } });
52
- }