UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.64 kB
import{m as normalizeTrimmedStringList}from"./string-normalization-D_oBUpO3.mjs";import{t as canAccess}from"./path-existence-BR9MXlgL.mjs";import"./openclaw-state-db-BlgxYkYw.mjs";import"./uninstall-config-DONPsAyt.mjs";import"./model-reference-inventory-DpUHPOcR.mjs";import path from"node:path"; //!src/infra/plugin-install-path-warnings.ts async function detectPluginInstallPathIssue(e){if(e.install?.source!==`path`)return null;const t=normalizeTrimmedStringList([e.install.sourcePath,e.install.installPath]);if(t.length===0)return null;for(const n of t)if(await canAccess(path.resolve(n)))return{kind:`custom-path`,pluginId:e.pluginId,path:n};return{kind:`missing-path`,pluginId:e.pluginId,path:t[0]??`(unknown)`}}function formatPluginInstallPathIssue(e){const t=e.formatCommand??(e=>e);if(e.issue.kind===`custom-path`)return[`${e.pluginLabel} is installed from a custom path: ${e.issue.path}`,`Main updates will not automatically replace that plugin with the repo's default ${e.pluginLabel} package.`,`Reinstall with "${t(e.defaultInstallCommand)}" when you want to return to the standard ${e.pluginLabel} plugin.`,...e.repoInstallCommand?[`If you are intentionally running from a repo checkout, reinstall that checkout explicitly with "${t(e.repoInstallCommand)}" after updates.`]:[]];return[`${e.pluginLabel} is installed from a custom path that no longer exists: ${e.issue.path}`,`Reinstall with "${t(e.defaultInstallCommand)}".`,...e.repoInstallCommand?[`If you are running from a repo checkout, you can also use "${t(e.repoInstallCommand)}".`]:[]]}export{formatPluginInstallPathIssue as n,detectPluginInstallPathIssue as t};