sliccy 5.88.2 → 5.89.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/node-server/_shared/agent-wire-types.d.ts +19 -0
- package/dist/node-server/_shared/agent-wire-types.d.ts.map +1 -1
- package/dist/ui/assets/account-store-CY3L_cQF.js +44 -0
- package/dist/ui/assets/{account-store-B_KMKrdO.js → account-store-DtZuHDmf.js} +1 -1
- package/dist/ui/assets/{adobe-DV4zpXLD.js → adobe-BT4LLrpZ.js} +1 -1
- package/dist/ui/assets/adobe-Bc-6NIQr.js +1 -0
- package/dist/ui/assets/{agent-message-to-chat-QyCEPmi8.js → agent-message-to-chat-DH5qVsNo.js} +1 -1
- package/dist/ui/assets/{anthropic-messages-C8dDJE2X.js → anthropic-messages-Cx3KdHDK.js} +3 -3
- package/dist/ui/assets/{apps-DEnR24ZP.js → apps-CDgCvWHN.js} +1 -1
- package/dist/ui/assets/{azure-openai-Ba60DqEK.js → azure-openai-BZYBbAzv.js} +1 -1
- package/dist/ui/assets/azure-openai-DXz4hF-c.js +1 -0
- package/dist/ui/assets/azure-openai-responses-D2e4727V.js +1 -0
- package/dist/ui/assets/bedrock-camp-CvcU-31w.js +1 -0
- package/dist/ui/assets/cerebras-CDYxWxu2.js +1 -0
- package/dist/ui/assets/{cerebras-C9ZJzdK4.js → cerebras-CvIDBeTv.js} +1 -1
- package/dist/ui/assets/compat-BHfpuQ4D.js +1 -0
- package/dist/ui/assets/{connect-surface-6KyNiRAj.js → connect-surface-Dg0fG3yA.js} +1 -1
- package/dist/ui/assets/context-compaction-DDE4L-Sj.js +58 -0
- package/dist/ui/assets/{cost-command-Cpg2Em0Q.js → cost-command-_BMgmnMI.js} +112 -111
- package/dist/ui/assets/{fs-D1Ke9zaI.js → fs-CyLJ0TYi.js} +2 -2
- package/dist/ui/assets/{fs-CD1g3yf4.js → fs-DpuVKRCQ.js} +1 -1
- package/dist/ui/assets/{github-VBKhh8b7.js → github-15WpvjGl.js} +2 -2
- package/dist/ui/assets/{github-DlKA7UIM.js → github-CXAoEzN7.js} +1 -1
- package/dist/ui/assets/{github-copilot-DiKZ0F7R.js → github-copilot-Ctq2koX1.js} +1 -1
- package/dist/ui/assets/github-copilot-Wogh9O3b.js +1 -0
- package/dist/ui/assets/google-generative-ai-BPByyH06.js +1 -0
- package/dist/ui/assets/{google-shared-BAKd3aSn.js → google-shared-DLE9jWCI.js} +1 -1
- package/dist/ui/assets/google-vertex-0jNZ5aI-.js +1 -0
- package/dist/ui/assets/{kernel-worker-CrxiLsof.js → kernel-worker-CnX2JxSd.js} +598 -606
- package/dist/ui/assets/legacy-api-aliases-BLiHiLlu.js +1 -0
- package/dist/ui/assets/{local-llm-B1n_Tc22.js → local-llm-D6vzlH1q.js} +1 -1
- package/dist/ui/assets/{local-llm-CrqtFJMO.js → local-llm-DUEO4jme.js} +1 -1
- package/dist/ui/assets/{main-CisgbjAR.js → main-YTQMsdfm.js} +3 -3
- package/dist/ui/assets/{mistral-conversations-CKK59QJS.js → mistral-conversations-BBexKxUC.js} +2 -2
- package/dist/ui/assets/{transform-messages-Bp94o3FD.js → models-CvUrqKSj.js} +1 -1
- package/dist/ui/assets/{mount-DVj7VP5s.js → mount-De_BQGq4.js} +2 -2
- package/dist/ui/assets/{mount-recovery-CRLQnEKr.js → mount-recovery-BZjiBIEQ.js} +1 -1
- package/dist/ui/assets/{mount-CXzjVij6.js → mount-sGWapNTk.js} +1 -1
- package/dist/ui/assets/{new-session-CQ3SN3W9.js → new-session-zluPrFE4.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-Bznbe4g_.js → oauth-bootstrap-BgFk_VJ2.js} +2 -2
- package/dist/ui/assets/{openai-codex-Dpe--Pbv.js → openai-codex-C8iCsBD9.js} +1 -1
- package/dist/ui/assets/openai-codex-bEaU3e8X.js +1 -0
- package/dist/ui/assets/openai-codex-responses-CBhbcvRK.js +7 -0
- package/dist/ui/assets/openai-completions-CBeXb_ux.js +5 -0
- package/dist/ui/assets/openai-responses-B5d1rOIe.js +1 -0
- package/dist/ui/assets/{openai-responses-shared-CiIL52L-.js → openai-responses-shared-BU1VYwTh.js} +5 -5
- package/dist/ui/assets/openrouter-BM-UDhNC.js +1 -0
- package/dist/ui/assets/{openrouter-CUwBTJXk.js → openrouter-CF8xV5wq.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-KQ2pyAjI.js → openrouter-oauth-DjtLJhP8.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-ChE4CDlG.js → openrouter-oauth-a-7KEbrQ.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-DtQvj03x.js → panel-rpc-handlers-MyjiRPfQ.js} +2 -2
- package/dist/ui/assets/{provider-Bujo3MeB.js → provider-7LNCXB6L.js} +1 -1
- package/dist/ui/assets/{provider-CTeo0pRQ.js → provider-BH5wrYZm.js} +2 -2
- package/dist/ui/assets/{provider-settings-Cp-_HR6M.js → provider-settings-DAQd7M-Z.js} +1 -1
- package/dist/ui/assets/{provider-settings-C_Gh-qaH.js → provider-settings-D_k-XVth.js} +1 -1
- package/dist/ui/assets/provider-store-access-B-KfYV1X.js +1 -0
- package/dist/ui/assets/{provider-store-access-msqEFHWL.js → provider-store-access-BIYwZNH0.js} +2 -2
- package/dist/ui/assets/{providers-aXrg7Hqf.js → providers-DMaEp7Pj.js} +2 -2
- package/dist/ui/assets/{providers-Wkrd-BXf.js → providers-K6q9kDLS.js} +1 -1
- package/dist/ui/assets/{quick-llm-BrmE-oQX.js → quick-llm-Dg57FmQe.js} +1 -1
- package/dist/ui/assets/session-freezer-C7XAYYYW.js +23 -0
- package/dist/ui/assets/session-freezer-DbAlvJ0R.js +15 -0
- package/dist/ui/assets/{setup-standalone-prelude-XVptKYpy.js → setup-standalone-prelude-C6YqJt2r.js} +1 -1
- package/dist/ui/assets/{setup-sudo-C0qs04rq.js → setup-sudo-0ZNlYZ_b.js} +2 -2
- package/dist/ui/assets/{skills--aPRiI_g.js → skills-B9c2PjwK.js} +1 -1
- package/dist/ui/assets/{src-DZ2yfAIc.js → src-mCXOSBtK.js} +44 -32
- package/dist/ui/assets/{store-CdMZmubX.js → store-D0OiI-Xj.js} +1 -1
- package/dist/ui/assets/{sudo-BIG8zrxW.js → sudo-D0UbkO_d.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-B86z7wX_.js → upgrade-detection-DMqexaA6.js} +1 -1
- package/dist/ui/assets/{wc-attach-BtJ9bT2T.js → wc-attach-BJk2fkdb.js} +2 -2
- package/dist/ui/assets/{wc-extension-Dq7AlAAz.js → wc-extension-BwLFa8q2.js} +2 -2
- package/dist/ui/assets/{wc-follower-DnN0mb_7.js → wc-follower-Dh_Vhf9K.js} +3 -3
- package/dist/ui/assets/wc-live-D2GKoip3.js +8 -0
- package/dist/ui/assets/{wc-nav-DQkhozMz.js → wc-nav-sQfzGmHv.js} +2 -2
- package/dist/ui/assets/{wc-onboarding--dnxvJ3j.js → wc-onboarding-BOSexBA4.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-BPju8pL7.js → wc-placeholder-BvaYuwiv.js} +2 -2
- package/dist/ui/assets/{wc-settings-BUKBfv3D.js → wc-settings-ZEBxc5EW.js} +2 -2
- package/dist/ui/assets/{wc-shell-p5XmLgeO.js → wc-shell-D3tTSQTN.js} +3 -3
- package/dist/ui/assets/{wc-sprinkles-Ddh4AEAG.js → wc-sprinkles-4EUT4NHo.js} +2 -2
- package/dist/ui/assets/{wc-tray-DPsUz1BR.js → wc-tray-DvhYzmJ9.js} +2 -2
- package/dist/ui/assets/{xai-grok-CLWOrmTv.js → xai-grok-BwI31S4-.js} +1 -1
- package/dist/ui/assets/xai-grok-CpSEkomD.js +1 -0
- package/dist/ui/index.html +6 -6
- package/dist/ui/packages/webapp/index.html +6 -6
- package/package.json +1 -1
- package/dist/ui/assets/account-store-BA1YRXaY.js +0 -101
- package/dist/ui/assets/adobe-D2SaljwO.js +0 -1
- package/dist/ui/assets/azure-openai-Da4RYl4k.js +0 -1
- package/dist/ui/assets/azure-openai-responses-CzG7X9qb.js +0 -1
- package/dist/ui/assets/bedrock-camp-DS0ilb3O.js +0 -1
- package/dist/ui/assets/cerebras-CtFfWjlX.js +0 -1
- package/dist/ui/assets/github-copilot-B6eM-Ljj.js +0 -1
- package/dist/ui/assets/google-generative-ai-DzD1vsXe.js +0 -1
- package/dist/ui/assets/google-vertex-oQOD3HKr.js +0 -1
- package/dist/ui/assets/legacy-api-aliases-YuuBU-he.js +0 -1
- package/dist/ui/assets/openai-codex-D6UlmJBX.js +0 -1
- package/dist/ui/assets/openai-codex-responses-DU5CHdDQ.js +0 -7
- package/dist/ui/assets/openai-completions-DhKgaAgM.js +0 -5
- package/dist/ui/assets/openai-responses-C4_jiYtu.js +0 -1
- package/dist/ui/assets/openrouter-B6Vy2W03.js +0 -1
- package/dist/ui/assets/provider-store-access-DRkGfm_o.js +0 -1
- package/dist/ui/assets/session-freezer-D1TdE11t.js +0 -21
- package/dist/ui/assets/wc-live-BLmDAdPx.js +0 -8
- package/dist/ui/assets/xai-grok-DH1A214O.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{t as n}from"./transform-messages-
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{t as n}from"./transform-messages-wECJwtH0.js";import{t as r}from"./sanitize-unicode-DmIE6hZJ.js";import{a as i}from"./constrained-sampling-DafcjXU6.js";var a=t(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),o=t((e=>{var t=a();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),s=t(((e,t)=>{t.exports=o()})),c=e(t(((e,t)=>{let n=s(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),c=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=c,t.exports.default=c,t.exports.AbortError=i}))(),1)
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2025 Google LLC
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./event-stream-qbAZIAKV.js";import{n as t,t as n}from"./models-CvUrqKSj.js";import{t as r}from"./provider-env-DwY8YuMk.js";import{r as i}from"./transform-messages-wECJwtH0.js";import{n as a}from"./headers-CbDaTl3c.js";import{t as o}from"./sanitize-unicode-DmIE6hZJ.js";import{n as s,t as c}from"./error-body-C0EnfbdK.js";import{a as l,c as u,i as d,l as f,n as p,o as m,r as h,s as g,t as _,u as v}from"./google-shared-DLE9jWCI.js";const y={THINKING_LEVEL_UNSPECIFIED:v.THINKING_LEVEL_UNSPECIFIED,MINIMAL:v.MINIMAL,LOW:v.LOW,MEDIUM:v.MEDIUM,HIGH:v.HIGH};let b=0;const x=(t,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-vertex`,provider:t.provider,model:t.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 o=k(i),s=o?w(t,o,i?.headers):C(t,j(i),M(i),i?.headers,i?.env),c=N(t,r,i),l=await i?.onPayload?.(c,t);l!==void 0&&(c=l);let u=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let f=null,p=e.content,g=()=>p.length-1;for await(let r of u){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=h(t);(!f||n&&f.type!==`thinking`||!n&&f.type!==`text`)&&(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:p.length-1,content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),n?(f={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(f),a.push({type:`thinking_start`,contentIndex:g(),partial:e})):(f={type:`text`,text:``},e.content.push(f),a.push({type:`text_start`,contentIndex:g(),partial:e}))),f.type===`thinking`?(f.thinking+=t.text,f.thinkingSignature=m(f.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:t.text,partial:e})):(f.text+=t.text,f.textSignature=m(f.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:t.text,partial:e}))}if(t.functionCall){f&&=(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++b}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=d(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},n(t,e.usage))}if(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`aborted`||e.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=c(s(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},S=(e,n,r)=>{let a=i(e,n,r,void 0);if(!r?.reasoning)return x(e,n,{...a,thinking:{enabled:!1}});let o=t(e,r.reasoning),s=o===`off`?`high`:o,c=e;return P(c)||F(c)?x(e,n,{...a,thinking:{enabled:!0,level:L(s,c)}}):x(e,n,{...a,thinking:{enabled:!0,budgetTokens:R(c,s,r.thinkingBudgets)}})};function C(e,t,n,r,i){let a=O(i);return new u({vertexai:!0,project:t,location:n,apiVersion:`v1`,...a?{googleAuthOptions:a}:{},httpOptions:T(e,r)})}function w(e,t,n){return new u({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:T(e,n)})}function T(e,t){let n={},r=E(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=f.COLLECTION,D(r)&&(n.apiVersion=``));let i=a({...e.headers,...t});return i&&(n.headers=i),Object.keys(n).length>0?n:void 0}function E(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function D(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function O(e){let t=r(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function k(e){let t=e?.apiKey?.trim();if(!(!t||t===`gcp-vertex-credentials`||A(t)))return t}function A(e){return/^<[^>]+>$/.test(e)}function j(e){let t=e?.project||r(`GOOGLE_CLOUD_PROJECT`,e?.env)||r(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function M(e){let t=e?.location||r(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function N(e,t,n={}){let r=_(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a=t.tools?.length?l(t.tools,n.toolChoice,g(e.id)):void 0,s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:o(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:p(t.tools)},...a!==void 0&&{toolConfig:{functionCallingConfig:{mode:a}}}};if(n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=y[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=I(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:r,config:s}}function P(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function F(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function I(e){let t=e;return P(t)?{thinkingLevel:v.LOW}:F(t)?{thinkingLevel:v.MINIMAL}:{thinkingBudget:0}}function L(e,t){if(P(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function R(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{x as stream,S as streamSimple};
|