Files
oh-my-opencode/packages/agents-md-core/src/injection-cache.ts
T
2026-05-21 12:50:10 +09:00

15 lines
513 B
TypeScript

import type { AgentsMdInjectedPathsStorage } from "./types";
export function getSessionCache(input: {
readonly sessionCaches: Map<string, Set<string>>;
readonly sessionID: string;
readonly storage: Pick<AgentsMdInjectedPathsStorage, "loadInjectedPaths">;
}): Set<string> {
const existing = input.sessionCaches.get(input.sessionID);
if (existing) return existing;
const loaded = input.storage.loadInjectedPaths(input.sessionID);
input.sessionCaches.set(input.sessionID, loaded);
return loaded;
}