sliccy 3.7.0 → 3.9.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/ui/assets/{adobe-Bb9Koo41.js → adobe-Bt5g8KQ8.js} +1 -1
- package/dist/ui/assets/{adobe-C83SQyit.js → adobe-CnR62Zz4.js} +2 -2
- package/dist/ui/assets/{agent-bridge-CqFAtXhQ.js → agent-bridge-jV-wd2rf.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-B5maV2R5.js → agent-message-to-chat-B8V1gOsM.js} +1 -1
- package/dist/ui/assets/{anthropic-B_W-Zf1F.js → anthropic-iVM3-a35.js} +1 -1
- package/dist/ui/assets/{anthropic-DFqMAkaW.js → anthropic-mL3ywMPV.js} +1 -1
- package/dist/ui/assets/{apps-CQcu3SPP.js → apps-DRVsIBBx.js} +1 -1
- package/dist/ui/assets/{azure-openai-N2PiMhaz.js → azure-openai-Cx5Pj5oC.js} +1 -1
- package/dist/ui/assets/{azure-openai-miFUu6Hv.js → azure-openai-JPzwToVw.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-DOyJjHhU.js → azure-openai-responses-CXt7G9Am.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-k5E1atrw.js → azure-openai-responses-nU5pAWHz.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-CqkW32Q7.js → bsh-watchdog-CEYald81.js} +1 -1
- package/dist/ui/assets/{cdp-DRnArGXe.js → cdp-DgQAS7RO.js} +3 -3
- package/dist/ui/assets/cost-command-CSFioZjM.js +1 -0
- package/dist/ui/assets/{es-HXRnKgrk.js → es-B67k6SZx.js} +1 -1
- package/dist/ui/assets/{follower-sprinkle-bridge-_PGckvHb.js → follower-sprinkle-bridge-DSIoRDT8.js} +1 -1
- package/dist/ui/assets/{github-C-Z3n5Xc.js → github-CK_6pj34.js} +2 -2
- package/dist/ui/assets/{github-BENqO11g.js → github-vJrAPitt.js} +1 -1
- package/dist/ui/assets/{google-BaN03Ews.js → google-CO7YjBwe.js} +1 -1
- package/dist/ui/assets/{google-7RDpSFjr.js → google-C_70cIVo.js} +1 -1
- package/dist/ui/assets/{google-shared-B50LC94Y.js → google-shared-BzCwNN5i.js} +1 -1
- package/dist/ui/assets/{google-shared-DQIr6_u6.js → google-shared-LxsopJXA.js} +1 -1
- package/dist/ui/assets/{google-vertex-DmQqHOd3.js → google-vertex-CmQxc5zO.js} +1 -1
- package/dist/ui/assets/{google-vertex-fe0XTrlp.js → google-vertex-DA-3dPhk.js} +1 -1
- package/dist/ui/assets/{intercepted-oauth-DZunMpOb.js → intercepted-oauth-DiLTU8Ii.js} +1 -1
- package/dist/ui/assets/{kernel-worker-C5VWVo3p.js → kernel-worker-BC6z3xjS.js} +1104 -1196
- package/dist/ui/assets/{lick-ws-bridge-BlpI5Vfh.js → lick-ws-bridge-BySQiZfZ.js} +1 -1
- package/dist/ui/assets/{local-llm-B9x9dHMp.js → local-llm-RHAVtkGQ.js} +1 -1
- package/dist/ui/assets/{magick-wasm-DTuiyppo.js → magick-wasm-C7EkxjX-.js} +1 -1
- package/dist/ui/assets/{main-CGBwb-Z7.js → main-BHLxIMys.js} +201 -187
- package/dist/ui/assets/{mistral-DNRus666.js → mistral-Chz686k5.js} +1 -1
- package/dist/ui/assets/{mistral-Bm98WJNR.js → mistral-Dx-x1MfD.js} +1 -1
- package/dist/ui/assets/{nuke-command-CC3imLyj.js → nuke-command-qvwqiQHy.js} +1 -1
- package/dist/ui/assets/{oauth-DBX2TVKl.js → oauth-CG3epMwm.js} +1 -1
- package/dist/ui/assets/{oauth-bootstrap-DOOX1I7K.js → oauth-bootstrap-CollSvx8.js} +2 -2
- package/dist/ui/assets/{oauth-service-Bv4EZbHs.js → oauth-service-Bby2XbV9.js} +1 -1
- package/dist/ui/assets/{oauth-service-v9k7zmDr.js → oauth-service-CsGFgUI2.js} +1 -1
- package/dist/ui/assets/{offscreen-client-C8dacNXH.js → offscreen-client-BgFTGLb6.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-C_kYnC4g.js → onboarding-orchestrator-BdKyK2bb.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-DQIglX1K.js → openai-codex-responses-CYZE7Ri0.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-DW1a9bCj.js → openai-codex-responses-DrQ-9KYF.js} +1 -1
- package/dist/ui/assets/{openai-completions-ChQDZA6E.js → openai-completions-Crq53Ayo.js} +1 -1
- package/dist/ui/assets/{openai-responses-Pm8J-HuA.js → openai-responses-DZWvz_eT.js} +1 -1
- package/dist/ui/assets/{openai-responses-CY2Kt17O.js → openai-responses-NpY-7Q9b.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-DsbHT7ZR.js → openai-responses-shared-D1mo55LS.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-CVjR8F2I.js → openai-responses-shared-D8o41Qqd.js} +1 -1
- package/dist/ui/assets/{openrouter-C17Qgp_a.js → openrouter-CatA7kSh.js} +1 -1
- package/dist/ui/assets/{openrouter-YvEDVJjZ.js → openrouter-DZjPMgbr.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-D3TvKTBJ.js → panel-rpc-handlers-BJ-wBZiF.js} +1 -1
- package/dist/ui/assets/{provider-DQdgU2cB.js → provider--7zezZNA.js} +1 -1
- package/dist/ui/assets/{provider-CVQ1-hiX.js → provider-BbarSgl8.js} +2 -2
- package/dist/ui/assets/provider-store-access-CcWgx9ta.js +1 -0
- package/dist/ui/assets/provider-store-access-IMgEIUH6.js +1 -0
- package/dist/ui/assets/{proxied-fetch-BD4Aw_98.js → proxied-fetch-BQDZVMp5.js} +1 -1
- package/dist/ui/assets/{pyodide-DjwZMHCM.js → pyodide-CoTxJ1oh.js} +2 -2
- package/dist/ui/assets/{remote-terminal-view-BY0dldZw.js → remote-terminal-view-D1HhRHw_.js} +1 -1
- package/dist/ui/assets/{secret-env-CRC281WY.js → secret-env-7EK-8pGt.js} +1 -1
- package/dist/ui/assets/{slicc-editor-DWlyJ8F2.js → slicc-editor-BySG3JWk.js} +1 -1
- package/dist/ui/assets/{spawn-7IvlkEig.js → spawn-Dqw1vU56.js} +1 -1
- package/dist/ui/assets/{sql-wasm-CwnEMigK.js → sql-wasm-1BJYGQai.js} +1 -1
- package/dist/ui/assets/{store-j2Druu0N.js → store-DrwbCi-e.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-Bn8j6E27.js → tray-leave-runtime-oNz7QQtO.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-3mhOWPt2.js → upgrade-detection-CaXKHhN-.js} +1 -1
- package/dist/ui/assets/{xai-grok-Che7ONVU.js → xai-grok-5wPTQels.js} +1 -1
- package/dist/ui/assets/{xai-grok-Doi4Og_5.js → xai-grok-Dw1VTeHT.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-Qd6vdo4-.js +0 -1
- package/dist/ui/assets/provider-store-access-HJH7Oiu7.js +0 -1
- package/dist/ui/assets/provider-store-access-R_T_zm3J.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,L as t,b as n,o as r,z as i}from"./kernel-worker-
|
|
1
|
+
import{B as e,L as t,b as n,o as r,z as i}from"./kernel-worker-BC6z3xjS.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-BzCwNN5i.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=n(t,i,void 0);if(!i?.reasoning)return g(t,r,{...a,thinking:{enabled:!1}});let o=e(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{H as e,V as t,y as n,z as r}from"./main-
|
|
1
|
+
import{H as e,V as t,y as n,z as r}from"./main-BHLxIMys.js";import{t as i}from"./sanitize-unicode-B1z_Y4Dq.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-LxsopJXA.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,n,i)=>{let a=new r;return(async()=>{let r={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,n,i),f=await i?.onPayload?.(l,e);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:r});let m=null,h=r.content,g=()=>h.length-1;for await(let n of p){r.responseId||=n.responseId;let i=n.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:r}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:r})),t?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},r.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:r})):(m={type:`text`,text:``},r.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:r}))),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:r})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:r}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:r}),null);let t=e.functionCall.id,n={type:`toolCall`,id:!t||r.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}};r.content.push(n),a.push({type:`toolcall_start`,contentIndex:g(),partial:r}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(n.arguments),partial:r}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:n,partial:r})}}i?.finishReason&&(r.stopReason=s(i.finishReason),r.content.some(e=>e.type===`toolCall`)&&(r.stopReason=`toolUse`)),n.usageMetadata&&(r.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}},t(e,r.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:r})),i?.signal?.aborted)throw Error(`Request was aborted`);if(r.stopReason===`aborted`||r.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:r.stopReason,message:r}),a.end()}catch(e){for(let e of r.content)`index`in e&&delete e.index;r.stopReason=i?.signal?.aborted?`aborted`:`error`,r.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:r.stopReason,error:r}),a.end()}})(),a},y=(t,r,i)=>{let a=n(t,i,void 0);if(!i?.reasoning)return v(t,r,{...a,thinking:{enabled:!1}});let o=e(t,i.reasoning),s=o===`off`?`high`:o,c=t;return A(c)||j(c)?v(t,r,{...a,thinking:{enabled:!0,level:N(s,c)}}):v(t,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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{it as e}from"./kernel-worker-
|
|
1
|
+
import{it as e}from"./kernel-worker-BC6z3xjS.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};
|