@shumai-one/shumai 0.3.0 → 0.3.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-93jcw0pn.js → chunk-08dr94gp.js} +1 -1
- package/bin/{chunk-a1mtpcrd.js → chunk-08mxv0sm.js} +2 -2
- package/bin/{chunk-jjgwrvdb.js → chunk-0t4z17qr.js} +1 -1
- package/bin/{chunk-cmcsxkh1.js → chunk-1d22tysv.js} +2 -2
- package/bin/{chunk-9zy0a8kt.js → chunk-1dawjfk8.js} +2 -2
- package/bin/{chunk-q11m2cp3.js → chunk-1nh6xgek.js} +1 -1
- package/bin/chunk-20y3wte3.js +2 -0
- package/bin/{chunk-4tt3jvm1.js → chunk-2ynx0den.js} +1 -1
- package/bin/{chunk-yaydmgcg.js → chunk-31a3k77j.js} +1 -1
- package/bin/{chunk-8rkp0fc5.js → chunk-31mjcykb.js} +2 -2
- package/bin/{chunk-1yqar2gz.js → chunk-3jdef7n4.js} +1 -1
- package/bin/{chunk-h1hj60fr.js → chunk-3rcc5s99.js} +2 -2
- package/bin/{chunk-sa4gc1f5.js → chunk-3t7mjvdv.js} +2 -2
- package/bin/{chunk-36wf2dq0.js → chunk-4ahve1nf.js} +1 -1
- package/bin/chunk-4hdnrwh1.js +1 -0
- package/bin/{chunk-652x28v2.js → chunk-4hdx2tv0.js} +1 -1
- package/bin/chunk-4htdb0xp.js +1 -0
- package/bin/chunk-4p7xpfey.js +2 -0
- package/bin/chunk-5f81c951.js +1 -0
- package/bin/{chunk-bnpw72vt.js → chunk-5vqan9c4.js} +2 -2
- package/bin/{chunk-e66j69wz.js → chunk-5zntjzxw.js} +1 -1
- package/bin/{chunk-jmh934ca.js → chunk-6a2eb3b5.js} +1 -1
- package/bin/{chunk-5x1ppya9.js → chunk-6t3gdd7e.js} +2 -2
- package/bin/chunk-7d5kep8c.js +2 -0
- package/bin/{chunk-a06432s3.js → chunk-7eycsyk6.js} +1 -1
- package/bin/{chunk-0p333kh7.js → chunk-7jjc175m.js} +3 -3
- package/bin/chunk-7kzqkp5z.js +1 -0
- package/bin/chunk-7sh6409h.js +1 -0
- package/bin/{chunk-zct68gc7.js → chunk-7y8dng8t.js} +2 -2
- package/bin/chunk-8e5zvy88.js +307 -0
- package/bin/{chunk-nmzvxgd6.js → chunk-8m6zg15c.js} +2 -2
- package/bin/{chunk-wv8xk7n7.js → chunk-8qyke29r.js} +1 -1
- package/bin/{chunk-jxxq76at.js → chunk-90et6bwm.js} +1 -1
- package/bin/chunk-9c7fxjej.js +2 -0
- package/bin/{chunk-449feg7g.js → chunk-9p2d0mk1.js} +1 -1
- package/bin/{chunk-c003q4v6.js → chunk-a10tf0d8.js} +1 -1
- package/bin/{chunk-9h3c60vw.js → chunk-a76c5r3c.js} +2 -2
- package/bin/{chunk-3g54qkv5.js → chunk-amsb41z5.js} +1 -1
- package/bin/{chunk-28egv700.js → chunk-arpna31w.js} +1 -1
- package/bin/{chunk-k0s6gfg6.js → chunk-b10meywb.js} +1 -1
- package/bin/chunk-b1e3tec3.js +62 -0
- package/bin/chunk-bdjhb77e.js +2 -0
- package/bin/chunk-beay9amy.js +1 -0
- package/bin/{chunk-cspp4n1d.js → chunk-c3fvs0bv.js} +2 -2
- package/bin/{chunk-ab45988z.js → chunk-c5my1b3k.js} +1 -1
- package/bin/{chunk-jh6pw37a.js → chunk-d3s00sn0.js} +1 -1
- package/bin/{chunk-9bvwwj5y.js → chunk-dhekxndw.js} +1 -1
- package/bin/{chunk-pzehf31g.js → chunk-dwaj1yn4.js} +1 -1
- package/bin/{chunk-rybbss5f.js → chunk-dwswqq3g.js} +1 -1
- package/bin/{chunk-5jhrqbk2.js → chunk-ejfmxjw6.js} +2 -2
- package/bin/{chunk-mzre12bp.js → chunk-er1rb6yj.js} +1 -1
- package/bin/chunk-etces6ff.js +2 -0
- package/bin/{chunk-r8vrfefa.js → chunk-etqpzc9e.js} +1 -1
- package/bin/{chunk-pna93n17.js → chunk-f8cn9m28.js} +1 -1
- package/bin/{chunk-fvf7j1qj.js → chunk-fdpjw17x.js} +1 -1
- package/bin/{chunk-agd2jevj.js → chunk-g2dk56e7.js} +1 -1
- package/bin/{chunk-fr3dg9aj.js → chunk-gn8snrnk.js} +1 -1
- package/bin/chunk-gqh4ttjh.js +3 -0
- package/bin/{chunk-szs8dy1s.js → chunk-gvn079hy.js} +2 -2
- package/bin/{chunk-qwxt1cha.js → chunk-h2wsm7h3.js} +2 -2
- package/bin/{chunk-cwebycwv.js → chunk-hfp4hpca.js} +2 -2
- package/bin/{chunk-yvgs4kmv.js → chunk-hrzm70wg.js} +1 -1
- package/bin/{chunk-fwcm78s9.js → chunk-hz31j0hk.js} +2 -2
- package/bin/{chunk-d3cqp0tb.js → chunk-j0p1peav.js} +2 -2
- package/bin/{chunk-aa2tkqg0.js → chunk-jm6bxtzt.js} +1 -1
- package/bin/{chunk-y132jbf0.js → chunk-jstc7pka.js} +1 -1
- package/bin/{chunk-8g1s0pq1.js → chunk-k0a35mg9.js} +1 -1
- package/bin/{chunk-e0kw3bst.js → chunk-k20bhxed.js} +1 -1
- package/bin/{chunk-he4h8e9e.js → chunk-k9w6mk9d.js} +2 -2
- package/bin/chunk-kgb16ggd.css +1 -0
- package/bin/{chunk-qjf561n2.js → chunk-m4py21f3.js} +1 -1
- package/bin/{chunk-jtwvd0te.js → chunk-mahxw48e.js} +2 -2
- package/bin/{chunk-f4x2dxe5.js → chunk-mcxsk75h.js} +3 -3
- package/bin/chunk-mm1j72a8.js +7 -0
- package/bin/{chunk-zy2sqtt9.js → chunk-na2nympm.js} +1 -1
- package/bin/chunk-nr89225z.js +2 -0
- package/bin/chunk-nrf5r23d.js +1 -0
- package/bin/{chunk-ddag2ezv.js → chunk-nt9tfjx6.js} +2 -2
- package/bin/chunk-nzy3pjjm.js +15 -0
- package/bin/{chunk-pvx55h1v.js → chunk-p396vw9h.js} +1 -1
- package/bin/{chunk-wwsvnz4v.js → chunk-p9xfyqh1.js} +2 -2
- package/bin/{chunk-phc9efjf.js → chunk-ph3e1bpp.js} +2 -2
- package/bin/{chunk-w3m9g3e9.js → chunk-pj0fgb2x.js} +1 -1
- package/bin/{chunk-9fefn2st.js → chunk-pp072ksj.js} +1 -1
- package/bin/{chunk-qt9efp9y.js → chunk-q5cdjzbv.js} +1 -1
- package/bin/{chunk-nd6psyzq.js → chunk-qc6dmzn0.js} +2 -2
- package/bin/{chunk-fytbcgak.js → chunk-qmtvy2j4.js} +2 -2
- package/bin/chunk-qn96vbke.js +2 -0
- package/bin/{chunk-bf5a4yc8.js → chunk-qvgc9e08.js} +1 -1
- package/bin/{chunk-mw0rc5m7.js → chunk-rrxjvewm.js} +1 -1
- package/bin/{chunk-nxhzchen.js → chunk-s05f0v9t.js} +1 -1
- package/bin/chunk-s5rfya1p.js +1 -0
- package/bin/{chunk-gc7b9j22.js → chunk-s7qpj715.js} +1 -1
- package/bin/chunk-scsy69bp.js +1 -0
- package/bin/{chunk-vjxgv3r6.js → chunk-sf6fwvrs.js} +1 -1
- package/bin/{chunk-h3y7szbm.js → chunk-ss45w8ks.js} +2 -2
- package/bin/{chunk-4gbs9swm.js → chunk-t2txvzkp.js} +1 -1
- package/bin/{chunk-e56nza63.js → chunk-td54rdfj.js} +1 -1
- package/bin/{chunk-6wa075zh.js → chunk-tsncwscz.js} +1 -1
- package/bin/{chunk-evzxjqr3.js → chunk-v2kfr8fx.js} +2 -2
- package/bin/chunk-vb9m47z9.js +1 -0
- package/bin/{chunk-t0detvbj.js → chunk-ve7v8wtv.js} +2 -2
- package/bin/{chunk-cm25nm9t.js → chunk-vf066xwh.js} +1 -1
- package/bin/{chunk-d5fapvnp.js → chunk-vgb8bzcg.js} +2 -2
- package/bin/{chunk-wcfpdfgy.js → chunk-vnfmh5ke.js} +2 -2
- package/bin/{chunk-hdqvbds8.js → chunk-vy24ncn2.js} +1 -1
- package/bin/{chunk-2xmsa8wv.js → chunk-w3a50kz8.js} +1 -1
- package/bin/{chunk-bjfwz2m7.js → chunk-w9w5301f.js} +2 -2
- package/bin/{chunk-1zpw2mbj.js → chunk-wap08p4j.js} +2 -2
- package/bin/{chunk-hktggc90.js → chunk-wny0qagx.js} +1 -1
- package/bin/{chunk-dk45f6mp.js → chunk-wqhk76de.js} +2 -2
- package/bin/{chunk-en4m76fw.js → chunk-wr5byz6r.js} +1 -1
- package/bin/{chunk-ky3dx324.js → chunk-wrz9e73c.js} +2 -2
- package/bin/{chunk-6f1twjf6.js → chunk-ws07a9kv.js} +1 -1
- package/bin/{chunk-9q32g9jd.js → chunk-x5dcgk62.js} +1 -1
- package/bin/{chunk-sprpjp4t.js → chunk-xawwxdq9.js} +2 -2
- package/bin/chunk-xwmsxg5x.js +1 -0
- package/bin/{chunk-736tcjve.js → chunk-y2nw8rbx.js} +2 -2
- package/bin/{chunk-48ebezek.js → chunk-y9ttm07y.js} +1 -1
- package/bin/chunk-yahb7wan.js +2 -0
- package/bin/{chunk-swa43tzr.js → chunk-z0ej44ak.js} +3 -3
- package/bin/chunk-zemgtnk0.js +1 -0
- package/bin/{chunk-a6dvjjce.js → chunk-zg0vm233.js} +1 -1
- package/bin/chunk-zhd2mkbr.js +1 -0
- package/bin/{chunk-cfamv4b2.js → chunk-zs9b0f3z.js} +2 -2
- package/bin/{chunk-8sr8ff6a.js → chunk-zxpef55w.js} +3 -3
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +254 -224
- package/package.json +7 -7
- package/prisma/migrations/20260729073910_change_agent_session_asset_on_delete_to_set_null/migration.sql +5 -0
- package/prisma/migrations/20260729114346_asset_size_byte_bigint/migration.sql +2 -0
- package/prisma/migrations/20260729114659_ai_usage_tokens_bigint/migration.sql +5 -0
- package/prisma/schema.prisma +6 -6
- package/bin/chunk-1wz0dge4.js +0 -3
- package/bin/chunk-2m2saan7.js +0 -2
- package/bin/chunk-2p0rg6xs.js +0 -1
- package/bin/chunk-3ge0s4k2.js +0 -1
- package/bin/chunk-6ks4277t.js +0 -2
- package/bin/chunk-80d6p55n.js +0 -1
- package/bin/chunk-8a9k4qj6.js +0 -2
- package/bin/chunk-8gkm2ysh.js +0 -1
- package/bin/chunk-8nvybmyv.js +0 -2
- package/bin/chunk-9jd3d3f3.js +0 -320
- package/bin/chunk-9nwjhams.js +0 -1
- package/bin/chunk-a2njf6av.js +0 -1
- package/bin/chunk-af3nys0r.js +0 -1
- package/bin/chunk-cx1ebj9k.js +0 -1
- package/bin/chunk-d1p9qz3y.js +0 -7
- package/bin/chunk-ea0fh29m.js +0 -2
- package/bin/chunk-epsctccj.js +0 -1
- package/bin/chunk-jyr3g5m4.js +0 -1
- package/bin/chunk-n0cn0xfg.js +0 -1
- package/bin/chunk-q0dhm16d.js +0 -62
- package/bin/chunk-qs5k9j8s.js +0 -1
- package/bin/chunk-t0fq8b99.js +0 -2
- package/bin/chunk-tm6z4hkd.css +0 -1
- package/bin/chunk-vdn3jymh.js +0 -2
- package/bin/chunk-z5p39kpk.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function z(b){if(b instanceof Error)return b.message||b.name;if(typeof b==="string")return b;return String(b)}function A(b){if(!(b instanceof Error))return{name:"ThrownValue",message:z(b)};let k=b.code;return{name:b.name||void 0,message:b.message||b.name,stack:b.stack,code:typeof k==="string"||typeof k==="number"?k:void 0}}function B(b,k,q){return{type:b,timestamp:Date.now(),error:A(k),details:q}}function C(b,k){b.diagnostics=[...b.diagnostics??[],k]}
|
|
3
|
-
export{z as
|
|
3
|
+
export{z as ne,B as oe,C as pe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{i as
|
|
1
|
+
import{Mh as e,ih as r,ik as c,zh as n}from"./chunk-b1e3tec3.js";var i=(o)=>({queryKey:["projects",o],queryFn:async()=>{let t=await e.api.projects[":projectId"].$get({param:{projectId:o}});if(!t.ok)throw Error("Failed to fetch project");return await t.json()}}),l=(o)=>({queryKey:["collections",o],queryFn:async()=>{let t=await e.api.collections[":collectionId"].$get({param:{collectionId:o}});if(!t.ok)throw Error("Failed to fetch collection");return await t.json()}}),u=n("/projects/$projectId/collections/$collectionId")({loader:({context:{queryClient:o},params:{projectId:t}})=>o.ensureQueryData(i(t)),pendingComponent:()=>r("div",{children:c.loading_collection()})});
|
|
2
|
+
export{i as gf,l as hf,u as if};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yk as q,al as M}from"./chunk-ws07a9kv.js";var GG=q((xK,e)=>{var y=1000,f=y*60,x=f*60,I=x*24,CG=I*7,IG=I*365.25;e.exports=function(G,Q){Q=Q||{};var K=typeof G;if(K==="string"&&G.length>0)return _G(G);else if(K==="number"&&isFinite(G))return Q.long?yG(G):DG(G);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(G))};function _G(G){if(G=String(G),G.length>100)return;var Q=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(G);if(!Q)return;var K=parseFloat(Q[1]),V=(Q[2]||"ms").toLowerCase();switch(V){case"years":case"year":case"yrs":case"yr":case"y":return K*IG;case"weeks":case"week":case"w":return K*CG;case"days":case"day":case"d":return K*I;case"hours":case"hour":case"hrs":case"hr":case"h":return K*x;case"minutes":case"minute":case"mins":case"min":case"m":return K*f;case"seconds":case"second":case"secs":case"sec":case"s":return K*y;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return K;default:return}}function DG(G){var Q=Math.abs(G);if(Q>=I)return Math.round(G/I)+"d";if(Q>=x)return Math.round(G/x)+"h";if(Q>=f)return Math.round(G/f)+"m";if(Q>=y)return Math.round(G/y)+"s";return G+"ms"}function yG(G){var Q=Math.abs(G);if(Q>=I)return u(G,Q,I,"day");if(Q>=x)return u(G,Q,x,"hour");if(Q>=f)return u(G,Q,f,"minute");if(Q>=y)return u(G,Q,y,"second");return G+" ms"}function u(G,Q,K,V){var Z=Q>=K*1.5;return Math.round(G/K)+" "+V+(Z?"s":"")}});var m=q((hK,KG)=>{function fG(G){K.debug=K,K.default=K,K.coerce=L,K.disable=J,K.enable=Z,K.enabled=N,K.humanize=GG(),K.destroy=v,Object.keys(G).forEach(($)=>{K[$]=G[$]}),K.names=[],K.skips=[],K.formatters={};function Q($){let w=0;for(let W=0;W<$.length;W++)w=(w<<5)-w+$.charCodeAt(W),w|=0;return K.colors[Math.abs(w)%K.colors.length]}K.selectColor=Q;function K($){let w,W=null,Y,R;function B(...X){if(!B.enabled)return;let T=B,j=Number(new Date),A=j-(w||j);if(T.diff=A,T.prev=w,T.curr=j,w=j,X[0]=K.coerce(X[0]),typeof X[0]!=="string")X.unshift("%O");let F=0;X[0]=X[0].replace(/%([a-zA-Z%])/g,(C,D)=>{if(C==="%%")return"%";F++;let s=K.formatters[D];if(typeof s==="function"){let AG=X[F];C=s.call(T,AG),X.splice(F,1),F--}return C}),K.formatArgs.call(T,X),(T.log||K.log).apply(T,X)}if(B.namespace=$,B.useColors=K.useColors(),B.color=K.selectColor($),B.extend=V,B.destroy=K.destroy,Object.defineProperty(B,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(W!==null)return W;if(Y!==K.namespaces)Y=K.namespaces,R=K.enabled($);return R},set:(X)=>{W=X}}),typeof K.init==="function")K.init(B);return B}function V($,w){let W=K(this.namespace+(typeof w>"u"?":":w)+$);return W.log=this.log,W}function Z($){K.save($),K.namespaces=$,K.names=[],K.skips=[];let w=(typeof $==="string"?$:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let W of w)if(W[0]==="-")K.skips.push(W.slice(1));else K.names.push(W)}function z($,w){let W=0,Y=0,R=-1,B=0;while(W<$.length)if(Y<w.length&&(w[Y]===$[W]||w[Y]==="*"))if(w[Y]==="*")R=Y,B=W,Y++;else W++,Y++;else if(R!==-1)Y=R+1,B++,W=B;else return!1;while(Y<w.length&&w[Y]==="*")Y++;return Y===w.length}function J(){let $=[...K.names,...K.skips.map((w)=>"-"+w)].join(",");return K.enable(""),$}function N($){for(let w of K.skips)if(z($,w))return!1;for(let w of K.names)if(z($,w))return!0;return!1}function L($){if($ instanceof Error)return $.stack||$.message;return $}function v(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return K.enable(K.load()),K}KG.exports=fG});var VG=q((QG,g)=>{QG.formatArgs=hG;QG.save=vG;QG.load=bG;QG.useColors=xG;QG.storage=iG();QG.destroy=(()=>{let G=!1;return()=>{if(!G)G=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();QG.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function xG(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let G;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(G=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(G[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function hG(G){if(G[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+G[0]+(this.useColors?"%c ":" ")+"+"+g.exports.humanize(this.diff),!this.useColors)return;let Q="color: "+this.color;G.splice(1,0,Q,"color: inherit");let K=0,V=0;G[0].replace(/%[a-zA-Z%]/g,(Z)=>{if(Z==="%%")return;if(K++,Z==="%c")V=K}),G.splice(V,0,Q)}QG.log=console.debug||console.log||(()=>{});function vG(G){try{if(G)QG.storage.setItem("debug",G);else QG.storage.removeItem("debug")}catch(Q){}}function bG(){let G;try{G=QG.storage.getItem("debug")||QG.storage.getItem("DEBUG")}catch(Q){}if(!G&&typeof process<"u"&&"env"in process)G=process.env.DEBUG;return G}function iG(){try{return localStorage}catch(G){}}g.exports=m()(QG);var{formatters:kG}=g.exports;kG.j=function(G){try{return JSON.stringify(G)}catch(Q){return"[UnexpectedJSONParseError]: "+Q.message}}});var $G=q((bK,ZG)=>{ZG.exports=(G,Q=process.argv)=>{let K=G.startsWith("-")?"":G.length===1?"-":"--",V=Q.indexOf(K+G),Z=Q.indexOf("--");return V!==-1&&(Z===-1||V<Z)}});var JG=q((iK,zG)=>{var mG=M("os"),wG=M("tty"),O=$G(),{env:U}=process,d;if(O("no-color")||O("no-colors")||O("color=false")||O("color=never"))d=0;else if(O("color")||O("colors")||O("color=true")||O("color=always"))d=1;function rG(){if("FORCE_COLOR"in U){if(U.FORCE_COLOR==="true")return 1;if(U.FORCE_COLOR==="false")return 0;return U.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(U.FORCE_COLOR,10),3)}}function aG(G){if(G===0)return!1;return{level:G,hasBasic:!0,has256:G>=2,has16m:G>=3}}function oG(G,{streamIsTTY:Q,sniffFlags:K=!0}={}){let V=rG();if(V!==void 0)d=V;let Z=K?d:V;if(Z===0)return 0;if(K){if(O("color=16m")||O("color=full")||O("color=truecolor"))return 3;if(O("color=256"))return 2}if(G&&!Q&&Z===void 0)return 0;let z=Z||0;if(U.TERM==="dumb")return z;if(process.platform==="win32"){let J=mG.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in U){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((J)=>(J in U))||U.CI_NAME==="codeship")return 1;return z}if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in U){let J=Number.parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(U.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM))return 1;if("COLORTERM"in U)return 1;return z}function r(G,Q={}){let K=oG(G,{streamIsTTY:G&&G.isTTY,...Q});return aG(K)}zG.exports={supportsColor:r,stdout:r({isTTY:wG.isatty(1)}),stderr:r({isTTY:wG.isatty(2)})}});var BG=q((YG,l)=>{var tG=M("tty"),c=M("util");YG.init=ZK;YG.log=KK;YG.formatArgs=eG;YG.save=QK;YG.load=VK;YG.useColors=sG;YG.destroy=c.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");YG.colors=[6,2,3,4,5,1];try{let G=JG();if(G&&(G.stderr||G).level>=2)YG.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(G){}YG.inspectOpts=Object.keys(process.env).filter((G)=>{return/^debug_/i.test(G)}).reduce((G,Q)=>{let K=Q.substring(6).toLowerCase().replace(/_([a-z])/g,(Z,z)=>{return z.toUpperCase()}),V=process.env[Q];if(/^(yes|on|true|enabled)$/i.test(V))V=!0;else if(/^(no|off|false|disabled)$/i.test(V))V=!1;else if(V==="null")V=null;else V=Number(V);return G[K]=V,G},{});function sG(){return"colors"in YG.inspectOpts?Boolean(YG.inspectOpts.colors):tG.isatty(process.stderr.fd)}function eG(G){let{namespace:Q,useColors:K}=this;if(K){let V=this.color,Z="\x1B[3"+(V<8?V:"8;5;"+V),z=` ${Z};1m${Q} \x1B[0m`;G[0]=z+G[0].split(`
|
|
3
3
|
`).join(`
|
|
4
4
|
`+z),G.push(Z+"m+"+l.exports.humanize(this.diff)+"\x1B[0m")}else G[0]=GK()+Q+" "+G[0]}function GK(){if(YG.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function KK(...G){return process.stderr.write(c.formatWithOptions(YG.inspectOpts,...G)+`
|
|
5
5
|
`)}function QK(G){if(G)process.env.DEBUG=G;else delete process.env.DEBUG}function VK(){return process.env.DEBUG}function ZK(G){G.inspectOpts={};let Q=Object.keys(YG.inspectOpts);for(let K=0;K<Q.length;K++)G.inspectOpts[Q[K]]=YG.inspectOpts[Q[K]]}l.exports=m()(YG);var{formatters:WG}=l.exports;WG.o=function(G){return this.inspectOpts.colors=this.useColors,c.inspect(G,this.inspectOpts).split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$b as V}from"./chunk-ss45w8ks.js";import{ac as v,bc as U,cc as x,dc as b,ec as f,fc as h}from"./chunk-y2nw8rbx.js";import{gc as I,hc as B}from"./chunk-w3a50kz8.js";import{jc as T}from"./chunk-6a2eb3b5.js";import{mc as C}from"./chunk-amsb41z5.js";import{oc as P}from"./chunk-gn8snrnk.js";import{bf as E,cf as M}from"./chunk-k9w6mk9d.js";import{df as y}from"./chunk-wny0qagx.js";import{Mk as F,Ok as K,Pk as j}from"./chunk-zxpef55w.js";import"./chunk-ws07a9kv.js";var k="v1",u="gcp-vertex-credentials",a={THINKING_LEVEL_UNSPECIFIED:F.THINKING_LEVEL_UNSPECIFIED,MINIMAL:F.MINIMAL,LOW:F.LOW,MEDIUM:F.MEDIUM,HIGH:F.HIGH},c=0,R=(q,w,J)=>{let Y=new y;return(async()=>{let Q={role:"assistant",content:[],api:"google-vertex",provider:q.provider,model:q.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let $=n(J),D=$?l(q,$,J?.headers):p(q,t(J),o(J),J?.headers,J?.env),N=qq(q,w,J),L=await J?.onPayload?.(N,q);if(L!==void 0)N=L;let d=await D.models.generateContentStream(N);Y.push({type:"start",partial:Q});let Z=null,O=Q.content,X=()=>O.length-1;for await(let z of d){Q.responseId||=z.responseId;let H=z.candidates?.[0];if(H?.content?.parts)for(let W of H.content.parts){if(W.text!==void 0){let _=v(W);if(!Z||_&&Z.type!=="thinking"||!_&&Z.type!=="text"){if(Z)if(Z.type==="text")Y.push({type:"text_end",contentIndex:O.length-1,content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});if(_)Z={type:"thinking",thinking:"",thinkingSignature:void 0},Q.content.push(Z),Y.push({type:"thinking_start",contentIndex:X(),partial:Q});else Z={type:"text",text:""},Q.content.push(Z),Y.push({type:"text_start",contentIndex:X(),partial:Q})}if(Z.type==="thinking")Z.thinking+=W.text,Z.thinkingSignature=U(Z.thinkingSignature,W.thoughtSignature),Y.push({type:"thinking_delta",contentIndex:X(),delta:W.text,partial:Q});else Z.text+=W.text,Z.textSignature=U(Z.textSignature,W.thoughtSignature),Y.push({type:"text_delta",contentIndex:X(),delta:W.text,partial:Q})}if(W.functionCall){if(Z){if(Z.type==="text")Y.push({type:"text_end",contentIndex:X(),content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});Z=null}let _=W.functionCall.id,S={type:"toolCall",id:!_||Q.content.some((A)=>A.type==="toolCall"&&A.id===_)?`${W.functionCall.name}_${Date.now()}_${++c}`:_,name:W.functionCall.name||"",arguments:W.functionCall.args??{},...W.thoughtSignature&&{thoughtSignature:W.thoughtSignature}};Q.content.push(S),Y.push({type:"toolcall_start",contentIndex:X(),partial:Q}),Y.push({type:"toolcall_delta",contentIndex:X(),delta:JSON.stringify(S.arguments),partial:Q}),Y.push({type:"toolcall_end",contentIndex:X(),toolCall:S,partial:Q})}}if(H?.finishReason){if(Q.stopReason=h(H.finishReason),Q.content.some((W)=>W.type==="toolCall"))Q.stopReason="toolUse"}if(z.usageMetadata)Q.usage={input:(z.usageMetadata.promptTokenCount||0)-(z.usageMetadata.cachedContentTokenCount||0),output:(z.usageMetadata.candidatesTokenCount||0)+(z.usageMetadata.thoughtsTokenCount||0),cacheRead:z.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:z.usageMetadata.thoughtsTokenCount||0,totalTokens:z.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},E(q,Q.usage)}if(Z)if(Z.type==="text")Y.push({type:"text_end",contentIndex:X(),content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});if(J?.signal?.aborted)throw Error("Request was aborted");if(Q.stopReason==="aborted"||Q.stopReason==="error")throw Error("An unknown error occurred");Y.push({type:"done",reason:Q.stopReason,message:Q}),Y.end()}catch($){for(let D of Q.content)if("index"in D)delete D.index;Q.stopReason=J?.signal?.aborted?"aborted":"error",Q.errorMessage=B(I($)),Y.push({type:"error",reason:Q.stopReason,error:Q}),Y.end()}})(),Y},Hq=(q,w,J)=>{let Y=T(q,w,J,void 0);if(!J?.reasoning)return R(q,w,{...Y,thinking:{enabled:!1}});let Q=M(q,J.reasoning),$=Q==="off"?"high":Q,D=q;if(G(D)||m(D))return R(q,w,{...Y,thinking:{enabled:!0,level:Jq($,D)}});return R(q,w,{...Y,thinking:{enabled:!0,budgetTokens:Qq(D,$,J.thinkingBudgets)}})};function p(q,w,J,Y,Q){let $=i(Q);return new j({vertexai:!0,project:w,location:J,apiVersion:k,...$?{googleAuthOptions:$}:{},httpOptions:g(q,Y)})}function l(q,w,J){return new j({vertexai:!0,apiKey:w,apiVersion:k,httpOptions:g(q,J)})}function g(q,w){let J={},Y=r(q.baseUrl);if(Y){if(J.baseUrl=Y,J.baseUrlResourceScope=K.COLLECTION,s(Y))J.apiVersion=""}let Q=P({...q.headers,...w});if(Q)J.headers=Q;return Object.keys(J).length>0?J:void 0}function r(q){let w=q.trim();if(!w||w.includes("{location}"))return;return w}function s(q){try{return new URL(q).pathname.split("/").some((J)=>/^v\d+(?:beta\d*)?$/.test(J))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(q)}}function i(q){let w=V("GOOGLE_APPLICATION_CREDENTIALS",q);return w?{keyFilename:w}:void 0}function n(q){let w=q?.apiKey?.trim();if(!w||w===u||e(w))return;return w}function e(q){return/^<[^>]+>$/.test(q)}function t(q){let w=q?.project||V("GOOGLE_CLOUD_PROJECT",q?.env)||V("GCLOUD_PROJECT",q?.env);if(!w)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return w}function o(q){let w=q?.location||V("GOOGLE_CLOUD_LOCATION",q?.env);if(!w)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return w}function qq(q,w,J={}){let Y=x(q,w),Q={};if(J.temperature!==void 0)Q.temperature=J.temperature;if(J.maxTokens!==void 0)Q.maxOutputTokens=J.maxTokens;let $={...Object.keys(Q).length>0&&Q,...w.systemPrompt&&{systemInstruction:C(w.systemPrompt)},...w.tools&&w.tools.length>0&&{tools:b(w.tools)}};if(w.tools&&w.tools.length>0&&J.toolChoice)$.toolConfig={functionCallingConfig:{mode:f(J.toolChoice)}};else $.toolConfig=void 0;if(J.thinking?.enabled&&q.reasoning){let N={includeThoughts:!0};if(J.thinking.level!==void 0)N.thinkingLevel=a[J.thinking.level];else if(J.thinking.budgetTokens!==void 0)N.thinkingBudget=J.thinking.budgetTokens;$.thinkingConfig=N}else if(q.reasoning&&J.thinking&&!J.thinking.enabled)$.thinkingConfig=wq(q);if(J.signal){if(J.signal.aborted)throw Error("Request aborted");$.abortSignal=J.signal}return{model:q.id,contents:Y,config:$}}function G(q){return/gemini-3(?:\.\d+)?-pro/.test(q.id.toLowerCase())}function m(q){let w=q.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(w)||w==="gemini-flash-latest"||w==="gemini-flash-lite-latest"}function wq(q){let w=q;if(G(w))return{thinkingLevel:F.LOW};if(m(w))return{thinkingLevel:F.MINIMAL};return{thinkingBudget:0}}function Jq(q,w){if(G(w))switch(q){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}switch(q){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function Qq(q,w,J){if(J?.[w]!==void 0)return J[w];if(q.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[w];if(q.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[w];return-1}export{Hq as streamSimple,R as stream};
|