import{f as F,g as V,i as h,h as A,j as E,k as H,u as I,l as x,w as t,o as e,a,m as i,n as P,c as o,F as y,r as w,b as d,t as _,d as U,p as R}from"./Bh-tMwKs.js";import{_ as T}from"./cCUm7iY-.js";import{c as j,_ as z,a as L,b as M}from"./D32OC87-.js";import{_ as q}from"./DeqoUPGn.js";function G(p,v=5e3){const n=h(()=>typeof p=="function"?p():p.value),{data:l,error:g,status:m,refresh:u}=F(()=>`/api/v1/sessions/${encodeURIComponent(n.value)}/messages`,{watch:[n],default:()=>[]},"$I_yy7my_H9"),r=h(()=>g.value?.message??null),c=h(()=>m.value==="pending"&&l.value.length===0),{pause:k}=V(u,v);return A(k),{messages:l,error:r,loading:c,refresh:u}}const J={class:"flex items-center gap-3"},K={class:"space-y-4 p-6"},O={key:1,class:"space-y-4"},Q={class:"space-y-2"},W={key:0,class:"whitespace-pre-wrap text-sm leading-relaxed"},X={key:1,class:"rounded-md border bg-muted/50 text-sm"},Y={class:"cursor-pointer px-3 py-2 font-mono text-xs text-primary hover:bg-muted"},Z={class:"px-3 py-2 text-xs text-muted whitespace-pre-wrap overflow-x-auto"},oe=E({__name:"[id]",setup(p){const v=H(),n=h(()=>v.params.id);I({title:()=>`Session ${n.value.slice(0,8)} — Agent Please`});const{messages:l,loading:g,error:m}=G(n);function u(r){return r.kind==="text"?r.text??"":r.input??""}return(r,c)=>{const k=R,$=T,B=M,N=q,S=z,b=L,C=j;return e(),x(C,null,{header:t(()=>[d(B,null,{left:t(()=>[a("div",J,[d(k,{icon:"i-lucide-arrow-left",variant:"ghost",size:"sm",to:"/"}),c[0]||(c[0]=a("span",{class:"text-lg font-bold"},"Session",-1)),d($,{variant:"outline",class:"font-mono text-xs"},{default:t(()=>[U(_(i(n).slice(0,8))+"… ",1)]),_:1})])]),_:1})]),body:t(()=>[a("div",K,[i(m)?(e(),x(N,{key:0,color:"error",variant:"subtle",title:i(m),icon:"i-lucide-alert-circle"},null,8,["title"])):P("",!0),i(g)?(e(),o("div",O,[(e(),o(y,null,w(3,s=>d(S,{key:s,class:"h-20 w-full rounded-xl"})),64))])):i(l).length===0?(e(),x(b,{key:2},{default:t(()=>[...c[1]||(c[1]=[a("div",{class:"py-8 text-center text-muted"}," No messages found. ",-1)])]),_:1})):(e(!0),o(y,{key:3},w(i(l),s=>(e(),x(b,{key:s.uuid,ui:{root:s.type==="assistant"?"border-primary/30":""}},{header:t(()=>[d($,{color:s.type==="assistant"?"primary":"neutral",variant:"subtle",class:"text-xs"},{default:t(()=>[U(_(s.type),1)]),_:2},1032,["color"])]),default:t(()=>[a("div",Q,[(e(!0),o(y,null,w(s.content,(f,D)=>(e(),o(y,{key:D},[f.kind==="text"?(e(),o("pre",W,_(u(f)),1)):(e(),o("details",X,[a("summary",Y,_(f.tool_name),1),a("pre",Z,_(u(f)),1)]))],64))),128))])]),_:2},1032,["ui"]))),128))])]),_:1})}}});export{oe as default};
