UNPKG

akm-cli

Version:

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 Cur

31 lines (30 loc) • 1.47 kB
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. import { loadConfig } from "../../core/config/config.js"; import { bundleOverlaps } from "../../core/config/config-sources.js"; /** Silent (undefined) when no pair is nested, and when the config cannot be read: `bundle-adapters` says that. */ export function collectBundleSharedPathCheck(readConfig = loadConfig) { const base = { name: "bundle-shared-path", kind: "deterministic", confidence: "high" }; let nested; try { nested = bundleOverlaps(readConfig()).filter((overlap) => overlap.kind === "nested"); } catch { return undefined; } if (nested.length === 0) return undefined; const pairs = nested.map((overlap) => { const outer = overlap.bundles.find((id) => id !== overlap.inner); return { inner: overlap.inner, outer }; }); return { ...base, status: "warn", message: `${pairs.map(({ inner, outer }) => `bundle "${inner}" is inside bundle "${outer}"`).join("; ")}: they share files, ` + "and the index files each shared file under the bundle configured first. Move one directory out of the other, or remove one bundle (a wiki folder inside a bundle " + "should be its own bundle, moved out).", evidence: { pairs }, }; }