@shumai-one/shumai 0.3.3 → 0.3.4

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 (135) hide show
  1. package/bin/{chunk-0dcv6kpk.js → chunk-03pw611p.js} +2 -2
  2. package/bin/{chunk-p8enen2a.js → chunk-05m8w09t.js} +1 -1
  3. package/bin/chunk-0ark0qrm.js +1 -0
  4. package/bin/{chunk-rt0pvhdf.js → chunk-1apsnd7e.js} +1 -1
  5. package/bin/{chunk-9vgjhemh.js → chunk-1bfrnc6b.js} +1 -1
  6. package/bin/{chunk-25qj10ny.js → chunk-21h9kgp5.js} +1 -1
  7. package/bin/{chunk-am1m29pv.js → chunk-2967rnmn.js} +1 -1
  8. package/bin/{chunk-7436fyrg.js → chunk-2errtbmb.js} +1 -1
  9. package/bin/{chunk-gh4w2bdg.js → chunk-2jnyk045.js} +1 -1
  10. package/bin/{chunk-xcbb21j9.js → chunk-2mr99scd.js} +2 -2
  11. package/bin/chunk-2pxev94x.js +2 -0
  12. package/bin/{chunk-p86w1eaw.js → chunk-2y9t0qxp.js} +1 -1
  13. package/bin/{chunk-7pjes19z.js → chunk-2ydhnafa.js} +2 -2
  14. package/bin/{chunk-m268vcdm.js → chunk-38hp9gfh.js} +2 -2
  15. package/bin/chunk-3t7v2de9.js +307 -0
  16. package/bin/{chunk-yj6tmjsc.js → chunk-3vbx3x11.js} +2 -2
  17. package/bin/chunk-3xfhbvar.js +2 -0
  18. package/bin/{chunk-9e99n265.js → chunk-4153rke8.js} +2 -2
  19. package/bin/{chunk-xn9cpax1.js → chunk-4a185tez.js} +3 -3
  20. package/bin/{chunk-3g9g2c7h.js → chunk-4rexdetz.js} +3 -3
  21. package/bin/{chunk-9zvteyz0.js → chunk-58y9bagr.js} +2 -2
  22. package/bin/{chunk-hz6s7by4.js → chunk-5dqn7egd.js} +1 -1
  23. package/bin/{chunk-7anqxx1z.js → chunk-5e48saab.js} +1 -1
  24. package/bin/{chunk-g097058z.js → chunk-5qwzveck.js} +2 -2
  25. package/bin/chunk-61hfhfce.js +2 -0
  26. package/bin/{chunk-mhwp74hh.js → chunk-6ab9eftx.js} +1 -1
  27. package/bin/{chunk-3gcnj1eq.js → chunk-6b0f3d07.js} +2 -2
  28. package/bin/{chunk-p1bcbtmg.js → chunk-6gjn8trh.js} +1 -1
  29. package/bin/{chunk-2fc5hk8r.js → chunk-75x3w5hx.js} +1 -1
  30. package/bin/chunk-7e39zmss.js +1 -0
  31. package/bin/chunk-7h1m1e0b.js +1 -0
  32. package/bin/{chunk-va6hxm7n.js → chunk-7kdz1eng.js} +2 -2
  33. package/bin/chunk-7pcba64w.js +1 -0
  34. package/bin/{chunk-749c09cw.js → chunk-7xfx7741.js} +1 -1
  35. package/bin/{chunk-gpeyctxd.js → chunk-898hrxwq.js} +2 -2
  36. package/bin/{chunk-pqxh0cg7.js → chunk-89chaa11.js} +2 -2
  37. package/bin/chunk-8btfb5g6.js +2 -0
  38. package/bin/{chunk-5cm4vge8.js → chunk-8pa1n500.js} +2 -2
  39. package/bin/{chunk-m6sssvg3.js → chunk-8qe7cpbr.js} +1 -1
  40. package/bin/{chunk-t15a1vp6.js → chunk-8tnq43k9.js} +1 -1
  41. package/bin/{chunk-h4a3ms2b.js → chunk-8wzepzp3.js} +2 -2
  42. package/bin/{chunk-c7rj0f5r.js → chunk-9deae0n7.js} +1 -1
  43. package/bin/{chunk-tc7q988r.js → chunk-ankkm2wz.js} +2 -2
  44. package/bin/{chunk-yedr4r8a.js → chunk-ardp3pze.js} +1 -1
  45. package/bin/{chunk-tzmzqmcg.js → chunk-axe5rq99.js} +1 -1
  46. package/bin/{chunk-mggfc9ya.js → chunk-bagxeg82.js} +2 -2
  47. package/bin/{chunk-bw6wyw7k.js → chunk-bhqrqt97.js} +2 -2
  48. package/bin/{chunk-zgsy3k3h.js → chunk-bn1sts8x.js} +1 -1
  49. package/bin/{chunk-5vwkfxy7.js → chunk-bpb0szs5.js} +2 -2
  50. package/bin/{chunk-9a7a1p1j.js → chunk-c1j58ekb.js} +2 -2
  51. package/bin/{chunk-qx2mzv89.js → chunk-c4nenmry.js} +1 -1
  52. package/bin/{chunk-cdqvg03f.js → chunk-c9f6n4sf.js} +1 -1
  53. package/bin/chunk-cwh21vfb.js +2 -0
  54. package/bin/{chunk-8a75zqbz.js → chunk-cwpmf8tx.js} +2 -2
  55. package/bin/{chunk-vg6mkdj1.js → chunk-d2xrh0vv.js} +2 -2
  56. package/bin/{chunk-9g6vy76b.js → chunk-d4sg0z3y.js} +2 -2
  57. package/bin/{chunk-4g7h9qhr.js → chunk-d4sjezbk.js} +1 -1
  58. package/bin/{chunk-mm810jv7.js → chunk-ddfx823h.js} +2 -2
  59. package/bin/chunk-dtjx1097.js +2 -0
  60. package/bin/chunk-e32bzfza.js +1 -0
  61. package/bin/{chunk-qshm5vcn.js → chunk-e6rmqgzv.js} +1 -1
  62. package/bin/chunk-ersxsrz8.js +62 -0
  63. package/bin/{chunk-vf3bg920.js → chunk-gg1wfpm8.js} +2 -2
  64. package/bin/{chunk-2jvqhps9.js → chunk-gg8dmkwd.js} +2 -2
  65. package/bin/chunk-gnx9g8px.js +2 -0
  66. package/bin/{chunk-bd6x5ns9.js → chunk-h0k9zw29.js} +2 -2
  67. package/bin/chunk-htrzgs2a.css +1 -0
  68. package/bin/{chunk-41m51y08.js → chunk-j2jdrmaa.js} +1 -1
  69. package/bin/{chunk-gpmaaca1.js → chunk-j5dejr3e.js} +2 -2
  70. package/bin/{chunk-9sdhdhv4.js → chunk-j5q3t199.js} +2 -2
  71. package/bin/{chunk-67rr836p.js → chunk-jgxhv36z.js} +1 -1
  72. package/bin/{chunk-0a0sdyta.js → chunk-jnx8p6kj.js} +1 -1
  73. package/bin/{chunk-q8me9zev.js → chunk-k41vt2gq.js} +1 -1
  74. package/bin/{chunk-wpntb95k.js → chunk-k78m3rar.js} +2 -2
  75. package/bin/{chunk-gaemak59.js → chunk-kfbztymc.js} +2 -2
  76. package/bin/{chunk-ts9f4zqh.js → chunk-kgr3ytpb.js} +2 -2
  77. package/bin/{chunk-yfkcv10v.js → chunk-khc3dydj.js} +1 -1
  78. package/bin/chunk-krpr6g8a.js +1 -0
  79. package/bin/{chunk-pdajhyqm.js → chunk-m8tnsds1.js} +2 -2
  80. package/bin/chunk-mfmcsdd7.js +1 -0
  81. package/bin/chunk-msjv1ykh.js +2 -0
  82. package/bin/{chunk-1rsp4hc5.js → chunk-n73dbqps.js} +1 -1
  83. package/bin/{chunk-xsw3pb5p.js → chunk-n7cmya8k.js} +2 -2
  84. package/bin/{chunk-x0r8dcq0.js → chunk-nabagpah.js} +2 -2
  85. package/bin/{chunk-h73653yp.js → chunk-nn5qpr0q.js} +1 -1
  86. package/bin/{chunk-3823qzr0.js → chunk-pew69nxg.js} +2 -2
  87. package/bin/{chunk-2475z7vk.js → chunk-q2shr586.js} +1 -1
  88. package/bin/chunk-q7v8sj72.js +1 -0
  89. package/bin/{chunk-jkh04dka.js → chunk-q9tm2d21.js} +1 -1
  90. package/bin/{chunk-xgb533n0.js → chunk-qw5yjhab.js} +3 -3
  91. package/bin/{chunk-wkth5xwr.js → chunk-r9thyg31.js} +2 -2
  92. package/bin/{chunk-57kgmgfs.js → chunk-s584wxzj.js} +2 -2
  93. package/bin/{chunk-bn4ewsy8.js → chunk-s5s1rk4n.js} +1 -1
  94. package/bin/{chunk-d3kpqay2.js → chunk-scfbmsy7.js} +2 -2
  95. package/bin/{chunk-525eypdk.js → chunk-sddrv3ep.js} +1 -1
  96. package/bin/{chunk-r5jmnsqj.js → chunk-sfmhbk59.js} +1 -1
  97. package/bin/{chunk-6jgq154r.js → chunk-tbdgkpgw.js} +1 -1
  98. package/bin/chunk-twhj7h73.js +1 -0
  99. package/bin/{chunk-wtzkfwmx.js → chunk-v5zdafv4.js} +2 -2
  100. package/bin/{chunk-v75fanse.js → chunk-vzx1r87y.js} +2 -2
  101. package/bin/{chunk-g224r7mc.js → chunk-w3xzd86e.js} +2 -2
  102. package/bin/{chunk-fwqpq2sy.js → chunk-xkh6b42h.js} +1 -1
  103. package/bin/chunk-yn7mxpmb.js +7 -0
  104. package/bin/{chunk-ey7vty63.js → chunk-z544s59c.js} +2 -2
  105. package/bin/{chunk-7x7jtkh8.js → chunk-zned6mj8.js} +1 -1
  106. package/bin/{chunk-v0yhkcj5.js → chunk-zpq34g0w.js} +2 -2
  107. package/bin/shumai-app.html +1 -1
  108. package/bin/shumai-app.js +498 -412
  109. package/package.json +7 -7
  110. package/prisma/migrations/20260806082136_add_sharelink_watermark/migration.sql +69 -0
  111. package/prisma/migrations/20260806085643_add_watermark_file_status/migration.sql +7 -0
  112. package/prisma/migrations/20260807140837_clean_media_remove_raw_transcodes_and_original_download_url/migration.sql +86 -0
  113. package/prisma/migrations/20260808014542_add_sharelink_allow_download/migration.sql +2 -0
  114. package/prisma/schema.prisma +68 -0
  115. package/bin/chunk-1cjgpspz.js +0 -2
  116. package/bin/chunk-1pgtq4rc.js +0 -2
  117. package/bin/chunk-4v5ykazp.js +0 -1
  118. package/bin/chunk-5x3vzer8.js +0 -1
  119. package/bin/chunk-804ndet8.js +0 -2
  120. package/bin/chunk-a8daqpfh.js +0 -7
  121. package/bin/chunk-c0c88nje.js +0 -307
  122. package/bin/chunk-d6v81kjj.js +0 -1
  123. package/bin/chunk-dfcrtdk2.js +0 -1
  124. package/bin/chunk-eczsk2xd.js +0 -62
  125. package/bin/chunk-g5e93f59.js +0 -2
  126. package/bin/chunk-g5xkj9p3.js +0 -2
  127. package/bin/chunk-hp139z0j.js +0 -2
  128. package/bin/chunk-j4y8c864.js +0 -1
  129. package/bin/chunk-pbb1tdwt.js +0 -1
  130. package/bin/chunk-pbfkw90e.js +0 -1
  131. package/bin/chunk-s10v4b01.css +0 -1
  132. package/bin/chunk-s1b5kf34.js +0 -2
  133. package/bin/chunk-v0xbr5e6.js +0 -2
  134. package/bin/chunk-yfjn4qn2.js +0 -1
  135. package/bin/chunk-z9560a6e.js +0 -1
