@shumai-one/shumai 0.3.0 → 0.3.2
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/bin/{chunk-93jcw0pn.js → chunk-08dr94gp.js} +1 -1
- package/bin/{chunk-a1mtpcrd.js → chunk-08mxv0sm.js} +2 -2
- package/bin/{chunk-jjgwrvdb.js → chunk-0t4z17qr.js} +1 -1
- package/bin/{chunk-cmcsxkh1.js → chunk-1d22tysv.js} +2 -2
- package/bin/{chunk-9zy0a8kt.js → chunk-1dawjfk8.js} +2 -2
- package/bin/{chunk-q11m2cp3.js → chunk-1nh6xgek.js} +1 -1
- package/bin/chunk-20y3wte3.js +2 -0
- package/bin/{chunk-4tt3jvm1.js → chunk-2ynx0den.js} +1 -1
- package/bin/{chunk-yaydmgcg.js → chunk-31a3k77j.js} +1 -1
- package/bin/{chunk-8rkp0fc5.js → chunk-31mjcykb.js} +2 -2
- package/bin/{chunk-1yqar2gz.js → chunk-3jdef7n4.js} +1 -1
- package/bin/{chunk-h1hj60fr.js → chunk-3rcc5s99.js} +2 -2
- package/bin/{chunk-sa4gc1f5.js → chunk-3t7mjvdv.js} +2 -2
- package/bin/{chunk-36wf2dq0.js → chunk-4ahve1nf.js} +1 -1
- package/bin/chunk-4hdnrwh1.js +1 -0
- package/bin/{chunk-652x28v2.js → chunk-4hdx2tv0.js} +1 -1
- package/bin/chunk-4htdb0xp.js +1 -0
- package/bin/chunk-4p7xpfey.js +2 -0
- package/bin/chunk-5f81c951.js +1 -0
- package/bin/{chunk-bnpw72vt.js → chunk-5vqan9c4.js} +2 -2
- package/bin/{chunk-e66j69wz.js → chunk-5zntjzxw.js} +1 -1
- package/bin/{chunk-jmh934ca.js → chunk-6a2eb3b5.js} +1 -1
- package/bin/{chunk-5x1ppya9.js → chunk-6t3gdd7e.js} +2 -2
- package/bin/chunk-7d5kep8c.js +2 -0
- package/bin/{chunk-a06432s3.js → chunk-7eycsyk6.js} +1 -1
- package/bin/{chunk-0p333kh7.js → chunk-7jjc175m.js} +3 -3
- package/bin/chunk-7kzqkp5z.js +1 -0
- package/bin/chunk-7sh6409h.js +1 -0
- package/bin/{chunk-zct68gc7.js → chunk-7y8dng8t.js} +2 -2
- package/bin/chunk-8e5zvy88.js +307 -0
- package/bin/{chunk-nmzvxgd6.js → chunk-8m6zg15c.js} +2 -2
- package/bin/{chunk-wv8xk7n7.js → chunk-8qyke29r.js} +1 -1
- package/bin/{chunk-jxxq76at.js → chunk-90et6bwm.js} +1 -1
- package/bin/chunk-9c7fxjej.js +2 -0
- package/bin/{chunk-449feg7g.js → chunk-9p2d0mk1.js} +1 -1
- package/bin/{chunk-c003q4v6.js → chunk-a10tf0d8.js} +1 -1
- package/bin/{chunk-9h3c60vw.js → chunk-a76c5r3c.js} +2 -2
- package/bin/{chunk-3g54qkv5.js → chunk-amsb41z5.js} +1 -1
- package/bin/{chunk-28egv700.js → chunk-arpna31w.js} +1 -1
- package/bin/{chunk-k0s6gfg6.js → chunk-b10meywb.js} +1 -1
- package/bin/chunk-b1e3tec3.js +62 -0
- package/bin/chunk-bdjhb77e.js +2 -0
- package/bin/chunk-beay9amy.js +1 -0
- package/bin/{chunk-cspp4n1d.js → chunk-c3fvs0bv.js} +2 -2
- package/bin/{chunk-ab45988z.js → chunk-c5my1b3k.js} +1 -1
- package/bin/{chunk-jh6pw37a.js → chunk-d3s00sn0.js} +1 -1
- package/bin/{chunk-9bvwwj5y.js → chunk-dhekxndw.js} +1 -1
- package/bin/{chunk-pzehf31g.js → chunk-dwaj1yn4.js} +1 -1
- package/bin/{chunk-rybbss5f.js → chunk-dwswqq3g.js} +1 -1
- package/bin/{chunk-5jhrqbk2.js → chunk-ejfmxjw6.js} +2 -2
- package/bin/{chunk-mzre12bp.js → chunk-er1rb6yj.js} +1 -1
- package/bin/chunk-etces6ff.js +2 -0
- package/bin/{chunk-r8vrfefa.js → chunk-etqpzc9e.js} +1 -1
- package/bin/{chunk-pna93n17.js → chunk-f8cn9m28.js} +1 -1
- package/bin/{chunk-fvf7j1qj.js → chunk-fdpjw17x.js} +1 -1
- package/bin/{chunk-agd2jevj.js → chunk-g2dk56e7.js} +1 -1
- package/bin/{chunk-fr3dg9aj.js → chunk-gn8snrnk.js} +1 -1
- package/bin/chunk-gqh4ttjh.js +3 -0
- package/bin/{chunk-szs8dy1s.js → chunk-gvn079hy.js} +2 -2
- package/bin/{chunk-qwxt1cha.js → chunk-h2wsm7h3.js} +2 -2
- package/bin/{chunk-cwebycwv.js → chunk-hfp4hpca.js} +2 -2
- package/bin/{chunk-yvgs4kmv.js → chunk-hrzm70wg.js} +1 -1
- package/bin/{chunk-fwcm78s9.js → chunk-hz31j0hk.js} +2 -2
- package/bin/{chunk-d3cqp0tb.js → chunk-j0p1peav.js} +2 -2
- package/bin/{chunk-aa2tkqg0.js → chunk-jm6bxtzt.js} +1 -1
- package/bin/{chunk-y132jbf0.js → chunk-jstc7pka.js} +1 -1
- package/bin/{chunk-8g1s0pq1.js → chunk-k0a35mg9.js} +1 -1
- package/bin/{chunk-e0kw3bst.js → chunk-k20bhxed.js} +1 -1
- package/bin/{chunk-he4h8e9e.js → chunk-k9w6mk9d.js} +2 -2
- package/bin/chunk-kgb16ggd.css +1 -0
- package/bin/{chunk-qjf561n2.js → chunk-m4py21f3.js} +1 -1
- package/bin/{chunk-jtwvd0te.js → chunk-mahxw48e.js} +2 -2
- package/bin/{chunk-f4x2dxe5.js → chunk-mcxsk75h.js} +3 -3
- package/bin/chunk-mm1j72a8.js +7 -0
- package/bin/{chunk-zy2sqtt9.js → chunk-na2nympm.js} +1 -1
- package/bin/chunk-nr89225z.js +2 -0
- package/bin/chunk-nrf5r23d.js +1 -0
- package/bin/{chunk-ddag2ezv.js → chunk-nt9tfjx6.js} +2 -2
- package/bin/chunk-nzy3pjjm.js +15 -0
- package/bin/{chunk-pvx55h1v.js → chunk-p396vw9h.js} +1 -1
- package/bin/{chunk-wwsvnz4v.js → chunk-p9xfyqh1.js} +2 -2
- package/bin/{chunk-phc9efjf.js → chunk-ph3e1bpp.js} +2 -2
- package/bin/{chunk-w3m9g3e9.js → chunk-pj0fgb2x.js} +1 -1
- package/bin/{chunk-9fefn2st.js → chunk-pp072ksj.js} +1 -1
- package/bin/{chunk-qt9efp9y.js → chunk-q5cdjzbv.js} +1 -1
- package/bin/{chunk-nd6psyzq.js → chunk-qc6dmzn0.js} +2 -2
- package/bin/{chunk-fytbcgak.js → chunk-qmtvy2j4.js} +2 -2
- package/bin/chunk-qn96vbke.js +2 -0
- package/bin/{chunk-bf5a4yc8.js → chunk-qvgc9e08.js} +1 -1
- package/bin/{chunk-mw0rc5m7.js → chunk-rrxjvewm.js} +1 -1
- package/bin/{chunk-nxhzchen.js → chunk-s05f0v9t.js} +1 -1
- package/bin/chunk-s5rfya1p.js +1 -0
- package/bin/{chunk-gc7b9j22.js → chunk-s7qpj715.js} +1 -1
- package/bin/chunk-scsy69bp.js +1 -0
- package/bin/{chunk-vjxgv3r6.js → chunk-sf6fwvrs.js} +1 -1
- package/bin/{chunk-h3y7szbm.js → chunk-ss45w8ks.js} +2 -2
- package/bin/{chunk-4gbs9swm.js → chunk-t2txvzkp.js} +1 -1
- package/bin/{chunk-e56nza63.js → chunk-td54rdfj.js} +1 -1
- package/bin/{chunk-6wa075zh.js → chunk-tsncwscz.js} +1 -1
- package/bin/{chunk-evzxjqr3.js → chunk-v2kfr8fx.js} +2 -2
- package/bin/chunk-vb9m47z9.js +1 -0
- package/bin/{chunk-t0detvbj.js → chunk-ve7v8wtv.js} +2 -2
- package/bin/{chunk-cm25nm9t.js → chunk-vf066xwh.js} +1 -1
- package/bin/{chunk-d5fapvnp.js → chunk-vgb8bzcg.js} +2 -2
- package/bin/{chunk-wcfpdfgy.js → chunk-vnfmh5ke.js} +2 -2
- package/bin/{chunk-hdqvbds8.js → chunk-vy24ncn2.js} +1 -1
- package/bin/{chunk-2xmsa8wv.js → chunk-w3a50kz8.js} +1 -1
- package/bin/{chunk-bjfwz2m7.js → chunk-w9w5301f.js} +2 -2
- package/bin/{chunk-1zpw2mbj.js → chunk-wap08p4j.js} +2 -2
- package/bin/{chunk-hktggc90.js → chunk-wny0qagx.js} +1 -1
- package/bin/{chunk-dk45f6mp.js → chunk-wqhk76de.js} +2 -2
- package/bin/{chunk-en4m76fw.js → chunk-wr5byz6r.js} +1 -1
- package/bin/{chunk-ky3dx324.js → chunk-wrz9e73c.js} +2 -2
- package/bin/{chunk-6f1twjf6.js → chunk-ws07a9kv.js} +1 -1
- package/bin/{chunk-9q32g9jd.js → chunk-x5dcgk62.js} +1 -1
- package/bin/{chunk-sprpjp4t.js → chunk-xawwxdq9.js} +2 -2
- package/bin/chunk-xwmsxg5x.js +1 -0
- package/bin/{chunk-736tcjve.js → chunk-y2nw8rbx.js} +2 -2
- package/bin/{chunk-48ebezek.js → chunk-y9ttm07y.js} +1 -1
- package/bin/chunk-yahb7wan.js +2 -0
- package/bin/{chunk-swa43tzr.js → chunk-z0ej44ak.js} +3 -3
- package/bin/chunk-zemgtnk0.js +1 -0
- package/bin/{chunk-a6dvjjce.js → chunk-zg0vm233.js} +1 -1
- package/bin/chunk-zhd2mkbr.js +1 -0
- package/bin/{chunk-cfamv4b2.js → chunk-zs9b0f3z.js} +2 -2
- package/bin/{chunk-8sr8ff6a.js → chunk-zxpef55w.js} +3 -3
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +254 -224
- package/package.json +7 -7
- package/prisma/migrations/20260729073910_change_agent_session_asset_on_delete_to_set_null/migration.sql +5 -0
- package/prisma/migrations/20260729114346_asset_size_byte_bigint/migration.sql +2 -0
- package/prisma/migrations/20260729114659_ai_usage_tokens_bigint/migration.sql +5 -0
- package/prisma/schema.prisma +6 -6
- package/bin/chunk-1wz0dge4.js +0 -3
- package/bin/chunk-2m2saan7.js +0 -2
- package/bin/chunk-2p0rg6xs.js +0 -1
- package/bin/chunk-3ge0s4k2.js +0 -1
- package/bin/chunk-6ks4277t.js +0 -2
- package/bin/chunk-80d6p55n.js +0 -1
- package/bin/chunk-8a9k4qj6.js +0 -2
- package/bin/chunk-8gkm2ysh.js +0 -1
- package/bin/chunk-8nvybmyv.js +0 -2
- package/bin/chunk-9jd3d3f3.js +0 -320
- package/bin/chunk-9nwjhams.js +0 -1
- package/bin/chunk-a2njf6av.js +0 -1
- package/bin/chunk-af3nys0r.js +0 -1
- package/bin/chunk-cx1ebj9k.js +0 -1
- package/bin/chunk-d1p9qz3y.js +0 -7
- package/bin/chunk-ea0fh29m.js +0 -2
- package/bin/chunk-epsctccj.js +0 -1
- package/bin/chunk-jyr3g5m4.js +0 -1
- package/bin/chunk-n0cn0xfg.js +0 -1
- package/bin/chunk-q0dhm16d.js +0 -62
- package/bin/chunk-qs5k9j8s.js +0 -1
- package/bin/chunk-t0fq8b99.js +0 -2
- package/bin/chunk-tm6z4hkd.css +0 -1
- package/bin/chunk-vdn3jymh.js +0 -2
- package/bin/chunk-z5p39kpk.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,b as y,c as E,d as G,e as v,f as V}from"./chunk-s7qpj715.js";import{t as tp}from"./chunk-nzy3pjjm.js";import"./chunk-bdjhb77e.js";import{sf as M,tf as A,uf as S,vf as H,wf as C}from"./chunk-ejfmxjw6.js";import{pg as R}from"./chunk-h2wsm7h3.js";import{rg as op}from"./chunk-yahb7wan.js";import{Pg as np}from"./chunk-wap08p4j.js";import{Ah as ip,Lj as m,Mh as h,Ph as cp,Wh as J,_j as b,ak as K,bj as w,dk as B,ek as D,fk as L,gh as Q,ih as p,ik as n,jh as t,mh as s,nh as $,qh as pp,qj as vp}from"./chunk-b1e3tec3.js";import{Xk as k}from"./chunk-ws07a9kv.js";var Vp=k(Q(),1);var x=k(Q(),1);var U=k(Q(),1);var j=m("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}});var a=U.createContext({size:"default",variant:"default",spacing:0});function l({className:i,variant:c,size:P,spacing:g=0,children:_,...z}){return p(b.Root,{"data-slot":"toggle-group","data-variant":c,"data-size":P,"data-spacing":g,style:{"--gap":g},className:K("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",i),...z,children:p(a.Provider,{value:{variant:c,size:P,spacing:g},children:_})})}function O({className:i,children:c,variant:P,size:g,..._}){let z=U.useContext(a);return p(b.Item,{"data-slot":"toggle-group-item","data-variant":z.variant||P,"data-size":z.size||g,"data-spacing":z.spacing,className:K(j({variant:z.variant||P,size:z.size||g}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",i),..._,children:c})}function e({teamId:i}){let[c,P]=x.useState("team"),[g,_]=x.useState("1h"),{data:z,isLoading:I}=$({queryKey:["teams",i,"ai-usage",g,"team"],queryFn:async()=>{let o=await h.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:i},query:{timeframe:g}});if(!o.ok)throw Error("Failed to fetch team AI usage");return await o.json()},enabled:!!i&&c==="team"}),{data:N,isLoading:q}=$({queryKey:["teams",i,"members"],queryFn:async()=>{let o=await h.api.teams[":teamId"].members.$get({param:{teamId:i},query:{}});if(!o.ok)throw Error("Failed to fetch team members");return await o.json()},enabled:!!i&&c==="members"}),W=s({queries:(N||[]).map((o)=>({queryKey:["teams",i,"ai-usage",g,o.id],queryFn:async()=>{let r=await h.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:i},query:{timeframe:g,userId:o.id}});if(!r.ok)throw Error(`Failed to fetch AI usage for member ${o.id}`);return await r.json()},enabled:!!i&&c==="members"}))}),X=q||W.some((o)=>o.isLoading),F=(o)=>{if(!o)return"U";let r=o.split(" ");if(r.length>1)return`${r[0][0]}${r[r.length-1][0]}`.toUpperCase();return o.substring(0,2).toUpperCase()},T=(o)=>{if(!o)return"";switch(o.toLowerCase()){case"owner":return n.owner();case"editor":return n.editor();case"reviewer":return n.reviewer();default:return o}},f=(o)=>(o??0).toLocaleString(),Y=(o)=>`$${(o??0).toFixed(6)}`;return t(M,{className:"border-border/60 shadow-sm",children:[t(A,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[t("div",{children:[p(S,{className:"text-xl font-semibold tracking-tight",children:n.ai_usage()}),p(H,{className:"text-sm text-muted-foreground mt-1",children:n.ai_usage_description()})]}),t("div",{className:"flex flex-wrap items-center gap-3",children:[t(l,{type:"single",value:c,onValueChange:(o)=>{if(o)P(o)},className:"border rounded-lg p-1 bg-muted/30",children:[p(O,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:n.team_view()}),p(O,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:n.members_view()})]}),t(l,{type:"single",value:g,onValueChange:(o)=>{if(o)_(o)},className:"border rounded-lg p-1 bg-muted/30",children:[p(O,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),p(O,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),p(O,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),p(O,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),p(C,{children:c==="team"?I?p("div",{className:"flex h-48 items-center justify-center",children:p(J,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):p("div",{className:"rounded-md border",children:t(u,{children:[p(y,{children:t(G,{children:[p(v,{children:n.team()}),p(v,{className:"text-right",children:n.input_tokens()}),p(v,{className:"text-right",children:n.output_tokens()}),p(v,{className:"text-right",children:n.cache_read_tokens()}),p(v,{className:"text-right",children:n.total_tokens()}),p(v,{className:"text-right",children:n.cost()})]})}),p(E,{children:t(G,{children:[p(V,{className:"font-medium",children:n.team()}),p(V,{className:"text-right",children:f(z?.team?.inputTokens)}),p(V,{className:"text-right",children:f(z?.team?.outputTokens)}),p(V,{className:"text-right",children:f(z?.team?.cacheReadTokens)}),p(V,{className:"text-right font-medium",children:f(z?.team?.totalTokens)}),p(V,{className:"text-right font-medium",children:Y(z?.team?.cost)})]})})]})}):X?p("div",{className:"flex h-48 items-center justify-center",children:p(J,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):p("div",{className:"rounded-md border",children:t(u,{children:[p(y,{children:t(G,{children:[p(v,{children:n.members()}),p(v,{children:n.role()}),p(v,{className:"text-right",children:n.input_tokens()}),p(v,{className:"text-right",children:n.output_tokens()}),p(v,{className:"text-right",children:n.cache_read_tokens()}),p(v,{className:"text-right",children:n.total_tokens()}),p(v,{className:"text-right",children:n.cost()})]})}),p(E,{children:(N||[]).map((o,r)=>{let Z=W[r]?.data?.member;return t(G,{children:[p(V,{children:t("div",{className:"flex items-center gap-3",children:[t(B,{className:"h-8 w-8 rounded-full",children:[o.image&&p(D,{src:o.image,alt:o.name,className:"object-cover"}),p(L,{className:"bg-primary/20 text-xs",children:F(o.name)})]}),t("div",{className:"flex flex-col",children:[p("span",{className:"text-sm font-medium leading-none",children:o.name}),p("span",{className:"text-xs text-muted-foreground mt-0.5",children:o.email})]})]})}),p(V,{className:"text-xs text-muted-foreground",children:T(o.role)}),p(V,{className:"text-right",children:f(Z?.inputTokens)}),p(V,{className:"text-right",children:f(Z?.outputTokens)}),p(V,{className:"text-right",children:f(Z?.cacheReadTokens)}),p(V,{className:"text-right font-medium",children:f(Z?.totalTokens)}),p(V,{className:"text-right font-medium",children:Y(Z?.cost)})]},o.id)})})]})})})]})}var d=k(Q(),1);function fp({teamId:i}){let[c,P]=d.useState(null),{ref:g,inView:_}=op(),{data:z,isLoading:I,isError:N,fetchNextPage:q,hasNextPage:W,isFetchingNextPage:X}=pp({queryKey:["teams",i,"agent-sessions"],queryFn:async({pageParam:f})=>{let Y=await h.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:i},query:{first:"20",after:f?String(f):void 0}});if(!Y.ok)throw Error("Failed to fetch agent sessions");return await Y.json()},initialPageParam:"",getNextPageParam:(f)=>f.pageInfo.cursor||void 0,enabled:!!i});d.useEffect(()=>{if(_&&W&&!X)q()},[_,W,X,q]);let F=z?.pages.flatMap((f)=>f.data).filter((f)=>f.id!=="pending")||[],T=(f)=>{switch(f){case"comment":return p(R,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:n.session_type_comment()});case"chat":return p(R,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:n.session_type_chat()});case"naming":return p(R,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:n.session_type_naming()});default:return p(R,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:f})}};return t("div",{className:"space-y-6",children:[t(M,{className:"border border-border/50 shadow-xs",children:[p(A,{className:"pb-4",children:p("div",{className:"flex items-center justify-between",children:t("div",{children:[t(S,{className:"text-xl font-bold flex items-center gap-2",children:[p(w,{className:"w-5 h-5 text-violet-500"}),n.sessions()]}),p(H,{className:"mt-1 text-sm text-muted-foreground",children:n.sessions_description()})]})})}),p(C,{children:I?p("div",{className:"flex h-64 items-center justify-center",children:p(J,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):N?p("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):F.length===0?t("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[p(w,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),p("p",{className:"text-base font-medium",children:n.no_sessions_found()})]}):t("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[t(u,{children:[p(y,{className:"bg-muted/40",children:t(G,{children:[p(v,{children:n.session_name()}),p(v,{children:n.creator()}),p(v,{children:n.session_type()}),p(v,{className:"text-right",children:n.create_time()})]})}),p(E,{children:F.map((f)=>t(G,{onClick:()=>P(f.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[p(V,{className:"font-medium",children:t("div",{className:"flex flex-col",children:[p("span",{className:"text-sm font-semibold text-foreground",children:f.name||n.untitled_session()}),p("span",{className:"text-xs font-mono text-muted-foreground/70",children:f.id})]})}),p(V,{children:t("div",{className:"flex items-center gap-2",children:[t(B,{className:"h-6 w-6",children:[p(D,{src:f.creator?.image||void 0}),p(L,{className:"text-[10px]",children:f.creator?.name?.[0]?.toUpperCase()||"?"})]}),p("span",{className:"text-sm text-foreground/90",children:f.creator?.name||"System / Agent"})]})}),p(V,{children:T(f.type)}),p(V,{className:"text-right text-xs text-muted-foreground",children:np(f.createdAt)})]},f.id))})]}),p("div",{ref:g,className:"py-4 flex justify-center",children:X&&p(J,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),p(tp,{sessionId:c,open:!!c,onOpenChange:(f)=>{if(!f)P(null)}})]})}function zp(){let{teamId:i}=gp.useParams(),[c,P]=Vp.useState("ai-usage"),{data:g,isLoading:_}=$({queryKey:["teams",i,"me"],queryFn:async()=>{let z=await h.api.teams[":teamId"].me.$get({param:{teamId:i}});if(!z.ok)throw Error("Failed to fetch me");return await z.json()},enabled:!!i});if(_)return p("div",{className:"flex h-screen items-center justify-center",children:p(J,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(g?.role?.toLowerCase()!=="owner")return t("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[p(vp,{className:"h-12 w-12 text-destructive mb-4"}),p("h2",{className:"text-xl font-bold tracking-tight mb-2",children:n.access_denied()}),p("p",{className:"text-sm text-muted-foreground max-w-md",children:n.only_owner_dashboard()})]});return p("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:t("div",{className:"flex flex-col md:flex-row h-full",children:[p("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:t("nav",{className:"p-4 space-y-1 mt-4",children:[p("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:n.dashboard()}),p("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:n.ai()}),t("button",{onClick:()=>P("ai-usage"),className:K("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",c==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[p(cp,{className:"w-5 h-5"}),n.usage(),c==="ai-usage"&&p("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),t("button",{onClick:()=>P("ai-sessions"),className:K("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",c==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[p(w,{className:"w-5 h-5"}),n.sessions(),c==="ai-sessions"&&p("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),p("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:t("div",{className:"max-w-6xl mx-auto space-y-8",children:[c==="ai-usage"&&p(e,{teamId:i}),c==="ai-sessions"&&p(fp,{teamId:i})]})})]})})}var gp=ip("/teams/$teamId/dashboard")({component:zp});export{gp as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{z as
|
|
1
|
+
import{sg as f}from"./chunk-yahb7wan.js";import{ih as b,jh as q}from"./chunk-b1e3tec3.js";function z(){return q("div",{className:"flex h-screen flex-col bg-background min-h-0",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-24"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded-md"}),b(f,{className:"h-8 w-20 rounded-md"})]})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-4 rounded"}),b(f,{className:"h-4 w-24"})]}),q("div",{className:"pl-4 space-y-3",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-28"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-24"})]})]})]}),q("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto",children:[q("div",{className:"flex items-center justify-between border-b pb-4",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-5 w-40"}),b(f,{className:"h-4 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-32 rounded"})]})]}),q("div",{className:"space-y-4",children:[b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-4 w-24"})}),b("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((w,v)=>q("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[b(f,{className:"aspect-square w-full rounded-md"}),q("div",{className:"space-y-2",children:[b(f,{className:"h-4 w-3/4"}),q("div",{className:"flex justify-between items-center",children:[b(f,{className:"h-3 w-1/4"}),b(f,{className:"h-3 w-1/3"})]})]})]},v))})]})]})]})]})}function A(){return q("div",{className:"h-screen flex flex-col bg-background",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-16"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-28"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-8 w-20 rounded"})})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:4}).map((w,v)=>q("div",{className:"flex gap-3 p-2 rounded border",children:[b(f,{className:"h-12 w-12 rounded bg-muted shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[b(f,{className:"h-3 w-2/3"}),b(f,{className:"h-2 w-1/2"})]})]},v))})]}),q("div",{className:"flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0",children:[b("div",{className:"flex-1 flex items-center justify-center",children:b(f,{className:"w-full max-w-4xl aspect-video rounded-lg shadow-lg"})}),q("div",{className:"mt-4 flex items-center justify-between shrink-0",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-8 w-8 rounded-full"}),b(f,{className:"h-4 w-32"})]}),b(f,{className:"h-4 w-24"})]})]}),q("div",{className:"w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card",children:[q("div",{className:"space-y-4",children:[b(f,{className:"h-5 w-32"}),b("div",{className:"space-y-3",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex justify-between items-center py-1 border-b",children:[b(f,{className:"h-3 w-20"}),b(f,{className:"h-3 w-32"})]},v))})]}),q("div",{className:"flex-1 flex flex-col gap-4",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex gap-3 p-3 rounded-lg border bg-muted/10",children:[b(f,{className:"h-8 w-8 rounded-full shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[q("div",{className:"flex justify-between",children:[b(f,{className:"h-3 w-24"}),b(f,{className:"h-2 w-12"})]}),b(f,{className:"h-3 w-full"}),b(f,{className:"h-3 w-5/6"})]})]},v))})]})]})]})]})}
|
|
2
|
+
export{z as Bf,A as Cf};
|