UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.86 kB
import{t as formatErrorMessage}from"./errors-D37BJTfI.mjs";import{k as setReplyPayloadMetadata}from"./reply-payload-C7eQHHoS.mjs";import{r as logVerbose}from"./globals-l9I53ZKA.mjs";import{n as logError}from"./logger-BHIcoxTH.mjs";import{l as requireCommandFlagEnabled}from"./command-gates-BMLoLImo.mjs";import{i as formatDetailedPluginHealth}from"./status-plugin-health-D3N45XLz.mjs";import{t as buildStatusReplyParts}from"./status-text-SZPHz9fl.mjs"; //!src/auto-reply/reply/commands-status.ts function markStatusReply(e){return setReplyPayloadMetadata(e,{contextFreeCommand:true})}async function buildStatusReply(e){const{command:t}=e;if(!t.isAuthorizedSender){logVerbose(`Ignoring /status from unauthorized sender: ${t.senderId||`<unknown>`}`);return}try{const{text:n,presentation:r}=await buildStatusReplyParts({...e,statusChannel:t.channel,statusAccountId:t.accountId});return markStatusReply({text:n,presentation:r,presentationTextMode:`fallback`})}catch(e){logError(`/status render failed: ${formatErrorMessage(e)}`);return markStatusReply({text:`⚠️ Status: error rendering response`})}}async function buildStatusPluginsReply(e){const{command:t}=e;if(!t.isAuthorizedSender){logVerbose(`Ignoring /status plugins from unauthorized sender: ${t.senderId||`<unknown>`}`);return}const n=requireCommandFlagEnabled(e.cfg,{label:`/status plugins`,configKey:`plugins`});if(n)return n.reply?markStatusReply(n.reply):void 0;try{const{collectInstalledPluginHealthSnapshot:t}=await import(`./status-plugin-health.runtime-D0synl-J.mjs`);const n=await t({config:e.cfg,workspaceDir:e.workspaceDir});return markStatusReply({text:formatDetailedPluginHealth(n)})}catch(e){logError(`/status plugins render failed: ${formatErrorMessage(e)}`);return markStatusReply({text:`⚠️ Plugins: health unavailable`})}}export{buildStatusReply as n,buildStatusPluginsReply as t};