@shumai-one/shumai 0.4.6 → 0.4.7
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-1bgsphyz.js → chunk-05tnmf8h.js} +2 -2
- package/bin/chunk-0xsgx9ep.js +1 -0
- package/bin/{chunk-3d5rm1d1.js → chunk-0ygtayqf.js} +1 -1
- package/bin/{chunk-crja7whq.js → chunk-11c93g1m.js} +2 -2
- package/bin/chunk-1ajgdv26.js +1 -0
- package/bin/{chunk-ba33nf0q.js → chunk-1ntn42d2.js} +3 -3
- package/bin/chunk-2kxhdnma.js +3 -0
- package/bin/chunk-30dsxm8s.js +1 -0
- package/bin/chunk-3b6h719s.js +3 -0
- package/bin/{chunk-pdh9bnyj.js → chunk-3g5pyw2e.js} +2 -2
- package/bin/{chunk-p75f5pgq.js → chunk-3h9c5ak3.js} +2 -2
- package/bin/{chunk-2qjfpmcf.js → chunk-3m5kwcj7.js} +1 -1
- package/bin/{chunk-w1wxzqqb.js → chunk-3p1bb08a.js} +2 -2
- package/bin/{chunk-6vxzkrsj.js → chunk-3r5yc5wm.js} +4 -4
- package/bin/{chunk-sab7tjxw.js → chunk-3tyk9xgf.js} +3 -3
- package/bin/{chunk-h9mka9br.js → chunk-4a88wwg2.js} +1 -1
- package/bin/{chunk-z08bqvkc.js → chunk-4f5pnnah.js} +14 -14
- package/bin/{chunk-dpc11hpd.js → chunk-4jgq9m51.js} +7 -7
- package/bin/{chunk-d7fwggt6.js → chunk-4m8gk79m.js} +1 -1
- package/bin/{chunk-b9hyc0a1.js → chunk-53vtc74g.js} +2 -2
- package/bin/{chunk-1kt5dzjv.js → chunk-58e1a3re.js} +2 -2
- package/bin/{chunk-dmvvt8va.js → chunk-5qkwpy8c.js} +2 -2
- package/bin/{chunk-07jszkhj.js → chunk-5rk7dyx9.js} +58 -58
- package/bin/{chunk-ga3pahzf.js → chunk-5v4s2kp4.js} +1 -1
- package/bin/{chunk-v8v8vdf7.js → chunk-5wp37g6w.js} +4 -4
- package/bin/{chunk-hs2r9qaw.js → chunk-628k58ek.js} +2 -2
- package/bin/{chunk-rp4pc6kz.js → chunk-6kdf411z.js} +1 -1
- package/bin/chunk-6ksrrayx.css +1 -0
- package/bin/chunk-6rjkbwz6.js +14 -0
- package/bin/{chunk-md5pcq46.js → chunk-781990k7.js} +4 -4
- package/bin/{chunk-ey3h4sct.js → chunk-887pj9xd.js} +2 -2
- package/bin/{chunk-1jybg56e.js → chunk-8b1w6bj9.js} +1 -1
- package/bin/{chunk-0wvhahzh.js → chunk-8gna37dd.js} +1 -1
- package/bin/{chunk-rmzcarv9.js → chunk-8sf106rq.js} +1 -1
- package/bin/{chunk-2jrjwaqr.js → chunk-8ystwvdt.js} +1 -1
- package/bin/{chunk-3j5njrpr.js → chunk-9v6eqa3n.js} +2 -2
- package/bin/{chunk-rsd164d9.js → chunk-9va1mzeq.js} +1 -1
- package/bin/{chunk-kmbjp5kp.js → chunk-an6nsq1t.js} +1 -1
- package/bin/{chunk-vzj2j11x.js → chunk-ayq8dskd.js} +1 -1
- package/bin/{chunk-y20sbaz5.js → chunk-b0rjvx5g.js} +1 -1
- package/bin/chunk-bgm76rzj.js +1 -0
- package/bin/chunk-btmxr226.js +1 -0
- package/bin/chunk-camzbwqh.js +2 -0
- package/bin/{chunk-t350k3s1.js → chunk-ccvjwhqq.js} +1 -1
- package/bin/{chunk-pgj2kjnn.js → chunk-dkzyv61a.js} +2 -2
- package/bin/{chunk-y56yvezn.js → chunk-dyq6h9ha.js} +1 -1
- package/bin/{chunk-teqprbd8.js → chunk-e17daz1x.js} +1 -1
- package/bin/{chunk-dbw8c1jj.js → chunk-ebf1r872.js} +4 -4
- package/bin/{chunk-2vzzd0q6.js → chunk-ebx3bd4c.js} +1 -1
- package/bin/{chunk-161rxeq2.js → chunk-ee3mrvqp.js} +1 -1
- package/bin/chunk-fg6zf2gb.js +2 -0
- package/bin/{chunk-6y4xkcte.js → chunk-fhazy8f9.js} +1 -1
- package/bin/{chunk-gqr5hxhj.js → chunk-fk712d68.js} +1 -1
- package/bin/{chunk-afnzb9ne.js → chunk-fvgb6rps.js} +2 -2
- package/bin/chunk-g9gmht89.js +2 -0
- package/bin/{chunk-1t51fp6n.js → chunk-gf4n4ahk.js} +1 -1
- package/bin/{chunk-gcjsw9yp.js → chunk-h3wr8nnk.js} +1 -1
- package/bin/chunk-htpjtarr.js +2 -0
- package/bin/{chunk-kg8eg9z3.js → chunk-hye75kp0.js} +2 -2
- package/bin/{chunk-3tg39jx7.js → chunk-j41mya13.js} +2 -2
- package/bin/chunk-j547gtag.js +2 -0
- package/bin/{chunk-a4056d0r.js → chunk-jde9r5mj.js} +1 -1
- package/bin/chunk-jf4kcad0.js +1 -0
- package/bin/{chunk-tgr86ac4.js → chunk-jt04mf5s.js} +1 -1
- package/bin/{chunk-hnhdq2wd.js → chunk-k3qypq3x.js} +1 -1
- package/bin/chunk-k5hnrtrt.js +1 -0
- package/bin/{chunk-mtb9fpj2.js → chunk-k810fstm.js} +1 -1
- package/bin/{chunk-3n4224c0.js → chunk-kg2c445x.js} +1 -1
- package/bin/{chunk-edqd8evk.js → chunk-kq2qbwx1.js} +1 -1
- package/bin/{chunk-7nvk7waw.js → chunk-m2h7a172.js} +1 -1
- package/bin/{chunk-brwbhbmc.js → chunk-m638fg4n.js} +5 -5
- package/bin/{chunk-3dgahs95.js → chunk-mm1a0zja.js} +1 -1
- package/bin/{chunk-hxyg5q2a.js → chunk-njabdtvb.js} +2 -2
- package/bin/{chunk-b6q287d1.js → chunk-njqf50vw.js} +1 -1
- package/bin/{chunk-47tn3vtg.js → chunk-nn5hyf6f.js} +1 -1
- package/bin/{chunk-t7bvde99.js → chunk-nnq8g9yy.js} +3 -3
- package/bin/{chunk-8cn7fx40.js → chunk-ny7qjn6s.js} +1 -1
- package/bin/{chunk-3d9tfxp4.js → chunk-p5fwjk5c.js} +1 -1
- package/bin/{chunk-s05cdax2.js → chunk-pa1fmskf.js} +1 -1
- package/bin/{chunk-a796sgcw.js → chunk-pcspeqwq.js} +2 -2
- package/bin/{chunk-yfr0hzb7.js → chunk-q1d7x1cc.js} +1 -1
- package/bin/{chunk-y1b3ck7m.js → chunk-q45n02fs.js} +1 -1
- package/bin/chunk-q6jsw0rr.js +211 -0
- package/bin/chunk-qjzyze00.js +1 -0
- package/bin/{chunk-2yr5k567.js → chunk-r55htzxr.js} +1 -1
- package/bin/{chunk-46wfxyd7.js → chunk-r7e2fmmx.js} +2 -2
- package/bin/{chunk-5kvc1gp2.js → chunk-rbagbd0e.js} +1 -1
- package/bin/{chunk-dz076sh7.js → chunk-rdscv38p.js} +1 -1
- package/bin/chunk-rfhmk32e.js +1 -0
- package/bin/{chunk-qs7855cz.js → chunk-rkafv27g.js} +2 -2
- package/bin/{chunk-hd6dnnyg.js → chunk-rkqpnyzx.js} +1 -1
- package/bin/{chunk-z6jpt0h6.js → chunk-s30fjvzs.js} +3 -3
- package/bin/{chunk-dj5a6kkh.js → chunk-s41mgkse.js} +1 -1
- package/bin/{chunk-988casfy.js → chunk-s63vj79f.js} +1 -1
- package/bin/{chunk-9d0thqcy.js → chunk-t3t7dcfq.js} +1 -1
- package/bin/{chunk-gsfcpcye.js → chunk-twyxs4z2.js} +1 -1
- package/bin/{chunk-1dqsf5qj.js → chunk-typ46eqd.js} +5 -5
- package/bin/chunk-v1sgrg0r.js +1 -0
- package/bin/{chunk-j9ks8bd7.js → chunk-vdnmq163.js} +1 -1
- package/bin/{chunk-jg2v25d2.js → chunk-vx66rms0.js} +2 -2
- package/bin/{chunk-9nvymwqj.js → chunk-wvq717b5.js} +2 -2
- package/bin/chunk-xbge27m4.js +1 -0
- package/bin/{chunk-ysv80zyb.js → chunk-xca338dw.js} +3 -3
- package/bin/chunk-xcsz1wp7.js +1 -0
- package/bin/{chunk-ehpfg3km.js → chunk-xznabrt2.js} +1 -1
- package/bin/{chunk-pvg3msgw.js → chunk-xzyfnfck.js} +3 -3
- package/bin/{chunk-9trnkbtr.js → chunk-ycw3rwhx.js} +3 -3
- package/bin/{chunk-qbqym9m6.js → chunk-yqvhgtez.js} +2 -2
- package/bin/{chunk-4syt6rn0.js → chunk-yr03tf5r.js} +2 -2
- package/bin/{chunk-n3xjwszr.js → chunk-z9jpgxf1.js} +1 -1
- package/bin/chunk-zb0az2tq.js +2 -0
- package/bin/{chunk-pwkby9h7.js → chunk-zbt4h7n0.js} +1 -1
- package/bin/{chunk-kk42xhgz.js → chunk-zcdqsp1e.js} +1 -1
- package/bin/chunk-zej27b5c.js +2 -0
- package/bin/{chunk-axmd242s.js → chunk-zmjtv19e.js} +1 -1
- package/bin/{chunk-7e5z637e.js → chunk-zr11zfwc.js} +1 -1
- package/bin/{chunk-k6avge95.js → chunk-zz0522zr.js} +4 -4
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +294 -293
- package/package.json +7 -7
- package/bin/chunk-0c67210c.js +0 -1
- package/bin/chunk-2z1pnt7h.js +0 -2
- package/bin/chunk-3vmapyk9.js +0 -1
- package/bin/chunk-886pnknh.js +0 -3
- package/bin/chunk-908pypkr.js +0 -1
- package/bin/chunk-952qwf17.js +0 -2
- package/bin/chunk-9a2tf0mh.js +0 -2
- package/bin/chunk-apfrw0wd.js +0 -3
- package/bin/chunk-batadmvr.js +0 -2
- package/bin/chunk-bvdvp192.js +0 -1
- package/bin/chunk-db1msmdh.js +0 -2
- package/bin/chunk-dkx3pmdz.js +0 -1
- package/bin/chunk-hacyjx1s.js +0 -1
- package/bin/chunk-he5nvmqw.js +0 -1
- package/bin/chunk-hyr1vtfp.js +0 -1
- package/bin/chunk-jh8q3885.js +0 -211
- package/bin/chunk-jzbrt2vk.js +0 -1
- package/bin/chunk-nqym3zbs.js +0 -1
- package/bin/chunk-sebbjvgv.css +0 -1
- package/bin/chunk-t8gv2ekj.js +0 -14
- package/bin/chunk-vm5tn0zm.js +0 -2
- package/bin/chunk-wmjp8dcm.js +0 -1
- package/bin/chunk-wy8dkyxj.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,S,t,Z,Ue,A,lt,wt,tm}from"./chunk-q6jsw0rr.js";import"./chunk-887pj9xd.js";import"./chunk-zz0522zr.js";import"./chunk-rkafv27g.js";import"./chunk-xznabrt2.js";import{Zi}from"./chunk-4f5pnnah.js";import"./chunk-an6nsq1t.js";import"./chunk-b0rjvx5g.js";import{rr}from"./chunk-zej27b5c.js";import"./chunk-4m8gk79m.js";import"./chunk-fk712d68.js";import"./chunk-9va1mzeq.js";import"./chunk-8sf106rq.js";S();function p(){let{projectId:e,folderId:d}=s.useParams(),{teamId:r,ensureTeamIdForProject:i}=lt();h(()=>{i(e)},[e,i]);let{data:a}=rr(tm(e)),o=a?.rootFolder,{data:l}=Z({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!l)return t(wt,{});return t(Zi,{teamId:r,projectId:e,projectName:a.name??"",assetId:d,rootFolderId:o,isRoot:!1})}var s=Ue("/projects/$projectId/folders/$folderId_/agentsmd")({component:p});export{s as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u,S,K,B,A,ei,
|
|
1
|
+
import{u,S,K,B,A,ei,Zd,k,lr}from"./chunk-q6jsw0rr.js";var X={x:0.5,y:0.5};class ai extends Zd{apply({activatorEvent:g,shape:I,transform:m}){if(!I||!(g instanceof PointerEvent))return m;let h=this.options?.anchor??X,{boundingRectangle:p}=I.initial,F=p.left+p.width*h.x,l=p.top+p.height*h.y;return{x:m.x+g.clientX-F,y:m.y+g.clientY-l}}static configure=ei(ai)}S();function Zl({teamId:g,projectId:I,assetId:m,folders:h,files:p,selectedIds:F,onClearSelection:l}){let D=K(),[d,w]=u(void 0),j=(n,r)=>{let s=["search",g,m,n?"folder":"file"],i=D.getQueriesData({queryKey:s}),o=(t)=>{if(typeof t!=="object"||t===null)return!1;let e=t;return"field"in e&&"order"in e&&typeof e.field==="string"&&(e.order==="asc"||e.order==="desc")};for(let[t,e]of i){if(!e||!Array.isArray(e.pages))continue;let f=t.find(o),a=e.pages.flatMap((c)=>c.data??[]),E=a.findIndex((c)=>c.id===r.id);if(E===-1)continue;if(a[E]={...a[E],...r},f?.field==="custom"){let c=f.order==="desc";a.sort((x,b)=>{let R=x.sortIndex??"",q=b.sortIndex??"";if(R===q)return 0;if(c)return R<q?1:-1;else return R<q?-1:1})}let T=0,z=e.pages.map((c)=>{let x=c.data?c.data.length:0,b=a.slice(T,T+x);return T+=x,{...c,data:b}});D.setQueryData(t,{...e,pages:z})}},v=A.api.projects[":projectId"].reparent.$post,{mutate:P}=B({mutationFn:async(n)=>{if(!(await v(n)).ok)throw Error("Failed to move assets");return null}}),C=A.api.folders[":folderId"].order.$patch,{mutate:Q}=B({mutationFn:async(n)=>{let r=await C(n);if(!r.ok)throw Error("Failed to reorder folder");return await r.json()}}),L=A.api.files[":fileId"].order.$patch,{mutate:M}=B({mutationFn:async(n)=>{let r=await L(n);if(!r.ok)throw Error("Failed to reorder file");return await r.json()}}),O=A.api.shares[":shareId"].assets.$post,{mutate:U}=B({mutationFn:async(n)=>{let r=await O(n);if(!r.ok)throw Error("Failed to add asset to share");return await r.json()}});return{dragState:d,handleDragStart:(n)=>{let r=n.operation.source;if(!r)return;let y=r.id.split(":").pop(),s=r.data;if(!s)return;let i,o;if(F.has(y))i=new Set(F),o=[...h,...p].filter((f)=>F.has(f.id));else i=new Set([y]),o=[s.item];let t=o.some((f)=>f.type==="folder"),e=i.size===1&&o.length===1&&o[0].type==="file";w({isActive:!0,draggedIds:i,hasFolders:t,isSingleFile:e,itemCount:i.size})},handleDragEnd:(n)=>{let{target:r}=n.operation;if(r&&d){let y=r.id.split(":").pop(),s=r.data;if(s?.type==="chatbot-sidebar"){let t=[...h,...p].filter((e)=>d.draggedIds.has(e.id)).map((e)=>({id:e.id,name:e.name||"Unnamed",type:e.type}));lr.getState().addAssets(t),l(),w(void 0);return}if(s?.type==="share-link"){let o=y,t=Array.from(d.draggedIds);U({param:{shareId:o},json:{assetIds:t}},{onSuccess:(e)=>{if(e.addedCount===0)k.info("Assets already exists in share");else k.success(`Added ${e.addedCount} item(s) to share link`);D.invalidateQueries({queryKey:["shares",I]}),l()},onError:(e)=>{k.error(`Failed to add to share: ${e.message}`)}}),w(void 0);return}let i=!1;if(s&&!d.draggedIds.has(y)){if(s.type==="folder"||s.type==="reorder")i=!0;else if(s.type==="file"||s.type==="version_stack"){if(d.isSingleFile)i=!0}}if(s?.type==="reorder"){let{position:o,item:t}=s,e=d.hasFolders,f=Array.from(d.draggedIds)[0];if(e)Q({param:{folderId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{k.success("Folder reordered"),j(!0,a),l()},onError:(a)=>{k.error(`Failed to reorder: ${a.message}`)}});else M({param:{fileId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{k.success("File reordered"),j(!1,a),l()},onError:(a)=>{k.error(`Failed to reorder: ${a.message}`)}})}else if(i)P({param:{projectId:I},json:{assetIds:Array.from(d.draggedIds),newParentId:y}},{onSuccess:()=>{k.success("Assets moved successfully"),D.invalidateQueries({queryKey:["search",g,m]}),D.invalidateQueries({queryKey:["folders"]}),l()},onError:()=>{k.error("Failed to move assets")}})}w(void 0)}}}
|
|
2
2
|
export{ai,Zl};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
3
|
-
export{
|
|
2
|
+
function xs(i){let t=3735928559,h=1103547991;for(let e=0;e<i.length;e++){let l=i.charCodeAt(e);t=Math.imul(t^l,2654435761),h=Math.imul(h^l,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(h^h>>>13,3266489909),h=Math.imul(h^h>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(h>>>0).toString(36)+(t>>>0).toString(36)}
|
|
3
|
+
export{xs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,D,u,S,
|
|
1
|
+
import{h,D,u,S,L,t,o,K,B,ft,Me,Ue,A,F,jn,Ls,Ti,E,Ce,Ie,Te,SA,D0,I_,Tf,Oc,Bs,Jv,_l,Fx,oE,qC,gn,lt,Nt,k,yr,je,$t,wt,Wp}from"./chunk-q6jsw0rr.js";import{Er}from"./chunk-xznabrt2.js";import{Pl}from"./chunk-8gna37dd.js";import{rr}from"./chunk-zej27b5c.js";import{Rn,Nn,Dn,br,xt,_t}from"./chunk-njqf50vw.js";import{co}from"./chunk-80qz30dc.js";import{Rr}from"./chunk-0ygtayqf.js";S();var P=(a)=>{if(!a)return"??";return a.split(" ").map((i)=>i[0]).slice(0,2).join("").toUpperCase()};function H(){let{projectId:a}=R.useParams(),{teamId:i,ensureTeamIdForProject:d}=lt(),N=K(),y=Me();h(()=>{d(a)},[a,d]);let{data:n}=rr(Wp(a)),m=n?.rootFolder,[w,C]=u(240),{shareConfigLeftSidebarCollapsed:c,setShareConfigLeftSidebarCollapsed:I}=$t(),{data:p,isLoading:T,fetchNextPage:f,hasNextPage:b,isFetchingNextPage:l}=ft({queryKey:["shares",a],queryFn:async({pageParam:e})=>{let r=await A.api.projects[":projectId"].shares.$get({param:{projectId:a},query:{first:"20",after:e}});if(!r.ok)throw Error("Failed to fetch share links");return await r.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,enabled:!!a}),{ref:j,inView:g}=Nt();h(()=>{if(g&&b&&!l)f()},[g,b,l,f]);let x=D(()=>p?.pages.flatMap((e)=>e.data)||[],[p]),{mutate:_}=B({mutationFn:async({id:e,isDisabled:r})=>{let s=await A.api.shares[":shareId"].$put({param:{shareId:e},json:{isDisabled:r}});if(!s.ok)throw Error("Failed to update share link");return await s.json()},onSuccess:()=>{N.invalidateQueries({queryKey:["shares",a]}),k.success(qC())},onError:(e)=>{k.error(Bs({message:e.message}))}});if(!i||!m||!n)return t(wt,{});let v=async(e)=>{let r=`${window.location.origin}/share/${e}`;if(await co(r))k.success(Jv())};return t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!c&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>I(!0)}),!c&&o(L,{children:[t("div",{className:"bg-background",style:{width:w},children:t(yr,{teamId:i,projectId:a,projectName:n.name??"",rootFolderId:m})}),t(Er,{onResize:(e)=>{C((r)=>Math.max(180,Math.min(400,r+e)))},className:"hidden md:block"})]}),o("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[t("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:o("div",{className:"flex items-center gap-2",children:[t(Ti,{className:"h-5 w-5 text-primary"}),t("h1",{className:"font-bold text-lg text-foreground",children:D0()})]})}),t("div",{className:"flex-1 overflow-y-auto p-6",children:T?t("div",{className:"flex justify-center items-center h-64",children:t("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):x.length===0?o("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[t(Ls,{className:"h-10 w-10 text-muted-foreground/50"}),t("p",{children:Fx()})]}):o("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[o(Rn,{children:[t(Nn,{children:o(br,{className:"hover:bg-transparent bg-muted/20",children:[t(xt,{className:"font-semibold px-4 py-3",children:_l()}),t(xt,{className:"font-semibold px-4 py-3",children:oE()}),t(xt,{className:"font-semibold px-4 py-3",children:Oc()}),t(xt,{className:"font-semibold px-4 py-3 w-[150px]",children:Tf()}),t(xt,{className:"font-semibold px-4 py-3 text-right w-[120px]",children:SA()})]})}),t(Dn,{children:x.map((e)=>{let r=`${window.location.origin}/share/${e.id}`;return o(br,{className:"hover:bg-muted/10 transition-colors",children:[t(_t,{className:"font-medium px-4 py-3.5",children:t("span",{className:"cursor-pointer hover:underline text-foreground",onClick:()=>y({to:"/projects/$projectId/shares/$shareId",params:{projectId:a,shareId:e.id}}),children:e.name})}),t(_t,{className:"px-4 py-3.5 max-w-[300px]",children:o("div",{className:"flex items-center gap-2 group",children:[t("span",{className:"truncate text-xs font-mono bg-muted/50 text-muted-foreground px-2 py-1 rounded-md border border-border cursor-pointer hover:bg-muted transition-colors flex-1",onClick:()=>v(e.id),title:I_(),children:r}),t(E,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>v(e.id),children:t(Rr,{className:"h-3.5 w-3.5"})}),t("a",{href:r,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center",children:t(Pl,{className:"h-3.5 w-3.5"})})]})}),t(_t,{className:"px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[e.creator?.image&&t(Ie,{src:e.creator.image,alt:e.creator.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:P(e.creator?.name)})]}),t("span",{className:"text-sm font-medium text-foreground truncate max-w-[150px]",children:e.creator?.name||gn()})]})}),t(_t,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:o("div",{className:"flex items-center gap-2",children:[t(jn,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),t("span",{children:new Date(e.createdAt).toLocaleDateString()})]})}),t(_t,{className:"px-4 py-3.5 text-right",children:t("div",{className:"flex justify-end",children:t(je,{checked:!e.isDisabled,onCheckedChange:(s)=>_({id:e.id,isDisabled:!s})})})})]},e.id)})})]}),t("div",{ref:j,className:"h-10 w-full flex items-center justify-center",children:l&&t(F,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var R=Ue("/projects/$projectId/shares/")({component:H});export{R as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ws,Kl,pi,Wl,mi,Yl,Jl,Xl,ec,tc}from"./chunk-xzyfnfck.js";import{cr}from"./chunk-3h9c5ak3.js";import{wn,xn}from"./chunk-qgkbxw1k.js";import{qe,Cr}from"./chunk-3g5pyw2e.js";import{Ba}from"./chunk-gc6m7agb.js";import{cn,Hr}from"./chunk-05tnmf8h.js";import{Yt}from"./chunk-b3aqmcps.js";var y="v1",E="gcp-vertex-credentials",T={THINKING_LEVEL_UNSPECIFIED:ws.THINKING_LEVEL_UNSPECIFIED,MINIMAL:ws.MINIMAL,LOW:ws.LOW,MEDIUM:ws.MEDIUM,HIGH:ws.HIGH},_=0,m=(e,t,n)=>{let o=new Yt;return(async()=>{let i={role:"assistant",content:[],api:"google-vertex",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let u=S(n),s=u?v(e,u,n?.headers):b(e,A(n),P(n),n?.headers,n?.env),h=N(e,t,n),g=await n?.onPayload?.(h,e);if(g!==void 0)h=g;let x=await s.models.generateContentStream(h);o.push({type:"start",partial:i});let r=null,I=i.content,l=()=>I.length-1;for await(let c of x){i.responseId||=c.responseId;let p=c.candidates?.[0];if(p?.content?.parts)for(let a of p.content.parts){if(a.text!==void 0){let d=Wl(a);if(!r||d&&r.type!=="thinking"||!d&&r.type!=="text"){if(r)if(r.type==="text")o.push({type:"text_end",contentIndex:I.length-1,content:r.text,partial:i});else o.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:i});if(d)r={type:"thinking",thinking:"",thinkingSignature:void 0},i.content.push(r),o.push({type:"thinking_start",contentIndex:l(),partial:i});else r={type:"text",text:""},i.content.push(r),o.push({type:"text_start",contentIndex:l(),partial:i})}if(r.type==="thinking")r.thinking+=a.text,r.thinkingSignature=mi(r.thinkingSignature,a.thoughtSignature),o.push({type:"thinking_delta",contentIndex:l(),delta:a.text,partial:i});else r.text+=a.text,r.textSignature=mi(r.textSignature,a.thoughtSignature),o.push({type:"text_delta",contentIndex:l(),delta:a.text,partial:i})}if(a.functionCall){if(r){if(r.type==="text")o.push({type:"text_end",contentIndex:l(),content:r.text,partial:i});else o.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:i});r=null}let d=a.functionCall.id,f={type:"toolCall",id:!d||i.content.some((C)=>C.type==="toolCall"&&C.id===d)?`${a.functionCall.name}_${Date.now()}_${++_}`:d,name:a.functionCall.name||"",arguments:a.functionCall.args??{},...a.thoughtSignature&&{thoughtSignature:a.thoughtSignature}};i.content.push(f),o.push({type:"toolcall_start",contentIndex:l(),partial:i}),o.push({type:"toolcall_delta",contentIndex:l(),delta:JSON.stringify(f.arguments),partial:i}),o.push({type:"toolcall_end",contentIndex:l(),toolCall:f,partial:i})}}if(p?.finishReason){if(i.stopReason=tc(p.finishReason),i.content.some((a)=>a.type==="toolCall"))i.stopReason="toolUse"}if(c.usageMetadata)i.usage={input:(c.usageMetadata.promptTokenCount||0)-(c.usageMetadata.cachedContentTokenCount||0),output:(c.usageMetadata.candidatesTokenCount||0)+(c.usageMetadata.thoughtsTokenCount||0),cacheRead:c.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:c.usageMetadata.thoughtsTokenCount||0,totalTokens:c.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},cn(e,i.usage)}if(r)if(r.type==="text")o.push({type:"text_end",contentIndex:l(),content:r.text,partial:i});else o.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:i});if(n?.signal?.aborted)throw Error("Request was aborted");if(i.stopReason==="aborted"||i.stopReason==="error")throw Error("An unknown error occurred");o.push({type:"done",reason:i.stopReason,message:i}),o.end()}catch(u){for(let s of i.content)if("index"in s)delete s.index;i.stopReason=n?.signal?.aborted?"aborted":"error",i.errorMessage=xn(wn(u)),o.push({type:"error",reason:i.stopReason,error:i}),o.end()}})(),o},Y=(e,t,n)=>{let o=Cr(e,t,n,void 0);if(!n?.reasoning)return m(e,t,{...o,thinking:{enabled:!1}});let i=Hr(e,n.reasoning),u=i==="off"?"high":i,s=e;if(k(s)||L(s))return m(e,t,{...o,thinking:{enabled:!0,level:D(u,s)}});return m(e,t,{...o,thinking:{enabled:!0,budgetTokens:H(s,u,n.thinkingBudgets)}})};function b(e,t,n,o,i){let u=w(i);return new pi({vertexai:!0,project:t,location:n,apiVersion:y,...u?{googleAuthOptions:u}:{},httpOptions:O(e,o)})}function v(e,t,n){return new pi({vertexai:!0,apiKey:t,apiVersion:y,httpOptions:O(e,n)})}function O(e,t){let n={},o=M(e.baseUrl);if(o){if(n.baseUrl=o,n.baseUrlResourceScope=Kl.COLLECTION,R(o))n.apiVersion=""}let i=Ba({...e.headers,...t});if(i)n.headers=i;return Object.keys(n).length>0?n:void 0}function M(e){let t=e.trim();if(!t||t.includes("{location}"))return;return t}function R(e){try{return new URL(e).pathname.split("/").some((n)=>/^v\d+(?:beta\d*)?$/.test(n))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function w(e){let t=cr("GOOGLE_APPLICATION_CREDENTIALS",e);return t?{keyFilename:t}:void 0}function S(e){let t=e?.apiKey?.trim();if(!t||t===E||G(t))return;return t}function G(e){return/^<[^>]+>$/.test(e)}function A(e){let t=e?.project||cr("GOOGLE_CLOUD_PROJECT",e?.env)||cr("GCLOUD_PROJECT",e?.env);if(!t)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return t}function P(e){let t=e?.location||cr("GOOGLE_CLOUD_LOCATION",e?.env);if(!t)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return t}function N(e,t,n={}){let o=Yl(e,t),i={};if(n.temperature!==void 0)i.temperature=n.temperature;if(n.maxTokens!==void 0)i.maxOutputTokens=n.maxTokens;let u=t.tools?.length?ec(t.tools,n.toolChoice,Xl(e.id)):void 0,s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:qe(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:Jl(t.tools)},...u!==void 0&&{toolConfig:{functionCallingConfig:{mode:u}}}};if(n.thinking?.enabled&&e.reasoning){let g={includeThoughts:!0};if(n.thinking.level!==void 0)g.thinkingLevel=T[n.thinking.level];else if(n.thinking.budgetTokens!==void 0)g.thinkingBudget=n.thinking.budgetTokens;s.thinkingConfig=g}else if(e.reasoning&&n.thinking&&!n.thinking.enabled)s.thinkingConfig=U(e);if(n.signal){if(n.signal.aborted)throw Error("Request aborted");s.abortSignal=n.signal}return{model:e.id,contents:o,config:s}}function k(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function L(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t==="gemini-flash-latest"||t==="gemini-flash-lite-latest"}function U(e){let t=e;if(k(t))return{thinkingLevel:ws.LOW};if(L(t))return{thinkingLevel:ws.MINIMAL};return{thinkingBudget:0}}function D(e,t){if(k(t))switch(e){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}switch(e){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function H(e,t,n){if(n?.[t]!==void 0)return n[t];if(e.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[t];if(e.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[t];return-1}export{m as stream,Y as streamSimple};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,S,t,Z,B,Ue,A,Nh,lt,em,_A}from"./chunk-q6jsw0rr.js";import"./chunk-5rk7dyx9.js";import"./chunk-6rjkbwz6.js";import"./chunk-camzbwqh.js";import"./chunk-3p1bb08a.js";import"./chunk-887pj9xd.js";import"./chunk-zz0522zr.js";import"./chunk-rkafv27g.js";import"./chunk-r55htzxr.js";import"./chunk-ayq8dskd.js";import"./chunk-4a88wwg2.js";import"./chunk-j41mya13.js";import"./chunk-xca338dw.js";import"./chunk-xznabrt2.js";import{Gn}from"./chunk-kq2qbwx1.js";import{rr}from"./chunk-zej27b5c.js";import"./chunk-4m8gk79m.js";import"./chunk-9va1mzeq.js";import"./chunk-jt04mf5s.js";import"./chunk-8ystwvdt.js";import"./chunk-8sf106rq.js";import"./chunk-q1d7x1cc.js";import"./chunk-fhazy8f9.js";import"./chunk-0ygtayqf.js";S();function u(){let{projectId:o,collectionId:r}=y.useParams(),{teamId:s,ensureTeamIdForProject:i}=lt();h(()=>{i(o)},[o,i]);let{data:l}=rr(em(o)),{data:a,refetch:d}=Z({..._A(r)}),{mutate:p}=B({mutationFn:async(n)=>{let c=await A.api.collections[":collectionId"].$patch({param:{collectionId:r},json:n});if(!c.ok)throw Error("Failed to update collection");return await c.json()},onSuccess:()=>{d()}}),e=l?.rootFolder,{data:f}=Z({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("Failed to fetch folder");return await n.json()},enabled:!!e});if(!s||!e||!f||!a)return t("div",{children:Nh()});let m=a.filter.sourceFolderId||e;return t(Gn,{teamId:s,projectId:o,projectName:l.name??"",assetId:m,rootFolderId:e,collection:a,onUpdateCollection:p})}var y=Ue("/projects/$projectId/collections/$collectionId")({component:u});export{y as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P,h,b,u,S,Z,t,o,K,L,A,I,F,In,St,ve,vt,Xt,er,pe,we,Re,C,z0,j0,V0,i_,wf,Km,F_,sy,Ry,Ny,pr,Ih,Bf,Hf,qh,mx,bx,jx,rg,bp,Nd,OC,k1,Pp,Op,$1,gn,Fp,ce,lt,Dr,Mn,ha,Fe,Le,Ze,Be,ne,Eo,zs,$t,ir}from"./chunk-jh8q3885.js";import{yn}from"./chunk-ey3h4sct.js";import{uu,js}from"./chunk-k6avge95.js";import{Co}from"./chunk-rsd164d9.js";var qe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ie=I("brain",qe);S();function va({projectId:c,contextAssetId:_,file:x,currentTime:le,frameRate:R,startTimecode:U,formatTimestamp:H,onTyping:de,onSelectMessage:X,selectedMessageId:me}){let{isHistoryMode:g,setIsHistoryMode:q,currentSessionId:ue,chatAssets:fe,removeAsset:ge,messages:y,historySessions:G,isStreaming:M,fetchHistorySessions:Y,loadSession:xe,deleteSession:he,startNewSession:ee,sendMessage:be,abortActiveSession:ye,selectedAgentId:j,setSelectedAgentId:D,inputText:ke,setInputText:Ne}=ir(),{teamId:p,ensureTeamIdForProject:te}=lt(),{videoTimeDisplayMode:_e}=$t(),[E,O]=u(null);h(()=>{if(c)te(c)},[c,te]);let{data:Se=[],isSuccess:re}=L({queryKey:["chat-agents",c],queryFn:async()=>{if(!c)return[];let e=await A.api.projects[":projectId"]["chat-agents"].$get({param:{projectId:c}});if(!e.ok)throw Error("failed to fetch agents");return e.json()},enabled:!!c}),T=Se.filter((e)=>e.type==="chat"&&e.enabled);h(()=>{if(!re)return;if(T.length>0){if(!T.some((r)=>r.id===j))D(T[0].id)}else if(j!==null)D(null)},[re,T,j,D]);let oe=b(null),B=b(null),Q=b(!0),z=b(!0);h(()=>{z.current=!0,Q.current=!0},[c,_,g]),h(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let{scrollTop:r,isAtBottom:l}=ir.getState(),s=setTimeout(()=>{if(l)e.scrollTop=e.scrollHeight;else e.scrollTop=r;let m=setTimeout(()=>{z.current=!1},50);return()=>clearTimeout(m)},0);return()=>clearTimeout(s)},[c,_,g]),h(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let r=()=>{if(z.current)return;let l=e.scrollTop,s=e.scrollHeight-l-e.clientHeight<10;ir.getState().setScrollState(l,s)};return e.addEventListener("scroll",r),()=>{e.removeEventListener("scroll",r)}},[c,_,g]);let{ref:Te,isDropTarget:Ce}=Dr({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});h(()=>{if(!g){let{isAtBottom:e}=ir.getState();if(e||M){let r=Q.current?"auto":"smooth";oe.current?.scrollIntoView({behavior:r})}Q.current=!1}},[y,M,g]),h(()=>{if(g&&p)Y(p)},[g,Y,p]);let k=K(),Ae=P(()=>{k.invalidateQueries({queryKey:["search"]}),k.invalidateQueries({queryKey:["folders"]}),k.invalidateQueries({queryKey:["files"]}),k.invalidateQueries({queryKey:["file"]}),k.invalidateQueries({queryKey:["version_stacks"]}),k.invalidateQueries({queryKey:["projects"]})},[k]),V=(e)=>{if(typeof e==="string")return e;if(Array.isArray(e))return e.map((r)=>{if(typeof r==="string")return r;if(r&&typeof r==="object"&&"type"in r&&r.type==="text"&&"text"in r)return String(r.text);return""}).join("");return""},se=(e)=>e.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:"),Me=(e)=>{switch(e.role){case"user":case"custom":{let r=e;if(e.role==="custom"&&r.customType==="context_display_info"){let m=r.details?.assets||[];if(m.length===0)return null;return o("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[t("div",{className:"font-semibold",children:j0()}),t("ul",{className:"list-disc list-inside space-y-0.5",children:m.map((n)=>o("li",{className:"truncate",children:[n.name," ",o("span",{className:"text-muted-foreground/70",children:["(",n.type,")"]})]},n.id))})]},e.id)}if(e.role==="user"||r.customType==="shumai_message"){let s=r.details,m=s?.referencedAssets||[],n=s?.attachedFiles||[],i=s?.position,f=s?.annotation||s?.annotations&&s.annotations.length>0,d=!s?.currentAsset?.id||_&&s.currentAsset.id===_||x?.id&&s.currentAsset.id===x.id,v=me===e.id,N="";if(i?.type==="time")if(H)N=H(i.seconds);else if(R){let a=Math.round(i.seconds*R);N=yn(a,R,_e,U)}else{let a=Math.floor(i.seconds/60),w=Math.floor(i.seconds%60);N=`${a.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`}else if(i?.type==="page")N=rg({page:i.page});let ae=V(r.content),je=n.length>0||m.length>0;return t("div",{onClick:()=>{if(d&&X)X(e)},className:C("flex flex-col items-end w-full group transition-all duration-150",d&&(f||i)&&"cursor-pointer"),children:o("div",{className:C("bg-primary text-primary-foreground rounded-lg px-3 py-2 text-sm whitespace-pre-wrap shadow-xs break-words transition-all border",je?"w-full":"max-w-[85%]",v?"border-blue-500 dark:border-blue-400":"border-transparent"),children:[o("div",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:[f&&t("span",{className:"inline-flex items-center align-middle mr-1.5 p-0.5 rounded bg-primary-foreground/20 text-primary-foreground",title:F_(),children:t(ha,{className:"w-3.5 h-3.5"})}),i&&t("span",{className:"inline-flex items-center align-middle mr-1.5 px-1.5 py-0.5 rounded text-xs font-mono font-bold bg-primary-foreground/20 text-primary-foreground",children:N}),ae&&t("span",{children:ae})]}),n.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:V0()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:n.map((a)=>{let w=a.name||"file",W=zs(w)||a.mediaType==="image"||a.mimeType?.startsWith("image/");return o("div",{className:C("group/att relative flex items-center w-full max-w-full rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",W?"h-18 p-1.5 gap-2.5 cursor-pointer":"h-9 px-2.5 gap-2.5"),onClick:(J)=>{if(J.stopPropagation(),a.url)if(W)O({url:a.url,name:w});else window.open(a.url,"_blank","noreferrer")},children:[W&&a.url?t("div",{className:"h-full aspect-square rounded-md overflow-hidden bg-black/20 shrink-0",children:t("img",{src:a.url,alt:w,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"})}):t(Xt,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("div",{className:"min-w-0 flex-1 overflow-hidden",children:t("p",{className:"text-xs font-medium text-primary-foreground truncate block w-full",title:w,children:w})}),a.url&&t("a",{href:a.url,target:"_blank",rel:"noreferrer",download:w,className:"p-1 text-primary-foreground/70 hover:text-primary-foreground shrink-0 rounded-md hover:bg-primary-foreground/20 transition-colors opacity-0 group-hover/att:opacity-100",onClick:(J)=>J.stopPropagation(),title:pr(),children:t(vt,{className:"w-3.5 h-3.5"})})]},a.id)})})]}),m.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:z0()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:m.map((a)=>o("div",{className:"flex items-center justify-between w-full h-9 px-2.5 rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",children:[o("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.type==="folder"?t(er,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}):t(Xt,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("span",{className:"text-xs font-medium truncate text-primary-foreground",title:a.name,children:a.name})]}),t("span",{className:"text-[10px] text-primary-foreground/60 uppercase shrink-0 font-mono ml-2",children:a.type})]},a.id))})]})]})},e.id)}let l=r.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}case"assistant":{let l=e.content;if(!l)return null;let s=[];if(l.forEach((n,i)=>{if(!n||typeof n!=="object")return;let f=n;switch(f.type){case"text":{let d=f.text;if(typeof d!=="string"||!d.trim())return;s.push(t("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:t(Eo,{components:{pre:({node:v,...N})=>t("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",...N})},children:se(d)})},`txt-${i}`));break}case"thinking":{let d=f.thinking;if(typeof d!=="string"||!d.trim())return;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(ie,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),t("span",{children:bp()||"Thinking"}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),t("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:t(Eo,{children:se(d)})})]},`think-${i}`));break}case"toolCall":{let d=String(f.name||f.toolName||gn()),v=f.arguments||f.args;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(Co,{className:"h-3.5 w-3.5"}),t("span",{children:wf()}),t("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:d}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!v&&o("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[t("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Pp()||"Arguments"}),t("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(v,null,2)})]})]},`tool-${i}`));break}case"image":{let d=String(f.mimeType||"image/png"),v=String(f.data||"");s.push(t("div",{className:"my-2 max-w-full",children:v?t("img",{src:v.startsWith("data:")?v:`data:${d};base64,${v}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Bf()})},`img-${i}`));break}default:{let d=JSON.stringify(n,null,2);if(d==="{}")return;s.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:d},`other-${i}`))}}}),s.length===0)return null;let m=!1;if(l.length>0){let n=l[l.length-1];if(typeof n==="string"&&n.trim().length>0)m=!0;else if(n&&typeof n==="object"){let i=n;if(i.type==="text"&&typeof i.text==="string"&&i.text.trim().length>0)m=!0}}return o("div",{className:"flex flex-col w-full space-y-1",children:[t("div",{className:"space-y-2 w-full",children:s}),m&&t("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:sy()})]},e.id)}case"toolResult":return t("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:t("span",{className:"font-semibold",children:Op({name:e.toolName||"tool"})})},e.id);case"thinking_level_change":{let l=e.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}default:return null}};return o("div",{ref:Te,className:C("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Ce&&t("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:o("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[t(St,{className:"h-6 w-6 text-primary animate-bounce"}),t("span",{className:"text-sm font-semibold text-foreground",children:Km()})]})}),o("div",{className:"h-12 border-b border-border flex items-center justify-between px-4 flex-shrink-0 bg-background/50 backdrop-blur-sm",children:[o("div",{className:"flex items-center gap-2",children:[g&&t("button",{onClick:()=>q(!1),className:"p-1 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:i_(),children:t(uu,{className:"h-4 w-4"})}),t(St,{className:"h-5 w-5 text-primary"}),t("span",{className:"font-semibold text-sm",children:g?Ih():OC()})]}),t("div",{className:"flex items-center gap-1",children:!g?o(Z,{children:[t("button",{onClick:ee,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:qh(),children:t(pe,{className:"h-4 w-4"})}),t("button",{onClick:()=>q(!0),className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Ih(),children:t(In,{className:"h-4 w-4"})})]}):o("button",{onClick:()=>{ee(),q(!1)},className:"flex items-center gap-1 text-xs bg-primary text-primary-foreground px-2.5 py-1 rounded-md hover:bg-primary/90 transition-colors shadow-xs cursor-pointer",children:[t(pe,{className:"h-3.5 w-3.5"}),t("span",{children:qh()})]})})]}),g?t(ce,{className:"flex-1 p-3",children:G.length===0?t("div",{className:"text-center text-xs text-muted-foreground py-8",children:bx()}):t("div",{className:"space-y-1",children:G.map((e)=>{let r=e.id===ue;return o("div",{onClick:()=>{if(p)xe(p,e.id),q(!1)},className:C("group flex items-center justify-between p-2.5 rounded-lg text-xs cursor-pointer transition-all border border-transparent",r?"bg-accent/80 text-accent-foreground font-medium border-border/40":"hover:bg-muted/60 text-muted-foreground hover:text-foreground"),children:[o("div",{className:"flex flex-col min-w-0 pr-2",children:[t("span",{className:"truncate text-foreground font-medium text-xs",children:e.name||Fp()}),t("span",{className:"text-[10px] text-muted-foreground",children:Mn(e.updatedAt)})]}),t("button",{onClick:(l)=>{if(l.stopPropagation(),p&&window.confirm(Ny()))he(p,e.id)},className:"opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted cursor-pointer",title:Ry(),children:t(we,{className:"h-4 w-4"})})]},e.id)})})}):o(Z,{children:[t(ce,{ref:B,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:y.length===0?o("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[t(St,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),t("p",{className:"text-sm",children:Km()})]}):o("div",{className:"space-y-4 pb-4",children:[y.map(Me),M&&y.length>0&&(y[y.length-1].role==="user"||y[y.length-1].customType==="shumai_message")&&o("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[t(F,{className:"h-3 w-3 animate-spin text-primary"}),t("span",{children:k1()})]}),t("div",{ref:oe})]})}),t("div",{className:"p-2 flex-shrink-0 bg-background",children:t(js,{projectId:c,value:ke,onChangeText:Ne,placeholder:$1(),disabled:!j||!p,isStreaming:M,onAbort:()=>{if(p)ye(p)},allowMentions:!1,allowAttachments:!0,workspaceAssets:fe,onRemoveWorkspaceAsset:ge,allowMarkup:!0,canMarkup:!!x&&["image","video","pdf"].includes(x.proxyType||""),markupDisabledTooltip:!x?jx():Hf(),allowTimestamp:x?.proxyType==="video"||x?.proxyType==="pdf",currentTime:le,frameRate:R||x?.media?.metadata?.frameRate||30,startTimecode:U||x?.media?.metadata?.startTimecode,formatTimestamp:H||(x?.proxyType==="pdf"?(e)=>rg({page:Math.round(e)}):void 0),onTyping:de,onSendMessage:(e,r,l,s,m,n)=>{if(!p)return;be(p,e,c,_,Ae,r,l,m,n)},bottomLeftExtra:t("div",{className:"flex items-center gap-1.5 min-w-0 max-w-full",children:T.length>0?o(Fe,{value:j||"",onValueChange:(e)=>D(e),disabled:M,children:[t(Ze,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full cursor-pointer",children:t(Le,{placeholder:Nd()})}),t(Be,{children:T.map((e)=>t(ne,{value:e.id,className:"cursor-pointer",children:o("div",{className:"flex items-center gap-2",children:[e.avatar?t("img",{src:e.avatar,alt:e.name,className:"w-4 h-4 rounded-full object-cover"}):t(St,{className:"w-4 h-4 text-muted-foreground"}),t("span",{className:"text-xs",children:e.name})]})},e.id))})]}):t("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:t("span",{children:mx()})})})})})]}),E&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>O(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer",children:t(Re,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:E.url,alt:E.name,className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),O(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:E.name})]})]})}
|
|
2
|
-
export{
|
|
1
|
+
import{P,h,b,u,S,L,t,o,K,Z,A,I,F,In,St,ve,vt,er,tr,fe,we,Re,C,G0,V0,J0,f_,Sf,Wm,z_,uy,Fy,Ly,mr,Mh,zf,Gf,Vh,wx,Tx,Wx,ag,wp,Dd,HC,B1,Fp,Lp,tI,gn,Zp,ce,lt,Dr,Mn,_a,Fe,Le,Ze,Be,ne,Eo,js,$t,lr}from"./chunk-q6jsw0rr.js";import{yn}from"./chunk-887pj9xd.js";import{du,qs}from"./chunk-zz0522zr.js";import{Co}from"./chunk-9va1mzeq.js";var qe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ie=I("brain",qe);S();function wa({projectId:c,contextAssetId:_,file:x,currentTime:le,frameRate:R,startTimecode:U,formatTimestamp:H,onTyping:de,onSelectMessage:X,selectedMessageId:me}){let{isHistoryMode:g,setIsHistoryMode:q,currentSessionId:ue,chatAssets:pe,removeAsset:ge,messages:y,historySessions:G,isStreaming:M,fetchHistorySessions:Y,loadSession:xe,deleteSession:he,startNewSession:ee,sendMessage:be,abortActiveSession:ye,selectedAgentId:j,setSelectedAgentId:D,inputText:ke,setInputText:Ne}=lr(),{teamId:p,ensureTeamIdForProject:te}=lt(),{videoTimeDisplayMode:_e}=$t(),[E,O]=u(null);h(()=>{if(c)te(c)},[c,te]);let{data:Se=[],isSuccess:re}=Z({queryKey:["chat-agents",c],queryFn:async()=>{if(!c)return[];let e=await A.api.projects[":projectId"]["chat-agents"].$get({param:{projectId:c}});if(!e.ok)throw Error("failed to fetch agents");return e.json()},enabled:!!c}),T=Se.filter((e)=>e.type==="chat"&&e.enabled);h(()=>{if(!re)return;if(T.length>0){if(!T.some((r)=>r.id===j))D(T[0].id)}else if(j!==null)D(null)},[re,T,j,D]);let oe=b(null),B=b(null),Q=b(!0),z=b(!0);h(()=>{z.current=!0,Q.current=!0},[c,_,g]),h(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let{scrollTop:r,isAtBottom:l}=lr.getState(),s=setTimeout(()=>{if(l)e.scrollTop=e.scrollHeight;else e.scrollTop=r;let m=setTimeout(()=>{z.current=!1},50);return()=>clearTimeout(m)},0);return()=>clearTimeout(s)},[c,_,g]),h(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let r=()=>{if(z.current)return;let l=e.scrollTop,s=e.scrollHeight-l-e.clientHeight<10;lr.getState().setScrollState(l,s)};return e.addEventListener("scroll",r),()=>{e.removeEventListener("scroll",r)}},[c,_,g]);let{ref:Te,isDropTarget:Ce}=Dr({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});h(()=>{if(!g){let{isAtBottom:e}=lr.getState();if(e||M){let r=Q.current?"auto":"smooth";oe.current?.scrollIntoView({behavior:r})}Q.current=!1}},[y,M,g]),h(()=>{if(g&&p)Y(p)},[g,Y,p]);let k=K(),Ae=P(()=>{k.invalidateQueries({queryKey:["search"]}),k.invalidateQueries({queryKey:["folders"]}),k.invalidateQueries({queryKey:["files"]}),k.invalidateQueries({queryKey:["file"]}),k.invalidateQueries({queryKey:["version_stacks"]}),k.invalidateQueries({queryKey:["projects"]})},[k]),V=(e)=>{if(typeof e==="string")return e;if(Array.isArray(e))return e.map((r)=>{if(typeof r==="string")return r;if(r&&typeof r==="object"&&"type"in r&&r.type==="text"&&"text"in r)return String(r.text);return""}).join("");return""},se=(e)=>e.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:"),Me=(e)=>{switch(e.role){case"user":case"custom":{let r=e;if(e.role==="custom"&&r.customType==="context_display_info"){let m=r.details?.assets||[];if(m.length===0)return null;return o("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[t("div",{className:"font-semibold",children:V0()}),t("ul",{className:"list-disc list-inside space-y-0.5",children:m.map((n)=>o("li",{className:"truncate",children:[n.name," ",o("span",{className:"text-muted-foreground/70",children:["(",n.type,")"]})]},n.id))})]},e.id)}if(e.role==="user"||r.customType==="shumai_message"){let s=r.details,m=s?.referencedAssets||[],n=s?.attachedFiles||[],i=s?.position,f=s?.annotation||s?.annotations&&s.annotations.length>0,d=!s?.currentAsset?.id||_&&s.currentAsset.id===_||x?.id&&s.currentAsset.id===x.id,v=me===e.id,N="";if(i?.type==="time")if(H)N=H(i.seconds);else if(R){let a=Math.round(i.seconds*R);N=yn(a,R,_e,U)}else{let a=Math.floor(i.seconds/60),w=Math.floor(i.seconds%60);N=`${a.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`}else if(i?.type==="page")N=ag({page:i.page});let ae=V(r.content),je=n.length>0||m.length>0;return t("div",{onClick:()=>{if(d&&X)X(e)},className:C("flex flex-col items-end w-full group transition-all duration-150",d&&(f||i)&&"cursor-pointer"),children:o("div",{className:C("bg-primary text-primary-foreground rounded-lg px-3 py-2 text-sm whitespace-pre-wrap shadow-xs break-words transition-all border",je?"w-full":"max-w-[85%]",v?"border-blue-500 dark:border-blue-400":"border-transparent"),children:[o("div",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:[f&&t("span",{className:"inline-flex items-center align-middle mr-1.5 p-0.5 rounded bg-primary-foreground/20 text-primary-foreground",title:z_(),children:t(_a,{className:"w-3.5 h-3.5"})}),i&&t("span",{className:"inline-flex items-center align-middle mr-1.5 px-1.5 py-0.5 rounded text-xs font-mono font-bold bg-primary-foreground/20 text-primary-foreground",children:N}),ae&&t("span",{children:ae})]}),n.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:J0()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:n.map((a)=>{let w=a.name||"file",W=js(w)||a.mediaType==="image"||a.mimeType?.startsWith("image/");return o("div",{className:C("group/att relative flex items-center w-full max-w-full rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",W?"h-18 p-1.5 gap-2.5 cursor-pointer":"h-9 px-2.5 gap-2.5"),onClick:(J)=>{if(J.stopPropagation(),a.url)if(W)O({url:a.url,name:w});else window.open(a.url,"_blank","noreferrer")},children:[W&&a.url?t("div",{className:"h-full aspect-square rounded-md overflow-hidden bg-black/20 shrink-0",children:t("img",{src:a.url,alt:w,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"})}):t(er,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("div",{className:"min-w-0 flex-1 overflow-hidden",children:t("p",{className:"text-xs font-medium text-primary-foreground truncate block w-full",title:w,children:w})}),a.url&&t("a",{href:a.url,target:"_blank",rel:"noreferrer",download:w,className:"p-1 text-primary-foreground/70 hover:text-primary-foreground shrink-0 rounded-md hover:bg-primary-foreground/20 transition-colors opacity-0 group-hover/att:opacity-100",onClick:(J)=>J.stopPropagation(),title:mr(),children:t(vt,{className:"w-3.5 h-3.5"})})]},a.id)})})]}),m.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:G0()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:m.map((a)=>o("div",{className:"flex items-center justify-between w-full h-9 px-2.5 rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",children:[o("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.type==="folder"?t(tr,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}):t(er,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("span",{className:"text-xs font-medium truncate text-primary-foreground",title:a.name,children:a.name})]}),t("span",{className:"text-[10px] text-primary-foreground/60 uppercase shrink-0 font-mono ml-2",children:a.type})]},a.id))})]})]})},e.id)}let l=r.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}case"assistant":{let l=e.content;if(!l)return null;let s=[];if(l.forEach((n,i)=>{if(!n||typeof n!=="object")return;let f=n;switch(f.type){case"text":{let d=f.text;if(typeof d!=="string"||!d.trim())return;s.push(t("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:t(Eo,{components:{pre:({node:v,...N})=>t("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",...N})},children:se(d)})},`txt-${i}`));break}case"thinking":{let d=f.thinking;if(typeof d!=="string"||!d.trim())return;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(ie,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),t("span",{children:wp()||"Thinking"}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),t("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:t(Eo,{children:se(d)})})]},`think-${i}`));break}case"toolCall":{let d=String(f.name||f.toolName||gn()),v=f.arguments||f.args;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(Co,{className:"h-3.5 w-3.5"}),t("span",{children:Sf()}),t("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:d}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!v&&o("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[t("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Fp()||"Arguments"}),t("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(v,null,2)})]})]},`tool-${i}`));break}case"image":{let d=String(f.mimeType||"image/png"),v=String(f.data||"");s.push(t("div",{className:"my-2 max-w-full",children:v?t("img",{src:v.startsWith("data:")?v:`data:${d};base64,${v}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:zf()})},`img-${i}`));break}default:{let d=JSON.stringify(n,null,2);if(d==="{}")return;s.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:d},`other-${i}`))}}}),s.length===0)return null;let m=!1;if(l.length>0){let n=l[l.length-1];if(typeof n==="string"&&n.trim().length>0)m=!0;else if(n&&typeof n==="object"){let i=n;if(i.type==="text"&&typeof i.text==="string"&&i.text.trim().length>0)m=!0}}return o("div",{className:"flex flex-col w-full space-y-1",children:[t("div",{className:"space-y-2 w-full",children:s}),m&&t("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:uy()})]},e.id)}case"toolResult":return t("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:t("span",{className:"font-semibold",children:Lp({name:e.toolName||"tool"})})},e.id);case"thinking_level_change":{let l=e.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:V(l)},e.id)}default:return null}};return o("div",{ref:Te,className:C("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Ce&&t("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:o("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[t(St,{className:"h-6 w-6 text-primary animate-bounce"}),t("span",{className:"text-sm font-semibold text-foreground",children:Wm()})]})}),o("div",{className:"h-12 border-b border-border flex items-center justify-between px-4 flex-shrink-0 bg-background/50 backdrop-blur-sm",children:[o("div",{className:"flex items-center gap-2",children:[g&&t("button",{onClick:()=>q(!1),className:"p-1 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:f_(),children:t(du,{className:"h-4 w-4"})}),t(St,{className:"h-5 w-5 text-primary"}),t("span",{className:"font-semibold text-sm",children:g?Mh():HC()})]}),t("div",{className:"flex items-center gap-1",children:!g?o(L,{children:[t("button",{onClick:ee,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Vh(),children:t(fe,{className:"h-4 w-4"})}),t("button",{onClick:()=>q(!0),className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Mh(),children:t(In,{className:"h-4 w-4"})})]}):o("button",{onClick:()=>{ee(),q(!1)},className:"flex items-center gap-1 text-xs bg-primary text-primary-foreground px-2.5 py-1 rounded-md hover:bg-primary/90 transition-colors shadow-xs cursor-pointer",children:[t(fe,{className:"h-3.5 w-3.5"}),t("span",{children:Vh()})]})})]}),g?t(ce,{className:"flex-1 p-3",children:G.length===0?t("div",{className:"text-center text-xs text-muted-foreground py-8",children:Tx()}):t("div",{className:"space-y-1",children:G.map((e)=>{let r=e.id===ue;return o("div",{onClick:()=>{if(p)xe(p,e.id),q(!1)},className:C("group flex items-center justify-between p-2.5 rounded-lg text-xs cursor-pointer transition-all border border-transparent",r?"bg-accent/80 text-accent-foreground font-medium border-border/40":"hover:bg-muted/60 text-muted-foreground hover:text-foreground"),children:[o("div",{className:"flex flex-col min-w-0 pr-2",children:[t("span",{className:"truncate text-foreground font-medium text-xs",children:e.name||Zp()}),t("span",{className:"text-[10px] text-muted-foreground",children:Mn(e.updatedAt)})]}),t("button",{onClick:(l)=>{if(l.stopPropagation(),p&&window.confirm(Ly()))he(p,e.id)},className:"opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted cursor-pointer",title:Fy(),children:t(we,{className:"h-4 w-4"})})]},e.id)})})}):o(L,{children:[t(ce,{ref:B,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:y.length===0?o("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[t(St,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),t("p",{className:"text-sm",children:Wm()})]}):o("div",{className:"space-y-4 pb-4",children:[y.map(Me),M&&y.length>0&&(y[y.length-1].role==="user"||y[y.length-1].customType==="shumai_message")&&o("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[t(F,{className:"h-3 w-3 animate-spin text-primary"}),t("span",{children:B1()})]}),t("div",{ref:oe})]})}),t("div",{className:"p-2 flex-shrink-0 bg-background",children:t(qs,{projectId:c,value:ke,onChangeText:Ne,placeholder:tI(),disabled:!j||!p,isStreaming:M,onAbort:()=>{if(p)ye(p)},allowMentions:!1,allowAttachments:!0,workspaceAssets:pe,onRemoveWorkspaceAsset:ge,allowMarkup:!0,canMarkup:!!x&&["image","video","pdf"].includes(x.proxyType||""),markupDisabledTooltip:!x?Wx():Gf(),allowTimestamp:x?.proxyType==="video"||x?.proxyType==="pdf",currentTime:le,frameRate:R||x?.media?.metadata?.frameRate||30,startTimecode:U||x?.media?.metadata?.startTimecode,formatTimestamp:H||(x?.proxyType==="pdf"?(e)=>ag({page:Math.round(e)}):void 0),onTyping:de,onSendMessage:(e,r,l,s,m,n)=>{if(!p)return;be(p,e,c,_,Ae,r,l,m,n)},bottomLeftExtra:t("div",{className:"flex items-center gap-1.5 min-w-0 max-w-full",children:T.length>0?o(Fe,{value:j||"",onValueChange:(e)=>D(e),disabled:M,children:[t(Ze,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full cursor-pointer",children:t(Le,{placeholder:Dd()})}),t(Be,{children:T.map((e)=>t(ne,{value:e.id,className:"cursor-pointer",children:o("div",{className:"flex items-center gap-2",children:[e.avatar?t("img",{src:e.avatar,alt:e.name,className:"w-4 h-4 rounded-full object-cover"}):t(St,{className:"w-4 h-4 text-muted-foreground"}),t("span",{className:"text-xs",children:e.name})]})},e.id))})]}):t("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:t("span",{children:wx()})})})})})]}),E&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>O(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer",children:t(Re,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:E.url,alt:E.name,className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),O(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:E.name})]})]})}
|
|
2
|
+
export{wa};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Dt}from"./chunk-
|
|
2
|
+
import{Dt}from"./chunk-s30fjvzs.js";import{$e}from"./chunk-781990k7.js";import{z}from"./chunk-yqvhgtez.js";var _=z(Dt()),N=z($e()),wc="AWS_ACCESS_KEY_ID",xc="AWS_SECRET_ACCESS_KEY",S="AWS_SESSION_TOKEN",C="AWS_CREDENTIAL_EXPIRATION",A="AWS_CREDENTIAL_SCOPE",p="AWS_ACCOUNT_ID",Fu=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[wc],E=process.env[xc],r=process.env[S],n=process.env[C],s=process.env[A],t=process.env[p];if(o&&E){let c={accessKeyId:o,secretAccessKey:E,...r&&{sessionToken:r},...n&&{expiration:new Date(n)},...s&&{credentialScope:s},...t&&{accountId:t}};return _.setCredentialFeature(c,"CREDENTIALS_ENV_VARS","g"),c}throw new N.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{wc,xc,Fu};
|