sliccy 2.54.1 → 2.54.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/dist/ui/assets/adobe-B1jUOkdF.js +1 -0
- package/dist/ui/assets/{adobe-CZBWzRi3.js → adobe-DZg7-K7c.js} +2 -2
- package/dist/ui/assets/{agent-bridge-DUBKRvg2.js → agent-bridge-fGfLRgWV.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-_ZvznEi6.js → agent-message-to-chat-BUMHCk2y.js} +1 -1
- package/dist/ui/assets/{anthropic-8dSWvEaO.js → anthropic-4ASJTRhO.js} +2 -2
- package/dist/ui/assets/{anthropic-B3g2jrQe.js → anthropic-CW4Fql_O.js} +1 -1
- package/dist/ui/assets/{azure-openai-Cs9t6vRM.js → azure-openai-VBmOZ1ay.js} +1 -1
- package/dist/ui/assets/azure-openai-responses-C_KSa6jj.js +1 -0
- package/dist/ui/assets/{azure-openai-responses-BZMXkkMn.js → azure-openai-responses-Ci2gkluO.js} +1 -1
- package/dist/ui/assets/azure-openai-xFajrwQo.js +1 -0
- package/dist/ui/assets/{bedrock-camp-CWcpoTdM.js → bedrock-camp-BAGPWCem.js} +3 -3
- package/dist/ui/assets/{bedrock-camp-jigA67u0.js → bedrock-camp-CWKZAe9y.js} +2 -2
- package/dist/ui/assets/{cdp-CnxVFH0S.js → cdp-kvQFmtFJ.js} +3 -3
- package/dist/ui/assets/cost-command-AcJsWAxd.js +1 -0
- package/dist/ui/assets/{dist-DB19jrs9.js → dist-BT9E_vUE.js} +1 -1
- package/dist/ui/assets/{dist-Ck3Vla0r.js → dist-C867mOPm.js} +1 -1
- package/dist/ui/assets/{dist-Dioyrn6j.js → dist-Dv2Nk_Uq.js} +1 -1
- package/dist/ui/assets/{dist-C_pwrhfY.js → dist-N8xNrrAa.js} +1 -1
- package/dist/ui/assets/{dist-BETSJsV5.js → dist-VRuvLOER.js} +1 -1
- package/dist/ui/assets/{env-api-keys-CH1OdZie.js → env-api-keys-DEKGEdJy.js} +1 -1
- package/dist/ui/assets/{es-BSQRfodq.js → es-bMJYmOPx.js} +1 -1
- package/dist/ui/assets/{fs-DHT3iarp.js → fs-2Iygkfgl.js} +3 -3
- package/dist/ui/assets/{fs-GZSurNkc.js → fs-tSL_dHbv.js} +1 -1
- package/dist/ui/assets/{github-5BYmUUQ7.js → github-Ba3cwHKD.js} +2 -2
- package/dist/ui/assets/github-pcF1E2_T.js +1 -0
- package/dist/ui/assets/google-CBK_Mvyz.js +1 -0
- package/dist/ui/assets/{google-D5tttDSd.js → google-gejI0Xd8.js} +1 -1
- package/dist/ui/assets/{google-shared-az0i8UPc.js → google-shared-BB2MKu9Q.js} +1 -1
- package/dist/ui/assets/{google-shared-CiHltZCP.js → google-shared-D_qkojxq.js} +1 -1
- package/dist/ui/assets/google-vertex-tM5T-lH5.js +1 -0
- package/dist/ui/assets/{google-vertex-DOtir00q.js → google-vertex-wc4xtIz9.js} +1 -1
- package/dist/ui/assets/{index-CWEy6UzW.js → index-DlhHNinJ.js} +9 -9
- package/dist/ui/assets/{kernel-worker-Z5eEhzpl.js → kernel-worker-zs-zRL9Z.js} +974 -974
- package/dist/ui/assets/{local-llm-DSF6fpSa.js → local-llm-B1Vy1Y00.js} +1 -1
- package/dist/ui/assets/{local-llm-CchxbQRo.js → local-llm-CMG7z-q1.js} +1 -1
- package/dist/ui/assets/{magick-wasm-CTqVspRN.js → magick-wasm-BMFWa7e1.js} +1 -1
- package/dist/ui/assets/{magick-wasm-CPN3NKqF.js → magick-wasm-PdWrmLP5.js} +1 -1
- package/dist/ui/assets/{mistral-BV0eFkMp.js → mistral-BGhArSbR.js} +1 -1
- package/dist/ui/assets/{mistral-BZdZwhYA.js → mistral-BjvHW1zm.js} +2 -2
- package/dist/ui/assets/{mount-CcA_qcZO.js → mount-B2p1IlMv.js} +1 -1
- package/dist/ui/assets/{mount-CiJ9lD8n.js → mount-KaXtlHH6.js} +2 -2
- package/dist/ui/assets/{nuke-command-d6pdX9by.js → nuke-command-DOb0s1O3.js} +1 -1
- package/dist/ui/assets/oauth-bootstrap-CH7rhvb6.js +1 -0
- package/dist/ui/assets/oauth-service-DNPgMPYf.js +1 -0
- package/dist/ui/assets/oauth-service-Dh_zSTTJ.js +1 -0
- package/dist/ui/assets/{offscreen-client-OrnbzVF2.js → offscreen-client--KzQqPLS.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-eTecv_Fr.js → onboarding-orchestrator-CLPXHTsD.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-BOuesx1c.js → openai-codex-responses-BH7I3fcD.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-DXb3k86e.js → openai-codex-responses-Box9MCzN.js} +1 -1
- package/dist/ui/assets/openai-completions-BnShqSeR.js +5 -0
- package/dist/ui/assets/{openai-completions-BXuJR1eK.js → openai-completions-DmV2esrh.js} +1 -1
- package/dist/ui/assets/{openai-responses-Bjk0FI2e.js → openai-responses-Cp1E557G.js} +1 -1
- package/dist/ui/assets/openai-responses-DOCxF9QM.js +1 -0
- package/dist/ui/assets/{openai-responses-shared-CYpbeIvb.js → openai-responses-shared-iYgA7Khl.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-DJ_O7os_.js → openai-responses-shared-iv5WheAz.js} +3 -3
- package/dist/ui/assets/panel-rpc-DMFq2vU_.js +1 -0
- package/dist/ui/assets/panel-rpc-handlers-Bh7lNAMQ.js +1 -0
- package/dist/ui/assets/panel-rpc-uLhnFoXD.js +1 -0
- package/dist/ui/assets/provider-settings-DVB7ucuC.js +28 -0
- package/dist/ui/assets/provider-settings-Dyb4Ejbk.js +63 -0
- package/dist/ui/assets/{providers-DpVMtzoJ.js → providers-C8_J4cGR.js} +1 -1
- package/dist/ui/assets/{pyodide-DwCMl2Ja.js → pyodide-DOGWuEal.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-mqv_gQku.js → remote-terminal-view-BkxZllWt.js} +1 -1
- package/dist/ui/assets/{transform-messages-uhk4b6os.js → simple-options-CVJdKrCb.js} +1 -1
- package/dist/ui/assets/{slicc-editor-QB-g14AA.js → slicc-editor-CmED91Wp.js} +2 -2
- package/dist/ui/assets/{spawn-DSTCmhFE.js → spawn-DferiTbS.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-KJJoM4E0.js → sprinkle-renderer-D_1WCWtS.js} +2 -2
- package/dist/ui/assets/{sql-wasm-eXBRXMXY.js → sql-wasm-DZVUCGLK.js} +1 -1
- package/dist/ui/assets/{telemetry-qzXntW4J.js → telemetry-C9XsVfDg.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-D6u0kID4.js → upgrade-detection-BQpWIyAs.js} +1 -1
- package/dist/ui/index.html +10 -10
- package/dist/ui/packages/webapp/index.html +10 -10
- package/package.json +1 -1
- package/dist/ui/assets/adobe-C4P2-kPA.js +0 -1
- package/dist/ui/assets/azure-openai-YaBKY1Wr.js +0 -1
- package/dist/ui/assets/azure-openai-responses-BruPNuxz.js +0 -1
- package/dist/ui/assets/cost-command-DDsW42ku.js +0 -1
- package/dist/ui/assets/github-rG6MKLWd.js +0 -1
- package/dist/ui/assets/google-NhMHz8rQ.js +0 -1
- package/dist/ui/assets/google-vertex-C4h2ubmt.js +0 -1
- package/dist/ui/assets/oauth-bootstrap-DFY31n07.js +0 -1
- package/dist/ui/assets/oauth-service-CBV0hFPx.js +0 -1
- package/dist/ui/assets/oauth-service-DwTzeJ6J.js +0 -1
- package/dist/ui/assets/openai-completions-ytvpg3gQ.js +0 -5
- package/dist/ui/assets/openai-responses-8f3sjZ0n.js +0 -1
- package/dist/ui/assets/panel-rpc-handlers-DSdIUEco.js +0 -1
- package/dist/ui/assets/provider-settings-CXdvFG7R.js +0 -63
- package/dist/ui/assets/provider-settings-eR4hZJ2w.js +0 -28
- /package/dist/ui/assets/{__vite-browser-external-ChUuVKj-.js → __vite-browser-external-CdaqDer8.js} +0 -0
- /package/dist/ui/assets/{addon-fit-BCjyTVK7.js → addon-fit-CBYO9uVb.js} +0 -0
- /package/dist/ui/assets/{addon-fit-CJBYijzN.js → addon-fit-CTgRqR5i.js} +0 -0
- /package/dist/ui/assets/{azure-ai-foundry-BitUTPkG.js → azure-ai-foundry-B5DluKZP.js} +0 -0
- /package/dist/ui/assets/{azure-ai-foundry-c-8tCxDt.js → azure-ai-foundry-D3HkGmef.js} +0 -0
- /package/dist/ui/assets/{backend-local-C97MTiUQ.js → backend-local-CfhYopTE.js} +0 -0
- /package/dist/ui/assets/{bsh-watchdog-D59Tbl5E.js → bsh-watchdog-DKgzntUa.js} +0 -0
- /package/dist/ui/assets/{chat-fixture-Hp7QoBPd.js → chat-fixture-BKyHtm_z.js} +0 -0
- /package/dist/ui/assets/{diagnostics-COTIkqqc.js → diagnostics-C5z6rwkV.js} +0 -0
- /package/dist/ui/assets/{dist-uJp2dR6X.js → dist-B-Md2rjs.js} +0 -0
- /package/dist/ui/assets/{dist-BhoaJ6E3.js → dist-BXMOjFxx.js} +0 -0
- /package/dist/ui/assets/{dist-DNQ3u_NS.js → dist-CZgcx_4U.js} +0 -0
- /package/dist/ui/assets/{follower-sprinkle-bridge-B8hu3_Tp.js → follower-sprinkle-bridge-D98CB4QW.js} +0 -0
- /package/dist/ui/assets/{git-config-DrjQgeV7.js → git-config-F_PSsmKc.js} +0 -0
- /package/dist/ui/assets/{github-copilot-headers-DCDy_wqp.js → github-copilot-headers-BKQV7zrp.js} +0 -0
- /package/dist/ui/assets/{github-copilot-headers-DFUtSIuj.js → github-copilot-headers-DPO4cOSI.js} +0 -0
- /package/dist/ui/assets/{hash-CsofV07h.js → hash-ekRFATsu.js} +0 -0
- /package/dist/ui/assets/{headers-BCPSYYop.js → headers-C4jF_HTA.js} +0 -0
- /package/dist/ui/assets/{headers-Dr-OH1-5.js → headers-CGhBAvcc.js} +0 -0
- /package/dist/ui/assets/{json-parse-Or9qhSeP.js → json-parse-CKelIhmU.js} +0 -0
- /package/dist/ui/assets/{lick-manager-proxy-B0RDZsAR.js → lick-manager-proxy-D4WRd8z3.js} +0 -0
- /package/dist/ui/assets/{mime-types-DVkB7Eq7.js → mime-types-4JXpZe6p.js} +0 -0
- /package/dist/ui/assets/{openai-D6Fs9zDM.js → openai-CQMTwQw3.js} +0 -0
- /package/dist/ui/assets/{openai-C-uvPKpB.js → openai-DxnCgV1v.js} +0 -0
- /package/dist/ui/assets/{page-storage-sync-CCCwfs1s.js → page-storage-sync-BIXKW7V9.js} +0 -0
- /package/dist/ui/assets/{path-utils-mhPGPhd8.js → path-utils-C99GOg2c.js} +0 -0
- /package/dist/ui/assets/{pdfjs-jzfXBGiL.js → pdfjs-Cesr9Csk.js} +0 -0
- /package/dist/ui/assets/{remote-cache-DdfqyJ2A.js → remote-cache-Cd8CL8Mo.js} +0 -0
- /package/dist/ui/assets/{rum-fanUFgbu.js → rum-DPJZsXNh.js} +0 -0
- /package/dist/ui/assets/{sanitize-unicode-Dw-JFaZE.js → sanitize-unicode-BA6bNBBh.js} +0 -0
- /package/dist/ui/assets/{sanitize-unicode-ncMKN_SD.js → sanitize-unicode-DFrWoF2t.js} +0 -0
- /package/dist/ui/assets/{secret-env-DTcVaCe1.js → secret-env-DrzPMa3Z.js} +0 -0
- /package/dist/ui/assets/{shared-Bzh87vAD.js → shared-AafAvJaI.js} +0 -0
- /package/dist/ui/assets/{sprinkle-bridge-channel-CHgv5aYx.js → sprinkle-bridge-channel-DMXpPm9r.js} +0 -0
- /package/dist/ui/assets/{sprinkle-bridge-channel-Cj_CAZH2.js → sprinkle-bridge-channel-DTuRl7C8.js} +0 -0
- /package/dist/ui/assets/{sprinkle-proxy-8PgiiiqE.js → sprinkle-proxy-CgcbIA81.js} +0 -0
- /package/dist/ui/assets/{src-CpO2JX79.js → src-lJxZtwWF.js} +0 -0
- /package/dist/ui/assets/{xterm-DHgoOdoP.js → xterm-BcRgm-P0.js} +0 -0
- /package/dist/ui/assets/{xterm-B7kAlFoJ.js → xterm-CguO-Jtb.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-jRWAZmH_.js";import{
|
|
1
|
+
import{o as e,t}from"./chunk-jRWAZmH_.js";import{i as n}from"./simple-options-CVJdKrCb.js";import{t as r}from"./sanitize-unicode-DFrWoF2t.js";var i=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}})),a=t((e=>{var t=i();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}}})),o=t(((e,t)=>{t.exports=a()})),s=e(t(((e,t)=>{let n=o(),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},s=e=>r.includes(e),c=(e,t)=>new Promise((r,o)=>{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)){o(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),o(e.originalError);else if(e instanceof TypeError&&!s(e.message))c.stop(),o(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){o(e);return}c.retry(e)||o(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{a as e,c as t,n,s as r}from"./simple-options-CVJdKrCb.js";import{t as i}from"./sanitize-unicode-DFrWoF2t.js";import{a,c as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p}from"./google-shared-D_qkojxq.js";const m={THINKING_LEVEL_UNSPECIFIED:c.THINKING_LEVEL_UNSPECIFIED,MINIMAL:c.MINIMAL,LOW:c.LOW,MEDIUM:c.MEDIUM,HIGH:c.HIGH};let h=0;const g=(t,n,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=C(i),c=o?y(t,o,i?.headers):v(t,T(i),E(i),i?.headers),l=D(t,n,i),f=await i?.onPayload?.(l,t);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:e});let m=null,g=e.content,_=()=>g.length-1;for await(let n of p){e.responseId||=n.responseId;let i=n.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=d(t);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g.length-1,content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:e})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:e})):(m={type:`text`,text:``},e.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:e}))),m.type===`thinking`?(m.thinking+=t.text,m.thinkingSignature=u(m.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:t.text,partial:e})):(m.text+=t.text,m.textSignature=u(m.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:t.text,partial:e}))}if(t.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.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()}_${++h}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:e})}}i?.finishReason&&(e.stopReason=s(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),n.usageMetadata&&(e.usage={input:(n.usageMetadata.promptTokenCount||0)-(n.usageMetadata.cachedContentTokenCount||0),output:(n.usageMetadata.candidatesTokenCount||0)+(n.usageMetadata.thoughtsTokenCount||0),cacheRead:n.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},r(t,e.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:_(),content:m.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=t instanceof Error?t.message:JSON.stringify(t),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},_=(e,r,i)=>{let a=n(e,i,void 0);if(!i?.reasoning)return g(e,r,{...a,thinking:{enabled:!1}});let o=t(e,i.reasoning),s=o===`off`?`high`:o,c=e;return O(c)||k(c)?g(e,r,{...a,thinking:{enabled:!0,level:j(s,c)}}):g(e,r,{...a,thinking:{enabled:!0,budgetTokens:M(c,s,i.thinkingBudgets)}})};function v(e,t,n,r){return new f({vertexai:!0,project:t,location:n,apiVersion:`v1`,httpOptions:b(e,r)})}function y(e,t,n){return new f({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:b(e,n)})}function b(e,t){let n={},r=x(e.baseUrl);return r&&(n.baseUrl=r,n.baseUrlResourceScope=o.COLLECTION,S(r)&&(n.apiVersion=``)),(e.headers||t)&&(n.headers={...e.headers,...t}),Object.keys(n).length>0?n:void 0}function x(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function S(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 C(e){let t=e?.apiKey?.trim()||{}.GOOGLE_CLOUD_API_KEY?.trim();if(!(!t||t===`gcp-vertex-credentials`||w(t)))return t}function w(e){return/^<[^>]+>$/.test(e)}function T(e){let t=e?.project||{}.GOOGLE_CLOUD_PROJECT||{}.GCLOUD_PROJECT;if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function E(e){let t=e?.location||{}.GOOGLE_CLOUD_LOCATION;if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function D(e,t,n={}){let r=p(e,t),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let s={...Object.keys(o).length>0&&o,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:l(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:a(n.toolChoice)}}:s.toolConfig=void 0,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=m[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=A(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 O(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function k(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function A(e){let t=e;return O(t)?{thinkingLevel:c.LOW}:k(t)?{thinkingLevel:c.MINIMAL}:{thinkingBudget:0}}function j(e,t){if(O(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 M(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{g as streamGoogleVertex,_ as streamSimpleGoogleVertex};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,n,s as r}from"./simple-options-D8vGmEnp.js";import{t as i}from"./sanitize-unicode-
|
|
1
|
+
import{a as e,c as t,n,s as r}from"./simple-options-D8vGmEnp.js";import{t as i}from"./sanitize-unicode-BA6bNBBh.js";import{a,c as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p}from"./google-shared-BB2MKu9Q.js";var m=`v1`,h=`gcp-vertex-credentials`,g={THINKING_LEVEL_UNSPECIFIED:c.THINKING_LEVEL_UNSPECIFIED,MINIMAL:c.MINIMAL,LOW:c.LOW,MEDIUM:c.MEDIUM,HIGH:c.HIGH},_=0,v=(t,n,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=T(i),c=o?x(t,o,i?.headers):b(t,D(i),O(i),i?.headers),l=k(t,n,i),f=await i?.onPayload?.(l,t);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:e});let m=null,h=e.content,g=()=>h.length-1;for await(let n of p){e.responseId||=n.responseId;let i=n.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=d(t);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:h.length-1,content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:e})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:e})):(m={type:`text`,text:``},e.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:e}))),m.type===`thinking`?(m.thinking+=t.text,m.thinkingSignature=u(m.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:t.text,partial:e})):(m.text+=t.text,m.textSignature=u(m.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:t.text,partial:e}))}if(t.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:m.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()}_${++_}`: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=s(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),n.usageMetadata&&(e.usage={input:(n.usageMetadata.promptTokenCount||0)-(n.usageMetadata.cachedContentTokenCount||0),output:(n.usageMetadata.candidatesTokenCount||0)+(n.usageMetadata.thoughtsTokenCount||0),cacheRead:n.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},r(t,e.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:m.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=t instanceof Error?t.message:JSON.stringify(t),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},y=(e,r,i)=>{let a=n(e,i,void 0);if(!i?.reasoning)return v(e,r,{...a,thinking:{enabled:!1}});let o=t(e,i.reasoning),s=o===`off`?`high`:o,c=e;return A(c)||j(c)?v(e,r,{...a,thinking:{enabled:!0,level:N(s,c)}}):v(e,r,{...a,thinking:{enabled:!0,budgetTokens:P(c,s,i.thinkingBudgets)}})};function b(e,t,n,r){return new f({vertexai:!0,project:t,location:n,apiVersion:m,httpOptions:S(e,r)})}function x(e,t,n){return new f({vertexai:!0,apiKey:t,apiVersion:m,httpOptions:S(e,n)})}function S(e,t){let n={},r=C(e.baseUrl);return r&&(n.baseUrl=r,n.baseUrlResourceScope=o.COLLECTION,w(r)&&(n.apiVersion=``)),(e.headers||t)&&(n.headers={...e.headers,...t}),Object.keys(n).length>0?n:void 0}function C(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function w(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 T(e){let t=e?.apiKey?.trim()||{}.GOOGLE_CLOUD_API_KEY?.trim();if(!(!t||t===h||E(t)))return t}function E(e){return/^<[^>]+>$/.test(e)}function D(e){let t=e?.project||{}.GOOGLE_CLOUD_PROJECT||{}.GCLOUD_PROJECT;if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function O(e){let t=e?.location||{}.GOOGLE_CLOUD_LOCATION;if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function k(e,t,n={}){let r=p(e,t),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let s={...Object.keys(o).length>0&&o,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:l(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:a(n.toolChoice)}}:s.toolConfig=void 0,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=g[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=M(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 A(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function j(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function M(e){let t=e;return A(t)?{thinkingLevel:c.LOW}:j(t)?{thinkingLevel:c.MINIMAL}:{thinkingBudget:0}}function N(e,t){if(A(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 P(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{v as streamGoogleVertex,y as streamSimpleGoogleVertex};
|