@shumai-one/shumai 0.3.8 → 0.3.10

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 (177) hide show
  1. package/bin/{chunk-fvwz4mgw.js → chunk-02tqxzgz.js} +2 -2
  2. package/bin/chunk-09c03qdg.js +2 -0
  3. package/bin/chunk-0fpgfrv8.js +2 -0
  4. package/bin/{chunk-p1rrkrn4.js → chunk-0hbqkcsd.js} +1 -1
  5. package/bin/{chunk-3bm3be9d.js → chunk-0qcp4v52.js} +1 -1
  6. package/bin/chunk-0te5kcy3.js +2 -0
  7. package/bin/chunk-15zbprbe.js +1 -0
  8. package/bin/{chunk-drjaw6a5.js → chunk-1ev668rp.js} +2 -2
  9. package/bin/{chunk-ykarhcph.js → chunk-1qd83phd.js} +1 -1
  10. package/bin/{chunk-r5rf62aa.js → chunk-1whn0v5n.js} +1 -1
  11. package/bin/{chunk-mp5etccz.js → chunk-28axgckk.js} +1 -1
  12. package/bin/{chunk-pqtwzb3s.js → chunk-2mxqjx3x.js} +1 -1
  13. package/bin/{chunk-y5g2ge6f.js → chunk-2sk6e4q0.js} +1 -1
  14. package/bin/{chunk-nffrjwb7.js → chunk-2sp0gkaw.js} +2 -2
  15. package/bin/{chunk-ygcmv04c.js → chunk-2t2wjzme.js} +2 -2
  16. package/bin/chunk-301pewt3.js +1 -0
  17. package/bin/chunk-33hax7fe.js +66 -0
  18. package/bin/{chunk-h9f55mjv.js → chunk-34f4hk54.js} +2 -2
  19. package/bin/{chunk-rq4h4p2g.js → chunk-39s0cxq1.js} +2 -2
  20. package/bin/{chunk-2ejky9qv.js → chunk-41de755j.js} +1 -1
  21. package/bin/{chunk-5fj5w0gg.js → chunk-42et2rqa.js} +2 -2
  22. package/bin/{chunk-k5yxntns.js → chunk-42f9r1sg.js} +2 -2
  23. package/bin/chunk-484yr1a7.js +1 -0
  24. package/bin/{chunk-ta02azkp.js → chunk-4shqnfq1.js} +1 -1
  25. package/bin/{chunk-nc632fxz.js → chunk-60xawsa6.js} +2 -2
  26. package/bin/chunk-62ag2nfa.js +2 -0
  27. package/bin/chunk-63emv4q3.js +1 -0
  28. package/bin/chunk-6529sh41.js +2 -0
  29. package/bin/{chunk-0zbwpfsk.js → chunk-661mcdxj.js} +2 -2
  30. package/bin/{chunk-6pcs8810.js → chunk-69sf7kb1.js} +1 -1
  31. package/bin/{chunk-bc2bf144.js → chunk-6gx6gdnk.js} +2 -2
  32. package/bin/chunk-6w395tfy.js +2 -0
  33. package/bin/chunk-7735r8d7.js +1 -0
  34. package/bin/{chunk-xexxh1zq.js → chunk-7m07t899.js} +1 -1
  35. package/bin/{chunk-tfnh9sk9.js → chunk-7r6h3fta.js} +2 -2
  36. package/bin/chunk-7xwmj4ew.js +2 -0
  37. package/bin/{chunk-yr8a8nzv.js → chunk-8r2agmv2.js} +2 -2
  38. package/bin/{chunk-antsxrw9.js → chunk-8zmk029n.js} +1 -1
  39. package/bin/{chunk-7r22vcjy.js → chunk-90jcmarf.js} +2 -2
  40. package/bin/{chunk-qyegjbzd.js → chunk-94fyesf6.js} +1 -1
  41. package/bin/chunk-94yxj3yy.js +2 -0
  42. package/bin/{chunk-c24an5j3.js → chunk-9rhckjgf.js} +2 -2
  43. package/bin/chunk-9ykcjdsv.js +3 -0
  44. package/bin/chunk-9yn5r2hh.js +2 -0
  45. package/bin/chunk-a80aab0f.js +2 -0
  46. package/bin/{chunk-x8ksced7.js → chunk-ag0pavv1.js} +2 -2
  47. package/bin/{chunk-ve826t5r.js → chunk-at5ksmqs.js} +1 -1
  48. package/bin/{chunk-7c85cyn0.js → chunk-bv5mh0e0.js} +3 -3
  49. package/bin/{chunk-6pmsknnk.js → chunk-bxexm2hd.js} +47 -47
  50. package/bin/{chunk-99f9r6xm.js → chunk-cc9fftnv.js} +2 -2
  51. package/bin/{chunk-15jsnygy.js → chunk-ch25gq27.js} +2 -2
  52. package/bin/chunk-csky7q56.js +2 -0
  53. package/bin/{chunk-mjxay7yv.js → chunk-d4ktgq49.js} +1 -1
  54. package/bin/{chunk-eqf7k7ax.js → chunk-day61cfg.js} +2 -2
  55. package/bin/{chunk-rjkj0dr9.js → chunk-dgvcraag.js} +2 -2
  56. package/bin/{chunk-80g5kcm0.js → chunk-e26p9vrv.js} +1 -1
  57. package/bin/{chunk-xpce3j7g.js → chunk-emyax05s.js} +1 -1
  58. package/bin/{chunk-2t0asg3w.js → chunk-enq1hf8g.js} +2 -2
  59. package/bin/{chunk-q0xv46wa.js → chunk-f03whbny.js} +2 -2
  60. package/bin/{chunk-k0ysbh3h.js → chunk-fk9pd7ra.js} +1 -1
  61. package/bin/{chunk-ssz62jfs.js → chunk-fscyvjzb.js} +2 -2
  62. package/bin/{chunk-21rp4vzr.js → chunk-g2bkj92r.js} +2 -2
  63. package/bin/chunk-g5qfxnz1.js +2 -0
  64. package/bin/{chunk-ph43tgr6.js → chunk-g6aq2cyq.js} +1 -1
  65. package/bin/chunk-gh6j1nsm.js +1 -0
  66. package/bin/{chunk-xktnqktj.js → chunk-gra1fhdp.js} +2 -2
  67. package/bin/{chunk-28n8xqhm.js → chunk-gtenq4kq.js} +1 -1
  68. package/bin/chunk-h5jre78a.js +2 -0
  69. package/bin/{chunk-thqahbva.js → chunk-hcaw54dj.js} +2 -2
  70. package/bin/{chunk-jfjjh86p.js → chunk-hsemzjvr.js} +2 -2
  71. package/bin/chunk-hte6gd36.js +1 -0
  72. package/bin/{chunk-djqs6m7w.js → chunk-j6dea33m.js} +3 -3
  73. package/bin/{chunk-n8pas7tj.js → chunk-j99cr9mz.js} +2 -2
  74. package/bin/chunk-jn805ccq.js +1 -0
  75. package/bin/{chunk-en96pr5c.js → chunk-k2w676wz.js} +2 -2
  76. package/bin/{chunk-m7d52gfe.js → chunk-k33qdrdp.js} +1 -1
  77. package/bin/chunk-kmhkhcy6.js +68 -0
  78. package/bin/chunk-kp4kn4b4.js +2 -0
  79. package/bin/{chunk-e4se9q6n.js → chunk-m3ghgqc2.js} +1 -1
  80. package/bin/chunk-m84qgdyj.js +2 -0
  81. package/bin/{chunk-9acfydwy.js → chunk-mk5hqjjd.js} +1 -1
  82. package/bin/{chunk-tvzfm7g8.js → chunk-mnhg12fm.js} +2 -2
  83. package/bin/{chunk-rjr8c8be.js → chunk-n3vzdzdw.js} +2 -2
  84. package/bin/{chunk-8bhsdk1v.js → chunk-nw03w9pa.js} +1 -1
  85. package/bin/{chunk-6vwqg1ra.js → chunk-p31qe5mc.js} +2 -2
  86. package/bin/chunk-p48npmbh.js +2 -0
  87. package/bin/{chunk-8fsrs7mh.js → chunk-p9w4ar11.js} +1 -1
  88. package/bin/chunk-pbztc6kv.js +1 -0
  89. package/bin/{chunk-9ntwrvhz.js → chunk-pg55qp08.js} +2 -2
  90. package/bin/{chunk-0qpz48vc.js → chunk-pv4scagf.js} +1 -1
  91. package/bin/chunk-q0hrd0yw.js +2 -0
  92. package/bin/{chunk-m49ar48r.js → chunk-qev7trtm.js} +2 -2
  93. package/bin/chunk-qk9npww4.js +2 -0
  94. package/bin/{chunk-4g4g02e0.js → chunk-qphebjbv.js} +1 -1
  95. package/bin/{chunk-0pm8c9bq.js → chunk-rakz3pe6.js} +2 -2
  96. package/bin/chunk-rjga1vn2.js +2 -0
  97. package/bin/chunk-rt8yqz51.js +1 -0
  98. package/bin/chunk-s542e1y0.js +1 -0
  99. package/bin/chunk-s6e91ky2.js +2 -0
  100. package/bin/chunk-s9s9hhet.js +2 -0
  101. package/bin/{chunk-2dxd0bar.js → chunk-s9yzt7s3.js} +2 -2
  102. package/bin/chunk-sjsn35mp.js +1 -0
  103. package/bin/{chunk-2q26gz0p.js → chunk-stggq92k.js} +1 -1
  104. package/bin/{chunk-5f9fk8x0.js → chunk-t16qt2ka.js} +3 -3
  105. package/bin/chunk-tc5evq8x.js +2 -0
  106. package/bin/chunk-tjrdsmdw.js +1 -0
  107. package/bin/{chunk-3mx22sn7.js → chunk-tkh0s7hg.js} +2 -2
  108. package/bin/{chunk-agdza65r.js → chunk-tsym31yb.js} +2 -2
  109. package/bin/{chunk-twm329fs.js → chunk-v1ybpqrz.js} +1 -1
  110. package/bin/chunk-vbkwteh4.js +1 -0
  111. package/bin/chunk-vevscfh2.js +2 -0
  112. package/bin/chunk-vg33qt6z.js +11 -0
  113. package/bin/{chunk-ep138kb3.js → chunk-vgwjg37a.js} +2 -2
  114. package/bin/chunk-vwz2pa54.js +2 -0
  115. package/bin/chunk-we3vdyhb.js +1 -0
  116. package/bin/chunk-whn6dvak.js +1 -0
  117. package/bin/{chunk-2em77vjv.js → chunk-wwjqqqr4.js} +1 -1
  118. package/bin/{chunk-jqzvazsf.js → chunk-xext4yvc.js} +1 -1
  119. package/bin/chunk-xr1wr22v.css +1 -0
  120. package/bin/chunk-xvpttxen.js +7 -0
  121. package/bin/chunk-y45tzhdn.js +2 -0
  122. package/bin/{chunk-kmt9fj1z.js → chunk-y5ptk39s.js} +2 -2
  123. package/bin/{chunk-bznz6h19.js → chunk-y7b5gy17.js} +1 -1
  124. package/bin/{chunk-2xaq1y16.js → chunk-y8ffp5zj.js} +2 -2
  125. package/bin/chunk-yfgwknpa.js +78 -0
  126. package/bin/{chunk-0mmw31pj.js → chunk-z7b132c0.js} +2 -2
  127. package/bin/{chunk-wy1ytxw7.js → chunk-zdmcc6ps.js} +3 -3
  128. package/bin/shumai-app.html +1 -1
  129. package/bin/shumai-app.js +703 -407
  130. package/package.json +7 -7
  131. package/prisma/migrations/20260816020719_add_agent_permission/migration.sql +2 -0
  132. package/prisma/migrations/20260817022118_add_quota_rules_and_records/migration.sql +68 -0
  133. package/prisma/migrations/20260818025858_remove_agent_skill_call_count_from_quota_resource_type/migration.sql +14 -0
  134. package/prisma/migrations/20260819091331_add_kanban_schema/migration.sql +164 -0
  135. package/prisma/migrations/20260821102514_add_kanban_notifications/migration.sql +26 -0
  136. package/prisma/migrations/20260821133500_add_c_collation_to_kanban_sort_index/migration.sql +10 -0
  137. package/prisma/migrations/20260822020609_add_kanban_task_assets/migration.sql +17 -0
  138. package/prisma/migrations/20260822071734_remove_kanban_task_cancelled_status/migration.sql +28 -0
  139. package/prisma/schema.prisma +257 -0
  140. package/bin/chunk-16s5kfy8.css +0 -1
  141. package/bin/chunk-33r4w0yv.js +0 -2
  142. package/bin/chunk-4cmw4qmt.js +0 -1
  143. package/bin/chunk-4d3wm83a.js +0 -2
  144. package/bin/chunk-5386brz2.js +0 -2
  145. package/bin/chunk-61bxmjd9.js +0 -2
  146. package/bin/chunk-75segwsp.js +0 -2
  147. package/bin/chunk-7eyg2kgv.js +0 -1
  148. package/bin/chunk-8jfm1j41.js +0 -1
  149. package/bin/chunk-8n6segk5.js +0 -1
  150. package/bin/chunk-bapy3qv8.js +0 -1
  151. package/bin/chunk-cm74nd4n.js +0 -1
  152. package/bin/chunk-cynjx7ha.js +0 -65
  153. package/bin/chunk-cyq3m4qz.js +0 -1
  154. package/bin/chunk-ddff7vm3.js +0 -2
  155. package/bin/chunk-dn8k5ef5.js +0 -3
  156. package/bin/chunk-dqdqs0d9.js +0 -1
  157. package/bin/chunk-drvwchyn.js +0 -2
  158. package/bin/chunk-eb551xw7.js +0 -1
  159. package/bin/chunk-f3rqamey.js +0 -2
  160. package/bin/chunk-g3p6h6sw.js +0 -68
  161. package/bin/chunk-jg31cnqc.js +0 -2
  162. package/bin/chunk-jk87gxbb.js +0 -2
  163. package/bin/chunk-jyk483r4.js +0 -1
  164. package/bin/chunk-khjybf4y.js +0 -1
  165. package/bin/chunk-p6ep6grv.js +0 -1
  166. package/bin/chunk-qhxznkjk.js +0 -11
  167. package/bin/chunk-qmja7bsr.js +0 -2
  168. package/bin/chunk-scmhhrte.js +0 -2
  169. package/bin/chunk-sjr6mvgm.js +0 -78
  170. package/bin/chunk-vpfj3q7r.js +0 -1
  171. package/bin/chunk-vqakgjsf.js +0 -1
  172. package/bin/chunk-wgjghs54.js +0 -7
  173. package/bin/chunk-x788nk6z.js +0 -2
  174. package/bin/chunk-xyzsmjtk.js +0 -2
  175. package/bin/chunk-y03s8bkz.js +0 -1
  176. package/bin/chunk-yxtb7xn8.js +0 -2
  177. package/bin/chunk-zaft3sfe.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function N(k){if(!(k instanceof Error)||!("status"in k)||!("headers"in k))return!1;return(k.status===void 0||typeof k.status==="number")&&(k.headers===void 0||k.headers instanceof Headers)}function O(k){let w=k.headers?.get("x-should-retry");if(w==="true")return!0;if(w==="false")return!1;if(k.status===void 0)return!0;return k.status===408||k.status===409||k.status===429||typeof k.status==="number"&&k.status>=500}function J(k,w,C){let z=w??60000;if(z>0&&k>z)throw Error(`Server requested ${Math.ceil(k/1000)}s retry delay (max: ${Math.ceil(z/1000)}s). ${C}`);return k}function Q(k,w,C){let z=k.headers?.get("retry-after-ms");if(z){let F=Number.parseFloat(z);if(!Number.isNaN(F))return J(F,C,k.message)}let B=k.headers?.get("retry-after");if(B){let F=Number.parseFloat(B),K=Number.isNaN(F)?Date.parse(B)-Date.now():F*1000;return J(K,C,k.message)}return Math.min(0.5*2**w,8)*1000*(1-Math.random()*0.25)}function H(){let k=Error("Request aborted");return k.name="AbortError",k}function T(k,w){return new Promise((C,z)=>{if(w?.aborted){z(H());return}let B=()=>{clearTimeout(G),z(H())},G=setTimeout(()=>{w?.removeEventListener("abort",B),C()},Math.max(0,k));w?.addEventListener("abort",B,{once:!0})})}async function V(k,w={}){let C=w.maxRetries??0,z=C;for(;;)try{return await k()}catch(B){if(w.signal?.aborted)throw H();if(z<=0||!N(B)||!O(B))throw B;let G=C-z;z--,await T(Q(B,G,w.maxRetryDelayMs),w.signal)}}
