dexto 1.1.8 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/agents/agent-template.yml +1 -1
- package/dist/agents/product-name-researcher/product-name-researcher.yml +1 -1
- package/dist/index.js +4 -2
- package/dist/webui/.next/standalone/.next/static/chunks/app/page-5e94d5a49dc718d0.js +1 -0
- package/dist/webui/.next/standalone/packages/webui/.next/BUILD_ID +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/app-build-manifest.json +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/build-manifest.json +2 -2
- package/dist/webui/.next/standalone/packages/webui/.next/prerender-manifest.json +3 -3
- package/dist/webui/.next/standalone/packages/webui/.next/required-server-files.json +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/server/app/playground/page_client-reference-manifest.js +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/server/pages/500.html +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/server/server-reference-manifest.json +1 -1
- package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/page-5e94d5a49dc718d0.js +1 -0
- package/dist/webui/.next/standalone/packages/webui/package.json +1 -1
- package/dist/webui/.next/standalone/packages/webui/server.js +1 -1
- package/dist/webui/.next/static/chunks/app/page-5e94d5a49dc718d0.js +1 -0
- package/dist/webui/package.json +1 -1
- package/package.json +2 -2
- package/dist/webui/.next/standalone/.next/static/chunks/app/page-1a1b5591a5f62ca5.js +0 -1
- package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/page-1a1b5591a5f62ca5.js +0 -1
- package/dist/webui/.next/static/chunks/app/page-1a1b5591a5f62ca5.js +0 -1
- /package/dist/webui/.next/standalone/.next/static/{_5RTE-15cb-kjZPtF45Oe → PvkEd_BO6ZXxX99T_gUvs}/_buildManifest.js +0 -0
- /package/dist/webui/.next/standalone/.next/static/{_5RTE-15cb-kjZPtF45Oe → PvkEd_BO6ZXxX99T_gUvs}/_ssgManifest.js +0 -0
- /package/dist/webui/.next/standalone/packages/webui/.next/static/{_5RTE-15cb-kjZPtF45Oe → PvkEd_BO6ZXxX99T_gUvs}/_buildManifest.js +0 -0
- /package/dist/webui/.next/standalone/packages/webui/.next/static/{_5RTE-15cb-kjZPtF45Oe → PvkEd_BO6ZXxX99T_gUvs}/_ssgManifest.js +0 -0
- /package/dist/webui/.next/static/{_5RTE-15cb-kjZPtF45Oe → PvkEd_BO6ZXxX99T_gUvs}/_buildManifest.js +0 -0
- /package/dist/webui/.next/static/{_5RTE-15cb-kjZPtF45Oe → PvkEd_BO6ZXxX99T_gUvs}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -219,7 +219,7 @@ Switch between providers instantly—no code changes required.
|
|
|
219
219
|
| Provider | Models | Setup |
|
|
220
220
|
|----------|--------|-------|
|
|
221
221
|
| **OpenAI** | `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`, `gpt-4o-audio-preview`, `o4-mini`, `o3`, `o3-mini`, `o1` | `export OPENAI_API_KEY=...` |
|
|
222
|
-
| **Anthropic** | `claude-opus-4-1-20250805`, `claude-4-opus-20250514`, `claude-4-sonnet-20250514`, `claude-3-7-sonnet-20250219`, `claude-3-5-sonnet-20240620`, `claude-3-5-haiku-20241022` | `export ANTHROPIC_API_KEY=...` |
|
|
222
|
+
| **Anthropic** | `claude-sonnet-4-5-20250929`, `claude-opus-4-1-20250805`, `claude-4-opus-20250514`, `claude-4-sonnet-20250514`, `claude-3-7-sonnet-20250219`, `claude-3-5-sonnet-20240620`, `claude-3-5-haiku-20241022` | `export ANTHROPIC_API_KEY=...` |
|
|
223
223
|
| **Google** | `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, `gemini-2.0-flash`, `gemini-2.0-flash-lite` | `export GOOGLE_GENERATIVE_AI_API_KEY=...` |
|
|
224
224
|
| **Groq** | `llama-3.3-70b-versatile`, `meta-llama/llama-4-scout-17b-16e-instruct`, `meta-llama/llama-4-maverick-17b-128e-instruct`, `qwen/qwen3-32b`, `gemma-2-9b-it`, `openai/gpt-oss-20b`, `openai/gpt-oss-120b`, `moonshotai/kimi-k2-instruct`, `deepseek-r1-distill-llama-70b` | `export GROQ_API_KEY=...` |
|
|
225
225
|
| **xAI** | `grok-4`, `grok-3`, `grok-3-mini`, `grok-code-fast-1` | `export XAI_API_KEY=...` |
|
|
@@ -227,7 +227,7 @@ Switch between providers instantly—no code changes required.
|
|
|
227
227
|
|
|
228
228
|
```bash
|
|
229
229
|
# Switch models via CLI
|
|
230
|
-
dexto -m claude-4-
|
|
230
|
+
dexto -m claude-sonnet-4-5-20250929
|
|
231
231
|
dexto -m gemini-2.5-pro
|
|
232
232
|
```
|
|
233
233
|
|
|
@@ -303,7 +303,7 @@ const currentLLM = agent.getCurrentLLMConfig();
|
|
|
303
303
|
|
|
304
304
|
// Switch models (provider inferred automatically)
|
|
305
305
|
await agent.switchLLM({ model: 'gpt-4.1-mini' });
|
|
306
|
-
await agent.switchLLM({ model: 'claude-4-
|
|
306
|
+
await agent.switchLLM({ model: 'claude-sonnet-4-5-20250929' });
|
|
307
307
|
|
|
308
308
|
// Switch model for a specific session id 1234
|
|
309
309
|
await agent.switchLLM({ model: 'gpt-4.1-mini' }, '1234')
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,7 @@ program
|
|
|
45
45
|
.option('-s, --strict', 'Require all server connections to succeed')
|
|
46
46
|
.option('--no-verbose', 'Disable verbose output')
|
|
47
47
|
.option('--no-interactive', 'Disable interactive prompts and API key setup')
|
|
48
|
+
.option('--skip-setup', 'Skip global setup validation (useful for MCP mode, automation)')
|
|
48
49
|
.option('-m, --model <model>', 'Specify the LLM model to use')
|
|
49
50
|
.option('--router <router>', 'Specify the LLM router to use (vercel or in-built)')
|
|
50
51
|
.option('--auto-approve', 'Always approve tool executions without confirmation prompts')
|
|
@@ -501,10 +502,11 @@ program
|
|
|
501
502
|
}
|
|
502
503
|
}
|
|
503
504
|
// Check setup state and auto-trigger if needed
|
|
504
|
-
if (
|
|
505
|
+
// Skip if --skip-setup flag is set (for MCP mode, automation, etc.)
|
|
506
|
+
if (!opts.skipSetup && (await requiresSetup())) {
|
|
505
507
|
if (opts.interactive === false) {
|
|
506
508
|
console.error('❌ Setup required but --no-interactive flag is set.');
|
|
507
|
-
console.error('💡 Run `dexto setup` to
|
|
509
|
+
console.error('💡 Run `dexto setup` first, or use --skip-setup to bypass global setup.');
|
|
508
510
|
safeExit('main', 1, 'setup-required-non-interactive');
|
|
509
511
|
}
|
|
510
512
|
await handleSetupCommand({ interactive: true });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{6810:(e,t,s)=>{"use strict";s.d(t,{default:()=>tI});var r,a=s(5801),n=s(5789),i=s(9854),l=s(6032),o=s(1236),c=s(1295),d=s(7891),m=s(4590),u=s(1828),x=s(9198),h=s(8537),p=s(4398);function f(e){let{delayDuration:t=0,...s}=e;return(0,a.jsx)(p.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...s})}function g(e){let{...t}=e;return(0,a.jsx)(f,{children:(0,a.jsx)(p.bL,{"data-slot":"tooltip",...t})})}function v(e){let{...t}=e;return(0,a.jsx)(p.l9,{"data-slot":"tooltip-trigger",...t})}function j(e){let{className:t,sideOffset:s=0,children:r,...n}=e;return(0,a.jsx)(p.ZL,{children:(0,a.jsxs)(p.UC,{"data-slot":"tooltip-content",sideOffset:s,className:(0,l.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,(0,a.jsx)(p.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var b=s(5315);let y=(0,n.forwardRef)((e,t)=>{let{children:s,tooltip:r,side:n="bottom",className:i,...o}=e;return(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)(b.$,{variant:"ghost",size:"icon",...o,className:(0,l.cn)("size-6 p-1",i),ref:t,children:[s,(0,a.jsx)("span",{className:"sr-only",children:r})]})}),(0,a.jsx)(j,{side:n,children:r})]})});function N(e){let{value:t,tooltip:s="Copy",copiedTooltip:r="Copied!",className:i,size:l=12}=e,[o,c]=(0,n.useState)(!1);return(0,a.jsx)(y,{tooltip:o?r:s,onClick:()=>{navigator.clipboard.writeText(t).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)}).catch(()=>{})},className:i,children:o?(0,a.jsx)(x.A,{size:l}):(0,a.jsx)(h.A,{size:l})})}y.displayName="TooltipIconButton";var w=s(8559),k=s(4957);class C{get supported(){return"speechSynthesis"in window&&"SpeechSynthesisUtterance"in window}isSpeaking(){return this._speaking}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}subscribeVoices(e){return this.voiceSubscribers.add(e),()=>{this.voiceSubscribers.delete(e)}}notify(){for(let e of this.subscribers)try{e()}catch(e){}}stop(){if(this.supported){try{window.speechSynthesis.cancel()}catch(e){}this.utterance=null,this._speaking&&(this._speaking=!1,this.notify())}}speak(e,t){if(!this.supported||!e||!e.trim())return;this.stop();let s=new window.SpeechSynthesisUtterance(e);(null==t?void 0:t.rate)!=null&&(s.rate=t.rate),(null==t?void 0:t.pitch)!=null&&(s.pitch=t.pitch);let r=this.resolveVoice();if(r)try{s.voice=r,(null==t?void 0:t.lang)?s.lang=t.lang:r.lang&&(s.lang=r.lang)}catch(e){}else(null==t?void 0:t.lang)&&(s.lang=t.lang);s.onstart=()=>{this.utterance===s&&(this._speaking=!0,this.notify())};let a=()=>{this.utterance===s&&(this._speaking=!1,this.utterance=null,this.notify())};s.onend=a,s.onerror=a;try{this.utterance=s,window.speechSynthesis.speak(s),this._speaking||(this._speaking=!0,this.notify())}catch(e){a()}}getVoices(){return this.voices}setPreferredVoice(e){this.preferredVoiceName=e&&e.length?e:null;try{this.preferredVoiceName?window.localStorage.setItem("ttsVoiceName",this.preferredVoiceName):window.localStorage.removeItem("ttsVoiceName")}catch(e){}this.voiceSubscribers.forEach(e=>e())}getPreferredVoiceName(){return this.preferredVoiceName}resolveVoice(){if(!this.voices.length)return null;let e=this.preferredVoiceName?this.voices.find(e=>e.name===this.preferredVoiceName):null;if(e)return e;let t=this.voices.find(e=>{var t;return"google uk english female"===e.name.toLowerCase()||e.name.toLowerCase().includes("google uk english female")&&(null==(t=e.lang)?void 0:t.toLowerCase().startsWith("en-gb"))});if(t)return t;let s=e=>{var t;let s=e.name.toLowerCase(),r=(null!=(t=e.lang)?t:"").toLowerCase(),a=0;return("en"===r||r.startsWith("en-"))&&(a+=3),s.includes("google")&&(a+=5),(s.includes("microsoft")||s.includes("azure"))&&(a+=4),(s.includes("natural")||s.includes("neural")||s.includes("premium"))&&(a+=4),s.includes("siri")&&(a+=3),s.includes("female")&&(a+=1),a};return[...this.voices].sort((e,t)=>s(t)-s(e))[0]||this.voices[0]||null}constructor(){if(this._speaking=!1,this.subscribers=new Set,this.utterance=null,this.voices=[],this.voiceSubscribers=new Set,this.preferredVoiceName=null,this.supported){try{let e=window.localStorage.getItem("ttsVoiceName");this.preferredVoiceName=e&&e.length?e:null}catch(e){}let e=()=>{try{let e=window.speechSynthesis.getVoices()||[];(e.length!==this.voices.length||e.some((e,t)=>{var s;return e.name!==(null==(s=this.voices[t])?void 0:s.name)}))&&(this.voices=e,this.voiceSubscribers.forEach(e=>e()))}catch(e){}};e();try{window.speechSynthesis.addEventListener("voiceschanged",e)}catch(e){}}}}let S=globalThis,A=null!=(r=S.__speechController)?r:S.__speechController=new C;function E(e){let{value:t,tooltip:s="Speak",stopTooltip:r="Stop",className:i,rate:l=1,pitch:o=1,lang:c}=e,[d,m]=(0,n.useState)(!1),u=A.supported,x=(null!=t?t:"").trim().length>0;return(0,n.useEffect)(()=>(m(A.isSpeaking()),A.subscribe(()=>m(A.isSpeaking()))),[]),(0,a.jsx)(y,{tooltip:d?r:s,onClick:()=>{if(u&&x){if(d)return A.stop();A.speak(t,{rate:l,pitch:o,lang:c})}},className:i,disabled:!u||!x,children:d?(0,a.jsx)(w.A,{size:12}):(0,a.jsx)(k.A,{size:12})})}function T(e){var t;let{error:s,onDismiss:r}=e,[i,l]=(0,n.useState)(!1),o=null==(t=s.detailedIssues)?void 0:t[0],x=(null==o?void 0:o.context)&&"object"==typeof o.context&&"detailedIssues"in o.context?o.context.detailedIssues:[],h=x.length>0?"".concat(s.message,"\n\nDetails:\n").concat(x.map(e=>{let t=e.message;if(e.context){let s="string"==typeof e.context?e.context:JSON.stringify(e.context,null,2);t+="\nContext: ".concat(s)}return t}).join("\n\n")):s.message;return(0,a.jsx)("div",{className:"w-full rounded-lg p-4 mb-4 border shadow-sm bg-destructive/10 border-destructive/40",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(c.A,{className:"h-5 w-5 text-destructive mt-0.5 flex-shrink-0"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-destructive",children:"Error"}),s.context&&(0,a.jsx)("span",{className:"text-xs bg-destructive/15 text-destructive px-2 py-0.5 rounded-full",children:s.context})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[x.length>0&&(0,a.jsx)("button",{onClick:()=>l(!i),className:"p-1 hover:bg-destructive/15 rounded text-destructive",title:i?"Collapse":"Expand",children:i?(0,a.jsx)(d.A,{className:"h-4 w-4"}):(0,a.jsx)(m.A,{className:"h-4 w-4"})}),(0,a.jsx)(N,{value:h,tooltip:"Copy error",className:"p-1 hover:bg-destructive/15 rounded text-destructive",size:16}),(0,a.jsx)(E,{value:h,tooltip:"Read error",className:"p-1 hover:bg-destructive/15 rounded text-destructive"}),(0,a.jsx)("button",{onClick:r,className:"p-1 hover:bg-destructive/15 rounded text-destructive",title:"Dismiss",children:(0,a.jsx)(u.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"mt-2 text-sm text-destructive",children:s.message}),i&&x.length>0&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("div",{className:"text-xs text-destructive bg-destructive/10 p-3 rounded border border-destructive/30 overflow-auto max-h-60",children:x.map((e,t)=>(0,a.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,a.jsx)("div",{className:"font-medium",children:e.message}),null!=e.context&&(0,a.jsx)("div",{className:"text-destructive/70 mt-1",children:"string"==typeof e.context?e.context:JSON.stringify(e.context,null,2)})]},t))})})]})]})})}var I=s(8667),R=s(8109),D=s(9597),L=s(732),F=s(5192),P=s(530),O=s(2913),z=s(8369),M=s(198),_=s(3801),U=s(2125),K=s(4439),$=s(9196);let V=(0,n.memo)(e=>{let{children:t}=e;return(0,a.jsx)("div",{className:"prose max-w-none dark:prose-invert [&>p]:my-5 [&>p]:leading-7 [&>p]:first:mt-0 [&>p]:last:mb-0 [&>h1]:mb-8 [&>h1]:text-4xl [&>h1]:font-extrabold [&>h1]:tracking-tight [&>h1]:last:mb-0 [&>h2]:mb-4 [&>h2]:mt-8 [&>h2]:text-3xl [&>h2]:font-semibold [&>h2]:tracking-tight [&>h2]:first:mt-0 [&>h2]:last:mb-0 [&>h3]:mb-4 [&>h3]:mt-6 [&>h3]:text-2xl [&>h3]:font-semibold [&>h3]:tracking-tight [&>h3]:first:mt-0 [&>h3]:last:mb-0 [&>h4]:mb-4 [&>h4]:mt-6 [&>h4]:text-xl [&>h4]:font-semibold [&>h4]:tracking-tight [&>h4]:first:mt-0 [&>h4]:last:mb-0 [&>ul]:my-5 [&>ul]:ml-6 [&>ul]:list-disc [&>ul>li]:mt-2 [&>ol]:my-5 [&>ol]:ml-6 [&>ol]:list-decimal [&>ol>li]:mt-2 [&_ul]:my-5 [&_ul]:ml-6 [&_ul]:list-disc [&_ul>li]:mt-2 [&_ol]:my-5 [&_ol]:ml-6 [&_ol]:list-decimal [&_ol>li]:mt-2 [&>blockquote]:border-l-2 [&>blockquote]:pl-6 [&>blockquote]:italic [&>hr]:my-5 [&>hr]:border-b",children:(0,a.jsx)(K.oz,{remarkPlugins:[$.A],skipHtml:!0,components:{table:e=>{let{className:t,children:s,...r}=e;return(0,a.jsx)("div",{className:"my-4 overflow-x-auto -mx-1 px-1",children:(0,a.jsx)("table",{className:["w-full border-separate border-spacing-0",t].filter(Boolean).join(" "),...r,children:s})})},thead:e=>{let{className:t,...s}=e;return(0,a.jsx)("thead",{className:t,...s})},tr:e=>{let{className:t,...s}=e;return(0,a.jsx)("tr",{className:["m-0 border-b first:border-t","[&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",t].filter(Boolean).join(" "),...s})},th:e=>{let{className:t,...s}=e;return(0,a.jsx)("th",{className:["bg-muted text-left font-bold align-top","px-4 py-2 first:rounded-tl-lg last:rounded-tr-lg","[&[align=center]]:text-center [&[align=right]]:text-right",t].filter(Boolean).join(" "),...s})},td:e=>{let{className:t,...s}=e;return(0,a.jsx)("td",{className:["border-b border-l last:border-r text-left align-top","px-4 py-2 whitespace-normal break-words","[&[align=center]]:text-center [&[align=right]]:text-right",t].filter(Boolean).join(" "),...s})},code:e=>{let{className:t,children:s,...r}=e,[i,l]=(0,n.useState)(!1),o=String(null!=s?s:"").replace(/\n$/,"");return t?(0,a.jsxs)("div",{className:"relative group my-4",children:[(0,a.jsx)(y,{tooltip:i?"Copied!":"Copy code",onClick:()=>{navigator.clipboard.writeText(o).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)}).catch(()=>{})},className:"absolute right-2 top-2 z-10 opacity-70 hover:opacity-100 transition-opacity bg-background/80 hover:bg-background",children:i?(0,a.jsx)(x.A,{size:14}):(0,a.jsx)(h.A,{size:14})}),(0,a.jsx)("pre",{className:"overflow-auto bg-muted p-3 rounded-lg text-sm",children:(0,a.jsx)("code",{className:t,children:o})})]}):(0,a.jsx)("code",{className:"text-xs px-1.5 py-0.5 bg-muted rounded font-mono",...r,children:s})}},children:t})})});function q(e){return/^data:image\/(png|jpeg|jpg|gif|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/i.test(e)}function B(e){try{let t=new URL(e);return("https:"===t.protocol||"http:"===t.protocol)&&"localhost"!==t.hostname}catch(e){return!1}}function J(e){var t,s;if(e.base64&&e.mimeType)return"data:".concat(e.mimeType,";base64,").concat(e.base64);if("string"==typeof e.base64)return e.base64;let r=null!=(s=null!=(t=e.url)?t:e.image)?s:e.audio;return"string"==typeof r?r:""}function G(e){let{messages:t,activeError:s,onDismissError:r,outerRef:i}=e,x=(0,n.useRef)(null),[h,p]=(0,n.useState)({}),[f,b]=(0,n.useState)({}),[y,w]=(0,n.useState)(null);(0,n.useRef)(null);let[C,S]=(0,n.useState)({isOpen:!1,src:"",alt:""});if((0,n.useEffect)(()=>{let e=document.createElement("style");return e.textContent="\n .audio-controls-container audio {\n max-width: 100% !important;\n width: 100% !important;\n height: auto !important;\n min-height: 32px;\n }\n .audio-controls-container audio::-webkit-media-controls-panel {\n max-width: 100% !important;\n }\n .audio-controls-container audio::-webkit-media-controls-timeline {\n max-width: 100% !important;\n }\n ",document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]),!t||0===t.length)return null;let A=e=>"string"==typeof e.content?e.content:Array.isArray(e.content)?e.content.map(e=>(0,o.PI)(e)?e.text:"").filter(Boolean).join("\n"):e.content&&"object"==typeof e.content?JSON.stringify(e.content,null,2):"",K=e=>e?(0,o.KU)(e)?"object"==typeof e.error?JSON.stringify(e.error,null,2):String(e.error):(0,o.P2)(e)?e.content.map(e=>(0,o.PI)(e)?e.text:"object"==typeof e?"":String(e)).filter(Boolean).join("\n"):"object"==typeof e?JSON.stringify(e,null,2):String(e):"";return(0,a.jsxs)("div",{id:"message-list-container",ref:i,className:"flex flex-col space-y-3 px-4 py-2",children:[t.map((e,n)=>{var i,u,x,y;let w=null!=(u=e.id)?u:"msg-".concat(n),C="user"===e.role,$="assistant"===e.role,G="system"===e.role,W=n===t.length-1,H=!!(e.toolName&&e.toolArgs),Y=!!(e.toolName&&e.toolResult),Z=H||Y,Q=Z&&W||!!h[w],X=[],ee=[];Y&&e.toolResult&&(0,o.P2)(e.toolResult)&&e.toolResult.content.forEach((e,t)=>{if((0,o.j0)(e)){let s=J(e);s&&(s.startsWith("data:")&&q(s)||s.startsWith("blob:")||B(s))&&X.push({src:s,alt:"Tool result image ".concat(t+1),index:t})}else if((0,o.kz)(e)){let s=J(e);s&&(s.startsWith("data:audio/")||s.startsWith("blob:")||B(s))&&ee.push({src:s,filename:e.filename,index:t})}});let et=C?I.A:R.A,es=(0,l.cn)(C?"grid w-full grid-cols-[1fr_auto] gap-x-2 items-start":"grid w-full grid-cols-[auto_1fr] gap-x-2 items-start"),er=(0,l.cn)("tool"===e.role?"w-full text-muted-foreground/70 bg-secondary border border-muted/30 rounded-md text-base":C?"p-3 rounded-xl shadow-sm w-fit max-w-[75%] bg-primary text-primary-foreground rounded-br-none text-base break-normal hyphens-none":$?"p-3 rounded-xl shadow-sm w-fit max-w-[90%] bg-card text-card-foreground border border-border rounded-bl-none text-base break-normal hyphens-none":G?"p-3 shadow-none w-full bg-transparent text-xs text-muted-foreground italic text-center border-none":""),ea=new Date(e.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),en=!!(s&&s.anchorMessageId===e.id);return(0,a.jsxs)("div",{className:"w-full","data-role":e.role,id:e.id?"message-".concat(e.id):void 0,children:[(0,a.jsxs)("div",{className:es,children:[$&&(0,a.jsx)(et,{className:"h-7 w-7 mt-1 text-muted-foreground col-start-1"}),"tool"===e.role&&(0,a.jsx)(D.A,{className:"h-7 w-7 p-1 mt-1 rounded-full border border-border text-muted-foreground col-start-1"}),(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-col group w-full",G?"col-span-2 items-center":C?"col-start-1 justify-self-end items-end":"col-start-2 justify-self-start items-start"),children:[(0,a.jsx)("div",{className:er,children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[$&&"string"==typeof e.reasoning&&e.reasoning.trim().length>0&&(0,a.jsxs)("div",{className:"mb-3 border border-orange-200/50 dark:border-orange-400/20 rounded-lg bg-gradient-to-br from-orange-50/30 to-amber-50/20 dark:from-orange-900/20 dark:to-amber-900/10",children:[(0,a.jsxs)("div",{className:"px-3 py-2 border-b border-orange-200/30 dark:border-orange-400/20 bg-orange-100/50 dark:bg-orange-900/30 rounded-t-lg flex items-center justify-between",children:[(0,a.jsxs)("button",{type:"button",className:"flex items-center gap-2 text-xs font-medium text-orange-700 dark:text-orange-300 hover:text-orange-800 dark:hover:text-orange-200 transition-colors group",onClick:()=>b(t=>({...t,[e.id]:!t[e.id]})),children:[(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"AI Reasoning"}),null==(x=f[e.id])||x?(0,a.jsx)(d.A,{className:"h-3 w-3 group-hover:scale-110 transition-transform"}):(0,a.jsx)(m.A,{className:"h-3 w-3 group-hover:scale-110 transition-transform"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(N,{value:e.reasoning,tooltip:"Copy reasoning",copiedTooltip:"Copied!",className:"opacity-70 hover:opacity-100 transition-opacity"}),(0,a.jsx)(E,{value:e.reasoning,tooltip:"Speak reasoning",stopTooltip:"Stop",className:"opacity-70 hover:opacity-100 transition-opacity"})]})]}),(null==(y=f[e.id])||y)&&(0,a.jsx)("div",{className:"px-3 py-2",children:(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words text-xs text-orange-800/80 dark:text-orange-200/70 leading-relaxed font-mono",children:e.reasoning})})]}),e.toolName?(0,a.jsxs)("div",{className:"p-2 rounded border border-border bg-muted/30 hover:bg-muted/60 cursor-pointer w-full",onClick:()=>{Z&&p(e=>({...e,[w]:!e[w]}))},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs font-medium",children:[(0,a.jsxs)("span",{className:"flex items-center",children:[Q?(0,a.jsx)(d.A,{className:"h-4 w-4 mr-2 text-primary"}):(0,a.jsx)(F.A,{className:"h-4 w-4 mr-2 text-primary"}),"Tool: ",e.toolName]}),e.toolResult?(0,o.KU)(e.toolResult)?(0,a.jsx)(c.A,{className:"mx-2 h-4 w-4 text-red-500"}):(0,a.jsx)(P.A,{className:"mx-2 h-4 w-4 text-green-500"}):(0,a.jsx)(O.A,{className:"mx-2 h-4 w-4 animate-spin text-muted-foreground"})]}),Q&&(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-medium",children:"Arguments:"}),(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto bg-background/50 p-2 rounded text-xs text-muted-foreground",children:JSON.stringify(e.toolArgs,null,2)})]}),e.toolResult&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-xs font-medium flex items-center justify-between",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("span",{children:"Result:"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(N,{value:K(e.toolResult),tooltip:"Copy result",copiedTooltip:"Copied!",className:"opacity-70 hover:opacity-100 transition-opacity"}),(0,a.jsx)(E,{value:K(e.toolResult),tooltip:"Speak result",stopTooltip:"Stop",className:"opacity-70 hover:opacity-100 transition-opacity"})]})]}),(0,o.KU)(e.toolResult)?(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto bg-red-100 text-red-700 p-2 rounded text-xs",children:"object"==typeof e.toolResult.error?JSON.stringify(e.toolResult.error,null,2):String(e.toolResult.error)}):(0,o.P2)(e.toolResult)?e.toolResult.content.map((e,t)=>(0,o.j0)(e)||(0,o.kz)(e)?null:(0,o.PI)(e)?(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto bg-background/50 p-2 rounded text-xs text-muted-foreground my-1",children:e.text},t):(0,o.EQ)(e)?(0,a.jsxs)("div",{className:"my-1 flex items-center gap-2 p-2 rounded border border-border bg-muted/50",children:[(0,a.jsx)(z.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.filename||"File attachment"," (",e.mimeType,")"]})]},t):(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto bg-background/50 p-2 rounded text-xs text-muted-foreground my-1",children:"object"==typeof e?JSON.stringify(e,null,2):String(e)},t)):(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto bg-background/50 p-2 rounded text-xs text-muted-foreground",children:"string"==typeof e.toolResult&&e.toolResult.startsWith("data:image")?q(e.toolResult)?(0,a.jsx)("img",{src:e.toolResult,alt:"Tool result image",className:"my-1 max-h-48 w-auto rounded border border-border"}):"Invalid image data":"object"==typeof e.toolResult?JSON.stringify(e.toolResult,null,2):String(e.toolResult)})]})]})]}):(0,a.jsxs)(a.Fragment,{children:["string"==typeof e.content&&""!==e.content.trim()&&(0,a.jsx)("div",{className:"relative",children:C?(0,a.jsx)("p",{className:"text-base whitespace-pre-line break-normal",children:e.content}):(0,a.jsx)(V,{children:e.content})}),e.content&&"object"==typeof e.content&&!Array.isArray(e.content)&&(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto bg-background/50 p-2 rounded text-xs text-muted-foreground",children:JSON.stringify(e.content,null,2)}),Array.isArray(e.content)&&e.content.map((e,t)=>{let s="".concat(w,"-part-").concat(t);if("text"===e.type)return(0,a.jsx)("div",{className:"relative",children:C?(0,a.jsx)("p",{className:"text-base whitespace-pre-line break-normal",children:e.text}):(0,a.jsx)(V,{children:e.text})},s);if((0,o.EQ)(e)){if(!e.mimeType.startsWith("audio/"))return(0,a.jsxs)("div",{className:"my-2 flex items-center gap-2 p-3 rounded-lg border border-border bg-muted/50",children:[(0,a.jsx)(M.A,{className:(0,l.cn)("h-5 w-5",C?void 0:"text-muted-foreground")}),(0,a.jsx)("span",{className:(0,l.cn)("text-sm font-medium",void 0),children:e.filename||"".concat(e.mimeType," file")}),(0,a.jsx)("span",{className:(0,l.cn)("text-xs",C?"text-primary-foreground/70":"text-muted-foreground"),children:e.mimeType})]},s);{let t="data:".concat(e.mimeType,";base64,").concat(e.data);return(0,a.jsxs)("div",{className:"my-2 flex items-center gap-2 p-3 rounded-lg border border-border bg-muted/50",children:[(0,a.jsx)(z.A,{className:(0,l.cn)("h-5 w-5",C?void 0:"text-muted-foreground")}),(0,a.jsx)("audio",{controls:!0,src:t,className:"flex-1 h-8"}),e.filename&&(0,a.jsx)("span",{className:(0,l.cn)("text-sm truncate max-w-[120px]",C?"text-primary-foreground/80":"text-muted-foreground"),children:e.filename})]},s)}}return null}),G&&!e.content&&(0,a.jsx)("p",{className:"italic",children:"System message"})]}),e.imageData&&!Array.isArray(e.content)&&(()=>{let t="data:".concat(e.imageData.mimeType,";base64,").concat(e.imageData.base64);return q(t)?(0,a.jsx)("img",{src:t,alt:"attachment",className:"mt-2 max-h-60 w-full rounded-lg border border-border object-contain"}):null})(),e.fileData&&!Array.isArray(e.content)&&(0,a.jsx)("div",{className:"mt-2",children:e.fileData.mimeType.startsWith("audio/")?(0,a.jsxs)("div",{className:"relative w-fit border border-border rounded-lg p-2 bg-muted/50 flex items-center gap-2 group",children:[(0,a.jsx)(z.A,{className:"h-4 w-4"}),(0,a.jsx)("audio",{controls:!0,src:"data:".concat(e.fileData.mimeType,";base64,").concat(e.fileData.base64),className:"h-8"})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-lg border border-border bg-muted/50",children:[(0,a.jsx)(M.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.fileData.filename||"".concat(e.fileData.mimeType," file")}),(0,a.jsx)("span",{className:"text-xs text-primary-foreground/70",children:e.fileData.mimeType})]})})]})}),!G&&!Z&&(0,a.jsxs)("div",{className:"text-xs text-muted-foreground mt-1 px-1 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{children:ea}),$&&(null==(i=e.tokenUsage)?void 0:i.totalTokens)!==void 0&&(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted/50 text-xs cursor-default",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),e.tokenUsage.totalTokens," tokens"]})}),(0,a.jsx)(j,{side:"bottom",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[void 0!==e.tokenUsage.inputTokens&&(0,a.jsxs)("div",{children:["Input: ",e.tokenUsage.inputTokens]}),void 0!==e.tokenUsage.outputTokens&&(0,a.jsxs)("div",{children:["Output: ",e.tokenUsage.outputTokens]}),void 0!==e.tokenUsage.reasoningTokens&&(0,a.jsxs)("div",{children:["Reasoning: ",e.tokenUsage.reasoningTokens]}),(0,a.jsxs)("div",{className:"font-medium mt-0.5",children:["Total: ",e.tokenUsage.totalTokens]})]})})]}),$&&e.model&&(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{children:(0,a.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted/30 text-xs cursor-default",children:e.model})}),(0,a.jsx)(j,{side:"bottom",children:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"font-medium",children:["Model: ",e.model]}),e.provider&&(0,a.jsxs)("div",{className:"font-medium",children:["Provider: ",e.provider]}),e.router&&(0,a.jsxs)("div",{className:"font-medium",children:["Router: ",e.router]})]})})]})]}),($||C)&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(N,{value:A(e),tooltip:"Copy message",copiedTooltip:"Copied!",className:"opacity-70 hover:opacity-100 transition-opacity"}),(0,a.jsx)(E,{value:A(e),tooltip:"Speak",stopTooltip:"Stop",className:"opacity-70 hover:opacity-100 transition-opacity"})]})]})]}),C&&(0,a.jsx)(et,{className:"h-7 w-7 mt-1 text-muted-foreground col-start-2"})]}),X.map((e,t)=>(0,a.jsx)("div",{className:"w-full mt-2",children:(0,a.jsxs)("div",{className:"flex items-end w-full justify-start",children:[(0,a.jsx)(_.A,{className:"h-7 w-7 mr-2 mb-1 text-muted-foreground self-start flex-shrink-0"}),(0,a.jsxs)("div",{className:"flex flex-col items-start",children:[(0,a.jsx)("div",{className:"p-3 rounded-xl shadow-sm max-w-[75%] bg-card text-card-foreground border border-border rounded-bl-none text-sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)(_.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"Tool Result Image"})]}),(0,a.jsxs)("div",{className:"relative group cursor-pointer",onClick:()=>{S({isOpen:!0,src:e.src,alt:e.alt})},children:[(0,a.jsx)("img",{src:e.src,alt:e.alt,className:"max-h-80 w-auto rounded border border-border object-contain transition-transform group-hover:scale-[1.02]"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors rounded border border-border flex items-center justify-center",children:(0,a.jsx)(U.A,{className:"h-8 w-8 text-white opacity-0 group-hover:opacity-100 transition-opacity drop-shadow-lg"})})]})]})}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:(0,a.jsx)("span",{children:ea})})]})]})},"".concat(w,"-image-").concat(t))),ee.map((e,t)=>(0,a.jsx)("div",{className:"w-full mt-2",children:(0,a.jsxs)("div",{className:"flex items-end w-full justify-start",children:[(0,a.jsx)(k.A,{className:"h-7 w-7 mr-2 mb-1 text-muted-foreground self-start flex-shrink-0"}),(0,a.jsxs)("div",{className:"flex flex-col items-start",children:[(0,a.jsx)("div",{className:"p-3 rounded-xl shadow-sm max-w-[75%] bg-card text-card-foreground border border-border rounded-bl-none text-sm overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)(k.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"Tool Result Audio"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-2 rounded border border-border bg-muted/30 min-w-0 audio-controls-container",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(z.A,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),(0,a.jsx)("audio",{controls:!0,src:e.src,className:"flex-1 min-w-0"})]}),e.filename&&(0,a.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,a.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:e.filename})})]})]})}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:(0,a.jsx)("span",{children:ea})})]})]})},"".concat(w,"-audio-").concat(t))),en&&(0,a.jsx)("div",{className:"mt-2 ml-12 mr-4",children:(0,a.jsx)(T,{error:s,onDismiss:r||(()=>{})})})]},w)}),(0,a.jsx)("div",{ref:x,className:"h-px"},"end-anchor"),C.isOpen&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"relative max-w-[90vw] max-h-[90vh] bg-background rounded-lg shadow-2xl border border-border",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Tool Result Image"}),(0,a.jsx)("button",{onClick:()=>{S({isOpen:!1,src:"",alt:""})},className:"p-2 hover:bg-muted rounded-md transition-colors","aria-label":"Close modal",children:(0,a.jsx)(u.A,{className:"h-5 w-5"})})]}),(0,a.jsx)("div",{className:"p-4 flex items-center justify-center",children:(0,a.jsx)("img",{src:C.src,alt:C.alt,className:"max-w-full max-h-[70vh] object-contain rounded"})}),(0,a.jsx)("div",{className:"p-4 border-t border-border text-sm text-muted-foreground",children:(0,a.jsx)("p",{children:C.alt})})]})})]})}var W=s(7732);function H(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("relative","w-full","flex flex-col overflow-hidden","max-h-[max(35svh,5rem)]","border-2 border-border/50","bg-background","rounded-3xl shadow-sm","transition-all duration-200",s),children:t})}function Y(e){let{leftButtons:t,rightButtons:s,className:r}=e;return(0,a.jsxs)("div",{className:(0,l.cn)("flex items-center justify-between","h-12 px-2",r),children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:t}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:s})]})}var Z=s(3511),Q=s(2744);let X=n.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(Q.bL,{className:(0,l.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...r,ref:t,children:(0,a.jsx)(Q.zi,{className:(0,l.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});function ee(e){let{isStreaming:t,onStreamingChange:s,className:r}=e;return(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 cursor-pointer ".concat(r||""),children:[(0,a.jsx)(Z.A,{className:"h-3 w-3 ".concat(t?"text-blue-500":"text-muted-foreground")}),(0,a.jsx)(X,{checked:t,onCheckedChange:s,className:"scale-75","aria-label":"Toggle streaming"})]})}),(0,a.jsxs)(j,{side:"bottom",children:[(0,a.jsx)("p",{children:t?"Streaming enabled":"Streaming disabled"}),(0,a.jsx)("p",{className:"text-xs opacity-75",children:t?"Responses will stream in real-time":"Responses will arrive all at once"})]})]})})}X.displayName=Q.bL.displayName;var et=s(7776),es=s(6182);function er(e){let{...t}=e;return(0,a.jsx)(es.bL,{"data-slot":"popover",...t})}function ea(e){let{className:t,align:s="center",sideOffset:r=4,...n}=e;return(0,a.jsx)(es.ZL,{children:(0,a.jsx)(es.UC,{"data-slot":"popover-content",align:s,sideOffset:r,className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}let en=e=>{let{children:t,...s}=e;return(0,a.jsx)(er,{...s,children:t})},ei=function(e){let{...t}=e;return(0,a.jsx)(es.l9,{"data-slot":"popover-trigger",...t})},el=n.forwardRef((e,t)=>{let{className:s,align:r="end",sideOffset:n=4,...i}=e;return(0,a.jsx)(ea,{ref:t,align:r,sideOffset:n,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...i})});el.displayName="DropdownMenuContent";let eo=n.forwardRef((e,t)=>{let{className:s,disabled:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pointer-events-none opacity-50",!r&&"hover:bg-accent hover:text-accent-foreground cursor-pointer",s),...n})});eo.displayName="DropdownMenuItem";let ec=n.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("-mx-1 my-1 h-px bg-muted",s),...r})});function ed(e){let{onImageAttach:t,onPdfAttach:s,onAudioAttach:r,className:i,supports:l}=e,[o,c]=n.useState(!1),d=(null==l?void 0:l.image)!==!1,m=(null==l?void 0:l.pdf)!==!1,u=(null==l?void 0:l.audio)!==!1;return(0,a.jsxs)(en,{open:o,onOpenChange:c,children:[(0,a.jsx)(ei,{asChild:!0,children:(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",className:"h-8 px-3 text-sm text-muted-foreground hover:text-foreground rounded-full ".concat(i||""),"aria-label":"Attach File",children:[(0,a.jsx)(et.A,{className:"h-3 w-3 mr-1.5"}),"Attach"]})}),(0,a.jsxs)(el,{side:"top",align:"start",children:[(0,a.jsx)(eo,{onClick:()=>{d&&(t(),c(!1))},className:d?void 0:"opacity-50 cursor-not-allowed","aria-disabled":!d,children:(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(et.A,{className:"h-4 w-4 mr-2"})," Image"]})}),!d&&(0,a.jsx)(j,{side:"bottom",children:"Unsupported for this model"})]})})}),(0,a.jsx)(eo,{onClick:()=>{m&&(s(),c(!1))},className:m?void 0:"opacity-50 cursor-not-allowed","aria-disabled":!m,children:(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(M.A,{className:"h-4 w-4 mr-2"})," PDF"]})}),!m&&(0,a.jsx)(j,{side:"bottom",children:"Unsupported for this model"})]})})}),(0,a.jsx)(eo,{onClick:()=>{u&&(r(),c(!1))},className:u?void 0:"opacity-50 cursor-not-allowed","aria-disabled":!u,children:(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(z.A,{className:"h-4 w-4 mr-2"})," Audio file"]})}),!u&&(0,a.jsx)(j,{side:"bottom",children:"Unsupported for this model"})]})})})]})]})}ec.displayName="DropdownMenuSeparator";var em=s(3947),eu=s(3827);function ex(e){let{isRecording:t,onToggleRecording:s,className:r,disabled:n}=e,i=(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:()=>{n||s()},className:"h-8 px-3 text-sm rounded-full ".concat(n?"opacity-50 cursor-not-allowed":"text-muted-foreground hover:text-foreground"," ").concat(r||""),"aria-label":t?"Stop recording":"Record audio","aria-disabled":!!n||void 0,children:[t?(0,a.jsx)(em.A,{className:"h-3 w-3 mr-1.5 text-red-500"}):(0,a.jsx)(eu.A,{className:"h-3 w-3 mr-1.5"}),t?"Stop":"Record"]});return n?(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:i}),(0,a.jsx)(j,{side:"bottom",children:"Unsupported for this model"})]})}):i}var eh=s(4569),ep=s(3871),ef=s(531),eg=s(7159),ev=s(5195),ej=s(7397);function eb(e){let{open:t,onOpenChange:s,provider:r,primaryEnvVar:i,onSaved:l}=e,[o,c]=(0,n.useState)(""),[d,m]=(0,n.useState)(!1),[u,x]=(0,n.useState)(null),h=async()=>{if(!o.trim())return void x("API key is required");m(!0),x(null);try{let e=await fetch("/api/llm/key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,apiKey:o})}),t=await e.json();if(!e.ok||"object"!=typeof t||null===t)throw Error("Failed to save API key");if(!t.ok||!t.provider||!t.envVar)throw Error("Unexpected response while saving API key");l({provider:t.provider,envVar:t.envVar}),s(!1),c("")}catch(e){x(e instanceof Error?e.message:"Failed to save API key")}finally{m(!1)}};return(0,a.jsx)(ep.lG,{open:t,onOpenChange:s,children:(0,a.jsxs)(ep.Cf,{className:"max-w-md",children:[(0,a.jsxs)(ep.c7,{children:[(0,a.jsxs)(ep.L3,{children:["Set ",r," API Key"]}),(0,a.jsxs)(ep.rr,{children:["This key will be stored in your .env (env var ",i,"). It is not shared with the client."]})]}),u&&(0,a.jsx)(eg.Fc,{variant:"destructive",children:(0,a.jsx)(eg.TN,{children:u})}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ef.J,{htmlFor:"apiKey",children:"API Key"}),(0,a.jsx)(ej.p,{id:"apiKey",type:"password",value:o,onChange:e=>c(e.target.value),placeholder:"Enter ".concat(r," API key")})]}),(0,a.jsxs)(ep.Es,{children:[(0,a.jsx)(b.$,{variant:"outline",onClick:()=>s(!1),disabled:d,children:"Cancel"}),(0,a.jsx)(b.$,{onClick:h,disabled:d,children:d?"Saving...":"Save"})]})]})})}var ey=s(8352),eN=s(4184),ew=s(2776);function ek(e){let{value:t,onChange:s,placeholder:r="Search providers or models",autoFocus:i=!1}=e,l=(0,n.useRef)(null);return(0,n.useEffect)(()=>{i&&l.current&&setTimeout(()=>{var e;null==(e=l.current)||e.focus()},100)},[i]),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(ew.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)(ej.p,{ref:l,placeholder:r,value:t,onChange:e=>s(e.target.value),className:"focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0"})]})}var eC=s(5980),eS=s(3555),eA=s(9355);let eE={openai:"/logos/openai.svg",anthropic:"/logos/claude-color.svg",google:"/logos/gemini-color.svg",groq:"/logos/groq.svg",xai:"/logos/grok.svg","openai-compatible":"/logos/openai.svg",cohere:"/logos/cohere-color.svg"},eT={openai:"https://platform.openai.com/docs/pricing",anthropic:"https://www.anthropic.com/pricing#api",google:"https://ai.google.dev/gemini-api/docs/pricing",groq:"https://groq.com/pricing/",xai:"https://docs.x.ai/docs/models",cohere:"https://cohere.com/pricing"};function eI(e){if(!e)return[];let t="USD"===(e.currency||"USD")?"$":"",s=[];return s.push("Cost: ".concat(t).concat(e.inputPerM.toFixed(2)," in / ").concat(t).concat(e.outputPerM.toFixed(2)," out per 1M tokens")),null!=e.cacheReadPerM&&s.push("Cache read: ".concat(t).concat(e.cacheReadPerM.toFixed(2)," per 1M tokens")),null!=e.cacheWritePerM&&s.push("Cache write: ".concat(t).concat(e.cacheWritePerM.toFixed(2)," per 1M tokens")),s}let eR=["google","cohere","anthropic"],eD=e=>!eR.includes(e),eL={image:(0,a.jsx)("span",{className:"text-sm",children:"\uD83D\uDDBC️"}),audio:(0,a.jsx)("span",{className:"text-sm",children:"\uD83C\uDFB5"}),pdf:(0,a.jsx)("span",{className:"text-sm",children:"\uD83D\uDCC4"}),reasoning:(0,a.jsx)("span",{className:"text-sm",children:"\uD83E\uDDE0"}),experimental:(0,a.jsx)(eS.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-amber-500 transition-colors cursor-help"}),new:(0,a.jsx)(eA.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-yellow-500 transition-colors cursor-help"}),realtime:(0,a.jsx)(Z.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-blue-500 transition-colors cursor-help"})};var eF=s(6083);function eP(e){let{supportedFileTypes:t,hasApiKey:s,className:r}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0 ".concat(r||""),children:[t.includes("pdf")&&(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)("div",{className:"transition-transform hover:scale-125",children:eL.pdf})}),(0,a.jsx)(j,{side:"top",children:(0,a.jsx)("span",{children:"PDF support"})})]}),t.includes("audio")&&(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)("div",{className:"transition-transform hover:scale-125",children:eL.audio})}),(0,a.jsx)(j,{side:"top",children:(0,a.jsx)("span",{children:"Audio support"})})]}),t.includes("image")&&(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)("div",{className:"transition-transform hover:scale-125",children:eL.image})}),(0,a.jsx)(j,{side:"top",children:(0,a.jsx)("span",{children:"Image support"})})]}),!s&&(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)("div",{className:"transition-transform hover:scale-125",children:(0,a.jsx)(eF.A,{className:"h-3.5 w-3.5 text-amber-500 hover:text-amber-400 transition-colors cursor-help"})})}),(0,a.jsx)(j,{side:"top",children:(0,a.jsx)("span",{children:"API key required"})})]})]})}function eO(e){let{providerId:t,provider:s,models:r,favorites:n,currentModel:i,onToggleFavorite:o,onUse:c}=e;return 0===r.length?null:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:eE[t]?(0,a.jsx)(eh.default,{src:eE[t],alt:"".concat(t," logo"),width:20,height:20,className:(0,l.cn)("object-contain",eD(t)&&"dark:invert dark:brightness-0 dark:contrast-200")}):(0,a.jsx)(ey.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsx)("span",{className:"text-base font-medium",children:s.name})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[s.supportedRouters.map(e=>(0,a.jsx)(eC.E,{variant:"outline",className:"capitalize text-xs",children:e},e)),s.supportsBaseURL&&(0,a.jsx)(eC.E,{variant:"secondary",className:"text-xs",children:"baseURL"}),!s.hasApiKey&&(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(eC.E,{variant:"destructive",className:"text-xs cursor-default",children:"API Key Required"})}),(0,a.jsxs)(j,{children:["Click any ",s.name," model to set up the API key"]})]})}),eT[t]&&(0,a.jsx)("a",{href:eT[t],target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline",title:"View provider pricing",children:"Pricing ↗"})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:r.map(e=>{let r,d,m=e.displayName||e.name,u=(r=e.name,(null==i?void 0:i.provider)===t&&(null==i?void 0:i.model)===r),x=(d=e.name,n.includes("".concat(t,"|").concat(d))),h=s.hasApiKey,p=eI(e.pricing||void 0),b=["Max tokens: ".concat(e.maxInputTokens.toLocaleString()),e.supportedFileTypes.length>0&&"Supports: ".concat(e.supportedFileTypes.join(", ")),e.default&&"Default model",!h&&"⚠️ API key required",...p].filter(Boolean);return(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)("div",{onClick:()=>c(t,e),onKeyDown:s=>{let r=s.target;if(r&&r.closest("button"))return;let a="Enter"===s.key,n=" "===s.key||"Spacebar"===s.key||"Space"===s.code;n&&s.preventDefault(),(a||n)&&c(t,e)},className:(0,l.cn)("group relative flex items-center gap-3 px-3 py-2.5 rounded-lg border transition-all duration-100 cursor-pointer outline-none","hover:bg-accent hover:border-accent-foreground/20 hover:shadow-sm","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",u&&"bg-accent border-accent-foreground/20 shadow-sm ring-1 ring-accent-foreground/10",!h&&"opacity-60"),role:"button",tabIndex:0,children:[(0,a.jsx)("div",{className:"flex-1 text-left",children:(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)("span",{className:"text-sm font-medium",children:m})})}),(0,a.jsx)(eP,{supportedFileTypes:e.supportedFileTypes,hasApiKey:h}),(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)("button",{onKeyDown:e=>{let t=" "===e.key||"Spacebar"===e.key||"Space"===e.code;("Enter"===e.key||t)&&(e.stopPropagation(),t&&e.preventDefault())},onClick:s=>{s.stopPropagation(),o(t,e.name)},className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors","aria-label":x?"Remove from favorites":"Add to favorites",children:(0,a.jsx)(eN.A,{className:(0,l.cn)("h-4 w-4",x&&"fill-current text-yellow-500")})})}),(0,a.jsx)(j,{side:"top",children:(0,a.jsx)("span",{children:x?"Remove from favorites":"Add to favorites"})})]})}),u&&(0,a.jsx)("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-primary rounded-l-lg"})]})}),(0,a.jsx)(j,{side:"bottom",className:"max-w-xs",children:(0,a.jsx)("div",{className:"text-xs space-y-0.5",children:b.map((e,t)=>(0,a.jsx)("div",{children:e},t))})})]})},e.name)})})]})}function ez(e,t){return"".concat(e,"|").concat(t)}let eM="dexto:modelFavorites";function e_(e){let{provider:t,model:s,providerInfo:r,isFavorite:n,isActive:i,onClick:o,onToggleFavorite:c}=e,d=s.displayName||s.name,m=r.hasApiKey,u=eI(s.pricing||void 0),x=["Max tokens: ".concat(s.maxInputTokens.toLocaleString()),s.supportedFileTypes.length>0&&"Supports: ".concat(s.supportedFileTypes.join(", ")),!m&&"⚠️ API key required",...u].filter(Boolean);return(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)("div",{onClick:o,className:(0,l.cn)("w-full flex items-center gap-4 px-4 py-3 rounded-xl transition-all duration-150 cursor-pointer group","hover:bg-accent/50 hover:shadow-md hover:scale-[1.01]",i&&"bg-primary/10 shadow-md ring-2 ring-primary/20 scale-[1.01]",!m&&"opacity-60"),role:"button",tabIndex:0,children:[(0,a.jsx)("div",{className:"w-6 h-6 flex-shrink-0 flex items-center justify-center",children:eE[t]?(0,a.jsx)(eh.default,{src:eE[t],alt:"".concat(t," logo"),width:24,height:24,className:(0,l.cn)("object-contain",eD(t)&&"dark:invert dark:brightness-0 dark:contrast-200")}):(0,a.jsx)(ey.A,{className:"h-5 w-5 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"flex-1 text-left min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-semibold text-foreground truncate",children:d}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:t})]}),(0,a.jsx)(eP,{supportedFileTypes:s.supportedFileTypes,hasApiKey:m}),(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),c()},className:(0,l.cn)("flex-shrink-0 transition-all duration-200","hover:scale-110 active:scale-95",n?"text-yellow-500 hover:text-yellow-400":"text-muted-foreground hover:text-yellow-500"),"aria-label":n?"Remove from favorites":"Add to favorites",children:(0,a.jsx)(eN.A,{className:(0,l.cn)("h-4 w-4",n&&"fill-current")})})}),(0,a.jsx)(j,{side:"top",children:(0,a.jsx)("span",{children:n?"Remove from favorites":"Add to favorites"})})]})})]})}),(0,a.jsx)(j,{side:"right",className:"max-w-xs",children:(0,a.jsx)("div",{className:"text-xs space-y-0.5",children:x.map((e,t)=>(0,a.jsx)("div",{children:e},t))})})]})})}function eU(){var e;let[t,s]=(0,n.useState)(!1),[r,o]=(0,n.useState)(!1),[c,u]=(0,n.useState)(null),[x,h]=(0,n.useState)({}),[p,f]=(0,n.useState)(""),[g,v]=(0,n.useState)(!1),[j,y]=(0,n.useState)(""),[N,w]=(0,n.useState)(""),[k,C]=(0,n.useState)(!1),[S,A]=(0,n.useState)(!1),[E,T]=(0,n.useState)(!1),[I,D]=(0,n.useState)(!1),[L,F]=(0,n.useState)(null),[P,z]=(0,n.useState)(null),{currentSessionId:M,currentLLM:_,refreshCurrentLLM:U}=(0,i.v)();(0,n.useEffect)(()=>{t&&_&&(y(_.router||"vercel"),w(_.baseURL||""))},[t,_]),(0,n.useEffect)(()=>{if(!t)return;let e=!1;return async function(){o(!0),u(null);try{let t=await fetch("/api/llm/catalog");if(!e&&t.ok){let e=await t.json();h(e.providers||{})}}catch(t){e||u("Failed to load catalog")}finally{e||o(!1)}}(),()=>{e=!0}},[t]);let[K,$]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(t)try{let e=localStorage.getItem(eM);$(e?JSON.parse(e):[])}catch(e){$([])}},[t]);let V=(0,n.useCallback)((e,t)=>{let s=ez(e,t);$(e=>{let t=e.includes(s)?e.filter(e=>e!==s):[...e,s];return localStorage.setItem(eM,JSON.stringify(t)),t})},[]);async function q(e,t,r){C(!0),u(null);try{var a,n;let i=function(e,t){var s,r,a;let n=(null==_?void 0:_.router)||"vercel",i=null!=(r=null==(s=x[e])?void 0:s.supportedRouters)?r:["vercel"],l=null!=(a=t.supportedRouters)?a:i,o=j||n;return l.includes(o)?o:l[0]||i[0]||"vercel"}(e,t),l={provider:e,model:t.name,router:i};r&&(null==(a=x[e])?void 0:a.supportsBaseURL)&&(l.baseURL=r),M&&(l.sessionId=M);let o=await fetch("/api/llm/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}),c=await o.json().catch(()=>({}));if(!o.ok){let e=(null==c?void 0:c.issues)&&(null==(n=c.issues[0])?void 0:n.message)||"Failed to switch model";u(e);return}await U(),s(!1)}catch(e){u("Network error while switching")}finally{C(!1)}}function B(e,t){let s=x[e];if(s){if(s.supportsBaseURL&&N){let e=function(e){let t=e.trim();if(!t.length)return{isValid:!0};try{let e=new URL(t);if(!["http:","https:"].includes(e.protocol))return{isValid:!1,error:"URL must use http:// or https://"};if(!e.pathname.includes("/v1"))return{isValid:!1,error:"URL must include /v1 for compatibility"};return{isValid:!0}}catch(e){return{isValid:!1,error:"Invalid URL format"}}}(N);if(!e.isValid)return void u(e.error||"Invalid base URL")}if(!s.hasApiKey){z({provider:e,model:t.name}),F(e),D(!0);return}q(e,t,N)}}let J=Object.keys(x),G=(null==_?void 0:_.displayName)||(null==_?void 0:_.model)||"Choose Model",W=(0,n.useMemo)(()=>K.map(e=>{let[t,s]=e.split("|"),r=x[t],a=null==r?void 0:r.models.find(e=>e.name===s);return r&&a?{providerId:t,provider:r,model:a}:null}).filter(Boolean),[K,x]),H=(0,n.useMemo)(()=>{if(!p)return x;let e={};return J.forEach(t=>{let s=x[t].models.filter(e=>(function(e,t){var s,r,a,n;let i=p.trim().toLowerCase();return!i||t.name.toLowerCase().includes(i)||null!=(a=null==(s=t.displayName)?void 0:s.toLowerCase().includes(i))&&a||e.toLowerCase().includes(i)||null!=(n=null==(r=x[e])?void 0:r.name.toLowerCase().includes(i))&&n})(t,e));s.length>0&&(e[t]={...x[t],models:s})}),e},[x,p,J]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(ep.lG,{open:t,onOpenChange:s,children:[(0,a.jsx)(ep.zM,{asChild:!0,children:(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",className:"hidden lg:flex items-center gap-2 cursor-pointer",title:"Choose model",children:[(null==_?void 0:_.provider)&&eE[_.provider]?(0,a.jsx)(eh.default,{src:eE[_.provider],alt:"".concat(_.provider," logo"),width:16,height:16,className:(0,l.cn)("object-contain",eD(_.provider)&&"dark:invert dark:brightness-0 dark:contrast-200")}):(0,a.jsx)(R.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"text-sm",children:G}),(0,a.jsx)(m.A,{className:"h-3 w-3"})]})}),(0,a.jsxs)(ep.Cf,{className:"max-w-4xl max-h-[85vh] flex flex-col",children:[(0,a.jsxs)(ep.c7,{className:"pb-4 flex-shrink-0",children:[(0,a.jsx)(ep.L3,{className:"text-xl",children:"Select Model"}),(0,a.jsx)(ep.rr,{className:"text-sm text-muted-foreground",children:"Choose from your favorite models or explore all available options"})]}),(0,a.jsxs)("div",{className:"flex flex-col min-h-0 flex-1 space-y-6",children:[(0,a.jsxs)("div",{className:"flex-shrink-0 space-y-4",children:[c&&(0,a.jsx)(eg.Fc,{variant:"destructive",children:(0,a.jsx)(eg.TN,{children:c})}),(0,a.jsx)(ek,{value:p,onChange:f,placeholder:"Search models, providers..."})]}),W.length>0&&!p&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:()=>T(!E),className:"flex items-center justify-between w-full p-0 h-auto hover:bg-transparent",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(eN.A,{className:"h-4 w-4 text-yellow-500 fill-current"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:"Favorites"}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",W.length,")"]})]}),E?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(d.A,{className:"h-4 w-4"})]}),!E&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"max-h-[280px] overflow-y-auto px-1 py-1 space-y-1",children:W.map(e=>{let t,{providerId:s,provider:r,model:n}=e;return(0,a.jsx)(e_,{provider:s,model:n,providerInfo:r,isFavorite:!0,isActive:(t=n.name,(null==_?void 0:_.provider)===s&&(null==_?void 0:_.model)===t),onClick:()=>B(s,n),onToggleFavorite:()=>V(s,n.name)},ez(s,n.name))})}),W.length>6&&(0,a.jsxs)("div",{className:"text-xs text-muted-foreground text-center",children:["Scroll to see all ",W.length," favorites"]})]})]}),!p&&(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:()=>A(!S),className:"w-full justify-center gap-2",children:S?(0,a.jsxs)(a.Fragment,{children:["Hide All Models ",(0,a.jsx)(d.A,{className:"h-4 w-4"})]}):(0,a.jsxs)(a.Fragment,{children:["Show All Models ",(0,a.jsx)(m.A,{className:"h-4 w-4"})]})}),(S||p)&&(0,a.jsx)("div",{className:"flex-1 overflow-auto px-1 min-h-0",children:(0,a.jsx)("div",{className:"space-y-6 pb-2",children:r?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(O.A,{className:"h-4 w-4 animate-spin"})," Loading models..."]}):0===Object.keys(H).length?(0,a.jsx)("div",{className:"text-sm text-muted-foreground text-center py-8",children:p?"No models found matching your search":"No providers available"}):Object.entries(H).map(e=>{let[t,s]=e;return(0,a.jsx)(eO,{providerId:t,provider:s,models:s.models,favorites:K,currentModel:_||void 0,onToggleFavorite:V,onUse:B},t)})})})]}),(0,a.jsxs)("div",{className:"flex-shrink-0 space-y-3 border-t pt-4 mt-4",children:[(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:()=>v(!g),className:"flex items-center justify-between w-full p-0 h-auto hover:bg-transparent",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Advanced Options"}),g?(0,a.jsx)(d.A,{className:"h-4 w-4"}):(0,a.jsx)(m.A,{className:"h-4 w-4"})]}),g&&(0,a.jsxs)("div",{className:"space-y-4 pl-4 border-l-2 border-muted",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ef.J,{className:"text-sm font-medium",children:"Router"}),(0,a.jsxs)(ev.l6,{value:j,onValueChange:e=>y(e),children:[(0,a.jsx)(ev.bq,{children:(0,a.jsx)(ev.yv,{placeholder:"Select router"})}),(0,a.jsx)(ev.gC,{children:Array.from(new Set(J.flatMap(e=>x[e].supportedRouters))).map(e=>(0,a.jsx)(ev.eb,{value:e,children:(0,a.jsx)("span",{className:"capitalize",children:e})},e))})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ef.J,{className:"text-sm font-medium",children:"Custom Base URL"}),(0,a.jsx)(ej.p,{value:N,onChange:e=>w(e.target.value),placeholder:"https://api.openai.com/v1",className:"text-sm"}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:"Only used for providers that support baseURL."})]})]})]})]})]}),L&&(0,a.jsx)(eb,{open:I,onOpenChange:D,provider:L,primaryEnvVar:(null==(e=x[L])?void 0:e.primaryEnvVar)||"",onSaved:function(e){if(h(t=>({...t,[e.provider]:t[e.provider]?{...t[e.provider],hasApiKey:!0}:t[e.provider]})),D(!1),P){var t;let{provider:e,model:s}=P,r=null==(t=x[e])?void 0:t.models.find(e=>e.name===s);r&&q(e,r,N),z(null)}}})]})}var eK=s(7079),e$=s(649);function eV(e){let{onSend:t,isSending:s,variant:r="chat"}=e,[o,c]=(0,n.useState)(""),d=(0,n.useRef)(null),[m,x]=(0,n.useState)(null),[h,p]=(0,n.useState)(null),f=(0,n.useRef)(null),g=(0,n.useRef)(null),v=(0,n.useRef)(null),j=function(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if("undefined"==typeof document)return;let e=document;if(!e.fonts||!e.fonts.ready)return void t(!0);let s=!1;return e.fonts.ready.then(()=>{s||t(!0)}),()=>{s=!0}},[]),e}(),[y,N]=(0,n.useState)(!1),k=(0,n.useRef)(null),{currentSessionId:C,isStreaming:S,setStreaming:A,cancel:E,processing:T,currentLLM:I}=(0,i.v)(),[R,D]=(0,n.useState)(null),[L,F]=(0,n.useState)(!1),[P,_]=(0,n.useState)(null),[U,K]=(0,n.useState)(null),[$,V]=(0,n.useState)([]),q=[{name:"Claude 4 Sonnet",provider:"anthropic",model:"claude-sonnet-4-5-20250929"},{name:"GPT-4o",provider:"openai",model:"gpt-4o"},{name:"GPT-4.1 Mini",provider:"openai",model:"gpt-4.1-mini"},{name:"Gemini 2.5 Pro",provider:"google",model:"gemini-2.5-pro"}],B=e=>{K(e),setTimeout(()=>K(null),5e3)};(0,n.useEffect)(()=>{(async()=>{try{let e=await fetch(C?"/api/llm/current?sessionId=".concat(C):"/api/llm/current");if(e.ok){let t=await e.json(),s=q.find(e=>e.model===t.config.model);s?D(s):D({name:"".concat(t.config.provider,"/").concat(t.config.model),provider:t.config.provider,model:t.config.model})}}catch(e){console.error("Failed to fetch current model:",e),D(null)}})()},[C]),(0,n.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/llm/catalog?mode=flat");if(!e.ok)return;let t=(await e.json()).models||[],s=null==I?void 0:I.provider,r=null==I?void 0:I.model;if(!s||!r)return;let a=t.find(e=>e.provider===s&&e.name===r);V((null==a?void 0:a.supportedFileTypes)||[])}catch(e){V([])}})()},[null==I?void 0:I.provider,null==I?void 0:I.model]);let J=()=>{let e=o.trim();(e||m||h)&&(t(e,null!=m?m:void 0,null!=h?h:void 0),c(""),x(null),p(null))},G=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),J())},Z=e=>{let t=e.clipboardData.getData("text/plain");if(t&&!(t.length<=2e4))if(e.preventDefault(),window.confirm("Large text detected. Attach as a file instead of inflating the input?\n(OK = attach as file, Cancel = paste truncated preview)"))p({base64:(e=>{try{return btoa(unescape(encodeURIComponent(e)))}catch(t){return btoa(e)}})(t),mimeType:"text/plain",filename:"pasted.txt"});else{let e=t.slice(0,2e4);c(t=>t+e)}},Q=async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);k.current=t;let s=[];t.ondataavailable=e=>{e.data.size>0&&s.push(e.data)},t.onstop=()=>{let r=new Blob(s,{type:t.mimeType}),a=new FileReader;a.onloadend=()=>{try{let e=a.result,s=e.indexOf(","),r=e.substring(s+1),n=t.mimeType||"audio/webm",i={"audio/mp3":"mp3","audio/mpeg":"mp3","audio/wav":"wav","audio/x-wav":"wav","audio/wave":"wav","audio/webm":"webm","audio/ogg":"ogg","audio/m4a":"m4a","audio/aac":"aac"}[n]||n.split("/")[1]||"webm";p({base64:r,mimeType:n,filename:"recording.".concat(i)})}catch(e){B("Failed to process audio recording. Please try again."),p(null)}},a.readAsDataURL(r),e.getTracks().forEach(e=>e.stop())},t.start(),N(!0)}catch(e){B("Failed to start audio recording. Please check microphone permissions.")}};return(0,n.useEffect)(()=>{o&&P&&_(null),o&&U&&K(null)},[o,P]),o.length,(0,a.jsxs)("div",{id:"input-area",className:"flex flex-col gap-2 w-full",children:[P&&(0,a.jsxs)(eg.Fc,{variant:"destructive",className:"mb-2",children:[(0,a.jsx)(eK.A,{className:"h-4 w-4"}),(0,a.jsxs)(eg.TN,{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:P}),(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:()=>_(null),className:"h-auto p-1 ml-2",children:(0,a.jsx)(u.A,{className:"h-3 w-3"})})]})]}),U&&(0,a.jsxs)(eg.Fc,{variant:"destructive",className:"mb-2",children:[(0,a.jsx)(eK.A,{className:"h-4 w-4"}),(0,a.jsxs)(eg.TN,{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:U}),(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:()=>K(null),className:"h-auto p-1 ml-2",children:(0,a.jsx)(u.A,{className:"h-3 w-3"})})]})]}),(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)("form",{onSubmit:e=>{e.preventDefault(),J()},children:(0,a.jsxs)(H,{children:[(m||h)&&(0,a.jsx)("div",{className:"px-4 pt-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[m&&(0,a.jsxs)("div",{className:"relative w-fit border border-border rounded-lg p-1 bg-muted/50 group",children:[(0,a.jsx)("img",{src:"data:".concat(m.mimeType,";base64,").concat(m.base64),alt:"preview",className:"h-12 w-auto rounded-md"}),(0,a.jsx)(b.$,{variant:"destructive",size:"icon",onClick:()=>x(null),className:"absolute -top-1 -right-1 h-4 w-4 rounded-full bg-destructive text-destructive-foreground opacity-100 group-hover:opacity-100 transition-opacity duration-150 shadow-md","aria-label":"Remove image",children:(0,a.jsx)(u.A,{className:"h-2 w-2"})})]}),h&&(0,a.jsxs)("div",{className:"relative w-fit border border-border rounded-lg p-2 bg-muted/50 flex items-center gap-2 group",children:[h.mimeType.startsWith("audio")?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(z.A,{className:"h-4 w-4"}),(0,a.jsx)("audio",{controls:!0,src:"data:".concat(h.mimeType,";base64,").concat(h.base64),className:"h-8"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"text-xs font-medium max-w-[160px] truncate",children:h.filename||"attachment"})]}),(0,a.jsx)(b.$,{variant:"destructive",size:"icon",onClick:()=>p(null),className:"absolute -top-1 -right-1 h-4 w-4 rounded-full bg-destructive text-destructive-foreground opacity-100 group-hover:opacity-100 transition-opacity duration-150 shadow-md","aria-label":"Remove attachment",children:(0,a.jsx)(u.A,{className:"h-2 w-2"})})]})]})}),(0,a.jsx)("div",{className:"flex-auto overflow-y-auto",children:j?(0,a.jsx)(W.A,{ref:d,value:o,onChange:e=>c(e.target.value),onKeyDown:G,onPaste:Z,placeholder:"Ask Dexto anything...",minRows:1,maxRows:8,className:"w-full px-4 pt-4 pb-1 text-lg leading-7 placeholder:text-lg bg-transparent border-none resize-none outline-none ring-0 ring-offset-0 focus:ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none max-h-full"}):(0,a.jsx)("textarea",{ref:d,rows:1,value:o,onChange:e=>c(e.target.value),onKeyDown:G,onPaste:Z,placeholder:"Ask Dexto anything...",className:"w-full px-4 pt-4 pb-1 text-lg leading-7 placeholder:text-lg bg-transparent border-none resize-none outline-none ring-0 ring-offset-0 focus:ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none"})}),(0,a.jsx)(Y,{leftButtons:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ed,{onImageAttach:()=>{var e;return null==(e=f.current)?void 0:e.click()},onPdfAttach:()=>{var e;return null==(e=g.current)?void 0:e.click()},onAudioAttach:()=>{var e;return null==(e=v.current)?void 0:e.click()},supports:{image:$.length?$.includes("image"):void 0,pdf:$.length?$.includes("pdf"):void 0,audio:$.length?$.includes("audio"):void 0}}),(0,a.jsx)(ex,{isRecording:y,onToggleRecording:y?()=>{var e;null==(e=k.current)||e.stop(),N(!1)}:Q,disabled:!$.includes("audio")})]}),rightButtons:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ee,{isStreaming:S,onStreamingChange:A}),(0,a.jsx)(eU,{}),(0,a.jsx)(b.$,{type:T?"button":"submit",onClick:T?()=>E(C||void 0):void 0,disabled:!T&&(!o.trim()&&!m&&!h||s),className:(0,l.cn)("h-10 w-10 p-0 rounded-full transition-all duration-200",T?"bg-secondary/80 text-secondary-foreground hover:bg-secondary shadow-sm hover:shadow-md border border-border/50":"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm hover:shadow-lg"),"aria-label":T?"Stop":"Send message",title:T?"Stop":"Send",children:T?(0,a.jsx)(w.A,{className:"h-3.5 w-3.5 fill-current"}):s?(0,a.jsx)(O.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(e$.A,{className:"h-4 w-4"})})]})})]})}),(0,a.jsx)("input",{ref:f,type:"file",id:"image-upload",accept:"image/*",className:"hidden",onChange:e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];if(!s)return;if(s.size>0x4000000){B("Image file too large. Maximum size is 64MB."),e.target.value="";return}if(!s.type.startsWith("image/")){B("Please select a valid image file."),e.target.value="";return}let r=new FileReader;r.onloadend=()=>{try{let e=r.result,t=e.indexOf(",");if(-1===t)throw Error("Invalid Data URL format");let a=e.substring(0,t),n=e.substring(t+1),i=a.match(/data:(.*);base64/),l=i?i[1]:s.type;if(!l)throw Error("Could not determine MIME type");x({base64:n,mimeType:l}),K(null)}catch(e){B("Failed to process image file. Please try again."),x(null)}},r.onerror=e=>{B("Failed to read image file. Please try again."),x(null)},r.readAsDataURL(s),e.target.value=""}}),(0,a.jsx)("input",{ref:g,type:"file",id:"pdf-upload",accept:"application/pdf",className:"hidden",onChange:e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];if(!s)return;if(s.size>0x4000000){B("PDF file too large. Maximum size is 64MB."),e.target.value="";return}if("application/pdf"!==s.type){B("Please select a valid PDF file."),e.target.value="";return}let r=new FileReader;r.onloadend=()=>{try{let e=r.result,t=e.indexOf(","),a=e.substring(t+1);p({base64:a,mimeType:"application/pdf",filename:s.name}),K(null)}catch(e){B("Failed to process PDF file. Please try again."),p(null)}},r.onerror=e=>{B("Failed to read PDF file. Please try again."),p(null)},r.readAsDataURL(s),e.target.value=""}}),(0,a.jsx)("input",{ref:v,type:"file",id:"audio-upload",accept:"audio/*",className:"hidden",onChange:e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];if(!s)return;if(s.size>0x4000000){B("Audio file too large. Maximum size is 64MB."),e.target.value="";return}if(!s.type.startsWith("audio/")){B("Please select a valid audio file."),e.target.value="";return}let r=new FileReader;r.onloadend=()=>{try{let e=r.result,t=e.indexOf(","),a=e.substring(t+1);p({base64:a,mimeType:s.type,filename:s.name}),K(null)}catch(e){B("Failed to process audio file. Please try again."),p(null)}},r.onerror=e=>{B("Failed to read audio file. Please try again."),p(null)},r.readAsDataURL(s),e.target.value=""}})]})]})}var eq=s(3504);let eB=JSON.parse('[{"id":"filesystem","name":"Filesystem","description":"Secure file operations with configurable access controls for reading and writing files","category":"productivity","icon":"\uD83D\uDCC1","config":{"type":"stdio","command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","."],"timeout":30000},"tags":["file","directory","filesystem","io"],"isOfficial":true,"isInstalled":false,"author":"Anthropic","homepage":"https://github.com/modelcontextprotocol/servers","matchIds":["filesystem"]},{"id":"meme-mcp","name":"Meme Generator","description":"Create memes using Imgflip templates","category":"creative","icon":"\uD83D\uDDBC️","config":{"type":"stdio","command":"npx","args":["-y","meme-mcp"],"env":{"IMGFLIP_USERNAME":"","IMGFLIP_PASSWORD":""},"timeout":30000},"tags":["meme","image","creative"],"isOfficial":false,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"Community","homepage":"https://www.npmjs.com/package/meme-mcp","matchIds":["meme-mcp"]},{"id":"product-name-scout","name":"Product Name Scout","description":"SERP analysis, autocomplete, dev collisions, and scoring for product names","category":"research","icon":"\uD83D\uDD0E","config":{"type":"stdio","command":"npx","args":["-y","@truffle-ai/product-name-scout-mcp"],"timeout":30000},"tags":["research","naming","brand"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"Truffle AI","homepage":"https://github.com/truffle-ai/mcp-servers","matchIds":["product-name-scout"]},{"id":"duckduckgo","name":"DuckDuckGo Search","description":"Search the web using DuckDuckGo","category":"research","icon":"\uD83E\uDD86","config":{"type":"stdio","command":"uvx","args":["duckduckgo-mcp-server"],"timeout":30000},"tags":["search","web","research"],"isOfficial":false,"isInstalled":false,"requirements":{"platform":"all","python":">=3.10","dependencies":["uv"]},"author":"Community","homepage":"https://github.com/duckduckgo/mcp-server","matchIds":["duckduckgo","ddg"]},{"id":"domain-checker","name":"Domain Checker","description":"Check domain availability across TLDs","category":"research","icon":"\uD83C\uDF10","config":{"type":"stdio","command":"uvx","args":["truffle-ai-domain-checker-mcp"],"timeout":30000},"tags":["domains","availability","research"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","python":">=3.10"},"author":"Truffle AI","homepage":"https://github.com/truffle-ai/mcp-servers","matchIds":["domain-checker"]},{"id":"linear","name":"Linear","description":"Manage Linear issues, projects, and workflows","category":"productivity","icon":"\uD83D\uDCCB","config":{"type":"stdio","command":"npx","args":["-y","mcp-remote","https://mcp.linear.app/sse"],"timeout":30000},"tags":["linear","tasks","projects"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"Linear","homepage":"https://mcp.linear.app","matchIds":["linear"]},{"id":"image-editor","name":"Image Editor","description":"Comprehensive image processing and manipulation tools","category":"creative","icon":"\uD83D\uDD8C️","config":{"type":"stdio","command":"uvx","args":["truffle-ai-image-editor-mcp"],"timeout":30000},"tags":["image","edit","opencv","pillow"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","python":">=3.10"},"author":"Truffle AI","homepage":"https://github.com/truffle-ai/mcp-servers","matchIds":["image_editor","image-editor"]},{"id":"music-creator","name":"Music Creator","description":"Create, analyze, and transform music and audio","category":"creative","icon":"\uD83C\uDFB5","config":{"type":"stdio","command":"uvx","args":["truffle-ai-music-creator-mcp"],"timeout":30000},"tags":["audio","music","effects"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","python":">=3.10"},"author":"Truffle AI","homepage":"https://github.com/truffle-ai/mcp-servers","matchIds":["music_creator","music-creator"]},{"id":"elevenlabs","name":"ElevenLabs","description":"Text-to-speech and voice synthesis using ElevenLabs API","category":"creative","icon":"\uD83C\uDFA4","config":{"type":"stdio","command":"uvx","args":["elevenlabs-mcp"],"env":{"ELEVENLABS_API_KEY":""},"timeout":30000},"tags":["tts","voice","audio","synthesis"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","python":">=3.10"},"author":"ElevenLabs","homepage":"https://github.com/elevenlabs/elevenlabs-mcp","matchIds":["elevenlabs"]},{"id":"hf","name":"Hugging Face","description":"Access Hugging Face models and datasets","category":"development","icon":"\uD83E\uDD17","config":{"type":"stdio","command":"npx","args":["-y","@llmindset/mcp-hfspace"],"timeout":30000},"tags":["huggingface","models","ai","ml"],"isOfficial":false,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"LLMindset","homepage":"https://github.com/llmindset/mcp-hfspace","matchIds":["hf","huggingface"]},{"id":"tavily","name":"Tavily Search","description":"Web search and research using Tavily AI search engine","category":"research","icon":"\uD83D\uDD0D","config":{"type":"stdio","command":"npx","args":["-y","tavily-mcp@0.1.3"],"env":{"TAVILY_API_KEY":""},"timeout":30000},"tags":["search","web","research","ai"],"isOfficial":false,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"Tavily AI","homepage":"https://www.npmjs.com/package/tavily-mcp","matchIds":["tavily"]},{"id":"puppeteer","name":"Puppeteer","description":"Browser automation and web interaction tools","category":"productivity","icon":"\uD83C\uDF10","config":{"type":"stdio","command":"npx","args":["-y","@truffle-ai/puppeteer-server"],"timeout":30000},"tags":["browser","automation","web","puppeteer"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"Truffle AI","homepage":"https://github.com/truffle-ai/mcp-servers","matchIds":["puppeteer"]},{"id":"gemini-tts","name":"Gemini TTS","description":"Google Gemini Text-to-Speech with 30 prebuilt voices and multi-speaker conversation support","category":"creative","icon":"\uD83C\uDF99️","config":{"type":"stdio","command":"npx","args":["-y","@truffle-ai/gemini-tts-server"],"env":{"GEMINI_API_KEY":""},"timeout":60000},"tags":["tts","speech","voice","audio","gemini","multi-speaker"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"Truffle AI","homepage":"https://github.com/truffle-ai/mcp-servers","matchIds":["gemini-tts","gemini_tts"]},{"id":"nano-banana","name":"Nano Banana","description":"Google Gemini 2.5 Flash Image for advanced image generation, editing, and manipulation","category":"creative","icon":"\uD83C\uDF4C","config":{"type":"stdio","command":"npx","args":["-y","@truffle-ai/nano-banana-server@0.1.2"],"env":{"GEMINI_API_KEY":""},"timeout":60000},"tags":["image","generation","editing","ai","gemini","nano-banana"],"isOfficial":true,"isInstalled":false,"requirements":{"platform":"all","node":">=18.0.0"},"author":"Truffle AI","homepage":"https://github.com/truffle-ai/mcp-servers","matchIds":["nano-banana","nano_banana"]}]');class eJ{static normalizeId(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}static getInstance(){return eJ.instance||(eJ.instance=new eJ),eJ.instance}async initialize(){this.isInitialized||(this.registryEntries=this.getBuiltinEntries(),this.isInitialized=!0)}async getEntries(e){var t;await this.initialize();let s=[...this.registryEntries];if((null==e?void 0:e.category)&&(s=s.filter(t=>t.category===e.category)),(null==e||null==(t=e.tags)?void 0:t.length)&&(s=s.filter(t=>e.tags.some(e=>t.tags.includes(e)))),null==e?void 0:e.search){let t=e.search.toLowerCase();s=s.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t)))}return(null==e?void 0:e.installed)!==void 0&&(s=s.filter(t=>t.isInstalled===e.installed)),(null==e?void 0:e.official)!==void 0&&(s=s.filter(t=>t.isOfficial===e.official)),s.sort((e,t)=>e.isInstalled!==t.isInstalled?e.isInstalled?-1:1:e.isOfficial!==t.isOfficial?e.isOfficial?-1:1:e.name.localeCompare(t.name))}async updateEntry(e,t){let s=this.registryEntries.findIndex(t=>t.id===e);return -1!==s&&(this.registryEntries[s]={...this.registryEntries[s],...t},!0)}async setInstalled(e,t){return this.updateEntry(e,{isInstalled:t})}async syncWithServerStatus(){try{if(await this.initialize(),0===this.registryEntries.length)return void console.warn("Registry entries not available for status sync");let e=new AbortController,t=setTimeout(()=>e.abort(),1e4),s=await fetch("/api/mcp/servers",{signal:e.signal});if(clearTimeout(t),!s.ok)return;let r=(await s.json()).servers||[],a=new Set;for(let e of(r.forEach(e=>{if(!(null==e?void 0:e.id)||"string"!=typeof e.id)return;let t=eJ.normalizeId(e.id);a.add(t)}),this.registryEntries)){let t=[e.id,e.name,...e.matchIds||[]].filter(Boolean).map(e=>eJ.normalizeId(String(e))).some(e=>a.has(e));e.isInstalled!==t&&(e.isInstalled=t)}}catch(e){console.warn("Failed to sync registry with server status:",e)}}async getServerConfig(e){return await this.initialize(),this.registryEntries.find(t=>t.id===e)||null}getBuiltinEntries(){return eB}constructor(){this.registryEntries=[],this.isInitialized=!1}}let eG=eJ.getInstance();function eW(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,l.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...s})}function eH(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,l.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...s})}function eY(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,l.cn)("leading-none font-semibold",t),...s})}function eZ(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,l.cn)("px-6",t),...s})}var eQ=s(7091),eX=s(1756),e0=s(8177),e1=s(976),e2=s(5582),e5=s(4580),e4=s(5160);function e3(e){let{isOpen:t,onClose:s,onInstallServer:r}=e,[i,o]=(0,n.useState)([]),[c,u]=(0,n.useState)([]),[x,h]=(0,n.useState)(!1),[p,f]=(0,n.useState)(null),[g,v]=(0,n.useState)(null),[j,y]=(0,n.useState)({}),[N,w]=(0,n.useState)(""),[k,C]=(0,n.useState)("list"),[S,A]=(0,n.useState)(null),E=(0,n.useRef)(null),T=(0,n.useRef)(!0),I=(0,n.useRef)(null);(0,n.useEffect)(()=>(T.current=!0,()=>{T.current=!1,E.current&&clearTimeout(E.current),I.current&&I.current.abort()}),[]),(0,n.useEffect)(()=>{t&&(async()=>{I.current&&I.current.abort();let e=new AbortController;if(I.current=e,T.current){h(!0),f(null);try{await eG.syncWithServerStatus();let t=await eG.getEntries();T.current&&!e.signal.aborted&&(o(t),u(t))}catch(t){T.current&&!e.signal.aborted&&f(t instanceof Error?t.message:"Failed to load server registry")}finally{T.current&&!e.signal.aborted&&h(!1)}}})()},[t]);let R=(0,n.useCallback)(async(e,t)=>{if(T.current)try{let s=await eG.getEntries({...e,search:t||void 0});T.current&&u(s)}catch(e){T.current&&f(e instanceof Error?e.message:"Failed to filter entries")}},[]);(0,n.useEffect)(()=>(E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{R(j,N)},300),()=>{E.current&&clearTimeout(E.current)}),[j,N,i,R]);let D=async e=>{if(T.current){v(e.id);try{await r(e),await eG.setInstalled(e.id,!0),T.current&&(o(t=>t.map(t=>t.id===e.id?{...t,isInstalled:!0}:t)),u(t=>t.map(t=>t.id===e.id?{...t,isInstalled:!0}:t)))}catch(e){T.current&&f(e instanceof Error?e.message:"Failed to install server")}finally{T.current&&v(null)}}};return(0,a.jsx)(ep.lG,{open:t,onOpenChange:e=>!e&&s(),children:(0,a.jsxs)(ep.Cf,{className:"!max-w-none w-[90vw] max-h-[85vh] overflow-hidden flex flex-col !sm:max-w-none",children:[(0,a.jsx)(ep.c7,{className:"pb-6 border-b",children:(0,a.jsxs)(ep.L3,{className:"flex items-center gap-3 text-xl font-semibold",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 border border-primary/20",children:(0,a.jsx)(eQ.A,{className:"h-5 w-5 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xl",children:"MCP Server Registry"}),(0,a.jsx)("div",{className:"text-sm font-normal text-muted-foreground mt-1",children:"Discover and add powerful integrations to your AI assistant"})]})]})}),(0,a.jsxs)("div",{className:"flex gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(ew.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10"}),(0,a.jsx)(ej.p,{placeholder:"Search servers, integrations, and capabilities...",value:N,onChange:e=>w(e.target.value),className:"pl-10 h-10 border-border/40 focus:border-primary/50 bg-background shadow-sm"})]}),(0,a.jsxs)("div",{className:"flex bg-muted/80 rounded-lg p-1 border border-border/40",children:[(0,a.jsxs)(b.$,{variant:"list"===k?"secondary":"ghost",size:"sm",onClick:()=>{C("list"),A(null)},className:(0,l.cn)("h-8 px-3 rounded-md transition-all","list"===k?"bg-background shadow-sm":"hover:bg-background/80"),children:[(0,a.jsx)(eX.A,{className:"h-4 w-4 mr-2"}),"List"]}),(0,a.jsxs)(b.$,{variant:"grid"===k?"secondary":"ghost",size:"sm",onClick:()=>{C("grid"),A(null)},className:(0,l.cn)("h-8 px-3 rounded-md transition-all","grid"===k?"bg-background shadow-sm":"hover:bg-background/80"),children:[(0,a.jsx)(e0.A,{className:"h-4 w-4 mr-2"}),"Grid"]})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto -mx-2 px-2",children:[p&&(0,a.jsx)(eg.Fc,{variant:"destructive",className:"mb-6 border-red-200/50 bg-red-50/50",children:(0,a.jsx)(eg.TN,{className:"text-red-800",children:p})}),x?(0,a.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,a.jsx)("div",{className:"h-10 w-10 border-3 border-primary/20 border-t-primary rounded-full animate-spin"}),(0,a.jsx)("div",{className:"text-base text-muted-foreground font-medium",children:"Discovering servers..."}),(0,a.jsx)("div",{className:"text-sm text-muted-foreground/70",children:"Loading registry entries"})]})}):0===c.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[(0,a.jsx)("div",{className:"p-4 rounded-2xl bg-muted/30 border border-border/20 mb-6",children:(0,a.jsx)(eQ.A,{className:"h-12 w-12 text-muted-foreground/60 mx-auto"})}),(0,a.jsx)("div",{className:"text-lg font-medium text-muted-foreground mb-2",children:0===i.length?"No servers available in the registry":"No servers match your search"}),(0,a.jsx)("div",{className:"text-sm text-muted-foreground/70 mb-4",children:0===i.length?"The registry is currently empty or failed to load":"Try adjusting your search terms or browse all categories"}),N&&(0,a.jsxs)(b.$,{variant:"outline",onClick:()=>w(""),className:"border-primary/20 hover:bg-primary/5",children:[(0,a.jsx)(ew.A,{className:"h-4 w-4 mr-2"}),"Clear search"]})]}):(0,a.jsx)("div",{className:(0,l.cn)("grid"===k?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4":"space-y-3"),children:c.map((e,t)=>{let s=S===e.id,r=e.description&&e.description.length>100;return"grid"===k?(0,a.jsx)(eW,{className:(0,l.cn)("group relative overflow-hidden transition-all duration-300 border-border/30 hover:border-primary/30 hover:shadow-lg bg-gradient-to-b from-card/90 to-card/50 backdrop-blur-sm",s&&"ring-2 ring-primary/20 border-primary/50 shadow-xl"),style:{animationDelay:"".concat(Math.min(30*t,300),"ms")},children:(0,a.jsxs)("div",{className:"cursor-pointer",onClick:()=>A(s?null:e.id),children:[(0,a.jsx)(eH,{className:"pb-4",children:(0,a.jsx)("div",{className:"flex items-start justify-between",children:(0,a.jsxs)("div",{className:"flex items-center gap-4 flex-1",children:[(0,a.jsx)("div",{className:"text-3xl p-3 rounded-xl bg-gradient-to-br from-primary/10 to-primary/5 border border-primary/20 group-hover:border-primary/30 transition-all",children:e.icon||"⚡"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)(eY,{className:"text-base font-semibold mb-2 group-hover:text-primary transition-colors leading-tight",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[e.isOfficial&&(0,a.jsxs)(eC.E,{className:"text-xs px-2 py-1 bg-blue-100 text-blue-700 border-blue-200",children:[(0,a.jsx)(eN.A,{className:"h-3 w-3 mr-1"}),"Official"]}),e.isInstalled&&(0,a.jsxs)(eC.E,{className:"text-xs px-2 py-1 bg-green-100 text-green-700 border-green-200",children:[(0,a.jsx)(P.A,{className:"h-3 w-3 mr-1"}),"Connected"]}),e.category&&(0,a.jsx)(eC.E,{variant:"outline",className:(0,l.cn)("text-xs px-2 py-1",(e=>{let t={productivity:"bg-blue-100 text-blue-800",development:"bg-green-100 text-green-800",research:"bg-purple-100 text-purple-800",creative:"bg-pink-100 text-pink-800",data:"bg-orange-100 text-orange-800",communication:"bg-indigo-100 text-indigo-800",custom:"bg-gray-100 text-gray-800"};return t[e]||t.custom})(e.category)),children:e.category})]})]})]})})}),(0,a.jsxs)(eZ,{className:"pt-0",children:[(0,a.jsx)("p",{className:(0,l.cn)("text-sm text-muted-foreground leading-relaxed mb-4 transition-all duration-300",s?"":"line-clamp-2"),children:e.description}),s&&(0,a.jsxs)("div",{className:"space-y-4 pt-4 border-t border-border/20 animate-in slide-in-from-top-1 duration-300",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 text-xs",children:e.author&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"p-1 rounded bg-muted/50",children:(0,a.jsx)(e1.A,{className:"h-3 w-3 text-muted-foreground"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-medium text-foreground",children:"Author"}),(0,a.jsx)("div",{className:"text-muted-foreground",children:e.author})]})]})}),e.tags&&e.tags.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-medium text-foreground mb-2",children:"Tags"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,8).map(e=>(0,a.jsx)(eC.E,{variant:"outline",className:"text-xs px-2 py-0.5 text-muted-foreground border-border/40 bg-background/50",children:e},e)),e.tags.length>8&&(0,a.jsxs)(eC.E,{variant:"outline",className:"text-xs px-2 py-0.5 text-muted-foreground border-border/40 bg-background/50",children:["+",e.tags.length-8]})]})]}),e.homepage&&(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsxs)("a",{href:e.homepage,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:text-primary/80 transition-colors font-medium",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(e2.A,{className:"h-4 w-4"}),"View Documentation"]})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4",children:[r&&(0,a.jsx)(b.$,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-primary p-0 h-auto",children:s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{className:"h-3 w-3 mr-1"}),"Show less"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.A,{className:"h-3 w-3 mr-1"}),"Show more"]})}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsx)(b.$,{onClick:t=>{t.stopPropagation(),D(e)},disabled:e.isInstalled||g===e.id,size:"sm",variant:e.isInstalled?"outline":"default",className:(0,l.cn)("min-w-[75px] transition-all font-medium",g===e.id&&"opacity-70",!e.isInstalled&&"bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary shadow-md hover:shadow-lg"),children:g===e.id?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"h-3 w-3 border-2 border-current border-t-transparent rounded-full animate-spin"}),(0,a.jsx)("span",{children:"Connecting"})]}):e.isInstalled?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(P.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"Connected"})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(e5.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"Connect"})]})})})]})]})]})},e.id):(0,a.jsx)(eW,{className:(0,l.cn)("group transition-all duration-200 border-border/30 hover:border-primary/20 hover:shadow-md bg-card/50 hover:bg-card/80 cursor-pointer !py-0 !gap-0",s&&"border-primary/30 shadow-lg bg-card/90",r&&"hover:bg-card/85"),onClick:()=>A(s?null:e.id),children:(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-xl bg-gradient-to-br from-primary/10 via-primary/5 to-transparent border border-primary/15 flex items-center justify-center text-lg font-medium",children:e.icon||"⚡"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("h3",{className:"text-base font-medium text-foreground group-hover:text-primary transition-colors leading-tight",children:e.name}),r&&(0,a.jsx)(m.A,{className:(0,l.cn)("h-4 w-4 text-muted-foreground/60 transition-all duration-200 flex-shrink-0",s&&"rotate-180 text-muted-foreground")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.isOfficial&&(0,a.jsxs)(eC.E,{className:"text-xs font-medium px-2 py-0.5 bg-blue-50 text-blue-600 border-blue-100 hover:bg-blue-100",children:[(0,a.jsx)(eN.A,{className:"h-2.5 w-2.5 mr-1 fill-current"}),"Official"]}),e.isInstalled&&(0,a.jsxs)(eC.E,{className:"text-xs font-medium px-2 py-0.5 bg-green-50 text-green-600 border-green-100",children:[(0,a.jsx)(P.A,{className:"h-2.5 w-2.5 mr-1"}),"Connected"]}),(0,a.jsx)(eC.E,{variant:"outline",className:"text-xs font-medium px-2 py-0.5 bg-background/50 text-muted-foreground border-border/40 capitalize",children:e.category})]})]}),(0,a.jsx)(b.$,{onClick:t=>{t.stopPropagation(),D(e)},disabled:e.isInstalled||g===e.id,size:"sm",variant:e.isInstalled?"outline":"default",className:(0,l.cn)("min-w-[80px] h-8 text-xs font-medium transition-all",g===e.id&&"opacity-70",!e.isInstalled&&"bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary shadow-sm hover:shadow-md"),children:g===e.id?(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("div",{className:"h-3 w-3 border-2 border-current border-t-transparent rounded-full animate-spin"}),(0,a.jsx)("span",{children:"Connecting..."})]}):e.isInstalled?(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(P.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"Connected"})]}):(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(e5.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:"Connect"})]})})]}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:(0,l.cn)("text-sm text-muted-foreground leading-relaxed transition-all duration-300",s?"":"line-clamp-2"),children:e.description})}),s&&(0,a.jsxs)("div",{className:"space-y-4 pt-4 border-t border-border/10 animate-in slide-in-from-top-2 duration-300",children:[e.author&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/20 border border-border/10",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10",children:(0,a.jsx)(e1.A,{className:"h-4 w-4 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Author"}),(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:e.author})]})]}),e.tags&&e.tags.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,a.jsx)(e4.A,{className:"h-4 w-4 text-primary"}),"Tags"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:e.tags.map(e=>(0,a.jsx)(eC.E,{variant:"outline",className:"text-xs px-3 py-1 text-muted-foreground border-border/40 bg-background/60 hover:bg-background/80 transition-colors",children:e},e))})]}),e.homepage&&(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsxs)("a",{href:e.homepage,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:text-primary/80 transition-colors font-medium px-4 py-2 rounded-lg border border-primary/20 hover:border-primary/40 bg-primary/5 hover:bg-primary/10",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(e2.A,{className:"h-4 w-4"}),"View Documentation"]})})]})]})]})})},e.id)})})]})]})})}var e8=s(7620),e6=s(2171),e7=s(5320),e9=s(113),te=s(5618);let tt="/api";function ts(e){return{type:e.config.type,command:e.config.command,args:e.config.args||[],url:e.config.url,env:e.config.env||{},headers:e.config.headers||{},timeout:e.config.timeout||3e4}}function tr(e){let{isOpen:t,onClose:s,onOpenConnectModal:r,onOpenConnectWithPrefill:i,variant:o="overlay",refreshTrigger:d}=e,[x,h]=(0,n.useState)([]),[p,f]=(0,n.useState)(null),[g,v]=(0,n.useState)([]),[j,y]=(0,n.useState)(!1),[N,w]=(0,n.useState)(!1),[k,C]=(0,n.useState)(null),[S,A]=(0,n.useState)(null),[E,T]=(0,n.useState)(!1),[I,R]=(0,n.useState)(null),[D,L]=(0,n.useState)(!1),F=(e,t)=>{console.error("ServersPanel Error (".concat(t,"):"),e),"servers"===t&&C(e),"tools"===t&&A(e)},P=(0,n.useCallback)(async e=>{y(!0),C(null),h([]),f(null),v([]),A(null);try{let t=await fetch("".concat(tt,"/mcp/servers"),e?{signal:e}:{});if(!t.ok){let e=await t.json().catch(()=>({error:"Failed to fetch servers"}));throw Error(e.message||e.error||"Server List: ".concat(t.statusText))}let s=(await t.json()).servers||[];if(h(s),s.length>0){let e=s.find(e=>"connected"===e.status);e?f(e.id):s.length>0&&f(s[0].id)}else console.log("No MCP servers found or returned from API.")}catch(e){"AbortError"!==e.name&&F(e.message,"servers")}finally{(null==e?void 0:e.aborted)||y(!1)}},[]),O=async e=>{if(L(!1),"function"==typeof i){let t=ts(e);i({name:e.name,config:t,lockName:!0,registryEntryId:e.id});return}try{let t=await fetch("/api/connect-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,config:ts(e)})}),s=await t.json();if(!t.ok)throw Error(s.error||"Server returned status ".concat(t.status));await P();try{await eG.syncWithServerStatus()}catch(e){console.warn("Failed to sync registry after server install:",e)}}catch(e){throw Error(e.message||"Failed to install server")}},z=async e=>{let t=x.find(t=>t.id===e);if(t&&window.confirm('Are you sure you want to remove server "'.concat(t.name,'"?'))){R(e),C(null);try{let t=await fetch("".concat(tt,"/mcp/servers/").concat(e),{method:"DELETE"});if(!t.ok){let e=await t.json().catch(()=>({error:"Failed to remove server"}));throw Error(e.message||e.error||"Server Removal: ".concat(t.statusText))}p===e&&(f(null),v([]));try{let t=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),s=t(e),r=(await eG.getEntries()).find(e=>[e.id,e.name,...e.matchIds||[]].filter(Boolean).map(e=>t(String(e))).includes(s));r&&await eG.setInstalled(r.id,!1)}catch(e){console.warn("Failed to update registry installed state on delete:",e)}await P();try{await eG.syncWithServerStatus()}catch(e){console.warn("Failed to sync registry status after server deletion:",e)}}catch(e){F(e.message,"servers")}finally{R(null)}}};(0,n.useEffect)(()=>{if(!t)return;let e=new AbortController;return P(e.signal),R(null),()=>{e.abort()}},[t,P]),(0,n.useEffect)(()=>{if(d&&t){let e=new AbortController;return P(e.signal),()=>{e.abort()}}},[d,t,P]);let M=(0,n.useCallback)(async(e,t)=>{let s=x.find(t=>t.id===e);if(v([]),A(null),!s||"connected"!==s.status)return void console.warn('Server "'.concat((null==s?void 0:s.name)||e,'" is not connected or not found. Cannot fetch tools.'));w(!0);try{let r=await fetch("".concat(tt,"/mcp/servers/").concat(e,"/tools"),t?{signal:t}:{});if(!r.ok){let e=await r.json().catch(()=>({error:"Failed to fetch tools for ".concat(s.name)}));throw Error(e.message||e.error||"Tool List (".concat(s.name,"): ").concat(r.statusText))}let a=await r.json();(null==t?void 0:t.aborted)||v(a.tools||[]),a.tools&&0!==a.tools.length||console.log('No tools found for server "'.concat(s.name,'".'))}catch(e){"AbortError"!==e.name&&F(e.message,"tools")}finally{(null==t?void 0:t.aborted)||w(!1)}},[x]);(0,n.useEffect)(()=>{if(!p)return;let e=new AbortController;return M(p,e.signal),()=>{e.abort()}},[p,M]);let _=x.find(e=>e.id===p);if("overlay"===o&&!t)return null;let U=(0,l.cn)("fixed top-0 right-0 z-40 h-screen w-80 bg-card border-l border-border shadow-xl transition-transform transform flex flex-col",t?"translate-x-0":"translate-x-full"),K=(0,l.cn)("h-full w-full flex flex-col bg-card");return(0,a.jsxs)("aside",{className:"overlay"===o?U:K,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border/50 bg-card/50 backdrop-blur-sm",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Tools & Servers"}),(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:()=>P(),disabled:j,className:"h-8 w-8 p-0",children:(0,a.jsx)(e8.A,{className:(0,l.cn)("h-3.5 w-3.5",j&&"animate-spin")})}),"overlay"===o&&(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:s,className:"h-8 w-8 p-0",children:(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"})})]})]}),(0,a.jsxs)("div",{className:"px-4 py-3 space-y-2 border-b border-border/30",children:[(0,a.jsxs)(b.$,{onClick:r,className:"w-full h-9 text-sm font-medium",size:"sm",children:[(0,a.jsx)(e6.A,{className:"mr-2 h-4 w-4"}),"Connect Server"]}),(0,a.jsxs)(b.$,{onClick:()=>L(!0),variant:"outline",className:"w-full h-9 text-sm font-medium",size:"sm",children:[(0,a.jsx)(e7.A,{className:"mr-2 h-4 w-4"}),"Browse Registry"]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-border/30",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,a.jsxs)("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Connected Servers (",x.length,")"]})}),j&&(0,a.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,a.jsx)(e8.A,{className:"h-5 w-5 animate-spin text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Loading servers..."})]})}),k&&(0,a.jsx)("div",{className:"p-3 rounded-lg bg-destructive/10 border border-destructive/20 mb-3",children:(0,a.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-destructive flex-shrink-0 mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-destructive",children:"Connection Error"}),(0,a.jsx)("p",{className:"text-xs text-destructive/80 mt-1",children:k})]})]})}),!j&&0===x.length&&!k&&(0,a.jsxs)("div",{className:"text-center py-8",children:[(0,a.jsx)(eQ.A,{className:"h-8 w-8 text-muted-foreground/50 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"No servers connected"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Connect or browse the registry"})]}),x.map(e=>(0,a.jsx)("div",{onClick:()=>f(e.id),className:(0,l.cn)("p-3 rounded-lg border cursor-pointer transition-all duration-200 mb-2 last:mb-0",p===e.id?"bg-primary/5 border-primary/20 shadow-sm":"bg-background hover:bg-muted/50 border-border/50 hover:border-border"),children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:(0,l.cn)("w-2 h-2 rounded-full flex-shrink-0","connected"===e.status?"bg-green-500":"error"===e.status?"bg-red-500":"bg-yellow-500")}),(0,a.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1 capitalize",children:e.status})]}),I===e.id?(0,a.jsx)(e8.A,{className:"h-4 w-4 animate-spin text-muted-foreground"}):(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:t=>{t.stopPropagation(),z(e.id)},className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,a.jsx)(e9.A,{className:"h-3.5 w-3.5"})})]})},e.id))]}),_&&(0,a.jsxs)("div",{className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsx)("div",{className:"px-4 py-3 border-b border-border/30",children:(0,a.jsxs)("button",{onClick:()=>T(!E),className:"flex items-center justify-between w-full text-left",children:[(0,a.jsx)("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Available Tools"}),(0,a.jsx)(m.A,{className:(0,l.cn)("h-3.5 w-3.5 transition-transform text-muted-foreground",E&&"rotate-180")})]})}),E&&(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 py-3",children:[N&&(0,a.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,a.jsx)(e8.A,{className:"h-4 w-4 animate-spin text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Loading tools..."})]})}),S&&(0,a.jsx)("div",{className:"p-3 rounded-lg bg-destructive/10 border border-destructive/20 mb-3",children:(0,a.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-destructive flex-shrink-0 mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-destructive",children:"Tools Error"}),(0,a.jsx)("p",{className:"text-xs text-destructive/80 mt-1",children:S})]})]})}),!N&&0===g.length&&!S&&"connected"===_.status&&(0,a.jsxs)("div",{className:"text-center py-6",children:[(0,a.jsx)(te.A,{className:"h-6 w-6 text-muted-foreground/50 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"No tools available"})]}),"connected"!==_.status&&(0,a.jsxs)("div",{className:"text-center py-6",children:[(0,a.jsx)(c.A,{className:"h-6 w-6 text-muted-foreground/50 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Server not connected"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Tools unavailable"})]}),g.map(e=>{var t;return(0,a.jsxs)("div",{className:"p-3 rounded-lg border border-border/50 bg-background hover:bg-muted/30 transition-colors mb-2 last:mb-0",children:[(0,a.jsx)("h4",{className:"text-sm font-medium mb-1",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:e.description}),(null==(t=e.inputSchema)?void 0:t.properties)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[Object.keys(e.inputSchema.properties).slice(0,3).map(e=>(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md bg-muted text-xs font-medium",children:e},e)),Object.keys(e.inputSchema.properties).length>3&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["+",Object.keys(e.inputSchema.properties).length-3," more"]})]})]},e.name)})]})]})]}),(0,a.jsx)(e3,{isOpen:D,onClose:()=>L(!1),onInstallServer:O})]})}let ta=n.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("relative overflow-auto",s),...n,children:r})});ta.displayName="ScrollArea";var tn=s(2848),ti=s(2132),tl=s(3358),to=s(174);let tc=function(e){let{onClick:t,className:s,variant:r="outline",side:n="bottom"}=e;return(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(b.$,{variant:r,size:"sm",onClick:t,className:["h-8 w-8 p-0",s].filter(Boolean).join(" "),"aria-label":"New chat",children:(0,a.jsx)(e5.A,{className:"h-4 w-4"})})}),(0,a.jsx)(j,{side:n,children:"New Chat (⌘K)"})]})})};function td(e){let{isOpen:t,onClose:s,currentSessionId:r,onSessionChange:i,returnToWelcome:o,variant:d="modal",onSearchOpen:m,onNewChat:u}=e,[x,h]=(0,n.useState)([]),[p,y]=(0,n.useState)(!1),[N,w]=(0,n.useState)(null),[k,C]=(0,n.useState)(!1),[S,A]=(0,n.useState)(""),[E,T]=(0,n.useState)(null),[I,R]=(0,n.useState)(!1),[D,L]=(0,n.useState)(null),[F,P]=(0,n.useState)(!1),O=(0,n.useCallback)(async()=>{y(!0),w(null);try{let e=await fetch("/api/sessions");if(!e.ok)throw Error("Failed to fetch sessions");let t=await e.json();h(t.sessions||[])}catch(e){console.error("Error fetching sessions:",e),w(e instanceof Error?e.message:"Failed to fetch sessions")}finally{y(!1)}},[]);(0,n.useEffect)(()=>{t&&O()},[t,O]),(0,n.useEffect)(()=>{let e=()=>{t&&O()},s=()=>{t&&O()};return window.addEventListener("dexto:message",e),window.addEventListener("dexto:response",s),()=>{window.removeEventListener("dexto:message",e),window.removeEventListener("dexto:response",s)}},[t,O]);let z=async()=>{try{let e=await fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:S.trim()||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create session")}let t=await e.json();h(e=>[...e,t.session]),A(""),C(!1),i(t.session.id)}catch(e){console.error("Error creating session:",e),w(e instanceof Error?e.message:"Failed to create session")}},M=async e=>{T(e);try{let t=await fetch("/api/sessions/".concat(e),{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete session")}h(t=>t.filter(t=>t.id!==e)),r===e&&o()}catch(e){console.error("Error deleting session:",e),w(e instanceof Error?e.message:"Failed to delete session")}finally{T(null)}},_=async()=>{if(D){P(!0);try{if(!(await fetch("/api/sessions/".concat(D),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to delete conversation");h(e=>e.filter(e=>e.id!==D)),r===D&&o(),R(!1),L(null)}catch(e){console.error("Error deleting conversation:",e),w(e instanceof Error?e.message:"Failed to delete conversation")}finally{P(!1)}}},U=(0,a.jsxs)("div",{className:"flex flex-col h-full",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-border/50",children:[(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsx)("h2",{className:"text-base font-semibold",children:"Chat History"})}),(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[m&&(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(b.$,{variant:"outline",size:"sm",onClick:m,className:"h-7 w-7 p-0","aria-label":"Search conversations",children:(0,a.jsx)(ew.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(j,{children:"Search conversations (⌘⇧S)"})]})}),u&&(0,a.jsx)(tc,{onClick:u,variant:"outline"})]})]}),N&&(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)(eg.Fc,{variant:"destructive",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)(eg.TN,{children:N})]})}),(0,a.jsx)(ta,{className:"flex-1 p-4",children:(0,a.jsx)("div",{className:"space-y-2",children:p?(0,a.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,a.jsx)(e8.A,{className:"h-6 w-6 animate-spin"})}):0===x.length?(0,a.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,a.jsx)(tn.A,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,a.jsx)("p",{children:"No chat history"}),(0,a.jsx)("p",{className:"text-sm",children:"Start a conversation to see it here"})]}):x.map(e=>(0,a.jsx)("div",{className:(0,l.cn)("group p-3 rounded-lg border border-border/50 bg-card hover:bg-muted/50 transition-all cursor-pointer",r===e.id&&"ring-2 ring-primary bg-primary/5"),onClick:()=>i(e.id),children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm truncate",children:e.id}),r===e.id&&(0,a.jsx)(eC.E,{variant:"secondary",className:"text-xs",children:"Active"})]}),(0,a.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,a.jsx)(ti.A,{className:"h-3 w-3"}),(0,a.jsxs)("span",{children:[e.messageCount," messages"]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,a.jsx)(tl.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:(e=>{if(!e)return"Unknown";let t=new Date(e),s=new Date().getTime()-t.getTime(),r=Math.floor(s/6e4),a=Math.floor(s/36e5),n=Math.floor(s/864e5);return r<1?"Just now":r<60?"".concat(r,"m ago"):a<24?"".concat(a,"h ago"):"".concat(n,"d ago")})(e.lastActivity)})]})]}),e.createdAt&&(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,a.jsx)(to.A,{className:"h-3 w-3"}),(0,a.jsxs)("span",{children:["Created ",(e=>{if(!e)return"Unknown";let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})(e.createdAt)]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[e.messageCount>0&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:t=>{t.stopPropagation(),L(e.id),R(!0)},className:"h-8 w-8 p-0",title:"Delete Conversation",children:(0,a.jsx)(e9.A,{className:"h-4 w-4 text-destructive"})})}),0===e.messageCount&&(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:t=>{t.stopPropagation(),M(e.id)},disabled:E===e.id,className:"h-8 w-8 p-0",title:"Delete Session",children:(0,a.jsx)(e9.A,{className:"h-4 w-4 text-destructive"})})]})]})},e.id))})}),(0,a.jsx)(ep.lG,{open:k,onOpenChange:C,children:(0,a.jsxs)(ep.Cf,{className:"sm:max-w-md",children:[(0,a.jsx)(ep.c7,{children:(0,a.jsx)(ep.L3,{children:"Start New Chat"})}),(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ef.J,{htmlFor:"sessionId",children:"Chat ID"}),(0,a.jsx)(ej.p,{id:"sessionId",value:S,onChange:e=>A(e.target.value),placeholder:"e.g., user-123, project-alpha",className:"font-mono"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave empty to auto-generate a unique ID"})]})}),(0,a.jsxs)(ep.Es,{children:[(0,a.jsx)(b.$,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),(0,a.jsx)(b.$,{onClick:z,children:"Start Chat"})]})]})}),(0,a.jsx)(ep.lG,{open:I,onOpenChange:R,children:(0,a.jsxs)(ep.Cf,{className:"sm:max-w-md",children:[(0,a.jsxs)(ep.c7,{children:[(0,a.jsxs)(ep.L3,{className:"flex items-center space-x-2",children:[(0,a.jsx)(e9.A,{className:"h-5 w-5 text-destructive"}),(0,a.jsx)("span",{children:"Delete Conversation"})]}),(0,a.jsxs)(ep.rr,{children:["This will permanently delete this conversation and all its messages. This action cannot be undone.",D&&(0,a.jsxs)("span",{className:"block mt-2 font-medium",children:["Session: ",(0,a.jsx)("span",{className:"font-mono",children:D})]})]})]}),(0,a.jsxs)(ep.Es,{children:[(0,a.jsx)(b.$,{variant:"outline",onClick:()=>R(!1),children:"Cancel"}),(0,a.jsxs)(b.$,{variant:"destructive",onClick:_,disabled:F,className:"flex items-center space-x-2",children:[(0,a.jsx)(e9.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:F?"Deleting...":"Delete Conversation"})]})]})]})})]});return"inline"===d?(0,a.jsx)("div",{className:"h-full",children:U}):(0,a.jsx)(ep.lG,{open:t,onOpenChange:s,children:(0,a.jsx)(ep.Cf,{className:"sm:max-w-lg h-[600px] flex flex-col p-0",children:U})})}var tm=s(6284);function tu(e){let{websocket:t}=e,[s,r]=(0,n.useState)(null),[l,o]=(0,n.useState)(!1),[d,m]=(0,n.useState)(!1),{currentSessionId:u}=(0,i.v)(),x=n.useRef([]);(0,n.useEffect)(()=>{if(!t)return;let e=e=>{try{let s=JSON.parse(e.data);if("toolConfirmationRequest"===s.event){var t;let e=null==s||null==(t=s.data)?void 0:t.sessionId;if(!e||e!==u)return;let a={...s.data,timestamp:new Date(s.data.timestamp)};console.debug("[WebUI] Received toolConfirmationRequest",a),d?x.current.push(a):(r(a),m(!0),o(!1))}}catch(e){console.error("Error parsing WebSocket message:",e)}};return t.addEventListener("message",e),()=>{t.removeEventListener("message",e)}},[t,d,u]);let h=(0,n.useCallback)(e=>{if(!s||!t)return;let a={type:"toolConfirmationResponse",data:{executionId:s.executionId,approved:e,rememberChoice:l,sessionId:s.sessionId}};if(console.debug("[WebUI] Sending toolConfirmationResponse",a),t.send(JSON.stringify(a)),m(!1),r(null),o(!1),x.current.length>0){let e=x.current.shift();setTimeout(()=>{r(e),m(!0)},0)}},[s,l,t]);return((0,n.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>{h(!1)},12e4);return()=>clearTimeout(e)},[d,h]),s)?(0,a.jsx)(ep.lG,{open:d,onOpenChange:e=>{e||h(!1)},children:(0,a.jsxs)(ep.Cf,{className:"sm:max-w-[800px] max-w-[95vw] max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsx)(ep.c7,{children:(0,a.jsxs)(ep.L3,{className:"flex items-center gap-2",children:[(0,a.jsx)(c.A,{className:"h-5 w-5 text-yellow-500"}),"Tool Execution Confirmation"]})}),(0,a.jsxs)("div",{className:"space-y-4 overflow-y-auto flex-1 min-h-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(D.A,{className:"h-4 w-4 text-blue-500"}),(0,a.jsx)("span",{className:"font-medium",children:"Tool:"}),(0,a.jsx)(eC.E,{variant:"outline",children:s.toolName})]}),s.description&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-medium",children:"Description:"}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium mb-2",children:"Arguments:"}),(0,a.jsx)("div",{className:"bg-background/50 p-3 rounded-md text-xs overflow-auto max-h-80 min-h-16 text-muted-foreground border",children:(0,a.jsx)("pre",{className:"whitespace-pre-wrap break-words font-mono",children:(e=>{if(!e)return"No arguments";try{return JSON.stringify(e,null,2)}catch(t){return String(e)}})(s.args)})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,a.jsx)(tl.A,{className:"h-4 w-4"}),(0,a.jsxs)("span",{children:["Requested at: ",s.timestamp.toLocaleString()]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(tm.S,{id:"remember",checked:l,onCheckedChange:e=>o(!0===e),className:"ml-1"}),(0,a.jsx)("label",{htmlFor:"remember",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Approve future executions of this tool for this session"})]}),(0,a.jsx)("div",{className:"bg-yellow-50 p-3 rounded-md",children:(0,a.jsxs)("p",{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Security Notice:"})," Only approve tools you trust. Tools can access your system and data according to their permissions."]})})]}),(0,a.jsxs)(ep.Es,{className:"gap-2 flex-shrink-0 mt-4 pt-4 border-t",children:[(0,a.jsx)(b.$,{variant:"outline",onClick:()=>h(!1),className:"bg-red-50 hover:bg-red-100 text-red-700 border-red-200",children:"Deny"}),(0,a.jsx)(b.$,{onClick:()=>h(!0),className:"bg-green-600 hover:bg-green-700",children:"Approve"})]})]})}):null}var tx=s(3665),th=s(8989);function tp(e){let{isOpen:t,onClose:s,onNavigateToSession:r}=e,[i,o]=(0,n.useState)(""),[c,d]=(0,n.useState)([]),[m,u]=(0,n.useState)(!1),[x,h]=(0,n.useState)(null),[p,f]=(0,n.useState)(0),g=(0,n.useCallback)(async e=>{if(!e.trim()){d([]),h(null);return}u(!0),h(null);try{let t=new URLSearchParams({q:e,limit:"10",offset:"0"}),s=await fetch("/api/search/messages?".concat(t));if(!s.ok){let e=await s.text();throw Error("Search failed: ".concat(s.status," ").concat(e))}let r=await s.json();d(r.results),f(0)}catch(e){console.error("Search error:",e),d([]),h(e instanceof Error?e.message:"Search failed")}finally{u(!1)}},[]);(0,n.useEffect)(()=>{let e=setTimeout(()=>{g(i)},300);return()=>clearTimeout(e)},[i,g]),(0,n.useEffect)(()=>{t&&(o(""),d([]),h(null),f(0))},[t]),(0,n.useEffect)(()=>{if(!t)return;let e=e=>{if(t&&(!e.ctrlKey&&!e.metaKey||!e.shiftKey||"S"!==e.key))switch(e.key){case"ArrowDown":e.preventDefault(),e.stopPropagation(),f(e=>Math.min(e+1,c.length-1));break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),f(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),e.stopPropagation(),c[p]&&v(c[p]);break;case"Escape":e.preventDefault(),e.stopPropagation(),s()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,c,p,s]);let v=e=>{r(e.sessionId,e.messageIndex),s()};return(0,a.jsx)(ep.lG,{open:t,onOpenChange:e=>!e&&s(),children:(0,a.jsxs)(ep.Cf,{className:"max-w-2xl p-0 top-[20%] transform translate-y-0",children:[(0,a.jsx)(ep.c7,{children:(0,a.jsx)(ep.L3,{className:"sr-only",children:"Search Conversations"})}),(0,a.jsxs)("div",{className:"flex flex-col max-h-[70vh]",children:[(0,a.jsx)("div",{className:"p-6 pb-4",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(ew.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-muted-foreground"}),(0,a.jsx)(ej.p,{placeholder:"Search conversations...",value:i,onChange:e=>o(e.target.value),className:"pl-12 text-lg border-0 shadow-none focus-visible:ring-0 bg-transparent",autoFocus:!0})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden border-t",children:m?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,a.jsx)(e8.A,{className:"h-6 w-6 animate-spin mr-3"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"Searching..."})]}):x?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(ew.A,{className:"w-12 h-12 mx-auto mb-4 text-destructive opacity-50"}),(0,a.jsx)("p",{className:"text-destructive font-medium",children:"Search Error"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:x}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Try again or check your connection."})]})}):(0,a.jsx)(ta,{className:"h-full",children:(0,a.jsx)("div",{className:"p-2",children:c.length>0?(0,a.jsx)("div",{className:"space-y-1",children:c.map((e,t)=>(0,a.jsxs)("div",{className:(0,l.cn)("flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-colors",t===p?"bg-accent text-accent-foreground":"hover:bg-accent/50"),onClick:()=>v(e),children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,a.jsx)(eC.E,{className:(0,l.cn)("text-xs",(e=>{switch(e){case"user":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"assistant":return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case"system":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}})(e.message.role)),children:(e=>{switch(e){case"user":return(0,a.jsx)(I.A,{className:"w-4 h-4"});case"assistant":return(0,a.jsx)(R.A,{className:"w-4 h-4"});case"system":return(0,a.jsx)(tx.A,{className:"w-4 h-4"});default:return(0,a.jsx)(th.A,{className:"w-4 h-4"})}})(e.message.role)})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.sessionId.length>20?"".concat(e.sessionId.slice(0,20),"..."):e.sessionId}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e.message.role})]}),(0,a.jsx)("div",{className:"text-sm text-muted-foreground line-clamp-2",children:((e,t)=>{if(!t)return e;let s=t.replace(/[.*+?^${}()|\[\]\\]/g,"\\$&"),r=RegExp("(".concat(s,")"),"gi");return e.split(r).map((e,t)=>r.test(e)?(0,a.jsx)("mark",{className:"bg-yellow-200 dark:bg-yellow-800 font-medium rounded px-1",children:e},t):e)})(e.context,i)})]}),(0,a.jsx)(F.A,{className:"w-4 h-4 text-muted-foreground flex-shrink-0 mt-1"})]},t))}):i?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)(ew.A,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground opacity-50"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"No messages found matching your search."}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:"Try different keywords."})]}):(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)(ew.A,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground opacity-50"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"Start typing to search your conversations."}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-4 mt-4 text-xs text-muted-foreground",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("kbd",{className:"px-2 py-1 bg-muted rounded text-xs",children:"↑"}),(0,a.jsx)("kbd",{className:"px-2 py-1 bg-muted rounded text-xs",children:"↓"}),(0,a.jsx)("span",{children:"to navigate"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("kbd",{className:"px-2 py-1 bg-muted rounded text-xs",children:"Enter"}),(0,a.jsx)("span",{children:"to select"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("kbd",{className:"px-2 py-1 bg-muted rounded text-xs",children:"Esc"}),(0,a.jsx)("span",{children:"to close"})]})]})]})})})})]})]})})}var tf=s(1740),tg=s(4619),tv=s(9040),tj=s(1601),tb=s(449),ty=s(1241),tN=s.n(ty),tw=s(6529),tk=s(4454);function tC(){let{theme:e,toggleTheme:t}=function(){let[e,t]=(0,n.useState)(()=>"undefined"!=typeof document?document.documentElement.classList.contains("dark")?"dark":"light":"dark");return(0,n.useEffect)(()=>{if("undefined"!=typeof document){document.documentElement.classList.toggle("dark","dark"===e);try{var t;localStorage.setItem("theme",e);let s=(null==(t=window.location)?void 0:t.protocol)==="https:";document.cookie="theme=".concat(encodeURIComponent(e),"; path=/; max-age=31536000; SameSite=Lax").concat(s?"; Secure":"")}catch(e){}}},[e]),{theme:e,toggleTheme:e=>{t(e?"dark":"light")},hasMounted:!0}}(),[s,r]=(0,n.useState)(!1);(0,n.useEffect)(()=>{r(!0)},[]);let i="dark"===e;return s?(0,a.jsx)(f,{children:(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(Q.bL,{checked:i,onCheckedChange:t,className:"w-12 h-6 bg-gray-300 dark:bg-gray-700 rounded-full relative transition-colors flex items-center px-0.5","aria-label":"Toggle theme",children:(0,a.jsx)(Q.zi,{className:"\n w-5 h-5 rounded-full shadow flex items-center justify-center\n transition-transform transform\n translate-x-0.5 data-[state=checked]:translate-x-[1.375rem]\n bg-white dark:bg-gray-100\n ",children:i?(0,a.jsx)(tw.A,{className:"w-3.5 h-3.5 text-gray-700"}):(0,a.jsx)(tk.A,{className:"w-3.5 h-3.5 text-yellow-500"})})})}),(0,a.jsx)(j,{children:i?"Switch to light mode":"Switch to dark mode"})]})}):(0,a.jsx)("div",{className:"w-12 h-6 bg-gray-300 dark:bg-gray-700 rounded-full"})}function tS(e){let{active:t=!1}=e,{voices:s,selected:r,setSelected:i}=function(){let[e,t]=(0,n.useState)(A.getVoices()),[s,r]=(0,n.useState)(A.getPreferredVoiceName());return(0,n.useEffect)(()=>{let e=A.subscribeVoices(()=>{t(A.getVoices()),r(A.getPreferredVoiceName())});return()=>e()},[]),{voices:e,selected:s,setSelected:e=>{A.setPreferredVoice(e),r(A.getPreferredVoiceName())}}}(),[l,o]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{if(!t)return void o(!1);let e=window.requestIdleCallback?window.requestIdleCallback(()=>o(!0)):setTimeout(()=>o(!0),0);return()=>{window.cancelIdleCallback&&"number"==typeof e?window.cancelIdleCallback(e):clearTimeout(e)}},[t]),t)?(0,a.jsxs)(ev.l6,{value:null!=r?r:"auto",onValueChange:e=>{i("auto"===e?null:e)},children:[(0,a.jsx)(ev.bq,{className:"h-8 w-[12rem] text-xs",children:(0,a.jsx)(ev.yv,{placeholder:"Voice"})}),(0,a.jsxs)(ev.gC,{children:[(0,a.jsx)(ev.eb,{value:"auto",children:"Auto (best available)"}),l&&s.map(e=>(0,a.jsxs)(ev.eb,{value:e.name,children:[e.name," (",e.lang,")"]},"".concat(e.name,"-").concat(e.lang)))]})]}):null}function tA(e){let{isOpen:t,onClose:s}=e;return(0,a.jsx)(ep.lG,{open:t,onOpenChange:e=>!e&&s(),children:(0,a.jsxs)(ep.Cf,{className:"sm:max-w-lg",children:[(0,a.jsxs)(ep.c7,{children:[(0,a.jsx)(ep.L3,{children:"Settings"}),(0,a.jsx)(ep.rr,{children:"Configure preferences for speech and more."})]}),(0,a.jsx)("div",{className:"space-y-6 py-2",children:(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)(ef.J,{className:"text-xs uppercase text-muted-foreground",children:"Voice"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Choose a preferred text-to-speech voice. “Auto” selects the best available voice on your device."}),(0,a.jsx)(tS,{active:t})]})})]})})}var tE=s(420);function tT(e){let{mode:t="default"}=e,{returnToWelcome:s}=(0,i.v)(),[r,l]=(0,n.useState)([]),[o,c]=(0,n.useState)([]),[d,u]=(0,n.useState)(null),[h,p]=(0,n.useState)(!1),[f,g]=(0,n.useState)(!1),[v,j]=(0,n.useState)(!1),y=(0,n.useCallback)(async()=>{try{var e,t;let s=await fetch("/api/agents");if(!s.ok)throw Error("Failed to fetch agents");let r=await s.json();l(r.installed||[]),c(r.available||[]),u(null!=(t=null==(e=r.current)?void 0:e.name)?t:null)}catch(e){console.error("AgentSelector load error:",e)}},[]);(0,n.useEffect)(()=>{p(!0),y().finally(()=>p(!1))},[y]);let N=(0,n.useCallback)(async e=>{try{g(!0);let t=await fetch("/api/agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||"Install failed: ".concat(t.status))}await y(),j(!1)}catch(t){console.error("Install agent failed:",t);let e=t instanceof Error?t.message:"Failed to install agent";alert("Failed to install agent: ".concat(e))}finally{g(!1)}},[y]),w=(0,n.useCallback)(async e=>{try{g(!0);let t=await fetch("/api/agents/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||"Switch failed: ".concat(t.status))}u(e),j(!1);try{window.dispatchEvent(new CustomEvent("dexto:agentSwitched",{detail:{name:e}}))}catch(e){}s()}catch(t){console.error("Switch agent failed:",t);let e=t instanceof Error?t.message:"Failed to switch agent";alert("Failed to switch agent: ".concat(e))}finally{g(!1)}},[s]),k=(0,n.useMemo)(()=>d||"Choose Agent",[d]);return(0,a.jsxs)(en,{open:v,onOpenChange:j,children:[(0,a.jsx)(ei,{asChild:!0,children:(0,a.jsxs)(b.$,{variant:"badge"===t?"outline":"default",size:"sm",className:(e=>{let t="transition-all duration-200 shadow-lg hover:shadow-xl font-semibold rounded-full";switch(e){case"badge":return"h-9 px-3 text-xs border border-teal-500 bg-teal-500/20 text-teal-600 hover:bg-teal-500/40 hover:border-teal-500 hover:text-teal-700 dark:text-teal-400 dark:hover:text-teal-300 dark:border-teal-400 dark:hover:border-teal-300 ".concat(t);case"title":return"h-11 px-4 text-lg font-bold bg-gradient-to-r from-teal-500/30 to-teal-500/40 text-teal-600 hover:from-teal-500/50 hover:to-teal-500/60 hover:text-teal-700 focus-visible:ring-2 focus-visible:ring-teal-500/50 focus-visible:ring-offset-2 border border-teal-500/40 dark:text-teal-400 dark:hover:text-teal-300 dark:border-teal-400 ".concat(t);default:return"h-10 px-3 text-sm bg-teal-500/40 text-teal-600 hover:bg-teal-500/50 hover:text-teal-700 focus-visible:ring-2 focus-visible:ring-teal-500/50 focus-visible:ring-offset-2 border border-teal-500/50 dark:text-teal-400 dark:hover:text-teal-300 dark:border-teal-400 ".concat(t)}})(t),disabled:f,children:[(0,a.jsx)(eA.A,{className:"w-4 h-4 mr-2"}),f?"Switching...":"title"===t?"Agent: ".concat(k):k,(0,a.jsx)(m.A,{className:"w-4 h-4 ml-2"})]})}),(0,a.jsxs)(el,{align:"start",className:"w-80 max-h-96 overflow-y-auto",children:[h&&(0,a.jsx)(eo,{disabled:!0,className:"text-center text-muted-foreground",children:"Loading agents..."}),!h&&(0,a.jsxs)(a.Fragment,{children:[r.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Installed"}),r.map(e=>(0,a.jsx)(eo,{onClick:()=>w(e.name),disabled:f||e.name===d,className:"cursor-pointer py-3",children:(0,a.jsx)("div",{className:"flex items-center justify-between w-full",children:(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium text-sm truncate",children:e.name}),e.name===d&&(0,a.jsx)(x.A,{className:"w-4 h-4 text-green-600 flex-shrink-0 animate-in fade-in duration-200"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.author&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground/80 mt-0.5",children:["by ",e.author]})]})})},e.name))]}),r.length>0&&o.length>0&&(0,a.jsx)(ec,{}),o.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Available"}),o.map(e=>(0,a.jsx)(eo,{onClick:()=>N(e.name),disabled:f,className:"cursor-pointer py-3",children:(0,a.jsx)("div",{className:"flex items-center justify-between w-full",children:(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium text-sm truncate",children:e.name}),(0,a.jsx)(tE.A,{className:"w-4 h-4 text-blue-600 flex-shrink-0"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.author&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground/80 mt-0.5",children:["by ",e.author]})]})})},e.name))]}),!h&&0===r.length&&0===o.length&&(0,a.jsx)(eo,{disabled:!0,className:"text-center text-muted-foreground",children:"No agents found"})]})]})]})}function tI(){let[e,t]=(0,n.useState)(!1),{messages:s,sendMessage:r,currentSessionId:o,switchSession:d,isWelcomeState:u,returnToWelcome:h,websocket:p,activeError:f,clearError:y,processing:N,cancel:w,greeting:k}=(0,i.v)(),[C,S]=(0,n.useState)(!1),[A,E]=(0,n.useState)(!1),[T,I]=(0,n.useState)(!1),[R,L]=(0,n.useState)(!1),[F,P]=(0,n.useState)(!1),[O,z]=(0,n.useState)(!1),[M,_]=(0,n.useState)(!1),[U,K]=(0,n.useState)("dexto-config"),[$,V]=(0,n.useState)(null),[q,B]=(0,n.useState)(""),[J,W]=(0,n.useState)(!1),[H,Y]=(0,n.useState)(null),[Z,Q]=(0,n.useState)(!1),[X,ee]=(0,n.useState)(!1),[et,es]=(0,n.useState)(null),[er,ea]=(0,n.useState)(!1),[ed,em]=(0,n.useState)(!1),[eu,ex]=(0,n.useState)(""),eh=n.useRef(null),ev=n.useRef(null),[eb,ey]=(0,n.useState)(!0),[eN,ew]=(0,n.useState)(!1),[ek,eA]=(0,n.useState)(!1),eE=n.useRef(0),[eT,eI]=(0,n.useState)(!1),eR=n.useRef(null),[eD,eL]=(0,n.useState)(0),[eF,eP]=(0,n.useState)(null);(0,n.useEffect)(()=>{"undefined"!=typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)&&t(!0)},[]);let eO=(0,n.useCallback)(()=>{let e=eh.current;e&&ey(e.scrollHeight-e.scrollTop<=e.clientHeight+1)},[]),ez=(0,n.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",t=eh.current;t&&(ew(!0),t.scrollTo({top:t.scrollHeight,behavior:e}),requestAnimationFrame(()=>ew(!1)))},[]);(0,n.useEffect)(()=>{let e=eh.current;if(!e)return;let t=()=>{let t=eE.current,s=e.scrollTop;!eN&&ek&&s<t&&eA(!1),eE.current=s,eO(),e.scrollHeight-e.scrollTop<=e.clientHeight+1?(eI(!1),eR.current&&(window.clearTimeout(eR.current),eR.current=null)):(eI(!1),eR.current&&window.clearTimeout(eR.current),eR.current=window.setTimeout(()=>{eI(!0)},180))};return e.addEventListener("scroll",t),eO(),()=>e.removeEventListener("scroll",t)},[eO,ek,eN,u]),(0,n.useEffect)(()=>{let e=ev.current;if(!e)return;let t=new ResizeObserver(()=>{!eN&&(ek||eb)&&ez("auto")});return t.observe(e),()=>t.disconnect()},[eb,eN,ek,ez,u]),(0,n.useEffect)(()=>{ek&&ez("auto")},[ek,s,ez]);let eM=(0,n.useCallback)(()=>{let e=eh.current;if(!e)return;let t=e.querySelectorAll('[data-role="user"]'),s=t[t.length-1];if(!s)return void ez("auto");let r=e.getBoundingClientRect(),a=Math.max(s.getBoundingClientRect().top-r.top+e.scrollTop-16,0);ew(!0),e.scrollTo({top:a,behavior:"auto"}),requestAnimationFrame(()=>ew(!1))},[ez]);(0,n.useEffect)(()=>{O?fetch(o?"/api/config.yaml?sessionId=".concat(o):"/api/config.yaml").then(e=>{if(!e.ok)throw Error("Failed to fetch configuration");return e.text()}).then(e=>{B(e),V(null)}).catch(e=>{console.error("Preview fetch failed:",e),V(e instanceof Error?e.message:"Preview fetch failed")}):(B(""),V(null),W(!1))},[O,o]);let e_=(0,n.useCallback)(async()=>{try{let e=o?"/api/config.yaml?sessionId=".concat(o):"/api/config.yaml",t=await fetch(e);if(!t.ok)throw Error("Failed to fetch configuration");let s=await t.text(),r=new Blob([s],{type:"application/x-yaml"}),a=URL.createObjectURL(r),n=document.createElement("a");n.href=a,n.download=o?"".concat(U,"-").concat(o,".yml"):"".concat(U,".yml"),document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(a)}catch(e){console.error("Download failed:",e),V(e instanceof Error?e.message:"Download failed")}},[U,o]),eU=(0,n.useCallback)(async()=>{try{await navigator.clipboard.writeText(q),W(!0),setTimeout(()=>W(!1),2e3)}catch(e){console.error("Copy failed:",e),V("Failed to copy to clipboard")}},[q]),eK=(0,n.useCallback)(async(e,t,s)=>{Q(!0),es(null);try{await r(e,t,s),setTimeout(()=>{eM(),eA(!0)},0)}catch(e){console.error("Failed to send message:",e),es(e instanceof Error?e.message:"Failed to send message"),setTimeout(()=>es(null),5e3)}finally{Q(!1)}},[r,eM]);(0,n.useEffect)(()=>{let e=()=>eA(!0),t=()=>eA(!1);return window.addEventListener("dexto:message",e),window.addEventListener("dexto:response",t),()=>{window.removeEventListener("dexto:message",e),window.removeEventListener("dexto:response",t)}},[]);let e$=(0,n.useCallback)(e=>{d(e),L(!1)},[d]),eB=(0,n.useCallback)(async e=>{let t={type:e.config.type,command:e.config.command,args:e.config.args||[],url:e.config.url,env:e.config.env||{},headers:e.config.headers||{},timeout:e.config.timeout||3e4};eP({name:e.name,config:t,lockName:!0,registryEntryId:e.id}),E(!1),S(!0)},[]),eJ=(0,n.useCallback)(async()=>{if(o){em(!0);try{if(!(await fetch("/api/sessions/".concat(o),{method:"DELETE"})).ok)throw Error("Failed to delete conversation");ea(!1),h()}catch(e){console.error("Failed to delete conversation:",e),es(e instanceof Error?e.message:"Failed to delete conversation"),setTimeout(()=>es(null),5e3)}finally{em(!1)}}},[o,h]);(0,n.useCallback)(e=>{e.preventDefault(),eu.trim()&&(eK(eu.trim()),ex(""))},[eu,eK]);let eW=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!e.ok){let t="HTTP ".concat(e.status,": ").concat(e.statusText);try{let s=await e.json();t=s.message||s.error||t}catch(e){}throw Error(t)}let t=await e.json();e$(t.session.id)}catch(e){console.error("Error creating new session:",e),es("Failed to create new session. Please try again."),setTimeout(()=>es(null),5e3)}},[e$]),eH=[{title:"Help me get started",description:"Show me what you can do",action:()=>eK("I'm new to Dexto. Can you show me your capabilities and help me understand how to work with you effectively?"),icon:"\uD83D\uDE80"},{title:"Create Snake Game",description:"Build a game and open it",action:()=>eK("Create a snake game in a new directory with HTML, CSS, and JavaScript, then open it in the browser for me to play."),icon:"\uD83D\uDC0D"},{title:"Connect new tools",description:"Browse and add MCP servers",action:()=>I(!0),icon:"\uD83D\uDD27"},{title:"Demonstrate tools",description:"Show me your capabilities",action:()=>eK("Pick one of your most interesting tools and demonstrate it with a practical example. Show me what it can do."),icon:"⚡"}];return(0,n.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"Backspace"===e.key&&o&&!u&&(e.preventDefault(),s.length>0?ea(!0):eJ()),(e.ctrlKey||e.metaKey)&&!e.shiftKey&&"h"===e.key&&(e.preventDefault(),L(e=>!e)),(e.ctrlKey||e.metaKey)&&!e.shiftKey&&"k"===e.key&&(e.preventDefault(),eW()),(e.ctrlKey||e.metaKey)&&!e.shiftKey&&"j"===e.key&&(e.preventDefault(),I(e=>!e)),(e.ctrlKey||e.metaKey)&&e.shiftKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),P(!0)),(e.ctrlKey||e.metaKey)&&!e.shiftKey&&"l"===e.key&&(e.preventDefault(),window.open("/playground","_blank")),(e.ctrlKey||e.metaKey)&&e.shiftKey&&"e"===e.key&&(e.preventDefault(),z(!0)),(e.ctrlKey||e.metaKey)&&!e.shiftKey&&"/"===e.key&&(e.preventDefault(),ee(!0)),"Escape"===e.key&&(T?I(!1):R?L(!1):A?E(!1):O?z(!1):X?ee(!1):er?ea(!1):et?es(null):N&&w(o||void 0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[T,R,F,A,O,X,er,et,P]),(0,a.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,a.jsx)("div",{className:(0,l.cn)("shrink-0 transition-all duration-300 ease-in-out border-r border-border/50 bg-card/50 backdrop-blur-sm",R?"w-80":"w-0 overflow-hidden"),children:R&&(0,a.jsx)(td,{isOpen:R,onClose:()=>L(!1),currentSessionId:o,onSessionChange:e$,returnToWelcome:h,variant:"inline",onSearchOpen:()=>P(!0),onNewChat:eW})}),(0,a.jsxs)("main",{className:"flex-1 flex flex-col relative",style:{"--thread-max-width":"54rem"},children:[null,(0,a.jsx)("header",{className:"shrink-0 border-b border-border/50 bg-background/95 backdrop-blur-xl shadow-sm",children:(0,a.jsxs)("div",{className:"grid grid-cols-3 items-center px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:()=>L(!R),className:(0,l.cn)("h-8 w-8 p-0 transition-colors",R&&"bg-muted"),children:(0,a.jsx)(tf.A,{className:"h-4 w-4"})})}),(0,a.jsx)(j,{children:"Chat History (⌘H)"})]}),!R&&(0,a.jsx)(tc,{onClick:eW}),(0,a.jsxs)("a",{href:"https://dexto.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center space-x-3 hover:opacity-80 transition-opacity",children:[(0,a.jsx)("img",{src:"/logos/dexto/dexto_logo_light.svg",alt:"Dexto",className:"h-12 w-auto dark:hidden"}),(0,a.jsx)("img",{src:"/logos/dexto/dexto_logo.svg",alt:"Dexto",className:"h-12 w-auto hidden dark:block"}),(0,a.jsx)("span",{className:"sr-only",children:"Dexto"})]}),o&&!u&&(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(eC.E,{variant:"secondary",className:"text-xs bg-muted/50 border-border/30 max-w-[120px] cursor-help",children:(0,a.jsx)("span",{className:"truncate",children:o.length>12?"".concat(o.slice(0,12),"..."):o})})}),(0,a.jsx)(j,{children:(0,a.jsx)("span",{className:"font-mono",children:o})})]})]}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(tT,{mode:"badge"})}),(0,a.jsxs)("div",{className:"flex items-center justify-end space-x-2",children:[(0,a.jsx)(tC,{}),(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(b.$,{variant:"ghost",size:"sm",onClick:()=>_(!0),className:"h-8 w-8 p-0","aria-label":"Open settings",children:(0,a.jsx)(tx.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(j,{children:"Settings"})]}),(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:()=>I(!T),className:(0,l.cn)("h-8 px-2 text-sm transition-colors",T&&"bg-muted"),children:[(0,a.jsx)(D.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"hidden sm:inline ml-1.5",children:"Tools"})]})}),(0,a.jsx)(j,{children:"Toggle tools panel (⌘J)"})]}),(0,a.jsxs)(g,{children:[(0,a.jsx)(v,{asChild:!0,children:(0,a.jsx)(b.$,{variant:"ghost",size:"sm",asChild:!0,className:"h-8 px-2 text-sm",children:(0,a.jsxs)(tN(),{href:"/playground",target:"_blank",rel:"noopener noreferrer",children:[(0,a.jsx)(eS.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"hidden sm:inline ml-1.5",children:"Playground"})]})})}),(0,a.jsx)(j,{children:"Open MCP playground (⌘L)"})]}),(0,a.jsxs)(en,{children:[(0,a.jsx)(ei,{asChild:!0,children:(0,a.jsx)(b.$,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:(0,a.jsx)(tg.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsxs)(el,{align:"end",children:[(0,a.jsxs)(eo,{onClick:()=>E(!0),children:[(0,a.jsx)(eQ.A,{className:"h-4 w-4 mr-2"}),"Browse MCP Registry"]}),(0,a.jsxs)(eo,{onClick:()=>z(!0),children:[(0,a.jsx)(tv.A,{className:"h-4 w-4 mr-2"}),"Export Config"]}),(0,a.jsxs)(eo,{onClick:()=>ee(!0),children:[(0,a.jsx)(tj.A,{className:"h-4 w-4 mr-2"}),"Shortcuts"]}),o&&!u&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ec,{}),(0,a.jsxs)(eo,{onClick:()=>ea(!0),className:"text-destructive focus:text-destructive",children:[(0,a.jsx)(e9.A,{className:"h-4 w-4 mr-2"}),"Delete Conversation"]})]})]})]})]})]})}),(0,a.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[H&&(0,a.jsxs)("div",{className:"fixed bottom-4 right-4 z-50 border border-border/60 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 text-foreground px-3 py-2 rounded-md shadow-md inline-flex items-center gap-2",children:[(0,a.jsx)(x.A,{className:"h-4 w-4 text-green-600"}),(0,a.jsx)("span",{className:"text-sm",children:H})]}),et&&(0,a.jsx)("div",{className:"absolute top-4 right-4 z-50 bg-destructive text-destructive-foreground px-4 py-2 rounded-md shadow-lg",children:et}),(0,a.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:u||0===s.length?(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center p-6 -mt-20",children:(0,a.jsxs)("div",{className:"w-full max-w-[var(--thread-max-width)] mx-auto space-y-6",children:[(0,a.jsxs)("div",{className:"text-center space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,a.jsx)("img",{src:"/logos/dexto/dexto_logo_icon.svg",alt:"Dexto",className:"h-12 w-auto"}),(0,a.jsx)("h2",{className:"text-2xl font-bold font-mono tracking-tight bg-gradient-to-r from-primary to-primary/70 bg-clip-text text-transparent",children:null!=k?k:"Welcome to Dexto"})]}),(0,a.jsx)("p",{className:"text-base text-muted-foreground max-w-xl mx-auto leading-relaxed",children:"Your AI assistant with powerful tools. Ask anything or connect new capabilities."})]}),(0,a.jsx)("div",{className:"flex flex-wrap justify-center gap-2 max-w-[var(--thread-max-width)] mx-auto",children:eH.map((e,t)=>(0,a.jsx)("button",{onClick:e.action,className:"group px-3 py-2 text-left rounded-full bg-primary/5 hover:bg-primary/10 transition-all duration-200 hover:shadow-sm hover:scale-105",children:(0,a.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,a.jsx)("span",{className:"text-sm",children:e.icon}),(0,a.jsx)("span",{className:"font-medium text-sm text-primary group-hover:text-primary/80 transition-colors",children:e.title})]})},t))}),(0,a.jsx)("div",{className:"max-w-[var(--thread-max-width)] mx-auto",children:(0,a.jsx)(eV,{onSend:eK,isSending:Z,variant:"welcome"})}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground space-y-1 text-center",children:(0,a.jsxs)("p",{children:["\uD83D\uDCA1 Try",(0,a.jsx)("kbd",{className:"px-1 py-0.5 bg-muted rounded text-xs ml-1",children:"⌘K"})," for new chat,",(0,a.jsx)("kbd",{className:"px-1 py-0.5 bg-muted rounded text-xs ml-1",children:"⌘J"})," for tools,",(0,a.jsx)("kbd",{className:"px-1 py-0.5 bg-muted rounded text-xs ml-1",children:"⌘L"})," for playground,",(0,a.jsx)("kbd",{className:"px-1 py-0.5 bg-muted rounded text-xs ml-1",children:e?"⌘⌫":"Ctrl+⌫"})," to delete session,",(0,a.jsx)("kbd",{className:"px-1 py-0.5 bg-muted rounded text-xs ml-1",children:"⌘/"})," for shortcuts"]})})]})}):(0,a.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,a.jsx)("div",{ref:eh,className:"h-full overflow-y-auto overscroll-contain relative",children:(0,a.jsxs)("div",{className:"min-h-full grid grid-rows-[1fr_auto]",children:[(0,a.jsx)("div",{className:"w-full max-w-[var(--thread-max-width)] mx-auto",children:(0,a.jsx)(G,{messages:s,activeError:f,onDismissError:y,outerRef:ev})}),(0,a.jsxs)("div",{className:"sticky bottom-0 z-10 px-4 pt-2 pb-[calc(env(safe-area-inset-bottom)+16px)] bg-background relative",children:[eT&&(0,a.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 -top-3 z-20 pointer-events-none",children:(0,a.jsxs)("button",{onClick:()=>{eI(!1),ez("smooth")},className:"pointer-events-auto px-3 py-1.5 rounded-full shadow-sm bg-background/95 border border-border/60 backdrop-blur supports-[backdrop-filter]:bg-background/80 text-sm text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-1.5",children:[(0,a.jsx)("span",{children:"Scroll to bottom"}),(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})]})}),(0,a.jsx)("div",{className:"w-full max-w-[var(--thread-max-width)] mx-auto pointer-events-auto",children:(0,a.jsx)(eV,{onSend:eK,isSending:Z,variant:"chat"})})]})]})})})}),(0,a.jsx)("div",{className:(0,l.cn)("shrink-0 transition-all duration-300 ease-in-out border-l border-border/50 bg-card/50 backdrop-blur-sm",T?"w-80":"w-0 overflow-hidden"),children:T&&(0,a.jsx)(tr,{isOpen:T,onClose:()=>I(!1),onOpenConnectModal:()=>S(!0),onOpenConnectWithPrefill:e=>{eP(e),S(!0)},variant:"inline",refreshTrigger:eD})})]}),(0,a.jsx)(eq.A,{isOpen:C,onClose:()=>{S(!1),eP(null)},onServerConnected:async()=>{if(null==eF?void 0:eF.registryEntryId)try{await eG.setInstalled(eF.registryEntryId,!0)}catch(e){console.warn("Failed to mark registry entry installed:",e)}eL(e=>e+1);let e=(null==eF?void 0:eF.name)||"Server";Y("Added ".concat(e)),setTimeout(()=>Y(null),4e3)},initialName:null==eF?void 0:eF.name,initialConfig:null==eF?void 0:eF.config,lockName:null==eF?void 0:eF.lockName}),(0,a.jsx)(e3,{isOpen:A,onClose:()=>E(!1),onInstallServer:eB}),(0,a.jsx)(ep.lG,{open:O,onOpenChange:z,children:(0,a.jsxs)(ep.Cf,{className:"sm:max-w-2xl",children:[(0,a.jsxs)(ep.c7,{children:[(0,a.jsxs)(ep.L3,{className:"flex items-center space-x-2",children:[(0,a.jsx)(tv.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{children:"Export Configuration"})]}),(0,a.jsxs)(ep.rr,{children:["Download your tool configuration for Claude Desktop or other MCP clients",o&&(0,a.jsxs)("span",{className:"block mt-1 text-sm text-muted-foreground",children:["Including session-specific settings for: ",(0,a.jsx)("span",{className:"font-mono",children:o})]})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ef.J,{htmlFor:"filename",children:"File name"}),(0,a.jsx)(ej.p,{id:"filename",value:U,onChange:e=>K(e.target.value),placeholder:"dexto-config",className:"font-mono"})]}),$&&(0,a.jsxs)(eg.Fc,{variant:"destructive",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)(eg.XL,{children:"Export Error"}),(0,a.jsx)(eg.TN,{children:$})]}),q&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ef.J,{children:"Configuration Preview"}),(0,a.jsx)(tb.T,{value:q,readOnly:!0,className:"h-32 font-mono text-xs bg-muted/30"})]})]}),(0,a.jsxs)(ep.Es,{children:[(0,a.jsx)(b.$,{variant:"outline",onClick:eU,className:"flex items-center space-x-2",children:(0,a.jsx)("span",{children:J?"Copied!":"Copy"})}),(0,a.jsxs)(b.$,{onClick:e_,className:"flex items-center space-x-2",children:[(0,a.jsx)(tv.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:"Download"})]})]})]})}),(0,a.jsx)(tA,{isOpen:M,onClose:()=>_(!1)}),(0,a.jsx)(ep.lG,{open:er,onOpenChange:ea,children:(0,a.jsxs)(ep.Cf,{className:"sm:max-w-md",children:[(0,a.jsxs)(ep.c7,{children:[(0,a.jsxs)(ep.L3,{className:"flex items-center space-x-2",children:[(0,a.jsx)(e9.A,{className:"h-5 w-5 text-destructive"}),(0,a.jsx)("span",{children:"Delete Conversation"})]}),(0,a.jsxs)(ep.rr,{children:["This will permanently delete this conversation and all its messages. This action cannot be undone.",o&&(0,a.jsxs)("span",{className:"block mt-2 font-medium",children:["Session: ",(0,a.jsx)("span",{className:"font-mono",children:o})]})]})]}),(0,a.jsxs)(ep.Es,{children:[(0,a.jsx)(b.$,{variant:"outline",onClick:()=>ea(!1),children:"Cancel"}),(0,a.jsxs)(b.$,{variant:"destructive",onClick:eJ,disabled:ed,className:"flex items-center space-x-2",children:[(0,a.jsx)(e9.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:ed?"Deleting...":"Delete Conversation"})]})]})]})}),(0,a.jsx)(ep.lG,{open:X,onOpenChange:ee,children:(0,a.jsxs)(ep.Cf,{className:"sm:max-w-md",children:[(0,a.jsx)(ep.c7,{children:(0,a.jsxs)(ep.L3,{className:"flex items-center space-x-2",children:[(0,a.jsx)(tj.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{children:"Keyboard Shortcuts"})]})}),(0,a.jsx)("div",{className:"space-y-3",children:[{key:"⌘H",desc:"Toggle chat history panel"},{key:"⌘K",desc:"Create new chat"},{key:"⌘J",desc:"Toggle tools panel"},{key:"⌘⇧S",desc:"Search conversations"},{key:"⌘L",desc:"Open MCP playground"},{key:"⌘⇧E",desc:"Export config"},{key:"⌘/",desc:"Show shortcuts"},{key:e?"⌘⌫":"Ctrl+⌫",desc:"Delete current session"},{key:"Esc",desc:"Close panels"}].map((e,t)=>(0,a.jsxs)("div",{className:"flex justify-between items-center py-1",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:e.desc}),(0,a.jsx)(eC.E,{variant:"outline",className:"font-mono text-xs",children:e.key})]},t))}),(0,a.jsx)(ep.Es,{children:(0,a.jsx)(ep.HM,{asChild:!0,children:(0,a.jsx)(b.$,{variant:"outline",children:"Close"})})})]})})]}),(0,a.jsx)(tp,{isOpen:F,onClose:()=>P(!1),onNavigateToSession:(e,t)=>{d(e),P(!1)}}),(0,a.jsx)(tu,{websocket:p})]})}},9419:(e,t,s)=>{Promise.resolve().then(s.bind(s,6810))}},e=>{e.O(0,[544,179,442,854,760,845,358],()=>e(e.s=9419)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
PvkEd_BO6ZXxX99T_gUvs
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"static/chunks/179-78abc2eacbc41da9.js",
|
|
26
26
|
"static/chunks/442-b1916bec348454b3.js",
|
|
27
27
|
"static/chunks/854-2a6d5a5297a15d52.js",
|
|
28
|
-
"static/chunks/app/page-
|
|
28
|
+
"static/chunks/app/page-5e94d5a49dc718d0.js"
|
|
29
29
|
],
|
|
30
30
|
"/playground/page": [
|
|
31
31
|
"static/chunks/webpack-7c234e7e7e272295.js",
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"ampDevFiles": [],
|
|
7
7
|
"lowPriorityFiles": [
|
|
8
|
-
"static/
|
|
9
|
-
"static/
|
|
8
|
+
"static/PvkEd_BO6ZXxX99T_gUvs/_buildManifest.js",
|
|
9
|
+
"static/PvkEd_BO6ZXxX99T_gUvs/_ssgManifest.js"
|
|
10
10
|
],
|
|
11
11
|
"rootMainFiles": [
|
|
12
12
|
"static/chunks/webpack-7c234e7e7e272295.js",
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"dynamicRoutes": {},
|
|
5
5
|
"notFoundRoutes": [],
|
|
6
6
|
"preview": {
|
|
7
|
-
"previewModeId": "
|
|
8
|
-
"previewModeSigningKey": "
|
|
9
|
-
"previewModeEncryptionKey": "
|
|
7
|
+
"previewModeId": "7f9468c3c39c632e12dfdc442757cbc4",
|
|
8
|
+
"previewModeSigningKey": "fde7209eac970bd0c3057304954b52524aa986e26d9aada8e5d9c00bb7f0154e",
|
|
9
|
+
"previewModeEncryptionKey": "d729ccf0bb304f882bfc4be0e437ea75f08c97c775b1d0ae311650c57b8b0a8d"
|
|
10
10
|
}
|
|
11
11
|
}
|