@shumai-one/shumai 0.4.4 → 0.4.6

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 (178) hide show
  1. package/bin/{chunk-snhsjs4x.js → chunk-07jszkhj.js} +62 -62
  2. package/bin/chunk-0c67210c.js +1 -0
  3. package/bin/{chunk-kswvyqq1.js → chunk-0wvhahzh.js} +2 -2
  4. package/bin/chunk-161rxeq2.js +2 -0
  5. package/bin/{chunk-trveq4wg.js → chunk-1bgsphyz.js} +2 -2
  6. package/bin/{chunk-vap4k11j.js → chunk-1dqsf5qj.js} +6 -6
  7. package/bin/{chunk-zxk7q0zk.js → chunk-1jybg56e.js} +1 -1
  8. package/bin/chunk-1kt5dzjv.js +2 -0
  9. package/bin/{chunk-drepsbb4.js → chunk-1t51fp6n.js} +1 -1
  10. package/bin/{chunk-cbgq517y.js → chunk-2jrjwaqr.js} +2 -2
  11. package/bin/chunk-2qjfpmcf.js +2 -0
  12. package/bin/{chunk-wjyaezs7.js → chunk-2vzzd0q6.js} +1 -1
  13. package/bin/chunk-2yr5k567.js +2 -0
  14. package/bin/chunk-2z1pnt7h.js +2 -0
  15. package/bin/{chunk-0zv3bks2.js → chunk-3d5rm1d1.js} +1 -1
  16. package/bin/{chunk-w4ghe71n.js → chunk-3d9tfxp4.js} +1 -1
  17. package/bin/{chunk-0qjfahk9.js → chunk-3dgahs95.js} +1 -1
  18. package/bin/{chunk-dqxeztfa.js → chunk-3j5njrpr.js} +2 -2
  19. package/bin/{chunk-ryzz5fht.js → chunk-3n4224c0.js} +1 -1
  20. package/bin/{chunk-914bp49r.js → chunk-3tg39jx7.js} +3 -3
  21. package/bin/chunk-3vmapyk9.js +1 -0
  22. package/bin/{chunk-g3fpmyyn.js → chunk-46wfxyd7.js} +2 -2
  23. package/bin/{chunk-4hkkdm2q.js → chunk-47tn3vtg.js} +1 -1
  24. package/bin/{chunk-1zwajpwf.js → chunk-4syt6rn0.js} +3 -3
  25. package/bin/chunk-5kvc1gp2.js +1 -0
  26. package/bin/{chunk-xa18z1py.js → chunk-5vvvgjvz.js} +2 -2
  27. package/bin/{chunk-5nm2jvg5.js → chunk-6vxzkrsj.js} +11 -11
  28. package/bin/{chunk-ytdwk2fq.js → chunk-6y4xkcte.js} +2 -2
  29. package/bin/{chunk-fpc4p0j8.js → chunk-7e5z637e.js} +2 -2
  30. package/bin/chunk-7nvk7waw.js +1 -0
  31. package/bin/{chunk-rq0n0vcc.js → chunk-80qz30dc.js} +2 -2
  32. package/bin/chunk-886pnknh.js +3 -0
  33. package/bin/{chunk-6ghcj4a9.js → chunk-8cn7fx40.js} +1 -1
  34. package/bin/chunk-908pypkr.js +1 -0
  35. package/bin/chunk-952qwf17.js +2 -0
  36. package/bin/chunk-988casfy.js +1 -0
  37. package/bin/chunk-9a2tf0mh.js +2 -0
  38. package/bin/{chunk-nkdk229f.js → chunk-9d0thqcy.js} +1 -1
  39. package/bin/{chunk-s2k4qntr.js → chunk-9nvymwqj.js} +2 -2
  40. package/bin/{chunk-mz0yjra0.js → chunk-9trnkbtr.js} +4 -4
  41. package/bin/{chunk-t2hy6tj9.js → chunk-a4056d0r.js} +1 -1
  42. package/bin/{chunk-ze20rm02.js → chunk-a796sgcw.js} +4 -4
  43. package/bin/{chunk-kpgfqkp0.js → chunk-afnzb9ne.js} +2 -2
  44. package/bin/chunk-apfrw0wd.js +3 -0
  45. package/bin/{chunk-wndm3px3.js → chunk-axmd242s.js} +1 -1
  46. package/bin/{chunk-nr20tvnw.js → chunk-b3aqmcps.js} +2 -2
  47. package/bin/chunk-b6q287d1.js +2 -0
  48. package/bin/{chunk-j1tkmcae.js → chunk-b9hyc0a1.js} +2 -2
  49. package/bin/chunk-ba33nf0q.js +4 -0
  50. package/bin/chunk-batadmvr.js +2 -0
  51. package/bin/{chunk-1t167cvj.js → chunk-brwbhbmc.js} +7 -7
  52. package/bin/chunk-bvdvp192.js +1 -0
  53. package/bin/{chunk-fahk9h62.js → chunk-crja7whq.js} +2 -2
  54. package/bin/{chunk-98715kc3.js → chunk-d7fwggt6.js} +2 -2
  55. package/bin/chunk-db1msmdh.js +2 -0
  56. package/bin/{chunk-97f2af6d.js → chunk-dbw8c1jj.js} +5 -5
  57. package/bin/{chunk-7gmdnsdg.js → chunk-dj5a6kkh.js} +1 -1
  58. package/bin/chunk-dkx3pmdz.js +1 -0
  59. package/bin/{chunk-071x515q.js → chunk-dmvvt8va.js} +2 -2
  60. package/bin/{chunk-3tedzb2j.js → chunk-dpc11hpd.js} +9 -9
  61. package/bin/{chunk-ks8xzc95.js → chunk-dscq4a4k.js} +2 -2
  62. package/bin/{chunk-jmpb5633.js → chunk-dz076sh7.js} +1 -1
  63. package/bin/chunk-edqd8evk.js +2 -0
  64. package/bin/{chunk-0qaq0sp8.js → chunk-ehpfg3km.js} +2 -2
  65. package/bin/chunk-ey3h4sct.js +2 -0
  66. package/bin/{chunk-vm5fx7td.js → chunk-ga3pahzf.js} +1 -1
  67. package/bin/chunk-gc6m7agb.js +3 -0
  68. package/bin/{chunk-7bcxj1jd.js → chunk-gcjsw9yp.js} +1 -1
  69. package/bin/chunk-gqr5hxhj.js +2 -0
  70. package/bin/{chunk-jrjnqx78.js → chunk-gsfcpcye.js} +1 -1
  71. package/bin/chunk-h9mka9br.js +2 -0
  72. package/bin/chunk-hacyjx1s.js +1 -0
  73. package/bin/chunk-hd6dnnyg.js +2 -0
  74. package/bin/chunk-he5nvmqw.js +1 -0
  75. package/bin/{chunk-reyxk4bw.js → chunk-hnhdq2wd.js} +1 -1
  76. package/bin/{chunk-gt4csat6.js → chunk-hs2r9qaw.js} +2 -2
  77. package/bin/{chunk-fb40xxz3.js → chunk-hxyg5q2a.js} +2 -2
  78. package/bin/chunk-hyr1vtfp.js +1 -0
  79. package/bin/{chunk-zw86wnwe.js → chunk-j9ks8bd7.js} +2 -2
  80. package/bin/{chunk-1gvscz88.js → chunk-jg2v25d2.js} +2 -2
  81. package/bin/chunk-jh8q3885.js +211 -0
  82. package/bin/chunk-jzbrt2vk.js +1 -0
  83. package/bin/chunk-k6avge95.js +10 -0
  84. package/bin/{chunk-msfw3jmc.js → chunk-kg8eg9z3.js} +2 -2
  85. package/bin/chunk-kk42xhgz.js +1 -0
  86. package/bin/{chunk-3ttrhqy3.js → chunk-kmbjp5kp.js} +2 -2
  87. package/bin/{chunk-jgs8an3h.js → chunk-md5pcq46.js} +8 -8
  88. package/bin/{chunk-xarsrs08.js → chunk-mtb9fpj2.js} +1 -1
  89. package/bin/chunk-n3xjwszr.js +2 -0
  90. package/bin/chunk-nqym3zbs.js +1 -0
  91. package/bin/{chunk-579e4wv4.js → chunk-p75f5pgq.js} +2 -2
  92. package/bin/{chunk-hm0dkzed.js → chunk-pdh9bnyj.js} +2 -2
  93. package/bin/{chunk-rhvv1vvk.js → chunk-pgj2kjnn.js} +2 -2
  94. package/bin/{chunk-hmpwg5za.js → chunk-pvg3msgw.js} +8 -8
  95. package/bin/{chunk-4991gz3y.js → chunk-pwkby9h7.js} +6 -6
  96. package/bin/{chunk-fnmwksnb.js → chunk-qbqym9m6.js} +2 -2
  97. package/bin/{chunk-4wy87hwd.js → chunk-qgkbxw1k.js} +2 -2
  98. package/bin/{chunk-1j27fzy1.js → chunk-qs7855cz.js} +2 -2
  99. package/bin/{chunk-7jtmwt5a.js → chunk-radcwage.js} +2 -2
  100. package/bin/{chunk-gk2q9a3f.js → chunk-rmzcarv9.js} +2 -2
  101. package/bin/{chunk-s2fnfyn9.js → chunk-rp4pc6kz.js} +1 -1
  102. package/bin/{chunk-5adsx8x4.js → chunk-rsd164d9.js} +2 -2
  103. package/bin/{chunk-hk5rc6cd.js → chunk-s05cdax2.js} +4 -4
  104. package/bin/{chunk-pazjhrnf.js → chunk-sab7tjxw.js} +5 -5
  105. package/bin/chunk-sebbjvgv.css +1 -0
  106. package/bin/{chunk-bkr5zm4h.js → chunk-t350k3s1.js} +1 -1
  107. package/bin/{chunk-4v41a1r9.js → chunk-t7bvde99.js} +3 -3
  108. package/bin/chunk-t8gv2ekj.js +14 -0
  109. package/bin/chunk-teqprbd8.js +2 -0
  110. package/bin/chunk-tgr86ac4.js +2 -0
  111. package/bin/{chunk-5hg6kcfz.js → chunk-v8v8vdf7.js} +9 -9
  112. package/bin/chunk-vm5tn0zm.js +2 -0
  113. package/bin/chunk-vzj2j11x.js +2 -0
  114. package/bin/chunk-w1wxzqqb.js +2 -0
  115. package/bin/chunk-wmjp8dcm.js +1 -0
  116. package/bin/chunk-wy8dkyxj.js +1 -0
  117. package/bin/{chunk-a6gx7f5q.js → chunk-y1b3ck7m.js} +1 -1
  118. package/bin/{chunk-1xh34aew.js → chunk-y20sbaz5.js} +2 -2
  119. package/bin/{chunk-qsr1a0rp.js → chunk-y56yvezn.js} +1 -1
  120. package/bin/{chunk-9t8n2des.js → chunk-yfr0hzb7.js} +2 -2
  121. package/bin/chunk-ysv80zyb.js +5 -0
  122. package/bin/chunk-z08bqvkc.js +42 -0
  123. package/bin/{chunk-5tcdwep5.js → chunk-z6jpt0h6.js} +4 -4
  124. package/bin/shumai-app.html +1 -1
  125. package/bin/shumai-app.js +605 -370
  126. package/package.json +7 -7
  127. package/prisma/migrations/20260913130237_add_asset_comment_asset_id_idx/migration.sql +2 -0
  128. package/prisma/migrations/20260914024424_add_asset_comment_reactions/migration.sql +22 -0
  129. package/prisma/migrations/20260914064432_limit_reaction_code_length/migration.sql +8 -0
  130. package/prisma/migrations/20260914092940_add_jpeg_preview_flags/migration.sql +5 -0
  131. package/prisma/schema.prisma +22 -0
  132. package/bin/chunk-0cmx7k4c.js +0 -1
  133. package/bin/chunk-16xax8kk.js +0 -1
  134. package/bin/chunk-2w5xqhjm.js +0 -1
  135. package/bin/chunk-3zkasqb8.js +0 -1
  136. package/bin/chunk-453ykvaw.js +0 -2
  137. package/bin/chunk-4mjywsj8.js +0 -3
  138. package/bin/chunk-5vzrpz50.js +0 -2
  139. package/bin/chunk-77fmkpdz.js +0 -10
  140. package/bin/chunk-7kjgvxqa.js +0 -2
  141. package/bin/chunk-7pw1550a.js +0 -2
  142. package/bin/chunk-7rhz2gze.js +0 -211
  143. package/bin/chunk-837fky18.js +0 -3
  144. package/bin/chunk-84as6x83.js +0 -1
  145. package/bin/chunk-8e28hcny.js +0 -2
  146. package/bin/chunk-9ccw540k.js +0 -2
  147. package/bin/chunk-9ybt6vbm.js +0 -1
  148. package/bin/chunk-avwgktxb.js +0 -2
  149. package/bin/chunk-d27mm390.js +0 -1
  150. package/bin/chunk-dj92fss9.js +0 -2
  151. package/bin/chunk-f6svp4dp.js +0 -2
  152. package/bin/chunk-fsyzs0tf.js +0 -1
  153. package/bin/chunk-fxecgp5k.js +0 -1
  154. package/bin/chunk-gc5sbfa5.js +0 -2
  155. package/bin/chunk-gdm6yfqq.js +0 -2
  156. package/bin/chunk-gye8gabk.js +0 -2
  157. package/bin/chunk-j2bvj2yn.js +0 -2
  158. package/bin/chunk-jffktpqg.js +0 -1
  159. package/bin/chunk-k2k9vjq6.js +0 -1
  160. package/bin/chunk-m9pr03kn.js +0 -2
  161. package/bin/chunk-mfn9qjm4.js +0 -2
  162. package/bin/chunk-nbdw8fen.js +0 -1
  163. package/bin/chunk-q806pqeh.js +0 -1
  164. package/bin/chunk-qka4mkmj.js +0 -2
  165. package/bin/chunk-rchsme43.js +0 -3
  166. package/bin/chunk-rqf7999q.js +0 -42
  167. package/bin/chunk-rssgmj7x.js +0 -2
  168. package/bin/chunk-t7nsgg5k.js +0 -4
  169. package/bin/chunk-tm7f32c7.js +0 -14
  170. package/bin/chunk-vy8gntez.js +0 -1
  171. package/bin/chunk-vyzptrea.js +0 -2
  172. package/bin/chunk-wdsf44hs.js +0 -2
  173. package/bin/chunk-x5jwwvs0.js +0 -1
  174. package/bin/chunk-x92cq59c.js +0 -1
  175. package/bin/chunk-xtf3c29c.css +0 -1
  176. package/bin/chunk-xx337zcw.js +0 -2
  177. package/bin/chunk-xz6713tj.js +0 -2
  178. package/bin/chunk-yfnem6se.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
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.5.4"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@shumai-one/shumai-darwin-arm64": "0.4.4",
31
- "@shumai-one/shumai-darwin-x64": "0.4.4",
32
- "@shumai-one/shumai-linux-arm64": "0.4.4",
33
- "@shumai-one/shumai-linux-x64": "0.4.4",
34
- "@shumai-one/shumai-win32-arm64": "0.4.4",
35
- "@shumai-one/shumai-win32-x64": "0.4.4"
30
+ "@shumai-one/shumai-darwin-arm64": "0.4.6",
31
+ "@shumai-one/shumai-darwin-x64": "0.4.6",
32
+ "@shumai-one/shumai-linux-arm64": "0.4.6",
33
+ "@shumai-one/shumai-linux-x64": "0.4.6",
34
+ "@shumai-one/shumai-win32-arm64": "0.4.6",
35
+ "@shumai-one/shumai-win32-x64": "0.4.6"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,2 @@
1
+ -- CreateIndex
2
+ CREATE INDEX "asset_comments_asset_id_idx" ON "asset_comments"("asset_id");
@@ -0,0 +1,22 @@
1
+ -- CreateTable
2
+ CREATE TABLE "asset_comment_reactions" (
3
+ "id" TEXT NOT NULL,
4
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
5
+ "comment_id" TEXT NOT NULL,
6
+ "user_id" TEXT NOT NULL,
7
+ "code" TEXT NOT NULL,
8
+
9
+ CONSTRAINT "asset_comment_reactions_pkey" PRIMARY KEY ("id")
10
+ );
11
+
12
+ -- CreateIndex
13
+ CREATE INDEX "asset_comment_reactions_comment_id_idx" ON "asset_comment_reactions"("comment_id");
14
+
15
+ -- CreateIndex
16
+ CREATE UNIQUE INDEX "asset_comment_reactions_comment_id_user_id_code_key" ON "asset_comment_reactions"("comment_id", "user_id", "code");
17
+
18
+ -- AddForeignKey
19
+ ALTER TABLE "asset_comment_reactions" ADD CONSTRAINT "asset_comment_reactions_comment_id_fkey" FOREIGN KEY ("comment_id") REFERENCES "asset_comments"("id") ON DELETE CASCADE ON UPDATE CASCADE;
20
+
21
+ -- AddForeignKey
22
+ ALTER TABLE "asset_comment_reactions" ADD CONSTRAINT "asset_comment_reactions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,8 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to alter the column `code` on the `asset_comment_reactions` table. The data in that column could be lost. The data in that column will be cast from `Text` to `VarChar(32)`.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "asset_comment_reactions" ALTER COLUMN "code" SET DATA TYPE VARCHAR(32);
@@ -0,0 +1,5 @@
1
+ -- AlterTable
2
+ ALTER TABLE "assets" ADD COLUMN "has_jpeg_preview" BOOLEAN NOT NULL DEFAULT false;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "projects" ADD COLUMN "has_jpeg_cover" BOOLEAN NOT NULL DEFAULT false;
@@ -218,6 +218,7 @@ model User {
218
218
  teamMembers TeamMember[] @relation("UserToTeamMember")
219
219
  comments AssetComment[] @relation("UserToAssetComment")
220
220
  completionChangedComments AssetComment[] @relation("UserToAssetCommentCompletionChanged")
221
+ commentReactions AssetCommentReaction[] @relation("UserToAssetCommentReaction")
221
222
  createdInvites Invite[] @relation("UserToInvite")
222
223
  createdNotifications Notification[] @relation("UserToCreatedNotification")
223
224
  notifications Notification[] @relation("UserToNotification")
@@ -391,6 +392,7 @@ model Project {
391
392
  id String @id @default(ulid())
392
393
  name String
393
394
  coverImageKey String? @map("cover_image_key")
395
+ hasJpegCover Boolean @default(false) @map("has_jpeg_cover")
394
396
  /// [MetadataOverrides]
395
397
  metadataOverrides Json? @map("metadata_overrides")
396
398
  enableNotification Boolean @default(true) @map("enable_notification")
@@ -525,6 +527,7 @@ model Asset {
525
527
  uploadId String? @map("upload_id")
526
528
  /// [MediaInfo]
527
529
  media Json?
530
+ hasJpegPreview Boolean @default(false) @map("has_jpeg_preview")
528
531
  isDeleted Boolean @default(false) @map("is_deleted")
529
532
  deletedAt DateTime? @map("deleted_at")
530
533
  sortIndex String? @map("sort_index")
@@ -656,7 +659,9 @@ model AssetComment {
656
659
  replies AssetComment[] @relation("CommentReplies")
657
660
 
658
661
  attachments AssetCommentAttachment[] @relation("CommentToAttachment")
662
+ reactions AssetCommentReaction[] @relation("CommentToReaction")
659
663
 
664
+ @@index([assetId])
660
665
  @@map("asset_comments")
661
666
  }
662
667
 
@@ -674,6 +679,23 @@ model AssetCommentAttachment {
674
679
  @@map("asset_comment_attachments")
675
680
  }
676
681
 
682
+ model AssetCommentReaction {
683
+ id String @id @default(ulid())
684
+ createdAt DateTime @default(now()) @map("created_at")
685
+
686
+ commentId String @map("comment_id")
687
+ comment AssetComment @relation("CommentToReaction", fields: [commentId], references: [id], onDelete: Cascade)
688
+
689
+ userId String @map("user_id")
690
+ user User @relation("UserToAssetCommentReaction", fields: [userId], references: [id], onDelete: Cascade)
691
+
692
+ code String @db.VarChar(32)
693
+
694
+ @@unique([commentId, userId, code])
695
+ @@index([commentId])
696
+ @@map("asset_comment_reactions")
697
+ }
698
+
677
699
  model AssetEmbedding {
678
700
  id String @id @default(ulid())
679
701
  embedding Unsupported("vector(1536)")?
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,zp}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:n}=er(zp(o)),e=n?.rootFolder,{data:s}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!s)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:n.name??"",assetId:"recently-deleted",rootFolderId:e})}var l=Fe("/projects/$projectId/recently-deleted")({component:i});export{l as Route};
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,Up}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function l(){let{projectId:o}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:s}=er(Up(o)),e=s?.rootFolder,{data:i}=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(!r||!e||!i)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:e,rootFolderId:e})}var c=Fe("/projects/$projectId/")({component:l});export{c as Route};
@@ -1 +0,0 @@
1
- import{D,N,h,O,w,u,Vn,C,B,t,o,K,Ou,Du,mr,vc,za,yo,qt,Vo,Lu,Zu,Bu,Uu,xc,Fu,Z,U,ut,Fe,A,T,br,L,wt,be,hr,Ut,De,E,dt,he,Y,It,vr,Lt,se,sr,S,Ee,Ie,Te,sA,aA,ay,uy,dy,hf,Zy,Fm,ke,Wa,$m,$0,Pc,Km,Ps,ls,ih,lh,Ub,Fb,bh,vw,vv,xv,tx,Qf,Vf,hx,Ix,jh,Zc,bS,ig,FS,jS,np,HS,QS,cg,KS,WS,ug,YS,XS,Cd,Ed,Id,wl,cp,iC,lC,cC,uC,Td,Os,IC,FC,qC,oE,uE,fE,pE,mE,hE,Mg,gE,Nd,XE,nI,gI,jg,cn,Rp,UI,FI,jc,Je,Xe,et,tt,rt,nt,ot,st,H,Mt,R,Cn,Zp,we,gt,At,yt,Il,Nr,Gd,Ct,Nt,Ot,Ht,Rt}from"./chunk-7rhz2gze.js";import{Eo,pr}from"./chunk-gc5sbfa5.js";import{Ul}from"./chunk-914bp49r.js";import{Fs,Uo,jl,ci,zi,Ca,ql}from"./chunk-dqxeztfa.js";import{Tn,Mn,Rn,_r,bt,mt}from"./chunk-xx337zcw.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import{Hn,oo}from"./chunk-cbgq517y.js";C();function te(a,e){let s=new Set(e);return a.filter((i)=>!s.has(i))}var ae=class extends yo{#r;#e;#o;#a;#t;#s;#i;#n;#l;#d=[];constructor(a,e,s){super();this.#r=a,this.#a=s,this.#o=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){if(this.listeners.size===1)this.#t.forEach((a)=>{a.subscribe((e)=>{this.#p(a,e)})})}onUnsubscribe(){if(!this.listeners.size)this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach((a)=>{a.destroy()})}setQueries(a,e){this.#o=a,this.#a=e,qt.batch(()=>{let s=this.#t,i=this.#u(this.#o);i.forEach((c)=>c.observer.setOptions(c.defaultedQueryOptions));let m=i.map((c)=>c.observer),r=m.map((c)=>c.getCurrentResult()),p=s.length!==m.length,f=m.some((c,x)=>c!==s[x]),g=p||f,v=g?!0:r.some((c,x)=>{let y=this.#e[x];return!y||!za(c,y)});if(!g&&!v)return;if(g)this.#d=i,this.#t=m;if(this.#e=r,!this.hasListeners())return;if(g)te(s,m).forEach((c)=>{c.destroy()}),te(m,s).forEach((c)=>{c.subscribe((x)=>{this.#p(c,x)})});this.#f()})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map((a)=>a.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(a,e){let s=this.#u(a),i=s.map((r)=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),m=s.map((r)=>r.defaultedQueryOptions.queryHash);return[i,(r)=>this.#c(r??i,e,m),()=>this.#m(i,s)]}#m(a,e){let s=new Set;return e.map((i,m)=>{let r=a[m];return!i.defaultedQueryOptions.notifyOnChangeProps?i.observer.trackResult(r,(p)=>{if(!s.has(p))s.add(p),e.forEach((f)=>{f.observer.trackProp(p)})}):r})}#c(a,e,s){if(e){let i=this.#l,m=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((r,p)=>r!==i[p]));if(this.#e!==this.#n||m||e!==this.#i){if(this.#i=e,this.#n=this.#e,s!==void 0)this.#l=s;this.#s=vc(this.#s,e(a))}return this.#s}return a}#g(){return!this.#a?.combine||this.#t.some((a,e)=>a.options.suspense&&this.#e[e]?.data===void 0)}#u(a){let e=new Map;this.#t.forEach((i)=>{let m=i.options.queryHash;if(!m)return;let r=e.get(m);if(r)r.push(i);else e.set(m,[i])});let s=[];return a.forEach((i)=>{let m=this.#r.defaultQueryOptions(i),r=e.get(m.queryHash)?.shift()??new Vo(this.#r,m);s.push({defaultedQueryOptions:m,observer:r})}),s}#p(a,e){let s=this.#t.indexOf(a);if(s!==-1)this.#e=this.#e.slice(),this.#e[s]=e,this.#f()}#f(){if(this.hasListeners()){let a=this.#g(),e=this.#s,s=a?e:this.#c(this.#m(this.#e,this.#d),this.#a?.combine);if(a||e!==s)qt.batch(()=>{this.listeners.forEach((i)=>{i(this.#e)})})}}};C();function re({queries:a,...e},s){let i=K(s),m=Ou(),r=Du(),p=e.subscribed!==!1,f=O(()=>a.map((d)=>{let b=i.defaultQueryOptions(d);return b._optimisticResults=m?"isRestoring":p?"optimistic":void 0,b}),[a,i,m,p]);f.forEach((d)=>{Uu(d);let b=i.getQueryCache().get(d.queryHash);Lu(d,r,b)}),Zu(r);let[g]=u(()=>new ae(i,f,e)),[v,c,x]=g.getOptimisticResult(f,e.combine),y=!m&&p;Vn(N((d)=>y?g.subscribe(qt.batchCalls(d)):mr,[g,y]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),h(()=>{g.setQueries(f,e)},[f,e,g]);let n=v.some((d,b)=>xc(f[b],d))?v.flatMap((d,b)=>{let k=f[b];if(k&&xc(k,d)){let Q=new Vo(i,k);return Fu(k,Q,r)}return[]}):[];if(n.length>0)throw Promise.all(n);let _=v.find((d,b)=>{let k=f[b];return k&&Bu({result:d,errorResetBoundary:r,throwOnError:k.throwOnError,query:i.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(_)throw _.error;return c(x())}C();C();var ve=Object.defineProperty,M=(a,e)=>ve(a,"name",{value:e,configurable:!0}),W="Collapsible",[Ne,Bt]=dt(W),[ye,X]=Ne(W),Ce=D(M(function(e,s){let{__scopeCollapsible:i,open:m,defaultOpen:r,disabled:p,onOpenChange:f,...g}=e,[v,c]=Lt({prop:m,defaultProp:r??!1,onChange:f,caller:W});return t(ye,{scope:i,disabled:p,contentId:vr(),open:v,onOpenToggle:N(()=>c((x)=>!x),[c]),children:t(se.div,{"data-state":z(v),"data-disabled":p?"":void 0,...g,ref:s})})},"Collapsible")),_e="CollapsibleTrigger",Re=D(M(function(e,s){let{__scopeCollapsible:i,...m}=e,r=X(_e,i);return t(se.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":z(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...m,ref:s,onClick:Y(e.onClick,r.onOpenToggle)})},"CollapsibleTrigger")),oe="CollapsibleContent",Ae=D(M(function(e,s){let{forceMount:i,...m}=e,r=X(oe,e.__scopeCollapsible);return t(sr,{present:i||r.open,children:({present:p})=>t(qe,{...m,ref:s,present:p})})},"CollapsibleContent")),qe=D(M(function(e,s){let{__scopeCollapsible:i,present:m,children:r,...p}=e,f=X(oe,i),[g,v]=u(m),c=w(null),x=he(s,c),y=w(0),n=y.current,_=w(0),d=_.current,b=f.open||g,k=w(b),Q=w(void 0);return h(()=>{let I=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(I)},[]),It(()=>{let I=c.current;if(I){Q.current=Q.current||{transitionDuration:I.style.transitionDuration,animationName:I.style.animationName},I.style.transitionDuration="0s",I.style.animationName="none";let j=I.getBoundingClientRect();if(y.current=j.height,_.current=j.width,!k.current)I.style.transitionDuration=Q.current.transitionDuration,I.style.animationName=Q.current.animationName;v(m)}},[f.open,m]),t(se.div,{"data-state":z(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!b,...p,ref:x,style:{["--radix-collapsible-content-height"]:n?`${n}px`:void 0,["--radix-collapsible-content-width"]:d?`${d}px`:void 0,...e.style},children:b&&r})},"CollapsibleContentImpl"));function z(a){return a?"open":"closed"}M(z,"getState");var Pe=Ce;var He=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],ie=T("chart-no-axes-column",He);var Oe=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],J=T("funnel",Oe);var Qe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],F=T("messages-square",Qe);function ne({teamId:a}){let[e,s]=u("team"),[i,m]=u("1h"),{data:r,isLoading:p}=Z({queryKey:["teams",a,"ai-usage",i,"team"],queryFn:async()=>{let d=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i}});if(!d.ok)throw Error("Failed to fetch team AI usage");return await d.json()},enabled:!!a&&e==="team"}),{data:f,isLoading:g}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let d=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!d.ok)throw Error("Failed to fetch team members");return await d.json()},enabled:!!a&&e==="members"}),v=re({queries:(f||[]).map((d)=>({queryKey:["teams",a,"ai-usage",i,d.id],queryFn:async()=>{let b=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i,userId:d.id}});if(!b.ok)throw Error(`Failed to fetch AI usage for member ${d.id}`);return await b.json()},enabled:!!a&&e==="members"}))}),c=g||v.some((d)=>d.isLoading),x=(d)=>{if(!d)return"U";let b=d.split(" ");if(b.length>1)return`${b[0][0]}${b[b.length-1][0]}`.toUpperCase();return d.substring(0,2).toUpperCase()},y=(d)=>{if(!d)return"";switch(d.toLowerCase()){case"owner":return Zc();case"editor":return Ps();case"reviewer":return Os();default:return d}},n=(d)=>(d??0).toLocaleString(),_=(d)=>`$${(d??0).toFixed(6)}`;return o(Ct,{className:"border-border/60 shadow-sm",children:[o(Nt,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[o("div",{children:[t(Ot,{className:"text-xl font-semibold tracking-tight",children:uy()}),t(Ht,{className:"text-sm text-muted-foreground mt-1",children:dy()})]}),o("div",{className:"flex flex-wrap items-center gap-3",children:[o(Eo,{type:"single",value:e,onValueChange:(d)=>{if(d)s(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(pr,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:nI()}),t(pr,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:xv()})]}),o(Eo,{type:"single",value:i,onValueChange:(d)=>{if(d)m(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(pr,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),t(pr,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),t(pr,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),t(pr,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),t(Rt,{children:e==="team"?p?t("div",{className:"flex h-48 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Tn,{children:[t(Mn,{children:o(_r,{children:[t(bt,{children:Nd()}),t(bt,{className:"text-right",children:bh()}),t(bt,{className:"text-right",children:jh()}),t(bt,{className:"text-right",children:Fm()}),t(bt,{className:"text-right",children:jg()}),t(bt,{className:"text-right",children:$m()})]})}),t(Rn,{children:o(_r,{children:[t(mt,{className:"font-medium",children:Nd()}),t(mt,{className:"text-right",children:n(r?.team?.inputTokens)}),t(mt,{className:"text-right",children:n(r?.team?.outputTokens)}),t(mt,{className:"text-right",children:n(r?.team?.cacheReadTokens)}),t(mt,{className:"text-right font-medium",children:n(r?.team?.totalTokens)}),t(mt,{className:"text-right font-medium",children:_(r?.team?.cost)})]})})]})}):c?t("div",{className:"flex h-48 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Tn,{children:[t(Mn,{children:o(_r,{children:[t(bt,{children:vv()}),t(bt,{children:IC()}),t(bt,{className:"text-right",children:bh()}),t(bt,{className:"text-right",children:jh()}),t(bt,{className:"text-right",children:Fm()}),t(bt,{className:"text-right",children:jg()}),t(bt,{className:"text-right",children:$m()})]})}),t(Rn,{children:(f||[]).map((d,b)=>{let k=v[b]?.data?.member;return o(_r,{children:[t(mt,{children:o("div",{className:"flex items-center gap-3",children:[o(Ee,{className:"h-8 w-8 rounded-full",children:[d.image&&t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"bg-primary/20 text-xs",children:x(d.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium leading-none",children:d.name}),t("span",{className:"text-xs text-muted-foreground mt-0.5",children:d.email})]})]})}),t(mt,{className:"text-xs text-muted-foreground",children:y(d.role)}),t(mt,{className:"text-right",children:n(k?.inputTokens)}),t(mt,{className:"text-right",children:n(k?.outputTokens)}),t(mt,{className:"text-right",children:n(k?.cacheReadTokens)}),t(mt,{className:"text-right font-medium",children:n(k?.totalTokens)}),t(mt,{className:"text-right font-medium",children:_(k?.cost)})]},d.id)})})]})})})]})}C();function le({teamId:a}){let[e,s]=u(null),{ref:i,inView:m}=Mt(),{data:r,isLoading:p,isError:f,fetchNextPage:g,hasNextPage:v,isFetchingNextPage:c}=ut({queryKey:["teams",a,"agent-sessions"],queryFn:async({pageParam:n})=>{let _=await A.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:a},query:{first:"20",after:n?String(n):void 0}});if(!_.ok)throw Error("Failed to fetch agent sessions");return await _.json()},initialPageParam:"",getNextPageParam:(n)=>n.pageInfo.cursor||void 0,enabled:!!a});h(()=>{if(m&&v&&!c)g()},[m,v,c,g]);let x=r?.pages.flatMap((n)=>n.data).filter((n)=>n.id!=="pending")||[],y=(n)=>{switch(n){case"comment":return t(we,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:mE()});case"chat":return t(we,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:pE()});case"naming":return t(we,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:hE()});default:return t(we,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:n})}};return o("div",{className:"space-y-6",children:[o(Ct,{className:"border border-border/50 shadow-xs",children:[t(Nt,{className:"pb-4",children:t("div",{className:"flex items-center justify-between",children:o("div",{children:[o(Ot,{className:"text-xl font-bold flex items-center gap-2",children:[t(F,{className:"w-5 h-5 text-violet-500"}),Mg()]}),t(Ht,{className:"mt-1 text-sm text-muted-foreground",children:gE()})]})})}),t(Rt,{children:p?t("div",{className:"flex h-64 items-center justify-center",children:t(L,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):f?t("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):x.length===0?o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(F,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),t("p",{className:"text-base font-medium",children:hx()})]}):o("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[o(Tn,{children:[t(Mn,{className:"bg-muted/40",children:o(_r,{children:[t(bt,{children:uE()}),t(bt,{children:Pc()}),t(bt,{children:fE()}),t(bt,{className:"text-right",children:$0()})]})}),t(Rn,{children:x.map((n)=>o(_r,{onClick:()=>s(n.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[t(mt,{className:"font-medium",children:o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-semibold text-foreground",children:n.name||Rp()}),t("span",{className:"text-xs font-mono text-muted-foreground/70",children:n.id})]})}),t(mt,{children:o("div",{className:"flex items-center gap-2",children:[o(Ee,{className:"h-6 w-6",children:[t(Ie,{src:n.creator?.image||void 0}),t(Te,{className:"text-[10px]",children:n.creator?.name?.[0]?.toUpperCase()||"?"})]}),t("span",{className:"text-sm text-foreground/90",children:n.creator?.name||"System / Agent"})]})}),t(mt,{children:y(n.type)}),t(mt,{className:"text-right text-xs text-muted-foreground",children:Cn(n.createdAt)})]},n.id))})]}),t("div",{ref:i,className:"py-4 flex justify-center",children:c&&t(L,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),t(Ul,{sessionId:e,open:!!e,onOpenChange:(n)=>{if(!n)s(null)}})]})}C();function de({...a}){return t(Pe,{"data-slot":"collapsible",...a})}function me({...a}){return t(Re,{"data-slot":"collapsible-trigger",...a})}function ce({...a}){return t(Ae,{"data-slot":"collapsible-content",...a})}function ee(a){switch(a.toLowerCase()){case"owner":return Zc();case"editor":return Ps();case"reviewer":return Os();default:return a}}function Le(a,e){if(typeof a==="object"&&a!==null&&"message"in a){let s=a.message;if(typeof s==="string")return s}return e}function Be({rule:a}){let e=a.resourceData??{};if(a.resource==="agent_mcp_call_count")return t("span",{children:lC({value:String(e.id??"")})});if(a.resource==="agent_bash_call_count")return t("span",{children:iC({value:String(e.match??"*")})});if(a.resource==="agent_tool_call_count")return t("span",{children:cC({value:String(e.name??e.toolName??"*")})});return null}function Me({rule:a}){if(a.scopeMode==="all_members")return o(we,{variant:"secondary",className:"gap-1 text-xs",children:[t(oo,{className:"h-3 w-3"}),o("span",{children:[Cd(),a.role?` (${ee(a.role)})`:` (${wl()})`]})]});if(a.scopeMode==="each_member")return o(we,{variant:"secondary",className:"gap-1 text-xs",children:[t(Hn,{className:"h-3 w-3"}),o("span",{children:[Ed(),a.role?` (${ee(a.role)})`:` (${wl()})`]})]});return o(we,{variant:"secondary",className:"gap-1 text-xs",children:[t(ci,{className:"h-3 w-3"}),o("span",{children:[Id()," (",a.userIds?.length||0,")"]})]})}function je({teamId:a,rule:e,record:s}){let i=K(),[m,r]=u(!1),[p,f]=u(()=>new Date),g=zi[e.resource],v=e.scopeMode==="all_members",c=s.percent>=100,x=v?e.role?`${XS()}: ${ee(e.role)}`:uC():s.user?.name||s.userId||cn();h(()=>{if(!s.isWindowActive||!s.periodEnd)return;let n=window.setInterval(()=>f(new Date),60000);return()=>window.clearInterval(n)},[s.isWindowActive,s.periodEnd]);let y=U({mutationFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:a,id:e.id},json:{userId:s.userId??null}});if(!n.ok){let _=await n.json().catch(()=>null);throw Error(Le(_,lh()))}return await n.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["teams",a,"quotas",e.id,"records"]}),i.invalidateQueries({queryKey:["teams",a,"quotas"]}),r(!1),R.success(WS())},onError:(n)=>{let _=n instanceof Error?n.message:lh();r(!1),R.error(_)}});return o(B,{children:[o("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[o("div",{className:"flex items-center justify-between gap-3",children:[o("div",{className:"flex min-w-0 items-center gap-3",children:[v?t("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t(oo,{className:"h-5 w-5"})}):o(Ee,{className:"h-9 w-9 shrink-0 border border-border/50",children:[t(Ie,{src:s.user?.image||void 0}),t(Te,{className:"text-xs font-semibold",children:s.user?.name?.[0]?.toUpperCase()||"U"})]}),o("div",{className:"min-w-0",children:[t("div",{className:"truncate text-sm font-semibold text-foreground",children:x}),!v&&s.user?.email&&t("div",{className:"truncate text-xs text-muted-foreground",children:s.user.email})]})]}),o("div",{className:"flex shrink-0 items-center gap-2",children:[s.isWindowActive&&s.periodEnd?o(we,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[t(hr,{className:"h-3 w-3"}),t("span",{children:cg({time:Zp(s.periodEnd,p)})})]}):o(we,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[t(br,{className:"h-3 w-3 text-primary"}),t("span",{children:ig()})]}),o(S,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>r(!0),disabled:y.isPending,children:[y.isPending?t(L,{className:"h-3.5 w-3.5 animate-spin"}):t(Fs,{className:"h-3.5 w-3.5"}),ug()]})]})]}),o("div",{className:"space-y-1.5 pt-1",children:[t(Gd,{value:Math.min(100,Math.max(0,s.percent)),className:"h-2"}),o("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[o("span",{className:c?"font-bold text-destructive":"text-foreground",children:[Ca(e.resource,s.consumed)," /"," ",Ca(e.resource,e.limit)," ",g?.unit]}),o("span",{className:c?"font-bold text-destructive":"text-muted-foreground",children:[s.percent,"%"]})]})]}),o("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[s.isWindowActive&&s.periodEnd?o("span",{className:"flex items-center gap-1 text-primary",children:[t(hr,{className:"h-3 w-3"}),cg({time:Zp(s.periodEnd,p)})]}):o("span",{className:"flex items-center gap-1",children:[t(br,{className:"h-3 w-3 text-primary"}),ig()]}),o("span",{children:[KS(),": ",Ca(e.resource,s.remaining)," ",g?.unit]})]})]}),t(Je,{open:m,onOpenChange:r,children:o(Xe,{children:[o(et,{children:[t(rt,{children:ug()}),t(nt,{children:YS({target:x})})]}),o(tt,{children:[t(st,{disabled:y.isPending,children:ke()}),o(ot,{onClick:(n)=>{n.preventDefault(),y.mutate()},disabled:y.isPending,children:[y.isPending&&t(L,{className:"mr-2 h-4 w-4 animate-spin"}),Wa()]})]})]})})]})}function Ue({teamId:a,rule:e}){let[s,i]=u(!1),[m,r]=u(""),p=zi[e.resource],f=p?.icon||Uo,{data:g,isLoading:v,isError:c}=Z({queryKey:["teams",a,"quotas",e.id,"records"],queryFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:a,id:e.id}});if(!n.ok)throw Error(ih());return await n.json()},enabled:s,refetchInterval:s?1e4:!1}),x=g?.records??[],y=x.filter((n)=>{if(!m.trim())return!0;let _=m.toLowerCase();return n.user?.name.toLowerCase().includes(_)||n.user?.email.toLowerCase().includes(_)});return o(de,{open:s,onOpenChange:i,className:"rounded-xl border border-border/70",children:[t(me,{asChild:!0,children:o("button",{type:"button","aria-label":s?FS():HS(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[o("div",{className:"flex min-w-0 items-start gap-3",children:[t("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:t(f,{className:"h-5 w-5"})}),o("div",{className:"min-w-0",children:[o("div",{className:"flex flex-wrap items-center gap-2",children:[t("span",{className:"font-semibold text-foreground",children:p?.label()||e.resource}),!e.enabled&&t(we,{variant:"secondary",children:np()})]}),o("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[t(Me,{rule:e}),o(we,{variant:"outline",className:"gap-1 text-xs",children:[t(hr,{className:"h-3 w-3"}),Ca(e.resource,e.limit)," ",p?.unit," /"," ",ql(e.period)]}),t(Be,{rule:e})]})]})]}),t(be,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${s?"rotate-180":""}`})]})}),t(ce,{children:o("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[e.scopeMode!=="all_members"&&x.length>3&&o("div",{className:"relative",children:[t(Ut,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),t(H,{value:m,onChange:(n)=>r(n.target.value),placeholder:cp(),className:"h-9 pl-9 text-sm"})]}),v?t("div",{className:"flex justify-center py-10",children:t(L,{className:"h-7 w-7 animate-spin text-primary"})}):c?t("div",{className:"py-8 text-center text-sm text-destructive",children:ih()}):y.length===0?t("div",{className:"py-8 text-center text-sm text-muted-foreground",children:QS()}):y.map((n,_)=>t(je,{teamId:a,rule:e,record:n},n.id||n.userId||`record-${_}`))]})})]})}function ue({teamId:a}){let{data:e,isLoading:s,isError:i}=Z({queryKey:["teams",a,"quotas"],queryFn:async()=>{let r=await A.api.teams[":teamId"].quotas.$get({param:{teamId:a}});if(!r.ok)throw Error(ls());return await r.json()},enabled:!!a}),m=e?.rules??[];return o(Ct,{className:"border-border/60 shadow-sm",children:[o(Nt,{children:[o(Ot,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[t(Uo,{className:"h-5 w-5 text-primary"}),Td()]}),t(Ht,{children:jS()})]}),t(Rt,{children:s?t("div",{className:"flex h-48 items-center justify-center",children:t(L,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):i?t("div",{className:"py-10 text-center text-sm text-destructive",children:ls()}):m.length===0?o("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[t(Uo,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),t("p",{className:"text-base font-medium text-foreground",children:Vf()}),t("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:Qf()})]}):t("div",{className:"space-y-3",children:m.map((r)=>t(Ue,{teamId:a,rule:r},r.id))})})]})}C();var $e=Object.values(Il);function pe({teamId:a}){let[e,s]=u([]),[i,m]=u([]),[r,p]=u(""),{ref:f,inView:g}=Mt(),{data:v}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let l=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!l.ok)return[];return await l.json()},enabled:!!a}),c=v||[],{data:x,isLoading:y,isError:n,fetchNextPage:_,hasNextPage:d,isFetchingNextPage:b}=ut({queryKey:["teams",a,"audit-logs",e,i,r],queryFn:async({pageParam:l})=>{let q=await A.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:a},query:{first:"20",after:l?String(l):void 0,actions:e.length>0?e:void 0,userIds:i.length>0?i:void 0,itemId:r.trim()||void 0}});if(!q.ok)throw Error("Failed to fetch audit logs");return await q.json()},initialPageParam:"",getNextPageParam:(l)=>l.pageInfo.endCursor||void 0,enabled:!!a});h(()=>{if(g&&d&&!b)_()},[g,d,b,_]);let k=x?.pages.flatMap((l)=>l.nodes)||[],Q=x?.pages[0]?.total??0,I=(l)=>{s((q)=>q.includes(l)?q.filter((P)=>P!==l):[...q,l])},j=(l)=>{m((q)=>q.includes(l)?q.filter((P)=>P!==l):[...q,l])},fe=(l)=>{if(l.includes("delete")||l.includes("remove")||l.includes("revoke"))return t(we,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:l});if(l.includes("create")||l.includes("add"))return t(we,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:l});if(l.includes("update")||l.includes("reparent")||l.includes("copy"))return t(we,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:l});return t(we,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:l})},ge=new Map(c.map((l)=>[l.userId||l.id,l]));return t("div",{className:"space-y-6",children:o(Ct,{className:"border border-border/50 shadow-xs",children:[o(Nt,{className:"pb-4",children:[o("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[o("div",{children:[o(Ot,{className:"text-xl font-bold flex items-center gap-2",children:[t(Fs,{className:"h-5 w-5 text-primary"}),hf()]}),t(Ht,{className:"mt-1",children:Zy()})]}),Q>0&&o(we,{variant:"secondary",className:"w-fit text-xs font-normal",children:[Q," ",hf()]})]}),o("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[o(gt,{children:[t(At,{asChild:!0,children:o(S,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),Ub(),e.length>0&&t(we,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:e.length})]})}),o(yt,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:qC()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:$e.map((l)=>o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(Nr,{checked:e.includes(l),onCheckedChange:()=>I(l)}),t("span",{className:"font-mono",children:l})]},l))}),e.length>0&&t(S,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>s([]),children:"Clear Actions"})]})]}),o(gt,{children:[t(At,{asChild:!0,children:o(S,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),Fb(),i.length>0&&t(we,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:i.length})]})}),o(yt,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:oE()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:c.map((l)=>{let q=l.userId||l.user?.id||l.id,P=l.user?.name||l.name||q,V=l.user?.image||l.image;return o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(Nr,{checked:i.includes(q),onCheckedChange:()=>j(q)}),o(Ee,{className:"h-5 w-5",children:[t(Ie,{src:V||void 0}),t(Te,{className:"text-[10px]",children:P.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate",children:P})]},q)})}),i.length>0&&t(S,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>m([]),children:"Clear Users"})]})]}),o("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[t(Ut,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t(H,{type:"text",placeholder:FC(),value:r,onChange:(l)=>p(l.target.value),className:"pl-8 pr-8 h-9 text-xs"}),r&&t("button",{onClick:()=>p(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:t(De,{className:"h-4 w-4"})})]}),(e.length>0||i.length>0||r)&&t(S,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{s([]),m([]),p("")},children:"Clear all"})]})]}),o(Rt,{className:"p-0",children:[y?t("div",{className:"flex h-64 items-center justify-center",children:t(L,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?t("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):k.length===0?t("div",{className:"p-12 text-center text-sm text-muted-foreground",children:tx()}):o(Tn,{children:[t(Mn,{children:o(_r,{className:"hover:bg-transparent border-b border-border/50",children:[t(bt,{className:"w-[180px] text-xs font-semibold",children:aA()}),t(bt,{className:"w-[200px] text-xs font-semibold",children:FI()}),t(bt,{className:"text-xs font-semibold",children:vw()}),t(bt,{className:"text-xs font-semibold",children:bS()}),t(bt,{className:"w-[160px] text-right text-xs font-semibold",children:gI()})]})}),t(Rn,{children:k.map((l)=>{let q=l.userId?ge.get(l.userId):null,P=q?.user?.name||q?.name||l.userId||"System",V=q?.user?.image||q?.image;return o(_r,{className:"hover:bg-muted/40 transition-colors",children:[t(mt,{className:"py-3 font-medium",children:fe(l.action)}),t(mt,{className:"py-3",children:o("div",{className:"flex items-center gap-2",children:[o(Ee,{className:"h-6 w-6",children:[t(Ie,{src:V||void 0}),t(Te,{className:"text-[10px]",children:P.slice(0,2).toUpperCase()})]}),t("span",{className:"text-xs font-medium text-foreground truncate max-w-[160px]",children:l.agent?jc({user:P,agent:l.agent.name}):P}),l.agent&&t(wt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})]})}),t(mt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.itemId||"-"}),t(mt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.projectId||"-"}),t(mt,{className:"py-3 text-right text-xs text-muted-foreground",children:Cn(l.createdAt)})]},l.id)})})]}),t("div",{ref:f,className:"py-4 flex justify-center",children:b&&t(L,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function ze(){let{teamId:a}=Ge.useParams(),[e,s]=u("audit-logs"),{data:i,isLoading:m}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let r=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!r.ok)throw Error("Failed to fetch me");return await r.json()},enabled:!!a});if(m)return t("div",{className:"flex h-screen items-center justify-center",children:t(L,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(i?.role?.toLowerCase()!=="owner")return o("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[t(jl,{className:"h-12 w-12 text-destructive mb-4"}),t("h2",{className:"text-xl font-bold tracking-tight mb-2",children:sA()}),t("p",{className:"text-sm text-muted-foreground max-w-md",children:Ix()})]});return t("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:o("div",{className:"flex flex-col md:flex-row h-full",children:[t("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:o("nav",{className:"p-4 space-y-1 mt-4",children:[t("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:Km()}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:XE()}),o("button",{onClick:()=>s("audit-logs"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(Fs,{className:"w-5 h-5"}),hf(),e==="audit-logs"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("quotas"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="quotas"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(Uo,{className:"w-5 h-5"}),Td(),e==="quotas"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:ay()}),o("button",{onClick:()=>s("ai-usage"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(ie,{className:"w-5 h-5"}),UI(),e==="ai-usage"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("ai-sessions"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(F,{className:"w-5 h-5"}),Mg(),e==="ai-sessions"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),t("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:o("div",{className:"max-w-6xl mx-auto space-y-8",children:[e==="audit-logs"&&t(pe,{teamId:a}),e==="ai-usage"&&t(ne,{teamId:a}),e==="ai-sessions"&&t(le,{teamId:a}),e==="quotas"&&t(ue,{teamId:a})]})})]})})}var Ge=Fe("/teams/$teamId/dashboard")({component:ze});export{Ge as Route};
@@ -1 +0,0 @@
1
- import{h,C,t,Z,Fe,A,it,_t,jp}from"./chunk-7rhz2gze.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-0qaq0sp8.js";import{Di}from"./chunk-rqf7999q.js";import"./chunk-3ttrhqy3.js";import"./chunk-1xh34aew.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-avwgktxb.js";import"./chunk-5adsx8x4.js";import"./chunk-gk2q9a3f.js";C();function l(){let{projectId:e}=p.useParams(),{teamId:r,ensureTeamIdForProject:i}=it();h(()=>{i(e)},[e,i]);let{data:a}=er(jp(e)),o=a?.rootFolder,{data:d}=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||!d)return t(_t,{});return t(Di,{teamId:r,projectId:e,projectName:a.name??"",assetId:o,rootFolderId:o,isRoot:!0})}var p=Fe("/projects/$projectId/agentsmd")({component:l});export{p as Route};
@@ -1,2 +0,0 @@
1
- import{T}from"./chunk-7rhz2gze.js";var o=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],Pl=T("arrow-up-narrow-wide",o);
2
- export{Pl};