openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
19 lines (18 loc) • 1.18 kB
JavaScript
//#region src/gateway/server-retained-plugin-cleanup.ts
async function cleanupRetainedPluginInstallGenerations(params) {
try {
const { clearLoadInstalledPluginIndexInstallRecordsCache, loadInstalledPluginIndexInstallRecordsSync } = await import("./installed-plugin-index-records-DGtSxIvi.js");
clearLoadInstalledPluginIndexInstallRecordsCache();
const records = loadInstalledPluginIndexInstallRecordsSync();
const { cleanupRetainedManagedNpmInstallGenerations } = await import("./managed-npm-retention-D-XbPuXW.js");
const removedGenerations = await cleanupRetainedManagedNpmInstallGenerations({
activeInstallPaths: [...params.startupInstallPaths, ...Object.values(records).flatMap((record) => record.installPath ? [record.installPath] : [])],
onError: (error, projectRoot) => params.log.warn(`failed to clean retained npm generation ${projectRoot}: ${String(error)}`)
});
if (removedGenerations > 0) params.log.info(`cleaned ${removedGenerations} retained npm plugin generation(s)`);
} catch (error) {
params.log.warn(`retained npm generation cleanup unavailable: ${String(error)}`);
}
}
//#endregion
export { cleanupRetainedPluginInstallGenerations };