@oro.ad/nuxt-claude-devtools 1.0.6 → 1.0.7

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.
Files changed (33) hide show
  1. package/dist/client/200.html +1 -1
  2. package/dist/client/404.html +1 -1
  3. package/dist/client/_nuxt/{B6Pm7LNk.js → B1H6wO_D.js} +1 -1
  4. package/dist/client/_nuxt/{Dgh4EhoJ.js → BpkYThsl.js} +1 -1
  5. package/dist/client/_nuxt/C2ORx7Gd.js +1 -0
  6. package/dist/client/_nuxt/CfGtRVGd.js +4 -0
  7. package/dist/client/_nuxt/{BngXb2T5.js → D-z88P1l.js} +1 -1
  8. package/dist/client/_nuxt/DJn_CTvm.js +1 -0
  9. package/dist/client/_nuxt/EMyRkg8p.js +1 -0
  10. package/dist/client/_nuxt/PGt8fA_Y.js +1 -0
  11. package/dist/client/_nuxt/builds/latest.json +1 -1
  12. package/dist/client/_nuxt/builds/meta/88c99fa0-10e0-4015-a61a-e0c6d7a01859.json +1 -0
  13. package/dist/client/_nuxt/error-404.2GhCpCfF.css +1 -0
  14. package/dist/client/_nuxt/error-500.DqdIhFrl.css +1 -0
  15. package/dist/client/index.html +1 -1
  16. package/dist/client/mcp/index.html +1 -1
  17. package/dist/module.json +1 -1
  18. package/dist/module.mjs +22 -13
  19. package/dist/runtime/logger.d.ts +5 -0
  20. package/dist/runtime/logger.js +12 -0
  21. package/dist/runtime/server/claude-session.d.ts +6 -4
  22. package/dist/runtime/server/claude-session.js +12 -21
  23. package/dist/runtime/server/plugins/socket.io.d.ts +2 -0
  24. package/dist/runtime/server/plugins/socket.io.js +48 -0
  25. package/package.json +2 -1
  26. package/dist/client/_nuxt/BWmwj9se.js +0 -1
  27. package/dist/client/_nuxt/CRwOrvc3.js +0 -1
  28. package/dist/client/_nuxt/DMBGVttU.js +0 -1
  29. package/dist/client/_nuxt/DYOOVyPh.js +0 -1
  30. package/dist/client/_nuxt/JxSLzYFz.js +0 -4
  31. package/dist/client/_nuxt/builds/meta/f2b44466-6d7e-4b5c-bf6b-f6c7cf9e0d59.json +0 -1
  32. package/dist/client/_nuxt/error-404.BLrjNXsr.css +0 -1
  33. package/dist/client/_nuxt/error-500.DLkAwcfL.css +0 -1
