sliccy 3.28.0 → 3.28.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/ui/assets/{adobe-BsI2QHM-.js → adobe-BtNEy-OF.js} +1 -1
- package/dist/ui/assets/{adobe-CMOt6RBV.js → adobe-CN-RTZJm.js} +2 -2
- package/dist/ui/assets/{agent-bridge-hW415QAE.js → agent-bridge-BawrCwNK.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-DxvgRMh2.js → agent-message-to-chat-kuKl0nA4.js} +1 -1
- package/dist/ui/assets/{anthropic-BC6K6cdY.js → anthropic-Bh5XSMjg.js} +1 -1
- package/dist/ui/assets/{anthropic-6xJJ2YZO.js → anthropic-iZ8lKeOw.js} +1 -1
- package/dist/ui/assets/{apps-Dr9FIzjl.js → apps-Df8C5jAQ.js} +1 -1
- package/dist/ui/assets/{azure-openai-BaAPMfG9.js → azure-openai-BfIN4FYk.js} +1 -1
- package/dist/ui/assets/{azure-openai-BMUF5f0d.js → azure-openai-CspsPmGG.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-CG2x6ghy.js → azure-openai-responses-BF_jdTm7.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-DJv1qDQU.js → azure-openai-responses-DxRtaqN-.js} +1 -1
- package/dist/ui/assets/{biome_wasm-BzCoRiez.js → biome_wasm-CZ9Jj8Ms.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-BhyyrsLG.js → bsh-watchdog-4N2xJA-P.js} +1 -1
- package/dist/ui/assets/{cdp-CVhzXRUr.js → cdp-_lPNsBbI.js} +3 -3
- package/dist/ui/assets/{cdp-ws-page-bridge-DIQyPbnc.js → cdp-ws-page-bridge-BpJIEvxM.js} +1 -1
- package/dist/ui/assets/{common-CuKB31Bx.js → common-CZk2yaM-.js} +1 -1
- package/dist/ui/assets/{connect-surface-CCGvblVO.js → connect-surface-Bmhtbe56.js} +1 -1
- package/dist/ui/assets/cost-command-B7isbRJf.js +1 -0
- package/dist/ui/assets/{es-Cv6f-0s7.js → es-DwTQw8_c.js} +1 -1
- package/dist/ui/assets/{follower-sprinkle-bridge-DEAKinMn.js → follower-sprinkle-bridge-CWyFRHis.js} +1 -1
- package/dist/ui/assets/{github-IUCTxlu3.js → github-DBZ7Mcvy.js} +2 -2
- package/dist/ui/assets/{github-8u3THsb9.js → github-H0LQdcC4.js} +1 -1
- package/dist/ui/assets/{github-copilot-DgFjN6KZ.js → github-copilot-CgR20_NT.js} +1 -1
- package/dist/ui/assets/{github-copilot-BpjWdMXh.js → github-copilot-DmeF_ZmQ.js} +2 -2
- package/dist/ui/assets/{google-fooyUc87.js → google-DbpRYzbj.js} +1 -1
- package/dist/ui/assets/{google-CE3pVXMY.js → google-DdciMiC6.js} +1 -1
- package/dist/ui/assets/{google-shared-C_9EKNrW.js → google-shared-Bz8F0Bm0.js} +1 -1
- package/dist/ui/assets/{google-shared-CvX1HGJK.js → google-shared-DJoffhni.js} +1 -1
- package/dist/ui/assets/{google-vertex-Wf1pkd9h.js → google-vertex-D1G_kg-E.js} +1 -1
- package/dist/ui/assets/{google-vertex-FAi9wG7t.js → google-vertex-Dzju2EFK.js} +1 -1
- package/dist/ui/assets/{intercepted-oauth-onIAQjXH.js → intercepted-oauth-Bxv8mNkX.js} +1 -1
- package/dist/ui/assets/{kernel-worker-DrqmmlLF.js → kernel-worker-Ql5P-V8j.js} +964 -964
- package/dist/ui/assets/{lick-ws-bridge-DEwdAGsC.js → lick-ws-bridge-D9xuCXcH.js} +1 -1
- package/dist/ui/assets/{local-llm-Q03t5xci.js → local-llm-CaRFUGQQ.js} +1 -1
- package/dist/ui/assets/{magick-wasm-BA_z-_am.js → magick-wasm-C-j83c4l.js} +1 -1
- package/dist/ui/assets/{main-BlxLnse7.js → main-BlCaLoTb.js} +186 -186
- package/dist/ui/assets/{main-cherry-D44F4Vlh.js → main-cherry-CjPFm9-r.js} +1 -1
- package/dist/ui/assets/{mistral-yWGuKrq4.js → mistral-Dg7B-fzS.js} +1 -1
- package/dist/ui/assets/{mistral-DEjW9qqh.js → mistral-zrG2ID03.js} +1 -1
- package/dist/ui/assets/{nodejs-CfVKCb8p.js → nodejs-CllneRib.js} +1 -1
- package/dist/ui/assets/{nuke-command-BHFb7iYV.js → nuke-command-Dv-1fMKD.js} +1 -1
- package/dist/ui/assets/{oauth-DaANiDrq.js → oauth-Cvc_3IxZ.js} +1 -1
- package/dist/ui/assets/{oauth-bootstrap-DdTo_8kc.js → oauth-bootstrap-ByqEpcEC.js} +2 -2
- package/dist/ui/assets/{oauth-service-CGlrsCXI.js → oauth-service-CZMahUvI.js} +1 -1
- package/dist/ui/assets/{oauth-service-Ct9lZUcR.js → oauth-service-kRXj8Xt_.js} +1 -1
- package/dist/ui/assets/{offscreen-client-DQeDUS4X.js → offscreen-client-fHaJw8aK.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-BN98n0DZ.js → onboarding-orchestrator-BnWILcnQ.js} +1 -1
- package/dist/ui/assets/{openai-codex-H4Rpya6U.js → openai-codex-C4ph1N9s.js} +1 -1
- package/dist/ui/assets/{openai-codex-DCZS82Tv.js → openai-codex-CtFed_5F.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-BOKYXvIU.js → openai-codex-responses-BG-fa7dO.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-D8oxdjNx.js → openai-codex-responses-iV06NcsK.js} +1 -1
- package/dist/ui/assets/{openai-completions-zAlP8W8O.js → openai-completions-BIZRM0Vg.js} +1 -1
- package/dist/ui/assets/{openai-responses-1AuAFhF4.js → openai-responses-BrxQ4OtB.js} +1 -1
- package/dist/ui/assets/{openai-responses-Bm1d6S7j.js → openai-responses-DRvLrjNe.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-CyGENinm.js → openai-responses-shared-BsWdZpPM.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-DtjQSz4-.js → openai-responses-shared-Dy-mOoFo.js} +1 -1
- package/dist/ui/assets/{openrouter-BjNEb_vt.js → openrouter-CRw79RQB.js} +1 -1
- package/dist/ui/assets/{openrouter-Cy7d-Hse.js → openrouter-CzN7Clkq.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-BIBd7qwX.js → panel-rpc-handlers-DtSP4NHe.js} +1 -1
- package/dist/ui/assets/{provider-B4kcdYSm.js → provider-DrmA7J38.js} +2 -2
- package/dist/ui/assets/{provider-D62HUJ72.js → provider-g0QyYe52.js} +1 -1
- package/dist/ui/assets/provider-store-access-DNYakeA7.js +1 -0
- package/dist/ui/assets/provider-store-access-DNd1fp7K.js +1 -0
- package/dist/ui/assets/{proxied-fetch-Ku3mKDDw.js → proxied-fetch-2Es3kSez.js} +1 -1
- package/dist/ui/assets/{pyodide-BzzXGKXZ.js → pyodide-DhC_gboo.js} +2 -2
- package/dist/ui/assets/{remote-terminal-view-Aip8SZl4.js → remote-terminal-view-Bt3ZYxVs.js} +1 -1
- package/dist/ui/assets/{secret-env-BXrNc3Yc.js → secret-env-BxmYy-Wu.js} +1 -1
- package/dist/ui/assets/{slicc-editor-DxNnkMN4.js → slicc-editor-D-Cb6XTh.js} +1 -1
- package/dist/ui/assets/{spawn-NJPpLzuU.js → spawn-cCTEv8cx.js} +1 -1
- package/dist/ui/assets/{sql-wasm-BatnsmsR.js → sql-wasm-CuJ-VLHJ.js} +1 -1
- package/dist/ui/assets/{store-Cu-dZ-Qd.js → store-wKJlAPht.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-B3OyxolX.js → tray-leave-runtime-Dco8hOq1.js} +1 -1
- package/dist/ui/assets/{typescript-DAY1Zzuh.js → typescript-CEI2h2hD.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-BSSXcDy5.js → upgrade-detection-B-wgTSLo.js} +1 -1
- package/dist/ui/assets/{web-CJrS_pPN.js → web-CVRcma8w.js} +1 -1
- package/dist/ui/assets/{ws-subscribers-B8hdAhNQ.js → ws-subscribers-D0SkGJR8.js} +1 -1
- package/dist/ui/assets/{xai-grok-Cil1zzx5.js → xai-grok-Bv45b0ot.js} +1 -1
- package/dist/ui/assets/{xai-grok-CKHIBDys.js → xai-grok-XvYqwX8g.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/ui/packages/webapp/index.html +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/cost-command-7TPmiftF.js +0 -1
- package/dist/ui/assets/provider-store-access-DUMZRNG6.js +0 -1
- package/dist/ui/assets/provider-store-access-XwHcqQAV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,Q as t,X as n,v as r}from"./main-
|
|
1
|
+
import{$ as e,Q as t,X as n,v as r}from"./main-BlCaLoTb.js";import{t as i}from"./sanitize-unicode-DmIE6hZJ.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-DJoffhni.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=(e,r,i)=>{let a=new n;return(async()=>{let n={role:`assistant`,content:[],api:`google-vertex`,provider:e.provider,model:e.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(e,o,i?.headers):b(e,D(i),O(i),i?.headers),l=k(e,r,i),f=await i?.onPayload?.(l,e);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:n});let m=null,h=n.content,g=()=>h.length-1;for await(let r of p){n.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let e of i.content.parts){if(e.text!==void 0){let t=d(e);(!m||t&&m.type!==`thinking`||!t&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:h.length-1,content:m.text,partial:n}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:n})),t?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},n.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:n})):(m={type:`text`,text:``},n.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:n}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:e.text,partial:n})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:n}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:n}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:n}),null);let t=e.functionCall.id,r={type:`toolCall`,id:!t||n.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++_}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};n.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:n}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:n}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:n})}}i?.finishReason&&(n.stopReason=s(i.finishReason),n.content.some(e=>e.type===`toolCall`)&&(n.stopReason=`toolUse`)),r.usageMetadata&&(n.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,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t(e,n.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:n}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:n})),i?.signal?.aborted)throw Error(`Request was aborted`);if(n.stopReason===`aborted`||n.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:n.stopReason,message:n}),a.end()}catch(e){for(let e of n.content)`index`in e&&delete e.index;n.stopReason=i?.signal?.aborted?`aborted`:`error`,n.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:n.stopReason,error:n}),a.end()}})(),a},y=(t,n,i)=>{let a=r(t,i,void 0);if(!i?.reasoning)return v(t,n,{...a,thinking:{enabled:!1}});let o=e(t,i.reasoning),s=o===`off`?`high`:o,c=t;return A(c)||j(c)?v(t,n,{...a,thinking:{enabled:!0,level:N(s,c)}}):v(t,n,{...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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,G as t,J as n,l as r,q as i}from"./kernel-worker-
|
|
1
|
+
import{A as e,G as t,J as n,l as r,q as i}from"./kernel-worker-Ql5P-V8j.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-Bz8F0Bm0.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=(e,n,r)=>{let a=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-vertex`,provider:e.provider,model:e.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(r),c=o?y(e,o,r?.headers):v(e,T(r),E(r),r?.headers),l=D(e,n,r),f=await r?.onPayload?.(l,e);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:t});let m=null,g=t.content,_=()=>g.length-1;for await(let n of p){t.responseId||=n.responseId;let r=n.candidates?.[0];if(r?.content?.parts)for(let e of r.content.parts){if(e.text!==void 0){let n=d(e);(!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:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:t})):(m={type:`text`,text:``},t.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:t}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:e.text,partial:t})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:e.text,partial:t}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t}),null);let n=e.functionCall.id,r={type:`toolCall`,id:!n||t.content.some(e=>e.type===`toolCall`&&e.id===n)?`${e.functionCall.name}_${Date.now()}_${++h}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:t})}}r?.finishReason&&(t.stopReason=s(r.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),n.usageMetadata&&(t.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}},i(e,t.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t})),r?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`aborted`||t.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:t.stopReason,message:t}),a.end()}catch(e){for(let e of t.content)`index`in e&&delete e.index;t.stopReason=r?.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:t.stopReason,error:t}),a.end()}})(),a},_=(t,r,i)=>{let a=e(t,i,void 0);if(!i?.reasoning)return g(t,r,{...a,thinking:{enabled:!1}});let o=n(t,i.reasoning),s=o===`off`?`high`:o,c=t;return O(c)||k(c)?g(t,r,{...a,thinking:{enabled:!0,level:j(s,c)}}):g(t,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 i=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:r(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:i,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{mt as e}from"./kernel-worker-
|
|
1
|
+
import{mt as e}from"./kernel-worker-Ql5P-V8j.js";var t=e({applyRewrites:()=>o,createInterceptingOAuthLauncher:()=>s,parseInterceptOAuthConfig:()=>n});function n(e){if(typeof e!=`object`||!e||Array.isArray(e))return{ok:!1,error:`expected a JSON object`};let t=e;if(typeof t.authorizeUrl!=`string`||t.authorizeUrl.length===0)return{ok:!1,error:`authorizeUrl must be a non-empty string`};if(typeof t.redirectUriPattern!=`string`||t.redirectUriPattern.length===0)return{ok:!1,error:`redirectUriPattern must be a non-empty string`};if(t.onCapture!==void 0&&t.onCapture!==`close`&&t.onCapture!==`leave`)return{ok:!1,error:`onCapture must be "close" or "leave"`};if(t.timeoutMs!==void 0&&(typeof t.timeoutMs!=`number`||t.timeoutMs<=0))return{ok:!1,error:`timeoutMs must be a positive number`};let n=r(t.rewrite);return n.ok?{ok:!0,config:{authorizeUrl:t.authorizeUrl,redirectUriPattern:t.redirectUriPattern,rewrite:n.rewrites,onCapture:t.onCapture,timeoutMs:t.timeoutMs}}:n}function r(e){if(e===void 0)return{ok:!0,rewrites:void 0};if(!Array.isArray(e))return{ok:!1,error:`rewrite must be an array`};let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(typeof r!=`object`||!r)return{ok:!1,error:`rewrite[${n}] must be an object`};let i=r;if(typeof i.match!=`string`||i.match.length===0)return{ok:!1,error:`rewrite[${n}].match must be a non-empty string`};if(i.replaceUrl!==void 0&&typeof i.replaceUrl!=`string`)return{ok:!1,error:`rewrite[${n}].replaceUrl must be a string when present`};if(i.appendParams!==void 0){if(typeof i.appendParams!=`object`||i.appendParams===null||Array.isArray(i.appendParams))return{ok:!1,error:`rewrite[${n}].appendParams must be an object`};for(let[e,t]of Object.entries(i.appendParams))if(typeof t!=`string`)return{ok:!1,error:`rewrite[${n}].appendParams.${e} must be a string`}}t.push({match:i.match,appendParams:i.appendParams,replaceUrl:i.replaceUrl})}return{ok:!0,rewrites:t}}function i(e,t){return t.endsWith(`*`)?e.startsWith(t.slice(0,-1)):e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}#`)}function a(e){return e.endsWith(`*`)?e:`${e}*`}function o(e,t){if(!t||t.length===0)return e;let n=e;for(let e of t)if(n.includes(e.match)){if(e.replaceUrl){n=e.replaceUrl;continue}if(e.appendParams)try{let t=new URL(n);for(let[n,r]of Object.entries(e.appendParams))t.searchParams.set(n,r);n=t.toString()}catch{}}return n}function s(e){return async t=>{let n=t.timeoutMs??12e4,r=t.rewrite??[],s=t.onCapture??`close`,c,l,u=!1,d=null,f=async()=>{if(l){try{await e.send(`Fetch.disable`,{},l)}catch{}try{await e.send(`Target.detachFromTarget`,{sessionId:l})}catch{}}if(c&&s===`close`)try{await e.send(`Target.closeTarget`,{targetId:c})}catch{}};return await new Promise(s=>{let p=async t=>{u||(u=!0,clearTimeout(h),e.off(`Fetch.requestPaused`,m),await f(),s(t))},m=n=>{let a=n;if(!a?.request?.url||!l||(typeof n.sessionId==`string`?n.sessionId:void 0)!==l)return;if(i(a.request.url,t.redirectUriPattern)){d=a.request.url,e.send(`Fetch.failRequest`,{requestId:a.requestId,errorReason:`Aborted`},l).catch(()=>{}),p(d);return}let s=o(a.request.url,r);if(s!==a.request.url){e.send(`Fetch.continueRequest`,{requestId:a.requestId,url:s},l).catch(e=>{console.warn(`[intercepted-oauth] continueRequest (rewrite) failed:`,e instanceof Error?e.message:String(e))});return}e.send(`Fetch.continueRequest`,{requestId:a.requestId},l).catch(()=>{})},h=setTimeout(()=>{p(null)},n);(async()=>{try{c=(await e.send(`Target.createTarget`,{url:`about:blank`})).targetId,l=(await e.send(`Target.attachToTarget`,{targetId:c,flatten:!0})).sessionId,e.on(`Fetch.requestPaused`,m),await e.send(`Fetch.enable`,{patterns:[{urlPattern:a(t.redirectUriPattern),requestStage:`Request`},...r.map(e=>({urlPattern:`*${e.match}*`,requestStage:`Request`}))]},l),await e.send(`Page.navigate`,{url:t.authorizeUrl},l)}catch(e){console.error(`[intercepted-oauth] setup failed:`,e instanceof Error?e.message:String(e)),p(null)}})()})}}export{t as n,s as t};
|