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
17 lines (16 loc) • 853 B
JavaScript
// 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 { ensureIndex } from "./ensure-index.js";
import { resolveSourceEntries } from "./search/search-source.js";
/** Resolve the active read sources using the same resolution rules as search/show. */
export function resolveReadSources(overrideStashDir, existingConfig) {
const sources = resolveSourceEntries(overrideStashDir, existingConfig);
return { sources, primarySource: sources[0] };
}
/** Ensure the primary source index is readable for reads, when a primary exists. */
export async function ensurePrimaryIndexForRead(primarySource) {
if (!primarySource?.path)
return false;
return ensureIndex(primarySource.path);
}