akm-cli 0.4.1 → 0.5.0-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,232 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.5.0] - 2026-04-22
10
+
11
+ ### Added
12
+
13
+ - **Multi-wiki support** (#119, #121): new `wiki` asset type with nine CLI verbs under `akm wiki …` (`create`, `list`, `show`, `remove`, `pages`, `search`, `stash`, `lint`, `ingest`). Each wiki lives at `<stashDir>/wikis/<name>/` with `schema.md`, `index.md`, `log.md`, `raw/`, and agent-authored pages. Wiki pages are first-class in stash-wide `akm search`. `akm index` regenerates each wiki's `index.md` as a side effect. See `docs/wikis.md` for the full guide. Design principle: **akm surfaces, the agent writes** — no LLM calls, no network access; akm owns only operations with invariants an agent can't reliably enforce (lifecycle, raw-slug uniqueness, structural lint, index regeneration, workflow discovery).
14
+ - **Workflow asset type** (#118): new `workflow` type with `akm workflow create <name>` and `akm workflow next <ref>` for authoring and stepping through multi-step workflows stored in the stash
15
+ - **Vault asset type** (#117): new `vault` type backed by `.env` files; `akm vault` subcommand with `list`, `show`, `load` (emits a `source` snippet for the current shell); values never appear in structured output
16
+ - **`--trust` flag for installs**: `akm add <source> --trust` performs a one-off trusted install, bypassing the install audit for that source
17
+ - **Writable git stash + `akm save`** (#114): `akm add … --writable` opts a remote git-backed stash into push-on-save; `akm save [name] [-m message]` commits (and pushes when writable + remote is set); default stash is auto-initialized as a git repo; git stash provider now uses `git clone` instead of HTTP tarball download
18
+
19
+ ### Removed (breaking)
20
+
21
+ - The unreleased single-wiki LLM POC: removes `akm lint` command, `akm import --llm` / `--dry-run` flags, `knowledge.pageKinds` config, and the `ingestKnowledgeSource` / `lintKnowledge` LLM prompts. Users of the POC should migrate to the new `akm wiki …` surface; raw content can be manually moved to `wikis/<name>/raw/`.
22
+
23
+ ## [0.4.1] - 2026-04-21
24
+
25
+ ### Added
26
+
27
+ - **`akm enable` / `akm disable`** (#108): toggle optional components (`skills.sh`, `context-hub`) on/off without manually editing config
28
+ - **`akm remember` and `akm import` commands** (#110): capture in-session knowledge directly from the CLI; `akm remember` records a memory to the default stash (supports stdin); `akm import` ingests a file or stdin as a knowledge asset
29
+ - **Karpathy-style wiki workflow in knowledge assets** (#113): `akm show knowledge:<doc>` now surfaces an `ingest` workflow for knowledge documents; `--dry-run` flag added; `pageKind` taxonomy made extensible
30
+ - Documentation: expanded `agent-install.md`, added `info` and `feedback` command docs, global flags reference (#106)
31
+
32
+ ### Fixed
33
+
34
+ - Remote embedding endpoint URL normalization — trailing slashes and path segments now handled correctly (#112)
35
+ - Reduced fallback capture-name collisions in `akm remember`
36
+
37
+ ## [0.4.0] - 2026-04-19
38
+
39
+ ### Added
40
+
41
+ - **Install security audit**: new pre-install scanner inspects kit contents for dangerous patterns and executable scripts before install; configurable via `config` CLI
42
+ - **Project-level config stash merging**: `.akm.json` in a project directory merges its stash/registry entries with user config during CLI runs
43
+ - **Disable inherited project stashes**: project config can disable stashes inherited from parent/user scopes
44
+ - **`akm curate` command**: new subcommand for curating assets from the stash (initial skeleton)
45
+
46
+ ### Fixed
47
+
48
+ - Index nested agent markdown files as agents so `akm search agent:...` finds them
49
+ - `install-audit` now reads at most `MAX_SCANNED_FILE_BYTES` per file using `Buffer.alloc`, with the file descriptor always closed via `try/finally`, and corrects the `scannedBytes` counter
50
+
51
+ ## [0.3.1] - 2026-04-01
52
+
53
+ ### Added
54
+
55
+ - **Website stash provider**: add a URL directly as a stash source with `akm stash add <url>`; crawls the site and indexes pages as knowledge assets
56
+ - Website provider options: `--max-pages` and `--depth` flags to bound crawling
57
+
58
+ ### Fixed
59
+
60
+ - Relaxed HTTP warnings for localhost website sources
61
+ - Addressed review feedback around website provider routing and security heuristics
62
+
63
+ ## [0.3.0] - 2026-03-30
64
+
65
+ ### Added
66
+
67
+ - Regression tests for vector/semantic search readiness, install, and setup flows
68
+ - `CONTRIBUTING.md` and "Why akm" section in documentation
69
+ - Three draft SEO blog posts
70
+
71
+ ### Changed
72
+
73
+ - **Unified source model**: replaced the `kit` vs `stash` split with a single source concept; `akm add` works for all source types
74
+ - Removed `stash` and `kit` subcommand groups; their behaviors fold into the top-level CLI (`akm list`, `akm add`, etc.)
75
+ - Refactored semantic search readiness tracking for clearer state transitions
76
+ - Aligned documentation voice and updated older posts for the current CLI surface
77
+
78
+ ### Fixed
79
+
80
+ - Embedding fingerprint is purged on model change and `usage_events` are re-linked correctly
81
+ - Local embedder dtype selection
82
+ - Release validation workflow
83
+ - Prereleases (versions with suffixes) are marked as such on GitHub releases and published to npm with `--tag next`
84
+
85
+ ## [0.2.2] - 2026-03-28
86
+
87
+ ### Fixed
88
+
89
+ - Binary install detection in `akm upgrade` self-update; centralized `AKM_VERSION` declaration with binary detection tests
90
+
91
+ ## [0.2.1] - 2026-03-25
92
+
93
+ ### Added
94
+
95
+ - Docker-based install tests covering multiple OS configurations (skipped in CI)
96
+ - Detailed error reporting in embedding availability checks
97
+ - Actionable guidance when `sqlite-vec` fails to open the DB
98
+
99
+ ### Changed
100
+
101
+ - **Rename**: project renamed from `Agent-i-Kit` to `akm` across docs and links
102
+ - Local embeddings switched to `@huggingface/transformers`
103
+ - `@huggingface/transformers` moved to `optionalDependencies`, then promoted to a runtime dependency
104
+ - Improved semantic search setup and index UX
105
+
106
+ ## [0.2.0] - 2026-03-18
107
+
108
+ ### Added
109
+
110
+ - **Extensible asset type system**: `AkmAssetType` (formerly `AgentIKitAssetType`) is now `string` instead of a fixed union; new types can be registered at runtime via `registerAssetType()`
111
+ - **Memory asset type**: built-in `memory` type stored in `memories/`, with `memory-md` renderer and directory/parent-dir-hint matchers
112
+ - **OpenViking stash provider**: `openviking` provider type for searching OpenViking servers via REST; add with `akm stash add <url> --provider openviking`
113
+ - **Remote show for `viking://` URIs**: `akm show viking://resources/my-doc` fetches content directly from an OpenViking server (returns `editable: false`)
114
+ - **`--options` flag** for `akm registry add` and `akm stash add`: pass provider-specific JSON config (e.g., `--options '{"apiKey":"key"}'`)
115
+ - **`akm registry build-index` command**: generates a v2 registry index JSON from npm/GitHub discovery with `--out`, `--manual`, `--npmRegistry`, `--githubApi`, and `--format` flags
116
+ - Exact-name match, type-relevance, and alias boosts in the search scoring pipeline
117
+ - Ranking regression tests with a synthetic fixture stash and a 41-case benchmark suite (MRR / Recall@5)
118
+ - `estimatedTokens` on context-hub provider search results and in `--for-agent` output
119
+ - Architecture docs and test fixture for OpenViking manual testing (`tests/fixtures/openviking/`)
120
+
121
+ ### Changed
122
+
123
+ - Unified context-hub indexing and fair provider scoring: local FTS scores are preserved everywhere and remote provider scores compete on equal footing
124
+ - Replaced RRF with normalized BM25 scoring across all merge paths
125
+ - EMA utility decay is now time-proportional instead of tied to index frequency
126
+ - Replaced the `(Bun as any).YAML` hack with a proper `yaml` package dependency
127
+ - YAML output format fixed; local registry refs now use a `file:` prefix
128
+
129
+ ### Removed
130
+
131
+ - `manifest` subcommand (adds no value over `search`)
132
+ - URI schemes (`viking://`, `context-hub://`) from user-facing refs — assets are addressed as `type:name`; sources use URLs
133
+ - Stale audit/ergonomics markdown from the repo
134
+
135
+ ### Fixed
136
+
137
+ - `skills.sh` install refs now produce valid `akm add` commands (#82)
138
+ - Prevented `akm remove` and `akm update --force` from deleting user-owned local source directories installed via path refs
139
+ - `usage_events` reverted to `DELETE` on full reindex
140
+
141
+ ## [0.1.0] - 2026-03-10
142
+
143
+ Major internal overhaul and rebrand. This release simplifies the asset model,
144
+ cleans up the CLI surface, and renames the package from `agent-i-kit` to `akm-cli`.
145
+
146
+ ### Added
147
+
148
+ - `--verbose` flag on `search` for detailed scoring output
149
+ - ExecHints system (`run`, `cwd`, `setup`) for script assets, replacing the old tool-runner
150
+ - New environment variable overrides: `AKM_CONFIG_DIR`, `AKM_CACHE_DIR`, `AKM_STASH_DIR`
151
+ - CI workflow running lint, type-check, and tests on every push/PR
152
+ - Biome linter and formatter configuration
153
+ - README badges (npm version, CI status, license)
154
+
155
+ ### Changed
156
+
157
+ - **Rebrand**: npm package `agent-i-kit` renamed to `akm-cli`; binary remains `akm`
158
+ - **Rebrand**: config field `"agent-i-kit"` renamed to `"akm"` in `package.json`
159
+ - **Rebrand**: plugin `agent-i-kit-opencode` renamed to `akm-opencode`
160
+ - **Rebrand**: registry `agent-i-kit-registry` renamed to `akm-registry`
161
+ - **Rebrand**: default paths changed (`~/agent-i-kit` to `~/akm`, `~/.config/agent-i-kit` to `~/.config/akm`)
162
+ - **Rebrand**: environment variables `AGENT_I_KIT_*` renamed to `AKM_*`
163
+ - Removed `tool` asset type entirely; `script` is the only script-like type
164
+ - `.stash.json` field renames: `intents` to `searchHints`, `entry` to `filename`; removed `generated` boolean
165
+ - `show` command: `--view` flag replaced with positional syntax (`akm show <ref> toc`)
166
+ - Collapsed `AssetTypeHandler` handlers into a unified renderer pipeline
167
+ - Dropped provider presets (raw JSON config only)
168
+ - Pinned `sqlite-vec` to exact version `0.1.7-alpha.2` (removed caret range)
169
+ - Replaced `(Bun as any).YAML` cast with proper type guard in CLI
170
+ - Version now injected at compile time via `--define AKM_VERSION` with safe runtime fallback
171
+
172
+ ### Removed
173
+
174
+ - `submit` command
175
+ - Provider presets (configure providers with raw JSON)
176
+ - `generated` boolean from `.stash.json`
177
+
178
+ ### Fixed
179
+
180
+ - CLI crash on macOS when running as compiled binary (`package.json` not embedded)
181
+ - Cleaned up search output formatting
182
+
183
+ ## [0.0.17] - 2026-03-12
184
+
185
+ Registry refactor and documentation overhaul. This release introduces a
186
+ first-class registry management CLI, modernizes the config schema, and
187
+ rewrites all documentation against the final asset model.
188
+
189
+ ### Added
190
+
191
+ - `akm registry` subcommand group with `list`, `add`, `remove`, and `search` subcommands
192
+ - `akm registry search --assets` flag for asset-level search against v2 registry indexes
193
+ - `registries` config field (`RegistryConfigEntry[]`) with `url`, `name`, and `enabled` properties
194
+ - Registry Index v2 schema with optional `assets` array on kit entries for asset-level discovery
195
+ - Official registry pre-configured by default in new installations
196
+ - Type names: `KitSource`, `InstalledKitEntry`, `KitInstallResult`, `KitInstallStatus`, `InstalledKitListEntry`
197
+
198
+ ### Changed
199
+
200
+ - Config: `installed` is now a top-level field (`config.installed`) instead of nested under `config.registry.installed`
201
+ - Config: registry URLs configured via `registries` array instead of `registryUrls`
202
+ - Documentation: complete rewrite of concepts, registry, CLI reference, README, and all technical docs
203
+ - Documentation: added "Mental Model" (registries --> kits --> stash --> assets) to concepts
204
+ - Documentation: added asset classification taxonomy description
205
+ - Documentation: merged ref format documentation into concepts (removed "opaque handle" framing)
206
+ - Documentation: revised apt analogy in core principles to map registries, kits, stash, and assets
207
+ - Documentation: added `akm registry` subcommand group to CLI reference
208
+ - Documentation: added registry hosting and v2 index format guides
209
+
210
+ ### Removed
211
+
212
+ - `tool` asset type (fully removed across all documentation and code)
213
+ - `registryUrls` config field (replaced by `registries`)
214
+ - `config.registry.installed` nesting (replaced by `config.installed`)
215
+ - All `tools/` directory references from documentation
216
+
217
+ ## [0.0.13] - 2026-03-09
218
+
219
+ Initial public release of Agent-i-Kit (`akm` CLI).
220
+
221
+ ### Added
222
+
223
+ - CLI tool (`akm`) for searching, showing, and running Agent-i-Kit stash assets
224
+ - Hybrid search with FTS5 full-text and optional vector similarity scoring
225
+ - Registry support for discovering, installing, and updating community kits
226
+ - Multiple install sources: npm, GitHub, git URLs, and local directories
227
+ - Self-update via `akm upgrade`
228
+ - Multiple output formats: plain text, YAML, and JSON (`--json`)
229
+ - Knowledge asset navigation with TOC, section, and line-range views
230
+ - `akm clone` to fork installed assets into your working stash
231
+ - Configuration system with embedding and LLM provider management
232
+ - Standalone binary distribution (no runtime dependencies)
@@ -10,6 +10,7 @@
10
10
  * `local-search.ts` import from, eliminating the import-order dependency
11
11
  * entirely.
12
12
  */
13
+ import { buildWorkflowAction } from "./renderers";
13
14
  /** Map asset types to their primary renderer names. */
14
15
  export const TYPE_TO_RENDERER = {
15
16
  script: "script-source",
@@ -18,6 +19,9 @@ export const TYPE_TO_RENDERER = {
18
19
  agent: "agent-md",
19
20
  knowledge: "knowledge-md",
20
21
  memory: "memory-md",
22
+ workflow: "workflow-md",
23
+ vault: "vault-env",
24
+ wiki: "wiki-md",
21
25
  };
22
26
  /** Map asset types to action builder functions for search results. */
23
27
  export const ACTION_BUILDERS = {
@@ -27,6 +31,9 @@ export const ACTION_BUILDERS = {
27
31
  agent: (ref) => `akm show ${ref} -> dispatch with full prompt`,
28
32
  knowledge: (ref) => `akm show ${ref} -> read reference material`,
29
33
  memory: (ref) => `akm show ${ref} -> recall context`,
34
+ workflow: (ref) => buildWorkflowAction(ref),
35
+ vault: (ref) => `akm vault list ${ref} -> see key names; eval "$(akm vault load ${ref})" -> load values into the current shell (values never echoed)`,
36
+ wiki: (ref) => `akm show ${ref} -> read the wiki page`,
30
37
  };
31
38
  /**
32
39
  * Register a type-to-renderer mapping.
@@ -1,6 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { registerActionBuilder, registerTypeRenderer } from "./asset-registry";
3
3
  import { toPosix } from "./common";
4
+ import { buildWorkflowAction } from "./renderers";
4
5
  const markdownSpec = {
5
6
  isRelevantFile: (fileName) => path.extname(fileName).toLowerCase() === ".md",
6
7
  toCanonicalName: (typeRoot, filePath) => {
@@ -53,8 +54,42 @@ const ASSET_SPECS_INTERNAL = {
53
54
  command: { stashDir: "commands", ...markdownSpec },
54
55
  agent: { stashDir: "agents", ...markdownSpec },
55
56
  knowledge: { stashDir: "knowledge", ...markdownSpec },
57
+ workflow: {
58
+ stashDir: "workflows",
59
+ ...markdownSpec,
60
+ rendererName: "workflow-md",
61
+ actionBuilder: (ref) => buildWorkflowAction(ref),
62
+ },
56
63
  script: { stashDir: "scripts", ...scriptSpec },
57
64
  memory: { stashDir: "memories", ...markdownSpec },
65
+ vault: {
66
+ stashDir: "vaults",
67
+ isRelevantFile: (fileName) => fileName === ".env" || fileName.endsWith(".env"),
68
+ toCanonicalName: (typeRoot, filePath) => {
69
+ const rel = toPosix(path.relative(typeRoot, filePath));
70
+ const fileName = path.basename(rel);
71
+ // Treat ".env" as the "default" vault; "<name>.env" → "<name>"
72
+ if (fileName === ".env") {
73
+ const dir = path.dirname(rel);
74
+ return dir === "." || dir === "" ? "default" : `${dir}/default`;
75
+ }
76
+ const stripped = rel.endsWith(".env") ? rel.slice(0, -4) : rel;
77
+ return stripped;
78
+ },
79
+ toAssetPath: (typeRoot, name) => {
80
+ if (name === "default")
81
+ return path.join(typeRoot, ".env");
82
+ return path.join(typeRoot, name.endsWith(".env") ? name : `${name}.env`);
83
+ },
84
+ rendererName: "vault-env",
85
+ actionBuilder: (ref) => `akm vault list ${ref} -> see key names; eval "$(akm vault load ${ref})" -> load values into the current shell (values never echoed)`,
86
+ },
87
+ wiki: {
88
+ stashDir: "wikis",
89
+ ...markdownSpec,
90
+ rendererName: "wiki-md",
91
+ actionBuilder: (ref) => `akm show ${ref} -> read the wiki page`,
92
+ },
58
93
  };
59
94
  export const ASSET_SPECS = ASSET_SPECS_INTERNAL;
60
95
  /**