MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / backupConfigFile

Function backupConfigFile

services/kiloclaw/controller/src/config-writer.ts:832–847  ·  view source on GitHub ↗
(
  configPath = DEFAULT_CONFIG_PATH,
  deps: ConfigWriterDeps = defaultDeps
)

Source from the content-addressed store, hash-verified

830 config.plugins.entries[KILOCLAW_MORNING_BRIEFING_PLUGIN_ID] ?? {};
831 config.plugins.entries[KILOCLAW_MORNING_BRIEFING_PLUGIN_ID].enabled = true;
832
833 // Telegram
834 if (env.TELEGRAM_BOT_TOKEN) {
835 const dmPolicy = env.TELEGRAM_DM_POLICY || 'pairing';
836 config.channels.telegram = config.channels.telegram ?? {};
837 config.channels.telegram.botToken = env.TELEGRAM_BOT_TOKEN;
838 config.channels.telegram.enabled = true;
839 config.channels.telegram.dmPolicy = dmPolicy;
840 // Explicit env override always wins; otherwise only seed allowFrom on
841 // first boot (when the key is absent) so user edits are preserved.
842 if (env.TELEGRAM_DM_ALLOW_FROM) {
843 config.channels.telegram.allowFrom = env.TELEGRAM_DM_ALLOW_FROM.split(',');
844 } else if (!('allowFrom' in config.channels.telegram)) {
845 config.channels.telegram.allowFrom = dmPolicy === 'open' ? ['*'] : [];
846 }
847
848 config.plugins = config.plugins ?? {};
849 config.plugins.entries = config.plugins.entries ?? {};
850 config.plugins.entries.telegram = config.plugins.entries.telegram ?? {};

Callers 4

mutateAgentConfigFunction · 0.90
registerConfigRoutesFunction · 0.90
writeBaseConfigFunction · 0.85

Calls 4

pruneOldConfigBackupsFunction · 0.85
joinMethod · 0.80
replaceMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected