openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
33 lines (32 loc) • 1.38 kB
JavaScript
import { a as getOpenClawDatabaseMaintenanceScope } from "./openclaw-state-maintenance-context-D6i7Zdhn.mjs";
import { i as resolveOpenClawPackageRootsSync } from "./openclaw-root-C-ayo09z.mjs";
import "./openclaw-state-db-async-lifecycle-CH8q4Sdl.mjs";
import { t as maintainRetainedUpdateRuntimes } from "./temp-artifact-cleanup-DZZ4TnQS.mjs";
import { t as note } from "./note-CnLgHvug.mjs";
import { t as inspectDoctorTemporaryDirectories } from "./temporary-directories-DM4O9F0P.mjs";
//#region src/commands/doctor-retained-runtime.ts
async function prepareRetainedUpdateRuntimeCleanup(e, t) {
const n = getOpenClawDatabaseMaintenanceScope();
const { directories: r, warnings: i } = await inspectDoctorTemporaryDirectories(e, t);
const a = resolveOpenClawPackageRootsSync({
moduleUrl: import.meta.url,
argv1: process.argv[1],
cwd: process.cwd()
});
return async (e, t) => {
const o = await maintainRetainedUpdateRuntimes({
packageRoots: a,
temporaryDirectories: r,
repair: e,
assertCurrent: t?.assertCurrent ?? (() => {
if (!n?.ownsSchemaMaintenance) throw new Error("Doctor does not hold Gateway maintenance");
n.assertAdmission();
}),
assertResourcesSettled: t?.assertResourcesSettled
});
o.push(...i);
if (o.length) note(o.join("\n"), "Updater runtimes");
};
}
//#endregion
export { prepareRetainedUpdateRuntimeCleanup };