Files
openclaw/src/plugins/installed-plugin-index-record-cache.ts
Peter Steinberger 98e3f729bc refactor: remove dead plugin loader exports (#105937)
* refactor(plugins): trim activation and contract exports

* test(plugins): restore fixture cleanup

* refactor(plugins): trim install and loader exports

* test(plugins): fully reset loader caches

* refactor(plugins): trim metadata and catalog exports

* test(plugins): preserve catalog trust coverage

* refactor(plugins): trim provider and plugin exports

* refactor(plugins): trim runtime and tool exports

* test(plugins): update dead-export consumers

* test(plugins): remove empty dead-export suites

* refactor(plugins): align exports with split registry

* refactor(plugins): trim drifted loader exports

* style(plugins): format test fixtures

* refactor(scripts): use supported plugin APIs

* refactor(plugins): finish dead export cleanup

* chore(deadcode): refresh export baseline

* test(cli): mock production memory state

* chore(deadcode): sync latest export baseline

* fix(tests): keep plugin fixtures inside core

* chore(deadcode): refresh rebased export baseline

* chore(deadcode): sync current ratchets

* fix(plugins): retain reserved slot invariant

* fix(plugins): preserve dead-export invariants

* test(plugins): use neutral catalog query fixture

* test(plugins): satisfy catalog lint

* test(plugins): preserve integrity drift coverage

* fix(ci): register skill experience live proof
2026-07-13 01:29:33 -07:00

37 lines
1.3 KiB
TypeScript

// Caches installed plugin index records for current process lookups.
import type { PluginInstallRecord } from "../config/types.plugins.js";
/** Cached installed plugin records for one store/recovery key. */
type InstallRecordsCacheEntry = {
records: Record<string, PluginInstallRecord>;
};
const installRecordsCache = new Map<string, InstallRecordsCacheEntry>();
let installRecordsCacheGeneration = 0;
/** Returns cached installed plugin records for a store/recovery key. */
export function getInstalledPluginIndexInstallRecordsCache(
key: string,
): InstallRecordsCacheEntry | undefined {
return installRecordsCache.get(key);
}
/** Stores cached installed plugin records for a store/recovery key. */
export function setInstalledPluginIndexInstallRecordsCache(
key: string,
entry: InstallRecordsCacheEntry,
): void {
installRecordsCache.set(key, entry);
}
/** Current cache generation used to detect concurrent clears during async loads. */
export function getInstalledPluginIndexInstallRecordsCacheGeneration(): number {
return installRecordsCacheGeneration;
}
/** Clears cached installed plugin records and advances the cache generation. */
export function clearLoadInstalledPluginIndexInstallRecordsCache(): void {
installRecordsCacheGeneration += 1;
installRecordsCache.clear();
}