openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
53 lines (52 loc) • 1.51 kB
JavaScript
import { r as asNullableRecord } from "../../record-coerce-CVPuDqcc.mjs";
import "../../runtime-doctor-migrations-YTlcIEpR.mjs";
//#region extensions/knowledge/doctor-contract-api.ts
const REVIEW_JOB_PATH = "plugins.entries.knowledge.config.maintenance.reviewJobId";
/** Retired Knowledge config Doctor reports. */
const legacyConfigRules = [{
path: [
"plugins",
"entries",
"knowledge",
"config",
"maintenance"
],
message: `${REVIEW_JOB_PATH} is retired: maintenance no longer queues the review, which runs on its own schedule. Run "openclaw doctor --fix" to remove it.`,
match: (e) => asNullableRecord(e)?.reviewJobId !== void 0
}];
/**
* Remove the retired `maintenance.reviewJobId` so the Knowledge config validates
* again. The review scribe's own automation keeps its schedule; nothing else changes.
*/
function normalizeCompatibilityConfig({ cfg: e }) {
const t = e.plugins?.entries?.knowledge;
const n = asNullableRecord(t?.config);
const r = asNullableRecord(n?.maintenance);
if (!t || !n || r?.reviewJobId === void 0) return {
config: e,
changes: []
};
const i = { ...r };
delete i.reviewJobId;
return {
config: {
...e,
plugins: {
...e.plugins,
entries: {
...e.plugins?.entries,
knowledge: {
...t,
config: {
...n,
maintenance: i
}
}
}
}
},
changes: [`Removed ${REVIEW_JOB_PATH}; the review scribe runs on its own schedule.`]
};
}
//#endregion
export { legacyConfigRules, normalizeCompatibilityConfig };