@oro.ad/nuxt-claude-devtools 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -10
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/B8uzckkK.js +1 -0
- package/dist/client/_nuxt/BAb1fJOF.js +12 -0
- package/dist/client/_nuxt/BB1-kxmm.js +1 -0
- package/dist/client/_nuxt/BMZIbUUD.js +1 -0
- package/dist/client/_nuxt/BSF2Vz9o.js +1 -0
- package/dist/client/_nuxt/BSVkH7b6.js +1 -0
- package/dist/client/_nuxt/{DV075BoS.js → BYp73eMl.js} +1 -1
- package/dist/client/_nuxt/B_BoWmnX.js +1 -0
- package/dist/client/_nuxt/BcZxFXBD.js +1 -0
- package/dist/client/_nuxt/BflmC3YB.js +1 -0
- package/dist/client/_nuxt/BnXQTjo-.js +1 -0
- package/dist/client/_nuxt/C--9REmc.js +1 -0
- package/dist/client/_nuxt/CDQtmRaX.js +1 -0
- package/dist/client/_nuxt/CHeJJZL9.js +1 -0
- package/dist/client/_nuxt/{DImlDIT-.js → COus5Ssl.js} +1 -1
- package/dist/client/_nuxt/{BRCY8pHC.js → CPA0s6N9.js} +1 -1
- package/dist/client/_nuxt/CRkq21kc.js +1 -0
- package/dist/client/_nuxt/Cgba93Y9.js +1 -0
- package/dist/client/_nuxt/D2l4TRxW.js +1 -0
- package/dist/client/_nuxt/DC_XB519.js +1 -0
- package/dist/client/_nuxt/DEys9N1G.js +1 -0
- package/dist/client/_nuxt/{DYNukx3V.js → DGQ4s7ae.js} +1 -1
- package/dist/client/_nuxt/DH8Ugy8E.js +1 -0
- package/dist/client/_nuxt/DSt96JPY.js +4 -0
- package/dist/client/_nuxt/DbJLoP3G.js +1 -0
- package/dist/client/_nuxt/DeGmaFBY.js +1 -0
- package/dist/client/_nuxt/DgfRwrFR.js +1 -0
- package/dist/client/_nuxt/{BbEuL4Z6.js → DolUcBed.js} +1 -1
- package/dist/client/_nuxt/M6QPYocW.js +1 -0
- package/dist/client/_nuxt/QumocfwJ.js +1 -0
- package/dist/client/_nuxt/TQi6eIO6.js +1 -0
- package/dist/client/_nuxt/V4UvAcd3.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/2be12f06-336a-4fdd-b982-2f6c682c14a6.json +1 -0
- package/dist/client/_nuxt/d8BPa19J.js +1 -0
- package/dist/client/_nuxt/entry.BMxUr06A.css +1 -0
- package/dist/client/_nuxt/qbS8UemQ.js +1 -0
- package/dist/client/_nuxt/wDw60tEC.js +10 -0
- package/dist/client/_nuxt/xEjB6ozD.js +1 -0
- package/dist/client/agents/index.html +1 -1
- package/dist/client/commands/index.html +1 -1
- package/dist/client/docs/index.html +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/mcp/index.html +1 -1
- package/dist/client/plugins/index.html +1 -0
- package/dist/client/settings/index.html +1 -0
- package/dist/client/skills/index.html +1 -1
- package/dist/module.d.mts +13 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +35 -7
- package/dist/runtime/constants.d.ts +29 -0
- package/dist/runtime/constants.js +5 -0
- package/dist/runtime/logger.js +18 -0
- package/dist/runtime/overlay/components/ChatOverlay.d.vue.ts +7 -0
- package/dist/runtime/overlay/components/ChatOverlay.vue +893 -0
- package/dist/runtime/overlay/components/ChatOverlay.vue.d.ts +7 -0
- package/dist/runtime/overlay/components/MarkdownContent.d.vue.ts +6 -0
- package/dist/runtime/overlay/components/MarkdownContent.vue +31 -0
- package/dist/runtime/overlay/components/MarkdownContent.vue.d.ts +6 -0
- package/dist/runtime/overlay/components/ToolCallBlock.d.vue.ts +8 -0
- package/dist/runtime/overlay/components/ToolCallBlock.vue +77 -0
- package/dist/runtime/overlay/components/ToolCallBlock.vue.d.ts +8 -0
- package/dist/runtime/overlay/plugin.client.d.ts +6 -0
- package/dist/runtime/overlay/plugin.client.js +29 -0
- package/dist/runtime/server/agents-manager.d.ts +17 -4
- package/dist/runtime/server/agents-manager.js +38 -109
- package/dist/runtime/server/base-resource-manager.d.ts +90 -0
- package/dist/runtime/server/base-resource-manager.js +201 -0
- package/dist/runtime/server/claude-session.d.ts +11 -1
- package/dist/runtime/server/claude-session.js +246 -27
- package/dist/runtime/server/commands-manager.d.ts +12 -4
- package/dist/runtime/server/commands-manager.js +25 -100
- package/dist/runtime/server/constants.d.ts +94 -0
- package/dist/runtime/server/constants.js +18 -0
- package/dist/runtime/server/docs-manager.d.ts +7 -0
- package/dist/runtime/server/docs-manager.js +112 -3
- package/dist/runtime/server/history-manager.d.ts +1 -0
- package/dist/runtime/server/history-manager.js +25 -3
- package/dist/runtime/server/plugins/socket.io.js +5 -3
- package/dist/runtime/server/plugins-manager.d.ts +84 -0
- package/dist/runtime/server/plugins-manager.js +338 -0
- package/dist/runtime/server/settings-manager.d.ts +17 -0
- package/dist/runtime/server/settings-manager.js +70 -0
- package/dist/runtime/server/share-manager.d.ts +24 -0
- package/dist/runtime/server/share-manager.js +96 -0
- package/dist/runtime/server/skills-manager.d.ts +18 -4
- package/dist/runtime/server/skills-manager.js +32 -159
- package/dist/runtime/shared/composables/useClaudeChat.d.ts +35 -0
- package/dist/runtime/shared/composables/useClaudeChat.js +264 -0
- package/dist/runtime/shared/composables/useShare.d.ts +42 -0
- package/dist/runtime/shared/composables/useShare.js +192 -0
- package/dist/runtime/shared/composables/useVoiceInput.d.ts +8 -0
- package/dist/runtime/shared/composables/useVoiceInput.js +77 -0
- package/dist/runtime/shared/constants.d.ts +28 -0
- package/dist/runtime/shared/constants.js +6 -0
- package/dist/runtime/shared/index.d.ts +9 -0
- package/dist/runtime/shared/index.js +5 -0
- package/dist/runtime/shared/types.d.ts +48 -0
- package/dist/runtime/shared/types.js +0 -0
- package/dist/runtime/types.d.ts +2 -0
- package/dist/types.d.mts +1 -1
- package/package.json +5 -3
- package/dist/client/_nuxt/BVHVIm9H.js +0 -12
- package/dist/client/_nuxt/BZrcCMrf.js +0 -1
- package/dist/client/_nuxt/BmjlsnUc.js +0 -1
- package/dist/client/_nuxt/D2NL8Xro.js +0 -7
- package/dist/client/_nuxt/D9qGFoJm.js +0 -4
- package/dist/client/_nuxt/Dbw96V2H.js +0 -7
- package/dist/client/_nuxt/FllXIyfS.js +0 -8
- package/dist/client/_nuxt/TvBJGid1.js +0 -1
- package/dist/client/_nuxt/XJ4dJUK2.js +0 -1
- package/dist/client/_nuxt/builds/meta/e8ae4dbb-462d-47a2-9aa2-50bed9498ab2.json +0 -1
- package/dist/client/_nuxt/e7kgpy_n.js +0 -4
- package/dist/client/_nuxt/entry.DwDQaFYc.css +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{_ as q,a as fe,u as Je,l as Qe,b as Xe}from"./XJ4dJUK2.js";import{g as J,s as P,w as M,T as re,o,c as i,l as w,a as t,b as r,d as E,F as H,p as G,n as z,t as C,_ as ie,z as Ge,A as Ye,r as k,q as A,y as te,B as ae,j as Ze,k as et,C as ve,m as tt,x as ot,D as ee}from"./e7kgpy_n.js";import{_ as me}from"./BbEuL4Z6.js";import{_ as nt}from"./TvBJGid1.js";import{_ as st}from"./DImlDIT-.js";const lt={key:0,class:"history-sidebar w-72 h-full border-r border-gray-200 dark:border-gray-700 flex flex-col n-bg-base absolute left-0 top-0 z-10 shadow-lg"},at={class:"p-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},rt={class:"p-3 border-b border-gray-200 dark:border-gray-700"},it={class:"flex-1 overflow-y-auto"},ct=["onClick"],ut={class:"flex items-start justify-between gap-2"},dt={class:"flex-1 min-w-0"},pt={class:"font-medium text-sm truncate"},vt={class:"text-xs opacity-50 mt-1 flex items-center gap-2"},ft=["onClick"],mt={key:0,class:"p-4 text-center opacity-50 text-sm"},gt=J({__name:"HistorySidebar",props:{conversations:{},activeId:{},isOpen:{type:Boolean}},emits:["select","delete","new","close"],setup(b,{emit:$}){const f=$;function x(u){const g=new Date(u),v=new Date().getTime()-g.getTime(),m=Math.floor(v/6e4),h=Math.floor(m/60),c=Math.floor(h/24);return m<1?"just now":m<60?`${m}m ago`:h<24?`${h}h ago`:c<7?`${c}d ago`:g.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function l(u,g){u.stopPropagation(),confirm("Delete this conversation?")&&f("delete",g)}return(u,g)=>{const p=q,v=fe;return o(),P(re,{name:"slide"},{default:M(()=>[b.isOpen?(o(),i("div",lt,[t("div",at,[g[2]||(g[2]=t("h2",{class:"font-semibold text-sm"}," Chat History ",-1)),t("button",{class:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors",onClick:g[0]||(g[0]=m=>f("close"))},[r(p,{icon:"carbon:close"})])]),t("div",rt,[r(v,{class:"w-full",n:"blue",onClick:g[1]||(g[1]=m=>f("new"))},{default:M(()=>[r(p,{class:"mr-1",icon:"carbon:add"}),g[3]||(g[3]=E(" New Chat ",-1))]),_:1})]),t("div",it,[(o(!0),i(H,null,G(b.conversations,m=>(o(),i("div",{key:m.id,class:z([{"bg-blue-500/10 border-l-2 border-l-blue-500":m.id===b.activeId},"p-3 border-b border-gray-100 dark:border-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 group transition-colors"]),onClick:h=>f("select",m.id)},[t("div",ut,[t("div",dt,[t("div",pt,C(m.title||"New conversation"),1),t("div",vt,[t("span",null,C(x(m.updatedAt)),1),g[4]||(g[4]=t("span",{class:"opacity-50"},"|",-1)),t("span",null,C(m.messages.length)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-100 dark:hover:bg-red-900/20 rounded transition-opacity",title:"Delete conversation",onClick:h=>l(h,m.id)},[r(p,{class:"text-red-500 text-sm",icon:"carbon:trash-can"})],8,ft)])],10,ct))),128)),b.conversations.length===0?(o(),i("div",mt,[r(p,{class:"text-2xl mb-2",icon:"carbon:chat"}),g[5]||(g[5]=t("p",null,"No conversations yet",-1))])):w("",!0)])])):w("",!0)]),_:1})}}}),ht=Object.assign(ie(gt,[["__scopeId","data-v-797cdae6"]]),{__name:"HistorySidebar"});let W;const Z=[];function ge(b){if(Z.push(b),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&Z.forEach($=>$(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set($){$&&Z.forEach(f=>f($))},get(){return W.value},configurable:!0}),()=>{Z.splice(Z.indexOf(b),1)}}function he(){W||(W=Ge(),ge($));function b(){W&&Ye(W)}function $(f){W.value=f,f.host&&f.host.hooks.hook("host:update:reactivity",b)}return W}const xt={class:"tool-call-block rounded-lg border border-gray-200 dark:border-gray-700 my-2 overflow-hidden text-sm"},_t={class:"flex items-center gap-2 px-3 py-2 bg-blue-500/10"},bt={class:"font-medium"},yt=["title"],kt=["href","title"],wt={key:2,class:"text-xs opacity-50 font-mono"},Ct={key:3,class:"ml-auto flex-shrink-0"},$t={key:4,class:"ml-auto flex-shrink-0"},St={key:0,class:"border-t border-gray-200 dark:border-gray-700"},Dt={class:"text-xs opacity-50"},Tt={key:0,class:"px-3 pb-2"},Rt={class:"text-xs n-bg-base p-2 rounded overflow-x-auto max-h-64 whitespace-pre-wrap"},Bt={class:"font-medium opacity-70"},It={key:0,class:"px-3 pb-2"},At={class:"text-xs n-bg-base p-2 rounded overflow-x-auto max-h-96 whitespace-pre-wrap"},Nt={key:1,class:"px-3 pb-2"},Mt={class:"text-xs opacity-50 truncate font-mono"},Et=J({__name:"ToolCallBlock",props:{toolUse:{},toolResult:{}},setup(b){const $=he(),f=b,x=k(!1),l=k(!1),u=A(()=>JSON.stringify(f.toolUse.input,null,2)),g=A(()=>Object.keys(f.toolUse.input).length),p=A(()=>f.toolResult?typeof f.toolResult.content=="string"?f.toolResult.content:JSON.stringify(f.toolResult.content,null,2):""),v=A(()=>{const d=p.value;return d.length<=100?d:d.substring(0,100)+"..."}),m=A(()=>({Read:"carbon:document",Write:"carbon:document-add",Edit:"carbon:edit",Bash:"carbon:terminal",Glob:"carbon:search",Grep:"carbon:search-locate",WebFetch:"carbon:cloud",WebSearch:"carbon:search",Task:"carbon:task",TodoWrite:"carbon:list-checked",AskUserQuestion:"carbon:help"})[f.toolUse.name]||"carbon:tool-box"),h=A(()=>f.toolUse.id.substring(0,12)),c=A(()=>{const d=f.toolUse.input,_=d.file_path||d.path||d.filePath||d.filename||d.file||null;return _?String(_):null}),D=A(()=>{const d=f.toolUse.input,_=d.url||d.uri||d.href||d.link||null;return _?String(_):null}),R=A(()=>{if(!D.value)return null;const d=D.value,_=50;if(d.length<=_)return d;try{const I=new URL(d),T=I.hostname,V=I.pathname+I.search;return V.length>_-T.length-3?T+V.substring(0,_-T.length-6)+"...":d}catch{return d.substring(0,_-3)+"..."}}),B=A(()=>{const d=f.toolUse.input;return d.line||d.lineNumber||d.offset||null}),N=A(()=>{if(!c.value)return null;const d=c.value,_=32;if(d.length<=_)return d;const I=d.slice(-_),T=I.indexOf("/");return T>0&&T<15?"..."+I.slice(T):"..."+I});async function O(){if(c.value)try{let d=c.value;if(B.value&&(d=`${d}:${B.value}`),$.value?.devtools?.rpc?.openInEditor&&await $.value.devtools.rpc.openInEditor(d))return;const _=`webstorm://open?file=${encodeURIComponent(c.value)}${B.value?`&line=${B.value}`:""}`;window.open(_,"_self")}catch(d){console.error("Failed to open file in IDE:",d)}}return(d,_)=>{const I=q,T=me;return o(),i("div",xt,[t("div",_t,[r(I,{icon:m.value,class:"text-blue-500 flex-shrink-0"},null,8,["icon"]),t("span",bt,C(b.toolUse.name),1),N.value?(o(),i("button",{key:0,title:`${c.value} (click to open in IDE)`,class:"text-xs text-blue-600 dark:text-blue-400 font-mono hover:underline cursor-pointer truncate max-w-[300px] text-right",onClick:te(O,["stop"])},C(N.value),9,yt)):R.value?(o(),i("a",{key:1,href:D.value,title:D.value,class:"text-xs text-blue-600 dark:text-blue-400 font-mono hover:underline truncate max-w-[300px] text-right",rel:"noopener noreferrer",target:"_blank",onClick:_[0]||(_[0]=te(()=>{},["stop"]))},C(R.value),9,kt)):(o(),i("span",wt,C(h.value),1)),b.toolResult?(o(),i("div",Ct,[b.toolResult.is_error?(o(),P(T,{key:0,n:"red"},{default:M(()=>[..._[3]||(_[3]=[E(" Error ",-1)])]),_:1})):(o(),P(T,{key:1,n:"green"},{default:M(()=>[..._[4]||(_[4]=[E(" Done ",-1)])]),_:1}))])):(o(),i("div",$t,[r(T,{n:"yellow"},{default:M(()=>[..._[5]||(_[5]=[E(" Running ",-1)])]),_:1})]))]),g.value>0?(o(),i("div",St,[t("button",{class:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",onClick:_[1]||(_[1]=V=>x.value=!x.value)},[r(I,{icon:x.value?"carbon:chevron-down":"carbon:chevron-right",class:"text-xs opacity-70"},null,8,["icon"]),_[6]||(_[6]=t("span",{class:"font-medium opacity-70"},"Parameters",-1)),t("span",Dt,C(g.value)+" "+C(g.value===1?"field":"fields"),1)]),x.value?(o(),i("div",Tt,[t("pre",Rt,C(u.value),1)])):w("",!0)])):w("",!0),b.toolResult?(o(),i("div",{key:1,class:z([{"bg-red-500/5":b.toolResult.is_error},"border-t border-gray-200 dark:border-gray-700"])},[t("button",{class:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",onClick:_[2]||(_[2]=V=>l.value=!l.value)},[r(I,{icon:l.value?"carbon:chevron-down":"carbon:chevron-right",class:"text-xs opacity-70"},null,8,["icon"]),t("span",Bt,C(b.toolResult.is_error?"Error":"Result"),1),b.toolResult.is_error?(o(),P(I,{key:0,class:"text-red-500",icon:"carbon:warning"})):w("",!0)]),l.value?(o(),i("div",It,[t("pre",At,C(p.value),1)])):p.value?(o(),i("div",Nt,[t("div",Mt,C(v.value),1)])):w("",!0)],2)):w("",!0)])}}}),Ot=Object.assign(Et,{__name:"ToolCallBlock"}),Pt={class:"thinking-block rounded-lg border border-purple-200 dark:border-purple-800 my-2 overflow-hidden text-sm bg-purple-500/5"},Ut={class:"text-xs opacity-50"},Lt={key:0,class:"px-3 pb-2"},jt={class:"text-xs n-bg-base p-2 rounded overflow-x-auto max-h-96 whitespace-pre-wrap text-purple-800 dark:text-purple-200"},Ht={key:1,class:"px-3 pb-2"},Vt={class:"text-xs opacity-50 truncate font-mono text-purple-700 dark:text-purple-300"},zt=J({__name:"ThinkingBlock",props:{thinking:{}},setup(b){const $=b,f=k(!1),x=A(()=>{const u=$.thinking;return u.length<=80?u:u.substring(0,80)+"..."}),l=A(()=>$.thinking.split(`
|
|
2
|
-
`).length);return(u,g)=>{const p=q;return o(),i("div",Pt,[t("button",{class:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-purple-500/10 transition-colors",onClick:g[0]||(g[0]=v=>f.value=!f.value)},[r(p,{icon:f.value?"carbon:chevron-down":"carbon:chevron-right",class:"text-xs text-purple-500"},null,8,["icon"]),r(p,{icon:"carbon:idea",class:"text-purple-500"}),g[1]||(g[1]=t("span",{class:"font-medium text-purple-700 dark:text-purple-300"},"Thinking",-1)),t("span",Ut,C(l.value)+" "+C(l.value===1?"line":"lines"),1)]),f.value?(o(),i("div",Lt,[t("pre",jt,C(b.thinking),1)])):(o(),i("div",Ht,[t("div",Vt,C(x.value),1)]))])}}}),Kt=Object.assign(zt,{__name:"ThinkingBlock"}),Ft={key:0,class:"mb-2"},Wt={class:"flex flex-wrap gap-2 mb-2"},qt={class:"font-mono"},Jt=["title"],Qt=["onClick"],Xt=J({__name:"ComponentContext",props:{components:{}},emits:["remove","toggle-picker","clear-all"],setup(b,{emit:$}){const f=b,x=$;function l(p){const v=p.split("/");return v[v.length-1].replace(".vue","")}function u(p){const v=p.match(/(?:components|pages|layouts|app)\/.*\.vue$/);return v?v[0]:p}const g=A(()=>f.components.length>0);return(p,v)=>{const m=q;return g.value?(o(),i("div",Ft,[t("div",Wt,[(o(!0),i(H,null,G(b.components,h=>(o(),i("div",{key:h.filePath,class:"flex items-center gap-1 px-2 py-1 bg-purple-500/20 text-purple-600 dark:text-purple-400 rounded-md text-sm group"},[r(m,{class:"text-purple-500",icon:"carbon:application"}),t("span",qt,C(l(h.filePath)),1),t("span",{title:h.filePath,class:"text-xs opacity-50 hidden sm:inline"}," ("+C(u(h.filePath))+") ",9,Jt),t("button",{class:"ml-1 opacity-50 hover:opacity-100 hover:text-red-500 transition-opacity",title:"Remove from context",onClick:te(c=>x("remove",h.filePath),["stop"])},[r(m,{icon:"carbon:close"})],8,Qt)]))),128)),b.components.length>1?(o(),i("button",{key:0,class:"flex items-center gap-1 px-2 py-1 text-xs opacity-50 hover:opacity-100 hover:text-red-500 transition-opacity",title:"Clear all components",onClick:v[0]||(v[0]=te(h=>x("clear-all"),["stop"]))},[r(m,{icon:"carbon:trash-can"}),v[1]||(v[1]=E(" Clear all ",-1))])):w("",!0)])])):w("",!0)}}}),Gt=Object.assign(Xt,{__name:"ComponentContext"}),Yt={key:0,class:"absolute bottom-full left-0 mb-1 w-full max-w-md z-50"},Zt={class:"n-bg-base border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden"},eo={class:"px-3 py-2 border-b border-neutral-200 dark:border-neutral-700 text-xs opacity-60 flex items-center gap-2"},to={class:"max-h-48 overflow-y-auto"},oo=["onClick","onMouseenter"],no={class:"truncate"},so={key:0,class:"px-3 py-4 text-center text-sm opacity-50"},lo=J({__name:"DocsAutocomplete",props:{docs:{},inputValue:{},cursorPosition:{},visible:{type:Boolean}},emits:["select","close"],setup(b,{expose:$,emit:f}){const x=b,l=f,u=k(0),g=A(()=>{if(!x.visible)return"";const c=x.inputValue.slice(0,x.cursorPosition).match(/@docs\/(\S*)$/);return c?c[1].toLowerCase():""}),p=A(()=>{const h=g.value;return h?x.docs.filter(c=>c.path.toLowerCase().includes(h)||c.name.toLowerCase().includes(h)):x.docs});ae(p,()=>{u.value=0});function v(h){if(!x.visible||p.value.length===0)return!1;switch(h.key){case"ArrowDown":return h.preventDefault(),u.value=(u.value+1)%p.value.length,!0;case"ArrowUp":return h.preventDefault(),u.value=u.value===0?p.value.length-1:u.value-1,!0;case"Tab":case"Enter":return h.preventDefault(),m(p.value[u.value]),!0;case"Escape":return h.preventDefault(),l("close"),!0}return!1}function m(h){l("select",h.path)}return $({handleKeydown:v}),(h,c)=>{const D=q;return o(),P(re,{name:"dropdown"},{default:M(()=>[b.visible&&p.value.length>0?(o(),i("div",Yt,[t("div",Zt,[t("div",eo,[r(D,{icon:"carbon:document"}),c[0]||(c[0]=t("span",null,"Select a document",-1)),c[1]||(c[1]=t("span",{class:"ml-auto opacity-50"},"Tab/Enter to select",-1))]),t("div",to,[(o(!0),i(H,null,G(p.value,(R,B)=>(o(),i("button",{key:R.path,class:z(["w-full px-3 py-2 text-left flex items-center gap-2 text-sm transition-colors",B===u.value?"bg-blue-500/20 text-blue-600 dark:text-blue-400":"hover:bg-neutral-100 dark:hover:bg-neutral-800"]),type:"button",onClick:N=>m(R),onMouseenter:N=>u.value=B},[r(D,{class:"opacity-50",icon:"carbon:document"}),t("span",no,C(R.path),1)],42,oo))),128))]),p.value.length===0?(o(),i("div",so," No documents found ")):w("",!0)])])):w("",!0)]),_:1})}}}),ao=Object.assign(ie(lo,[["__scopeId","data-v-9157fee2"]]),{__name:"DocsAutocomplete"}),ro={key:0,class:"absolute bottom-full left-0 mb-1 w-full max-w-md z-50"},io={class:"n-bg-base border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden"},co={class:"px-3 py-2 border-b border-neutral-200 dark:border-neutral-700 text-xs opacity-60 flex items-center gap-2"},uo={class:"max-h-48 overflow-y-auto"},po=["onClick","onMouseenter"],vo={class:"flex-1 min-w-0"},fo={class:"font-mono truncate"},mo={key:0,class:"text-xs opacity-50 truncate"},go=J({__name:"CommandsAutocomplete",props:{commands:{},inputValue:{},cursorPosition:{},visible:{type:Boolean}},emits:["select","close"],setup(b,{expose:$,emit:f}){const x=b,l=f,u=k(0),g=A(()=>{if(!x.visible)return"";const D=x.inputValue.slice(0,x.cursorPosition).match(/(?:^|\s)\/(\S*)$/);return D?D[1].toLowerCase():""}),p=A(()=>{const c=g.value;return x.commands.filter(R=>c?R.name.toLowerCase().includes(c)||R.description?.toLowerCase().includes(c):!0)}),v=A(()=>x.visible&&p.value.length>0);ae(p,()=>{u.value=0}),ae([p,g],([c,D])=>{x.visible&&c.length===0&&D.length>0&&l("close")});function m(c){if(!v.value)return!1;switch(c.key){case"ArrowDown":return c.preventDefault(),u.value=(u.value+1)%p.value.length,!0;case"ArrowUp":return c.preventDefault(),u.value=u.value===0?p.value.length-1:u.value-1,!0;case"Tab":case"Enter":return c.preventDefault(),h(p.value[u.value]),!0;case"Escape":return c.preventDefault(),l("close"),!0}return!1}function h(c){l("select",c.name)}return $({handleKeydown:m}),(c,D)=>{const R=q;return o(),P(re,{name:"dropdown"},{default:M(()=>[v.value?(o(),i("div",ro,[t("div",io,[t("div",co,[r(R,{icon:"carbon:terminal"}),D[0]||(D[0]=t("span",null,"Slash Commands",-1)),D[1]||(D[1]=t("span",{class:"ml-auto opacity-50"},"Tab/Enter to select",-1))]),t("div",uo,[(o(!0),i(H,null,G(p.value,(B,N)=>(o(),i("button",{key:B.name,class:z(["w-full px-3 py-2 text-left flex items-center gap-2 text-sm transition-colors",N===u.value?"bg-green-500/20 text-green-600 dark:text-green-400":"hover:bg-neutral-100 dark:hover:bg-neutral-800"]),type:"button",onClick:O=>h(B),onMouseenter:O=>u.value=N},[r(R,{class:"opacity-50 text-green-500",icon:"carbon:terminal"}),t("div",vo,[t("div",fo," /"+C(B.name),1),B.description?(o(),i("div",mo,C(B.description),1)):w("",!0)])],42,po))),128))])])])):w("",!0)]),_:1})}}}),ho=Object.assign(ie(go,[["__scopeId","data-v-58ca4e57"]]),{__name:"CommandsAutocomplete"}),xo={class:"relative flex flex-col h-screen n-bg-base overflow-hidden"},_o={class:"flex flex-col h-full"},bo={class:"flex items-center justify-between p-4"},yo={class:"flex items-center gap-3"},ko={class:"text-xl font-bold flex items-center gap-2"},wo={class:"flex items-center gap-2"},Co={class:"relative"},$o={key:0,class:"px-4 pt-4"},So={key:0,class:"text-xs opacity-50 mb-1"},Do={key:0,class:"ml-1"},To={key:1,class:"ml-2"},Ro={key:1,class:"whitespace-pre-wrap font-mono text-sm"},Bo={key:2,class:"opacity-50"},Io={class:"text-xs opacity-30 mt-1"},Ao={key:0,class:"flex items-center justify-center h-full opacity-50"},No={class:"text-center"},Mo={class:"p-4"},Eo={class:"flex items-center gap-2 mb-2"},Oo={class:"flex gap-2 items-center"},Po={class:"flex-1 relative"},Uo=["disabled"],Lo={key:0,class:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 text-red-500"},jo={class:"text-xs opacity-50 mt-2 flex items-center gap-3"},Ho={key:0,class:"text-green-500/70"},Vo={key:1,class:"text-blue-500/70"},Jo=J({__name:"index",setup(b){const $=he(),f=Je(),x=k([]),l=k(null),u=k([]),g=k([]),p=k(null),v=k(""),m=k(!1),h=k(!1),c=k(!1),D=k(null),R=k(null),B=k(!1),N=k(!1),O=k(null),d=k(!1),_=k([]),I=k(!1),T=k(0),V=k(null),oe=k([]),Q=k(!1),ne=k(null),Y=k(!1),se=k(new Map),xe=A(()=>m.value?c.value?"Processing...":"Ready":"Disconnected"),_e=A(()=>m.value?c.value?"blue":"green":"red");function X(){ee(()=>{D.value&&(D.value.scrollTop=D.value.scrollHeight)})}function be(){return Math.random().toString(36).substring(2,9)}function K(n,e,s=!1){const a={id:be(),role:n,content:e,timestamp:new Date,streaming:s};return u.value.push(a),X(),a}function ye(n){return(n instanceof Date?n:new Date(n)).toLocaleTimeString()}function ke(n,e){if(n)return n.find(s=>s.type==="tool_result"&&s.tool_use_id===e)}function we(){return f.isActive.value&&f.origin.value?f.origin.value:window.location.origin}function Ce(){const n=we();console.log("[claude-client] Connecting to socket at",n,"tunnel active:",f.isActive.value),l.value=Qe(n,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),l.value.on("connect",()=>{console.log("[claude-client] Connected to socket"),m.value=!0,l.value?.emit("docs:list"),l.value?.emit("commands:list")}),l.value.on("disconnect",()=>{console.log("[claude-client] Disconnected from socket"),m.value=!1,h.value=!1,c.value=!1,K("system","Disconnected from server")}),l.value.on("session:status",e=>{console.log("[claude-client] Session status:",e),h.value=e.active,c.value=e.processing}),l.value.on("history:loaded",e=>{console.log("[claude-client] History loaded:",e.id,e.messages.length,"messages"),p.value=e.id,u.value=e.messages.map(s=>({...s,timestamp:new Date(s.timestamp)})),X()}),l.value.on("history:list",e=>{console.log("[claude-client] Conversations list:",e.length),g.value=e}),l.value.on("history:switched",e=>{console.log("[claude-client] Switched to conversation:",e.id),p.value=e.id,u.value=e.messages.map(s=>({...s,timestamp:new Date(s.timestamp)})),B.value=!1,X()}),l.value.on("history:deleted",e=>{console.log("[claude-client] Conversation deleted:",e)}),l.value.on("docs:list",e=>{console.log("[claude-client] Docs list received:",e.length),_.value=e}),l.value.on("commands:list",e=>{console.log("[claude-client] Commands list received:",e.length),oe.value=e}),l.value.on("stream:message_start",e=>{console.log("[claude-client] Message start:",e.id),se.value.clear()}),l.value.on("stream:tool_use",e=>{console.log("[claude-client] Tool use:",e.name);const s={type:"tool_use",id:e.id,name:e.name,input:e.input};se.value.set(e.id,s);const a=u.value.findLast(S=>S.role==="assistant");a&&(a.contentBlocks||(a.contentBlocks=[]),a.contentBlocks.push(s),X())}),l.value.on("stream:tool_result",e=>{console.log("[claude-client] Tool result:",e.tool_use_id,e.is_error?"ERROR":"OK");const s={type:"tool_result",tool_use_id:e.tool_use_id,content:e.content,is_error:e.is_error},a=u.value.findLast(S=>S.role==="assistant");a&&(a.contentBlocks||(a.contentBlocks=[]),a.contentBlocks.push(s),X())}),l.value.on("stream:text_delta",e=>{const s=u.value.findLast(a=>a.role==="assistant");s&&s.streaming&&(s.content+=e.text,X())}),l.value.on("stream:message_complete",e=>{console.log("[claude-client] Message complete:",e.id);const s=u.value.findLast(a=>a.role==="assistant");s&&(s.streaming=!1,s.content=e.content,s.contentBlocks=e.contentBlocks,s.model=e.model),se.value.clear()}),l.value.on("stream:result",e=>{console.log("[claude-client] Result:",e.subtype,"cost:",e.cost_usd,"duration:",e.duration_ms)}),l.value.on("output:chunk",e=>{console.log("[claude-client] Output chunk:",e.length);const s=u.value.findLast(a=>a.role==="assistant");s&&s.streaming||K("assistant",e,!0)}),l.value.on("output:complete",()=>{console.log("[claude-client] Output complete");const e=u.value.findLast(s=>s.role==="assistant");e&&(e.streaming=!1)}),l.value.on("output:error",e=>{console.log("[claude-client] Output error:",e),K("system",`Error: ${e}`)}),l.value.on("session:error",e=>{console.log("[claude-client] Session error:",e),K("system",`Session error: ${e}`)}),l.value.on("session:closed",e=>{console.log("[claude-client] Session closed:",e),K("system",`Session ended (exit code: ${e.exitCode})`)})}function ce(){l.value&&(l.value.emit("session:reset"),u.value=[],B.value=!1)}function $e(){if(!v.value.trim()||c.value||!m.value)return;N.value&&O.value&&(O.value.stop(),N.value=!1);let n=v.value.trim();v.value="",R.value&&(R.value.style.height="auto"),x.value.length>0&&(n=`${x.value.map(s=>`@${s.filePath}`).join(" ")}
|
|
3
|
-
|
|
4
|
-
${n}`),K("user",n),K("assistant","",!0),l.value&&l.value.emit("message:send",n)}function Se(n){I.value&&V.value&&V.value.handleKeydown(n)||Q.value&&ne.value&&ne.value.handleKeydown(n)||n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),$e())}function De(){ue(),Te(),Re()}function Te(){const n=R.value;if(!n)return;T.value=n.selectionStart||0;const s=v.value.slice(0,T.value).match(/@docs\/\S*$/);I.value=!!s,I.value&&(Q.value=!1)}function Re(){const n=R.value;if(!n||I.value)return;T.value=n.selectionStart||0;const s=v.value.slice(0,T.value).match(/(?:^|\s)\/\S*$/);Q.value=!!s}function Be(n){const e=R.value;if(!e)return;const s=v.value.slice(0,T.value),a=v.value.slice(T.value);if(s.match(/@docs\/\S*$/)){const U=s.lastIndexOf("@docs/"),j=s.slice(0,U)+`@docs/${n}`+a;v.value=j,ee(()=>{const F=U+`@docs/${n}`.length;e.setSelectionRange(F,F),e.focus()})}I.value=!1}function Ie(n){const e=R.value;if(!e)return;const s=v.value.slice(0,T.value),a=v.value.slice(T.value),S=s.match(/(?:^|\s)(\/\S*)$/);if(S){const U=s.length-S[1].length,j=s.slice(0,U)+`/${n} `+a;v.value=j,ee(()=>{const F=U+`/${n} `.length;e.setSelectionRange(F,F),e.focus()})}Q.value=!1}function Ae(){I.value=!1}function Ne(){Q.value=!1}function ue(){const n=R.value;n&&(n.style.height="auto",n.style.height=Math.min(n.scrollHeight,200)+"px")}function de(){const n=window.SpeechRecognition||window.webkitSpeechRecognition;if(!n){d.value=!1;return}d.value=!0;const e=new n;e.continuous=!0,e.interimResults=!0,e.lang="ru-RU",e.onresult=s=>{let a="";for(let S=s.resultIndex;S<s.results.length;S++){const U=s.results[S][0].transcript;s.results[S].isFinal&&(a+=U)}a&&(v.value+=a,ee(ue))},e.onerror=s=>{console.error("Speech recognition error:",s.error),N.value=!1},e.onend=()=>{N.value=!1},O.value=e}function Me(){if(O.value||de(),!O.value){alert("Speech recognition is not supported in this browser. Try Chrome or Edge.");return}N.value?(O.value.stop(),N.value=!1):(O.value.start(),N.value=!0)}function Ee(){B.value=!B.value,B.value&&l.value&&l.value.emit("history:list")}function pe(){if(!$.value?.host?.inspector){console.warn("[claude-client] Inspector not available");return}$.value.host.inspector.toggle()}function Oe(n){if(console.log("[claude-client] Component selected:",n),x.value.some(S=>S.filePath===n))return;const e=n.split("/"),a=e[e.length-1].replace(".vue","");x.value.push({filePath:n,name:a,timestamp:Date.now()})}function Pe(n){x.value=x.value.filter(e=>e.filePath!==n)}function Ue(){x.value=[]}function Le(){return window.location.pathname.includes("__claude-devtools")}ge(n=>{console.log("[claude-client] DevTools client connected");const e=n.host.hooks,s=e.callHook.bind(e);e.callHook=async(a,...S)=>{if(a==="host:inspector:click"&&S[0]&&Le()){const U=S[0];console.log("[claude-client] Intercepted callHook:",a,U),Oe(U),n.host.inspector?.disable();return}return s(a,...S)},console.log("[claude-client] Monkey-patched hooks.callHook")});function je(n){l.value&&l.value.emit("history:switch",n)}function He(n){l.value&&l.value.emit("history:delete",n)}return Ze(()=>{Ce(),de()}),et(()=>{l.value&&l.value.disconnect(),O.value&&N.value&&O.value.stop()}),(n,e)=>{const s=ht,a=q,S=fe,U=me,j=nt,F=Xe,le=st,Ve=Ot,ze=Kt,Ke=Gt,Fe=ao,We=ho;return o(),i("div",xo,[r(s,{"active-id":p.value,conversations:g.value,"is-open":B.value,onClose:e[0]||(e[0]=y=>B.value=!1),onDelete:He,onNew:ce,onSelect:je},null,8,["active-id","conversations","is-open"]),t("div",_o,[t("div",bo,[t("div",yo,[r(S,{n:"gray",title:"Chat History",onClick:Ee},{default:M(()=>[r(a,{icon:"carbon:recently-viewed"})]),_:1}),t("h1",ko,[r(a,{class:"text-green",icon:"carbon:machine-learning-model"}),e[4]||(e[4]=E(" Claude AI ",-1))]),r(U,{n:_e.value},{default:M(()=>[E(C(xe.value),1)]),_:1},8,["n"])]),t("div",wo,[r(S,{disabled:!m.value||c.value,n:"blue",onClick:ce},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:add"}),e[5]||(e[5]=E(" New Chat ",-1))]),_:1},8,["disabled"]),r(j,{to:"/docs"},{default:M(()=>[r(S,{n:"gray"},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:document"}),e[6]||(e[6]=E(" Docs ",-1))]),_:1})]),_:1}),t("div",Co,[r(S,{n:"gray",onClick:e[1]||(e[1]=y=>Y.value=!Y.value)},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:overflow-menu-horizontal"}),e[7]||(e[7]=E(" More ",-1)),r(a,{class:z([{"rotate-180":Y.value},"ml-1 transition-transform"]),icon:"carbon:chevron-down"},null,8,["class"])]),_:1}),Y.value?(o(),i("div",{key:0,class:"absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg n-bg-base border border-neutral-200 dark:border-neutral-800 shadow-lg overflow-hidden",onClick:e[2]||(e[2]=y=>Y.value=!1)},[r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/mcp"},{default:M(()=>[r(a,{class:"text-blue-500",icon:"carbon:plug"}),e[8]||(e[8]=E(" MCP Servers ",-1))]),_:1}),r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/commands"},{default:M(()=>[r(a,{class:"text-green-500",icon:"carbon:terminal"}),e[9]||(e[9]=E(" Commands ",-1))]),_:1}),r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/skills"},{default:M(()=>[r(a,{class:"text-orange-500",icon:"carbon:lightning"}),e[10]||(e[10]=E(" Skills ",-1))]),_:1}),r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/agents"},{default:M(()=>[r(a,{class:"text-purple-500",icon:"carbon:bot"}),e[11]||(e[11]=E(" Agents ",-1))]),_:1})])):w("",!0)])])]),ve($)?w("",!0):(o(),i("div",$o,[r(F,{n:"yellow"},{default:M(()=>[...e[12]||(e[12]=[E(" Open this page inside Nuxt DevTools for best experience. ",-1)])]),_:1})])),t("div",{ref_key:"messagesContainer",ref:D,class:"flex-1 overflow-auto p-4 space-y-4"},[(o(!0),i(H,null,G(u.value,y=>(o(),i("div",{key:y.id,class:z([y.role==="user"?"justify-end":"justify-start","flex"])},[t("div",{class:z([{"bg-green-500/20 text-green-800 dark:text-green-100":y.role==="user","n-bg-active":y.role==="assistant","bg-yellow-500/20 text-yellow-800 dark:text-yellow-200 text-sm":y.role==="system"},"max-w-[85%] rounded-lg px-4 py-2"])},[y.role==="assistant"?(o(),i("div",So,[e[13]||(e[13]=E(" Claude ",-1)),y.model?(o(),i("span",Do,"("+C(y.model.split("-").slice(0,2).join("-"))+")",1)):w("",!0),y.streaming?(o(),i("span",To,[r(a,{class:"animate-pulse",icon:"carbon:circle-filled"})])):w("",!0)])):w("",!0),y.contentBlocks&&y.contentBlocks.length>0?(o(),i(H,{key:1},[(o(!0),i(H,null,G(y.contentBlocks,(L,qe)=>(o(),i(H,{key:qe},[L.type==="text"&&L.text?(o(),P(le,{key:0,content:L.text},null,8,["content"])):L.type==="tool_use"?(o(),P(Ve,{key:1,"tool-result":ke(y.contentBlocks,L.id),"tool-use":L},null,8,["tool-result","tool-use"])):L.type==="thinking"&&L.thinking?(o(),P(ze,{key:2,thinking:L.thinking},null,8,["thinking"])):w("",!0)],64))),128)),y.content&&!y.contentBlocks.some(L=>L.type==="text")?(o(),P(le,{key:0,content:y.content},null,8,["content"])):w("",!0)],64)):(o(),i(H,{key:2},[y.role==="assistant"&&y.content?(o(),P(le,{key:0,content:y.content},null,8,["content"])):y.content?(o(),i("div",Ro,C(y.content),1)):w("",!0),y.streaming&&!y.content?(o(),i("span",Bo,"Thinking...")):w("",!0)],64)),t("div",Io,C(ye(y.timestamp)),1)],2)],2))),128)),u.value.length===0?(o(),i("div",Ao,[t("div",No,[r(a,{class:"text-4xl mb-2",icon:"carbon:chat"}),e[14]||(e[14]=t("p",null,"Send a message to start chatting with Claude",-1))])])):w("",!0)],512),t("div",Mo,[r(Ke,{components:x.value,onRemove:Pe,onClearAll:Ue,onTogglePicker:pe},null,8,["components"]),t("div",Eo,[ve($)?(o(),P(S,{key:0,disabled:!m.value,n:"purple",title:"Select a component from the page to add as context",onClick:pe},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:touch-1"}),e[15]||(e[15]=E(" "+C("Add Component"),-1))]),_:1},8,["disabled"])):w("",!0)]),t("div",Oo,[t("div",Po,[r(Fe,{ref_key:"docsAutocompleteRef",ref:V,"cursor-position":T.value,docs:_.value,"input-value":v.value,visible:I.value,onClose:Ae,onSelect:Be},null,8,["cursor-position","docs","input-value","visible"]),r(We,{ref_key:"commandsAutocompleteRef",ref:ne,commands:oe.value,"cursor-position":T.value,"input-value":v.value,visible:Q.value,onClose:Ne,onSelect:Ie},null,8,["commands","cursor-position","input-value","visible"]),tt(t("textarea",{ref_key:"textareaRef",ref:R,"onUpdate:modelValue":e[3]||(e[3]=y=>v.value=y),class:z([{"opacity-50":!m.value||c.value},"w-full px-3 py-2 n-bg-base border border-neutral-200 dark:border-neutral-800 rounded-lg font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"]),disabled:!m.value||c.value,placeholder:"Type your message... (Shift+Enter for new line)",rows:"1",style:{"min-height":"42px","max-height":"200px"},onInput:De,onKeydown:Se},null,42,Uo),[[ot,v.value]]),N.value?(o(),i("div",Lo,[...e[16]||(e[16]=[t("span",{class:"w-2 h-2 bg-red-500 rounded-full animate-pulse"},null,-1),t("span",{class:"text-xs"},"Recording...",-1)])])):w("",!0)]),d.value?(o(),P(S,{key:0,disabled:!m.value||c.value,n:N.value?"red":"gray",title:N.value?"Stop recording":"Start voice input",class:"h-[42px] -mt-[6px]",onClick:Me},{default:M(()=>[r(a,{icon:N.value?"carbon:stop-filled":"carbon:microphone"},null,8,["icon"])]),_:1},8,["disabled","n","title"])):w("",!0)]),t("div",jo,[t("span",null,"Enter to send | Shift+Enter for new line"+C(d.value?" | Click mic for voice input":""),1),oe.value.length>0?(o(),i("span",Ho,[r(a,{class:"mr-1",icon:"carbon:terminal"}),e[17]||(e[17]=E("Type / for commands ",-1))])):w("",!0),_.value.length>0?(o(),i("span",Vo,[r(a,{class:"mr-1",icon:"carbon:document"}),e[18]||(e[18]=E("@docs/ for docs ",-1))])):w("",!0)])])])])}}});export{Jo as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{_ as H}from"./TvBJGid1.js";import{u as J,l as K,a as O,b as Q,_ as X}from"./XJ4dJUK2.js";import{_ as Z}from"./BZrcCMrf.js";import{_ as ee}from"./BbEuL4Z6.js";import{_ as oe}from"./DImlDIT-.js";import{g as le,r as f,j as ne,k as te,c as i,a as o,b as t,w as u,d,l as w,F as g,p as E,t as p,m as j,x as $,s as A,o as a,n as F,y as se}from"./e7kgpy_n.js";const ae={class:"relative flex flex-col h-screen n-bg-base"},ie={class:"flex items-center justify-between p-4"},de={class:"flex items-center gap-3"},re={class:"text-xl font-bold flex items-center gap-2"},ue={class:"flex items-center gap-2"},me={class:"flex-1 overflow-auto p-4"},ce={class:"flex gap-4 h-full"},ve={class:"w-64 flex-shrink-0 space-y-4"},fe={key:0,class:"n-bg-active rounded-lg p-4 opacity-50 text-sm"},pe={class:"space-y-1"},be=["onClick"],xe={class:"flex items-center justify-between"},_e={class:"flex items-center gap-2 truncate"},ge={class:"font-mono"},we={key:0,class:"text-xs opacity-50 pl-6 truncate"},ke={class:"flex-1 flex flex-col n-bg-active rounded-lg overflow-hidden"},ye={class:"flex-1 overflow-auto"},Ce={class:"p-4 border-b border-neutral-200 dark:border-neutral-800"},Te={key:0,class:"mb-4"},Ve={class:"space-y-4"},he={class:"text-xs opacity-50 mt-1"},Ne={class:"p-4"},Be={class:"p-4 border-t border-neutral-200 dark:border-neutral-800 flex gap-2 flex-shrink-0"},Se={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between"},Ue={class:"font-bold font-mono"},De={key:0,class:"text-sm opacity-70"},Ee={class:"text-xs opacity-50 mt-1"},je={class:"flex gap-2"},$e={key:0,class:"px-4 pt-4"},Ae={class:"flex-1 p-4 overflow-auto"},Fe={class:"space-y-4 mb-4"},Le={key:0,class:"mb-4"},Me={class:"flex flex-wrap gap-1"},Pe={key:2,class:"flex-1 flex items-center justify-center opacity-50"},Re={class:"text-center"},Je=le({__name:"commands",setup(qe){const h=J(),r=f(null),T=f(!1),k=f(!1),N=f([]),n=f(null),b=f(!1),V=f(!1),m=f({name:"",description:"",content:"",allowedTools:""}),c=f({name:"",description:"",content:"",allowedTools:""}),v=f("");function L(){return h.isActive.value&&h.origin.value?h.origin.value:window.location.origin}function M(){const s=L();console.log("[commands-client] Connecting to socket at",s),r.value=K(s,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),r.value.on("connect",()=>{console.log("[commands-client] Connected"),T.value=!0,S()}),r.value.on("disconnect",()=>{console.log("[commands-client] Disconnected"),T.value=!1}),r.value.on("commands:list",e=>{console.log("[commands-client] Commands list received",e),N.value=e,k.value=!1}),r.value.on("commands:saved",e=>{e.success&&e.command?(n.value=e.command,b.value=!1,V.value=!1,U(),v.value=""):v.value=e.error||"Failed to save command"}),r.value.on("commands:deleted",e=>{e.success&&n.value?.name===e.name&&(n.value=null)})}function S(){r.value&&(k.value=!0,r.value.emit("commands:list"))}function U(){m.value={name:"",description:"",content:"",allowedTools:""},v.value=""}function P(s){n.value=s,c.value={name:s.name,description:s.description||"",content:s.content,allowedTools:s.allowedTools?.join(", ")||""},b.value=!1}function R(){n.value&&(c.value={name:n.value.name,description:n.value.description||"",content:n.value.content,allowedTools:n.value.allowedTools?.join(", ")||""},b.value=!0)}function D(){const s=b.value?c.value:m.value;if(!s.name){v.value="Name is required";return}if(!s.content){v.value="Content is required";return}if(r.value){const e=s.allowedTools.split(",").map(y=>y.trim()).filter(y=>y.length>0);r.value.emit("commands:save",{name:s.name,content:s.content,description:s.description||void 0,allowedTools:e.length>0?e:void 0})}}function q(){n.value&&(c.value={name:n.value.name,description:n.value.description||"",content:n.value.content,allowedTools:n.value.allowedTools?.join(", ")||""}),b.value=!1,v.value=""}function z(s){confirm(`Delete command "/${s}"?`)&&r.value&&r.value.emit("commands:delete",s)}function I(s){return new Date(s).toLocaleDateString()}return ne(()=>{M()}),te(()=>{r.value&&r.value.disconnect()}),(s,e)=>{const y=H,x=X,_=O,B=Q,C=Z,W=ee,Y=oe;return a(),i("div",ae,[o("div",ie,[o("div",de,[t(y,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:u(()=>[...e[9]||(e[9]=[d(" ← Chat ",-1)])]),_:1}),o("h1",re,[t(x,{class:"text-green",icon:"carbon:terminal"}),e[10]||(e[10]=d(" Slash Commands ",-1))])]),o("div",ue,[t(_,{disabled:!T.value,n:"green",onClick:e[0]||(e[0]=l=>{V.value=!0,n.value=null})},{default:u(()=>[t(x,{class:"mr-1",icon:"carbon:add"}),e[11]||(e[11]=d(" New Command ",-1))]),_:1},8,["disabled"]),t(_,{disabled:!T.value||k.value,n:"gray",onClick:S},{default:u(()=>[t(x,{class:F([{"animate-spin":k.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[12]||(e[12]=d(" Refresh ",-1))]),_:1},8,["disabled"])])]),o("div",me,[o("div",ce,[o("div",ve,[t(B,{class:"text-xs",icon:"carbon:information",n:"green"},{default:u(()=>[...e[13]||(e[13]=[d(" Slash commands are markdown files with YAML frontmatter. ",-1),o("br",null,null,-1),d(" Stored as ",-1),o("code",{class:"font-mono"},".claude/commands/<name>.md",-1)])]),_:1}),N.value.length===0&&!k.value?(a(),i("div",fe,[...e[14]||(e[14]=[d(" No slash commands yet. ",-1),o("br",null,null,-1),d(" Create one to get started. ",-1)])])):w("",!0),o("div",pe,[(a(!0),i(g,null,E(N.value,l=>(a(),i("div",{key:l.name,class:F([n.value?.name===l.name?"n-bg-active ring-1 ring-green-500":"hover:n-bg-active","rounded-lg p-2 cursor-pointer group"]),onClick:G=>P(l)},[o("div",xe,[o("div",_e,[t(x,{class:"opacity-50 text-green-500",icon:"carbon:terminal"}),o("span",ge,"/"+p(l.name),1)]),t(_,{class:"opacity-0 group-hover:opacity-100",n:"red xs",onClick:se(G=>z(l.name),["stop"])},{default:u(()=>[t(x,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]),l.description?(a(),i("div",we,p(l.description),1)):w("",!0)],10,be))),128))])]),o("div",ke,[V.value?(a(),i(g,{key:0},[o("div",ye,[o("div",Ce,[e[19]||(e[19]=o("h3",{class:"font-bold mb-4"}," Create New Slash Command ",-1)),v.value?(a(),i("div",Te,[t(B,{icon:"carbon:warning",n:"red"},{default:u(()=>[d(p(v.value),1)]),_:1})])):w("",!0),o("div",Ve,[o("div",null,[e[15]||(e[15]=o("label",{class:"block text-sm font-medium mb-1"},"Command Name",-1)),t(C,{modelValue:m.value.name,"onUpdate:modelValue":e[1]||(e[1]=l=>m.value.name=l),class:"w-full font-mono",placeholder:"e.g. review, deploy, test"},null,8,["modelValue"]),o("div",he," Will be invoked as /"+p(m.value.name||"command-name"),1)]),o("div",null,[e[16]||(e[16]=o("label",{class:"block text-sm font-medium mb-1"},"Description (optional)",-1)),t(C,{modelValue:m.value.description,"onUpdate:modelValue":e[2]||(e[2]=l=>m.value.description=l),class:"w-full",placeholder:"Brief description of what this command does"},null,8,["modelValue"])]),o("div",null,[e[17]||(e[17]=o("label",{class:"block text-sm font-medium mb-1"},"Allowed Tools (optional)",-1)),t(C,{modelValue:m.value.allowedTools,"onUpdate:modelValue":e[3]||(e[3]=l=>m.value.allowedTools=l),class:"w-full font-mono",placeholder:"e.g. Bash(git:*), Read, Edit"},null,8,["modelValue"]),e[18]||(e[18]=o("div",{class:"text-xs opacity-50 mt-1"}," Comma-separated list of allowed tools ",-1))])])]),o("div",Ne,[e[20]||(e[20]=o("label",{class:"block text-sm font-medium mb-1"},"Command Prompt",-1)),j(o("textarea",{"onUpdate:modelValue":e[4]||(e[4]=l=>m.value.content=l),class:"w-full min-h-[200px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-y",placeholder:`Write the prompt for this command...
|
|
2
|
-
|
|
3
|
-
Example:
|
|
4
|
-
Review the current code changes and provide feedback on:
|
|
5
|
-
1. Code quality
|
|
6
|
-
2. Potential bugs
|
|
7
|
-
3. Performance issues`},null,512),[[$,m.value.content]])])]),o("div",Be,[t(_,{n:"green",onClick:D},{default:u(()=>[...e[21]||(e[21]=[d(" Create Command ",-1)])]),_:1}),t(_,{n:"gray",onClick:e[5]||(e[5]=l=>{V.value=!1,U()})},{default:u(()=>[...e[22]||(e[22]=[d(" Cancel ",-1)])]),_:1})])],64)):n.value?(a(),i(g,{key:1},[o("div",Se,[o("div",null,[o("h3",Ue," /"+p(n.value.name),1),n.value.description?(a(),i("div",De,p(n.value.description),1)):w("",!0),o("div",Ee," Updated: "+p(I(n.value.updatedAt)),1)]),o("div",je,[b.value?(a(),i(g,{key:0},[t(_,{n:"green",onClick:D},{default:u(()=>[t(x,{class:"mr-1",icon:"carbon:save"}),e[23]||(e[23]=d(" Save ",-1))]),_:1}),t(_,{n:"gray",onClick:q},{default:u(()=>[...e[24]||(e[24]=[d(" Cancel ",-1)])]),_:1})],64)):(a(),A(_,{key:1,n:"blue",onClick:R},{default:u(()=>[t(x,{class:"mr-1",icon:"carbon:edit"}),e[25]||(e[25]=d(" Edit ",-1))]),_:1}))])]),v.value&&b.value?(a(),i("div",$e,[t(B,{icon:"carbon:warning",n:"red"},{default:u(()=>[d(p(v.value),1)]),_:1})])):w("",!0),o("div",Ae,[b.value?(a(),i(g,{key:0},[o("div",Fe,[o("div",null,[e[26]||(e[26]=o("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),t(C,{modelValue:c.value.description,"onUpdate:modelValue":e[6]||(e[6]=l=>c.value.description=l),class:"w-full",placeholder:"Brief description"},null,8,["modelValue"])]),o("div",null,[e[27]||(e[27]=o("label",{class:"block text-sm font-medium mb-1"},"Allowed Tools",-1)),t(C,{modelValue:c.value.allowedTools,"onUpdate:modelValue":e[7]||(e[7]=l=>c.value.allowedTools=l),class:"w-full font-mono",placeholder:"e.g. Bash(git:*), Read, Edit"},null,8,["modelValue"])])]),e[28]||(e[28]=o("label",{class:"block text-sm font-medium mb-1"},"Command Prompt",-1)),j(o("textarea",{"onUpdate:modelValue":e[8]||(e[8]=l=>c.value.content=l),class:"w-full h-full min-h-[300px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none"},null,512),[[$,c.value.content]])],64)):(a(),i(g,{key:1},[n.value.allowedTools&&n.value.allowedTools.length>0?(a(),i("div",Le,[e[29]||(e[29]=o("div",{class:"text-xs font-medium opacity-50 mb-1"}," Allowed Tools ",-1)),o("div",Me,[(a(!0),i(g,null,E(n.value.allowedTools,l=>(a(),A(W,{key:l,class:"font-mono text-xs",n:"blue"},{default:u(()=>[d(p(l),1)]),_:2},1024))),128))])])):w("",!0),t(Y,{content:n.value.content,class:"max-w-none"},null,8,["content"])],64))])],64)):(a(),i("div",Pe,[o("div",Re,[t(x,{class:"text-4xl mb-2",icon:"carbon:terminal"}),e[30]||(e[30]=o("p",null,"Select a command or create a new one",-1))])]))])])])])}}});export{Je as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{_ as R}from"./TvBJGid1.js";import{u as W,l as Y,a as J,b as Q,_ as X}from"./XJ4dJUK2.js";import{_ as Z}from"./BZrcCMrf.js";import{_ as ee}from"./BbEuL4Z6.js";import{_ as le}from"./DImlDIT-.js";import{g as te,r as p,j as ne,k as oe,c as r,a as l,b as o,w as d,d as a,l as x,F as _,p as se,m as V,E as $,x as F,t as b,s as D,o as i,n as I,y as ae}from"./e7kgpy_n.js";const ie={class:"relative flex flex-col h-screen n-bg-base"},ue={class:"flex items-center justify-between p-4"},re={class:"flex items-center gap-3"},de={class:"text-xl font-bold flex items-center gap-2"},ce={class:"flex items-center gap-2"},me={class:"flex-1 overflow-auto p-4"},ve={class:"flex gap-4 h-full"},pe={class:"w-64 flex-shrink-0 space-y-4"},fe={key:0,class:"n-bg-active rounded-lg p-4 opacity-50 text-sm"},be={class:"space-y-1"},ge=["onClick"],ke={class:"flex items-center justify-between"},xe={class:"flex items-center gap-2 truncate"},_e={class:"font-medium"},we={key:0,class:"text-xs opacity-50 pl-6 truncate"},ye={class:"flex-1 flex flex-col n-bg-active rounded-lg overflow-hidden"},Ce={class:"flex-1 overflow-auto"},Se={class:"p-4 border-b border-neutral-200 dark:border-neutral-800"},Ve={key:0,class:"mb-4"},He={class:"space-y-4"},Ne={class:"p-4"},Ue={class:"p-4 border-t border-neutral-200 dark:border-neutral-800 flex gap-2 flex-shrink-0"},De={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between"},Me={class:"font-bold flex items-center gap-2"},Ae={key:0,class:"text-sm opacity-70"},Be={class:"flex gap-2"},Ee={key:0,class:"px-4 pt-4"},$e={class:"flex-1 p-4 overflow-auto"},Fe={class:"space-y-4 mb-4"},Ie={class:"flex flex-wrap gap-2 mb-4"},Le={class:"text-xs opacity-50 mb-4"},Te={key:2,class:"flex-1 flex items-center justify-center opacity-50"},je={class:"text-center"},Re=te({__name:"skills",setup(qe){const H=W(),u=p(null),C=p(!1),w=p(!1),N=p([]),t=p(null),g=p(!1),S=p(!1),c=p({name:"",description:"",content:"",argumentHint:"",model:""}),m=p({name:"",description:"",content:"",argumentHint:"",model:""}),v=p("");function L(){return H.isActive.value&&H.origin.value?H.origin.value:window.location.origin}function T(){const s=L();console.log("[skills-client] Connecting to socket at",s),u.value=Y(s,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),u.value.on("connect",()=>{console.log("[skills-client] Connected"),C.value=!0,M()}),u.value.on("disconnect",()=>{console.log("[skills-client] Disconnected"),C.value=!1}),u.value.on("skills:list",e=>{console.log("[skills-client] Skills list received",e),N.value=e,w.value=!1}),u.value.on("skills:saved",e=>{e.success&&e.skill?(t.value=e.skill,g.value=!1,S.value=!1,A(),v.value=""):v.value=e.error||"Failed to save skill"}),u.value.on("skills:deleted",e=>{e.success&&t.value?.name===e.name&&(t.value=null)})}function M(){u.value&&(w.value=!0,u.value.emit("skills:list"))}function A(){c.value={name:"",description:"",content:"",argumentHint:"",model:""},v.value=""}function j(s){t.value=s,m.value={name:s.name,description:s.description,content:s.content,argumentHint:s.argumentHint||"",model:s.model||""},g.value=!1}function q(){t.value&&(m.value={name:t.value.name,description:t.value.description,content:t.value.content,argumentHint:t.value.argumentHint||"",model:t.value.model||""},g.value=!0)}function B(){const s=g.value?m.value:c.value;if(!s.name){v.value="Name is required";return}if(!s.description){v.value="Description is required";return}if(!s.content){v.value="Content is required";return}u.value&&u.value.emit("skills:save",{name:s.name,description:s.description,content:s.content,argumentHint:s.argumentHint||void 0,model:s.model||void 0})}function h(){t.value&&(m.value={name:t.value.name,description:t.value.description,content:t.value.content,argumentHint:t.value.argumentHint||"",model:t.value.model||""}),g.value=!1,v.value=""}function z(s){return new Date(s).toLocaleDateString()}function O(s){confirm(`Delete skill "${s}"?`)&&u.value&&u.value.emit("skills:delete",s)}return ne(()=>{T()}),oe(()=>{u.value&&u.value.disconnect()}),(s,e)=>{const G=R,f=X,k=J,U=Q,y=Z,E=ee,K=le;return i(),r("div",ie,[l("div",ue,[l("div",re,[o(G,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:d(()=>[...e[11]||(e[11]=[a(" ← Chat ",-1)])]),_:1}),l("h1",de,[o(f,{class:"text-orange",icon:"carbon:lightning"}),e[12]||(e[12]=a(" Skills ",-1))])]),l("div",ce,[o(k,{disabled:!C.value,n:"orange",onClick:e[0]||(e[0]=n=>{S.value=!0,t.value=null})},{default:d(()=>[o(f,{class:"mr-1",icon:"carbon:add"}),e[13]||(e[13]=a(" New Skill ",-1))]),_:1},8,["disabled"]),o(k,{disabled:!C.value||w.value,n:"gray",onClick:M},{default:d(()=>[o(f,{class:I([{"animate-spin":w.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[14]||(e[14]=a(" Refresh ",-1))]),_:1},8,["disabled"])])]),l("div",me,[l("div",ve,[l("div",pe,[o(U,{class:"text-xs",icon:"carbon:information",n:"orange"},{default:d(()=>[...e[15]||(e[15]=[a(" Skills extend Claude's capabilities with custom knowledge. ",-1),l("br",null,null,-1),a(" Stored as ",-1),l("code",{class:"font-mono"},".claude/skills/<name>/SKILL.md",-1)])]),_:1}),N.value.length===0&&!w.value?(i(),r("div",fe,[...e[16]||(e[16]=[a(" No skills configured yet. ",-1),l("br",null,null,-1),a(" Create one to get started. ",-1)])])):x("",!0),l("div",be,[(i(!0),r(_,null,se(N.value,n=>(i(),r("div",{key:n.name,class:I([t.value?.name===n.name?"n-bg-active ring-1 ring-orange-500":"hover:n-bg-active","rounded-lg p-2 cursor-pointer group"]),onClick:P=>j(n)},[l("div",ke,[l("div",xe,[o(f,{class:"opacity-50 text-orange-500",icon:"carbon:lightning"}),l("span",_e,b(n.name),1)]),o(k,{class:"opacity-0 group-hover:opacity-100",n:"red xs",onClick:ae(P=>O(n.name),["stop"])},{default:d(()=>[o(f,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]),n.description?(i(),r("div",we,b(n.description),1)):x("",!0)],10,ge))),128))])]),l("div",ye,[S.value?(i(),r(_,{key:0},[l("div",Ce,[l("div",Se,[e[23]||(e[23]=l("h3",{class:"font-bold mb-4"}," Create New Skill ",-1)),v.value?(i(),r("div",Ve,[o(U,{icon:"carbon:warning",n:"red"},{default:d(()=>[a(b(v.value),1)]),_:1})])):x("",!0),l("div",He,[l("div",null,[e[17]||(e[17]=l("label",{class:"block text-sm font-medium mb-1"},"Name",-1)),o(y,{modelValue:c.value.name,"onUpdate:modelValue":e[1]||(e[1]=n=>c.value.name=n),class:"w-full font-mono",placeholder:"e.g. vue-expert, code-reviewer"},null,8,["modelValue"])]),l("div",null,[e[18]||(e[18]=l("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),o(y,{modelValue:c.value.description,"onUpdate:modelValue":e[2]||(e[2]=n=>c.value.description=n),class:"w-full",placeholder:"Brief description of what this skill does"},null,8,["modelValue"])]),l("div",null,[e[19]||(e[19]=l("label",{class:"block text-sm font-medium mb-1"},"Argument Hint (optional)",-1)),o(y,{modelValue:c.value.argumentHint,"onUpdate:modelValue":e[3]||(e[3]=n=>c.value.argumentHint=n),class:"w-full",placeholder:"e.g. <query>"},null,8,["modelValue"]),e[20]||(e[20]=l("div",{class:"text-xs opacity-50 mt-1"}," Hint for argument when using /skillname ",-1))]),l("div",null,[e[22]||(e[22]=l("label",{class:"block text-sm font-medium mb-1"},"Model (optional)",-1)),V(l("select",{"onUpdate:modelValue":e[4]||(e[4]=n=>c.value.model=n),class:"w-full p-2 n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800"},[...e[21]||(e[21]=[l("option",{value:""}," Inherit (default) ",-1),l("option",{value:"sonnet"}," Sonnet ",-1),l("option",{value:"opus"}," Opus ",-1),l("option",{value:"haiku"}," Haiku ",-1)])],512),[[$,c.value.model]])])])]),l("div",Ne,[e[24]||(e[24]=l("label",{class:"block text-sm font-medium mb-1"},"Content (Markdown)",-1)),V(l("textarea",{"onUpdate:modelValue":e[5]||(e[5]=n=>c.value.content=n),class:"w-full min-h-[200px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-y",placeholder:`Write the skill instructions in markdown...
|
|
2
|
-
|
|
3
|
-
Example:
|
|
4
|
-
You are an expert in Vue 3 Composition API.
|
|
5
|
-
|
|
6
|
-
## Guidelines
|
|
7
|
-
- Always use <script setup>
|
|
8
|
-
- Follow TypeScript best practices`},null,512),[[F,c.value.content]])])]),l("div",Ue,[o(k,{n:"orange",onClick:B},{default:d(()=>[...e[25]||(e[25]=[a(" Create Skill ",-1)])]),_:1}),o(k,{n:"gray",onClick:e[6]||(e[6]=n=>{S.value=!1,A()})},{default:d(()=>[...e[26]||(e[26]=[a(" Cancel ",-1)])]),_:1})])],64)):t.value?(i(),r(_,{key:1},[l("div",De,[l("div",null,[l("h3",Me,[o(f,{class:"text-orange-500",icon:"carbon:lightning"}),a(" "+b(t.value.name),1)]),t.value.description?(i(),r("div",Ae,b(t.value.description),1)):x("",!0)]),l("div",Be,[g.value?(i(),r(_,{key:0},[o(k,{n:"green",onClick:B},{default:d(()=>[o(f,{class:"mr-1",icon:"carbon:save"}),e[27]||(e[27]=a(" Save ",-1))]),_:1}),o(k,{n:"gray",onClick:h},{default:d(()=>[...e[28]||(e[28]=[a(" Cancel ",-1)])]),_:1})],64)):(i(),D(k,{key:1,n:"blue",onClick:q},{default:d(()=>[o(f,{class:"mr-1",icon:"carbon:edit"}),e[29]||(e[29]=a(" Edit ",-1))]),_:1}))])]),v.value&&g.value?(i(),r("div",Ee,[o(U,{icon:"carbon:warning",n:"red"},{default:d(()=>[a(b(v.value),1)]),_:1})])):x("",!0),l("div",$e,[g.value?(i(),r(_,{key:0},[l("div",Fe,[l("div",null,[e[30]||(e[30]=l("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),o(y,{modelValue:m.value.description,"onUpdate:modelValue":e[7]||(e[7]=n=>m.value.description=n),class:"w-full",placeholder:"Brief description"},null,8,["modelValue"])]),l("div",null,[e[31]||(e[31]=l("label",{class:"block text-sm font-medium mb-1"},"Argument Hint",-1)),o(y,{modelValue:m.value.argumentHint,"onUpdate:modelValue":e[8]||(e[8]=n=>m.value.argumentHint=n),class:"w-full",placeholder:"e.g. <query>"},null,8,["modelValue"])]),l("div",null,[e[33]||(e[33]=l("label",{class:"block text-sm font-medium mb-1"},"Model",-1)),V(l("select",{"onUpdate:modelValue":e[9]||(e[9]=n=>m.value.model=n),class:"w-full p-2 n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800"},[...e[32]||(e[32]=[l("option",{value:""}," Inherit (default) ",-1),l("option",{value:"sonnet"}," Sonnet ",-1),l("option",{value:"opus"}," Opus ",-1),l("option",{value:"haiku"}," Haiku ",-1)])],512),[[$,m.value.model]])])]),e[34]||(e[34]=l("label",{class:"block text-sm font-medium mb-1"},"Content (Markdown)",-1)),V(l("textarea",{"onUpdate:modelValue":e[10]||(e[10]=n=>m.value.content=n),class:"w-full h-full min-h-[300px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none"},null,512),[[F,m.value.content]])],64)):(i(),r(_,{key:1},[l("div",Ie,[t.value.model?(i(),D(E,{key:0,n:"blue"},{default:d(()=>[a(" Model: "+b(t.value.model),1)]),_:1})):x("",!0),t.value.argumentHint?(i(),D(E,{key:1,n:"gray"},{default:d(()=>[a(" Arg: "+b(t.value.argumentHint),1)]),_:1})):x("",!0)]),l("div",Le," Updated: "+b(z(t.value.updatedAt)),1),o(K,{content:t.value.content,class:"max-w-none"},null,8,["content"])],64))])],64)):(i(),r("div",Te,[l("div",je,[o(f,{class:"text-4xl mb-2",icon:"carbon:lightning"}),e[35]||(e[35]=l("p",null,"Select a skill or create a new one",-1))])]))])])])])}}});export{Re as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as O,N as q,z as j,r as B,e as k,j as N,O as T,P as U,Q as E,R as I,L,S as A,U as V,V as w,W as D,q as b,X as P,Y as F,M as H,Z as z,$ as M,a0 as W,a1 as $}from"./e7kgpy_n.js";const Q=(...t)=>t.find(o=>o!==void 0);function G(t){const o=t.componentName||"NuxtLink";function v(e){return typeof e=="string"&&e.startsWith("#")}function S(e,u,f){const r=f??t.trailingSlash;if(!e||r!=="append"&&r!=="remove")return e;if(typeof e=="string")return R(e,r);const l="path"in e&&e.path!==void 0?e.path:u(e).path;return{...e,name:void 0,path:R(l,r)}}function C(e){const u=q(),f=H(),r=b(()=>!!e.target&&e.target!=="_self"),l=b(()=>{const i=e.to||e.href||"";return typeof i=="string"&&P(i,{acceptRelative:!0})}),m=A("RouterLink"),h=typeof m!="string"?m.useLink:void 0,c=b(()=>{if(e.external)return!0;const i=e.to||e.href||"";return typeof i=="object"?!1:i===""||l.value}),n=b(()=>{const i=e.to||e.href||"";return c.value?i:S(i,u.resolve,e.trailingSlash)}),g=c.value?void 0:h?.({...e,to:n}),y=b(()=>{const i=e.trailingSlash??t.trailingSlash;if(!n.value||l.value||v(n.value))return n.value;if(c.value){const p=typeof n.value=="object"&&"path"in n.value?w(n.value):n.value,x=typeof p=="object"?u.resolve(p).href:p;return R(x,i)}return typeof n.value=="object"?u.resolve(n.value)?.href??null:R(F(f.app.baseURL,n.value),i)});return{to:n,hasTarget:r,isAbsoluteUrl:l,isExternal:c,href:y,isActive:g?.isActive??b(()=>n.value===u.currentRoute.value.path),isExactActive:g?.isExactActive??b(()=>n.value===u.currentRoute.value.path),route:g?.route??b(()=>u.resolve(n.value)),async navigate(i){await z(y.value,{replace:e.replace,external:c.value||r.value})}}}return O({name:o,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:C,setup(e,{slots:u}){const f=q(),{to:r,href:l,navigate:m,isExternal:h,hasTarget:c,isAbsoluteUrl:n}=C(e),g=j(!1),y=B(null),i=s=>{y.value=e.custom?s?.$el?.nextElementSibling:s?.$el};function p(s){return!g.value&&(typeof e.prefetchOn=="string"?e.prefetchOn===s:e.prefetchOn?.[s]??t.prefetchOn?.[s])&&(e.prefetch??t.prefetch)!==!1&&e.noPrefetch!==!0&&e.target!=="_blank"&&!Z()}async function x(s=k()){if(g.value)return;g.value=!0;const d=typeof r.value=="string"?r.value:h.value?w(r.value):f.resolve(r.value).fullPath,a=h.value?new URL(d,window.location.href).href:d;await Promise.all([s.hooks.callHook("link:prefetch",a).catch(()=>{}),!h.value&&!c.value&&D(r.value,f).catch(()=>{})])}if(p("visibility")){const s=k();let d,a=null;N(()=>{const _=X();T(()=>{d=U(()=>{y?.value?.tagName&&(a=_.observe(y.value,async()=>{a?.(),a=null,await x(s)}))})})}),E(()=>{d&&I(d),a?.(),a=null})}return()=>{if(!h.value&&!c.value&&!v(r.value)){const a={ref:i,to:r.value,activeClass:e.activeClass||t.activeClass,exactActiveClass:e.exactActiveClass||t.exactActiveClass,replace:e.replace,ariaCurrentValue:e.ariaCurrentValue,custom:e.custom};return e.custom||(p("interaction")&&(a.onPointerenter=x.bind(null,void 0),a.onFocus=x.bind(null,void 0)),g.value&&(a.class=e.prefetchedClass||t.prefetchedClass),a.rel=e.rel||void 0),L(A("RouterLink"),a,u.default)}const s=e.target||null,d=Q(e.noRel?"":e.rel,t.externalRelAttribute,n.value||c.value?"noopener noreferrer":"")||null;return e.custom?u.default?u.default({href:l.value,navigate:m,prefetch:x,get route(){if(!l.value)return;const a=new URL(l.value,window.location.href);return{path:a.pathname,fullPath:a.pathname,get query(){return V(a.search)},hash:a.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:l.value}},rel:d,target:s,isExternal:h.value||c.value,isActive:!1,isExactActive:!1}):null:L("a",{ref:y,href:l.value||null,rel:d,target:s,onClick:a=>{if(!(h.value||c.value))return a.preventDefault(),e.replace?f.replace(l.value):f.push(l.value)}},u.default?.())}}})}const K=G($);function R(t,o){const v=o==="append"?M:W;return P(t)&&!t.startsWith("http")?t:v(t,!0)}function X(){const t=k();if(t._observer)return t._observer;let o=null;const v=new Map,S=(e,u)=>(o||=new IntersectionObserver(f=>{for(const r of f){const l=v.get(r.target);(r.isIntersecting||r.intersectionRatio>0)&&l&&l()}}),v.set(e,u),o.observe(e),()=>{v.delete(e),o?.unobserve(e),v.size===0&&(o?.disconnect(),o=null)});return t._observer={observe:S}}const Y=/2g/;function Z(){const t=navigator.connection;return!!(t&&(t.saveData||Y.test(t.effectiveType)))}export{K as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as me}from"./TvBJGid1.js";import{c as ee,o as I,n as ge,g as _e,L as X,H as C,a as be,s as we,l as ve,M as Ee,q as x}from"./e7kgpy_n.js";const te={__name:"NIcon",props:{icon:{type:String,required:!1}},setup(n){return(e,t)=>(I(),ee("div",{class:ge(["n-icon",n.icon])},null,2))}},kt=_e({name:"NButton",props:{to:String,icon:String,border:{type:Boolean,default:!0},disabled:Boolean,type:{type:String,default:"button"}},setup(n,{attrs:e,slots:t}){return()=>X(n.to?me:"button",{to:n.to,...e,...!n.to&&{type:n.type},...n.disabled?{disabled:!0}:{tabindex:0},class:[n.border?"n-button-base active:n-button-active focus-visible:n-focus-base hover:n-button-hover":"",t.default?"":"n-icon-button","n-button n-transition n-disabled:n-disabled"].join(" ")},{default:()=>[C(t,"icon",{},()=>n.icon?[X(te,{icon:n.icon,class:t.default?"n-button-icon":""})]:[]),C(t,"default")]})}}),ke={class:"n-tip n-tip-base"},At={__name:"NTip",props:{icon:{type:String,required:!1}},setup(n){return(e,t)=>{const s=te;return I(),ee("div",ke,[C(e.$slots,"icon",{},()=>[n.icon?(I(),we(s,{key:0,icon:n.icon,class:"n-tip-icon"},null,8,["icon"])):ve("",!0)]),be("div",null,[C(e.$slots,"default")])])}}},y=Object.create(null);y.open="0";y.close="1";y.ping="2";y.pong="3";y.message="4";y.upgrade="5";y.noop="6";const T=Object.create(null);Object.keys(y).forEach(n=>{T[y[n]]=n});const V={type:"error",data:"parser error"},se=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ne=typeof ArrayBuffer=="function",ie=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,K=({type:n,data:e},t,s)=>se&&e instanceof Blob?t?s(e):Q(e,s):ne&&(e instanceof ArrayBuffer||ie(e))?t?s(e):Q(new Blob([e]),s):s(y[n]+(e||"")),Q=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function j(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let L;function Ae(n,e){if(se&&n.data instanceof Blob)return n.data.arrayBuffer().then(j).then(e);if(ne&&(n.data instanceof ArrayBuffer||ie(n.data)))return e(j(n.data));K(n,!1,t=>{L||(L=new TextEncoder),e(L.encode(t))})}const G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<G.length;n++)E[G.charCodeAt(n)]=n;const Te=n=>{let e=n.length*.75,t=n.length,s,i=0,r,o,c,h;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const m=new ArrayBuffer(e),f=new Uint8Array(m);for(s=0;s<t;s+=4)r=E[n.charCodeAt(s)],o=E[n.charCodeAt(s+1)],c=E[n.charCodeAt(s+2)],h=E[n.charCodeAt(s+3)],f[i++]=r<<2|o>>4,f[i++]=(o&15)<<4|c>>2,f[i++]=(c&3)<<6|h&63;return m},Re=typeof ArrayBuffer=="function",W=(n,e)=>{if(typeof n!="string")return{type:"message",data:re(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Oe(n.substring(1),e)}:T[t]?n.length>1?{type:T[t],data:n.substring(1)}:{type:T[t]}:V},Oe=(n,e)=>{if(Re){const t=Te(n);return re(t,e)}else return{base64:!0,data:n}},re=(n,e)=>e==="blob"?n instanceof Blob?n:new Blob([n]):n instanceof ArrayBuffer?n:n.buffer,oe="",Ce=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((r,o)=>{K(r,!1,c=>{s[o]=c,++i===t&&e(s.join(oe))})})},Be=(n,e)=>{const t=n.split(oe),s=[];for(let i=0;i<t.length;i++){const r=W(t[i],e);if(s.push(r),r.type==="error")break}return s};function Se(){return new TransformStream({transform(n,e){Ae(n,t=>{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,s)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let q;function k(n){return n.reduce((e,t)=>e+t.length,0)}function A(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;i<e;i++)t[i]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function Ne(n,e){q||(q=new TextDecoder);const t=[];let s=0,i=-1,r=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(k(t)<1)break;const h=A(t,1);r=(h[0]&128)===128,i=h[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(k(t)<2)break;const h=A(t,2);i=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),s=3}else if(s===2){if(k(t)<8)break;const h=A(t,8),m=new DataView(h.buffer,h.byteOffset,h.length),f=m.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(V);break}i=f*Math.pow(2,32)+m.getUint32(4),s=3}else{if(k(t)<i)break;const h=A(t,i);c.enqueue(W(r?h:q.decode(h),e)),s=0}if(i===0||i>n){c.enqueue(V);break}}}})}const ae=4;function u(n){if(n)return xe(n)}function xe(n){for(var e in u.prototype)n[e]=u.prototype[e];return n}u.prototype.on=u.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};u.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+n],this};u.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};u.prototype.hasListeners=function(n){return!!this.listeners(n).length};const S=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Le="arraybuffer";function ce(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const qe=l.setTimeout,Pe=l.clearTimeout;function N(n,e){e.useNativeTimers?(n.setTimeoutFn=qe.bind(l),n.clearTimeoutFn=Pe.bind(l)):(n.setTimeoutFn=l.setTimeout.bind(l),n.clearTimeoutFn=l.clearTimeout.bind(l))}const De=1.33;function Ie(n){return typeof n=="string"?Ve(n):Math.ceil((n.byteLength||n.size)*De)}function Ve(n){let e=0,t=0;for(let s=0,i=n.length;s<i;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function he(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ue(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Fe(n){let e={},t=n.split("&");for(let s=0,i=t.length;s<i;s++){let r=t[s].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class Me extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class Y extends u{constructor(e){super(),this.writable=!1,N(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new Me(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=W(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Ue(e);return t.length?"?"+t:""}}class He extends Y{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Be(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Ce(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=he()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let ue=!1;try{ue=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const $e=ue;function Ke(){}class We extends He{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,r)=>{this.onError("xhr post error",i,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class d extends u{constructor(e,t,s){super(),this.createRequest=e,N(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=ce(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=d.requestsCount++,d.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Ke,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete d.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}d.requestsCount=0;d.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Z);else if(typeof addEventListener=="function"){const n="onpagehide"in l?"pagehide":"unload";addEventListener(n,Z,!1)}}function Z(){for(let n in d.requests)d.requests.hasOwnProperty(n)&&d.requests[n].abort()}const Ye=(function(){const n=fe({xdomain:!1});return n&&n.responseType!==null})();class ze extends We{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Ye&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new d(fe,this.uri(),e)}}function fe(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||$e))return new XMLHttpRequest}catch{}if(!e)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const le=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Je extends Y{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=le?{}:ce(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;K(s,this.supportsBinary,r=>{try{this.doWrite(s,r)}catch{}i&&S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=he()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const P=l.WebSocket||l.MozWebSocket;class Xe extends Je{createSocket(e,t,s){return le?new P(e,t,s):t?new P(e,t):new P(e)}doWrite(e,t){this.ws.send(t)}}class Qe extends Y{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Ne(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Se();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{s.read().then(({done:c,value:h})=>{c||(this.onPacket(h),r())}).catch(c=>{})};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const je={websocket:Xe,webtransport:Qe,polling:ze},Ge=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ze=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function U(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=Ge.exec(n||""),r={},o=14;for(;o--;)r[Ze[o]]=i[o]||"";return t!=-1&&s!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=et(r,r.path),r.queryKey=tt(r,r.query),r}function et(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function tt(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,r){i&&(t[i]=r)}),t}const F=typeof addEventListener=="function"&&typeof removeEventListener=="function",R=[];F&&addEventListener("offline",()=>{R.forEach(n=>n())},!1);class _ extends u{constructor(e,t){if(super(),this.binaryType=Le,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=U(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=U(t.host).host);N(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Fe(this.opts.query)),F&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},R.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=ae,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&_.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",_.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(t+=Ie(i)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,S(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const r={type:e,data:t,options:s};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(_.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),F&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=R.indexOf(this._offlineEventListener);s!==-1&&R.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}_.protocol=ae;class st extends _{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;_.priorWebsocketSuccess=!1;const i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",g=>{if(!s)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;_.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(f(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=t.name,this.emitReserved("upgradeError",w)}}))};function r(){s||(s=!0,f(),t.close(),t=null)}const o=g=>{const w=new Error("probe error: "+g);w.transport=t.name,r(),this.emitReserved("upgradeError",w)};function c(){o("transport closed")}function h(){o("socket closed")}function m(g){t&&g.name!==t.name&&r()}const f=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let nt=class extends st{constructor(e,t={}){const s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>je[i]).filter(i=>!!i)),super(e,s)}};function it(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=U(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const r=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+r+":"+s.port+e,s.href=s.protocol+"://"+r+(t&&t.port===s.port?"":":"+s.port),s}const rt=typeof ArrayBuffer=="function",ot=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,pe=Object.prototype.toString,at=typeof Blob=="function"||typeof Blob<"u"&&pe.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&pe.call(File)==="[object FileConstructor]";function z(n){return rt&&(n instanceof ArrayBuffer||ot(n))||at&&n instanceof Blob||ct&&n instanceof File}function O(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(O(n[t]))return!0;return!1}if(z(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return O(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&O(n[t]))return!0;return!1}function ht(n){const e=[],t=n.data,s=n;return s.data=M(t,e),s.attachments=e.length,{packet:s,buffers:e}}function M(n,e){if(!n)return n;if(z(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let s=0;s<n.length;s++)t[s]=M(n[s],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=M(n[s],e));return t}return n}function ut(n,e){return n.data=H(n.data,e),delete n.attachments,n}function H(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=H(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=H(n[t],e));return n}const de=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ft=5;var a;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(a||(a={}));class lt{constructor(e){this.replacer=e}encode(e){return(e.type===a.EVENT||e.type===a.ACK)&&O(e)?this.encodeAsBinary({type:e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===a.BINARY_EVENT||e.type===a.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=ht(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}}class J extends u{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===a.BINARY_EVENT;s||t.type===a.BINARY_ACK?(t.type=s?a.EVENT:a.ACK,this.reconstructor=new pt(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(z(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(a[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===a.BINARY_EVENT||s.type===a.BINARY_ACK){const r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(r,t)}else s.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const r=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(J.isPayloadValid(s.type,r))s.data=r;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return B(t);case a.DISCONNECT:return t===void 0;case a.CONNECT_ERROR:return typeof t=="string"||B(t);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&de.indexOf(t[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pt{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=ut(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function dt(n){return typeof n=="string"}const yt=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};function mt(n){return n===void 0||yt(n)}function B(n){return Object.prototype.toString.call(n)==="[object Object]"}function gt(n,e){switch(n){case a.CONNECT:return e===void 0||B(e);case a.DISCONNECT:return e===void 0;case a.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&de.indexOf(e[0])===-1);case a.ACK:return Array.isArray(e);case a.CONNECT_ERROR:return typeof e=="string"||B(e);default:return!1}}function _t(n){return dt(n.nsp)&&mt(n.id)&>(n.type,n.data)}const bt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:J,Encoder:lt,get PacketType(){return a},isPacketValid:_t,protocol:ft},Symbol.toStringTag,{value:"Module"}));function p(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const wt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ye extends u{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[p(e,"open",this.onopen.bind(this)),p(e,"packet",this.onpacket.bind(this)),p(e,"error",this.onerror.bind(this)),p(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,r;if(wt.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:a.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const f=this.ids++,g=t.pop();this._registerAckCallback(f,g),o.id=f}const c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,h=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!c||(h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(r),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{const r=(o,c)=>o?i(o):s(c);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...r)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:a.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case a.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case a.EVENT:case a.BINARY_EVENT:this.onevent(e);break;case a.ACK:case a.BINARY_ACK:this.onack(e);break;case a.DISCONNECT:this.ondisconnect();break;case a.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:a.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:a.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}function b(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}b.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};b.prototype.reset=function(){this.attempts=0};b.prototype.setMin=function(n){this.ms=n};b.prototype.setMax=function(n){this.max=n};b.prototype.setJitter=function(n){this.jitter=n};class $ extends u{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,N(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new b({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||bt;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new nt(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=p(t,"open",function(){s.onopen(),e&&e()}),r=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=p(t,"error",r);if(this._timeout!==!1){const c=this._timeout,h=this.setTimeoutFn(()=>{i(),r(new Error("timeout")),t.close()},c);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(p(e,"ping",this.onping.bind(this)),p(e,"data",this.ondata.bind(this)),p(e,"error",this.onerror.bind(this)),p(e,"close",this.onclose.bind(this)),p(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){S(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new ye(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const v={};function D(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=it(n,e.path||"/socket.io"),s=t.source,i=t.id,r=t.path,o=v[i]&&r in v[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let h;return c?h=new $(s,e):(v[i]||(v[i]=new $(s,e)),h=v[i]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(D,{Manager:$,Socket:ye,io:D,connect:D});function Rt(){const e=Ee().public?.claudeDevtoolsBc?.tunnel;return{isActive:x(()=>!!e),origin:x(()=>e?.origin??null),host:x(()=>e?.host??null),config:e??null}}export{te as _,kt as a,At as b,D as l,Rt as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"e8ae4dbb-462d-47a2-9aa2-50bed9498ab2","timestamp":1768962598614,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|