openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.23 kB
JavaScript
import{O as tryResolveAmbientOwnerAgentId,f as resolveAgentWorkspaceDir}from"./agent-scope-config-CG9CFpGX.mjs";
//!src/plugins/control-plane-workspace.ts
const PLUGIN_WORKSPACE_SCOPE_OMITTED_DIAGNOSTIC_CODE=`workspace-scope-omitted`;function resolvePluginControlPlaneWorkspace(e){if(e.workspaceDir!==void 0)return{workspaceDir:e.workspaceDir,workspaceScope:`selected`};const t=tryResolveAmbientOwnerAgentId(e.config);const n=t?resolveAgentWorkspaceDir(e.config,t,e.env):void 0;if(n)return{agentId:t,workspaceDir:n,workspaceScope:`selected`};return{workspaceScope:`omitted`,diagnostic:{level:`warn`,code:PLUGIN_WORKSPACE_SCOPE_OMITTED_DIAGNOSTIC_CODE,message:`Workspace plugin discovery was skipped because multiple explicit agents are configured without agents.defaults.systemAgent.agentId. This partial result includes bundled, managed, and global plugins only; set agents.defaults.systemAgent.agentId to include that owner's workspace plugins.`}}}function appendPluginControlPlaneWorkspaceDiagnostic(e,t){const n=t.diagnostic;if(!n||e.some(e=>e.code===PLUGIN_WORKSPACE_SCOPE_OMITTED_DIAGNOSTIC_CODE))return[...e];return[...e,n]}export{resolvePluginControlPlaneWorkspace as n,appendPluginControlPlaneWorkspaceDiagnostic as t};