@@ -1,3 +1,3 @@
1
- import{Fg as _,Wg as u,Xg as F,ah as H,ch as U,yg as m}from"./chunk-eczsk2xd.js";import{Fk as E}from"./chunk-t15a1vp6.js";var V=null,r=F((p)=>({projectState:null,setProjectState:(c)=>{if(V)clearTimeout(V),V=null;p({projectState:c})},clearProjectState:()=>{if(V)clearTimeout(V);V=setTimeout(()=>{p({projectState:null}),V=null},10)}}));var v="shumai_selected_agent_id",R=()=>{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(v);return null},X=F((p)=>({isChatbotOpen:!1,setIsChatbotOpen:(c)=>p({isChatbotOpen:c}),isHistoryMode:!1,setIsHistoryMode:(c)=>p({isHistoryMode:c}),currentSessionId:null,setCurrentSessionId:(c)=>p({currentSessionId:c}),chatAssets:[],addAssets:(c)=>p((j)=>{let f=new Set(j.chatAssets.map(($)=>$.id)),q=c.filter(($)=>!f.has($.id));return{chatAssets:[...j.chatAssets,...q]}}),removeAsset:(c)=>p((j)=>({chatAssets:j.chatAssets.filter((f)=>f.id!==c)})),clearAssets:()=>p({chatAssets:[]}),messages:[],setMessages:(c)=>p({messages:c}),historySessions:[],setHistorySessions:(c)=>p({historySessions:c}),isStreaming:!1,setIsStreaming:(c)=>p({isStreaming:c}),selectedAgentId:R(),setSelectedAgentId:(c)=>{if(typeof window<"u"&&window.localStorage)if(c)localStorage.setItem(v,c);else localStorage.removeItem(v);p({selectedAgentId:c})},inputText:"",setInputText:(c)=>p({inputText:c}),scrollTop:0,isAtBottom:!0,setScrollState:(c,j)=>p({scrollTop:c,isAtBottom:j}),fetchHistorySessions:async(c)=>{try{let j=await U.api.teams[":teamId"].chat.sessions.$get({param:{teamId:c},query:{first:"50"}});if(j.ok){let f=await j.json();p({historySessions:f.data||[]})}}catch(j){console.error("Failed to fetch history sessions:",j)}},loadSession:async(c,j)=>{try{let f=await U.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:c,sessionId:j}});if(f.ok){let q=await f.json(),Q=X.getState().historySessions.find((Z)=>Z.id===j)?.agentId||null;p({currentSessionId:j,messages:q,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...Q?{selectedAgentId:Q}:{}})}else throw Error("Failed to load session messages")}catch(f){let q=f instanceof Error?f.message:"Failed to load session";H.error(q)}},deleteSession:async(c,j)=>{try{if((await U.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:c,sessionId:j}})).ok)H.success("Session deleted successfully"),p((q)=>({historySessions:q.historySessions.filter(($)=>$.id!==j),currentSessionId:q.currentSessionId===j?null:q.currentSessionId,messages:q.currentSessionId===j?[]:q.messages}));else throw Error("Failed to delete session")}catch(f){let q=f instanceof Error?f.message:"Failed to delete session";H.error(q)}},startNewSession:()=>{let c=R();p({currentSessionId:null,messages:[],chatAssets:[],inputText:"",scrollTop:0,isAtBottom:!0,...c?{selectedAgentId:c}:{}})},sendMessage:async(c,j,f,q,$)=>{let Q=X.getState();if(Q.isStreaming)return;let Z=`temp-${Date.now()}`,y={id:Z,role:"user",content:[{type:"text",text:j}],timestamp:Date.now()},z=[...Q.messages];if(Q.chatAssets.length>0){let W={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:Q.chatAssets.map((J)=>({id:J.id,name:J.name,type:J.type}))},timestamp:Date.now()-1};z.push(W)}z.push(y),p({messages:z,isStreaming:!0,chatAssets:[],isAtBottom:!0});let b=Q.chatAssets.map((w)=>w.id),G=Q.selectedAgentId;if(!G){H.error("No agent selected");return}try{let w=await U.api.teams[":teamId"].chat.$post({param:{teamId:c},json:{agentId:G,textPrompt:j,assetIds:b,sessionId:Q.currentSessionId||void 0,contextAssetId:q,projectId:f}});if(!w.ok)throw Error("Failed to start chat");let W=w.headers.get("x-session-id");if(W&&!Q.currentSessionId)p({currentSessionId:W});let J=w.body?.getReader();if(!J)throw Error("No stream body");let B=new TextDecoder,K="";while(!0){let{done:S,value:x}=await J.read();if(S)break;K+=B.decode(x,{stream:!0});let N=K.split(`
1
+ import{Gg as _,Xg as u,Yg as F,bh as H,dh as U,zg as m}from"./chunk-ersxsrz8.js";import{Jk as E}from"./chunk-8tnq43k9.js";var V=null,r=F((p)=>({projectState:null,setProjectState:(c)=>{if(V)clearTimeout(V),V=null;p({projectState:c})},clearProjectState:()=>{if(V)clearTimeout(V);V=setTimeout(()=>{p({projectState:null}),V=null},10)}}));var v="shumai_selected_agent_id",R=()=>{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(v);return null},X=F((p)=>({isChatbotOpen:!1,setIsChatbotOpen:(c)=>p({isChatbotOpen:c}),isHistoryMode:!1,setIsHistoryMode:(c)=>p({isHistoryMode:c}),currentSessionId:null,setCurrentSessionId:(c)=>p({currentSessionId:c}),chatAssets:[],addAssets:(c)=>p((j)=>{let f=new Set(j.chatAssets.map(($)=>$.id)),q=c.filter(($)=>!f.has($.id));return{chatAssets:[...j.chatAssets,...q]}}),removeAsset:(c)=>p((j)=>({chatAssets:j.chatAssets.filter((f)=>f.id!==c)})),clearAssets:()=>p({chatAssets:[]}),messages:[],setMessages:(c)=>p({messages:c}),historySessions:[],setHistorySessions:(c)=>p({historySessions:c}),isStreaming:!1,setIsStreaming:(c)=>p({isStreaming:c}),selectedAgentId:R(),setSelectedAgentId:(c)=>{if(typeof window<"u"&&window.localStorage)if(c)localStorage.setItem(v,c);else localStorage.removeItem(v);p({selectedAgentId:c})},inputText:"",setInputText:(c)=>p({inputText:c}),scrollTop:0,isAtBottom:!0,setScrollState:(c,j)=>p({scrollTop:c,isAtBottom:j}),fetchHistorySessions:async(c)=>{try{let j=await U.api.teams[":teamId"].chat.sessions.$get({param:{teamId:c},query:{first:"50"}});if(j.ok){let f=await j.json();p({historySessions:f.data||[]})}}catch(j){console.error("Failed to fetch history sessions:",j)}},loadSession:async(c,j)=>{try{let f=await U.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:c,sessionId:j}});if(f.ok){let q=await f.json(),Q=X.getState().historySessions.find((Z)=>Z.id===j)?.agentId||null;p({currentSessionId:j,messages:q,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...Q?{selectedAgentId:Q}:{}})}else throw Error("Failed to load session messages")}catch(f){let q=f instanceof Error?f.message:"Failed to load session";H.error(q)}},deleteSession:async(c,j)=>{try{if((await U.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:c,sessionId:j}})).ok)H.success("Session deleted successfully"),p((q)=>({historySessions:q.historySessions.filter(($)=>$.id!==j),currentSessionId:q.currentSessionId===j?null:q.currentSessionId,messages:q.currentSessionId===j?[]:q.messages}));else throw Error("Failed to delete session")}catch(f){let q=f instanceof Error?f.message:"Failed to delete session";H.error(q)}},startNewSession:()=>{let c=R();p({currentSessionId:null,messages:[],chatAssets:[],inputText:"",scrollTop:0,isAtBottom:!0,...c?{selectedAgentId:c}:{}})},sendMessage:async(c,j,f,q,$)=>{let Q=X.getState();if(Q.isStreaming)return;let Z=`temp-${Date.now()}`,y={id:Z,role:"user",content:[{type:"text",text:j}],timestamp:Date.now()},z=[...Q.messages];if(Q.chatAssets.length>0){let W={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:Q.chatAssets.map((J)=>({id:J.id,name:J.name,type:J.type}))},timestamp:Date.now()-1};z.push(W)}z.push(y),p({messages:z,isStreaming:!0,chatAssets:[],isAtBottom:!0});let b=Q.chatAssets.map((w)=>w.id),G=Q.selectedAgentId;if(!G){H.error("No agent selected");return}try{let w=await U.api.teams[":teamId"].chat.$post({param:{teamId:c},json:{agentId:G,textPrompt:j,assetIds:b,sessionId:Q.currentSessionId||void 0,contextAssetId:q,projectId:f}});if(!w.ok)throw Error("Failed to start chat");let W=w.headers.get("x-session-id");if(W&&!Q.currentSessionId)p({currentSessionId:W});let J=w.body?.getReader();if(!J)throw Error("No stream body");let B=new TextDecoder,K="";while(!0){let{done:S,value:x}=await J.read();if(S)break;K+=B.decode(x,{stream:!0});let N=K.split(`
2
2
  `);K=N.pop()||"";for(let l of N){let Y=l.trim();if(!Y)continue;if(Y.startsWith("data: ")){let A=Y.slice(6);try{let D=JSON.parse(A);if(D.type==="session"){if(!X.getState().currentSessionId)p({currentSessionId:D.sessionId})}else if(D.type==="entry"){let L=D.entry,h=L;if(h.role==="toolResult"&&typeof h.toolName==="string"&&["create_file","create_folder","create_version"].includes(h.toolName)&&!h.isError)$?.();p((O)=>{let C=O.messages.some((k)=>k.id===L.id),T=O.messages.filter((k)=>{if(L.role==="user"&&!C)return!(k.id.startsWith("temp-")&&!k.id.startsWith("temp-context-"));if(L.role==="custom"&&L.customType==="context_display_info"&&!C)return!k.id.startsWith("temp-context-");return!0}),M=T.findIndex((k)=>k.id===L.id);if(M!==-1){let k=[...T];return k[M]=L,{messages:k}}else return{messages:[...T,L]}})}else if(D.type==="done"){if(D.status==="failed")H.error(D.error||"Workflow failed")}}catch(D){console.error("Error parsing SSE line:",D)}}}}X.getState().fetchHistorySessions(c)}catch(w){let W=w instanceof Error?w.message:"Failed to send message";H.error(W),p((J)=>({messages:J.messages.filter((B)=>B.id!==Z)}))}finally{p({isStreaming:!1})}},abortActiveSession:async(c)=>{let{currentSessionId:j,isStreaming:f}=X.getState();if(!j||!f)return;try{if((await U.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:c,sessionId:j}})).ok)H.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(q){let $=q instanceof Error?q.message:"Failed to abort execution";H.error($)}}}));var P=E(m(),1);function g(p){let c=p.match(/teams\/([^/]+)/);if(c)return{teamId:c[1]};let j=p.match(/projects\/([^/]+)/);if(j)return{projectId:j[1]};return{}}function jc(){let[p,c]=P.useState(),j=u({select:(Q)=>Q.location.pathname}),{teamId:f,projectId:q}=g(j),{data:$}=_({queryKey:["projects",q,"team"],queryFn:async()=>{let Q=await U.api.projects[":projectId"].team.$get({param:{projectId:q}});if(!Q.ok)throw Error("failed to fetch project team");return await Q.json()},enabled:!!q});return P.useEffect(()=>{if(f)c(f);else if($?.teamId)c($.teamId)},[f,$]),p}
3
- export{jc as qf,r as rf,X as sf};
3
+ export{jc as rf,r as sf,X as tf};
@@ -1,2 +1,2 @@
1
- import{Xg as F,ch as B}from"./chunk-eczsk2xd.js";var J=F((w,D)=>({metadata:{},isLoading:!1,error:null,fetchMetadata:async(A)=>{w({isLoading:!0,error:null});try{let h=await B.api.teams[":teamId"]["user-metadata"].$get({param:{teamId:A}});if(!h.ok)throw Error("failed to fetch user metadata");let C=(await h.json()).reduce((j,E)=>{return j[E.key]=E.value,j},{});w({metadata:C,isLoading:!1})}catch(h){w({error:h instanceof Error?h.message:String(h),isLoading:!1})}},setMetadata:async(A,h,q)=>{let C=D().metadata;w((j)=>({metadata:{...j.metadata,[h]:q}}));try{if(!(await B.api.teams[":teamId"]["user-metadata"][":key"].$put({param:{teamId:A,key:h},json:{value:q}})).ok)throw Error("failed to update user metadata")}catch(j){w({metadata:C}),console.error(j)}},getMetadata:(A,h)=>{let q=D().metadata[A];return q!==void 0?q:h}}));
2
- export{J as bg};
1
+ import{Yg as F,dh as B}from"./chunk-ersxsrz8.js";var J=F((w,D)=>({metadata:{},isLoading:!1,error:null,fetchMetadata:async(A)=>{w({isLoading:!0,error:null});try{let h=await B.api.teams[":teamId"]["user-metadata"].$get({param:{teamId:A}});if(!h.ok)throw Error("failed to fetch user metadata");let C=(await h.json()).reduce((j,E)=>{return j[E.key]=E.value,j},{});w({metadata:C,isLoading:!1})}catch(h){w({error:h instanceof Error?h.message:String(h),isLoading:!1})}},setMetadata:async(A,h,q)=>{let C=D().metadata;w((j)=>({metadata:{...j.metadata,[h]:q}}));try{if(!(await B.api.teams[":teamId"]["user-metadata"][":key"].$put({param:{teamId:A,key:h},json:{value:q}})).ok)throw Error("failed to update user metadata")}catch(j){w({metadata:C}),console.error(j)}},getMetadata:(A,h)=>{let q=D().metadata[A];return q!==void 0?q:h}}));
2
+ export{J as cg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Xb as e,Yb as p,Zb as t}from"./chunk-qw5yjhab.js";import"./chunk-8pa1n500.js";import"./chunk-8wzepzp3.js";import"./chunk-zned6mj8.js";import"./chunk-4a185tez.js";import"./chunk-58y9bagr.js";import"./chunk-8tnq43k9.js";export{t as kyselyAdapter,e as getKyselyDatabaseType,p as createKyselyAdapter};
@@ -1,2 +1,2 @@
1
- import{Ne as A}from"./chunk-3823qzr0.js";import{Ag as v,Rg as w,ch as z}from"./chunk-eczsk2xd.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")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
- export{B as Ie,H as Je};
1
+ import{Oe as A}from"./chunk-pew69nxg.js";import{Bg as v,Sg as w,dh as z}from"./chunk-ersxsrz8.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")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
+ export{B as Je,H as Ke};