UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

6 lines • 1.96 kB
import{n as sanitizeTerminalText}from"./safe-text-B_QTgn0s.mjs";import{t as VERSION}from"./version-DrZ9Nfde.mjs";import{r as shouldWarnOnTouchedVersion}from"./version-RfsxYZoO.mjs";import{i as hashConfigRaw}from"./io.read-helpers-B0XuPBY2.mjs";import{F as warnedFutureTouchedVersions,P as setBoundedConfigIoWarningEntry,j as loggedConfigWarningFingerprints}from"./write-lock-BXv5IgVt.mjs"; //!src/config/json5-comments.ts function hasJSON5Comments(e){let t;for(let n=0;n<e.length;n+=1){const r=e[n];if(t){if(r===`\\`)n+=1;else if(r===t)t=void 0;continue}if(r===`"`||r===`'`){t=r;continue}if(r===`/`&&(e[n+1]===`/`||e[n+1]===`*`))return true}return false}function warnIfJSON5CommentsWillBeStripped(e){if(e.skipOutputLogs||typeof e.raw!==`string`||!hasJSON5Comments(e.raw))return;(e.warn??console.warn)(`Config write will strip JSON5 comments from ${e.filePath}.`)} //!src/config/io.warnings.ts function logConfigWarningsOnce(e){if(e.warnings.length===0){loggedConfigWarningFingerprints.delete(e.configPath);return}const t=e.warnings.map(e=>`${sanitizeTerminalText(e.path||`<root>`)}: ${sanitizeTerminalText(e.message)}`).join(`; `);const n=hashConfigRaw(t);const r=loggedConfigWarningFingerprints.get(e.configPath)===n;setBoundedConfigIoWarningEntry(loggedConfigWarningFingerprints,e.configPath,n);if(!r)e.logger.warn(`Config warnings: ${t}`)}function warnIfConfigFromFuture(e,t){const n=e.meta?.lastTouchedVersion;if(!n||!shouldWarnOnTouchedVersion(VERSION,n))return;if(warnedFutureTouchedVersions.check(n))return;t.warn([`Your OpenClaw config was written by version ${n}, but this command is running ${VERSION}.`,"Check: `openclaw --version`, `which openclaw`, and `openclaw gateway status --deep`.","If unexpected, update PATH so `openclaw` points to the version you want, or reinstall the Gateway service from that same OpenClaw install."].join(` `))}export{warnIfConfigFromFuture as n,warnIfJSON5CommentsWillBeStripped as r,logConfigWarningsOnce as t};