sliccy 2.53.0 → 2.54.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.
Files changed (87) hide show
  1. package/dist/ui/assets/{adobe-Ce4pGa6k.js → adobe-C4P2-kPA.js} +1 -1
  2. package/dist/ui/assets/{adobe-CpY266Zc.js → adobe-CZBWzRi3.js} +2 -2
  3. package/dist/ui/assets/{agent-bridge-DGLDgqPE.js → agent-bridge-DUBKRvg2.js} +1 -1
  4. package/dist/ui/assets/{agent-message-to-chat-ySHRDnOA.js → agent-message-to-chat-_ZvznEi6.js} +1 -1
  5. package/dist/ui/assets/{anthropic-CQXRZrKe.js → anthropic-B3g2jrQe.js} +1 -1
  6. package/dist/ui/assets/{azure-openai-7f0I1c2g.js → azure-openai-Cs9t6vRM.js} +1 -1
  7. package/dist/ui/assets/{azure-openai-CqN5Wyf8.js → azure-openai-YaBKY1Wr.js} +1 -1
  8. package/dist/ui/assets/{azure-openai-responses-B6VpI3fU.js → azure-openai-responses-BZMXkkMn.js} +1 -1
  9. package/dist/ui/assets/{backend-local-D-jeTNnr.js → backend-local-C97MTiUQ.js} +1 -1
  10. package/dist/ui/assets/{bedrock-camp-CqXHYC67.js → bedrock-camp-jigA67u0.js} +3 -3
  11. package/dist/ui/assets/{cdp-C1mctqQQ.js → cdp-CnxVFH0S.js} +3 -3
  12. package/dist/ui/assets/cost-command-DDsW42ku.js +1 -0
  13. package/dist/ui/assets/{dist-DGI-KRHb.js → dist-BETSJsV5.js} +1 -1
  14. package/dist/ui/assets/dist-BhoaJ6E3.js +43 -0
  15. package/dist/ui/assets/{dist-DTOmXa93.js → dist-C_pwrhfY.js} +1 -1
  16. package/dist/ui/assets/{dist-6maigE1F.js → dist-Ck3Vla0r.js} +1 -1
  17. package/dist/ui/assets/{dist-8qo5XTx8.js → dist-DB19jrs9.js} +1 -1
  18. package/dist/ui/assets/{es-CdoilK6E.js → es-BSQRfodq.js} +1 -1
  19. package/dist/ui/assets/follower-sprinkle-bridge-B8hu3_Tp.js +1 -0
  20. package/dist/ui/assets/{fs-BSEneDlc.js → fs-DHT3iarp.js} +3 -3
  21. package/dist/ui/assets/{fs-D0XzcKxU.js → fs-GZSurNkc.js} +1 -1
  22. package/dist/ui/assets/{github-DvH9BDfk.js → github-5BYmUUQ7.js} +2 -2
  23. package/dist/ui/assets/{github-ET50AuxZ.js → github-rG6MKLWd.js} +1 -1
  24. package/dist/ui/assets/{google-BszFYcuS.js → google-D5tttDSd.js} +1 -1
  25. package/dist/ui/assets/{google-shared-D_QrelB6.js → google-shared-az0i8UPc.js} +1 -1
  26. package/dist/ui/assets/{google-vertex-qkuMo_cz.js → google-vertex-DOtir00q.js} +1 -1
  27. package/dist/ui/assets/index-CWEy6UzW.js +1422 -0
  28. package/dist/ui/assets/{kernel-worker-UTlIe_KM.js → kernel-worker-Z5eEhzpl.js} +627 -619
  29. package/dist/ui/assets/{local-llm-BeFRU84A.js → local-llm-CchxbQRo.js} +1 -1
  30. package/dist/ui/assets/{local-llm-DnhS4Nc8.js → local-llm-DSF6fpSa.js} +1 -1
  31. package/dist/ui/assets/magick-wasm-CPN3NKqF.js +1 -0
  32. package/dist/ui/assets/{mistral-7vMFlwyv.js → mistral-BV0eFkMp.js} +1 -1
  33. package/dist/ui/assets/{mount-BRCe8J-8.js → mount-CcA_qcZO.js} +1 -1
  34. package/dist/ui/assets/{mount-vDUPSYAA.js → mount-CiJ9lD8n.js} +2 -2
  35. package/dist/ui/assets/{nuke-command-BvSSDKyh.js → nuke-command-d6pdX9by.js} +1 -1
  36. package/dist/ui/assets/{oauth-bootstrap-qeeH1muA.js → oauth-bootstrap-DFY31n07.js} +1 -1
  37. package/dist/ui/assets/{oauth-service-CP7_knvf.js → oauth-service-CBV0hFPx.js} +1 -1
  38. package/dist/ui/assets/{oauth-service-sgmdLPuV.js → oauth-service-DwTzeJ6J.js} +1 -1
  39. package/dist/ui/assets/{offscreen-client-BPqEe2hm.js → offscreen-client-OrnbzVF2.js} +1 -1
  40. package/dist/ui/assets/{onboarding-orchestrator-BWrouEJg.js → onboarding-orchestrator-eTecv_Fr.js} +1 -1
  41. package/dist/ui/assets/{openai-codex-responses-DW3ZYFcb.js → openai-codex-responses-DXb3k86e.js} +1 -1
  42. package/dist/ui/assets/{openai-completions-D5rB4vsV.js → openai-completions-BXuJR1eK.js} +1 -1
  43. package/dist/ui/assets/{openai-responses-CF3yEStf.js → openai-responses-Bjk0FI2e.js} +1 -1
  44. package/dist/ui/assets/{openai-responses-shared-vokXRwgV.js → openai-responses-shared-CYpbeIvb.js} +1 -1
  45. package/dist/ui/assets/{provider-settings-CNtqy5Bx.js → provider-settings-CXdvFG7R.js} +1 -1
  46. package/dist/ui/assets/provider-settings-eR4hZJ2w.js +28 -0
  47. package/dist/ui/assets/{providers-CR2KVBJC.js → providers-DpVMtzoJ.js} +1 -1
  48. package/dist/ui/assets/{remote-terminal-view-DKpFrNt5.js → remote-terminal-view-mqv_gQku.js} +3 -3
  49. package/dist/ui/assets/shared-Bzh87vAD.js +1 -0
  50. package/dist/ui/assets/{slicc-editor-DfIx330Y.js → slicc-editor-QB-g14AA.js} +2 -2
  51. package/dist/ui/assets/{spawn-koTNaVLy.js → spawn-DSTCmhFE.js} +1 -1
  52. package/dist/ui/assets/sprinkle-renderer-KJJoM4E0.js +112 -0
  53. package/dist/ui/assets/{telemetry-BHB_tqYb.js → telemetry-qzXntW4J.js} +1 -1
  54. package/dist/ui/assets/{upgrade-detection-eWV10cS4.js → upgrade-detection-D6u0kID4.js} +1 -1
  55. package/dist/ui/electron-overlay-entry.js +7 -7
  56. package/dist/ui/index.html +16 -14
  57. package/dist/ui/packages/webapp/index.html +16 -14
  58. package/package.json +1 -1
  59. package/dist/ui/assets/cost-command-De1m63Hp.js +0 -1
  60. package/dist/ui/assets/index-ZLv5StNy.js +0 -1532
  61. package/dist/ui/assets/magick-wasm-BCZpZeyl.js +0 -1
  62. package/dist/ui/assets/provider-settings-BHwoEn-1.js +0 -28
  63. /package/dist/ui/assets/{addon-fit-CVV7fTw9.js → addon-fit-CJBYijzN.js} +0 -0
  64. /package/dist/ui/assets/{azure-ai-foundry-rmhg6ipI.js → azure-ai-foundry-c-8tCxDt.js} +0 -0
  65. /package/dist/ui/assets/{chat-fixture-B4ajo0MH.js → chat-fixture-Hp7QoBPd.js} +0 -0
  66. /package/dist/ui/assets/{diagnostics-DEZCW87A.js → diagnostics-Bab61WyO.js} +0 -0
  67. /package/dist/ui/assets/{dist-BzFg7Vf5.js → dist-uJp2dR6X.js} +0 -0
  68. /package/dist/ui/assets/{env-api-keys-DxKb6C4Q.js → env-api-keys-BoL4zxcb.js} +0 -0
  69. /package/dist/ui/assets/{git-config-BCAVbrIP.js → git-config-DrjQgeV7.js} +0 -0
  70. /package/dist/ui/assets/{github-copilot-headers-B6Fvsk-Y.js → github-copilot-headers-DCDy_wqp.js} +0 -0
  71. /package/dist/ui/assets/{hash-CQjDwcjR.js → hash-K0cSe8jy.js} +0 -0
  72. /package/dist/ui/assets/{headers-DkHU-pcw.js → headers-Dr-OH1-5.js} +0 -0
  73. /package/dist/ui/assets/{json-parse-C5jSA6JB.js → json-parse-Cu2r6BfV.js} +0 -0
  74. /package/dist/ui/assets/{mount-picker-popup-DJJfRF_c.js → mount-picker-popup-ys6_YNH0.js} +0 -0
  75. /package/dist/ui/assets/{openai-CRGaNv9i.js → openai-C-uvPKpB.js} +0 -0
  76. /package/dist/ui/assets/{page-storage-sync-B_kI_rjd.js → page-storage-sync-CCCwfs1s.js} +0 -0
  77. /package/dist/ui/assets/{panel-rpc-handlers-D6u8EbY-.js → panel-rpc-handlers-DSdIUEco.js} +0 -0
  78. /package/dist/ui/assets/{path-utils-d3qOVZOu.js → path-utils-mhPGPhd8.js} +0 -0
  79. /package/dist/ui/assets/{rum-DP66esB2.js → rum-fanUFgbu.js} +0 -0
  80. /package/dist/ui/assets/{sanitize-unicode-BD2XKRoV.js → sanitize-unicode-Dw-JFaZE.js} +0 -0
  81. /package/dist/ui/assets/{secret-env-BN6ZnD74.js → secret-env-DTcVaCe1.js} +0 -0
  82. /package/dist/ui/assets/{simple-options-imi_RHvn.js → simple-options-D8vGmEnp.js} +0 -0
  83. /package/dist/ui/assets/{sprinkle-bridge-channel-BJWN_rO5.js → sprinkle-bridge-channel-Cj_CAZH2.js} +0 -0
  84. /package/dist/ui/assets/{src-BcpYRmFj.js → src-CpO2JX79.js} +0 -0
  85. /package/dist/ui/assets/{tool-ui-B3Bihlxa.js → tool-ui-DaAXBPJY.js} +0 -0
  86. /package/dist/ui/assets/{tray-follower-status-DKq8RTLd.js → tray-follower-status-hrOEFANe.js} +0 -0
  87. /package/dist/ui/assets/{xterm-ucbPh68r.js → xterm-DHgoOdoP.js} +0 -0
@@ -1 +1 @@
1
- import{a as e,c as t,n,s as r}from"./simple-options-imi_RHvn.js";import{t as i}from"./sanitize-unicode-BD2XKRoV.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_QrelB6.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
+ import{a as e,c as t,n,s as r}from"./simple-options-D8vGmEnp.js";import{t as i}from"./sanitize-unicode-Dw-JFaZE.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-az0i8UPc.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};