@shumai-one/shumai 0.2.2 → 0.3.0

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.
Files changed (148) hide show
  1. package/bin/{chunk-e7ndw3hg.js → chunk-0p333kh7.js} +3 -3
  2. package/bin/chunk-1wz0dge4.js +3 -0
  3. package/bin/{chunk-gtrc5ka2.js → chunk-1yqar2gz.js} +1 -1
  4. package/bin/{chunk-fz88kkk1.js → chunk-1zpw2mbj.js} +2 -2
  5. package/bin/{chunk-46ar48f9.js → chunk-28egv700.js} +1 -1
  6. package/bin/{chunk-0xbf8bcg.js → chunk-2m2saan7.js} +2 -2
  7. package/bin/chunk-2p0rg6xs.js +1 -0
  8. package/bin/{chunk-w88219ex.js → chunk-2xmsa8wv.js} +1 -1
  9. package/bin/{chunk-mzg1h07d.js → chunk-36wf2dq0.js} +1 -1
  10. package/bin/{chunk-ta7bfdrn.js → chunk-3g54qkv5.js} +1 -1
  11. package/bin/chunk-3ge0s4k2.js +1 -0
  12. package/bin/{chunk-hr97a5j5.js → chunk-449feg7g.js} +1 -1
  13. package/bin/{chunk-hkbybhww.js → chunk-48ebezek.js} +1 -1
  14. package/bin/{chunk-8qg47kj6.js → chunk-4gbs9swm.js} +1 -1
  15. package/bin/{chunk-thsbcbay.js → chunk-4tt3jvm1.js} +1 -1
  16. package/bin/{chunk-15sefy5t.js → chunk-5jhrqbk2.js} +2 -2
  17. package/bin/{chunk-wg98cacx.js → chunk-5x1ppya9.js} +2 -2
  18. package/bin/{chunk-nrwna4ha.js → chunk-652x28v2.js} +1 -1
  19. package/bin/{chunk-0qkj838r.js → chunk-6f1twjf6.js} +1 -1
  20. package/bin/chunk-6ks4277t.js +2 -0
  21. package/bin/{chunk-0rxhc7ka.js → chunk-6wa075zh.js} +2 -2
  22. package/bin/{chunk-qksb0v3c.js → chunk-736tcjve.js} +2 -2
  23. package/bin/chunk-80d6p55n.js +1 -0
  24. package/bin/{chunk-gswbc6y9.js → chunk-8a9k4qj6.js} +2 -2
  25. package/bin/chunk-8g1s0pq1.js +2 -0
  26. package/bin/chunk-8gkm2ysh.js +1 -0
  27. package/bin/chunk-8nvybmyv.js +2 -0
  28. package/bin/{chunk-srn8t0v7.js → chunk-8rkp0fc5.js} +1 -1
  29. package/bin/{chunk-1wm57c6y.js → chunk-8sr8ff6a.js} +3 -3
  30. package/bin/{chunk-2aamsc5v.js → chunk-93jcw0pn.js} +1 -1
  31. package/bin/{chunk-3rmc8nz6.js → chunk-9bvwwj5y.js} +1 -1
  32. package/bin/{chunk-925q4paa.js → chunk-9fefn2st.js} +1 -1
  33. package/bin/{chunk-262hkppb.js → chunk-9h3c60vw.js} +2 -2
  34. package/bin/{chunk-xyjw8w3r.js → chunk-9jd3d3f3.js} +1 -1
  35. package/bin/chunk-9nwjhams.js +1 -0
  36. package/bin/{chunk-7b17fb36.js → chunk-9q32g9jd.js} +1 -1
  37. package/bin/{chunk-0aj303as.js → chunk-9zy0a8kt.js} +2 -2
  38. package/bin/{chunk-w7dn1m95.js → chunk-a06432s3.js} +1 -1
  39. package/bin/{chunk-de99643r.js → chunk-a1mtpcrd.js} +2 -2
  40. package/bin/{chunk-4e3jbp84.js → chunk-a2njf6av.js} +1 -1
  41. package/bin/{chunk-5d2q46mx.js → chunk-a6dvjjce.js} +1 -1
  42. package/bin/{chunk-s46zwr4p.js → chunk-aa2tkqg0.js} +1 -1
  43. package/bin/{chunk-fbte2rmd.js → chunk-ab45988z.js} +1 -1
  44. package/bin/chunk-af3nys0r.js +1 -0
  45. package/bin/{chunk-29tx9qe2.js → chunk-agd2jevj.js} +1 -1
  46. package/bin/{chunk-9h027f50.js → chunk-bf5a4yc8.js} +1 -1
  47. package/bin/{chunk-ybhgmvxa.js → chunk-bjfwz2m7.js} +2 -2
  48. package/bin/{chunk-e52nga6c.js → chunk-bnpw72vt.js} +2 -2
  49. package/bin/{chunk-c45rh4hk.js → chunk-c003q4v6.js} +1 -1
  50. package/bin/{chunk-5m9be8an.js → chunk-cfamv4b2.js} +2 -2
  51. package/bin/{chunk-922nnh39.js → chunk-cm25nm9t.js} +1 -1
  52. package/bin/{chunk-9h3ds7rn.js → chunk-cmcsxkh1.js} +2 -2
  53. package/bin/{chunk-zemrvz79.js → chunk-cspp4n1d.js} +2 -2
  54. package/bin/{chunk-kfhtk3eh.js → chunk-cwebycwv.js} +1 -1
  55. package/bin/chunk-cx1ebj9k.js +1 -0
  56. package/bin/chunk-d1p9qz3y.js +7 -0
  57. package/bin/{chunk-q24epdh8.js → chunk-d3cqp0tb.js} +2 -2
  58. package/bin/{chunk-97jzve52.js → chunk-d5fapvnp.js} +2 -2
  59. package/bin/{chunk-e3s3rz2e.js → chunk-ddag2ezv.js} +2 -2
  60. package/bin/{chunk-7hsgmjpa.js → chunk-dk45f6mp.js} +2 -2
  61. package/bin/{chunk-9ab6k4rq.js → chunk-e0kw3bst.js} +1 -1
  62. package/bin/{chunk-bd71dp4j.js → chunk-e56nza63.js} +1 -1
  63. package/bin/{chunk-re0b7sj7.js → chunk-e66j69wz.js} +1 -1
  64. package/bin/{chunk-pq18zenh.js → chunk-ea0fh29m.js} +1 -1
  65. package/bin/{chunk-s1n39qte.js → chunk-en4m76fw.js} +1 -1
  66. package/bin/{chunk-f14sqw1d.js → chunk-epsctccj.js} +1 -1
  67. package/bin/{chunk-92xxys10.js → chunk-evzxjqr3.js} +2 -2
  68. package/bin/{chunk-ymeycphq.js → chunk-f4x2dxe5.js} +3 -3
  69. package/bin/{chunk-pxw97qbq.js → chunk-fr3dg9aj.js} +1 -1
  70. package/bin/{chunk-fcvtgx1y.js → chunk-fvf7j1qj.js} +1 -1
  71. package/bin/{chunk-bs0fjz3w.js → chunk-fwcm78s9.js} +2 -2
  72. package/bin/{chunk-xcwbg4w9.js → chunk-fytbcgak.js} +2 -2
  73. package/bin/{chunk-wc8sc9r9.js → chunk-gc7b9j22.js} +1 -1
  74. package/bin/{chunk-b8js74jk.js → chunk-h1hj60fr.js} +2 -2
  75. package/bin/{chunk-9avkn3x1.js → chunk-h3y7szbm.js} +2 -2
  76. package/bin/{chunk-j8qtab70.js → chunk-hdqvbds8.js} +1 -1
  77. package/bin/{chunk-q09dfja5.js → chunk-he4h8e9e.js} +2 -2
  78. package/bin/{chunk-d2vxmn9v.js → chunk-hktggc90.js} +1 -1
  79. package/bin/{chunk-fepymbka.js → chunk-jh6pw37a.js} +1 -1
  80. package/bin/{chunk-ygz6pawn.js → chunk-jjgwrvdb.js} +1 -1
  81. package/bin/{chunk-2dsmsa6a.js → chunk-jmh934ca.js} +1 -1
  82. package/bin/{chunk-dghtwyq1.js → chunk-jtwvd0te.js} +2 -2
  83. package/bin/{chunk-4qpa7b5t.js → chunk-jxxq76at.js} +1 -1
  84. package/bin/chunk-jyr3g5m4.js +1 -0
  85. package/bin/{chunk-zzx99j8t.js → chunk-k0s6gfg6.js} +1 -1
  86. package/bin/chunk-ky3dx324.js +2 -0
  87. package/bin/{chunk-h0ytx8zc.js → chunk-mw0rc5m7.js} +1 -1
  88. package/bin/chunk-mzre12bp.js +1 -0
  89. package/bin/{chunk-s8t74q9m.js → chunk-n0cn0xfg.js} +1 -1
  90. package/bin/{chunk-88fg1sw7.js → chunk-nd6psyzq.js} +2 -2
  91. package/bin/{chunk-m4zpf9gg.js → chunk-nmzvxgd6.js} +2 -2
  92. package/bin/{chunk-891h8br6.js → chunk-nxhzchen.js} +1 -1
  93. package/bin/{chunk-8mkfgcvb.js → chunk-phc9efjf.js} +2 -2
  94. package/bin/{chunk-n4meg9wb.js → chunk-pna93n17.js} +1 -1
  95. package/bin/{chunk-d3wmdjze.js → chunk-pvx55h1v.js} +1 -1
  96. package/bin/{chunk-g8th86na.js → chunk-pzehf31g.js} +1 -1
  97. package/bin/{chunk-nyhqy6q2.js → chunk-q0dhm16d.js} +5 -5
  98. package/bin/chunk-q11m2cp3.js +2 -0
  99. package/bin/{chunk-31baz5n0.js → chunk-qjf561n2.js} +1 -1
  100. package/bin/chunk-qs5k9j8s.js +1 -0
  101. package/bin/{chunk-ztmj61z9.js → chunk-qt9efp9y.js} +1 -1
  102. package/bin/{chunk-1xpec5r8.js → chunk-qwxt1cha.js} +2 -2
  103. package/bin/{chunk-5t6c3038.js → chunk-r8vrfefa.js} +1 -1
  104. package/bin/{chunk-cxhmr356.js → chunk-rybbss5f.js} +1 -1
  105. package/bin/{chunk-t3t6021k.js → chunk-sa4gc1f5.js} +2 -2
  106. package/bin/{chunk-jf3vn5c3.js → chunk-sprpjp4t.js} +2 -2
  107. package/bin/chunk-swa43tzr.js +3 -0
  108. package/bin/{chunk-14fh4s1a.js → chunk-szs8dy1s.js} +2 -2
  109. package/bin/{chunk-ry33f2qk.js → chunk-t0detvbj.js} +2 -2
  110. package/bin/chunk-t0fq8b99.js +2 -0
  111. package/bin/{chunk-pmswtfe3.css → chunk-tm6z4hkd.css} +1 -1
  112. package/bin/{chunk-wsyg4rwg.js → chunk-vdn3jymh.js} +1 -1
  113. package/bin/{chunk-8wqfkm4c.js → chunk-vjxgv3r6.js} +1 -1
  114. package/bin/{chunk-dqgv5yy1.js → chunk-w3m9g3e9.js} +1 -1
  115. package/bin/{chunk-5r8858hx.js → chunk-wcfpdfgy.js} +2 -2
  116. package/bin/{chunk-rtngbgpk.js → chunk-wv8xk7n7.js} +1 -1
  117. package/bin/{chunk-7e06b2zb.js → chunk-wwsvnz4v.js} +1 -1
  118. package/bin/{chunk-qqk51620.js → chunk-y132jbf0.js} +1 -1
  119. package/bin/{chunk-2aascrtb.js → chunk-yaydmgcg.js} +1 -1
  120. package/bin/{chunk-7we7ex0m.js → chunk-yvgs4kmv.js} +1 -1
  121. package/bin/{chunk-fa2g2wge.js → chunk-z5p39kpk.js} +2 -2
  122. package/bin/{chunk-77r8w95d.js → chunk-zct68gc7.js} +2 -2
  123. package/bin/{chunk-mqjzmn0e.js → chunk-zy2sqtt9.js} +1 -1
  124. package/bin/shumai-app.html +1 -1
  125. package/bin/shumai-app.js +260 -208
  126. package/package.json +7 -7
  127. package/prisma/migrations/20260728024147_add_agent_session_entry_columns/migration.sql +14 -0
  128. package/prisma/migrations/20260728024205_migrate_agent_session_entry_data/migration.sql +12 -0
  129. package/prisma/migrations/20260728031230_remove_agent_session_entry_legacy_entry_column/migration.sql +8 -0
  130. package/prisma/schema.prisma +12 -6
  131. package/bin/chunk-23d3968z.js +0 -2
  132. package/bin/chunk-2g12s6mc.js +0 -2
  133. package/bin/chunk-4jk0y1w1.js +0 -1
  134. package/bin/chunk-54tr7y2x.js +0 -3
  135. package/bin/chunk-6z65xd0w.js +0 -3
  136. package/bin/chunk-8tf6kgdj.js +0 -2
  137. package/bin/chunk-av71yjaa.js +0 -1
  138. package/bin/chunk-byqc8tzq.js +0 -1
  139. package/bin/chunk-ccw7mjgq.js +0 -5
  140. package/bin/chunk-f7sbkfmk.js +0 -2
  141. package/bin/chunk-fd5a3pdd.js +0 -1
  142. package/bin/chunk-g6zzg6v2.js +0 -1
  143. package/bin/chunk-kr06nrbx.js +0 -2
  144. package/bin/chunk-r0w920zb.js +0 -1
  145. package/bin/chunk-sd86v1e6.js +0 -1
  146. package/bin/chunk-szzff7gd.js +0 -1
  147. package/bin/chunk-tspps87j.js +0 -1
  148. package/bin/chunk-y2qp11v9.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "A fullstack AI-powered media workspace and workflow engine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,12 +27,12 @@
