import{ti as e,yr as t}from"./app-server-manager-signals-Yn0WSnoY.js";function n(e){return e.interface?.displayName?.trim()||t(e.name)}function r(e){let t=e.interface?.defaultPrompt;if(!t)return null;let n=t.trim();return n.length===0?null:n}function i({name:t,path:n}){return n?`[$${t}](${e(n)})`:`$${t}`}function a(e,t){let n=t.toLowerCase(),r=[];for(let t of e.data){let e=t.skills.find(e=>e.name.toLowerCase()===n);if(e!=null)return e;r.push(...t.skills.filter(e=>e.name.toLowerCase().endsWith(`:${n}`)))}return r.length===1?r[0]:null}function o(e){return e.endsWith(` `)?e:`${e} `}function s(e){let t=r(e),n=i({name:e.name,path:e.path});if(!t)return o(n);let a=t.toLowerCase(),s=`[$${e.name.toLowerCase()}](`;if(a.includes(s))return o(t);let c=`$${e.name.toLowerCase()}`;return!e.path&&a.includes(c)?o(t):o(`${t} ${n}`)}export{s as i,i as n,n as r,a as t};
//# sourceMappingURL=skill-utils-9ttn5Q5l.js.map