UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 2.86 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{BA as t,dj as n,fs as r,mj as i,ps as a,zA as o}from"./control-ui-boot-shared-DFTSUQQ0.js";import{C as s,F as c,U as l,d as u,g as d,gt as f,i as p,j as m,l as h,m as g,s as _,u as v,x as y}from"./solid-runtime-C416s-HC.js";import{dc as b,fc as x}from"./control-ui-boot-chat-DewxEbIm.js";import{lt as S,st as C}from"./markdown-runtime-DmM7zNej.js";import{n as w,t as T}from"./sanitized-html-BeSpwng-.js";function E(e){let t=c(()=>e.client.request(`skills.files.get`,{agentId:e.agentId,path:e.path},{signal:e.signal})),n=c(()=>{let e=t().content.replace(/\r\n/g,` `).split(` `);return e.at(-1)===``&&e.pop(),e}),a=c(()=>{let e=n(),t=e[0]===`---`?e.indexOf(`---`,1):-1;return e.slice(0,j).map((e,n)=>({number:n+1,html:C(e||` `,n<=t?`yaml`:`markdown`)}))});return f(()=>e.onPosition()),[(()=>{var n=D(),a=n.firstChild,s=a.nextSibling,c=s.nextSibling,l=c.nextSibling,f=l.firstChild,_=f.nextSibling;u(a,m(o,{name:`fileText`})),u(s,()=>t().path.replaceAll(`\\`,`/`).split(`/`).at(-1)),u(c,()=>t().name),u(l,(()=>{var e=b();return m(r,{ref(t){(typeof e==`function`||Array.isArray(e))&&p(e,t)},get text(){return t().content},get idleLabel(){return i(`filePreview.copyFile`)},bare:!0})})(),f),f._$$click=()=>e.onOpen(t());var v=b();(typeof v==`function`||Array.isArray(v))&&g(()=>v,f),u(f,m(o,{name:`maximize`})),_._$$click=()=>e.onClose();var y=b();return(typeof y==`function`||Array.isArray(y))&&g(()=>y,_),u(_,m(o,{name:`x`})),h(()=>({e:i(`filePreview.skill.open`),t:i(`filePreview.skill.open`),a:i(`common.close`)}),({e,t,a:n},r)=>{e!==r?.e&&d(f,`title`,e),t!==r?.t&&d(f,`aria-label`,t),n!==r?.a&&d(_,`aria-label`,n)}),n})(),(()=>{var e=O(),t=b();return(typeof t==`function`||Array.isArray(t))&&g(()=>t,e),u(e,m(s,{get each(){return a()},children:e=>(()=>{var t=A(),n=t.firstChild;return u(n,()=>e.number),u(t,m(T,{tag:`code`,get html(){return e.html}}),null),t})()})),h(()=>i(`filePreview.skill.source`),t=>{d(e,`aria-label`,t)}),e})(),(()=>{var e=k(),r=e.firstChild,o=r.nextSibling;return u(r,()=>t().path),u(o,()=>i(`filePreview.skill.lines`,{count:String(a().length),total:String(n().length)})),h(()=>t().path,e=>{d(r,`title`,e)}),e})()]}var D,O,k,A,j;function M(){return(M=e((()=>{v(),l(),n(),S(),x(),a(),t(),w(),D=y(`<header class=skill-file-hovercard__header><span class=skill-file-hovercard__icon aria-hidden=true></span><strong></strong><span class=skill-file-hovercard__name></span><div class=skill-file-hovercard__actions><button type=button></button><button type=button>`),O=y(`<div class=skill-file-hovercard__source tabindex=0>`),k=y(`<footer class=skill-file-hovercard__footer><span class=skill-file-hovercard__path></span><span>`),A=y(`<div class=skill-file-hovercard__line><span class=skill-file-hovercard__number aria-hidden=true>`),j=400,_([`click`])})))()}M();export{E as SkillRead};