gemi 0.236.2 → 0.237.1
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/dist/ai/Agent.d.ts.map +1 -1
- package/dist/ai/AgentProvider.d.ts +22 -0
- package/dist/ai/AgentProvider.d.ts.map +1 -1
- package/dist/ai/FallbackProvider.d.ts +6 -0
- package/dist/ai/FallbackProvider.d.ts.map +1 -1
- package/dist/ai/ImageModel.d.ts.map +1 -1
- package/dist/ai/contextCompaction.d.ts.map +1 -1
- package/dist/ai/generate.d.ts.map +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +172 -172
- package/dist/ai/index.js.map +6 -6
- package/dist/ai/runtime.d.ts +8 -0
- package/dist/ai/runtime.d.ts.map +1 -1
- package/dist/ai/store/DatabaseAgentStore.d.ts.map +1 -1
- package/dist/ai/testing/index.js +2 -2
- package/dist/ai/testing/index.js.map +1 -1
- package/dist/ai/types.d.ts +13 -0
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/usageLimits.d.ts +12 -1
- package/dist/ai/usageLimits.d.ts.map +1 -1
- package/dist/ai/usageMeter.d.ts +67 -10
- package/dist/ai/usageMeter.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/auth/UserProvider.d.ts +5 -22
- package/dist/auth/UserProvider.d.ts.map +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-naj8bmj5.js → chunk-0xmk4jyj.js} +2 -2
- package/dist/{chunk-naj8bmj5.js.map → chunk-0xmk4jyj.js.map} +1 -1
- package/dist/{chunk-sh2bd09k.js → chunk-1etmnz40.js} +2 -2
- package/dist/{chunk-sh2bd09k.js.map → chunk-1etmnz40.js.map} +1 -1
- package/dist/{chunk-t60krz4g.js → chunk-2apm69wz.js} +2 -2
- package/dist/{chunk-t60krz4g.js.map → chunk-2apm69wz.js.map} +1 -1
- package/dist/{chunk-8476xvk9.js → chunk-2as2xfem.js} +2 -2
- package/dist/{chunk-8476xvk9.js.map → chunk-2as2xfem.js.map} +1 -1
- package/dist/{chunk-ezea9fpd.js → chunk-2fw9pm64.js} +2 -2
- package/dist/{chunk-ezea9fpd.js.map → chunk-2fw9pm64.js.map} +1 -1
- package/dist/{chunk-h1wmpa03.js → chunk-2g1h9ktj.js} +2 -2
- package/dist/{chunk-h1wmpa03.js.map → chunk-2g1h9ktj.js.map} +1 -1
- package/dist/{chunk-ca5kp6cn.js → chunk-34a5b9xt.js} +2 -2
- package/dist/{chunk-ca5kp6cn.js.map → chunk-34a5b9xt.js.map} +1 -1
- package/dist/{chunk-3y1h3ncf.js → chunk-358krc4n.js} +2 -2
- package/dist/{chunk-3y1h3ncf.js.map → chunk-358krc4n.js.map} +1 -1
- package/dist/{chunk-qvn0w2rt.js → chunk-49kkapvr.js} +2 -2
- package/dist/{chunk-qvn0w2rt.js.map → chunk-49kkapvr.js.map} +1 -1
- package/dist/{chunk-8jc8x9tc.js → chunk-4pjv77s5.js} +2 -2
- package/dist/{chunk-8jc8x9tc.js.map → chunk-4pjv77s5.js.map} +1 -1
- package/dist/{chunk-ts75gcfd.js → chunk-4rs6w1gp.js} +2 -2
- package/dist/{chunk-k2mpxwh2.js.map → chunk-4rs6w1gp.js.map} +1 -1
- package/dist/{chunk-fbk79z21.js → chunk-4wdc4q33.js} +2 -2
- package/dist/{chunk-fbk79z21.js.map → chunk-4wdc4q33.js.map} +1 -1
- package/dist/{chunk-t2p5n8fe.js → chunk-692nx054.js} +2 -2
- package/dist/{chunk-t2p5n8fe.js.map → chunk-692nx054.js.map} +1 -1
- package/dist/{chunk-x2dmgge8.js → chunk-6wv3k8ap.js} +2 -2
- package/dist/{chunk-x2dmgge8.js.map → chunk-6wv3k8ap.js.map} +1 -1
- package/dist/{chunk-jssjfvsz.js → chunk-768yza4f.js} +2 -2
- package/dist/{chunk-jssjfvsz.js.map → chunk-768yza4f.js.map} +1 -1
- package/dist/{chunk-y2vayxcd.js → chunk-7qhqqf0q.js} +2 -2
- package/dist/{chunk-y2vayxcd.js.map → chunk-7qhqqf0q.js.map} +1 -1
- package/dist/chunk-7ytazpjd.js +5 -0
- package/dist/{chunk-gvr7cwxn.js.map → chunk-7ytazpjd.js.map} +3 -3
- package/dist/{chunk-1w6ra6jc.js → chunk-80kga3p1.js} +1 -1
- package/dist/{chunk-1mb7kaxs.js → chunk-88c8ck33.js} +3 -3
- package/dist/{chunk-1mb7kaxs.js.map → chunk-88c8ck33.js.map} +1 -1
- package/dist/{chunk-5exrgw07.js → chunk-8adbpxpm.js} +3 -3
- package/dist/{chunk-5exrgw07.js.map → chunk-8adbpxpm.js.map} +1 -1
- package/dist/{chunk-x185900b.js → chunk-8ccjtbm2.js} +27 -27
- package/dist/{chunk-x185900b.js.map → chunk-8ccjtbm2.js.map} +3 -3
- package/dist/{chunk-2j45vbs2.js → chunk-8kp4rkd3.js} +2 -2
- package/dist/{chunk-2j45vbs2.js.map → chunk-8kp4rkd3.js.map} +1 -1
- package/dist/{chunk-z3tk66vh.js → chunk-9779ngzq.js} +2 -2
- package/dist/{chunk-z3tk66vh.js.map → chunk-9779ngzq.js.map} +1 -1
- package/dist/{chunk-px9h2qgv.js → chunk-97t5t8jp.js} +3 -3
- package/dist/{chunk-px9h2qgv.js.map → chunk-97t5t8jp.js.map} +1 -1
- package/dist/{chunk-a119av2z.js → chunk-9a3wbbr6.js} +2 -2
- package/dist/{chunk-a119av2z.js.map → chunk-9a3wbbr6.js.map} +1 -1
- package/dist/{chunk-7fbnw7e2.js → chunk-9wf36729.js} +1 -1
- package/dist/chunk-ab5xsxyx.js +13 -0
- package/dist/{chunk-fs94x6ef.js.map → chunk-ab5xsxyx.js.map} +3 -3
- package/dist/{chunk-byv7b79h.js → chunk-ajyfp09w.js} +2 -2
- package/dist/{chunk-byv7b79h.js.map → chunk-ajyfp09w.js.map} +1 -1
- package/dist/{chunk-9kt24ctk.js → chunk-bhycdjcv.js} +2 -2
- package/dist/{chunk-9kt24ctk.js.map → chunk-bhycdjcv.js.map} +1 -1
- package/dist/{chunk-hprgj13q.js → chunk-bxby9c62.js} +2 -2
- package/dist/{chunk-hprgj13q.js.map → chunk-bxby9c62.js.map} +1 -1
- package/dist/{chunk-2kzysesp.js → chunk-c3c37k46.js} +3 -3
- package/dist/{chunk-2kzysesp.js.map → chunk-c3c37k46.js.map} +1 -1
- package/dist/{chunk-t6x1r5n6.js → chunk-ca1qwsjj.js} +3 -3
- package/dist/{chunk-t6x1r5n6.js.map → chunk-ca1qwsjj.js.map} +1 -1
- package/dist/{chunk-74dzzd64.js → chunk-cckfxk08.js} +2 -2
- package/dist/{chunk-74dzzd64.js.map → chunk-cckfxk08.js.map} +1 -1
- package/dist/chunk-cwkf46bk.js +5 -0
- package/dist/{chunk-0hy5dsbt.js.map → chunk-cwkf46bk.js.map} +1 -1
- package/dist/{chunk-8gz07168.js → chunk-d2jafhaf.js} +4 -4
- package/dist/{chunk-8gz07168.js.map → chunk-d2jafhaf.js.map} +1 -1
- package/dist/{chunk-gt9ftnhn.js → chunk-dh1wbntq.js} +2 -2
- package/dist/{chunk-gt9ftnhn.js.map → chunk-dh1wbntq.js.map} +1 -1
- package/dist/{chunk-4n3jva4e.js → chunk-dt8bxq4c.js} +2 -2
- package/dist/{chunk-4n3jva4e.js.map → chunk-dt8bxq4c.js.map} +1 -1
- package/dist/{chunk-406ef17s.js → chunk-ea5fv4h9.js} +2 -2
- package/dist/{chunk-406ef17s.js.map → chunk-ea5fv4h9.js.map} +1 -1
- package/dist/{chunk-28yb0q82.js → chunk-engdyem1.js} +2 -2
- package/dist/{chunk-28yb0q82.js.map → chunk-engdyem1.js.map} +1 -1
- package/dist/{chunk-m3fbewhz.js → chunk-fhbre39m.js} +3 -3
- package/dist/{chunk-m3fbewhz.js.map → chunk-fhbre39m.js.map} +1 -1
- package/dist/chunk-g6re0kkk.js +88 -0
- package/dist/{chunk-73541m4t.js.map → chunk-g6re0kkk.js.map} +4 -4
- package/dist/{chunk-yahabnz4.js → chunk-g7exgg3k.js} +3 -3
- package/dist/{chunk-yahabnz4.js.map → chunk-g7exgg3k.js.map} +1 -1
- package/dist/{chunk-2ver7cdt.js → chunk-gbgwtaqq.js} +1 -1
- package/dist/{chunk-p4p8xy74.js → chunk-h0b4rjzn.js} +2 -2
- package/dist/{chunk-p4p8xy74.js.map → chunk-h0b4rjzn.js.map} +1 -1
- package/dist/{chunk-fqndtpwm.js → chunk-h2cvg5r5.js} +3 -3
- package/dist/{chunk-fqndtpwm.js.map → chunk-h2cvg5r5.js.map} +1 -1
- package/dist/{chunk-17bva6b1.js → chunk-hgwtg5zp.js} +2 -2
- package/dist/{chunk-17bva6b1.js.map → chunk-hgwtg5zp.js.map} +1 -1
- package/dist/{chunk-n4kz9vft.js → chunk-hk37x8mp.js} +1 -1
- package/dist/{chunk-np6vee9d.js → chunk-j0bbh93g.js} +3 -3
- package/dist/{chunk-np6vee9d.js.map → chunk-j0bbh93g.js.map} +1 -1
- package/dist/{chunk-ka8dzc6q.js → chunk-j5r7vm8a.js} +2 -2
- package/dist/{chunk-ka8dzc6q.js.map → chunk-j5r7vm8a.js.map} +1 -1
- package/dist/{chunk-9jt5qj1b.js → chunk-kbz5s9wb.js} +2 -2
- package/dist/{chunk-9jt5qj1b.js.map → chunk-kbz5s9wb.js.map} +1 -1
- package/dist/{chunk-8yb9jrj5.js → chunk-kgpqz8te.js} +2 -2
- package/dist/{chunk-8yb9jrj5.js.map → chunk-kgpqz8te.js.map} +1 -1
- package/dist/{chunk-kvtvx64t.js → chunk-mhvg8nnb.js} +2 -2
- package/dist/{chunk-kvtvx64t.js.map → chunk-mhvg8nnb.js.map} +1 -1
- package/dist/{chunk-gftdag48.js → chunk-mk8jwsm4.js} +2 -2
- package/dist/{chunk-gftdag48.js.map → chunk-mk8jwsm4.js.map} +1 -1
- package/dist/{chunk-ehtj7zs2.js → chunk-mn5xxg4q.js} +2 -2
- package/dist/{chunk-ehtj7zs2.js.map → chunk-mn5xxg4q.js.map} +1 -1
- package/dist/{chunk-8mpptpn5.js → chunk-mt68n713.js} +3 -3
- package/dist/{chunk-8mpptpn5.js.map → chunk-mt68n713.js.map} +1 -1
- package/dist/{chunk-1xz206e1.js → chunk-mykr2v6g.js} +3 -3
- package/dist/{chunk-1xz206e1.js.map → chunk-mykr2v6g.js.map} +1 -1
- package/dist/{chunk-kak3vc71.js → chunk-nxap8bmy.js} +2 -2
- package/dist/{chunk-kak3vc71.js.map → chunk-nxap8bmy.js.map} +1 -1
- package/dist/{chunk-zt4hybgg.js → chunk-p7ae0rnf.js} +2 -2
- package/dist/{chunk-zt4hybgg.js.map → chunk-p7ae0rnf.js.map} +1 -1
- package/dist/{chunk-aj9atkwk.js → chunk-pb7n7vaq.js} +1 -1
- package/dist/{chunk-8n40a2sn.js → chunk-pe4f30nw.js} +2 -2
- package/dist/{chunk-8n40a2sn.js.map → chunk-pe4f30nw.js.map} +1 -1
- package/dist/{chunk-9sbhqscs.js → chunk-prvncxxf.js} +3 -3
- package/dist/{chunk-9sbhqscs.js.map → chunk-prvncxxf.js.map} +1 -1
- package/dist/{chunk-x6a5qxpa.js → chunk-q1grt110.js} +2 -2
- package/dist/{chunk-x6a5qxpa.js.map → chunk-q1grt110.js.map} +1 -1
- package/dist/{chunk-h0dch3vh.js → chunk-s3fpkpdh.js} +2 -2
- package/dist/{chunk-h0dch3vh.js.map → chunk-s3fpkpdh.js.map} +1 -1
- package/dist/{chunk-yknc5rgh.js → chunk-sajfdtkt.js} +2 -2
- package/dist/{chunk-yknc5rgh.js.map → chunk-sajfdtkt.js.map} +1 -1
- package/dist/{chunk-gjzwrx5g.js → chunk-tfefp5jh.js} +2 -2
- package/dist/{chunk-gjzwrx5g.js.map → chunk-tfefp5jh.js.map} +1 -1
- package/dist/chunk-txf4kfze.js +48 -0
- package/dist/chunk-txf4kfze.js.map +26 -0
- package/dist/{chunk-zm6b938z.js → chunk-vcmwp7pv.js} +3 -3
- package/dist/{chunk-zm6b938z.js.map → chunk-vcmwp7pv.js.map} +1 -1
- package/dist/{chunk-6v1fbe70.js → chunk-vf9jtq9h.js} +2 -2
- package/dist/{chunk-6v1fbe70.js.map → chunk-vf9jtq9h.js.map} +1 -1
- package/dist/{chunk-sv2mv2q2.js → chunk-vtf7tkef.js} +2 -2
- package/dist/{chunk-sv2mv2q2.js.map → chunk-vtf7tkef.js.map} +1 -1
- package/dist/{chunk-g7hz0dmk.js → chunk-w9v8bbp8.js} +2 -2
- package/dist/{chunk-g7hz0dmk.js.map → chunk-w9v8bbp8.js.map} +1 -1
- package/dist/{chunk-pfkbhqp7.js → chunk-wgpg670d.js} +2 -2
- package/dist/{chunk-pfkbhqp7.js.map → chunk-wgpg670d.js.map} +1 -1
- package/dist/{chunk-17ewxwga.js → chunk-wj0q7tyn.js} +3 -3
- package/dist/{chunk-17ewxwga.js.map → chunk-wj0q7tyn.js.map} +1 -1
- package/dist/{chunk-4mha212g.js → chunk-wskms8nf.js} +1 -1
- package/dist/{chunk-4vn8gyzy.js → chunk-wzng3k56.js} +2 -2
- package/dist/{chunk-4vn8gyzy.js.map → chunk-wzng3k56.js.map} +1 -1
- package/dist/{chunk-k2mpxwh2.js → chunk-xe76d4v6.js} +2 -2
- package/dist/{chunk-ts75gcfd.js.map → chunk-xe76d4v6.js.map} +1 -1
- package/dist/{chunk-at82qczv.js → chunk-xm0fb17q.js} +3 -3
- package/dist/{chunk-at82qczv.js.map → chunk-xm0fb17q.js.map} +1 -1
- package/dist/{chunk-h5wjk91m.js → chunk-xr8mcx1y.js} +2 -2
- package/dist/{chunk-h5wjk91m.js.map → chunk-xr8mcx1y.js.map} +1 -1
- package/dist/{chunk-y56xd7sv.js → chunk-y73xy0zy.js} +2 -2
- package/dist/{chunk-y56xd7sv.js.map → chunk-y73xy0zy.js.map} +1 -1
- package/dist/{chunk-hgwkxn0g.js → chunk-ygfwbh8p.js} +2 -2
- package/dist/{chunk-hgwkxn0g.js.map → chunk-ygfwbh8p.js.map} +1 -1
- package/dist/{chunk-4800w7qx.js → chunk-zz0k1na4.js} +3 -3
- package/dist/{chunk-4800w7qx.js.map → chunk-zz0k1na4.js.map} +3 -3
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/DB.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/Model.d.ts.map +1 -1
- package/dist/orm/context.d.ts +50 -0
- package/dist/orm/context.d.ts.map +1 -1
- package/dist/orm/index.js +3 -3
- package/dist/orm/index.js.map +3 -3
- package/dist/probe/index.js +2 -2
- package/dist/probe/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/lock/DatabaseLockStore.d.ts.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-0hy5dsbt.js +0 -5
- package/dist/chunk-73541m4t.js +0 -88
- package/dist/chunk-dav7mv8t.js +0 -48
- package/dist/chunk-dav7mv8t.js.map +0 -26
- package/dist/chunk-fs94x6ef.js +0 -9
- package/dist/chunk-gvr7cwxn.js +0 -5
- /package/dist/{chunk-1w6ra6jc.js.map → chunk-80kga3p1.js.map} +0 -0
- /package/dist/{chunk-7fbnw7e2.js.map → chunk-9wf36729.js.map} +0 -0
- /package/dist/{chunk-2ver7cdt.js.map → chunk-gbgwtaqq.js.map} +0 -0
- /package/dist/{chunk-n4kz9vft.js.map → chunk-hk37x8mp.js.map} +0 -0
- /package/dist/{chunk-aj9atkwk.js.map → chunk-pb7n7vaq.js.map} +0 -0
- /package/dist/{chunk-4mha212g.js.map → chunk-wskms8nf.js.map} +0 -0
package/dist/chunk-fs94x6ef.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Gl as W,Nl as M,Ql as y}from"./chunk-8476xvk9.js";import{AsyncLocalStorage as L}from"async_hooks";var J=new L;function g(){return J.getStore()?.tx}function b(){return J.getStore()?.connection??M}function f(j,q){let z=J.getStore();if(b()===j)return q();return D(j),J.run({...z,depth:z?.depth??0,connection:j===M?void 0:j},q)}function D(j){let q=J.getStore();if(q?.tx===void 0)return;let z=q.connection??M;if(z===j)return;throw new y(z,j)}function O(j){let q=J.getStore();if(q?.tx===void 0||q.afterCommit===void 0)return!1;let z=v.get(q.afterCommit);if(z==="committed")return!1;if(z==="rolled_back")return!0;return q.afterCommit.push(j),!0}var v=new WeakMap;function C(j){if(O(j))return Promise.resolve();let q=(z)=>{console.error("An after-commit callback threw. No transaction was open, so it ran immediately.",z)};try{return Promise.resolve(j()).catch(q)}catch(z){return q(z),Promise.resolve()}}function p(j){let q=J.getStore();if(q?.tx!==void 0&&q.tx===j&&q.statementFailed)q.statementFailed.value=!0}function u(j){let q=J.getStore();if(q?.tx===void 0||q.commitDependsOn===void 0)return!1;return q.commitDependsOn.push(j),!0}class _ extends Error{constructor(j){super(`A statement this transaction depended on failed after being issued on it, so the transaction rolled back instead of committing: ${j instanceof Error?j.message:String(j)}`,{cause:j});this.name="TransactionDependencyError"}}async function U(j,q){if(j.length===q)return;let B=(await Promise.allSettled(j.slice(q))).find((Q)=>Q.status==="rejected");if(B)throw new _(B.reason)}function m(){let j=J.getStore();return j?.tx===void 0?null:j.depth}function l(){return J.getStore()?.system===!0}function i(j){let q=J.getStore();return J.run({...q,depth:q?.depth??0,system:!0},j)}function c(j){return J.getStore()?.trashed?.get(j)}function d(j,q,z){let B=J.getStore(),Q=new Map(B?.trashed);return Q.set(j,q),J.run({...B,depth:B?.depth??0,trashed:Q},z)}function s(){return J.getStore()?.actor}function a(j,q){let z=J.getStore();return J.run({...z,depth:z?.depth??0,system:!1,actor:{user:j??null}},q)}function S(j){if(Bun.env.NODE_ENV!=="development")return null;if(j===!1)return null;if(j===void 0)return W;if(!Number.isFinite(j)||j<=0)return W;return j}function h(j){let q=S(j);if(q===null)return()=>{};let z=Error("transaction opened here"),B=setTimeout(()=>{let Q=z.stack?.split(`
|
|
3
|
-
`).slice(1).join(`
|
|
4
|
-
`)??"";console.warn(`[gemi] A database transaction has not settled after ${q}ms. It `+"reserves a pooled connection until it does \u2014 check for network or "+`filesystem I/O inside the callback, and move it outside the transaction if you find any.
|
|
5
|
-
${Q}
|
|
6
|
-
(development only; set database.slowTransactionThreshold to change the threshold, or false to switch this off)`)},q);return B.unref?.(),()=>clearTimeout(B)}async function E(j,q){if(j.length===0)return;await J.run({...q,tx:void 0,afterCommit:void 0,commitDependsOn:void 0,depth:q?.depth??0},async()=>{for(let z of j)try{await z()}catch(B){console.error("An after-commit callback threw. The transaction it was waiting on had already committed and stays committed, and the callbacks after it still ran.",B)}})}function o(j,q,z){let B=J.getStore(),Q=z?.connection??M;if(D(Q),B?.tx){let K=B.afterCommit,$=K?.length??0,Z=B.commitDependsOn,H=Z?.length??0;return B.tx.savepoint((R)=>{let I=R;return J.run({...B,tx:I,depth:B.depth+1},async()=>{let w=await q(I);if(Z)await U(Z,H);return w})}).catch((R)=>{if(K)K.length=$;if(Z)Z.length=H;throw R})}let X=h(z?.slowTransactionThreshold),P=[],G=[],V=new Map,Y={value:!1};try{return j.begin((K)=>J.run({...B,tx:K,depth:0,connection:Q===M?void 0:Q,afterCommit:P,commitDependsOn:G,appliedSettings:V,statementFailed:Y},async()=>{if(!z?.deferSettings)await F(K,B?.settings,V);let $=await q(K);if(await U(G,0),Y.value)await K.unsafe("select 1");return $})).finally(X).then(async(K)=>{return v.set(P,"committed"),await E(P,B),K},(K)=>{throw v.set(P,"rolled_back"),K})}catch(K){throw X(),K}}var k=/^[A-Za-z_][A-Za-z0-9_$]*(\.[A-Za-z_][A-Za-z0-9_$]*)+$/;class A extends Error{setting;outer;inner;constructor(j,q,z){super(`DB.withSettings: "${j}" is already "${q}" in an enclosing withSettings block, and a nested block can't change it to "${z}". Open a separate block outside the first one.`);this.setting=j;this.outer=q;this.inner=z;this.name="SessionSettingConflictError"}}function n(){let j=J.getStore()?.settings;return j&&Object.keys(j).length>0?j:void 0}async function F(j,q,z){if(!q)return[];let B=Object.entries(q).filter(([X,P])=>z.get(X)!==P);if(B.length===0)return[];let Q=B.map((X,P)=>`set_config($${P*2+1}, $${P*2+2}, true)`);await j.unsafe(`select ${Q.join(", ")}`,B.flatMap(([X,P])=>[X,P]));for(let[X,P]of B)z.set(X,P);return B.map(([X])=>X)}async function r(){let j=J.getStore();if(j?.tx&&j.appliedSettings)await F(j.tx,j.settings,j.appliedSettings)}async function t(j,q){let z=J.getStore(),B=z?.settings??{},Q={...B};for(let[V,Y]of Object.entries(j)){if(!k.test(V))throw Error(`DB.withSettings: "${V}" is not a custom setting name. Use a prefix and a dot, like "app.tenant_id".`);let K=Y===null?"":String(Y);if(Object.hasOwn(B,V)&&B[V]!==K)throw new A(V,B[V],K);Q[V]=K}let X={...z,depth:z?.depth??0,settings:Q},P=z?.tx,G=z?.appliedSettings;if(!P||!G)return J.run(X,q);return J.run(X,async()=>{let V=await F(P,Q,G),Y=async()=>{if(V.length===0)return;let $=V.map((Z,H)=>`set_config($${H+1}, '', true)`);await P.unsafe(`select ${$.join(", ")}`,V);for(let Z of V)G.delete(Z)},K;try{K=await q()}catch($){throw await Y().catch(()=>{}),$}return await Y(),K})}
|
|
7
|
-
export{J as il,g as jl,b as kl,f as ll,D as ml,O as nl,C as ol,p as pl,u as ql,_ as rl,m as sl,l as tl,i as ul,c as vl,d as wl,s as xl,a as yl,o as zl,A as Al,n as Bl,r as Cl,t as Dl};
|
|
8
|
-
|
|
9
|
-
//# debugId=65312690B0470E2464756E2164756E21
|
package/dist/chunk-gvr7cwxn.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ij as b}from"./chunk-t6x1r5n6.js";class D extends Error{retryable;constructor(Q,V={}){super(Q,V.cause!==void 0?{cause:V.cause}:void 0);this.name="ToolError",this.retryable=V.retryable??!0}}var u={provider_error:"The model provider returned an error.",rate_limited:"The model provider is rate limiting requests. Try again shortly.",context_length_exceeded:"The conversation is too long for the model.",content_filtered:"The model provider's content filter blocked this request.",invalid_tool_input:"The model provider rejected the request.",tool_error:"A tool failed.",unknown:"The run failed unexpectedly."};function E(Q,V){if(V.source==="tool"){if(V.cause instanceof D)return Q;return{...Q,message:`The tool "${V.toolName}" failed with an unexpected error.`}}let Y=u[Q.code];return Y===void 0?Q:{...Q,message:Y}}function HQ(Q,V,Y,Z){let $;try{$=(Q??E)(V,Y)}catch(J){Z(J),$=E(V,Y)}return{code:$.code,message:$.message,...$.toolCallId!==void 0?{toolCallId:$.toolCallId}:{},retryable:$.retryable}}var S=new WeakMap;function LQ(Q,V){if(Q!==V)S.set(Q,V)}function UQ(Q){return S.get(Q)??Q}class _ extends D{id;code="attachment_not_found";constructor(Q){super(`No attachment ${Q}.`);this.id=Q;this.name="AttachmentNotFoundError"}}class T extends D{code="invalid_attachment_scope";constructor(Q){super(Q);this.name="InvalidAttachmentScopeError"}}function P(Q){if(!Q||typeof Q.key!=="string"||Q.key.length===0)throw new T("An attachment scope needs a non-empty key. Return `null` from `attachmentScope()` for a request that has no subject \u2014 an empty key is a bucket every caller shares.");return Q}var g="gemi_att_";function h(){return`${g}${crypto.randomUUID()}`}class A{store;storage;scope;lifetime;constructor(Q,V,Y,Z=null){this.store=Q;this.storage=V;this.scope=Y;this.lifetime=Z;P(Y)}withLifetime(Q){return new A(this.store,this.storage,this.scope,Q)}get scopeKey(){return this.scope.key}async get(Q){let V=await this.store.find(this.scope,Q);if(!V||V.scopeKey!==this.scope.key||x(V,Date.now()))throw new _(Q);return V}async read(Q){return await this.readRecord(Q,await this.get(Q))}async readRecord(Q,V){if(!V.objectName)throw new _(Q);return await this.storage.read({name:V.objectName})}async file(Q){let V=await this.get(Q),Z=(await this.readRecord(Q,V)).body,$=Z instanceof Blob?Z:Z?await new Response(Z).blob():new Blob([]);return new File([$],V.name,{type:V.mimeType})}async put(Q,V={}){let Y=h(),Z=V.mimeType??Q.type??"",$=V.name??(Q instanceof File?Q.name:Y),J=await this.storage.put({name:l(Y,$),body:Q,contentType:Z||void 0}),K={id:Y,scopeKey:this.scope.key,objectName:J,name:$,mimeType:Z||"application/octet-stream",size:Q.size,createdAt:new Date().toISOString(),destination:V.fileId?"both":"storage",...V.fileId?{fileId:V.fileId}:{},...this.lifetime?this.lifetime.next():{}};return await this.store.put(this.scope,K),this.lifetime?.onPut?.(K),K}}function x(Q,V){if(!Q.expiresAt)return!1;let Y=Date.parse(Q.expiresAt);return Number.isFinite(Y)&&Y<=V}function zQ(Q,V,Y=Date.now()){if(Q===null||Q===void 0)return null;if(Q==="turn")return{expiresAt:new Date(Y+V).toISOString(),deleteAfterTurn:!0};let Z=Q?.ttlMs;if(typeof Z!=="number"||!Number.isFinite(Z)||Z<=0)throw Error(`attachmentRetention() must answer "turn", { ttlMs } with a positive number of milliseconds, or null; it answered ${JSON.stringify(Q)}.`);return{expiresAt:new Date(Y+Z).toISOString()}}async function DQ(Q,V){if(Q.objectName){if(!V.storage.delete)throw Error(`Cannot delete attachment ${Q.id}: the controller's attachmentStorage has no delete().`);await V.storage.delete({name:Q.objectName})}if(Q.fileId){if(!V.provider?.deleteFile)throw Error(`Cannot delete the provider copy of attachment ${Q.id}: the agent's provider has no deleteFile().`);await V.provider.deleteFile(Q.fileId),await V.fileOwners?.delete?.(Q.fileId)}if(!V.store.delete)throw Error(`Cannot delete attachment ${Q.id}: the controller's attachment store has no delete().`);await V.store.delete({key:Q.scopeKey},Q.id)}function l(Q,V){let Y=/\.([A-Za-z0-9]{1,8})$/.exec(V);return`attachments/${Q}${Y?`.${Y[1].toLowerCase()}`:""}`}class w{rows=new Map;async put(Q,V){P(Q),this.rows.set(V.id,{...V,scopeKey:Q.key})}async find(Q,V){P(Q);let Y=this.rows.get(V);if(!Y||Y.scopeKey!==Q.key)return null;return Y}async delete(Q,V){P(Q);let Y=this.rows.get(V);if(Y&&Y.scopeKey===Q.key)this.rows.delete(V)}async expired(Q,V){let Y=[];for(let Z of this.rows.values()){if(Y.length>=V)break;if(x(Z,Q.getTime()))Y.push(Z)}return Y}get size(){return this.rows.size}}var FQ=new w;function p(Q){let V=new Set;for(let Y of Q)for(let Z of Y.content??[]){if(Z.type!=="tool-call")continue;for(let $ of Z.attachments??[])if($&&"shown"in $&&$.shown)V.add($.shown.messageId)}return V}function v(Q){if(Q.length===0)return[];let V=p(Q),Y=[0];for(let Z=1;Z<Q.length;Z++)if(m(Q[Z],V))Y.push(Z);return Y}function m(Q,V){if(Q.turn!==void 0)return Q.turn===Q.id;return Q.role==="user"&&!Q.joined&&!V.has(Q.id)}function f(Q){if(Q.turn!==void 0)return Q.turn===Q.id?void 0:Q.turn;return Q.joined}function RQ(Q){let V=v(Q),Y=V.map(()=>[]),Z=new Map,$=-1;return Q.forEach((J,K)=>{if(V[$+1]===K)$++;let B=f(J),H=B!==void 0?Z.get(B):void 0;Y[H??$].push(J),Z.set(J.id,H??$)}),Y}function c(Q,V,Y){let Z=(K)=>{let B=0;while(B+1<V.length&&V[B+1]<=K)B++;return B},$=new Map(Q.map((K,B)=>[K.id,B])),J=Y;for(let K=Q.length-1;K>=V[J];K--){let B=f(Q[K]),H=B!==void 0?$.get(B):void 0;if(H!==void 0&&H<V[J])J=Z(H)}return J}function d(Q){try{return JSON.stringify(Q).length}catch{return 0}}var i=4,n=10,o="[Earlier turns of this conversation are not shown.]";function CQ(Q,V={}){let Y=[...Q],Z=v(Y),$=s(V),J=R(V.maxTurns)??1/0,K=Math.max(1,Math.floor(R(V.step)??n));if(Z.length<=1||J>=Z.length&&$===1/0)return{messages:Y,start:0,omittedTurns:0,omittedMessages:0};let B=Array.from({length:Y.length+1},()=>0);if($!==1/0)for(let X=Y.length-1;X>=0;X--)B[X]=B[X+1]+d(Y[X]);let H=(X)=>Z.length-X<=J&&B[Z[X]]<=$,G=-1;for(let X=0;X<Z.length;X+=K)if(H(X)){G=X;break}if(G<0){for(let X=0;X<Z.length;X++)if(H(X)){G=X;break}}if(G<0)G=Z.length-1;if(G=c(Y,Z,G),G===0)return{messages:Y,start:0,omittedTurns:0,omittedMessages:0};let L=Z[G],U=Y.slice(0,L),F=U.filter((X)=>X.role==="system"),q=a(U,Y.slice(L)),W={turns:G,messages:U.length-F.length},M=typeof V.note==="function"?V.note(W):V.note===void 0?o:V.note;if(M){let X=q[0];q[0]={...X,content:[{type:"text",text:M},...X.content]}}return{messages:[...F,...q],start:L,omittedTurns:W.turns,omittedMessages:W.messages}}function R(Q){return typeof Q==="number"&&Q>0?Q:void 0}function s(Q){let V=R(Q.maxBytes)??1/0,Y=R(Q.maxTokens);return Math.min(V,Y===void 0?1/0:Y*i)}function k(Q,V){let Y=Array.isArray(Q?.namespaces)?Q.namespaces:[],Z=Array.isArray(Q?.loaded)?Q.loaded:[];return V.namespace?Y.includes(V.namespace):Z.includes(String(V.name))}function j(Q){return Array.isArray(Q.toolSearches)?Q.toolSearches:[]}function a(Q,V){let Y=[];for(let G of Q)for(let L of G.content??[])if(L.type==="tool-call")Y.push(...j(L));if(Y.length===0)return V;let Z=[],$=new Set,J;if(V.forEach((G,L)=>{(G.content??[]).forEach((U,F)=>{if(U.type!=="tool-call"||U.partial)return;if(Z.push(...j(U)),Z.some((W)=>k(W,U)))return;let q=Y.filter((W)=>k(W,U));if(q.length===0)return;for(let W of q)$.add(W);J??={message:L,part:F}})}),!J)return V;let K=Y.filter((G)=>$.has(G)),B=[...V],H=B[J.message];return B[J.message]={...H,content:H.content.map((G,L)=>L===J.part&&G.type==="tool-call"?{...G,toolSearches:[...K,...j(G)]}:G)},B}class O extends Error{constructor(){super("The run was stopped");this.name="RunAborted"}}function OQ(Q,V){if(V.aborted)return Promise.reject(new O);return new Promise((Y,Z)=>{let $=()=>Z(new O);V.addEventListener("abort",$,{once:!0}),Q.then(Y,Z).finally(()=>V.removeEventListener("abort",$))})}function IQ(Q){switch(Q.type){case"text-delta":case"reasoning-delta":case"tool-call-delta":case"tool-call":case"tool-search":case"output-delta":return!0;default:return!1}}function NQ(){return{inputTokens:0,outputTokens:0,totalTokens:0}}function MQ(Q,V){if(!V)return Q;let Y={inputTokens:Q.inputTokens+(V.inputTokens??0),outputTokens:Q.outputTokens+(V.outputTokens??0),totalTokens:Q.totalTokens+(V.totalTokens??0)};for(let Z of r)if(V[Z]!==void 0||Q[Z]!==void 0)Y[Z]=(Q[Z]??0)+(V[Z]??0);return Y}var r=["reasoningTokens","cachedInputTokens","cacheWriteInputTokens","imageInputTokens","imageOutputTokens","audioInputTokens","cachedAudioInputTokens","audioOutputTokens"];function t(Q){if(!Q.trim())return{};try{return JSON.parse(Q)}catch{}let V=[],Y=!1,Z=!1;for(let K of Q){if(Y){if(Z)Z=!1;else if(K==="\\")Z=!0;else if(K==='"')Y=!1;continue}if(K==='"')Y=!0;else if(K==="{")V.push("}");else if(K==="[")V.push("]");else if(K==="}"||K==="]")V.pop()}let $=Q;if(Y)$+='"';$=$.replace(/[,:]\s*$/,"");let J=V.reverse().join("");try{return JSON.parse($+J)}catch{try{return JSON.parse($.replace(/,?\s*"[^"]*"\s*$/,"")+J)}catch{return{}}}}function EQ(Q){return{name:"output",schema:Q.toJSONSchema(),strict:b(Q)}}function SQ(Q,V){let Y=Q.safeParse(t(V));if(Y.ok===!0)return{ok:!0,value:Y.value};return{ok:!1,error:{code:"invalid_output",message:`The model's structured answer did not match the output schema: ${Y.errors.join(", ")}`,retryable:!0}}}function TQ(Q){if(Q.length>0)Q[0];return Q}function AQ(Q,V,Y){let Z=Q.content[Q.content.length-1];if(Z&&Z.type===V){Z.text=(Z.text??"")+Y;return}Q.content.push(V==="text"?{type:"text",text:Y}:{type:"reasoning",text:Y})}function xQ(Q,V,Y,Z){let $=Q.content[Q.content.length-1];if($&&$.type==="reasoning"&&$.id===V&&!$.providerMetadata){if($.text=($.text??"")+Y,Z)$.providerMetadata=Z;return}Q.content.push({type:"reasoning",...V?{id:V}:{},text:Y,...Z?{providerMetadata:Z}:{}})}class y extends Error{status;body;requestId;retryAfter;constructor(Q,V,Y,Z){super(`Provider request failed with status ${Q}: ${YQ(V)}`);if(this.name="ProviderHttpError",this.status=Q,this.body=V,this.requestId=Y,Z!==void 0)this.retryAfter=Z}}class C extends Error{timeoutMs;constructor(Q){super(`Provider request timed out after ${Q}ms`);this.name="ProviderTimeoutError",this.timeoutMs=Q}}class e extends C{constructor(Q){super(Q);this.name="ProviderStreamIdleError",this.message=`Provider stream sent nothing for ${Q}ms (streamIdleTimeoutMs)`}}class QQ extends C{constructor(Q){super(Q);this.name="ProviderStreamDurationError",this.message=`Provider stream was still going after ${Q}ms (streamMaxDurationMs)`}}class I extends Error{limit;detail;constructor(Q,V,Y="",Z=Q+1){super(`Provider streamed more than ${Q} characters of arguments for "${V}" without finishing the call (maxToolArgumentChars)`);this.name="ProviderToolArgumentsTooLongError",this.limit=Q,this.detail={tool:V,toolCallId:Y,limit:Q,chars:Z}}}class VQ extends I{constructor(Q,V,Y,Z,$){super(Q,V,Y,Z);this.name="ProviderToolArgumentsRunawayError",this.message=`Provider streamed more than ${Q} characters of white space in the arguments for "${V}" before they were whole JSON (maxToolArgumentWhitespace)`,this.detail.whitespace=$}}function YQ(Q){let V=N(Q);if(V?.message)return V.message;if(typeof Q==="string")return Q.slice(0,500);return"no error body"}function N(Q){if(!Q||typeof Q!=="object")return null;let V=Q,Z=V.error&&typeof V.error==="object"?V.error:Q;if(typeof Z.message!=="string"&&typeof Z.code!=="string"&&typeof Z.type!=="string")return null;let $=Z.innererror?.code??Z.code;return{message:Z.message,type:Z.type,code:$,param:Z.param}}function kQ(Q){if(!Q||typeof Q!=="object")return{};let V=Q,{status:Y,requestId:Z}=V,$=ZQ(V.body),J=z(V.providerType)??$.providerType,K=z(V.providerCode)??$.providerCode,B=z(V.providerParam)??$.providerParam;return{...typeof Y==="number"&&Y>=100&&Y<=599?{status:Y}:{},...typeof Z==="string"&&Z?{requestId:Z}:{},...J?{providerType:J}:{},...K?{providerCode:K}:{},...B?{providerParam:B}:{}}}function ZQ(Q){let V=N(Q),Y=z(V?.type),Z=z(V?.code),$=z(V?.param);return{...Y?{providerType:Y}:{},...Z?{providerCode:Z}:{},...$?{providerParam:$}:{}}}function z(Q){return typeof Q==="string"&&Q?Q:void 0}function vQ(Q){if(Q instanceof C||Q instanceof I)return{code:"provider_error",message:Q.message,retryable:!0};if(XQ(Q))return{code:"aborted",message:"The request was aborted.",retryable:!1};if(Q instanceof y)return $Q(Q.status,N(Q.body),Q.message,Q.retryAfter);if(Q instanceof TypeError)return{code:"provider_error",message:`Could not reach the provider: ${Q.message}`,retryable:!0};if(Q instanceof Error)return{code:"provider_error",message:Q.message,retryable:!1};return{code:"unknown",message:String(Q),retryable:!1}}function $Q(Q,V,Y,Z){let $=V?.message??Y,J=(V?.code??"").toLowerCase(),K=(V?.type??"").toLowerCase(),B=`${J} ${K} ${$}`.toLowerCase().replace(/https?:\/\/\S+/g,"");if(Q===429){if(!JQ.has(J)&&(J==="insufficient_quota"||B.includes("quota")))return{code:"rate_limited",message:$,retryable:!1};let G=Z??KQ($);return{code:"rate_limited",message:$,retryable:!0,...G!==void 0?{retryAfter:G}:{}}}if(Q>=500||Q===408||Q===409)return{code:"provider_error",message:$,retryable:!0};if(BQ(B))return{code:"context_length_exceeded",message:$,retryable:!1};if(GQ(B))return{code:"content_filtered",message:$,retryable:!1};if(V?.param?.startsWith("tools")||B.includes("invalid schema for function"))return{code:"invalid_tool_input",message:$,retryable:!1};return{code:"provider_error",message:$,retryable:!1}}var JQ=new Set(["ratelimitreached","rate_limit_exceeded","too_many_requests"]);function KQ(Q){let V=/retry after (\d+(?:\.\d+)?)\s*(milliseconds?|ms|seconds?|secs?|s)\b/i.exec(Q);if(!V)return;let Y=Number(V[1]);return/^m(s|illi)/i.test(V[2])?Y:Y*1000}function BQ(Q){return Q.includes("context_length_exceeded")||Q.includes("maximum context length")||Q.includes("context window")||Q.includes("reduce the length")||Q.includes("prompt is too long")||Q.includes("request_too_large")}function GQ(Q){return Q.includes("content_filter")||Q.includes("content_policy_violation")||Q.includes("responsibleaipolicyviolation")||Q.includes("content management policy")||Q.includes("moderation_blocked")||Q.includes("rejected by the safety system")||Q.includes("safety_violations")}function XQ(Q){if(!Q||typeof Q!=="object")return!1;let V=Q;return V.name==="AbortError"||V.code==="ABORT_ERR"}
|
|
3
|
-
export{O as qd,OQ as rd,IQ as sd,NQ as td,MQ as ud,t as vd,EQ as wd,SQ as xd,TQ as yd,AQ as zd,xQ as Ad,D as Bd,E as Cd,HQ as Dd,LQ as Ed,UQ as Fd,_ as Gd,T as Hd,g as Id,h as Jd,A as Kd,zQ as Ld,DQ as Md,l as Nd,w as Od,FQ as Pd,y as Qd,C as Rd,e as Sd,QQ as Td,I as Ud,VQ as Vd,kQ as Wd,ZQ as Xd,vQ as Yd,p as Zd,v as _d,RQ as $d,d as ae,n as be,o as ce,CQ as de};
|
|
4
|
-
|
|
5
|
-
//# debugId=2DB216492CE128A864756E2164756E21
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|