openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
33 lines (32 loc) • 798 B
JavaScript
//#region src/commands/onboard-hooks.ts
const DEFAULT_ONBOARDING_INTERNAL_HOOKS = ["session-memory"];
function enableDefaultOnboardingInternalHooks(cfg) {
const existingInternal = cfg.hooks?.internal;
if (existingInternal?.enabled === false) return cfg;
let changed = false;
const entries = { ...existingInternal?.entries };
for (const hookName of DEFAULT_ONBOARDING_INTERNAL_HOOKS) {
const entry = entries[hookName];
if (entry?.enabled === false) continue;
if (entry?.enabled !== true) {
entries[hookName] = {
...entry,
enabled: true
};
changed = true;
}
}
if (!changed) return cfg;
return {
...cfg,
hooks: {
...cfg.hooks,
internal: {
...existingInternal,
entries
}
}
};
}
//#endregion
export { enableDefaultOnboardingInternalHooks as t };