3
- export{V as sl};
3
+ export{V as _l};
@@ -1,2 +1,2 @@
1
- import{ef as A}from"./chunk-agdza65r.js";import{Hh as v,Yh as w,ji as z}from"./chunk-sjr6mvgm.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/folders/$folderId_/agentsmd")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
- export{B as Ne,H as Oe};
1
+ import{Ne as A}from"./chunk-tsym31yb.js";import{Ai as z,_h as v,pi as w}from"./chunk-yfgwknpa.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/folders/$folderId_/agentsmd")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
+ export{B as he,H as ie};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{nc as P,oc as J}from"./chunk-yr8a8nzv.js";import{bd as V,cd as W,dd as X}from"./chunk-jqzvazsf.js";import"./chunk-2em77vjv.js";var Y=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},Z=class{#h;#j=new k;#z;#H;constructor(h){this.#h={...h}}async init(){if(this.#z=this.#h.database,this.#H=new $(this.#z),this.#h.onCreateConnection)await this.#h.onCreateConnection(this.#H)}async acquireConnection(){return await this.#j.lock(),this.#H}async beginTransaction(h){await h.executeQuery(J.raw("begin"))}async commitTransaction(h){await h.executeQuery(J.raw("commit"))}async rollbackTransaction(h){await h.executeQuery(J.raw("rollback"))}async releaseConnection(){this.#j.unlock()}async destroy(){this.#z?.close()}},$=class{#h;constructor(h){this.#h=h}executeQuery(h){let{sql:z,parameters:H}=h,j=this.#h.prepare(z).all(...H);return Promise.resolve({rows:j})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},k=class{#h;#j;async lock(){while(this.#h!==void 0)await this.#h;this.#h=new Promise((h)=>{this.#j=h})}unlock(){let h=this.#j;this.#h=void 0,this.#j=void 0,h?.()}},w=class{#h;constructor(h){this.#h=h}async getSchemas(){return[]}async getTables(h={withInternalKyselyTables:!1}){let z=this.#h.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!h.withInternalKyselyTables)z=z.where("name","!=",W).where("name","!=",X);let H=await z.execute();return Promise.all(H.map(({name:j})=>this.#j(j)))}async getMetadata(h){return{tables:await this.getTables(h)}}async#j(h){let z=this.#h,H=(await z.selectFrom("sqlite_master").where("name","=",h).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((j)=>j.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:h,columns:(await z.selectFrom(P`pragma_table_info(${h})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((j)=>({name:j.name,dataType:j.type,isNullable:!j.notnull,isAutoIncrementing:j.name===H,hasDefaultValue:j.dflt_value!=null})),isView:!0}}},K=class extends V{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},F=class{#h;constructor(h){this.#h={...h}}createDriver(){return new Z(this.#h)}createQueryCompiler(){return new K}createAdapter(){return new Y}createIntrospector(h){return new w(h)}};export{F as NodeSqliteDialect};
2
+ import{Jb as P,Kb as J}from"./chunk-8r2agmv2.js";import{xc as V,yc as W,zc as X}from"./chunk-xext4yvc.js";import"./chunk-wwjqqqr4.js";var Y=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},Z=class{#h;#j=new k;#z;#H;constructor(h){this.#h={...h}}async init(){if(this.#z=this.#h.database,this.#H=new $(this.#z),this.#h.onCreateConnection)await this.#h.onCreateConnection(this.#H)}async acquireConnection(){return await this.#j.lock(),this.#H}async beginTransaction(h){await h.executeQuery(J.raw("begin"))}async commitTransaction(h){await h.executeQuery(J.raw("commit"))}async rollbackTransaction(h){await h.executeQuery(J.raw("rollback"))}async releaseConnection(){this.#j.unlock()}async destroy(){this.#z?.close()}},$=class{#h;constructor(h){this.#h=h}executeQuery(h){let{sql:z,parameters:H}=h,j=this.#h.prepare(z).all(...H);return Promise.resolve({rows:j})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},k=class{#h;#j;async lock(){while(this.#h!==void 0)await this.#h;this.#h=new Promise((h)=>{this.#j=h})}unlock(){let h=this.#j;this.#h=void 0,this.#j=void 0,h?.()}},w=class{#h;constructor(h){this.#h=h}async getSchemas(){return[]}async getTables(h={withInternalKyselyTables:!1}){let z=this.#h.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!h.withInternalKyselyTables)z=z.where("name","!=",W).where("name","!=",X);let H=await z.execute();return Promise.all(H.map(({name:j})=>this.#j(j)))}async getMetadata(h){return{tables:await this.getTables(h)}}async#j(h){let z=this.#h,H=(await z.selectFrom("sqlite_master").where("name","=",h).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((j)=>j.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:h,columns:(await z.selectFrom(P`pragma_table_info(${h})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((j)=>({name:j.name,dataType:j.type,isNullable:!j.notnull,isAutoIncrementing:j.name===H,hasDefaultValue:j.dflt_value!=null})),isView:!0}}},K=class extends V{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},F=class{#h;constructor(h){this.#h={...h}}createDriver(){return new Z(this.#h)}createQueryCompiler(){return new K}createAdapter(){return new Y}createIntrospector(h){return new w(h)}};export{F as NodeSqliteDialect};
@@ -0,0 +1,2 @@
1
+ import{nh as b,oh as H,th as wW}from"./chunk-y45tzhdn.js";import{Ai as y,vi as WW,wi as qW}from"./chunk-yfgwknpa.js";var c=Symbol.for("immer-nothing"),v=Symbol.for("immer-draftable"),Y=Symbol.for("immer-state");function G(W,...q){throw Error(`[Immer] minified error nr: ${W}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function x(W){return!!W&&!!W[Y]}function U(W){if(!W)return!1;return o(W)||Array.isArray(W)||!!W[v]||!!W.constructor?.[v]||M(W)||f(W)}var JW=Object.prototype.constructor.toString(),n=new WeakMap;function o(W){if(!W||typeof W!=="object")return!1;let q=Object.getPrototypeOf(W);if(q===null||q===Object.prototype)return!0;let w=Object.hasOwnProperty.call(q,"constructor")&&q.constructor;if(w===Object)return!0;if(typeof w!=="function")return!1;let $=n.get(w);if($===void 0)$=Function.toString.call(w),n.set(w,$);return $===JW}function C(W,q,w=!0){if(F(W)===0)(w?Reflect.ownKeys(W):Object.keys(W)).forEach((J)=>{q(J,W[J],W)});else W.forEach(($,J)=>q(J,$,W))}function F(W){let q=W[Y];return q?q.type_:Array.isArray(W)?1:M(W)?2:f(W)?3:0}function D(W,q){return F(W)===2?W.has(q):Object.prototype.hasOwnProperty.call(W,q)}function r(W,q,w){let $=F(W);if($===2)W.set(q,w);else if($===3)W.add(w);else W[q]=w}function QW(W,q){if(W===q)return W!==0||1/W===1/q;else return W!==W&&q!==q}function M(W){return W instanceof Map}function f(W){return W instanceof Set}function K(W){return W.copy_||W.base_}function P(W,q){if(M(W))return new Map(W);if(f(W))return new Set(W);if(Array.isArray(W))return Array.prototype.slice.call(W);let w=o(W);if(q===!0||q==="class_only"&&!w){let $=Object.getOwnPropertyDescriptors(W);delete $[Y];let J=Reflect.ownKeys($);for(let Q=0;Q<J.length;Q++){let X=J[Q],Z=$[X];if(Z.writable===!1)Z.writable=!0,Z.configurable=!0;if(Z.get||Z.set)$[X]={configurable:!0,writable:!0,enumerable:Z.enumerable,value:W[X]}}return Object.create(z(W),$)}else{let $=z(W);if($!==null&&w)return{...W};let J=Object.create($);return Object.assign(J,W)}}function g(W,q=!1){if(E(W)||x(W)||!U(W))return W;if(F(W)>1)Object.defineProperties(W,{set:O,add:O,clear:O,delete:O});if(Object.freeze(W),q)Object.values(W).forEach((w)=>g(w,!0));return W}function XW(){G(2)}var O={value:XW};function E(W){if(W===null||typeof W!=="object")return!0;return Object.isFrozen(W)}var ZW={};function I(W){let q=ZW[W];if(!q)G(0,W);return q}var m;function p(){return m}function YW(W,q){return{drafts_:[],parent_:W,immer_:q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function h(W,q){if(q)I("Patches"),W.patches_=[],W.inversePatches_=[],W.patchListener_=q}function k(W){A(W),W.drafts_.forEach(GW),W.drafts_=null}function A(W){if(W===m)m=W.parent_}function i(W){return m=YW(m,W)}function GW(W){let q=W[Y];if(q.type_===0||q.type_===1)q.revoke_();else q.revoked_=!0}function u(W,q){q.unfinalizedDrafts_=q.drafts_.length;let w=q.drafts_[0];if(W!==void 0&&W!==w){if(w[Y].modified_)k(q),G(4);if(U(W)){if(W=V(q,W),!q.parent_)R(q,W)}if(q.patches_)I("Patches").generateReplacementPatches_(w[Y].base_,W,q.patches_,q.inversePatches_)}else W=V(q,w,[]);if(k(q),q.patches_)q.patchListener_(q.patches_,q.inversePatches_);return W!==c?W:void 0}function V(W,q,w){if(E(q))return q;let $=W.immer_.shouldUseStrictIteration(),J=q[Y];if(!J)return C(q,(Q,X)=>l(W,J,q,Q,X,w),$),q;if(J.scope_!==W)return q;if(!J.modified_)return R(W,J.base_,!0),J.base_;if(!J.finalized_){J.finalized_=!0,J.scope_.unfinalizedDrafts_--;let Q=J.copy_,X=Q,Z=!1;if(J.type_===3)X=new Set(Q),Q.clear(),Z=!0;if(C(X,(B,N)=>l(W,J,Q,B,N,w,Z),$),R(W,Q,!1),w&&W.patches_)I("Patches").generatePatches_(J,w,W.patches_,W.inversePatches_)}return J.copy_}function l(W,q,w,$,J,Q,X){if(J==null)return;if(typeof J!=="object"&&!X)return;let Z=E(J);if(Z&&!X)return;if(x(J)){let B=Q&&q&&q.type_!==3&&!D(q.assigned_,$)?Q.concat($):void 0,N=V(W,J,B);if(r(w,$,N),x(N))W.canAutoFreeze_=!1;else return}else if(X)w.add(J);if(U(J)&&!Z){if(!W.immer_.autoFreeze_&&W.unfinalizedDrafts_<1)return;if(q&&q.base_&&q.base_[$]===J&&Z)return;if(V(W,J),(!q||!q.scope_.parent_)&&typeof $!=="symbol"&&(M(w)?w.has($):Object.prototype.propertyIsEnumerable.call(w,$)))R(W,J)}}function R(W,q,w=!1){if(!W.parent_&&W.immer_.autoFreeze_&&W.canAutoFreeze_)g(q,w)}function HW(W,q){let w=Array.isArray(W),$={type_:w?1:0,scope_:q?q.scope_:p(),modified_:!1,finalized_:!1,assigned_:{},parent_:q,base_:W,draft_:null,copy_:null,revoke_:null,isManual_:!1},J=$,Q=d;if(w)J=[$],Q=L;let{revoke:X,proxy:Z}=Proxy.revocable(J,Q);return $.draft_=Z,$.revoke_=X,Z}var d={get(W,q){if(q===Y)return W;let w=K(W);if(!D(w,q))return BW(W,w,q);let $=w[q];if(W.finalized_||!U($))return $;if($===_(W.base_,q))return j(W),W.copy_[q]=S($,W);return $},has(W,q){return q in K(W)},ownKeys(W){return Reflect.ownKeys(K(W))},set(W,q,w){let $=s(K(W),q);if($?.set)return $.set.call(W.draft_,w),!0;if(!W.modified_){let J=_(K(W),q),Q=J?.[Y];if(Q&&Q.base_===w)return W.copy_[q]=w,W.assigned_[q]=!1,!0;if(QW(w,J)&&(w!==void 0||D(W.base_,q)))return!0;j(W),T(W)}if(W.copy_[q]===w&&(w!==void 0||(q in W.copy_))||Number.isNaN(w)&&Number.isNaN(W.copy_[q]))return!0;return W.copy_[q]=w,W.assigned_[q]=!0,!0},deleteProperty(W,q){if(_(W.base_,q)!==void 0||q in W.base_)W.assigned_[q]=!1,j(W),T(W);else delete W.assigned_[q];if(W.copy_)delete W.copy_[q];return!0},getOwnPropertyDescriptor(W,q){let w=K(W),$=Reflect.getOwnPropertyDescriptor(w,q);if(!$)return $;return{writable:!0,configurable:W.type_!==1||q!=="length",enumerable:$.enumerable,value:w[q]}},defineProperty(){G(11)},getPrototypeOf(W){return z(W.base_)},setPrototypeOf(){G(12)}},L={};C(d,(W,q)=>{L[W]=function(){return arguments[0]=arguments[0][0],q.apply(this,arguments)}});L.deleteProperty=function(W,q){return L.set.call(this,W,q,void 0)};L.set=function(W,q,w){return d.set.call(this,W[0],q,w,W[0])};function _(W,q){let w=W[Y];return(w?K(w):W)[q]}function BW(W,q,w){let $=s(q,w);return $?"value"in $?$.value:$.get?.call(W.draft_):void 0}function s(W,q){if(!(q in W))return;let w=z(W);while(w){let $=Object.getOwnPropertyDescriptor(w,q);if($)return $;w=z(w)}return}function T(W){if(!W.modified_){if(W.modified_=!0,W.parent_)T(W.parent_)}}function j(W){if(!W.copy_)W.copy_=P(W.base_,W.scope_.immer_.useStrictShallowCopy_)}var KW=class{constructor(W){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(q,w,$)=>{if(typeof q==="function"&&typeof w!=="function"){let Q=w;w=q;let X=this;return function(B=Q,...N){return X.produce(B,($W)=>w.call(this,$W,...N))}}if(typeof w!=="function")G(6);if($!==void 0&&typeof $!=="function")G(7);let J;if(U(q)){let Q=i(this),X=S(q,void 0),Z=!0;try{J=w(X),Z=!1}finally{if(Z)k(Q);else A(Q)}return h(Q,$),u(J,Q)}else if(!q||typeof q!=="object"){if(J=w(q),J===void 0)J=q;if(J===c)J=void 0;if(this.autoFreeze_)g(J,!0);if($){let Q=[],X=[];I("Patches").generateReplacementPatches_(q,J,Q,X),$(Q,X)}return J}else G(1,q)},this.produceWithPatches=(q,w)=>{if(typeof q==="function")return(X,...Z)=>this.produceWithPatches(X,(B)=>q(B,...Z));let $,J;return[this.produce(q,w,(X,Z)=>{$=X,J=Z}),$,J]},typeof W?.autoFreeze==="boolean")this.setAutoFreeze(W.autoFreeze);if(typeof W?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(W.useStrictShallowCopy);if(typeof W?.useStrictIteration==="boolean")this.setUseStrictIteration(W.useStrictIteration)}createDraft(W){if(!U(W))G(8);if(x(W))W=UW(W);let q=i(this),w=S(W,void 0);return w[Y].isManual_=!0,A(q),w}finishDraft(W,q){let w=W&&W[Y];if(!w||!w.isManual_)G(9);let{scope_:$}=w;return h($,q),u(void 0,$)}setAutoFreeze(W){this.autoFreeze_=W}setUseStrictShallowCopy(W){this.useStrictShallowCopy_=W}setUseStrictIteration(W){this.useStrictIteration_=W}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(W,q){let w;for(w=q.length-1;w>=0;w--){let J=q[w];if(J.path.length===0&&J.op==="replace"){W=J.value;break}}if(w>-1)q=q.slice(w+1);let $=I("Patches").applyPatches_;if(x(W))return $(W,q);return this.produce(W,(J)=>$(J,q))}};function S(W,q){let w=M(W)?I("MapSet").proxyMap_(W,q):f(W)?I("MapSet").proxySet_(W,q):HW(W,q);return(q?q.scope_:p()).drafts_.push(w),w}function UW(W){if(!x(W))G(10,W);return a(W)}function a(W){if(!U(W)||E(W))return W;let q=W[Y],w,$=!0;if(q){if(!q.modified_)return q.base_;q.finalized_=!0,w=P(W,q.scope_.immer_.useStrictShallowCopy_),$=q.scope_.immer_.shouldUseStrictIteration()}else w=P(W,!0);if(C(w,(J,Q)=>{r(w,J,a(Q))},$),q)q.finalized_=!1;return w}var IW=new KW,t=IW.produce;var NW=(W)=>(q,w,$)=>{return $.setState=(J,Q,...X)=>{let Z=typeof J==="function"?t(J):J;return q(Z,Q,...X)},W($.setState,w,$)},e=NW;var RW=WW()(qW(e((W,q)=>({members:[],loading:!1,fetchMembers:async(w,$,J)=>{if(!J&&q().loadedTeamId===w&&q().loadedWithAgents===$)return;W({loading:!0});try{let Q=await y.api.teams[":teamId"].members.$get({param:{teamId:w},query:{includeAgents:$?"true":"false"}});if(!Q.ok)throw Error("failed to fetch members");let X=await Q.json();W({members:X||[],loadedTeamId:w,loadedProjectId:void 0,loadedWithAgents:$,loading:!1})}catch{W({loading:!1})}},fetchProjectMembers:async(w,$,J)=>{if(!J&&q().loadedProjectId===w&&q().loadedWithAgents===$)return;W({loading:!0});try{let Q=await y.api.projects[":projectId"].members.$get({param:{projectId:w},query:{includeAgents:$?"true":"false"}});if(!Q.ok)throw Error("failed to fetch project members");let X=await Q.json();W({members:X||[],loadedProjectId:w,loadedTeamId:void 0,loadedWithAgents:$,loading:!1})}catch{W({loading:!1})}}}))));function _W(W,q,w){let $=H(W,w?.in);if(isNaN(q))return b(w?.in||W,NaN);if(!q)return $;let J=$.getDate(),Q=b(w?.in||W,$.getTime());Q.setMonth($.getMonth()+q+1,0);let X=Q.getDate();if(J>=X)return Q;else return $.setFullYear(Q.getFullYear(),Q.getMonth(),J),$}function PW(W,q){let w=H(W,q?.in),$=w.getMonth();return w.setFullYear(w.getFullYear(),$+1,0),w.setHours(23,59,59,999),w}function TW(W,q){return H(W,q?.in).getMonth()}function dW(W,q){return H(W,q?.in).getFullYear()}function vW(W,q){let[w,$]=wW(W,q.start,q.end);return{start:w,end:$}}
2
+ export{_W as xf,PW as yf,vW as zf,TW as Af,dW as Bf,RW as Cf};
@@ -1,2 +1,2 @@
1
- import{Tf as p}from"./chunk-rjr8c8be.js";import{$f as j,bg as F}from"./chunk-g3p6h6sw.js";import{Fh as s,Jh as q,Oh as P,hi as _,ji as f}from"./chunk-sjr6mvgm.js";import{em as l}from"./chunk-2em77vjv.js";var i={x:0.5,y:0.5};class D extends F{apply({activatorEvent:Z,shape:L,transform:E}){if(!L||!(Z instanceof PointerEvent))return E;let M=this.options?.anchor??i,{boundingRectangle:G}=L.initial,Q=G.left+G.width*M.x,J=G.top+G.height*M.y;return{x:E.x+Z.clientX-Q,y:E.y+Z.clientY-J}}static configure=j(D)}var C=l(s(),1);function YO({teamId:Z,projectId:L,assetId:E,folders:M,files:G,selectedIds:Q,onClearSelection:J}){let T=q(),[N,A]=C.useState(void 0),y=(Y,R)=>{let h=["search",Z,E,Y?"folder":"file"],U=T.getQueriesData({queryKey:h}),H=(X)=>{if(typeof X!=="object"||X===null)return!1;let O=X;return"field"in O&&"order"in O&&typeof O.field==="string"&&(O.order==="asc"||O.order==="desc")};for(let[X,O]of U){if(!O||!Array.isArray(O.pages))continue;let z=X.find(H),k=O.pages.flatMap((w)=>w.data??[]),K=k.findIndex((w)=>w.id===R.id);if(K===-1)continue;if(k[K]={...k[K],...R},z?.field==="custom"){let w=z.order==="desc";k.sort((B,x)=>{let $=B.sortIndex??"",b=x.sortIndex??"";if($===b)return 0;if(w)return $<b?1:-1;else return $<b?-1:1})}let V=0,o=O.pages.map((w)=>{let B=w.data?w.data.length:0,x=k.slice(V,V+B);return V+=B,{...w,data:x}});T.setQueryData(X,{...O,pages:o})}},v=f.api.projects[":projectId"].reparent.$post,{mutate:c}=P({mutationFn:async(Y)=>{if(!(await v(Y)).ok)throw Error("Failed to move assets");return null}}),n=f.api.folders[":folderId"].order.$patch,{mutate:u}=P({mutationFn:async(Y)=>{let R=await n(Y);if(!R.ok)throw Error("Failed to reorder folder");return await R.json()}}),m=f.api.files[":fileId"].order.$patch,{mutate:S}=P({mutationFn:async(Y)=>{let R=await m(Y);if(!R.ok)throw Error("Failed to reorder file");return await R.json()}}),I=f.api.shares[":shareId"].assets.$post,{mutate:g}=P({mutationFn:async(Y)=>{let R=await I(Y);if(!R.ok)throw Error("Failed to add asset to share");return await R.json()}});return{dragState:N,handleDragStart:(Y)=>{let R=Y.operation.source;if(!R)return;let W=R.id.split(":").pop(),h=R.data;if(!h)return;let U,H;if(Q.has(W))U=new Set(Q),H=[...M,...G].filter((O)=>Q.has(O.id));else U=new Set([W]),H=[h.item];let X=H.some((O)=>O.type==="folder");A({isActive:!0,draggedIds:U,hasFolders:X,itemCount:U.size})},handleDragEnd:(Y)=>{let{target:R}=Y.operation;if(R&&N){let W=R.id.split(":").pop(),h=R.data;if(h?.type==="chatbot-sidebar"){let X=[...M,...G].filter((O)=>N.draggedIds.has(O.id)).map((O)=>({id:O.id,name:O.name||"Unnamed",type:O.type}));p.getState().addAssets(X),J(),A(void 0);return}if(h?.type==="share-link"){let H=W,X=Array.from(N.draggedIds);g({param:{shareId:H},json:{assetIds:X}},{onSuccess:(O)=>{if(O.addedCount===0)_.info("Assets already exists in share");else _.success(`Added ${O.addedCount} item(s) to share link`);T.invalidateQueries({queryKey:["shares",L]}),J()},onError:(O)=>{_.error(`Failed to add to share: ${O.message}`)}}),A(void 0);return}let U=!1;if(h&&!N.draggedIds.has(W)){if(h.type==="folder"||h.type==="reorder")U=!0;else if(h.type==="file"){if(!N.hasFolders&&N.itemCount===1)U=!0}}if(h?.type==="reorder"){let{position:H,item:X}=h,O=N.hasFolders,z=Array.from(N.draggedIds)[0];if(O)u({param:{folderId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("Folder reordered"),y(!0,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}});else S({param:{fileId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("File reordered"),y(!1,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}})}else if(U)c({param:{projectId:L},json:{assetIds:Array.from(N.draggedIds),newParentId:W}},{onSuccess:()=>{_.success("Assets moved successfully"),T.invalidateQueries({queryKey:["search",Z,E]}),T.invalidateQueries({queryKey:["folders"]}),J()},onError:()=>{_.error("Failed to move assets")}})}A(void 0)}}}
2
- export{D as l,YO as m};
1
+ import{_f as p}from"./chunk-n3vzdzdw.js";import{pg as j,rg as F}from"./chunk-kmhkhcy6.js";import{Ai as f,Fl as _,Yh as s,ai as q,fi as P}from"./chunk-yfgwknpa.js";import{Mm as l}from"./chunk-wwjqqqr4.js";var i={x:0.5,y:0.5};class D extends F{apply({activatorEvent:Z,shape:L,transform:E}){if(!L||!(Z instanceof PointerEvent))return E;let M=this.options?.anchor??i,{boundingRectangle:G}=L.initial,Q=G.left+G.width*M.x,J=G.top+G.height*M.y;return{x:E.x+Z.clientX-Q,y:E.y+Z.clientY-J}}static configure=j(D)}var C=l(s(),1);function YO({teamId:Z,projectId:L,assetId:E,folders:M,files:G,selectedIds:Q,onClearSelection:J}){let T=q(),[N,A]=C.useState(void 0),y=(Y,R)=>{let h=["search",Z,E,Y?"folder":"file"],U=T.getQueriesData({queryKey:h}),H=(X)=>{if(typeof X!=="object"||X===null)return!1;let O=X;return"field"in O&&"order"in O&&typeof O.field==="string"&&(O.order==="asc"||O.order==="desc")};for(let[X,O]of U){if(!O||!Array.isArray(O.pages))continue;let z=X.find(H),k=O.pages.flatMap((w)=>w.data??[]),K=k.findIndex((w)=>w.id===R.id);if(K===-1)continue;if(k[K]={...k[K],...R},z?.field==="custom"){let w=z.order==="desc";k.sort((B,x)=>{let $=B.sortIndex??"",b=x.sortIndex??"";if($===b)return 0;if(w)return $<b?1:-1;else return $<b?-1:1})}let V=0,o=O.pages.map((w)=>{let B=w.data?w.data.length:0,x=k.slice(V,V+B);return V+=B,{...w,data:x}});T.setQueryData(X,{...O,pages:o})}},v=f.api.projects[":projectId"].reparent.$post,{mutate:c}=P({mutationFn:async(Y)=>{if(!(await v(Y)).ok)throw Error("Failed to move assets");return null}}),n=f.api.folders[":folderId"].order.$patch,{mutate:u}=P({mutationFn:async(Y)=>{let R=await n(Y);if(!R.ok)throw Error("Failed to reorder folder");return await R.json()}}),m=f.api.files[":fileId"].order.$patch,{mutate:S}=P({mutationFn:async(Y)=>{let R=await m(Y);if(!R.ok)throw Error("Failed to reorder file");return await R.json()}}),I=f.api.shares[":shareId"].assets.$post,{mutate:g}=P({mutationFn:async(Y)=>{let R=await I(Y);if(!R.ok)throw Error("Failed to add asset to share");return await R.json()}});return{dragState:N,handleDragStart:(Y)=>{let R=Y.operation.source;if(!R)return;let W=R.id.split(":").pop(),h=R.data;if(!h)return;let U,H;if(Q.has(W))U=new Set(Q),H=[...M,...G].filter((O)=>Q.has(O.id));else U=new Set([W]),H=[h.item];let X=H.some((O)=>O.type==="folder");A({isActive:!0,draggedIds:U,hasFolders:X,itemCount:U.size})},handleDragEnd:(Y)=>{let{target:R}=Y.operation;if(R&&N){let W=R.id.split(":").pop(),h=R.data;if(h?.type==="chatbot-sidebar"){let X=[...M,...G].filter((O)=>N.draggedIds.has(O.id)).map((O)=>({id:O.id,name:O.name||"Unnamed",type:O.type}));p.getState().addAssets(X),J(),A(void 0);return}if(h?.type==="share-link"){let H=W,X=Array.from(N.draggedIds);g({param:{shareId:H},json:{assetIds:X}},{onSuccess:(O)=>{if(O.addedCount===0)_.info("Assets already exists in share");else _.success(`Added ${O.addedCount} item(s) to share link`);T.invalidateQueries({queryKey:["shares",L]}),J()},onError:(O)=>{_.error(`Failed to add to share: ${O.message}`)}}),A(void 0);return}let U=!1;if(h&&!N.draggedIds.has(W)){if(h.type==="folder"||h.type==="reorder")U=!0;else if(h.type==="file"){if(!N.hasFolders&&N.itemCount===1)U=!0}}if(h?.type==="reorder"){let{position:H,item:X}=h,O=N.hasFolders,z=Array.from(N.draggedIds)[0];if(O)u({param:{folderId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("Folder reordered"),y(!0,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}});else S({param:{fileId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("File reordered"),y(!1,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}})}else if(U)c({param:{projectId:L},json:{assetIds:Array.from(N.draggedIds),newParentId:W}},{onSuccess:()=>{_.success("Assets moved successfully"),T.invalidateQueries({queryKey:["search",Z,E]}),T.invalidateQueries({queryKey:["folders"]}),J()},onError:()=>{_.error("Failed to move assets")}})}A(void 0)}}}
2
+ export{D as o,YO as p};