gemi 0.236.2 → 0.237.0
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 +40 -40
- package/dist/ai/index.js.map +4 -4
- package/dist/ai/runtime.d.ts +8 -0
- package/dist/ai/runtime.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/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-gftdag48.js → chunk-07fy1618.js} +2 -2
- package/dist/{chunk-gftdag48.js.map → chunk-07fy1618.js.map} +1 -1
- package/dist/{chunk-ca5kp6cn.js → chunk-0kjcd94c.js} +2 -2
- package/dist/{chunk-ca5kp6cn.js.map → chunk-0kjcd94c.js.map} +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-hprgj13q.js → chunk-185k67yf.js} +2 -2
- package/dist/{chunk-hprgj13q.js.map → chunk-185k67yf.js.map} +1 -1
- package/dist/{chunk-p4p8xy74.js → chunk-2d757e1s.js} +2 -2
- package/dist/{chunk-p4p8xy74.js.map → chunk-2d757e1s.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-4vn8gyzy.js → chunk-2gj2nhve.js} +2 -2
- package/dist/{chunk-4vn8gyzy.js.map → chunk-2gj2nhve.js.map} +1 -1
- package/dist/{chunk-x6a5qxpa.js → chunk-2h1ta6cv.js} +2 -2
- package/dist/{chunk-x6a5qxpa.js.map → chunk-2h1ta6cv.js.map} +1 -1
- package/dist/chunk-2mjtssv3.js +5 -0
- package/dist/{chunk-0hy5dsbt.js.map → chunk-2mjtssv3.js.map} +1 -1
- package/dist/{chunk-m3fbewhz.js → chunk-3jr6d0cb.js} +3 -3
- package/dist/{chunk-m3fbewhz.js.map → chunk-3jr6d0cb.js.map} +1 -1
- package/dist/{chunk-17bva6b1.js → chunk-3p4wdpag.js} +2 -2
- package/dist/{chunk-17bva6b1.js.map → chunk-3p4wdpag.js.map} +1 -1
- package/dist/{chunk-gjzwrx5g.js → chunk-5c538k7m.js} +2 -2
- package/dist/{chunk-gjzwrx5g.js.map → chunk-5c538k7m.js.map} +1 -1
- package/dist/{chunk-3y1h3ncf.js → chunk-5fxdjmgd.js} +2 -2
- package/dist/{chunk-3y1h3ncf.js.map → chunk-5fxdjmgd.js.map} +1 -1
- package/dist/{chunk-9sbhqscs.js → chunk-5kjnbmwp.js} +3 -3
- package/dist/{chunk-9sbhqscs.js.map → chunk-5kjnbmwp.js.map} +1 -1
- package/dist/{chunk-sh2bd09k.js → chunk-5nn0pgxg.js} +2 -2
- package/dist/{chunk-sh2bd09k.js.map → chunk-5nn0pgxg.js.map} +1 -1
- package/dist/{chunk-qvn0w2rt.js → chunk-5pbjc6tm.js} +2 -2
- package/dist/{chunk-qvn0w2rt.js.map → chunk-5pbjc6tm.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-px9h2qgv.js → chunk-7159w4qq.js} +3 -3
- package/dist/{chunk-px9h2qgv.js.map → chunk-7159w4qq.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-fbk79z21.js → chunk-7b4tsj9x.js} +2 -2
- package/dist/{chunk-fbk79z21.js.map → chunk-7b4tsj9x.js.map} +1 -1
- package/dist/{chunk-kak3vc71.js → chunk-8591j0cj.js} +2 -2
- package/dist/{chunk-kak3vc71.js.map → chunk-8591j0cj.js.map} +1 -1
- package/dist/{chunk-1mb7kaxs.js → chunk-89jc9yg9.js} +3 -3
- package/dist/{chunk-1mb7kaxs.js.map → chunk-89jc9yg9.js.map} +1 -1
- package/dist/{chunk-1w6ra6jc.js → chunk-9447c20x.js} +1 -1
- package/dist/{chunk-np6vee9d.js → chunk-96v1bwg4.js} +3 -3
- package/dist/{chunk-np6vee9d.js.map → chunk-96v1bwg4.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-n4kz9vft.js → chunk-9ey725pw.js} +1 -1
- package/dist/chunk-a3s6cp49.js +48 -0
- package/dist/chunk-a3s6cp49.js.map +26 -0
- package/dist/{chunk-yahabnz4.js → chunk-a9p3djqm.js} +3 -3
- package/dist/{chunk-yahabnz4.js.map → chunk-a9p3djqm.js.map} +1 -1
- package/dist/{chunk-ka8dzc6q.js → chunk-ack021d9.js} +2 -2
- package/dist/{chunk-ka8dzc6q.js.map → chunk-ack021d9.js.map} +1 -1
- package/dist/{chunk-4n3jva4e.js → chunk-b9gf8sqq.js} +2 -2
- package/dist/{chunk-4n3jva4e.js.map → chunk-b9gf8sqq.js.map} +1 -1
- package/dist/{chunk-73541m4t.js → chunk-bcb1dwhb.js} +4 -4
- package/dist/{chunk-73541m4t.js.map → chunk-bcb1dwhb.js.map} +1 -1
- package/dist/{chunk-4800w7qx.js → chunk-bg0da5pd.js} +3 -3
- package/dist/{chunk-4800w7qx.js.map → chunk-bg0da5pd.js.map} +3 -3
- 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-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-c6zpn9yp.js} +3 -3
- package/dist/{chunk-t6x1r5n6.js.map → chunk-c6zpn9yp.js.map} +1 -1
- package/dist/{chunk-y2vayxcd.js → chunk-dj5d9wcc.js} +2 -2
- package/dist/{chunk-y2vayxcd.js.map → chunk-dj5d9wcc.js.map} +1 -1
- package/dist/{chunk-5exrgw07.js → chunk-dmzgw2d8.js} +3 -3
- package/dist/{chunk-5exrgw07.js.map → chunk-dmzgw2d8.js.map} +1 -1
- package/dist/chunk-ejf6sz1d.js +5 -0
- package/dist/{chunk-gvr7cwxn.js.map → chunk-ejf6sz1d.js.map} +3 -3
- package/dist/{chunk-74dzzd64.js → chunk-fb0bazw9.js} +2 -2
- package/dist/{chunk-74dzzd64.js.map → chunk-fb0bazw9.js.map} +1 -1
- package/dist/{chunk-8476xvk9.js → chunk-fgnpyj44.js} +2 -2
- package/dist/{chunk-8476xvk9.js.map → chunk-fgnpyj44.js.map} +1 -1
- package/dist/{chunk-1xz206e1.js → chunk-fp31t0ey.js} +3 -3
- package/dist/{chunk-1xz206e1.js.map → chunk-fp31t0ey.js.map} +1 -1
- package/dist/{chunk-8yb9jrj5.js → chunk-fp6mxxkq.js} +2 -2
- package/dist/{chunk-8yb9jrj5.js.map → chunk-fp6mxxkq.js.map} +1 -1
- package/dist/{chunk-hgwkxn0g.js → chunk-fx45rbbn.js} +2 -2
- package/dist/{chunk-hgwkxn0g.js.map → chunk-fx45rbbn.js.map} +1 -1
- package/dist/{chunk-ts75gcfd.js → chunk-g29wz7h7.js} +2 -2
- package/dist/{chunk-k2mpxwh2.js.map → chunk-g29wz7h7.js.map} +1 -1
- package/dist/{chunk-byv7b79h.js → chunk-gakdsme3.js} +2 -2
- package/dist/{chunk-byv7b79h.js.map → chunk-gakdsme3.js.map} +1 -1
- package/dist/{chunk-28yb0q82.js → chunk-gj4hg8xk.js} +2 -2
- package/dist/{chunk-28yb0q82.js.map → chunk-gj4hg8xk.js.map} +1 -1
- package/dist/{chunk-h0dch3vh.js → chunk-h6z5k6yh.js} +2 -2
- package/dist/{chunk-h0dch3vh.js.map → chunk-h6z5k6yh.js.map} +1 -1
- package/dist/{chunk-fqndtpwm.js → chunk-jfqfvx3t.js} +3 -3
- package/dist/{chunk-fqndtpwm.js.map → chunk-jfqfvx3t.js.map} +1 -1
- package/dist/{chunk-at82qczv.js → chunk-jwh7t982.js} +3 -3
- package/dist/{chunk-at82qczv.js.map → chunk-jwh7t982.js.map} +1 -1
- package/dist/{chunk-2ver7cdt.js → chunk-k2jxxdj1.js} +1 -1
- package/dist/{chunk-t2p5n8fe.js → chunk-k9devrb5.js} +2 -2
- package/dist/{chunk-t2p5n8fe.js.map → chunk-k9devrb5.js.map} +1 -1
- package/dist/{chunk-sv2mv2q2.js → chunk-kpbm4mbc.js} +2 -2
- package/dist/{chunk-sv2mv2q2.js.map → chunk-kpbm4mbc.js.map} +1 -1
- package/dist/{chunk-gt9ftnhn.js → chunk-krfz1rzm.js} +2 -2
- package/dist/{chunk-gt9ftnhn.js.map → chunk-krfz1rzm.js.map} +1 -1
- package/dist/{chunk-zt4hybgg.js → chunk-mwe7hpbd.js} +2 -2
- package/dist/{chunk-zt4hybgg.js.map → chunk-mwe7hpbd.js.map} +1 -1
- package/dist/{chunk-x185900b.js → chunk-n78b8pp5.js} +3 -3
- package/dist/{chunk-x185900b.js.map → chunk-n78b8pp5.js.map} +1 -1
- package/dist/{chunk-fs94x6ef.js → chunk-nznkpf8r.js} +3 -3
- package/dist/{chunk-fs94x6ef.js.map → chunk-nznkpf8r.js.map} +1 -1
- package/dist/{chunk-2j45vbs2.js → chunk-p91yn1b8.js} +2 -2
- package/dist/{chunk-2j45vbs2.js.map → chunk-p91yn1b8.js.map} +1 -1
- package/dist/{chunk-h5wjk91m.js → chunk-pqaha4f1.js} +2 -2
- package/dist/{chunk-h5wjk91m.js.map → chunk-pqaha4f1.js.map} +1 -1
- package/dist/{chunk-8gz07168.js → chunk-q4b79hjb.js} +4 -4
- package/dist/{chunk-8gz07168.js.map → chunk-q4b79hjb.js.map} +1 -1
- package/dist/{chunk-ezea9fpd.js → chunk-qj2r0v7w.js} +2 -2
- package/dist/{chunk-ezea9fpd.js.map → chunk-qj2r0v7w.js.map} +1 -1
- package/dist/{chunk-8jc8x9tc.js → chunk-rmwhvgvg.js} +2 -2
- package/dist/{chunk-8jc8x9tc.js.map → chunk-rmwhvgvg.js.map} +1 -1
- package/dist/{chunk-4mha212g.js → chunk-sxtg2qha.js} +1 -1
- package/dist/{chunk-t60krz4g.js → chunk-t4yx1jqb.js} +2 -2
- package/dist/{chunk-t60krz4g.js.map → chunk-t4yx1jqb.js.map} +1 -1
- package/dist/{chunk-yknc5rgh.js → chunk-t6xe3jr4.js} +2 -2
- package/dist/{chunk-yknc5rgh.js.map → chunk-t6xe3jr4.js.map} +1 -1
- package/dist/{chunk-kvtvx64t.js → chunk-tmpfcx0v.js} +2 -2
- package/dist/{chunk-kvtvx64t.js.map → chunk-tmpfcx0v.js.map} +1 -1
- package/dist/{chunk-8n40a2sn.js → chunk-trbwk80g.js} +2 -2
- package/dist/{chunk-8n40a2sn.js.map → chunk-trbwk80g.js.map} +1 -1
- package/dist/{chunk-aj9atkwk.js → chunk-va2p7e59.js} +1 -1
- package/dist/{chunk-17ewxwga.js → chunk-vbmtyxr4.js} +3 -3
- package/dist/{chunk-17ewxwga.js.map → chunk-vbmtyxr4.js.map} +1 -1
- package/dist/{chunk-406ef17s.js → chunk-vc7ny5zs.js} +2 -2
- package/dist/{chunk-406ef17s.js.map → chunk-vc7ny5zs.js.map} +1 -1
- 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-8mpptpn5.js → chunk-vrp3zzz4.js} +3 -3
- package/dist/{chunk-8mpptpn5.js.map → chunk-vrp3zzz4.js.map} +1 -1
- package/dist/{chunk-y56xd7sv.js → chunk-w7rgnjt5.js} +2 -2
- package/dist/{chunk-y56xd7sv.js.map → chunk-w7rgnjt5.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-k2mpxwh2.js → chunk-x8pk6qqs.js} +2 -2
- package/dist/{chunk-ts75gcfd.js.map → chunk-x8pk6qqs.js.map} +1 -1
- package/dist/{chunk-9jt5qj1b.js → chunk-xj3ebwrj.js} +2 -2
- package/dist/{chunk-9jt5qj1b.js.map → chunk-xj3ebwrj.js.map} +1 -1
- package/dist/{chunk-6v1fbe70.js → chunk-y9efbqmp.js} +2 -2
- package/dist/{chunk-6v1fbe70.js.map → chunk-y9efbqmp.js.map} +1 -1
- package/dist/{chunk-7fbnw7e2.js → chunk-yb7yw0cp.js} +1 -1
- package/dist/{chunk-z3tk66vh.js → chunk-yca8nznt.js} +2 -2
- package/dist/{chunk-z3tk66vh.js.map → chunk-yca8nznt.js.map} +1 -1
- package/dist/{chunk-pfkbhqp7.js → chunk-z0xmyrjb.js} +2 -2
- package/dist/{chunk-pfkbhqp7.js.map → chunk-z0xmyrjb.js.map} +1 -1
- package/dist/{chunk-ehtj7zs2.js → chunk-z55c52fm.js} +2 -2
- package/dist/{chunk-ehtj7zs2.js.map → chunk-z55c52fm.js.map} +1 -1
- 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/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/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- 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/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-dav7mv8t.js +0 -48
- package/dist/chunk-dav7mv8t.js.map +0 -26
- package/dist/chunk-gvr7cwxn.js +0 -5
- /package/dist/{chunk-1w6ra6jc.js.map → chunk-9447c20x.js.map} +0 -0
- /package/dist/{chunk-n4kz9vft.js.map → chunk-9ey725pw.js.map} +0 -0
- /package/dist/{chunk-2ver7cdt.js.map → chunk-k2jxxdj1.js.map} +0 -0
- /package/dist/{chunk-4mha212g.js.map → chunk-sxtg2qha.js.map} +0 -0
- /package/dist/{chunk-aj9atkwk.js.map → chunk-va2p7e59.js.map} +0 -0
- /package/dist/{chunk-7fbnw7e2.js.map → chunk-yb7yw0cp.js.map} +0 -0
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
|