@shumai-one/shumai 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/chunk-01052ssf.js +32 -0
- package/bin/{chunk-w4ydfy9d.js → chunk-02fvcrej.js} +4 -4
- package/bin/chunk-0bj887zm.js +2 -0
- package/bin/chunk-167z646e.js +2 -0
- package/bin/chunk-1ktk6764.js +10 -0
- package/bin/{chunk-p1ed0pa6.js → chunk-1nvd90g2.js} +1 -1
- package/bin/{chunk-kywdke0y.js → chunk-1wfg56z3.js} +5 -5
- package/bin/{chunk-ahgq10a7.js → chunk-257dcd2f.js} +2 -2
- package/bin/chunk-26qn7fek.js +2 -0
- package/bin/chunk-2cdxm1cp.js +55 -0
- package/bin/chunk-2jj4j8cn.js +3 -0
- package/bin/chunk-2ne2b54t.js +2 -0
- package/bin/{chunk-qqj2m1b1.js → chunk-2nhgdqdg.js} +2 -2
- package/bin/chunk-2vbeqczj.js +1 -0
- package/bin/chunk-37p6bcx2.js +1 -0
- package/bin/chunk-3ckkwdjx.js +13 -0
- package/bin/chunk-3knfx6dm.js +1 -0
- package/bin/chunk-3z85zxkn.js +1 -0
- package/bin/chunk-4mws03es.js +5 -0
- package/bin/chunk-54tbfvya.js +2 -0
- package/bin/chunk-55h9ze53.js +2 -0
- package/bin/chunk-56kh5fxc.js +1 -0
- package/bin/chunk-576nj64j.js +2 -0
- package/bin/{chunk-dfecgpce.js → chunk-5wapd171.js} +13 -13
- package/bin/chunk-6cnqjngz.js +1 -0
- package/bin/chunk-73yncv54.js +2 -0
- package/bin/chunk-7g46e1wy.js +3 -0
- package/bin/{chunk-jq3pq545.js → chunk-7naa7tpn.js} +2 -2
- package/bin/{chunk-am6dg0a5.js → chunk-7sgrtxbt.js} +2 -2
- package/bin/{chunk-3me1v3z5.js → chunk-7v7mypc6.js} +2 -2
- package/bin/chunk-82tps5n1.js +2 -0
- package/bin/chunk-84x8p7v5.js +1 -0
- package/bin/{chunk-fxtzy5f5.js → chunk-88jg9dq5.js} +2 -2
- package/bin/chunk-8cjet7pp.js +12 -0
- package/bin/chunk-8fyg9dy4.js +2 -0
- package/bin/chunk-8gtfgkrn.js +2 -0
- package/bin/chunk-8mqbztj8.js +2 -0
- package/bin/chunk-8xb6yz11.js +2 -0
- package/bin/chunk-8yjsmr7g.js +2 -0
- package/bin/chunk-91rb0jpb.js +2 -0
- package/bin/chunk-96qpjght.js +2 -0
- package/bin/chunk-9f1xk1nt.js +1 -0
- package/bin/chunk-9mk9cvbk.js +1 -0
- package/bin/{chunk-r5g84kj4.js → chunk-9n1w5dw1.js} +3 -3
- package/bin/chunk-9nw5w8vh.js +1 -0
- package/bin/{chunk-3j82q2gj.js → chunk-9t3p4xp6.js} +1 -1
- package/bin/chunk-9xhjy897.js +11 -0
- package/bin/chunk-9zsv6d2f.js +1 -0
- package/bin/chunk-a411xhmm.js +7 -0
- package/bin/{chunk-s01p4w8d.js → chunk-a74g6h8a.js} +2 -2
- package/bin/chunk-ah8fjb6f.js +2 -0
- package/bin/chunk-atfz7g7e.js +2 -0
- package/bin/{chunk-swz6v48q.js → chunk-b5rhvzv9.js} +2 -2
- package/bin/{chunk-bg6waaf9.js → chunk-b7bnp021.js} +2 -2
- package/bin/chunk-cf5axr8c.js +1 -0
- package/bin/chunk-cgmebxx6.js +2 -0
- package/bin/chunk-cwat1jwx.js +3 -0
- package/bin/chunk-cz13a82m.js +3 -0
- package/bin/chunk-dk42gf7v.js +2 -0
- package/bin/chunk-e4f56spj.js +4 -0
- package/bin/chunk-e4yscwen.js +18 -0
- package/bin/chunk-eb7mzbfm.js +1 -0
- package/bin/chunk-er14d498.js +3 -0
- package/bin/{chunk-bs6saf4d.js → chunk-eyjfhdp9.js} +2 -2
- package/bin/chunk-f25fe9th.js +393 -0
- package/bin/chunk-f6avg5qe.js +129 -0
- package/bin/chunk-fatmqnp1.js +2 -0
- package/bin/chunk-fvx9k1dc.js +2 -0
- package/bin/{chunk-h6f2gyt5.js → chunk-g22wmpk1.js} +2 -2
- package/bin/chunk-g6sdezec.js +2 -0
- package/bin/chunk-gtf19jc1.js +2 -0
- package/bin/chunk-gxepkvt2.js +2 -0
- package/bin/chunk-h1n7jqnw.js +1 -0
- package/bin/chunk-hfm82066.js +2 -0
- package/bin/chunk-hnkcgvcj.js +3 -0
- package/bin/{chunk-agcnbjxk.js → chunk-hpbn0k9n.js} +2 -2
- package/bin/{chunk-d4hk62q2.js → chunk-hpwv4am3.js} +4 -4
- package/bin/{chunk-acmr8v0d.js → chunk-hw6czrya.js} +1 -1
- package/bin/{chunk-r9gp9yqw.js → chunk-hzkjgcre.js} +1 -1
- package/bin/chunk-j2s311yc.js +3 -0
- package/bin/{chunk-6hzktewz.js → chunk-jt02kpfc.js} +2 -2
- package/bin/{chunk-c60j1b4w.js → chunk-jt0ykktx.js} +1 -1
- package/bin/{chunk-sd6w0z6a.js → chunk-jzgbxqdg.js} +2 -2
- package/bin/chunk-kj6h5j5a.js +4 -0
- package/bin/chunk-km4gn6b6.js +1 -0
- package/bin/chunk-knj2s8mg.js +16 -0
- package/bin/{chunk-1eqw2dpx.js → chunk-kvhf12b4.js} +2 -2
- package/bin/chunk-m0q2cgfg.js +2 -0
- package/bin/chunk-m82tkhaa.js +11 -0
- package/bin/chunk-m9adtgzk.js +2 -0
- package/bin/{chunk-0tvnfy4k.js → chunk-mcj1xpcc.js} +2 -2
- package/bin/chunk-mcw198kg.js +13 -0
- package/bin/{chunk-9s0k533c.js → chunk-mwktrwtx.js} +1 -1
- package/bin/{chunk-wsprap60.js → chunk-mzsw9var.js} +2 -2
- package/bin/chunk-ns33grgx.js +2 -0
- package/bin/{chunk-xsfy8hz3.js → chunk-ny1kbmxt.js} +2 -2
- package/bin/{chunk-16n160h1.js → chunk-p3f5aevs.js} +1 -1
- package/bin/chunk-p3j6ydk1.js +1 -0
- package/bin/chunk-p4s95471.js +2 -0
- package/bin/chunk-pk406dgy.js +2 -0
- package/bin/chunk-q2bew2vc.js +2 -0
- package/bin/chunk-q5vkxee3.js +5 -0
- package/bin/{chunk-hzv1mhr5.js → chunk-q83h0hkx.js} +2 -2
- package/bin/{chunk-fre31bhw.js → chunk-q8w4mbw4.js} +2 -2
- package/bin/{chunk-b7qs7hxg.js → chunk-qwpkcp8d.js} +2 -2
- package/bin/chunk-r1xer8gn.js +5 -0
- package/bin/chunk-s1e4qy3q.js +14 -0
- package/bin/{chunk-b9d8xdhb.js → chunk-s9ksftq2.js} +1 -1
- package/bin/chunk-srxp5jav.js +42 -0
- package/bin/chunk-swtwaaqe.js +1 -0
- package/bin/chunk-tagdrg7p.js +1 -0
- package/bin/{chunk-d18v5vmp.js → chunk-tekwpkjf.js} +2 -2
- package/bin/chunk-twtxnzbv.js +2 -0
- package/bin/{chunk-c6f8x05m.js → chunk-v05rrxp5.js} +2 -2
- package/bin/{chunk-ht5rht98.js → chunk-v5cn90cf.js} +2 -2
- package/bin/chunk-v5mcjwxy.js +2 -0
- package/bin/{chunk-jb8vbeb0.js → chunk-vcrmjtcz.js} +2 -2
- package/bin/chunk-vkzasgxw.js +2 -0
- package/bin/chunk-vp3czaeh.js +7 -0
- package/bin/chunk-x03jwaga.js +8 -0
- package/bin/chunk-x342vzdx.js +2 -0
- package/bin/chunk-x8mjh387.js +5 -0
- package/bin/chunk-xc54vhfz.js +2 -0
- package/bin/chunk-xvkwbczx.js +3 -0
- package/bin/chunk-y241cxff.js +1 -0
- package/bin/chunk-yk12hydf.js +7 -0
- package/bin/chunk-ympbfzz4.js +2 -0
- package/bin/{chunk-n412a1hp.js → chunk-yq32evnn.js} +6 -6
- package/bin/chunk-z1p13dnc.js +2 -0
- package/bin/chunk-zarz3sqn.js +211 -0
- package/bin/chunk-zezje74z.js +4 -0
- package/bin/chunk-zrszykjf.js +3 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +942 -1015
- package/package.json +7 -7
- package/prisma/migrations/20261026024507_hash_api_tokens/migration.sql +28 -0
- package/prisma/migrations/20261026031904_add_audit_log_via/migration.sql +2 -0
- package/prisma/migrations/20261029024626_add_oauth_and_jwks/migration.sql +205 -0
- package/prisma/migrations/20261029030321_default_empty_arrays_oauth/migration.sql +25 -0
- package/prisma/schema.prisma +186 -1
- package/bin/chunk-0502p2k7.js +0 -3
- package/bin/chunk-0b0t6y8h.js +0 -11
- package/bin/chunk-1vt9ss7d.js +0 -2
- package/bin/chunk-23780yj6.js +0 -3
- package/bin/chunk-2cpsfc87.js +0 -1
- package/bin/chunk-2w0d9veg.js +0 -2
- package/bin/chunk-2xp9prpq.js +0 -1
- package/bin/chunk-3gqs15zq.js +0 -2
- package/bin/chunk-3pw7z25v.js +0 -3
- package/bin/chunk-3tx9v8kj.js +0 -2
- package/bin/chunk-3wdtp4ht.js +0 -1
- package/bin/chunk-57axjy7y.js +0 -1
- package/bin/chunk-5aqthcm6.js +0 -5
- package/bin/chunk-5gq4q1bb.js +0 -2
- package/bin/chunk-5r1br11d.js +0 -2
- package/bin/chunk-61hrdg0g.js +0 -1
- package/bin/chunk-6aa4xmnw.js +0 -2
- package/bin/chunk-6mrgtn78.js +0 -18
- package/bin/chunk-6s55r0z9.js +0 -1
- package/bin/chunk-6vkfzzvt.js +0 -5
- package/bin/chunk-7dprpnm6.js +0 -2
- package/bin/chunk-7rycq6wb.js +0 -129
- package/bin/chunk-895gzdtp.js +0 -7
- package/bin/chunk-8d1p8qpv.js +0 -1
- package/bin/chunk-8r3k84dh.js +0 -2
- package/bin/chunk-99sarrvt.js +0 -3
- package/bin/chunk-b21z62fj.js +0 -1
- package/bin/chunk-bv589v2m.js +0 -3
- package/bin/chunk-c8kjpmfe.js +0 -2
- package/bin/chunk-c9xyejnk.js +0 -2
- package/bin/chunk-cb9peqy5.js +0 -2
- package/bin/chunk-ckczqmrz.js +0 -5
- package/bin/chunk-cr33cs6j.js +0 -2
- package/bin/chunk-cxet91kt.js +0 -2
- package/bin/chunk-d7e351jd.js +0 -6
- package/bin/chunk-ebcfbn00.js +0 -2
- package/bin/chunk-f0b4a9y3.js +0 -2
- package/bin/chunk-fkn6f4qt.js +0 -4
- package/bin/chunk-g78vapcm.js +0 -2
- package/bin/chunk-gdpfwxea.js +0 -4
- package/bin/chunk-gwqqq0b1.js +0 -32
- package/bin/chunk-h3cwf9aw.js +0 -2
- package/bin/chunk-h4ty530v.js +0 -16
- package/bin/chunk-h58yfx7w.js +0 -2
- package/bin/chunk-h9ngpxyd.js +0 -1
- package/bin/chunk-hbr17jvr.js +0 -13
- package/bin/chunk-hc0xbmtt.js +0 -5
- package/bin/chunk-j9t7tvt5.js +0 -2
- package/bin/chunk-jvt8q0eg.js +0 -2
- package/bin/chunk-jzgtthsj.js +0 -3
- package/bin/chunk-jzjhg7ng.js +0 -1
- package/bin/chunk-k547syp2.js +0 -2
- package/bin/chunk-k7sjpke6.js +0 -2
- package/bin/chunk-k8ct1qgv.js +0 -3
- package/bin/chunk-k9q4nn8b.js +0 -11
- package/bin/chunk-keetdtxb.js +0 -2
- package/bin/chunk-kjjw8mbg.js +0 -1
- package/bin/chunk-mey80kv9.js +0 -54
- package/bin/chunk-nfncawpm.js +0 -12
- package/bin/chunk-nvwt8atc.js +0 -1
- package/bin/chunk-p1d500sf.js +0 -211
- package/bin/chunk-q0vs124k.js +0 -2
- package/bin/chunk-q5795f3s.js +0 -2
- package/bin/chunk-q5j3b0h5.js +0 -3
- package/bin/chunk-qd7pvaxb.js +0 -2
- package/bin/chunk-qhpt7170.js +0 -2
- package/bin/chunk-qt78vs3g.js +0 -2
- package/bin/chunk-ra6mdjr0.js +0 -1
- package/bin/chunk-ryfvaz6v.js +0 -3
- package/bin/chunk-s22eapcc.js +0 -2
- package/bin/chunk-sbg86tch.js +0 -2
- package/bin/chunk-sbqy6m8t.js +0 -1
- package/bin/chunk-sdp9w627.js +0 -14
- package/bin/chunk-sn0nypvd.js +0 -42
- package/bin/chunk-sv92vkyh.js +0 -2
- package/bin/chunk-t6cn018t.js +0 -3
- package/bin/chunk-ts4d1mxf.js +0 -2
- package/bin/chunk-wkdkc12e.js +0 -4
- package/bin/chunk-xgnvktq6.js +0 -10
- package/bin/chunk-xjw3mpvx.js +0 -1
- package/bin/chunk-xznq2axj.js +0 -1
- package/bin/chunk-y4v08wq7.js +0 -1
- package/bin/chunk-yncvy335.js +0 -3
- package/bin/chunk-ytzddcj2.js +0 -1
- package/bin/chunk-zxqasmvz.js +0 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{io,Z,a,g,X,R,mv,bv,Vm,pp,mh,cT,Dk,Wh,V0,CR,dg,fg,Jn,Se,xe,ke,Ce,Ot,Ly,nn,Bo,ts,Te}from"./chunk-zarz3sqn.js";import{ns}from"./chunk-8yjsmr7g.js";Z();var y=(p)=>p.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:");function _u({sessionId:p,open:N,onOpenChange:_}){let{data:x,isLoading:S}=X({queryKey:["agent-sessions",p,"entries"],queryFn:async()=>{if(!p)return[];let r=await R.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:p}});if(!r.ok)throw Error("Failed to fetch session logs");return await r.json()},enabled:N&&!!p});return a(Se,{open:N,onOpenChange:_,children:g(xe,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl",children:[g(ke,{className:"pb-4 border-b border-foreground/15",children:[g(Ce,{className:"flex items-center gap-2 text-xl font-bold",children:[a(ns,{className:"w-5 h-5 text-violet-500"}),bv()]}),a(Ot,{children:mv()})]}),a("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:S?g("div",{className:"space-y-4",children:[g("div",{className:"flex gap-4",children:[a(Te,{className:"h-5 w-5 rounded-full shrink-0"}),g("div",{className:"flex-1 space-y-2",children:[a(Te,{className:"h-4 w-1/4"}),a(Te,{className:"h-20 w-full"})]})]}),g("div",{className:"flex gap-4",children:[a(Te,{className:"h-5 w-5 rounded-full shrink-0"}),g("div",{className:"flex-1 space-y-2",children:[a(Te,{className:"h-4 w-1/4"}),a(Te,{className:"h-12 w-full"})]})]})]}):x&&x.length>0?a("div",{className:"flex flex-col",children:x.map((r)=>{let o=r.entry,b=o?.timestamp||r.timestamp,f="";if(typeof b==="string"||typeof b==="number"){let e=new Date(b);if(!isNaN(e.getTime()))f=nn(e.toISOString())}if(o&&typeof o==="object"){if(o.type==="custom_message"){if(o.customType==="context")return null;if(o.customType==="shumai_message"){let e=Ly(o.details),d=typeof o.content==="string"?o.content:"",m=e?`${d}
|
|
2
|
+
|
|
3
|
+
${e}`.trim():d,w="bg-primary/10 text-primary",v=V0();return g("div",{className:"relative pl-6 pb-6 last:pb-0",children:[a("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),a("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center bg-primary"}),g("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[g("div",{className:"flex items-center justify-between gap-2",children:[g("div",{className:"flex items-center gap-2 flex-wrap",children:[a("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider bg-primary/10 text-primary",children:v}),g("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:pp(),children:[pp(),": ",r.id]})]}),a("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),a("div",{className:"text-xs text-foreground/90 whitespace-pre-wrap leading-relaxed font-sans",children:m})]})]},r.id)}}if(o.type==="message"&&o.message){let e=o.message,d="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",m=String(e.role||"");if(e.role==="user")d="bg-primary/10 text-primary",m=V0();else if(e.role==="assistant")d="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",m=Dk();else if(e.role==="toolResult")d=e.isError?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300":"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300",m=fg({name:String(e.toolName||Jn())});else if(e.role==="thought")d="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",m=Wh();let w=(s)=>{let t=s;if(typeof s==="string")try{t=JSON.parse(s)}catch{}if(t&&typeof t==="object"&&!Array.isArray(t))return a("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(t).map(([n,l])=>{let c=l&&typeof l==="object"?JSON.stringify(l,null,2):String(l);return g("div",{className:"text-xs leading-relaxed break-words",children:[g("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[n,":"]})," ",a("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:c})]},n)})});return a("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(s)})},v=()=>{let s=e.content;if(!s)return null;if(typeof s==="string"){if(!s.trim())return null;return a("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:a(ts,{children:y(s)})})}if(Array.isArray(s)){let t=[];if(s.forEach((i,n)=>{if(!i)return;if(typeof i==="string"){if(!i.trim())return;t.push(a("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:a(ts,{children:y(i)})},`str-${n}`));return}if(typeof i==="object"){let l=i,c=l.type;if(c==="text"){let u=l.text;if(typeof u!=="string"||!u.trim())return;t.push(a("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:a(ts,{children:y(u)})},`txt-${n}`));return}if(c==="toolCall"){let u=String(l.name||l.toolName||Jn()),h=l.arguments||l.args;t.push(g("div",{className:"text-xs space-y-2 py-1",children:[g("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[Vm()," ",a("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:u})]}),!!h&&g("div",{className:"space-y-1 pt-3",children:[a("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:dg()}),w(h)]})]},`tool-${n}`));return}if(c==="image"){t.push(a("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:mh()},`img-${n}`));return}let k=JSON.stringify(i,null,2);if(k==="{}")return;t.push(a("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:k},`other-${n}`))}}),t.length===0)return null;return a("div",{className:"space-y-3 w-full",children:t.map((i,n)=>g(io,{children:[n>0&&a(Bo,{className:"my-3 opacity-50"}),i]},n))})}return null};return g("div",{className:"relative pl-6 pb-6 last:pb-0",children:[a("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),a("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${e.role==="user"?"bg-primary":e.role==="assistant"?"bg-violet-500":e.role==="toolResult"?e.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),g("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[g("div",{className:"flex items-center justify-between gap-2",children:[g("div",{className:"flex items-center gap-2 flex-wrap",children:[a("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${d}`,children:m}),g("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:pp(),children:[pp(),": ",r.id]})]}),a("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),v()]})]},r.id)}}return g("div",{className:"relative pl-6 pb-6 last:pb-0",children:[a("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),a("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),g("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[g("div",{className:"flex items-center justify-between gap-2 mb-1.5 flex-wrap",children:[g("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:"Entry ID",children:["ID: ",r.id]}),a("div",{className:"text-[10px] text-muted-foreground/60",children:f})]}),a("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(r.entry,null,2)})]})]},r.id)})}):g("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[a(ns,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),a("p",{className:"text-sm font-medium",children:cT()}),a("p",{className:"text-xs text-muted-foreground/60 mt-1",children:CR()})]})})]})})}
|
|
4
|
+
export{_u};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{at,sr}from"./chunk-e4yscwen.js";import{se}from"./chunk-2jj4j8cn.js";var _=se(at());var N=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.AccessKeyId==="string"&&typeof e.SecretAccessKey==="string"&&typeof e.Token==="string"&&typeof e.Expiration==="string",h=(e)=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}});var C=({maxRetries:e=0,timeout:t=1000})=>({maxRetries:e,timeout:t});var v=se(at());import R from"http";function E(e){return new Promise((t,n)=>{let o=R.request({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});o.on("error",(r)=>{n(Object.assign(new v.ProviderError("Unable to connect to instance metadata service"),r)),o.destroy()}),o.on("timeout",()=>{n(new v.ProviderError("TimeoutError from instance metadata service")),o.destroy()}),o.on("response",(r)=>{let{statusCode:a=400}=r;if(a<200||300<=a)n(Object.assign(new v.ProviderError("Error response received from instance metadata service"),{statusCode:a})),o.destroy();let p=[];r.on("data",(s)=>{p.push(s)}),r.on("end",()=>{t(Buffer.concat(p)),o.destroy()})}),o.end()})}var T=(e,t)=>{let n=e();for(let o=0;o<t;o++)n=n.catch(e);return n};var A="AWS_CONTAINER_CREDENTIALS_FULL_URI",g="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",D="AWS_CONTAINER_AUTHORIZATION_TOKEN",G=(e={})=>{let{timeout:t,maxRetries:n}=C(e);return()=>T(async()=>{let o=await J({logger:e.logger}),r=JSON.parse(await H(t,o));if(!N(r))throw new _.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:e.logger});return h(r)},n)},H=async(e,t)=>{if(process.env[D])t.headers={...t.headers,Authorization:process.env[D]};return(await E({...t,timeout:e})).toString()},q="169.254.170.2",Y=new Set(["localhost","127.0.0.1"]),j=new Set(["http:","https:"]),J=async({logger:e})=>{if(process.env[g])return{hostname:q,path:process.env[g]};if(process.env[A]){let t;try{t=new URL(process.env[A])}catch{throw new _.CredentialsProviderError(`${process.env[A]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:e})}if(!t.hostname||!Y.has(t.hostname))throw new _.CredentialsProviderError(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!j.has(t.protocol))throw new _.CredentialsProviderError(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{protocol:t.protocol,hostname:t.hostname,path:t.pathname+t.search,port:t.port?parseInt(t.port,10):void 0}}throw new _.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${g} or ${A} environment variable is set`,{tryNextLink:!1,logger:e})};var u=se(at());var y=se(at());class O extends y.CredentialsProviderError{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(e,t=!0){super(e,t);this.tryNextLink=t,Object.setPrototypeOf(this,O.prototype)}}var w=se(at()),F=se(sr());var S;(function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"})(S||(S={}));var P={environmentVariableSelector:(e)=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(e)=>e.ec2_metadata_service_endpoint,default:void 0};var l;(function(e){e.IPv4="IPv4",e.IPv6="IPv6"})(l||(l={}));var X="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",z="ec2_metadata_service_endpoint_mode",L={environmentVariableSelector:(e)=>e[X],configFileSelector:(e)=>e[z],default:l.IPv4};var b=async()=>F.parseUrl(await Z()||await Q()),Z=async()=>w.loadConfig(P)(),Q=async()=>{let e=await w.loadConfig(L)();switch(e){case l.IPv4:return S.IPv4;case l.IPv6:return S.IPv6;default:throw Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(l)}`)}};var M=(e,t)=>{let n=300+Math.floor(Math.random()*300),o=new Date(Date.now()+n*1000);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(o)}.
|
|
3
|
+
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let r=e.originalExpiration??e.expiration;return{...e,...r?{originalExpiration:r}:{},expiration:o}};var V=(e,t={})=>{let n=t?.logger||console,o;return async()=>{let r;try{if(r=await e(),r.expiration&&r.expiration.getTime()<Date.now())r=M(r,n)}catch(a){if(o)n.warn("Credential renew failed: ",a),r=M(o,n);else throw a}return o=r,r}};var W="/latest/meta-data/iam/security-credentials/",ee="/latest/api/token",x="AWS_EC2_METADATA_V1_DISABLED",k="ec2_metadata_v1_disabled",U="x-aws-ec2-metadata-token",te=(e={})=>V(oe(e),{logger:e.logger}),oe=(e={})=>{let t=!1,{logger:n,profile:o}=e,{timeout:r,maxRetries:a}=C(e),p=async(s,m)=>{if(t||m.headers?.[U]==null){let i=!1,c=!1,B=await u.loadConfig({environmentVariableSelector:(d)=>{let f=d[x];if(c=!!f&&f!=="false",f===void 0)throw new u.CredentialsProviderError(`${x} not set in env, checking config file next.`,{logger:e.logger});return c},configFileSelector:(d)=>{let f=d[k];return i=!!f&&f!=="false",i},default:!1},{profile:o})();if(e.ec2MetadataV1Disabled||B){let d=[];if(e.ec2MetadataV1Disabled)d.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(i)d.push(`config file profile (${k})`);if(c)d.push(`process environment variable (${x})`);throw new O(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${d.join(", ")}].`)}}let K=(await T(async()=>{let i;try{i=await ne(m)}catch(c){if(c.statusCode===401)t=!1;throw c}return i},s)).trim();return T(async()=>{let i;try{i=await ae(K,m,e)}catch(c){if(c.statusCode===401)t=!1;throw c}return i},s)};return async()=>{let s=await b();if(t)return n?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),p(a,{...s,timeout:r});else{let m;try{m=(await re({...s,timeout:r})).toString()}catch(I){if(I?.statusCode===400)throw Object.assign(I,{message:"EC2 Metadata token request returned error"});else if(I.message==="TimeoutError"||[403,404,405].includes(I.statusCode))t=!0;return n?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),p(a,{...s,timeout:r})}return p(a,{...s,headers:{[U]:m},timeout:r})}}},re=async(e)=>E({...e,path:ee,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),ne=async(e)=>(await E({...e,path:W})).toString(),ae=async(e,t,n)=>{let o=JSON.parse((await E({...t,path:W+e})).toString());if(!N(o))throw new u.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:n.logger});return h(o)};export{A as ENV_CMDS_FULL_URI,g as ENV_CMDS_RELATIVE_URI,G as fromContainerMetadata,te as fromInstanceMetadata};
|
package/bin/shumai-app.html
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<meta name="theme-color" content="#ffffff" />
|
|
26
26
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
27
27
|
<title>Shumai</title>
|
|
28
|
-
<link rel="stylesheet" crossorigin href="./chunk-8qdtvfx3.css"><script type="module" crossorigin src="./chunk-
|
|
28
|
+
<link rel="stylesheet" crossorigin href="./chunk-8qdtvfx3.css"><script type="module" crossorigin src="./chunk-zarz3sqn.js"></script></head>
|
|
29
29
|
<body>
|
|
30
30
|
<div id="root"></div>
|
|
31
31
|
|