akm-cli 0.9.0-beta.4 → 0.9.0-beta.41
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 +646 -0
- package/dist/assets/prompts/consolidate-system.md +23 -0
- package/dist/assets/prompts/contradiction-judge.md +33 -0
- package/dist/assets/prompts/distill-knowledge-system.md +22 -0
- package/dist/assets/prompts/distill-lesson-system.md +36 -0
- package/dist/assets/prompts/extract-session.md +6 -2
- package/dist/assets/prompts/graph-extract-system.md +1 -0
- package/dist/assets/prompts/memory-infer-system.md +1 -0
- package/dist/assets/prompts/memory-infer-user.md +5 -0
- package/dist/assets/prompts/metadata-enhance-system.md +1 -0
- package/dist/assets/prompts/procedural-system.md +44 -0
- package/dist/assets/prompts/recombine-system.md +40 -0
- package/dist/assets/prompts/staleness-detect-system.md +6 -0
- package/dist/assets/prompts/validate-summary-judge.md +1 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/agent.md +22 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/command.md +22 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/fact.md +24 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/knowledge.md +22 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/lesson.md +25 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/memory.md +21 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/script.md +21 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/skill.md +23 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/workflow.md +22 -0
- package/dist/assets/templates/html/health.html +281 -111
- package/dist/cli.js +14 -3
- package/dist/commands/agent/contribute-cli.js +16 -3
- package/dist/commands/feedback-cli.js +15 -6
- package/dist/commands/graph/graph.js +75 -71
- package/dist/commands/health/checks.js +48 -0
- package/dist/commands/health/html-report.js +422 -80
- package/dist/commands/health.js +381 -9
- package/dist/commands/improve/calibration.js +161 -0
- package/dist/commands/improve/consolidate.js +631 -111
- package/dist/commands/improve/dedup.js +482 -0
- package/dist/commands/improve/distill.js +163 -69
- package/dist/commands/improve/encoding-salience.js +205 -0
- package/dist/commands/improve/extract-cli.js +115 -1
- package/dist/commands/improve/extract-prompt.js +39 -2
- package/dist/commands/improve/extract-watch.js +140 -0
- package/dist/commands/improve/extract.js +403 -40
- package/dist/commands/improve/feedback-valence.js +54 -0
- package/dist/commands/improve/homeostatic.js +467 -0
- package/dist/commands/improve/improve-auto-accept.js +113 -6
- package/dist/commands/improve/improve-profiles.js +12 -0
- package/dist/commands/improve/improve.js +2042 -612
- package/dist/commands/improve/memory/memory-contradiction-detect.js +23 -28
- package/dist/commands/improve/outcome-loop.js +256 -0
- package/dist/commands/improve/proactive-maintenance.js +115 -0
- package/dist/commands/improve/procedural.js +418 -0
- package/dist/commands/improve/recombine.js +602 -0
- package/dist/commands/improve/reflect-noise.js +0 -0
- package/dist/commands/improve/reflect.js +46 -4
- package/dist/commands/improve/related-sessions.js +120 -0
- package/dist/commands/improve/salience.js +438 -0
- package/dist/commands/improve/triage.js +93 -0
- package/dist/commands/lint/agent-linter.js +19 -24
- package/dist/commands/lint/base-linter.js +173 -60
- package/dist/commands/lint/command-linter.js +19 -24
- package/dist/commands/lint/env-key-rules.js +34 -1
- package/dist/commands/lint/fact-linter.js +39 -0
- package/dist/commands/lint/index.js +31 -13
- package/dist/commands/lint/memory-linter.js +1 -1
- package/dist/commands/lint/registry.js +7 -2
- package/dist/commands/lint/task-linter.js +3 -3
- package/dist/commands/lint/workflow-linter.js +26 -1
- package/dist/commands/proposal/drain-policies.js +5 -0
- package/dist/commands/proposal/drain.js +17 -1
- package/dist/commands/proposal/proposal.js +5 -0
- package/dist/commands/proposal/propose.js +5 -0
- package/dist/commands/proposal/validators/proposal-quality-validators.js +9 -8
- package/dist/commands/proposal/validators/proposals.js +187 -57
- package/dist/commands/read/curate.js +344 -80
- package/dist/commands/read/search-cli.js +7 -0
- package/dist/commands/read/search.js +1 -0
- package/dist/commands/read/show.js +67 -2
- package/dist/commands/sources/init.js +36 -9
- package/dist/commands/sources/installed-stashes.js +5 -1
- package/dist/commands/sources/schema-repair.js +13 -1
- package/dist/commands/sources/stash-cli.js +19 -3
- package/dist/commands/sources/stash-skeleton.js +23 -8
- package/dist/core/asset/asset-registry.js +2 -0
- package/dist/core/asset/asset-spec.js +14 -0
- package/dist/core/asset/frontmatter.js +166 -167
- package/dist/core/asset/markdown.js +8 -0
- package/dist/core/authoring-rules.js +83 -0
- package/dist/core/config/config-schema.js +274 -2
- package/dist/core/config/config.js +2 -2
- package/dist/core/logs-db.js +4 -3
- package/dist/core/paths.js +3 -0
- package/dist/core/standards/resolve-standards-context.js +87 -0
- package/dist/core/standards/resolve-stash-standards.js +99 -0
- package/dist/core/standards/resolve-type-conventions.js +66 -0
- package/dist/core/state-db.js +691 -30
- package/dist/indexer/db/db.js +364 -38
- package/dist/indexer/db/graph-db.js +129 -86
- package/dist/indexer/ensure-index.js +152 -17
- package/dist/indexer/graph/graph-boost.js +51 -41
- package/dist/indexer/graph/graph-extraction.js +203 -3
- package/dist/indexer/index-writer-lock.js +99 -0
- package/dist/indexer/indexer.js +114 -111
- package/dist/indexer/passes/memory-inference.js +10 -3
- package/dist/indexer/passes/staleness-detect.js +2 -5
- package/dist/indexer/search/db-search.js +15 -4
- package/dist/indexer/search/ranking-contributors.js +22 -0
- package/dist/indexer/search/ranking.js +4 -0
- package/dist/indexer/walk/matchers.js +9 -0
- package/dist/integrations/agent/prompts.js +33 -0
- package/dist/integrations/harnesses/claude/session-log.js +11 -1
- package/dist/integrations/harnesses/opencode/session-log.js +173 -3
- package/dist/integrations/session-logs/index.js +16 -0
- package/dist/llm/client.js +23 -4
- package/dist/llm/embedder.js +27 -3
- package/dist/llm/embedders/local.js +66 -2
- package/dist/llm/feature-gate.js +8 -4
- package/dist/llm/graph-extract.js +2 -1
- package/dist/llm/memory-infer.js +4 -8
- package/dist/llm/metadata-enhance.js +9 -1
- package/dist/output/renderers.js +73 -1
- package/dist/output/shapes/curate.js +14 -2
- package/dist/output/text/helpers.js +16 -1
- package/dist/runtime.js +25 -1
- package/dist/scripts/migrate-storage.js +1378 -599
- package/dist/scripts/migrations/import-fs-improve-runs-to-db.js +479 -270
- package/dist/setup/setup.js +3 -3
- package/dist/sources/providers/git.js +71 -61
- package/dist/sources/providers/tar-utils.js +16 -8
- package/dist/storage/sqlite-pragmas.js +146 -0
- package/dist/wiki/wiki.js +37 -0
- package/dist/workflows/db.js +3 -4
- package/dist/workflows/validate-summary.js +2 -7
- package/docs/data-and-telemetry.md +1 -0
- package/package.json +8 -6
|
@@ -1005,6 +1005,15 @@ export function formatCuratePlain(r, detail) {
|
|
|
1005
1005
|
lines.push(` run: ${String(item.run)}`);
|
|
1006
1006
|
if (item.followUp)
|
|
1007
1007
|
lines.push(` show: ${String(item.followUp)}`);
|
|
1008
|
+
if (Array.isArray(item.supportRefs) && item.supportRefs.length > 0) {
|
|
1009
|
+
for (const support of item.supportRefs) {
|
|
1010
|
+
if (!support.ref)
|
|
1011
|
+
continue;
|
|
1012
|
+
const label = typeof support.type === "string" ? `[${support.type}] ` : "";
|
|
1013
|
+
const why = typeof support.reason === "string" ? ` — ${support.reason}` : "";
|
|
1014
|
+
lines.push(` support: ${label}${String(support.ref)}${why}`);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1008
1017
|
if (detail !== "brief" && item.reason)
|
|
1009
1018
|
lines.push(` why: ${String(item.reason)}`);
|
|
1010
1019
|
}
|
|
@@ -1026,8 +1035,14 @@ export function formatCuratePlain(r, detail) {
|
|
|
1026
1035
|
}
|
|
1027
1036
|
export function formatInitPlain(r) {
|
|
1028
1037
|
let out = `Stash initialized at ${r.stashDir ?? "unknown"}`;
|
|
1029
|
-
|
|
1038
|
+
// When --dir scaffolded a secondary stash but the default was deliberately
|
|
1039
|
+
// left untouched, tell the user instead of silently repointing their default.
|
|
1040
|
+
if (r.defaultStashUpdated === false && typeof r.previousStashDir === "string" && r.previousStashDir) {
|
|
1041
|
+
out += `\nYour default stash is unchanged (${r.previousStashDir}). Re-run with --set-default to make ${r.stashDir} the default.`;
|
|
1042
|
+
}
|
|
1043
|
+
else if (r.configPath) {
|
|
1030
1044
|
out += `\nConfig saved to ${r.configPath}`;
|
|
1045
|
+
}
|
|
1031
1046
|
return out;
|
|
1032
1047
|
}
|
|
1033
1048
|
export function formatIndexPlain(r) {
|
package/dist/runtime.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { spawn as nodeSpawn, spawnSync as nodeSpawnSync } from "node:child_process";
|
|
24
24
|
import { createHash } from "node:crypto";
|
|
25
|
-
import { createWriteStream } from "node:fs";
|
|
25
|
+
import { createWriteStream, statfsSync } from "node:fs";
|
|
26
26
|
import { createRequire } from "node:module";
|
|
27
27
|
import path from "node:path";
|
|
28
28
|
import { Readable } from "node:stream";
|
|
@@ -200,6 +200,30 @@ export function resolveModule(spec, from) {
|
|
|
200
200
|
export function getDirname(importMetaUrl) {
|
|
201
201
|
return path.dirname(fileURLToPath(importMetaUrl));
|
|
202
202
|
}
|
|
203
|
+
// ── Filesystem type probe ─────────────────────────────────────────────────────
|
|
204
|
+
/**
|
|
205
|
+
* Best-effort filesystem-type probe: return the numeric `f_type` magic of the
|
|
206
|
+
* filesystem backing `path`, or `undefined` on any error (ENOENT/EPERM/
|
|
207
|
+
* unsupported). Used (via injection) by the SQLite journal-mode network-FS
|
|
208
|
+
* fallback (#628).
|
|
209
|
+
*
|
|
210
|
+
* This is a runtime primitive (a `statfs` filesystem-type probe) and therefore
|
|
211
|
+
* lives here, per the runtime boundary, even though it uses only `node:fs`. The
|
|
212
|
+
* "magic-number → is-network" classification stays a pure helper elsewhere.
|
|
213
|
+
*
|
|
214
|
+
* `fs.statfsSync` is a stable `node:fs` API (Node ≥ 18.15) and is implemented
|
|
215
|
+
* under Bun as well. It THROWS ENOENT on a non-existent path, so callers should
|
|
216
|
+
* probe an already-created directory — the swallowed error simply yields
|
|
217
|
+
* `undefined` (treated as "not network").
|
|
218
|
+
*/
|
|
219
|
+
export function statfsType(path) {
|
|
220
|
+
try {
|
|
221
|
+
return statfsSync(path).type;
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
203
227
|
// ── Sleep ───────────────────────────────────────────────────────────────────
|
|
204
228
|
/**
|
|
205
229
|
* Block the current thread for `ms` without busy-spinning. On Bun uses the real
|