@@ -0,0 +1 @@
1
+ import{_ as Se}from"./EMyRkg8p.js";import{c as D,o as v,n as Ce,g as Be,C as re,D as E,a as fe,B as le,l as de,E as Ne,r as xe,G as oe,A as Le,x as N,m as qe,H as Pe,y as De,I as Ie,J as Ve,_ as Ue,K as Fe}from"./CfGtRVGd.js";const X={__name:"NIcon",props:{icon:{type:String,required:!1}},setup(s){return(e,t)=>(v(),D("div",{class:Ce(["n-icon",s.icon])},null,2))}},Jt=Be({name:"NButton",props:{to:String,icon:String,border:{type:Boolean,default:!0},disabled:Boolean,type:{type:String,default:"button"}},setup(s,{attrs:e,slots:t}){return()=>re(s.to?Se:"button",{to:s.to,...e,...!s.to&&{type:s.type},...s.disabled?{disabled:!0}:{tabindex:0},class:[s.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:()=>[E(t,"icon",{},()=>s.icon?[re(X,{icon:s.icon,class:t.default?"n-button-icon":""})]:[]),E(t,"default")]})}}),$e={class:"n-tip n-tip-base"},Xt={__name:"NTip",props:{icon:{type:String,required:!1}},setup(s){return(e,t)=>{const n=X;return v(),D("div",$e,[E(e.$slots,"icon",{},()=>[s.icon?(v(),le(n,{key:0,icon:s.icon,class:"n-tip-icon"},null,8,["icon"])):de("",!0)]),fe("div",null,[E(e.$slots,"default")])])}}};typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Me=s=>typeof s<"u";function He(s){return JSON.parse(JSON.stringify(s))}function Ke(s,e,t,n={}){var i,r;const{clone:o=!1,passive:c=!1,eventName:h,deep:p=!1,defaultValue:l,shouldEmit:m}=n,f=Ne(),te=t||f?.emit||(f==null||(i=f.$emit)===null||i===void 0?void 0:i.bind(f))||(f==null||(r=f.proxy)===null||r===void 0||(r=r.$emit)===null||r===void 0?void 0:r.bind(f?.proxy));let R=h;R=R||`update:${e.toString()}`;const se=d=>o?typeof o=="function"?o(d):He(d):d,ne=()=>Me(s[e])?se(s[e]):l,ie=d=>{m?m(d)&&te(R,d):te(R,d)};if(c){const d=xe(ne());let O=!1;return oe(()=>s[e],S=>{O||(O=!0,d.value=se(S),Le(()=>O=!1))}),oe(d,S=>{!O&&(S!==s[e]||p)&&ie(S)},{deep:p}),d}else return N({get(){return ne()},set(d){ie(d)}})}const We={class:"n-text-input flex flex items-center border n-border-base rounded n-bg-base py-1 pl-1 pr-2 focus-within:border-context focus-within:n-focus-base"},Qt={__name:"NTextInput",props:{modelValue:{type:[String,Number],required:!1,default:""},icon:{type:String,required:!1},placeholder:{type:String,required:!1},disabled:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},readonly:{type:Boolean,required:!1},type:{type:String,required:!1,default:"text"}},emits:["keydown","keyup","change"],setup(s,{emit:e}){const i=Ke(s,"modelValue",e,{passive:!0});return(r,o)=>{const c=X;return v(),D("div",We,[E(r.$slots,"icon",{},()=>[s.icon?(v(),le(c,{key:0,icon:s.icon,class:"ml-0.3em mr-0.1em text-1.1em op50"},null,8,["icon"])):de("",!0)]),qe(fe("input",Ie({"onUpdate:modelValue":o[0]||(o[0]=h=>Ve(i)?i.value=h:null)},r.$props,{class:"ml-0.4em w-full flex-auto n-bg-base !outline-none"}),null,16),[[Pe,De(i)]])])}}},Ye={},ze={class:"n-badge"};function Je(s,e){return v(),D("span",ze,[E(s.$slots,"default")])}const Gt=Object.assign(Ue(Ye,[["render",Je]]),{__name:"NBadge"}),b=Object.create(null);b.open="0";b.close="1";b.ping="2";b.pong="3";b.message="4";b.upgrade="5";b.noop="6";const x=Object.create(null);Object.keys(b).forEach(s=>{x[b[s]]=s});const H={type:"error",data:"parser error"},pe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ye=typeof ArrayBuffer=="function",me=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Q=({type:s,data:e},t,n)=>pe&&e instanceof Blob?t?n(e):ae(e,n):ye&&(e instanceof ArrayBuffer||me(e))?t?n(e):ae(new Blob([e]),n):n(b[s]+(e||"")),ae=(s,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(s)};function ce(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let U;function Xe(s,e){if(pe&&s.data instanceof Blob)return s.data.arrayBuffer().then(ce).then(e);if(ye&&(s.data instanceof ArrayBuffer||me(s.data)))return e(ce(s.data));Q(s,!1,t=>{U||(U=new TextEncoder),e(U.encode(t))})}const he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<he.length;s++)A[he.charCodeAt(s)]=s;const Qe=s=>{let e=s.length*.75,t=s.length,n,i=0,r,o,c,h;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);const p=new ArrayBuffer(e),l=new Uint8Array(p);for(n=0;n<t;n+=4)r=A[s.charCodeAt(n)],o=A[s.charCodeAt(n+1)],c=A[s.charCodeAt(n+2)],h=A[s.charCodeAt(n+3)],l[i++]=r<<2|o>>4,l[i++]=(o&15)<<4|c>>2,l[i++]=(c&3)<<6|h&63;return p},Ge=typeof ArrayBuffer=="function",G=(s,e)=>{if(typeof s!="string")return{type:"message",data:ge(s,e)};const t=s.charAt(0);return t==="b"?{type:"message",data:je(s.substring(1),e)}:x[t]?s.length>1?{type:x[t],data:s.substring(1)}:{type:x[t]}:H},je=(s,e)=>{if(Ge){const t=Qe(s);return ge(t,e)}else return{base64:!0,data:s}},ge=(s,e)=>e==="blob"?s instanceof Blob?s:new Blob([s]):s instanceof ArrayBuffer?s:s.buffer,_e="",Ze=(s,e)=>{const t=s.length,n=new Array(t);let i=0;s.forEach((r,o)=>{Q(r,!1,c=>{n[o]=c,++i===t&&e(n.join(_e))})})},et=(s,e)=>{const t=s.split(_e),n=[];for(let i=0;i<t.length;i++){const r=G(t[i],e);if(n.push(r),r.type==="error")break}return n};function tt(){return new TransformStream({transform(s,e){Xe(s,t=>{const n=t.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}s.data&&typeof s.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let F;function C(s){return s.reduce((e,t)=>e+t.length,0)}function B(s,e){if(s[0].length===e)return s.shift();const t=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)t[i]=s[0][n++],n===s[0].length&&(s.shift(),n=0);return s.length&&n<s[0].length&&(s[0]=s[0].slice(n)),t}function st(s,e){F||(F=new TextDecoder);const t=[];let n=0,i=-1,r=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(n===0){if(C(t)<1)break;const h=B(t,1);r=(h[0]&128)===128,i=h[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(C(t)<2)break;const h=B(t,2);i=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),n=3}else if(n===2){if(C(t)<8)break;const h=B(t,8),p=new DataView(h.buffer,h.byteOffset,h.length),l=p.getUint32(0);if(l>Math.pow(2,21)-1){c.enqueue(H);break}i=l*Math.pow(2,32)+p.getUint32(4),n=3}else{if(C(t)<i)break;const h=B(t,i);c.enqueue(G(r?h:F.decode(h),e)),n=0}if(i===0||i>s){c.enqueue(H);break}}}})}const be=4;function u(s){if(s)return nt(s)}function nt(s){for(var e in u.prototype)s[e]=u.prototype[e];return s}u.prototype.on=u.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};u.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};const I=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),y=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),it="arraybuffer";function we(s,...e){return e.reduce((t,n)=>(s.hasOwnProperty(n)&&(t[n]=s[n]),t),{})}const rt=y.setTimeout,ot=y.clearTimeout;function V(s,e){e.useNativeTimers?(s.setTimeoutFn=rt.bind(y),s.clearTimeoutFn=ot.bind(y)):(s.setTimeoutFn=y.setTimeout.bind(y),s.clearTimeoutFn=y.clearTimeout.bind(y))}const at=1.33;function ct(s){return typeof s=="string"?ht(s):Math.ceil((s.byteLength||s.size)*at)}function ht(s){let e=0,t=0;for(let n=0,i=s.length;n<i;n++)e=s.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function ve(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ut(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function ft(s){let e={},t=s.split("&");for(let n=0,i=t.length;n<i;n++){let r=t[n].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class lt extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class j extends u{constructor(e){super(),this.writable=!1,V(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new lt(e,t,n)),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=G(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=ut(e);return t.length?"?"+t:""}}class dt extends j{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 n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};et(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,Ze(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]=ve()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let Ee=!1;try{Ee=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const pt=Ee;function yt(){}class mt extends dt{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.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,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class _ extends u{constructor(e,t,n){super(),this.createRequest=e,V(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=we(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=_.requestsCount++,_.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=yt,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete _.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()}}_.requestsCount=0;_.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ue);else if(typeof addEventListener=="function"){const s="onpagehide"in y?"pagehide":"unload";addEventListener(s,ue,!1)}}function ue(){for(let s in _.requests)_.requests.hasOwnProperty(s)&&_.requests[s].abort()}const gt=(function(){const s=ke({xdomain:!1});return s&&s.responseType!==null})();class _t extends mt{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=gt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new _(ke,this.uri(),e)}}function ke(s){const e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||pt))return new XMLHttpRequest}catch{}if(!e)try{return new y[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Te=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bt extends j{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Te?{}:we(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}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 n=e[t],i=t===e.length-1;Q(n,this.supportsBinary,r=>{try{this.doWrite(n,r)}catch{}i&&I(()=>{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]=ve()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const $=y.WebSocket||y.MozWebSocket;class wt extends bt{createSocket(e,t,n){return Te?new $(e,t,n):t?new $(e,t):new $(e)}doWrite(e,t){this.ws.send(t)}}class vt extends j{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=st(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),i=tt();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{n.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 n=e[t],i=t===e.length-1;this._writer.write(n).then(()=>{i&&I(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Et={websocket:wt,webtransport:vt,polling:_t},kt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Tt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K(s){if(s.length>8e3)throw"URI too long";const e=s,t=s.indexOf("["),n=s.indexOf("]");t!=-1&&n!=-1&&(s=s.substring(0,t)+s.substring(t,n).replace(/:/g,";")+s.substring(n,s.length));let i=kt.exec(s||""),r={},o=14;for(;o--;)r[Tt[o]]=i[o]||"";return t!=-1&&n!=-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=At(r,r.path),r.queryKey=Rt(r,r.query),r}function At(s,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Rt(s,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,r){i&&(t[i]=r)}),t}const W=typeof addEventListener=="function"&&typeof removeEventListener=="function",L=[];W&&addEventListener("offline",()=>{L.forEach(s=>s())},!1);class w extends u{constructor(e,t){if(super(),this.binaryType=it,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 n=K(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=K(t.host).host);V(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(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),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=ft(this.opts.query)),W&&(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"})},L.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=be,t.transport=e,this.id&&(t.sid=this.id);const n=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](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&w.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",w.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 n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(t+=ct(i)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,I(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,i){if(typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const r={type:e,data:t,options:n};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()},n=()=>{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?n():e()}):this.upgrading?n():e()),this}_onError(e){if(w.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(),W&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=L.indexOf(this._offlineEventListener);n!==-1&&L.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}w.protocol=be;class Ot extends w{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),n=!1;w.priorWebsocketSuccess=!1;const i=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",m=>{if(!n)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;w.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=t.name,this.emitReserved("upgradeError",f)}}))};function r(){n||(n=!0,l(),t.close(),t=null)}const o=m=>{const f=new Error("probe error: "+m);f.transport=t.name,r(),this.emitReserved("upgradeError",f)};function c(){o("transport closed")}function h(){o("socket closed")}function p(m){t&&m.name!==t.name&&r()}const l=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",p)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let St=class extends Ot{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>Et[i]).filter(i=>!!i)),super(e,n)}};function Ct(s,e="",t){let n=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),n=K(s)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const r=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port+e,n.href=n.protocol+"://"+r+(t&&t.port===n.port?"":":"+n.port),n}const Bt=typeof ArrayBuffer=="function",Nt=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Ae=Object.prototype.toString,xt=typeof Blob=="function"||typeof Blob<"u"&&Ae.call(Blob)==="[object BlobConstructor]",Lt=typeof File=="function"||typeof File<"u"&&Ae.call(File)==="[object FileConstructor]";function Z(s){return Bt&&(s instanceof ArrayBuffer||Nt(s))||xt&&s instanceof Blob||Lt&&s instanceof File}function q(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,n=s.length;t<n;t++)if(q(s[t]))return!0;return!1}if(Z(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return q(s.toJSON(),!0);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&q(s[t]))return!0;return!1}function qt(s){const e=[],t=s.data,n=s;return n.data=Y(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Y(s,e){if(!s)return s;if(Z(s)){const t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){const t=new Array(s.length);for(let n=0;n<s.length;n++)t[n]=Y(s[n],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){const t={};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=Y(s[n],e));return t}return s}function Pt(s,e){return s.data=z(s.data,e),delete s.attachments,s}function z(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=z(s[t],e);else if(typeof s=="object")for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=z(s[t],e));return s}const Re=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Dt=5;var a;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(a||(a={}));class It{constructor(e){this.replacer=e}encode(e){return(e.type===a.EVENT||e.type===a.ACK)&&q(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=qt(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}}class ee 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 n=t.type===a.BINARY_EVENT;n||t.type===a.BINARY_ACK?(t.type=n?a.EVENT:a.ACK,this.reconstructor=new Vt(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 n={type:Number(e.charAt(0))};if(a[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.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");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(r,t)}else n.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}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(ee.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return P(t);case a.DISCONNECT:return t===void 0;case a.CONNECT_ERROR:return typeof t=="string"||P(t);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Re.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 Vt{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=Pt(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Ut(s){return typeof s=="string"}const Ft=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function $t(s){return s===void 0||Ft(s)}function P(s){return Object.prototype.toString.call(s)==="[object Object]"}function Mt(s,e){switch(s){case a.CONNECT:return e===void 0||P(e);case a.DISCONNECT:return e===void 0;case a.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Re.indexOf(e[0])===-1);case a.ACK:return Array.isArray(e);case a.CONNECT_ERROR:return typeof e=="string"||P(e);default:return!1}}function Ht(s){return Ut(s.nsp)&&$t(s.id)&&Mt(s.type,s.data)}const Kt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ee,Encoder:It,get PacketType(){return a},isPacketValid:Ht,protocol:Dt},Symbol.toStringTag,{value:"Module"}));function g(s,e,t){return s.on(e,t),function(){s.off(e,t)}}const Wt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Oe extends u{constructor(e,t,n){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,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[g(e,"open",this.onopen.bind(this)),g(e,"packet",this.onpacket.bind(this)),g(e,"error",this.onerror.bind(this)),g(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 n,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 l=this.ids++,m=t.pop();this._registerAckCallback(l,m),o.id=l}const c=(i=(n=this.io.engine)===null||n===void 0?void 0:n.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 n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n: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((n,i)=>{const r=(o,c)=>o?i(o):n(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 n={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?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue())),this._queue.push(n),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(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.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 n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);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 n of t)n.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 n=!1;return function(...i){n||(n=!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 n=0;n<t.length;n++)if(e===t[n])return t.splice(n,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 n=0;n<t.length;n++)if(e===t[n])return t.splice(n,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 n of t)n.apply(this,e.data)}}}function k(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}k.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=(Math.floor(e*10)&1)==0?s-t:s+t}return Math.min(s,this.max)|0};k.prototype.reset=function(){this.attempts=0};k.prototype.setMin=function(s){this.ms=s};k.prototype.setMax=function(s){this.max=s};k.prototype.setJitter=function(s){this.jitter=s};class J extends u{constructor(e,t){var n;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,V(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((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new k({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||Kt;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 St(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=g(t,"open",function(){n.onopen(),e&&e()}),r=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=g(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(g(e,"ping",this.onping.bind(this)),g(e,"data",this.ondata.bind(this)),g(e,"error",this.onerror.bind(this)),g(e,"close",this.onclose.bind(this)),g(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){I(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Oe(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],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 n;this.cleanup(),(n=this.engine)===null||n===void 0||n.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 n=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&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const T={};function M(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};const t=Ct(s,e.path||"/socket.io"),n=t.source,i=t.id,r=t.path,o=T[i]&&r in T[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let h;return c?h=new J(n,e):(T[i]||(T[i]=new J(n,e)),h=T[i]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(M,{Manager:J,Socket:Oe,io:M,connect:M});function Zt(){const e=Fe().public?.claudeDevtoolsBc?.tunnel;return{isActive:N(()=>!!e),origin:N(()=>e?.origin??null),host:N(()=>e?.host??null),config:e??null}}export{X as _,Jt as a,Xt as b,Qt as c,Gt as d,M as l,Zt as u};
@@ -0,0 +1 @@
1
+ import{g as O,L as q,s as T,r as j,e as k,j as B,M as N,N as U,O as E,P as I,C as L,Q as A,R as V,S as w,T as D,x as b,U as P,V as F,K as H,W as M,X as W,Y as z,Z as Q}from"./CfGtRVGd.js";const $=(...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 C(e,r);const l="path"in e&&e.path!==void 0?e.path:u(e).path;return{...e,name:void 0,path:C(l,r)}}function R(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 C(x,i)}return typeof n.value=="object"?u.resolve(n.value)?.href??null:C(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 M(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:R,setup(e,{slots:u}){const f=q(),{to:r,href:l,navigate:m,isExternal:h,hasTarget:c,isAbsoluteUrl:n}=R(e),g=T(!1),y=j(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"&&!Y()}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;B(()=>{const _=K();N(()=>{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=$(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 J=G(Q);function C(t,o){const v=o==="append"?W:z;return P(t)&&!t.startsWith("http")?t:v(t,!0)}function K(){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 X=/2g/;function Y(){const t=navigator.connection;return!!(t&&(t.saveData||X.test(t.effectiveType)))}export{J as _};
@@ -0,0 +1 @@
1
+ import{u as z,l as F,d as q,a as H,b as G,c as J,_ as Q}from"./DJn_CTvm.js";import{_ as W}from"./EMyRkg8p.js";import{s as Y,q as Z,g as ee,r as m,x as V,j as te,k as se,c as p,a as l,l as T,b as n,d as _,w as g,y as ne,F as oe,p as le,z as ae,A as ie,o as d,t as N,n as E,B}from"./CfGtRVGd.js";let x;const k=[];function ce(w){if(k.push(w),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&k.forEach(f=>f(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set(f){f&&k.forEach(i=>i(f))},get(){return x.value},configurable:!0}),()=>{k.splice(k.indexOf(w),1)}}function ue(){x||(x=Y(),ce(f));function w(){x&&Z(x)}function f(i){x.value=i,i.host&&i.host.hooks.hook("host:update:reactivity",w)}return x}const re={class:"relative flex flex-col h-screen n-bg-base"},de={class:"flex items-center justify-between p-4"},fe={class:"flex items-center gap-3"},ve={class:"text-xl font-bold flex items-center gap-2"},me={class:"flex items-center gap-2"},pe={key:0,class:"px-4 pt-4"},_e={key:0,class:"text-xs opacity-50 mb-1"},ge={key:0,class:"ml-2"},xe={class:"whitespace-pre-wrap font-mono text-sm"},ye={class:"text-xs opacity-30 mt-1"},be={key:0,class:"flex items-center justify-center h-full opacity-50"},we={class:"text-center"},ke={class:"p-4"},Ne=ee({__name:"index",setup(w){const f=ue(),i=z(),s=m(null),v=m([]),y=m(""),c=m(!1),S=m(!1),u=m(!1),h=m(null),L=V(()=>c.value?u.value?"Processing...":"Ready":"Disconnected"),M=V(()=>c.value?u.value?"blue":"green":"red");function D(){ie(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})}function U(){return Math.random().toString(36).substring(2,9)}function r(o,e,t=!1){const b={id:U(),role:o,content:e,timestamp:new Date,streaming:t};return v.value.push(b),D(),b}function j(){return i.isActive.value&&i.origin.value?i.origin.value:window.location.origin}function A(){const o=j();console.log("[claude-client] Connecting to socket at",o,"tunnel active:",i.isActive.value),s.value=F(o,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),s.value.on("connect",()=>{console.log("[claude-client] Connected to socket"),c.value=!0,r("system","Connected to Claude DevTools")}),s.value.on("disconnect",()=>{console.log("[claude-client] Disconnected from socket"),c.value=!1,S.value=!1,u.value=!1,r("system","Disconnected from server")}),s.value.on("session:status",e=>{console.log("[claude-client] Session status:",e),S.value=e.active,u.value=e.processing}),s.value.on("output:chunk",e=>{console.log("[claude-client] Output chunk:",e.length);const t=v.value.findLast(b=>b.role==="assistant");t&&t.streaming?(t.content+=e,D()):r("assistant",e,!0)}),s.value.on("output:complete",()=>{console.log("[claude-client] Output complete");const e=v.value.findLast(t=>t.role==="assistant");e&&(e.streaming=!1)}),s.value.on("output:error",e=>{console.log("[claude-client] Output error:",e),r("system",`Error: ${e}`)}),s.value.on("session:error",e=>{console.log("[claude-client] Session error:",e),r("system",`Session error: ${e}`)}),s.value.on("session:closed",e=>{console.log("[claude-client] Session closed:",e),r("system",`Session ended (exit code: ${e.exitCode})`)})}function $(){s.value&&(s.value.emit("session:reset"),v.value=[],r("system","New conversation started"))}function O(){if(!y.value.trim()||u.value||!c.value)return;const o=y.value.trim();y.value="",r("user",o),s.value&&s.value.emit("message:send",o)}function P(){v.value=[],c.value&&r("system","Chat cleared")}function R(o){console.log(o),o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),O())}return te(()=>{A()}),se(()=>{s.value&&s.value.disconnect()}),(o,e)=>{const t=Q,b=q,C=H,I=W,K=G,X=J;return d(),p("div",re,[l("div",de,[l("div",fe,[l("h1",ve,[n(t,{class:"text-green",icon:"carbon:machine-learning-model"}),e[1]||(e[1]=_(" Claude AI ",-1))]),n(b,{n:M.value},{default:g(()=>[_(N(L.value),1)]),_:1},8,["n"])]),l("div",me,[n(C,{disabled:!c.value||u.value,n:"blue",onClick:$},{default:g(()=>[n(t,{class:"mr-1",icon:"carbon:add"}),e[2]||(e[2]=_(" New Chat ",-1))]),_:1},8,["disabled"]),n(C,{n:"gray",onClick:P},{default:g(()=>[n(t,{class:"mr-1",icon:"carbon:trash-can"}),e[3]||(e[3]=_(" Clear ",-1))]),_:1}),n(I,{to:"/mcp"},{default:g(()=>[n(C,{n:"gray"},{default:g(()=>[n(t,{class:"mr-1",icon:"carbon:plug"}),e[4]||(e[4]=_(" MCP ",-1))]),_:1})]),_:1})])]),ne(f)?T("",!0):(d(),p("div",pe,[n(K,{n:"yellow"},{default:g(()=>[...e[5]||(e[5]=[_(" Open this page inside Nuxt DevTools for best experience. ",-1)])]),_:1})])),l("div",{ref_key:"messagesContainer",ref:h,class:"flex-1 overflow-auto p-4 space-y-4"},[(d(!0),p(oe,null,le(v.value,a=>(d(),p("div",{key:a.id,class:E([a.role==="user"?"justify-end":"justify-start","flex"])},[l("div",{class:E([{"bg-green-500/20 text-green-800 dark:text-green-100":a.role==="user","n-bg-active":a.role==="assistant","bg-yellow-500/20 text-yellow-800 dark:text-yellow-200 text-sm":a.role==="system"},"max-w-[80%] rounded-lg px-4 py-2"])},[a.role==="assistant"?(d(),p("div",_e,[e[6]||(e[6]=_(" Claude ",-1)),a.streaming?(d(),p("span",ge,[n(t,{class:"animate-pulse",icon:"carbon:circle-filled"})])):T("",!0)])):T("",!0),l("div",xe,N(a.content),1),l("div",ye,N(a.timestamp.toLocaleTimeString()),1)],2)],2))),128)),v.value.length===0?(d(),p("div",be,[l("div",we,[n(t,{class:"text-4xl mb-2",icon:"carbon:chat"}),e[7]||(e[7]=l("p",null,"Send a message to start chatting with Claude",-1))])])):T("",!0)],512),l("div",ke,[l("div",{class:"flex gap-2",onKeydown:ae(R,["enter"])},[n(X,{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=a=>y.value=a),disabled:!c.value||u.value,class:"flex-1 font-mono",placeholder:"Type your message..."},null,8,["modelValue","disabled"]),n(C,{disabled:!y.value.trim()||!c.value||u.value,n:"green",onClick:O},{default:g(()=>[u.value?(d(),B(t,{key:0,class:"animate-spin",icon:"carbon:loading"})):(d(),B(t,{key:1,icon:"carbon:send"}))]),_:1},8,["disabled"])],32),e[8]||(e[8]=l("div",{class:"text-xs opacity-50 mt-2"}," Press Enter to send | --continue will be used for follow-up messages ",-1))])])}}});export{Ne as default};
@@ -1 +1 @@
1
- {"id":"f2b44466-6d7e-4b5c-bf6b-f6c7cf9e0d59","timestamp":1767989026393}
1
+ {"id":"88c99fa0-10e0-4015-a61a-e0c6d7a01859","timestamp":1768755143369}
@@ -0,0 +1 @@
1
+ {"id":"88c99fa0-10e0-4015-a61a-e0c6d7a01859","timestamp":1768755143369,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -0,0 +1 @@
1
+ .grid[data-v-8c88d9ea]{display:grid}.mb-2[data-v-8c88d9ea]{margin-bottom:.5rem}.mb-4[data-v-8c88d9ea]{margin-bottom:1rem}.max-w-520px[data-v-8c88d9ea]{max-width:520px}.min-h-screen[data-v-8c88d9ea]{min-height:100vh}.w-full[data-v-8c88d9ea]{width:100%}.flex[data-v-8c88d9ea]{display:flex}.place-content-center[data-v-8c88d9ea]{place-content:center}.items-center[data-v-8c88d9ea]{align-items:center}.justify-center[data-v-8c88d9ea]{justify-content:center}.overflow-hidden[data-v-8c88d9ea]{overflow:hidden}.bg-white[data-v-8c88d9ea]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-8c88d9ea]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-8c88d9ea]{text-align:center}.text-\[80px\][data-v-8c88d9ea]{font-size:80px}.text-2xl[data-v-8c88d9ea]{font-size:1.5rem;line-height:2rem}.text-sm[data-v-8c88d9ea]{font-size:.875rem;line-height:1.25rem}.text-\[\#020420\][data-v-8c88d9ea]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-8c88d9ea]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.hover\:text-\[\#00DC82\][data-v-8c88d9ea]:hover{--un-text-opacity:1;color:rgb(0 220 130/var(--un-text-opacity))}.font-medium[data-v-8c88d9ea]{font-weight:500}.font-semibold[data-v-8c88d9ea]{font-weight:600}.leading-none[data-v-8c88d9ea]{line-height:1}.tracking-wide[data-v-8c88d9ea]{letter-spacing:.025em}.font-sans[data-v-8c88d9ea]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums[data-v-8c88d9ea]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.underline[data-v-8c88d9ea]{text-decoration-line:underline}.underline-offset-3[data-v-8c88d9ea]{text-underline-offset:3px}.antialiased[data-v-8c88d9ea]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-8c88d9ea]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-8c88d9ea]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-8c88d9ea]{font-size:110px}.sm\:text-3xl[data-v-8c88d9ea]{font-size:1.875rem;line-height:2.25rem}}
@@ -0,0 +1 @@
1
+ .grid[data-v-c415ba6a]{display:grid}.mb-2[data-v-c415ba6a]{margin-bottom:.5rem}.mb-4[data-v-c415ba6a]{margin-bottom:1rem}.max-w-520px[data-v-c415ba6a]{max-width:520px}.min-h-screen[data-v-c415ba6a]{min-height:100vh}.place-content-center[data-v-c415ba6a]{place-content:center}.overflow-hidden[data-v-c415ba6a]{overflow:hidden}.bg-white[data-v-c415ba6a]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-c415ba6a]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-c415ba6a]{text-align:center}.text-\[80px\][data-v-c415ba6a]{font-size:80px}.text-2xl[data-v-c415ba6a]{font-size:1.5rem;line-height:2rem}.text-\[\#020420\][data-v-c415ba6a]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-c415ba6a]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold[data-v-c415ba6a]{font-weight:600}.leading-none[data-v-c415ba6a]{line-height:1}.tracking-wide[data-v-c415ba6a]{letter-spacing:.025em}.font-sans[data-v-c415ba6a]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums[data-v-c415ba6a]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased[data-v-c415ba6a]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-c415ba6a]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-c415ba6a]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-c415ba6a]{font-size:110px}.sm\:text-3xl[data-v-c415ba6a]{font-size:1.875rem;line-height:2.25rem}}
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.Ci1n7Rlt.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/JxSLzYFz.js"><script type="module" src="/__claude-devtools/_nuxt/JxSLzYFz.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__claude-devtools",buildId:"f2b44466-6d7e-4b5c-bf6b-f6c7cf9e0d59",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767989031179,false]</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.Ci1n7Rlt.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/CfGtRVGd.js"><script type="module" src="/__claude-devtools/_nuxt/CfGtRVGd.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"88c99fa0-10e0-4015-a61a-e0c6d7a01859",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1768755148712,false]</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.Ci1n7Rlt.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/JxSLzYFz.js"><script type="module" src="/__claude-devtools/_nuxt/JxSLzYFz.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__claude-devtools",buildId:"f2b44466-6d7e-4b5c-bf6b-f6c7cf9e0d59",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767989031178,false]</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.Ci1n7Rlt.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/CfGtRVGd.js"><script type="module" src="/__claude-devtools/_nuxt/CfGtRVGd.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"88c99fa0-10e0-4015-a61a-e0c6d7a01859",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1768755148711,false]</script></body></html>
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oro.ad/nuxt-claude-devtools",
3
3
  "configKey": "claudeDevtools",
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,6 +1,8 @@
1
- import { defineNuxtModule, createResolver } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addServerPlugin } from '@nuxt/kit';
2
+ import { getTunnelConfig } from '@oro.ad/nuxt-claude-devtools-bc/tunnel';
3
+ import { createLogger } from '../dist/runtime/logger.js';
2
4
  import { existsSync } from 'node:fs';
3
- import { SOCKET_PORT, getClaudeSession, destroyClaudeSession } from '../dist/runtime/server/claude-session.js';
5
+ import { SOCKET_PATH, destroyClaudeSession } from '../dist/runtime/server/claude-session.js';
4
6
 
5
7
  const DEVTOOLS_UI_ROUTE = "/__claude-devtools";
6
8
  const DEVTOOLS_UI_LOCAL_PORT = 3300;
@@ -40,6 +42,7 @@ function setupDevToolsUI(nuxt, resolver) {
40
42
  });
41
43
  }
42
44
 
45
+ const log = createLogger("module");
43
46
  const module$1 = defineNuxtModule({
44
47
  meta: {
45
48
  name: "@oro.ad/nuxt-claude-devtools",
@@ -57,21 +60,27 @@ const module$1 = defineNuxtModule({
57
60
  return;
58
61
  }
59
62
  const resolver = createResolver(import.meta.url);
63
+ const tunnel = getTunnelConfig();
64
+ if (tunnel) {
65
+ log(`Tunnel detected: ${tunnel.origin}`);
66
+ }
67
+ nuxt.options.nitro = nuxt.options.nitro || {};
68
+ nuxt.options.nitro.experimental = nuxt.options.nitro.experimental || {};
69
+ nuxt.options.nitro.experimental.websocket = true;
70
+ log("Enabled Nitro experimental WebSocket support");
60
71
  nuxt.options.runtimeConfig.claudeDevtools = {
61
72
  claude: options.claude,
62
- rootDir: nuxt.options.rootDir
73
+ rootDir: nuxt.options.rootDir,
74
+ tunnelOrigin: tunnel?.origin || null
63
75
  };
64
- nuxt.hook("ready", () => {
65
- console.log(`[claude-devtools] Starting Socket.IO server on port ${SOCKET_PORT}`);
66
- const session = getClaudeSession({
67
- command: options.claude.command,
68
- args: options.claude.args,
69
- rootDir: nuxt.options.rootDir
70
- });
71
- session.startSocketServer();
72
- });
76
+ nuxt.options.runtimeConfig.public.claudeDevtools = {
77
+ socketPath: SOCKET_PATH,
78
+ tunnelOrigin: tunnel?.origin || null
79
+ };
80
+ addServerPlugin(resolver.resolve("./runtime/server/plugins/socket.io"));
81
+ log("Added Socket.IO Nitro plugin");
73
82
  nuxt.hook("close", () => {
74
- console.log("[claude-devtools] Cleaning up Claude session");
83
+ log("Cleaning up Claude session");
75
84
  destroyClaudeSession();
76
85
  });
77
86
  setupDevToolsUI(nuxt, resolver);
@@ -0,0 +1,5 @@
1
+ interface LoggerOptions {
2
+ timestamp?: boolean;
3
+ }
4
+ export declare function createLogger(subsystem: string, options?: LoggerOptions): (message: string, data?: unknown) => void;
5
+ export {};
@@ -0,0 +1,12 @@
1
+ const PREFIX = "[nuxt-claude-devtools]";
2
+ export function createLogger(subsystem, options = {}) {
3
+ const tag = `${PREFIX} [${subsystem}]`;
4
+ return function log(message, data) {
5
+ const ts = options.timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : "";
6
+ if (data !== void 0) {
7
+ console.log(`${tag}${ts} ${message}`, data);
8
+ } else {
9
+ console.log(`${tag}${ts} ${message}`);
10
+ }
11
+ };
12
+ }
@@ -1,22 +1,24 @@
1
- export declare const SOCKET_PORT = 3355;
1
+ import type { Server as SocketServer } from 'socket.io';
2
+ export declare const SOCKET_PATH = "/__claude_devtools_socket";
2
3
  export interface ClaudeSessionConfig {
3
4
  command: string;
4
5
  args: string[];
5
6
  rootDir: string;
7
+ tunnelOrigin?: string | null;
6
8
  }
7
9
  export declare class ClaudeSession {
8
10
  private config;
9
11
  private io;
10
- private httpServer;
11
12
  private isProcessing;
12
13
  private continueSession;
13
14
  constructor(config: ClaudeSessionConfig);
14
- startSocketServer(): void;
15
+ attachSocketIO(io: SocketServer): void;
15
16
  destroy(): void;
16
17
  private sendMessage;
17
18
  private getMcpServers;
18
19
  private addMcpServer;
19
20
  private removeMcpServer;
20
21
  }
21
- export declare function getClaudeSession(config: ClaudeSessionConfig): ClaudeSession;
22
+ export declare function initClaudeSession(config: ClaudeSessionConfig): ClaudeSession;
23
+ export declare function getClaudeSessionInstance(): ClaudeSession | null;
22
24
  export declare function destroyClaudeSession(): void;
@@ -1,32 +1,22 @@
1
- import { createServer } from "node:http";
2
1
  import { execSync, spawn } from "node:child_process";
3
- import { Server as SocketServer } from "socket.io";
2
+ import { createLogger } from "../logger.js";
3
+ const log = createLogger("session", { timestamp: true });
4
4
  function getErrorMessage(error) {
5
5
  if (error instanceof Error) return error.message;
6
6
  return String(error);
7
7
  }
8
- export const SOCKET_PORT = 3355;
9
- function log(message, data) {
10
- const timestamp = (/* @__PURE__ */ new Date()).toISOString();
11
- console.log(`[claude-session] [${timestamp}] ${message}`, data !== void 0 ? data : "");
12
- }
8
+ export const SOCKET_PATH = "/__claude_devtools_socket";
13
9
  export class ClaudeSession {
14
10
  config;
15
11
  io = null;
16
- httpServer = null;
17
12
  isProcessing = false;
18
13
  continueSession = false;
19
14
  constructor(config) {
20
15
  this.config = config;
21
16
  }
22
- startSocketServer() {
23
- this.httpServer = createServer();
24
- this.io = new SocketServer(this.httpServer, {
25
- cors: {
26
- origin: "*",
27
- methods: ["GET", "POST"]
28
- }
29
- });
17
+ attachSocketIO(io) {
18
+ this.io = io;
19
+ log(`Socket.IO attached, setting up event handlers`);
30
20
  this.io.on("connection", (socket) => {
31
21
  log("Client connected", { socketId: socket.id });
32
22
  socket.emit("session:status", {
@@ -59,13 +49,9 @@ export class ClaudeSession {
59
49
  log("Client disconnected", { socketId: socket.id });
60
50
  });
61
51
  });
62
- this.httpServer.listen(SOCKET_PORT, () => {
63
- log(`Socket.IO server started on port ${SOCKET_PORT}`);
64
- });
65
52
  }
66
53
  destroy() {
67
54
  this.io?.close();
68
- this.httpServer?.close();
69
55
  }
70
56
  sendMessage(message) {
71
57
  if (this.isProcessing) {
@@ -199,15 +185,20 @@ export class ClaudeSession {
199
185
  }
200
186
  }
201
187
  let sessionInstance = null;
202
- export function getClaudeSession(config) {
188
+ export function initClaudeSession(config) {
203
189
  if (!sessionInstance) {
204
190
  sessionInstance = new ClaudeSession(config);
191
+ log("Session initialized");
205
192
  }
206
193
  return sessionInstance;
207
194
  }
195
+ export function getClaudeSessionInstance() {
196
+ return sessionInstance;
197
+ }
208
198
  export function destroyClaudeSession() {
209
199
  if (sessionInstance) {
210
200
  sessionInstance.destroy();
211
201
  sessionInstance = null;
202
+ log("Session destroyed");
212
203
  }
213
204
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nitropack").NitroAppPlugin;
2
+ export default _default;
@@ -0,0 +1,48 @@
1
+ import { defineNitroPlugin, useRuntimeConfig } from "nitropack/runtime";
2
+ import { Server as Engine } from "engine.io";
3
+ import { Server } from "socket.io";
4
+ import { defineEventHandler } from "h3";
5
+ import { createLogger } from "../../logger.js";
6
+ import { getClaudeSessionInstance, initClaudeSession } from "../claude-session.js";
7
+ const log = createLogger("plugin");
8
+ export default defineNitroPlugin((nitroApp) => {
9
+ const config = useRuntimeConfig();
10
+ const claudeConfig = config.claudeDevtools;
11
+ if (!claudeConfig) {
12
+ log("No config found, skipping Socket.IO setup");
13
+ return;
14
+ }
15
+ log("Initializing Socket.IO server");
16
+ initClaudeSession({
17
+ command: claudeConfig.claude.command,
18
+ args: claudeConfig.claude.args,
19
+ rootDir: claudeConfig.rootDir,
20
+ tunnelOrigin: claudeConfig.tunnelOrigin || null
21
+ });
22
+ const engine = new Engine();
23
+ const io = new Server();
24
+ io.bind(engine);
25
+ const session = getClaudeSessionInstance();
26
+ if (session) {
27
+ session.attachSocketIO(io);
28
+ }
29
+ nitroApp.router.use("/__claude_devtools_socket/", defineEventHandler({
30
+ handler(event) {
31
+ engine.handleRequest(event.node.req, event.node.res);
32
+ event._handled = true;
33
+ },
34
+ websocket: {
35
+ open(peer) {
36
+ engine.prepare(peer._internal.nodeReq);
37
+ engine.onWebSocket(
38
+ // @ts-expect-error - accessing internal
39
+ peer._internal.nodeReq,
40
+ // @ts-expect-error - accessing internal
41
+ peer._internal.nodeReq.socket,
42
+ peer.websocket
43
+ );
44
+ }
45
+ }
46
+ }));
47
+ log("Socket.IO server ready on /__claude_devtools_socket/");
48
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oro.ad/nuxt-claude-devtools",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Nuxt DevTools integration for Claude Code AI assistant",
5
5
  "license": "GPL-3.0-only",
6
6
  "type": "module",
@@ -39,6 +39,7 @@
39
39
  "dependencies": {
40
40
  "@nuxt/devtools-kit": "^3.1.1",
41
41
  "@nuxt/kit": "^4.2.2",
42
+ "@oro.ad/nuxt-claude-devtools-bc": "^1.0.5",
42
43
  "sirv": "^3.0.2",
43
44
  "socket.io": "^4.8.1"
44
45
  },
@@ -1 +0,0 @@
1
- import{g as O,K as q,s as T,r as j,e as k,j as B,L as N,M as U,N as E,O as I,C as L,P as A,Q as V,R as w,S as D,x as b,T as P,U as F,V as H,W as M,X as W,Y as z,Z as Q}from"./JxSLzYFz.js";const $=(...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 C(e,r);const l="path"in e&&e.path!==void 0?e.path:u(e).path;return{...e,name:void 0,path:C(l,r)}}function R(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})}),y=A("RouterLink"),h=y&&typeof y!="string"?y.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}),m=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 C(x,i)}return typeof n.value=="object"?u.resolve(n.value)?.href??null:C(F(f.app.baseURL,n.value),i)});return{to:n,hasTarget:r,isAbsoluteUrl:l,isExternal:c,href:m,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 M(m.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:R,setup(e,{slots:u}){const f=q(),{to:r,href:l,navigate:y,isExternal:h,hasTarget:c,isAbsoluteUrl:n}=R(e),g=T(!1),m=j(null),i=s=>{m.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"&&!Y()}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;B(()=>{const _=K();N(()=>{d=U(()=>{m?.value?.tagName&&(a=_.observe(m.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=$(e.noRel?"":e.rel,t.externalRelAttribute,n.value||c.value?"noopener noreferrer":"")||null;return e.custom?u.default?u.default({href:l.value,navigate:y,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:m,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 J=G(Q);function C(t,o){const v=o==="append"?W:z;return P(t)&&!t.startsWith("http")?t:v(t,!0)}function K(){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 X=/2g/;function Y(){const t=navigator.connection;return!!(t&&(t.saveData||X.test(t.effectiveType)))}export{J as _};
@@ -1 +0,0 @@
1
- import{l as A,d as X,a as z,b as F,c as q,_ as H}from"./DYOOVyPh.js";import{_ as G}from"./BWmwj9se.js";import{s as J,q as Q,g as W,r as m,x as O,j as Y,k as Z,c as p,a as o,l as C,b as n,d as v,w as _,y as ee,F as te,p as se,z as ne,A as oe,o as u,t as T,n as V,B as E}from"./JxSLzYFz.js";let g;const w=[];function le(b){if(w.push(b),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&w.forEach(d=>d(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set(d){d&&w.forEach(t=>t(d))},get(){return g.value},configurable:!0}),()=>{w.splice(w.indexOf(b),1)}}function ae(){g||(g=J(),le(d));function b(){g&&Q(g)}function d(t){g.value=t,t.host&&t.host.hooks.hook("host:update:reactivity",b)}return g}const ie={class:"relative flex flex-col h-screen n-bg-base"},ce={class:"flex items-center justify-between p-4"},re={class:"flex items-center gap-3"},ue={class:"text-xl font-bold flex items-center gap-2"},de={class:"flex items-center gap-2"},fe={key:0,class:"px-4 pt-4"},me={key:0,class:"text-xs opacity-50 mb-1"},pe={key:0,class:"ml-2"},ve={class:"whitespace-pre-wrap font-mono text-sm"},_e={class:"text-xs opacity-30 mt-1"},ge={key:0,class:"flex items-center justify-center h-full opacity-50"},xe={class:"text-center"},ye={class:"p-4"},ke=W({__name:"index",setup(b){const d=ae(),t=m(null),f=m([]),x=m(""),i=m(!1),N=m(!1),c=m(!1),h=m(null),B=O(()=>i.value?c.value?"Processing...":"Ready":"Disconnected"),L=O(()=>i.value?c.value?"blue":"green":"red");function S(){oe(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})}function M(){return Math.random().toString(36).substring(2,9)}function r(l,e,s=!1){const y={id:M(),role:l,content:e,timestamp:new Date,streaming:s};return f.value.push(y),S(),y}function $(){const l=window.location.origin.replace(/:3300$/,":3355").replace(/:3000$/,":3355");t.value=A(l,{transports:["websocket","polling"]}),t.value.on("connect",()=>{console.log("[claude-client] Connected to socket"),i.value=!0,r("system","Connected to Claude DevTools")}),t.value.on("disconnect",()=>{console.log("[claude-client] Disconnected from socket"),i.value=!1,N.value=!1,c.value=!1,r("system","Disconnected from server")}),t.value.on("session:status",e=>{console.log("[claude-client] Session status:",e),N.value=e.active,c.value=e.processing}),t.value.on("output:chunk",e=>{console.log("[claude-client] Output chunk:",e.length);const s=f.value.findLast(y=>y.role==="assistant");s&&s.streaming?(s.content+=e,S()):r("assistant",e,!0)}),t.value.on("output:complete",()=>{console.log("[claude-client] Output complete");const e=f.value.findLast(s=>s.role==="assistant");e&&(e.streaming=!1)}),t.value.on("output:error",e=>{console.log("[claude-client] Output error:",e),r("system",`Error: ${e}`)}),t.value.on("session:error",e=>{console.log("[claude-client] Session error:",e),r("system",`Session error: ${e}`)}),t.value.on("session:closed",e=>{console.log("[claude-client] Session closed:",e),r("system",`Session ended (exit code: ${e.exitCode})`)})}function j(){t.value&&(t.value.emit("session:reset"),f.value=[],r("system","New conversation started"))}function D(){if(!x.value.trim()||c.value||!i.value)return;const l=x.value.trim();x.value="",r("user",l),t.value&&t.value.emit("message:send",l)}function U(){f.value=[],i.value&&r("system","Chat cleared")}function P(l){console.log(l),l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),D())}return Y(()=>{$()}),Z(()=>{t.value&&t.value.disconnect()}),(l,e)=>{const s=H,y=X,k=z,R=G,I=F,K=q;return u(),p("div",ie,[o("div",ce,[o("div",re,[o("h1",ue,[n(s,{class:"text-green",icon:"carbon:machine-learning-model"}),e[1]||(e[1]=v(" Claude AI ",-1))]),n(y,{n:L.value},{default:_(()=>[v(T(B.value),1)]),_:1},8,["n"])]),o("div",de,[n(k,{disabled:!i.value||c.value,n:"blue",onClick:j},{default:_(()=>[n(s,{class:"mr-1",icon:"carbon:add"}),e[2]||(e[2]=v(" New Chat ",-1))]),_:1},8,["disabled"]),n(k,{n:"gray",onClick:U},{default:_(()=>[n(s,{class:"mr-1",icon:"carbon:trash-can"}),e[3]||(e[3]=v(" Clear ",-1))]),_:1}),n(R,{to:"/mcp"},{default:_(()=>[n(k,{n:"gray"},{default:_(()=>[n(s,{class:"mr-1",icon:"carbon:plug"}),e[4]||(e[4]=v(" MCP ",-1))]),_:1})]),_:1})])]),ee(d)?C("",!0):(u(),p("div",fe,[n(I,{n:"yellow"},{default:_(()=>[...e[5]||(e[5]=[v(" Open this page inside Nuxt DevTools for best experience. ",-1)])]),_:1})])),o("div",{ref_key:"messagesContainer",ref:h,class:"flex-1 overflow-auto p-4 space-y-4"},[(u(!0),p(te,null,se(f.value,a=>(u(),p("div",{key:a.id,class:V([a.role==="user"?"justify-end":"justify-start","flex"])},[o("div",{class:V([{"bg-green-500/20 text-green-800 dark:text-green-100":a.role==="user","n-bg-active":a.role==="assistant","bg-yellow-500/20 text-yellow-800 dark:text-yellow-200 text-sm":a.role==="system"},"max-w-[80%] rounded-lg px-4 py-2"])},[a.role==="assistant"?(u(),p("div",me,[e[6]||(e[6]=v(" Claude ",-1)),a.streaming?(u(),p("span",pe,[n(s,{class:"animate-pulse",icon:"carbon:circle-filled"})])):C("",!0)])):C("",!0),o("div",ve,T(a.content),1),o("div",_e,T(a.timestamp.toLocaleTimeString()),1)],2)],2))),128)),f.value.length===0?(u(),p("div",ge,[o("div",xe,[n(s,{class:"text-4xl mb-2",icon:"carbon:chat"}),e[7]||(e[7]=o("p",null,"Send a message to start chatting with Claude",-1))])])):C("",!0)],512),o("div",ye,[o("div",{class:"flex gap-2",onKeydown:ne(P,["enter"])},[n(K,{modelValue:x.value,"onUpdate:modelValue":e[0]||(e[0]=a=>x.value=a),disabled:!i.value||c.value,class:"flex-1 font-mono",placeholder:"Type your message..."},null,8,["modelValue","disabled"]),n(k,{disabled:!x.value.trim()||!i.value||c.value,n:"green",onClick:D},{default:_(()=>[c.value?(u(),E(s,{key:0,class:"animate-spin",icon:"carbon:loading"})):(u(),E(s,{key:1,icon:"carbon:send"}))]),_:1},8,["disabled"])],32),e[8]||(e[8]=o("div",{class:"text-xs opacity-50 mt-2"}," Press Enter to send | --continue will be used for follow-up messages ",-1))])])}}});export{ke as default};
@@ -1 +0,0 @@
1
- import{_ as A}from"./BWmwj9se.js";import{_ as F,a as L,b as B,c as R,d as E,l as q}from"./DYOOVyPh.js";import{g as D,r as p,j as H,k as I,c as r,o as u,a as l,b as s,w as i,d as a,n as z,l as C,t as c,m as g,v as b,F as V,p as G}from"./JxSLzYFz.js";const J={class:"relative flex flex-col h-screen n-bg-base"},K={class:"flex items-center justify-between p-4"},O={class:"flex items-center gap-3"},Q={class:"text-xl font-bold flex items-center gap-2"},W={class:"flex items-center gap-2"},X={class:"flex-1 overflow-auto p-4 space-y-6"},Y={key:0,class:"n-bg-active rounded-lg p-4 mb-4"},Z={key:0,class:"mb-4"},h={class:"space-y-4"},ee={class:"flex gap-4"},le={class:"flex items-center gap-2"},te={class:"flex items-center gap-2"},oe={class:"flex items-center gap-2"},se={key:1},ne={class:"flex gap-4"},ae={class:"flex items-center gap-2"},re={class:"flex items-center gap-2"},ue={class:"flex gap-2 pt-2"},ie={class:"text-lg font-semibold mb-3 flex items-center gap-2"},de={key:0,class:"n-bg-active rounded-lg p-4 opacity-50"},me={key:1,class:"space-y-2"},pe={class:"font-bold flex items-center gap-2"},ce={class:"text-sm opacity-70 font-mono"},_e=D({__name:"mcp",setup(ve){const n=p(null),x=p(!1),w=p([]),_=p(!1),k=p(!1),t=p({name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"}),d=p("");function U(){const m=window.location.origin.replace(/:3300$/,":3355").replace(/:3000$/,":3355");n.value=q(m,{transports:["websocket","polling"]}),n.value.on("connect",()=>{console.log("[mcp-client] Connected to socket"),x.value=!0,S()}),n.value.on("disconnect",()=>{console.log("[mcp-client] Disconnected from socket"),x.value=!1}),n.value.on("mcp:list",e=>{console.log("[mcp-client] MCP list received",e),w.value=e,_.value=!1}),n.value.on("mcp:added",e=>{console.log("[mcp-client] MCP added result",e),e.success?(k.value=!1,N()):d.value=e.error||"Failed to add MCP server"}),n.value.on("mcp:removed",e=>{console.log("[mcp-client] MCP removed result",e),e.success||alert(`Failed to remove: ${e.error}`)})}function S(){n.value&&(_.value=!0,n.value.emit("mcp:list"))}function N(){t.value={name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"},d.value=""}function M(){if(!t.value.name){d.value="Name is required";return}if(t.value.transport==="stdio"&&!t.value.command){d.value="Command is required for stdio transport";return}if((t.value.transport==="http"||t.value.transport==="sse")&&!t.value.url){d.value="URL is required for HTTP/SSE transport";return}if(n.value){const m=t.value.args.split(" ").map(e=>e.trim()).filter(e=>e.length>0);n.value.emit("mcp:add",{name:t.value.name,transport:t.value.transport,command:t.value.command,args:m,url:t.value.url,scope:t.value.scope})}}function P(m){confirm(`Remove MCP server "${m.name}"?`)&&n.value&&n.value.emit("mcp:remove",{name:m.name})}return H(()=>{U()}),I(()=>{n.value&&n.value.disconnect()}),(m,e)=>{const $=A,v=F,f=L,T=B,y=R,j=E;return u(),r("div",J,[l("div",K,[l("div",O,[s($,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:i(()=>[...e[11]||(e[11]=[a(" ← Chat ",-1)])]),_:1}),l("h1",Q,[s(v,{class:"text-blue",icon:"carbon:plug"}),e[12]||(e[12]=a(" MCP Servers ",-1))])]),l("div",W,[s(f,{disabled:!x.value,n:"blue",onClick:e[0]||(e[0]=o=>k.value=!0)},{default:i(()=>[s(v,{class:"mr-1",icon:"carbon:add"}),e[13]||(e[13]=a(" Add Server ",-1))]),_:1},8,["disabled"]),s(f,{disabled:!x.value||_.value,n:"gray",onClick:S},{default:i(()=>[s(v,{class:z([{"animate-spin":_.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[14]||(e[14]=a(" Refresh ",-1))]),_:1},8,["disabled"])])]),l("div",X,[k.value?(u(),r("div",Y,[e[28]||(e[28]=l("h3",{class:"font-bold mb-4"}," Add MCP Server ",-1)),d.value?(u(),r("div",Z,[s(T,{icon:"carbon:warning",n:"red"},{default:i(()=>[a(c(d.value),1)]),_:1})])):C("",!0),l("div",h,[l("div",null,[e[15]||(e[15]=l("label",{class:"block text-sm font-medium mb-1"},"Name",-1)),s(y,{modelValue:t.value.name,"onUpdate:modelValue":e[1]||(e[1]=o=>t.value.name=o),class:"w-full",placeholder:"e.g. github, nuxt-ui-remote"},null,8,["modelValue"])]),l("div",null,[e[19]||(e[19]=l("label",{class:"block text-sm font-medium mb-1"},"Transport",-1)),l("div",ee,[l("label",le,[g(l("input",{"onUpdate:modelValue":e[2]||(e[2]=o=>t.value.transport=o),name:"transport",type:"radio",value:"stdio"},null,512),[[b,t.value.transport]]),e[16]||(e[16]=l("span",null,"stdio (local command)",-1))]),l("label",te,[g(l("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>t.value.transport=o),name:"transport",type:"radio",value:"http"},null,512),[[b,t.value.transport]]),e[17]||(e[17]=l("span",null,"HTTP (remote)",-1))]),l("label",oe,[g(l("input",{"onUpdate:modelValue":e[4]||(e[4]=o=>t.value.transport=o),name:"transport",type:"radio",value:"sse"},null,512),[[b,t.value.transport]]),e[18]||(e[18]=l("span",null,"SSE (remote)",-1))])])]),t.value.transport==="stdio"?(u(),r(V,{key:0},[l("div",null,[e[20]||(e[20]=l("label",{class:"block text-sm font-medium mb-1"},"Command",-1)),s(y,{modelValue:t.value.command,"onUpdate:modelValue":e[5]||(e[5]=o=>t.value.command=o),class:"w-full font-mono",placeholder:"e.g. npx"},null,8,["modelValue"])]),l("div",null,[e[21]||(e[21]=l("label",{class:"block text-sm font-medium mb-1"},"Arguments (space separated)",-1)),s(y,{modelValue:t.value.args,"onUpdate:modelValue":e[6]||(e[6]=o=>t.value.args=o),class:"w-full font-mono",placeholder:"e.g. -y @modelcontextprotocol/server-github"},null,8,["modelValue"])])],64)):C("",!0),t.value.transport==="http"||t.value.transport==="sse"?(u(),r("div",se,[e[22]||(e[22]=l("label",{class:"block text-sm font-medium mb-1"},"URL",-1)),s(y,{modelValue:t.value.url,"onUpdate:modelValue":e[7]||(e[7]=o=>t.value.url=o),class:"w-full font-mono",placeholder:"e.g. https://ui.nuxt.com/mcp"},null,8,["modelValue"])])):C("",!0),l("div",null,[e[25]||(e[25]=l("label",{class:"block text-sm font-medium mb-1"},"Scope",-1)),l("div",ne,[l("label",ae,[g(l("input",{"onUpdate:modelValue":e[8]||(e[8]=o=>t.value.scope=o),name:"scope",type:"radio",value:"local"},null,512),[[b,t.value.scope]]),e[23]||(e[23]=l("span",null,"Local (this project, private)",-1))]),l("label",re,[g(l("input",{"onUpdate:modelValue":e[9]||(e[9]=o=>t.value.scope=o),name:"scope",type:"radio",value:"global"},null,512),[[b,t.value.scope]]),e[24]||(e[24]=l("span",null,"User (all projects)",-1))])])]),l("div",ue,[s(f,{n:"green",onClick:M},{default:i(()=>[...e[26]||(e[26]=[a(" Add Server ",-1)])]),_:1}),s(f,{n:"gray",onClick:e[10]||(e[10]=o=>{k.value=!1,N()})},{default:i(()=>[...e[27]||(e[27]=[a(" Cancel ",-1)])]),_:1})])])])):C("",!0),l("div",null,[l("h2",ie,[s(v,{icon:"carbon:plug"}),e[29]||(e[29]=a(" Configured Servers ",-1))]),w.value.length===0?(u(),r("div",de," No MCP servers configured ")):(u(),r("div",me,[(u(!0),r(V,null,G(w.value,o=>(u(),r("div",{key:o.name,class:"n-bg-active rounded-lg p-4 flex items-center justify-between"},[l("div",null,[l("div",pe,[a(c(o.name)+" ",1),s(j,{n:o.transport==="stdio"?"gray":"blue",class:"text-xs"},{default:i(()=>[a(c(o.transport),1)]),_:2},1032,["n"])]),l("div",ce,[o.transport==="stdio"?(u(),r(V,{key:0},[a(c(o.command)+" "+c(o.args?.join(" ")),1)],64)):(u(),r(V,{key:1},[a(c(o.url),1)],64))])]),s(f,{n:"red",onClick:fe=>P(o)},{default:i(()=>[s(v,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]))),128))]))])])])}}});export{_e as default};