hermium 0.3.3 → 0.3.5
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/dist/public/assets/js/ChatInputBlock-DtDwhu-o.js +1 -0
- package/dist/public/assets/js/MarkdownMessage-HqtkizAq.js +1 -0
- package/dist/public/assets/js/chat._sessionId-CQhAWRie.js +1 -0
- package/dist/public/assets/js/chat.index-Rey-yJNu.js +1 -0
- package/dist/public/assets/js/index-DaPM5Pp6.js +1 -0
- package/dist/public/assets/js/index-lcPGeFiu.js +60 -0
- package/dist/public/assets/js/memory-hKlWOmsk.js +3 -0
- package/dist/public/assets/js/settings-CgEeK7SY.js +1 -0
- package/dist/public/assets/js/skills-Os0vuATW.js +1 -0
- package/dist/public/assets/js/usage-Bkxk-UWX.js +1 -0
- package/dist/server/_ssr/{ChatInputBlock-BTSt3ldw.mjs → ChatInputBlock-Dax0BiWA.mjs} +1 -1
- package/dist/server/_ssr/{MarkdownMessage-DzImLKnw.mjs → MarkdownMessage-Cwh9eBP2.mjs} +1 -1
- package/dist/server/_ssr/{chat._sessionId-CUSsvbBX.mjs → chat._sessionId-CI4x2myS.mjs} +4 -4
- package/dist/server/_ssr/{chat.index-YqIyLr2b.mjs → chat.index-CkW4HXDE.mjs} +1 -1
- package/dist/server/_ssr/{index-Be17Jodh.mjs → index-CZIkem83.mjs} +2 -2
- package/dist/server/_ssr/{index--T6rScER.mjs → index-Cnfau46H.mjs} +2 -2
- package/dist/server/_ssr/{memory-DLVdk8UN.mjs → memory-DNXYkaz6.mjs} +3 -3
- package/dist/server/_ssr/{router-C0m-TE_e.mjs → router-BHawbDFJ.mjs} +39 -20
- package/dist/server/_ssr/{skills-DAVualEA.mjs → skills-De5OAjih.mjs} +5 -34
- package/dist/server/_ssr/{usage-CCOujow3.mjs → usage-CDQOB3tW.mjs} +1 -1
- package/dist/server/_tanstack-start-manifest_v-CZgpkRLi.mjs +4 -0
- package/dist/server/index.mjs +103 -117
- package/dist/server/public/assets/js/ChatInputBlock-DtDwhu-o.js +1 -0
- package/dist/server/public/assets/js/MarkdownMessage-HqtkizAq.js +1 -0
- package/dist/server/public/assets/js/chat._sessionId-CQhAWRie.js +1 -0
- package/dist/server/public/assets/js/chat.index-Rey-yJNu.js +1 -0
- package/dist/server/public/assets/js/index-DaPM5Pp6.js +1 -0
- package/dist/server/public/assets/js/index-lcPGeFiu.js +60 -0
- package/dist/server/public/assets/js/memory-hKlWOmsk.js +3 -0
- package/dist/server/public/assets/js/settings-CgEeK7SY.js +1 -0
- package/dist/server/public/assets/js/skills-Os0vuATW.js +1 -0
- package/dist/server/public/assets/js/usage-Bkxk-UWX.js +1 -0
- package/package.json +1 -1
- package/dist/public/assets/js/ChatInputBlock-D4CYR2D_.js +0 -1
- package/dist/public/assets/js/MarkdownMessage-Bu4diQAT.js +0 -1
- package/dist/public/assets/js/base-ui-DKZpRETY.js +0 -1
- package/dist/public/assets/js/chat._sessionId-IyYhnI65.js +0 -1
- package/dist/public/assets/js/chat.index-CdO1bi1g.js +0 -1
- package/dist/public/assets/js/index-CGq67I5U.js +0 -60
- package/dist/public/assets/js/index-CYDXRqze.js +0 -1
- package/dist/public/assets/js/memory-BC-tVM26.js +0 -3
- package/dist/public/assets/js/router-Cdi9aGOg.js +0 -1
- package/dist/public/assets/js/settings-CthZPCPZ.js +0 -1
- package/dist/public/assets/js/skills-COr12qk7.js +0 -1
- package/dist/public/assets/js/usage-oWmLZ5Lt.js +0 -1
- package/dist/server/_tanstack-start-manifest_v-wG3l04YA.mjs +0 -4
- package/dist/server/public/assets/js/ChatInputBlock-D4CYR2D_.js +0 -1
- package/dist/server/public/assets/js/MarkdownMessage-Bu4diQAT.js +0 -1
- package/dist/server/public/assets/js/base-ui-DKZpRETY.js +0 -1
- package/dist/server/public/assets/js/chat._sessionId-IyYhnI65.js +0 -1
- package/dist/server/public/assets/js/chat.index-CdO1bi1g.js +0 -1
- package/dist/server/public/assets/js/index-CGq67I5U.js +0 -60
- package/dist/server/public/assets/js/index-CYDXRqze.js +0 -1
- package/dist/server/public/assets/js/memory-BC-tVM26.js +0 -3
- package/dist/server/public/assets/js/router-Cdi9aGOg.js +0 -1
- package/dist/server/public/assets/js/settings-CthZPCPZ.js +0 -1
- package/dist/server/public/assets/js/skills-COr12qk7.js +0 -1
- package/dist/server/public/assets/js/usage-oWmLZ5Lt.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as t,x,D as n,J as o,g as R,s as B,B as g,i as L,k as U,m as F,a as K}from"./index-lcPGeFiu.js";function M({className:d,...i}){return t.jsx("textarea",{"data-slot":"textarea",className:x("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",d),...i})}function E({onCreateSession:d}){const[i,m]=n.useState(""),[a,u]=n.useState([]),[j,p]=n.useState(!1),l=n.useRef(null),f=n.useRef(null),h=o(e=>e.sendMessage),w=o(e=>e.abortStream),N=o(e=>e.isStreaming),y=o(e=>e.activeSessionId),v=n.useCallback(e=>{if(!e)return;const s=[];for(const r of Array.from(e))s.push({id:Math.random().toString(36).slice(2),name:r.name,type:r.type||"application/octet-stream",size:r.size,url:URL.createObjectURL(r),file:r});u(r=>[...r,...s])},[]),k=n.useCallback(e=>{u(s=>{const r=s.find(c=>c.id===e);return r&&URL.revokeObjectURL(r.url),s.filter(c=>c.id!==e)})},[]),b=async()=>{const e=i.trim();if(!e&&a.length===0)return;if(d){const r=await o.getState().createNewSession();if(r){d(r),m(""),l.current&&(l.current.value="");const c=a.length>0?a:void 0;u([]),await h(e,void 0,c)}return}if(!y&&!await o.getState().createNewSession())return;m(""),l.current&&(l.current.value="");const s=a.length>0?a:void 0;u([]),await h(e,void 0,s)},S=e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),b())},D=e=>{e.preventDefault(),p(!0)},I=e=>{e.preventDefault(),p(!1)},z=e=>{e.preventDefault(),p(!1),v(e.dataTransfer.files)},C=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`,A=e=>e.startsWith("image/");return t.jsx("div",{className:"flex flex-col gap-2 w-full",children:t.jsxs("div",{className:x("flex min-h-[120px] flex-col rounded-2xl cursor-text bg-card border border-border shadow-lg transition-colors",j&&"border-primary ring-2 ring-primary/20"),onDragOver:D,onDragLeave:I,onDrop:z,children:[a.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2 p-3 pb-0",children:a.map(e=>t.jsxs("div",{className:"group relative flex items-center gap-2 rounded-lg border bg-muted/50 px-2 py-1.5 pr-7 text-xs",children:[A(e.type)?t.jsx("img",{src:e.url,alt:e.name,className:"h-6 w-6 rounded object-cover"}):t.jsx(R,{className:"size-4 text-muted-foreground shrink-0"}),t.jsx("span",{className:"truncate max-w-[120px]",children:e.name}),t.jsx("span",{className:"text-muted-foreground/60",children:C(e.size)}),t.jsx("button",{onClick:()=>k(e.id),className:"absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center rounded p-0.5 text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(B,{className:"size-3"})})]},e.id))}),t.jsx("div",{className:"flex-1 relative overflow-y-auto max-h-[258px]",children:t.jsx(M,{ref:l,value:i,onChange:e=>m(e.target.value),onKeyDown:S,placeholder:"Ask anything",className:"w-full border-0 p-3 transition-[padding] duration-200 ease-in-out min-h-[48.4px] outline-none text-[16px] text-foreground resize-none shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent! whitespace-pre-wrap break-words"})}),t.jsxs("div",{className:"flex min-h-[40px] items-center gap-2 p-2 pb-1",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("input",{ref:f,type:"file",multiple:!0,className:"hidden",onChange:e=>v(e.target.files)}),t.jsx(g,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground transition-colors duration-100 ease-out",title:"Attach files","aria-label":"Attach files",onClick:()=>f.current?.click(),children:t.jsx(L,{className:"h-5 w-5"})}),t.jsx(g,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground transition-colors duration-100 ease-out",title:"Attach images","aria-label":"Attach images",onClick:()=>f.current?.click(),children:t.jsx(U,{className:"h-5 w-5"})})]}),t.jsx("div",{className:"ml-auto flex items-center gap-3",children:N?t.jsx(g,{variant:"ghost",size:"icon-sm",onClick:w,className:"rounded-full bg-destructive hover:bg-destructive/90 text-destructive-foreground transition-colors cursor-pointer",title:"Stop generating","aria-label":"Stop generating",children:t.jsx(F,{className:"h-4 w-4"})}):t.jsx(g,{variant:"ghost",size:"icon-sm",onClick:b,className:x("rounded-full transition-colors duration-100 ease-out cursor-pointer bg-primary",(i||a.length>0)&&"bg-primary hover:bg-primary/90!"),disabled:!i&&a.length===0,"aria-label":"Send message",children:t.jsx(K,{className:"h-4 w-4 text-primary-foreground"})})})]})]})})}export{E as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as s,M as m,E as d,F as n}from"./index-lcPGeFiu.js";function c({content:a,isStreaming:l}){return s.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none leading-relaxed",children:[s.jsx(m,{remarkPlugins:[n],rehypePlugins:[d],components:{p:({children:e})=>s.jsx("p",{className:"mb-3 last:mb-0",children:e}),h1:({children:e})=>s.jsx("h1",{className:"text-xl font-semibold mt-4 mb-2",children:e}),h2:({children:e})=>s.jsx("h2",{className:"text-lg font-semibold mt-3 mb-2",children:e}),h3:({children:e})=>s.jsx("h3",{className:"text-base font-semibold mt-2 mb-1",children:e}),ul:({children:e})=>s.jsx("ul",{className:"list-disc pl-5 mb-3 space-y-1",children:e}),ol:({children:e})=>s.jsx("ol",{className:"list-decimal pl-5 mb-3 space-y-1",children:e}),li:({children:e})=>s.jsx("li",{className:"marker:text-muted-foreground",children:e}),code:({className:e,children:r,...t})=>{if(!(e?.includes("hljs")||e?.includes("language-")))return s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-sm font-mono text-foreground",...t,children:r});const o=e?.match(/language-(\w+)/)?.[1];return s.jsxs("div",{className:"relative my-3 rounded-lg border bg-muted/50 overflow-hidden",children:[o&&s.jsx("div",{className:"flex items-center justify-between px-3 py-1.5 bg-muted border-b text-[10px] text-muted-foreground font-mono uppercase",children:s.jsx("span",{children:o})}),s.jsx("pre",{className:"p-3 overflow-x-auto text-sm leading-relaxed m-0",children:s.jsx("code",{className:e,...t,children:r})})]})},blockquote:({children:e})=>s.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-4 italic text-muted-foreground my-3",children:e}),a:({href:e,children:r})=>s.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80 transition-colors",children:r}),table:({children:e})=>s.jsx("div",{className:"overflow-x-auto my-3 rounded-lg border",children:s.jsx("table",{className:"w-full text-sm border-collapse",children:e})}),thead:({children:e})=>s.jsx("thead",{className:"bg-muted border-b",children:e}),th:({children:e})=>s.jsx("th",{className:"px-3 py-2 text-left font-medium text-foreground",children:e}),td:({children:e})=>s.jsx("td",{className:"px-3 py-2 border-b border-muted",children:e}),hr:()=>s.jsx("hr",{className:"my-4 border-border"}),strong:({children:e})=>s.jsx("strong",{className:"font-semibold text-foreground",children:e})},children:a}),l&&s.jsx("span",{className:"inline-block w-0.5 h-4 bg-foreground/70 ml-0.5 align-text-bottom animate-pulse"})]})}export{c as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as m,C as e,g as w,D as d,e as v,x as p,h as f,c as y,f as C,L as k,S,u as I}from"./index-lcPGeFiu.js";import{M as g}from"./MarkdownMessage-HqtkizAq.js";import{C as T}from"./ChatInputBlock-DtDwhu-o.js";function M({text:t}){const[s,r]=d.useState(!1),a=async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),2e3)};return e.jsxs("button",{onClick:a,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground/50 hover:text-foreground hover:bg-muted transition-colors","aria-label":"Copy message",children:[s?e.jsx(y,{className:"size-3"}):e.jsx(C,{className:"size-3"}),s?"Copied":"Copy"]})}function E(t){const s=Math.floor(t/1e3);if(s<60)return`${s}s`;const r=Math.floor(s/60),a=s%60;return a===0?`${r}m`:`${r}m ${a}s`}function j({reasoning:t,isStreaming:s,startedAt:r,endedAt:a}){const[o,l]=d.useState(s??!1),[n,u]=d.useState(Date.now()),i=d.useRef(null);if(d.useEffect(()=>{l(s??!1)},[s]),d.useEffect(()=>{if(s&&r&&!a)return i.current=setInterval(()=>u(Date.now()),1e3),()=>{i.current&&clearInterval(i.current)};i.current&&(clearInterval(i.current),i.current=null)},[s,r,a]),!t.trim())return null;const x=r?Math.max(0,(a??(s?n:r))-r):null,h=[...t].length,c=s&&r&&!a;return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>l(!o),className:p("inline-flex items-center gap-1.5 text-[11px] transition-colors",c?"text-amber-500 dark:text-amber-400 font-medium":"text-muted-foreground/70 hover:text-foreground"),children:[e.jsx(v,{className:p("size-3 shrink-0 transition-transform",o&&"rotate-90")}),c?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(f,{className:"size-2.5 animate-spin"}),"thinking…"]}):e.jsx("span",{children:"thought"}),x!==null&&x>0&&e.jsxs("span",{className:"text-muted-foreground/60 tabular-nums",children:["· ",E(x)]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["· ",h.toLocaleString()," chars"]})]}),o&&e.jsx("div",{className:"mt-1 rounded-md bg-amber-50 dark:bg-amber-950/20 px-2.5 py-1.5 text-[11px] text-muted-foreground leading-relaxed whitespace-pre-wrap font-mono border border-amber-200 dark:border-amber-800/30",children:t})]})}function N(t){if(!t)return null;try{const s=JSON.parse(t);return{text:JSON.stringify(s,null,2),isJson:!0}}catch{return{text:t,isJson:!1}}}function b({tools:t}){const[s,r]=d.useState(!1);if(!t?.length)return null;const a=t.filter(n=>n.status==="running").length,o=t.filter(n=>n.status==="done").length,l=t.filter(n=>n.status==="error").length;return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>r(!s),className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground/70 hover:text-foreground transition-colors",children:[e.jsx(v,{className:p("size-3 shrink-0 transition-transform",s&&"rotate-90")}),e.jsxs("span",{children:["used ",t.length," tool",t.length>1?"s":""]}),a>0&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-amber-500",children:[e.jsx(f,{className:"size-2.5 animate-spin"}),a]}),o>0&&e.jsxs("span",{className:"text-emerald-500",children:[o," done"]}),l>0&&e.jsxs("span",{className:"text-red-500",children:[l," error"]}),t.length>0&&a===0&&e.jsxs("span",{className:"text-muted-foreground/50 truncate max-w-[200px]",children:["— ",t.map(n=>n.name).join(", ")]})]}),s&&e.jsx("div",{className:"mt-1 flex flex-col gap-1.5",children:t.map((n,u)=>{const i=N(n.preview),x=N(n.output);return e.jsxs("div",{className:"rounded-md bg-muted/40 border border-border/50 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-foreground/80 font-mono",children:n.name}),n.status==="running"&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-amber-500",children:[e.jsx(f,{className:"size-2.5 animate-spin"}),"running"]}),n.status==="done"&&e.jsx("span",{className:"text-[10px] text-emerald-500",children:"✓ done"}),n.status==="error"&&e.jsx("span",{className:"text-[10px] text-red-500",children:"✗ error"})]}),i&&e.jsxs("div",{className:"border-t border-border/30",children:[e.jsx("div",{className:"px-2.5 py-0.5 text-[9px] uppercase tracking-wider text-muted-foreground/60",children:"Arguments"}),e.jsx("div",{className:"px-2.5 pb-1.5",children:e.jsx("pre",{className:p("text-[10px] leading-relaxed overflow-x-auto font-mono whitespace-pre-wrap max-h-[200px] overflow-y-auto rounded",i.isJson?"bg-slate-900/10 dark:bg-slate-900/40 text-foreground/80 px-2 py-1":"text-muted-foreground/70"),children:i.text})})]}),x&&e.jsxs("div",{className:"border-t border-border/30",children:[e.jsx("div",{className:"px-2.5 py-0.5 text-[9px] uppercase tracking-wider text-muted-foreground/60",children:"Result"}),e.jsx("div",{className:"px-2.5 pb-1.5",children:e.jsx("pre",{className:p("text-[10px] leading-relaxed overflow-x-auto font-mono whitespace-pre-wrap max-h-[200px] overflow-y-auto rounded",x.isJson?"bg-slate-900/10 dark:bg-slate-900/40 text-foreground/80 px-2 py-1":"text-muted-foreground/70"),children:x.text})})]})]},n.callId||`${n.name}-${u}`)})})]})}function z({content:t,isStreaming:s,isAssistant:r}){return r&&!s&&t?e.jsx(g,{content:t}):s&&t?e.jsx("div",{className:"text-base leading-relaxed",children:e.jsx(g,{content:t,isStreaming:!0})}):s&&!t?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground",children:[e.jsx(f,{className:"h-3.5 w-3.5 animate-spin"}),"Thinking…"]}):e.jsx("div",{className:"text-base leading-relaxed whitespace-pre-wrap",children:t})}function L(t){if(!t||isNaN(t))return null;try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return null}}function D(){const t=m(s=>s.messages);return t.length===0?e.jsx("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:"Start a conversation"}):e.jsx("div",{className:"flex flex-col",children:t.map(s=>{const r=s.role==="user",a=s.role==="system",o=s.role==="tool",l=!!s.content?.trim(),n=!!s.reasoning?.trim(),u=!!s.toolCalls?.length,i=L(s.timestamp),x=o||!r&&!l&&(n||u);if(a)return e.jsx("div",{className:"px-4 py-2",children:e.jsx("div",{className:"mx-auto max-w-3xl rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-2.5 text-sm text-destructive",children:s.content})},s.id);if(x)return e.jsxs("div",{className:"px-4 py-1",children:[e.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-1",children:[n&&e.jsx(j,{reasoning:s.reasoning,isStreaming:s.isStreaming,startedAt:s.reasoningStartedAt,endedAt:s.reasoningEndedAt}),!o&&u&&e.jsx(b,{tools:s.toolCalls}),o&&e.jsx("div",{className:"rounded-md bg-muted/40 px-2.5 py-1.5 text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap font-mono border border-border/50",children:s.content})]}),i&&e.jsx("div",{className:"mx-auto max-w-3xl",children:e.jsx("span",{className:"mt-0.5 text-[10px] text-muted-foreground/40",children:i})})]},s.id);if(r){const h=!!s.attachments?.length;return e.jsx("div",{className:"flex px-4 py-2 justify-end",children:e.jsxs("div",{className:"flex min-w-0 flex-col max-w-[80%] items-end gap-1.5",children:[h&&e.jsx("div",{className:"flex flex-wrap justify-end gap-1.5",children:s.attachments.map(c=>c.type.startsWith("image/")?e.jsx("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"block rounded-xl overflow-hidden border border-border/50 hover:border-border transition-colors",children:e.jsx("img",{src:c.url,alt:c.name,className:"max-h-[200px] max-w-[260px] object-cover"})},c.id):e.jsxs("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg border bg-card px-2.5 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[e.jsx(w,{className:"size-3.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate max-w-[180px]",children:c.name})]},c.id))}),e.jsx("div",{className:"rounded-2xl px-4 py-2.5 text-sm leading-relaxed bg-primary text-primary-foreground",children:e.jsx("div",{className:"whitespace-pre-wrap",children:s.content})}),i&&e.jsx("span",{className:"text-[10px] text-muted-foreground/50 px-1",children:i})]})},s.id)}return e.jsx("div",{className:"flex px-4 py-4 justify-start",children:e.jsxs("div",{className:"flex min-w-0 flex-col w-full max-w-3xl gap-1",children:[n&&e.jsx(j,{reasoning:s.reasoning,isStreaming:s.isStreaming,startedAt:s.reasoningStartedAt,endedAt:s.reasoningEndedAt}),u&&e.jsx(b,{tools:s.toolCalls}),e.jsx(z,{content:s.content,isStreaming:s.isStreaming,isAssistant:!0}),l&&e.jsx("div",{className:"mt-1 flex items-center gap-2 px-1",children:e.jsx(M,{text:s.content})}),i&&e.jsx("span",{className:"mt-0.5 text-[10px] text-muted-foreground/50 px-1",children:i})]})},s.id)})})}function J(){const{activeSessionId:t,isStreaming:s}=m(),r=m(l=>l.syncFromDb),{state:a}=k(),o=a==="collapsed";return d.useEffect(()=>{if(!t||!s)return;const l=setInterval(()=>{r(t)},2e3);return()=>clearInterval(l)},[t,s,r]),e.jsxs("div",{className:"flex h-full flex-col ",children:[e.jsx("header",{className:"flex items-center justify-between border-b px-4 py-3 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&e.jsx(S,{className:p("mr-1 -ml-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0")}),e.jsx("h2",{className:"truncate font-medium",children:t?`Chat ${t.slice(0,8)}`:"New Chat"}),s&&e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"Streaming…"})]})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e.jsx("div",{className:"mx-auto max-w-3xl",children:e.jsx(D,{})})}),e.jsx("div",{className:"shrink-0 bg-background px-4 py-3",children:e.jsx("div",{className:"mx-auto max-w-3xl",children:e.jsx(T,{})})})]})}function B(){const{sessionId:t}=I.useParams(),s=m(o=>o.switchSession),r=m(o=>o.loadSessions),a=m(o=>o.sessionsLoaded);return d.useEffect(()=>{a||r()},[a,r]),d.useEffect(()=>{t&&s(t)},[t,s]),e.jsx(J,{})}export{B as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as c,J as a,D as o,y as u,C as i}from"./index-lcPGeFiu.js";function f(){const s=c(),n=a(e=>e.sessionsLoaded),t=a(e=>e.sessions),r=o.useRef(!1);return o.useEffect(()=>{if(n)if(t.length>0)s({to:"/chat/$sessionId",params:{sessionId:t[0].id},replace:!0});else{if(r.current)return;r.current=!0,u({title:"",source:"api_server"}).then(e=>{s({to:"/chat/$sessionId",params:{sessionId:e.id},replace:!0})}).catch(()=>{r.current=!1})}},[n,t,s]),i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading conversations…"})})}export{f as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as a,C as e}from"./index-lcPGeFiu.js";import{C as n}from"./ChatInputBlock-DtDwhu-o.js";function o(){const t=a();return e.jsx("div",{className:"flex flex-1 flex-col items-center justify-center px-4",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-2xl mx-auto",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-semibold tracking-tight text-foreground text-center",children:"What can I help you with?"}),e.jsx("div",{className:"w-full",children:e.jsx(n,{onCreateSession:s=>{t({to:"/chat/$sessionId",params:{sessionId:s}})}})})]})})}export{o as component};
|