openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
19 lines (18 loc) • 740 B
JavaScript
import { l as isRecord } from "./record-coerce-CVPuDqcc.mjs";
//#region src/config/implicit-agent-roster.ts
/** Materialize fresh-install defaults without interpreting persisted legacy rosters. */
function applyImplicitAgentRosterDefaults(e) {
if (!isRecord(e) || e.agents !== void 0 && !isRecord(e.agents)) return e;
const t = isRecord(e.agents) ? e.agents : {};
if (t.ownership === "explicit" || Object.hasOwn(t, "list") && (!Array.isArray(t.list) || t.list.length > 0) || t.entries !== void 0 && (!isRecord(t.entries) || Object.keys(t.entries).length > 0)) return e;
const { list: n, ...r } = t;
return {
...e,
agents: {
...r,
entries: { main: {} }
}
};
}
//#endregion
export { applyImplicitAgentRosterDefaults as t };