27
27
  "zod": "4.4.3"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@shumai-one/shumai-darwin-arm64": "0.2.2",
31
- "@shumai-one/shumai-darwin-x64": "0.2.2",
32
- "@shumai-one/shumai-linux-arm64": "0.2.2",
33
- "@shumai-one/shumai-linux-x64": "0.2.2",
34
- "@shumai-one/shumai-win32-arm64": "0.2.2",
35
- "@shumai-one/shumai-win32-x64": "0.2.2"
30
+ "@shumai-one/shumai-darwin-arm64": "0.3.0",
31
+ "@shumai-one/shumai-darwin-x64": "0.3.0",
32
+ "@shumai-one/shumai-linux-arm64": "0.3.0",
33
+ "@shumai-one/shumai-linux-x64": "0.3.0",
34
+ "@shumai-one/shumai-win32-arm64": "0.3.0",
35
+ "@shumai-one/shumai-win32-x64": "0.3.0"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,14 @@
1
+ -- AlterTable
2
+ ALTER TABLE "agent_session_entries" ADD COLUMN "asset_id" TEXT,
3
+ ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
4
+ ADD COLUMN "data" JSONB,
5
+ ADD COLUMN "parent_id" TEXT,
6
+ ADD COLUMN "type" TEXT,
7
+ ALTER COLUMN "session_id" DROP NOT NULL,
8
+ ALTER COLUMN "entry" DROP NOT NULL;
9
+
10
+ -- CreateIndex
11
+ CREATE INDEX "agent_session_entries_parent_id_idx" ON "agent_session_entries"("parent_id");
12
+
13
+ -- CreateIndex
14
+ CREATE INDEX "agent_session_entries_asset_id_idx" ON "agent_session_entries"("asset_id");
@@ -0,0 +1,12 @@
1
+ -- Migrate existing entry JSON data to new columns
2
+ UPDATE agent_session_entries
3
+ SET
4
+ type = entry->>'type',
5
+ parent_id = entry->>'parentId',
6
+ asset_id = (SELECT s.asset_id FROM agent_sessions s WHERE s.id = agent_session_entries.session_id),
7
+ created_at = CASE
8
+ WHEN entry->>'timestamp' IS NOT NULL THEN (entry->>'timestamp')::timestamptz
9
+ ELSE created_at
10
+ END,
11
+ data = (entry::jsonb - 'id' - 'type' - 'parentId' - 'timestamp')::text::json
12
+ WHERE entry IS NOT NULL;
@@ -0,0 +1,8 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `entry` on the `agent_session_entries` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "agent_session_entries" DROP COLUMN "entry";
@@ -722,14 +722,20 @@ model AgentSession {
722
722
  }
