@townco/gui-template 0.1.20 → 0.1.21
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 +6 -6
- package/dist/assets/icons-B97fCJAR.js +1 -0
- package/dist/assets/index-BYcgnHYe.css +1 -0
- package/dist/assets/index-C98yvCE3.js +10 -0
- package/dist/index.html +3 -3
- package/index.html +5 -0
- package/package.json +7 -8
- package/src/App.tsx +5 -5
- package/src/ChatView.tsx +58 -7
- package/dist/assets/icons-B7gv8oe5.js +0 -1
- package/dist/assets/index-C0mV9pei.js +0 -10
- package/dist/assets/index-xsqqZGAY.css +0 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ A fullscreen chat interface for interacting with the agent, built using the same
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- Clean, fullscreen chat interface
|
|
8
|
-
- Uses core hooks and schemas from `@
|
|
8
|
+
- Uses core hooks and schemas from `@townco/ui/core` (same as TUI)
|
|
9
9
|
- ACP (Agent Client Protocol) SDK integration
|
|
10
10
|
- Configurable agent server URL via environment variables
|
|
11
11
|
- Static build output for production deployment
|
|
@@ -90,15 +90,15 @@ The GUI app uses React Context for state management (simpler than Zustand used b
|
|
|
90
90
|
- Handles message sending and client lifecycle
|
|
91
91
|
- Provides `useChatContext` hook
|
|
92
92
|
|
|
93
|
-
- **`@
|
|
93
|
+
- **`@townco/ui/sdk`** - ACP Client SDK
|
|
94
94
|
- `AcpClient` - Agent communication client
|
|
95
95
|
- Transport abstraction (HTTP, WebSocket, Stdio)
|
|
96
96
|
|
|
97
|
-
- **`@
|
|
97
|
+
- **`@townco/ui/gui`** - React UI components
|
|
98
98
|
- `MessageList` - Message display with markdown rendering
|
|
99
99
|
- Uses core `DisplayMessage` schema with metadata support
|
|
100
100
|
|
|
101
|
-
- **Core Schemas** - Shared types from `@
|
|
101
|
+
- **Core Schemas** - Shared types from `@townco/ui/core`
|
|
102
102
|
- `DisplayMessage` - Same schema as TUI
|
|
103
103
|
- `ConnectionStatus` - Shared connection states
|
|
104
104
|
|
|
@@ -146,8 +146,8 @@ apps/gui/
|
|
|
146
146
|
- **Vite** - Build tool and dev server
|
|
147
147
|
- **TypeScript** - Type safety
|
|
148
148
|
- **Tailwind CSS** - Styling
|
|
149
|
-
- **@
|
|
150
|
-
- **Zod** - Schema validation (via @
|
|
149
|
+
- **@townco/ui** - Shared UI components and SDK
|
|
150
|
+
- **Zod** - Schema validation (via @townco/ui/core)
|
|
151
151
|
|
|
152
152
|
## Current Status
|
|
153
153
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s}from"./react-DWDN8s0r.js";const _=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,c)=>c?c.toUpperCase():a.toLowerCase()),h=o=>{const t=m(o);return t.charAt(0).toUpperCase()+t.slice(1)},i=(...o)=>o.filter((t,a,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===a).join(" ").trim(),w=o=>{for(const t in o)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var g={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const u=s.forwardRef(({color:o="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:r="",children:n,iconNode:l,...d},p)=>s.createElement("svg",{ref:p,...g,width:t,height:t,stroke:o,strokeWidth:c?Number(a)*24/Number(t):a,className:i("lucide",r),...!n&&!w(d)&&{"aria-hidden":"true"},...d},[...l.map(([y,k])=>s.createElement(y,k)),...Array.isArray(n)?n:[n]]));const e=(o,t)=>{const a=s.forwardRef(({className:c,...r},n)=>s.createElement(u,{ref:n,iconNode:t,className:i(`lucide-${_(h(o))}`,`lucide-${o}`,c),...r}));return a.displayName=h(o),a};const v=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],I=e("arrow-down",v);const x=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Z=e("arrow-up",x);const f=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],K=e("check",f);const $=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],O=e("chevron-down",$);const C=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],T=e("chevron-right",C);const M=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],X=e("chevron-up",M);const N=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],G=e("chevrons-up-down",N);const b=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],J=e("circle-check",b);const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Q=e("circle",A);const j=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Y=e("code",j);const q=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],e1=e("database",q);const z=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],t1=e("file-text",z);const L=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],o1=e("link-2",L);const S=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a1=e("loader-circle",S);const V=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],c1=e("mic",V);const D=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],n1=e("panel-right",D);const H=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],s1=e("paperclip",H);const P=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r1=e("settings",P);const U=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],d1=e("sparkles",U);const E=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],h1=e("square-check-big",E);const R=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],i1=e("square-slash",R);const W=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],l1=e("wrench",W);const B=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],p1=e("x",B);export{I as A,T as C,e1 as D,t1 as F,o1 as L,c1 as M,s1 as P,i1 as S,l1 as W,p1 as X,h1 as a,K as b,Q as c,O as d,a1 as e,G as f,X as g,J as h,Z as i,n1 as j,d1 as k,r1 as l,Y as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-zinc-100:oklch(96.7% .001 286.375);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--radius:.5rem;--max-width-prose:477px;--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-primary-hover:var(--primary-hover);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-secondary-hover:var(--secondary-hover);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-accent-hover:var(--accent-hover);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-destructive-hover:var(--destructive-hover);--color-border:var(--border);--color-input:var(--input);--color-input-background:var(--input-background);--color-ring:var(--ring);--color-text-primary:var(--text-primary);--color-text-secondary:var(--text-secondary);--color-text-tertiary:var(--text-tertiary);--max-width-chat:720px;--max-width-prompt-container:393px;--letter-spacing-tight:-.48px;--letter-spacing-uppercase:1.12px;--font-size-heading-3:1.5rem;--line-height-heading-3:1.2;--font-size-subheading:1.25rem;--line-height-subheading:1.5;--font-size-label:.875rem;--line-height-label:1.5}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground)}button{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-16{height:calc(var(--spacing)*16)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[6lh\]{max-height:6lh}.min-h-\[80px\]{min-height:80px}.min-h-\[200px\]{min-height:200px}.min-h-full{min-height:100%}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-10{width:calc(var(--spacing)*10)}.w-64{width:calc(var(--spacing)*64)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[80\%\]{max-width:80%}.max-w-\[90\%\]{max-width:90%}.max-w-\[200px\]{max-width:200px}.max-w-chat{max-width:var(--max-width-chat)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-prompt-container{max-width:var(--max-width-prompt-container)}.max-w-prose{max-width:var(--max-width-prose)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[4px\]{gap:4px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:var(--radius)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[border-bottom-width\:0\.5px\]{border-bottom-width:.5px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-none{--tw-border-style:none;border-style:none}.border-\[primary\]{border-color:primary}.border-border,.border-border\/30{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,var(--color-border)30%,transparent)}}.border-border\/50{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-destructive,.border-destructive\/20{border-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--color-destructive)20%,transparent)}}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--color-input)}.border-transparent{border-color:#0000}.bg-accent-hover{background-color:var(--color-accent-hover)}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive,.bg-destructive\/10{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--color-destructive)10%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-green-500{background-color:var(--color-green-500)}.bg-input-background{background-color:var(--color-input-background)}.bg-muted{background-color:var(--color-muted)}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.from-background{--tw-gradient-from:var(--color-background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-\[2px\]{padding-block:2px}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1\.5{padding-bottom:calc(var(--spacing)*1.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-8{padding-bottom:calc(var(--spacing)*8)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[20px\]{font-size:20px}.leading-\[1\.2\]{--tw-leading:1.2;line-height:1.2}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\[var\(--font-family\)\]{--tw-font-weight:var(--font-family);font-weight:var(--font-family)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.4px\]{--tw-tracking:-.4px;letter-spacing:-.4px}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--font-size\)\]{color:var(--font-size)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-foreground{color:var(--color-foreground)}.text-gray-700{color:var(--color-gray-700)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-muted-foreground,.text-muted-foreground\/60{color:var(--color-muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,var(--color-muted-foreground)60%,transparent)}}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.text-text-tertiary{color:var(--color-text-tertiary)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.accent-\[primary\]{accent-color:primary}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-\[0_4px_16px_0_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--color-muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--color-primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--color-muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--color-primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--color-border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--color-background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--color-foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}@media(hover:hover){.hover\:border-border\/50:hover{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/50:hover{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.hover\:border-border\/80:hover{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/80:hover{border-color:color-mix(in oklab,var(--color-border)80%,transparent)}}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-accent-hover:hover{background-color:var(--color-accent-hover)}.hover\:bg-background:hover{background-color:var(--color-background)}.hover\:bg-card:hover,.hover\:bg-card\/80:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/80:hover{background-color:color-mix(in oklab,var(--color-card)80%,transparent)}}.hover\:bg-card\/90:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/90:hover{background-color:color-mix(in oklab,var(--color-card)90%,transparent)}}.hover\:bg-destructive-hover:hover{background-color:var(--color-destructive-hover)}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\:bg-secondary-hover:hover{background-color:var(--color-secondary-hover)}.hover\:bg-secondary\/80:hover{background-color:var(--color-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:bg-muted:focus{background-color:var(--color-muted)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:text-foreground:focus{color:var(--color-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive:focus-visible{--tw-ring-color:var(--color-destructive)}.focus-visible\:ring-green-500:focus-visible{--tw-ring-color:var(--color-green-500)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--color-background)}.data-\[state\=active\]\:bg-transparent[data-state=active]{background-color:#0000}.data-\[state\=active\]\:bg-zinc-100[data-state=active]{background-color:var(--color-zinc-100)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--color-foreground)}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=active\]\:shadow-none[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=inactive\]\:text-muted-foreground[data-state=inactive]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:bg-muted[data-state=open]{background-color:var(--color-muted)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}@media(min-width:40rem){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:block{display:block}}@media(min-width:64rem){.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:p-0{padding:calc(var(--spacing)*0)}}@media(min-width:80rem){.xl\:block{display:block}}@media(min-width:96rem){.\32xl\:block{display:block}}@media(prefers-color-scheme:dark){.dark\:bg-transparent{background-color:#0000}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.text-heading-3{font-size:var(--font-size-heading-3);line-height:var(--line-height-heading-3);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-subheading{font-size:var(--font-size-subheading);line-height:var(--line-height-subheading);font-weight:400}.text-label{font-size:var(--font-size-label);line-height:var(--line-height-label);letter-spacing:var(--letter-spacing-uppercase);text-transform:uppercase;font-weight:500}}:root{--background:var(--color-white);--foreground:var(--color-neutral-950);--card:var(--color-white);--card-foreground:var(--color-neutral-950);--popover:var(--color-white);--popover-foreground:var(--color-neutral-950);--primary:var(--color-neutral-900);--primary-foreground:var(--color-neutral-50);--primary-hover:var(--color-neutral-700);--secondary:var(--color-neutral-100);--secondary-foreground:var(--color-neutral-900);--secondary-hover:var(--color-neutral-50);--muted:var(--color-neutral-50);--muted-foreground:var(--color-neutral-500);--accent:var(--color-neutral-100);--accent-foreground:var(--color-neutral-900);--accent-hover:var(--color-neutral-50);--destructive:var(--color-red-500);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-600);--border:var(--color-neutral-200);--border-dark:var(--color-neutral-300);--border-focus:var(--color-neutral-400);--border-error:var(--color-red-500);--input:var(--color-neutral-200);--input-background:var(--color-white);--ring:var(--color-neutral-900);--text-primary:var(--color-neutral-900);--text-secondary:var(--color-neutral-600);--text-tertiary:var(--color-neutral-500)}.dark{--background:var(--color-neutral-950);--foreground:var(--color-neutral-50);--card:var(--color-neutral-950);--card-foreground:var(--color-neutral-50);--popover:var(--color-neutral-950);--popover-foreground:var(--color-neutral-50);--primary:var(--color-neutral-50);--primary-foreground:var(--color-neutral-900);--primary-hover:var(--color-neutral-200);--secondary:var(--color-neutral-800);--secondary-foreground:var(--color-neutral-50);--secondary-hover:var(--color-neutral-700);--muted:var(--color-neutral-800);--muted-foreground:var(--color-neutral-400);--accent:var(--color-neutral-800);--accent-foreground:var(--color-neutral-50);--accent-hover:var(--color-neutral-700);--destructive:var(--color-red-900);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-800);--border:var(--color-neutral-800);--border-dark:var(--color-neutral-700);--border-focus:var(--color-neutral-600);--border-error:var(--color-red-500);--input:var(--color-neutral-800);--input-background:var(--color-neutral-950);--ring:var(--color-neutral-300);--text-primary:var(--color-neutral-50);--text-secondary:var(--color-neutral-400);--text-tertiary:var(--color-neutral-500)}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes slideDownAndFade{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideLeftAndFade{0%{opacity:0;transform:translate(2px)}to{opacity:1;transform:translate(0)}}@keyframes slideUpAndFade{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideRightAndFade{0%{opacity:0;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{r as i,j as t,P as ts,e as ss,f as ns,M as os,h as rs,a as as}from"./react-DWDN8s0r.js";import{L as H,M as T,N as I,O as x,P as ke,Q as M,R as E,S as _,T as L,U as is,W as K,X as te,Y as ls,Z as cs,$ as ds,a0 as us,a1 as W,a2 as ps,a3 as ye}from"./vendor-BxtqxsLB.js";import{P as ms,a as fs}from"./acp-sdk-BiGbXeF1.js";import{S as X,L as Ie,T as Ee,C as Re,R as hs,O as Me,P as gs,a as Ue,b as xs,c as Ae,D as De,d as _e,e as Le,f as bs,g as ze,I as Pe,h as Fe,i as Oe,j as He,k as $e,l as Be,m as We,n as Ve,o as ys,p as qe,q as Qe,r as ws,s as Ge,V as vs,t as Ke,u as Xe,v as Ns,w as js,x as Je}from"./radix-C1pEulHa.js";import{C as Ye,S as Cs,P as Ss,M as Ts,A as ks,a as Ze,F as et,D as tt,L as st,X as Is,b as nt,c as ot,d as pe,W as Es,e as rt,f as Rs,g as me,h as Ms,i as Us,j as at,k as we,l as As,m as Ds}from"./icons-B97fCJAR.js";import{r as _s}from"./markdown-DP5OEpQP.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();const ce=typeof process<"u"&&process.versions?.node;let Ls,zs=0;const Ps=new Set;function Fs(s){for(const e of Ps)e(s)}const ve={trace:0,debug:1,info:2,warn:3,error:4,fatal:5};class Os{service;minLevel;logFilePath;logsDir;writeQueue=[];isWriting=!1;constructor(e,n="debug"){this.service=e,this.minLevel=n,typeof process<"u"&&(this.minLevel="info")}setupFileLogging(){}async writeToFile(e){if(!(!this.logFilePath||!ce)&&(this.writeQueue.push(e),!this.isWriting)){for(this.isWriting=!0;this.writeQueue.length>0;){const o=`${this.writeQueue.splice(0,this.writeQueue.length).join(`
|
|
2
|
+
`)}
|
|
3
|
+
`;try{await require("node:fs").promises.appendFile(this.logFilePath,o,"utf-8")}catch{}}this.isWriting=!1}}shouldLog(e){return ve[e]>=ve[this.minLevel]}log(e,n,o){if(!this.shouldLog(e))return;const a={id:`log_${++zs}`,timestamp:new Date().toISOString(),level:e,service:this.service,message:n,...o&&{metadata:o}};if(Fs(a),ce&&this.logFilePath,ce&&this.logFilePath){const l={timestamp:a.timestamp,level:a.level,service:a.service,message:a.message,...a.metadata&&{metadata:a.metadata}};this.writeToFile(JSON.stringify(l)).catch(()=>{})}}trace(e,n){this.log("trace",e,n)}debug(e,n){this.log("debug",e,n)}info(e,n){this.log("info",e,n)}warn(e,n){this.log("warn",e,n)}error(e,n){this.log("error",e,n)}fatal(e,n){this.log("fatal",e,n)}}function $(s,e="debug"){return new Os(s,e)}const it=H(["pending","in_progress","completed","failed"]),Hs=H(["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"]),lt=T({path:x(),line:I().nullable().optional()}),fe=T({inputTokens:I().optional(),outputTokens:I().optional(),totalTokens:I().optional()}),ct=ke("type",[T({type:M("content"),content:T({type:M("text"),text:x()})}),T({type:M("text"),text:x()}),T({type:M("diff"),path:x(),oldText:x(),newText:x(),line:I().nullable().optional()}),T({type:M("terminal"),terminalId:x()})]),dt=T({id:x(),title:x(),kind:Hs,status:it,locations:E(lt).optional(),rawInput:_(x(),L()).optional(),rawOutput:_(x(),L()).optional(),content:E(ct).optional(),error:x().optional(),startedAt:I().optional(),completedAt:I().optional(),tokenUsage:fe.optional()}),$s=T({id:x(),status:it.optional(),locations:E(lt).optional(),rawOutput:_(x(),L()).optional(),content:E(ct).optional(),error:x().optional(),completedAt:I().optional(),tokenUsage:fe.optional()});function Ne(s,e){return{...s,status:e.status??s.status,locations:e.locations??s.locations,rawOutput:e.rawOutput??s.rawOutput,content:e.content?[...s.content??[],...e.content]:s.content,error:e.error??s.error,completedAt:e.completedAt??s.completedAt,tokenUsage:e.tokenUsage??s.tokenUsage}}const V=$("chat-store","debug"),S=is(s=>({connectionStatus:"disconnected",sessionId:null,error:null,messages:[],isStreaming:!1,streamingStartTime:null,toolCalls:{},totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0},currentModel:"claude-sonnet-4-5-20250929",tokenDisplayMode:"context",logs:[],activeTab:"chat",input:{value:"",isSubmitting:!1,attachedFiles:[]},setConnectionStatus:e=>s({connectionStatus:e}),setSessionId:e=>s({sessionId:e}),setError:e=>s({error:e}),addMessage:e=>s(n=>({messages:[...n.messages,e]})),updateMessage:(e,n)=>s(o=>{const a=o.messages.find(r=>r.id===e);let l=o.totalBilled,u=o.currentContext,m=n;if(n.tokenUsage){const r=a?.tokenUsage;V.debug("updateMessage: incoming tokenUsage",{incoming:n.tokenUsage,existing:r});const c={inputTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0),outputTokens:Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0),totalTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0)+Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0)};V.debug("updateMessage: merged tokenUsage",{merged:c}),m={...n,tokenUsage:c};const d=c.inputTokens-(r?.inputTokens??0),h=c.outputTokens-(r?.outputTokens??0),g=c.totalTokens-(r?.totalTokens??0);l={inputTokens:o.totalBilled.inputTokens+d,outputTokens:o.totalBilled.outputTokens+h,totalTokens:o.totalBilled.totalTokens+g},u={inputTokens:c.inputTokens,outputTokens:o.currentContext.outputTokens+h,totalTokens:c.totalTokens}}const p=o.messages.map(r=>r.id===e?{...r,...m}:r);if(n.tokenUsage&&m.tokenUsage){const r=a?.tokenUsage,c=m.tokenUsage,d=(c.inputTokens??0)-(r?.inputTokens??0),h=(c.outputTokens??0)-(r?.outputTokens??0),g=(c.totalTokens??0)-(r?.totalTokens??0),b=p.filter(w=>w.tokenUsage).map(w=>({id:w.id,role:w.role,tokens:w.tokenUsage})),y=p.reduce((w,v)=>({inputTokens:w.inputTokens+(v.tokenUsage?.inputTokens??0),outputTokens:w.outputTokens+(v.tokenUsage?.outputTokens??0),totalTokens:w.totalTokens+(v.tokenUsage?.totalTokens??0)}),{inputTokens:0,outputTokens:0,totalTokens:0}),j=y.inputTokens===l.inputTokens&&y.outputTokens===l.outputTokens&&y.totalTokens===l.totalTokens;V.debug("updateMessage: tokenUsage update",{messageId:e,updates:n.tokenUsage,existing:r,messageMax:c,delta:{inputDelta:d,outputDelta:h,totalDelta:g},totalBilled:l,currentContext:u,actualSum:y,billedCorrect:j?"✅":"❌",messageCount:p.length,messagesWithTokens:b.length,breakdown:b})}return{messages:p,totalBilled:l,currentContext:u}}),clearMessages:()=>s({messages:[]}),setIsStreaming:e=>s({isStreaming:e}),setStreamingStartTime:e=>s({streamingStartTime:e}),addToolCall:(e,n)=>s(o=>({toolCalls:{...o.toolCalls,[e]:[...o.toolCalls[e]||[],n]}})),addToolCallToCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(u=>u.role==="assistant");if(o===-1)return V.warn("No assistant message found to add tool call to"),n;const a=[...n.messages],l=a[o];return l?(a[o]={...l,toolCalls:[...l.toolCalls||[],e]},{messages:a}):n}),updateToolCallInCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(c=>c.role==="assistant");if(o===-1)return V.warn("No assistant message found to update tool call in"),n;const a=[...n.messages],l=a[o];if(!l)return n;const u=l.toolCalls||[],m=u.findIndex(c=>c.id===e.id);if(m===-1)return V.warn(`Tool call ${e.id} not found in message`),n;const p=u[m];if(!p)return n;const r=[...u];return r[m]=Ne(p,e),a[o]={...l,toolCalls:r},{messages:a}}),updateToolCall:(e,n)=>s(o=>{const a=o.toolCalls[e]||[],l=a.findIndex(p=>p.id===n.id);if(l===-1)return o;const u=a[l];if(!u)return o;const m=[...a];return m[l]=Ne(u,n),{toolCalls:{...o.toolCalls,[e]:m}}}),setInputValue:e=>s(n=>({input:{...n.input,value:e}})),setInputSubmitting:e=>s(n=>({input:{...n.input,isSubmitting:e}})),addFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:[...n.input.attachedFiles,e]}})),removeFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:n.input.attachedFiles.filter((o,a)=>a!==e)}})),clearInput:()=>s(e=>({input:{value:"",isSubmitting:!1,attachedFiles:[]}})),addTokenUsage:e=>s(n=>({totalBilled:{inputTokens:n.totalBilled.inputTokens+(e.inputTokens??0),outputTokens:n.totalBilled.outputTokens+(e.outputTokens??0),totalTokens:n.totalBilled.totalTokens+(e.totalTokens??0)},currentContext:{inputTokens:e.inputTokens??n.currentContext.inputTokens,outputTokens:n.currentContext.outputTokens+(e.outputTokens??0),totalTokens:(e.inputTokens??n.currentContext.inputTokens)+(n.currentContext.outputTokens+(e.outputTokens??0))}})),setCurrentModel:e=>s({currentModel:e}),resetTokens:()=>s({totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0}}),cycleTokenDisplayMode:()=>s(e=>{const n=["context","input","output"],a=(n.indexOf(e.tokenDisplayMode)+1)%n.length,l=n[a];return l?{tokenDisplayMode:l}:e}),addLog:e=>s(n=>({logs:[...n.logs,e]})),clearLogs:()=>s({logs:[]}),setActiveTab:e=>s({activeTab:e})})),de=$("use-chat-messages","debug");function ut(s){const e=S(c=>c.messages),n=S(c=>c.isStreaming),o=S(c=>c.sessionId),a=S(c=>c.setIsStreaming),l=S(c=>c.setStreamingStartTime),u=S(c=>c.addMessage),m=S(c=>c.updateMessage),p=S(c=>c.setError),r=i.useCallback(async c=>{if(!s){de.error("No client available"),p("No client available");return}if(!o){de.error("No active session"),p("No active session");return}try{const d=Date.now();a(!0),l(d);const h={id:`msg_${Date.now()}_user`,role:"user",content:c,timestamp:new Date().toISOString(),isStreaming:!1};u(h);const g=`msg_${Date.now()}_assistant`,b={id:g,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0,streamingStartTime:d};u(b);const y=e.filter(N=>N.role!=="system").map(N=>`${N.role==="user"?"Human":"Assistant"}: ${N.content}`).join(`
|
|
4
|
+
|
|
5
|
+
`),j=y?`${y}
|
|
6
|
+
|
|
7
|
+
Human: ${c}`:c,w=s.receiveMessages();s.sendMessage(j,o).catch(N=>{const U=N instanceof Error?N.message:String(N);p(U),a(!1),l(null)});let v="";for await(const N of w)if(N.tokenUsage&&de.debug("chunk.tokenUsage",{tokenUsage:N.tokenUsage}),N.isComplete){m(g,{content:v,isStreaming:!1,streamingStartTime:void 0,...N.tokenUsage?{tokenUsage:N.tokenUsage}:{}}),a(!1),l(null);break}else N.contentDelta.type==="text"&&(v+=N.contentDelta.text,m(g,{content:v,...N.tokenUsage?{tokenUsage:N.tokenUsage}:{}}),await new Promise(U=>setTimeout(U,16)))}catch(d){const h=d instanceof Error?d.message:String(d);p(h),a(!1),l(null)}},[s,o,e,u,m,a,l,p]);return{messages:e,isStreaming:n,sendMessage:r}}const Bs=$("use-chat-input","debug");function Ws(s){const e=S(d=>d.input),n=S(d=>d.setInputValue),o=S(d=>d.setInputSubmitting),a=S(d=>d.addFileAttachment),l=S(d=>d.removeFileAttachment),{sendMessage:u}=ut(s),m=i.useCallback(d=>{n(d)},[n]),p=i.useCallback(async()=>{if(!e.value.trim()||e.isSubmitting)return;const d=e.value;n(""),o(!0);try{await u(d)}catch(h){Bs.error("Failed to send message",{error:h instanceof Error?h.message:String(h)})}finally{o(!1)}},[e,n,o,u]),r=i.useCallback(d=>{a(d)},[a]),c=i.useCallback(d=>{l(d)},[l]);return{value:e.value,isSubmitting:e.isSubmitting,attachedFiles:e.attachedFiles,onChange:m,onSubmit:p,onAttachFile:r,onRemoveFile:c}}const Vs=$("use-chat-session","debug");function qs(s){const e=S(d=>d.connectionStatus),n=S(d=>d.sessionId),o=S(d=>d.setConnectionStatus),a=S(d=>d.setSessionId),l=S(d=>d.setError),u=S(d=>d.clearMessages),m=S(d=>d.resetTokens),p=i.useCallback(async()=>{if(!s){l("No client available");return}try{o("connecting"),l(null),await s.connect(),o("connected")}catch(d){Vs.error("Failed to connect",{error:d instanceof Error?d.message:String(d)});const h=d instanceof Error?d.message:String(d);l(h),o("error")}},[s,o,l]),r=i.useCallback(async()=>{if(!s){l("No client available");return}try{const d=await s.startSession();a(d),u(),m()}catch(d){const h=d instanceof Error?d.message:String(d);l(h)}},[s,a,l,u,m]),c=i.useCallback(async()=>{if(s)try{await s.disconnect(),o("disconnected"),a(null)}catch(d){const h=d instanceof Error?d.message:String(d);l(h)}},[s,o,a,l]);return i.useEffect(()=>{s&&e==="disconnected"&&p()},[s,e,p]),i.useEffect(()=>{e==="connected"&&!n&&r()},[e,n,r]),{connectionStatus:e,sessionId:n,connect:p,startSession:r,disconnect:c}}function Qs(s){const e=S(u=>u.toolCalls),n=S(u=>u.addToolCall),o=S(u=>u.updateToolCall),a=S(u=>u.addToolCallToCurrentMessage),l=S(u=>u.updateToolCallInCurrentMessage);return i.useEffect(()=>{if(!s)return;const u=s.onSessionUpdate(m=>{m.type==="tool_call"?(n(m.sessionId,m.toolCall),a(m.toolCall)):m.type==="tool_call_update"&&(o(m.sessionId,m.toolCallUpdate),l(m.toolCallUpdate))});return()=>{u()}},[s,n,o,a,l]),{toolCalls:e,getToolCallsForSession:u=>{const m=e[u];return m&&m.length>0?m:Object.values(e).flat()}}}const Gs=T({id:x(),role:H(["user","assistant","system"]),content:x(),timestamp:te(),isStreaming:K().default(!1),streamingStartTime:I().optional(),metadata:_(x(),L()).optional(),toolCalls:E(dt).optional(),tokenUsage:fe.optional()}),Ks=T({value:x(),isSubmitting:K(),attachedFiles:E(T({name:x(),path:x(),size:I(),mimeType:x()}))});T({sessionId:x().nullable(),isConnected:K(),isStreaming:K(),messages:E(Gs),input:Ks,error:x().nullable()});H(["disconnected","connecting","connected","error"]);const k=$("http-transport");class Xs{connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;messageQueue=[];currentSessionId=null;chunkResolvers=[];streamComplete=!1;sseAbortController=null;reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=1e3;reconnecting=!1;abortController=null;options;constructor(e){this.options={...e,baseUrl:e.baseUrl.replace(/\/$/,"")}}async connect(){if(!this.connected)try{this.abortController=new AbortController;const e={protocolVersion:ms,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},n=await this.sendRpcRequest("initialize",e);k.info("ACP connection initialized",{initResponse:n});const o={cwd:"/",mcpServers:[]},a=await this.sendRpcRequest("session/new",o);this.currentSessionId=a.sessionId,k.info("Session created",{sessionId:this.currentSessionId}),await this.connectSSE(),this.connected=!0,this.reconnectAttempts=0}catch(e){this.connected=!1;const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async disconnect(){if(this.connected)try{this.abortController&&(this.abortController.abort(),this.abortController=null),this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.connected=!1,this.currentSessionId=null,this.messageQueue=[],this.chunkResolvers=[],this.streamComplete=!1,this.reconnecting=!1,this.reconnectAttempts=0}catch(e){const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async send(e){if(!this.connected||!this.currentSessionId)throw new Error("Transport not connected");try{this.streamComplete=!1,this.messageQueue=[];const n=e.content.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
8
|
+
`),o={sessionId:this.currentSessionId,prompt:[{type:"text",text:n}]},a=await this.sendRpcRequest("session/prompt",o);k.debug("Prompt sent",{promptResponse:a}),this.streamComplete=!0;const l=this.chunkResolvers.shift();l?l({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}):this.messageQueue.push({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0})}catch(n){this.streamComplete=!0;const o=n instanceof Error?n:new Error(String(n));throw this.notifyError(o),o}}async*receive(){for(;!this.streamComplete;)if(this.messageQueue.length>0){const e=this.messageQueue.shift();if(e&&(yield e,e.isComplete))return}else{const e=await new Promise(n=>{this.chunkResolvers.push(n)});if(e.isComplete){yield e;return}else yield e}for(;this.messageQueue.length>0;){const e=this.messageQueue.shift();e&&(yield e)}yield{id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}async sendRpcRequest(e,n){const a={jsonrpc:"2.0",id:this.generateRequestId(),method:e,params:n},l={"Content-Type":"application/json",...this.options.headers},u=this.options.timeout??600*1e3,m=new AbortController,p=setTimeout(()=>m.abort(),u);try{const r=await fetch(`${this.options.baseUrl}/rpc`,{method:"POST",headers:l,body:JSON.stringify(a),signal:m.signal});if(clearTimeout(p),!r.ok){const d=await r.text();throw new Error(`HTTP ${r.status}: ${d}`)}const c=await r.json();if(c.error)throw new Error(`ACP error: ${c.error.message||JSON.stringify(c.error)}`);return c.result||c}catch(r){throw clearTimeout(p),r instanceof Error&&r.name==="AbortError"?new Error(`Request timeout after ${u}ms`):r}}async connectSSE(){if(!this.currentSessionId)throw new Error("Cannot connect SSE without a session ID");const e=`${this.options.baseUrl}/events`,n={"X-Session-ID":this.currentSessionId,...this.options.headers};this.sseAbortController=new AbortController;try{const o=await fetch(e,{method:"GET",headers:n,signal:this.sseAbortController.signal});if(!o.ok)throw new Error(`SSE connection failed: HTTP ${o.status}`);if(!o.body)throw new Error("Response body is null");k.debug("SSE connection opened"),this.reconnectAttempts=0,this.reconnectDelay=1e3;const a=o.body.getReader(),l=new TextDecoder;let u="";(async()=>{try{for(;;){const{done:m,value:p}=await a.read();if(m){k.debug("SSE stream closed by server"),this.connected&&await this.handleSSEDisconnect();break}u+=l.decode(p,{stream:!0});const r=u.split(`
|
|
9
|
+
`);u=r.pop()||"";let c={event:"message",data:""};for(const d of r)d.startsWith("event:")?c.event=d.substring(6).trim():d.startsWith("data:")?c.data=d.substring(5).trim():d===""&&(c.event==="message"&&c.data&&this.handleSSEMessage(c.data),c={event:"message",data:""})}}catch(m){if(m instanceof Error&&m.name==="AbortError"){k.debug("SSE stream aborted");return}k.error("Error reading SSE stream",{error:m}),this.connected&&!this.reconnecting&&await this.handleSSEDisconnect()}})()}catch(o){throw k.error("SSE connection error",{error:o}),o}}async handleSSEDisconnect(){if(this.reconnecting||!this.connected)return;if(this.reconnecting=!0,this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.reconnectAttempts>=this.maxReconnectAttempts){const n=new Error(`SSE reconnection failed after ${this.maxReconnectAttempts} attempts`);this.notifyError(n),this.connected=!1,this.reconnecting=!1;return}this.reconnectAttempts++;const e=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),32e3);k.debug("SSE reconnecting",{delay:e,attempt:this.reconnectAttempts,maxAttempts:this.maxReconnectAttempts}),await new Promise(n=>setTimeout(n,e));try{await this.connectSSE(),k.info("SSE reconnected successfully"),this.reconnecting=!1}catch(n){k.error("SSE reconnection failed",{error:n}),this.reconnecting=!1}}handleSSEMessage(e){try{const n=JSON.parse(e);k.debug("Received SSE message",{message:n});const o=fs.safeParse(n);if(!o.success){k.error("Invalid ACP message from SSE",{issues:o.error.issues});return}const a=o.data;k.debug("Parsed ACP message",{method:"method"in a?a.method:"(no method)"}),"method"in a&&a.method==="session/update"&&(k.debug("Received session/update notification"),"params"in a&&a.params&&(k.debug("Calling handleSessionNotification",{params:a.params}),this.handleSessionNotification(a.params)))}catch(n){k.error("Error parsing SSE message",{error:n}),this.notifyError(n instanceof Error?n:new Error(String(n)))}}handleSessionNotification(e){k.debug("handleSessionNotification called",{params:e});const o=e.update,a=this.currentSessionId||e.sessionId;if(k.debug("Update session type",{sessionUpdate:o?.sessionUpdate}),o?.sessionUpdate==="tool_call"){k.debug("Tool call notification",{tokenUsage:o.tokenUsage});const l=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,u={id:o.toolCallId??"",title:o.title??"",kind:o.kind||"other",status:o.status||"pending",locations:o.locations,rawInput:o.rawInput,tokenUsage:o.tokenUsage,content:o.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const r=p;if(r.type==="content"&&typeof r.content=="object"&&r.content!==null){const c=r.content;if(c.type==="text")return{type:"content",content:{type:"text",text:typeof c.text=="string"?c.text:""}}}return r.type==="text"?{type:"text",text:typeof r.text=="string"?r.text:""}:r.type==="diff"?{type:"diff",path:typeof r.path=="string"?r.path:"",oldText:typeof r.oldText=="string"?r.oldText:"",newText:typeof r.newText=="string"?r.newText:"",line:typeof r.line=="number"?r.line:null}:r.type==="terminal"?{type:"terminal",terminalId:typeof r.terminalId=="string"?r.terminalId:""}:{type:"text",text:""}}),startedAt:Date.now()},m={type:"tool_call",sessionId:a,status:"active",toolCall:u,messageId:l};this.notifySessionUpdate(m)}else if(o?.sessionUpdate==="tool_call_update"){const l=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,u={id:o.toolCallId??"",status:o.status,locations:o.locations,rawOutput:o.rawOutput,tokenUsage:o.tokenUsage,content:o.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const r=p;if(r.type==="content"&&typeof r.content=="object"&&r.content!==null){const c=r.content;if(c.type==="text")return{type:"content",content:{type:"text",text:typeof c.text=="string"?c.text:""}}}return r.type==="text"?{type:"text",text:typeof r.text=="string"?r.text:""}:r.type==="diff"?{type:"diff",path:typeof r.path=="string"?r.path:"",oldText:typeof r.oldText=="string"?r.oldText:"",newText:typeof r.newText=="string"?r.newText:"",line:typeof r.line=="number"?r.line:null}:r.type==="terminal"?{type:"terminal",terminalId:typeof r.terminalId=="string"?r.terminalId:""}:{type:"text",text:""}}),error:o.error,completedAt:o.status==="completed"||o.status==="failed"?Date.now():void 0},m={type:"tool_call_update",sessionId:a,status:"active",toolCallUpdate:u,messageId:l};k.debug("Notifying tool_call_update session update",{sessionUpdate:m}),this.notifySessionUpdate(m)}else if(o&&"sessionUpdate"in o&&o.sessionUpdate==="tool_output"){const l=o,u=l._meta&&typeof l._meta=="object"&&"messageId"in l._meta?String(l._meta.messageId):void 0,m={id:l.toolCallId??"",rawOutput:l.rawOutput,content:l.content?.map(r=>{if(typeof r!="object"||r===null)return{type:"text",text:""};const c=r;if(c.type==="content"&&typeof c.content=="object"&&c.content!==null){const d=c.content;if(d.type==="text")return{type:"content",content:{type:"text",text:typeof d.text=="string"?d.text:""}}}return c.type==="text"?{type:"text",text:typeof c.text=="string"?c.text:""}:c.type==="diff"?{type:"diff",path:typeof c.path=="string"?c.path:"",oldText:typeof c.oldText=="string"?c.oldText:"",newText:typeof c.newText=="string"?c.newText:"",line:typeof c.line=="number"?c.line:null}:c.type==="terminal"?{type:"terminal",terminalId:typeof c.terminalId=="string"?c.terminalId:""}:{type:"text",text:""}})},p={type:"tool_call_update",sessionId:a,status:"active",toolCallUpdate:m,messageId:u};k.debug("Notifying tool_output as tool_call_update",{sessionUpdate:p}),this.notifySessionUpdate(p)}else if(o?.sessionUpdate==="agent_message_chunk"){const l={type:"generic",sessionId:a,status:"active"},u=o._meta&&typeof o._meta=="object"&&"tokenUsage"in o._meta?o._meta.tokenUsage:void 0;k.debug("Agent message chunk",{tokenUsage:u});const m=o.content;if(m&&typeof m=="object"){const p=m;let r=null;if(p.type==="text"&&typeof p.text=="string"&&(r={id:e.sessionId,role:"assistant",contentDelta:{type:"text",text:p.text},tokenUsage:u,isComplete:!1}),r){const c=this.chunkResolvers.shift();c?c(r):this.messageQueue.push(r)}}this.notifySessionUpdate(l)}else{const l={type:"generic",sessionId:a,status:"active"};this.notifySessionUpdate(l)}}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}notifySessionUpdate(e){for(const n of this.sessionUpdateCallbacks)try{n(e)}catch(o){k.error("Error in session update callback",{error:o})}}notifyError(e){for(const n of this.errorCallbacks)try{n(e)}catch(o){k.error("Error in error callback",{error:o})}}}class Js{constructor(){throw new Error("StdioTransport is not available in the browser. Use HttpTransport or WebSocketTransport instead.")}async connect(){throw new Error("StdioTransport not available in browser")}async disconnect(){}async send(){throw new Error("StdioTransport not available in browser")}async*receive(){throw new Error("StdioTransport not available in browser")}isConnected(){return!1}onSessionUpdate(){return()=>{}}onError(){return()=>{}}}class Ys{ws=null;connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;constructor(e){}async connect(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.connected=!1}async send(e){throw!this.connected||!this.ws?new Error("Transport not connected"):new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async*receive(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}}const ue=$("acp-client","debug");class Zs{config;transport;sessions=new Map;currentSessionId=null;sessionUpdateHandlers=new Set;errorHandlers=new Set;constructor(e){this.config=e,this.transport=this.createTransport(),this.setupTransportListeners(),e.autoConnect&&this.connect().catch(n=>{ue.error("Failed to auto-connect",{error:n instanceof Error?n.message:String(n)})})}async connect(){await this.transport.connect()}async disconnect(){await this.transport.disconnect(),this.currentSessionId=null}isConnected(){return this.transport.isConnected()}async startSession(e){const n=this.generateSessionId(),o=new Date().toISOString(),a={id:n,status:"connecting",config:e?{...e,agentPath:e.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:o}};return this.sessions.set(n,a),this.currentSessionId=n,this.updateSessionStatus(n,"connected"),n}async sendMessage(e,n){const o=n||this.currentSessionId;if(!o)throw new Error("No active session. Start a session first.");if(!this.transport.isConnected())throw new Error("Transport not connected");const a=this.sessions.get(o);if(!a)throw new Error(`Session ${o} not found`);const l={id:this.generateMessageId(),role:"user",content:[{type:"text",text:e}],timestamp:new Date().toISOString()};a.messages.push(l),this.updateSessionStatus(o,"active"),await this.transport.send(l)}async*receiveMessages(){if(!this.transport.isConnected())throw new Error("Transport not connected");yield*this.transport.receive()}getSession(e){return this.sessions.get(e)}getCurrentSession(){return this.currentSessionId?this.sessions.get(this.currentSessionId):void 0}getAllSessions(){return Array.from(this.sessions.values())}onSessionUpdate(e){return this.sessionUpdateHandlers.add(e),()=>{this.sessionUpdateHandlers.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}createTransport(){switch(this.config.type){case"stdio":return new Js(this.config.options);case"http":return new Xs(this.config.options);case"websocket":return new Ys(this.config.options);default:throw new Error(`Unknown transport type: ${this.config.type}`)}}setupTransportListeners(){this.transport.onSessionUpdate(e=>{this.handleSessionUpdate(e)}),this.transport.onError(e=>{this.handleError(e)})}handleSessionUpdate(e){if(e.sessionId){const n=this.sessions.get(e.sessionId);n&&(e.status&&(n.status=e.status),e.message&&n.messages.push(e.message),e.error&&(n.error=e.error))}for(const n of this.sessionUpdateHandlers)try{n(e)}catch(o){ue.error("Error in session update handler",{error:o instanceof Error?o.message:String(o)})}}handleError(e){for(const n of this.errorHandlers)try{n(e)}catch(o){ue.error("Error in error handler",{error:o instanceof Error?o.message:String(o)})}}updateSessionStatus(e,n){const o=this.sessions.get(e);o&&(o.status=n,this.handleSessionUpdate({sessionId:e,status:n}))}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateMessageId(){return`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}}const en=T({name:x(),description:x().optional(),parameters:_(x(),L()).optional()}),tn=T({name:x(),description:x(),parameters:_(x(),L()),required:E(x()).optional()}),sn=T({name:x(),version:x().optional(),description:x().optional(),author:x().optional(),capabilities:E(en).optional(),tools:E(tn).optional(),supportedFormats:E(x()).optional()}),nn=H(["initializing","ready","busy","error","terminated"]);T({status:nn,info:sn.optional(),pid:I().optional(),error:x().optional(),uptime:I().optional()});const pt=H(["user","assistant","system","tool"]),on=H(["text","image","file","tool_call","tool_result"]),J=T({type:on}),rn=J.extend({type:M("text"),text:x()}),an=J.extend({type:M("image"),url:x().url().optional(),data:x().optional(),mimeType:x().optional()}),ln=J.extend({type:M("file"),name:x(),path:x().optional(),url:x().url().optional(),mimeType:x(),size:I().optional()}),cn=J.extend({type:M("tool_call"),id:x(),name:x(),arguments:_(x(),L())}),dn=J.extend({type:M("tool_result"),callId:x(),result:L(),error:x().optional()}),mt=ke("type",[rn,an,ln,cn,dn]),ft=T({id:x(),role:pt,content:E(mt),timestamp:te(),metadata:_(x(),L()).optional()});T({id:x(),role:pt,contentDelta:mt,isComplete:K(),tokenUsage:T({inputTokens:I().optional(),outputTokens:I().optional(),totalTokens:I().optional()}).optional()});const ht=H(["idle","connecting","connected","active","streaming","error","disconnected"]),un=T({agentPath:x(),agentArgs:E(x()).optional(),environment:_(x(),x()).optional(),workingDirectory:x().optional(),timeout:I().optional()}),pn=T({agentName:x().optional(),agentVersion:x().optional(),capabilities:E(x()).optional(),startedAt:te(),lastActivityAt:te().optional()});T({id:x(),status:ht,config:un,metadata:pn.optional(),messages:E(ft),error:x().optional()});const se=T({sessionId:x(),status:ht.optional(),message:ft.optional(),error:x().optional()}),mn=se.extend({type:M("tool_call"),toolCall:dt,messageId:x().optional()}),fn=se.extend({type:M("tool_call_update"),toolCallUpdate:$s,messageId:x().optional()}),hn=se.extend({type:M("tool_output"),toolOutput:T({id:x(),content:E(ls()).optional(),rawOutput:_(x(),L()).optional()}),messageId:x().optional()}),gn=se.extend({type:M("generic").optional()});cs([mn,fn,hn,gn]);function f(...s){return ds(us(s))}const xn=W("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-hover",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive-hover",outline:"border border-input bg-background hover:bg-accent-hover hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary-hover",ghost:"hover:bg-accent-hover hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Y=i.forwardRef(({className:s,variant:e,size:n,asChild:o=!1,...a},l)=>{const u=o?X:"button";return t.jsx(u,{className:f(xn({variant:e,size:n,className:s})),ref:l,...a})});Y.displayName="Button";const bn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:f("rounded-lg border bg-card text-card-foreground shadow-sm",s),...e}));bn.displayName="Card";const yn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:f("flex flex-col space-y-1.5 p-6",s),...e}));yn.displayName="CardHeader";const wn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:f("text-2xl font-semibold leading-none tracking-tight",s),...e}));wn.displayName="CardTitle";const vn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:f("text-sm text-muted-foreground",s),...e}));vn.displayName="CardDescription";const Nn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:f("p-6 pt-0",s),...e}));Nn.displayName="CardContent";const jn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:f("flex items-center p-6 pt-0",s),...e}));jn.displayName="CardFooter";const gt=i.forwardRef(({title:s,description:e,guideUrl:n,guideText:o="Guide",suggestedPrompts:a=[],onPromptClick:l,onGuideClick:u,className:m,...p},r)=>{const c=g=>{l?.(g)},d=()=>{n&&window.open(n,"_blank","noopener,noreferrer"),u?.()},h=[];for(let g=0;g<a.length;g+=2)h.push(a.slice(g,g+2));return t.jsxs("div",{ref:r,className:f("flex flex-col items-start gap-6",m),...p,children:[t.jsx("h3",{className:"text-heading-3 text-text-primary hidden lg:block",children:s}),t.jsx("p",{className:"text-subheading text-text-secondary max-w-prose",children:e}),(n||u)&&t.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg hover:bg-accent transition-colors",children:[t.jsx("span",{className:"text-sm font-medium leading-normal text-text-primary",children:o}),t.jsx(Ye,{className:"size-4 text-text-primary"})]}),a.length>0&&t.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-prompt-container",children:[t.jsx("p",{className:"text-label text-text-tertiary",children:"Suggested Prompts"}),t.jsx("div",{className:"flex flex-col gap-2.5",children:h.map(g=>t.jsx("div",{className:"flex gap-2.5 items-center",children:g.map(b=>t.jsx("button",{type:"button",onClick:()=>c(b),className:"flex-1 flex items-start gap-2 p-3 bg-secondary hover:bg-secondary/80 rounded-2xl transition-colors min-w-0",children:t.jsx("span",{className:"text-base font-normal leading-normal text-text-tertiary truncate",children:b})},b))},g.join("-")))})]})]})});gt.displayName="ChatEmptyState";const xt=i.createContext(void 0),he=()=>{const s=i.useContext(xt);if(!s)throw new Error("ChatHeader components must be used within ChatHeader.Root");return s},bt=i.forwardRef(({defaultExpanded:s=!1,expanded:e,onExpandedChange:n,className:o,children:a,...l},u)=>{const[m,p]=i.useState(s),r=e??m,c=i.useCallback(b=>{p(b),n?.(b)},[n]),d=i.Children.toArray(a),h=d.find(b=>i.isValidElement(b)&&typeof b.type=="function"&&b.type.displayName==="ChatHeader.ExpandablePanel"),g=d.filter(b=>b!==h);return t.jsxs(xt.Provider,{value:{isExpanded:r,setIsExpanded:c},children:[t.jsx("div",{ref:u,className:f("flex items-center justify-between px-6 py-4",o),...l,children:g}),h]})});bt.displayName="ChatHeader.Root";const Cn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("h1",{ref:o,className:f("m-0 text-xl font-semibold",s),...n,children:e}));Cn.displayName="ChatHeader.Title";const Sn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("flex items-center gap-3",s),...n,children:e}));Sn.displayName="ChatHeader.Actions";const Tn=s=>{switch(s){case"connected":return"bg-green-500";case"connecting":return"bg-yellow-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},kn=s=>{switch(s){case"connected":return"Connected";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"No Server"}},In=i.forwardRef(({status:s,statusText:e,className:n,...o},a)=>{const l=e??kn(s),u=Tn(s);return t.jsxs("div",{ref:a,className:f("flex items-center gap-2",n),...o,children:[t.jsx("div",{className:f("h-2 w-2 rounded-full",u)}),t.jsx("span",{className:"text-sm text-muted-foreground",children:l})]})});In.displayName="ChatHeader.StatusIndicator";const En=i.forwardRef(({icon:s,className:e,children:n,onClick:o,...a},l)=>{const{isExpanded:u,setIsExpanded:m}=he(),p=r=>{m(!u),o?.(r)};return t.jsxs("button",{ref:l,type:"button",onClick:p,className:f("rounded p-1 transition-colors hover:bg-background lg:hidden",e),"aria-label":u?"Collapse header":"Expand header",...a,children:[s&&t.jsx("div",{className:f("transition-transform duration-200",u&&"rotate-180"),children:s}),n]})});En.displayName="ChatHeader.Toggle";const yt=i.forwardRef(({className:s,children:e,...n},o)=>{const{isExpanded:a}=he();return a?t.jsx("div",{ref:o,className:f("absolute top-full left-0 right-0 z-50 border-b border-border bg-card px-6 py-4 shadow-lg lg:hidden",s),...n,children:e}):null});yt.displayName="ChatHeader.ExpandablePanel";const wt=i.forwardRef(({commands:s=[],showCommandMenu:e,commandMenuQuery:n,selectedMenuIndex:o,setSelectedMenuIndex:a,setMenuItemCount:l,triggerCounter:u,onChange:m,className:p,...r},c)=>{const d=i.useCallback((g,b)=>{const y=g.toLowerCase(),j=b.toLowerCase();if(!b)return 1;if(y.includes(j))return 1-j.length/y.length;let w=0;for(let v=0;v<y.length&&w<j.length;v++)y[v]===j[w]&&w++;return w===j.length?.5-w/y.length:0},[]),h=i.useMemo(()=>s.map(g=>({...g,score:Math.max(d(g.label,n),g.description?d(g.description,n):0)})).filter(g=>g.score>0).sort((g,b)=>b.score-g.score),[s,n,d]);return i.useEffect(()=>{l(h.length)},[h.length,l]),i.useEffect(()=>{a(0)},[a]),i.useEffect(()=>{u>0&&h[o]&&(h[o].onSelect(),m(""))},[u,h,o,m]),!e||h.length===0?null:t.jsxs("div",{ref:c,className:f("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md","rounded-md border border-border bg-card p-2 shadow-lg",p),...r,children:[t.jsx("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1",children:"Commands"}),t.jsx("div",{className:"max-h-64 overflow-y-auto",children:h.map((g,b)=>t.jsxs("button",{type:"button",onClick:()=>g.onSelect(),className:f("w-full rounded-sm px-2 py-2 text-left text-sm transition-colors","flex items-start gap-2","hover:bg-muted",b===o&&"bg-muted"),children:[g.icon&&t.jsx("span",{className:"shrink-0 mt-0.5",children:g.icon}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium",children:g.label}),g.description&&t.jsx("div",{className:"text-xs text-muted-foreground truncate",children:g.description})]})]},g.id))})]})});wt.displayName="ChatInputCommandMenu";const vt=i.createContext(void 0),ne=()=>{const s=i.useContext(vt);if(!s)throw new Error("ChatInput components must be used within ChatInput.Root");return s},Nt=i.forwardRef(({client:s,value:e,onChange:n,onSubmit:o,disabled:a=!1,isSubmitting:l,submitOnEnter:u=!0,className:m,children:p,...r},c)=>{const d=i.useRef(null),h=Ws(s??null),g=S(R=>R.isStreaming),b=h?h.value:e||"",y=h?h.onChange:n||(()=>{}),j=h?h.onSubmit:o||(async()=>{}),w=h?h.isSubmitting||g:l||!1,[v,N]=i.useState(!1),[U,z]=i.useState(""),[O,C]=i.useState(0),[A,P]=i.useState(0),[ie,le]=i.useState(0),Xt=i.useCallback(()=>{le(R=>R+1)},[]),Jt=async R=>{R.preventDefault(),b.trim()&&!w&&!a&&(await j(),setTimeout(()=>{d.current?.focus()},0))},Yt=R=>{const F=R.target;!(F.tagName==="BUTTON"||F.tagName==="INPUT"||F.tagName==="TEXTAREA"||F.closest("button"))&&d.current&&d.current.focus()},Zt=R=>{const F=R.target;!(F.tagName==="BUTTON"||F.tagName==="INPUT"||F.tagName==="TEXTAREA"||F.closest("button"))&&R.key===" "&&(R.preventDefault(),d.current&&d.current.focus())};return i.useEffect(()=>{const R=document.querySelector('textarea[name="chat-input"]');R&&d.current!==R&&(d.current=R)},[]),i.useEffect(()=>{!b&&d.current&&(d.current.style.height="auto",d.current.style.overflowY="hidden")},[b]),t.jsx(vt.Provider,{value:{value:b,onChange:y,onSubmit:j,disabled:a,isSubmitting:w,submitOnEnter:u,showCommandMenu:v,setShowCommandMenu:N,commandMenuQuery:U,setCommandMenuQuery:z,selectedMenuIndex:O,setSelectedMenuIndex:C,menuItemCount:A,setMenuItemCount:P,triggerMenuSelect:Xt,triggerCounter:ie},children:t.jsx("form",{ref:c,onSubmit:Jt,onClick:Yt,onKeyDown:Zt,className:f("relative w-full divide-y rounded-xl border bg-background shadow-md",m),...r,children:p})})});Nt.displayName="ChatInput.Root";const jt=i.forwardRef(({asChild:s=!1,className:e,onKeyDown:n,children:o,...a},l)=>{const{value:u,onChange:m,onSubmit:p,disabled:r,isSubmitting:c,submitOnEnter:d,showCommandMenu:h,setShowCommandMenu:g,setCommandMenuQuery:b,setSelectedMenuIndex:y,menuItemCount:j,triggerMenuSelect:w}=ne(),v=i.useRef(null),O={ref:i.useCallback(C=>{v.current=C,typeof l=="function"?l(C):l&&(l.current=C)},[l]),name:"chat-input",value:u,onChange:C=>{const A=C.target.value;if(m(A),A.startsWith("/")&&!A.includes(`
|
|
10
|
+
`)){g(!0);const le=A.slice(1);b(le)}else g(!1),b("");const P=v.current;if(!P)return;P.style.height="auto";const ie=Math.min(P.scrollHeight,164);P.style.height=`${ie}px`,P.scrollHeight>164?P.style.overflowY="auto":P.style.overflowY="hidden"},onKeyDown:C=>{if(h&&j>0){if(C.key==="ArrowDown"){C.preventDefault(),y(A=>(A+1)%j);return}else if(C.key==="ArrowUp"){C.preventDefault(),y(A=>(A-1+j)%j);return}else if(C.key==="Enter"&&!C.shiftKey){C.preventDefault(),w();return}else if(C.key==="Escape"){C.preventDefault(),g(!1),b("");return}}d&&C.key==="Enter"&&!C.shiftKey&&(u.trim()&&!c&&!r?(C.preventDefault(),p()):(c||r)&&C.preventDefault()),n?.(C)},disabled:r,...a};return s&&i.isValidElement(o)?i.cloneElement(o,O):t.jsx("textarea",{...O,className:f("w-full resize-none rounded-none border-none p-4 shadow-none","outline-none ring-0 field-sizing-content max-h-[6lh]","bg-transparent dark:bg-transparent focus-visible:ring-0","text-sm placeholder:text-muted-foreground","disabled:cursor-not-allowed disabled:opacity-50",e)})});jt.displayName="ChatInput.Field";const Ct=i.forwardRef(({asChild:s=!1,className:e,disabled:n,children:o,...a},l)=>{const{value:u,disabled:m,isSubmitting:p}=ne(),r=n||m||p||!u.trim(),c=s?X:Y;return t.jsx(c,{ref:l,type:"submit",disabled:r,variant:s?void 0:"default",size:"icon",className:f(!s&&"gap-1.5 rounded-full",e),...a,children:o})});Ct.displayName="ChatInput.Submit";const St=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("flex items-center justify-between p-2",s),...n,children:e}));St.displayName="ChatInput.Toolbar";const Tt=i.forwardRef(({asChild:s=!1,className:e,children:n,onClick:o,...a},l)=>{const{value:u,onChange:m,setShowCommandMenu:p,setCommandMenuQuery:r}=ne(),c=h=>{u.startsWith("/")||(m("/"),p(!0),r("")),o?.(h)},d=s?X:Y;return t.jsx(d,{ref:l,type:"button",variant:"ghost",size:"icon",className:f("rounded-full",e),onClick:c,...a,children:n||t.jsx(Cs,{className:"size-4"})})});Tt.displayName="ChatInput.Actions";const kt=i.forwardRef(({asChild:s=!1,className:e,children:n,...o},a)=>{const l=s?X:Y;return t.jsx(l,{ref:a,type:"button",variant:"ghost",size:"icon",className:f("rounded-full",e),...o,children:n||t.jsx(Ss,{className:"size-4"})})});kt.displayName="ChatInput.Attachment";const It=i.forwardRef(({asChild:s=!1,className:e,children:n,...o},a)=>{const l=s?X:Y;return t.jsx(l,{ref:a,type:"button",variant:"ghost",size:"icon",className:f("rounded-full",e),...o,children:n||t.jsx(Ts,{className:"size-4"})})});It.displayName="ChatInput.VoiceInput";const Et=i.forwardRef(({commands:s=[],className:e,onChange:n,...o},a)=>{const{showCommandMenu:l,commandMenuQuery:u,selectedMenuIndex:m,setSelectedMenuIndex:p,setMenuItemCount:r,triggerCounter:c,onChange:d}=ne();return t.jsx(wt,{ref:a,commands:s,showCommandMenu:l,commandMenuQuery:u,selectedMenuIndex:m,setSelectedMenuIndex:p,setMenuItemCount:r,triggerCounter:c,onChange:d,className:e,...o})});Et.displayName="ChatInput.CommandMenu";const Rn=({className:s,...e})=>t.jsx(ts,{className:f("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",s),...e}),Rt=({className:s,...e})=>t.jsx(ss,{className:f(s),...e}),Mn=({withHandle:s,className:e,...n})=>t.jsx(ns,{className:f("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:s&&t.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[t.jsx("title",{children:"Resize Handle"}),t.jsx("circle",{cx:"9",cy:"12",r:"1"}),t.jsx("circle",{cx:"9",cy:"5",r:"1"}),t.jsx("circle",{cx:"9",cy:"19",r:"1"}),t.jsx("circle",{cx:"15",cy:"12",r:"1"}),t.jsx("circle",{cx:"15",cy:"5",r:"1"}),t.jsx("circle",{cx:"15",cy:"19",r:"1"})]})})}),Un=({...s})=>t.jsx(ps,{position:"top-center",className:"toaster group",style:{"--top-offset":"16px","--width:":"calc(100% - 2 * var(--top-offset))",position:"absolute",zIndex:5,top:"var(--top-offset)",left:"50%",transform:"translateX(-50%)",width:"calc(100% - 2 * var(--top-offset))",maxWidth:"480px"},offset:0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...s}),Mt=i.createContext(void 0),ge=()=>{const s=i.useContext(Mt);if(!s)throw new Error("ChatLayout components must be used within ChatLayout.Root");return s},Ut=i.forwardRef(({defaultSidebarOpen:s=!1,defaultPanelSize:e="hidden",defaultActiveTab:n="todo",className:o,children:a,...l},u)=>{const[m,p]=i.useState(s),[r,c]=i.useState(e),[d,h]=i.useState(n);return t.jsx(Mt.Provider,{value:{sidebarOpen:m,setSidebarOpen:p,panelSize:r,setPanelSize:c,activeTab:d,setActiveTab:h},children:t.jsx("div",{ref:u,className:f("flex h-screen flex-row bg-background text-foreground",o),...l,children:t.jsx(Rn,{direction:"horizontal",className:"flex-1",children:a})})})});Ut.displayName="ChatLayout.Root";const An=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("relative z-10 border-b border-border bg-card shrink-0",s),...n,children:e}));An.displayName="ChatLayout.Header";const At=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx(Rt,{defaultSize:75,minSize:50,children:t.jsx("div",{ref:o,className:f("flex flex-1 flex-col overflow-hidden h-full",s),...n,children:e})}));At.displayName="ChatLayout.Main";const Dt=i.forwardRef(({showToaster:s=!0,className:e,children:n,...o},a)=>t.jsxs("div",{ref:a,className:f("relative flex flex-1 flex-col overflow-hidden",e),...o,children:[n,s&&t.jsx(Un,{})]}));Dt.displayName="ChatLayout.Body";const _t=i.forwardRef(({className:s,children:e,onScrollChange:n,showScrollToBottom:o=!0,...a},l)=>{const[u,m]=i.useState(!1),p=i.useRef(null);i.useImperativeHandle(l,()=>p.current);const r=i.useCallback(()=>{const h=p.current;if(!h)return;const{scrollTop:g,scrollHeight:b,clientHeight:y}=h,w=b-g-y<100;m(!w&&o),n?.(w)},[n,o]),c=i.useCallback(()=>{r()},[r]),d=i.useCallback(()=>{const h=p.current;h&&h.scrollTo({top:h.scrollHeight,behavior:"smooth"})},[]);return i.useEffect(()=>{r()},[r]),t.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[t.jsx("div",{ref:p,className:f("h-full overflow-y-auto",s),onScroll:c,...a,children:t.jsx("div",{className:"mx-auto max-w-chat min-h-full flex flex-col",children:e})}),u&&t.jsx("button",{type:"button",onClick:d,className:f("absolute bottom-4 left-1/2 -translate-x-1/2 z-10","flex items-center justify-center p-2 rounded-full","bg-card border border-border shadow-lg","text-foreground","hover:bg-accent hover:text-accent-foreground","transition-all duration-200 ease-in-out","animate-in fade-in slide-in-from-bottom-2"),"aria-label":"Scroll to bottom",children:t.jsx(ks,{className:"size-4"})})]})});_t.displayName="ChatLayout.Messages";const Lt=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("bg-linear-to-t from-background to-transparent px-4 pb-4",s),...n,children:t.jsx("div",{className:"mx-auto max-w-chat",children:e})}));Lt.displayName="ChatLayout.Footer";const Dn=i.forwardRef(({className:s,children:e,...n},o)=>{const{sidebarOpen:a}=ge();return a?t.jsx("div",{ref:o,className:f("border-r border-border bg-card w-64 overflow-y-auto",s),...n,children:e}):null});Dn.displayName="ChatLayout.Sidebar";const zt=i.forwardRef(({breakpoint:s="lg",className:e,children:n,...o},a)=>{const{panelSize:l}=ge();return l==="hidden"?null:t.jsxs(t.Fragment,{children:[t.jsx(Mn,{withHandle:!0}),t.jsx(Rt,{defaultSize:25,minSize:15,maxSize:50,children:t.jsx("div",{ref:a,className:f("hidden h-full border-l border-border bg-card overflow-y-auto transition-all duration-300",s==="md"&&"md:block",s==="lg"&&"lg:block",s==="xl"&&"xl:block",s==="2xl"&&"2xl:block",e),...o,children:n})})]})});zt.displayName="ChatLayout.Aside";const Pt=i.forwardRef(({source:s,isSelected:e,className:n,...o},a)=>t.jsxs("button",{ref:a,type:"button",className:f("flex w-full text-left gap-2 items-start p-3 rounded-lg transition-colors cursor-pointer border border-transparent","hover:bg-accent-hover hover:border-border/50",e&&"bg-accent-hover border-border/50",n),onClick:()=>window.open(s.url,"_blank"),...o,children:[t.jsx("div",{className:"flex gap-2 items-center py-[2px] shrink-0",children:t.jsx("div",{className:"relative rounded-[3px] shrink-0 size-4 overflow-hidden bg-muted",children:s.favicon?t.jsx("img",{alt:s.sourceName,className:"size-full object-cover",src:s.favicon}):t.jsx("div",{className:"size-full bg-muted"})})}),t.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[t.jsxs("div",{className:"text-xs leading-normal text-foreground",children:[t.jsx("span",{className:"font-medium",children:s.sourceName}),t.jsxs("span",{className:"text-muted-foreground",children:[" · ",s.title]})]}),t.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground line-clamp-3",children:s.snippet})]})]}));Pt.displayName="SourceListItem";const oe=i.forwardRef(({todos:s,className:e,...n},o)=>t.jsx("div",{ref:o,className:f("space-y-2",e),...n,children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No todos yet"})}):s.map(a=>t.jsx("div",{className:"text-sm",children:a.text},a.id))}));oe.displayName="TodoTabContent";const re=i.forwardRef(({files:s=[],className:e,...n},o)=>t.jsx("div",{ref:o,className:f("space-y-2",e),...n,children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No files attached"})}):s.map(a=>t.jsx("div",{className:"text-sm",children:a},a))}));re.displayName="FilesTabContent";const ae=i.forwardRef(({sources:s=[],className:e,...n},o)=>t.jsx("div",{ref:o,className:f("space-y-2",e),...n,children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No sources available"})}):s.map(a=>t.jsx(Pt,{source:a},a.id))}));ae.displayName="SourcesTabContent";const _n=i.forwardRef(({data:s,className:e,...n},o)=>t.jsxs("div",{ref:o,className:f("space-y-4",e),...n,children:[t.jsx("h3",{className:"font-semibold text-lg",children:"Database"}),t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsx("p",{children:"Database viewer - panel automatically expanded to large size"}),t.jsxs("div",{className:"mt-4 p-4 border border-border rounded",children:[t.jsx("p",{children:"Your large data table would go here"}),s&&typeof s=="object"?t.jsx("pre",{className:"mt-2 text-xs overflow-auto",children:JSON.stringify(s,null,2)}):null]})]})]}));_n.displayName="DatabaseTabContent";const xe=hs,Q=i.forwardRef(({className:s,...e},n)=>t.jsx(Ie,{ref:n,className:f("inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground gap-1",s),...e}));Q.displayName=Ie.displayName;const G=i.forwardRef(({className:s,...e},n)=>t.jsx(Ee,{ref:n,className:f("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...e}));G.displayName=Ee.displayName;const D=i.forwardRef(({className:s,...e},n)=>t.jsx(Re,{ref:n,className:f("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...e}));D.displayName=Re.displayName;const Ft=i.forwardRef(({todo:s,className:e,...n},o)=>t.jsx("div",{ref:o,className:f("flex items-center gap-3 px-3 py-2 rounded-lg",e),...n,children:t.jsx("span",{className:f("flex-1 text-[var(--font-size)] font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"shimmer-animation"),children:s.text})}));Ft.displayName="TodoListItem";const Ot=i.forwardRef(({client:s,todos:e,className:n,...o},a)=>{const l=e||[];return t.jsx("div",{ref:a,className:f("space-y-2 max-h-64 overflow-y-auto",n),...o,children:l.length===0?t.jsx("p",{className:"text-sm text-foreground opacity-60 italic",children:"No tasks yet."}):l.map(u=>t.jsx(Ft,{todo:u},u.id))})});Ot.displayName="TodoList";const Ln=i.forwardRef(({client:s,todos:e,variant:n="animated",showIcons:o=!1,visibleTabs:a=["todo","files","database"],className:l,...u},m)=>{const p=e||[],[r,c]=i.useState(a[0]||"todo"),d=i.useRef(null),h=i.useRef(null);i.useEffect(()=>{const j=setTimeout(()=>{const w=d.current;if(r&&w){const v=h.current;if(v){const N=w.getBoundingClientRect(),U=v.getBoundingClientRect(),z=U.left-N.left,O=U.width,C=z/N.width*100,A=100-(z+O)/N.width*100;w.style.clipPath=`inset(0 ${A.toFixed(2)}% 0 ${C.toFixed(2)}% round 999px)`}}},0);return()=>clearTimeout(j)},[r]);const b=[{id:"todo",label:n==="pills"?"To-do":"To-Do List",icon:Ze},{id:"files",label:"Files",icon:et},{id:"database",label:"Database",icon:tt},{id:"sources",label:"Sources",icon:st}].filter(y=>a.includes(y.id));return t.jsx("div",{ref:m,className:f("select-none",l),...u,children:t.jsxs(xe,{value:r,onValueChange:c,className:"w-full",children:[n==="pills"?t.jsx(Q,{className:f("w-full justify-start bg-transparent p-0 h-auto","gap-1"),children:b.map(y=>{const j=y.icon;return t.jsxs(G,{value:y.id,className:f("gap-2 px-3 py-1.5 rounded-lg text-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[o&&j&&t.jsx(j,{className:"size-4"}),y.label]},y.id)})}):t.jsxs("div",{className:"relative mb-4 border-border",children:[t.jsx(Q,{className:"bg-transparent p-0 h-auto rounded-none w-full border-none",children:b.map(y=>t.jsx(G,{value:y.id,className:"px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:y.label},y.id))}),t.jsx("div",{ref:d,className:"absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none",style:{clipPath:"inset(0 100% 0 0% round 999px)",transition:"clip-path 0.25s ease-out"},children:t.jsx(Q,{className:"bg-secondary p-0 h-auto rounded-none w-full border-none",children:b.map(y=>t.jsx(G,{value:y.id,ref:r===y.id?h:null,className:"px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none",tabIndex:-1,children:y.label},y.id))})})]}),t.jsx(D,{value:"todo",className:n==="pills"?"mt-0":"",children:n==="pills"?t.jsx(oe,{todos:p}):t.jsx(Ot,{todos:p})}),t.jsx(D,{value:"files",className:n==="pills"?"mt-0":"",children:t.jsx(re,{})}),t.jsx(D,{value:"database",className:n==="pills"?"mt-0":"",children:t.jsx("div",{className:"text-sm text-foreground opacity-60 italic",children:"Database tab coming soon..."})}),t.jsx(D,{value:"sources",className:n==="pills"?"mt-0":"",children:t.jsx(ae,{})})]})})});Ln.displayName="ChatSecondaryPanel";const zn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("flex h-full flex-col",s),...n,children:e}));zn.displayName="ChatSidebar.Root";const Pn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("border-b border-border px-4 py-3",s),...n,children:e}));Pn.displayName="ChatSidebar.Header";const Fn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("flex-1 overflow-y-auto p-4",s),...n,children:e}));Fn.displayName="ChatSidebar.Content";const On=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:f("border-t border-border px-4 py-3",s),...n,children:e}));On.displayName="ChatSidebar.Footer";const Hn=i.forwardRef(({children:s,className:e,...n},o)=>{const[a,l]=i.useState(s),[u,m]=i.useState(!1),p=i.useRef(s),r=i.useRef(!0);return i.useEffect(()=>{if(r.current){r.current=!1,p.current=s;return}if(p.current===s)return;m(!0);const c=setTimeout(()=>{l(s),p.current=s,requestAnimationFrame(()=>{m(!1)})},150);return()=>{clearTimeout(c)}},[s]),t.jsx("span",{ref:o,className:f("text-sm text-foreground opacity-60 transition-opacity duration-300",u?"opacity-0":"opacity-60",e),...n,children:a})});Hn.displayName="ChatStatus";const $n=i.forwardRef(({autoScroll:s=!0,isStreaming:e=!1,scrollBehavior:n="smooth",scrollThreshold:o=100,showScrollButton:a=!0,scrollButton:l,className:u,children:m,...p},r)=>{const c=i.useRef(null),[d,h]=i.useState(!0),[g,b]=i.useState(!1),y=i.useRef(0);i.useImperativeHandle(r,()=>{if(!c.current)throw new Error("Container ref not initialized");return c.current});const j=i.useCallback(()=>{const v=c.current;if(!v)return;const{scrollTop:N,scrollHeight:U,clientHeight:z}=v,C=U-N-z<o;h(C),b(!C&&a),y.current=N},[o,a]),w=i.useCallback((v=n)=>{const N=c.current;N&&N.scrollTo({top:N.scrollHeight,behavior:v})},[n]);return i.useEffect(()=>{!s||!c.current||(e&&d?w("auto"):!e&&d&&w())},[s,e,d,w]),i.useEffect(()=>{const v=c.current;if(!v)return;const N=()=>{j()};return v.addEventListener("scroll",N,{passive:!0}),j(),()=>{v.removeEventListener("scroll",N)}},[j]),i.useEffect(()=>{const v=c.current;if(!v)return;const N=new ResizeObserver(()=>{d&&s&&w("auto")});return N.observe(v),()=>{N.disconnect()}},[d,s,w]),t.jsxs("div",{className:"relative flex-1",children:[t.jsx("div",{ref:c,className:f("h-full overflow-y-auto overflow-x-hidden","scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent",u),...p,children:t.jsx("div",{className:"flex flex-col gap-4 px-4 py-4",children:m})}),g&&t.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10",children:l||t.jsxs("button",{type:"button",onClick:()=>w(),className:"px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2","aria-label":"Scroll to bottom",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Down arrow",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),"Scroll to bottom"]})})]})});$n.displayName="Conversation";const Bn=gs,Ht=i.forwardRef(({className:s,...e},n)=>t.jsx(Me,{ref:n,className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...e}));Ht.displayName=Me.displayName;const Wn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Bn,{children:[t.jsx(Ht,{}),t.jsxs(Ue,{ref:o,className:f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[e,t.jsxs(xs,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(Is,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Wn.displayName=Ue.displayName;const Vn=i.forwardRef(({className:s,...e},n)=>t.jsx(Ae,{ref:n,className:f("text-lg font-semibold leading-none tracking-tight",s),...e}));Vn.displayName=Ae.displayName;const qn=i.forwardRef(({className:s,...e},n)=>t.jsx(De,{ref:n,className:f("text-sm text-muted-foreground",s),...e}));qn.displayName=De.displayName;const Qn=i.forwardRef(({className:s,inset:e,children:n,...o},a)=>t.jsxs(_e,{ref:a,className:f("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-muted data-[state=open]:bg-muted",e&&"pl-8",s),...o,children:[n,t.jsx(Ye,{className:"ml-auto h-4 w-4"})]}));Qn.displayName=_e.displayName;const Gn=i.forwardRef(({className:s,...e},n)=>t.jsx(Le,{ref:n,className:f("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 shadow-lg","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),...e}));Gn.displayName=Le.displayName;const Kn=i.forwardRef(({className:s,sideOffset:e=4,...n},o)=>t.jsx(bs,{children:t.jsx(ze,{ref:o,sideOffset:e,className:f("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 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),...n})}));Kn.displayName=ze.displayName;const Xn=i.forwardRef(({className:s,inset:e,...n},o)=>t.jsx(Pe,{ref:o,className:f("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",s),...n}));Xn.displayName=Pe.displayName;const Jn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Fe,{ref:o,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Oe,{children:t.jsx(nt,{className:"h-4 w-4"})})}),e]}));Jn.displayName=Fe.displayName;const Yn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(He,{ref:o,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Oe,{children:t.jsx(ot,{className:"h-2 w-2 fill-current"})})}),e]}));Yn.displayName=He.displayName;const Zn=i.forwardRef(({className:s,inset:e,...n},o)=>t.jsx($e,{ref:o,className:f("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",s),...n}));Zn.displayName=$e.displayName;const eo=i.forwardRef(({className:s,...e},n)=>t.jsx(Be,{ref:n,className:f("-mx-1 my-1 h-px bg-border",s),...e}));eo.displayName=Be.displayName;const to=W("flex h-10 w-full rounded-md border bg-input-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),so=i.forwardRef(({className:s,type:e,variant:n,...o},a)=>t.jsx("input",{type:e,className:f(to({variant:n,className:s})),ref:a,...o}));so.displayName="Input";const no=i.forwardRef(({className:s,...e},n)=>t.jsx(We,{ref:n,className:f("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...e}));no.displayName=We.displayName;const oo=W("flex animate-fadeIn",{variants:{role:{user:"max-w-[80%] self-end ml-auto mr-2",assistant:"self-start mr-auto",system:"self-start mr-auto max-w-full"},layout:{default:"",full:"max-w-full",compact:"max-w-[90%]"}},defaultVariants:{role:"assistant",layout:"default"}}),$t=i.forwardRef(({message:s,role:e,layout:n,className:o,children:a,messageId:l,autoScroll:u,isLastMessage:m=!1,...p},r)=>{const c=s?s.role:e||"assistant",d=s?s.id:l,h=i.useRef(null),[g,b]=i.useState(void 0);return i.useImperativeHandle(r,()=>h.current),i.useEffect(()=>{if(!m||c!=="assistant"){b(void 0);return}const y=()=>{const w=h.current;if(!w)return;let v=w.parentElement;for(;v&&!v.classList.contains("overflow-y-auto");)v=v.parentElement;if(!v)return;const N=w.previousElementSibling;if(!N||N.getAttribute("aria-label")!=="user message"){b(void 0);return}const U=v.clientHeight,z=N.offsetHeight,C=Math.max(0,U-z-32);b(C)};y();const j=new ResizeObserver(y);if(h.current){j.observe(h.current);let w=h.current.parentElement;for(;w&&!w.classList.contains("overflow-y-auto");)w=w.parentElement;w&&j.observe(w)}return()=>j.disconnect()},[m,c]),i.useEffect(()=>{if((u!==void 0?u:c==="user")&&h.current){const j=setTimeout(()=>{h.current?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},50);return()=>clearTimeout(j)}},[c,u]),t.jsx("article",{ref:h,"aria-label":`${c} message`,"data-message-id":d,className:f(oo({role:c,layout:n}),o),style:{minHeight:g!==void 0?`${g}px`:void 0},...p,children:a})});$t.displayName="Message";const ee=128e3,je={"claude-sonnet-4-5-20250929":2e5,"claude-sonnet-4-20250514":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-sonnet-20240620":2e5,"claude-3-opus-20240229":2e5,"claude-3-sonnet-20240229":2e5,"claude-3-haiku-20240307":2e5,"gpt-4-turbo":128e3,"gpt-4-turbo-preview":128e3,"gpt-4-0125-preview":128e3,"gpt-4-1106-preview":128e3,"gpt-4":8192,"gpt-4-32k":32768,"gpt-3.5-turbo":16385,"gpt-3.5-turbo-16k":16385,default:ee};function ro(s){if(!s)return ee;if(s in je)return je[s]??ee;const e=s.toLowerCase();return e.includes("claude")?2e5:e.includes("gpt-4-turbo")?128e3:e.includes("gpt-4-32k")?32768:e.includes("gpt-4")?8192:e.includes("gpt-3.5")?16385:ee}function ao(s,e){const n=ro(e);return s/n*100}function io(s,e,n=1){return`${ao(s,e).toFixed(n)}%`}const Ce=W("mb-3 rounded-lg bg-card border border-border transition-all",{variants:{variant:{default:"opacity-70",subtle:"opacity-50",prominent:"opacity-90 shadow-sm"}},defaultVariants:{variant:"default"}}),lo=W("w-4 h-4 text-foreground opacity-60 transition-transform duration-200",{variants:{expanded:{true:"rotate-180",false:""}},defaultVariants:{expanded:!1}}),Bt=i.forwardRef(({content:s,isStreaming:e=!1,mode:n="collapsible",defaultExpanded:o=!1,autoExpand:a=!1,autoCollapse:l=!0,autoCollapseDelay:u=2e3,label:m="Thinking",variant:p,className:r},c)=>{const[d,h]=i.useState(n==="inline"?!0:o),[g,b]=i.useState(!1);return i.useEffect(()=>{if(l&&!e&&s&&n==="collapsible"){const y=setTimeout(()=>{b(!0),h(!1)},u);return()=>clearTimeout(y)}},[e,s,l,u,n]),i.useEffect(()=>{a&&e&&n==="collapsible"&&!g&&h(!0)},[a,e,n,g]),!s&&!e?null:n==="inline"?t.jsxs("div",{ref:c,className:f(Ce({variant:p}),"p-3",r),children:[t.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",children:m}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse"})]}),t.jsxs("div",{className:"text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})]}):t.jsxs("div",{ref:c,className:f("mb-3",r),children:[t.jsxs("button",{type:"button",onClick:()=>{h(!d),b(!1)},className:"w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left","aria-expanded":d,"aria-label":`${d?"Collapse":"Expand"} reasoning`,children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0",children:m}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0"}),!d&&s&&t.jsxs("span",{className:"text-xs text-foreground opacity-50 truncate",children:[s.substring(0,60),s.length>60&&"..."]})]}),t.jsx(pe,{className:lo({expanded:d}),"aria-hidden":"true"})]}),d&&t.jsx("div",{className:f(Ce({variant:p}),"mt-2 p-3 animate-fadeIn"),children:t.jsxs("div",{className:"text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})})]})});Bt.displayName="Reasoning";const Wt=i.forwardRef(({content:s,isStreaming:e=!1,showEmpty:n=!0,emptyMessage:o="",className:a,...l},u)=>{if(!s&&e&&n)return t.jsx("div",{ref:u,className:f("opacity-70 italic text-sm",a),...l,children:o});if(!s)return null;const m={table:({node:p,...r})=>t.jsx("div",{className:"overflow-x-auto my-4",children:t.jsx("table",{className:"min-w-full border-collapse border border-border rounded-md",...r})}),thead:({node:p,...r})=>t.jsx("thead",{className:"bg-card border-b border-border",...r}),tbody:({node:p,...r})=>t.jsx("tbody",{...r}),tr:({node:p,...r})=>t.jsx("tr",{className:"border-b border-border hover:bg-card transition-colors",...r}),th:({node:p,...r})=>t.jsx("th",{className:"px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0",...r}),td:({node:p,...r})=>t.jsx("td",{className:"px-4 py-2 text-foreground border-r border-border last:border-r-0",...r}),input:({node:p,checked:r,...c})=>c.type==="checkbox"?t.jsx("input",{type:"checkbox",checked:r||!1,disabled:!0,readOnly:!0,className:"mr-2 w-4 h-4 accent-[primary] cursor-not-allowed",...c}):t.jsx("input",{...c}),code:({node:p,...r})=>r.className?.includes("language-")?t.jsx("code",{className:"block p-4 bg-card border border-border rounded-md overflow-x-auto text-sm font-mono text-foreground shadow-sm",...r}):t.jsx("code",{className:"px-1.5 py-0.5 bg-card border border-border rounded text-sm font-mono text-foreground",...r}),pre:({node:p,...r})=>t.jsx("pre",{className:"my-4 rounded-lg",...r}),h1:({node:p,...r})=>t.jsx("h1",{className:"text-2xl font-bold mt-6 mb-4 text-foreground border-b border-border pb-2",...r}),h2:({node:p,...r})=>t.jsx("h2",{className:"text-xl font-semibold mt-5 mb-3 text-foreground border-b border-border/50 pb-1.5",...r}),h3:({node:p,...r})=>t.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2 text-foreground",...r}),h4:({node:p,...r})=>t.jsx("h4",{className:"text-base font-semibold mt-3 mb-2 text-foreground",...r}),ul:({node:p,...r})=>{const c=p?.children?.some(d=>typeof d=="object"&&d!==null&&"type"in d&&d.type==="element"&&"tagName"in d&&d.tagName==="li"&&"children"in d&&Array.isArray(d.children)&&d.children.some(h=>typeof h=="object"&&h!==null&&"type"in h&&h.type==="element"&&"tagName"in h&&h.tagName==="input"&&"properties"in h&&typeof h.properties=="object"&&h.properties!==null&&"type"in h.properties&&h.properties.type==="checkbox"));return t.jsx("ul",{className:f("my-2 space-y-1 text-foreground",c?"list-none space-y-2":"list-disc list-inside"),...r})},ol:({node:p,...r})=>t.jsx("ol",{className:"list-decimal list-inside my-2 space-y-1 text-foreground",...r}),li:({node:p,...r})=>{const c=p?.children?.some(d=>typeof d=="object"&&d!==null&&"type"in d&&d.type==="element"&&"tagName"in d&&d.tagName==="input"&&"properties"in d&&typeof d.properties=="object"&&d.properties!==null&&"type"in d.properties&&d.properties.type==="checkbox");return t.jsx("li",{className:f("flex items-start",c?"gap-2":"ml-2"),...r})},a:({node:p,...r})=>t.jsx("a",{className:"text-primary hover:underline decoration-2 underline-offset-2 transition-all",target:"_blank",rel:"noopener noreferrer",...r}),p:({node:p,...r})=>t.jsx("p",{className:"my-2 text-foreground leading-relaxed",...r}),blockquote:({node:p,...r})=>t.jsx("blockquote",{className:"border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2 rounded-r-md shadow-sm",...r}),hr:({node:p,...r})=>t.jsx("hr",{className:"my-6 border-t border-border opacity-50",...r})};return t.jsxs("div",{ref:u,className:f("markdown-content prose prose-sm max-w-none dark:prose-invert",a),...l,children:[t.jsx(os,{remarkPlugins:[_s],components:m,children:s}),e&&s&&t.jsx("span",{className:"inline-block ml-1 animate-typing text-primary",children:"..."})]})});Wt.displayName="Response";const co={pending:"bg-transparent text-muted-foreground",in_progress:"bg-transparent text-muted-foreground",completed:"bg-transparent text-muted-foreground",failed:"bg-transparent text-muted-foreground"};function uo({toolCall:s}){const[e,n]=i.useState(!1);return t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("button",{type:"button",className:"flex items-center gap-1.5 cursor-pointer bg-transparent border-none p-0 text-left group w-fit",onClick:()=>n(!e),"aria-expanded":e,children:[t.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded ${co[s.status]}`,children:[t.jsx(Es,{className:"h-3 w-3"}),t.jsx("span",{children:s.title}),s.status==="completed"&&t.jsx("span",{children:"✓"})]}),t.jsx("span",{className:"text-muted-foreground text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:e?"▲":"▼"})]}),e&&t.jsxs("div",{className:"mt-2 space-y-3 text-sm border border-border rounded-md p-3 bg-card shadow-sm max-w-full",children:[s.locations&&s.locations.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Files"}),t.jsx("ul",{className:"space-y-1",children:s.locations.map(o=>t.jsxs("li",{className:"font-mono text-xs text-foreground bg-muted px-2 py-1 rounded",children:[o.path,o.line!==null&&o.line!==void 0&&`:${o.line}`]},`${o.path}:${o.line??""}`))})]}),s.rawInput&&Object.keys(s.rawInput).length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Input"}),t.jsx("div",{className:"bg-muted p-2 rounded border border-border",children:t.jsx(ye,{value:s.rawInput,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent"}})})]}),s.content&&s.content.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Output"}),t.jsx("div",{className:"space-y-2",children:s.content.map((o,a)=>{const l=()=>o.type==="diff"&&"path"in o?`diff-${o.path}-${a}`:o.type==="terminal"&&"terminalId"in o?`terminal-${o.terminalId}`:o.type==="text"&&"text"in o?`text-${o.text.substring(0,20)}-${a}`:o.type==="content"&&"content"in o?`content-${o.content.text?.substring(0,20)}-${a}`:`block-${a}`,u=(m,p)=>{try{const r=JSON.parse(m);if(typeof r=="object"&&r!==null)return t.jsx("div",{className:"bg-muted p-2 rounded border border-border",children:t.jsx(ye,{value:r,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent"}})},p)}catch{}return t.jsx("pre",{className:"bg-muted p-2.5 rounded border border-border text-xs overflow-x-auto font-mono text-foreground",children:m},p)};if(o.type==="content"&&"content"in o){const m=o.content;if(m.type==="text"&&m.text)return u(m.text,l())}return o.type==="text"&&"text"in o?u(o.text,l()):o.type==="diff"&&"path"in o&&"oldText"in o&&"newText"in o?t.jsxs("div",{className:"border rounded",children:[t.jsxs("div",{className:"bg-muted px-2 py-1 text-xs font-mono",children:[o.path,"line"in o&&o.line!==null&&o.line!==void 0&&`:${o.line}`]}),t.jsxs("div",{className:"p-2 font-mono text-xs",children:[t.jsxs("div",{className:"text-red-600",children:["- ",o.oldText]}),t.jsxs("div",{className:"text-green-600",children:["+ ",o.newText]})]})]},l()):o.type==="terminal"&&"terminalId"in o?t.jsxs("div",{className:"bg-black text-green-400 p-2 rounded text-xs font-mono",children:["Terminal: ",o.terminalId]},l()):null})})]}),s.error&&t.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded p-2.5 text-destructive",children:[t.jsx("div",{className:"text-xs font-semibold text-destructive uppercase tracking-wide mb-1.5",children:"Error"}),t.jsx("div",{className:"text-xs",children:s.error})]}),s.tokenUsage&&t.jsxs("div",{className:"bg-muted border border-border rounded p-2.5",children:[t.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"Token Usage"}),t.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs text-foreground",children:[s.tokenUsage.inputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-muted-foreground text-[10px] uppercase tracking-wide mb-0.5",children:"Input"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.inputTokens.toLocaleString()})]}),s.tokenUsage.outputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-muted-foreground text-[10px] uppercase tracking-wide mb-0.5",children:"Output"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.outputTokens.toLocaleString()})]}),s.tokenUsage.totalTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-muted-foreground text-[10px] uppercase tracking-wide mb-0.5",children:"Total"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.totalTokens.toLocaleString()})]})]})]}),s.startedAt&&t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Started: ",new Date(s.startedAt).toLocaleTimeString(),s.completedAt&&t.jsxs(t.Fragment,{children:[" ","| Completed:"," ",new Date(s.completedAt).toLocaleTimeString()," (",Math.round((s.completedAt-s.startedAt)/1e3),"s)"]})]})]})]})}const Z=["Thinking","Pensando","Pensant","Denkend","Pensando","考えている","생각 중","思考中","Размышляя","Düşünüyor","Myślący","Tänkande","Pensando","Ajatellen","Σκεπτόμενος","חושב","सोच रहा है","Berpikir"],Se=["...","·..",".·.","..·",".·.","·.."];function po({startTime:s}){const[e,n]=i.useState(0),[o,a]=i.useState(()=>Z[Math.floor(Math.random()*Z.length)]),[l,u]=i.useState(0);i.useEffect(()=>{const r=setInterval(()=>{const d=Date.now()-s;n(d)},100);return()=>clearInterval(r)},[s]),i.useEffect(()=>{const r=setInterval(()=>{const c=Math.floor(Math.random()*Z.length);a(Z[c])},1500);return()=>clearInterval(r)},[]),i.useEffect(()=>{const r=setInterval(()=>{u(c=>(c+1)%Se.length)},100);return()=>clearInterval(r)},[]);const m=(e/1e3).toFixed(1),p=Se[l];return t.jsxs("span",{className:"text-muted-foreground text-sm",children:[o,p," ",m,"s"]})}const mo=W("w-full px-4 py-3 rounded-xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors",{variants:{role:{user:"bg-primary text-primary-foreground shadow-sm",assistant:"text-foreground",system:"bg-card border border-border text-foreground opacity-80 text-sm"},variant:{default:"",outline:"border border-border",ghost:"bg-transparent"}},defaultVariants:{role:"assistant",variant:"default"}}),Vt=i.forwardRef(({role:s,variant:e,isStreaming:n,message:o,thinkingDisplayStyle:a="collapsible",className:l,children:u,...m},p)=>{const r=S(y=>y.streamingStartTime),c=S(y=>y.currentModel),d=o&&!u,h=d?o.role:s||"assistant",g=d?o.isStreaming:n;let b=u;if(d){const y=o.metadata?.thinking,j=!!y,w=o.isStreaming&&!o.content&&o.role==="assistant";b=t.jsxs(t.Fragment,{children:[o.role==="assistant"&&j&&t.jsx(Bt,{content:y,isStreaming:o.isStreaming,mode:a,autoCollapse:!0}),w&&r&&t.jsxs("div",{className:"flex items-center gap-2 opacity-50",children:[t.jsx(rt,{className:"size-4 animate-spin text-muted-foreground"}),t.jsx(po,{startTime:r})]}),o.role==="assistant"&&o.toolCalls&&o.toolCalls.length>0&&t.jsx("div",{className:"flex flex-col gap-2 mb-3",children:o.toolCalls.map(v=>t.jsx(uo,{toolCall:v},v.id))}),o.role==="user"?t.jsx("div",{className:"whitespace-pre-wrap",children:o.content}):t.jsx(Wt,{content:o.content,isStreaming:o.isStreaming,showEmpty:!1}),o.role==="assistant"&&o.tokenUsage&&t.jsx("div",{className:"mt-3 pt-2 border-t border-border/30 text-xs text-muted-foreground/60",children:t.jsxs("span",{children:["Context:"," ",io(o.tokenUsage.totalTokens??0,c??void 0)," ","(",(o.tokenUsage.totalTokens??0).toLocaleString()," ","tokens)"]})})]})}return t.jsx("div",{ref:p,className:f(mo({role:h,variant:e}),g&&"animate-pulse-subtle",l),...m,children:b})});Vt.displayName="MessageContent";const be=i.forwardRef(({showIcons:s=!0,visibleTabs:e=["todo","files"],variant:n="default",className:o,...a},l)=>{const m=[{id:"todo",label:"To-do",icon:Ze},{id:"files",label:"Files",icon:et},{id:"database",label:"Database",icon:tt},{id:"sources",label:"Sources",icon:st}].filter(r=>e.includes(r.id)),p=n==="compact"?"gap-[4px]":"gap-3";return t.jsx(Q,{ref:l,className:f("w-full justify-start bg-transparent p-0 h-auto",p,o),...a,children:m.map(r=>{const c=r.icon;return t.jsxs(G,{value:r.id,className:f("gap-2 px-3 py-1.5 rounded-lg text-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[s&&c&&t.jsx(c,{className:"size-4"}),r.label]},r.id)})})});be.displayName="PanelTabsHeader";const fo=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Ve,{ref:o,className:f("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...n,children:[e,t.jsx(ys,{asChild:!0,children:t.jsx(Rs,{className:"h-4 w-4 opacity-50"})})]}));fo.displayName=Ve.displayName;const qt=i.forwardRef(({className:s,...e},n)=>t.jsx(qe,{ref:n,className:f("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(me,{className:"h-4 w-4"})}));qt.displayName=qe.displayName;const Qt=i.forwardRef(({className:s,...e},n)=>t.jsx(Qe,{ref:n,className:f("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(pe,{className:"h-4 w-4"})}));Qt.displayName=Qe.displayName;const ho=i.forwardRef(({className:s,children:e,position:n="popper",...o},a)=>t.jsx(ws,{children:t.jsxs(Ge,{ref:a,className:f("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...o,children:[t.jsx(qt,{}),t.jsx(vs,{className:f("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),t.jsx(Qt,{})]})}));ho.displayName=Ge.displayName;const go=i.forwardRef(({className:s,...e},n)=>t.jsx(Ke,{ref:n,className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...e}));go.displayName=Ke.displayName;const xo=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Xe,{ref:o,className:f("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ns,{children:t.jsx(nt,{className:"h-4 w-4"})})}),t.jsx(js,{children:e})]}));xo.displayName=Xe.displayName;const bo=i.forwardRef(({className:s,...e},n)=>t.jsx(Je,{ref:n,className:f("-mx-1 my-1 h-px bg-muted",s),...e}));bo.displayName=Je.displayName;const Gt=i.forwardRef(({task:s,collapsible:e=!0,defaultExpanded:n=!1,onTaskClick:o,className:a,...l},u)=>{const[m,p]=i.useState(n),r=!!(s.details||s.files&&s.files.length>0),c={pending:ot,in_progress:rt,completed:Ms}[s.status],d=()=>{switch(s.status){case"completed":return"text-green-500";case"in_progress":return"text-primary";default:return"text-foreground opacity-40"}},h=()=>{r&&e&&p(!m),o?.(s)};return t.jsxs("div",{ref:u,className:f("rounded-lg border border-border bg-card transition-all","hover:shadow-sm hover:border-border/80",a),...l,children:[t.jsxs("button",{type:"button",onClick:h,className:f("w-full flex items-center gap-3 px-3 py-2.5 text-left",r&&e&&"cursor-pointer"),disabled:!r&&!e,children:[t.jsx(c,{className:f("w-4 h-4 shrink-0",d(),s.status==="in_progress"&&"animate-spin")}),t.jsx("span",{className:f("flex-1 text-sm font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"font-medium"),children:s.text}),r&&e&&t.jsx(pe,{className:f("w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0",m&&"rotate-180"),"aria-hidden":"true"})]}),r&&m&&t.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn",children:[s.details&&t.jsx("p",{className:"text-sm text-foreground opacity-80 leading-relaxed mb-2",children:s.details}),s.files&&s.files.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",children:"Files:"}),t.jsx("div",{className:"space-y-1",children:s.files.map(g=>t.jsx("div",{className:"text-xs font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50",children:g},g))})]})]})]})});Gt.displayName="Task";const yo=i.forwardRef(({tasks:s,collapsible:e=!0,onTaskClick:n,emptyMessage:o="No tasks yet.",className:a,...l},u)=>t.jsx("div",{ref:u,className:f("space-y-2 max-h-96 overflow-y-auto",a),...l,children:s.length===0?t.jsx("p",{className:"text-sm text-foreground opacity-60 italic py-4 text-center",children:o}):s.map(m=>t.jsx(Gt,{task:m,collapsible:e,...n?{onTaskClick:n}:{}},m.id))}));yo.displayName="TaskList";const wo=W("flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),vo=i.forwardRef(({className:s,autoResize:e=!1,maxHeight:n=200,variant:o,...a},l)=>{const u=i.useRef(null),m=i.useCallback(r=>{u.current=r,typeof l=="function"?l(r):l&&(l.current=r)},[l]),p=i.useCallback(()=>{const r=u.current;if(!r||!e)return;r.style.height="auto";const c=Math.min(r.scrollHeight,n);r.style.height=`${c}px`,r.scrollHeight>n?r.style.overflowY="auto":r.style.overflowY="hidden"},[e,n]);return i.useEffect(()=>{p()},[p]),t.jsx("textarea",{className:f(wo({variant:o}),e&&"overflow-y-hidden",s),ref:m,...a})});vo.displayName="Textarea";const B=$("gui");function No({agentName:s}){const{isExpanded:e,setIsExpanded:n}=he();return t.jsxs("div",{className:"flex lg:hidden items-center gap-2 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx("h1",{className:"text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-foreground",children:s}),t.jsx("div",{className:"flex items-center justify-center shrink-0",children:t.jsx(me,{className:"size-4 rotate-180 text-muted-foreground"})})]}),t.jsx("button",{type:"button",className:"flex items-center justify-center shrink-0 cursor-pointer","aria-label":"Toggle menu",onClick:()=>n(!e),children:t.jsx(at,{className:"size-4 text-muted-foreground"})})]})}function jo({agentName:s,todos:e,sources:n,showHeader:o}){const{panelSize:a,setPanelSize:l}=ge();return t.jsxs(bt,{className:f("border-b border-border bg-card relative lg:p-0","[border-bottom-width:0.5px]"),children:[t.jsxs("div",{className:"hidden lg:flex items-center gap-2 w-full h-16 py-5 pl-6 pr-4",children:[o&&t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx("h1",{className:"text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-foreground",children:s}),t.jsx("div",{className:"flex items-center justify-center shrink-0",children:t.jsx(me,{className:"size-4 rotate-180 text-muted-foreground"})})]}),!o&&t.jsx("div",{className:"flex-1"}),t.jsx("button",{type:"button",className:"flex items-center justify-center shrink-0 cursor-pointer","aria-label":"Toggle sidebar",onClick:()=>{l(a==="hidden"?"small":"hidden")},children:t.jsx(at,{className:"size-4 text-muted-foreground"})})]}),t.jsx(No,{agentName:s}),t.jsx(yt,{className:f("pt-6 pb-8 px-6","border-b border-border bg-card","shadow-[0_4px_16px_0_rgba(0,0,0,0.04)]","[border-bottom-width:0.5px]"),children:t.jsxs(xe,{defaultValue:"todo",className:"w-full",children:[t.jsx(be,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"default"}),t.jsx(D,{value:"todo",className:"mt-4",children:t.jsx(oe,{todos:e})}),t.jsx(D,{value:"files",className:"mt-4",children:t.jsx(re,{})}),t.jsx(D,{value:"sources",className:"mt-4",children:t.jsx(ae,{sources:n})})]})})]})}function Co({client:s}){const{connectionStatus:e,connect:n,sessionId:o}=qs(s),{messages:a}=ut(s);Qs(s);const l=S(g=>g.error),[u,m]=i.useState("Agent"),[p,r]=i.useState(typeof window<"u"?window.innerWidth>=1024:!0);i.useEffect(()=>{B.debug("Connection status changed",{status:e}),e==="error"&&l&&B.error("Connection error occurred",{error:l})},[e,l]),i.useEffect(()=>{if(s&&o){const g=s.getCurrentSession();g?.metadata?.agentName&&m(g.metadata.agentName)}},[s,o]),i.useEffect(()=>{const g=window.matchMedia("(min-width: 1024px)"),b=y=>{r(y.matches)};return r(g.matches),g.addEventListener("change",b),()=>{g.removeEventListener("change",b)}},[]);const c=[],d=[{id:"1",title:"Boeing Scores Early Wins at Dubai Airshow",sourceName:"Reuters",url:"https://www.reuters.com/markets/companies/BA.N",snippet:"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"2",title:"Boeing's Sustainable Aviation Goals Take Flight",sourceName:"Forbes",url:"https://www.forbes.com",snippet:"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",favicon:"https://www.google.com/s2/favicons?domain=forbes.com&sz=32"},{id:"3",title:"Boeing Faces Increased Competition in Global Aviation Market",sourceName:"Reuters",url:"https://www.reuters.com",snippet:"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"4",title:"Boeing's Starliner Successfully Completes Orbital Test Flight",sourceName:"The Verge",url:"https://www.theverge.com",snippet:"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",favicon:"https://www.google.com/s2/favicons?domain=theverge.com&sz=32"}],h=[{id:"model-sonnet",label:"Use Sonnet 4.5",description:"Switch to Claude Sonnet 4.5 model",icon:t.jsx(we,{className:"h-4 w-4"}),category:"model",onSelect:()=>{B.info("User selected Sonnet 4.5 model")}},{id:"model-opus",label:"Use Opus",description:"Switch to Claude Opus model",icon:t.jsx(we,{className:"h-4 w-4"}),category:"model",onSelect:()=>{B.info("User selected Opus model")}},{id:"settings",label:"Open Settings",description:"Configure chat preferences",icon:t.jsx(As,{className:"h-4 w-4"}),category:"action",onSelect:()=>{B.info("User opened settings")}},{id:"code-mode",label:"Code Mode",description:"Enable code-focused responses",icon:t.jsx(Ds,{className:"h-4 w-4"}),category:"mode",onSelect:()=>{B.info("User enabled code mode")}}];return t.jsxs(Ut,{defaultPanelSize:"hidden",defaultActiveTab:"todo",children:[t.jsxs(At,{children:[t.jsx(jo,{agentName:u,todos:c,sources:d,showHeader:a.length>0}),e==="error"&&l&&t.jsx("div",{className:"border-b border-destructive/20 bg-destructive/10 px-6 py-4",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"mb-1 text-sm font-semibold text-destructive",children:"Connection Error"}),t.jsx("p",{className:"whitespace-pre-line text-sm text-foreground",children:l})]}),t.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-destructive px-4 py-2 text-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive-hover",children:"Retry"})]})}),t.jsxs(Dt,{children:[t.jsx(_t,{className:a.length>0?"pt-4":"",children:a.length===0?t.jsx("div",{className:"flex flex-1 items-center px-4",children:t.jsx(gt,{title:u,description:"This agent can help you with your tasks. Start a conversation by typing a message below.",suggestedPrompts:["Help me debug this code","Explain how this works","Create a new feature","Review my changes"],onPromptClick:g=>{B.info("Prompt clicked",{prompt:g})}})}):t.jsx("div",{className:"flex flex-col gap-4 px-4",children:a.map((g,b)=>t.jsx($t,{message:g,isLastMessage:b===a.length-1,children:t.jsx(Vt,{message:g,thinkingDisplayStyle:"collapsible"})},g.id))})}),t.jsx(Lt,{children:t.jsxs(Nt,{client:s,children:[t.jsx(Et,{commands:h}),t.jsx(jt,{placeholder:"Type a message or / for commands...",autoFocus:!0}),t.jsxs(St,{children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Tt,{}),t.jsx(kt,{})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(It,{}),t.jsx(Ct,{children:t.jsx(Us,{className:"size-4"})})]})]})]})})]})]}),p&&t.jsx(zt,{breakpoint:"lg",children:t.jsxs(xe,{defaultValue:"todo",className:"flex flex-col h-full",children:[t.jsx("div",{className:f("border-b border-border bg-card","px-6 py-2 h-16","flex items-center","[border-bottom-width:0.5px]"),children:t.jsx(be,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"compact"})}),t.jsx(D,{value:"todo",className:"flex-1 p-4 mt-0",children:t.jsx(oe,{todos:c})}),t.jsx(D,{value:"files",className:"flex-1 p-4 mt-0",children:t.jsx(re,{})}),t.jsx(D,{value:"sources",className:"flex-1 p-4 mt-0",children:t.jsx(ae,{sources:d})})]})})]})}function So(){return"http://localhost:3100"}const Te={agentServerUrl:So()},q=$("gui");function To(){const[s,e]=i.useState(null),[n,o]=i.useState(null);return i.useEffect(()=>{try{q.info("Initializing ACP client",{serverUrl:Te.agentServerUrl});const a=new Zs({type:"http",options:{baseUrl:Te.agentServerUrl}});return e(a),q.info("ACP client initialized successfully"),()=>{q.debug("Disconnecting ACP client"),a.disconnect().catch(l=>{q.error("Failed to disconnect ACP client",{error:l instanceof Error?l.message:String(l)})})}}catch(a){const l=a instanceof Error?a.message:"Failed to initialize ACP client";o(l),q.error("Failed to initialize ACP client",{error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0});return}},[]),n?t.jsx("div",{className:"flex items-center justify-center h-screen bg-background",children:t.jsxs("div",{className:"text-center p-8 max-w-md",children:[t.jsx("h1",{className:"text-2xl font-bold text-destructive mb-4",children:"Initialization Error"}),t.jsx("p",{className:"text-foreground mb-4",children:n}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to initialize the ACP client. Check the console for details."})]})}):t.jsx(Co,{client:s})}const Kt=document.getElementById("root");if(!Kt)throw new Error("Root element not found");rs.createRoot(Kt).render(t.jsx(as.StrictMode,{children:t.jsx(To,{})}));
|
package/dist/index.html
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Agent Chat</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-C98yvCE3.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/vendor-BxtqxsLB.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/react-DWDN8s0r.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/acp-sdk-BiGbXeF1.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/radix-C1pEulHa.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/icons-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-B97fCJAR.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/markdown-DP5OEpQP.js">
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BYcgnHYe.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
package/index.html
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Agent Chat</title>
|
|
7
|
+
<script type="module">
|
|
8
|
+
if (import.meta.env.DEV) {
|
|
9
|
+
import("react-grab");
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
7
12
|
</head>
|
|
8
13
|
<body>
|
|
9
14
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/gui-template",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -11,10 +11,7 @@
|
|
|
11
11
|
"public",
|
|
12
12
|
"README.md"
|
|
13
13
|
],
|
|
14
|
-
"repository":
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/federicoweber/agent_hub.git"
|
|
17
|
-
},
|
|
14
|
+
"repository": "github:townco/town",
|
|
18
15
|
"scripts": {
|
|
19
16
|
"dev": "vite",
|
|
20
17
|
"build": "vite build",
|
|
@@ -22,14 +19,16 @@
|
|
|
22
19
|
"check": "tsc --noEmit"
|
|
23
20
|
},
|
|
24
21
|
"dependencies": {
|
|
25
|
-
"@townco/
|
|
22
|
+
"@townco/core": "0.0.2",
|
|
23
|
+
"@townco/ui": "0.1.24",
|
|
26
24
|
"lucide-react": "^0.552.0",
|
|
27
25
|
"react": "^19.2.0",
|
|
28
|
-
"react-dom": "^19.2.0"
|
|
26
|
+
"react-dom": "^19.2.0",
|
|
27
|
+
"react-grab": "^0.0.39"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
30
|
"@tailwindcss/postcss": "^4.1.17",
|
|
32
|
-
"@townco/tsconfig": "0.1.
|
|
31
|
+
"@townco/tsconfig": "0.1.21",
|
|
33
32
|
"@types/react": "^19.2.2",
|
|
34
33
|
"@types/react-dom": "^19.2.2",
|
|
35
34
|
"@vitejs/plugin-react": "^5.1.0",
|
package/src/App.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { createLogger } from "@townco/core";
|
|
1
2
|
import { AcpClient } from "@townco/ui";
|
|
2
|
-
import { createLogger } from "@townco/ui/core";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { ChatView } from "./ChatView.js";
|
|
5
5
|
import { config } from "./config.js";
|
|
@@ -50,13 +50,13 @@ function App() {
|
|
|
50
50
|
|
|
51
51
|
if (error) {
|
|
52
52
|
return (
|
|
53
|
-
<div className="flex items-center justify-center h-screen bg-
|
|
53
|
+
<div className="flex items-center justify-center h-screen bg-background">
|
|
54
54
|
<div className="text-center p-8 max-w-md">
|
|
55
|
-
<h1 className="text-2xl font-bold text-
|
|
55
|
+
<h1 className="text-2xl font-bold text-destructive mb-4">
|
|
56
56
|
Initialization Error
|
|
57
57
|
</h1>
|
|
58
|
-
<p className="text-
|
|
59
|
-
<p className="text-sm text-
|
|
58
|
+
<p className="text-foreground mb-4">{error}</p>
|
|
59
|
+
<p className="text-sm text-muted-foreground">
|
|
60
60
|
Failed to initialize the ACP client. Check the console for details.
|
|
61
61
|
</p>
|
|
62
62
|
</div>
|
package/src/ChatView.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { createLogger } from "@townco/core";
|
|
1
2
|
import type { AcpClient } from "@townco/ui";
|
|
2
3
|
import {
|
|
3
|
-
createLogger,
|
|
4
4
|
useChatMessages,
|
|
5
5
|
useChatSession,
|
|
6
6
|
useChatStore,
|
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
Message,
|
|
25
25
|
MessageContent,
|
|
26
26
|
PanelTabsHeader,
|
|
27
|
+
type SourceItem,
|
|
28
|
+
SourcesTabContent,
|
|
27
29
|
Tabs,
|
|
28
30
|
TabsContent,
|
|
29
31
|
type TodoItem,
|
|
@@ -75,10 +77,12 @@ function MobileHeader({ agentName }: { agentName: string }) {
|
|
|
75
77
|
function AppChatHeader({
|
|
76
78
|
agentName,
|
|
77
79
|
todos,
|
|
80
|
+
sources,
|
|
78
81
|
showHeader,
|
|
79
82
|
}: {
|
|
80
83
|
agentName: string;
|
|
81
84
|
todos: TodoItem[];
|
|
85
|
+
sources: SourceItem[];
|
|
82
86
|
showHeader: boolean;
|
|
83
87
|
}) {
|
|
84
88
|
const { panelSize, setPanelSize } = ChatLayout.useChatLayoutContext();
|
|
@@ -130,7 +134,7 @@ function AppChatHeader({
|
|
|
130
134
|
<Tabs defaultValue="todo" className="w-full">
|
|
131
135
|
<PanelTabsHeader
|
|
132
136
|
showIcons={true}
|
|
133
|
-
visibleTabs={["todo", "files"]}
|
|
137
|
+
visibleTabs={["todo", "files", "sources"]}
|
|
134
138
|
variant="default"
|
|
135
139
|
/>
|
|
136
140
|
<TabsContent value="todo" className="mt-4">
|
|
@@ -139,6 +143,9 @@ function AppChatHeader({
|
|
|
139
143
|
<TabsContent value="files" className="mt-4">
|
|
140
144
|
<FilesTabContent />
|
|
141
145
|
</TabsContent>
|
|
146
|
+
<TabsContent value="sources" className="mt-4">
|
|
147
|
+
<SourcesTabContent sources={sources} />
|
|
148
|
+
</TabsContent>
|
|
142
149
|
</Tabs>
|
|
143
150
|
</ChatHeader.ExpandablePanel>
|
|
144
151
|
</ChatHeader.Root>
|
|
@@ -146,7 +153,7 @@ function AppChatHeader({
|
|
|
146
153
|
}
|
|
147
154
|
|
|
148
155
|
export function ChatView({ client }: ChatViewProps) {
|
|
149
|
-
// Use shared hooks from @
|
|
156
|
+
// Use shared hooks from @townco/ui/core
|
|
150
157
|
const { connectionStatus, connect, sessionId } = useChatSession(client);
|
|
151
158
|
const { messages } = useChatMessages(client);
|
|
152
159
|
useToolCalls(client); // Still need to subscribe to tool call events
|
|
@@ -197,6 +204,46 @@ export function ChatView({ client }: ChatViewProps) {
|
|
|
197
204
|
// TODO: Replace with useChatStore((state) => state.todos) when todos are added to the store
|
|
198
205
|
const todos: TodoItem[] = [];
|
|
199
206
|
|
|
207
|
+
// Dummy sources data based on Figma design
|
|
208
|
+
const sources: SourceItem[] = [
|
|
209
|
+
{
|
|
210
|
+
id: "1",
|
|
211
|
+
title: "Boeing Scores Early Wins at Dubai Airshow",
|
|
212
|
+
sourceName: "Reuters",
|
|
213
|
+
url: "https://www.reuters.com/markets/companies/BA.N",
|
|
214
|
+
snippet:
|
|
215
|
+
"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",
|
|
216
|
+
favicon: "https://www.google.com/s2/favicons?domain=reuters.com&sz=32",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: "2",
|
|
220
|
+
title: "Boeing's Sustainable Aviation Goals Take Flight",
|
|
221
|
+
sourceName: "Forbes",
|
|
222
|
+
url: "https://www.forbes.com",
|
|
223
|
+
snippet:
|
|
224
|
+
"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",
|
|
225
|
+
favicon: "https://www.google.com/s2/favicons?domain=forbes.com&sz=32",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: "3",
|
|
229
|
+
title: "Boeing Faces Increased Competition in Global Aviation Market",
|
|
230
|
+
sourceName: "Reuters",
|
|
231
|
+
url: "https://www.reuters.com",
|
|
232
|
+
snippet:
|
|
233
|
+
"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",
|
|
234
|
+
favicon: "https://www.google.com/s2/favicons?domain=reuters.com&sz=32",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: "4",
|
|
238
|
+
title: "Boeing's Starliner Successfully Completes Orbital Test Flight",
|
|
239
|
+
sourceName: "The Verge",
|
|
240
|
+
url: "https://www.theverge.com",
|
|
241
|
+
snippet:
|
|
242
|
+
"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",
|
|
243
|
+
favicon: "https://www.google.com/s2/favicons?domain=theverge.com&sz=32",
|
|
244
|
+
},
|
|
245
|
+
];
|
|
246
|
+
|
|
200
247
|
// Command menu items for chat input
|
|
201
248
|
const commandMenuItems: CommandMenuItem[] = [
|
|
202
249
|
{
|
|
@@ -249,15 +296,16 @@ export function ChatView({ client }: ChatViewProps) {
|
|
|
249
296
|
<AppChatHeader
|
|
250
297
|
agentName={agentName}
|
|
251
298
|
todos={todos}
|
|
299
|
+
sources={sources}
|
|
252
300
|
showHeader={messages.length > 0}
|
|
253
301
|
/>
|
|
254
302
|
|
|
255
303
|
{/* Connection Error Banner */}
|
|
256
304
|
{connectionStatus === "error" && error && (
|
|
257
|
-
<div className="border-b border-
|
|
305
|
+
<div className="border-b border-destructive/20 bg-destructive/10 px-6 py-4">
|
|
258
306
|
<div className="flex items-start justify-between gap-4">
|
|
259
307
|
<div className="flex-1">
|
|
260
|
-
<h3 className="mb-1 text-sm font-semibold text-
|
|
308
|
+
<h3 className="mb-1 text-sm font-semibold text-destructive">
|
|
261
309
|
Connection Error
|
|
262
310
|
</h3>
|
|
263
311
|
<p className="whitespace-pre-line text-sm text-foreground">
|
|
@@ -267,7 +315,7 @@ export function ChatView({ client }: ChatViewProps) {
|
|
|
267
315
|
<button
|
|
268
316
|
type="button"
|
|
269
317
|
onClick={connect}
|
|
270
|
-
className="rounded-lg bg-
|
|
318
|
+
className="rounded-lg bg-destructive px-4 py-2 text-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive-hover"
|
|
271
319
|
>
|
|
272
320
|
Retry
|
|
273
321
|
</button>
|
|
@@ -354,7 +402,7 @@ export function ChatView({ client }: ChatViewProps) {
|
|
|
354
402
|
>
|
|
355
403
|
<PanelTabsHeader
|
|
356
404
|
showIcons={true}
|
|
357
|
-
visibleTabs={["todo", "files"]}
|
|
405
|
+
visibleTabs={["todo", "files", "sources"]}
|
|
358
406
|
variant="compact"
|
|
359
407
|
/>
|
|
360
408
|
</div>
|
|
@@ -366,6 +414,9 @@ export function ChatView({ client }: ChatViewProps) {
|
|
|
366
414
|
<TabsContent value="files" className="flex-1 p-4 mt-0">
|
|
367
415
|
<FilesTabContent />
|
|
368
416
|
</TabsContent>
|
|
417
|
+
<TabsContent value="sources" className="flex-1 p-4 mt-0">
|
|
418
|
+
<SourcesTabContent sources={sources} />
|
|
419
|
+
</TabsContent>
|
|
369
420
|
</Tabs>
|
|
370
421
|
</ChatLayout.Aside>
|
|
371
422
|
)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n}from"./react-DWDN8s0r.js";const _=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,c)=>c?c.toUpperCase():a.toLowerCase()),h=o=>{const t=m(o);return t.charAt(0).toUpperCase()+t.slice(1)},i=(...o)=>o.filter((t,a,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===a).join(" ").trim(),w=o=>{for(const t in o)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var g={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const u=n.forwardRef(({color:o="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:r="",children:s,iconNode:l,...d},p)=>n.createElement("svg",{ref:p,...g,width:t,height:t,stroke:o,strokeWidth:c?Number(a)*24/Number(t):a,className:i("lucide",r),...!s&&!w(d)&&{"aria-hidden":"true"},...d},[...l.map(([y,k])=>n.createElement(y,k)),...Array.isArray(s)?s:[s]]));const e=(o,t)=>{const a=n.forwardRef(({className:c,...r},s)=>n.createElement(u,{ref:s,iconNode:t,className:i(`lucide-${_(h(o))}`,`lucide-${o}`,c),...r}));return a.displayName=h(o),a};const v=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],F=e("arrow-down",v);const f=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],I=e("arrow-up",f);const x=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Z=e("check",x);const C=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],K=e("chevron-down",C);const $=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],O=e("chevron-right",$);const M=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],T=e("chevron-up",M);const N=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],X=e("chevrons-up-down",N);const b=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],G=e("circle-check",b);const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],J=e("circle",A);const j=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Q=e("code",j);const z=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Y=e("database",z);const q=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],e1=e("file-text",q);const L=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],t1=e("loader-circle",L);const S=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],o1=e("mic",S);const V=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],a1=e("panel-right",V);const D=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],c1=e("paperclip",D);const P=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],s1=e("settings",P);const U=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],n1=e("sparkles",U);const E=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],r1=e("square-check-big",E);const H=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],d1=e("square-slash",H);const R=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],h1=e("wrench",R);const W=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],i1=e("x",W);export{F as A,O as C,Y as D,e1 as F,t1 as L,o1 as M,c1 as P,d1 as S,h1 as W,i1 as X,r1 as a,Z as b,J as c,K as d,X as e,T as f,G as g,I as h,a1 as i,n1 as j,s1 as k,Q as l};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{r as i,j as t,P as Yt,e as Zt,f as es,M as ts,h as ss,a as ns}from"./react-DWDN8s0r.js";import{L as H,M as T,N as I,O as h,P as Te,Q as M,R as E,S as D,T as _,U as os,W as G,X as te,Y as rs,Z as as,$ as is,a0 as ls,a1 as W,a2 as cs,a3 as be}from"./vendor-BxtqxsLB.js";import{P as ds,a as us}from"./acp-sdk-BiGbXeF1.js";import{S as X,L as ke,T as Ie,C as Ee,R as ps,O as Re,P as fs,a as Me,b as ms,c as Ue,D as Ae,d as De,e as _e,f as gs,g as Le,I as Pe,h as ze,i as Oe,j as Fe,k as He,l as $e,m as Be,n as We,o as hs,p as Ve,q as qe,r as xs,s as Qe,V as bs,t as Ke,u as Ge,v as ys,w as ws,x as Xe}from"./radix-C1pEulHa.js";import{C as Je,S as vs,P as Ns,M as js,A as Cs,a as Ye,F as Ze,D as et,X as Ss,b as tt,c as st,d as ue,W as Ts,L as nt,e as ks,f as pe,g as Is,h as Es,i as ot,j as ye,k as Rs,l as Ms}from"./icons-B7gv8oe5.js";import{r as Us}from"./markdown-DP5OEpQP.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();const le=typeof process<"u"&&process.versions?.node;let As,Ds=0;const _s=new Set;function Ls(s){for(const e of _s)e(s)}const we={trace:0,debug:1,info:2,warn:3,error:4,fatal:5};class Ps{service;minLevel;logFilePath;logsDir;writeQueue=[];isWriting=!1;constructor(e,n="debug"){this.service=e,this.minLevel=n,typeof process<"u"&&(this.minLevel="info")}setupFileLogging(){}async writeToFile(e){if(!(!this.logFilePath||!le)&&(this.writeQueue.push(e),!this.isWriting)){for(this.isWriting=!0;this.writeQueue.length>0;){const o=`${this.writeQueue.splice(0,this.writeQueue.length).join(`
|
|
2
|
-
`)}
|
|
3
|
-
`;try{await require("node:fs").promises.appendFile(this.logFilePath,o,"utf-8")}catch{}}this.isWriting=!1}}shouldLog(e){return we[e]>=we[this.minLevel]}log(e,n,o){if(!this.shouldLog(e))return;const a={id:`log_${++Ds}`,timestamp:new Date().toISOString(),level:e,service:this.service,message:n,...o&&{metadata:o}};if(Ls(a),le&&this.logFilePath,le&&this.logFilePath){const l={timestamp:a.timestamp,level:a.level,service:a.service,message:a.message,...a.metadata&&{metadata:a.metadata}};this.writeToFile(JSON.stringify(l)).catch(()=>{})}}trace(e,n){this.log("trace",e,n)}debug(e,n){this.log("debug",e,n)}info(e,n){this.log("info",e,n)}warn(e,n){this.log("warn",e,n)}error(e,n){this.log("error",e,n)}fatal(e,n){this.log("fatal",e,n)}}function $(s,e="debug"){return new Ps(s,e)}const rt=H(["pending","in_progress","completed","failed"]),zs=H(["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"]),at=T({path:h(),line:I().nullable().optional()}),fe=T({inputTokens:I().optional(),outputTokens:I().optional(),totalTokens:I().optional()}),it=Te("type",[T({type:M("content"),content:T({type:M("text"),text:h()})}),T({type:M("text"),text:h()}),T({type:M("diff"),path:h(),oldText:h(),newText:h(),line:I().nullable().optional()}),T({type:M("terminal"),terminalId:h()})]),lt=T({id:h(),title:h(),kind:zs,status:rt,locations:E(at).optional(),rawInput:D(h(),_()).optional(),rawOutput:D(h(),_()).optional(),content:E(it).optional(),error:h().optional(),startedAt:I().optional(),completedAt:I().optional(),tokenUsage:fe.optional()}),Os=T({id:h(),status:rt.optional(),locations:E(at).optional(),rawOutput:D(h(),_()).optional(),content:E(it).optional(),error:h().optional(),completedAt:I().optional(),tokenUsage:fe.optional()});function ve(s,e){return{...s,status:e.status??s.status,locations:e.locations??s.locations,rawOutput:e.rawOutput??s.rawOutput,content:e.content?[...s.content??[],...e.content]:s.content,error:e.error??s.error,completedAt:e.completedAt??s.completedAt,tokenUsage:e.tokenUsage??s.tokenUsage}}const V=$("chat-store","debug"),S=os(s=>({connectionStatus:"disconnected",sessionId:null,error:null,messages:[],isStreaming:!1,streamingStartTime:null,toolCalls:{},totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0},currentModel:"claude-sonnet-4-5-20250929",tokenDisplayMode:"context",logs:[],activeTab:"chat",input:{value:"",isSubmitting:!1,attachedFiles:[]},setConnectionStatus:e=>s({connectionStatus:e}),setSessionId:e=>s({sessionId:e}),setError:e=>s({error:e}),addMessage:e=>s(n=>({messages:[...n.messages,e]})),updateMessage:(e,n)=>s(o=>{const a=o.messages.find(r=>r.id===e);let l=o.totalBilled,u=o.currentContext,f=n;if(n.tokenUsage){const r=a?.tokenUsage;V.debug("updateMessage: incoming tokenUsage",{incoming:n.tokenUsage,existing:r});const c={inputTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0),outputTokens:Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0),totalTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0)+Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0)};V.debug("updateMessage: merged tokenUsage",{merged:c}),f={...n,tokenUsage:c};const d=c.inputTokens-(r?.inputTokens??0),m=c.outputTokens-(r?.outputTokens??0),x=c.totalTokens-(r?.totalTokens??0);l={inputTokens:o.totalBilled.inputTokens+d,outputTokens:o.totalBilled.outputTokens+m,totalTokens:o.totalBilled.totalTokens+x},u={inputTokens:c.inputTokens,outputTokens:o.currentContext.outputTokens+m,totalTokens:c.totalTokens}}const p=o.messages.map(r=>r.id===e?{...r,...f}:r);if(n.tokenUsage){const r=a?.tokenUsage,c=f.tokenUsage,d=(c.inputTokens??0)-(r?.inputTokens??0),m=(c.outputTokens??0)-(r?.outputTokens??0),x=(c.totalTokens??0)-(r?.totalTokens??0),b=p.filter(w=>w.tokenUsage).map(w=>({id:w.id,role:w.role,tokens:w.tokenUsage})),y=p.reduce((w,v)=>({inputTokens:w.inputTokens+(v.tokenUsage?.inputTokens??0),outputTokens:w.outputTokens+(v.tokenUsage?.outputTokens??0),totalTokens:w.totalTokens+(v.tokenUsage?.totalTokens??0)}),{inputTokens:0,outputTokens:0,totalTokens:0}),j=y.inputTokens===l.inputTokens&&y.outputTokens===l.outputTokens&&y.totalTokens===l.totalTokens;V.debug("updateMessage: tokenUsage update",{messageId:e,updates:n.tokenUsage,existing:r,messageMax:c,delta:{inputDelta:d,outputDelta:m,totalDelta:x},totalBilled:l,currentContext:u,actualSum:y,billedCorrect:j?"✅":"❌",messageCount:p.length,messagesWithTokens:b.length,breakdown:b})}return{messages:p,totalBilled:l,currentContext:u}}),clearMessages:()=>s({messages:[]}),setIsStreaming:e=>s({isStreaming:e}),setStreamingStartTime:e=>s({streamingStartTime:e}),addToolCall:(e,n)=>s(o=>({toolCalls:{...o.toolCalls,[e]:[...o.toolCalls[e]||[],n]}})),addToolCallToCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(u=>u.role==="assistant");if(o===-1)return V.warn("No assistant message found to add tool call to"),n;const a=[...n.messages],l=a[o];return l?(a[o]={...l,toolCalls:[...l.toolCalls||[],e]},{messages:a}):n}),updateToolCallInCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(c=>c.role==="assistant");if(o===-1)return V.warn("No assistant message found to update tool call in"),n;const a=[...n.messages],l=a[o];if(!l)return n;const u=l.toolCalls||[],f=u.findIndex(c=>c.id===e.id);if(f===-1)return V.warn(`Tool call ${e.id} not found in message`),n;const p=u[f];if(!p)return n;const r=[...u];return r[f]=ve(p,e),a[o]={...l,toolCalls:r},{messages:a}}),updateToolCall:(e,n)=>s(o=>{const a=o.toolCalls[e]||[],l=a.findIndex(p=>p.id===n.id);if(l===-1)return o;const u=a[l];if(!u)return o;const f=[...a];return f[l]=ve(u,n),{toolCalls:{...o.toolCalls,[e]:f}}}),setInputValue:e=>s(n=>({input:{...n.input,value:e}})),setInputSubmitting:e=>s(n=>({input:{...n.input,isSubmitting:e}})),addFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:[...n.input.attachedFiles,e]}})),removeFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:n.input.attachedFiles.filter((o,a)=>a!==e)}})),clearInput:()=>s(e=>({input:{value:"",isSubmitting:!1,attachedFiles:[]}})),addTokenUsage:e=>s(n=>({totalBilled:{inputTokens:n.totalBilled.inputTokens+(e.inputTokens??0),outputTokens:n.totalBilled.outputTokens+(e.outputTokens??0),totalTokens:n.totalBilled.totalTokens+(e.totalTokens??0)},currentContext:{inputTokens:e.inputTokens??n.currentContext.inputTokens,outputTokens:n.currentContext.outputTokens+(e.outputTokens??0),totalTokens:(e.inputTokens??n.currentContext.inputTokens)+(n.currentContext.outputTokens+(e.outputTokens??0))}})),setCurrentModel:e=>s({currentModel:e}),resetTokens:()=>s({totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0}}),cycleTokenDisplayMode:()=>s(e=>{const n=["context","input","output"],a=(n.indexOf(e.tokenDisplayMode)+1)%n.length,l=n[a];return l?{tokenDisplayMode:l}:e}),addLog:e=>s(n=>({logs:[...n.logs,e]})),clearLogs:()=>s({logs:[]}),setActiveTab:e=>s({activeTab:e})})),ce=$("use-chat-messages","debug");function ct(s){const e=S(c=>c.messages),n=S(c=>c.isStreaming),o=S(c=>c.sessionId),a=S(c=>c.setIsStreaming),l=S(c=>c.setStreamingStartTime),u=S(c=>c.addMessage),f=S(c=>c.updateMessage),p=S(c=>c.setError),r=i.useCallback(async c=>{if(!s){ce.error("No client available"),p("No client available");return}if(!o){ce.error("No active session"),p("No active session");return}try{const d=Date.now();a(!0),l(d);const m={id:`msg_${Date.now()}_user`,role:"user",content:c,timestamp:new Date().toISOString(),isStreaming:!1};u(m);const x=`msg_${Date.now()}_assistant`,b={id:x,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0,streamingStartTime:d};u(b);const y=e.filter(N=>N.role!=="system").map(N=>`${N.role==="user"?"Human":"Assistant"}: ${N.content}`).join(`
|
|
4
|
-
|
|
5
|
-
`),j=y?`${y}
|
|
6
|
-
|
|
7
|
-
Human: ${c}`:c,w=s.receiveMessages();s.sendMessage(j,o).catch(N=>{const U=N instanceof Error?N.message:String(N);p(U),a(!1),l(null)});let v="";for await(const N of w)if(N.tokenUsage&&ce.debug("chunk.tokenUsage",{tokenUsage:N.tokenUsage}),N.isComplete){f(x,{content:v,isStreaming:!1,streamingStartTime:void 0,...N.tokenUsage?{tokenUsage:N.tokenUsage}:{}}),a(!1),l(null);break}else N.contentDelta.type==="text"&&(v+=N.contentDelta.text,f(x,{content:v,...N.tokenUsage?{tokenUsage:N.tokenUsage}:{}}),await new Promise(U=>setTimeout(U,16)))}catch(d){const m=d instanceof Error?d.message:String(d);p(m),a(!1),l(null)}},[s,o,e,u,f,a,l,p]);return{messages:e,isStreaming:n,sendMessage:r}}const Fs=$("use-chat-input","debug");function Hs(s){const e=S(d=>d.input),n=S(d=>d.setInputValue),o=S(d=>d.setInputSubmitting),a=S(d=>d.addFileAttachment),l=S(d=>d.removeFileAttachment),{sendMessage:u}=ct(s),f=i.useCallback(d=>{n(d)},[n]),p=i.useCallback(async()=>{if(!e.value.trim()||e.isSubmitting)return;const d=e.value;n(""),o(!0);try{await u(d)}catch(m){Fs.error("Failed to send message",{error:m instanceof Error?m.message:String(m)})}finally{o(!1)}},[e,n,o,u]),r=i.useCallback(d=>{a(d)},[a]),c=i.useCallback(d=>{l(d)},[l]);return{value:e.value,isSubmitting:e.isSubmitting,attachedFiles:e.attachedFiles,onChange:f,onSubmit:p,onAttachFile:r,onRemoveFile:c}}const $s=$("use-chat-session","debug");function Bs(s){const e=S(d=>d.connectionStatus),n=S(d=>d.sessionId),o=S(d=>d.setConnectionStatus),a=S(d=>d.setSessionId),l=S(d=>d.setError),u=S(d=>d.clearMessages),f=S(d=>d.resetTokens),p=i.useCallback(async()=>{if(!s){l("No client available");return}try{o("connecting"),l(null),await s.connect(),o("connected")}catch(d){$s.error("Failed to connect",{error:d instanceof Error?d.message:String(d)});const m=d instanceof Error?d.message:String(d);l(m),o("error")}},[s,o,l]),r=i.useCallback(async()=>{if(!s){l("No client available");return}try{const d=await s.startSession();a(d),u(),f()}catch(d){const m=d instanceof Error?d.message:String(d);l(m)}},[s,a,l,u,f]),c=i.useCallback(async()=>{if(s)try{await s.disconnect(),o("disconnected"),a(null)}catch(d){const m=d instanceof Error?d.message:String(d);l(m)}},[s,o,a,l]);return i.useEffect(()=>{s&&e==="disconnected"&&p()},[s,e,p]),i.useEffect(()=>{e==="connected"&&!n&&r()},[e,n,r]),{connectionStatus:e,sessionId:n,connect:p,startSession:r,disconnect:c}}function Ws(s){const e=S(u=>u.toolCalls),n=S(u=>u.addToolCall),o=S(u=>u.updateToolCall),a=S(u=>u.addToolCallToCurrentMessage),l=S(u=>u.updateToolCallInCurrentMessage);return i.useEffect(()=>{if(!s)return;const u=s.onSessionUpdate(f=>{f.type==="tool_call"?(n(f.sessionId,f.toolCall),a(f.toolCall)):f.type==="tool_call_update"&&(o(f.sessionId,f.toolCallUpdate),l(f.toolCallUpdate))});return()=>{u()}},[s,n,o,a,l]),{toolCalls:e,getToolCallsForSession:u=>{const f=e[u];return f&&f.length>0?f:Object.values(e).flat()}}}const Vs=T({id:h(),role:H(["user","assistant","system"]),content:h(),timestamp:te(),isStreaming:G().default(!1),streamingStartTime:I().optional(),metadata:D(h(),_()).optional(),toolCalls:E(lt).optional(),tokenUsage:fe.optional()}),qs=T({value:h(),isSubmitting:G(),attachedFiles:E(T({name:h(),path:h(),size:I(),mimeType:h()}))});T({sessionId:h().nullable(),isConnected:G(),isStreaming:G(),messages:E(Vs),input:qs,error:h().nullable()});H(["disconnected","connecting","connected","error"]);const k=$("http-transport");class Qs{connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;messageQueue=[];currentSessionId=null;chunkResolvers=[];streamComplete=!1;sseAbortController=null;reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=1e3;reconnecting=!1;abortController=null;options;constructor(e){this.options={...e,baseUrl:e.baseUrl.replace(/\/$/,"")}}async connect(){if(!this.connected)try{this.abortController=new AbortController;const e={protocolVersion:ds,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},n=await this.sendRpcRequest("initialize",e);k.info("ACP connection initialized",{initResponse:n});const o={cwd:"/",mcpServers:[]},a=await this.sendRpcRequest("session/new",o);this.currentSessionId=a.sessionId,k.info("Session created",{sessionId:this.currentSessionId}),await this.connectSSE(),this.connected=!0,this.reconnectAttempts=0}catch(e){this.connected=!1;const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async disconnect(){if(this.connected)try{this.abortController&&(this.abortController.abort(),this.abortController=null),this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.connected=!1,this.currentSessionId=null,this.messageQueue=[],this.chunkResolvers=[],this.streamComplete=!1,this.reconnecting=!1,this.reconnectAttempts=0}catch(e){const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async send(e){if(!this.connected||!this.currentSessionId)throw new Error("Transport not connected");try{this.streamComplete=!1,this.messageQueue=[];const n=e.content.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
8
|
-
`),o={sessionId:this.currentSessionId,prompt:[{type:"text",text:n}]},a=await this.sendRpcRequest("session/prompt",o);k.debug("Prompt sent",{promptResponse:a}),this.streamComplete=!0;const l=this.chunkResolvers.shift();l?l({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}):this.messageQueue.push({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0})}catch(n){this.streamComplete=!0;const o=n instanceof Error?n:new Error(String(n));throw this.notifyError(o),o}}async*receive(){for(;!this.streamComplete;)if(this.messageQueue.length>0){const e=this.messageQueue.shift();if(e&&(yield e,e.isComplete))return}else{const e=await new Promise(n=>{this.chunkResolvers.push(n)});if(e.isComplete){yield e;return}else yield e}for(;this.messageQueue.length>0;){const e=this.messageQueue.shift();e&&(yield e)}yield{id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}async sendRpcRequest(e,n){const a={jsonrpc:"2.0",id:this.generateRequestId(),method:e,params:n},l={"Content-Type":"application/json",...this.options.headers},u=this.options.timeout??600*1e3,f=new AbortController,p=setTimeout(()=>f.abort(),u);try{const r=await fetch(`${this.options.baseUrl}/rpc`,{method:"POST",headers:l,body:JSON.stringify(a),signal:f.signal});if(clearTimeout(p),!r.ok){const d=await r.text();throw new Error(`HTTP ${r.status}: ${d}`)}const c=await r.json();if(c.error)throw new Error(`ACP error: ${c.error.message||JSON.stringify(c.error)}`);return c.result||c}catch(r){throw clearTimeout(p),r instanceof Error&&r.name==="AbortError"?new Error(`Request timeout after ${u}ms`):r}}async connectSSE(){if(!this.currentSessionId)throw new Error("Cannot connect SSE without a session ID");const e=`${this.options.baseUrl}/events`,n={"X-Session-ID":this.currentSessionId,...this.options.headers};this.sseAbortController=new AbortController;try{const o=await fetch(e,{method:"GET",headers:n,signal:this.sseAbortController.signal});if(!o.ok)throw new Error(`SSE connection failed: HTTP ${o.status}`);if(!o.body)throw new Error("Response body is null");k.debug("SSE connection opened"),this.reconnectAttempts=0,this.reconnectDelay=1e3;const a=o.body.getReader(),l=new TextDecoder;let u="";(async()=>{try{for(;;){const{done:f,value:p}=await a.read();if(f){k.debug("SSE stream closed by server"),this.connected&&await this.handleSSEDisconnect();break}u+=l.decode(p,{stream:!0});const r=u.split(`
|
|
9
|
-
`);u=r.pop()||"";let c={event:"message",data:""};for(const d of r)d.startsWith("event:")?c.event=d.substring(6).trim():d.startsWith("data:")?c.data=d.substring(5).trim():d===""&&(c.event==="message"&&c.data&&this.handleSSEMessage(c.data),c={event:"message",data:""})}}catch(f){if(f instanceof Error&&f.name==="AbortError"){k.debug("SSE stream aborted");return}k.error("Error reading SSE stream",{error:f}),this.connected&&!this.reconnecting&&await this.handleSSEDisconnect()}})()}catch(o){throw k.error("SSE connection error",{error:o}),o}}async handleSSEDisconnect(){if(this.reconnecting||!this.connected)return;if(this.reconnecting=!0,this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.reconnectAttempts>=this.maxReconnectAttempts){const n=new Error(`SSE reconnection failed after ${this.maxReconnectAttempts} attempts`);this.notifyError(n),this.connected=!1,this.reconnecting=!1;return}this.reconnectAttempts++;const e=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),32e3);k.debug("SSE reconnecting",{delay:e,attempt:this.reconnectAttempts,maxAttempts:this.maxReconnectAttempts}),await new Promise(n=>setTimeout(n,e));try{await this.connectSSE(),k.info("SSE reconnected successfully"),this.reconnecting=!1}catch(n){k.error("SSE reconnection failed",{error:n}),this.reconnecting=!1}}handleSSEMessage(e){try{const n=JSON.parse(e);k.debug("Received SSE message",{message:n});const o=us.safeParse(n);if(!o.success){k.error("Invalid ACP message from SSE",{issues:o.error.issues});return}const a=o.data;k.debug("Parsed ACP message",{method:"method"in a?a.method:"(no method)"}),"method"in a&&a.method==="session/update"&&(k.debug("Received session/update notification"),"params"in a&&a.params&&(k.debug("Calling handleSessionNotification",{params:a.params}),this.handleSessionNotification(a.params)))}catch(n){k.error("Error parsing SSE message",{error:n}),this.notifyError(n instanceof Error?n:new Error(String(n)))}}handleSessionNotification(e){k.debug("handleSessionNotification called",{params:e});const o=e.update,a=this.currentSessionId||e.sessionId;if(k.debug("Update session type",{sessionUpdate:o?.sessionUpdate}),o?.sessionUpdate==="tool_call"){k.debug("Tool call notification",{tokenUsage:o.tokenUsage});const l=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,u={id:o.toolCallId??"",title:o.title??"",kind:o.kind||"other",status:o.status||"pending",locations:o.locations,rawInput:o.rawInput,tokenUsage:o.tokenUsage,content:o.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const r=p;if(r.type==="content"&&typeof r.content=="object"&&r.content!==null){const c=r.content;if(c.type==="text")return{type:"content",content:{type:"text",text:typeof c.text=="string"?c.text:""}}}return r.type==="text"?{type:"text",text:typeof r.text=="string"?r.text:""}:r.type==="diff"?{type:"diff",path:typeof r.path=="string"?r.path:"",oldText:typeof r.oldText=="string"?r.oldText:"",newText:typeof r.newText=="string"?r.newText:"",line:typeof r.line=="number"?r.line:null}:r.type==="terminal"?{type:"terminal",terminalId:typeof r.terminalId=="string"?r.terminalId:""}:{type:"text",text:""}}),startedAt:Date.now()},f={type:"tool_call",sessionId:a,status:"active",toolCall:u,messageId:l};this.notifySessionUpdate(f)}else if(o?.sessionUpdate==="tool_call_update"){const l=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,u={id:o.toolCallId??"",status:o.status,locations:o.locations,rawOutput:o.rawOutput,tokenUsage:o.tokenUsage,content:o.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const r=p;if(r.type==="content"&&typeof r.content=="object"&&r.content!==null){const c=r.content;if(c.type==="text")return{type:"content",content:{type:"text",text:typeof c.text=="string"?c.text:""}}}return r.type==="text"?{type:"text",text:typeof r.text=="string"?r.text:""}:r.type==="diff"?{type:"diff",path:typeof r.path=="string"?r.path:"",oldText:typeof r.oldText=="string"?r.oldText:"",newText:typeof r.newText=="string"?r.newText:"",line:typeof r.line=="number"?r.line:null}:r.type==="terminal"?{type:"terminal",terminalId:typeof r.terminalId=="string"?r.terminalId:""}:{type:"text",text:""}}),error:o.error,completedAt:o.status==="completed"||o.status==="failed"?Date.now():void 0},f={type:"tool_call_update",sessionId:a,status:"active",toolCallUpdate:u,messageId:l};k.debug("Notifying tool_call_update session update",{sessionUpdate:f}),this.notifySessionUpdate(f)}else if(o&&"sessionUpdate"in o&&o.sessionUpdate==="tool_output"){const l=o,u=l._meta&&typeof l._meta=="object"&&"messageId"in l._meta?String(l._meta.messageId):void 0,f={id:l.toolCallId??"",rawOutput:l.rawOutput,content:l.content?.map(r=>{if(typeof r!="object"||r===null)return{type:"text",text:""};const c=r;if(c.type==="content"&&typeof c.content=="object"&&c.content!==null){const d=c.content;if(d.type==="text")return{type:"content",content:{type:"text",text:typeof d.text=="string"?d.text:""}}}return c.type==="text"?{type:"text",text:typeof c.text=="string"?c.text:""}:c.type==="diff"?{type:"diff",path:typeof c.path=="string"?c.path:"",oldText:typeof c.oldText=="string"?c.oldText:"",newText:typeof c.newText=="string"?c.newText:"",line:typeof c.line=="number"?c.line:null}:c.type==="terminal"?{type:"terminal",terminalId:typeof c.terminalId=="string"?c.terminalId:""}:{type:"text",text:""}})},p={type:"tool_call_update",sessionId:a,status:"active",toolCallUpdate:f,messageId:u};k.debug("Notifying tool_output as tool_call_update",{sessionUpdate:p}),this.notifySessionUpdate(p)}else if(o?.sessionUpdate==="agent_message_chunk"){const l={type:"generic",sessionId:a,status:"active"},u=o._meta&&typeof o._meta=="object"&&"tokenUsage"in o._meta?o._meta.tokenUsage:void 0;k.debug("Agent message chunk",{tokenUsage:u});const f=o.content;if(f&&typeof f=="object"){const p=f;let r=null;if(p.type==="text"&&typeof p.text=="string"&&(r={id:e.sessionId,role:"assistant",contentDelta:{type:"text",text:p.text},tokenUsage:u,isComplete:!1}),r){const c=this.chunkResolvers.shift();c?c(r):this.messageQueue.push(r)}}this.notifySessionUpdate(l)}else{const l={type:"generic",sessionId:a,status:"active"};this.notifySessionUpdate(l)}}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}notifySessionUpdate(e){for(const n of this.sessionUpdateCallbacks)try{n(e)}catch(o){k.error("Error in session update callback",{error:o})}}notifyError(e){for(const n of this.errorCallbacks)try{n(e)}catch(o){k.error("Error in error callback",{error:o})}}}class Ks{constructor(){throw new Error("StdioTransport is not available in the browser. Use HttpTransport or WebSocketTransport instead.")}async connect(){throw new Error("StdioTransport not available in browser")}async disconnect(){}async send(){throw new Error("StdioTransport not available in browser")}async*receive(){throw new Error("StdioTransport not available in browser")}isConnected(){return!1}onSessionUpdate(){return()=>{}}onError(){return()=>{}}}class Gs{ws=null;connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;constructor(e){}async connect(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.connected=!1}async send(e){throw!this.connected||!this.ws?new Error("Transport not connected"):new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async*receive(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}}const de=$("acp-client","debug");class Xs{config;transport;sessions=new Map;currentSessionId=null;sessionUpdateHandlers=new Set;errorHandlers=new Set;constructor(e){this.config=e,this.transport=this.createTransport(),this.setupTransportListeners(),e.autoConnect&&this.connect().catch(n=>{de.error("Failed to auto-connect",{error:n instanceof Error?n.message:String(n)})})}async connect(){await this.transport.connect()}async disconnect(){await this.transport.disconnect(),this.currentSessionId=null}isConnected(){return this.transport.isConnected()}async startSession(e){const n=this.generateSessionId(),o=new Date().toISOString(),a={id:n,status:"connecting",config:e?{...e,agentPath:e.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:o}};return this.sessions.set(n,a),this.currentSessionId=n,this.updateSessionStatus(n,"connected"),n}async sendMessage(e,n){const o=n||this.currentSessionId;if(!o)throw new Error("No active session. Start a session first.");if(!this.transport.isConnected())throw new Error("Transport not connected");const a=this.sessions.get(o);if(!a)throw new Error(`Session ${o} not found`);const l={id:this.generateMessageId(),role:"user",content:[{type:"text",text:e}],timestamp:new Date().toISOString()};a.messages.push(l),this.updateSessionStatus(o,"active"),await this.transport.send(l)}async*receiveMessages(){if(!this.transport.isConnected())throw new Error("Transport not connected");yield*this.transport.receive()}getSession(e){return this.sessions.get(e)}getCurrentSession(){return this.currentSessionId?this.sessions.get(this.currentSessionId):void 0}getAllSessions(){return Array.from(this.sessions.values())}onSessionUpdate(e){return this.sessionUpdateHandlers.add(e),()=>{this.sessionUpdateHandlers.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}createTransport(){switch(this.config.type){case"stdio":return new Ks(this.config.options);case"http":return new Qs(this.config.options);case"websocket":return new Gs(this.config.options);default:throw new Error(`Unknown transport type: ${this.config.type}`)}}setupTransportListeners(){this.transport.onSessionUpdate(e=>{this.handleSessionUpdate(e)}),this.transport.onError(e=>{this.handleError(e)})}handleSessionUpdate(e){if(e.sessionId){const n=this.sessions.get(e.sessionId);n&&(e.status&&(n.status=e.status),e.message&&n.messages.push(e.message),e.error&&(n.error=e.error))}for(const n of this.sessionUpdateHandlers)try{n(e)}catch(o){de.error("Error in session update handler",{error:o instanceof Error?o.message:String(o)})}}handleError(e){for(const n of this.errorHandlers)try{n(e)}catch(o){de.error("Error in error handler",{error:o instanceof Error?o.message:String(o)})}}updateSessionStatus(e,n){const o=this.sessions.get(e);o&&(o.status=n,this.handleSessionUpdate({sessionId:e,status:n}))}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateMessageId(){return`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}}const Js=T({name:h(),description:h().optional(),parameters:D(h(),_()).optional()}),Ys=T({name:h(),description:h(),parameters:D(h(),_()),required:E(h()).optional()}),Zs=T({name:h(),version:h().optional(),description:h().optional(),author:h().optional(),capabilities:E(Js).optional(),tools:E(Ys).optional(),supportedFormats:E(h()).optional()}),en=H(["initializing","ready","busy","error","terminated"]);T({status:en,info:Zs.optional(),pid:I().optional(),error:h().optional(),uptime:I().optional()});const dt=H(["user","assistant","system","tool"]),tn=H(["text","image","file","tool_call","tool_result"]),J=T({type:tn}),sn=J.extend({type:M("text"),text:h()}),nn=J.extend({type:M("image"),url:h().url().optional(),data:h().optional(),mimeType:h().optional()}),on=J.extend({type:M("file"),name:h(),path:h().optional(),url:h().url().optional(),mimeType:h(),size:I().optional()}),rn=J.extend({type:M("tool_call"),id:h(),name:h(),arguments:D(h(),_())}),an=J.extend({type:M("tool_result"),callId:h(),result:_(),error:h().optional()}),ut=Te("type",[sn,nn,on,rn,an]),pt=T({id:h(),role:dt,content:E(ut),timestamp:te(),metadata:D(h(),_()).optional()});T({id:h(),role:dt,contentDelta:ut,isComplete:G(),tokenUsage:T({inputTokens:I().optional(),outputTokens:I().optional(),totalTokens:I().optional()}).optional()});const ft=H(["idle","connecting","connected","active","streaming","error","disconnected"]),ln=T({agentPath:h(),agentArgs:E(h()).optional(),environment:D(h(),h()).optional(),workingDirectory:h().optional(),timeout:I().optional()}),cn=T({agentName:h().optional(),agentVersion:h().optional(),capabilities:E(h()).optional(),startedAt:te(),lastActivityAt:te().optional()});T({id:h(),status:ft,config:ln,metadata:cn.optional(),messages:E(pt),error:h().optional()});const se=T({sessionId:h(),status:ft.optional(),message:pt.optional(),error:h().optional()}),dn=se.extend({type:M("tool_call"),toolCall:lt,messageId:h().optional()}),un=se.extend({type:M("tool_call_update"),toolCallUpdate:Os,messageId:h().optional()}),pn=se.extend({type:M("tool_output"),toolOutput:T({id:h(),content:E(rs()).optional(),rawOutput:D(h(),_()).optional()}),messageId:h().optional()}),fn=se.extend({type:M("generic").optional()});as([dn,un,pn,fn]);function g(...s){return is(ls(s))}const mn=W("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Y=i.forwardRef(({className:s,variant:e,size:n,asChild:o=!1,...a},l)=>{const u=o?X:"button";return t.jsx(u,{className:g(mn({variant:e,size:n,className:s})),ref:l,...a})});Y.displayName="Button";const gn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("rounded-lg border bg-card text-card-foreground shadow-sm",s),...e}));gn.displayName="Card";const hn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("flex flex-col space-y-1.5 p-6",s),...e}));hn.displayName="CardHeader";const xn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("text-2xl font-semibold leading-none tracking-tight",s),...e}));xn.displayName="CardTitle";const bn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("text-sm text-muted-foreground",s),...e}));bn.displayName="CardDescription";const yn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("p-6 pt-0",s),...e}));yn.displayName="CardContent";const wn=i.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("flex items-center p-6 pt-0",s),...e}));wn.displayName="CardFooter";const mt=i.forwardRef(({title:s,description:e,guideUrl:n,guideText:o="Guide",suggestedPrompts:a=[],onPromptClick:l,onGuideClick:u,className:f,...p},r)=>{const c=x=>{l?.(x)},d=()=>{n&&window.open(n,"_blank","noopener,noreferrer"),u?.()},m=[];for(let x=0;x<a.length;x+=2)m.push(a.slice(x,x+2));return t.jsxs("div",{ref:r,className:g("flex flex-col items-start gap-6",f),...p,children:[t.jsx("h3",{className:"text-heading-3 text-text-primary hidden lg:block",children:s}),t.jsx("p",{className:"text-subheading text-text-secondary max-w-prose",children:e}),(n||u)&&t.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg hover:bg-accent transition-colors",children:[t.jsx("span",{className:"text-sm font-medium leading-normal text-text-primary",children:o}),t.jsx(Je,{className:"size-4 text-text-primary"})]}),a.length>0&&t.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-prompt-container",children:[t.jsx("p",{className:"text-label text-text-tertiary",children:"Suggested Prompts"}),t.jsx("div",{className:"flex flex-col gap-2.5",children:m.map(x=>t.jsx("div",{className:"flex gap-2.5 items-center",children:x.map(b=>t.jsx("button",{type:"button",onClick:()=>c(b),className:"flex-1 flex items-start gap-2 p-3 bg-secondary hover:bg-secondary/80 rounded-2xl transition-colors min-w-0",children:t.jsx("span",{className:"text-base font-normal leading-normal text-text-tertiary truncate",children:b})},b))},x.join("-")))})]})]})});mt.displayName="ChatEmptyState";const gt=i.createContext(void 0),me=()=>{const s=i.useContext(gt);if(!s)throw new Error("ChatHeader components must be used within ChatHeader.Root");return s},ht=i.forwardRef(({defaultExpanded:s=!1,expanded:e,onExpandedChange:n,className:o,children:a,...l},u)=>{const[f,p]=i.useState(s),r=e??f,c=i.useCallback(b=>{p(b),n?.(b)},[n]),d=i.Children.toArray(a),m=d.find(b=>i.isValidElement(b)&&typeof b.type=="function"&&b.type.displayName==="ChatHeader.ExpandablePanel"),x=d.filter(b=>b!==m);return t.jsxs(gt.Provider,{value:{isExpanded:r,setIsExpanded:c},children:[t.jsx("div",{ref:u,className:g("flex items-center justify-between px-6 py-4",o),...l,children:x}),m]})});ht.displayName="ChatHeader.Root";const vn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("h1",{ref:o,className:g("m-0 text-xl font-semibold",s),...n,children:e}));vn.displayName="ChatHeader.Title";const Nn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex items-center gap-3",s),...n,children:e}));Nn.displayName="ChatHeader.Actions";const jn=s=>{switch(s){case"connected":return"bg-green-500";case"connecting":return"bg-yellow-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},Cn=s=>{switch(s){case"connected":return"Connected";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"No Server"}},Sn=i.forwardRef(({status:s,statusText:e,className:n,...o},a)=>{const l=e??Cn(s),u=jn(s);return t.jsxs("div",{ref:a,className:g("flex items-center gap-2",n),...o,children:[t.jsx("div",{className:g("h-2 w-2 rounded-full",u)}),t.jsx("span",{className:"text-sm text-muted-foreground",children:l})]})});Sn.displayName="ChatHeader.StatusIndicator";const Tn=i.forwardRef(({icon:s,className:e,children:n,onClick:o,...a},l)=>{const{isExpanded:u,setIsExpanded:f}=me(),p=r=>{f(!u),o?.(r)};return t.jsxs("button",{ref:l,type:"button",onClick:p,className:g("rounded p-1 transition-colors hover:bg-background lg:hidden",e),"aria-label":u?"Collapse header":"Expand header",...a,children:[s&&t.jsx("div",{className:g("transition-transform duration-200",u&&"rotate-180"),children:s}),n]})});Tn.displayName="ChatHeader.Toggle";const xt=i.forwardRef(({className:s,children:e,...n},o)=>{const{isExpanded:a}=me();return a?t.jsx("div",{ref:o,className:g("absolute top-full left-0 right-0 z-50 border-b border-border bg-card px-6 py-4 shadow-lg lg:hidden",s),...n,children:e}):null});xt.displayName="ChatHeader.ExpandablePanel";const bt=i.forwardRef(({commands:s=[],showCommandMenu:e,commandMenuQuery:n,selectedMenuIndex:o,setSelectedMenuIndex:a,setMenuItemCount:l,triggerCounter:u,onChange:f,className:p,...r},c)=>{const d=i.useCallback((x,b)=>{const y=x.toLowerCase(),j=b.toLowerCase();if(!b)return 1;if(y.includes(j))return 1-j.length/y.length;let w=0;for(let v=0;v<y.length&&w<j.length;v++)y[v]===j[w]&&w++;return w===j.length?.5-w/y.length:0},[]),m=i.useMemo(()=>s.map(x=>({...x,score:Math.max(d(x.label,n),x.description?d(x.description,n):0)})).filter(x=>x.score>0).sort((x,b)=>b.score-x.score),[s,n,d]);return i.useEffect(()=>{l(m.length)},[m.length,l]),i.useEffect(()=>{a(0)},[a]),i.useEffect(()=>{u>0&&m[o]&&(m[o].onSelect(),f(""))},[u,m,o,f]),!e||m.length===0?null:t.jsxs("div",{ref:c,className:g("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md","rounded-md border border-border bg-card p-2 shadow-lg",p),...r,children:[t.jsx("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1",children:"Commands"}),t.jsx("div",{className:"max-h-64 overflow-y-auto",children:m.map((x,b)=>t.jsxs("button",{type:"button",onClick:()=>x.onSelect(),className:g("w-full rounded-sm px-2 py-2 text-left text-sm transition-colors","flex items-start gap-2","hover:bg-muted",b===o&&"bg-muted"),children:[x.icon&&t.jsx("span",{className:"shrink-0 mt-0.5",children:x.icon}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium",children:x.label}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground truncate",children:x.description})]})]},x.id))})]})});bt.displayName="ChatInputCommandMenu";const yt=i.createContext(void 0),ne=()=>{const s=i.useContext(yt);if(!s)throw new Error("ChatInput components must be used within ChatInput.Root");return s},wt=i.forwardRef(({client:s,value:e,onChange:n,onSubmit:o,disabled:a=!1,isSubmitting:l,submitOnEnter:u=!0,className:f,children:p,...r},c)=>{const d=i.useRef(null),m=Hs(s??null),x=S(R=>R.isStreaming),b=m?m.value:e||"",y=m?m.onChange:n||(()=>{}),j=m?m.onSubmit:o||(async()=>{}),w=m?m.isSubmitting||x:l||!1,[v,N]=i.useState(!1),[U,L]=i.useState(""),[O,C]=i.useState(0),[A,P]=i.useState(0),[ae,ie]=i.useState(0),Qt=i.useCallback(()=>{ie(R=>R+1)},[]),Kt=async R=>{R.preventDefault(),b.trim()&&!w&&!a&&(await j(),setTimeout(()=>{d.current?.focus()},0))},Gt=R=>{const z=R.target;!(z.tagName==="BUTTON"||z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.closest("button"))&&d.current&&d.current.focus()},Xt=R=>{const z=R.target;!(z.tagName==="BUTTON"||z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.closest("button"))&&R.key===" "&&(R.preventDefault(),d.current&&d.current.focus())};return i.useEffect(()=>{const R=document.querySelector('textarea[name="chat-input"]');R&&d.current!==R&&(d.current=R)},[]),i.useEffect(()=>{!b&&d.current&&(d.current.style.height="auto",d.current.style.overflowY="hidden")},[b]),t.jsx(yt.Provider,{value:{value:b,onChange:y,onSubmit:j,disabled:a,isSubmitting:w,submitOnEnter:u,showCommandMenu:v,setShowCommandMenu:N,commandMenuQuery:U,setCommandMenuQuery:L,selectedMenuIndex:O,setSelectedMenuIndex:C,menuItemCount:A,setMenuItemCount:P,triggerMenuSelect:Qt,triggerCounter:ae},children:t.jsx("form",{ref:c,onSubmit:Kt,onClick:Gt,onKeyDown:Xt,className:g("relative w-full divide-y rounded-xl border bg-background shadow-md",f),...r,children:p})})});wt.displayName="ChatInput.Root";const vt=i.forwardRef(({asChild:s=!1,className:e,onKeyDown:n,children:o,...a},l)=>{const{value:u,onChange:f,onSubmit:p,disabled:r,isSubmitting:c,submitOnEnter:d,showCommandMenu:m,setShowCommandMenu:x,setCommandMenuQuery:b,setSelectedMenuIndex:y,menuItemCount:j,triggerMenuSelect:w}=ne(),v=i.useRef(null),O={ref:i.useCallback(C=>{v.current=C,typeof l=="function"?l(C):l&&(l.current=C)},[l]),name:"chat-input",value:u,onChange:C=>{const A=C.target.value;if(f(A),A.startsWith("/")&&!A.includes(`
|
|
10
|
-
`)){x(!0);const ie=A.slice(1);b(ie)}else x(!1),b("");const P=v.current;if(!P)return;P.style.height="auto";const ae=Math.min(P.scrollHeight,164);P.style.height=`${ae}px`,P.scrollHeight>164?P.style.overflowY="auto":P.style.overflowY="hidden"},onKeyDown:C=>{if(m&&j>0){if(C.key==="ArrowDown"){C.preventDefault(),y(A=>(A+1)%j);return}else if(C.key==="ArrowUp"){C.preventDefault(),y(A=>(A-1+j)%j);return}else if(C.key==="Enter"&&!C.shiftKey){C.preventDefault(),w();return}else if(C.key==="Escape"){C.preventDefault(),x(!1),b("");return}}d&&C.key==="Enter"&&!C.shiftKey&&(u.trim()&&!c&&!r?(C.preventDefault(),p()):(c||r)&&C.preventDefault()),n?.(C)},disabled:r,...a};return s&&i.isValidElement(o)?i.cloneElement(o,O):t.jsx("textarea",{...O,className:g("w-full resize-none rounded-none border-none p-4 shadow-none","outline-none ring-0 field-sizing-content max-h-[6lh]","bg-transparent dark:bg-transparent focus-visible:ring-0","text-sm placeholder:text-muted-foreground","disabled:cursor-not-allowed disabled:opacity-50",e)})});vt.displayName="ChatInput.Field";const Nt=i.forwardRef(({asChild:s=!1,className:e,disabled:n,children:o,...a},l)=>{const{value:u,disabled:f,isSubmitting:p}=ne(),r=n||f||p||!u.trim(),c=s?X:Y;return t.jsx(c,{ref:l,type:"submit",disabled:r,variant:s?void 0:"default",size:"icon",className:g(!s&&"gap-1.5 rounded-full",e),...a,children:o})});Nt.displayName="ChatInput.Submit";const jt=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex items-center justify-between p-2",s),...n,children:e}));jt.displayName="ChatInput.Toolbar";const Ct=i.forwardRef(({asChild:s=!1,className:e,children:n,onClick:o,...a},l)=>{const{value:u,onChange:f,setShowCommandMenu:p,setCommandMenuQuery:r}=ne(),c=m=>{u.startsWith("/")||(f("/"),p(!0),r("")),o?.(m)},d=s?X:Y;return t.jsx(d,{ref:l,type:"button",variant:"ghost",size:"icon",className:g("rounded-full",e),onClick:c,...a,children:n||t.jsx(vs,{className:"size-4"})})});Ct.displayName="ChatInput.Actions";const St=i.forwardRef(({asChild:s=!1,className:e,children:n,...o},a)=>{const l=s?X:Y;return t.jsx(l,{ref:a,type:"button",variant:"ghost",size:"icon",className:g("rounded-full",e),...o,children:n||t.jsx(Ns,{className:"size-4"})})});St.displayName="ChatInput.Attachment";const Tt=i.forwardRef(({asChild:s=!1,className:e,children:n,...o},a)=>{const l=s?X:Y;return t.jsx(l,{ref:a,type:"button",variant:"ghost",size:"icon",className:g("rounded-full",e),...o,children:n||t.jsx(js,{className:"size-4"})})});Tt.displayName="ChatInput.VoiceInput";const kt=i.forwardRef(({commands:s=[],className:e,onChange:n,...o},a)=>{const{showCommandMenu:l,commandMenuQuery:u,selectedMenuIndex:f,setSelectedMenuIndex:p,setMenuItemCount:r,triggerCounter:c,onChange:d}=ne();return t.jsx(bt,{ref:a,commands:s,showCommandMenu:l,commandMenuQuery:u,selectedMenuIndex:f,setSelectedMenuIndex:p,setMenuItemCount:r,triggerCounter:c,onChange:d,className:e,...o})});kt.displayName="ChatInput.CommandMenu";const kn=({className:s,...e})=>t.jsx(Yt,{className:g("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",s),...e}),It=({className:s,...e})=>t.jsx(Zt,{className:g(s),...e}),In=({withHandle:s,className:e,...n})=>t.jsx(es,{className:g("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:s&&t.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[t.jsx("title",{children:"Resize Handle"}),t.jsx("circle",{cx:"9",cy:"12",r:"1"}),t.jsx("circle",{cx:"9",cy:"5",r:"1"}),t.jsx("circle",{cx:"9",cy:"19",r:"1"}),t.jsx("circle",{cx:"15",cy:"12",r:"1"}),t.jsx("circle",{cx:"15",cy:"5",r:"1"}),t.jsx("circle",{cx:"15",cy:"19",r:"1"})]})})}),En=({...s})=>t.jsx(cs,{position:"top-center",className:"toaster group",style:{"--top-offset":"16px","--width:":"calc(100% - 2 * var(--top-offset))",position:"absolute",zIndex:5,top:"var(--top-offset)",left:"50%",transform:"translateX(-50%)",width:"calc(100% - 2 * var(--top-offset))",maxWidth:"480px"},offset:0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...s}),Et=i.createContext(void 0),ge=()=>{const s=i.useContext(Et);if(!s)throw new Error("ChatLayout components must be used within ChatLayout.Root");return s},Rt=i.forwardRef(({defaultSidebarOpen:s=!1,defaultPanelSize:e="hidden",defaultActiveTab:n="todo",className:o,children:a,...l},u)=>{const[f,p]=i.useState(s),[r,c]=i.useState(e),[d,m]=i.useState(n);return t.jsx(Et.Provider,{value:{sidebarOpen:f,setSidebarOpen:p,panelSize:r,setPanelSize:c,activeTab:d,setActiveTab:m},children:t.jsx("div",{ref:u,className:g("flex h-screen flex-row bg-background text-foreground",o),...l,children:t.jsx(kn,{direction:"horizontal",className:"flex-1",children:a})})})});Rt.displayName="ChatLayout.Root";const Rn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("relative z-10 border-b border-border bg-card shrink-0",s),...n,children:e}));Rn.displayName="ChatLayout.Header";const Mt=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx(It,{defaultSize:75,minSize:50,children:t.jsx("div",{ref:o,className:g("flex flex-1 flex-col overflow-hidden h-full",s),...n,children:e})}));Mt.displayName="ChatLayout.Main";const Ut=i.forwardRef(({showToaster:s=!0,className:e,children:n,...o},a)=>t.jsxs("div",{ref:a,className:g("relative flex flex-1 flex-col overflow-hidden",e),...o,children:[n,s&&t.jsx(En,{})]}));Ut.displayName="ChatLayout.Body";const At=i.forwardRef(({className:s,children:e,onScrollChange:n,showScrollToBottom:o=!0,...a},l)=>{const[u,f]=i.useState(!1),p=i.useRef(null);i.useImperativeHandle(l,()=>p.current);const r=i.useCallback(()=>{const m=p.current;if(!m)return;const{scrollTop:x,scrollHeight:b,clientHeight:y}=m,w=b-x-y<100;f(!w&&o),n?.(w)},[n,o]),c=i.useCallback(()=>{r()},[r]),d=i.useCallback(()=>{const m=p.current;m&&m.scrollTo({top:m.scrollHeight,behavior:"smooth"})},[]);return i.useEffect(()=>{r()},[r]),t.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[t.jsx("div",{ref:p,className:g("h-full overflow-y-auto",s),onScroll:c,...a,children:t.jsx("div",{className:"mx-auto max-w-chat min-h-full flex flex-col",children:e})}),u&&t.jsx("button",{type:"button",onClick:d,className:g("absolute bottom-4 left-1/2 -translate-x-1/2 z-10","flex items-center justify-center p-2 rounded-full","bg-card border border-border shadow-lg","text-foreground","hover:bg-accent hover:text-accent-foreground","transition-all duration-200 ease-in-out","animate-in fade-in slide-in-from-bottom-2"),"aria-label":"Scroll to bottom",children:t.jsx(Cs,{className:"size-4"})})]})});At.displayName="ChatLayout.Messages";const Dt=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("bg-linear-to-t from-background to-transparent px-4 pb-4",s),...n,children:t.jsx("div",{className:"mx-auto max-w-chat",children:e})}));Dt.displayName="ChatLayout.Footer";const Mn=i.forwardRef(({className:s,children:e,...n},o)=>{const{sidebarOpen:a}=ge();return a?t.jsx("div",{ref:o,className:g("border-r border-border bg-card w-64 overflow-y-auto",s),...n,children:e}):null});Mn.displayName="ChatLayout.Sidebar";const _t=i.forwardRef(({breakpoint:s="lg",className:e,children:n,...o},a)=>{const{panelSize:l}=ge();return l==="hidden"?null:t.jsxs(t.Fragment,{children:[t.jsx(In,{withHandle:!0}),t.jsx(It,{defaultSize:25,minSize:15,maxSize:50,children:t.jsx("div",{ref:a,className:g("hidden h-full border-l border-border bg-card overflow-y-auto transition-all duration-300",s==="md"&&"md:block",s==="lg"&&"lg:block",s==="xl"&&"xl:block",s==="2xl"&&"2xl:block",e),...o,children:n})})]})});_t.displayName="ChatLayout.Aside";const oe=i.forwardRef(({todos:s,className:e,...n},o)=>t.jsx("div",{ref:o,className:g("space-y-2",e),...n,children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No todos yet"})}):s.map(a=>t.jsx("div",{className:"text-sm",children:a.text},a.id))}));oe.displayName="TodoTabContent";const re=i.forwardRef(({files:s=[],className:e,...n},o)=>t.jsx("div",{ref:o,className:g("space-y-2",e),...n,children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No files attached"})}):s.map(a=>t.jsx("div",{className:"text-sm",children:a},a))}));re.displayName="FilesTabContent";const Un=i.forwardRef(({data:s,className:e,...n},o)=>t.jsxs("div",{ref:o,className:g("space-y-4",e),...n,children:[t.jsx("h3",{className:"font-semibold text-lg",children:"Database"}),t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsx("p",{children:"Database viewer - panel automatically expanded to large size"}),t.jsxs("div",{className:"mt-4 p-4 border border-border rounded",children:[t.jsx("p",{children:"Your large data table would go here"}),s&&typeof s=="object"?t.jsx("pre",{className:"mt-2 text-xs overflow-auto",children:JSON.stringify(s,null,2)}):null]})]})]}));Un.displayName="DatabaseTabContent";const he=ps,Q=i.forwardRef(({className:s,...e},n)=>t.jsx(ke,{ref:n,className:g("inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground gap-1",s),...e}));Q.displayName=ke.displayName;const K=i.forwardRef(({className:s,...e},n)=>t.jsx(Ie,{ref:n,className:g("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...e}));K.displayName=Ie.displayName;const F=i.forwardRef(({className:s,...e},n)=>t.jsx(Ee,{ref:n,className:g("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...e}));F.displayName=Ee.displayName;const Lt=i.forwardRef(({todo:s,className:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex items-center gap-3 px-3 py-2 rounded-lg",e),...n,children:t.jsx("span",{className:g("flex-1 text-[var(--font-size)] font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"shimmer-animation"),children:s.text})}));Lt.displayName="TodoListItem";const Pt=i.forwardRef(({client:s,todos:e,className:n,...o},a)=>{const l=e||[];return t.jsx("div",{ref:a,className:g("space-y-2 max-h-64 overflow-y-auto",n),...o,children:l.length===0?t.jsx("p",{className:"text-sm text-foreground opacity-60 italic",children:"No tasks yet."}):l.map(u=>t.jsx(Lt,{todo:u},u.id))})});Pt.displayName="TodoList";const An=i.forwardRef(({client:s,todos:e,variant:n="animated",showIcons:o=!1,visibleTabs:a=["todo","files","database"],className:l,...u},f)=>{const p=e||[],[r,c]=i.useState(a[0]||"todo"),d=i.useRef(null),m=i.useRef(null);i.useEffect(()=>{const j=setTimeout(()=>{const w=d.current;if(r&&w){const v=m.current;if(v){const N=w.getBoundingClientRect(),U=v.getBoundingClientRect(),L=U.left-N.left,O=U.width,C=L/N.width*100,A=100-(L+O)/N.width*100;w.style.clipPath=`inset(0 ${A.toFixed(2)}% 0 ${C.toFixed(2)}% round 999px)`}}},0);return()=>clearTimeout(j)},[r]);const b=[{id:"todo",label:n==="pills"?"To-do":"To-Do List",icon:Ye},{id:"files",label:"Files",icon:Ze},{id:"database",label:"Database",icon:et}].filter(y=>a.includes(y.id));return t.jsx("div",{ref:f,className:g("select-none",l),...u,children:t.jsxs(he,{value:r,onValueChange:c,className:"w-full",children:[n==="pills"?t.jsx(Q,{className:g("w-full justify-start bg-transparent p-0 h-auto","gap-1"),children:b.map(y=>{const j=y.icon;return t.jsxs(K,{value:y.id,className:g("gap-2 px-3 py-1.5 rounded-lg text-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[o&&j&&t.jsx(j,{className:"size-4"}),y.label]},y.id)})}):t.jsxs("div",{className:"relative mb-4 border-border",children:[t.jsx(Q,{className:"bg-transparent p-0 h-auto rounded-none w-full border-none",children:b.map(y=>t.jsx(K,{value:y.id,className:"px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:y.label},y.id))}),t.jsx("div",{ref:d,className:"absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none",style:{clipPath:"inset(0 100% 0 0% round 999px)",transition:"clip-path 0.25s ease-out"},children:t.jsx(Q,{className:"bg-secondary p-0 h-auto rounded-none w-full border-none",children:b.map(y=>t.jsx(K,{value:y.id,ref:r===y.id?m:null,className:"px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none",tabIndex:-1,children:y.label},y.id))})})]}),t.jsx(F,{value:"todo",className:n==="pills"?"mt-0":"",children:n==="pills"?t.jsx(oe,{todos:p}):t.jsx(Pt,{todos:p})}),t.jsx(F,{value:"files",className:n==="pills"?"mt-0":"",children:t.jsx(re,{})}),t.jsx(F,{value:"database",className:n==="pills"?"mt-0":"",children:t.jsx("div",{className:"text-sm text-foreground opacity-60 italic",children:"Database tab coming soon..."})})]})})});An.displayName="ChatSecondaryPanel";const Dn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex h-full flex-col",s),...n,children:e}));Dn.displayName="ChatSidebar.Root";const _n=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("border-b border-border px-4 py-3",s),...n,children:e}));_n.displayName="ChatSidebar.Header";const Ln=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex-1 overflow-y-auto p-4",s),...n,children:e}));Ln.displayName="ChatSidebar.Content";const Pn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("border-t border-border px-4 py-3",s),...n,children:e}));Pn.displayName="ChatSidebar.Footer";const zn=i.forwardRef(({children:s,className:e,...n},o)=>{const[a,l]=i.useState(s),[u,f]=i.useState(!1),p=i.useRef(s),r=i.useRef(!0);return i.useEffect(()=>{if(r.current){r.current=!1,p.current=s;return}if(p.current===s)return;f(!0);const c=setTimeout(()=>{l(s),p.current=s,requestAnimationFrame(()=>{f(!1)})},150);return()=>{clearTimeout(c)}},[s]),t.jsx("span",{ref:o,className:g("text-sm text-foreground opacity-60 transition-opacity duration-300",u?"opacity-0":"opacity-60",e),...n,children:a})});zn.displayName="ChatStatus";const On=i.forwardRef(({autoScroll:s=!0,isStreaming:e=!1,scrollBehavior:n="smooth",scrollThreshold:o=100,showScrollButton:a=!0,scrollButton:l,className:u,children:f,...p},r)=>{const c=i.useRef(null),[d,m]=i.useState(!0),[x,b]=i.useState(!1),y=i.useRef(0);i.useImperativeHandle(r,()=>{if(!c.current)throw new Error("Container ref not initialized");return c.current});const j=i.useCallback(()=>{const v=c.current;if(!v)return;const{scrollTop:N,scrollHeight:U,clientHeight:L}=v,C=U-N-L<o;m(C),b(!C&&a),y.current=N},[o,a]),w=i.useCallback((v=n)=>{const N=c.current;N&&N.scrollTo({top:N.scrollHeight,behavior:v})},[n]);return i.useEffect(()=>{!s||!c.current||(e&&d?w("auto"):!e&&d&&w())},[s,e,d,w]),i.useEffect(()=>{const v=c.current;if(!v)return;const N=()=>{j()};return v.addEventListener("scroll",N,{passive:!0}),j(),()=>{v.removeEventListener("scroll",N)}},[j]),i.useEffect(()=>{const v=c.current;if(!v)return;const N=new ResizeObserver(()=>{d&&s&&w("auto")});return N.observe(v),()=>{N.disconnect()}},[d,s,w]),t.jsxs("div",{className:"relative flex-1",children:[t.jsx("div",{ref:c,className:g("h-full overflow-y-auto overflow-x-hidden","scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent",u),...p,children:t.jsx("div",{className:"flex flex-col gap-4 px-4 py-4",children:f})}),x&&t.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10",children:l||t.jsxs("button",{type:"button",onClick:()=>w(),className:"px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2","aria-label":"Scroll to bottom",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Down arrow",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),"Scroll to bottom"]})})]})});On.displayName="Conversation";const Fn=fs,zt=i.forwardRef(({className:s,...e},n)=>t.jsx(Re,{ref:n,className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...e}));zt.displayName=Re.displayName;const Hn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Fn,{children:[t.jsx(zt,{}),t.jsxs(Me,{ref:o,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[e,t.jsxs(ms,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(Ss,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hn.displayName=Me.displayName;const $n=i.forwardRef(({className:s,...e},n)=>t.jsx(Ue,{ref:n,className:g("text-lg font-semibold leading-none tracking-tight",s),...e}));$n.displayName=Ue.displayName;const Bn=i.forwardRef(({className:s,...e},n)=>t.jsx(Ae,{ref:n,className:g("text-sm text-muted-foreground",s),...e}));Bn.displayName=Ae.displayName;const Wn=i.forwardRef(({className:s,inset:e,children:n,...o},a)=>t.jsxs(De,{ref:a,className:g("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-muted data-[state=open]:bg-muted",e&&"pl-8",s),...o,children:[n,t.jsx(Je,{className:"ml-auto h-4 w-4"})]}));Wn.displayName=De.displayName;const Vn=i.forwardRef(({className:s,...e},n)=>t.jsx(_e,{ref:n,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 shadow-lg","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),...e}));Vn.displayName=_e.displayName;const qn=i.forwardRef(({className:s,sideOffset:e=4,...n},o)=>t.jsx(gs,{children:t.jsx(Le,{ref:o,sideOffset:e,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 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),...n})}));qn.displayName=Le.displayName;const Qn=i.forwardRef(({className:s,inset:e,...n},o)=>t.jsx(Pe,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",s),...n}));Qn.displayName=Pe.displayName;const Kn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(ze,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Oe,{children:t.jsx(tt,{className:"h-4 w-4"})})}),e]}));Kn.displayName=ze.displayName;const Gn=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Fe,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Oe,{children:t.jsx(st,{className:"h-2 w-2 fill-current"})})}),e]}));Gn.displayName=Fe.displayName;const Xn=i.forwardRef(({className:s,inset:e,...n},o)=>t.jsx(He,{ref:o,className:g("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",s),...n}));Xn.displayName=He.displayName;const Jn=i.forwardRef(({className:s,...e},n)=>t.jsx($e,{ref:n,className:g("-mx-1 my-1 h-px bg-border",s),...e}));Jn.displayName=$e.displayName;const Yn=W("flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),Zn=i.forwardRef(({className:s,type:e,variant:n,...o},a)=>t.jsx("input",{type:e,className:g(Yn({variant:n,className:s})),ref:a,...o}));Zn.displayName="Input";const eo=i.forwardRef(({className:s,...e},n)=>t.jsx(Be,{ref:n,className:g("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...e}));eo.displayName=Be.displayName;const to=W("flex animate-fadeIn",{variants:{role:{user:"max-w-[80%] self-end ml-auto mr-2",assistant:"self-start mr-auto",system:"self-start mr-auto max-w-full"},layout:{default:"",full:"max-w-full",compact:"max-w-[90%]"}},defaultVariants:{role:"assistant",layout:"default"}}),Ot=i.forwardRef(({message:s,role:e,layout:n,className:o,children:a,messageId:l,autoScroll:u,isLastMessage:f=!1,...p},r)=>{const c=s?s.role:e||"assistant",d=s?s.id:l,m=i.useRef(null),[x,b]=i.useState(void 0);return i.useImperativeHandle(r,()=>m.current),i.useEffect(()=>{if(!f||c!=="assistant"){b(void 0);return}const y=()=>{const w=m.current;if(!w)return;let v=w.parentElement;for(;v&&!v.classList.contains("overflow-y-auto");)v=v.parentElement;if(!v)return;const N=w.previousElementSibling;if(!N||N.getAttribute("aria-label")!=="user message"){b(void 0);return}const U=v.clientHeight,L=N.offsetHeight,C=Math.max(0,U-L-32);b(C)};y();const j=new ResizeObserver(y);if(m.current){j.observe(m.current);let w=m.current.parentElement;for(;w&&!w.classList.contains("overflow-y-auto");)w=w.parentElement;w&&j.observe(w)}return()=>j.disconnect()},[f,c]),i.useEffect(()=>{if((u!==void 0?u:c==="user")&&m.current){const j=setTimeout(()=>{m.current?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},50);return()=>clearTimeout(j)}},[c,u]),t.jsx("article",{ref:m,"aria-label":`${c} message`,"data-message-id":d,className:g(to({role:c,layout:n}),o),style:{minHeight:x!==void 0?`${x}px`:void 0},...p,children:a})});Ot.displayName="Message";const ee=128e3,Ne={"claude-sonnet-4-5-20250929":2e5,"claude-sonnet-4-20250514":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-sonnet-20240620":2e5,"claude-3-opus-20240229":2e5,"claude-3-sonnet-20240229":2e5,"claude-3-haiku-20240307":2e5,"gpt-4-turbo":128e3,"gpt-4-turbo-preview":128e3,"gpt-4-0125-preview":128e3,"gpt-4-1106-preview":128e3,"gpt-4":8192,"gpt-4-32k":32768,"gpt-3.5-turbo":16385,"gpt-3.5-turbo-16k":16385,default:ee};function so(s){if(!s)return ee;if(s in Ne)return Ne[s]??ee;const e=s.toLowerCase();return e.includes("claude")?2e5:e.includes("gpt-4-turbo")?128e3:e.includes("gpt-4-32k")?32768:e.includes("gpt-4")?8192:e.includes("gpt-3.5")?16385:ee}function no(s,e){const n=so(e);return s/n*100}function oo(s,e,n=1){return`${no(s,e).toFixed(n)}%`}const je=W("mb-3 rounded-lg bg-card border border-border transition-all",{variants:{variant:{default:"opacity-70",subtle:"opacity-50",prominent:"opacity-90 shadow-sm"}},defaultVariants:{variant:"default"}}),ro=W("w-4 h-4 text-foreground opacity-60 transition-transform duration-200",{variants:{expanded:{true:"rotate-180",false:""}},defaultVariants:{expanded:!1}}),Ft=i.forwardRef(({content:s,isStreaming:e=!1,mode:n="collapsible",defaultExpanded:o=!1,autoExpand:a=!1,autoCollapse:l=!0,autoCollapseDelay:u=2e3,label:f="Thinking",variant:p,className:r},c)=>{const[d,m]=i.useState(n==="inline"?!0:o),[x,b]=i.useState(!1);return i.useEffect(()=>{if(l&&!e&&s&&n==="collapsible"){const y=setTimeout(()=>{b(!0),m(!1)},u);return()=>clearTimeout(y)}},[e,s,l,u,n]),i.useEffect(()=>{a&&e&&n==="collapsible"&&!x&&m(!0)},[a,e,n,x]),!s&&!e?null:n==="inline"?t.jsxs("div",{ref:c,className:g(je({variant:p}),"p-3",r),children:[t.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",children:f}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse"})]}),t.jsxs("div",{className:"text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})]}):t.jsxs("div",{ref:c,className:g("mb-3",r),children:[t.jsxs("button",{type:"button",onClick:()=>{m(!d),b(!1)},className:"w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left","aria-expanded":d,"aria-label":`${d?"Collapse":"Expand"} reasoning`,children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0",children:f}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0"}),!d&&s&&t.jsxs("span",{className:"text-xs text-foreground opacity-50 truncate",children:[s.substring(0,60),s.length>60&&"..."]})]}),t.jsx(ue,{className:ro({expanded:d}),"aria-hidden":"true"})]}),d&&t.jsx("div",{className:g(je({variant:p}),"mt-2 p-3 animate-fadeIn"),children:t.jsxs("div",{className:"text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})})]})});Ft.displayName="Reasoning";const Ht=i.forwardRef(({content:s,isStreaming:e=!1,showEmpty:n=!0,emptyMessage:o="",className:a,...l},u)=>{if(!s&&e&&n)return t.jsx("div",{ref:u,className:g("opacity-70 italic text-sm",a),...l,children:o});if(!s)return null;const f={table:({node:p,...r})=>t.jsx("div",{className:"overflow-x-auto my-4",children:t.jsx("table",{className:"min-w-full border-collapse border border-border rounded-md",...r})}),thead:({node:p,...r})=>t.jsx("thead",{className:"bg-card border-b border-border",...r}),tbody:({node:p,...r})=>t.jsx("tbody",{...r}),tr:({node:p,...r})=>t.jsx("tr",{className:"border-b border-border hover:bg-card transition-colors",...r}),th:({node:p,...r})=>t.jsx("th",{className:"px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0",...r}),td:({node:p,...r})=>t.jsx("td",{className:"px-4 py-2 text-foreground border-r border-border last:border-r-0",...r}),input:({node:p,checked:r,...c})=>c.type==="checkbox"?t.jsx("input",{type:"checkbox",checked:r||!1,disabled:!0,readOnly:!0,className:"mr-2 w-4 h-4 accent-[primary] cursor-not-allowed",...c}):t.jsx("input",{...c}),code:({node:p,...r})=>r.className?.includes("language-")?t.jsx("code",{className:"block p-4 bg-card border border-border rounded-md overflow-x-auto text-sm font-mono text-foreground shadow-sm",...r}):t.jsx("code",{className:"px-1.5 py-0.5 bg-card border border-border rounded text-sm font-mono text-foreground",...r}),pre:({node:p,...r})=>t.jsx("pre",{className:"my-4 rounded-lg",...r}),h1:({node:p,...r})=>t.jsx("h1",{className:"text-2xl font-bold mt-6 mb-4 text-foreground border-b border-border pb-2",...r}),h2:({node:p,...r})=>t.jsx("h2",{className:"text-xl font-semibold mt-5 mb-3 text-foreground border-b border-border/50 pb-1.5",...r}),h3:({node:p,...r})=>t.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2 text-foreground",...r}),h4:({node:p,...r})=>t.jsx("h4",{className:"text-base font-semibold mt-3 mb-2 text-foreground",...r}),ul:({node:p,...r})=>{const c=p?.children?.some(d=>typeof d=="object"&&d!==null&&"type"in d&&d.type==="element"&&"tagName"in d&&d.tagName==="li"&&"children"in d&&Array.isArray(d.children)&&d.children.some(m=>typeof m=="object"&&m!==null&&"type"in m&&m.type==="element"&&"tagName"in m&&m.tagName==="input"&&"properties"in m&&typeof m.properties=="object"&&m.properties!==null&&"type"in m.properties&&m.properties.type==="checkbox"));return t.jsx("ul",{className:g("my-2 space-y-1 text-foreground",c?"list-none space-y-2":"list-disc list-inside"),...r})},ol:({node:p,...r})=>t.jsx("ol",{className:"list-decimal list-inside my-2 space-y-1 text-foreground",...r}),li:({node:p,...r})=>{const c=p?.children?.some(d=>typeof d=="object"&&d!==null&&"type"in d&&d.type==="element"&&"tagName"in d&&d.tagName==="input"&&"properties"in d&&typeof d.properties=="object"&&d.properties!==null&&"type"in d.properties&&d.properties.type==="checkbox");return t.jsx("li",{className:g("flex items-start",c?"gap-2":"ml-2"),...r})},a:({node:p,...r})=>t.jsx("a",{className:"text-primary hover:underline decoration-2 underline-offset-2 transition-all",target:"_blank",rel:"noopener noreferrer",...r}),p:({node:p,...r})=>t.jsx("p",{className:"my-2 text-foreground leading-relaxed",...r}),blockquote:({node:p,...r})=>t.jsx("blockquote",{className:"border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2 rounded-r-md shadow-sm",...r}),hr:({node:p,...r})=>t.jsx("hr",{className:"my-6 border-t border-border opacity-50",...r})};return t.jsxs("div",{ref:u,className:g("markdown-content prose prose-sm max-w-none dark:prose-invert",a),...l,children:[t.jsx(ts,{remarkPlugins:[Us],components:f,children:s}),e&&s&&t.jsx("span",{className:"inline-block ml-1 animate-typing text-primary",children:"..."})]})});Ht.displayName="Response";const ao={pending:"bg-transparent text-muted-foreground",in_progress:"bg-transparent text-muted-foreground",completed:"bg-transparent text-muted-foreground",failed:"bg-transparent text-muted-foreground"};function io({toolCall:s}){const[e,n]=i.useState(!1);return t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("button",{type:"button",className:"flex items-center gap-1.5 cursor-pointer bg-transparent border-none p-0 text-left group w-fit",onClick:()=>n(!e),"aria-expanded":e,children:[t.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded ${ao[s.status]}`,children:[t.jsx(Ts,{className:"h-3 w-3"}),t.jsx("span",{children:s.title}),s.status==="completed"&&t.jsx("span",{children:"✓"})]}),t.jsx("span",{className:"text-gray-400 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:e?"▲":"▼"})]}),e&&t.jsxs("div",{className:"mt-2 space-y-3 text-sm border border-gray-200 rounded-md p-3 bg-white shadow-sm max-w-full",children:[s.locations&&s.locations.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Files"}),t.jsx("ul",{className:"space-y-1",children:s.locations.map(o=>t.jsxs("li",{className:"font-mono text-xs text-gray-700 bg-gray-50 px-2 py-1 rounded",children:[o.path,o.line!==null&&o.line!==void 0&&`:${o.line}`]},`${o.path}:${o.line??""}`))})]}),s.rawInput&&Object.keys(s.rawInput).length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Input"}),t.jsx("div",{className:"bg-gray-50 p-2 rounded border border-gray-200",children:t.jsx(be,{value:s.rawInput,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent"}})})]}),s.content&&s.content.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Output"}),t.jsx("div",{className:"space-y-2",children:s.content.map((o,a)=>{const l=()=>o.type==="diff"&&"path"in o?`diff-${o.path}-${a}`:o.type==="terminal"&&"terminalId"in o?`terminal-${o.terminalId}`:o.type==="text"&&"text"in o?`text-${o.text.substring(0,20)}-${a}`:o.type==="content"&&"content"in o?`content-${o.content.text?.substring(0,20)}-${a}`:`block-${a}`,u=(f,p)=>{try{const r=JSON.parse(f);if(typeof r=="object"&&r!==null)return t.jsx("div",{className:"bg-gray-50 p-2 rounded border border-gray-200",children:t.jsx(be,{value:r,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent"}})},p)}catch{}return t.jsx("pre",{className:"bg-gray-50 p-2.5 rounded border border-gray-200 text-xs overflow-x-auto font-mono text-gray-800",children:f},p)};if(o.type==="content"&&"content"in o){const f=o.content;if(f.type==="text"&&f.text)return u(f.text,l())}return o.type==="text"&&"text"in o?u(o.text,l()):o.type==="diff"&&"path"in o&&"oldText"in o&&"newText"in o?t.jsxs("div",{className:"border rounded",children:[t.jsxs("div",{className:"bg-gray-100 px-2 py-1 text-xs font-mono",children:[o.path,"line"in o&&o.line!==null&&o.line!==void 0&&`:${o.line}`]}),t.jsxs("div",{className:"p-2 font-mono text-xs",children:[t.jsxs("div",{className:"text-red-600",children:["- ",o.oldText]}),t.jsxs("div",{className:"text-green-600",children:["+ ",o.newText]})]})]},l()):o.type==="terminal"&&"terminalId"in o?t.jsxs("div",{className:"bg-black text-green-400 p-2 rounded text-xs font-mono",children:["Terminal: ",o.terminalId]},l()):null})})]}),s.error&&t.jsxs("div",{className:"bg-red-50 border border-red-200 rounded p-2.5 text-red-700",children:[t.jsx("div",{className:"text-xs font-semibold text-red-600 uppercase tracking-wide mb-1.5",children:"Error"}),t.jsx("div",{className:"text-xs",children:s.error})]}),s.tokenUsage&&t.jsxs("div",{className:"bg-gray-50 border border-gray-200 rounded p-2.5",children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Token Usage"}),t.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs text-gray-700",children:[s.tokenUsage.inputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wide mb-0.5",children:"Input"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.inputTokens.toLocaleString()})]}),s.tokenUsage.outputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wide mb-0.5",children:"Output"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.outputTokens.toLocaleString()})]}),s.tokenUsage.totalTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wide mb-0.5",children:"Total"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.totalTokens.toLocaleString()})]})]})]}),s.startedAt&&t.jsxs("div",{className:"text-xs text-gray-500",children:["Started: ",new Date(s.startedAt).toLocaleTimeString(),s.completedAt&&t.jsxs(t.Fragment,{children:[" ","| Completed:"," ",new Date(s.completedAt).toLocaleTimeString()," (",Math.round((s.completedAt-s.startedAt)/1e3),"s)"]})]})]})]})}const Z=["Thinking","Pensando","Pensant","Denkend","Pensando","考えている","생각 중","思考中","Размышляя","Düşünüyor","Myślący","Tänkande","Pensando","Ajatellen","Σκεπτόμενος","חושב","सोच रहा है","Berpikir"],Ce=["...","·..",".·.","..·",".·.","·.."];function lo({startTime:s}){const[e,n]=i.useState(0),[o,a]=i.useState(()=>Z[Math.floor(Math.random()*Z.length)]),[l,u]=i.useState(0);i.useEffect(()=>{const r=setInterval(()=>{const d=Date.now()-s;n(d)},100);return()=>clearInterval(r)},[s]),i.useEffect(()=>{const r=setInterval(()=>{const c=Math.floor(Math.random()*Z.length);a(Z[c])},1500);return()=>clearInterval(r)},[]),i.useEffect(()=>{const r=setInterval(()=>{u(c=>(c+1)%Ce.length)},100);return()=>clearInterval(r)},[]);const f=(e/1e3).toFixed(1),p=Ce[l];return t.jsxs("span",{className:"text-muted-foreground text-sm",children:[o,p," ",f,"s"]})}const co=W("w-full px-4 py-3 rounded-xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors",{variants:{role:{user:"bg-primary text-primary-foreground shadow-sm",assistant:"text-foreground",system:"bg-card border border-border text-foreground opacity-80 text-sm"},variant:{default:"",outline:"border border-border",ghost:"bg-transparent"}},defaultVariants:{role:"assistant",variant:"default"}}),$t=i.forwardRef(({role:s,variant:e,isStreaming:n,message:o,thinkingDisplayStyle:a="collapsible",className:l,children:u,...f},p)=>{const r=S(y=>y.streamingStartTime),c=S(y=>y.currentModel),d=o&&!u,m=d?o.role:s||"assistant",x=d?o.isStreaming:n;let b=u;if(d){const y=o.metadata?.thinking,j=!!y,w=o.isStreaming&&!o.content&&o.role==="assistant";b=t.jsxs(t.Fragment,{children:[o.role==="assistant"&&j&&t.jsx(Ft,{content:y,isStreaming:o.isStreaming,mode:a,autoCollapse:!0}),w&&r&&t.jsxs("div",{className:"flex items-center gap-2 opacity-50",children:[t.jsx(nt,{className:"size-4 animate-spin text-muted-foreground"}),t.jsx(lo,{startTime:r})]}),o.role==="assistant"&&o.toolCalls&&o.toolCalls.length>0&&t.jsx("div",{className:"flex flex-col gap-2 mb-3",children:o.toolCalls.map(v=>t.jsx(io,{toolCall:v},v.id))}),o.role==="user"?t.jsx("div",{className:"whitespace-pre-wrap",children:o.content}):t.jsx(Ht,{content:o.content,isStreaming:o.isStreaming,showEmpty:!1}),o.role==="assistant"&&o.tokenUsage&&t.jsx("div",{className:"mt-3 pt-2 border-t border-border/30 text-xs text-muted-foreground/60",children:t.jsxs("span",{children:["Context:"," ",oo(o.tokenUsage.totalTokens??0,c??void 0)," ","(",(o.tokenUsage.totalTokens??0).toLocaleString()," ","tokens)"]})})]})}return t.jsx("div",{ref:p,className:g(co({role:m,variant:e}),x&&"animate-pulse-subtle",l),...f,children:b})});$t.displayName="MessageContent";const xe=i.forwardRef(({showIcons:s=!0,visibleTabs:e=["todo","files"],variant:n="default",className:o,...a},l)=>{const f=[{id:"todo",label:"To-do",icon:Ye},{id:"files",label:"Files",icon:Ze},{id:"database",label:"Database",icon:et}].filter(r=>e.includes(r.id)),p=n==="compact"?"gap-[4px]":"gap-3";return t.jsx(Q,{ref:l,className:g("w-full justify-start bg-transparent p-0 h-auto",p,o),...a,children:f.map(r=>{const c=r.icon;return t.jsxs(K,{value:r.id,className:g("gap-2 px-3 py-1.5 rounded-lg text-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[s&&c&&t.jsx(c,{className:"size-4"}),r.label]},r.id)})})});xe.displayName="PanelTabsHeader";const uo=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(We,{ref:o,className:g("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...n,children:[e,t.jsx(hs,{asChild:!0,children:t.jsx(ks,{className:"h-4 w-4 opacity-50"})})]}));uo.displayName=We.displayName;const Bt=i.forwardRef(({className:s,...e},n)=>t.jsx(Ve,{ref:n,className:g("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(pe,{className:"h-4 w-4"})}));Bt.displayName=Ve.displayName;const Wt=i.forwardRef(({className:s,...e},n)=>t.jsx(qe,{ref:n,className:g("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(ue,{className:"h-4 w-4"})}));Wt.displayName=qe.displayName;const po=i.forwardRef(({className:s,children:e,position:n="popper",...o},a)=>t.jsx(xs,{children:t.jsxs(Qe,{ref:a,className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...o,children:[t.jsx(Bt,{}),t.jsx(bs,{className:g("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),t.jsx(Wt,{})]})}));po.displayName=Qe.displayName;const fo=i.forwardRef(({className:s,...e},n)=>t.jsx(Ke,{ref:n,className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...e}));fo.displayName=Ke.displayName;const mo=i.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Ge,{ref:o,className:g("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(ys,{children:t.jsx(tt,{className:"h-4 w-4"})})}),t.jsx(ws,{children:e})]}));mo.displayName=Ge.displayName;const go=i.forwardRef(({className:s,...e},n)=>t.jsx(Xe,{ref:n,className:g("-mx-1 my-1 h-px bg-muted",s),...e}));go.displayName=Xe.displayName;const Vt=i.forwardRef(({task:s,collapsible:e=!0,defaultExpanded:n=!1,onTaskClick:o,className:a,...l},u)=>{const[f,p]=i.useState(n),r=!!(s.details||s.files&&s.files.length>0),c={pending:st,in_progress:nt,completed:Is}[s.status],d=()=>{switch(s.status){case"completed":return"text-green-500";case"in_progress":return"text-primary";default:return"text-foreground opacity-40"}},m=()=>{r&&e&&p(!f),o?.(s)};return t.jsxs("div",{ref:u,className:g("rounded-lg border border-border bg-card transition-all","hover:shadow-sm hover:border-border/80",a),...l,children:[t.jsxs("button",{type:"button",onClick:m,className:g("w-full flex items-center gap-3 px-3 py-2.5 text-left",r&&e&&"cursor-pointer"),disabled:!r&&!e,children:[t.jsx(c,{className:g("w-4 h-4 shrink-0",d(),s.status==="in_progress"&&"animate-spin")}),t.jsx("span",{className:g("flex-1 text-sm font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"font-medium"),children:s.text}),r&&e&&t.jsx(ue,{className:g("w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0",f&&"rotate-180"),"aria-hidden":"true"})]}),r&&f&&t.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn",children:[s.details&&t.jsx("p",{className:"text-sm text-foreground opacity-80 leading-relaxed mb-2",children:s.details}),s.files&&s.files.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",children:"Files:"}),t.jsx("div",{className:"space-y-1",children:s.files.map(x=>t.jsx("div",{className:"text-xs font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50",children:x},x))})]})]})]})});Vt.displayName="Task";const ho=i.forwardRef(({tasks:s,collapsible:e=!0,onTaskClick:n,emptyMessage:o="No tasks yet.",className:a,...l},u)=>t.jsx("div",{ref:u,className:g("space-y-2 max-h-96 overflow-y-auto",a),...l,children:s.length===0?t.jsx("p",{className:"text-sm text-foreground opacity-60 italic py-4 text-center",children:o}):s.map(f=>t.jsx(Vt,{task:f,collapsible:e,...n?{onTaskClick:n}:{}},f.id))}));ho.displayName="TaskList";const xo=W("flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),bo=i.forwardRef(({className:s,autoResize:e=!1,maxHeight:n=200,variant:o,...a},l)=>{const u=i.useRef(null),f=i.useCallback(r=>{u.current=r,typeof l=="function"?l(r):l&&(l.current=r)},[l]),p=i.useCallback(()=>{const r=u.current;if(!r||!e)return;r.style.height="auto";const c=Math.min(r.scrollHeight,n);r.style.height=`${c}px`,r.scrollHeight>n?r.style.overflowY="auto":r.style.overflowY="hidden"},[e,n]);return i.useEffect(()=>{p()},[p]),t.jsx("textarea",{className:g(xo({variant:o}),e&&"overflow-y-hidden",s),ref:f,...a})});bo.displayName="Textarea";const B=$("gui");function yo({agentName:s}){const{isExpanded:e,setIsExpanded:n}=me();return t.jsxs("div",{className:"flex lg:hidden items-center gap-2 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx("h1",{className:"text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-foreground",children:s}),t.jsx("div",{className:"flex items-center justify-center shrink-0",children:t.jsx(pe,{className:"size-4 rotate-180 text-muted-foreground"})})]}),t.jsx("button",{type:"button",className:"flex items-center justify-center shrink-0 cursor-pointer","aria-label":"Toggle menu",onClick:()=>n(!e),children:t.jsx(ot,{className:"size-4 text-muted-foreground"})})]})}function wo({agentName:s,todos:e,showHeader:n}){const{panelSize:o,setPanelSize:a}=ge();return t.jsxs(ht,{className:g("border-b border-border bg-card relative lg:p-0","[border-bottom-width:0.5px]"),children:[t.jsxs("div",{className:"hidden lg:flex items-center gap-2 w-full h-16 py-5 pl-6 pr-4",children:[n&&t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx("h1",{className:"text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-foreground",children:s}),t.jsx("div",{className:"flex items-center justify-center shrink-0",children:t.jsx(pe,{className:"size-4 rotate-180 text-muted-foreground"})})]}),!n&&t.jsx("div",{className:"flex-1"}),t.jsx("button",{type:"button",className:"flex items-center justify-center shrink-0 cursor-pointer","aria-label":"Toggle sidebar",onClick:()=>{a(o==="hidden"?"small":"hidden")},children:t.jsx(ot,{className:"size-4 text-muted-foreground"})})]}),t.jsx(yo,{agentName:s}),t.jsx(xt,{className:g("pt-6 pb-8 px-6","border-b border-border bg-card","shadow-[0_4px_16px_0_rgba(0,0,0,0.04)]","[border-bottom-width:0.5px]"),children:t.jsxs(he,{defaultValue:"todo",className:"w-full",children:[t.jsx(xe,{showIcons:!0,visibleTabs:["todo","files"],variant:"default"}),t.jsx(F,{value:"todo",className:"mt-4",children:t.jsx(oe,{todos:e})}),t.jsx(F,{value:"files",className:"mt-4",children:t.jsx(re,{})})]})})]})}function vo({client:s}){const{connectionStatus:e,connect:n,sessionId:o}=Bs(s),{messages:a}=ct(s);Ws(s);const l=S(m=>m.error),[u,f]=i.useState("Agent"),[p,r]=i.useState(typeof window<"u"?window.innerWidth>=1024:!0);i.useEffect(()=>{B.debug("Connection status changed",{status:e}),e==="error"&&l&&B.error("Connection error occurred",{error:l})},[e,l]),i.useEffect(()=>{if(s&&o){const m=s.getCurrentSession();m?.metadata?.agentName&&f(m.metadata.agentName)}},[s,o]),i.useEffect(()=>{const m=window.matchMedia("(min-width: 1024px)"),x=b=>{r(b.matches)};return r(m.matches),m.addEventListener("change",x),()=>{m.removeEventListener("change",x)}},[]);const c=[],d=[{id:"model-sonnet",label:"Use Sonnet 4.5",description:"Switch to Claude Sonnet 4.5 model",icon:t.jsx(ye,{className:"h-4 w-4"}),category:"model",onSelect:()=>{B.info("User selected Sonnet 4.5 model")}},{id:"model-opus",label:"Use Opus",description:"Switch to Claude Opus model",icon:t.jsx(ye,{className:"h-4 w-4"}),category:"model",onSelect:()=>{B.info("User selected Opus model")}},{id:"settings",label:"Open Settings",description:"Configure chat preferences",icon:t.jsx(Rs,{className:"h-4 w-4"}),category:"action",onSelect:()=>{B.info("User opened settings")}},{id:"code-mode",label:"Code Mode",description:"Enable code-focused responses",icon:t.jsx(Ms,{className:"h-4 w-4"}),category:"mode",onSelect:()=>{B.info("User enabled code mode")}}];return t.jsxs(Rt,{defaultPanelSize:"hidden",defaultActiveTab:"todo",children:[t.jsxs(Mt,{children:[t.jsx(wo,{agentName:u,todos:c,showHeader:a.length>0}),e==="error"&&l&&t.jsx("div",{className:"border-b border-red-500/20 bg-red-500/10 px-6 py-4",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"mb-1 text-sm font-semibold text-red-500",children:"Connection Error"}),t.jsx("p",{className:"whitespace-pre-line text-sm text-foreground",children:l})]}),t.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600",children:"Retry"})]})}),t.jsxs(Ut,{children:[t.jsx(At,{className:a.length>0?"pt-4":"",children:a.length===0?t.jsx("div",{className:"flex flex-1 items-center px-4",children:t.jsx(mt,{title:u,description:"This agent can help you with your tasks. Start a conversation by typing a message below.",suggestedPrompts:["Help me debug this code","Explain how this works","Create a new feature","Review my changes"],onPromptClick:m=>{B.info("Prompt clicked",{prompt:m})}})}):t.jsx("div",{className:"flex flex-col gap-4 px-4",children:a.map((m,x)=>t.jsx(Ot,{message:m,isLastMessage:x===a.length-1,children:t.jsx($t,{message:m,thinkingDisplayStyle:"collapsible"})},m.id))})}),t.jsx(Dt,{children:t.jsxs(wt,{client:s,children:[t.jsx(kt,{commands:d}),t.jsx(vt,{placeholder:"Type a message or / for commands...",autoFocus:!0}),t.jsxs(jt,{children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Ct,{}),t.jsx(St,{})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Tt,{}),t.jsx(Nt,{children:t.jsx(Es,{className:"size-4"})})]})]})]})})]})]}),p&&t.jsx(_t,{breakpoint:"lg",children:t.jsxs(he,{defaultValue:"todo",className:"flex flex-col h-full",children:[t.jsx("div",{className:g("border-b border-border bg-card","px-6 py-2 h-16","flex items-center","[border-bottom-width:0.5px]"),children:t.jsx(xe,{showIcons:!0,visibleTabs:["todo","files"],variant:"compact"})}),t.jsx(F,{value:"todo",className:"flex-1 p-4 mt-0",children:t.jsx(oe,{todos:c})}),t.jsx(F,{value:"files",className:"flex-1 p-4 mt-0",children:t.jsx(re,{})})]})})]})}function No(){return"http://localhost:3100"}const Se={agentServerUrl:No()},q=$("gui");function jo(){const[s,e]=i.useState(null),[n,o]=i.useState(null);return i.useEffect(()=>{try{q.info("Initializing ACP client",{serverUrl:Se.agentServerUrl});const a=new Xs({type:"http",options:{baseUrl:Se.agentServerUrl}});return e(a),q.info("ACP client initialized successfully"),()=>{q.debug("Disconnecting ACP client"),a.disconnect().catch(l=>{q.error("Failed to disconnect ACP client",{error:l instanceof Error?l.message:String(l)})})}}catch(a){const l=a instanceof Error?a.message:"Failed to initialize ACP client";o(l),q.error("Failed to initialize ACP client",{error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0});return}},[]),n?t.jsx("div",{className:"flex items-center justify-center h-screen bg-[var(--color-bg)]",children:t.jsxs("div",{className:"text-center p-8 max-w-md",children:[t.jsx("h1",{className:"text-2xl font-bold text-red-500 mb-4",children:"Initialization Error"}),t.jsx("p",{className:"text-[var(--color-text)] mb-4",children:n}),t.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Failed to initialize the ACP client. Check the console for details."})]})}):t.jsx(vo,{client:s})}const qt=document.getElementById("root");if(!qt)throw new Error("Root element not found");ss.createRoot(qt).render(t.jsx(ns.StrictMode,{children:t.jsx(jo,{})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-zinc-100:oklch(96.7% .001 286.375);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--max-width-prose:477px;--color-background:hsl(var(--background));--color-foreground:hsl(var(--foreground));--color-card:hsl(var(--card));--color-card-foreground:hsl(var(--card-foreground));--color-popover:hsl(var(--popover));--color-popover-foreground:hsl(var(--popover-foreground));--color-primary:hsl(var(--primary));--color-primary-foreground:hsl(var(--primary-foreground));--color-secondary:hsl(var(--secondary));--color-secondary-foreground:hsl(var(--secondary-foreground));--color-muted:hsl(var(--muted));--color-muted-foreground:hsl(var(--muted-foreground));--color-accent:hsl(var(--accent));--color-accent-foreground:hsl(var(--accent-foreground));--color-destructive:hsl(var(--destructive));--color-destructive-foreground:hsl(var(--destructive-foreground));--color-border:hsl(var(--border));--color-input:hsl(var(--input));--color-ring:hsl(var(--ring));--color-text-primary:hsl(var(--text-primary));--color-text-secondary:hsl(var(--text-secondary));--color-text-tertiary:hsl(var(--text-tertiary));--max-width-chat:720px;--max-width-prompt-container:393px;--letter-spacing-tight:-.48px;--letter-spacing-uppercase:1.12px;--font-size-heading-3:1.5rem;--line-height-heading-3:1.2;--font-size-subheading:1.25rem;--line-height-subheading:1.5;--font-size-label:.875rem;--line-height-label:1.5}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}button{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-16{height:calc(var(--spacing)*16)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[6lh\]{max-height:6lh}.min-h-\[80px\]{min-height:80px}.min-h-\[200px\]{min-height:200px}.min-h-full{min-height:100%}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-10{width:calc(var(--spacing)*10)}.w-64{width:calc(var(--spacing)*64)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[80\%\]{max-width:80%}.max-w-\[90\%\]{max-width:90%}.max-w-\[200px\]{max-width:200px}.max-w-chat{max-width:var(--max-width-chat)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-prompt-container{max-width:var(--max-width-prompt-container)}.max-w-prose{max-width:var(--max-width-prose)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[4px\]{gap:4px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[border-bottom-width\:0\.5px\]{border-bottom-width:.5px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-none{--tw-border-style:none;border-style:none}.border-\[primary\]{border-color:primary}.border-border{border-color:var(--color-border)}.border-border\/30{border-color:color-mix(in srgb,hsl(var(--border))30%,transparent)}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,var(--color-border)30%,transparent)}}.border-border\/50{border-color:color-mix(in srgb,hsl(var(--border))50%,transparent)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-destructive{border-color:var(--color-destructive)}.border-gray-200{border-color:var(--color-gray-200)}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--color-input)}.border-red-200{border-color:var(--color-red-200)}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-\[var\(--color-bg\)\]{background-color:var(--color-bg)}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive{background-color:var(--color-destructive)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted{background-color:var(--color-muted)}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.from-background{--tw-gradient-from:var(--color-background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1\.5{padding-bottom:calc(var(--spacing)*1.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-8{padding-bottom:calc(var(--spacing)*8)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[20px\]{font-size:20px}.leading-\[1\.2\]{--tw-leading:1.2;line-height:1.2}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\[var\(--font-family\)\]{--tw-font-weight:var(--font-family);font-weight:var(--font-family)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.4px\]{--tw-tracking:-.4px;letter-spacing:-.4px}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--color-text\)\]{color:var(--color-text)}.text-\[var\(--color-text-secondary\)\]{color:var(--color-text-secondary)}.text-\[var\(--font-size\)\]{color:var(--font-size)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-foreground{color:var(--color-foreground)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-muted-foreground\/60{color:color-mix(in srgb,hsl(var(--muted-foreground))60%,transparent)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,var(--color-muted-foreground)60%,transparent)}}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.text-text-tertiary{color:var(--color-text-tertiary)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.accent-\[primary\]{accent-color:primary}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-\[0_4px_16px_0_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--color-muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--color-primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--color-muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--color-primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--color-border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--color-background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--color-foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}@media(hover:hover){.hover\:border-border\/80:hover{border-color:color-mix(in srgb,hsl(var(--border))80%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/80:hover{border-color:color-mix(in oklab,var(--color-border)80%,transparent)}}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-background:hover{background-color:var(--color-background)}.hover\:bg-card:hover{background-color:var(--color-card)}.hover\:bg-card\/80:hover{background-color:color-mix(in srgb,hsl(var(--card))80%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/80:hover{background-color:color-mix(in oklab,var(--color-card)80%,transparent)}}.hover\:bg-card\/90:hover{background-color:color-mix(in srgb,hsl(var(--card))90%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/90:hover{background-color:color-mix(in oklab,var(--color-card)90%,transparent)}}.hover\:bg-destructive\/90:hover{background-color:color-mix(in srgb,hsl(var(--destructive))90%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--color-destructive)90%,transparent)}}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-primary\/90:hover{background-color:color-mix(in srgb,hsl(var(--primary))90%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:bg-secondary\/80:hover{background-color:color-mix(in srgb,hsl(var(--secondary))80%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:bg-muted:focus{background-color:var(--color-muted)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:text-foreground:focus{color:var(--color-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive:focus-visible{--tw-ring-color:var(--color-destructive)}.focus-visible\:ring-green-500:focus-visible{--tw-ring-color:var(--color-green-500)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--color-background)}.data-\[state\=active\]\:bg-transparent[data-state=active]{background-color:#0000}.data-\[state\=active\]\:bg-zinc-100[data-state=active]{background-color:var(--color-zinc-100)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--color-foreground)}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=active\]\:shadow-none[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=inactive\]\:text-muted-foreground[data-state=inactive]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:bg-muted[data-state=open]{background-color:var(--color-muted)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}@media(min-width:40rem){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:block{display:block}}@media(min-width:64rem){.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:p-0{padding:calc(var(--spacing)*0)}}@media(min-width:80rem){.xl\:block{display:block}}@media(min-width:96rem){.\32xl\:block{display:block}}@media(prefers-color-scheme:dark){.dark\:bg-transparent{background-color:#0000}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.text-heading-3{font-size:var(--font-size-heading-3);line-height:var(--line-height-heading-3);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-subheading{font-size:var(--font-size-subheading);line-height:var(--line-height-subheading);font-weight:400}.text-label{font-size:var(--font-size-label);line-height:var(--line-height-label);letter-spacing:var(--letter-spacing-uppercase);text-transform:uppercase;font-weight:500}}:root{--background:0 0% 100%;--foreground:222.2 84% 4.9%;--card:0 0% 100%;--card-foreground:222.2 84% 4.9%;--popover:0 0% 100%;--popover-foreground:222.2 84% 4.9%;--primary:222.2 47.4% 11.2%;--primary-foreground:210 40% 98%;--secondary:210 40% 96.1%;--secondary-foreground:222.2 47.4% 11.2%;--muted:210 40% 96.1%;--muted-foreground:215.4 16.3% 46.9%;--accent:210 40% 96.1%;--accent-foreground:222.2 47.4% 11.2%;--destructive:0 84.2% 60.2%;--destructive-foreground:210 40% 98%;--border:214.3 31.8% 91.4%;--input:214.3 31.8% 91.4%;--ring:222.2 84% 4.9%;--radius:.5rem;--text-primary:0 0% 9.02%;--text-secondary:0 0% 32.16%;--text-tertiary:0 0% 45.1%}.dark{--background:222.2 84% 4.9%;--foreground:210 40% 98%;--card:222.2 84% 4.9%;--card-foreground:210 40% 98%;--popover:222.2 84% 4.9%;--popover-foreground:210 40% 98%;--primary:210 40% 98%;--primary-foreground:222.2 47.4% 11.2%;--secondary:217.2 32.6% 17.5%;--secondary-foreground:210 40% 98%;--muted:217.2 32.6% 17.5%;--muted-foreground:215 20.2% 65.1%;--accent:217.2 32.6% 17.5%;--accent-foreground:210 40% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:210 40% 98%;--border:217.2 32.6% 17.5%;--input:217.2 32.6% 17.5%;--ring:212.7 26.8% 83.9%;--text-primary:0 0% 98%;--text-secondary:0 0% 70%;--text-tertiary:0 0% 55%}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes slideDownAndFade{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideLeftAndFade{0%{opacity:0;transform:translate(2px)}to{opacity:1;transform:translate(0)}}@keyframes slideUpAndFade{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideRightAndFade{0%{opacity:0;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes pulse{50%{opacity:.5}}
|