UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 2.22 kB
import{t as listAgentIdsCompatibility}from"../../agent-scope-runtime-DKb8jQZx.mjs";import{t as resolveSkillWorkshopConfig}from"../../config-CpMk1XES.mjs";import{t as detectSkillWorkshopToolPolicyDiagnostic}from"../../tool-policy-diagnostic-DL1xJS1I.mjs"; //!extensions/skill-workshop/doctor-health-api.ts const SKILL_WORKSHOP_TOOL_POLICY_CHECK_ID=`skill-workshop/tool-policy`;function createSkillWorkshopToolPolicyCheck(e){return{id:SKILL_WORKSHOP_TOOL_POLICY_CHECK_ID,kind:`plugin`,source:`skill-workshop`,description:`Autonomous Skill Workshop capture has a callable review tool.`,async detect(t){const n=resolveSkillWorkshopConfig(t.cfg).autonomous.mode!==`off`;const r=listAgentIdsCompatibility(t.cfg);const i=(await Promise.all((r.length>0?r:[void 0]).map(r=>detectSkillWorkshopToolPolicyDiagnostic({explainToolAvailability:e,config:t.cfg,workshopEnabled:n,...r?{agentId:r}:{}})))).filter(e=>e!==null);const a=t.cfg.plugins;const o=Array.isArray(a?.allow)&&a.allow.length>0&&!a.allow.some(e=>e.trim().toLowerCase()===`skill-workshop`);const s=n&&(a?.enabled===false||o)?[{checkId:SKILL_WORKSHOP_TOOL_POLICY_CHECK_ID,category:`fix-now`,docsUrl:`https://docs.openclaw.ai/tools/skill-workshop`,severity:`warning`,message:`Skill Workshop is on, but ${a?.enabled===false?`plugins.enabled=false`:`plugins.allow`} keeps the skill-workshop plugin off, so learned skills are not loaded.`,path:a?.enabled===false?`plugins.enabled`:`plugins.allow`,requirement:`Learned skills load through the skill-workshop plugin.`,fixHint:a?.enabled===false?`Enable plugins and limit them with plugins.allow, including skill-workshop.`:`Add "skill-workshop" to plugins.allow.`}]:[];const c=i.map(e=>({checkId:SKILL_WORKSHOP_TOOL_POLICY_CHECK_ID,category:`fix-now`,docsUrl:`https://docs.openclaw.ai/tools/skill-workshop`,severity:`warning`,message:e.detail,path:e.source,target:e.agentId,requirement:`Autonomous Skill Workshop review requires the skill_workshop tool.`,fixHint:e.fix}));return[...s,...c]}}}function registerSkillWorkshopDoctorChecks(e){if(e.getHealthCheck(SKILL_WORKSHOP_TOOL_POLICY_CHECK_ID))return;e.registerHealthCheck(createSkillWorkshopToolPolicyCheck(e.explainToolAvailability))}export{registerSkillWorkshopDoctorChecks};