sliccy 3.32.0 → 3.32.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-0hBB-cvI.js +2 -0
- package/dist/ui/assets/adobe-Siq458HU.js +1 -0
- package/dist/ui/assets/{agent-bridge-BmPNQNyp.js → agent-bridge-B4fMRTq4.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-BULzciH_.js → agent-message-to-chat-BtGucQZb.js} +1 -1
- package/dist/ui/assets/{anthropic-C0qwC7-w.js → anthropic-BtADBMTr.js} +2 -2
- package/dist/ui/assets/{anthropic-CHHtdLPy.js → anthropic-ClPBBm6O.js} +2 -2
- package/dist/ui/assets/{apps-YH9ldD25.js → apps-JmnZT0_d.js} +1 -1
- package/dist/ui/assets/{azure-openai-DXygs5O6.js → azure-openai-BF07BSkG.js} +1 -1
- package/dist/ui/assets/{azure-openai-C9P5DkS8.js → azure-openai-BadnFKYq.js} +1 -1
- package/dist/ui/assets/azure-openai-responses-DAwt8x-O.js +1 -0
- package/dist/ui/assets/{azure-openai-responses-CpWuZozQ.js → azure-openai-responses-PyfCX2VE.js} +1 -1
- package/dist/ui/assets/{biome_wasm-CRr4JjWn.js → biome_wasm-CwT46YkP.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-DaXpKHAi.js → bsh-watchdog-DOS3grX1.js} +1 -1
- package/dist/ui/assets/{cdp-C2e8AyZy.js → cdp-B0CbWj0b.js} +3 -3
- package/dist/ui/assets/{cdp-ws-page-bridge-Cj43vtty.js → cdp-ws-page-bridge-BaREToXn.js} +1 -1
- package/dist/ui/assets/{common-Bec07QCB.js → common-DPijqIuN.js} +1 -1
- package/dist/ui/assets/{connect-surface-Ck_vQoam.js → connect-surface-B8X2BxSx.js} +1 -1
- package/dist/ui/assets/cost-command-CEPNh0VO.js +1 -0
- package/dist/ui/assets/{es-BVu1-m9n.js → es-BvNkEnLt.js} +5 -5
- package/dist/ui/assets/{follower-sprinkle-bridge-YKWY4PSL.js → follower-sprinkle-bridge-i8o45Iz0.js} +1 -1
- package/dist/ui/assets/{github-B2MUYew1.js → github-BHPt4SGX.js} +1 -1
- package/dist/ui/assets/{github-4lYWHWy0.js → github-D3FUw7Ft.js} +2 -2
- package/dist/ui/assets/{github-copilot-C52RjIpK.js → github-copilot-C1p7G_lc.js} +2 -2
- package/dist/ui/assets/{github-copilot-Uft2j7Oa.js → github-copilot-C7jxXCHT.js} +1 -1
- package/dist/ui/assets/google-DS3rVZP1.js +1 -0
- package/dist/ui/assets/{google-shared-BHU6i1pu.js → google-shared-Ck5bpSOw.js} +3 -3
- package/dist/ui/assets/{google-shared-BLw0sd3s.js → google-shared-DNHwaM2i.js} +1 -1
- package/dist/ui/assets/google-vertex-CkktMzxu.js +1 -0
- package/dist/ui/assets/{google-vertex-BOYR0o6q.js → google-vertex-CwyKiWDF.js} +1 -1
- package/dist/ui/assets/google-vnvvxTni.js +1 -0
- package/dist/ui/assets/hosted-config-apply-CAtsa6WM.js +1 -0
- package/dist/ui/assets/{intercepted-oauth-CkihOC6W.js → intercepted-oauth-CGJydQlU.js} +1 -1
- package/dist/ui/assets/{kernel-worker-thcJSaI4.js → kernel-worker-Cjl8fjr8.js} +977 -977
- package/dist/ui/assets/{lick-ws-bridge-DxWBoA9l.js → lick-ws-bridge-Ca7uAWlQ.js} +1 -1
- package/dist/ui/assets/{local-llm-CuKgZah9.js → local-llm-YcdPZyUH.js} +2 -2
- package/dist/ui/assets/{magick-wasm-CeJKAHiV.js → magick-wasm-C8lW0-35.js} +1 -1
- package/dist/ui/assets/{main-B17wOcQm.js → main-BccCPfVs.js} +120 -120
- package/dist/ui/assets/{main-cherry-BXAxhSxS.js → main-cherry-CfIm_qBH.js} +1 -1
- package/dist/ui/assets/{mistral-BAZMIGs3.js → mistral-DeuCdnLs.js} +2 -2
- package/dist/ui/assets/{mistral-COQuTqqc.js → mistral-Dgd8b7W0.js} +2 -2
- package/dist/ui/assets/{nodejs-BGy5U4JR.js → nodejs-D_wR4YhI.js} +1 -1
- package/dist/ui/assets/{nuke-command-DbDnIGqI.js → nuke-command-alibr6is.js} +1 -1
- package/dist/ui/assets/{oauth-1TWJ9Lpq.js → oauth-BvQKYNNy.js} +1 -1
- package/dist/ui/assets/oauth-bootstrap-BAnHB1H5.js +2 -0
- package/dist/ui/assets/{oauth-service-CsTUDTTA.js → oauth-service-2Bm2tu9h.js} +1 -1
- package/dist/ui/assets/{oauth-service-DUdG4vOP.js → oauth-service-HBkDeXXf.js} +1 -1
- package/dist/ui/assets/{offscreen-client-CbnPqFcd.js → offscreen-client-ijhP4Z8j.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-OseBY3e8.js → onboarding-orchestrator-VipPxQM9.js} +1 -1
- package/dist/ui/assets/{openai-codex-ChsSa-S2.js → openai-codex-BOCOi8v3.js} +1 -1
- package/dist/ui/assets/{openai-codex-CsEBtkzj.js → openai-codex-BquojmIo.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-BwePkD6g.js → openai-codex-responses-2_MR5Im1.js} +5 -5
- package/dist/ui/assets/{openai-codex-responses-BKsBblPU.js → openai-codex-responses-XAgywVT2.js} +3 -3
- package/dist/ui/assets/openai-completions-aOEJoPfR.js +5 -0
- package/dist/ui/assets/openai-responses-CSMuG2OA.js +1 -0
- package/dist/ui/assets/openai-responses-DV7QYgXj.js +1 -0
- package/dist/ui/assets/{openai-responses-shared-CefvrRUw.js → openai-responses-shared-BK_I3ssh.js} +4 -4
- package/dist/ui/assets/{openai-responses-shared-DVDbpbYT.js → openai-responses-shared-CU6P3yaz.js} +5 -5
- package/dist/ui/assets/{openrouter-CaSZyKf5.js → openrouter-C8oMEs0J.js} +1 -1
- package/dist/ui/assets/{openrouter-D-MziO8t.js → openrouter-ybLvFVQF.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-ChvAu4GP.js → panel-rpc-handlers-DHlnRnNz.js} +1 -1
- package/dist/ui/assets/{provider-Bdb6y9pT.js → provider-CuDhBMAi.js} +1 -1
- package/dist/ui/assets/{provider-BiuAThHu.js → provider-DB2BpoXt.js} +2 -2
- package/dist/ui/assets/provider-store-access-C_cZs2wy.js +1 -0
- package/dist/ui/assets/provider-store-access-DGBFQqC5.js +1 -0
- package/dist/ui/assets/{proxied-fetch-CtGAzJEA.js → proxied-fetch-ChX8PtVt.js} +1 -1
- package/dist/ui/assets/{pyodide-DFilkaFa.js → pyodide-CjGywQ7Z.js} +2 -2
- package/dist/ui/assets/{remote-terminal-view-B4qSW6nT.js → remote-terminal-view-BYUBsOyw.js} +1 -1
- package/dist/ui/assets/{secret-env-BVFnqist.js → secret-env-yupQt_od.js} +1 -1
- package/dist/ui/assets/{slicc-editor-BoFhrpq6.js → slicc-editor-Bdty0qFW.js} +1 -1
- package/dist/ui/assets/{spawn-CctKIs7F.js → spawn-BQL7p7C6.js} +1 -1
- package/dist/ui/assets/{sql-wasm-CiP_iqtv.js → sql-wasm-D0KJBRcf.js} +1 -1
- package/dist/ui/assets/{store-Cb6Dcgd1.js → store-CoqxzWD_.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-nxy6Ftte.js → tray-leave-runtime-DgzvG0cq.js} +1 -1
- package/dist/ui/assets/{typescript-C2iCtGbY.js → typescript-D8obSBRU.js} +3 -3
- package/dist/ui/assets/upgrade-detection-SLtjojQ6.js +1 -0
- package/dist/ui/assets/{web-BcJ-CPfm.js → web-2nwzshjs.js} +1 -1
- package/dist/ui/assets/ws-subscribers-D0P6rQ_C.js +1 -0
- package/dist/ui/assets/{xai-grok-BMnAJaG6.js → xai-grok-24FXuNvx.js} +1 -1
- package/dist/ui/assets/{xai-grok-DPkerKvQ.js → xai-grok-CGuHGhwm.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/adobe-Bst4BHL-.js +0 -1
- package/dist/ui/assets/adobe-DCdXi0ew.js +0 -2
- package/dist/ui/assets/azure-openai-responses-Dh9R4d9u.js +0 -1
- package/dist/ui/assets/cost-command-B7V2Fi3m.js +0 -1
- package/dist/ui/assets/google-DgtutA97.js +0 -1
- package/dist/ui/assets/google-Dx52dHvK.js +0 -1
- package/dist/ui/assets/google-vertex-DRWaCSkn.js +0 -1
- package/dist/ui/assets/hosted-config-apply-BuSIcpqX.js +0 -1
- package/dist/ui/assets/oauth-bootstrap-Dchkv1Zk.js +0 -2
- package/dist/ui/assets/openai-completions-zkTKSpSn.js +0 -5
- package/dist/ui/assets/openai-responses-BDGEO7hH.js +0 -1
- package/dist/ui/assets/openai-responses-CUDxDKLP.js +0 -1
- package/dist/ui/assets/provider-store-access-CN7MwCrJ.js +0 -1
- package/dist/ui/assets/provider-store-access-CWJRpyK3.js +0 -1
- package/dist/ui/assets/upgrade-detection-DdhyD4vU.js +0 -1
- package/dist/ui/assets/ws-subscribers-D75-mu3V.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,Z as t,et as n,y as r}from"./main-BccCPfVs.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-DNHwaM2i.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=(n,r,i)=>{let a=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-vertex`,provider:n.provider,model:n.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(n,o,i?.headers):b(n,D(i),O(i),i?.headers),l=k(n,r,i),f=await i?.onPayload?.(l,n);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:t});let m=null,h=t.content,g=()=>h.length-1;for await(let r of p){t.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 n=d(e);(!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:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:t})):(m={type:`text`,text:``},t.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:t}))),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:t})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:t}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),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()}_${++_}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:t})}}i?.finishReason&&(t.stopReason=s(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),r.usageMetadata&&(t.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}},e(n,t.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),i?.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=i?.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},y=(e,t,i)=>{let a=r(e,i,void 0);if(!i?.reasoning)return v(e,t,{...a,thinking:{enabled:!1}});let o=n(e,i.reasoning),s=o===`off`?`high`:o,c=e;return A(c)||j(c)?v(e,t,{...a,thinking:{enabled:!0,level:N(s,c)}}):v(e,t,{...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{
|
|
1
|
+
import{K as e,W as t,k as n,l as r,q as i}from"./kernel-worker-Cjl8fjr8.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-Ck5bpSOw.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=(n,r,i)=>{let a=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-vertex`,provider:n.provider,model:n.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(n,o,i?.headers):v(n,T(i),E(i),i?.headers),l=D(n,r,i),f=await i?.onPayload?.(l,n);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 r of p){t.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 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})}}i?.finishReason&&(t.stopReason=s(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),r.usageMetadata&&(t.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}},e(n,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})),i?.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=i?.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},_=(e,t,r)=>{let a=n(e,r,void 0);if(!r?.reasoning)return g(e,t,{...a,thinking:{enabled:!1}});let o=i(e,r.reasoning),s=o===`off`?`high`:o,c=e;return O(c)||k(c)?g(e,t,{...a,thinking:{enabled:!0,level:j(s,c)}}):g(e,t,{...a,thinking:{enabled:!0,budgetTokens:M(c,s,r.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,Z as t,et as n,it as r,y as i}from"./main-BccCPfVs.js";import{t as a}from"./sanitize-unicode-DmIE6hZJ.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./google-shared-DNHwaM2i.js";var p=0,m=(n,i,a)=>{let o=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-generative-ai`,provider:n.provider,model:n.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 c=g(n,a?.apiKey||r(n.provider)||``,a?.headers),d=_(n,i,a),f=await a?.onPayload?.(d,n);f!==void 0&&(d=f);let m=await c.models.generateContentStream(d);o.push({type:`start`,partial:t});let h=null,v=t.content,y=()=>v.length-1;for await(let r of m){t.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 n=u(e);(!h||n&&h.type!==`thinking`||!n&&h.type!==`text`)&&(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:v.length-1,content:h.text,partial:t}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:t})),n?(h={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(h),o.push({type:`thinking_start`,contentIndex:y(),partial:t})):(h={type:`text`,text:``},t.content.push(h),o.push({type:`text_start`,contentIndex:y(),partial:t}))),h.type===`thinking`?(h.thinking+=e.text,h.thinkingSignature=l(h.thinkingSignature,e.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:y(),delta:e.text,partial:t})):(h.text+=e.text,h.textSignature=l(h.textSignature,e.thoughtSignature),o.push({type:`text_delta`,contentIndex:y(),delta:e.text,partial:t}))}if(e.functionCall){h&&=(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:t}):o.push({type:`thinking_end`,contentIndex:y(),content:h.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()}_${++p}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),o.push({type:`toolcall_start`,contentIndex:y(),partial:t}),o.push({type:`toolcall_delta`,contentIndex:y(),delta:JSON.stringify(r.arguments),partial:t}),o.push({type:`toolcall_end`,contentIndex:y(),toolCall:r,partial:t})}}i?.finishReason&&(t.stopReason=s(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),r.usageMetadata&&(t.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}},e(n,t.usage))}if(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:t}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:t})),a?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`aborted`||t.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:t.stopReason,message:t}),o.end()}catch(e){for(let e of t.content)`index`in e&&delete e.index;t.stopReason=a?.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),o.push({type:`error`,reason:t.stopReason,error:t}),o.end()}})(),o},h=(e,t,a)=>{let o=a?.apiKey||r(e.provider);if(!o)throw Error(`No API key for provider: ${e.provider}`);let s=i(e,a,o);if(!a?.reasoning)return m(e,t,{...s,thinking:{enabled:!1}});let c=n(e,a.reasoning),l=c===`off`?`high`:c,u=e;return y(u)||b(u)||v(u)?m(e,t,{...s,thinking:{enabled:!0,level:S(l,u)}}):m(e,t,{...s,thinking:{enabled:!0,budgetTokens:C(u,l,a.thinkingBudgets)}})};function g(e,t,n){let r={};return e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``),(e.headers||n)&&(r.headers={...e.headers,...n}),new d({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function _(e,t,n={}){let r=f(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:c(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:o(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=n.thinking.level,s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=x(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 v(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function b(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function x(e){return y(e)?{thinkingLevel:`LOW`}:b(e)||v(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function S(e,t){if(y(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(v(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;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 C(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-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{m as streamGoogle,h as streamSimpleGoogle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./main-BccCPfVs.js";var t=e(`hosted-config`);async function n(e,t){let n=new Set(e.map(e=>e.providerId));for(let n of e)n.kind===`oauth`?await t.saveOAuthAccount({providerId:n.providerId,accessToken:n.accessToken,refreshToken:n.refreshToken,tokenExpiresAt:n.tokenExpiresAt,userName:n.userName,baseUrl:n.baseUrl}):t.addAccount(n.providerId,n.apiKey,n.baseUrl,n.deployment,n.apiVersion);let r=new Set(t.previouslyManaged());for(let e of t.currentProviderIds())r.has(e)&&!n.has(e)&&await t.removeAccount(e)}async function r(e,n,r=5e3){await Promise.all(e.map(async e=>{if(e.kind!==`oauth`||!e.accessToken)return;let i=n.getRefreshModels(e.providerId);if(i)try{await Promise.race([i(e.accessToken),new Promise(e=>setTimeout(e,r))])}catch(n){t.warn(`prewarm: refreshModels failed; cone boots with cold model metadata`,{providerId:e.providerId,error:n instanceof Error?n.message:String(n)})}}))}export{n as applyHostedAccounts,r as prewarmHostedModels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ht as e}from"./kernel-worker-Cjl8fjr8.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};
|