723
723
 
724
724
  model AgentSessionEntry {
725
- id String @id // Uses ULID generated by pi-coding-agent
726
- sessionId String @map("session_id")
727
- session AgentSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
728
- /// [PiSessionEntry]
729
- entry Json
725
+ id String @id // Uses ULID generated by pi-coding-agent
726
+ sessionId String? @map("session_id")
727
+ session AgentSession? @relation(fields: [sessionId], references: [id], onDelete: Cascade)
728
+ assetId String? @map("asset_id")
729
+ type String?
730
+ parentId String? @map("parent_id")
731
+ /// [PiSessionEntryData]
732
+ data Json?
733
+ createdAt DateTime @default(now()) @map("created_at")
730
734
 
731
- @@map("agent_session_entries")
732
735
  @@index([sessionId])
736
+ @@index([parentId])
737
+ @@index([assetId])
738
+ @@map("agent_session_entries")
733
739
  }
734
740
 
735
741
  model UserMetadata {
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pb as a}from"./chunk-e52nga6c.js";import"./chunk-0qkj838r.js";export default a();
@@ -1,2 +0,0 @@
1
- import{k as RG}from"./chunk-f7sbkfmk.js";import{l as DG,m as PG}from"./chunk-fepymbka.js";import{s as wG}from"./chunk-xyjw8w3r.js";import{t as NG}from"./chunk-ccw7mjgq.js";import{B as OG,O as MG}from"./chunk-pq18zenh.js";import{fa as kG}from"./chunk-7e06b2zb.js";import{Da as k,Fa as QG,Ga as UG,Ha as EG,Qa as LG,Ta as qG,Va as c}from"./chunk-srn8t0v7.js";import{yf as zG}from"./chunk-88fg1sw7.js";import{hg as KG,ig as n}from"./chunk-54tr7y2x.js";import{pg as WG}from"./chunk-fa2g2wge.js";import{ch as TG}from"./chunk-gswbc6y9.js";import{Bh as VG,Sh as $,gk as $G,mh as $J,mk as HG,nh as p,oh as Z,ph as W,qh as AG,th as m,vh as BG,wh as I}from"./chunk-nyhqy6q2.js";import{Vk as VJ}from"./chunk-0qkj838r.js";var Y=VJ($J(),1);function HJ({teamId:_,projectId:X,projectName:P,assetId:A,rootFolderId:M,collection:z,onUpdateCollection:vG}){let N=VG(),o=AG(),{canEdit:xG}=TG(X),{setFields:r}=OG(),yG=$.api.files[":fileId"].metadata.$patch,{mutate:bG}=BG({mutationFn:async(G)=>{if(!(await yG(G)).ok)throw Error("Failed to patch metadata");return null}}),{data:v}=m({queryKey:["fields",X],queryFn:async()=>{let G=await $.api.projects[":projectId"].fields.$get({param:{projectId:X}});if(!G.ok)throw Error("Failed to fetch fields");return await G.json()},enabled:!!X});Y.useEffect(()=>{if(v)r(v,X)},[v,X,r]);let B=A==="recently-deleted",[CG,x]=Y.useState(null),[H,w]=Y.useState(new Set),[y,l]=Y.useState(null),[hG,FG]=Y.useState(240),[gG,uG]=Y.useState(360),{isChatbotOpen:b}=n(),{members:fG,fetchMembers:i}=MG(),{metadata:jG,fetchMetadata:a,setMetadata:SG}=zG();Y.useEffect(()=>{if(_)i(_),a(_)},[_,i,a]);let C=Y.useMemo(()=>{return z?.filter?.searchFilter?.conditions||[]},[z]),[O,h]=Y.useState(C);Y.useEffect(()=>{h(C)},[C]);let d=`project:${X}:sort`,Q=jG[d]||{field:"custom",order:"asc"},pG=(G)=>{if(G)SG(_,d,G)},K=!!z,F=O.length>0||K,{fileListLeftSidebarCollapsed:s,setFileListLeftSidebarCollapsed:mG,fileListRightSidebarCollapsed:t,setFileListRightSidebarCollapsed:IG,viewModes:nG}=WG(),e=nG[X]??"card",cG=Y.useRef(null),{data:R}=B?{data:void 0}:m({queryKey:["folders",A],queryFn:async()=>{let G=await $.api.folders[":folderId"].$get({param:{folderId:A}});if(!G.ok)throw Error("failed to fetch folder");return await G.json()}}),{setProjectState:GG,clearProjectState:JG}=KG();Y.useEffect(()=>{return GG({teamId:_,projectId:X,projectName:P,ancestorFolders:R?.ancestorFolders??[],currentAsset:B?{name:"Recently Deleted",type:"folder"}:K?{name:z.name,type:"folder"}:{name:R?.name,type:"folder"},isRootFolder:!B&&!K&&A===M,onFolderClick:(G)=>{N({to:"/projects/$projectId/folders/$folderId",params:{projectId:X,folderId:G}})}}),()=>JG()},[_,X,P,R,B,A,M,GG,JG,N]);let{data:g,fetchNextPage:oG,hasNextPage:rG,isFetchingNextPage:lG}=I({queryKey:B?["projects",X,"recently-deleted","folder"]:["search",_,A,"folder",O,Q,K],queryFn:async({pageParam:G})=>{if(B||K){if(B){let V=await $.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:X},query:{assetType:"folder",after:G}});if(!V.ok)throw Error("failed to fetch recently deleted folders");return await V.json()}return{data:[],pageInfo:{total:0}}}if(F)return{data:[],pageInfo:{total:0}};let J=await $.api.folders[":folderId"].search.$post({param:{folderId:A},json:{assetType:"folder",after:G,recursively:!1,sort:Q,conditions:[]}});if(!J.ok)throw Error("failed to search folders");return await J.json()},enabled:!F,initialPageParam:"",getNextPageParam:(G)=>{return G.pageInfo?.cursor||void 0}}),{data:u,fetchNextPage:iG,hasNextPage:aG,isFetchingNextPage:dG}=I({queryKey:B?["projects",X,"recently-deleted","file"]:["search",_,A,"file",O,Q,K],queryFn:async({pageParam:G})=>{if(B){let V=await $.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:X},query:{assetType:"file",after:G}});if(!V.ok)throw Error("failed to fetch recently deleted files");return await V.json()}let J=await $.api.folders[":folderId"].search.$post({param:{folderId:A},json:{assetType:"file",after:G,recursively:F||K,conditions:O,sort:Q}});if(!J.ok)throw Error("failed to search files");return await J.json()},initialPageParam:"",getNextPageParam:(G)=>{return G.pageInfo?.cursor||void 0}}),D=g?.pages.flatMap((G)=>G.data??[])??[],T=u?.pages.flatMap((G)=>G.data??[])??[],sG=g?.pages[0]?.pageInfo?.total,tG=u?.pages[0]?.pageInfo?.total,eG=g?.pages[0]?.pageInfo?.totalSize,GJ=u?.pages[0]?.pageInfo?.totalSize,XG=()=>{w(new Set),x(null),l(null)},{dragState:U,handleDragStart:JJ,handleDragEnd:XJ}=PG({teamId:_,projectId:X,assetId:A,folders:D,files:T,selectedIds:H,onClearSelection:XG}),f=Y.useMemo(()=>{if(H.size!==1)return null;let G=Array.from(H)[0];return T.find((V)=>V.id===G)||null},[H,T]),YJ=(G)=>{if(B)return;if(G.type==="folder")h([]),N({to:"/projects/$projectId/folders/$folderId",params:{projectId:X,folderId:G.id}});else N({to:"/projects/$projectId/files/$fileId",params:{projectId:X,fileId:G.versionStack?G.versionStack.id:G.id},search:{version:void 0}})},ZJ=(G,J)=>{let V=J.metaKey||J.ctrlKey;if(J.shiftKey&&y){let ZG=[...D,...T].find((L)=>L.id===y);if(ZG)if(ZG.type===G.type){let L=G.type==="folder"?D:T,j=L.findIndex((q)=>q.id===y),S=L.findIndex((q)=>q.id===G.id);if(j!==-1&&S!==-1){let q=Math.min(j,S),_J=Math.max(j,S),AJ=L.slice(q,_J+1),_G=new Set(H);AJ.forEach((BJ)=>{_G.add(BJ.id)}),w(_G),x(G);return}}else return}if(V){let E=new Set(H);if(E.has(G.id))E.delete(G.id);else E.add(G.id);w(E)}else w(new Set([G.id]));l(G.id),x(G)},YG=(G,J,V)=>{bG({param:{fileId:G},json:[{key:J,value:V}]},{onSuccess:()=>{o.invalidateQueries({queryKey:["folders",A,"children",{assetType:"file"}]}),o.invalidateQueries({queryKey:["search",_,A]})}})};return W(LG,{modifiers:[DG.configure({anchor:{x:0,y:0}})],plugins:(G)=>G.map((J)=>{if(J===k)return k.configure({dropAnimation:null});if(typeof J==="object"&&J!==null&&"plugin"in J&&J.plugin===k)return k.configure({dropAnimation:null});return J}),sensors:B||!xG?[]:[EG.configure({activationConstraints:[new UG.Distance({value:10})]}),QG],onDragStart:JJ,onDragEnd:XJ,children:[Z("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:W("div",{ref:cG,className:"flex flex-1 overflow-hidden relative",children:[!s&&Z("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>mG(!0)}),(!t||b)&&Z("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{IG(!0),n.getState().setIsChatbotOpen(!1)}}),!s&&W(p,{children:[Z("div",{className:"bg-background",style:{width:hG},children:Z(kG,{teamId:_,projectId:X,projectName:P,rootFolderId:M,dragState:U,ancestorFolders:R?.ancestorFolders??[]})}),Z(c,{onResize:(G)=>{FG((J)=>Math.max(180,Math.min(400,J+G)))},className:"hidden md:block"})]}),Z(NG,{teamId:_,projectId:X,assetId:A,folders:D,files:T,totalFolders:sG,totalFiles:tG,totalFoldersSize:eG,totalFilesSize:GJ,selectedItem:CG,selectedIds:H,onItemSelect:ZJ,onItemDoubleClick:YJ,onSaveField:YG,displayStyle:e,onClearSelection:XG,fetchNextFoldersPage:oG,hasNextFoldersPage:rG||!1,isFetchingNextFoldersPage:lG,fetchNextFilesPage:iG,hasNextFilesPage:aG||!1,isFetchingNextFilesPage:dG,isRecentlyDeleted:B,filterConditions:O,onFilterChange:h,sort:Q,onSortChange:pG,dragState:U,collection:z,onUpdateCollection:vG,rootFolderId:M}),(!t||b)&&W(p,{children:[Z(c,{onResize:(G)=>{uG((J)=>Math.max(240,Math.min(600,J-G)))},className:"hidden md:block"}),Z("div",{style:{width:gG},className:"bg-background flex flex-col flex-shrink-0",children:b?Z(RG,{projectId:X,contextAssetId:A}):f?Z(wG,{teamId:_,projectId:X,file:f,onSaveField:(G,J)=>YG(f.id,G,J),members:fG,hideAnnotationControl:!0}):Z("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:HG.select_asset_to_view_details()})})]})]})}),Z(qG,{children:U?.isActive?Z("div",{className:$G("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",e==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:W("span",{children:["Moving ",U.itemCount," item",U.itemCount!==1?"s":""]})}):null})]})}
2
- export{HJ as j};
@@ -1 +0,0 @@
1
- import{j as V}from"./chunk-2g12s6mc.js";import"./chunk-f7sbkfmk.js";import"./chunk-fepymbka.js";import"./chunk-xyjw8w3r.js";import"./chunk-ccw7mjgq.js";import"./chunk-pq18zenh.js";import"./chunk-wsyg4rwg.js";import"./chunk-7e06b2zb.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{hf as U}from"./chunk-8mkfgcvb.js";import"./chunk-88fg1sw7.js";import{zf as N}from"./chunk-ry33f2qk.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-54tr7y2x.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-fa2g2wge.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import{bh as K}from"./chunk-gswbc6y9.js";import{Gh as H,Sh as J,mh as Z,oh as q,th as B,uh as G}from"./chunk-nyhqy6q2.js";import{Vk as Y}from"./chunk-0qkj838r.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await J.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:"recently-deleted",rootFolderId:b})}var $=H("/projects/$projectId/recently-deleted")({component:_});export{$ as Route};
@@ -1,3 +0,0 @@
1
- import{Kh as B,Lh as J,Qh as $,Sh as w,mh as u,th as z}from"./chunk-nyhqy6q2.js";import{Vk as b}from"./chunk-0qkj838r.js";var E=null,g=J((p)=>({projectState:null,setProjectState:(j)=>{if(E)clearTimeout(E),E=null;p({projectState:j})},clearProjectState:()=>{if(E)clearTimeout(E);E=setTimeout(()=>{p({projectState:null}),E=null},10)}}));var H=J((p)=>({isChatbotOpen:!1,setIsChatbotOpen:(j)=>p({isChatbotOpen:j}),isHistoryMode:!1,setIsHistoryMode:(j)=>p({isHistoryMode:j}),currentSessionId:null,setCurrentSessionId:(j)=>p({currentSessionId:j}),chatAssets:[],addAssets:(j)=>p((c)=>{let f=new Set(c.chatAssets.map((P)=>P.id)),F=j.filter((P)=>!f.has(P.id));return{chatAssets:[...c.chatAssets,...F]}}),removeAsset:(j)=>p((c)=>({chatAssets:c.chatAssets.filter((f)=>f.id!==j)})),clearAssets:()=>p({chatAssets:[]}),messages:[],setMessages:(j)=>p({messages:j}),historySessions:[],setHistorySessions:(j)=>p({historySessions:j}),isStreaming:!1,setIsStreaming:(j)=>p({isStreaming:j}),selectedAgentId:null,setSelectedAgentId:(j)=>p({selectedAgentId:j}),scrollTop:0,isAtBottom:!0,setScrollState:(j,c)=>p({scrollTop:j,isAtBottom:c}),fetchHistorySessions:async(j)=>{try{let c=await w.api.teams[":teamId"].chat.sessions.$get({param:{teamId:j},query:{first:"50"}});if(c.ok){let f=await c.json();p({historySessions:f.data||[]})}}catch(c){console.error("Failed to fetch history sessions:",c)}},loadSession:async(j,c)=>{try{let f=await w.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:j,sessionId:c}});if(f.ok){let F=await f.json(),T=H.getState().historySessions.find((O)=>O.id===c)?.agentId||null;p({currentSessionId:c,messages:F,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...T?{selectedAgentId:T}:{}})}else throw Error("Failed to load session messages")}catch(f){let F=f instanceof Error?f.message:"Failed to load session";$.error(F)}},deleteSession:async(j,c)=>{try{if((await w.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:j,sessionId:c}})).ok)$.success("Session deleted successfully"),p((F)=>({historySessions:F.historySessions.filter((P)=>P.id!==c),currentSessionId:F.currentSessionId===c?null:F.currentSessionId,messages:F.currentSessionId===c?[]:F.messages}));else throw Error("Failed to delete session")}catch(f){let F=f instanceof Error?f.message:"Failed to delete session";$.error(F)}},startNewSession:()=>{p({currentSessionId:null,messages:[],chatAssets:[],scrollTop:0,isAtBottom:!0})},sendMessage:async(j,c,f,F)=>{let P=H.getState();if(P.isStreaming)return;let T=`temp-${Date.now()}`,O={id:T,role:"user",content:[{type:"text",text:c}],timestamp:Date.now()},R=[...P.messages];if(P.chatAssets.length>0){let G={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:P.chatAssets.map((k)=>({id:k.id,name:k.name,type:k.type}))},timestamp:Date.now()-1};R.push(G)}R.push(O),p({messages:R,isStreaming:!0,chatAssets:[],isAtBottom:!0});let v=P.chatAssets.map((K)=>K.id),Y=P.selectedAgentId;if(!Y){$.error("No agent selected");return}try{let K=await w.api.teams[":teamId"].chat.$post({param:{teamId:j},json:{agentId:Y,textPrompt:c,assetIds:v,sessionId:P.currentSessionId||void 0,contextAssetId:F,projectId:f}});if(!K.ok)throw Error("Failed to start chat");let G=K.headers.get("x-session-id");if(G&&!P.currentSessionId)p({currentSessionId:G});let k=K.body?.getReader();if(!k)throw Error("No stream body");let U=new TextDecoder,V="";while(!0){let{done:A,value:y}=await k.read();if(A)break;V+=U.decode(y,{stream:!0});let Z=V.split(`
2
- `);V=Z.pop()||"";for(let C of Z){let W=C.trim();if(!W)continue;if(W.startsWith("data: ")){let M=W.slice(6);try{let Q=JSON.parse(M);if(Q.type==="session"){if(!H.getState().currentSessionId)p({currentSessionId:Q.sessionId})}else if(Q.type==="entry"){let D=Q.entry;p((_)=>{let h=_.messages.some((q)=>q.id===D.id),X=_.messages.filter((q)=>{if(D.role==="user"&&!h)return!(q.id.startsWith("temp-")&&!q.id.startsWith("temp-context-"));if(D.role==="custom"&&D.customType==="context_display_info"&&!h)return!q.id.startsWith("temp-context-");return!0}),N=X.findIndex((q)=>q.id===D.id);if(N!==-1){let q=[...X];return q[N]=D,{messages:q}}else return{messages:[...X,D]}})}else if(Q.type==="done"){if(Q.status==="failed")$.error(Q.error||"Workflow failed")}}catch(Q){console.error("Error parsing SSE line:",Q)}}}}H.getState().fetchHistorySessions(j)}catch(K){let G=K instanceof Error?K.message:"Failed to send message";$.error(G),p((k)=>({messages:k.messages.filter((U)=>U.id!==T)}))}finally{p({isStreaming:!1})}},abortActiveSession:async(j)=>{let{currentSessionId:c,isStreaming:f}=H.getState();if(!c||!f)return;try{if((await w.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:j,sessionId:c}})).ok)$.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(F){let P=F instanceof Error?F.message:"Failed to abort execution";$.error(P)}}}));var L=b(u(),1);function S(p){let j=p.match(/teams\/([^/]+)/);if(j)return{teamId:j[1]};let c=p.match(/projects\/([^/]+)/);if(c)return{projectId:c[1]};return{}}function t(){let[p,j]=L.useState(),c=B({select:(T)=>T.location.pathname}),{teamId:f,projectId:F}=S(c),{data:P}=z({queryKey:["projects",F,"team"],queryFn:async()=>{let T=await w.api.projects[":projectId"].team.$get({param:{projectId:F}});if(!T.ok)throw Error("failed to fetch project team");return await T.json()},enabled:!!F});return L.useEffect(()=>{if(f)j(f);else if(P?.teamId)j(P.teamId)},[f,P]),p}
3
- export{t as gg,g as hg,H as ig};