sliccy 3.1.0 → 3.2.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/README.md +1 -1
- package/dist/ui/assets/__vite-browser-external-B0Aozsa-.js +1 -0
- package/dist/ui/assets/adobe-CIhJaB8m.js +1 -0
- package/dist/ui/assets/adobe-nI2lXFZS.js +2 -0
- package/dist/ui/assets/agent-bridge-BOSnTfFR.js +1 -0
- package/dist/ui/assets/{agent-message-to-chat-CO-_I0_3.js → agent-message-to-chat-DWcpzWsT.js} +1 -1
- package/dist/ui/assets/anthropic-DSZwm6Il.js +39 -0
- package/dist/ui/assets/{anthropic-CW4Fql_O.js → anthropic-Dr7XjLnI.js} +2 -2
- package/dist/ui/assets/azure-openai-B0c3bdmX.js +1 -0
- package/dist/ui/assets/azure-openai-Sl6IRfiF.js +1 -0
- package/dist/ui/assets/azure-openai-responses-CyInI5pN.js +1 -0
- package/dist/ui/assets/azure-openai-responses-DlELGil5.js +1 -0
- package/dist/ui/assets/{bsh-watchdog-0KPLx0BS.js → bsh-watchdog-COpOvHJO.js} +1 -1
- package/dist/ui/assets/{cdp-zqEKj8zX.js → cdp-aFMV5D5H.js} +4 -4
- package/dist/ui/assets/cost-command-CAuxDd3O.js +1 -0
- package/dist/ui/assets/{dist-N8xNrrAa.js → dist-BTGs16AV.js} +1 -1
- package/dist/ui/assets/{dist-C867mOPm.js → dist-BcBxL8nL.js} +1 -1
- package/dist/ui/assets/{dist-VRuvLOER.js → dist-Bgcuvc8h.js} +1 -1
- package/dist/ui/assets/{dist-Dv2Nk_Uq.js → dist-EkY3RL7q.js} +1 -1
- package/dist/ui/assets/{dist-BT9E_vUE.js → dist-cK1g1pHF.js} +1 -1
- package/dist/ui/assets/{es-RM_apZN6.js → es-Fg9CJu2a.js} +5 -5
- package/dist/ui/assets/follower-sprinkle-bridge-DhazpaQ4.js +1 -0
- package/dist/ui/assets/github-B6QNU-3A.js +2 -0
- package/dist/ui/assets/github-sM7l0VoL.js +1 -0
- package/dist/ui/assets/google-CnlnlpZP.js +1 -0
- package/dist/ui/assets/google-D6c_sIut.js +1 -0
- package/dist/ui/assets/google-shared-BulFztPz.js +11 -0
- package/dist/ui/assets/{google-shared-D_qkojxq.js → google-shared-DhHenZn9.js} +3 -3
- package/dist/ui/assets/google-vertex-B1MO0HYD.js +1 -0
- package/dist/ui/assets/google-vertex-Bagm5hdl.js +1 -0
- package/dist/ui/assets/index-CVQ53vhp.js +1574 -0
- package/dist/ui/assets/intercepted-oauth-CLysites.js +1 -0
- package/dist/ui/assets/kernel-worker-DXnVtalJ.js +7651 -0
- package/dist/ui/assets/{local-llm-eF8GDq5b.js → local-llm-D75Fgjs0.js} +2 -2
- package/dist/ui/assets/magick-wasm-2lkhWhgt.js +1 -0
- package/dist/ui/assets/{mistral-BGhArSbR.js → mistral-BRR29uMI.js} +2 -2
- package/dist/ui/assets/{mistral-BjvHW1zm.js → mistral-BlIxxwbs.js} +2 -2
- package/dist/ui/assets/{nuke-command-SaFQ52mr.js → nuke-command-DTqz_Ptx.js} +1 -1
- package/dist/ui/assets/oauth-bootstrap-BVwa_nfZ.js +1 -0
- package/dist/ui/assets/oauth-service-DPEJn1wm.js +1 -0
- package/dist/ui/assets/oauth-service-DqXJQYDI.js +1 -0
- package/dist/ui/assets/offscreen-client-CRpw9tqj.js +1 -0
- package/dist/ui/assets/onboarding-orchestrator-lQP1nZ0U.js +1 -0
- package/dist/ui/assets/openai-codex-responses-Dc1_JfHA.js +7 -0
- package/dist/ui/assets/openai-codex-responses-_IImRqdn.js +7 -0
- package/dist/ui/assets/openai-completions-Btrw7eXb.js +5 -0
- package/dist/ui/assets/openai-responses-C_hKR-4u.js +1 -0
- package/dist/ui/assets/openai-responses-JZsTLlZ6.js +1 -0
- package/dist/ui/assets/{openai-responses-shared-iv5WheAz.js → openai-responses-shared-C6-6OmQ7.js} +3 -3
- package/dist/ui/assets/{openai-responses-shared-iYgA7Khl.js → openai-responses-shared-QJEgheLX.js} +4 -4
- package/dist/ui/assets/panel-rpc-handlers-Daa9NEEL.js +1 -0
- package/dist/ui/assets/{py-realm-worker-vbqFsiux.js → py-realm-worker-zrXeREDr.js} +1 -1
- package/dist/ui/assets/pyodide-Bv1KSh-_.js +3 -0
- package/dist/ui/assets/pyodide-C5AaR78M.js +3 -0
- package/dist/ui/assets/remote-terminal-view-C7kjPBGc.js +6 -0
- package/dist/ui/assets/secret-env-BREbgKZt.js +1 -0
- package/dist/ui/assets/slicc-editor-D8qyzAmK.js +12 -0
- package/dist/ui/assets/{spawn-BCQJvlZ6.js → spawn-DDHiq6QX.js} +1 -1
- package/dist/ui/assets/{sql-wasm-DZVUCGLK.js → sql-wasm-C4rwSbnn.js} +2 -2
- package/dist/ui/assets/upgrade-detection-ARQ7pi6W.js +1 -0
- package/dist/ui/assets/xai-grok-CJqWJw1A.js +1 -0
- package/dist/ui/assets/xai-grok-dQuvw1db.js +1 -0
- package/dist/ui/assets/{xai-grok-sanitize-DTcvIA0E.js → xai-grok-sanitize-BeI8rdV5.js} +1 -1
- package/dist/ui/assets/{xai-grok-sanitize-DsBfxZb8.js → xai-grok-sanitize-CiOn_xsO.js} +1 -1
- package/dist/ui/electron-overlay-entry.js +7 -7
- package/dist/ui/index.html +1 -20
- package/dist/ui/packages/webapp/index.html +1 -20
- package/package.json +3 -3
- package/dist/ui/assets/__vite-browser-external-CTFk2Lkt.js +0 -1
- package/dist/ui/assets/__vite-browser-external-CdaqDer8.js +0 -1
- package/dist/ui/assets/adobe-B-pbWvsC.js +0 -1
- package/dist/ui/assets/adobe-sfsf_4qf.js +0 -2
- package/dist/ui/assets/agent-bridge-B-oWMlDX.js +0 -1
- package/dist/ui/assets/anthropic-4ASJTRhO.js +0 -39
- package/dist/ui/assets/azure-openai-BD_sHVsp.js +0 -1
- package/dist/ui/assets/azure-openai-aTVRkWSi.js +0 -1
- package/dist/ui/assets/azure-openai-responses-C_KSa6jj.js +0 -1
- package/dist/ui/assets/azure-openai-responses-Ci2gkluO.js +0 -1
- package/dist/ui/assets/backend-local-BTd37iLF.js +0 -9
- package/dist/ui/assets/backend-local-CfhYopTE.js +0 -9
- package/dist/ui/assets/bedrock-camp-Bds6qFqf.js +0 -4
- package/dist/ui/assets/bedrock-camp-uPFt7YMZ.js +0 -5
- package/dist/ui/assets/chunk-Cn1BcAw8.js +0 -1
- package/dist/ui/assets/chunk-jRWAZmH_.js +0 -1
- package/dist/ui/assets/cost-command-CKxW3T3V.js +0 -1
- package/dist/ui/assets/db-DPvmo9md.js +0 -1
- package/dist/ui/assets/diagnostics-Bab61WyO.js +0 -1
- package/dist/ui/assets/diagnostics-C5z6rwkV.js +0 -1
- package/dist/ui/assets/env-api-keys-BoL4zxcb.js +0 -1
- package/dist/ui/assets/env-api-keys-DEKGEdJy.js +0 -1
- package/dist/ui/assets/follower-sprinkle-bridge-D98CB4QW.js +0 -1
- package/dist/ui/assets/fs-B4oiCmB6.js +0 -4
- package/dist/ui/assets/fs-DjItwHb7.js +0 -3
- package/dist/ui/assets/git-config-CxvDN7N3.js +0 -7
- package/dist/ui/assets/github-43qAI71s.js +0 -2
- package/dist/ui/assets/github-Bz0AhHTO.js +0 -1
- package/dist/ui/assets/github-copilot-headers-DPO4cOSI.js +0 -1
- package/dist/ui/assets/google-CBK_Mvyz.js +0 -1
- package/dist/ui/assets/google-gejI0Xd8.js +0 -1
- package/dist/ui/assets/google-shared-BB2MKu9Q.js +0 -11
- package/dist/ui/assets/google-vertex-tM5T-lH5.js +0 -1
- package/dist/ui/assets/google-vertex-wc4xtIz9.js +0 -1
- package/dist/ui/assets/headers-CGhBAvcc.js +0 -1
- package/dist/ui/assets/index-Dr4P8kcB.js +0 -1424
- package/dist/ui/assets/intercepted-oauth-CnYe4Pun.js +0 -1
- package/dist/ui/assets/json-parse-CKelIhmU.js +0 -3
- package/dist/ui/assets/json-parse-Cu2r6BfV.js +0 -3
- package/dist/ui/assets/kernel-worker-DVMS1qoG.js +0 -7546
- package/dist/ui/assets/local-llm-pOzJZUC2.js +0 -2
- package/dist/ui/assets/logger-B-No_qN_.js +0 -1
- package/dist/ui/assets/logger-BHrAkMIS.js +0 -1
- package/dist/ui/assets/magick-wasm-BMFWa7e1.js +0 -1
- package/dist/ui/assets/magick-wasm-D4Na_fL8.js +0 -1
- package/dist/ui/assets/mime-types-4JXpZe6p.js +0 -1
- package/dist/ui/assets/mime-types-DL940yDZ.js +0 -1
- package/dist/ui/assets/mount-D4A-IhxD.js +0 -1
- package/dist/ui/assets/mount-DqMPMRkq.js +0 -2
- package/dist/ui/assets/mount-id-Ccy4_G8i.js +0 -1
- package/dist/ui/assets/mount-picker-popup-ys6_YNH0.js +0 -1
- package/dist/ui/assets/mount-table-store-BDnU4NqG.js +0 -1
- package/dist/ui/assets/oauth-bootstrap-gMsviobT.js +0 -1
- package/dist/ui/assets/oauth-service--O2P_cH3.js +0 -1
- package/dist/ui/assets/oauth-service-BXo87SGy.js +0 -1
- package/dist/ui/assets/offscreen-client-B70i1ydX.js +0 -1
- package/dist/ui/assets/onboarding-orchestrator-BDsGw7PC.js +0 -1
- package/dist/ui/assets/openai-CQMTwQw3.js +0 -16
- package/dist/ui/assets/openai-codex-responses-BH7I3fcD.js +0 -7
- package/dist/ui/assets/openai-codex-responses-Box9MCzN.js +0 -7
- package/dist/ui/assets/openai-completions-BnShqSeR.js +0 -5
- package/dist/ui/assets/openai-completions-DmV2esrh.js +0 -5
- package/dist/ui/assets/openai-responses-Cp1E557G.js +0 -1
- package/dist/ui/assets/openai-responses-DOCxF9QM.js +0 -1
- package/dist/ui/assets/panel-rpc-DMFq2vU_.js +0 -1
- package/dist/ui/assets/panel-rpc-handlers-D2yCpT8_.js +0 -1
- package/dist/ui/assets/panel-rpc-uLhnFoXD.js +0 -1
- package/dist/ui/assets/path-utils-C99GOg2c.js +0 -1
- package/dist/ui/assets/path-utils-CgbXfwyO.js +0 -1
- package/dist/ui/assets/preload-helper-ca-nBW7U.js +0 -1
- package/dist/ui/assets/provider-settings-B1ICPsZd.js +0 -63
- package/dist/ui/assets/provider-settings-Xmj6eRF8.js +0 -28
- package/dist/ui/assets/providers-DnwRSoOv.js +0 -1
- package/dist/ui/assets/pyodide-DOGWuEal.js +0 -3
- package/dist/ui/assets/pyodide-DhfjhWo1.js +0 -3
- package/dist/ui/assets/remote-cache-Cd8CL8Mo.js +0 -1
- package/dist/ui/assets/remote-terminal-view-BD1tHNzj.js +0 -6
- package/dist/ui/assets/sanitize-unicode-DFrWoF2t.js +0 -1
- package/dist/ui/assets/secret-env-LcaaxgBy.js +0 -1
- package/dist/ui/assets/shared-AafAvJaI.js +0 -1
- package/dist/ui/assets/simple-options-CVJdKrCb.js +0 -1
- package/dist/ui/assets/simple-options-D8vGmEnp.js +0 -1
- package/dist/ui/assets/slicc-editor-CFqadznu.js +0 -12
- package/dist/ui/assets/sprinkle-renderer-sJJO5bqF.js +0 -112
- package/dist/ui/assets/telemetry-D728iVf5.js +0 -1
- package/dist/ui/assets/tool-ui-D9h6SJkp.js +0 -1
- package/dist/ui/assets/tool-ui-DaAXBPJY.js +0 -1
- package/dist/ui/assets/tray-follower-status-hrOEFANe.js +0 -1
- package/dist/ui/assets/upgrade-detection-a__NoLEt.js +0 -1
- package/dist/ui/assets/xai-grok-DvJXZgXP.js +0 -1
- package/dist/ui/assets/xai-grok-cSrhflu0.js +0 -1
- /package/dist/ui/assets/{active-transport-DjJ32qlA.js → active-transport-CfU1UxY6.js} +0 -0
- /package/dist/ui/assets/{active-transport-lYMG0Gv5.js → active-transport-DeSPCdTV.js} +0 -0
- /package/dist/ui/assets/{addon-fit-CBYO9uVb.js → addon-fit-BDUxDgg1.js} +0 -0
- /package/dist/ui/assets/{addon-fit-CTgRqR5i.js → addon-fit-Dkm5m5XK.js} +0 -0
- /package/dist/ui/assets/{azure-ai-foundry-DtrzZiwo.js → azure-ai-foundry-1pnZpxAJ.js} +0 -0
- /package/dist/ui/assets/{azure-ai-foundry--QIByvkN.js → azure-ai-foundry-k_w7vD5C.js} +0 -0
- /package/dist/ui/assets/{chat-fixture-t_1Cmb9j.js → chat-fixture-BNN19l1e.js} +0 -0
- /package/dist/ui/assets/{dist-B-Md2rjs.js → dist-BNe7ZIzA.js} +0 -0
- /package/dist/ui/assets/{dist-BXMOjFxx.js → dist-BYoCEWmq.js} +0 -0
- /package/dist/ui/assets/{dist-CZgcx_4U.js → dist-BrjVVq8c.js} +0 -0
- /package/dist/ui/assets/{git-config-DIdLP3yo.js → git-config-DFJqG7AS.js} +0 -0
- /package/dist/ui/assets/{github-copilot-headers-BKQV7zrp.js → github-copilot-headers-CTUP_cqn.js} +0 -0
- /package/dist/ui/assets/{hash-K0cSe8jy.js → hash-B9Dtr1VK.js} +0 -0
- /package/dist/ui/assets/{hash-ekRFATsu.js → hash-C3GX0Zuo.js} +0 -0
- /package/dist/ui/assets/{headers-C4jF_HTA.js → headers-AeYLn7L4.js} +0 -0
- /package/dist/ui/assets/{lick-manager-proxy-D4WRd8z3.js → lick-manager-proxy-DfectiMI.js} +0 -0
- /package/dist/ui/assets/{openai-DxnCgV1v.js → openai-Bf1npfRy.js} +0 -0
- /package/dist/ui/assets/{page-storage-sync-M2qhyuvc.js → page-storage-sync-BxtXNbwY.js} +0 -0
- /package/dist/ui/assets/{pdfjs-Cesr9Csk.js → pdfjs-DDDkZHZ4.js} +0 -0
- /package/dist/ui/assets/{rum-C0g6MAOC.js → rum-wVO4iYd-.js} +0 -0
- /package/dist/ui/assets/{sanitize-unicode-BA6bNBBh.js → sanitize-unicode-h0KEBmEw.js} +0 -0
- /package/dist/ui/assets/{sprinkle-bridge-channel-B_tegUwc.js → sprinkle-bridge-channel-BBxRgvga.js} +0 -0
- /package/dist/ui/assets/{sprinkle-bridge-channel-C2blpBXT.js → sprinkle-bridge-channel-no1Jz9ii.js} +0 -0
- /package/dist/ui/assets/{sprinkle-proxy-CgcbIA81.js → sprinkle-proxy-rF3NSOGq.js} +0 -0
- /package/dist/ui/assets/{src-lJxZtwWF.js → src-BQRb5emh.js} +0 -0
- /package/dist/ui/assets/{xai-grok-errors-DGVLpB4k.js → xai-grok-errors-CGcnoVae.js} +0 -0
- /package/dist/ui/assets/{xai-grok-errors-B7OqxH_0.js → xai-grok-errors-WbFsMZum.js} +0 -0
- /package/dist/ui/assets/{xai-grok-models-DGbQVjGO.js → xai-grok-models-0q2zveAT.js} +0 -0
- /package/dist/ui/assets/{xai-grok-models-0CbvNCeN.js → xai-grok-models-cvcIXmNM.js} +0 -0
- /package/dist/ui/assets/{xterm-CguO-Jtb.js → xterm-D8ldLLKi.js} +0 -0
- /package/dist/ui/assets/{xterm-BcRgm-P0.js → xterm-DhusGoAm.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){let t={};for(let[n,r]of e.entries())t[n]=r;return t}export{e as t};
|